/* The training game. One game window (bar, stage) on a quiet desk, with dark scenes inside the stage.
   Every colour is a variable set here in :root, and only here: a theme can change them all later.
   The default is a neutral slate-and-teal look with AA contrast. No images, no fonts from elsewhere. */
:root {
  color-scheme: light;
  --desk: #E6EBEF;
  --ui: #FFFFFF;
  --ink: #17212B;
  --muted: #4F5B67;
  --line: #D3DBE2;
  --soft: #EDF2F5;
  --accent: #0E5E6F;
  --accent-2: #3FA7BD;
  --on-accent: #FFFFFF;
  --risk: #B3261E;
  --risk-soft: #FBE9E7;
  --night: #101820;
  --night-2: #1E2C38;
  --on-night: #E8EEF2;
  --on-night-muted: #A7B4BF;
  --night-line: #3A4B59;
  --night-hover: #263845;
  --door-1: #C9D3DB;
  --door-2: #EEF2F5;
  --wire: #8A98A5;
  --sys-bar: #F1F2F4;
  --sys-ink: #3C4148;
  --shadow: rgba(16, 24, 32, 0.45);
  --veil: rgba(16, 24, 32, 0.55);
  --glow: rgba(14, 94, 111, 0.35);
  --f-display: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", system-ui, sans-serif;
  --f-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --f-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  /* Three more, for the pack's theme (FORMATO r0 §5); neutral here. */
  --cctv: #9FD8C9;
  --glitch: #B3261E;
  --img-vault-bg: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0; background: var(--desk); color: var(--ink);
  font-family: var(--f-body); font-size: 16px; line-height: 1.5;
  padding: 20px 16px 60px;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--f-display); margin: 0; line-height: 1.1; text-wrap: balance; overflow-wrap: anywhere; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
/* A heading takes the focus when a screen changes: it must not look like a box to type in. */
h1:focus, h2:focus, main:focus { outline: none; }
h1:focus-visible, h2:focus-visible {
  outline: none; text-decoration: underline; text-decoration-color: var(--accent-2);
  text-decoration-thickness: 3px; text-underline-offset: 6px;
}

.skip {
  position: absolute; left: 8px; top: -60px; z-index: 60;
  background: var(--ui); color: var(--ink); padding: 8px 12px; border-radius: 8px;
}
.skip:focus { top: 8px; }

/* The game window */
.win {
  max-width: 1100px; margin: 0 auto; background: var(--ui); border-radius: 14px;
  box-shadow: 0 0 0 1px var(--line), 0 24px 60px -36px var(--shadow);
  overflow: hidden; overflow: clip; position: relative;
}
.hud {
  position: sticky; top: 0; z-index: 10; background: var(--ui);
  display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap;
  padding: 12px 18px; border-bottom: 1px solid var(--line);
}
.hud-left { display: grid; min-width: 0; }
.op {
  font-family: var(--f-mono); font-weight: 600; font-size: .76rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent);
}
.where { font-size: .92rem; color: var(--muted); min-width: 0; }
.hud-right { margin-left: auto; display: flex; gap: 10px 16px; align-items: center; flex-wrap: wrap; }
.hud-item { display: flex; gap: 6px; align-items: center; }
.hud-label { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pips { display: flex; gap: 4px; flex-wrap: wrap; }
.pip { width: 13px; height: 13px; border-radius: 3px; border: 2px solid var(--accent); }
.pip.on { background: var(--accent); }
.pip.miss { border-color: var(--risk); background: repeating-linear-gradient(45deg, var(--risk) 0 2px, transparent 2px 5px); }
.code { display: flex; gap: 4px; align-items: center; }
.code b {
  width: 22px; height: 26px; border-radius: 4px; border: 1.5px dashed var(--wire);
  display: grid; place-items: center; font-family: var(--f-mono); color: var(--accent); font-size: .9rem;
}
.code b.got { border-style: solid; border-color: var(--accent); background: var(--soft); }
.clock {
  font-family: var(--f-mono); font-weight: 600; font-size: 1.1rem; font-variant-numeric: tabular-nums;
  background: var(--soft); color: var(--accent); padding: 4px 12px; border-radius: 8px; transition: background .3s;
  white-space: nowrap;
}
.clock-state { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 600; }
.clock.stopped { color: var(--muted); }
.clock.low { background: var(--risk); color: var(--on-accent); }

.stage { min-height: 560px; position: relative; display: flex; flex-direction: column; }
.stage > section { flex: 1; }
.live:empty { display: none; }
.live {
  margin: 14px 18px 0; padding: 10px 14px; border-radius: 10px;
  background: var(--soft); color: var(--ink);
}
.problem {
  margin: 14px 18px 0; padding: 10px 14px; border-radius: 10px; font-weight: 600;
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
  border: 2px solid var(--risk); background: var(--risk-soft); color: var(--ink);
}

/* Shared pieces */
.pad { padding: 26px clamp(18px, 4vw, 40px); display: grid; gap: 16px; align-content: start; }
.narrow > * { max-width: 640px; }
.eyebrow {
  display: block; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.h-xl { font-size: clamp(2.2rem, 6vw, 4.2rem); font-weight: 800; font-stretch: condensed; text-transform: uppercase; letter-spacing: -.01em; }
.h-l { font-size: clamp(1.5rem, 3.4vw, 2.2rem); font-weight: 800; font-stretch: condensed; }
.h-m { font-size: 1.35rem; font-weight: 800; }
.lede { color: var(--muted); max-width: 64ch; }
.small { font-size: .9rem; color: var(--muted); }
.prompt { font-size: 1.05rem; max-width: 70ch; }
.notice { font-weight: 700; border-left: 4px solid var(--accent); padding-left: 10px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.btn {
  border: 0; background: var(--accent); color: var(--on-accent); font-weight: 700;
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px -10px var(--glow); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 2px var(--accent); }
.btn.small { min-height: 36px; padding: 6px 14px; font-size: .88rem; }
.btn.quiet { box-shadow: none; text-decoration: underline; text-underline-offset: 3px; padding-inline: 8px; }
.btn.light { background: var(--on-night); color: var(--night); }
.btn.ghost-light { background: transparent; color: var(--on-night); box-shadow: inset 0 0 0 2px var(--night-line); }
.field { display: grid; gap: 4px; max-width: 32rem; }
.field label { font-weight: 600; }
input[type="text"] {
  font: inherit; width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--ui); color: var(--ink);
}
input[type="text"]:focus-visible { border-color: var(--accent); }

/* The title screen: a dark hero; the moving picture of the prototype is drawn with CSS here */
.hero { position: relative; display: grid; background: var(--night); color: var(--on-night); overflow: hidden; min-height: 560px; }
.hero-art {
  position: absolute; inset: 0;
  background: radial-gradient(120% 100% at 85% 20%, var(--night-2), var(--night) 70%);
}
.hero-line {
  position: absolute; right: 8%; width: 34%; height: 2px; background: var(--accent-2); opacity: .35;
  animation: drift 6s ease-in-out infinite alternate;
}
.hero-line:nth-child(1) { top: 30%; }
.hero-line:nth-child(2) { top: 50%; width: 24%; animation-delay: 1.2s; }
.hero-line:nth-child(3) { top: 70%; width: 40%; animation-delay: 2.4s; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-24px); } }
.hero-pad { position: relative; z-index: 1; align-content: center; max-width: 760px; }
.hero .eyebrow { color: var(--accent-2); }
.hero .lede { color: var(--on-night-muted); }
.facts { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; color: var(--on-night); max-width: 64ch; }
.meta { font-size: .95rem; color: var(--on-night-muted); max-width: 64ch; }
.meta b { color: var(--on-night); }
.hero .btn { background: var(--on-night); color: var(--night); }

