:root {
  --bg: #15171b;
  --felt: #1d2622;
  --felt-line: rgba(255, 255, 255, 0.035);
  --ink: #e9e2d0;
  --ink-dim: #a39d8e;
  --ink-faint: #6f6a5f;
  --paper: #efe6cf;
  --paper-ink: #2a2620;
  --panel: #1f2126;
  --panel-2: #272a30;
  --line: #3a3d44;
  --accent: #d4a24c;
  --danger: #d0564a;
  --good: #6dbb6a;
  --card-w: 116px;
  --card-h: 168px;
  --serif: 'IM Fell English', Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
  --display: 'Cinzel', 'Palatino Linotype', Georgia, serif;
  --black: 'Pirata One', 'Cinzel', Georgia, serif;
  --mono: 'Courier Prime', 'Courier New', ui-monospace, monospace;
  --sans: -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
/* The notch and the gesture bar: the browser's safe area, or what the app reports (CSS px). */
:root { --inset-l: 0px; --inset-t: 0px; --inset-r: 0px; --inset-b: 0px;
  --sa-l: max(env(safe-area-inset-left, 0px), var(--inset-l)); --sa-t: max(env(safe-area-inset-top, 0px), var(--inset-t));
  --sa-r: max(env(safe-area-inset-right, 0px), var(--inset-r)); --sa-b: max(env(safe-area-inset-bottom, 0px), var(--inset-b)); }
body { touch-action: manipulation; -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }

/* ---------- Layout ---------- */
#app { display: grid; grid-template-rows: auto 1fr; height: 100vh; height: 100dvh; padding: var(--sa-t) var(--sa-r) var(--sa-b) var(--sa-l); }
#topbar {
  display: flex; align-items: center; gap: 12px; padding: 4px 14px; background: #0f1013;
  border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow: hidden; min-height: 52px;
}
#topbar .brand { flex: none; white-space: nowrap; font-family: var(--black); font-weight: 400; letter-spacing: 0.06em; color: var(--accent); font-size: 21px; line-height: 1; }
#topbar .rank { flex: none; white-space: nowrap; font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
/* The meters give way before anything else: a word too long for its room is cut, never the buttons. */
#meters { display: flex; gap: 12px; flex-wrap: nowrap; flex: 0 1 auto; min-width: 0; }
.meter { display: flex; align-items: center; gap: 6px; min-width: 104px; overflow: hidden; }
.meter .m-icon { position: relative; width: 28px; height: 28px; background: center / contain no-repeat; flex: none; }
.meter .m-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.meter .m-label { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-dim); display: flex; justify-content: space-between; gap: 8px; }
.meter .m-word { font-family: var(--display); font-size: 12px; letter-spacing: 0.04em; color: var(--paper); line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.4s; }
/* The icon reads at every level (the word carries the colour); it only brightens a little as the meter fills. */
.meter .m-icon { opacity: 0.85; transition: opacity 0.4s, filter 0.4s; }
.meter.lvl-1 .m-icon { opacity: 0.9; }
.meter.lvl-2 .m-icon { opacity: 0.95; }
.meter.lvl-3 .m-icon, .meter.lvl-4 .m-icon { opacity: 1; }
.meter.warn .m-word { color: #e08a3c; }
.meter.crit .m-word { color: var(--danger); }
.meter.lvl-3 .m-icon { filter: drop-shadow(0 0 4px rgba(224, 138, 60, 0.8)); }
.meter.rep .m-icon { opacity: 1; }
.meter.rep .m-word { color: var(--good); }
.meter.crit .m-label { color: var(--danger); }
/* Every pulse in the stylesheet is a glow drawn once on a pseudo-element whose opacity moves;
   nothing is refiltered frame by frame (the keyframes pulse, glow, urgent and urgentIcon). */
.meter.crit .m-icon::after { content: ''; position: absolute; inset: 2px; border-radius: 50%; box-shadow: 0 0 6px 3px rgba(208, 86, 74, 1); opacity: 0; animation: urgentIcon 1s infinite; pointer-events: none; }
@keyframes urgentIcon { 50% { opacity: 1; } }
.meter.rep .m-fill { background: var(--good); }
/* A meter that moves: the icon swells twice, a glow drawn once behind it pulses by opacity (red where it hurts,
   gold where it helps), and a small arrow floats the way it went and fades. */
.meter.bump { position: relative; overflow: visible; z-index: 1; }
.meter.bump-bad { --glow: rgba(208, 52, 44, 0.95); }
.meter.bump-good { --glow: rgba(240, 200, 110, 0.95); }
.meter.bump .m-icon { animation: meterBump 0.8s ease-in-out 2; }
.meter.bump::before { content: ''; position: absolute; inset-inline-start: 0; top: 50%; width: 28px; height: 28px; margin-top: -14px; border-radius: 50%; box-shadow: 0 0 10px 4px var(--glow); opacity: 0; animation: meterGlow 0.8s ease-in-out 2; pointer-events: none; }
.meter.bump .m-icon::before { content: ''; position: absolute; inset-inline-end: -3px; width: 14px; height: 14px; background: var(--art-carrow2-02) center / contain no-repeat; opacity: 0; pointer-events: none; }
.meter.bump-up .m-icon::before { top: 14px; animation: meterArrowUp 1.6s ease-out forwards; }
.meter.bump-down .m-icon::before { top: 0; animation: meterArrowDown 1.6s ease-out forwards; }
@keyframes meterBump { 50% { transform: scale(1.35); } }
/* A step inside a word: the icon nudges the way it went, and a small arrow, red where it hurts and green where it
   helps, fades beside it. */
.meter.nudge { position: relative; overflow: visible; z-index: 1; }
.meter.nudge-up .m-icon { animation: mNudgeUp 0.7s ease-out; }
.meter.nudge-down .m-icon { animation: mNudgeDown 0.7s ease-out; }
.meter.nudge .m-icon::before { content: ''; position: absolute; inset-inline-end: -4px; width: 11px; height: 11px; background: var(--art-carrow2-02) center / contain no-repeat; opacity: 0; pointer-events: none; }
.meter.nudge-bad .m-icon::before { filter: drop-shadow(0 0 3px rgba(208, 86, 74, 0.9)); }
.meter.nudge-good .m-icon::before { filter: drop-shadow(0 0 3px rgba(109, 187, 106, 0.9)); }
.meter.nudge-up .m-icon::before { top: 15px; animation: nudgeArrowUp 0.9s ease-out forwards; }
.meter.nudge-down .m-icon::before { top: 2px; animation: nudgeArrowDown 0.9s ease-out forwards; }
@keyframes mNudgeUp { 30% { transform: translateY(-4px) scale(1.18); } }
@keyframes mNudgeDown { 30% { transform: translateY(4px) scale(1.18); } }
@keyframes nudgeArrowUp { 0% { opacity: 0.95; transform: translateY(0) rotate(-90deg); } 100% { opacity: 0; transform: translateY(-6px) rotate(-90deg); } }
@keyframes nudgeArrowDown { 0% { opacity: 0.95; transform: translateY(0) rotate(90deg); } 100% { opacity: 0; transform: translateY(6px) rotate(90deg); } }
/* A new word comes in spaced out and settles. */
.meter .m-word.word-new { animation: wordIn 0.5s ease-out; }
@keyframes wordIn { from { opacity: 0; letter-spacing: 0.18em; } }
@keyframes meterGlow { 50% { opacity: 1; } }
@keyframes meterArrowUp { 0% { opacity: 0; transform: translateY(0) rotate(-90deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px) rotate(-90deg); } }
@keyframes meterArrowDown { 0% { opacity: 0; transform: translateY(0) rotate(90deg); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(10px) rotate(90deg); } }
#controls { margin-inline-start: auto; flex: none; display: flex; gap: 6px; align-items: center; }
#controls .speed { display: flex; gap: 2px; padding: 2px; border-radius: 8px; background: #1a1c20; border: 1px solid var(--line); }
#controls .speed .ctl { border: none; min-width: 40px; }
.ctl.dbi { position: relative; width: 44px; height: 44px; min-width: 44px; padding: 0; background: var(--i) center / 100% 100% no-repeat, transparent; border: none; border-radius: 50%; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); transition: transform 0.12s, filter 0.12s; }
.ctl.dbi:hover { transform: translateY(-1px); filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.7)) brightness(1.15); }
.ctl.dbi.on { background: var(--i) center / 100% 100% no-repeat; filter: drop-shadow(0 0 6px rgba(212, 162, 76, 0.9)) brightness(1.2); }
/* The fastest speed: the same button with three chevrons drawn over the two baked into bround-06. */
#controls button[data-speed="3"]::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 128 122'%3E%3Ccircle cx='63' cy='61' r='43' fill='%23f5dbb3'/%3E%3Cpath fill='%23101412' d='M29 41l24 20-24 20zM51 41l24 20-24 20zM73 41l24 20-24 20z'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.ctl.dbi small:empty { display: none; }
.ctl.dbi small { position: absolute; right: 2px; bottom: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--accent); color: #1a1508; font-family: var(--display); font-weight: 700; font-size: 10px; line-height: 16px; text-align: center; }
#controls .speed { background: transparent; border: none; padding: 0; gap: 2px; }
.ctl { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; font-size: 13px; }
.ctl:hover { border-color: var(--accent); }
.ctl.on { background: var(--accent); color: #1a1508; border-color: var(--accent); }

#main { display: grid; grid-template-columns: 1fr; min-height: 0; }
#table {
  position: relative; overflow: hidden; min-width: 0; min-height: 0; touch-action: none; cursor: grab;
  background: #061a1e; perspective: 1500px; perspective-origin: 50% 20%;
}
#table.panning { cursor: grabbing; }
/* The table plane is tilted, so the cards read as lying on it; the camera
   (#board's translate/scale) moves over the plane, the plane never moves. */
#table { contain: paint; }
/* The table's shadow is a gradient painted once on the plane, not a blur redrawn under the camera. */
#tilt { position: absolute; inset: 0; transform: rotateX(26deg); transform-origin: 50% 50%; background: radial-gradient(ellipse at 50% 45%, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.5) 100%), radial-gradient(ellipse at 50% 40%, #0e4a50, #06282d 70%); }
/* The flat table (Settings, Table: Tilt the table off; the default where the device asks for less motion). */
html[data-flat] #tilt { transform: none; contain: paint; }
html[data-flat] #table { perspective: none; }
#board { position: absolute; left: 0; top: 0; width: 1px; height: 1px; transform-origin: 0 0; will-change: transform; }
#board::before { content: ''; position: absolute; left: -550px; top: -280px; width: 2960px; height: 1900px; border-radius: 18px; background: var(--art-ntable) center / 100% 100% no-repeat; pointer-events: none; z-index: 0; }
/* Every board child is placed from the board's origin by translate3d: left and top pinned to 0, or in Arabic
   (right-to-left) a child with no left would hang off the board's right edge, a whole width off the camera. */
