:root {
  --bg: #070a0f;
  --bg-elev: #0d131d;
  --bg-panel: #111927;
  --bg-inset: #05080d;
  --line: #1e293b;
  --line-bright: #334155;
  --ink: #eef2f6;
  --ink-muted: #94a3b8;
  --ink-dim: #64748b;
  --amber: #f59e0b;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --amber-glow: rgba(245, 158, 11, 0.35);
  --red: #ef4444;
  --red-soft: rgba(239, 68, 68, 0.16);
  --green: #34d399;
  --green-soft: rgba(52, 211, 153, 0.14);
  --cyan: #38bdf8;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
  --sans: 'Space Grotesk', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius: 12px;
  --maxw: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--sans);
  background:
    radial-gradient(1000px 420px at 82% -8%, rgba(245, 158, 11, 0.11), transparent 60%),
    radial-gradient(800px 380px at 12% 0%, rgba(239, 68, 68, 0.08), transparent 55%),
    var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { width: min(var(--maxw), calc(100% - 28px)); margin: 0 auto; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(7, 10, 15, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 8px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0.03em;
  text-decoration: none;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 10px var(--red);
  animation: recPulse 1.6s infinite;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}
.brand-sub {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 2px 7px;
  border-radius: 999px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.nav a:hover, .nav a.active {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.06);
  text-decoration: none;
}
.nav a.active { color: var(--amber); }

/* Hero */
.hero {
  padding: 22px 0 14px;
}
.eyebrow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-bright);
  background: var(--bg-elev);
  color: var(--ink-muted);
}
.pill-red { border-color: rgba(239, 68, 68, 0.45); background: var(--red-soft); color: #fca5a5; }
.pill-amber { border-color: rgba(245, 158, 11, 0.45); background: var(--amber-soft); color: #fcd34d; }
.pill-green { border-color: rgba(52, 211, 153, 0.4); background: var(--green-soft); color: #6ee7b7; }

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.02em;
}
.hero-lead {
  margin: 0 0 16px;
  color: var(--ink-muted);
  max-width: 780px;
  font-size: clamp(14.5px, 1.5vw, 16.5px);
}
.hero-lead strong { color: var(--ink); }

/* Workspace Mode Switcher */
.mode-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  border-radius: 10px;
  border: 1px solid var(--line-bright);
  background: var(--bg-elev);
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}
.mode-tab:hover { border-color: var(--amber); color: var(--ink); }
.mode-tab[aria-selected="true"] {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.22), rgba(239, 68, 68, 0.14));
  border-color: var(--amber);
  color: #fff;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
}
.mode-tab .tab-tag {
  font-family: var(--mono);
  font-size: 10.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--amber);
}

/* Console Shell */
.console-shell {
  background: var(--bg-elev);
  border: 1px solid var(--line-bright);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}
.console-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 14px;
  background: #0a0f17;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  flex-wrap: wrap;
}
.console-bar-left { display: flex; align-items: center; gap: 10px; }
.console-lights { display: inline-flex; gap: 5px; }
.console-lights span { width: 8px; height: 8px; border-radius: 50%; background: #334155; }
.console-lights span:nth-child(1) { background: var(--red); }
.console-lights span:nth-child(2) { background: var(--amber); }
.console-lights span:nth-child(3) { background: var(--green); }

.mode-panel[hidden] { display: none !important; }
.panel-pad { padding: 16px; }

/* Game Layout */
.game-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 16px;
  align-items: start;
}
.crt-frame {
  position: relative;
  background: #020408;
  border: 1px solid #263246;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  width: 100%;
  touch-action: none;
  user-select: none;
}
.crt-frame canvas {
  display: block;
  width: 100%;
  height: 100%;
}
.crt-scanlines {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.025) 0px,
    rgba(255, 255, 255, 0.025) 1px,
    transparent 2px,
    transparent 4px
  );
}
.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  background: radial-gradient(circle at center, rgba(7, 10, 15, 0.84), rgba(3, 5, 10, 0.94));
  z-index: 5;
}
.game-overlay[hidden] { display: none; }
.game-overlay h2 {
  margin: 0 0 6px;
  font-size: clamp(20px, 2.8vw, 30px);
  color: #fff;
  letter-spacing: 0.02em;
}
.game-overlay p {
  margin: 0 0 14px;
  color: var(--ink-muted);
  max-width: 480px;
  font-size: 13.5px;
}