/* The lift: doors on the left, a dark panel of floors on the right */
.lift { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 560px; position: relative; }
.doors { background: var(--soft); display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 40px 28px 40px 40px; }
.door { background: linear-gradient(90deg, var(--door-1), var(--door-2) 60%, var(--door-1)); border-radius: 6px; transition: transform .6s ease; }
.lift.open .door:first-child { transform: translateX(-30%); }
.lift.open .door:last-child { transform: translateX(30%); }
.lift-panel {
  background: var(--night); color: var(--on-night); display: grid; gap: 14px; align-content: center;
  padding: 32px clamp(18px, 3vw, 36px);
}
.lift-panel .t { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .12em; color: var(--on-night-muted); text-transform: uppercase; }
.lift-help { color: var(--on-night-muted); font-size: .95rem; }
.clock-note {
  font-family: var(--f-mono); font-size: .84rem; padding: 6px 10px; border-radius: 8px;
  background: var(--soft); color: var(--ink); justify-self: start;
}
.lift-panel .clock-note { background: var(--night-2); color: var(--on-night); }
.lift-note {
  background: var(--night-2); border-radius: 10px; padding: 10px 14px;
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center;
}
.lift-note p { flex: 1 1 100%; }
.floors { display: grid; gap: 6px; }
.fbtn {
  display: flex; align-items: center; gap: 14px; border: 0; background: transparent; color: var(--on-night);
  text-align: left; padding: 8px; border-radius: 12px; width: 100%;
}
.fbtn:hover:not(:disabled) { background: var(--night-hover); }
.fbtn .b {
  width: 56px; height: 56px; border-radius: 50%; border: 3px solid var(--on-night); flex: 0 0 auto;
  display: grid; place-items: center; font-family: var(--f-display); font-weight: 800; font-size: 1.5rem;
}
.fbtn .tx { display: grid; }
.fbtn .tx b { font-size: 1.05rem; }
.fbtn .tx span { font-size: .88rem; color: var(--on-night-muted); }
.fbtn.done .b { background: var(--on-night); color: var(--night); }
.fbtn.last .b { border-style: dashed; }
.fbtn:disabled { opacity: .5; cursor: not-allowed; }
.review summary { cursor: pointer; font-weight: 600; color: var(--on-night-muted); }
.review-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.review-list button {
  width: 100%; text-align: left; border: 1px solid var(--night-line); background: transparent; color: var(--on-night);
  border-radius: 8px; padding: 8px 10px; font-size: .9rem;
}
.review-list button:hover { background: var(--night-hover); }

