/* LS-OS, NES. How it behaves is written in INTERACTION.md; this file is how it looks.

   COLOUR: one combination from Wada Sanzo, A Dictionary of Color Combinations (1934), at a time, and nothing else.
   Default: combination 6 (Deep Indigo and Grenadine Pink). Six are built in; SETTINGS or ?palette=<n> chooses.
   Every tone below is one of the combination's own colours or a mix of two of them (straight sRGB mixes, the same as
   CSS color-mix(in srgb)); each mix is stated beside it. Letters are only ever --fg, --hi or --soft on --bg, or --bg
   on --hi (the cursor bar); all of those measure 7:1 or better (the numbers are beside each palette).
   --line, --rule and --live are for lines, frames and the LIVE square, never for letters.
   Two things are not the combination's: the game's own pictures, and DIM THE LIGHTS, which lays black around the
   picture, because lights that are out have no colour (see #dim).

   SHAPE: the unit is one 8 px tile (--u). Bars and menu rows are 5 tiles. Windows have an 8 px tile border drawn by
   os.js, with the title set into it. Menus and headings are in our own pixel font, never smaller than 2x; longer
   text is the device's own plain face at 17 px, small notes at 13 px.
   Everything that is read sits on the solid ground. Behind the page, and seen only in the margins: the game's own
   picture, huge and soft (#bg), under the LCD mesh (#grid); both are in the combination's colours.

   MOTION (all of it is in this file, under "motion" at the end, and INTERACTION.md says how it behaves): a press
   changes the page in the same frame and the motion plays alongside it; nothing waits for a motion to end. Every
   motion goes one way and stays (a slide, a dissolve from the old picture to the new, a line of words arriving):
   nothing blinks, pulses, loops or dips and comes back. The cursor bar steps: it never glides.
   prefers-reduced-motion, or MOTION: STILL in SETTINGS: no slides, no dissolves, no typing; only the slow fades of light remain (DIM THE LIGHTS,
   the backdrop), because for light a fade is the gentler thing. */

/* The combinations themselves (--bg0, --fg0, --hi0, --soft0, --line0, --live0, --rule0 for each data-pal) are in
   ../css/palettes.css, which index.html loads before this file: the plain pages wear the same ones (../css/site.css). */

