:root {
  --bg: #041029;
  --bg-deep: #020714;
  --panel: rgba(7, 21, 52, 0.88);
  --panel-soft: rgba(17, 47, 109, 0.76);
  --panel-strong: rgba(24, 63, 145, 0.92);
  --line: rgba(182, 212, 255, 0.16);
  --text: #eef4ff;
  --muted: #b3c6e8;
  --gold: #f3c555;
  --gold-soft: #ffe7a6;
  --blue: #1f55d9;
  --blue-soft: #75d0ff;
  --good: #8ff0b1;
  --bad: #ff8e9d;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.34);
  --display: Baskerville, "Times New Roman", Georgia, serif;
  --ui: "Trebuchet MS", "Segoe UI", sans-serif;
  --radius: 28px;
  --page: 1280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ui);
  color: var(--text);
  background:
    radial-gradient(circle at 14% 10%, rgba(117, 208, 255, 0.14), transparent 18%),
    radial-gradient(circle at 86% 9%, rgba(243, 197, 85, 0.14), transparent 18%),
    radial-gradient(circle at 50% 100%, rgba(31, 85, 217, 0.30), transparent 34%),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0) 18%),
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.018) 0 1px, transparent 1px 4px);
  opacity: 0.34;
  mix-blend-mode: screen;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

img {
  max-width: 100%;
  display: block;
}

.site-shell {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 80;
  backdrop-filter: blur(16px);
  background: linear-gradient(180deg, rgba(2, 8, 24, 0.90), rgba(2, 8, 24, 0.62));
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--gold-soft);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 900;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #19274e;
  box-shadow: var(--shadow);
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-copy strong {
  font-size: 0.98rem;
}

.brand-copy span {
  font-size: 0.72rem;
  color: var(--blue-soft);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.nav-link,
.btn,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 800;
  background: linear-gradient(180deg, rgba(19, 49, 116, 0.94), rgba(7, 21, 52, 0.98));
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, filter 0.18s ease, background 0.18s ease;
}

.btn {
  border-radius: 12px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.46;
  filter: saturate(0.25);
  transform: none;
}

.btn:disabled:hover {
  transform: none;
  filter: saturate(0.25);
}

.nav-link:hover,
.btn:hover,
.chip:hover,
.card:hover,
.timeline-item:hover,
.metric:hover {
  transform: translateY(-2px);
  filter: brightness(1.04);
}

.nav-link.is-active,
.btn.primary,
.btn.is-active {
  color: #182649;
  font-weight: 900;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  border-color: rgba(255, 231, 166, 0.44);
}

.page {
  max-width: var(--page);
  margin: 0 auto;
  padding: 18px 22px 42px;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 30px;
  border-radius: 34px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 84% 20%, rgba(255, 255, 255, 0.06), transparent 18%),
    linear-gradient(124deg, rgba(24, 63, 145, 0.94), rgba(8, 23, 55, 0.96) 46%, rgba(2, 10, 26, 0.98));
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -42% -10%;
  height: 250px;
  background: radial-gradient(circle, rgba(243, 197, 85, 0.16), transparent 62%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 22px;
  align-items: center;
}

.hero-grid > :first-child {
  max-width: 660px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(243, 197, 85, 0.12);
  border: 1px solid rgba(255, 231, 166, 0.28);
  color: var(--gold-soft);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 900;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.hero-title {
  margin-top: 12px;
  font-family: var(--display);
  font-size: clamp(2.75rem, 4.7vw, 4.7rem);
  line-height: 0.94;
  letter-spacing: -0.05em;
  color: var(--gold-soft);
}

.hero-copy {
  margin-top: 14px;
  max-width: 46ch;
  color: var(--muted);
  line-height: 1.7;
  font-size: 1.02rem;
}

.hero-actions,
.chip-row,
.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 18px;
}

.chip {
  min-height: 0;
  padding: 8px 12px;
  box-shadow: none;
  background: rgba(255, 255, 255, 0.05);
}

.hero-panel,
.section,
.card,
.timeline-item,
.metric,
.note-panel {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-soft), var(--panel));
  box-shadow: var(--shadow);
}

.hero-panel,
.section,
.card,
.note-panel {
  padding: 20px;
}

.hero-panel-title,
.section-kicker,
.card-kicker {
  color: var(--blue-soft);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 18px;
}