/* A challenge */
.ch-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.steps { display: flex; gap: 6px; align-items: center; font-family: var(--f-mono); font-size: .74rem; color: var(--muted); }
.steps i { width: 22px; height: 4px; border-radius: 2px; background: var(--line); }
.steps i.on { background: var(--accent); }
.ch-body { display: grid; gap: 12px; }
.qcard {
  border: 1px solid var(--line); border-radius: 16px; padding: 20px clamp(16px, 3vw, 26px);
  display: grid; gap: 12px; max-width: 720px; box-shadow: 0 20px 40px -32px var(--shadow);
}
.qcard .h { font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; color: var(--accent); }
.hint { font-size: .92rem; color: var(--muted); }
.opts, .checks { display: grid; gap: 8px; }
.opt, .ck {
  display: flex; gap: 12px; align-items: center; text-align: left; border: 1.5px solid var(--line);
  border-radius: 10px; padding: 12px 14px; background: var(--ui); font-size: .98rem; min-height: 48px;
  transition: border-color .15s, background .15s;
}
.opt:hover, .ck:hover { border-color: var(--accent); background: var(--soft); }
.opt .l {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--accent); flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 700; font-size: .82rem; color: var(--accent);
}
.opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.opt[aria-pressed="true"] .l { border-color: var(--on-accent); color: var(--on-accent); }
.ck .bx {
  width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--accent); flex: 0 0 auto;
  display: grid; place-items: center; font-size: .8rem; color: var(--on-accent);
}
.ck[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); }
.ck[aria-pressed="true"] .bx { background: var(--accent); }

/* The keypad: a dark panel with the digits typed so far and the keys */
.vault {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: center;
  background: var(--night); color: var(--on-night); border-radius: 16px; padding: 24px clamp(16px, 3vw, 32px);
}
.vault .hint { color: var(--on-night-muted); }
.digits { display: flex; gap: 10px; flex-wrap: wrap; }
.digits b {
  flex: 0 0 auto; width: 64px; aspect-ratio: 3 / 4; border-radius: 12px; background: var(--ui); color: var(--accent);
  display: grid; place-items: center; font-family: var(--f-mono); font-size: 2.2rem;
}
.digits b.e { background: transparent; border: 2px dashed var(--night-line); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 280px; width: 100%; }
.keys button {
  border: 0; border-radius: 10px; padding: 12px 0; min-height: 48px; background: var(--night-2);
  color: var(--on-night); font-family: var(--f-mono); font-size: 1.15rem;
}
.keys button:hover { background: var(--night-hover); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* A result */
.verdict {
  border-radius: 12px; padding: 14px 18px; display: flex; justify-content: space-between; gap: 12px;
  align-items: center; background: var(--accent); color: var(--on-accent);
}
.verdict h1 { font-size: clamp(1.3rem, 3vw, 1.8rem); }
.verdict.bad { background: var(--risk); }
.verdict .pen { font-family: var(--f-mono); font-size: 1.4rem; }
.fbgrid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.col { display: grid; gap: 14px; }
.res-seconds { font-size: 1.1rem; font-weight: 700; }
.res-trap { border-left: 4px solid var(--risk); padding-left: 12px; }
.advice { border-left: 4px solid var(--accent); padding: 4px 0 4px 14px; font-weight: 600; }
.why { background: var(--soft); border-radius: 14px; padding: 18px; display: grid; gap: 8px; }
.why .h { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.film-note { color: var(--muted); font-size: .95rem; }
.film-note b { color: var(--ink); }
.found {
  display: flex; gap: 14px; align-items: center; background: var(--night); color: var(--on-night);
  border-radius: 14px; padding: 14px 18px; animation: pop .6s ease both;
}
.found-digit {
  width: 56px; aspect-ratio: 3 / 4; border-radius: 10px; background: var(--ui); color: var(--accent);
  display: grid; place-items: center; font-family: var(--f-mono); font-size: 2rem;
}
.found-text { display: grid; }
.found-text span { color: var(--on-night-muted); font-size: .9rem; }
@keyframes pop { 0% { opacity: 0; transform: scale(.9); } 60% { opacity: 1; transform: scale(1.04); } 100% { transform: none; } }

/* The trap: a notice that looks like the system, not like the game. No field, drawn or real. */
.trap { position: absolute; inset: 0; z-index: 15; background: var(--veil); display: grid; place-items: center; padding: 20px; }
.trapbox { width: min(440px, 100%); background: var(--ui); border-radius: 12px; box-shadow: 0 30px 60px -20px var(--shadow); overflow: hidden; }
.trapbox .tb { background: var(--sys-bar); padding: 10px 14px; font-size: .82rem; color: var(--sys-ink); display: flex; justify-content: space-between; }
.trapbox .tc { padding: 18px; display: grid; gap: 12px; }
.trapbox h1 { font-family: var(--f-body); font-size: 1.15rem; font-weight: 700; }
.trapbox .btn { background: var(--sys-ink); }
.trapbox .btn + .btn { background: transparent; color: var(--sys-ink); box-shadow: inset 0 0 0 2px var(--sys-ink); }

/* The end */
.pieces { display: flex; gap: 6px; flex-wrap: wrap; }
.piece {
  width: 44px; height: 44px; border-radius: 8px; background: var(--night-2);
  animation: flip .5s ease both;
}
.piece.on { background: var(--accent); }
.piece.miss { background: repeating-linear-gradient(45deg, var(--risk) 0 4px, var(--night-2) 4px 10px); }
.piece.none { background: var(--line); }
@keyframes flip { from { opacity: 0; transform: rotateY(90deg); } to { opacity: 1; transform: none; } }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--soft); border-radius: 12px; padding: 12px 14px; display: grid; }
.stat b { font-family: var(--f-mono); font-size: 1.5rem; color: var(--ink); font-variant-numeric: tabular-nums; }
.stat span { font-size: .88rem; color: var(--muted); }
.grade { font-weight: 600; }
.record summary, details summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.figures { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 10px 0 0; }
.figures dt { color: var(--muted); }
.figures dd { margin: 0; font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* The page's own dialog for leaving inside a challenge */
.sheet { position: absolute; inset: 0; z-index: 30; background: var(--veil); display: grid; place-items: center; padding: 20px; }
.sheet-in { width: min(460px, 100%); background: var(--ui); border-radius: 16px; padding: 22px; display: grid; gap: 14px; box-shadow: 0 30px 60px -20px var(--shadow); }

/* The panel */
.tw { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
table { line-height: normal; border-collapse: collapse; width: 100%; min-width: 640px; font-size: .88rem; }
caption { text-align: left; color: var(--muted); padding: 8px 12px; }
th, td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
th { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--soft); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* ---- With a pack ---- */
.sound { white-space: nowrap; }
.sound[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
/* The pack's cover: its picture behind, its routes as large buttons */
.cover-media video, .cover-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .45; }
.cover .accent { color: var(--accent-2); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--night-line); border-radius: 999px; padding: 4px 10px; color: var(--on-night-muted); }
.routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; max-width: 900px; }
.route { display: grid; gap: 6px; text-align: left; background: var(--night-2); color: var(--on-night);
  border: 2px solid var(--night-line); border-radius: 14px; padding: 14px 16px; min-height: 44px; }
