:root,
[data-theme="dark"] {
  --bg: #111111;
  --surface: #171717;
  --surface-2: #1f1f1f;
  --border: #2f2f2f;
  --text: #f0f0f0;
  --text-muted: #949494;
  --primary: #f97316;
  --primary-soft: rgba(249, 115, 22, 0.12);
  --success: #22c55e;
  --error: #ef4444;
}

[data-theme="light"] {
  --bg: #f8f8f8;
  --surface: #ffffff;
  --surface-2: #f0f0f0;
  --border: #d6d6d6;
  --text: #101010;
  --text-muted: #5f5f5f;
  --primary: #ea580c;
  --primary-soft: rgba(234, 88, 12, 0.1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  font-family: "Satoshi", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.03) 0, transparent 24%),
    radial-gradient(circle at 76% 74%, rgba(255, 255, 255, 0.02) 0, transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.015) 0, transparent 30%),
    var(--bg);
  color: var(--text);
}

body {
  position: relative;
  overflow-x: hidden;
}

body::before {
  background:
    radial-gradient(circle at 14% 22%, rgba(255, 255, 255, 0.016) 0 12%, transparent 46%),
    radial-gradient(circle at 78% 30%, rgba(255, 255, 255, 0.012) 0 10%, transparent 42%),
    radial-gradient(circle at 36% 76%, rgba(255, 255, 255, 0.012) 0 9%, transparent 40%);
  animation: bgDriftA 26s ease-in-out infinite alternate;
}

body::after {
  background:
    radial-gradient(circle at 84% 74%, rgba(255, 255, 255, 0.012) 0 9%, transparent 40%),
    radial-gradient(circle at 24% 52%, rgba(255, 255, 255, 0.01) 0 8%, transparent 36%),
    radial-gradient(circle at 60% 16%, rgba(255, 255, 255, 0.01) 0 8%, transparent 36%);
  animation: bgDriftB 34s ease-in-out infinite alternate;
}

@keyframes bgDriftA {
  0% { transform: translate3d(-1%, -1%, 0) scale(1); }
  100% { transform: translate3d(1.2%, 1.5%, 0) scale(1.03); }
}

@keyframes bgDriftB {
  0% { transform: translate3d(1%, -0.8%, 0) scale(1); }
  100% { transform: translate3d(-1.1%, 1.2%, 0) scale(1.025); }
}

@keyframes bgDriftC {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-1.1%, 0.8%, 0) scale(1.015); }
  100% { transform: translate3d(1%, -0.7%, 0) scale(1.03); }
}

@keyframes starFloat {
  0% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-1.4%, 1.1%, 0); }
  100% { transform: translate3d(1.1%, -1%, 0); }
}

@keyframes starTwinkle {
  0% { opacity: 0.22; }
  100% { opacity: 0.34; }
}

a {
  color: inherit;
  text-decoration: none;
}

#app {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

#app::before {
  display: none;
}

#app::after {
  display: none;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 20px;
  height: 56px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

header {
  display: none;
}

.logo {
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  color: var(--primary);
}

.header-actions {
  display: flex;
  gap: 10px;
}

.icon-btn,
.btn {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  border-radius: 10px;
  cursor: pointer;
}

.icon-btn {
  width: 36px;
  height: 36px;
  font-size: 17px;
}

.btn {
  padding: 10px 14px;
  font-size: 13px;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.layout {
  display: flex;
  flex: 1;
  min-height: 100vh;
}

sidebar {
  width: 220px;
  min-width: 220px;
  border-right: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(249, 115, 22, 0.06), transparent 26%),
    var(--surface);
  padding: 56px 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: width 220ms ease, min-width 220ms ease, padding 220ms ease, opacity 180ms ease, border-color 220ms ease;
}

#sidebar-toggle {
  position: fixed;
  top: 12px;
  left: 14px;
  z-index: 50;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: rgba(23, 23, 23, 0.92);
  border-color: rgba(249, 115, 22, 0.38);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

#sidebar-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(249, 115, 22, 0.66);
  background: rgba(31, 31, 31, 0.98);
}

#sidebar-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 180ms ease;
}

body.sidebar-collapsed #sidebar-toggle svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed sidebar {
  width: 0;
  min-width: 0;
  padding-left: 0;
  padding-right: 0;
  border-right-color: transparent;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

.nav-link {
  position: relative;
  display: block;
  padding: 11px 12px 11px 14px;
  border-radius: 11px;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: color 170ms ease, background-color 170ms ease, border-color 170ms ease, transform 170ms ease;
}

.nav-link:hover {
  background: rgba(249, 115, 22, 0.07);
  border-color: rgba(249, 115, 22, 0.24);
  color: var(--text);
  transform: translateX(2px);
}

.nav-link.active {
  background: linear-gradient(90deg, rgba(249, 115, 22, 0.2), rgba(249, 115, 22, 0.06));
  color: var(--primary);
  border-color: rgba(249, 115, 22, 0.52);
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(249, 115, 22, 0.12) inset;
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 4px;
  height: 18px;
  border-radius: 999px;
  background: var(--primary);
  transform: translateY(-50%);
}

main {
  flex: 1;
  padding: 24px;
}

.home-main {
  display: grid;
  gap: 20px;
  padding-top: 34px;
}