.hero-panel-status {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.93rem;
  line-height: 1.4;
}

.hero-stats,
.stat-grid,
.card-grid,
.split-grid,
.metric-grid,
.legend-grid,
.insight-grid,
.heatmap {
  display: grid;
  gap: 16px;
}

.hero-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.stat,
.metric {
  padding: 16px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(4, 14, 37, 0.42);
}

.stat-spotlight .stat-value {
  font-size: 1.5rem;
  line-height: 1.1;
}

.stat-label,
.metric-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.stat-value,
.metric-value {
  margin-top: 6px;
  font-size: 1.18rem;
  font-weight: 900;
  color: var(--text);
}

.hero-panel-note {
  margin-top: 14px;
  padding: 14px 16px 16px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(4, 14, 37, 0.42);
  color: var(--text);
  line-height: 1.55;
}

.hero-panel-note-kicker {
  color: var(--blue-soft);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-panel-note-title {
  margin-top: 8px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 900;
  line-height: 1.35;
}

.hero-panel-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.hero-fact {
  display: inline-flex;
  align-items: center;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 800;
  line-height: 1;
}

.hero-panel-note-copy {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.hero-panel-foot {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.hero-panel-link {
  color: var(--muted);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  font-size: 0.9rem;
}

.hero-panel-link:hover,
.hero-panel-link:focus-visible {
  color: var(--gold-soft);
  text-decoration: underline;
}

.section-stack {
  display: grid;
  gap: 16px;
  margin-top: 14px;
}

.section-title {
  margin-top: 10px;
  font-family: var(--display);
  font-size: clamp(2rem, 3vw, 3.2rem);
  letter-spacing: -0.04em;
  color: var(--gold-soft);
}

.section-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.62;
}

.card-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.split-grid {
  grid-template-columns: 1.4fr 0.9fr;
}

.card-title {
  margin-top: 12px;
  font-family: var(--display);
  font-size: 1.6rem;
  letter-spacing: -0.03em;
  color: var(--gold-soft);
}

.card-copy,
.card ul,
.timeline-copy,
.list-copy {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.58;
}

.card ul,
.clean-list,
.timeline {
  padding: 0;
  margin: 16px 0 0;
  list-style: none;
}

.clean-list {
  display: grid;
  gap: 12px;
}

.clean-list li,
.list-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 14, 37, 0.36);
  color: var(--muted);
  line-height: 1.52;
}

.clean-list strong,
.list-item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
}

.timeline {
  display: grid;
  gap: 12px;
}

.timeline-item {
  padding: 18px 20px;
  background: linear-gradient(180deg, rgba(17, 47, 109, 0.88), rgba(7, 21, 52, 0.96));
}