/* the tokens everything uses. They are registered colours so DIM THE LIGHTS can fade them (600 ms, linear). */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #000; }
@property --fg { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --hi { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --soft { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --line { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --live { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --rule { syntax: "<color>"; inherits: true; initial-value: #888; }
html { --bg: var(--bg0); --fg: var(--fg0); --hi: var(--hi0); --soft: var(--soft0); --line: var(--line0); --live: var(--live0); --rule: var(--rule0);
  transition: --bg 600ms linear, --fg 600ms linear, --hi 600ms linear, --soft 600ms linear, --line 600ms linear, --live 600ms linear, --rule 600ms linear; }
html.boot { transition: none; } /* the page opens in its own colours: no fade from the default while it starts */
/* DIM THE LIGHTS, on every screen: the ground goes to a fifth of itself (near black), letters to four
   fifths, so the page is clearly darker and still reads (every scheme 5:1 or better dimmed, measured by tools/walk.ts). The white scheme has no dark of its own: dimmed, its ground is near black and its letters light grey. */
html.lo { --bg: color-mix(in srgb, var(--bg0) 20%, #000); --fg: color-mix(in srgb, var(--fg0) 80%, #000); --hi: color-mix(in srgb, var(--hi0) 80%, #000);
  --soft: color-mix(in srgb, var(--soft0) 80%, #000); --line: color-mix(in srgb, var(--line0) 55%, #000); --live: color-mix(in srgb, var(--live0) 74%, #000);
  --rule: color-mix(in srgb, var(--rule0) 45%, #000); }
/* the light grounds (html[data-light]: WHITE and the light combinations, marked by js/front.js and setPalette) have no dark of their own:
   dimmed, the ground is the pale tone taken almost to black and the letters are that pale tone, darker. WHITE keeps its own greys. */
html.lo[data-light] { --bg: color-mix(in srgb, var(--bg0) 8%, #000); --fg: color-mix(in srgb, var(--bg0) 78%, #000); --hi: color-mix(in srgb, var(--bg0) 78%, #000); --soft: color-mix(in srgb, var(--bg0) 64%, #000);
  --line: color-mix(in srgb, var(--bg0) 50%, #000); --live: color-mix(in srgb, var(--dlive0, var(--bg0)) 85%, #000); --rule: color-mix(in srgb, var(--bg0) 22%, #000); }
html.lo[data-pal="white"] { --bg: #121212; --fg: #b4b4b4; --hi: #b4b4b4; --soft: #969696; --line: #7a7a7a; --live: #b4b4b4; --rule: #333333; }
/* ACCESSIBILITY (SETTINGS; on by itself when the device asks for more contrast): letters pushed toward white (or
   black), quiet labels as strong as the body, frames and rules as strong as the letters. */
html.a11y:not([data-light]) { --fg: color-mix(in srgb, var(--fg0) 45%, #fff); --hi: color-mix(in srgb, var(--hi0) 50%, #fff); --soft: color-mix(in srgb, var(--fg0) 45%, #fff); --line: color-mix(in srgb, var(--hi0) 50%, #fff); --rule: color-mix(in srgb, var(--fg0) 50%, var(--bg0)); }
html.a11y[data-light] { --fg: color-mix(in srgb, var(--fg0) 45%, #000); --hi: color-mix(in srgb, var(--hi0) 50%, #000); --soft: color-mix(in srgb, var(--fg0) 45%, #000); --line: color-mix(in srgb, var(--hi0) 50%, #000); --rule: color-mix(in srgb, var(--fg0) 50%, var(--bg0)); }
html.a11y[data-pal="white"] { --soft: #000; --rule: #000; }
html.a11y.lo:not([data-light]) { --bg: color-mix(in srgb, var(--bg0) 20%, #000); --fg: color-mix(in srgb, var(--fg0) 45%, #ccc); --hi: color-mix(in srgb, var(--hi0) 50%, #ccc); --soft: color-mix(in srgb, var(--fg0) 45%, #ccc); --line: color-mix(in srgb, var(--hi0) 50%, #aaa); --rule: color-mix(in srgb, var(--fg0) 40%, #000); }
html.a11y.lo[data-light] { --fg: color-mix(in srgb, var(--bg0) 86%, #000); --hi: color-mix(in srgb, var(--bg0) 86%, #000); --soft: color-mix(in srgb, var(--bg0) 86%, #000); --line: color-mix(in srgb, var(--bg0) 69%, #000); --rule: color-mix(in srgb, var(--bg0) 40%, #000); }
html.a11y.lo[data-pal="white"] { --fg: #d0d0d0; --hi: #d0d0d0; --soft: #d0d0d0; --line: #b0b0b0; --rule: #666; }

:root { --u: 8px; --row: calc(var(--u) * 5); --gap: calc(var(--u) * 2); --pad: 20px; --small: 14px; --t: 160ms; --slide: 240ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); font: 17px/1.6 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; overscroll-behavior: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
a { color: inherit; text-decoration: none; }
button { all: unset; box-sizing: border-box; cursor: pointer; }
p, h2, ol, ul { margin: 0; padding: 0; }
canvas, img.pic { image-rendering: pixelated; image-rendering: crisp-edges; display: block; }
:focus { outline: none; }
::selection { background: var(--hi); color: var(--bg); }
/* a word in the pixel font: the mask is drawn by os.js; the word itself stays in the element at no size */
.px { position: relative; display: inline-block; flex: none; font-size: 0; line-height: 0; white-space: pre; overflow: hidden; vertical-align: middle; }
.px::before { content: ""; position: absolute; inset: 0; background: currentColor; -webkit-mask: var(--m) 0 0 / 100% 100% no-repeat; mask: var(--m) 0 0 / 100% 100% no-repeat; image-rendering: pixelated; }
.pxl { display: grid; justify-items: start; min-width: 0; }
.hi { color: var(--hi); } .soft { color: var(--soft); } .left { justify-self: start; }

/* behind everything, bottom to top: the LCD mesh (4 px pitch, in the rule colour), clear in the middle of the page and
   full at its edges; then the picture of where the cursor is, 48x32 and softened by os.js until it is only light, in
   two tones of the combination (the ground for its darks, the highlight for its lights), shown at 30%. Neither moves.
   No filter and no mask is used (they cost a frame on slow machines): the picture is softened once, when it is drawn,
   and the mesh is cleared in the middle by a sheet of the ground colour laid over it. */
#grid { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
#grid::before { content: ""; position: absolute; inset: 0; background-image: linear-gradient(var(--rule) 1px, transparent 1px), linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: calc(var(--u) / 2) calc(var(--u) / 2); }
#grid::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, var(--bg) 30%, transparent 100%); }
#bg { position: fixed; inset: -80px; z-index: 1; pointer-events: none; }
#bg canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; image-rendering: auto; opacity: 0; }
#bg canvas.on { opacity: .3; }

#app { position: fixed; inset: 0; height: 100dvh; z-index: 2; display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }

/* status bar and help bar: the ground, one line */
#bar, #foot { background: var(--bg); display: grid; align-items: center; padding: 0 var(--gap); min-width: 0; white-space: nowrap; }
#bar { grid-template-columns: auto minmax(0, 1fr) auto; column-gap: var(--gap); min-height: var(--row); border-bottom: 2px solid var(--line); }
#brand { justify-self: start; height: var(--row); display: flex; align-items: center; }
#tabs { display: flex; height: var(--row); justify-content: center; min-width: 0; overflow-x: auto; scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
/* the section you are in: a block under its name (never a second cursor bar). --tp: the space either side of a name, 9 px,
   or less (down to 6) where all of them would not fit otherwise (os.js fitTabs); then the status bar leaves out DEMO, the
   clock and the battery, in that order (#bar.nopre, .noclock, .nobatt) */
.tab { display: flex; align-items: center; gap: 6px; height: 100%; padding: 0 var(--tp, 9px); color: var(--soft); flex: none; }
#bar.nopre #pre, #bar.noclock #clock, #bar.nobatt #batt { display: none !important; }
.tab.on { color: var(--hi); box-shadow: inset 0 -6px 0 var(--hi); }
.tab .pip { width: 6px; height: 6px; background: var(--live); display: none; }
.tab.live .pip { display: block; }
#status { justify-self: end; display: flex; align-items: center; height: var(--row); color: var(--soft); }
#status > * { display: flex; align-items: center; gap: 6px; height: var(--row); }
#live b { width: 8px; height: 8px; box-shadow: inset 0 0 0 2px var(--line); }
/* the pre-release demo's mark (os.js tickPre): a small filled tag after LATENT SPACE, at the type's own size, no motion */
#pre { display: flex; align-items: center; margin-left: 8px; padding: 3px 4px 2px; background: var(--hi); color: var(--bg); }
#pre[hidden] { display: none; }
#bar { grid-row: 1; } #main { grid-row: 3; } #foot { grid-row: 4; }
#live.on b { background: var(--live); box-shadow: none; }
#batt i { display: block; width: 22px; height: 12px; border: 2px solid var(--line); padding: 1px; position: relative; }
#batt i::after { content: ""; position: absolute; right: -5px; top: 2px; width: 3px; height: 4px; background: var(--line); }
#batt i b { display: block; height: 100%; background: var(--line); }

#foot { grid-template-columns: minmax(0, 1fr) auto; gap: var(--gap); height: calc(var(--u) * 8); border-top: 2px solid var(--line); }
#legal { font: var(--small)/17px var(--sans); color: var(--soft); overflow: hidden; white-space: normal; max-height: 51px; text-wrap: balance; } /* the disclaimer's first two sentences, in up to 3 lines inside the bar's fixed height. Never cut with an ellipsis: where they do not fit beside the key hints, os.js (fitLegal) shows the first sentence alone, or nothing */
#keys { display: flex; gap: calc(var(--u) * 3); height: 100%; justify-self: end; }
#keys .k { display: flex; align-items: center; gap: var(--u); height: 100%; color: var(--fg); }
#keys button { display: flex; align-items: center; justify-content: center; gap: 12px; height: 100%; min-width: 44px; color: var(--fg); }
/* a key cap: a filled square button with a glyph or a short word in it (the key hints, the small player, MEDIA's buttons). One look; a place changes only its size */
.cap { display: grid; place-items: center; height: 40px; min-width: 40px; padding: 0 10px; background: var(--hi); color: var(--bg); flex: none; }
#keys .lbl { color: var(--soft); }

main { position: relative; min-height: 0; min-width: 0; }
.view { position: absolute; inset: 0; margin: 0 auto; max-width: 1512px; padding: var(--gap); }

/* a window: the ground inside an 8 px tile border (the tiles are drawn in os.js and arrive as --tile) */
.win { position: relative; background: var(--bg); background-clip: padding-box; border: 8px solid transparent; border-image: var(--tile) var(--slice) / 8px stretch; padding: var(--u) var(--gap); min-width: 0; min-height: 0; }
/* above a scrolled page: its faded pictures sit on a layer of their own (Eri, 2026-11-20: "about gets cut off") */
.win > .ttl { position: absolute; z-index: 2; top: -19px; left: 12px; background: var(--bg); padding: 4px 8px; color: var(--hi); display: flex; max-width: calc(100% - 24px); overflow: hidden; }
.win > .cnt { position: absolute; z-index: 2; bottom: -19px; right: 12px; background: var(--bg); padding: 4px 8px; display: flex; color: var(--soft); }

/* menu rows: the cursor is one solid bar in the highlight colour with the ground's colour for type. It steps: no transition, ever. */
.rows { overflow-y: auto; scrollbar-width: none; min-height: 0; overscroll-behavior: contain; }
.rows::-webkit-scrollbar, .page::-webkit-scrollbar, .side::-webkit-scrollbar, .stage::-webkit-scrollbar, .info::-webkit-scrollbar { display: none; }
/* a list with pinned rows (SAVES): the pinned rows stay, the others scroll between them; .more says how many are out of sight */
.rows.split { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; }
.rows.split > .scroll { overflow-y: auto; scrollbar-width: none; min-height: 0; overscroll-behavior: contain; }
.rows.split > .scroll::-webkit-scrollbar { display: none; }
.rows.split .morel { display: flex; justify-content: flex-end; min-height: 20px; padding: 2px 12px 0; color: var(--soft); border-top: 1px solid var(--rule); }
.rows.split .rowhead .more { margin-left: auto; white-space: pre; } .rows.split .rowhead .more.both { display: none; }
.list.short .rows.split .rowhead .more.up, .list.short .rows.split .morel { display: none; } .list.short .rows.split .rowhead .more.both { display: flex; }
.list.short .rows.split .rowhead { margin-top: 0; } .list.short { padding-top: 12px; }
.rows.split .scroll .row .thumb { margin: 0 2px; }
/* a phone on its side, or any screen under 500 px tall (os.js paintList, short): every list keeps the window's whole
   height and the dialogue box stands beside it (no info window); an opened page takes the list's place, as on a phone */
.list.short { grid-template-rows: minmax(0, 1fr) auto; }
.list.short > .listw { grid-row: 1 / 3; }
.list.short > .dlg { grid-column: 2; grid-row: 1 / 3; }
.list.short.pg { grid-template-columns: minmax(0, 1fr) clamp(260px, 36%, 360px); }
.list.short.pg > .listw { display: none; }
.list.short.pg > .docw { grid-column: 1; grid-row: 1 / 3; }
.stage .pnote, .touch .pnote { min-height: 20px; font: 14px/20px var(--sans); color: var(--fg); }
.row { min-height: var(--row); width: 100%; display: flex; align-items: center; gap: 12px; padding: 5px 12px; color: var(--fg); cursor: pointer; }
.row .n { color: var(--soft); }
.row .t { min-width: 0; }
.row .val { margin-left: auto; color: var(--soft); }
.row .col, .rowhead .col { flex: 0 0 var(--cw, 104px); min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; display: flex; align-items: center; font: 13px/1.2 var(--sans); }
.row .t0, .rowhead .t0 { flex: 0 0 var(--c0, 120px); min-width: 0; overflow: hidden; }
.row .thumb { flex: none; width: 60px; height: 40px; box-shadow: 0 0 0 2px var(--line); margin: 4px 2px; }
/* a group's heading is a small filled tag standing on its hairline, as a window's title stands on its frame: an underline alone read as one more row (Eri, 2026-11-21: "the headers of new items in the menus are unclear .. just distinguished by the underline") */
.rowhead > .tag { align-self: flex-end; background: color-mix(in srgb, var(--rule) 45%, var(--bg)); color: var(--fg); padding: 4px 8px 3px; margin-bottom: -5px; }
.rowhead:has(> .tag) { padding-left: 0; } .rows > .rowhead:first-child { margin-top: 2px; }
/* SETTINGS, colours: a table of small squares, each a combination's ground with its letters' colour inside; the one that is on is framed */
.row.swrow { align-items: flex-start; } .row.swrow .two { gap: 10px; padding: 4px 0 8px; }
.sws { display: flex; flex-wrap: wrap; gap: 8px 7px; padding: 4px; } .sw { position: relative; width: 20px; height: 20px; box-shadow: 0 0 0 1px var(--rule); cursor: pointer; }
.sw::after { content: ""; position: absolute; inset: 6px; background: currentColor; } .sw.on { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); } /* two rings, so one shows on the cursor's fill and the other on the ground */
.rowhead { min-height: calc(var(--u) * 4); display: flex; align-items: center; gap: 12px; padding: 4px 12px; color: var(--soft); border-bottom: 1px solid var(--rule); margin-top: var(--u); }
/* ABOUT at 1280 x 800 showed seven of its nine rows (os.js paintList, snug): rows of 36 px and closer headings, the type as it was, only while that makes the whole list fit */
.list.snug .row { min-height: 36px; padding-top: 3px; padding-bottom: 3px; } .list.snug .rowhead { min-height: 28px; padding-top: 2px; padding-bottom: 2px; margin-top: 4px; }
.row.on, .cdb.on { background: var(--hi); color: var(--bg); }
.row.on .n, .row.on .val, .row.on .col { color: var(--bg); }
.row.on .thumb { box-shadow: 0 0 0 2px var(--bg); }
.act { display: inline-flex; align-items: center; gap: 10px; min-height: var(--row); padding: 0 var(--gap); background: var(--hi); color: var(--bg); justify-self: start; }
.quiet { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: var(--row); padding: 0 var(--gap); background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 2px var(--line); }
.quiet:active { background: var(--hi); color: var(--bg); }
/* an action that opens another site (ABOUT, Support: the gift link, os.js actBtn): the same bar with a pixel heart for
   its mark. Under the pointer it turns over into a frame (highlight on the ground); with the keyboard on it, a second
   frame stands 2 px off it. Square, in the combination's own colours, and it steps: no transition. */
.act.out:hover { background: var(--bg); color: var(--hi); box-shadow: inset 0 0 0 2px var(--hi); }
.act.out:focus-visible { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--hi); }
.act.out:hover:focus-visible { box-shadow: inset 0 0 0 2px var(--hi), 0 0 0 2px var(--bg), 0 0 0 4px var(--hi); }

/* a picture of the game: a line around whole pixels. Black behind it: that is the game's own unlit screen. */
.art { position: relative; background: #000; box-shadow: 0 0 0 2px var(--line); margin: 2px; flex: none; overflow: hidden; }
.art canvas, .art img { width: 100%; height: 100%; }
.art .intro, .art video { display: block; width: 100%; height: 100%; } .art .intro { cursor: pointer; } .art video, .art .intro img { image-rendering: pixelated; } /* the opening before the file question (js/intro.js) */
.art .livec { position: absolute; inset: 0; opacity: 0; } .art .livec.show { opacity: 1; }
.art .over { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; gap: var(--u); background: var(--bg); text-align: center; }
.art .over.gone { opacity: 0; pointer-events: none; }
.art iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* label and value rows */
.meta { display: grid; grid-template-columns: auto minmax(0, 1fr); width: 100%; }
.meta > * { min-height: calc(var(--u) * 4); padding: 5px 0; border-bottom: 1px solid var(--rule); display: flex; align-items: center; overflow: hidden; }
.meta > :nth-child(odd) { color: var(--soft); padding-right: var(--gap); }
.meta > :nth-child(even) { justify-content: flex-end; }
.sq { display: inline-block; width: 8px; height: 8px; background: var(--live); flex: none; }
.bar { height: 8px; width: 100%; box-shadow: inset 0 0 0 2px var(--line); padding: 2px; } .bar i { display: block; height: 100%; width: 0; background: var(--hi); }

/* the dialogue box: what the thing under the cursor is, or what just happened. The words are there at once.
   Pixel font when they fit the box; the body face when they are too many (.plainsay, then .tiny). */
.dlg { padding: 14px var(--pad); cursor: default; } /* --pad: a window's words start under the first letter of its title, in every window */
.dlg > .act { position: absolute; right: var(--pad); bottom: 14px; }
@media (max-width: 759px) { .dlg > .act { position: static; margin-top: 8px; } } /* a phone: under the words, never over them */
.dlg p { overflow-y: auto; scrollbar-width: none; } .msg { overflow: hidden; } /* never cut short: a box too small for its words scrolls */
.plainsay { font: 20px/30px var(--sans); } .plainsay.tiny { font: 17px/24px var(--sans); }

/* home: the sections as a carousel of pictures; the card in the middle is the cursor */
.home { display: grid; grid-template-rows: minmax(0, 1fr) auto auto; gap: var(--gap); max-width: none; padding-left: 0; padding-right: 0; }
.lane { display: grid; align-content: center; overflow: hidden; touch-action: pan-y; }
.track { display: flex; width: max-content; will-change: transform; }
.card { display: grid; justify-items: center; align-content: start; gap: var(--gap); cursor: pointer; }
/* an unchosen card dims as one picture: dimming each canvas let the still show through WATCH's live picture (Eri, 2026-11-20: "the watch is weird looking") */
.card:not(.on) .art { box-shadow: 0 0 0 2px var(--rule); } .card:not(.on) .art > canvas:not(.livec) { filter: brightness(.4); } .card:not(.on) .art > canvas.livec { filter: brightness(.4); }
.plate { display: grid; place-items: center; height: 56px; padding: 0 24px; background: var(--bg); color: var(--soft); box-shadow: 0 0 0 2px var(--rule); }
.card.on .plate { background: var(--hi); color: var(--bg); box-shadow: 0 0 0 2px var(--hi); }
.home .dlg { width: min(880px, calc(100% - var(--gap) * 2)); margin: 0 auto; }
.home .legal { display: none; }
/* home on a phone on its side (os.js paintHome, short): the dialogue box beside the row of cards, the names at 3x */
.home.short { grid-template-columns: minmax(0, 1fr) clamp(260px, 36%, 360px); grid-template-rows: minmax(0, 1fr); padding-right: var(--gap); }
.home.short .dlg { grid-column: 2; grid-row: 1; width: auto; margin: 0; }
.home.short .card { gap: var(--u); }
.home.short .plate { height: 48px; }

/* a section: the list window, the info window, the dialogue box */
.list { display: grid; grid-template-columns: var(--lw, 520px) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 20px var(--gap); padding-top: 24px; }
.listw { padding: var(--u) 0; display: grid; grid-template-rows: minmax(0, 1fr); align-content: start; }
.info { display: grid; align-content: start; justify-items: center; gap: var(--gap); padding: var(--pad); overflow-y: auto; scrollbar-width: none; } /* the same padding as an opened page (.doc), so nothing shifts when a row is opened */
.info > p, .info > .meta, .info > .head, .info > .lab, .info > .facts { justify-self: start; }
.info > .head { display: flex; align-items: flex-end; gap: var(--gap); color: var(--hi); }
.list > .dlg { grid-column: 1 / -1; }
.list.solo { grid-template-columns: minmax(0, 1fr); }

/* a page: one window you read */
.page { overflow-y: auto; scrollbar-width: none; padding-top: 24px; }
.doc { width: min(760px, 100%); margin: 0 auto; display: grid; gap: var(--gap); justify-items: start; padding: var(--pad) var(--pad) 24px; }
.doc p, .info p { max-width: 62ch; }
.lab { color: var(--soft); margin-top: var(--u); }
.doc .head { display: flex; align-items: flex-end; gap: var(--gap); color: var(--hi); }
.note, p.soft { font: var(--small)/1.5 var(--sans); color: var(--soft); } /* --small: the one size for small notes (13 px was hard to read in the quiet colour) */
.cd { display: grid; gap: 4px; width: 100%; padding-bottom: var(--u); border-bottom: 1px solid var(--rule); }
.cdtop { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.cdb { display: flex; align-items: center; min-height: calc(var(--u) * 4); padding: 0 var(--u); margin-left: calc(var(--u) * -1); color: var(--hi); }
.cdoften { margin-left: auto; color: var(--soft); }
table.est { width: 100%; border-collapse: collapse; font: 15px/1.3 var(--mono); font-variant-numeric: tabular-nums; }
table.est th, table.est td { text-align: right; padding: var(--u) 0 var(--u) var(--gap); border-bottom: 1px solid var(--rule); font-weight: 400; }
table.est th { color: var(--soft); font-size: 13px; }
table.est th:first-child, table.est td:first-child { text-align: left; padding-left: 0; }

/* a page opens in the same frame as its list (2026-11-14, the owner: going in and out should feel like one UI). The list
   window stays where it was with the opened row framed (not filled: the cursor is in the page now), the page is the
   right-hand window, the dialogue box stays at the bottom. On a phone the page takes the list window's place. */
.docw { display: grid; grid-template-rows: minmax(0, 1fr); padding: 0; }
.list .doc { width: auto; margin: 0; min-height: 0; overflow-y: auto; scrollbar-width: none; align-content: start; padding: var(--pad) var(--pad) 24px; }
.list .doc::-webkit-scrollbar { display: none; }
.row.open { box-shadow: inset 0 0 0 2px var(--hi); color: var(--hi); }
.row.open .n, .row.open .val { color: var(--hi); }
.pics { display: flex; flex-wrap: wrap; gap: var(--gap); }
.pics figure { margin: 0; display: grid; gap: var(--u); }
.pics figcaption { font: var(--small)/1.5 var(--sans); color: var(--soft); max-width: 62ch; }
.steps { margin: 0; padding-left: 1.6em; display: grid; gap: 4px; max-width: 62ch; }
.steps li { padding-left: 4px; }
.facts { list-style: square; margin: 0; padding-left: 1.4em; display: grid; gap: 4px; max-width: 62ch; }

/* the live stage and the game: the picture, and a side window */
.stage { display: grid; grid-template-columns: auto minmax(280px, 400px); grid-template-rows: auto auto; justify-content: center; align-content: start; gap: 20px var(--gap); padding-top: 24px; overflow-y: auto; scrollbar-width: none; }
.stage > .dlg { grid-column: 1; }
.stage.big { grid-template-columns: auto; padding-top: 20px; } /* the picture alone, in the middle (a press on it; os.js playBig) */
.side { grid-row: 1 / span 2; grid-column: 2; display: grid; align-content: start; gap: var(--gap); padding: var(--gap); align-self: start; }
.acts { list-style: none; display: grid; width: 100%; }
.acts li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: var(--u); min-height: 26px; align-items: start; overflow: hidden; }
.keys2 { display: grid; grid-template-columns: auto 1fr; gap: 0 var(--gap); width: 100%; }
.keys2 > * { align-self: center; margin: 3px 0; }
.btns { display: flex; flex-wrap: wrap; gap: var(--u); }
/* beside the running game: two even columns, so four buttons are a square of large targets and none wraps alone (Eri, 2026-11-20: "can this menu's buttons at the bottom please be more erganomic?") */
.side .btns { display: grid; grid-template-columns: 1fr 1fr; }
.side .btns .quiet { min-height: 44px; padding: 0 var(--u); }
.keycols { display: flex; flex-direction: column; } .keycols.two { flex-direction: row; flex-wrap: wrap; gap: 0 24px; } .keycols.two .keys2 { flex: 1 1 auto; width: auto; }
.side.keysw { display: flex; flex-direction: column; } .side.keysw .btns { margin-top: auto; } .stage > .note.under { grid-column: 1; grid-row: 2; width: 0; min-width: 100%; max-width: none; color: var(--fg); } /* on the backdrop, not in a window: the full colour, as .pnote there */ /* beside the game: the window is as tall as the picture (os.js), the keys at its top, the buttons and the note at its foot */
.side .pnote:empty { display: none; } /* no empty line (and its two gaps) between the buttons and the note until a save or load has something to say */

/* play, before the game runs: one window in the middle */
.center { display: grid; place-content: center; }
.center .win { width: min(560px, calc(100vw - 32px)); display: grid; gap: var(--gap); padding: 20px var(--gap) var(--gap); }
.center .rows { margin: 0 calc(var(--gap) * -1); }
.log { list-style: none; font: 14px/1.5 var(--mono); display: grid; gap: 4px; color: var(--soft); }
.needs { font: 13px/1.5 var(--mono); color: var(--soft); word-break: break-all; }

/* the game in a narrow window without touch: the picture and two buttons */
.touch { display: flex; flex-direction: column; align-items: center; gap: var(--gap); padding: var(--u) 0 var(--gap); }
.touch .screen { margin-top: auto; margin-bottom: auto; }
.padbar { width: 100%; max-width: 400px; padding: 0 var(--gap); display: flex; gap: var(--u); }
.padbar .quiet { flex: 1; }

/* the game on a touch screen (2026-11-15, the owner: "Nes' buttons are not comfortable to use in mobile"): the picture,
   a pad for two thumbs, and the page's two buttons. Nothing here scrolls, zooms, selects or opens a long-press menu.
   Upright: the picture and Pause / Sound at the top, the pad along the bottom. Sideways: the picture in the middle, the
   D-pad and L on the left, A and B and R on the right, SELECT and START under the picture. Sizes come from os.js
   (--dp: the D-pad's side; --ab: the A/B area; --by: the pad's distance from the bottom). */
.view.thumbs { padding: 0; display: block; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.thumbs * { -webkit-touch-callout: none; }
.thumbs .top { position: absolute; left: 0; right: 0; top: 0; bottom: calc(var(--ctl) + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: var(--u) 0; }
.thumbs .screen { flex: none; }
.thumbs .sys { display: flex; gap: var(--u); }
.thumbs .sys .quiet { min-height: 40px; min-width: 120px; padding: 0 12px; }
.thumbs .sys .quiet.dimb { min-width: 48px; }
.dev { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; } .dev a { width: 40px; height: 40px; display: grid; place-items: center; color: var(--fg); box-shadow: inset 0 0 0 2px var(--line); } .devl { display: flex; gap: 12px; }
.dev a:hover, .dev a:focus-visible { background: var(--hi); color: var(--bg); } .dev svg { width: 20px; height: 20px; fill: currentColor; }
.thumbs .pnote { min-height: 20px; font: 14px/20px var(--sans); color: var(--soft); text-align: center; padding: 0 12px; }
.tp { position: absolute; display: grid; place-items: center; color: var(--fg); touch-action: none; }
/* a part of the pad: the ground colour, a 2 px line; held, it fills with a quiet mix of the highlight (no flash, no
   motion: it steps, like the cursor) */
.tp .k { display: grid; place-items: center; background: var(--bg); box-shadow: inset 0 0 0 2px var(--line); }
.tp .k.down { background: color-mix(in srgb, var(--hi) 34%, var(--bg)); }
.tp.dp { width: var(--dp); height: var(--dp); left: var(--inx, 14px); bottom: calc(var(--by) + env(safe-area-inset-bottom, 0px)); }
.tp.dp .k { position: absolute; width: calc(var(--dp) / 3); height: calc(var(--dp) / 3); }
.tp.dp .k[data-b="Up"] { left: calc(var(--dp) / 3); top: 0; } .tp.dp .k[data-b="Down"] { left: calc(var(--dp) / 3); bottom: 0; }
.tp.dp .k[data-b="Left"] { left: 0; top: calc(var(--dp) / 3); } .tp.dp .k[data-b="Right"] { right: 0; top: calc(var(--dp) / 3); }
.tp.dp .k > * { display: block; } /* one arrow, turned, so the four are the same size */
.tp.dp .k[data-b="Up"] > * { transform: rotate(90deg); } .tp.dp .k[data-b="Right"] > * { transform: rotate(180deg); } .tp.dp .k[data-b="Down"] > * { transform: rotate(270deg); }
.tp.dp .hub { position: absolute; left: calc(var(--dp) / 3 - 2px); top: calc(var(--dp) / 3 - 2px); width: calc(var(--dp) / 3 + 4px); height: calc(var(--dp) / 3 + 4px); background: var(--bg); }
.tp.dp .hub::after { content: ""; position: absolute; inset: 30%; box-shadow: inset 0 0 0 2px var(--rule); }
.tp.ab { width: var(--ab); height: var(--ab); right: var(--inx, 12px); bottom: calc(var(--by) + env(safe-area-inset-bottom, 0px)); }
.tp.ab .k { position: absolute; width: calc(var(--ab) * .42); height: calc(var(--ab) * .42); border-radius: 50%; }
.tp.ab .k[data-b="B"] { left: 0; bottom: calc(var(--ab) * .1); } .tp.ab .k[data-b="A"] { right: 0; top: calc(var(--ab) * .1); }
.tp.sh { width: 132px; height: 48px; bottom: calc(var(--by) + var(--dp) + 20px + env(safe-area-inset-bottom, 0px)); }
.tp.sh .k { width: 100%; height: 40px; }
.tp.sh.l { left: 12px; } .tp.sh.r { right: 12px; }
.tp.mid { left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 36px; }
.tp.mid > div { display: grid; place-items: center; height: 48px; }
.tp.mid .k { width: 92px; height: 32px; border-radius: 16px; box-shadow: inset 0 0 0 2px var(--rule); color: var(--soft); }
.tp.mid .k.down { color: var(--fg); }
.thumbs.land .top { left: var(--side); right: var(--side); bottom: 62px; justify-content: flex-start; padding-top: 6px; }
.thumbs.land .tp.mid { bottom: 8px; }
.thumbs.land .tp.sh { top: 10px; bottom: auto; }
.thumbs.land .sys2 { position: absolute; top: 66px; display: grid; gap: var(--u); width: calc(var(--side) - 24px); }
.thumbs.land .sys2.l { left: 12px; } .thumbs.land .sys2.r { right: 12px; }
.thumbs.land .sys2 .quiet { min-height: 40px; padding: 0 8px; }
.thumbs.land .pnote { text-align: left; padding: 0; }

/* DIM THE LIGHTS: four black sheets around the picture (never over it), faded in and out over 600 ms. Black is the one
   colour that is not the combination's: lights that are out have no colour. With the lights out the backdrop and the
   mesh go down to almost nothing, on every screen, picture or not (html.lo; the tokens dim at the top of this file). */
#dim { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
#dim i { position: fixed; background: #000; opacity: 0; transition: opacity 600ms linear; }
body.dim #dim { pointer-events: auto; cursor: pointer; } body.dim #dim i { opacity: .6; } /* .9 read as black (Eri, 2026-11-20) */

/* a window over the page: the pause menu, a question, a choice. What is under it is held back by a sheet of the ground
   colour at 72% (#scrim, which outlives the window so it can fade out). */
#scrim { position: fixed; left: 0; right: 0; z-index: 4; pointer-events: none; background: var(--bg); opacity: 0; }
body.over #scrim { opacity: .72; }
#menu { position: fixed; left: 0; right: 0; top: 0; bottom: 0; z-index: 5; display: grid; place-items: center; }
#menu .win { width: min(480px, calc(100vw - 32px)); padding: 20px 0 var(--u); display: grid; gap: var(--u); max-height: calc(100% - 16px); grid-template-rows: auto minmax(0, 1fr) auto; }
#menu .msg { padding: var(--u) 12px 0; border-top: 1px solid var(--rule); margin-top: var(--u); height: 74px; }
#menu .msg.tiny { height: auto; min-height: 74px; padding-bottom: 4px; } /* a line too long even in the small face makes the window taller; it was cut off mid-letter at the window's edge */
#menu .ask { padding: 0 12px var(--u); font: 15px/1.5 var(--sans); } /* 12 px, as a row's: the question, the rows and the line under them start on one edge */
#menu .win.big { width: min(760px, calc(100vw - 32px)); padding-top: 32px; gap: 20px; }
#menu .win.big .ask { font-size: 20px; line-height: 1.6; padding: 0 28px 8px; }
#menu .win.big .row { min-height: 60px; }
/* the window's parts in a column: only the rows give way (and scroll) when the window is as tall as it may be */
#menu .win { display: flex; flex-direction: column; } #menu .win > * { flex: none; } #menu .win > .rows { flex: 0 1 auto; }
#menu .win > .art { align-self: center; }
#menu .win.side { width: min(720px, calc(100vw - 32px)); flex-direction: row; align-items: flex-start; gap: 16px; padding-left: 16px; }
#menu .win.side > .art { align-self: flex-start; }
#menu .win.side > .colm { flex: 1 1 0; min-width: 0; min-height: 0; max-height: 100%; display: flex; flex-direction: column; gap: var(--u); align-self: stretch; }
#menu .win.side > .colm > * { flex: none; } #menu .win.side > .colm > .rows { flex: 0 1 auto; }
#menu .win.side > .msg { flex: none; width: 240px; height: auto; align-self: stretch; margin: 0; padding: 0 var(--gap); border-top: 0; border-left: 1px solid var(--rule); }
/* a save point in a list: a picture large enough to tell where it was, when it was made, and how long ago */
.row .thumb.big { width: 96px; height: 64px; }
.row .two { display: grid; gap: 4px; min-width: 0; }
.row .sub { color: var(--soft); } .row.on .sub { color: var(--bg); }
/* on a touch screen the rows of a window over the page are a thumb's height; the page under it never scrolls */
@media (pointer: coarse) {
  #menu .row { min-height: 52px; }
  body.ingame #tabs, body.ingame #foot { display: none; }
  body.ingame.over #foot { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--bg); }
  body.ingame #app { touch-action: none; -webkit-user-select: none; user-select: none; }
}
@media (pointer: coarse) and (orientation: landscape) { #menu .row { min-height: 44px; } }
@media (pointer: coarse) and (orientation: landscape) and (max-height: 500px) { #menu .row { min-height: 40px; } #menu .win { padding-top: 10px; max-height: calc(100% - 8px); } } /* a phone on its side: six rows fit between the bars */

#emu { position: fixed; left: -9999px; top: 0; width: 240px; height: 160px; }
noscript { position: fixed; inset: auto 16px 16px; font: 14px var(--mono); z-index: 9; background: var(--bg); }

/* One bar (Eri, 2026-11-19: "i dont want two menu bars, the status stuff can become symbols or reduced in size please so
   everything fits on one line"): the status is symbols (a square for the stream, a sun or a moon for the lights, a note
   for the menu sounds, dimmed when off, the battery, the clock; each says what it is in its title), so the section names
   sit beside it at every width. Where they do not all fit (os.js fitTabs) the clock and the battery go, then LATENT
   SPACE becomes LS, and on a phone the strip scrolls sideways between LS and the symbols. */
#snd.off { opacity: .45; }
#status { gap: 12px; }
@media (max-width: 759px) {
  #bar { padding: 0 var(--u); column-gap: var(--u); }
  #tabs { justify-content: flex-start; }
  #status { gap: 12px; }
  #live .px, #clock, #batt { display: none !important; }
  #foot { grid-template-columns: 1fr; height: calc(var(--u) * 8); padding: 0 var(--u); }
  #keys .cap { height: 36px; min-width: 36px; padding: 0 8px; }
  .dlg { padding: 10px 12px; }
  .plainsay { font: 16px/23px var(--sans); } .plainsay.tiny { font: 14px/19px var(--sans); }
  #legal { display: none; }
  #keys { justify-self: center; gap: var(--gap); }
  #keys button { min-width: 40px; }
  body.ingame #tabs, body.ingame #foot { display: none; }
  body.ingame.over #foot { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--bg); } /* the pause menu keeps its legend */
  .view { padding: var(--u); }
  .home { gap: var(--u); padding: var(--u) 0; }
  .home .dlg { width: calc(100% - var(--gap)); }
  .home .legal { display: block; padding: var(--u) var(--gap); font: 13px/1.4 var(--sans); color: var(--soft); text-align: center; background: var(--bg); }
  .plate { height: 48px; }
  .list { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; gap: var(--gap); padding-top: 20px; }
  .list.long { grid-template-rows: minmax(0, 1fr) auto; }
  .list > .dlg { grid-column: 1; }
  .row { padding: 5px var(--u); gap: var(--u); } .rowhead { padding: 4px var(--u); gap: var(--u); }
  .info { padding: var(--u); gap: var(--u); }
  .page, .stage { padding-top: 20px; }
  .list.pg { grid-template-rows: minmax(0, 1fr) auto; }
  .list.pg > .listw { display: none; }
  .list .doc { padding: 16px 12px; }
  .doc { padding: 16px 12px; }
  .stage { grid-template-columns: minmax(0, 1fr); justify-items: center; gap: var(--gap); }
  .stage > .dlg, .side { grid-column: 1; grid-row: auto; width: 100%; }
  table.est { font-size: 13px; } table.est th, table.est td { padding-left: var(--u); }
}

/* ---- motion. Each one starts in the frame of the press and runs beside it; none is waited for.
   - a new screen: the screen before it lies on top (#ghost) and dissolves away over 160 ms, so every point goes
     straight from its old colour to its new one and nothing goes dark in between
   - home: the row of cards slides one card in 240 ms and the pictures change strength as they pass; steps under
     400 ms apart are cuts (os.js), so pictures never race past one after another
   - the dialogue box: the words arrive left to right, line after line (os.js sets the times: 120 letters a second)
   - a window over the page arrives in 160 ms; the sheet under it comes and goes in 300 ms
   - the live picture and its cover dissolve in 800 ms; a progress bar grows in 600 ms; the game's first picture
     comes up in 600 ms
   - the backdrop changes picture in 900 ms; DIM THE LIGHTS takes 600 ms */
#ghost { position: fixed; z-index: 3; pointer-events: none; overflow: hidden; }
#ghost .view { animation: out var(--t) var(--ease) both; }
@keyframes out { to { opacity: 0; } }
@keyframes in { from { opacity: 0; } }
@keyframes type { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
#menu.enter .win { animation: in var(--t) var(--ease) both; }
#scrim { transition: opacity 300ms linear; }
.track { transition: transform var(--slide) var(--ease); }
.track.cut { transition: none; }
.card .art canvas:not(.livec) { transition: filter var(--slide) linear; } /* one comes up as the other goes down: the light on the page stays level */
.track.cut .card .art canvas { transition: none; }
.art .livec, .art .over { transition: opacity .8s linear; }
.bar i { transition: width .6s linear; }
#bg canvas { transition: opacity .9s var(--ease); }
#bg, #grid::before { transition: opacity 600ms linear; }
html.lo #bg, html.lo #grid::before { opacity: .06; }
/* the site's own stills dim with the lights; the game and the live picture (.lit, .livec) never do */
:is(.info, .doc) .art > img, :is(.info, .doc) .art > canvas:not(.livec) { transition: opacity 600ms linear; }
html.lo :is(.info, .doc) .art > img, html.lo :is(.info, .doc) .art > canvas:not(.livec) { opacity: .45; } html.lo .card .art > canvas:not(.livec) { filter: brightness(.45); }
html.lo .card:not(.on) .art canvas { opacity: .2; }
/* the same with SETTINGS, MOTION: STILL */
html.still #ghost { display: none; }
html.still #menu.enter .win, html.still .pxl .px { animation: none !important; }
html.still .track, html.still .card .art canvas, html.still .art .livec, html.still .art .over, html.still .bar i { transition: none; }
@media (prefers-reduced-motion: reduce) {
  #ghost { display: none; }
  #menu.enter .win, .pxl .px { animation: none !important; }
  .track, .card .art canvas, .art .livec, .art .over, .bar i { transition: none; }
}

/* ---- ACCESSIBILITY (SETTINGS; on by itself when the device asks for more contrast). Every word in the pixel font is
   shown in the device's own plain face instead, larger and with more space between lines; the colours above are
   stronger; the cursor bar is taller and carries a ▶ so it never depends on colour alone; motion is STILL (os.js). */
/* (:not(:empty): a drawn icon has no word in it, MEDIA's play, previous, next and loop, and keeps its pixels; without this those buttons were blank) */
html.a11y .px:not(:empty) { font: 600 clamp(19px, calc(var(--k, 2) * 9px), 56px)/1.4 var(--sans); width: auto !important; height: auto !important; overflow: visible; white-space: normal; display: inline; vertical-align: baseline; letter-spacing: .01em; }
html.a11y .px:not(:empty)::before { display: none; }
html.a11y .pxl { display: block; }
html.a11y body { font-size: 19px; line-height: 1.7; }
html.a11y .doc p, html.a11y .info p { font-size: 19px; line-height: 1.7; }
html.a11y .note, html.a11y p.soft, html.a11y .pics figcaption { font: 17px/1.6 var(--sans); }
html.a11y .plainsay, html.a11y .plainsay.tiny { font: 19px/28px var(--sans); }
html.a11y .dlg p { overflow-y: auto; scrollbar-width: thin; }
html.a11y .home .dlg p { height: auto !important; min-height: 84px; } /* home's box grows with its sentence: on a phone the larger face needs four or five lines where the box had three, and the last one was cut off */
@media (max-width: 759px) { html.a11y .home .dlg p { min-height: 112px; } } /* four lines at least on a phone only: on a desktop the pictures are sized for a box of three, and a fourth pushed the box up against the cards' names */
@media (max-width: 759px) { html.a11y .rowhead .t0 .px { font-size: 12px; } } /* CONTROLS on a phone: the heading over the first column is the size of the other three, on one line */
html.a11y .row { position: relative; min-height: 56px; padding-top: 8px; padding-bottom: 8px; padding-left: 36px; }
html.a11y .row.on::before, html.a11y .row.open::before { content: "▶"; position: absolute; left: 10px; top: 50%; transform: translateY(-50%); font: 700 19px/1 var(--sans); }
html.a11y .act::before { content: "▶"; font: 700 19px/1 var(--sans); flex: none; }
html.a11y .act > .px:first-child { display: none; }
html.a11y .row.open::before { content: "▷"; }
html.a11y .rowhead { padding-left: 36px; }
html.a11y .row.open { box-shadow: inset 0 0 0 4px var(--hi); }
html.a11y .row .col, html.a11y .rowhead .col { white-space: normal; overflow: visible; overflow-wrap: anywhere; padding-right: 6px; font-size: 16px; line-height: 1.3; }
html.a11y .row .col .px, html.a11y .rowhead .col .px { font-size: 16px; }
@media (max-width: 759px) { html.a11y .row .col, html.a11y .row .col .px { font-size: 14px; overflow-wrap: normal; } html.a11y .rowhead .col, html.a11y .rowhead .col .px { font-size: 12px; overflow-wrap: normal; } html.a11y .row .t0, html.a11y .rowhead .t0 { flex-basis: 76px; } html.a11y .row .col, html.a11y .rowhead .col { flex: 1 1 0; padding-right: 2px; } html.a11y .row, html.a11y .rowhead { gap: 6px; } html.a11y .row, html.a11y .rowhead { padding-left: 30px; } html.a11y .row.on::before, html.a11y .row.open::before { left: 6px; } }
html.a11y .meta > * { min-height: 44px; }
html.a11y .tab.on { box-shadow: inset 0 -8px 0 var(--hi); }
html.a11y #legal { font-size: 15px; line-height: 18px; max-height: 54px; }
html.a11y .win > .ttl, html.a11y .win > .cnt { padding: 0 8px; top: -16px; line-height: 1.2; }
html.a11y .win > .cnt { top: auto; bottom: -16px; }
html.a11y #keys .cap { min-width: 44px; }
/* on a phone the larger face made the hints wider than the bar (ENTER ran into its neighbour and "Play the demo" was cut): they stay inside it, and a long label takes two short lines */
@media (max-width: 759px) { html.a11y #keys { max-width: 100%; gap: 10px; } html.a11y #keys .k, html.a11y #keys button { min-width: 0; flex: 0 1 auto; gap: 6px; } html.a11y #keys .cap { min-width: 36px; flex: none; } html.a11y #keys .lbl { font-size: 16px; line-height: 1.15; } }
html.a11y #bar { grid-template-columns: 1fr auto; }
html.a11y #tabs { grid-row: 2; grid-column: 1 / -1; border-top: 1px solid var(--rule); justify-content: safe center; }
html.a11y table.est { font-size: 17px; }

/* WATCH, one view (os.js paintWatch): the status on the left under two small tabs standing on its window's top line (the
   playlist's list tabs), the game on the right as large as whole pixels allow. Plain type, --fg on --bg (4.5:1 or more in
   every scheme); the window scrolls inside itself, never off the page. A phone: the game on top, the status under it. */
.view.watch { display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); gap: 0 32px; padding: 16px; }
.watch .wleft { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
/* the same tabs as MEDIA's (the playlist page's) */
.watch .wtabs { display: flex; align-items: flex-end; gap: 8px; padding: 0 20px; margin-bottom: -1px; position: relative; z-index: 1; flex: none; }
.watch .wtabs button { position: relative; display: flex; align-items: center; height: 30px; padding: 0 14px 2px; color: var(--fg); background: color-mix(in srgb, var(--rule) 45%, var(--bg)); } /* an unchosen tab: still filled, in a quieter fill with the letters' own colour (ground letters on the rule tone measured 2.2 to 3.4:1) */
.watch .wtabs button::after { content: ""; position: absolute; inset: -12px 0 0; } /* 44 px to press, as MEDIA's: the tab itself stays 30 px on every device */
.watch .wtabs button.on { background: var(--hi); color: var(--bg); box-shadow: none; }
/* the light grounds (WHITE, 52, 84, 268): --rule is a pale tone, and the ground's letters on it could not be read; an unchosen tab there has the dark letters */
html[data-light]:not(.lo) .watch .wtabs button:not(.on), html[data-light]:not(.lo) .media .mtabs button:not(.on) { color: var(--fg); }
.watch .wstat { flex: 1 1 auto; min-height: 0; overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.watch .wpane { flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 20px 24px; display: grid; gap: 10px; align-content: start; }
.watch .wpane::-webkit-scrollbar, .watch .wlog::-webkit-scrollbar { display: none; }
.watch .wpane[hidden], .watch .wlog[hidden], .watch .wfoot[hidden], .watch .wfoot [hidden] { display: none; }
/* STATUS: a log of HERMES's steps in the type of a terminal, the newest at the bottom, and the facts pinned under it
   (Eri, 2026-11-20: "stuff pinned at the bottom so the status can be better understood ... they should read like terminal logs") */
.watch .wpane.wlogp { display: flex; flex-direction: column; gap: 0; padding: 0; overflow: hidden; }
/* the log reads as a terminal (Eri, 2026-11-21: "can we style the terminal better btw? its a little plain"): a darker ground,
   a title line, each step a prompt line (its number, the buttons as keys) with HERMES's words hanging under it on a rule,
   a steady cursor after the newest, and the pinned rows as a status bar. Nothing blinks. */
.watch .wlogp { --term: color-mix(in srgb, var(--bg) 62%, #000); background: var(--term); }
html[data-light] .watch .wlogp { --term: color-mix(in srgb, var(--bg) 94.5%, #000); } /* a light ground only goes a shade darker (WHITE: #f1f1f1); 62% would be a grey slab under dark letters */
html[data-light] .watch .wlog .wres.bad .wico { color: inherit; } /* 268's --live (Raw Sienna) is 2.48:1 on its pale log ground, too weak even for the arrow: on the light grounds a failed move is the letter colour throughout */
html.lo .watch .wlog li { opacity: 1; } /* the lights dimmed: the letters are already four fifths of themselves, and an older turn stepped back again fell to 3.7:1 (6, 337) */
.watch .wtop { flex: none; display: flex; justify-content: space-between; gap: 12px; padding: 7px 16px; border-bottom: 1px solid var(--rule); font: 12px/1.5 var(--mono); letter-spacing: .04em; color: var(--soft); }
.watch .wtop[hidden] { display: none; } .watch .wtop .wtn::before { content: "\25CF  "; color: var(--rule); } .watch .wtop .wts.on { color: var(--hi); }
.watch .wlog { list-style: none; margin: 0; flex: 1 1 auto; min-height: 0; overflow-y: auto; scrollbar-width: none; padding: 10px 16px 14px; font: 14px/1.5 var(--mono); -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 20px); mask-image: linear-gradient(to bottom, transparent 0, #000 20px); } /* the line the scroll cuts at the top goes out softly, not struck through by the title's rule */
.watch .wlog li { padding: 8px 0 6px; opacity: .8; } .watch .wlog li:last-child { opacity: 1; } /* older turns step back a little; at .8 their --soft lines still read (4.5:1 on WHITE) */
/* a turn as the Hermes CLI prints one: his name, his words, a dotted bar and a row for each tool he called, what came back */
.watch .wlog .wh { display: flex; gap: 10px; align-items: baseline; }
.watch .wlog .wwho { color: var(--hi); font-weight: 700; } .watch .wlog .wn { color: var(--soft); font-size: 12px; }
.watch .wlog .wth { margin: 3px 0 5px; color: var(--fg); overflow-wrap: anywhere; }
.watch .wlog .wtool { display: grid; grid-template-columns: 1ch 2ch 6ch minmax(0, 1fr); gap: 0 1ch; align-items: baseline; }
.watch .wlog .wbar { color: var(--line); } .watch .wlog .wico { color: var(--hi); text-align: center; } .watch .wlog .wverb { color: var(--hi); }
.watch .wlog .warg { color: var(--fg); overflow-wrap: anywhere; }
.watch .wlog .wres { display: grid; grid-template-columns: 1ch 2ch minmax(0, 1fr); gap: 0 1ch; align-items: baseline; color: var(--soft); overflow-wrap: anywhere; } .watch .wlog .wres.bad { color: var(--fg); } .watch .wlog .wres.bad .wico { color: var(--live); } /* a failed move: its words in the letter colour and only the arrow in --live, which is never for letters (as letters on an older turn it measured 3.4:1 on 190, 4.0:1 on 141 and 265) */ /* the tool rows' columns: the arrow under the icons, the words under the verbs, a second line under the first */
.watch .wlog .wres .wico { color: inherit; }
.watch .wlog li:last-child > p:last-child::after, .watch .wlog li:last-child > div:last-child > :last-child::after { content: ""; display: inline-block; width: .55em; height: 1.05em; margin-left: 6px; vertical-align: text-bottom; background: var(--hi); }
.watch .wfoot { flex: none; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 14px; padding: 9px 16px 11px; border-top: 2px solid var(--line); background: color-mix(in srgb, var(--line) 12%, var(--bg)); font: 13px/1.5 var(--mono); }
.watch .wfoot .wfl { color: var(--soft); } .watch .wfoot .wfv { color: var(--fg); overflow-wrap: anywhere; } /* a long model name takes a second line on a phone; it is never cut */
.watch .wfoot .wfv:last-child { color: var(--hi); }
.watch .wlogp > .wline { padding: 20px 24px; }
.watch .wline { font: 22px/1.45 var(--sans); color: var(--fg); overflow-wrap: anywhere; margin-bottom: 8px; }
.watch .wrow { display: grid; gap: 4px; padding: 10px 0; border-top: 1px solid var(--rule); }
.watch .wval { font: 18px/1.45 var(--sans); color: var(--fg); overflow-wrap: anywhere; }
.watch .wright { display: grid; place-items: center; min-width: 0; min-height: 0; }
.watch.phone { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); gap: 16px; padding: 8px; }
.watch.phone .wright { order: -1; }
.watch.phone .wpane { padding: 16px; } .watch.phone .wpane.wlogp { padding: 0; } .watch.phone .wlog { padding: 10px 14px; font-size: 13px; } .watch.phone .wfoot { padding: 8px 14px 10px; }
.watch.phone .wline { font-size: 19px; }
.watch.phone .wval { font-size: 17px; }

/* ---- MEDIA, laid out as the playlist (Eri, 2026-11-19: "also the media tab doesnt have the same styles we created for the
   playlist"; tools/music_playlist/page.html): solid tabs standing on the list window's top line, rows with the number, a
   picture, the name and its place in the plain face, the length; NOW PLAYING and the picture window beside it (under it on
   a phone). Letters are only --fg, --hi or --soft on --bg, or --bg on --hi, as everywhere. Nothing here moves by itself:
   the seek bar's fill is the one thing that changes while something plays. */
.view.media { display: grid; grid-template-columns: minmax(0, 1fr) clamp(300px, 40%, 480px); grid-template-rows: minmax(0, 1fr); gap: 0 var(--gap); max-width: 1180px; } /* the view's own padding on top, so the tabs stand where WATCH's do */
.media .mleft { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.media .mlist { flex: 1 1 auto; min-height: 120px; } /* the list window is as tall as the view (the playlist page's full-height list), so both columns end on one line */
/* MUSIC is an album: a cover and its facts over a plain list of tracks, and no picture window beside it (Eri, 2026-11-20:
   "look less like it and more like a spotify album thingy") */
.media.music .mlist { grid-template-rows: auto minmax(0, 1fr); }
.media .malbum { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: var(--gap); align-items: end; padding: var(--u) var(--gap) var(--gap); border-bottom: 1px solid var(--rule); margin-bottom: var(--u); }
.media .malbum img { width: 132px; aspect-ratio: 1; object-fit: cover; image-rendering: pixelated; background: #000; box-shadow: 0 0 0 2px var(--line); }
.media .malbum .mwords { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.media .malbum .soft { font: 14px/1.3 var(--sans); color: var(--soft); }
.media .malbum .cap { margin-top: 6px; }
.view.media.music:not(.phone) .mpic:not(.full):not(.words) { display: none; }
.media.phone .malbum { grid-template-columns: 84px minmax(0, 1fr); padding: 6px 12px 12px; } .media.phone .malbum img { width: 84px; }
/* music playing on outside MEDIA: a small player in the bottom bar */
#foot:has(#mini:not([hidden])) { grid-template-columns: minmax(0, 1fr) auto auto; }
#mini { display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 34vw; }
#mini .cap { min-width: 44px; }
#mini .mname2[hidden] { display: none; }
#mini .mname2 { font: 15px/1.2 var(--sans); color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; text-decoration: underline; text-underline-offset: 3px; }
.media .mtabs { display: flex; align-items: flex-end; gap: 8px; padding: 0 20px; margin-bottom: -1px; position: relative; z-index: 1; flex: none; }
/* the tabs of the playlist page (tools/music_playlist.py #tabs), copied (Eri, 2026-11-20: "we should really copy the /playlist/ page self hosted for the tabs"):
   solid, no outlines, the chosen one in its colour, resting on the window's top line */
.media .mtabs button { position: relative; display: flex; align-items: center; height: 30px; padding: 0 14px 2px; color: var(--fg); background: color-mix(in srgb, var(--rule) 45%, var(--bg)); }
.media .mtabs button::after { content: ""; position: absolute; inset: -12px 0 0; } /* 44 px to press */
.media .mtabs button.on { color: var(--bg); background: var(--hi); box-shadow: none; }
.media .mtabs .mabout { margin-left: auto; }
.media .row { gap: 12px; padding: 4px 12px; }
.media .row .n { order: -1; flex: none; width: 34px; display: flex; justify-content: flex-end; }
.media .row .thumb { width: 54px; height: 36px; object-fit: cover; image-rendering: pixelated; margin: 4px 2px; }
.media .row .mt { min-width: 0; flex: 1; display: grid; gap: 2px; overflow: hidden; }
.media .row .pl { font: 13px/1.3 var(--sans); color: var(--soft); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.media .row.on .pl { color: var(--bg); }
.media .row .val { align-self: center; }
.media .mside { display: grid; gap: 28px; align-content: start; min-width: 0; min-height: 0; margin-top: 29px; } /* the tabs' height less their 1 px: both columns' windows start on one line */
.media .mnow { padding: 18px 20px 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; align-content: start; }
.media .mname { color: var(--hi); min-height: 22px; overflow: hidden; }
.media .mplace { font: 15px/1.35 var(--sans); color: var(--fg); min-height: 20px; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.media .mcredit { font: 13px/1.3 var(--sans); color: var(--soft); }
.media .mcredit:empty { display: none; }
.media .mthumb { display: none; }
.media .seek { position: relative; height: 28px; display: flex; align-items: center; cursor: pointer; touch-action: none; margin-top: 4px; }
.media .seek::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 12px; box-shadow: inset 0 0 0 2px var(--line); }
.media .seek i { position: absolute; left: 2px; top: 10px; height: 8px; width: 0; background: var(--hi); max-width: calc(100% - 4px); }
.media .times { display: flex; justify-content: space-between; color: var(--soft); }
.media .mctl { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }
.media .cap { display: grid; place-items: center; height: 44px; min-width: 52px; padding: 0 12px; background: var(--hi); color: var(--bg); }
.media .cap.wide { min-width: 68px; }
.media .cap.off { background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 2px var(--line); }
.media .mdl { justify-self: center; margin-top: 6px; }
.media .mpic { padding: 10px; }
/* GUIDES: the guide under the cursor fills the right column and scrolls in its window */
.view.media.guides .mside { align-content: stretch; grid-template-rows: minmax(0, 1fr); }
.view.media.guides.phone { grid-template-rows: minmax(0, 38%) minmax(0, 1fr); }
.media .mguide { display: flex; min-height: 0; padding: 0; }
.media .mguide .doc { flex: 1; width: auto; margin: 0; min-height: 0; overflow-y: auto; scrollbar-width: none; align-content: start; padding: 20px 24px 24px; }
.media .mguide .doc::-webkit-scrollbar { display: none; }
/* a short window: PREVIEW gets the room under NOW PLAYING and the picture shrinks to it, keeping 3:2, instead of running past the window's foot */
.view.media:not(.phone) .mside { grid-template-rows: auto minmax(0, max-content); }
.view.media.guides:not(.phone) .mside { grid-template-rows: minmax(0, 1fr); } /* GUIDES has the one window: the rule above gave it a second, empty row and its 28 px gap, so the guide ended 28 px above the list's foot */
html.a11y .media:not(.phone) .mside { margin-top: 43px; } /* the larger face's tabs are 44 px tall */
.view.media:not(.phone) .mpic:not(.full):not(.words) { min-height: 0; display: flex; justify-content: center; }
.view.media:not(.phone) .mpic:not(.full):not(.words) .mframe { width: auto; height: auto; max-width: 100%; max-height: 100%; flex: 0 1 100%; min-width: 0; }
/* a tall picture (the phone map, 1290 x 2796) fits inside the frame: its grid row is the frame's, not the picture's (Eri, 2026-11-20: "bug") */
.media .mframe { width: 100%; aspect-ratio: 3 / 2; background: #000; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); overflow: hidden; cursor: zoom-in; }
.media .mframe img, .media .mframe video { display: block; width: 100%; height: 100%; min-width: 0; min-height: 0; object-fit: contain; image-rendering: pixelated; }
.media .mframe img.smooth { image-rendering: auto; }

.media .mpic.words .mframe { aspect-ratio: auto; background: none; cursor: default; display: grid; gap: 10px; padding: 6px 10px 8px; align-content: start; }
.media .mpic.words p { font: 15px/1.5 var(--sans); } .media .mpic.words a { text-decoration: underline; text-underline-offset: 3px; }
/* a picture shown big: its window in the middle, the page dark behind it; a press puts it back */
.media .mpic.full { position: fixed; z-index: 6; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(94vw, calc((100dvh - 120px) * 1.5)); box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--bg) 88%, transparent); }
.media .mpic.full .mframe { cursor: zoom-out; }
/* a phone held upright: the list on top, NOW PLAYING under it as one small window with the picture as a thumbnail beside the
   name (a press shows it big), so the list gets the room, as the playlist does on MUSIC; the picture window comes only for
   a film that is on, or for ABOUT's words */
.view.media.phone { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 22px 0; padding: 14px 8px 8px; }
.media.phone .mtabs { padding: 0 10px; gap: 6px; }
.media.phone .mtabs button { padding: 0 9px 2px; }
.media.phone .mside { margin-top: 0; gap: 22px; }
.media.phone .mnow { padding: 12px 14px 8px; }
.media.phone .mpic:not(.full) .mframe { max-height: 20dvh; }
.media.phone .mpic.words .mframe { max-height: 32dvh; overflow-y: auto; scrollbar-width: none; }
.media.phone .mpic:not(.full):not(.words):not(.playing) { display: none; }
.media.phone .mnow { grid-template-columns: 108px minmax(0, 1fr); column-gap: 12px; row-gap: 2px; }
.media.phone .mthumb { display: block; grid-column: 1; grid-row: 1 / span 3; align-self: start; width: 108px; aspect-ratio: 3 / 2; background: #000; object-fit: cover; image-rendering: pixelated; cursor: zoom-in; }
.media.phone .mthumb[hidden] { display: none; }
.media.phone .mname, .media.phone .mplace, .media.phone .mcredit { grid-column: 2; }
.media.phone .mplace { -webkit-line-clamp: 1; }
.media.phone .mcredit { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.media.phone .seek, .media.phone .times, .media.phone .mctl { grid-column: 1 / -1; }
.media.phone .mctl { margin-top: 4px; }
/* a screen under 560 px tall (a phone on its side, a small laptop window): the picture window gives its room to the list */
@media (max-height: 560px) { .view.media { padding-top: 12px; } .media .mside { gap: 20px; } .media .mpic:not(.full) { display: none; } .media .mnow { padding: 12px 16px 10px; } }
html.a11y .media .row .pl, html.a11y .media .mcredit { font-size: 15px; }
html.a11y .media .mtabs button { height: auto; min-height: 44px; }
/* ACCESSIBILITY: a tab that is not chosen is the ground with the letters' colour and a frame (the quiet fill behind dark letters was about 2.5:1, and on WHITE it was black on black); the chosen tab stays filled */
html.a11y .watch .wtabs button:not(.on), html.a11y .media .mtabs button:not(.on) { background: var(--bg); color: var(--fg); box-shadow: inset 0 0 0 2px var(--line); }
.media .mnow > .mabout { position: absolute; top: -19px; right: 12px; z-index: 1; display: flex; align-items: center; padding: 4px 8px; background: var(--bg); color: var(--soft); }
.media .mnow > .mabout::after { content: ""; position: absolute; inset: -10px -4px; } /* 44 px to press */
.media .mnow > .mabout.on { color: var(--hi); }
.media.phone .mdl { grid-column: 1 / -1; }
/* a phone: the list keeps at least four rows; a film that is on stands small under NOW PLAYING, never taking the list's room */
.media.phone .mlist { min-height: min(300px, 38dvh); }
.view.media.guides.phone .mlist { min-height: 0; } /* GUIDES gives its list 38% of the view: held to 300 px it ran on under the guide's window, which hid its foot and left its count on the guide's first line */
.media.phone:has(.mpic.playing) .mlist { min-height: 120px; } /* a clip that plays adds its window under NOW SHOWING: the list gives up height, or it ran on under that window and its count sat on the seek bar */
.media.phone .row .pl { white-space: normal; } /* a phone: the place takes a second line instead of being cut with dots */
.media.phone .mpic.playing:not(.full) { padding: 6px; }
.media.phone .mpic.playing:not(.full) .mframe { height: 18dvh; width: auto; max-width: 100%; justify-self: center; }

/* WATCH plays the game here (watch-play.js): the game's own picture over the still, Sound under it, the overlay's line plain */
.art .wgame { position: absolute; inset: 0; pointer-events: none; width: 100%; height: 100%; opacity: 0; image-rendering: pixelated; } .art .wgame.show { opacity: 1; }
.watch .wright { grid-template-rows: auto auto; align-content: center; gap: 12px; }
.watch .wunder { display: flex; justify-content: center; gap: 8px; }
.watch .over .wnote { font: 17px/1.45 var(--sans); color: var(--fg); max-width: 34em; padding: 0 16px; }
.watch .over .wnote:empty { display: none; }
.watch .over button[hidden], .watch .wunder[hidden] { display: none; }
.watch .art .over { z-index: 1; }
.watch.phone .over { gap: 6px; } .watch.phone .over .wnote { font-size: 14px; line-height: 1.35; padding: 0 8px; }

/* while the game runs the lights step, they do not fade: animating the page's colour tokens for 600 ms restyles the whole
   page on every frame, and the game's sound slowed while it did (Eri, 2026-11-21: "when i press dim lights the sound from
   the gameplay slows a bit") */
html.run, html.run #dim i, html.run #bg, html.run #grid::before, html.run :is(.info, .doc) .art > img, html.run :is(.info, .doc) .art > canvas:not(.livec) { transition: none !important; }
