:root {
  --bg: hsl(150, 10%, 4%);
  --bg1: hsl(150, 8%, 7%);
  --ink: hsl(150, 10%, 95%);
  --muted: hsl(150, 5%, 50%);
  --panel: hsl(150, 8%, 7%);
  --panel-strong: hsl(150, 6%, 9%);
  --panel-2: hsl(150, 6%, 10%);
  --line: hsl(150, 6%, 15%);
  --secondary: hsl(150, 6%, 12%);
  --accent: hsl(155, 100%, 45%);
  --accent2: hsl(155, 100%, 45%);
  --accent-fg: hsl(150, 10%, 4%);
  --warn: #f59f00;
  --ok: hsl(155, 100%, 45%);
  --bad: hsl(0, 72%, 51%);
  --shadow: 0 20px 60px rgba(0,0,0,0.55);
  --shadow-soft: 0 10px 26px rgba(0,0,0,0.30);
  --radius: 8px;
  --radius-sm: 8px;
  --max-w: 1152px;
  --font-ui: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Berkeley Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

code, pre { font-family: var(--font-mono); }

.bg-noise { display: none; }

/* ─── Header ─── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: hsla(150, 10%, 4%, 0.80);
  backdrop-filter: blur(16px);
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
}
.topbar__left {
  display: flex;
  align-items: center;
  gap: 24px;
  min-width: 0;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  user-select: none;
}
.brand__icon {
  color: var(--accent);
  flex-shrink: 0;
}
.brand__title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.topnav__link {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
  transition: color 150ms ease;
}
.topnav__link:hover {
  color: var(--accent);
}
.topnav__link--active {
  color: var(--accent);
}

.topbar__hamburger {
  display: none;
  appearance: none;
  border: none;
  background: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
}
.topbar__hamburger:hover { color: var(--ink); }
.topbar__hamburger svg { display: block; }

/* Mobile nav */
.topnav--mobile {
  display: none;
  flex-direction: column;
  gap: 16px;
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.topnav--mobile .topnav__link {
  font-size: 14px;
}
.topnav--mobile:not(.hidden) { display: flex; }

@media (max-width: 768px) {
  .topnav { display: none; }
  .topbar__right .btn { display: none; }
  .topbar__hamburger { display: block; }
}

.pill {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--secondary);
  color: var(--muted);
}

/* ─── Main container ─── */
.main {
  padding: 22px 20px 56px;
  max-width: var(--max-w);
  margin: 0 auto;
}
.main--home {
  padding: 0;
  max-width: none;
}
.main--wide {
  max-width: none;
  padding-left: 24px;
  padding-right: 24px;
}

/* ─── Sections ─── */
.section {
  padding: 80px 0;
}
.section--border {
  border-bottom: 1px solid var(--line);
}
.section__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.section-header__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.section-header__title {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
@media (min-width: 768px) {
  .section-header__title { font-size: 30px; }
}

/* ─── Hero ─── */
.hero-section {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.hero-grid-bg {
  position: absolute;
  inset: 0;
  opacity: 0.03;
  background-image:
    linear-gradient(var(--accent) 1px, transparent 1px),
    linear-gradient(90deg, var(--accent) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}
.hero-section .section__inner {
  position: relative;
  padding-top: 96px;
  padding-bottom: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--secondary);
  border-radius: 999px;
  padding: 6px 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 32px;
}
.hero__badge-icon {
  color: var(--accent);
  opacity: 0.9;
}
.hero__badge-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.hero__badge-link:hover,
.hero__badge-link:focus-visible {
  text-decoration: underline;
}
.hero__pulse {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.9;
}
.hero__title {
  max-width: 900px;
  font-size: clamp(32px, 5.5vw, 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-wrap: balance;
}
.hero__accent {
  display: block;
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: clamp(16px, 2vw, 20px);
  color: var(--accent);
}
.hero__desc {
  margin-top: 24px;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.6;
  color: var(--muted);
  text-wrap: balance;
}
@media (min-width: 768px) {
  .hero__desc { font-size: 18px; }
}
.hero__actions {
  margin-top: 40px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ─── Stat cards ─── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 48px;
}
@media (min-width: 768px) {
  .stat-row { grid-template-columns: repeat(4, 1fr); }
}
.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: hsla(150, 6%, 12%, 0.5);
}
.stat-card__icon {
  color: var(--accent);
  margin-bottom: 8px;
}
.stat-card__value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
}
.stat-card__label {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

/* ─── Table card wrapper ─── */
.table-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  margin-top: 32px;
}

/* ─── Snap scroll ─── */
.snap-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin: 0 -24px;
  padding-left: 24px;
  padding-right: 24px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.snap-scroll::-webkit-scrollbar { height: 4px; }
.snap-scroll::-webkit-scrollbar-track { background: transparent; }
.snap-scroll::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.snap-card {
  min-width: 300px;
  flex-shrink: 0;
  scroll-snap-align: start;
}

/* ─── Game card (featured) ─── */
.game-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 20px;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  display: block;
  transition: border-color 150ms ease;
}
.game-card:hover {
  border-color: hsla(155, 100%, 45%, 0.3);
}
.game-card__scenario {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}
.game-card__agents {
  margin-top: 16px;
}
.game-card__agent {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
}
.game-card__agent--winner {
  color: var(--accent);
  font-weight: 700;
}
.game-card__vs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
}
.game-card__vs-line {
  flex: 1;
  height: 1px;
  background: var(--line);
}
.game-card__vs-text {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
}
.game-card__footer {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 16px;
}
.game-card__stat {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.game-card__stat svg { color: var(--accent); }
.game-card__play {
  margin-left: auto;
  color: var(--muted);
  transition: color 150ms ease;
}
.game-card:hover .game-card__play { color: var(--accent); }

/* ─── Entry card (explore) ─── */
.entry-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 150ms ease;
}
.entry-card:hover {
  border-color: hsla(155, 100%, 45%, 0.3);
}
.entry-card__icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  background: var(--secondary);
}
.entry-card__icon svg { color: var(--accent); }
.entry-card__title {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  transition: color 150ms ease;
}
.entry-card:hover .entry-card__title { color: var(--accent); }
.entry-card__desc {
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.entry-card__arrow {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--muted);
  transition: color 150ms ease;
}
.entry-card:hover .entry-card__arrow { color: var(--accent); }