.timeline-year {
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.timeline-title {
  margin-top: 6px;
  font-size: 1.08rem;
  font-weight: 900;
}

.timeline-copy {
  margin-top: 8px;
}

.quote-wall {
  display: grid;
  gap: 12px;
}

.quote {
  padding: 18px 20px;
  border-left: 4px solid var(--gold);
  border-radius: 20px;
  background: rgba(4, 14, 37, 0.40);
  color: var(--text);
  line-height: 1.56;
}

.quote span {
  display: block;
  margin-top: 10px;
  color: var(--blue-soft);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-footer {
  margin-top: 22px;
  max-width: 980px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.page-footer a {
  color: var(--gold-soft);
}

[data-reveal] {
  opacity: 1;
  transform: translateY(0);
}

[data-reveal].reveal-item {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].reveal-item.in-view {
  opacity: 1;
  transform: translateY(0);
}

.studio-layout {
  display: grid;
  grid-template-columns: 1.4fr 0.92fr;
  gap: 18px;
  margin-top: 18px;
}

.board-controls {
  display: grid;
  gap: 14px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 900;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.field select,
.field input,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(4, 14, 37, 0.60);
  color: var(--text);
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.score-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(4, 14, 37, 0.40);
}

.score-card .label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.score-card .value {
  margin-top: 6px;
  font-size: 1.16rem;
  font-weight: 900;
}

.board-stage {
  margin-top: 18px;
  padding: 14px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(8, 21, 52, 0.86), rgba(2, 10, 26, 0.96));
}

.board-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 0 6px 14px;
}

.board-banner strong {
  color: var(--gold-soft);
  font-size: 1.15rem;
}

.board-banner span {
  color: var(--muted);
}

.board {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.board button {
  cursor: pointer;
}

.category-cell,
.clue-cell {
  min-height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 -10px 24px rgba(0, 0, 0, 0.25);
}

.category-cell {
  padding: 14px;
  background: linear-gradient(180deg, #2a67e8, #163f96);
  color: #f5fbff;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.88rem;
  font-weight: 900;
  line-height: 1.2;
}

.clue-cell {
  position: relative;
  background: linear-gradient(180deg, #1440a2, #0b2b6f);
  color: var(--gold-soft);
  font-size: clamp(1.25rem, 2vw, 2rem);
  font-weight: 900;
  transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.clue-cell:hover:not(.used) {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.clue-cell.used {
  opacity: 0.22;
  cursor: default;
}

.sidebar-stack,
.log,
.heatmap {
  display: grid;
  gap: 14px;
}

.log {
  max-height: 340px;
  overflow: auto;
}

.log-item,
.heat-card {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(4, 14, 37, 0.40);
}

.log-item strong,
.heat-card strong {
  color: var(--text);
}

.log-item.good {
  border-color: rgba(143, 240, 177, 0.24);
}

.log-item.bad {
  border-color: rgba(255, 142, 157, 0.24);
}

.bar {
  height: 10px;
  margin-top: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gold), var(--blue-soft));
}

.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(2, 7, 20, 0.78);
  backdrop-filter: blur(10px);
}

.modal-wrap.show {
  display: flex;
}

.modal {
  width: min(880px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 24px;
  border-radius: 28px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(24, 63, 145, 0.95), rgba(7, 21, 52, 0.98));
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.modal-title {
  margin-top: 8px;
  font-family: var(--display);
  font-size: 2rem;
  letter-spacing: -0.04em;
  color: var(--gold-soft);
}

.modal-copy {
  margin-top: 18px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(4, 14, 37, 0.42);
  color: var(--text);
  font-size: 1.08rem;
  line-height: 1.58;
}

.answer-box {
  display: none;
  margin-top: 16px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(243, 197, 85, 0.12);
  border: 1px solid rgba(255, 231, 166, 0.22);
}

.answer-box.show {
  display: block;
}

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

.modal-actions .btn {
  min-height: 42px;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 140;
  display: none;
  padding: 13px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(6, 18, 46, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
}

.toast.show {
  display: block;
}

.tiny {
  font-size: 0.88rem;
}

.muted {
  color: var(--muted);
}

.gold {
  color: var(--gold-soft);
}

.center {
  text-align: center;
}

@keyframes glow-pan {
  0% {
    transform: translateX(-2%);
  }
  50% {
    transform: translateX(2%);
  }
  100% {
    transform: translateX(-2%);
  }
}

.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.04), transparent 60%);
  opacity: 0.8;
  animation: glow-pan 12s ease-in-out infinite;
  pointer-events: none;
}

@media (max-width: 1180px) {
  .hero-grid,
  .split-grid,
  .studio-layout,
  .card-grid.three,
  .card-grid.two {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .page {
    padding: 18px 14px 34px;
  }

  .topbar-inner {
    padding: 10px 14px;
  }

  .hero,
  .hero-panel,
  .section,
  .card,
  .note-panel,
  .modal {
    padding: 18px;
  }

  .hero-actions,
  .metric-row,
  .modal-actions {
    flex-direction: column;
  }

  .btn,
  .nav-link {
    width: 100%;
  }

  .hero-panel-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-panel-foot {
    justify-content: flex-start;
  }

  .hero-stats,
  .score-grid,
  .board,
  .control-grid {
    grid-template-columns: 1fr;
  }

  .category-cell,
  .clue-cell {
    min-height: 82px;
  }
}

.skip-link { position: fixed; top: -100px; left: 12px; z-index: 1000; background: #ffe18a; color: #071b42; padding: 12px 18px; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid #ffe18a; outline-offset: 4px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.wager-form { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin: 20px 0; }
.wager-results { line-height: 1.7; border-left: 3px solid var(--gold); padding: 12px 20px; background: #081b3a; }
.verified-date { margin: 12px 0; color: var(--muted); font-size: .85rem; }
@media (max-width: 700px) { .nav-links { gap: 6px; } .nav-link { width: auto; padding: 8px 12px; } .wager-form { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } .reveal-item { opacity: 1; transform: none; } }
