/* Research-preview site: shared styles. Palette = validated reference palette (site/SPEC.md, src/qamar/plots/style.py). */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --card: #ffffff;
  --ink: #0b0b0b;
  --ink-2: #52514e;
  --muted: #6f6e69;
  --axis: #898781;
  --grid: #e1e0d9;
  --baseline: #c3c2b7;
  --border: rgba(11, 11, 11, 0.10);
  --wash: #f1f0ec;
  --accent: #2a78d6;
  --accent-d: #1c5cab;
  --nav-border: rgba(11, 11, 11, 0.14);
  --nav-border-hover: rgba(11, 11, 11, 0.26);
  --link: #1c5cab;
  --good: #006300;
  --warn-bg: #fff6e0;
  --crit: #d03b3b;
  /* models (categorical slots 1-5, fixed order) */
  --m-opt: #2a78d6;
  --m-optp: #eb6834;
  --m-lin: #1baf7a;
  --m-quad: #eda100;
  --m-fixed: #e87ba4;
  /* ordinal blue ramp (published -> faithful -> corrected) */
  --o1: #86b6ef;
  --o2: #2a78d6;
  --o3: #104281;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 4px 16px rgba(0, 0, 0, .04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d0d0d; --surface: #1a1a19; --card: #161615; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a9890;
    --axis: #898781; --grid: #2c2c2a; --baseline: #383835; --border: rgba(255, 255, 255, 0.10); --wash: #232321;
    --accent: #3987e5; --accent-d: #1c5cab; --nav-border: rgba(255, 255, 255, 0.16); --nav-border-hover: rgba(255, 255, 255, 0.30); --link: #86b6ef; --good: #0ca30c; --warn-bg: #2a2310; --crit: #e66767;
    --m-opt: #3987e5; --m-optp: #d95926; --m-lin: #199e70; --m-quad: #c98500; --m-fixed: #d55181;
    --o1: #184f95; --o2: #3987e5; --o3: #9ec5f4;
    --shadow: none;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d0d0d; --surface: #1a1a19; --card: #161615; --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a9890;
  --axis: #898781; --grid: #2c2c2a; --baseline: #383835; --border: rgba(255, 255, 255, 0.10); --wash: #232321;
  --accent: #3987e5; --accent-d: #1c5cab; --nav-border: rgba(255, 255, 255, 0.16); --nav-border-hover: rgba(255, 255, 255, 0.30); --link: #86b6ef; --good: #0ca30c; --warn-bg: #2a2310; --crit: #e66767;
  --m-opt: #3987e5; --m-optp: #d95926; --m-lin: #199e70; --m-quad: #c98500; --m-fixed: #d55181;
  --o1: #184f95; --o2: #3987e5; --o3: #9ec5f4;
  --shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 16px/1.6 var(--font); overflow-x: hidden;
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; height: auto; display: block; }
code, .mono { font-family: var(--mono); font-size: .88em; }
h1, h2, h3 { line-height: 1.25; text-wrap: balance; }
h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); margin: .2em 0 .35em; letter-spacing: -.01em; }
h2 { font-size: 1.4rem; margin: 2.4em 0 .5em; padding-top: .2em; }
h3 { font-size: 1.08rem; margin: 1.6em 0 .4em; }
p, li { text-wrap: pretty; }
hr { border: 0; border-top: 1px solid var(--grid); margin: 2.5em 0; }
small, .small { font-size: .86rem; }
.muted { color: var(--muted); }
.ink2 { color: var(--ink-2); }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1160px; margin: 0 auto; padding: 0 16px; display: flex; align-items: center; gap: 12px; min-height: 52px;
}
.brand { font-weight: 650; color: var(--ink); text-decoration: none; white-space: nowrap; font-size: .95rem; }
.brand span { color: var(--muted); font-weight: 450; }
/* nav items are pills: visible resting fill + border, hover lift, focus ring, a solid current-page pill with a small lip
   (the same 3D language as the game buttons, kept quiet so it never competes with a Play button) */