/* ─── Footer ─── */
.footer {
  padding: 48px 0;
}
.footer__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}
.footer__brand {
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer__brand svg { color: var(--accent); }
.footer__brand span {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}
.footer__desc {
  max-width: 480px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.footer__links {
  display: flex;
  gap: 24px;
}
.footer__links a {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 150ms ease;
}
.footer__links a:hover { color: var(--accent); }
.footer__copy {
  font-family: var(--font-mono);
  font-size: 10px;
  color: hsla(150, 5%, 50%, 0.6);
}

/* ─── Grid ─── */
.grid {
  display: grid;
  gap: 14px;
}
.grid--two {
  grid-template-columns: 1.1fr 0.9fr;
}
@media (max-width: 980px) {
  .grid--two { grid-template-columns: 1fr; }
}

/* ─── Panel ─── */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: none;
  overflow: hidden;
  animation: rise 240ms ease-out both;
}
.panel--flat { background: var(--panel-strong); }

@keyframes rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.panel__header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.panel__header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.panel__title {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.panel__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}
.panel__body { padding: 16px; }

/* ─── Typography ─── */
.h1 {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 700;
  margin: 0 0 8px;
}
.h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── KV pairs ─── */
.kv {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 10px 14px;
  font-family: var(--font-mono);
  font-size: 13px;
}
@media (max-width: 520px) {
  .kv { grid-template-columns: 1fr; }
}
.kv__k { color: var(--muted); }
.kv__v { color: var(--ink); word-break: break-word; }

/* ─── Links ─── */
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--secondary);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 12px;
  transition: border-color 150ms ease;
}
.link:hover { border-color: hsla(155, 100%, 45%, 0.45); }
.link--missing { opacity: 0.45; pointer-events: none; }

/* ─── Table ─── */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap::-webkit-scrollbar { height: 6px; }
.table-wrap::-webkit-scrollbar-track { background: transparent; }
.table-wrap::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 13px;
}
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
tr:hover td { background: hsla(150, 6%, 12%, 0.5); }

.table-link {
  color: var(--ink);
  text-decoration: none;
  transition: color 150ms ease;
}
.table-link:hover { color: var(--accent); text-decoration: underline; }

/* ─── Badge ─── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--secondary);
  font-size: 12px;
}
.badge--ok { border-color: hsla(155, 100%, 45%, 0.35); color: var(--ok); }
.badge--bad { border-color: hsla(0, 72%, 51%, 0.35); color: var(--bad); }
.badge--warn { border-color: rgba(245,159,0,0.35); color: var(--warn); }

/* ─── Controls ─── */
.replay-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.controls-left, .controls-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--secondary);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 150ms ease;
}
.btn:hover { border-color: hsla(155, 100%, 45%, 0.45); }
.btn--primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-fg);
  font-weight: 600;
}
.btn--primary:hover {
  background: hsl(155, 100%, 40%);
  border-color: hsl(155, 100%, 40%);
}
.btn--ghost { background: transparent; border-color: transparent; }
.btn--ghost:hover { color: var(--accent); border-color: transparent; }
.btn--xs {
  padding: 6px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
}
.btn--lg {
  padding: 12px 20px;
  font-size: 13px;
}
.btn--disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.range {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
}
input[type="range"] { width: min(420px, 68vw); }