.role-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: min(520px, 100%);
  margin-bottom: 14px;
}
.role-btn {
  padding: 9px 8px;
  border-radius: 10px;
  border: 1px solid var(--line-bright);
  background: rgba(15, 23, 42, 0.85);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.role-btn strong { display: block; font-size: 13px; color: #fff; }
.role-btn span { display: block; font-size: 11px; color: var(--ink-muted); margin-top: 2px; }
.role-btn.selected, .role-btn:hover {
  border-color: var(--amber);
  background: rgba(245, 158, 11, 0.14);
}

.comms-strip {
  margin-top: 10px;
  padding: 9px 12px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 40px;
}
.comms-strip .comms-ts { color: var(--amber); margin-right: 6px; }

.game-sidebar {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.hud-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}
.hud-card h3 {
  margin: 0 0 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.stat-box {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
}
.stat-box .k { display: block; font-family: var(--mono); font-size: 10px; color: var(--ink-dim); text-transform: uppercase; }
.stat-box .v { display: block; font-family: var(--mono); font-size: 16px; font-weight: 800; color: #fff; margin-top: 2px; }
.controls-list {
  margin: 0;
  padding-left: 16px;
  font-size: 12.5px;
  color: var(--ink-muted);
}
.controls-list li { margin-bottom: 4px; }
.controls-list strong { color: var(--ink); }

.mobile-actions {
  display: none;
  gap: 8px;
  margin-top: 8px;
}

/* Studio / Generator Grids */
.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 16px;
  align-items: start;
}
.field-group { margin-bottom: 12px; }
.field-group label {
  display: block;
  font-family: var(--mono);
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin-bottom: 5px;
}
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
input[type="text"], input[type="file"], select, textarea {
  width: 100%;
  background: var(--bg-inset);
  color: var(--ink);
  border: 1px solid var(--line-bright);
  border-radius: 9px;
  padding: 9px 11px;
  font-family: var(--sans);
  font-size: 13.5px;
}
textarea { font-family: var(--mono); font-size: 12.5px; line-height: 1.45; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.preview-stage {
  background: #03050a;
  border: 1px solid var(--line-bright);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.preview-stage canvas {
  max-width: 100%;
  max-height: 440px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid #243044;
  background: #000;
}

/* Buttons */
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 15px;
  border-radius: 9px;
  border: 1px solid var(--line-bright);
  background: #172133;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.08s, border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--amber); background: #1d2a40; text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #0b0e14;
}
.btn-primary:hover { background: #fbbf24; border-color: #fbbf24; color: #0b0e14; }
.btn-danger {
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fecaca;
}
.btn-danger:hover { background: rgba(239, 68, 68, 0.32); border-color: var(--red); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; }

.status-note {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-muted);
  padding: 7px 10px;
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  width: 100%;
}

/* Ad Slot (Default visible, lazy-loaded, zero consent popup) */
.ad-slot-wrap {
  margin: 22px 0;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px 14px;
}
.ad-slot-label {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-dim);
  margin-bottom: 8px;
}
.ad-slot-body { min-height: 90px; }

/* Sections */
.section {
  padding: 28px 0 8px;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.section h2 {
  margin: 0;
  font-size: clamp(20px, 2.4vw, 28px);
  letter-spacing: -0.015em;
}
.section-sub {
  margin: 4px 0 0;
  color: var(--ink-muted);
  font-size: 14px;
}

/* Fact Check Callout */
.fact-box {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.11), rgba(17, 25, 39, 0.95));
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 14px;
  padding: 18px 20px;
}
.fact-box h2 { margin-top: 0; margin-bottom: 8px; font-size: 20px; }
.fact-box p { margin: 0 0 10px; color: #dbe3ee; font-size: 14.5px; }
.fact-box p:last-child { margin-bottom: 0; }

/* Tape Deck */
.tape-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.tape-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tape-card.playing { border-color: var(--amber); box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.35); }
.tape-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--amber);
}
.tape-card h3 { margin: 0; font-size: 15.5px; }
.tape-log {
  background: var(--bg-inset);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  flex: 1;
}
.tape-line { padding: 3px 4px; border-radius: 4px; transition: background 0.15s, color 0.15s; }
.tape-line.active-line { background: rgba(245, 158, 11, 0.16); color: #fff; }
.tape-line b { color: var(--amber); }

/* Dossier & Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.dossier-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
}
.dossier-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
}
.badge {
  padding: 2px 7px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
}
.badge-ok { background: var(--green-soft); color: #6ee7b7; border: 1px solid rgba(52, 211, 153, 0.35); }
.badge-warn { background: var(--amber-soft); color: #fcd34d; border: 1px solid rgba(245, 158, 11, 0.35); }
.badge-danger { background: var(--red-soft); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.35); }
.dossier-card h3 { margin: 0 0 4px; font-size: 16px; }
.dossier-origin { font-family: var(--mono); font-size: 11.5px; color: var(--ink-dim); margin-bottom: 8px; }
.dossier-card p { margin: 0; font-size: 13.5px; color: var(--ink-muted); }

/* Timeline */
.timeline {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.tl-item {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-left: 3px solid var(--amber);
  border-radius: 10px;
  padding: 14px 16px;
}
.tl-date { font-family: var(--mono); font-size: 11.5px; color: var(--amber); margin-bottom: 4px; }
.tl-item h3 { margin: 0 0 6px; font-size: 16px; }
.tl-item p { margin: 0; font-size: 13.5px; color: var(--ink-muted); }

/* Quiz */
.quiz-box {
  background: var(--bg-elev);
  border: 1px solid var(--line-bright);
  border-radius: 14px;
  padding: 18px;
}
.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--amber);
  margin-bottom: 10px;
}
.quiz-bar {
  height: 5px;
  background: var(--bg-inset);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 14px;
}
.quiz-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--red));
  transition: width 0.25s ease;
}
.quiz-prompt { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.quiz-opts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.quiz-opt {
  text-align: left;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-bright);
  background: var(--bg-panel);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.quiz-opt:hover { border-color: var(--amber); background: rgba(245, 158, 11, 0.12); }

/* FAQ */
.faq-list { display: grid; gap: 10px; }
.faq-item {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: #fff;
}
.faq-item p { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-muted); }