#board > * { position: absolute; left: 0; top: 0; z-index: 1; }
/* The token's small box: the magnet (the Bell's shows the weekly dues). */
.verb .v-magnet { display: none; position: absolute; right: -10px; top: 60%; width: 46px; height: 46px; border-radius: 8px; background: #14161a; border: 2px solid #3a3d44; box-shadow: 0 3px 0 #0a0908, 0 5px 6px rgba(0, 0, 0, 0.6); color: var(--paper); font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 42px; text-align: center; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.verb .v-magnet.asks, .verb .v-magnet.due { display: block; animation: boxIn 0.25s ease-out; }
.verb .v-magnet.asks { background-size: 78%; background-position: center; background-repeat: no-repeat; border-color: var(--accent); box-shadow: 0 3px 0 #0a0908, 0 0 10px rgba(212, 162, 76, 0.8); animation: boxIn 0.25s ease-out; cursor: pointer; }
.verb .v-magnet.asks::after { content: ''; position: absolute; inset: -2px; border-radius: 8px; box-shadow: 0 0 10px 3px rgba(212, 162, 76, 0.9); opacity: 0; animation: glow 1.6s 0.25s infinite; pointer-events: none; }
.verb.asking .v-status { color: var(--accent); }
.ask { margin: 8px 0 12px; padding: 10px 12px; border-radius: 8px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 0 0 2px var(--accent), 0 6px 16px rgba(0, 0, 0, 0.45); }
.ask.answered { box-shadow: none; opacity: 0.85; }
.ask .ask-head { font-family: var(--display); font-weight: 700; font-size: 13px; letter-spacing: 0.04em; }
.ask p { margin: 4px 0 8px; font-family: var(--serif); font-size: 13.5px; line-height: 1.45; }
.ask .plate-btn { display: block; margin: 0 auto 4px; }
.ask .vw-desc { margin: 0; text-align: center; color: #5a4f3a; font-size: 12px; }
.verb .v-magnet.due { border-color: #f0c85a; box-shadow: 0 3px 0 #0a0908, 0 0 10px rgba(240, 200, 90, 0.7); }
@keyframes boxIn { from { transform: scale(0.4); opacity: 0; } }
.verb .v-magnet:hover { transform: translateY(-2px); }
/* The Bell's box: the dues on the numbered ring (cnum), figures past nine. */
.verb.time .v-magnet { color: #f0c85a; cursor: default; background-size: 78%; background-position: center; background-repeat: no-repeat; }
.plate-btn.pull { display: block; margin: -4px auto 12px; }
/* A card on its way into a verb. */
#drag-layer .card.ghost { transition: left 0.36s ease-in, top 0.36s ease-in, transform 0.36s ease-in, opacity 0.36s; pointer-events: none; }
/* A choice the city puts to you, on the table where the camera goes. */
#board .choice { z-index: 4; width: 380px; padding: 14px 16px 12px; border-radius: 10px; background: var(--paper); color: var(--paper-ink); box-shadow: 0 0 0 3px #7c1d15, 0 0 0 5px #2a1a10, 0 24px 40px rgba(0, 0, 0, 0.65); animation: choiceIn 0.35s ease-out; cursor: default; }
#board .choice.gone { opacity: 0; transform: scale(0.96); transition: opacity 0.3s, transform 0.3s; }
@keyframes choiceIn { from { opacity: 0; transform: translateY(-10px) scale(0.97); } }
#board .choice .ch-title { font-family: var(--display); font-weight: 700; font-size: 17px; letter-spacing: 0.04em; margin-bottom: 6px; color: #5a1410; }
#board .choice .ch-text { margin: 0 0 10px; font-family: var(--serif); font-size: 14px; line-height: 1.5; }
#board .choice .ch-options { display: flex; flex-direction: column; gap: 8px; }
#board .choice .ch-opt { display: block; width: 100%; text-align: start; padding: 8px 10px; border: 1px solid #a88a4c; border-radius: 6px; background: #f6efdc; color: var(--paper-ink); cursor: pointer; transition: transform 0.12s, box-shadow 0.12s; }
#board .choice .ch-opt:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0, 0, 0, 0.35); border-color: #7c1d15; }
#board .choice .ch-opt { position: relative; padding-inline-end: 44px; }
#board .choice .ch-opt .ch-cost { position: absolute; inset-inline-end: 8px; top: 50%; width: 28px; height: 28px; margin-top: -14px; background: center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
#board .choice .ch-opt.cant { opacity: 0.55; filter: grayscale(0.6); }
/* The answer taken: the wax comes down on it, the others dim, nothing more is pressed. */
#board .choice.answered .ch-opt { pointer-events: none; transition: opacity 0.2s; }
#board .choice.answered .ch-opt:not(.taken) { opacity: 0.45; }
#board .choice .ch-opt.taken { border-color: #7c1d15; }
#board .choice .ch-opt.taken::after { content: ''; position: absolute; inset-inline-end: 0; top: 50%; width: 46px; height: 46px; margin-top: -23px; background: var(--art-cwax-01) center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); pointer-events: none; transform: rotate(-6deg); animation: stamp 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
#board .choice .ch-opt span em { font-style: italic; color: #7c1d15; }
#board .choice .ch-opt b { display: block; font-family: var(--display); font-size: 13px; letter-spacing: 0.03em; color: #2a1a10; }
#board .choice .ch-opt span { display: block; font-family: var(--serif); font-size: 12.5px; color: #5a4f3a; line-height: 1.35; margin-top: 2px; }
/* What an answer gives: chips (a meter's or a patron's seal with the way it moves, a card's icon with how many),
   then the sentence for what only shows later. No arrow glyph: it would point the wrong way in Arabic. */
#board .choice .ch-opt .ch-gain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin-top: 5px; font-family: var(--serif); font-style: italic; font-size: 11.5px; color: #1d6a49; }
#board .choice .ch-opt .ch-gain > span { display: inline; margin: 0; color: inherit; font-size: inherit; }
#board .choice .ch-opt .ch-chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
#board .choice .ch-opt .ch-chip { position: relative; display: inline-flex; margin: 0; line-height: 1; align-items: center; gap: 2px; height: 24px; padding: 0 4px 0 2px; border-radius: 12px; background: rgba(29, 106, 73, 0.12); border: 1px solid rgba(29, 106, 73, 0.45); font-style: normal; }
#board .choice .ch-opt .ch-chip.bad { background: rgba(124, 29, 21, 0.1); border-color: rgba(124, 29, 21, 0.45); }
#board .choice .ch-opt .ch-chip i { width: 20px; height: 20px; background: center / contain no-repeat; }
#board .choice .ch-opt .ch-chip b { display: inline; margin: 0; direction: ltr; unicode-bidi: isolate; font-family: var(--display); font-size: 12px; letter-spacing: 0; color: #1d6a49; }
#board .choice .ch-opt .ch-chip.bad b { color: #7c1d15; }
#board .choice .ch-opt .ch-chip.moves::after { content: ''; width: 14px; height: 14px; background: var(--art-carrow2-02) center / contain no-repeat; }
#board .choice .ch-opt .ch-chip.moves.up::after { transform: rotate(-90deg); }
#board .choice .ch-opt .ch-chip.moves.down::after { transform: rotate(90deg); }
#board .choice .ch-note { margin-top: 8px; text-align: center; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #8a7a5a; }
/* The collection pile: a strip of six faint cell outlines (one per card, like the grid's) where new
   cards land; the player drags it. The strip has no z-index of its own, and it is set by left and top
   (js/ui.js placePile), never a transform, so it makes no stacking context: it paints above the grid
   and below the cards; the tab hangs off its top-left corner and the painted label (clabel-02, the
   circle clipped away as on the hint) stands on its top edge. The tab is above the cards (z-index 2), so the pile
   can always be taken by it, even under a full row; the label is under them (z-index 0), so a card in the row
   above keeps its name in sight and the label shows wherever that row is bare. The cell pitch
   is --cell-px, set by js/screens.js from the card spacing setting. */
#board .pile-zone { z-index: auto; border: none; border-radius: 6px; cursor: grab; --cell: rgba(240, 200, 90, 0.3);
  background:
    repeating-linear-gradient(90deg, transparent 0 6px, var(--cell) 6px 7px, transparent 7px calc(var(--cell-px, 130px) - 3px), var(--cell) calc(var(--cell-px, 130px) - 3px) calc(var(--cell-px, 130px) - 2px), transparent calc(var(--cell-px, 130px) - 2px) var(--cell-px, 130px)) 0 5px / 100% calc(100% - 11px) no-repeat,
    repeating-linear-gradient(90deg, transparent 0 6px, var(--cell) 6px calc(var(--cell-px, 130px) - 2px), transparent calc(var(--cell-px, 130px) - 2px) var(--cell-px, 130px)) 0 5px / 100% 1px no-repeat,
    repeating-linear-gradient(90deg, transparent 0 6px, var(--cell) 6px calc(var(--cell-px, 130px) - 2px), transparent calc(var(--cell-px, 130px) - 2px) var(--cell-px, 130px)) 0 calc(100% - 6px) / 100% 1px no-repeat; }
#board .pile-zone.dragging { cursor: grabbing; --cell: rgba(240, 200, 90, 0.7); }
#board .pile-zone .pz-tab { position: absolute; left: 6px; top: -30px; width: 34px; height: 38px; z-index: 2; background: var(--art-ctab-04) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
#board .pile-zone .pz-label { position: absolute; left: -2px; top: -40px; height: 42px; z-index: 0; padding: 0 10px 0 6px; border: solid transparent; border-width: 14px 20px 14px 50px; border-image: var(--art-clabel-02) 28 40 28 100 fill / 14px 20px 14px 50px stretch; clip-path: inset(0 0 0 46px);
  font-family: var(--display); font-weight: 700; font-size: 11px; line-height: 14px; letter-spacing: 0.12em; text-transform: uppercase; white-space: nowrap; color: #1c1914; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
/* The grid: one cell per card, drawn as faint paper outlines. */
#board .grid { z-index: 0; pointer-events: none; opacity: 0.3; will-change: transform;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='130' height='172'%3E%3Crect x='6.5' y='6.5' width='117' height='159' rx='7' fill='none' stroke='rgba(228,206,160,0.55)' stroke-width='1'/%3E%3C/svg%3E") 0 0 repeat; }
/* Paused: a shade laid over the plane, not a filter over every card. */
#table.paused #tilt::after { content: ''; position: absolute; inset: 0; background: rgba(6, 20, 24, 0.35); pointer-events: none; }
#windows { position: absolute; inset: 0; pointer-events: none; z-index: 5; }
#drag-layer { position: fixed; inset: 0; pointer-events: none; z-index: 950; }
#pause-banner {
  position: absolute; left: 50%; bottom: 14px; transform: translate(-50%, 8px); z-index: 7; opacity: 0; pointer-events: none;
  padding: 6px 18px; border-radius: 16px; background: rgba(12, 14, 16, 0.88); border: 1px solid #b8913f; color: var(--paper);
  font-family: var(--serif); font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; font-size: 14px; transition: opacity 0.2s, transform 0.2s;
}
#pause-banner span { margin-inline-start: 10px; font-family: var(--sans); font-weight: 400; letter-spacing: 0; text-transform: none; font-size: 12px; color: var(--ink-dim); }
#table.paused #pause-banner { opacity: 1; transform: translate(-50%, 0); }
/* No keyboard under a finger: the banner says tap, and a tap on it resumes (the coarse pointer's block below). */
#pause-banner .pb-tap { display: none; }
#zoom { position: absolute; right: 12px; bottom: 12px; z-index: 6; display: flex; gap: 4px; }
#zoom button { width: 34px; height: 34px; border-radius: 8px; background: rgba(15, 17, 19, 0.85); border: 1px solid var(--line); color: var(--paper); font-size: 17px; }
#zoom button:hover { border-color: var(--accent); }
#zoom .tool-gap { width: 6px; }
#zoom button.tool-word { width: auto; padding: 0 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
#zoom button.hidden { display: none; }
.card.merged::after { --glow: rgba(255, 255, 255, 0.95); animation: mergedGlow 1s ease-out; }
@keyframes mergedGlow { 30% { opacity: 1; } }
/* Tapping an empty slot lists the cards that fit it. */
.slot .s-box.empty { cursor: pointer; }
.slot .s-box.empty:hover { filter: brightness(1.15); }
.slot.picking .s-box { filter: drop-shadow(0 0 8px rgba(212, 162, 76, 0.9)); }
.picker { margin: -4px 0 12px; padding: 8px 10px; border: 1px dashed #a88a4c; border-radius: 8px; background: rgba(255, 250, 238, 0.6); }
.picker .pk-head { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #8a5a1a; }
.picker .pk-head span { flex: 1; }
.picker .pk-close { background: none; border: none; color: #5a4f3a; font-size: 16px; cursor: pointer; padding: 0 4px; }
.picker .pk-none { margin: 6px 0 0; font-size: 12px; color: #5a4f3a; font-family: var(--serif); }
.picker .pk-cards { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-height: 260px; overflow: auto; }
.picker .pk-card { cursor: pointer; }
.picker .pk-card:hover .c-face { transform: translateY(-3px); filter: drop-shadow(0 0 6px rgba(212, 162, 76, 0.9)); }
/* The hint is a painted label bar under the verbs: the circle (crisp, from ::before) carries the
   marker, the panel (::after, nine-sliced like .plate-btn) stretches with the words. */
#hint { position: absolute; left: 50%; top: 10px; bottom: auto; white-space: pre-line; transform: translateX(-50%); z-index: 4; max-width: 70%; min-height: 40px; padding-block: 8px; padding-inline: 54px 18px; isolation: isolate; text-align: center; font-family: var(--serif); font-size: 13px; line-height: 1.3; color: #1f1b15; pointer-events: auto; transition: opacity 0.6s; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55)); }
#hint::after { content: ''; position: absolute; inset: 0; z-index: -1; border: solid transparent; border-width: 16px 24px 16px 92px; border-image: var(--art-clabel-06) 32 48 32 184 fill / 16px 24px 16px 92px stretch; clip-path: inset(0 0 0 46px); }
#hint::before { content: ''; position: absolute; inset-inline-start: 0; top: 50%; width: 46px; height: 40px; margin-top: -20px; background: var(--art-bround-17) 8px center / 28px 28px no-repeat, var(--art-clabel-06) left center / auto 40px no-repeat; }
#hint.gone { opacity: 0; pointer-events: none; }
/* A desk with a verb window docked at the right: the hint keeps to the felt left of it, centred there, so a long
   lesson never runs under the window. (Phones put the window at the foot and have their own hint below.) */
@media (min-width: 981px) and (min-height: 521px) {
  body.has-window #hint { left: calc((100% - 390px * var(--ui-scale, 1)) / 2); max-width: calc(100% - 420px * var(--ui-scale, 1)); }
}
#hint.go { cursor: pointer; }
#hint.advice { filter: drop-shadow(0 0 6px rgba(212, 162, 76, 0.55)) drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55)); }
#hint.advice::before { filter: drop-shadow(0 0 4px rgba(212, 162, 76, 0.9)); }
/* The journal: a drawer over the right of the table, shown on request. */
/* Closed, the drawer is hidden as well as slid out, so it is not kept as a painted layer off the edge; it hides once the slide is over. */
#journal-drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(380px, 90%); transform: translateX(105%); visibility: hidden; transition: transform 0.25s ease, visibility 0s linear 0.25s; z-index: 30; border-left: 1px solid var(--line); background: rgba(22, 24, 28, 0.97); display: flex; flex-direction: column; min-height: 0; box-shadow: -8px 0 24px rgba(0, 0, 0, 0.5); }
#journal-drawer.open { transform: translateX(0); visibility: visible; transition: transform 0.25s ease, visibility 0s; }
/* The drawer's head is the small blue banner (cbar-02); the journal below it is paper. */
.side-head { display: flex; justify-content: space-between; align-items: center; margin: 6px 10px 0; padding-block: 2px; padding-inline: 14px 6px; border: solid transparent; border-width: 20px 36px; border-image: var(--art-cbar-02) 46 60 fill / 20px 26px stretch; background: none; color: #1c1914; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.22em; text-transform: uppercase; }
.side-head button { background: none; border: none; color: #1c1914; font-size: 20px; cursor: pointer; padding: 0 4px; margin: -10px 0; }
/* The Journal closes with the red roundel X, as the windows do. */
#journal-close { width: 36px; height: 36px; padding: 0; border-radius: 50%; color: transparent; font-size: 0; background: var(--art-cok-02) center / 100% 100% no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
#journal-close:hover { filter: drop-shadow(0 0 6px rgba(255, 120, 100, 0.8)); }
#journal { flex: 1; overflow: auto; padding: 12px 14px; min-height: 0; margin: 4px 10px 10px; background: rgba(239, 227, 198, 0.92); color: #1f1b15; border: 2px solid #b8913f; box-shadow: inset 0 0 0 4px rgba(239, 227, 198, 0.92), inset 0 0 0 5px #8f7440; }
#btn-journal.on { color: var(--accent); }
#btn-journal.unread::after { content: ''; position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
#btn-journal { position: relative; }

.verb .v-plate.long { font-size: 12px; letter-spacing: 0.03em; }
/* The count of cards in a token: the numbered wax (cwaxn), figures on a plain disc past five. */
.verb .v-count { position: absolute; top: -8px; left: -8px; width: 30px; height: 30px; background: center / contain no-repeat; color: var(--paper); font-family: var(--display); font-weight: 700; font-size: 13px; line-height: 30px; text-align: center; text-shadow: 0 0 3px #000, 0 1px 2px #000; transform: scale(0); transition: transform 0.2s; }
.verb .v-count.figures, .verb .v-badge.figures { background-color: #7c1d15; border-radius: 50%; box-shadow: 0 0 0 2px #0e1112; }
.verb.loaded .v-count { transform: scale(1); }
.verb.dragging { transform: none; }

/* The dossier floats at the top left of the table: the painted panel (cpanel3-01) at seven tenths,
   its bar and the baked X in the border, the words on its paper. The panel scrolls, and a scroller
   clips at its padding box, so the X's hot spot is the button beside it (#peek-x, index.html),
   which the stylesheet shows and places over the X while the dossier is open. */
#peek { position: absolute; top: 12px; left: 12px; width: 330px; max-height: calc(100% - 140px); overflow: auto; z-index: 26; padding: 8px 4px 6px 2px; color: var(--paper-ink); background: none;
  border: solid transparent; border-width: 45px 46px 20px 14px; border-image: var(--art-cpanel3-01) 64 66 28 20 fill / 1 stretch;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.55)); font-size: 13px; opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
/* Only a pinned dossier (a card tapped, a meter asked about) takes the pointer: the one a mouse resting on a card
   opens is a picture over the felt, so the press, the drag and the next hover go through it to what lies under. */
#peek.open { opacity: 1; transform: none; pointer-events: none; }
#peek.open.pinned { pointer-events: auto; }
/* Over the card it shows, the dossier stands at the other side of the table (js/ui.js placePeek). */
#peek.far { left: auto; right: 12px; }
#peek .peek-close { display: none; }
#peek-x { display: none; position: absolute; z-index: 27; width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%; background: none; color: transparent; font-size: 0; cursor: pointer; }
#peek.open.pinned + #peek-x { display: block; left: calc(318.4px * var(--ui-scale, 1) - 22px); top: calc(36.5px * var(--ui-scale, 1) - 22px); }
#peek.open.pinned.far + #peek-x { left: auto; right: calc(35.6px * var(--ui-scale, 1) - 22px); }
#peek-x:hover { box-shadow: 0 0 12px rgba(255, 120, 100, 0.7); }
/* The panel's painted band carries the kind's seal and the name (the panel's own content starts under it), clear
   of the X; it is drawn beside the panel like the X, and shows while the dossier is open. */
#peek-head { display: none; position: absolute; z-index: 27; left: 32px; top: 15px; width: 262px; height: 38px; align-items: center; gap: 8px; color: var(--paper); pointer-events: none; overflow: hidden; zoom: var(--ui-scale, 1); }
#peek.open ~ #peek-head.on { display: flex; }
#peek.far ~ #peek-head { left: auto; right: 60px; }
#peek-head .k-icon { flex: none; width: 26px; height: 26px; background: center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.7)); }
#peek-head h4 { margin: 0; min-width: 0; font-family: var(--display); font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
/* What a charge needs and has, in icons: each kind of proof with its pips (filled, had; empty, wanted). */
#peek .i-proof { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 6px 0; }
#peek .pf-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 6px 2px 3px; border-radius: 12px; background: rgba(120, 90, 50, 0.12); box-shadow: inset 0 0 0 1px rgba(120, 90, 50, 0.35); }
#peek .pf-chip .chip-icon { width: 22px; height: 22px; }
#peek .pf-chip b { font-size: 14px; line-height: 1; letter-spacing: 1px; color: #7c1d15; }
#peek .pf-chip.met { box-shadow: inset 0 0 0 1px rgba(80, 110, 60, 0.6); }
#peek .pf-chip.met b { color: #4c6a33; }
#peek .pf-chip.pf-word b { color: #5a4f3a; }

/* ---------- Verbs ---------- */
/* Tokens sit on the board and can be dragged anywhere; clicking opens a window. */
.verb {
  position: absolute; left: 0; top: 0; width: 240px; height: 292px; display: flex; flex-direction: column; align-items: center;
  cursor: grab; user-select: none; touch-action: none; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.verb.dragging { transition: none; z-index: 20; cursor: grabbing; }
/* A layer of its own only while it moves: nothing is promoted at rest. */
.card.lifted, .card.settle, .card.flying, .card.arrive, .verb.dragging, #drag-layer .card { will-change: transform; }
/* A square tile twice a card's width, raised: a thick lower edge and a shadow on the felt. */
.verb .v-token { position: relative; width: 232px; height: 232px; margin-top: 4px; flex: none; background: #0f1517 center / 100% 100% no-repeat; border-radius: 12px;
  box-shadow: 0 12px 0 #1a1410, 0 13px 0 1px #0b0908, 0 22px 26px rgba(0, 0, 0, 0.6); transition: transform 0.15s, box-shadow 0.15s; }
.verb:hover .v-token { transform: translateY(-4px); box-shadow: 0 16px 0 #1a1410, 0 17px 0 1px #0b0908, 0 30px 32px rgba(0, 0, 0, 0.6); }
.verb.dragging .v-token { transform: translateY(-10px) scale(1.03); box-shadow: 0 22px 0 #1a1410, 0 23px 0 1px #0b0908, 0 40px 40px rgba(0, 0, 0, 0.65); }
/* Set to work, the slab is pressed into the felt (its edge shrinks as it sinks); its work done, it rises once before
   the green glow. Translate only, on the tile itself: the table's tilt sits on an ancestor and is not touched. */
.verb.pressed .v-token { animation: press 0.22s ease-out; }
@keyframes press { 35% { transform: translateY(8px); box-shadow: 0 4px 0 #1a1410, 0 5px 0 1px #0b0908, 0 8px 10px rgba(0, 0, 0, 0.6); } }
.verb.risen .v-token { animation: rise 0.3s ease-out; }
@keyframes rise { 40% { transform: translateY(-6px); box-shadow: 0 18px 0 #1a1410, 0 19px 0 1px #0b0908, 0 32px 34px rgba(0, 0, 0, 0.6); } }
/* A drop refused: the tile or the slot shakes its head; under less motion its edge flashes red instead. */
.verb.refuse .v-token, .slot.refuse { animation: refuse 0.3s ease-out; }
@keyframes refuse { 20% { transform: translateX(-5px); } 40% { transform: translateX(4px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.vwin.refuse, html[data-calm] .verb.refuse .v-token, html[data-calm] .slot.refuse { outline: 2px solid transparent; outline-offset: 2px; animation: refuseFlash 0.3s ease-out; }
@keyframes refuseFlash { 30% { outline-color: var(--danger); } }
/* Held under a finger long enough to lift: the tile rises before it moves. */
/* The name, on a plate below the tile. */
.verb .v-plate {
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: 16px; width: 200px; height: 40px; box-sizing: border-box;
  border: solid transparent; border-width: 12px 26px; border-image: var(--art-cpill-03) 27 46 fill / 12px 26px stretch;
  display: flex; align-items: center; justify-content: center; pointer-events: none;
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.08em; text-transform: uppercase; color: #1c1914; white-space: nowrap; overflow: hidden;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55));
}
/* The clock: a rounded square drawn just outside the token's edge, so the icon stays clear. */
.verb .v-ring { position: absolute; left: -8px; top: -8px; width: calc(100% + 16px); height: calc(100% + 16px); overflow: visible; pointer-events: none; z-index: 1; }
/* No filter on the ring: it is redrawn as it runs, and a filter repaints the whole token each time. The glow is a
   wider pale stroke behind the line, sharing its dash; the track keeps no edge glow. */
.verb .v-ring rect { fill: none; stroke: var(--accent); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 0 999; }
.verb .v-ring rect.glow { stroke-width: 14; stroke-opacity: 0.35; }
.verb .v-ring rect.track { stroke: rgba(12, 10, 8, 0.75); stroke-dasharray: none; }
.verb.locked .v-ring, .verb.time .v-ring rect.track { opacity: 0.5; }

.verb .v-week { position: absolute; left: 50%; top: 42px; transform: translateX(-50%); background: #0e1112; color: var(--paper); font-family: var(--serif); font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 4px; white-space: nowrap; }
.verb .v-name { font-family: var(--mono); font-weight: 700; font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; text-align: center; color: var(--paper); text-shadow: 0 1px 3px #000; }
.verb .v-status { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); padding: 2px 10px; border-radius: 11px; background: rgba(14, 12, 10, 0.78); font-size: 13px; font-weight: 700; color: var(--paper); font-variant-numeric: tabular-nums; white-space: nowrap; z-index: 2; pointer-events: none; }
.verb .v-status:empty { display: none; }
/* What a finished verb holds: the numbered wax (cwaxn), the mark (cmark-04) with a '!' when it is only word. */
.verb .v-badge { position: absolute; top: -10px; right: -10px; width: 40px; height: 40px; background: center / contain no-repeat; color: var(--paper); font-family: var(--display); font-weight: 700; font-size: 16px; line-height: 40px; text-align: center; text-shadow: 0 0 3px #000, 0 1px 2px #000; transform: scale(0); transition: transform 0.2s; }
.verb.done .v-badge { transform: scale(1); }
.verb.running .v-status { color: var(--accent); }
.verb.open .v-token { filter: drop-shadow(0 0 8px rgba(212, 162, 76, 0.95)); }
.verb.loaded .v-token { filter: drop-shadow(0 0 5px rgba(212, 162, 76, 0.6)); }
/* The token's glow: drawn once on ::before (::after is the lock), its opacity pulses. */
.verb.done .v-token::before, .verb.new .v-token::before, .verb.noticed .v-token::before { content: ''; position: absolute; inset: 0; border-radius: 12px; box-shadow: 0 0 14px 6px var(--glow, rgba(212, 162, 76, 1)); opacity: 0; pointer-events: none; }
.verb.noticed .v-token::before { animation: glow 0.9s 4; }
.verb.done .v-token::before { --glow: rgba(109, 187, 106, 0.95); animation: pulse 1.4s infinite; }
.verb .v-back { position: absolute; left: 50%; top: 20%; width: 92px; height: 128px; margin-left: -46px; border-radius: 6px; background: var(--art-cback-01) center / 100% 100% no-repeat; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.7); transform: rotate(-8deg) scale(0); transition: transform 0.2s; pointer-events: none; }
.verb.done .v-back { transform: rotate(-8deg) scale(1); }
.verb.done .v-ring rect:not(.track) { stroke: var(--good); }
.verb.done .v-status { color: #8fe08b; }
.verb.locked .v-token { filter: grayscale(1) brightness(0.55); }
.verb.locked .v-token::after { content: ''; position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; transform: translate(-50%, -50%); background: var(--art-iinv-11) center / contain no-repeat; }
.verb.locked .v-status { color: #ff8c7a; }
.verb.can-drop .v-token { filter: drop-shadow(0 0 10px rgba(109, 187, 106, 1)); }
.verb.drop-hover .v-token { transform: scale(1.14); filter: drop-shadow(0 0 14px rgba(140, 230, 130, 1)); }
.verb.new .v-token::before { animation: glow 1.6s 3; }
@keyframes pulse { 50% { opacity: 1; } }
/* The verdict: a wax stamp slams down and lifts (on the Court token only when the trial card is not on the table). */
.verb .verdict { position: absolute; left: 50%; top: 120px; width: 120px; height: 120px; margin: -60px 0 0 -60px; z-index: 4; pointer-events: none; background: center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6)); transform: rotate(-6deg); animation: stamp 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both, stampLift 0.4s ease-in 1.6s forwards; }
@keyframes stamp { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } 60% { transform: scale(0.95) rotate(-6deg); opacity: 1; } to { transform: scale(1) rotate(-6deg); } }
@keyframes stampLift { to { opacity: 0; } }
/* On the card it was given on: the Blood Court card (a case card when it went cold), kept a moment as a ghost. */
#board .card.judged { pointer-events: none; z-index: 6; }
.card.judged .c-ringsvg, .card.judged .c-time { visibility: hidden; }
.card .verdict { position: absolute; left: 10%; top: 50%; width: 80%; aspect-ratio: 1; margin-top: -40%; z-index: 4; border-radius: 12%; pointer-events: none; background: center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.6)); transform: rotate(-6deg); animation: stamp 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
/* What the verdict makes waits under the stamp, then comes out of it. */
.card.awaiting { visibility: hidden; }
@keyframes glow { 50% { opacity: 1; } }

/* ---------- Cards ---------- */
/* A card element is positioned by transform on the board; its look lives on
   .c-face (and .c-under for the cards beneath it in a stack). A "pic" face is
   a picture in a frame the stylesheet draws, in the kind's colour; the other
   families carry a whole painted face. */
.card {
  position: absolute; left: 0; top: 0; width: var(--card-w); height: var(--card-h); color: var(--paper-ink);
  cursor: grab; user-select: none; touch-action: none;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s;
  --tone: #b8892c;
}
/* A card's glow (urgent, noticed, merged) is drawn once on ::after; only its opacity moves. */
.card.urgent::after, .card.noticed::after, .card.merged::after { content: ''; position: absolute; inset: 0; border-radius: 8px; box-shadow: 0 0 10px 4px var(--glow, rgba(212, 162, 76, 1)); opacity: 0; pointer-events: none; }
.card.noticed::after { animation: glow 0.9s 4; }
.card.tone-red { --tone: #9b2a2a; }
.card.tone-blue { --tone: #2a5b8c; }
.card.tone-gold { --tone: #b8892c; }
.card.tone-teal { --tone: #1f7a72; }
.card.tone-grey { --tone: #6a6e74; }
.card.tone-dark { --tone: #2c2f36; }
.card .c-face, .card .c-under { position: absolute; inset: 0; border-radius: 8px; background: var(--pic) center / 100% 100% no-repeat; }
/* A whole painted card: the picture is the face. */
.card.face-full .c-face, .card.face-full .c-under { background: #0f1517 var(--pic) center / contain no-repeat; }
/* A square icon on an empty framed card, in the kind's colour. */
.card.tone-red { --frame: var(--art-cframe-01); }
.card.tone-blue { --frame: var(--art-cframe-02); }
.card.tone-gold { --frame: var(--art-cframe-03); }
.card.tone-dark { --frame: var(--art-cframe-04); }
.card.tone-teal { --frame: var(--art-cframe-05); }
.card.tone-grey { --frame: var(--art-cframe-06); }
.card.face-icon .c-face, .card.face-icon .c-under { background: var(--frame) center / 100% 100% no-repeat; }
/* The icon: only its disc, so the glyph sits on the arch's own paper with no second frame round it. */
.card.face-icon .c-face::before, .card.face-icon .c-under::before {
  content: ''; position: absolute; left: 50%; top: 44%; width: 82%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: var(--pic) center / 100% 100% no-repeat; clip-path: circle(41% at 50% 50%);
}
.card .c-face { box-shadow: 0 3px 4px rgba(0, 0, 0, 0.55); transition: transform 0.15s, box-shadow 0.15s, filter 0.15s; }
/* The kind of crime, as a wax seal on the corner of a case. */
.card .c-seal { position: absolute; right: -7px; top: -7px; width: 32px; height: 32px; background: center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.65)); pointer-events: none; }
/* A token's later status (kept, matched, read in part): a smaller seal in the same corner, so the face keeps its words. */
.card .c-status { right: -6px; top: -6px; width: 28px; height: 28px; }
/* A case searched out: the glass stamp on the left corner, across from its crime. */
.card .c-searched { right: auto; left: -6px; }
/* A token about one accused: their portrait, whole and small, pinned on the top corner opposite the status seal. */
.card .c-patron { position: absolute; left: -6px; top: -6px; width: 30px; height: 30px; background: center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.65)); pointer-events: none; }
.card.mini .c-patron { width: 20px; height: 20px; left: -3px; top: -3px; }
.card .c-about { position: absolute; left: 4px; top: 4px; width: 32px; height: 48px; background: #efe3c6 center / contain no-repeat; border: 1px solid #8f7440; border-radius: 3px; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6); pointer-events: none; }
.card.mini .c-about { width: 20px; height: 30px; left: 2px; top: 2px; }
/* Case strings: a pinned rope from each case to what belongs to it. */
#board .links { position: absolute; overflow: visible; pointer-events: none; z-index: 0; opacity: 0.6; }
#board .links.pins { z-index: 5; opacity: 0.85; }
/* Each rope has a shadow path drawn under it (the first half of the layer), not a filter. */
#board .links path { fill: none; stroke-width: 3; stroke-linecap: round; }
#board .links path.shade { stroke: rgba(0, 0, 0, 0.5); stroke-width: 4; transform: translateY(2px); }
#board .links .pin { stroke: rgba(0, 0, 0, 0.6); stroke-width: 1; }
#board .links .pin-hi { fill: rgba(255, 255, 255, 0.55); }
.card .c-under { filter: brightness(0.55); box-shadow: 0 2px 3px rgba(0, 0, 0, 0.5); }
.card.face-full .c-face, .card.face-icon .c-face { box-shadow: 0 3px 4px rgba(0, 0, 0, 0.55); }
.card .c-face.gray { filter: grayscale(0.9) brightness(0.8) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.55)); }
.card .c-under.u1 { transform: translate(4px, 4px); }
.card .c-under.u2 { transform: translate(8px, 8px); }
.card:hover .c-face { transform: translateY(-4px); box-shadow: 0 9px 10px rgba(0, 0, 0, 0.65); }
#board .card:hover { z-index: 3; }
.card.unavailable .c-face { filter: saturate(0.35) brightness(0.72) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.card.unavailable:hover .c-face { filter: saturate(0.5) brightness(0.85) drop-shadow(0 9px 10px rgba(0, 0, 0, 0.65)); }
#peek .i-note.i-unavailable { color: #b7654f; }
.card.selected .c-face { filter: drop-shadow(0 0 3px var(--accent)) drop-shadow(0 0 7px rgba(212, 162, 76, 0.75)); }
.card.fits .c-face { filter: drop-shadow(0 0 5px rgba(212, 162, 76, 0.85)) drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.card.fits-strong .c-face { filter: drop-shadow(0 0 10px rgba(255, 210, 110, 1)); transform: translateY(-5px); }
.card.can-stack .c-face { filter: drop-shadow(0 0 9px rgba(109, 187, 106, 1)); }
.card.arrive .c-face { animation: arrive 0.45s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes arrive { from { transform: scale(0.6) translateY(-20px); opacity: 0; } }
.card.settle .c-face { animation: settle 0.32s ease-out; }
@keyframes settle { 40% { transform: scale(0.96, 0.98); } 70% { transform: scale(1.01); } }
.card.leaving { opacity: 0; }
.card.leaving .c-face { transform: scale(0.9); }
/* How a card leaves, where the rules say: an ability lost for good burns, a token fades like ink, a witness walks off. */
.card.gone-burn, .card.gone-ink, .card.gone-walk { pointer-events: none; }
.card.gone-burn .c-face { animation: burn 0.9s ease-in forwards; }
@keyframes burn { 40% { filter: sepia(1) brightness(0.6) contrast(1.3); } 100% { filter: sepia(1) brightness(0.15); transform: scale(0.88) rotate(4deg); opacity: 0; } }
.card.gone-ink .c-face { animation: inkfade 0.7s ease-in forwards; }
@keyframes inkfade { to { filter: grayscale(1) blur(1px); transform: translateY(-8px); opacity: 0; } }
.card.gone-walk .c-face { animation: walkoff 0.6s ease-in forwards; }
@keyframes walkoff { to { transform: translateX(40px); opacity: 0; } }
[dir=rtl] .card.gone-walk .c-face { animation-name: walkoffRtl; }
@keyframes walkoffRtl { to { transform: translateX(-40px); opacity: 0; } }
html[data-calm] .card.gone-burn .c-face, html[data-calm] .card.gone-ink .c-face, html[data-calm] .card.gone-walk .c-face { animation-name: fadeOut; }
.card.no-anim { transition: none !important; }
.card.urgent::after { --glow: rgba(208, 86, 74, 1); animation: urgent 0.9s infinite; }
@keyframes urgent { 50% { opacity: 1; } }
/* Picked up: in the drag layer, lifted, casting a long shadow. */
#drag-layer .card { transition: transform 0.12s ease-out; cursor: grabbing; z-index: 1; }
#drag-layer .card .c-face { filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.6)); }
#drag-layer .card.returning, #drag-layer .card.absorbing { transition: left 0.24s ease-in-out, top 0.24s ease-in-out, transform 0.24s ease-in-out, opacity 0.24s; }
.card.dragging-src { opacity: 0.3; }
/* The words: a strip of paper at the foot of a painted card, or the band of a framed one. */
.card .c-body { position: absolute; left: 7%; right: 7%; top: 64%; bottom: 5%; display: flex; flex-direction: column; overflow: hidden; }
.card.face-full .c-body { top: auto; bottom: 5%; left: 8%; right: 8%; max-height: 40%; padding: 3px 4px; background: rgba(239, 230, 207, 0.94); border-radius: 3px; box-shadow: 0 0 0 1px rgba(60, 40, 10, 0.45), 0 2px 4px rgba(0, 0, 0, 0.35); }
.card.face-full.banded .c-body { bottom: 4%; left: 9%; right: 9%; background: none; box-shadow: none; padding: 2px 3px; }
/* The story cards (cstory: the Sketch-book, an Insight, a Whisper...) paint their band higher, from about three
   quarters of the way down to a tenth from the foot: the name stands in it, centred, not under it. */
.card.face-full.banded.band-story .c-body { top: 73.5%; bottom: 10%; max-height: none; justify-content: center; padding: 0 3px; }
.card.face-full.banded.band-story .c-title { margin-top: 0; }
.card.face-icon .c-body { top: 80.5%; bottom: 6%; left: 10%; right: 10%; padding: 0 2px; justify-content: center; }
.card.face-icon .c-title { -webkit-line-clamp: 1; margin-top: 0; }
.card .c-title { font-family: var(--display); font-size: 10px; line-height: 1.15; font-weight: 700; text-align: center; margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; flex: none; letter-spacing: 0.01em; color: #2a2317; }
.card .c-aspects { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; margin-top: auto; padding-top: 2px; }
/* The clock on a card: a ring just outside its edge, and the time in the middle of the picture. */
.card .c-ringsvg { position: absolute; left: -6px; top: -6px; width: calc(100% + 12px); height: calc(100% + 12px); overflow: visible; pointer-events: none; z-index: 1; }
.card .c-ringsvg rect { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0 999; filter: drop-shadow(0 0 2px rgba(212, 162, 76, 0.8)); }
.card .c-ringsvg rect.track { stroke: rgba(12, 10, 8, 0.7); stroke-dasharray: none; filter: none; }
.card.timed.urgent .c-ringsvg rect:not(.track) { stroke: #d0564a; filter: drop-shadow(0 0 3px rgba(208, 86, 74, 0.9)); }
.card .c-time { position: absolute; left: 50%; top: 30%; transform: translate(-50%, -50%); padding: 2px 8px; border-radius: 10px; background: rgba(14, 12, 10, 0.78); color: #f0d58a; font-family: var(--mono); font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: 0.04em; box-shadow: 0 0 0 1px rgba(255, 220, 140, 0.35); pointer-events: none; }
.card.timed.urgent .c-time { color: #ffb3a8; box-shadow: 0 0 0 1px rgba(208, 86, 74, 0.7); }
.card.mini .c-time { font-size: 10px; padding: 1px 6px; }
/* A find turning over. */
/* The flip plays on the mini card's wrapper: the card inside keeps its scale. */
.mini-wrap.flip-out { animation: flipOut 0.18s ease-in forwards; }
.mini-wrap.flip-in { animation: flipIn 0.22s ease-out; }
@keyframes flipOut { to { transform: rotateY(90deg); } }
@keyframes flipIn { from { transform: rotateY(-90deg); } to { transform: rotateY(0); } }
.card.facedown .c-face { background: #0f1517 var(--art-cback-01) center / 100% 100% no-repeat !important; border: none !important; box-shadow: 0 3px 4px rgba(0, 0, 0, 0.55) !important; }
.card.facedown .c-face::before, .card.facedown .c-body, .card.facedown .c-ringsvg, .card.facedown .c-time { display: none; }
.card.facedown { cursor: pointer; }
.card .c-count { position: absolute; top: 6px; right: 6px; z-index: 2; background: #0e1112; color: var(--paper); border: 1px solid #c9a24c; font-size: 12px; font-weight: 700; border-radius: 13px; padding: 0 8px; line-height: 24px; cursor: grab; box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.4); }
.card .c-pin { position: absolute; left: -8px; top: -8px; width: 28px; height: 28px; z-index: 2; background: center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); pointer-events: none; }
.card .c-count::before { content: '⠿ '; opacity: 0.7; font-size: 10px; }
.card .c-count:hover { background: #2a2418; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: rgba(14, 17, 18, 0.85); color: var(--paper); border-radius: 3px; padding: 1px 3px 1px 1px; font-family: var(--mono); font-size: 9.5px; font-weight: 700; line-height: 1; }
.chip-icon { width: 13px; height: 13px; background: center / contain no-repeat; border-radius: 50%; }
.chip.big { font-size: 12px; padding: 3px 7px 3px 3px; gap: 5px; font-family: var(--sans); font-weight: 600; }
.chip.big .chip-icon { width: 20px; height: 20px; }

.mini-wrap { position: relative; width: calc(var(--card-w) * 0.72); height: calc(var(--card-h) * 0.72); flex: none; transform-style: preserve-3d; }
.outputs { perspective: 700px; }
.mini-wrap .card { transform: scale(0.72); transform-origin: 0 0; transition: none; }

/* ---------- Side panel ---------- */
#peek .i-card { display: flex; justify-content: center; height: calc(var(--card-h) * 1.3 + 8px); margin: 6px 0 8px; }
#peek .i-card .card { position: relative; left: auto; top: auto; transform: scale(1.3); transform-origin: top center; pointer-events: none; cursor: default; }
#peek .i-lines { margin: 6px 0; padding: 6px 8px; border-inline-start: 2px solid #a88a4c; font-family: var(--serif); font-style: italic; font-size: 12.5px; line-height: 1.35; color: var(--paper-ink); }
#peek h4 { margin: 0 0 4px; font-family: var(--display); font-size: 15px; }
#peek .i-kind { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: #5a4f3a; display: flex; align-items: center; gap: 6px; }
#peek .i-kind .k-icon { width: 22px; height: 22px; flex: none; background: center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
#peek p { margin: 6px 0; line-height: 1.45; color: var(--paper-ink); font-family: var(--serif); font-size: 14px; }
#peek .i-aspects { display: flex; gap: 4px; flex-wrap: wrap; margin: 6px 0; }
#peek .i-note { color: #5a4f3a; font-size: 12px; }
#peek .chip[data-aspect] { cursor: pointer; }
#peek .chip[data-aspect]:hover { outline: 1px solid var(--accent); }
#peek .aspect-pop { margin: 4px 0 8px; padding: 8px 10px; border-radius: 6px; border: 1px solid #a88a4c; background: #f6efdc; color: var(--paper-ink); box-shadow: inset 0 0 0 1px rgba(60, 40, 10, 0.12); font-size: 12.5px; }
#peek .aspect-pop b { font-family: var(--display); font-size: 13px; }
#peek .aspect-pop p { margin: 4px 0 0; color: var(--paper-ink); font-size: 12.5px; line-height: 1.4; }
#peek .aspect-pop .ap-note { color: #5a4f3a; font-style: italic; }
#peek .aspect-pop .ap-find { margin-top: 6px; padding: 3px 10px; border: 1px solid #a88a4c; border-radius: 6px; background: #efe3c6; color: var(--paper-ink); font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; cursor: pointer; }
#peek .peek-mark, #peek .peek-board { display: block; margin: 8px auto 4px; min-width: 110px; font-size: 12px; padding: 0 14px; border-width: 12px 22px; }

/* The verb window is the painted panel (cpanel3-01, 270x304, one tile pixel per CSS pixel): a dark
   title bar with the red X baked into its corner, paper below. The slices keep the bar (64), the X's
   column (66), the foot (28) and the left edge (20) whole; the panel is drawn on ::before so Arabic
   can mirror it, and it grows with the Settings slider through the border widths. The window is a
   column: the head sits in the bar, the body scrolls under it and reaches onto the paper under the
   X's column. */
.vwin {
  position: absolute; right: 8px; top: 8px; width: 370px; max-height: calc(100% - 68px); overflow: visible; pointer-events: auto; padding: 0;
  display: flex; flex-direction: column; isolation: isolate; color: var(--paper-ink); background: none;
  border: solid transparent; border-width: calc(64px * var(--ui-scale, 1)) calc(66px * var(--ui-scale, 1)) calc(28px * var(--ui-scale, 1)) calc(20px * var(--ui-scale, 1));
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.6)); animation: winIn 0.18s ease-out; transition: opacity 0.16s, transform 0.16s;
}
/* The windows read in the period serif like the stories; numbers and timers keep the mono. */
.vwin, .picker, .ask { font-family: var(--serif); }
.vwin::before { content: ''; position: absolute; z-index: -1; pointer-events: none; top: calc(-64px * var(--ui-scale, 1)); right: calc(-66px * var(--ui-scale, 1)); bottom: calc(-28px * var(--ui-scale, 1)); left: calc(-20px * var(--ui-scale, 1));
  border: solid transparent; border-width: inherit; border-image: var(--art-cpanel3-01) 64 66 28 20 fill / 1 stretch; }
.vwin .divider { display: none; }
.vw-body { flex: 1 1 auto; min-height: 0; overflow: auto; margin: 0 -46px 0 -10px; padding: 2px 4px 2px 12px; }
.vwin.closing { opacity: 0; transform: scale(0.96); }
@keyframes winIn { from { opacity: 0; transform: scale(0.95) translateY(6px); } }
/* The head sits in the bar (tile y 0-57), the X's hot spot over the baked X (tile x 211-261, y 10-60). */
.vw-head { position: absolute; left: 0; right: 0; top: -56px; height: 42px; display: flex; align-items: center; gap: 8px; user-select: none; touch-action: none; }
.vw-icon { width: 30px; height: 30px; flex: none; background: center / contain no-repeat; border-radius: 6px; }
.vw-info { width: 28px; height: 28px; padding: 0; border: none; color: transparent; font-size: 0; background: var(--art-bround-17) center / 100% 100% no-repeat; cursor: pointer; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.vw-info:hover { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)) brightness(1.2); }
.slot .s-icon { display: block; width: 18px; height: 18px; margin: 3px auto 0; background: center / contain no-repeat; opacity: 0.85; }
.card .c-stats { display: flex; justify-content: center; gap: 8px; margin-top: 2px; }
.card .c-stat { display: inline-flex; align-items: center; gap: 2px; font-family: var(--mono); font-weight: 700; font-size: 11px; color: #2a1a10; }
.card .c-stat i { width: 16px; height: 16px; background: center / contain no-repeat; }
.card .c-stat.heat { color: #7c1d15; }
#peek .i-meter { display: flex; align-items: center; gap: 8px; margin: 4px 0 6px; }
#peek .i-meter .m-icon { width: 34px; height: 34px; background: center / contain no-repeat; }
#peek .i-meter h4 { margin: 0; }
/* Under Standing: a row for each patron, their seal, a word for their favour and the next step. */
#peek .i-favour { margin: 8px 0 2px; display: grid; gap: 6px; }
#peek .fv-row { display: grid; grid-template-columns: 26px auto 1fr; align-items: center; column-gap: 6px; row-gap: 1px; padding: 4px 6px; border-inline-start: 3px solid #b8a27a; background: rgba(120, 90, 50, 0.08); }
#peek .fv-row i { grid-row: span 3; width: 26px; height: 26px; background: center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
#peek .fv-row b { font-family: var(--display); font-size: 12.5px; }
#peek .fv-row em { justify-self: end; font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: #5a4f3a; }
#peek .fv-row span { grid-column: 2 / -1; font-size: 12px; line-height: 1.3; color: #3a3127; }
#peek .fv-row.fv-patron { border-inline-start-color: #b8913f; } #peek .fv-row.fv-patron em { color: #8a6a1f; }
#peek .fv-row.fv-warm em { color: #6d6a2a; }
#peek .fv-row.fv-cold { border-inline-start-color: #a0463a; } #peek .fv-row.fv-cold em { color: #a0463a; }
#peek .fv-seal { font-size: 12px; color: #5a4f3a; }
.meter { cursor: pointer; }
/* A notice at the table's edge, pointing at something worth a look. */
.edge-mark { position: absolute; z-index: 28; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 6px; padding-block: 4px; padding-inline: 6px 10px; border-radius: 16px; background: rgba(14, 12, 10, 0.9); border: 1px solid var(--accent); color: var(--paper); font-family: var(--display); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; cursor: pointer; animation: markIn 0.25s ease-out; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6); }
.edge-mark b { position: relative; width: 22px; height: 22px; background: center / contain no-repeat; }
.edge-mark b::after { content: ''; position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 8px 3px rgba(109, 187, 106, 0.95); opacity: 0; animation: pulse 1.4s infinite; pointer-events: none; }
.edge-mark::after { content: ''; position: absolute; left: 50%; top: 50%; width: 30px; height: 2px; margin-top: -1px; transform-origin: 0 50%; transform: rotate(var(--ang, 0deg)) translateX(24px); background: var(--accent); }
.edge-mark.hidden { display: none; }
@keyframes markIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.8); } }
/* Less motion: the pulses hold still; a warning keeps a steady glow. */
/* Under a menu, a screen or a dialog the table holds still (js/main.js, holdStill); under a screen that
   covers it whole it is not drawn. */
html.cf-still #table *, html.cf-still #table *::before, html.cf-still #table *::after,
html.cf-still #topbar *, html.cf-still #topbar *::before, html.cf-still #topbar *::after { animation-play-state: paused !important; }
html.cf-cover #app { visibility: hidden; }
@media (prefers-reduced-motion: reduce) {
  .verb.done .v-token::before, .verb.new .v-token::before, .verb.noticed .v-token::before, .card.urgent::after, .card.noticed::after, .card.merged::after, .meter.crit .m-icon::after, .edge-mark b::after, .verb .v-magnet.asks::after { animation: none; }
  .card.urgent::after, .meter.crit .m-icon::after { opacity: 0.8; }
  .meter.bump .m-icon, .meter.bump::before, .meter.bump .m-icon::before { animation: none; }
  .meter.bump::before, .meter.bump .m-icon::before { opacity: 0.9; }
  .meter.bump-up .m-icon::before { transform: rotate(-90deg); }
  .meter.bump-down .m-icon::before { transform: rotate(90deg); }
  .card.gone-burn .c-face, .card.gone-ink .c-face, .card.gone-walk .c-face { animation-name: fadeOut; }
}
.vw-head h3 { flex: 1; min-width: 0; margin: 0; font-family: var(--display); letter-spacing: 0.06em; text-transform: uppercase; font-size: 15px; font-weight: 700; color: var(--paper); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px #000; }
.vw-close { position: absolute; top: 5px; right: -54px; width: 44px; height: 44px; padding: 0; border: none; border-radius: 50%; color: transparent; font-size: 0; background: none; cursor: pointer; }
.vw-close:hover { box-shadow: 0 0 12px rgba(255, 120, 100, 0.7); }
.divider { height: 2px; margin: 4px 8px 10px; background: linear-gradient(90deg, transparent, var(--accent) 20%, var(--accent) 80%, transparent); opacity: 0.7; }
.vw-desc { color: var(--ink-dim); font-size: 14px; line-height: 1.45; margin: 0 0 12px; }
.vwin .vw-desc { color: #5a4f3a; }
/* Under a verb's first words: the offices' powers, one short dim line each; the ones still to come dimmer. */
.vwin .vw-desc.vw-power { font-size: 12.5px; margin: -6px 0 6px; padding-inline-start: 10px; border-inline-start: 2px solid rgba(90, 79, 58, 0.35); opacity: 0.85; }
.vwin .vw-desc.vw-power.locked { opacity: 0.55; }
.vwin .vw-desc.vw-season { font-style: italic; font-size: 13px; margin: 0 0 8px; }
/* The story reads on the panel's own paper, with a rule under it. */
.story { color: var(--paper-ink); padding: 2px 0 10px; margin: 0 0 12px; border-bottom: 1px solid rgba(60, 40, 10, 0.25); }
.story h5 { margin: 0 0 6px; font-family: var(--display); letter-spacing: 0.04em; font-size: 13px; }
.story p { margin: 0; font-family: var(--serif); font-size: 14px; line-height: 1.5; }
/* The words still to type hold their place, unseen (js/ui.js storyBox), so the story never grows under the finds. */
.story p .ghost { visibility: hidden; }
.slots { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 12px; }
.slot { position: relative; width: calc(var(--card-w) * 0.72 + 10px); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.slot .s-box { width: calc(var(--card-w) * 0.72 + 10px); height: calc(var(--card-h) * 0.72 + 10px); background: rgba(10, 12, 14, 0.55); border: 1.5px dashed rgba(201, 162, 76, 0.45); border-radius: 9px; box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6); display: flex; align-items: center; justify-content: center; padding: 4px; }
.slot .s-label { font-family: var(--mono); font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em; color: #5a4f3a; text-align: center; max-width: calc(var(--card-w) * 0.72 + 10px); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.2; }
.slot.primary .s-box { border-style: solid; border-color: rgba(212, 162, 76, 0.8); box-shadow: inset 0 0 12px rgba(0, 0, 0, 0.6), 0 0 8px rgba(212, 162, 76, 0.25); }
/* An empty slot is a framed card in the tone of what it takes: gold for the first slot, blue for an
   ability, red for the accused and the proof before the Court, grey for the rest. Its icon sits in
   the frame's arch; its name sits under the slot, as under a filled one. */
.slot .s-box.empty { --frame: var(--art-cframe-06); border: none; border-radius: 0; box-shadow: none; background: var(--frame) center / 100% 100% no-repeat; }
.slot.primary .s-box.empty { --frame: var(--art-cframe-03); }
.slot[data-slot="mind"] .s-box.empty, .slot[data-slot="grow"] .s-box.empty, .slot[data-slot="aid2"] .s-box.empty, .slot[data-slot="aid3"] .s-box.empty { --frame: var(--art-cframe-02); }
.slot[data-verb="arrest"] .s-box.empty, .slot[data-slot="c1"] .s-box.empty, .slot[data-slot="c2"] .s-box.empty, .slot[data-slot="c3"] .s-box.empty, .slot[data-slot="c4"] .s-box.empty { --frame: var(--art-cframe-01); }
.slot .s-box.empty ~ .s-icon { position: absolute; left: 50%; top: calc((var(--card-h) * 0.72 + 10px) * 0.44); width: 46%; height: auto; aspect-ratio: 1; margin: 0; transform: translate(-50%, -50%); clip-path: circle(41%); opacity: 1; pointer-events: none; }
/* A token's standing toward the accused before the Court. */
.slot .s-label.st-names { color: #1d6a49; font-weight: 700; }
.slot .s-label.st-other { color: var(--danger); font-weight: 700; }
.slot .s-label.st-off { color: #8a7a5a; }
/* Every caption sits under its slot, empty or filled, on one baseline: an empty slot's icon is in its
   frame, so its caption takes the room the small icon takes under a filled one. */
.slot .s-box.empty ~ .s-icon ~ .s-label { margin-top: 25px; }
/* A token that hurts the charge wears a red shadow. */
.card.bad .c-face { filter: drop-shadow(0 0 3px rgba(208, 86, 74, 1)) drop-shadow(0 0 6px rgba(208, 86, 74, 0.7)); }
.slot.can-drop .s-box { filter: drop-shadow(0 0 6px rgba(109, 187, 106, 0.9)); }
.slot.drop-hover .s-box { filter: drop-shadow(0 0 10px rgba(109, 187, 106, 1)) brightness(1.2); }
/* An empty frame stays quiet, so the cards laid are the loudest thing on the sheet; it wakes in its
   own colour when a card that fits is dragged, when it is picked, or under the pointer. */
.slot .s-box.empty, .slot .s-box.empty ~ .s-icon { opacity: 0.55; filter: saturate(0.55); }
.slot.primary .s-box.empty, .slot.primary .s-box.empty ~ .s-icon { opacity: 0.9; }
.slot .s-box.empty:hover, .slot .s-box.empty:hover ~ .s-icon { opacity: 1; filter: brightness(1.15); }
.slot.picking .s-box.empty { opacity: 1; filter: drop-shadow(0 0 8px rgba(212, 162, 76, 0.9)); }
.slot.can-drop .s-box.empty { opacity: 1; filter: drop-shadow(0 0 6px rgba(109, 187, 106, 0.9)); }
.slot.drop-hover .s-box.empty { opacity: 1; filter: drop-shadow(0 0 10px rgba(109, 187, 106, 1)) brightness(1.2); }
.slot.picking .s-box.empty ~ .s-icon, .slot.can-drop .s-box.empty ~ .s-icon, .slot.drop-hover .s-box.empty ~ .s-icon { opacity: 1; filter: none; }
.recipe.mystery { border-style: dashed; }
/* The way the verb has found: a bordered paper inset. */
.recipe { border: 1px solid #a88a4c; border-radius: 6px; padding: 10px 12px; background: #f6efdc; color: var(--paper-ink); margin-bottom: 12px; box-shadow: inset 0 0 0 1px rgba(60, 40, 10, 0.12); }
.recipe h5 { margin: 0 0 4px; font-size: 14px; font-family: var(--display); }
.recipe p { margin: 0; font-size: 13px; color: #5a4f3a; line-height: 1.45; }
.recipe .r-strain { color: #7a6440; font-size: 12px; margin-top: 6px; font-style: italic; }
.recipe .r-danger { color: #a5522a; font-size: 12px; margin-top: 6px; }
.recipe .r-blocked { color: var(--danger); font-size: 12px; margin-top: 6px; padding-inline-start: 22px; min-height: 16px; background: var(--art-cmark-04) 0 50% / 16px no-repeat; }
.recipe .r-none { color: #8a7a5a; font-style: italic; }
.clock { display: grid; grid-template-columns: 1fr 70px minmax(52px, auto); align-items: center; gap: 8px; font-size: 12px; margin: 4px 0; color: #5a4f3a; }
.clock .ck-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock .ck-bar { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.12); overflow: hidden; }
.clock .ck-bar i { display: block; height: 100%; background: #6dbb6a; }
.clock.urgent { color: var(--danger); }
/* The Council's fortnightly count in the Bell's pane: its seal, the words, a pip a case. */
.quota { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 12px; color: #5a4f3a; }
.quota .q-seal { flex: none; width: 24px; height: 24px; background: center / contain no-repeat; }
.quota .q-text { flex: 1; min-width: 0; }
.quota .q-pips { display: flex; gap: 3px; }
.quota .q-pips i { width: 10px; height: 10px; border-radius: 50%; border: 1px solid #8a6a3a; background: transparent; }
.quota .q-pips i.on { background: #b8892c; border-color: #7a5a1a; }
.quota.met .q-pips i.on { background: #2f7a4a; border-color: #1f5a34; }
.clock.urgent .ck-bar i { background: var(--danger); }
.clock .ck-days { font-family: var(--mono); text-align: right; font-size: 11px; white-space: nowrap; }
.charge { margin-top: 8px; padding: 8px 10px; border-radius: 6px; background: rgba(255, 250, 238, 0.6); border: 1px solid #a88a4c; font-size: 12px; }
.charge .ch-head { display: flex; justify-content: space-between; font-family: var(--serif); font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.charge.tier-weak .ch-head { color: var(--danger); }
.charge.tier-reasonable .ch-head { color: #a8711a; }
.charge.tier-strong .ch-head { color: #2e7a3a; }
/* The four seals of full proof: lit in their wax, or dark and pale. The numbers are in the dossier. */
.charge .ch-gates { display: flex; justify-content: space-between; gap: 4px; margin: 0 0 8px; }
.charge .ch-gate { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; }
.charge .ch-gate i { width: 34px; height: 34px; background: center / contain no-repeat; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.45)); transition: opacity 0.3s; }
.charge .ch-gate em { font-family: var(--serif); font-style: normal; font-size: 10.5px; line-height: 1.15; color: #2a1a10; }
.charge .ch-gate.off i { opacity: 0.3; filter: grayscale(1); }
.charge .ch-gate.off em { color: #8a7a5a; }
.charge .ch-gloss { margin: -4px 0 6px; font-style: italic; font-size: 12px; line-height: 1.3; color: #6d5d40; }
.charge .ch-row { display: grid; grid-template-columns: 16px 90px 1fr 44px; align-items: center; gap: 6px; margin: 3px 0; color: #6d5d40; }
.charge .ch-row .chip-icon { width: 16px; height: 16px; }
.charge .ch-row.met { color: var(--paper-ink); }
.charge .ch-bar { height: 6px; border-radius: 3px; background: rgba(0, 0, 0, 0.12); overflow: hidden; }
.charge .ch-bar i { display: block; height: 100%; background: #8b6a3a; }
.charge .ch-row.met .ch-bar i { background: #2e7a3a; }
.charge .ch-row.part .ch-bar i { background: #c8902a; }
.charge .ch-num { font-family: var(--mono); text-align: right; font-size: 11px; }
.charge .ch-note { margin-top: 4px; font-size: 11.5px; line-height: 1.35; }
.charge .ch-note.good { color: #2e7a3a; }
.charge .ch-note.bad { color: var(--danger); }
.charge .ch-note.ch-first { font-weight: 700; }
.charge .ch-note.dim { color: #8a7a5a; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.actions .plate-btn.go { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The window's plates come first and stay in sight while the body scrolls, at every width: the Court's Charge
   never sits below the fold of a desk screen. */
.vw-body { display: flex; flex-direction: column; }
.vw-body > * { flex: none; }
.vw-body .actions { order: -1; position: sticky; top: 0; z-index: 3; margin: 0 -4px 10px -2px; padding: 6px 4px; background: #f3e9cf; border-bottom: 1px solid #a88a4c; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); }
/* The go plate and Clear share one row; the go plate gives way (its label ends in an ellipsis). */
.vw-body .actions.go-row { flex-wrap: nowrap; }
.actions.go-row .plate-btn { min-width: 0; padding-inline: 8px; letter-spacing: 0.05em; }
.actions.go-row .go { flex: 1 1 auto; min-width: 0; }
.actions.go-row .go + button { flex: none; padding-inline: 4px; }
/* A narrow window (a phone's sheet, the desk's side window) drops the accused's name from the Charge plate, so
   Charge and Clear share a row; the accused's card and the charge panel still name them. */
.vw-body { container-type: inline-size; }
/* The tier on the Charge plate, under the verb and the name on a line of its own: smaller, plain, so a phone and the
   desk's side window read it whole beside Clear. */
.plate-btn.go .go-tier { display: block; margin-top: 1px; font-size: 0.86em; line-height: 1; letter-spacing: 0; text-transform: none; }
@media (max-width: 480px) { .go-name { display: none; } }
@container (max-width: 480px) { .go-name { display: none; } }
.btn { background: var(--accent); color: #1a1508; border: none; border-radius: 7px; padding: 9px 16px; font-weight: 700; font-size: 14px; }
.btn:disabled { background: #474a50; color: #888; cursor: not-allowed; }
.progress { height: 8px; background: rgba(0, 0, 0, 0.15); border-radius: 4px; overflow: hidden; margin: 8px 0 4px; }
.progress > div { height: 100%; background: var(--accent); }
.held { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.outputs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; min-height: 20px; }

/* The journal on paper: each entry a paper block with its kind's colour as a rule down its left,
   and its kind's icon; the Firsts wear their marks (cprog-01 waiting, cprog-02 done). */
.journal-entry { position: relative; border: 1px solid rgba(60, 40, 10, 0.25); border-inline-start: 3px solid #8f7440; border-radius: 4px; padding-block: 6px 8px; padding-inline: 10px 8px; margin-bottom: 10px; background: rgba(255, 250, 238, 0.6); }
.journal-entry .j-icon { float: left; width: 20px; height: 20px; margin: 2px 8px 0 0; background: center / contain no-repeat; }
.journal-entry::after { content: ''; display: block; clear: both; }
.firsts { margin: 0 0 14px; padding: 8px 10px; border: 1px solid #a88a4c; border-radius: 8px; background: rgba(255, 250, 238, 0.5); }
.firsts h6 { margin: 0 0 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a5a1a; }
.firsts .first { display: inline-block; margin-block: 2px; margin-inline: 0 8px; font-family: var(--serif); font-size: 12.5px; color: #6a5f4a; }
.firsts .first i { display: inline-block; width: 18px; height: 18px; margin-block: -4px; margin-inline: 0 4px; vertical-align: middle; background: center / contain no-repeat; }
.firsts .first.done { color: #1f1b15; }
/* The Roads: the endings nearest, each with its seal and what it still wants; a defeat's warning in red. */
.roads { margin: 0 0 14px; padding: 8px 10px; border: 1px solid #a88a4c; border-radius: 8px; background: rgba(255, 250, 238, 0.5); }
.roads h6 { margin: 0 0 6px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a5a1a; }
.roads .road { display: grid; grid-template-columns: 30px 1fr; column-gap: 8px; align-items: center; margin: 4px 0; }
.roads .road i { grid-row: span 2; width: 30px; height: 30px; background: center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }
.roads .road b { font-family: var(--display); font-size: 12.5px; color: #1f1b15; }
.roads .road span { font-family: var(--serif); font-size: 12.5px; color: #4a4033; line-height: 1.3; }
.roads .road.warn b, .roads .road.warn span { color: #8a2a1e; }
.journal-entry .j-meta { font-family: var(--mono); font-size: 10px; color: #8a7a5a; text-transform: uppercase; letter-spacing: 0.08em; }
.journal-entry h6 { margin: 2px 0 3px; font-size: 13px; font-family: var(--display); color: #2a1a10; }
.journal-entry p { margin: 0; font-family: var(--serif); font-size: 13px; line-height: 1.45; color: #4a4033; }
.journal-entry.k-case { border-inline-start-color: var(--danger); }
.journal-entry.k-danger, .journal-entry.k-harm, .journal-entry.k-need { border-inline-start-color: #e08a3c; }
.journal-entry.k-major { border-inline-start-color: #b8892c; }
.journal-entry.k-victory { border-inline-start-color: #3f8f3c; }
.journal-entry.k-week { border-inline-start-color: #6a6e74; }

/* ---------- Toasts ---------- */
/* Top right, under the bar, clear of the notch; a verb window pushes them left. */
/* Bottom-right, growing up from just above the table's tools: the verb tiles (twice a card) fill the top of the felt
   at the fit view, and cards fill rows from the left, so the foot of the right-hand side is the felt left bare. */
#toasts { position: fixed; right: calc(12px + var(--sa-r)); top: auto; left: auto; bottom: calc(60px + var(--sa-b)); display: flex; flex-direction: column; gap: 6px; z-index: 900; width: 380px; max-width: calc(100vw - 24px); pointer-events: none; }
body.has-window #toasts { right: calc(390px * var(--ui-scale, 1)); }
/* The open Journal is a drawer at the right: the toasts stand beside it, not over the Roads at its head. */
body.has-journal #toasts { right: calc(min(380px, 90vw) + 12px + var(--sa-r)); }
.toast.leaving { opacity: 0; transform: translateX(20px); transition: opacity 0.3s, transform 0.3s; }
/* The bar grows with its words: the panel (::after) is nine-sliced and stretches; the circle
   (::before) is painted crisp from the same tile, with the icon in it. */
/* border-image-source is set here (unpainted, width 0) so the page sees the bar comes from the stylesheet. */
.toast { position: relative; isolation: isolate; border-image-source: var(--bar); border-image-width: 0; aspect-ratio: auto; min-height: 44px; padding-block: 10px; padding-inline: 58px 30px; color: #1f1b15; display: flex; flex-direction: column; justify-content: center; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); animation: toastIn 0.25s ease-out; pointer-events: auto; cursor: pointer; }
.toast::after { content: ''; position: absolute; inset: 0; z-index: -1; border: solid transparent; border-width: 16px 24px 16px 92px; border-image: var(--bar) 32 48 32 184 fill / 16px 24px 16px 92px stretch; clip-path: inset(0 0 0 46px); }
.toast::before { content: ''; position: absolute; inset-inline-start: 0; top: 50%; width: 46px; height: 40px; margin-top: -20px; background: var(--bar) left center / auto 40px no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.toast .t-icon { position: absolute; inset-inline-start: 0; top: 50%; width: 46px; height: 40px; margin-top: -20px; background: var(--icon) 8px center / 28px 28px no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); pointer-events: none; }
.toast b { display: -webkit-box; font-family: var(--display); font-size: 13px; line-height: 1.15; white-space: normal; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.toast span { font-size: 12px; line-height: 1.25; color: #4a4033; font-family: var(--serif); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.toast span:empty { display: none; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; background: rgba(8, 9, 11, 0.88); z-index: 1200; display: flex; align-items: center; justify-content: center; padding: calc(16px + var(--sa-t)) calc(16px + var(--sa-r)) calc(16px + var(--sa-b)) calc(16px + var(--sa-l)); overflow: auto; }
.modal-box { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; max-width: 880px; width: 100%; padding: 28px 32px; max-height: calc(100vh - 32px); overflow: auto; }
.menu-box { max-width: 420px; }
.modal .divider { margin: 6px 0 16px; }
.modal h1 { font-family: var(--black); letter-spacing: 0.08em; color: var(--accent); margin: 0 0 4px; font-size: 38px; font-weight: 400; }
.modal h2 { font-family: var(--serif); font-weight: 400; margin: 0 0 18px; color: var(--ink-dim); font-size: 18px; }
.modal .lead { font-family: var(--serif); font-size: 16px; line-height: 1.6; color: var(--ink); }
.pick-head { margin: 16px 0 6px; font-family: var(--display); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); text-align: center; }
.origins { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 6px 0 4px; }
.origin { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 8px; background: rgba(20, 24, 26, 0.85); cursor: pointer; text-align: center; transition: border-color 0.15s, transform 0.15s; color: var(--ink); }
.origin:hover { border-color: #7d6a45; transform: translateY(-2px); }
.origin.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212, 162, 76, 0.35); }
.origin .o-face { width: 64px; height: 88px; border-radius: 6px; background: center / cover no-repeat; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.6)); }
.origin h3 { margin: 4px 0 2px; font-family: var(--display); font-size: 12.5px; }
.origin p { margin: 0 0 4px; font-size: 11px; color: var(--ink-dim); line-height: 1.4; font-family: var(--serif); }
.origin .o-where { font-size: 10px; color: var(--ink-dim); font-family: var(--serif); font-style: italic; line-height: 1.3; margin-bottom: 4px; }
.origin .bonus { font-size: 10.5px; color: #a8c29a; line-height: 1.35; }
.origin .shut { font-size: 10.5px; color: #c48a7a; line-height: 1.35; margin-top: 2px; }
.callings { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 6px 0 18px; }
.calling { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: rgba(20, 24, 26, 0.85); cursor: pointer; text-align: start; transition: border-color 0.15s, transform 0.15s; }
.calling:hover { border-color: #7d6a45; transform: translateY(-2px); }
.calling.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(212, 162, 76, 0.35); }
.calling .pcard { width: 100px; flex: none; }
.calling .pcard .pc-top { font-size: 9px; }
.calling .pcard .pc-bottom { font-size: 8px; }
.calling h3 { margin: 2px 0 6px; font-family: var(--display); font-size: 16px; }
.calling p { margin: 0 0 6px; font-size: 12.5px; color: var(--ink-dim); line-height: 1.45; }
.calling .bonus { font-size: 11.5px; color: var(--ink-faint); }
.field { display: flex; gap: 10px; align-items: center; margin: 10px 0; flex-wrap: wrap; }
.field input[type=text] { background: #15171b; border: 1px solid var(--line); color: var(--ink); padding: 8px 10px; border-radius: 6px; font-size: 14px; min-width: 220px; }
.field label { font-size: 13px; color: var(--ink-dim); }
.modal .row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.help-paper { padding: 14px 26px 18px; font-family: var(--serif); }
/* The Help: a row of chapter tabs over one scrolling paper; each chapter flows in two columns on a wide screen. */
/* In a verb window's about: the book that opens the Help at this verb. */
.vwin .vw-help { display: block; width: 34px; height: 34px; margin: 4px 0 2px; padding: 0; border: none; border-radius: 50%; background: center / contain no-repeat; cursor: pointer; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5)); }
.vwin .vw-help:hover { filter: drop-shadow(0 0 6px rgba(212, 162, 76, 0.9)); }
.help-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0 0 8px; }
.help-tabs button { display: flex; align-items: center; gap: 8px; padding: 5px 12px; background: linear-gradient(#171b1d, #0e1112); color: var(--paper); border: 1px solid #6b5634; font-family: var(--serif); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 12.5px; cursor: pointer; box-shadow: inset 0 0 0 2px #0a0c0d, inset 0 0 0 3px #3a3122; }
.help-tabs button.on { background: linear-gradient(#8e1f1c, #5d1210); border-color: #d05a4a; }
.help-tabs .ico { flex: none; width: 20px; height: 20px; background: center / contain no-repeat; }
.help-ch { scroll-margin-top: 6px; }
.help-ch + .help-ch { margin-top: 18px; padding-top: 4px; border-top: 2px solid #c9b78f; }
.help-ch h3 { margin: 6px 0 2px; font-family: var(--display); font-size: 19px; letter-spacing: 0.06em; text-transform: uppercase; color: #7c1d15; }
.help-cols { columns: 2; column-gap: 32px; font-size: 14.5px; line-height: 1.5; }
.help-cols h4 { display: flex; align-items: center; gap: 8px; margin: 14px 0 3px; font-family: var(--display); letter-spacing: 0.06em; text-transform: uppercase; font-size: 14px; color: #1f1b15; break-after: avoid; scroll-margin-top: 6px; }
.help-cols h4::before { content: '◈'; font-size: 11px; color: #8f7440; }
.help-cols h4:has(.hv)::before { content: none; }
.help-cols h4::after { content: ''; flex: 1; border-bottom: 1px solid #c9b78f; }
.help-cols h4 .hv { flex: none; width: 30px; height: 30px; border-radius: 5px; background: var(--i) center / 100% 100% no-repeat; box-shadow: 0 2px 0 #1a1410, 0 3px 4px rgba(0, 0, 0, 0.4); }
.help-cols h4:first-child { margin-top: 4px; }
.help-cols p { margin: 0; color: #2a2317; break-inside: avoid; }
.help-cols p + p { margin-top: 6px; }
.help-cols b { color: #7c1d15; }
.help-cols p.hw { margin: 0 0 6px; }
/* Where a verb window's i sent the reader: the heading glows for a moment. */
.help-cols h4.flash { animation: helpFlash 1.6s ease-out; }
@keyframes helpFlash { 0%, 40% { background: rgba(212, 162, 76, 0.45); } 100% { background: transparent; } }
/* The ending's tally: painted counters (--c is the tile: the crown, the eye, the moon, the fire) with
   the number beside the icon, never over it, and the word under both. */
.stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 14px 0 4px; }
.stats div { display: grid; grid-template-columns: 40px auto; align-items: center; column-gap: 6px; }
.stats b { width: 40px; height: 40px; font-size: 0; background: var(--c, var(--art-cres-09)) center / contain no-repeat; clip-path: ellipse(50% 44% at 50% 49.5%); filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.stats em { font-style: normal; font-family: var(--display); font-weight: 700; font-size: 22px; line-height: 1; color: #1f1b15; min-width: 1.4em; }
.stats span { grid-column: 1 / -1; display: block; margin-top: 2px; font-family: var(--mono); font-size: 10.5px; color: #5a4f3a; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.2; }
/* The end card is dealt in, and the rank's wax lands on it after; the counters count up (js/main.js). */
.end-box.dealt .end-card { animation: flipIn 0.5s ease-out backwards; }
.end-box.dealt .end-card .ec-seal { animation: stamp 0.45s ease-out 0.4s both; }
.banner.lose span { border-image-source: var(--art-cbar-01); }
.banner.win span { border-image-source: var(--art-cbar-03); }
.end-paper { flex: 1 1 auto; min-height: 150px; overflow: auto; display: grid; grid-template-columns: 240px 1fr; gap: 20px; align-items: start; padding: 18px 22px; font-family: var(--serif); }
.end-paper h2 { margin: 0 0 8px; font-family: var(--serif); font-weight: 400; font-size: 16px; color: #5a4f3a; }
.end-box .end-paper .lead { margin: 0 0 8px; max-width: none; text-align: start; text-shadow: none; color: #1f1b15; font-size: 15px; line-height: 1.55; }
/* The end card: a wide frame (gold on a win, dark on a loss) with the ending's picture in its arch,
   the rank's wax in the circle and the name in the band. */
/* Under a loss: what would have saved you, beside the threat's seal. */
.end-paper .end-lesson { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; padding: 6px 10px; border-inline-start: 3px solid rgba(160, 50, 40, 0.7); background: rgba(120, 90, 50, 0.1); color: #3a3127; font-size: 14px; line-height: 1.4; }
.end-paper .end-lesson i { flex: none; width: 34px; height: 34px; background: center / contain no-repeat; }
/* What became of them: the run's late story, a line each with its seal. */
.end-paper .end-epi { margin: 0 0 10px; }
.end-paper .end-epi h6 { margin: 0 0 4px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: #8a5a1a; }
.end-paper .end-epi ul { margin: 0; padding: 0; list-style: none; }
.end-paper .end-epi li { display: flex; align-items: center; gap: 8px; margin: 3px 0; font-family: var(--serif); font-size: 13.5px; line-height: 1.35; color: #2a241c; }
.end-paper .end-epi li i { flex: none; width: 24px; height: 24px; background: center / contain no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }
.end-card { position: relative; width: 100%; aspect-ratio: 320 / 236; background: var(--frame, var(--art-cwide-04)) center / 100% 100% no-repeat; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.5)); }
.end-win .end-card { --frame: var(--art-cwide-03); }
.end-lose .end-card { --frame: var(--art-cwide-04); }
.end-card .ec-pic { position: absolute; left: 7.2%; top: 9.8%; width: 85.6%; height: 64.8%; border-radius: 50% 50% 0 0 / 56% 56% 0 0; overflow: hidden; background: var(--art-cback-04) center / cover no-repeat; }
.end-card .ec-seal { position: absolute; left: 80.3%; top: 6.8%; width: 15%; aspect-ratio: 1; background: center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5)); }
.end-card .ec-name { position: absolute; left: 8%; right: 8%; top: 78.4%; height: 18.6%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: #1c1914; overflow: hidden; }

/* ---------- Narrow screens ---------- */
@media (max-width: 980px) {
  #main { grid-template-columns: 1fr; grid-template-rows: 1fr auto; }
  #toasts { width: 300px; }
  .vwin { width: min(370px, calc(100% - 8px)); }
  .callings { grid-template-columns: 1fr; }
  .help-cols { columns: 1; }
  .help-tabs button { font-size: 10.5px; padding: 4px 8px; gap: 5px; letter-spacing: 0.04em; }
  .help-tabs .ico { width: 16px; height: 16px; }
  /* The bar in one 44px row: icon-only meters, a short week, the play button alone (it cycles the speed);
     the journal, the Watch-house and the Help are in the pause menu. */
  #topbar { gap: 6px; padding: 4px 8px; min-height: 44px; }
  /* Named under #topbar so these beat the base badge and week-bar rules further down; the five 30px icons keep their width and the week bar shortens to its hourglass. */
  #topbar #rank-badge { width: 32px; height: 32px; }
  #topbar #weekbar { width: auto; flex: 0 1 100px; min-width: 30px; }
  #meters { gap: 4px; flex: none; }
  .meter { min-width: 0; width: 30px; flex: none; height: 30px; gap: 0; }
  .meter .m-icon { width: 30px; height: 30px; }
  .meter .m-main { display: none; }
  #controls { gap: 2px; }
  .ctl.dbi, #controls .speed .ctl { width: 36px; height: 36px; min-width: 36px; }
  #controls button[data-speed="2"], #controls button[data-speed="3"], #btn-journal, #btn-precinct, #btn-help { display: none; }
}
/* The bar sheds its words before it wraps: the meter names (the icon and the word stay; the
   name is in the tap dossier), then the rank, then the brand. */
@media (max-width: 1500px) {
  .meter .m-label { display: none; }
  .meter { min-width: 0; }
}
@media (max-width: 1300px) {
  #topbar .rank { display: none; }
}
@media (max-width: 1100px) {
  #topbar .brand { display: none; }
}

/* ---------- Screens (title, new game, settings, archive) ---------- */
.modal { background: rgba(6, 9, 10, 0.72) var(--art-dmenu) center / cover no-repeat; background-blend-mode: multiply; }
#title.modal { background: rgba(6, 9, 10, 0.25) var(--art-dmenu) center / cover no-repeat; background-blend-mode: multiply; }
.screen-box { background: rgba(10, 13, 16, 0.86); border: 1px solid #6b5634; border-radius: 12px; box-shadow: 0 0 0 1px #0a0b0c, 0 18px 40px rgba(0, 0, 0, 0.65); }
.modal#menu, .modal#help, .modal#end { background: rgba(6, 9, 10, 0.8); }
/* A screen is a column: banner, a scrolling paper, the buttons; the box never outgrows the page. */
.screen-box { width: 100%; max-width: 980px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; overflow: hidden; padding: 8px 24px 20px; }
.screen-box > .row, .screen-box > .banner, .screen-box > .lead { flex: none; }
.help-paper, .settings-paper, .precinct-paper, .archive-body { flex: 1 1 auto; min-height: 0; overflow: auto; max-height: none; }
.settings-body { flex: 1 1 auto; min-height: 0; }
.screen-box.wide { max-width: 1160px; }
.screen-box .lead { text-align: center; max-width: 760px; margin: 0 auto 8px; text-shadow: 0 2px 6px #000; }
.screen-box .field { justify-content: center; }

.title-wrap { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
/* The scene is laid out at its own aspect; the logo and the buttons sit on its painted plates. */
.title-scene { position: relative; width: min(100vw, calc((100vh - 32px) * 1.777)); aspect-ratio: 1672 / 941; background: var(--art-dmenu) center / 100% 100% no-repeat; }
/* Round the scene, the same room again at cover, darkened (no blur filter, which a phone's WebView pays for):
   the bars a screen of another shape leaves are the room in shadow, not black. */
#title.modal { background: linear-gradient(rgba(4, 14, 17, 0.62), rgba(4, 14, 17, 0.62)), var(--art-dmenu) center / cover no-repeat, #06161a; padding: 0; }
.title-scene { box-shadow: 0 0 48px 24px rgba(4, 14, 17, 0.7); }
/* The candle breathes and the river lights drift: a warm halo over the painted flame, a slow shimmer on the
   water under the bridge. Both are still under reduced motion or the calm setting. */
.title-scene::after { content: ''; position: absolute; left: 2.6%; top: 36.5%; width: 13%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(255, 200, 110, 0.35), transparent 65%); mix-blend-mode: screen; pointer-events: none; animation: flicker 3.2s infinite steps(1); }
.title-scene::before { content: ''; position: absolute; left: 78%; top: 56%; width: 21%; height: 7%; background: repeating-linear-gradient(90deg, transparent 0 7px, rgba(255, 205, 120, 0.9) 7px 9px, transparent 9px 17px); opacity: 0.15; mix-blend-mode: screen; pointer-events: none; -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent); animation: riverDrift 8s ease-in-out infinite alternate; }
@keyframes flicker { 0% { opacity: 0.85; transform: scale(1); } 23% { opacity: 1; transform: scale(1.04); } 41% { opacity: 0.75; transform: scale(1); } 67% { opacity: 0.95; transform: scale(0.98); } }
@keyframes riverDrift { from { transform: translateX(0); } to { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .title-scene::before, .title-scene::after { animation: none; } }
html[data-calm] .title-scene::before, html[data-calm] .title-scene::after { animation: none; }
.title-scene .title-logo { position: absolute; left: 30%; top: 5%; width: 40%; aspect-ratio: 736 / 214; margin: 0; }
/* The painted plate is English; in a right-to-left language the game's name is set under it in that tongue. */
.title-sub { display: none; }
[dir=rtl] .title-scene .title-sub { display: block; position: absolute; left: 20%; right: 20%; top: 26%; text-align: center; pointer-events: none;
  font-family: 'Amiri', var(--display); font-weight: 700; font-size: clamp(14px, 2.2vw, 32px); line-height: 1.2; color: #d4a24c; filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85)); }
[dir=rtl] .title-scene .title-buttons { top: 32%; }
.title-scene .title-buttons { position: absolute; left: 36%; top: 30%; width: 28%; display: flex; flex-direction: column; gap: 2.2%; }
.title-scene .title-buttons .plate-btn { width: 100%; min-width: 0; margin: 0; font-size: clamp(11px, 1.5vw, 18px); letter-spacing: 0.12em; }
/* A plate with an icon is a flex row (icon, gap, words): a label that wraps or reads right-to-left never slides under the icon. The icon's negative vertical margin keeps the plate the height of its words. */
.title-buttons .plate-btn, #menu .plate-btn { display: flex; align-items: center; justify-content: center; gap: 10px; text-align: start; line-height: 1.3; }
.plate-btn .mi { display: block; flex: none; width: 28px; height: 28px; margin: -6px 0; background: var(--i) center / 100% 100% no-repeat; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.6)); }
.title-scene .title-buttons .plate-btn.hidden { display: none !important; }
/* Until the art has loaded, New Game and Continue wait: an hourglass turns where their icons were (js/main.js). */
#title.art-wait #t-new, #title.art-wait #t-continue { cursor: progress; filter: saturate(0.6) brightness(0.92); }
#title.art-wait #t-new .mi, #title.art-wait #t-continue .mi { background-image: var(--art-ctimer-01); animation: glassTurn 1.6s ease-in-out infinite; }
@keyframes glassTurn { 0%, 35% { transform: rotate(0); } 65%, 100% { transform: rotate(180deg); } }
.title-logo { width: min(620px, 92vw); aspect-ratio: 736 / 214; background: var(--art-logo) center / contain no-repeat; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, 0.7)); }
.title-buttons { display: flex; flex-direction: column; gap: 12px; width: min(340px, 86vw); }

/* Painted plate buttons (css/art/buttons.css); the ends stay crisp, the middle stretches. */
.plate-btn {
  --plate: var(--art-cpill-03); position: relative; min-width: 150px; padding: 2px 22px; border: solid transparent; border-width: 14px 26px;
  border-image: var(--plate) var(--slice, 27 46) fill / var(--bw, 14px 26px) var(--rep, stretch); background: none; color: #1c1914;
  font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55)); transition: filter 0.15s, transform 0.15s;
}
.plate-btn:hover { filter: drop-shadow(0 4px 8px rgba(212, 162, 76, 0.55)) brightness(1.08); transform: translateY(-1px); }
.plate-btn:disabled { filter: grayscale(1) opacity(0.5); cursor: not-allowed; transform: none; }
.plate-btn.gold { --plate: var(--art-cpill-03); }
.plate-btn.red { --plate: var(--art-cpill-01); }
.plate-btn.teal { --plate: var(--art-cpill-04); }
.plate-btn.blue { --plate: var(--art-cpill-02); }
.plate-btn.dark, .plate-btn.redfill, .plate-btn.tealfill { color: var(--paper); --plate: var(--art-cpill2-04); --slice: 22 46; --bw: 12px 26px; }
.plate-btn.redfill { --plate: var(--art-cpill2-01); --slice: 26 46; --bw: 12px 26px; }
.plate-btn.tealfill { --plate: var(--art-cpill2-05); --slice: 22 46; --bw: 12px 26px; }

.banner { display: flex; justify-content: center; margin: 6px 0 16px; }
.banner span {
  display: inline-block; padding: 4px 40px; border: solid transparent; border-width: 20px 36px; border-image: var(--art-cbar-03) 46 60 fill / 20px 26px stretch;
  color: #1c1914; font-family: var(--display); font-weight: 700; font-size: clamp(20px, 3.6vw, 34px); letter-spacing: 0.06em; text-transform: uppercase;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.6));
}
.banner.dark span { border-image-source: var(--art-cbar-02); letter-spacing: 0.22em; }
.banner.small span { font-size: 20px; padding: 2px 28px; }
.row.center { justify-content: center; }
.row.right { justify-content: flex-end; }
.row.column { flex-direction: column; align-items: stretch; }

/* Illustrated cards with a name plate at top and bottom. */
.pcard { position: relative; display: block; width: 100%; aspect-ratio: 208 / 331; padding: 0; border: none; background: center / 100% 100% no-repeat; color: #1c1914; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.6)); cursor: pointer; }
.pcard .pc-top, .pcard .pc-bottom { position: absolute; left: 14%; right: 14%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--display); font-weight: 700; line-height: 1.05; overflow: hidden; }
.pcard .pc-top { display: none; }
.pcard .pc-bottom { top: 82%; height: 11%; left: 10%; right: 10%; font-size: 9.5px; letter-spacing: 0.04em; text-transform: uppercase; background: rgba(239, 230, 207, 0.94); border-radius: 3px; box-shadow: 0 0 0 1px rgba(60, 40, 10, 0.45); }
.pcard.big .pc-top { font-size: 12.5px; }
.pcard.big .pc-bottom { font-size: 12px; }

/* Settings */
.settings-body { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: minmax(0, 1fr); gap: 22px; }
.settings-tabs { display: flex; flex-direction: column; gap: 14px; }
.settings-tabs button { display: flex; align-items: center; gap: 16px; padding: 10px 14px; background: linear-gradient(#171b1d, #0e1112); color: var(--paper); border: 1px solid #6b5634; font-family: var(--serif); font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; font-size: 15px; cursor: pointer; box-shadow: inset 0 0 0 3px #0a0c0d, inset 0 0 0 4px #3a3122; }
.settings-tabs button.on { background: linear-gradient(#8e1f1c, #5d1210); border-color: #d05a4a; }
.paper { background: #efe3c6 radial-gradient(ellipse at 30% 20%, rgba(255, 255, 255, 0.35), transparent 60%); color: #1f1b15; border: 2px solid #b8913f; box-shadow: inset 0 0 0 4px #efe3c6, inset 0 0 0 5px #8f7440, 0 10px 30px rgba(0, 0, 0, 0.5); }
.settings-paper { padding: 18px 26px; font-family: var(--serif); }
.settings-paper h3 { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px; font-size: 20px; letter-spacing: 0.08em; text-transform: uppercase; }
.settings-paper h3::before { content: '◈'; font-size: 14px; }
.settings-paper h3::after { content: ''; flex: 1; border-bottom: 1px solid #6d5d40; }
.set-row { display: grid; grid-template-columns: 230px 1fr 62px; align-items: center; gap: 14px; padding: 6px 0 6px 24px; font-size: 16px; }
.set-row output { border: 1px solid #6d5d40; text-align: center; padding: 3px 0; font-size: 14px; }
.set-note { font-size: 13px; color: #6d5d40; margin: 4px 0 0 24px; }
.set-row input[type=range] { -webkit-appearance: none; appearance: none; height: 12px; border-radius: 6px; background: linear-gradient(90deg, #8e1f1c, #b52b25); border: 2px solid #151515; }
.set-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; transform: rotate(45deg); background: #efe3c6; border: 3px solid #b8913f; box-shadow: 0 0 0 2px #151515; cursor: pointer; }
.set-row input[type=range]::-moz-range-thumb { width: 18px; height: 18px; background: #efe3c6; border: 3px solid #b8913f; cursor: pointer; }
.toggle { -webkit-appearance: none; appearance: none; grid-column: 3; justify-self: end; width: 66px; height: 27px; border: none; background: var(--art-ctog2-01) center / 100% 100% no-repeat; position: relative; cursor: pointer; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)); }
.toggle:checked { background-image: var(--art-ctog-01); }
.toggle.red:checked { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.5)) hue-rotate(160deg); }
.lang-pick { grid-column: 2 / 4; display: flex; align-items: center; justify-content: space-between; background: #111416; color: var(--paper); border: 2px solid #b8913f; padding: 6px 12px; }
.lang-pick button { background: none; border: none; color: var(--paper); font-size: 22px; }

/* Line icons for settings tabs and archive rows. */
.ico { display: inline-block; width: 36px; height: 36px; flex: none; background: center / contain no-repeat; }
.ico-audio { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe3c6' stroke-width='2'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16 9a4 4 0 0 1 0 6M18.5 6.5a8 8 0 0 1 0 11'/%3E%3C/svg%3E"); }
.ico-display { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe3c6' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='12' rx='1'/%3E%3Cpath d='M9 20h6M12 16v4'/%3E%3C/svg%3E"); }
.ico-gameplay { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe3c6' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1L7 17M17 7l2.1-2.1'/%3E%3C/svg%3E"); }
.ico-language { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe3c6' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M3 12h18M12 3c3 3 3 15 0 18M12 3c-3 3-3 15 0 18'/%3E%3C/svg%3E"); }
.ico-file { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe3c6' stroke-width='2'%3E%3Cpath d='M6 3h9l4 4v14H6z'/%3E%3Cpath d='M9 11h7M9 15h7M9 7h4'/%3E%3C/svg%3E"); }
.ico-pin { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe3c6' stroke-width='2'%3E%3Cpath d='M12 21s-6-6.5-6-11a6 6 0 0 1 12 0c0 4.5-6 11-6 11z'/%3E%3Ccircle cx='12' cy='10' r='2'/%3E%3C/svg%3E"); }
.ico-person { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe3c6' stroke-width='2'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c1-4 4-6 8-6s7 2 8 6'/%3E%3C/svg%3E"); }
.ico-eye { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23efe3c6' stroke-width='2'%3E%3Cpath d='M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E"); }

/* Archive */
.archive-body { display: grid; grid-template-columns: 1fr 380px; gap: 26px; align-items: start; }
.archive-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.archive-grid .pcard { transition: transform 0.15s, filter 0.15s; }
.archive-grid .pcard:hover { transform: translateY(-3px); }
.archive-grid .pcard.on { filter: drop-shadow(0 0 8px rgba(212, 162, 76, 1)); }
.archive-grid .pcard.o-cold, .archive-grid .pcard.o-acquitted { --dim: 1; }
/* The outcome's wax and a sealed record's key, each tile whole in a small gilt frame, as the promotion frames its wax. */
.archive-grid .pcard .pc-seal, .archive-grid .pcard .pc-sealed { position: absolute; display: block; box-sizing: border-box; padding: 2px; background: #012225 var(--s) center / contain no-repeat; background-origin: content-box; border: 2px solid #a88a4c; border-radius: 5px; box-shadow: inset 0 0 0 1px #0a0c0d, 0 3px 6px rgba(0, 0, 0, 0.55); pointer-events: none; z-index: 1; }
.archive-grid .pcard .pc-seal { top: 3%; right: 3%; width: 30%; aspect-ratio: 1; }
.archive-grid .pcard .pc-sealed { top: 4%; left: 5%; width: 20%; aspect-ratio: 112 / 149; }
.archive-grid .pcard.o-cold::after { content: ''; position: absolute; inset: 20% 12% 20%; background: rgba(40, 60, 80, 0.35); mix-blend-mode: multiply; pointer-events: none; }
.archive-empty { grid-column: 1 / -1; color: var(--ink-dim); font-family: var(--serif); font-size: 16px; text-align: center; padding: 60px 0; }
.archive-pager { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 12px; font-family: var(--mono); color: var(--ink-dim); }
.archive-pager .pg { background: #111416; color: var(--paper); border: 1px solid #b8913f; width: 34px; height: 30px; font-size: 18px; }
.archive-pager .pg:disabled { opacity: 0.35; }
.archive-detail { position: relative; padding: 18px 18px 22px; min-height: 420px; font-family: var(--serif); }
.a-title { margin: 0 0 14px; display: flow-root; }
.a-title span { display: block; padding: 10px 14px; background: #f7eed8; border: 2px solid #8f7440; font-weight: 700; font-size: 18px; line-height: 1.2; }
.a-portrait { float: right; margin: -8px -6px 8px 10px; width: 66px; height: 104px; background: center / contain no-repeat; border-radius: 4px; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); }
.a-portrait.sealed { filter: brightness(0.3); }
.a-portrait.sealed + .a-seal { position: absolute; top: 38px; right: 20px; width: 50px; height: 50px; background: var(--art-cwax-01) center / contain no-repeat; filter: drop-shadow(0 3px 4px rgba(0,0,0,0.6)); }
.a-row { display: flex; gap: 12px; align-items: flex-start; margin: 12px 0; font-size: 14.5px; line-height: 1.4; }
.a-row .ico { width: 38px; height: 38px; background-color: #15191b; border-radius: 4px; }
.a-dim { color: #6d5d40; }
.a-empty { color: #6d5d40; }

/* Ending */
.end-box .row { flex-wrap: wrap; }
.end-box .plate-btn { min-width: 0; font-size: 12.5px; padding: 10px 18px; }

/* Window shake on harm done, not on every piece of bad news. */
#app.shake { animation: shake 0.3s; }
@keyframes shake { 20% { transform: translate(-3px, 1px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, 1px); } 80% { transform: translate(1px, -1px); } }

.story { cursor: default; }

@media (max-width: 980px) {
  .callings { grid-template-columns: 1fr; }
  .origins { grid-template-columns: repeat(2, 1fr); }
  .settings-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .settings-tabs { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .settings-tabs button { font-size: 12px; padding: 6px 10px; gap: 6px; }
  .set-row { grid-template-columns: 1fr 1fr 52px; padding-left: 0; font-size: 14px; }
  .archive-body { grid-template-columns: 1fr; }
  .archive-grid { grid-template-columns: repeat(2, 1fr); }
  .end-paper { grid-template-columns: 1fr; gap: 10px; padding: 12px 14px; }
  .end-card { width: 200px; margin: 0 auto; }
  .stats { display: grid; grid-template-columns: repeat(4, max-content); justify-content: center; gap: 6px 10px; }
  .stats b { width: 34px; height: 34px; }
  .stats div { grid-template-columns: 34px auto; }
  .stats em { font-size: 19px; }
  .stats span { font-size: 9px; letter-spacing: 0; }
  .banner span { padding: 10px 34px; }
}
/* A phone on its side: the card stays beside the words, so the tally is not pushed under the fold. */
@media (max-height: 520px) {
  .end-box .end-paper { grid-template-columns: 150px 1fr; }
  .end-box .end-paper .end-card { width: 150px; margin: 0; }
  .end-box .stats { justify-content: flex-start; }
}

/* Top bar: rank badge and the sun-to-moon week bar. */
#rank-badge { width: 38px; height: 38px; flex: none; background: center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
#weekbar { position: relative; width: 150px; height: 30px; flex: none; }
/* The hourglass is its own element, so it can turn over when the Bell tolls. */
#weekbar .wb-glass { position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--art-ctimer-01) center / contain no-repeat; z-index: 1; }
#weekbar .wb-glass.turn { animation: hourTurn 0.7s ease-in-out; }
@keyframes hourTurn { to { transform: rotate(180deg); } }
/* A new week: the bar flashes gold over the full shade instead of running back. */
#weekbar::after { content: ''; position: absolute; left: 26px; right: 0; top: 8px; bottom: 8px; border-radius: 0 7px 7px 0; background: rgba(240, 200, 110, 0.9); opacity: 0; pointer-events: none; }
#weekbar.flash::after { animation: wbFlash 0.6s ease-out; }
@keyframes wbFlash { 35% { opacity: 0.7; } }
/* The Bell's tile swings once on its top edge as it tolls. */
.verb.time.toll .v-token { transform-origin: 50% 0; animation: toll 1.2s ease-out; }
@keyframes toll { 15% { transform: rotate(-4deg); } 35% { transform: rotate(3deg); } 55% { transform: rotate(-2deg); } 75% { transform: rotate(1deg); } }
#weekbar::before { content: ''; position: absolute; left: 26px; right: 0; top: 8px; bottom: 8px; border-radius: 0 7px 7px 0; background: linear-gradient(#efe3c6, #d9c9a3); box-shadow: inset 0 0 0 1px rgba(60, 40, 10, 0.6), 0 2px 3px rgba(0, 0, 0, 0.5); }
/* The shade is anchored at the moon and scaled back from the sun (js/ui.js writes the scaleX). */
#weekbar .wb-shade { position: absolute; top: 9px; bottom: 9px; left: 19%; right: 1px; background: rgba(12, 14, 16, 0.78); border-radius: 0 6px 6px 0; transform-origin: right center; transition: transform 0.5s linear; }

/* Painted dialogs with hot spots over their baked buttons. */
.precinct-lead { font-family: var(--serif); font-size: 16px; color: var(--paper); margin: -6px auto 12px; }
.precinct-paper { padding: 16px 20px; }
.precinct-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.room { position: relative; border: 2px solid #b8913f; border-radius: 6px; padding: 12px 14px 12px 74px; background: rgba(255, 250, 238, 0.55); box-shadow: inset 0 0 0 1px rgba(60, 40, 10, 0.25); min-height: 132px; display: flex; flex-direction: column; gap: 6px; color: #1f1b15; }
.room .rm-icon { position: absolute; left: 12px; top: 12px; width: 50px; height: 50px; background: center / contain no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.4)); }
.room .rm-name { font-family: var(--display); font-weight: 700; font-size: 14px; letter-spacing: 0.03em; }
.room .rm-desc { font-family: var(--serif); font-size: 13px; color: #3a3127; line-height: 1.4; flex: 1; }
.room .rm-foot { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: #7a6a4c; }
.room.owned { border-color: #1f7a72; background: rgba(31, 122, 114, 0.12); }
.room.owned .rm-foot { color: #1f7a72; }
.room.locked { opacity: 0.55; border-color: #9a8c70; }
.room.ordered .rm-foot { color: #7c1d15; }
.room .plate-btn.small { align-self: flex-start; font-size: 12px; padding: 4px 14px; min-height: 30px; }
/* The cheapest Petition the office allows and not yet bought: a gold edge and a small tag. */
.room.next { border-color: #d4a24c; box-shadow: inset 0 0 0 1px rgba(60, 40, 10, 0.25), 0 0 0 2px rgba(212, 162, 76, 0.55); }
/* The Next tag stands on the foot's line, at its far end, clear of the Petition button under it. */
.room .rm-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.room .rm-next { flex: none; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #8a5a1a; }
.modal.dialog { background: rgba(6, 9, 10, 0.7); z-index: 1300; }
.dlg { position: relative; background: center / 100% 100% no-repeat; filter: drop-shadow(0 16px 30px rgba(0, 0, 0, 0.7)); }
.dlg-confirm { width: min(420px, 92vw); aspect-ratio: 360 / 307; background-image: var(--art-cpanel-01); }
.dlg-confirm .dlg-head { position: absolute; left: 22%; right: 22%; top: 3%; height: 13%; display: flex; align-items: center; justify-content: center; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper); }
.dlg-confirm .dlg-text { position: absolute; left: 10%; right: 10%; top: 20%; height: 52%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--serif); font-size: 16px; line-height: 1.35; color: #1f1b15; }
.dlg-hot { position: absolute; top: 77%; height: 15%; background: transparent; border: none; border-radius: 8px; cursor: pointer; font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--paper); text-shadow: 0 1px 2px #000; }
.dlg-hot:hover { background: rgba(255, 255, 255, 0.08); box-shadow: 0 0 12px rgba(212, 162, 76, 0.5); }
.dlg-hot.yes { left: 6%; width: 40%; }
.dlg-hot.no { left: 53%; width: 40%; }
.dlg-levelup { width: min(520px, 92vw); aspect-ratio: 519 / 311; background-image: var(--art-cpanel2-01); animation: promoIn 0.5s ease-out; }
.lu-badge { position: absolute; left: 6%; top: 19%; width: 17%; aspect-ratio: 1; box-sizing: border-box; padding: 3px; background: #012225 center / contain no-repeat; background-origin: content-box; border: 2px solid #a88a4c; border-radius: 6px; box-shadow: inset 0 0 0 1px #0a0c0d, 0 0 0 1px #3a3122, 0 4px 8px rgba(0, 0, 0, 0.55); transform: rotate(-6deg); }
.lu-title { position: absolute; left: 22%; right: 22%; top: 3%; height: 12%; box-sizing: border-box; padding-inline: 6%; color: var(--paper) !important; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; text-align: center; font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; color: #1f1b15; }
.lu-slot { position: absolute; top: 19%; width: 15%; height: 36%; background: center / contain no-repeat; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.5)); cursor: pointer; border-radius: 8px; transition: transform 0.15s, filter 0.15s; }
.lu-slot:hover { transform: translateY(-2px); }
.lu-slot.on { filter: drop-shadow(0 0 6px rgba(212, 162, 76, 0.9)); }
.lu-slot.empty { display: none; }
.lu-slot .lu-cap { position: absolute; left: -30%; right: -30%; top: 100%; margin-top: 4px; text-align: center; font-family: var(--display); font-weight: 700; font-size: min(11px, 2.1vw); white-space: nowrap; letter-spacing: 0.06em; text-transform: uppercase; color: #1f1b15; }
.lu-slot.s1 { left: 30%; } .lu-slot.s2 { left: 49%; } .lu-slot.s3 { left: 68%; }
.lu-note { position: absolute; left: 8%; right: 8%; top: 64%; height: 14%; display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--serif); font-size: min(12.5px, 2.4vw); line-height: 1.25; color: #3a3127; overflow: hidden; }
.dlg-levelup .dlg-hot { top: 79%; height: 15%; font-size: min(13px, 2.5vw); white-space: nowrap; overflow: hidden; }
.dlg-hot.blue { left: 6%; width: 42%; }
.dlg-hot.red { left: 52%; width: 42%; }
@keyframes promoIn { from { transform: scale(0.7); opacity: 0; } }
.lu-title .lu-kick { font-family: var(--mono); font-weight: 400; font-size: 10px; letter-spacing: 0.14em; opacity: 0.85; }
[dir=rtl] .lu-title .lu-kick { font-size: 12px; letter-spacing: 0; }
.lu-title .lu-rank { max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* The ceremony: the wax comes down after the panel, then the powers are dealt one by one. */
.dlg-levelup.cer .lu-badge { animation: stamp 0.45s cubic-bezier(0.3, 1.4, 0.5, 1) 0.35s backwards; }
.dlg-levelup.cer .lu-slot:not(.empty) { animation: flipIn 0.4s ease-out backwards; }
#rank-badge.rank-new { animation: rankGlow 2s ease-out; }
/* Pressed in like wax (the first 0.3s), then it glows. */
@keyframes rankGlow { 0% { opacity: 0; transform: scale(1.8); } 15% { opacity: 1; transform: scale(0.95); } 0%, 22%, 60% { filter: drop-shadow(0 0 8px rgba(240, 200, 110, 0.95)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); } 22%, 60% { transform: scale(1.12); } }
@media (prefers-reduced-motion: reduce) {
  .dlg-levelup, .dlg-levelup.cer .lu-badge, .dlg-levelup.cer .lu-slot:not(.empty) { animation: none; }
  #rank-badge.rank-new { animation: none; filter: drop-shadow(0 0 6px rgba(240, 200, 110, 0.9)); }
}

/* Reduce motion (Settings, on from the first run where the device asks for it): no shake, no slam,
   no turn in depth. Flips and stamps fade, panels and notes come in by opacity alone, glows hold still. */
html[data-calm] #app.shake { animation: none; }
html[data-calm] .verb .verdict { animation: fadeIn 0.2s ease-out both, stampLift 0.4s ease-in 1.6s forwards; }
html[data-calm] .card .verdict { animation: fadeIn 0.2s ease-out both; }
html[data-calm] .mini-wrap.flip-out { animation: fadeOut 0.12s linear forwards; }
html[data-calm] .mini-wrap.flip-in { animation: fadeIn 0.12s linear; }
html[data-calm] .card.arrive .c-face, html[data-calm] .card.settle .c-face { animation-name: fadeIn; }
html[data-calm] .dlg-levelup, html[data-calm] #board .choice, html[data-calm] .vwin, html[data-calm] .toast, html[data-calm] .edge-mark, html[data-calm] .verb .v-magnet.asks, html[data-calm] .verb .v-magnet.due { animation-name: fadeIn; }
html[data-calm] .dlg-levelup.cer .lu-badge, html[data-calm] .dlg-levelup.cer .lu-slot:not(.empty), html[data-calm] #board .choice .ch-opt.taken::after { animation-name: fadeIn; }
html[data-calm] #rank-badge.rank-new { animation: none; filter: drop-shadow(0 0 6px rgba(240, 200, 110, 0.9)); }
html[data-calm] .verb.done .v-token::before, html[data-calm] .verb.new .v-token::before, html[data-calm] .verb.noticed .v-token::before, html[data-calm] .card.urgent::after, html[data-calm] .card.noticed::after, html[data-calm] .card.merged::after, html[data-calm] .meter.crit .m-icon::after, html[data-calm] .edge-mark b::after, html[data-calm] .verb .v-magnet.asks::after, html[data-calm] #turn .turn-card { animation: none; }
html[data-calm] .card.urgent::after, html[data-calm] .meter.crit .m-icon::after { opacity: 0.8; }
html[data-calm] .meter.bump .m-icon, html[data-calm] .meter.bump::before, html[data-calm] .meter.bump .m-icon::before { animation: none; }
html[data-calm] .meter.bump::before, html[data-calm] .meter.bump .m-icon::before { opacity: 0.9; }
html[data-calm] .meter.bump-up .m-icon::before { transform: rotate(-90deg); }
html[data-calm] .meter.bump-down .m-icon::before { transform: rotate(90deg); }
/* Less motion: a step inside a word is the coloured arrow alone, held still; the Bell does not swing, the glass
   does not turn, a new word fades in without spreading. */
html[data-calm] .meter.nudge .m-icon, html[data-calm] .meter.nudge .m-icon::before, html[data-calm] .verb.time.toll .v-token, html[data-calm] .verb.pressed .v-token, html[data-calm] .verb.risen .v-token, html[data-calm] #weekbar .wb-glass.turn { animation: none; }
html[data-calm] .meter.nudge .m-icon::before { opacity: 0.9; }
html[data-calm] .meter.nudge-up .m-icon::before { transform: rotate(-90deg); }
html[data-calm] .meter.nudge-down .m-icon::before { transform: rotate(90deg); }
html[data-calm] .meter .m-word.word-new { animation-name: fadeIn; }
html[data-calm] .vwin.closing, html[data-calm] .toast.leaving { transform: none; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeOut { to { opacity: 0; } }

/* Panels scale with the Settings slider; the table itself is zoomed by hand. */
.vwin { width: min(calc(370px * var(--ui-scale, 1)), calc(100% - 16px)); }
.vw-head, .vw-body, .vwin .divider, #peek, #toasts, #hint, #journal-drawer .side-head, #journal { zoom: var(--ui-scale, 1); }

/* ---------- Phones and short windows: the verb window is a sheet from the bottom, the tools are art. */
@media (max-height: 520px), (max-width: 980px) {
  .vwin { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-width: none; max-height: 78%; border-bottom-width: 0; padding-bottom: calc(10px + var(--sa-b)); }
  .vwin::before { bottom: 0; }
  .end-box .banner { margin: 2px 0 8px; }
  .end-box .banner span { font-size: 18px; padding: 0 22px; border-width: 12px 24px; }
  .end-box .plate-btn { font-size: 11px; padding: 6px 12px; border-width: 10px 20px; }
  .end-box .end-paper { padding: 10px 14px; gap: 12px; }
  .end-box .end-card { width: 150px; }
  .vwin.closing { transform: translateY(12px); }
  @keyframes winIn { from { opacity: 0; transform: translateY(16px); } }
  .slots { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .slot { flex: none; }
  #zoom { top: 10px; right: 10px; bottom: auto; }
  #zoom button.tool-art { width: 34px; padding: 0; font-size: 0; border: none; border-radius: 6px; background: var(--i) center / 100% 100% no-repeat; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6)); }
  /* Undo's arrow points back the way an Arabic line reads. */
  [dir=rtl] #zoom button.tool-art[data-tool=undo] { transform: scaleX(-1); }
  #zoom .tool-gap { width: 2px; }
  /* Toasts grow up from the bottom-right over the empty felt, two at most. With the sheet open, the newest alone
     sits just above the sheet's top (the sheet is at most 78% of the table under the 44px bar), never on its head. */
  #toasts { top: auto; bottom: calc(12px + var(--sa-b)); }
  #toasts .toast:nth-last-child(n+3) { display: none; }
  body.has-window #toasts { right: calc(12px + var(--sa-r)); bottom: calc(78% - 28px - 0.78 * var(--sa-t)); }
  body.has-window #toasts .toast:not(:last-child) { display: none; }
  #hint { max-width: 44%; }
  /* The edge marks keep to the felt: under an open sheet or the dossier they would sit on what is being read. */
  body.has-window .edge-mark, #peek.open ~ .edge-mark { display: none; }
  /* Zoomed out, the clocks that decide life and death stay readable: --zk (js/ui.js, in steps) grows the time,
     the count and the ring as the board shrinks, to about 10px on the screen at the farthest fit. */
  .card .c-time { font-size: calc(12px * var(--zk, 1)); }
  .card .c-count { font-size: calc(12px * var(--zk, 1)); line-height: calc(24px * var(--zk, 1)); }
  .card .c-ringsvg rect { stroke-width: calc(4px * var(--zk, 1)); }
  .verb .v-status { font-size: calc(13px * var(--zk, 1)); }
  /* The pile's tab, the one handle that is always above the cards, keeps a finger's size the same way. */
  #board .pile-zone .pz-tab { width: calc(34px * var(--zk, 1)); height: calc(38px * var(--zk, 1)); top: calc(8px - 38px * var(--zk, 1)); }
  .menu-box { max-width: 600px; }
  #menu .row.column { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  #menu .plate-btn { font-size: 12px; padding: 2px 12px; }
}
/* A short window (a phone on its side): nothing fits above the sheet, so the one toast sits top-left under the bar, away from
   the sheet's eye and X (top-right in English, top-left in Arabic). The table's tools (zoom, Tidy, Stack, Collect, Undo) take
   the other top corner, so a toast never lies over them. The title's plates go two abreast so Install and the
   language button stay on the screen. */
@media (max-height: 520px) {
  body.has-window #toasts { right: auto; left: calc(12px + var(--sa-l)); top: calc(var(--sa-t) + 56px); bottom: auto; }
  [dir=rtl] body.has-window #toasts { left: auto; right: calc(12px + var(--sa-r)); }
  /* Arabic lines stand taller: two of them, not three, so the toast ends above the sheet's head (the Journal keeps the whole). */
  [dir=rtl] body.has-window #toasts .toast span { -webkit-line-clamp: 2; }
  [dir=rtl] #zoom { right: auto; left: 10px; }
  .title-scene .title-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px; left: 20%; width: 60%; top: 27%; }
  .title-scene .title-buttons .plate-btn { font-size: 11px; letter-spacing: 0.08em; padding: 2px 8px; border-width: 10px 20px; gap: 6px; }
  .title-scene .title-buttons .plate-btn .mi { width: 22px; height: 22px; margin: -4px 0; }
  #menu .plate-btn { border-width: 10px 20px; }
  /* Help, Settings, the Watch-house and the Rolls: a slim banner and button row, so the paper keeps the height. */
  .screen-box.wide { padding: 4px 16px 10px; }
  .screen-box.wide > .banner { margin: 0 0 6px; }
  .screen-box.wide > .banner span { font-size: 18px; padding: 0 22px; border-width: 10px 20px; letter-spacing: 0.12em; }
  .screen-box.wide .lead { font-size: 12px; margin-bottom: 4px; }
  .screen-box.wide > .row { margin-top: 6px; }
  .screen-box.wide > .row .plate-btn { padding: 2px 14px; border-width: 10px 20px; font-size: 11px; min-height: 0; }
  /* The rooms run in one strip that scrolls sideways, each whole with its price and Petition plate. */
  .precinct-paper { padding: 8px 12px; }
  .precinct-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 270px; overflow-x: auto; padding-bottom: 4px; gap: 10px; }
  .room { min-height: 0; padding: 8px 10px 8px 54px; gap: 4px; }
  .room .rm-icon { left: 8px; top: 8px; width: 38px; height: 38px; }
  .room .rm-desc { font-size: 12px; line-height: 1.3; }
  .room .plate-btn.small { font-size: 11px; padding: 0 12px; border-width: 10px 20px; min-height: 0; }
  /* The Rolls: the cases four abreast beside their record, both scrolling in the paper's height. */
  .archive-body { grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; }
  .archive-grid { grid-template-columns: repeat(4, minmax(0, 104px)); gap: 10px; justify-content: center; }
  .archive-pager { margin-top: 6px; }
  .archive-detail { min-height: 0; padding: 10px 12px 12px; }
  .a-portrait.sealed + .a-seal { top: 29px; right: 14px; }
}
/* A narrow screen held upright: the hint is a strip under the tool row (the opening is taught by it: Health onto
   Attend, open Explore, the sergeant), a few lines at most, tappable like the bar on a desk. After the phone block,
   so it beats the short window's 44% cap. */
@media (max-width: 980px) and (min-height: 521px) {
  /* A sheet rises from the foot: paused, the banner waits up on the felt, under the hint, clear of the sheet. */
  body.has-window #pause-banner { top: 132px; bottom: auto; }
  /* Without a sheet the banner keeps the foot: the toasts grow up from above it, never over 'Tap to resume'. */
  #toasts { bottom: calc(58px + var(--sa-b)); }
  /* Upright, the open Journal is nearly the width of the screen: the toasts wait (the Journal has the stories). */
  body.has-journal #toasts { display: none; }
  #hint { left: 8px; right: 8px; top: 62px; width: auto; max-width: none; transform: none; padding-block: 7px; padding-inline: 54px 16px; text-align: start; font-size: 12px; line-height: 1.25; }
}
/* A phone on its side (the APK's only way): the verbs fill the top of the felt, so the hint docks at the foot, on the
   left, clear of the toasts that grow up from the bottom-right. An open sheet covers it on purpose: the sheet is
   what is being read. */
@media (max-height: 520px) {
  #hint { left: 8px; right: auto; top: auto; bottom: 8px; width: auto; max-width: min(520px, 56%); transform: none; padding-block: 7px; padding-inline: 54px 16px; text-align: start; font-size: 12px; line-height: 1.25; }
  /* Paused, the banner sits in the strip at the top of the felt, left of the tools: the camera keeps that band free
     (js/ui.js toolBand), the hint has the foot, and an open sheet fills the rest. */
  #pause-banner { top: 8px; bottom: auto; }
}
/* A narrow phone: the pause menu in one column; the bar's gaps close so the five meters, the badge and the controls fit 360px. */
@media (max-width: 480px) {
  #menu .row.column { grid-template-columns: 1fr; }
  .title-scene .title-buttons { left: 24%; width: 52%; }
}
@media (max-width: 400px) {
  #topbar { gap: 4px; }
  #meters { gap: 2px; }
}

/* ---- A phone held upright shows half the verbs: a card turns on its side over the felt, and the clock waits (js/ui.js
   UI.upright). The play button below it lets the game go on upright, at the farthest zoom. */
#turn { display: none; position: absolute; inset: 0; z-index: 35; flex-direction: column; align-items: center; justify-content: center; gap: 56px; background: rgba(6, 9, 10, 0.86); }
#table.upright #turn { display: flex; }
#turn .turn-card { width: 116px; height: 168px; border-radius: 8px; background: var(--art-cback-01) center / 100% 100% no-repeat; box-shadow: 0 10px 24px rgba(0, 0, 0, 0.7); animation: turnSide 2.4s ease-in-out infinite; }
#turn #turn-ok { width: 64px; height: 64px; min-width: 64px; }
@keyframes turnSide { 0%, 25% { transform: rotate(0deg); } 55%, 100% { transform: rotate(90deg); } }
@media (prefers-reduced-motion: reduce) { #turn .turn-card { animation: none; transform: rotate(90deg); } }

/* ---- Fingers: every small control is 44px under a coarse pointer; the stack count and the big chips
   get an invisible hit-slop instead, so they look the same (ANDROID.md's 48dp holds at density). */
@media (pointer: coarse) {
  #zoom button, #zoom button.tool-art { width: 44px; height: 44px; }
  #zoom button.tool-word { min-width: 44px; }
  .vw-close, .vw-info, #peek .peek-close, #peek-x, .picker .pk-close, .side-head button, .archive-pager .pg { min-width: 44px; min-height: 44px; }
  .vw-info { background-size: 28px 28px; }
  .chip.big { position: relative; }
  .card .c-count::after, .chip.big::after { content: ''; position: absolute; inset: -10px; }
  #pause-banner .pb-key { display: none; }
  #pause-banner .pb-tap { display: inline; }
  #table.paused #pause-banner { pointer-events: auto; cursor: pointer; }
}
/* A phone's bar keeps its 36px buttons and 30px meters, and each reaches 44px tall under the finger. The meters
   are icons alone there, so nothing spills when they stop clipping. */
@media (pointer: coarse) and (max-width: 980px) {
  .meter { position: relative; overflow: visible; }
  .ctl.dbi::after { content: ''; position: absolute; inset: -4px -1px; }
  .meter::after { content: ''; position: absolute; inset: -7px -2px; }
}

/* ---- Languages. Arabic reads right-to-left in fonts that carry its
   letters; letter-spacing would pull the joined script apart, so it is off. */
/* The language button is a small dark plate with the Aa of the Settings tab, among the painted plates. */
.title-scene .title-buttons .plate-btn.lang { font-size: clamp(10px, 1.1vw, 14px); letter-spacing: 0.06em; }
.title-scene .title-buttons .plate-btn.lang .mi { width: 22px; height: 22px; margin: -4px 0; }
.lang-select { grid-column: 2 / 4; justify-self: end; min-width: 160px; background: #111416; color: var(--paper); border: 2px solid #b8913f; padding: 6px 12px; font-family: inherit; font-size: 14px; }
[dir=rtl] {
  --serif: 'Amiri', 'Noto Naskh Arabic', 'Scheherazade New', 'Traditional Arabic', 'Sakkal Majalla', 'Geeza Pro', 'Tahoma', serif;
  --display: 'Amiri', 'Noto Naskh Arabic', 'Scheherazade New', 'Traditional Arabic', 'Sakkal Majalla', 'Geeza Pro', 'Tahoma', serif;
  --black: 'Amiri', 'Noto Naskh Arabic', 'Scheherazade New', 'Traditional Arabic', 'Sakkal Majalla', 'Geeza Pro', 'Tahoma', serif;
  --mono: 'Amiri', 'Noto Naskh Arabic', 'Tahoma', 'Courier New', monospace;
  --sans: 'Amiri', 'Noto Sans Arabic', 'Noto Naskh Arabic', 'Segoe UI', 'Tahoma', sans-serif;
}
[dir=rtl] body, [dir=rtl] .card, [dir=rtl] .verb, [dir=rtl] .vwin, [dir=rtl] #peek, [dir=rtl] .toast, [dir=rtl] .modal, [dir=rtl] .choice, [dir=rtl] .meter, [dir=rtl] #hint, [dir=rtl] .pile-zone { letter-spacing: 0; }
[dir=rtl] * { letter-spacing: 0 !important; }
/* Arabic needs more height than the capitals it replaces: the card's few words, the verb's plate, the toast's title and the meters' words are set larger and looser. */
[dir=rtl] .card .c-title { font-size: 12.5px; line-height: 1.45; }
[dir=rtl] .verb .v-plate { font-size: 16px; line-height: 1.5; overflow: clip; overflow-clip-margin: 6px; }
[dir=rtl] .verb .v-plate.long { font-size: 14px; }
[dir=rtl] .toast b { font-size: 14.5px; line-height: 1.4; }
/* A word cut to its room keeps the marks above and below its letters (the shadda, the dots under ya): the clip is drawn
   past the tight line by padding, and the padding is taken back by the margin, so nothing moves. */
[dir=rtl] .meter .m-word { font-size: 13.5px; padding-block: 0.35em; margin-block: -0.35em; }
[dir=rtl] .lu-title { line-height: 1.3; }
[dir=rtl] .lu-title .lu-rank { padding-block: 0.35em; margin-block: -0.2em -0.35em; }
[dir=rtl] .meter .m-label { font-size: 11.5px; }
[dir=rtl] .toast span, [dir=rtl] #hint, [dir=rtl] #peek .i-lines { line-height: 1.6; }
/* Arabic has no italic: emphasis is carried by colour, as the help already does. */
[dir=rtl] * { font-style: normal !important; }
[dir=rtl] #topbar .brand { font-size: 19px; }
[dir=rtl] .story p, [dir=rtl] .vw-desc, [dir=rtl] .journal-entry p, [dir=rtl] .modal p, [dir=rtl] #peek p, [dir=rtl] .help-cols p, [dir=rtl] .lead { line-height: 1.75; }
[dir=rtl] .toast.leaving { transform: translateX(20px); }
/* The bars read from the right: the bar and its socket are mirrored, the medallion's icon is not (the hint's eye is the same either way). */
[dir=rtl] .toast::after, [dir=rtl] .toast::before, [dir=rtl] #hint::after, [dir=rtl] #hint::before { transform: scaleX(-1); }
[dir=rtl] .toast .t-icon { background-position: right 8px center; }
[dir=rtl] .recipe .r-blocked { background-position: 100% 50%; }
[dir=rtl] .journal-entry .j-icon { float: right; margin: 2px 0 0 8px; }
[dir=rtl] input[type=text] { direction: rtl; }
[dir=rtl] #name { direction: ltr; text-align: right; }
/* A count alone keeps its sign before its number. */
[dir=rtl] .card .c-count { unicode-bidi: isolate; direction: ltr; }
/* Arabic mirrors the panel side to side only: the X's column and the left edge change places, while the top and the
   foot stay whatever the layout gives them (no foot on a phone's sheet), and the window's own closing slide is kept. */
[dir=rtl] .vwin { border-right-width: calc(20px * var(--ui-scale, 1)); border-left-width: calc(66px * var(--ui-scale, 1)); }
[dir=rtl] .vwin::before { right: calc(-20px * var(--ui-scale, 1)); left: calc(-66px * var(--ui-scale, 1)); border-right-width: calc(66px * var(--ui-scale, 1)); border-left-width: calc(20px * var(--ui-scale, 1)); transform: scaleX(-1); }
[dir=rtl] .vw-body { margin: 0 -10px 0 -46px; padding: 2px 12px 2px 4px; }
/* The mirrored bar's bright bevel runs just past the icon: the Arabic title, smaller than the capitals, steps clear of it onto the dark. */
[dir=rtl] .vw-head h3 { padding-inline-start: 10px; font-size: 16px; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
[dir=rtl] .vw-close { right: auto; left: -54px; }
/* The speed buttons are a player's controls, read left to right in every language (their arrows point that way);
   the Main Menu's back arrow points the way an Arabic line reads. */
[dir=rtl] #controls .speed { direction: ltr; }
[dir=rtl] #m-title .mi { transform: scaleX(-1); }