.select {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--secondary);
  padding: 10px 34px 10px 12px;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255,255,255,0.55) 50%),
    linear-gradient(135deg, rgba(255,255,255,0.55) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
.select:hover { border-color: hsla(155, 100%, 45%, 0.45); }
.select:focus {
  outline: 2px solid hsla(155, 100%, 45%, 0.25);
  outline-offset: 2px;
}

/* ─── Terminal grid ─── */
.terminal-grid {
  --tile-min: 480px;
  --tile-h: 380px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(var(--tile-min), 1fr));
  align-items: start;
}
.terminal-grid[data-size="compact"]   { --tile-min: 380px; --tile-h: 280px; }
.terminal-grid[data-size="readable"]  { --tile-min: 480px; --tile-h: 380px; }
.terminal-grid[data-size="huge"]      { --tile-min: 620px; --tile-h: 480px; }
.terminal-grid[data-size="cinematic"] { --tile-min: 780px; --tile-h: 600px; }
.terminal-grid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.terminal-grid[data-cols="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.terminal-grid[data-cols="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) {
  .terminal-grid[data-cols="2"],
  .terminal-grid[data-cols="3"],
  .terminal-grid[data-cols="4"] {
    grid-template-columns: 1fr;
  }
}

.terminal-tile {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  cursor: default;
  transition: transform 120ms ease, border-color 120ms ease;
}
.terminal-tile:hover {
  transform: translateY(-2px);
  border-color: hsla(155, 100%, 45%, 0.35);
}
.terminal-tile__head {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.terminal-tile__head:focus-visible {
  outline: 2px solid hsla(155, 100%, 45%, 0.25);
  outline-offset: 2px;
}
.terminal-tile__name {
  font-family: var(--font-mono);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.terminal-tile__activity {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.92;
}
.terminal-tile__activity::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--muted);
  flex: 0 0 auto;
}
.terminal-tile__activity--scan::before { background: var(--accent); }
.terminal-tile__activity--exploit::before { background: hsla(0, 72%, 51%, 0.9); }
.terminal-tile__activity--defend::before { background: rgba(245,159,0,0.9); }
.terminal-tile__activity--submit::before { background: var(--ok); }
.terminal-tile__activity--dead::before { background: var(--bad); }
.terminal-tile__meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.terminal-tile__actions { display: flex; align-items: center; gap: 10px; }
.terminal-grid .player { height: var(--tile-h); }
.terminal-tile .player { cursor: pointer; }
.terminal-tile__body { position: relative; }

/* ─── Elimination overlay ─── */
.elim-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  opacity: 0;
  transition: opacity 140ms ease;
  background:
    repeating-linear-gradient(
      45deg,
      hsla(0, 72%, 51%, 0.00),
      hsla(0, 72%, 51%, 0.00) 10px,
      hsla(0, 72%, 51%, 0.18) 10px,
      hsla(0, 72%, 51%, 0.18) 20px
    );
}
.elim-overlay__inner {
  background: hsla(150, 10%, 4%, 0.80);
  border: 1px solid hsla(0, 72%, 51%, 0.35);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 10px 14px;
  text-align: center;
  backdrop-filter: blur(6px);
}
.elim-overlay__title {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--bad);
}
.elim-overlay__detail {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: hsla(150, 10%, 95%, 0.82);
}

.terminal-tile--eliminated .elim-overlay { opacity: 1; }
.terminal-tile--eliminated { border-color: hsla(0, 72%, 51%, 0.35); }
.terminal-tile--eliminated:hover {
  transform: none;
  border-color: hsla(0, 72%, 51%, 0.45);
}
.terminal-tile--eliminated .terminal-tile__meta--elim { color: var(--bad); font-weight: 700; }
.terminal-tile--eliminated .player { filter: grayscale(0.75) brightness(0.95); }
.player {
  background: rgba(0,0,0,0.06);
}
.player--big { height: min(62vh, 720px); }
@media (max-width: 720px) {
  .player--big { height: min(56vh, 520px); }
}

.drawer-player-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
}
.drawer-player-wrap .elim-overlay__title { font-size: 30px; }
.drawer-player-wrap .elim-overlay__detail { font-size: 13px; }
.drawer-player-wrap--eliminated .elim-overlay { opacity: 1; }

