/* COMRAD project page
   Layout: two-player split screen. A single seam runs down the centre of the hero, through the
   split-screen footage and into the status bar; P1 content is amber, P2 content is blue, and the
   sections below reuse that pairing whenever two agents (or two algorithm families) are compared. */

@font-face { font-family: "Big Shoulders Display"; src: url("fonts/bigshoulders-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Big Shoulders Display"; src: url("fonts/bigshoulders-900.woff2") format("woff2"); font-weight: 800 900; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/atkinson-700.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "VT323"; src: url("fonts/vt323.woff") format("woff"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --ground: #1b1a12;
  --panel: #24231a;
  --panel-2: #2e2d21;
  --rule: #48462f;
  --khaki: #a39f78;
  --bone: #ece4e2;
  --p1: #f2801a;
  --p2: #6b74ff;
  --hud: #eee164;
  --blood: #d0262a;
  --p1-soft: rgba(242, 128, 26, .14);
  --p2-soft: rgba(107, 116, 255, .16);

  --font-display: "Big Shoulders Display", "Oswald", "Arial Narrow", Impact, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
  --font-hud: "VT323", "Courier New", ui-monospace, monospace;

  --step--1: 0.94rem;
  --step-0: 1.08rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.6rem, 5.4vw, 4.6rem);
  --step-4: clamp(5.5rem, 19vw, 17rem);

  --gut: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video, canvas { max-width: 100%; display: block; }
a { color: var(--hud); text-underline-offset: 3px; }
a:hover { color: var(--bone); }
:focus-visible { outline: 3px solid var(--hud); outline-offset: 3px; }
b, strong { color: #fff; }
em { color: var(--bone); }
.px { image-rendering: pixelated; }
.hud { font-family: var(--font-hud); letter-spacing: .02em; }
.p1 { color: var(--p1); }
.p2 { color: var(--p2); }
.yl { color: var(--hud); }
.rd { color: var(--blood); }
.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ───────────── top bar ───────────── */
.topbar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(27, 26, 18, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 52px; }
.brand { font-family: var(--font-display); font-weight: 900; font-size: 1.55rem; letter-spacing: .04em; text-decoration: none; color: var(--bone); line-height: 1; }
.brand span:first-child { color: var(--p1); } .brand span:last-child { color: var(--p2); }
.topbar nav { display: flex; gap: 20px; margin-left: auto; font-family: var(--font-hud); font-size: 1.3rem; }
.topbar nav a { color: var(--khaki); text-decoration: none; text-transform: uppercase; }
.topbar nav a:hover { color: var(--hud); }
@media (max-width: 860px) { .topbar nav a.opt { display: none; } }
@media (max-width: 520px) {
  .topbar .wrap { gap: 12px; height: auto; min-height: 52px; padding-block: 8px; }
  .topbar nav { flex-wrap: wrap; justify-content: flex-end; gap: 4px 12px; font-size: 1.15rem; }
}

/* ───────────── hero ───────────── */
.hero { position: relative; padding-top: clamp(28px, 5vw, 64px); }
.hero-head { position: relative; text-align: center; }
.kicker { font-family: var(--font-hud); font-size: 1.45rem; color: var(--khaki); text-transform: uppercase; letter-spacing: .06em; margin: 1rem; }
.wordmark {
  margin: 0; font-family: var(--font-display); font-weight: 900; font-size: var(--step-4);
  line-height: .78; letter-spacing: -.01em; display: flex; justify-content: center; text-transform: uppercase;
  user-select: none;
}
.wordmark .half { display: block; padding-inline: .03em; }
.wordmark .l { color: var(--p1); }
.wordmark .r { color: var(--p2); }
.seam { position: absolute; left: 50%; width: 2px; margin-left: -1px; background: var(--bone); opacity: .9; }
.hero-head .seam { top: 0; bottom: 0; }
.tagline { font-family: var(--font-display); font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2.2rem); line-height: 1.05; text-transform: uppercase; letter-spacing: .02em; margin: 18px auto 0; max-width: 50ch; text-wrap: balance; }
.authors { margin: 14px 0 0; color: var(--khaki); font-size: var(--step-0); }
.authors b { color: var(--bone); font-weight: 400; }
.cta { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin: 26px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 10px 18px 9px; border: 2px solid var(--bone);
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--bone); background: transparent; text-decoration: none; cursor: pointer; line-height: 1;
  transition: background .15s, color .15s, transform .15s var(--ease);
}
.btn:hover { background: var(--bone); color: var(--ground); transform: translateY(-2px); }
.btn.solid { background: var(--hud); border-color: var(--hud); color: var(--ground); }
.btn.solid:hover { background: var(--bone); border-color: var(--bone); }
.btn svg { width: 18px; height: 18px; }
.btn.sm { font-size: 1rem; padding: 7px 12px 6px; }
.btn[aria-pressed="true"] { background: var(--bone); color: var(--ground); }

/* hero buddies */
.buddy { position: absolute; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 3; }
.buddy img { height: 92px; width: auto; image-rendering: pixelated; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.6)); }
.flip { transform: scaleX(-1); }
.bubble {
  position: relative; display: inline-block; background: var(--bone); color: #17140c;
  font-family: var(--font-hud); font-size: 1.35rem; line-height: 1; padding: 6px 10px 5px; white-space: nowrap;
  box-shadow: 4px 4px 0 rgba(0,0,0,.55);
}
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -10px; margin-left: -6px; border: 6px solid transparent; border-top: 6px solid var(--bone); border-bottom: 0; border-width: 10px 7px 0; }
.bubble.left::after { left: 22%; } .bubble.right::after { left: 78%; }
.bubble b { color: #b3170e; font-weight: 400; }
.buddy.h1 { left: max(var(--gut), calc(50% - 600px)); bottom: 12px; }
.buddy.h2 { right: max(var(--gut), calc(50% - 600px)); bottom: 12px; }
@media (max-width: 980px) {
  /* A dedicated row keeps both marines clear of the wrapping action buttons. */
  .hero-head { padding-bottom: 132px; }
  .buddy.h1, .buddy.h2 { bottom: 0; }
  .buddy img { height: 72px; }
  .buddy .bubble { font-size: 1.2rem; }
}

/* split-screen screen */
.screen { position: relative; margin-top: clamp(28px, 4vw, 48px); }
.screen-frame { position: relative; max-width: 1600px; margin-inline: auto; border-top: 2px solid var(--bone); border-bottom: 2px solid var(--bone); background: #000; }
.screen video, .screen img.poster { width: 100%; aspect-ratio: 32 / 9; object-fit: cover; }
.screen .seam { top: -2px; bottom: -2px; z-index: 2; }
.vp-label { position: absolute; top: 12px; z-index: 2; display: flex; align-items: center; gap: 8px; font-family: var(--font-hud); font-size: 1.35rem; text-transform: uppercase; background: rgba(0,0,0,.72); padding: 3px 10px 2px; line-height: 1.1; }
.vp-label.l { left: 12px; color: var(--p1); } .vp-label.r { left: calc(50% + 12px); color: var(--p2); }
.vp-label svg { width: 18px; height: 14px; }

/* status bar under the screen */
.statusbar { position: relative; display: grid; grid-template-columns: repeat(3, 1fr) 96px repeat(3, 1fr); max-width: 1600px; margin-inline: auto; background: var(--panel); border-bottom: 1px solid var(--rule); }
.stat { padding: 14px 10px 12px; text-align: center; border-right: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.stat .n { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.9rem, 3.6vw, 3.1rem); line-height: .9; color: var(--blood); }
.stat .l { font-family: var(--font-hud); font-size: 1.2rem; color: var(--khaki); text-transform: uppercase; line-height: 1.05; margin-top: 4px; }
.stat:nth-child(7) { border-right: 0; }
.face { display: flex; align-items: center; justify-content: center; background: #111; border-right: 1px solid var(--rule); }
.face img { width: 64px; height: auto; image-rendering: pixelated; }
@media (max-width: 820px) {
  .statusbar { grid-template-columns: repeat(3, 1fr); }
  .face { grid-column: 1 / -1; order: -1; padding: 8px 0; border-right: 0; border-bottom: 1px solid var(--rule); }
  .stat:nth-child(4), .stat:nth-child(7) { border-right: 0; }
  .stat { border-bottom: 1px solid var(--rule); }
}

/* ───────────── sections ───────────── */
section.block { padding-block: clamp(64px, 9vw, 120px); border-bottom: 1px solid var(--rule); position: relative; }
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.sec-head h2 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: var(--step-3); line-height: .88; text-transform: uppercase; letter-spacing: -.005em; text-wrap: balance; }
.sec-head h2 em { font-style: normal; color: var(--hud); }
.sec-head p.deck { margin: 14px 0 0; max-width: 62ch; color: var(--khaki); font-size: var(--step-1); line-height: 1.45; }
.sec-head .mascot { display: flex; align-items: flex-end; gap: 10px; }
.sec-head .mascot img { height: 78px; width: auto; image-rendering: pixelated; filter: drop-shadow(3px 3px 0 rgba(0,0,0,.6)); }
.sec-head .mascot img.animated-monster, footer .gg img.animated-monster { object-fit: contain; object-position: center bottom; flex: none; }
.sec-head .mascot img.floating-monster { animation: monster-hover 2.4s ease-in-out infinite; animation-play-state: paused; }
.sec-head .mascot img.floating-monster.in-view { animation-play-state: running; }
@keyframes monster-hover { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.sec-head .mascot .bubble::after { left: auto; right: -12px; bottom: 8px; top: auto; border-width: 7px 0 7px 12px; border-color: transparent transparent transparent var(--bone); margin: 0; }
@media (max-width: 720px) { .sec-head { grid-template-columns: minmax(0, 1fr); } .sec-head .mascot { justify-self: end; } }
.label { font-family: var(--font-hud); font-size: 1.3rem; text-transform: uppercase; color: var(--khaki); letter-spacing: .04em; line-height: 1.1; }
p { margin: 0 0 1em; }
.prose { max-width: 66ch; }
.prose p { color: #d8d0cc; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 860px) { .cols-2 { grid-template-columns: 1fr; } }
figure { margin: 0; }
figcaption { font-size: var(--step--1); color: var(--khaki); margin-top: 10px; line-height: 1.5; }
figcaption b { color: var(--bone); }

/* ───────────── TL;DR / why ───────────── */
.tldr { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.tldr > * { min-width: 0; }
@media (max-width: 960px) { .tldr { grid-template-columns: minmax(0, 1fr); } }
.lead { font-size: clamp(1.35rem, 2.1vw, 1.7rem); line-height: 1.38; margin: 0 0 22px; color: var(--bone); text-wrap: pretty; }
.lead .mark { color: var(--hud); }
details.abstract { border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
details.abstract summary { cursor: pointer; list-style: none; padding: 12px 0; font-family: var(--font-hud); font-size: 1.35rem; color: var(--hud); text-transform: uppercase; }
details.abstract summary::-webkit-details-marker { display: none; }
details.abstract summary::before { content: "+ "; }
details.abstract[open] summary::before { content: "− "; }
details.abstract p { font-size: var(--step--1); color: #cfc7c2; }
.contribs { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 0; }
.contribs li { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--rule); font-size: var(--step--1); color: #d8d0cc; }
.contribs li img { width: 26px; height: auto; image-rendering: pixelated; margin-top: 2px; }

.cmp-wrap { overflow-x: auto; background: var(--panel); border: 1px solid var(--rule); }
table.cmp { width: 100%; border-collapse: collapse; font-size: .98rem; min-width: 560px; }
.cmp th { font-family: var(--font-hud); font-weight: 400; font-size: 1.15rem; color: var(--khaki); text-transform: uppercase; padding: 12px 8px 8px; text-align: center; line-height: 1; vertical-align: bottom; border-bottom: 1px solid var(--rule); }
.cmp th:first-child, .cmp td:first-child { text-align: left; padding-left: 14px; }
.cmp td { text-align: center; padding: 8px; border-bottom: 1px solid rgba(72,70,47,.6); color: #d8d0cc; white-space: nowrap; }
.cmp td.sep { border-top: 2px solid var(--rule); }
.cmp tr.ours td { background: rgba(238,225,100,.09); color: #fff; border-top: 2px solid var(--hud); border-bottom: 2px solid var(--hud); font-weight: 700; }
.ck, .xx, .pt { display: inline-block; width: 16px; height: 16px; vertical-align: middle; }
.ck { background: var(--hud); clip-path: polygon(14% 46%, 0 62%, 38% 100%, 100% 22%, 86% 8%, 38% 70%); }
.xx { background: var(--blood); clip-path: polygon(20% 0, 50% 30%, 80% 0, 100% 20%, 70% 50%, 100% 80%, 80% 100%, 50% 70%, 20% 100%, 0 80%, 30% 50%, 0 20%); opacity: .85; }
.pt { height: 4px; width: 14px; background: var(--khaki); }
.cmp-note { font-size: .9rem; color: var(--khaki); padding: 10px 14px; border-top: 1px solid var(--rule); }

/* ───────────── scenarios: level select ───────────── */
.levels { display: grid; grid-template-columns: minmax(250px, 330px) minmax(0, 1fr); gap: 0; border: 1px solid var(--rule); background: var(--panel); }
@media (max-width: 900px) { .levels { grid-template-columns: minmax(0, 1fr); } }
.lvl-list { border-right: 1px solid var(--rule); padding: 8px 0; max-height: 1000px; overflow: auto; }
@media (max-width: 900px) { .lvl-list { border-right: 0; border-bottom: 1px solid var(--rule); max-height: none; display: flex; overflow-x: auto; padding: 8px; gap: 6px; } }
.tier-h { font-family: var(--font-hud); font-size: 1.15rem; color: var(--khaki); text-transform: uppercase; padding: 12px 16px 4px; display: flex; align-items: center; gap: 8px; }
@media (max-width: 900px) { .tier-h { display: none; } }
.skulls { display: inline-flex; gap: 2px; }
.skulls i { width: 11px; height: 11px; background: var(--hud); clip-path: polygon(20% 0, 80% 0, 100% 25%, 100% 62%, 78% 72%, 78% 100%, 22% 100%, 22% 72%, 0 62%, 0 25%); }
.skulls i.off { background: var(--rule); }
.lvl {
  display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 12px; align-items: center; width: 100%;
  padding: 7px 16px; background: transparent; border: 0; border-left: 4px solid transparent; color: var(--bone);
  text-align: left; cursor: pointer; font: inherit;
}
.lvl img { width: 54px; aspect-ratio: 16/9; object-fit: cover; filter: saturate(.6) brightness(.8); }
.lvl .nm { font-family: var(--font-display); font-weight: 700; font-size: 1.22rem; line-height: 1; text-transform: uppercase; letter-spacing: .02em; }
.lvl .mt { font-family: var(--font-hud); font-size: 1.05rem; color: var(--khaki); line-height: 1; margin-top: 3px; }
.lvl:hover { background: var(--panel-2); }
.lvl[aria-selected="true"] { background: var(--panel-2); border-left-color: var(--hud); }
.lvl[aria-selected="true"] img { filter: none; }
@media (max-width: 900px) { .lvl { flex: 0 0 auto; width: auto; grid-template-columns: 1fr; padding: 6px; border-left: 0; border-bottom: 3px solid transparent; } .lvl img { width: 92px; } .lvl .nm { font-size: 1rem; white-space: nowrap; } .lvl .mt { display: none; } .lvl[aria-selected="true"] { border-bottom-color: var(--hud); } }
.lvl-detail { padding: clamp(16px, 2.6vw, 28px); min-width: 0; }
.views { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #000; }
.views.single { grid-template-columns: 1fr; }
.views img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.views .seam { top: 0; bottom: 0; }
.views.single .seam { display: none; }
.lvl-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; margin: 20px 0 6px; }
.lvl-title h3 { margin: 0; font-family: var(--font-display); font-weight: 900; font-size: clamp(2rem, 3.6vw, 3rem); line-height: .9; text-transform: uppercase; }
.lvl-chal { font-size: var(--step-1); line-height: 1.4; margin: 6px 0 18px; max-width: 58ch; color: var(--bone); }
.specs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.specs > div { padding: 10px 12px 9px 0; min-width: 0; }
.specs > div + div { padding-left: 12px; border-left: 1px solid var(--rule); }
.specs .v { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; line-height: 1; color: var(--bone); text-transform: uppercase; }
@media (max-width: 560px) { .specs { grid-template-columns: 1fr 1fr; } .specs > div:nth-child(3) { border-left: 0; padding-left: 0; } .specs > div:nth-child(n+3) { border-top: 1px solid var(--rule); } }
.lvl-score { margin-top: 18px; }
.mini-bars { display: grid; gap: 5px; margin-top: 8px; }
.mb { display: grid; grid-template-columns: 74px minmax(0, 1fr) 92px; gap: 10px; align-items: center; font-family: var(--font-hud); font-size: 1.12rem; line-height: 1; }
.mb .track { height: 12px; background: rgba(255,255,255,.05); position: relative; }
.mb .fill { position: absolute; inset: 0 auto 0 0; background: var(--p1); }
.mb.off .fill { background: var(--p2); }
.mb .val { text-align: right; color: var(--bone); font-variant-numeric: tabular-nums; }
.mb.best .nm { color: var(--hud); }
.mb.best .val { color: var(--hud); }
.scen-foot { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 14px; font-size: .92rem; color: var(--khaki); }

/* ───────────── game ───────────── */
.arcade { border: 2px solid var(--bone); background: #000; position: relative; }
.arcade .seam { top: 0; bottom: 0; z-index: 2; pointer-events: none; }
.arcade canvas { width: 100%; height: auto; aspect-ratio: 32 / 10; image-rendering: pixelated; cursor: crosshair; }
.arcade.solo canvas { aspect-ratio: 16 / 10; }
.arcade.solo .seam { display: none; }
.arcade.real-wad canvas { aspect-ratio: 16 / 9; display: block; }
.arcade.real-wad .seam { display: none; }
.doom-launch { position: absolute; inset: 0; display: grid; place-content: center; gap: 10px; padding: 24px; background: rgba(0, 0, 0, .78); text-align: center; }
.doom-launch p { max-width: 44rem; margin: 0; color: var(--khaki); font-family: var(--font-hud); font-size: 1.2rem; line-height: 1.25; }
.doom-launch p[data-state="ok"] { color: var(--hud); }
.doom-launch p[data-state="error"] { color: #ff9a83; }
.arcade.real-wad.running .doom-launch { inset: auto 0 0; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 7px 12px; background: rgba(0, 0, 0, .7); pointer-events: none; }
.arcade.real-wad.running #doom-start { display: none; }
.arcade.real-wad.running .doom-launch p { font-size: 1rem; }
.game-ui { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; margin-top: 16px; }
@media (max-width: 860px) { .game-ui { grid-template-columns: 1fr; } }
.doom-controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.doom-controls .btn { padding: 5px 11px; }
.toggles { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toggles .label { margin-right: 4px; }
.seg { display: inline-flex; border: 2px solid var(--bone); }
.seg button { font-family: var(--font-hud); font-size: 1.2rem; text-transform: uppercase; background: transparent; color: var(--bone); border: 0; padding: 4px 10px 3px; cursor: pointer; line-height: 1.1; }
.seg button + button { border-left: 2px solid var(--bone); }
.seg button[aria-pressed="true"] { background: var(--bone); color: var(--ground); }
.keys { font-family: var(--font-hud); font-size: 1.15rem; color: var(--khaki); line-height: 1.3; }
.keys kbd { font-family: inherit; color: var(--bone); border: 1px solid var(--rule); padding: 0 5px; background: var(--panel); }
.game-rules { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-top: 22px; border-top: 1px solid var(--rule); }
.game-rules > div { padding: 14px 18px 0 0; font-size: .97rem; color: #d8d0cc; display: grid; grid-template-columns: 40px minmax(0,1fr); gap: 12px; align-items: start; }
.game-rules > div + div { padding-left: 18px; border-left: 1px solid var(--rule); }
.game-rules img { width: 40px; image-rendering: pixelated; }
@media (max-width: 760px) { .game-rules { grid-template-columns: 1fr; } .game-rules > div + div { border-left: 0; padding-left: 0; } }
.touchpad { display: none; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: space-between; }
.touchpad .grp { display: flex; gap: 6px; }
.touchpad .grp:last-child { margin-left: auto; }
.touchpad button { width: 56px; height: 52px; font-family: var(--font-hud); font-size: 1.5rem; background: var(--panel-2); color: var(--bone); border: 2px solid var(--rule); touch-action: none; }
@media (hover: none) and (pointer: coarse) { .touchpad { display: flex; } }

/* ───────────── doomgen ───────────── */
.pipeline { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pipeline figure { background: #000; border: 1px solid var(--rule); }
.pipeline img { width: 100%; aspect-ratio: 6/5; object-fit: contain; image-rendering: pixelated; }
.pipeline figcaption { margin: 0; padding: 8px 10px; font-family: var(--font-hud); font-size: 1.2rem; color: var(--bone); border-top: 1px solid var(--rule); line-height: 1.1; }
.pipeline figcaption b { color: var(--hud); font-weight: 400; }
.reroll { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; margin-top: clamp(28px, 4vw, 48px); }
@media (max-width: 860px) { .reroll { grid-template-columns: 1fr; } }
.variant { position: relative; background: #000; border: 1px solid var(--rule); aspect-ratio: 1755 / 1590; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.variant img { width: 100%; height: 100%; object-fit: contain; }
.variant .tag { position: absolute; left: 10px; top: 10px; font-family: var(--font-hud); font-size: 1.3rem; background: rgba(0,0,0,.75); padding: 2px 8px; color: var(--hud); }
.dots { display: flex; gap: 6px; margin-top: 12px; }
.dots button { width: 28px; height: 8px; border: 0; background: var(--rule); cursor: pointer; padding: 0; }
.dots button[aria-current="true"] { background: var(--hud); }

/* difficulty grid */
.axes-grid { display: grid; grid-template-columns: auto repeat(3, minmax(0, 1fr)); gap: 4px; font-family: var(--font-hud); }
.axes-grid .h { font-size: 1.15rem; color: var(--khaki); text-transform: uppercase; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1; padding: 4px; }
.axes-grid .h.row { justify-content: flex-end; padding-right: 10px; }
.cell { border: 0; padding: 14px 6px 10px; text-align: center; color: #120d05; cursor: pointer; font-family: var(--font-hud); line-height: 1; }
.cell .s { font-family: var(--font-display); font-weight: 900; font-size: 2rem; display: block; }
.cell .ci { font-size: 1.05rem; opacity: .8; }
.cell[aria-pressed="true"] { outline: 3px solid var(--bone); outline-offset: -3px; }
.axes-read { margin-top: 14px; min-height: 3.2em; font-size: .98rem; color: #d8d0cc; }
@media (max-width: 520px) {
  .axes-grid { grid-template-columns: minmax(0, .85fr) repeat(3, minmax(0, 1fr)); }
  .cell { padding-inline: 4px; }
  .cell .s { font-size: 1.5rem; }
}

/* ───────────── results ───────────── */
.board-wrap { overflow-x: auto; border: 1px solid var(--rule); background: var(--panel); }
table.board { width: 100%; border-collapse: collapse; min-width: 880px; font-variant-numeric: tabular-nums; }
.board th { font-family: var(--font-hud); font-weight: 400; font-size: 1.2rem; text-transform: uppercase; padding: 10px 6px 8px; line-height: 1; border-bottom: 1px solid var(--rule); cursor: pointer; white-space: nowrap; }
.board th.fam { cursor: default; font-size: 1.05rem; padding-bottom: 2px; border-bottom: 0; }
.board th.on { color: var(--p1); } .board th.off { color: var(--p2); }
.board th.sel { background: var(--panel-2); color: var(--hud); }
.board th:first-child, .board td:first-child { text-align: left; padding-left: 14px; }
.board td { padding: 0 3px; height: 38px; border-bottom: 1px solid rgba(72,70,47,.55); font-family: var(--font-hud); font-size: 1.2rem; text-align: center; position: relative; }
.board td.sn { font-family: var(--font-body); font-size: .95rem; color: var(--bone); white-space: nowrap; padding-right: 12px; }
.board td.ceil { color: var(--khaki); }
.board td .c { position: relative; display: flex; align-items: center; justify-content: center; height: 30px; }
.board td .c .bar { position: absolute; left: 0; bottom: 3px; height: 4px; background: var(--p1); opacity: .9; }
.board td.offc .c .bar { background: var(--p2); }
.board td .c .t { position: relative; color: #cfc6bd; }
.board td.zero .c .t { color: #6d6a52; }
.board td.best .c { outline: 2px solid var(--hud); outline-offset: -2px; }
.board td.best .c .t { color: var(--hud); }
.board td.colsel { background: rgba(238,225,100,.06); }
.board tr:hover td { background: rgba(255,255,255,.03); }
.board-tools { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.board-note { font-size: .9rem; color: var(--khaki); padding: 10px 14px; border-top: 1px solid var(--rule); }
.reaction { display: flex; align-items: center; gap: 14px; }
.reaction img { width: 44px; image-rendering: pixelated; background: #111; padding: 4px; border: 1px solid var(--rule); }
.reaction .hud { font-size: 1.25rem; line-height: 1.1; color: var(--bone); max-width: 36ch; }

/* tug-of-war chart */
.tug { margin-top: clamp(40px, 6vw, 72px); }
.tug-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px; margin-bottom: 12px; }
.tug-head .side { font-family: var(--font-display); font-weight: 900; font-size: clamp(1.4rem, 2.6vw, 2.2rem); text-transform: uppercase; line-height: .9; }
.tug-head .side.l { color: var(--p1); text-align: right; } .tug-head .side.r { color: var(--p2); }
.tug-head .mid { font-family: var(--font-hud); font-size: 1.2rem; color: var(--khaki); text-align: center; line-height: 1.1; }
.tug-rows { position: relative; display: grid; gap: 6px; }
.tug-rows .seam { top: -6px; bottom: -6px; }
.tr { display: grid; grid-template-columns: minmax(0, 1fr) 200px minmax(0, 1fr); align-items: center; gap: 0; }
.tr .lab { font-size: .9rem; text-align: center; color: var(--bone); padding: 0 10px; line-height: 1.15; }
.tr .side { position: relative; height: 22px; }
.tr .side .b { position: absolute; top: 0; bottom: 0; }
.tr .side.l .b { right: 0; background: var(--p1); }
.tr .side.r .b { left: 0; background: var(--p2); }
.tr .side .v { position: absolute; top: 1px; font-family: var(--font-hud); font-size: 1.1rem; line-height: 1; color: var(--bone); white-space: nowrap; }
.tr .side.l .v { right: calc(var(--w) + 8px); }
.tr .side.r .v { left: calc(var(--w) + 8px); }
.tr .side .who { position: absolute; top: 2px; font-family: var(--font-hud); font-size: 1rem; color: #120d05; line-height: 1; }
.tr .side.l .who { right: 6px; } .tr .side.r .who { left: 6px; }
.tr.win-l .lab { color: var(--p1); } .tr.win-r .lab { color: var(--p2); }
@media (max-width: 700px) { .tr { grid-template-columns: minmax(0, 1fr) 110px minmax(0, 1fr); } .tr .lab { font-size: .78rem; } .tr .side .who { display: none; } }

/* findings */
.finds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--bone); }
.find { padding: 22px 22px 6px 0; }
.find + .find { padding-left: 22px; border-left: 1px solid var(--rule); }
.find img { height: 40px; width: auto; image-rendering: pixelated; }
.find h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.8rem; line-height: .95; text-transform: uppercase; margin: 14px 0 10px; text-wrap: balance; }
.find p { font-size: .98rem; color: #d8d0cc; }
.find .next { font-family: var(--font-hud); font-size: 1.2rem; color: var(--hud); line-height: 1.15; }
@media (max-width: 900px) { .finds { grid-template-columns: 1fr; } .find + .find { padding-left: 0; border-left: 0; border-top: 1px solid var(--rule); } }

/* ammo carrier */
.versus { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #060805; border: 1px solid var(--rule); }
.versus .seam { top: 0; bottom: 0; z-index: 2; }
.versus figure { position: relative; }
.versus img, .versus video { width: 100%; aspect-ratio: 1600 / 861; object-fit: contain; }
.versus figcaption { margin: 0; padding: 10px 14px; display: flex; justify-content: space-between; gap: 10px; font-family: var(--font-hud); font-size: 1.3rem; border-top: 1px solid var(--rule); line-height: 1.1; }
@media (max-width: 700px) { .versus { grid-template-columns: 1fr; } .versus .seam { display: none; } }

/* humans vs agents */
.hva { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 4vw, 56px); }
@media (max-width: 860px) { .hva { grid-template-columns: 1fr; } }
.hva h3 { font-family: var(--font-display); font-weight: 900; font-size: 1.9rem; text-transform: uppercase; line-height: .95; margin: 0 0 4px; }
.hbars { display: grid; gap: 7px; margin-top: 14px; }
.hb { display: grid; grid-template-columns: 150px minmax(0, 1fr) 60px; gap: 10px; align-items: center; font-size: .92rem; }
.hb .track { height: 16px; background: rgba(255,255,255,.05); position: relative; }
.hb .fill { position: absolute; inset: 0 auto 0 0; }
.hb.human .fill { background: var(--hud); }
.hb.agent .fill { background: var(--blood); }
.hb.script .fill { background: var(--khaki); }
.hb .val { font-family: var(--font-hud); font-size: 1.2rem; text-align: right; }
.hb.zero .val { color: var(--blood); }

/* small charts */
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-hud); fill: var(--khaki); font-size: 15px; }
.chart .v { fill: var(--bone); }
.chart .hl { fill: var(--hud); }
.chart .grid line { stroke: var(--rule); stroke-width: 1; }

/* media placeholders */
.tapes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .tapes { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .tapes { grid-template-columns: 1fr; } }
.tape { border: 1px solid var(--rule); background: var(--panel); display: flex; flex-direction: column; min-width: 0; }
.tape .scr { position: relative; aspect-ratio: 16/9; background: #0b0b07; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.tape .scr video, .tape .scr img { width: 100%; height: 100%; object-fit: cover; }
.tape .scr.static { background-image: repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px); }
.tape .scr.static img.spr { width: auto; height: 46%; object-fit: contain; image-rendering: pixelated; opacity: .9; }
.tape .scr .soon { position: absolute; top: 10px; left: 10px; font-family: var(--font-hud); font-size: 1.1rem; color: var(--ground); background: var(--hud); padding: 1px 7px; line-height: 1.1; }
.tape .meta { padding: 12px 14px 14px; }
.tape h4 { margin: 0 0 4px; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; line-height: 1; text-transform: uppercase; }
.tape p { margin: 0; font-size: .9rem; color: var(--khaki); line-height: 1.45; }

/* citation */
.cite { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
@media (max-width: 700px) { .cite { grid-template-columns: 1fr; } }
pre.bib { margin: 0; background: #0f0e09; border: 1px solid var(--rule); padding: 20px 22px; overflow-x: auto; font-family: "Source Code Pro", ui-monospace, Menlo, monospace; font-size: .86rem; color: #d8d0cc; line-height: 1.6; }

footer { padding-block: 56px 72px; color: var(--khaki); font-size: .9rem; }
footer .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
@media (max-width: 700px) { footer .wrap { grid-template-columns: 1fr; } }
footer p { max-width: 70ch; }
footer .gg { display: flex; align-items: flex-end; gap: 6px; }
footer .gg img { height: 58px; image-rendering: pixelated; }

[hidden] { display: none !important; }

/* difficulty: the axes figure fills its column like the grid beside it */
.diff { align-items: stretch; }
.diff figure { display: flex; flex-direction: column; }
.diff figure img { width: 100%; height: auto; flex: 1 1 auto; object-fit: contain; }

/* footer: the two marines say GG */
footer .gg { flex-direction: column; align-items: center; gap: 14px; }
footer .gg .duo { display: flex; align-items: flex-end; gap: 6px; }

/* tug of war: no seam through the scenario names; bars leave room for their value */
.tug-rows .seam { display: none; }

/* option switches read as radio choices: the filled marker is the active one */
.seg { border: 0; gap: 4px; }
.seg button, .seg button + button { border: 2px solid var(--rule); color: var(--khaki); display: inline-flex; align-items: center; gap: 8px; }
.seg button::before { content: ""; width: 10px; height: 10px; border: 2px solid currentColor; box-sizing: border-box; flex: none; }
.seg button:hover { color: var(--bone); border-color: var(--khaki); }
.seg button[aria-pressed="true"] { color: var(--ground); background: var(--bone); border-color: var(--bone); }
.seg button[aria-pressed="true"]::before { background: var(--p1); border-color: var(--p1); }