.home-hero {
  position: relative;
  overflow: hidden;
  min-height: 200px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 82% 18%, rgba(249, 115, 22, 0.24), transparent 34%),
    radial-gradient(circle at 12% 86%, rgba(34, 197, 94, 0.09), transparent 36%),
    radial-gradient(circle at 48% 50%, rgba(245, 158, 11, 0.08), transparent 52%),
    linear-gradient(155deg, rgba(255, 255, 255, 0.02), transparent 52%),
    var(--surface);
}

  .home-hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 14px;
    text-align: center;
    max-width: 720px;
  }

.home-title {
  margin: 0;
  text-align: center;
  font-size: clamp(34px, 6.2vw, 62px);
  line-height: 1.04;
  letter-spacing: 0.02em;
  font-family: "JetBrains Mono", monospace;
  text-transform: uppercase;
  background: linear-gradient(95deg, #f59e0b 0%, #fb923c 45%, #facc15 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 34px rgba(249, 115, 22, 0.2);
}

[data-theme="light"] .home-title {
  background: linear-gradient(95deg, #b45309 0%, #ea580c 50%, #ca8a04 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .home-title {
  background: linear-gradient(95deg, #f59e0b 0%, #fb923c 45%, #facc15 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.home-hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 26px;
  width: min(320px, 64%);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(249, 115, 22, 0.65), transparent);
  transform: translateX(-50%);
  opacity: 0.9;
}

.home-hero::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(600px, 88%);
  height: min(600px, 88%);
  border-radius: 50%;
  border: 1px solid rgba(249, 115, 22, 0.14);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0.45;
}

.home-title {
  font-family: "JetBrains Mono", monospace;
}

.home-hero-copy {
  margin: 0;
  max-width: 46ch;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.home-cta {
  position: relative;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.55);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.96), rgba(234, 88, 12, 0.96));
  color: #fff;
  font-family: "JetBrains Mono", monospace;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 14px 32px rgba(249, 115, 22, 0.26);
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.home-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px rgba(249, 115, 22, 0.3);
  filter: brightness(1.03);
}

.home-cta:active {
  transform: translateY(0);
}

.page-title {
  margin: 0 0 20px;
  font-family: "JetBrains Mono", monospace;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.kpi {
  display: none;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
}

a.card {
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 220ms ease, background-color 220ms ease;
}

a.card:hover {
  transform: translateY(-3px);
  border-color: rgba(249, 115, 22, 0.55);
  background-color: rgba(249, 115, 22, 0.06);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), 0 0 0 1px rgba(249, 115, 22, 0.18) inset;
}

a.card:active {
  transform: translateY(-1px);
}

.kpi-label {
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.kpi-value {
  font-size: 30px;
  font-family: "JetBrains Mono", monospace;
  color: var(--primary);
}

.runner-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 14px;
}

.list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  cursor: pointer;
  color: var(--text-muted);
  background: var(--surface-2);
}

.item.active {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-soft);
}

.terminal {
  min-height: 260px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b0b0b;
  color: #e7e7e7;
  font-family: "Fira Code", monospace;
  white-space: pre-wrap;
  padding: 12px;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

textarea,
select,
input[type="range"] {
  width: 100%;
}

textarea {
  min-height: 360px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0b0b0b;
  color: #e7e7e7;
  font-family: "Fira Code", monospace;
  padding: 12px;
  font-size: 13px;
}

label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.setting-row {
  margin-bottom: 18px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary);
  border-radius: 9px;
  padding: 10px 14px;
  background: var(--surface);
  display: none;
}

.toast.show {
  display: block;
}

body.wiki-spoiler-active {
  overflow: hidden;
}

body.wiki-spoiler-active #app {
  filter: blur(9px) brightness(0.68);
  pointer-events: none;
  user-select: none;
}

.wiki-spoiler-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(8, 8, 8, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.wiki-spoiler-card {
  width: min(620px, 100%);
  border: 1px solid rgba(249, 115, 22, 0.32);
  border-radius: 18px;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 18%, rgba(249, 115, 22, 0.12), transparent 28%),
    radial-gradient(circle at 80% 85%, rgba(34, 197, 94, 0.08), transparent 28%),
    var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
}

.wiki-spoiler-kicker {
  display: inline-block;
  margin-bottom: 10px;
  color: #f59e0b;
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wiki-spoiler-card h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.08;
}

.wiki-spoiler-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
  font-size: 14px;
}

.wiki-spoiler-optout {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}

.wiki-spoiler-optout input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: #f97316;
}

.wiki-spoiler-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.wiki-spoiler-actions .btn {
  min-width: 180px;
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  sidebar {
    width: 100%;
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-direction: row;
    overflow-x: auto;
    padding: 48px 10px 10px;
  }

  body.sidebar-collapsed sidebar {
    width: 100%;
    min-width: 0;
    height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-color: transparent;
    overflow: hidden;
  }

  .nav-link {
    white-space: nowrap;
    transform: none;
  }

  .runner-layout {
    grid-template-columns: 1fr;
  }

  .home-hero {
    padding: 26px 16px 34px;
    min-height: 0;
  }

  .home-main {
    padding-top: 58px;
  }


  .home-hero-content {
    gap: 12px;
  }

  .home-hero-copy {
    font-size: 13px;
  }

  .home-cta {
    padding: 13px 20px;
  }
  .home-title {
    font-size: clamp(30px, 9vw, 44px);
    line-height: 1.15;
  }
}