/* ─── Derived Replay UI ─── */
.drawer-activity {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.drawer-activity__line {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  line-height: 1.4;
  opacity: 0.92;
}
.drawer-bookmarks {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bm {
  appearance: none;
  border: 1px solid var(--line);
  background: hsla(150, 6%, 12%, 0.45);
  border-radius: 999px;
  padding: 8px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 150ms ease, transform 120ms ease;
}
.bm:hover { border-color: hsla(155, 100%, 45%, 0.45); transform: translateY(-1px); }
.bm__t { color: var(--muted); margin-right: 8px; }
.bm__label { color: var(--ink); }

.evidence-row--active td { background: hsla(155, 100%, 45%, 0.10); }
.evidence-row--active code { color: var(--accent); }
.evidence-row { cursor: pointer; }
.evidence-row:hover td { background: hsla(155, 100%, 45%, 0.06); }

/* ─── Empty / misc ─── */
.empty {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

.codebox {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(0,0,0,0.25);
  overflow: auto;
  max-height: 420px;
  white-space: pre;
  tab-size: 2;
  font-size: 12px;
  line-height: 1.4;
  color: var(--ink);
}

/* ─── Drawer ─── */
.drawer {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(740px, 96vw);
  background: hsla(150, 10%, 4%, 0.95);
  backdrop-filter: blur(12px);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 180ms ease;
  z-index: 80;
  display: grid;
  grid-template-rows: auto auto 1fr;
}
.drawer--open { transform: translateX(0); }
.drawer__header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.drawer__tabs {
  display: flex;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  border: 1px solid var(--line);
  background: var(--secondary);
  padding: 10px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--ink);
  transition: border-color 150ms ease;
}
.tab--active { border-color: var(--accent); color: var(--accent); }
.drawer__body { padding: 12px; overflow: auto; }
.tabpane { display: none; }
.tabpane--active { display: block; }

/* ─── Story Mode ─── */
.story-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.story-now {
  min-width: min(420px, 100%);
}
.story-now__line {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
  opacity: 0.92;
}
.story-now__sub {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.story-agents {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.story-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: hsla(150, 6%, 12%, 0.35);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
  user-select: none;
  cursor: pointer;
}
.story-chip__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--muted);
}
.story-chip--scan .story-chip__dot { background: var(--accent); }
.story-chip--exploit .story-chip__dot { background: hsla(0, 72%, 51%, 0.9); }
.story-chip--defend .story-chip__dot { background: rgba(245,159,0,0.9); }
.story-chip--submit .story-chip__dot { background: var(--ok); }
.story-chip--dead .story-chip__dot { background: var(--bad); }
.story-chip__agent { opacity: 0.95; }
.story-chip__act { color: var(--muted); }

.story-bookmarks {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.story-feed {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(56vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.story-strip--collapsed .story-feed { max-height: min(22vh, 240px); }
.story-strip--expanded .story-feed { max-height: min(56vh, 560px); }
.story-feed::-webkit-scrollbar { width: 8px; }
.story-feed::-webkit-scrollbar-track { background: transparent; }
.story-feed::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.story-item {
  display: grid;
  grid-template-columns: 66px 18px 1fr;
  gap: 10px;
  padding: 10px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: hsla(150, 6%, 12%, 0.25);
  cursor: pointer;
  transition: border-color 150ms ease, transform 120ms ease, background 150ms ease;
}
.story-item:hover {
  border-color: hsla(155, 100%, 45%, 0.35);
  transform: translateY(-1px);
}
.story-item--active {
  border-color: var(--accent);
  background: hsla(155, 100%, 45%, 0.08);
}
.story-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.story-icon {
  color: var(--accent);
  opacity: 0.92;
  margin-top: 1px;
}
.story-text {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink);
}
.story-text__agent {
  color: var(--muted);
  margin-right: 8px;
}

/* Story Mode lives inside Replay Hub now; no right-side sticky panel behavior. */

/* ─── Agent Drawer: Player Card ─── */
.result-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: hsla(150, 6%, 12%, 0.4);
  margin-bottom: 16px;
}
.result-banner__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.result-banner__stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.result-banner__stat-value {
  font-weight: 700;
  color: var(--ink);
}
.result-banner__placement {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  color: var(--ink);
  min-width: 42px;
  text-align: center;
}
.result-banner__placement--first {
  color: var(--accent);
}
.result-banner__fate {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.strategy-block {
  margin-bottom: 16px;
}
.strategy-block .kicker {
  margin-bottom: 6px;
}
.strategy-block__text {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink);
  opacity: 0.92;
}

.phase-row {
  display: grid;
  grid-template-columns: 20px 80px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: hsla(150, 6%, 12%, 0.25);
  cursor: pointer;
  margin-bottom: 6px;
  transition: border-color 150ms ease, background 150ms ease;
}
.phase-row:hover {
  border-color: hsla(155, 100%, 45%, 0.35);
}
.phase-row--active {
  border-color: var(--accent);
  background: hsla(155, 100%, 45%, 0.08);
}
.phase-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  justify-self: center;
}
.phase-dot--scan { background: var(--accent); }
.phase-dot--exploit { background: hsla(0, 72%, 51%, 0.9); }
.phase-dot--defend { background: rgba(245,159,0,0.9); }
.phase-dot--submit { background: var(--ok); }
.phase-row__time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
}
.phase-row__summary {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink);
  line-height: 1.4;
}