.route:hover:not(:disabled) { border-color: var(--accent-2); background: var(--night-hover); }
.route-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: baseline; }
.route-head b { font-family: var(--f-display); font-size: 1.3rem; }
.route-mins { font-family: var(--f-mono); font-size: .8rem; color: var(--on-night-muted); }
.route-blurb { font-size: .92rem; color: var(--on-night-muted); }
.route-open { font-size: .85rem; font-weight: 700; color: var(--accent-2); }
/* The lift's own video, over the drawn doors */
.doors { position: relative; }
.lift-media { position: absolute; inset: 0; overflow: hidden; }
.lift-media video, .lift-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fbtn .tx span.theme { font-size: .8rem; font-family: var(--f-mono); letter-spacing: .04em; }
/* Scenes and films: dark, picture first, the subtitle always on screen */
.scene { background: var(--night); color: var(--on-night); display: grid; min-height: 560px; }
.scene-in { padding: 18px clamp(16px, 4vw, 40px); display: grid; gap: 10px; align-content: start; max-width: 960px; width: 100%; margin: 0 auto; }
.scene .eyebrow { color: var(--accent-2); }
/* The picture never pushes the subtitle and the buttons off the screen: its height is capped by the window's. */
.scene-media { position: relative; background: var(--night-2); border-radius: 12px; overflow: hidden; aspect-ratio: 16 / 9;
  max-height: 42vh; width: 100%; }
.scene-text { display: grid; gap: 10px; }
.scene h1 { justify-self: start; background: var(--ui); color: var(--ink); padding: 4px 12px; border-radius: 8px; }
.mute-note { font-size: .9rem; color: var(--on-night); border-left: 4px solid var(--accent-2); padding-left: 10px; }
.scene-media video, .scene-media img { width: 100%; height: 100%; object-fit: contain; display: block; }
.scene-desc { background: var(--night-2); border-radius: 12px; padding: 16px; color: var(--on-night); font-style: italic; }
.scene-tag { justify-self: start; font-family: var(--f-mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  background: var(--accent); color: var(--on-accent); border-radius: 6px; padding: 3px 8px; }
.scene-card { font-family: var(--f-display); font-size: clamp(1.4rem, 4vw, 2.2rem); font-weight: 800; }
.scene-sfx { font-family: var(--f-mono); font-size: .85rem; color: var(--on-night-muted); }
.subtitle { background: var(--veil); color: var(--on-night); border-radius: 8px; padding: 10px 14px; font-size: 1.05rem; }
.subtitle b { color: var(--accent-2); }
.scene-step { color: var(--on-night-muted); }
/* A painter's stage, and the short deadline bar */
.ch-stage { display: grid; gap: 12px; }
.deadline { position: relative; display: grid; gap: 4px; max-width: 720px; }
.deadline-bar { display: block; height: 6px; border-radius: 3px; background: var(--accent); width: 100%; transition: width .25s linear; }
.deadline.low .deadline-bar { background: var(--risk); }
.deadline-text { font-family: var(--f-mono); font-size: .8rem; color: var(--muted); }
.vault-img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; }
/* The keypad's picture (--img-vault-bg of the theme) is set by the script, through /pack/: never resolved here. */
.vault { background-size: cover; background-position: center; }
/* A result with a pack: the kind's own part, the best answer, the taunt */
.res-kind { display: grid; gap: 10px; }
.best { border-left: 4px solid var(--accent); padding: 2px 0 2px 12px; display: grid; gap: 2px; }
.best-part { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.taunt { background: var(--night); color: var(--on-night); border-left: 4px solid var(--glitch); border-radius: 10px;
  padding: 12px 16px; display: grid; gap: 4px; }
.taunt-glitch { font-family: var(--f-mono); font-size: .8rem; color: var(--glitch); }
.taunt-label { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--glitch); }
/* The end with a pack */
.rewatch { display: grid; gap: 10px; }

