/* The scene is pixel art from art/ (see art/PROMPTS.md); panels outside the scene stay plain for reading. */
/* Pixel fonts, self-hosted (SIL OFL, licences in fonts/): no request leaves the site. Latin subset. */
@font-face { font-family: 'Pixelify Sans'; src: url(fonts/PixelifySans.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Caveat; src: url(fonts/Caveat.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: VT323; src: url(fonts/VT323.woff2) format('woff2'); font-display: swap; }
:root {
  --ink: #1b1630; --paper: #f4ecd8; --line: #b9ad91; --night: #232046; --glass: #3c3a6e;
  --desk: #6b4a35; --desk-dark: #4f3626; --ok: #3f8a4c; --bad: #b3363f; --amber: #d9a441;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); color: var(--ink); font: 14px/1.35 ui-monospace, Menlo, Consolas, monospace; overflow: hidden; }
button { font: inherit; cursor: pointer; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); padding: 4px 8px; }

#rotate { display: none; position: fixed; inset: 0; z-index: 50; background: var(--ink); color: var(--paper); place-items: center; text-align: center; padding: 16px; }
@media (orientation: portrait) and (max-width: 900px) { #rotate { display: grid; } }

#stage { position: fixed; inset: 0; }
/* Centred with margins, not a grid: a grid track overflows off-centre when the screen is smaller than 640x360. */
#scene { position: absolute; left: 50%; top: 50%; margin: -180px 0 0 -320px; width: 640px; height: 360px; transform-origin: center; image-rendering: pixelated; font: 8px/1.2 'Pixelify Sans', ui-monospace, monospace; font-variant-ligatures: none; }
#scene img, #scene * { image-rendering: pixelated; }

#window { position: absolute; left: 0; top: 0; width: 640px; height: 120px; background: linear-gradient(rgb(27 22 48 / 0.45), rgb(27 22 48 / 0.45)), url(art/corridor.png); /* dimmed: the corridor is behind glass, the face is in front */ overflow: hidden; border-bottom: 6px solid var(--desk-dark); }
#requester { position: absolute; bottom: 0; left: 280px; width: 80px; text-align: center; transition: left 0.6s steps(6); }
#requester.out { left: 700px; }
#requester.gone { left: -120px; }
#bust { width: 66px; height: 98px; margin: 0 auto; background: no-repeat center bottom; animation: breathe 2.4s steps(1) infinite; }
@keyframes breathe { 50% { transform: translateY(1px); } }
#who { position: absolute; bottom: 0; left: -30px; right: -30px; color: var(--paper); background: var(--ink); font-size: 7px; padding: 1px 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#bubble { position: absolute; left: 372px; top: 10px; width: 250px; background: var(--paper); border: 2px solid var(--ink); padding: 4px 6px; font-size: 8px; }

/* Hotspots sit over the props drawn in art/desk.png. */
#desk { position: absolute; left: 0; top: 126px; width: 640px; height: 234px; background: var(--desk) url(art/desk.png); }
#slot { position: absolute; left: 240px; top: 34px; width: 176px; height: 36px; color: var(--paper); text-align: center; line-height: 36px; font-size: 8px; text-shadow: 1px 1px var(--ink); }
#slot.hot { outline: 2px solid var(--ok); background: rgb(63 138 76 / 0.35); }
#papers { position: absolute; left: 10px; top: 76px; width: 470px; height: 156px; }
.paper { position: absolute; width: 96px; height: 72px; background: var(--paper); border: 2px solid var(--ink); padding: 4px; font-size: 7px; overflow: hidden; touch-action: none; user-select: none; animation: slide-in 0.3s steps(4); }
.paper .mark { margin-top: 6px; padding: 2px; border: 2px solid; font-weight: bold; text-align: center; transform: rotate(-8deg); }
.paper .mark.APPROVE { color: var(--ok); } .paper .mark.RETURN { color: var(--bad); } .paper .mark.SUGGEST { color: #2d5f9a; } .paper .mark.APPOINTMENT { color: #7a4fa0; }
@keyframes slide-in { from { transform: translateY(-40px); opacity: 0; } }

#pager { position: absolute; left: 543px; top: 46px; width: 68px; height: 36px; padding: 1px 3px; background: #1f2b1f; color: #9be39b; font: 8px/0.95 VT323, monospace; overflow: hidden; }
#clock { font-size: 17px; line-height: 0.9; }
#mute { position: absolute; left: 546px; top: 86px; width: 60px; height: 12px; padding: 0; border: 0; background: transparent; color: var(--paper); font-size: 6px; text-shadow: 1px 1px var(--ink); }
#handbook-btn { position: absolute; left: 536px; top: 115px; width: 102px; height: 104px; border: 0; background: transparent; color: var(--paper); font-size: 9px; text-shadow: 1px 1px var(--ink); padding-top: 70px; }
#handbook-btn:hover, #mute:hover { outline: 2px solid var(--amber); }

/* Readable panels sit outside the scaled scene so text stays a normal size. */
.panel { position: fixed; inset: 8px; z-index: 10; background: var(--paper); border: 3px solid var(--ink); display: flex; flex-direction: column; }
.panel[hidden] { display: none; }
.bar { display: flex; gap: 6px; align-items: center; padding: 6px; background: var(--line); flex-wrap: wrap; }
.grow { flex: 1; }
#reader-say { flex: 1; font-style: italic; }
#sheets { flex: 1; overflow: auto; display: flex; gap: 10px; padding: 10px; align-items: flex-start; }
.sheet { flex: 0 0 280px; background: #fffaf0; border: 2px solid var(--ink); padding: 8px; }
.sheet h3 { margin: 0 0 6px; font-size: 14px; }
.row { margin: 2px 0; }
.f { border-bottom: 1px dotted var(--line); }
.inspecting .f { cursor: crosshair; background: #fff1a8; }
.f.picked { outline: 2px solid #2d5f9a; }
.f.clash { outline: 2px solid var(--bad); background: #ffd0d0; }
.stampbox { margin-top: 6px; border: 2px dashed var(--line); padding: 6px; min-height: 28px; }
.stamp[data-call="APPROVE"] { color: var(--ok); } .stamp[data-call="RETURN"] { color: var(--bad); } .stamp[data-call="SUGGEST"] { color: #2d5f9a; } .stamp[data-call="APPOINTMENT"] { color: #7a4fa0; }

#modal { overflow: auto; padding: 12px; }
#modal h2 { margin: 0 0 8px; }
#modal .choices { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
#modal .esc-papers summary { cursor: pointer; font-weight: bold; margin: 6px 0; }
#modal .esc-sheets { display: flex; gap: 10px; overflow-x: auto; padding: 6px 0; align-items: flex-start; }
#modal table { border-collapse: collapse; width: 100%; }
#modal td, #modal th { border: 1px solid var(--line); padding: 4px; text-align: left; vertical-align: top; }
.new { color: var(--bad); font-weight: bold; }
.bars div { margin: 6px 0; }
.lab { display: inline-block; width: 80px; }
.track { display: inline-block; position: relative; width: 160px; height: 10px; background: var(--line); vertical-align: middle; }
.track i { position: absolute; top: -3px; width: 6px; height: 16px; background: var(--ink); transform: translateX(-50%); }

.chat { background: #dcf8c6; border: 2px solid var(--ink); padding: 8px; max-width: 520px; }
.chat p { margin: 4px 0 0; }

#toast { position: fixed; left: 50%; top: 12px; transform: translateX(-50%); z-index: 20; background: var(--bad); color: var(--paper); padding: 8px 14px; border: 3px solid var(--ink); font-weight: bold; }

/* ---- Paper forms (docs.js): printed labels in dark ink, entries in ballpoint handwriting ---- */
.sheet.paper-sheet { flex: 0 0 min(660px, 94vw); background: #fbf8ef; padding: 10px 12px; font: 12px/1.3 Arial, Helvetica, sans-serif; color: #1c1c28; }
.paper-sheet > h3 { display: none; }
.pf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; border-bottom: 2px solid #1c1c28; padding-bottom: 3px; }
.pf-head small { font-size: 10px; }
.pf-head .code { margin-left: auto; font-size: 10px; font-weight: bold; }
.pf-title { margin: 6px 0; text-align: center; font-size: 13px; }
.pf-title small, .lb small, .pf-sec small, .pf-text small, .ticks small { display: block; font-weight: normal; font-style: italic; font-size: 9px; color: #555; }
.pf-text small, .ticks small { display: inline; }
.pf-body { display: flex; gap: 6px; }
.pf-main { flex: 1; min-width: 0; }
.pf-sec { background: #e4dfd0; border: 1px solid #1c1c28; padding: 2px 4px; font-weight: bold; margin-top: 4px; }
.pf-sec small { display: inline; }
.g { display: grid; grid-template-columns: repeat(3, 1fr); border-left: 1px solid #1c1c28; }
.g .c { border-right: 1px solid #1c1c28; border-bottom: 1px solid #1c1c28; padding: 2px 4px; min-height: 30px; }
.g .w2 { grid-column: span 2; } .g .w3 { grid-column: span 3; }
.lb { display: block; font-size: 10px; font-weight: bold; }
.pf .f, .pf .hw { font: 600 17px/1.1 Caveat, 'Segoe Print', cursive; color: #1b2a5a; border-bottom: 0; }
.pf .hw { display: inline-block; margin-right: 6px; }
.pf .when { display: block; font-size: 14px; }
.svc { display: flex; gap: 14px; padding: 3px 6px; border: 1px solid #1c1c28; border-top: 0; font-weight: bold; }
.circ { font-style: normal; border: 2px solid #1b2a5a; border-radius: 50%; padding: 0 5px; }
.yn { font-weight: bold; }
.pf-office { width: 92px; border: 1px solid #1c1c28; background: #eeeae0; color: #777; font-size: 10px; margin-top: 4px; }
.pf-office > div { border-top: 1px solid #aaa; padding: 4px 3px 12px; }
.sigbox, .sigline { position: relative; min-height: 64px; }
.chop { width: 210px; height: auto; display: block; }
.sig { height: 34px; width: auto; display: block; }
.sig.over { position: absolute; left: 40px; top: 6px; height: 44px; }
.pf-text { margin: 5px 0; }
.ticks { border-collapse: collapse; margin: 2px 0 4px; }
.ticks td, .ticks th { border: 1px solid #1c1c28; padding: 1px 6px; font-size: 11px; }
.ticks td:nth-child(n+2) { width: 38px; text-align: center; }
.cosign { width: 100%; min-height: 64px; position: relative; border: 2px dashed #b9ad91; background: transparent; padding: 0; pointer-events: none; }
.cosign small { visibility: hidden; }
.cosign-ready .cosign { pointer-events: auto; }
.cosign-ready .cosign small { visibility: visible; }
.cosign-ready .cosign { border-color: #3f8a4c; background: #e7f4e3; animation: pulse 1s steps(2) infinite; }
.cosign.done { border-style: solid; border-color: transparent; }
@keyframes pulse { 50% { background: #cfe9c7; } }

/* ---- The voXel console (after voXel's iPad interface): sidebar, viewer, notepad ---- */
#monitor { position: absolute; left: 430px; top: 4px; width: 88px; height: 66px; border: 0; padding: 0; background: url(art/monitor.png) no-repeat center / contain; }
#monitor:hover { outline: 2px solid var(--amber); }
#monitor-count { position: absolute; right: 2px; top: 0; min-width: 14px; height: 14px; border-radius: 7px; background: #e5484d; color: #fff; font: 9px/14px VT323, monospace; text-align: center; }
.panel.vx { display: grid; grid-template-columns: minmax(150px, 230px) 1fr minmax(180px, 300px); grid-template-rows: minmax(0, 1fr); background: #000; color: #f2f2f7; border-color: #2c2c2e;
  font: 13px/1.3 -apple-system, 'Segoe UI', Roboto, sans-serif; z-index: 12; }
.panel.vx[hidden] { display: none; }
.vx-side { background: #1c1c1e; overflow: auto; padding: 8px; border-right: 1px solid #2c2c2e; }
.vx-h { font-weight: 600; color: #8e8e93; text-transform: uppercase; font-size: 11px; margin: 8px 4px 4px; }
.vx-row { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; background: transparent; color: inherit; border: 0; border-radius: 10px; padding: 6px; }
.vx-row.on { background: #2c2c2e; }
.vx-row img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: #000; }
.vx-row small { display: block; color: #8e8e93; }
.vx-urgent { color: #ff9f0a; }
.vx-empty { color: #8e8e93; padding: 4px; }
.vx-pt { padding: 4px; font-weight: 600; } .vx-pt small { display: block; color: #8e8e93; font-weight: 400; }
#vx-history .row { padding: 2px 4px; color: #d1d1d6; } #vx-history .f { border: 0; }
.vx-main { display: flex; flex-direction: column; min-width: 0; }
.vx-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: #1c1c1e; }
.vx-bar button { background: #2c2c2e; color: #0a84ff; border: 0; border-radius: 8px; }
.vx-icons { display: flex; gap: 10px; flex: 1; justify-content: center; overflow: hidden; }
.vx-icons svg { width: 18px; height: 18px; fill: none; stroke: #f2f2f7; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.vx-view { position: relative; flex: 1; display: grid; place-items: center; min-height: 0; }
.vx-view img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.vx-view.blank img, .vx-view.blank .ov { visibility: hidden; }
.ov { position: absolute; font: 11px/1.35 ui-monospace, Menlo, Consolas, monospace; color: #f2f2f7; text-shadow: 0 0 2px #000; }
.ov.tl { left: 8px; top: 6px; } .ov.tr { right: 8px; top: 6px; text-align: right; } .ov.bl { left: 8px; bottom: 6px; } .ov.br { right: 8px; bottom: 6px; text-align: right; }
.ov.br b { color: #ff9f0a; font-weight: 600; }
.vx-note { background: #1c1c1e; display: flex; flex-direction: column; border-left: 1px solid #2c2c2e; min-width: 0; }
.vx-note-h { display: flex; justify-content: space-between; align-items: center; padding: 8px 10px; color: #0a84ff; }
.vx-note-h button { background: transparent; color: #0a84ff; border: 0; font-weight: 600; }
.vx-tabs { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 4px 10px; color: #0a84ff; font-size: 12px; border-bottom: 1px solid #2c2c2e; }
#vx-dx { color: #f2f2f7; border: 1px solid #3a3a3c; border-radius: 6px; padding: 0 6px; }
.vx-paper { flex: 1; overflow: auto; padding: 6px 10px 10px 28px; background:
  linear-gradient(90deg, transparent 20px, #ff453a55 20px, #ff453a55 21px, transparent 21px),
  repeating-linear-gradient(#1c1c1e 0 25px, #3a3a3c 25px 26px); line-height: 26px; }
.vx-paper p { margin: 0 0 4px; color: #d1d1d6; font-style: italic; }
#vx-options { margin: 0; padding-left: 18px; }
#vx-options button { background: transparent; border: 0; color: #f2f2f7; text-align: left; padding: 0 4px; width: 100%; }
#vx-options button.on { color: #0a84ff; font-weight: 600; text-decoration: underline; }
#vx-intro { position: absolute; inset: 0; background: #000; display: grid; place-items: center; z-index: 2; }
#vx-intro[hidden] { display: none; }
#vx-intro video, #vx-intro img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 900px) { .panel.vx { grid-template-columns: 150px 1fr 200px; font-size: 12px; } .vx-icons svg:nth-child(n+6) { display: none; } }

/* ---- The voXel plug on the end card ---- */
.plug { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 10px; background: #000; color: #f2f2f7; border-radius: 10px;
  font: 13px/1.4 -apple-system, 'Segoe UI', Roboto, sans-serif; }
.plug img { width: 96px; height: 96px; object-fit: cover; border-radius: 18px; flex: none; }
.plug h3 { margin: 0 0 4px; } .plug p { margin: 4px 0; } .plug ul { margin: 4px 0; padding-left: 18px; }
.plug a { color: #0a84ff; } .plug small { color: #8e8e93; }
.plug-cta { display: inline-block; background: #0a84ff; color: #fff !important; padding: 4px 10px; border-radius: 8px; text-decoration: none; font-weight: 600; }
@media (max-width: 600px) { .plug { flex-direction: column; } }

/* ---- Full-screen scenes: title, menu, backstory, register, scores, settings (title.js) ---- */
#screen { position: fixed; inset: 0; z-index: 9; background: var(--night); color: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; justify-content: safe center; gap: 12px; padding: 16px; overflow: auto; }
/* safe center: content taller than the screen starts at the top and scrolls, instead of being cut off above it */
#screen[hidden] { display: none; }
#screen > :not(.art) { position: relative; z-index: 1; }
/* The scene art keeps its 16:9 shape and covers the screen, so the effects (.fx) stay pinned to the picture. */
/* dvh: the visible height on phones (vh counts the space behind the browser's address bar); vh stays as the fallback */
.art { position: fixed; left: 50%; top: 50%; width: max(100vw, 177.78vh); height: max(100vh, 56.25vw); width: max(100vw, 177.78dvh); height: max(100dvh, 56.25vw); transform: translate(-50%, -50%);
  background: center / 100% 100% no-repeat; image-rendering: pixelated; overflow: hidden; }
.bg-night .art { background-image: url(art/bg/night.png); }
.bg-dawn .art { background-image: url(art/bg/dawn.png); }
.bg-room .art { background-image: url(art/bg/room.png); }
.art::after { content: ''; position: absolute; inset: 0; }
.dim .art::after { background: rgb(27 22 48 / 0.65); }
/* Title and menu: the logo sits in the night sky, darkened a little so it reads over the building. */
#screen.title { justify-content: flex-start; padding-top: 8vh; padding-top: 8dvh; }
.title .art::after { background: linear-gradient(rgb(27 22 48 / 0.7), rgb(27 22 48 / 0) 60%); }
/* A paper panel over a scene is a centred card, so the scene shows around it. */
#screen:not([hidden]) ~ #modal { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(640px, calc(100% - 32px)); max-height: calc(100% - 32px); }
.logo { margin: 0; font: 700 clamp(36px, 9vw, 88px)/1 'Pixelify Sans', monospace; letter-spacing: 4px; text-align: center; text-shadow: 4px 4px var(--ink); position: relative; }
.logo small { display: block; font-size: 0.22em; letter-spacing: 1px; margin-top: 8px; text-shadow: 2px 2px var(--ink); }
.tap { font: 24px 'Pixelify Sans', monospace; background: rgb(27 22 48 / 0.6); padding: 4px 14px; text-shadow: 2px 2px var(--ink); animation: blink 1.2s steps(2) infinite; position: relative; }
@keyframes blink { 50% { opacity: 0; } }
.menu { display: flex; flex-direction: column; gap: 6px; min-width: 220px; position: relative; }
.menu button, .menu a { font: 16px 'Pixelify Sans', monospace; padding: 6px 12px; text-align: center; }
.menu a { color: var(--paper); text-shadow: 1px 1px var(--ink); }
.menu button:hover, .menu button:focus-visible { outline: 3px solid var(--amber); }
/* ---- Small animations over the art (title.js fxHtml). --c is the effect's colour. ---- */
.fx { position: absolute; pointer-events: none; }
.fx-rain { overflow: hidden; }
/* Rain: thin vertical lines cut into dashes by a moving mask, two layers at different spacing and speed, tilted a little. */
.fx-rain::before, .fx-rain::after { content: ''; position: absolute; inset: -20%; transform: rotate(12deg);
  background: repeating-linear-gradient(90deg, rgb(200 215 255 / 0.4) 0 1px, transparent 1px 31px);
  -webkit-mask: repeating-linear-gradient(transparent 0 44px, #000 44px 60px); mask: repeating-linear-gradient(transparent 0 44px, #000 44px 60px);
  animation: rain 0.4s linear infinite; }
.fx-rain::after { background: repeating-linear-gradient(90deg, rgb(200 215 255 / 0.25) 0 1px, transparent 1px 19px); background-position: 9px 0;
  -webkit-mask: repeating-linear-gradient(transparent 0 30px, #000 30px 40px); mask: repeating-linear-gradient(transparent 0 30px, #000 30px 40px);
  animation-duration: 0.6s; --drop: 40px; }
@keyframes rain { to { -webkit-mask-position: 0 var(--drop, 60px); mask-position: 0 var(--drop, 60px); } }
/* Thunder: two quick flashes every 13 s. */
.fx-flash { background: #e8f0ff; mix-blend-mode: screen; opacity: 0; animation: thunder 13s infinite; }
@keyframes thunder { 0%, 61%, 63.5%, 65%, 100% { opacity: 0; } 61.5% { opacity: 0.55; } 62.5% { opacity: 0.1; } 64% { opacity: 0.4; } }
.fx-glow, .fx-flicker, .fx-blink { background: radial-gradient(closest-side, var(--c), transparent); mix-blend-mode: screen; }
.fx-glow { animation: glow 3s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: 0.2; } to { opacity: 0.65; } }
.fx-flicker { animation: flicker 4s steps(1) infinite; }
@keyframes flicker { 0%, 100% { opacity: 0.55; } 7% { opacity: 0.1; } 9% { opacity: 0.55; } 11% { opacity: 0.15; } 13% { opacity: 0.55; } 70% { opacity: 0.45; } }
.fx-blink { background: radial-gradient(closest-side, #fff 15%, var(--c) 35%, transparent); animation: blinker 0.8s steps(1) infinite; }
@keyframes blinker { 50% { opacity: 0; } }
/* A lit window going dark now and then. */
.fx-off { background: var(--c); opacity: 0; animation: off 9s steps(1) infinite; }
@keyframes off { 40% { opacity: 0.85; } 75% { opacity: 0; } }
/* Three birds crossing the dawn sky. */
.fx-birds::before { content: ''; position: absolute; top: 0; width: 60px; height: 24px; animation: birds 22s linear infinite;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 24'%3E%3Cpath d='M2 8l4-3 4 3M20 14l4-3 4 3M36 6l4-3 4 3' fill='none' stroke='%231b1630' stroke-width='2'/%3E%3C/svg%3E") no-repeat; }
@keyframes birds { from { left: -8%; transform: translateY(0); } 50% { transform: translateY(30%); } to { left: 108%; transform: translateY(0); } }
/* Light sliding over the wet car park. */
.fx-shimmer { background: repeating-linear-gradient(100deg, transparent 0 40px, rgb(255 230 190 / 0.3) 40px 46px);
  -webkit-mask: linear-gradient(transparent, #000 40%, transparent); mask: linear-gradient(transparent, #000 40%, transparent);
  animation: shimmer 4s linear infinite; }
@keyframes shimmer { to { background-position: 92px 0; } }
.reduce .tap, .reduce .fx { animation: none !important; } .reduce .fx::before, .reduce .fx::after { animation: none; } .reduce .fx-flash, .reduce .fx-off { opacity: 0; }
.story { margin: 0; width: min(960px, 100%, 100vh); width: min(960px, 100%); display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer; animation: fadein 0.4s; }
.story .frame { width: 100%; width: min(100%, calc((100dvh - 180px) * 16 / 9)); /* the panel shrinks so caption and Skip fit the visible height */ position: relative; overflow: hidden; border: 3px solid var(--ink); line-height: 0; }
.story img { width: 100%; max-height: 62vh; max-height: 62dvh; object-fit: contain; display: block; image-rendering: pixelated; }
.story figcaption { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: 8px 12px; font-size: 16px; max-width: 640px; }
@keyframes fadein { from { opacity: 0; } }
.reduce .story { animation: none; }
.story-bar { display: flex; gap: 12px; align-items: center; text-shadow: 1px 1px var(--ink); }
.card, .register { background: var(--paper); color: var(--ink); border: 3px solid var(--ink); padding: 12px 16px; width: min(640px, 100%); max-height: 100%; overflow: auto; }
.card h2, .register h2 { margin: 0 0 8px; }
.card table, .register table { border-collapse: collapse; width: 100%; }
.card td, .card th, .register td, .register th { border: 1px solid var(--line); padding: 4px 6px; text-align: left; vertical-align: middle; }
.scores tr.mine td { background: #fff1a8; font-weight: bold; }
.opts td:first-child { width: 35%; }
.register { position: relative; background: #fffaf0 repeating-linear-gradient(transparent 0 23px, #d7e3f0 23px 24px); }
.register h2 small, .register th small { display: block; font-size: 11px; font-weight: normal; }
.register th { font-size: 12px; }
.register .name { font: 22px Caveat, cursive; white-space: nowrap; }
.register .ink { position: relative; display: inline-block; } /* the pen rides the width of the name, not the cell */
.register .sigcell .sig { height: 34px; width: auto; display: block; }
.register .write { display: inline-block; clip-path: inset(0 100% 0 0); animation: write 1.2s steps(30) forwards; }
@keyframes write { to { clip-path: inset(0 0 0 0); } }
.register .pen { position: absolute; top: -4px; left: 0; width: 4px; height: 26px; background: linear-gradient(var(--ink) 80%, #c0c0c0 80%); transform: rotate(30deg); transform-origin: bottom;
  animation: pen 1.2s steps(30) forwards; }
@keyframes pen { 90% { opacity: 1; } to { left: 100%; opacity: 0; } }
.register tr.me path { animation: draw 1s 1.3s linear forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.register .chopspot { margin: 8px 0 8px auto; width: 240px; opacity: 0; animation: thump 0.3s 2.4s ease-out forwards; }
.register .chopspot svg { width: 100%; display: block; }
@keyframes thump { from { opacity: 0; transform: scale(1.6); } 60% { opacity: 1; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.register.done .write, .register.done .pen, .register.done tr.me path, .register.done .chopspot { animation: none; }
.register.done .write { clip-path: none; } .register.done .pen { opacity: 0; } .register.done tr.me path { stroke-dashoffset: 0 !important; } .register.done .chopspot { opacity: 1; }
#modal .hi { font-weight: bold; color: var(--ok); }

/* ---- The in-between screens: the handbook as an open book, the debrief on a clipboard ---- */
#modal.book { background: linear-gradient(90deg, #f6efdc 0 calc(50% - 10px), #d8cdb2 calc(50% - 2px), #b9ad91 50%, #d8cdb2 calc(50% + 2px), #f6efdc calc(50% + 10px));
  border: 10px solid #8b2a2a; border-radius: 6px; box-shadow: 0 6px 0 #5e1b1b, 0 10px 24px rgb(0 0 0 / 0.5); padding: 18px 26px;
  font-family: Georgia, 'Times New Roman', serif; }
/* The columns sit in an inner box: on the panel itself they would overflow sideways, out of sight. */
#modal.book .cols { column-count: 2; column-gap: 52px; }
#modal.book h2 { color: #8b2a2a; }
#screen:not([hidden]) ~ #modal.book { width: min(920px, calc(100% - 32px)); }
#modal.book p, #modal.book li { break-inside: avoid; }
#modal.book .choices { justify-content: center; }
#modal.clip { background: #fffaf0; border: 14px solid #8a5a35; border-radius: 10px; padding-top: 40px; box-shadow: 0 8px 24px rgb(0 0 0 / 0.5); }
#modal.clip::before { content: ''; position: absolute; top: 6px; /* inside: the panel scrolls, so its border clips */ left: 50%; width: 120px; height: 22px; margin-left: -60px;
  background: linear-gradient(#d9d9d9, #8f8f8f); border: 2px solid #555; border-radius: 6px 6px 3px 3px; }
@media (max-width: 700px) { #modal.book { background: #f6efdc; } #modal.book .cols { column-count: 1; } }

/* ---- Online leaderboard (leaderboard.js): the High scores tabs and the post form ---- */
.card .tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.card .tabs [aria-pressed="true"] { background: var(--ink); color: var(--paper); }
#modal .bad { color: var(--bad); font-weight: bold; }