.evidence-counts {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.evidence-counts .badge {
  font-family: var(--font-mono);
}

.commentary-feed {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(56vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.commentary-feed::-webkit-scrollbar { width: 8px; }
.commentary-feed::-webkit-scrollbar-track { background: transparent; }
.commentary-feed::-webkit-scrollbar-thumb { background: var(--line); border-radius: 8px; }

.drawer-section {
  margin-bottom: 16px;
}
.drawer-section > .kicker {
  margin-bottom: 8px;
}

/* ─── Details accordion ─── */
.details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: hsla(150, 6%, 12%, 0.3);
  padding: 12px 12px;
}
.details > summary {
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 150ms ease;
}
.details > summary:hover { color: var(--accent); }
.details__body { margin-top: 10px; }

/* ─── Strip / Card grid (used on inner pages) ─── */
.strip {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}
.strip-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  transition: transform 120ms ease, border-color 120ms ease;
}
.strip-card:hover {
  transform: translateY(-2px);
  border-color: hsla(155, 100%, 45%, 0.35);
}
.strip-card__top { display: flex; justify-content: space-between; gap: 10px; }
.strip-card__title { font-family: var(--font-mono); font-size: 14px; font-weight: 800; }
.strip-card__meta { margin-top: 6px; font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.strip-card__cta { margin-top: 10px; font-family: var(--font-mono); font-size: 12px; color: var(--accent); }

.card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.card-strip {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}
.card {
  display: block;
  text-decoration: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 14px;
  transition: transform 120ms ease, border-color 120ms ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: hsla(155, 100%, 45%, 0.35);
}
.card__kicker {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.card__title {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 900;
}
.card__meta {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}
.card__cta {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
}

/* ─── Champion card ─── */
.champion { text-align: center; padding: 24px; }
.champion__crown { font-size: 40px; line-height: 1; margin-bottom: 8px; }
.champion__label {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}
.champion__name { font-family: var(--font-mono); font-size: 18px; font-weight: 800; margin-top: 12px; }
.champion__elo {
  font-family: var(--font-mono); font-size: 36px; font-weight: 900;
  color: var(--accent);
  margin-top: 4px;
}
.champion__record { font-family: var(--font-mono); font-size: 14px; color: var(--muted); }

/* ─── Leaderboard table ─── */
.lb-table thead th {
  position: sticky;
  top: 0;
  background: var(--panel);
  border-bottom: 2px solid var(--accent);
}
.lb-table tbody tr:nth-child(even) td { background: hsla(150, 6%, 12%, 0.3); }
.lb-rank--top { color: var(--accent); font-weight: 700; }

/* ─── Medal badges ─── */
.medal { display: inline-block; width: 20px; text-align: center; }

/* ─── Scenario card in snap scroll ─── */
.scenario-snap-card {
  min-width: 200px;
  flex-shrink: 0;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 150ms ease;
}
.scenario-snap-card:hover { border-color: hsla(155, 100%, 45%, 0.3); }
.scenario-snap-card__icon {
  color: var(--muted);
  margin-bottom: 12px;
  transition: color 150ms ease;
}
.scenario-snap-card:hover .scenario-snap-card__icon { color: var(--accent); }
.scenario-snap-card__name {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
}
.scenario-snap-card__diff {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.diff--easy { color: var(--accent); }
.diff--medium { color: hsl(200, 70%, 50%); }
.diff--hard { color: hsl(30, 80%, 55%); }
.diff--expert { color: var(--bad); }

/* Entry points grid */
.entry-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin-top: 48px;
}
@media (min-width: 640px) {
  .entry-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .entry-grid { grid-template-columns: repeat(3, 1fr); }
}