/* Footer */
.site-footer {
  margin-top: 42px;
  border-top: 1px solid var(--line);
  background: #05080d;
  padding: 24px 0 32px;
  color: var(--ink-dim);
  font-size: 13px;
}
.footer-grid {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--ink-muted); }
.disclaimer-note {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: var(--ink-dim);
}

/* Helmet Avatar Picker */
.avatar-picker {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.avatar-chip {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line-bright);
  background: var(--bg-inset);
  color: var(--ink-muted);
  font-family: var(--mono);
  font-size: 11.5px;
  cursor: pointer;
}
.avatar-chip.selected, .avatar-chip:hover {
  border-color: var(--amber);
  color: #fff;
  background: var(--amber-soft);
}

@media (max-width: 960px) {
  .game-grid, .studio-grid { grid-template-columns: 1fr; }
  .tape-grid, .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .header-inner { flex-wrap: wrap; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .nav a { white-space: nowrap; }
  .crt-frame { aspect-ratio: auto; min-height: 350px; }
  .game-overlay { padding: 14px 12px; }
  .game-overlay h2 { font-size: 18px; }
  .game-overlay p { font-size: 12px; margin-bottom: 10px; }
  .role-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-bottom: 10px; }
  .role-btn { padding: 7px 6px; }
  .role-btn strong { font-size: 11.5px; }
  .role-btn span { font-size: 9.5px; }
  .tape-grid, .card-grid, .timeline, .quiz-opts, .field-row { grid-template-columns: 1fr; }
  .mobile-actions { display: flex; }
}