.nav-scroll { margin-left: auto; min-width: 0; position: relative; }
.nav-links { display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; flex-wrap: nowrap; }
.nav-links li { flex: none; }
.nav-links a {
  display: block; padding: 5px 12px; border-radius: 999px; color: var(--ink-2); text-decoration: none; font-size: .88rem;
  font-weight: 550; white-space: nowrap; background: var(--card); border: 1px solid var(--nav-border);
  box-shadow: 0 2px 0 var(--nav-border); transition: background .12s, color .12s, transform .12s, box-shadow .12s;
}
.nav-links a:hover { background: var(--wash); color: var(--ink); border-color: var(--nav-border-hover);
  box-shadow: 0 3px 0 var(--nav-border-hover); transform: translateY(-1px); }
.nav-links a:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--nav-border-hover); }
.nav-links a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nav-links a[aria-current="page"] { color: #fff; background: var(--accent); border-color: var(--accent-d); font-weight: 650;
  box-shadow: 0 2px 0 var(--accent-d); }
.nav-links a[aria-current="page"]:hover { background: var(--accent); color: #fff; }
.icon-btn {
  border: 1px solid var(--nav-border); background: var(--card); color: var(--ink-2); border-radius: 999px;
  width: 34px; height: 34px; display: inline-grid; place-items: center; cursor: pointer; flex: none;
  box-shadow: 0 2px 0 var(--nav-border);
}
.icon-btn:hover { color: var(--ink); background: var(--wash); }
.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.icon-btn svg { width: 17px; height: 17px; }
@media (prefers-reduced-motion: reduce) { .nav-links a { transition: none; } .nav-links a:hover, .nav-links a:active { transform: none; } }
/* narrow screens: brand + theme button on the first line, the pills as one scrollable row below, with edge fades */
@media (max-width: 1180px) {
  .nav-inner { flex-wrap: wrap; row-gap: 0; padding-top: 8px; }
  .theme-btn { margin-left: auto; }
  .nav-scroll { order: 3; flex: 0 0 calc(100% + 32px); margin: 6px -16px 0; }
  .nav-links { overflow-x: auto; padding: 4px 16px 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-scroll::before, .nav-scroll::after { content: ""; position: absolute; top: 0; bottom: 6px; width: 36px; pointer-events: none;
    opacity: 0; transition: opacity .15s; z-index: 1; }
  .nav-scroll::before { left: 0; background: linear-gradient(to right, var(--page), transparent); }
  .nav-scroll::after { right: 0; background: linear-gradient(to left, var(--page), transparent); }
  .nav-scroll.more-left::before, .nav-scroll.more-right::after { opacity: 1; }
}

/* ---------- layout ---------- */
main { padding: 0 16px 48px; }
.wrap { max-width: 1160px; margin: 0 auto; }
.prose { max-width: 760px; }
.hero { padding: 40px 0 8px; }
.kicker { text-transform: uppercase; letter-spacing: .07em; font-size: .76rem; color: var(--muted); font-weight: 600; margin: 0; }
.lede { font-size: 1.13rem; color: var(--ink-2); max-width: 760px; }
.toc { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .9rem; margin: 18px 0 0; padding: 0; list-style: none; }
.toc a { color: var(--ink-2); }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; box-shadow: var(--shadow);
  min-width: 0;
}
.card h3 { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }
a.card { color: inherit; text-decoration: none; display: block; transition: border-color .15s; }
a.card:hover { border-color: var(--axis); }

.stat .label { font-size: .84rem; color: var(--ink-2); margin: 0 0 4px; font-weight: 550; }
.stat .value { font-size: 2rem; font-weight: 650; letter-spacing: -.02em; line-height: 1.15; }
.stat .value small { font-size: .95rem; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }
.stat .sub { font-size: .9rem; color: var(--ink-2); margin: 6px 0 0; }
.stat .more { font-size: .85rem; margin-top: 10px; display: inline-block; }

.callout {
  border-left: 3px solid var(--accent); background: var(--card); padding: 12px 16px; border-radius: 0 10px 10px 0;
  margin: 1.2em 0; border-top: 1px solid var(--border); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.callout.warn { border-left-color: #eda100; }
.callout.crit { border-left-color: var(--crit); }
.callout p { margin: .35em 0; }
.pending {
  border: 1px dashed var(--baseline); border-radius: 10px; padding: 14px 16px; color: var(--muted); background: transparent;
  font-size: .95rem;
}
.pending::before { content: "Result pending · "; font-weight: 600; color: var(--ink-2); }
.pill {
  display: inline-block; font-size: .74rem; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border);
  color: var(--ink-2); white-space: nowrap; font-weight: 550; vertical-align: 1px;
}
.sev { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: .84rem; font-weight: 550; }
.sev i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.sev-High i { background: #d03b3b; }
.sev-Medium i { background: #ec835a; }
.sev-Low i { background: var(--baseline); }
.sev-Doc i { background: transparent; border: 1.5px solid var(--axis); }
.sev-Own i { background: #6250d6; }

/* ---------- figures & charts ---------- */
figure { margin: 1.4em 0; }
figure img { border-radius: 8px; border: 1px solid var(--border); background: #fcfcfb; }
figcaption { font-size: .88rem; color: var(--ink-2); margin-top: 8px; max-width: 760px; }
.fig-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 16px 10px; margin: 1.2em 0; min-width: 0; }
.chart-card h3 { margin: 0 0 2px; font-size: 1rem; }
.chart-card .sub { margin: 0 0 10px; font-size: .88rem; color: var(--ink-2); }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { fill: var(--muted); font: 12px var(--font); }
.chart .tick text { font-variant-numeric: tabular-nums; }
.chart .lbl { fill: var(--ink-2); }
.chart .lbl-strong { fill: var(--ink); font-weight: 600; }
.chart .grid line { stroke: var(--grid); stroke-width: 1; }
.chart .axis-line { stroke: var(--baseline); stroke-width: 1; }
.chart .hit { fill: transparent; cursor: default; }
.chart .mark { transition: opacity .12s; }
.chart .dim .mark { opacity: .35; }
.chart .mark.hl { opacity: 1 !important; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .84rem; color: var(--ink-2); margin: 4px 0 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.legend i.line { height: 2px; width: 16px; border-radius: 1px; }
.legend i.dot { width: 10px; height: 10px; border-radius: 50%; }
.legend i.ring { width: 10px; height: 10px; border-radius: 50%; background: transparent !important; border: 2px solid; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 12px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--card); flex-wrap: wrap; }
.seg button {
  border: 0; background: transparent; padding: 5px 11px; font: inherit; font-size: .86rem; color: var(--ink-2); cursor: pointer;
  border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--page); }
select { font: inherit; font-size: .88rem; padding: 4px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--ink); }

.tooltip {
  position: fixed; z-index: 50; pointer-events: none; background: var(--card); color: var(--ink); border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 10px; font-size: .82rem; line-height: 1.4; box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
  max-width: 300px; opacity: 0; transition: opacity .08s;
}
.tooltip.show { opacity: 1; }
.tooltip .tt-title { color: var(--ink-2); font-size: .78rem; margin-bottom: 3px; }
.tooltip .tt-row { display: flex; align-items: center; gap: 7px; }
.tooltip .tt-row b { font-variant-numeric: tabular-nums; }
.tooltip .tt-key { width: 12px; height: 2px; border-radius: 1px; flex: none; }
.tooltip .tt-note { color: var(--muted); font-size: .76rem; margin-top: 3px; }
.tooltip .tt-body { color: var(--ink); font-size: .84rem; }
/* table cells with a hover / tap / keyboard description (meta page subagent table) */
.has-tip { cursor: help; border-bottom: 1px dotted var(--axis); border-radius: 2px; }
.has-tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.has-tip[aria-expanded="true"] { background: var(--wash); }
.has-tip .tip-i { display: inline-block; margin-left: 5px; color: var(--muted); font-size: .8em; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--card); margin: 1em 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .87rem; }
th, td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--grid); vertical-align: top; }
th { font-weight: 600; color: var(--ink-2); background: var(--surface); position: sticky; top: 0; font-size: .82rem; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.best { font-weight: 650; }
.delta { color: var(--muted); font-size: .8em; display: block; }
.delta.big { color: var(--ink); font-weight: 600; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
details { margin: 1em 0; }
details > summary { cursor: pointer; color: var(--ink-2); font-weight: 550; }
details[open] > summary { margin-bottom: .5em; }

/* ---------- timeline ---------- */
.log-list { list-style: none; padding: 0; margin: 0; border-left: 2px solid var(--grid); }
.log-list li { position: relative; padding: 4px 0 10px 18px; font-size: .92rem; }
.log-list li::before { content: ""; position: absolute; left: -6px; top: 11px; width: 10px; height: 10px; border-radius: 50%; background: var(--card); border: 2px solid var(--axis); }
.log-list li.user::before { background: var(--m-optp); border-color: var(--m-optp); }
.log-list li.fix::before { background: var(--crit); border-color: var(--crit); }
.log-list .t { font-family: var(--mono); font-size: .78rem; color: var(--muted); margin-right: 6px; }
.log-list .tag { font-weight: 600; }

/* ---------- generative model diagram ---------- */
.gm { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 1em 0; }
.gm .node { border: 1.5px solid var(--ink-2); border-radius: 999px; padding: 6px 14px; background: var(--card); font-weight: 600; }
.gm .arrow { color: var(--muted); }
.gm .node small { font-weight: 450; color: var(--ink-2); }

.map-frame { width: 100%; height: 760px; border: 1px solid var(--border); border-radius: 12px; background: #fcfcfb; display: block; }
@media (max-width: 800px) { .map-frame { height: 1100px; } }

footer.site-footer { border-top: 1px solid var(--border); padding: 20px 16px 32px; color: var(--muted); font-size: .84rem; }
footer.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: space-between; }

@media (max-width: 600px) {
  body { font-size: 15.5px; }
  .hero { padding-top: 24px; }
  h2 { margin-top: 2em; }
  .card { padding: 14px 16px; }
  .stat .value { font-size: 1.7rem; }
  .chart-card { padding: 12px 10px 8px; }
}
@media (forced-colors: active) { .legend i, .swatch { forced-color-adjust: none; } }
.card h3 .pill { display: table; margin-bottom: 6px; }
@media (max-width: 600px) { td:first-child { min-width: 7.5em; } }
@media (max-width: 700px) {
  table.stack thead { display: none; }
  table.stack, table.stack tbody { display: block; }
  table.stack tr { display: block; padding: 10px 12px; border-bottom: 1px solid var(--grid); }
  table.stack tr:last-child { border-bottom: 0; }
  table.stack td { display: block; border: 0; padding: 2px 0; min-width: 0; text-align: left; white-space: normal; }
  table.stack td[data-label]::before { content: attr(data-label) " · "; color: var(--muted); font-size: .8em; font-weight: 600; }
}

/* ---------- lightbox (click a figure / "Expand" a chart) ---------- */
figure img { cursor: zoom-in; }
.chart-card { position: relative; }
.expand-btn { position: absolute; top: 10px; right: 10px; border: 1px solid var(--border); background: var(--card);
  color: var(--ink-2); border-radius: 6px; padding: 3px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.expand-btn:hover { color: var(--ink); }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 10px; padding: 3vh 3vw; background: rgba(10, 10, 10, 0.82); cursor: zoom-out; }
.lightbox[hidden] { display: none; }
.lightbox .lb-content { max-width: 94vw; max-height: 86vh; display: flex; align-items: center; justify-content: center; }
.lightbox img { max-width: 94vw; max-height: 86vh; width: auto; height: auto; border-radius: 8px; background: #fcfcfb;
  cursor: default; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.lightbox .lb-chart { background: var(--card); border-radius: 10px; padding: 18px; width: min(94vw, 1500px);
  max-height: 86vh; overflow: auto; cursor: default; }
.lightbox .lb-chart svg { width: 100%; height: auto; max-height: 80vh; }
.lightbox .lb-caption { color: #f0efec; font-size: 14px; max-width: 90vw; text-align: center; }
.lightbox .lb-close { position: fixed; top: 14px; right: 18px; border: none; background: rgba(255,255,255,.12);
  color: #fff; font-size: 22px; line-height: 1; width: 38px; height: 38px; border-radius: 50%; cursor: pointer; }
.lightbox .lb-close:hover { background: rgba(255,255,255,.25); }
body.lb-open { overflow: hidden; }

/* ---------- games page: card tabs + the chunky in-game Play button ---------- */
/* Lilita One (c) 2011 Juan Montoreano, SIL Open Font License 1.1 (assets/fonts/CREDITS.txt); the game's display font */
@font-face { font-family: "Lilita One"; src: url(fonts/lilita-one-latin-400.woff2) format("woff2"); font-display: swap; }
.pick-label { margin: 22px 0 8px; font-size: .78rem; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.game-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 18px; }
.game-tabs [role="tab"] {
  position: relative; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 10px 12px; text-align: left;
  font: inherit; color: var(--ink); background: var(--card); border: 1px solid var(--nav-border); border-radius: 14px;
  box-shadow: 0 3px 0 var(--nav-border); cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .12s, background .12s;
}
.game-tabs [role="tab"]:hover { transform: translateY(-2px); border-color: var(--nav-border-hover); box-shadow: 0 5px 0 var(--nav-border-hover); }
.game-tabs [role="tab"]:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--nav-border-hover); }
.game-tabs [role="tab"]:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.game-tabs [role="tab"][aria-selected="true"] {
  border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card));
  box-shadow: 0 0 0 1px var(--accent), 0 3px 0 var(--accent-d);
}
.game-tabs [role="tab"][aria-selected="true"]::after {   /* pointer joining the selected tab to its panel */
  content: ""; position: absolute; left: 50%; bottom: -13px; transform: translateX(-50%);
  border: 9px solid transparent; border-bottom: 0; border-top-color: var(--accent);
}
.gt-thumb { flex: none; width: 52px; height: 52px; border-radius: 12px; overflow: hidden; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); }
.gt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gt-thumb svg { width: 34px; height: 34px; }
.gt-brain-type { background: linear-gradient(135deg, #e87ba4, #6250d6); }
.gt-foggy-four { background: linear-gradient(135deg, #86b6ef, #1c5cab); }
.gt-hidden-nest { background: linear-gradient(135deg, #eda100, #1baf7a); }
.gt-text { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; min-width: 0; }
.gt-title { font-weight: 650; font-size: .98rem; line-height: 1.2; }
.gt-chip { font-size: .72rem; font-weight: 650; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--wash);
  color: var(--ink-2); white-space: nowrap; }
.gt-chip.is-play { background: #dcf6e4; color: #12693a; }
:root[data-theme="dark"] .gt-chip.is-play { background: #143d24; color: #8ff0a8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gt-chip.is-play { background: #143d24; color: #8ff0a8; } }
.game-panel { padding: 8px 24px 4px; background: var(--card); border: 1px solid var(--border); border-top: 3px solid var(--accent);
  border-radius: 16px; max-width: none; }
.game-panel h2 { margin-top: .3em; }
.game-panel p { max-width: 78ch; }
.game-panel .question { font-size: 1.08rem; color: var(--ink); border-left: 3px solid var(--accent); padding-left: 12px; }
.play-row { margin: 26px 0 30px; text-align: center; }
.play-btn3d {
  --pb-ink: #2a1b2d; --pb-lip: #1f9a48;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 12px; max-width: 100%; white-space: nowrap;
  padding: 12px 34px 15px; border: 3px solid var(--pb-ink); border-radius: 22px; overflow: hidden;
  font: 30px/1 "Lilita One", "Arial Rounded MT Bold", var(--font); letter-spacing: .04em; text-transform: uppercase;
  color: #fff; text-decoration: none;
  -webkit-text-stroke: 4px var(--pb-ink); paint-order: stroke fill;
  background: linear-gradient(#5fe384, #3fcf6a);
  box-shadow: 0 6px 0 var(--pb-lip), 0 9px 0 var(--pb-ink), 0 16px 24px rgba(0, 0, 0, .16);
  transition: transform .08s ease-out, box-shadow .08s ease-out, filter .12s;
}
.play-btn3d::after {   /* glossy top highlight, as in the game */
  content: ""; position: absolute; left: 10px; right: 10px; top: 4px; height: 38%; border-radius: 14px;
  background: rgba(255, 255, 255, .28); pointer-events: none;
}
.play-btn3d .pb-ico { width: 28px; height: 28px; flex: none; fill: #fff; stroke: var(--pb-ink); stroke-width: 2.5px;
  paint-order: stroke fill; stroke-linejoin: round; }
.play-btn3d:hover { transform: translateY(-2px); filter: brightness(1.05);
  box-shadow: 0 8px 0 var(--pb-lip), 0 11px 0 var(--pb-ink), 0 20px 28px rgba(0, 0, 0, .2); }
.play-btn3d:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--pb-lip), 0 4px 0 var(--pb-ink), 0 6px 10px rgba(0, 0, 0, .14); }
.play-btn3d:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; }
:root[data-theme="dark"] .play-btn3d { box-shadow: 0 6px 0 var(--pb-lip), 0 9px 0 #000, 0 0 0 1px rgba(255, 255, 255, .06), 0 16px 28px rgba(0, 0, 0, .5); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .play-btn3d {
  box-shadow: 0 6px 0 var(--pb-lip), 0 9px 0 #000, 0 0 0 1px rgba(255, 255, 255, .06), 0 16px 28px rgba(0, 0, 0, .5); } }
@media (prefers-reduced-motion: reduce) {
  .play-btn3d, .game-tabs [role="tab"] { transition: none; }
  .play-btn3d:hover, .play-btn3d:active, .game-tabs [role="tab"]:hover, .game-tabs [role="tab"]:active { transform: none; }
}
.soon { display: inline-block; border: 1px dashed var(--axis); color: var(--ink-2); padding: 8px 14px; border-radius: 10px; font-weight: 550; }
@media (max-width: 720px) {
  .game-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .game-tabs [role="tab"] { gap: 10px; padding: 9px 10px; }
  .game-tabs [role="tab"][aria-selected="true"]::after { display: none; }
  .gt-thumb { width: 44px; height: 44px; border-radius: 10px; }
  .gt-thumb svg { width: 28px; height: 28px; }
  .game-panel { padding: 4px 16px 2px; }
  .play-btn3d { font-size: 21px; letter-spacing: .02em; padding: 11px 20px 13px; border-radius: 18px; gap: 9px; -webkit-text-stroke-width: 3.5px; }
  .play-btn3d .pb-ico { width: 22px; height: 22px; }
}

/* ---------- prompts page ---------- */
.prompt-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; margin-top: 18px; }
.prompt-card { background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); min-width: 0; }
.prompt-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px;
  border-bottom: 1px solid var(--border); font-size: .84rem; color: var(--ink-2); font-weight: 600; }
.copy-btn { border: 1px solid var(--border); background: var(--page); color: var(--ink); border-radius: 8px; padding: 5px 10px;
  font: inherit; font-size: .82rem; cursor: pointer; }
.copy-btn:hover { background: var(--wash); }
.prompt-body { padding: 6px 22px 18px; max-width: 760px; }
.prompt-pre { margin: 0; padding: 18px 22px 22px; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: .86rem; line-height: 1.55;
  color: var(--ink); background: var(--code-bg, rgba(127,127,127,.08)); border-radius: 0 0 12px 12px; max-height: 75vh; overflow-y: auto; }
.prompt-pre:focus { outline: 2px solid var(--accent, #3b6fd8); outline-offset: -2px; }
.prompt-body h2 { font-size: 1.3rem; margin: .8em 0 .3em; }
.prompt-body h3 { font-size: 1.02rem; margin: 1.4em 0 .3em; }
.prompt-body li { margin: .2em 0; }
.prompt-side { position: sticky; top: 70px; font-size: .92rem; }
.prompt-side h2 { font-size: 1.02rem; margin: 0 0 .5em; padding: 0; }
.prompt-side ul { padding-left: 1.1em; margin: 0; }
.prompt-side li { margin: .45em 0; }
.lede p { margin: .4em 0; }
@media (max-width: 900px) {
  .prompt-layout { grid-template-columns: 1fr; }
  .prompt-side { position: static; }
  .prompt-body { padding: 4px 16px 14px; }
}

/* ---------- math (KaTeX, pre-rendered at build time by tools/katex/render_math.mjs) ---------- */
.katex { font-size: 1.06em; }
.math-block { margin: .6em 0 1em; }
.math-display { overflow-x: auto; overflow-y: hidden; max-width: 100%; padding: 2px 0 6px; -webkit-overflow-scrolling: touch; }
.math-display .katex-display { margin: .4em 0; }
.gm .katex { font-size: 1em; }

/* ---------- meta page: agent failure modes ---------- */
.failure-modes .card ul { padding-left: 1.1em; margin: .4em 0 .6em; font-size: .93rem; }
.failure-modes .card li { margin: .25em 0; }
.failure-modes .card p { margin: .45em 0; font-size: .95rem; }
details.incident-log { margin: 16px 0 8px; max-width: 900px; }
details.incident-log summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
details.incident-log ol { font-size: .92rem; padding-left: 1.4em; }
details.incident-log li { margin: .3em 0; }