/* Screens come in gently */
.pad:not([hidden]), .lift:not([hidden]), .hero:not([hidden]), .scene:not([hidden]) { animation: rise .3s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 820px) {
  .hero-line { display: none; }
  .lift, .vault, .fbgrid { grid-template-columns: 1fr; }
  .doors { min-height: 120px; padding: 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage, .lift, .hero, .scene { min-height: 480px; }
  .routes { grid-template-columns: 1fr; }
  .scene-media { max-height: 34vh; }
  .hud-right { margin-left: 0; width: 100%; justify-content: space-between; }
}
@media (max-width: 640px) {
  .fbtn .tx span, .stat span, .found-text span, .film-note { font-size: .875rem; }
  .hud-label { font-size: .66rem; }
}
@media (max-width: 560px) {
  body { padding: 8px 8px 40px; }
  .pad { padding: 20px 16px; }
  .row .btn { flex: 1 1 auto; }
  .digits b { width: 52px; font-size: 1.8rem; }
  .figures { grid-template-columns: 1fr; }
  .figures dd { margin-bottom: 6px; }
  .pip { width: 11px; height: 11px; }
  .piece { width: 36px; height: 36px; }
}
@media (max-width: 400px) {
  .hud { padding: 10px 12px; }
  .hud-right { gap: 8px; }
  .clock { font-size: 1rem; padding: 4px 8px; }
}
@media (pointer: coarse) {
  button, .opt, .ck { touch-action: manipulation; }
  .btn, .btn.small { min-height: 44px; }
  .keys button { min-height: 52px; }
  .fbtn { min-height: 60px; }
  .review-list button { min-height: 44px; }
  details summary { padding: 10px 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
/* The challenges with no heavy media (flags-decide, the card, decision, form, inbox, builder,
   call, chat). Only the engine's colour and font variables; every class starts with pk-. */

/* Scene on the left, steps on the right; one above the other below 820px */
.pk-split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pk-scene, .pk-side { display: grid; gap: 14px; min-width: 0; align-content: start; }
.pk-solo { display: grid; gap: 14px; max-width: 720px; }
.pk-panel { display: grid; gap: 12px; }
.pk-h { font-family: var(--f-display); font-weight: 800; font-size: 1.2rem; color: var(--accent); }
.pk-hint { font-size: .92rem; color: var(--muted); }
.pk-eyebrow {
  display: block; font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); font-weight: 600;
}
.pk-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Buttons */
.pk-btn {
  font: inherit; color: var(--ink); background: var(--ui); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 10px 14px; min-height: 44px; text-align: left; cursor: pointer;
  overflow-wrap: anywhere; transition: border-color .15s, background .15s;
}
.pk-btn:hover:not(:disabled) { border-color: var(--accent); background: var(--soft); }
.pk-btn:disabled { opacity: .5; cursor: not-allowed; }
.pk-btn:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.pk-primary {
  justify-self: start; border: 0; border-radius: 999px; padding: 10px 22px; font-weight: 700;
  background: var(--accent); color: var(--on-accent); text-align: center;
}
.pk-primary:hover:not(:disabled) { background: var(--accent); box-shadow: 0 8px 20px -10px var(--glow); }
.pk-small { justify-self: start; min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.pk-opts, .pk-checks, .pk-replies { display: grid; gap: 8px; }
.pk-opt[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--on-accent); }
.pk-check { display: flex; gap: 12px; align-items: center; }
.pk-bx {
  width: 20px; height: 20px; border-radius: 5px; border: 2px solid var(--accent); flex: 0 0 auto;
}
.pk-check[aria-pressed="true"] { border-color: var(--accent); background: var(--soft); }
.pk-check[aria-pressed="true"] .pk-bx { background: var(--accent); box-shadow: inset 0 0 0 3px var(--ui); }
.pk-reply { width: 100%; }

/* The decision card */
.pk-card {
  border: 1px solid var(--line); border-radius: 16px; padding: 18px clamp(14px, 3vw, 24px);
  display: grid; gap: 12px; background: var(--ui); box-shadow: 0 20px 40px -32px var(--shadow);
}
.pk-kicker {
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--risk); font-weight: 700;
}
.pk-card-q { font-family: var(--f-display); font-weight: 800; font-size: 1.3rem; color: var(--ink); }
.pk-ctx { color: var(--muted); }
.pk-opts-done { list-style: none; margin: 0; padding: 0; }
.pk-opt-done {
  display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; border: 1.5px solid var(--line);
  border-radius: 10px; padding: 10px 14px;
}
.pk-opt-text { flex: 1 1 12rem; }
.pk-ok { border-color: var(--accent); }
.pk-bad { border-color: var(--risk); }
.pk-mark { font-weight: 800; }
.pk-ok > .pk-mark, .pk-ok > .pk-rv-top > .pk-mark { color: var(--accent); }
.pk-bad > .pk-mark, .pk-bad > .pk-rv-top > .pk-mark { color: var(--risk); }
.pk-tag {
  font-size: .82rem; font-weight: 600;
  color: var(--muted); background: var(--soft); border-radius: 6px; padding: 2px 6px;
}

/* The phone (flags-decide) */
.pk-phone {
  background: var(--night); color: var(--on-night); border-radius: 22px; padding: 20px 18px;
  display: grid; gap: 10px; border: 1px solid var(--night-line);
}
.pk-phone-num { font-family: var(--f-mono); font-size: 1.25rem; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.pk-phone-note { color: var(--on-night-muted); font-size: .92rem; }
.pk-msg { background: var(--night-2); border-radius: 14px 14px 14px 4px; padding: 10px 12px; white-space: pre-wrap; }
.pk-note { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.pk-note .pk-btn { background: var(--night-2); color: var(--on-night); border-color: var(--night-line); min-height: 40px; }
.pk-note .pk-btn:hover:not(:disabled) { background: var(--night-hover); }
.pk-note-time { font-family: var(--f-mono); font-size: .84rem; color: var(--on-night-muted); }
.pk-transcript { border-left: 3px solid var(--accent-2); padding-left: 10px; display: grid; gap: 4px; }
.pk-transcript .pk-eyebrow { color: var(--accent-2); }
.pk-transcript p { white-space: pre-wrap; }

/* Form */
.pk-form { display: grid; gap: 14px; max-width: 640px; }
.pk-field { display: grid; gap: 4px; }
.pk-label { font-weight: 600; }
.pk-select, .pk-search {
  font: inherit; width: 100%; min-height: 44px; padding: 8px 12px; border: 2px solid var(--line);
  border-radius: 10px; background: var(--ui); color: var(--ink);
}
.pk-select:focus-visible, .pk-search:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 1px; border-color: var(--accent); }

/* Inbox */
.pk-mailwrap { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
.pk-maillist { display: grid; gap: 10px; }
.pk-mails { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pk-mailitem { width: 100%; display: grid; gap: 2px; }
.pk-mailitem[aria-current="true"] { border-color: var(--accent); background: var(--soft); }
.pk-mail-from { font-weight: 700; }
.pk-mail-subj { color: var(--muted); font-size: .92rem; }
.pk-mail-time { font-family: var(--f-mono); font-size: .76rem; color: var(--muted); }
.pk-mailitem .pk-tag { justify-self: start; }
.pk-reader {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px;
  align-content: start; min-height: 200px;
}
.pk-from { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; }
.pk-addr { font-family: var(--f-mono); font-size: .88rem; overflow-wrap: anywhere; background: var(--soft); border-radius: 6px; padding: 2px 6px; }
.pk-subject { font-family: var(--f-display); font-size: 1.2rem; font-weight: 800; }
.pk-body { white-space: pre-wrap; }
.pk-linkbtn { justify-self: start; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.pk-linkbox { background: var(--soft); border-radius: 10px; padding: 10px 12px; display: grid; gap: 4px; }
.pk-url { font-family: var(--f-mono); font-size: .88rem; overflow-wrap: anywhere; }
.pk-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pk-act { text-align: center; }

/* Builder */
.pk-slot { display: grid; gap: 8px; }
.pk-slot-h { font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; color: var(--accent); }
.pk-preview {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px;
  background: var(--ui); box-shadow: 0 20px 40px -32px var(--shadow);
}
.pk-preview-head {
  font-family: var(--f-mono); font-size: .74rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); border-bottom: 1px solid var(--line); padding-bottom: 8px;
}
.pk-prev-row { white-space: pre-wrap; overflow-wrap: anywhere; min-height: 1.5em; }
.pk-empty { color: var(--muted); font-style: italic; }
.pk-fakebtn {
  display: inline-block; background: var(--accent); color: var(--on-accent); border-radius: 8px;
  padding: 8px 16px; font-weight: 700;
}

/* Call and chat */
.pk-call, .pk-chat {
  background: var(--night); color: var(--on-night); border-radius: 18px; padding: 18px;
  display: grid; gap: 12px; border: 1px solid var(--night-line);
}
.pk-call-who, .pk-chat-head { display: flex; gap: 12px; align-items: center; }
.pk-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center;
  background: var(--night-2); color: var(--on-night); font-family: var(--f-display); font-weight: 800; font-size: 1.4rem;
}
.pk-chat-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--night-2); }
.pk-call-id { display: grid; min-width: 0; }
.pk-call-num { color: var(--on-night-muted); font-family: var(--f-mono); font-size: .86rem; overflow-wrap: anywhere; }
.pk-call-status {
  justify-self: start; font-family: var(--f-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  background: var(--night-2); color: var(--on-night); border-radius: 6px; padding: 3px 8px;
}
.pk-call-status:empty { display: none; }
.pk-log { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pk-line { overflow-wrap: anywhere; }
.pk-who { font-weight: 700; }
.pk-call .pk-line, .pk-chat .pk-line { color: var(--on-night); }
.pk-call .pk-mine .pk-who, .pk-chat .pk-mine .pk-who { color: var(--accent-2); }
.pk-call .pk-btn, .pk-chat .pk-btn { background: var(--night-2); color: var(--on-night); border-color: var(--night-line); }
.pk-bubbles .pk-line { justify-self: start; max-width: 88%; background: var(--night-2); border-radius: 14px 14px 14px 4px; padding: 8px 12px; }
.pk-bubbles .pk-mine { justify-self: end; background: var(--accent); color: var(--on-accent); border-radius: 14px 14px 4px 14px; }
.pk-bubbles .pk-mine .pk-who { color: var(--on-accent); }
.pk-typing { color: var(--on-night-muted); font-style: italic; font-size: .9rem; }
.pk-profile { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: grid; gap: 8px; }
.pk-profile-flags { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
.pk-replybox { display: grid; gap: 8px; }

/* The directory of the call */
.pk-dir { display: grid; gap: 10px; }
.pk-dir-sys { background: var(--soft); border-radius: 10px; padding: 8px 12px; }
.pk-dir-tools { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 8px; }
.pk-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.pk-table { border-collapse: collapse; width: 100%; font-size: .9rem; line-height: normal; }
.pk-table th, .pk-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.pk-table th { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--soft); font-weight: 600; }
.pk-table tr:last-child td { border-bottom: 0; }
.pk-dir-q { font-weight: 700; }

/* Review rows in the result */
.pk-review { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pk-rv { border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 14px; display: grid; gap: 4px; }
.pk-rv-top { display: flex; gap: 8px; align-items: baseline; }
.pk-rv-sub, .pk-rv-line { font-size: .94rem; }
.pk-rv-sub { color: var(--muted); }
.pk-rv-k { color: var(--muted); }
.pk-rv-note { font-size: .92rem; border-left: 3px solid var(--accent); padding-left: 10px; }
.pk-ending { display: grid; gap: 10px; }
.pk-ending .pk-mine .pk-who { color: var(--accent); }

@media (max-width: 820px) {
  .pk-split, .pk-mailwrap { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .pk-dir-tools, .pk-actions { grid-template-columns: 1fr; }
  .pk-phone, .pk-call, .pk-chat { padding: 14px 12px; border-radius: 14px; }
  .pk-table { font-size: .84rem; }
  .pk-table th, .pk-table td { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .pk-btn { transition: none; }
}
/* The painters with pictures and video (camera-roll, tape, zones). Colours: engine variables only,
   plus --cctv and --glitch (each with an engine variable to fall back on). */

/* Scene on the left, steps on the right; one above the other on a phone */
.pm-wrap { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.pm-scene, .pm-side { display: grid; gap: 12px; align-content: start; min-width: 0; }
.pm-h { font-family: var(--f-display); font-weight: 800; font-size: 1.25rem; color: var(--accent); }
.pm-q { font-size: 1.02rem; }
.pm-hint, .pm-small, .pm-count, .pm-left { font-size: .92rem; color: var(--muted); }
.pm-count, .pm-left { font-family: var(--f-mono); }
.pm-fail {
  padding: 14px 16px; border-radius: 10px; border: 2px dashed var(--line);
  background: var(--soft); color: var(--ink); font-weight: 600;
}
.pm-choices { display: flex; gap: 10px; flex-wrap: wrap; }
.pm-choices .btn { flex: 1 1 8rem; }
.pm-stack { flex-direction: column; }
.pm-stack .btn { flex: 0 0 auto; text-align: left; border-radius: 10px; }
.pm-spent { text-decoration: line-through; }
.pm-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* camera-roll: the bar, the thumbnails, the viewer and its magnifier */
.pm-rollbar {
  display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 8px 12px; border-radius: 10px;
  background: var(--night); color: var(--on-night); font-family: var(--f-mono); font-size: .8rem;
}
.pm-rollbar span + span { color: var(--on-night-muted); }
.pm-roll {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 8px;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
}
.pm-thumb {
  position: relative; display: grid; width: 100%; padding: 0; overflow: hidden;
  border: 2px solid var(--line); border-radius: 10px; background: var(--night); color: var(--on-night);
  text-align: left;
}
button.pm-thumb:hover { border-color: var(--accent); }
.pm-thumb-img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.pm-thumb-none {
  display: grid; place-items: center; aspect-ratio: 1 / 1; padding: 6px;
  font-size: .8rem; color: var(--on-night-muted);
}
.pm-time {
  position: absolute; left: 0; bottom: 0; padding: 2px 6px; font-family: var(--f-mono); font-size: .72rem;
  background: var(--veil); color: var(--on-night);
}
.pm-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: .74rem; font-weight: 700;
  background: var(--ui); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--accent);
}
.pm-thumb .pm-tag { position: absolute; top: 4px; right: 4px; }
.pm-roll-still .pm-thumb { border-style: solid; }

.pm-view {
  position: relative; overflow: hidden; border-radius: 12px; background: var(--night);
  touch-action: none; cursor: crosshair;
}
.pm-view-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.pm-lens {
  position: absolute; overflow: hidden; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 3px var(--ui), 0 10px 28px -6px var(--shadow); background: var(--night);
}
.pm-lens-img { position: absolute; max-width: none; display: block; }
.pm-view:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }

/* tape: the recording, its clock and the position bar */
.pm-tv {
  position: relative; overflow: hidden; border-radius: 12px; aspect-ratio: 16 / 9;
  background: var(--night); color: var(--on-night);
}
.pm-tv-off { aspect-ratio: auto; background: transparent; }
.pm-video { display: block; width: 100%; height: 100%; object-fit: contain; background: var(--night); }
.pm-cam, .pm-clock {
  position: absolute; top: 8px; padding: 2px 8px; border-radius: 4px; background: var(--veil);
  font-family: var(--f-mono); font-size: .8rem; letter-spacing: .06em; color: var(--cctv, var(--on-night));
}
.pm-cam { left: 8px; text-transform: uppercase; max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pm-clock { right: 8px; font-variant-numeric: tabular-nums; }
.pm-ctrl { display: flex; gap: 12px; align-items: center; }
.pm-play { flex: 0 0 auto; min-width: 5.5rem; }
.pm-scrub { flex: 1 1 auto; padding: 14px 0; cursor: pointer; touch-action: none; border-radius: 6px; }
.pm-track { position: relative; height: 8px; border-radius: 4px; background: var(--line); }
.pm-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--accent); }
.pm-knob {
  position: absolute; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  background: var(--ui); box-shadow: 0 0 0 3px var(--accent);
}
.pm-ticks { position: absolute; inset: 0; }
.pm-tick {
  position: absolute; top: -6px; bottom: -6px; width: 3px; margin-left: -1.5px; border-radius: 2px;
  background: var(--glitch, var(--risk));
}
.pm-mark { justify-self: start; }

/* zones: the picture to press on */
.pm-board { position: relative; border-radius: 12px; overflow: hidden; background: var(--night); cursor: crosshair; }
.pm-board-img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-select: none; }
.pm-dots { position: absolute; inset: 0; pointer-events: none; }
.pm-dot {
  position: absolute; width: 28px; height: 28px; margin: -14px 0 0 -14px; border-radius: 50%;
  border: 3px solid var(--ui); box-shadow: 0 0 0 2px var(--accent), 0 0 0 5px var(--veil);
}
.pm-cross {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; display: none; pointer-events: none;
  border-radius: 50%; box-shadow: 0 0 0 2px var(--accent-2), 0 0 0 4px var(--night);
}
.pm-cross::before, .pm-cross::after { content: ""; position: absolute; background: var(--accent-2); }
.pm-cross::before { left: 50%; top: -8px; bottom: -8px; width: 2px; margin-left: -1px; }
.pm-cross::after { top: 50%; left: -8px; right: -8px; height: 2px; margin-top: -1px; }
.pm-board:focus-visible { outline: 3px solid var(--accent-2); outline-offset: 2px; }
.pm-board:focus-visible .pm-cross { display: block; }

/* The result: the annotated pictures */
.pm-rv { display: grid; gap: 14px; }
.pm-lede { font-weight: 700; font-size: 1.05rem; }
.pm-rv-grid {
  list-style: none; margin: 0; padding: 0; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
}
.pm-fig { display: grid; gap: 6px; align-content: start; }
.pm-frame { position: relative; overflow: hidden; border-radius: 10px; background: var(--night); }
.pm-frame-tv { aspect-ratio: 16 / 9; }
.pm-frame-img { display: block; width: 100%; height: auto; }
.pm-frame-tv .pm-frame-img { height: 100%; object-fit: contain; }
.pm-box { position: absolute; border: 3px solid var(--accent-2); border-radius: 4px; box-shadow: 0 0 0 2px var(--night); }
.pm-box-label {
  position: absolute; left: -3px; bottom: 100%; max-width: 16rem; padding: 1px 6px; font-size: .74rem; font-weight: 700;
  background: var(--accent-2); color: var(--night); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pm-cap { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.pm-ok, .pm-bad { font-weight: 800; }
.pm-ok { color: var(--accent); }
.pm-bad { color: var(--risk); }
.pm-ring {
  position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
  border: 3px solid var(--accent-2); box-shadow: 0 0 0 2px var(--night);
}
.pm-ring-decoy { border-style: dashed; border-color: var(--risk); }
.pm-ring-mine::after {
  content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--ui);
}
.pm-ring-label {
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 4px; max-width: 10rem;
  padding: 1px 6px; border-radius: 4px; font-size: .72rem; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; background: var(--ui); color: var(--ink);
}
.pm-reasons { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }

@media (max-width: 820px) {
  .pm-wrap { grid-template-columns: 1fr; }
}
@media (max-width: 400px) {
  .pm-roll { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .pm-ctrl { gap: 8px; }
  .pm-play { min-width: 4.5rem; }
  .pm-ring-label, .pm-box-label { max-width: 7rem; }
}
@media (pointer: coarse) {
  .pm-thumb, .pm-choice { touch-action: manipulation; }
  .pm-scrub { padding: 18px 0; }
}
@media (prefers-reduced-motion: reduce) {
  .pm-wrap *, .pm-rv * { animation: none !important; transition: none !important; }
}
