:root {
  color-scheme: dark;
  --bg: #14110c;
  --panel: #1e1a14;
  --ink: #f3e6c8;
  --muted: #b7a88a;
  --line: #3a3224;
  --ok: #d7b56d;
  --bad: #d36c4f;
  --idle: #8d7f64;
  font-family: "Iosevka", "IBM Plex Mono", "ui-monospace", monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); min-height: 100%; }
body { display: flex; flex-direction: column; min-height: 100vh; }

.top {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0; color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; font-size: 0.7rem; }
h1, h2 { margin: 0.15rem 0 0; font-weight: 600; }
h1 { font-size: 1.4rem; }
h2 { font-size: 0.85rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 1.25rem; }
#status { margin: 0; color: var(--ok); }
#status[data-tone="bad"] { color: var(--bad); }
#status[data-tone="idle"] { color: var(--idle); }

main { padding: 1.25rem 1.5rem 2rem; flex: 1; }
.layout { display: grid; grid-template-columns: minmax(16rem, 22rem) 1fr; gap: 1.25rem; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 1rem 1.1rem 1.2rem; }
dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.8rem; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.caps { list-style: none; margin: 0.4rem 0 0; padding: 0; font-size: 0.78rem; }
.caps li { padding: 0.15rem 0; border-bottom: 1px solid #2a241a; }
.world-wrap { margin: 0; position: relative; }
canvas {
  display: block;
  width: 100%;
  height: auto;
  background: #0b0a08;
  border: 1px solid var(--line);
  image-rendering: pixelated;
}
figcaption { color: var(--muted); font-size: 0.75rem; margin-top: 0.5rem; }
#incompatible { max-width: 40rem; }

@media (max-width: 840px) {
  .layout { grid-template-columns: 1fr; }
}

.stack {
  display: grid;
  gap: 16px;
  align-content: start;
}

.fields {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px;
}

.fields li {
  border: 1px dashed currentColor;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 0.85rem;
  opacity: 0.7;
}

.fields li::after {
  content: " · pending";
  opacity: 0.6;
}

.flow {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  line-height: 1.6;
}

.note {
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.8;
}

/* FULL_VIEW: the world canvas keeps a 16:9 box; its backing store follows the box at the
   device pixel ratio, clamped by the frozen ClientCompatibilityProfile. */
.full-view #world { aspect-ratio: 16 / 9; height: auto; }

/* Release playtest page (?release=playtest): its own header, the language selector, the
   refusal or error notice, the Hub and the Session. Controls meet the 24 x 24 px target and
   show focus (WCAG 2.2 SC 2.5.8 and 2.4.7); the Hub keeps its own focus style. */
.release { display: grid; gap: 1rem; max-width: 72rem; }
.release[hidden], .release [hidden], .top[hidden] { display: none; }
/* The Hub draws a light card: its native controls and headings follow it, not the dark shell. */
#release-hub .release-hub { color-scheme: light; }
#release-hub h1, #release-hub h2 { color: inherit; }
.release-top { padding: 0 0 0.75rem; }
.release-top #release-status { margin: 0; color: var(--ok); }
.release-top #release-status[data-tone="bad"] { color: var(--bad); }
.release-locale { display: flex; align-items: center; gap: 0.6rem; }
.release-locale label { color: var(--ink); }
.release select,
.release #release-session button {
  font: inherit;
  min-height: 24px;
  min-width: 24px;
  padding: 0.3rem 0.6rem;
}
.release select { color: var(--ink); background: var(--panel); border: 1px solid var(--muted); }
.release #release-session button { color: var(--bg); background: var(--ink); border: 1px solid var(--ink); cursor: pointer; }
.release #release-session button:disabled { opacity: 0.6; cursor: default; }
.release input[type="checkbox"],
.release input[type="radio"] { width: 24px; height: 24px; margin: 0 0.4rem 0 0; }
.release-locale :focus-visible,
#release-session :focus-visible,
#release-notice :focus-visible { outline: 3px solid var(--ok); outline-offset: 2px; }
#release-session > section { display: grid; gap: 0.5rem; }
#release-session form { display: grid; gap: 0.5rem; max-width: 24rem; }
#release-session label { display: grid; gap: 0.25rem; color: var(--ink); }
#release-session > section > div { display: flex; flex-wrap: wrap; gap: 0.5rem; }
#release-notice { border: 1px solid var(--bad); padding: 1rem 1.1rem; background: var(--panel); }
#release-notice h1 { font-size: 1.2rem; margin: 0 0 0.5rem; }
#release-attribution { color: var(--muted); font-size: 0.8rem; margin: 0; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The release hunt view: the mode toggle (24 x 24 px targets, visible focus, pressed state
   in text and colour), the canvas's figure and the SUMMARY_VIEW panel beside it. */
.release-hunt { display: grid; gap: 0.75rem; }
.release-hunt-modes { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.release-hunt-modes button { font: inherit; min-height: 24px; min-width: 24px; padding: 0.3rem 0.7rem; color: var(--ink); background: var(--panel); border: 1px solid var(--muted); cursor: pointer; }
.release-hunt-modes button[aria-pressed="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.release-hunt-modes button[aria-disabled="true"] { opacity: 0.6; cursor: default; }
.release-hunt-modes :focus-visible, #release-summary :focus-visible { outline: 3px solid var(--ok); outline-offset: 2px; }
#release-hunt-status, #release-hunt-reason { margin: 0; }
#release-hunt-reason { color: var(--muted); }
.release-hunt-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr); gap: 1rem; align-items: start; }
/* SUMMARY_VIEW hides the canvas's figure: the panel then takes the whole row. */
.release-hunt-body:has(> .release-hunt-stage > [hidden]) { grid-template-columns: minmax(0, 1fr); }
.release-hunt-body:has(> .release-hunt-stage > [hidden]) > .release-hunt-stage { display: none; }
.release-hunt-stage .world-wrap { margin: 0; }
.release-summary { background: var(--panel); padding: 0.8rem 1rem; }
.release-summary h3, .release-summary h4 { margin: 0 0 0.4rem; }
.release-summary dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0.25rem 0.75rem; margin: 0.5rem 0; }
.release-summary dt { color: var(--muted); }
.release-summary dd { margin: 0; }
.release-summary .summary-code { color: var(--muted); font-size: 0.85em; }
.release-summary ol { margin: 0; padding-left: 1.2rem; }
