/* Dragon World: the one set of design tokens and parts for every page and overlay around the game (docs/ui/DESIGN.md).
   Loaded by one-world.html and dragon-world.html, and by src/ui/tokens.js for pages that do not link it. */
:root {
  /* space, 4-based */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px;
  --pad: var(--s4);                                   /* every panel's padding */
  /* corners: small labels, buttons and fields, panels and cards */
  --r1: 3px; --r2: 4px; --r3: 6px;
  /* colour */
  --ink: #0b1019; --panel: rgba(12, 17, 27, .9); --panel-solid: #0f1521; --line: rgba(255, 255, 255, .14); --line-strong: rgba(255, 255, 255, .32);
  --text: #f2f0e9; --text-2: #c4cbd6; --text-3: #9ba6b6; --paper: #f2f0e9; --on-paper: #10141c;
  --gold: #f0b35a; --gold-tint: rgba(240, 179, 90, .16); --ember: #ffb347; --danger: #e9584a; --danger-text: #ff9a84;
  --tint: rgba(255, 255, 255, .07); --tint-hover: rgba(255, 255, 255, .13); --veil: rgba(6, 9, 15, .62);
  /* type */
  --f-display: "Space Grotesk", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-text: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --t1: 12px; --t2: 13px; --t3: 15px; --t4: 18px; --t5: 24px;
  /* sizes */
  --touch: 44px; --main: 52px;
  /* motion */
  --m1: 120ms; --m2: 220ms; --m3: 420ms; --ease: cubic-bezier(.2, .7, .2, 1);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px); --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --edge-l: max(var(--s4), var(--safe-l)); --edge-r: max(var(--s4), var(--safe-r)); --edge-t: max(var(--s3), var(--safe-t)); --edge-b: max(var(--s3), var(--safe-b));
}
@media (max-height: 480px) { :root { --pad: var(--s3); } }
@media (prefers-reduced-motion: reduce) { :root { --m1: 0ms; --m2: 0ms; --m3: 0ms; } }

/* ---- parts --------------------------------------------------------------------------------------------------------- */
.ui-panel { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--pad);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2); box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
  font: 500 var(--t2)/1.4 var(--f-text); box-sizing: border-box; pointer-events: auto; }
.ui-panel *, .ui-panel *::before, .ui-panel *::after { box-sizing: border-box; }
.ui-head { display: flex; align-items: center; gap: var(--s2); min-height: var(--touch); margin: calc(var(--s1) * -1) 0 var(--s2); }
.ui-head h2, .ui-head h3, .ui-title { margin: 0; font: 600 var(--t4)/1.2 var(--f-display); letter-spacing: -.01em; color: var(--text); flex: 1; min-width: 0; }
.ui-label { margin: 0 0 var(--s2); font: 600 var(--t1)/1.3 var(--f-text); color: var(--text-3); letter-spacing: .02em; }
.ui-quiet { color: var(--text-3); font-weight: 400; }
.ui-err { color: var(--danger-text); }

/* every button outside the four round touch controls */
.ui-btn, .ui-panel button, #pu-top button, .ui-panel label.btn {
  position: static; display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: var(--touch); min-width: var(--touch); padding: 0 var(--s3); margin: 0;
  font: 600 var(--t2)/1.1 var(--f-text); color: var(--text); background: var(--tint); border: 1px solid transparent; border-radius: var(--r2);
  cursor: pointer; pointer-events: auto; opacity: 1; transform: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: background var(--m1) var(--ease), border-color var(--m1) var(--ease), transform var(--m1) var(--ease), opacity var(--m2); }
.ui-btn:hover, .ui-panel button:hover, #pu-top button:hover, .ui-panel label.btn:hover { background: var(--tint-hover); }
.ui-btn:active, .ui-panel button:active, #pu-top button:active, .ui-panel label.btn:active { transform: scale(.985); }
.ui-panel button:disabled, .ui-btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.ui-panel button.pick, .ui-panel button[aria-pressed="true"], #pu-top button.on { background: var(--gold-tint); border-color: var(--gold); color: var(--text); }
.ui-panel .ui-main, .ui-main { min-height: var(--main); padding: 0 var(--s5); background: var(--paper); color: var(--on-paper); font: 700 var(--t3)/1 var(--f-text); border-color: var(--paper); }
.ui-panel .ui-main:hover, .ui-main:hover { background: #fffdf6; }
.ui-panel .ui-ghost { background: transparent; border-color: var(--line-strong); }
.ui-panel .ui-close, .ui-close { width: var(--touch); padding: 0; background: transparent; flex: none; }
.ui-close::before { content: ""; width: 18px; height: 18px; background: currentColor;
  -webkit-mask: var(--i-close) center / contain no-repeat; mask: var(--i-close) center / contain no-repeat; }
:where(.ui-panel, #pu-top, #boot) :focus { outline: none; }
:where(.ui-panel, #pu-top, #boot, .lb-card) :focus-visible, .ui-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ui-panel input[type=text] { font: 500 var(--t3)/1.2 var(--f-text); color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line-strong);
  border-radius: var(--r2); min-height: var(--touch); padding: 0 var(--s3); min-width: 0; width: 100%; user-select: text; -webkit-user-select: text; }
.ui-panel input[type=text]::placeholder { color: var(--text-3); }
.ui-panel input[type=text]:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
.ui-panel input[type=range] { accent-color: var(--gold); min-height: var(--touch); }

/* the segmented choice: a row of 44-tall buttons in a 1 px frame, the picked one in gold tint (a four-step switch: Off,
   Low, Mid, Full; Settings' rows; .ui-seg-wide: the Controls view's device tabs) */
.ui-seg { display: inline-flex; align-items: center; gap: var(--s2); }
.ui-seg-label { font: 600 var(--t1)/1 var(--f-text); color: var(--text-3); min-width: 3.6em; }
.ui-seg-row { display: inline-flex; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: var(--r2); padding: 2px; gap: 2px; }
.ui-panel .ui-seg-row button { min-width: 44px; padding: 0 var(--s2); min-height: var(--touch); font-size: var(--t1); background: transparent; border-radius: var(--r1); }
.ui-panel .ui-seg-row button.pick, .ui-panel .ui-seg-row button[aria-selected="true"] { background: var(--gold-tint); border-color: var(--gold); }
.ui-panel .ui-seg-row.ui-seg-wide button { padding: 0 var(--s3); font-size: var(--t2); }

/* toasts (the rooms messages and the big centre line are notices since batch 4: docs/ui/NOTICES.md) */
.ui-toast {
  background: rgba(8, 12, 20, .72); color: var(--text); border-radius: var(--r3); padding: var(--s2) var(--s3);
  font: 500 var(--t2)/1.35 var(--f-text); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); text-shadow: none; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }

/* icons (thin line, drawn as masks so they take the text colour) */
:root {
  --i-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E");
  --i-help: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2.5' y='6' width='19' height='12' rx='2.5'/%3E%3Cpath d='M6 10h2M10 10h2M14 10h2M18 10h0M7 14h10'/%3E%3C/svg%3E");
  --i-music: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 18V5l11-2v13'/%3E%3Ccircle cx='6.5' cy='18' r='2.5'/%3E%3Ccircle cx='17.5' cy='16' r='2.5'/%3E%3C/svg%3E");
  --i-sound: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5h3.5L12 5.5v13l-4.5-4H4z'/%3E%3Cpath d='M15.5 9a4.5 4.5 0 0 1 0 6M18 6.5a8 8 0 0 1 0 11'/%3E%3C/svg%3E");
  --i-mute: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9.5h3.5L12 5.5v13l-4.5-4H4z'/%3E%3Cpath d='M16 9.5l5 5M21 9.5l-5 5'/%3E%3C/svg%3E");
  --i-rooms: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8.5' r='3.2'/%3E%3Cpath d='M3 19c.6-3.3 3-5.2 6-5.2s5.4 1.9 6 5.2'/%3E%3Cpath d='M15.5 5.6a3.2 3.2 0 0 1 0 6M17.5 14.2c1.8.7 3 2.4 3.4 4.8'/%3E%3C/svg%3E");
  --i-time: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7v5l3.2 2'/%3E%3C/svg%3E");
  --i-full: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9V4h5M15 4h5v5M20 15v5h-5M9 20H4v-5'/%3E%3C/svg%3E");
  --i-unfull: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 4v5H4M20 9h-5V4M15 20v-5h5M4 15h5v5'/%3E%3C/svg%3E");
  --i-set: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h8M17 7h3M4 12h2M11 12h9M4 17h10M19 17h1'/%3E%3Ccircle cx='14.5' cy='7' r='2.2'/%3E%3Ccircle cx='8.5' cy='12' r='2.2'/%3E%3Ccircle cx='16.5' cy='17' r='2.2'/%3E%3C/svg%3E");
  --i-map: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6.5l6-2.5 6 2.5 6-2.5v13.5l-6 2.5-6-2.5-6 2.5z'/%3E%3Cpath d='M9 4v13.5M15 6.5V20'/%3E%3C/svg%3E");
  --i-heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 20.5 4.2 12.9a5 5 0 0 1 7.1-7.1l.7.7.7-.7a5 5 0 0 1 7.1 7.1z'/%3E%3C/svg%3E");
  --i-flame: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12.5 2c.6 3.4 5.5 6.3 5.5 11.5a6 6 0 0 1-12 0c0-2.6 1.3-4.4 2.7-5.6-.1 1.9.6 3.2 1.8 3.8C10 8.3 11 5 12.5 2z'/%3E%3C/svg%3E");
  --i-bolt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M13.5 2 4.5 13.5h6L9.5 22l9-11.5h-6z'/%3E%3C/svg%3E");
}

/* ---- the play-screen kit (docs/ui/DESIGN.md "Play-screen kit"; every widget in its states: kit.html) -------------------
   Every widget of the play screen is defined once, with the tokens above and below; a part that needs one uses its class,
   or is named in its selector, instead of drawing its own. The owner's rule (2026-11-20): see-through, small, at the
   sides, never blocking the view; a plate only on what can be tapped.
     Panel .ui-panel · Main button .ui-main · Second button .ui-btn / .ui-ghost · Icon button .ui-icon (--ic), .ui-close
     (the parts, above) · Segmented choice .ui-seg-row (above) · Glass --glass · Chip .ui-chip · Switch .ui-switch ·
     Touch button .pu-touch · Key cap .ui-key · Edge glow .ui-glow (here) · Fold menu tile #pu-top button (the top
     buttons, the lighter play screen) · Meter line .st-row .bar · Dots .ui-dots (the status block) · Ring meter .hl on a
     touch button (the lighter play screen) · Notice line, Choice, Mark .nt-* (on-screen notices, at the end) */
:root {
  /* glass: the see-through fill of what can be tapped in play (the Menu and its tiles, the chips, the old status panel) */
  --glass: rgba(10, 14, 22, .5); --glass-hover: rgba(20, 26, 38, .7); --glass-line: rgba(255, 255, 255, .22); --glass-blur: blur(8px);
  /* touch buttons: round, a light line, a see-through fill, the word in 13 px 600; held: the ember tint */
  --tb-line: rgba(255, 255, 255, .6); --tb-fill: rgba(20, 20, 26, .38); --ember-held: rgba(255, 170, 60, .6);
  --tb-flame: 92px; --tb-ball: 74px; --tb-boost: 68px; --tb-land: 62px; --tb-small: 56px; --tb-grab: 64px;     /* Land on the lighter screen, Turn: small; Grab, Dive: grab */
  /* meters: the track under a line, the water's colour (the breath line, Dive) */
  --meter-track: rgba(255, 255, 255, .16); --meter-track-bare: rgba(255, 255, 255, .24); --water: #8fe3f0;
  /* the edge glow: red when hurt; a land's colour when singed (set --glow) */
  --glow-hurt: rgba(220, 40, 20, .7);
  /* the drawings in panels (Controls, the Home Screen guide): thin lines in the text colour, gold on what to hold or tap */
  --draw-line: rgba(242, 240, 233, .55); --draw-dim: rgba(242, 240, 233, .22); --draw-quiet: #aab3c1; --draw-fill: rgba(255, 255, 255, .06); --draw-glow: rgba(240, 179, 90, .18);
}
/* Icon button: a 20 px thin-line icon by mask (--ic), in the text colour; square (44) when it has no word */
.ui-icon::before, #pu-top button::before, #pn-box :is(.lb-help, .lb-full, .lb-set)::before { content: ""; width: 20px; height: 20px; flex: none; background: currentColor;
  -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; }
.ui-icon.ui-square { width: var(--touch); padding: 0; gap: 0; font-size: 0; }
/* Chip: glass, corner 6, 36 tall in a 44 hit area, 12 px words with tabular numbers; pressed: gold tint and line.
   The gold chip (the overdrive Lock, src/speed.js) has a gold line and, pressed (locked on), a gold fill */
.ui-chip, #play-ui #pu-lock { display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); box-sizing: border-box; min-height: 36px; min-width: var(--touch); padding: 0 10px;
  border: 1px solid var(--glass-line); border-radius: var(--r3); background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--text); font: 600 var(--t1)/1.2 var(--f-text); font-variant-numeric: tabular-nums; cursor: pointer; pointer-events: auto; touch-action: manipulation; }
.ui-chip { position: relative; } .ui-chip::after { content: ""; position: absolute; inset: -4px 0; }      /* the 44 hit area */
.ui-chip b { font-size: var(--t2); }
.ui-chip[aria-pressed="true"] { background: var(--gold-tint); border-color: var(--gold); }
.ui-chip.gold, #play-ui #pu-lock { border-color: var(--gold); }
.ui-chip.gold[aria-pressed="true"], #play-ui #pu-lock[aria-pressed="true"] { background: var(--gold); color: var(--on-paper); }
/* Switch: on or off; the word says it, a 40 by 22 track shows it, gold when on */
:is(.ui-switch, #ui-settings .st-switch) { flex: none; gap: var(--s2); padding: 0 var(--s1) 0 var(--s2); background: transparent; color: var(--text-2); font-size: var(--t1); }
:is(.ui-switch, #ui-settings .st-switch) i { position: relative; flex: none; width: 40px; height: 22px; border-radius: 11px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line-strong);
  transition: background var(--m2) var(--ease), border-color var(--m2) var(--ease); }
:is(.ui-switch, #ui-settings .st-switch) i::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2);
  transition: transform var(--m2) var(--ease), background var(--m2) var(--ease); }
:is(.ui-switch, #ui-settings .st-switch)[aria-checked="true"] { color: var(--text); }
:is(.ui-switch, #ui-settings .st-switch)[aria-checked="true"] i { background: var(--gold-tint); border-color: var(--gold); }
:is(.ui-switch, #ui-settings .st-switch)[aria-checked="true"] i::after { transform: translateX(18px); background: var(--gold); }
/* Touch button: round, a light line, a see-through fill; sizes --tb-*; the places are set by src/play/buttons.js and the
   parts; held: the ember tint; with keys or a pad (pointer: fine) quieter and 0.8 from the bottom right corner */
#play-ui .pu-touch { position: absolute; pointer-events: auto; border: 2px solid var(--tb-line); background: var(--tb-fill); color: #fff; border-radius: 50%; font: inherit; touch-action: none; }
#play-ui .pu-touch.on { background: var(--ember-held); }
@media (pointer: fine) { #play-ui .pu-touch { opacity: .55; transform: scale(.8); transform-origin: bottom right; } }
/* the steering thumb: where the left thumb went down, and where it is now */
#play-ui #pu-base, #play-ui #pu-knob { position: absolute; border-radius: 50%; display: none; transform: translate(-50%, -50%); }
#play-ui #pu-base { width: 130px; height: 130px; border: 2px solid rgba(255, 255, 255, .45); background: rgba(255, 255, 255, .08); }
#play-ui #pu-knob { width: 56px; height: 56px; background: rgba(255, 255, 255, .55); }
/* Key cap: 1 px line, 2 px base, corner 3, 11 px 600 (in a panel; on the world the notices' kbd.nt-key, darker) */
.ui-key { display: inline-block; min-width: 1.7em; padding: 0 5px; margin-right: 2px; box-sizing: border-box; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: var(--r1);
  font: 600 11px/1.5 var(--f-text); text-align: center; color: var(--text); background: rgba(255, 255, 255, .06); }
/* Edge glow: an inset glow round the screen, shown with .on; red when hurt, a land's colour (--glow) when singed; it
   holds steady under reduced motion */
.ui-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0; box-shadow: inset 0 0 80px 22px var(--glow, var(--glow-hurt)); transition: opacity var(--m2) var(--ease); }
.ui-glow.on { opacity: 1; }

/* ---- the loading screen ----------------------------------------------------------------------------------------- */
#boot { position: fixed; inset: 0; z-index: 50; overflow: hidden; background: var(--ink) var(--hero-tiny, none) center / cover no-repeat; color: var(--text); font: 500 var(--t3)/1.45 var(--f-text);
  transition: opacity var(--m3) var(--ease); }
#boot.done { opacity: 0; pointer-events: none; }
#boot .bt-bg { position: absolute; inset: -2%; background: var(--hero-tiny) center / cover no-repeat; filter: blur(18px); transform: scale(1.04); }
#boot .bt-pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; opacity: 0; transition: opacity var(--m3) var(--ease); }
#boot .bt-pic.in { opacity: 1; }
#boot .bt-veil { position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(6, 10, 18, .58) 0%, rgba(6, 10, 18, .2) 30%, rgba(6, 10, 18, 0) 46%, rgba(6, 10, 18, 0) 56%, rgba(6, 10, 18, .84) 100%),
              linear-gradient(90deg, rgba(6, 10, 18, .5) 0%, rgba(6, 10, 18, .18) 40%, rgba(6, 10, 18, 0) 62%); }
#boot .bt-top { position: absolute; left: calc(var(--edge-l) + var(--s4)); right: var(--edge-r); top: calc(var(--edge-t) + clamp(8px, 4vh, 48px)); }
#boot .bt-kicker { margin: 0 0 var(--s2); font: 600 var(--t1)/1 var(--f-text); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
#boot h1 { margin: 0; font: 700 clamp(40px, 7.4vw, 96px)/.92 var(--f-display); letter-spacing: -.035em; color: #fffaf0; text-shadow: 0 2px 30px rgba(10, 16, 30, .45), 0 1px 2px rgba(10, 16, 30, .4); }
#boot .bt-line { margin: var(--s3) 0 0; max-width: 34ch; font: 500 clamp(15px, 1.5vw, 19px)/1.4 var(--f-text); color: #f4efe4; text-shadow: 0 1px 10px rgba(6, 10, 18, .7), 0 0 2px rgba(6, 10, 18, .5); }
#boot .bt-foot { position: absolute; left: calc(var(--edge-l) + var(--s4)); right: calc(var(--edge-r) + var(--s4)); bottom: calc(var(--edge-b) + clamp(12px, 5vh, 56px)); max-width: 560px; }
#boot .bt-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); margin-bottom: var(--s2); font: 500 var(--t2)/1.3 var(--f-text); }
#boot .bt-stage { color: var(--text); font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#boot .bt-num { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
#boot .bt-bar { position: relative; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .18); overflow: hidden; }
#boot .bt-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, #f6c56f, var(--gold)); border-radius: 2px; transition: transform var(--m2) linear; }
#boot .bt-note { margin: var(--s2) 0 0; color: var(--text-2); font: 400 var(--t1)/1.4 var(--f-text); min-height: 1.4em; }
#boot .bt-turn { display: none; margin-top: var(--s3); align-items: center; gap: var(--s2); color: var(--text); font: 600 var(--t2)/1.3 var(--f-text); }
#boot .bt-turn::before { content: ""; width: 22px; height: 22px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2.5' width='10' height='19' rx='2'/%3E%3Cpath d='M2.5 15a7 7 0 0 0 5 5M21.5 9a7 7 0 0 0-5-5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='7' y='2.5' width='10' height='19' rx='2'/%3E%3Cpath d='M2.5 15a7 7 0 0 0 5 5M21.5 9a7 7 0 0 0-5-5'/%3E%3C/svg%3E") center / contain no-repeat; }
@media (orientation: portrait) and (pointer: coarse) { #boot .bt-turn { display: flex; } }
#boot .bt-fail { display: none; }
#boot.failed .bt-progress { display: none; }
#boot.failed .bt-fail { display: block; }
#boot .bt-fail h2 { margin: 0 0 var(--s1); font: 600 var(--t4)/1.25 var(--f-display); color: var(--text); }
#boot .bt-fail p { margin: 0 0 var(--s3); color: var(--text-2); font-size: var(--t2); }
#boot .bt-fail .bt-why { color: var(--text-3); font-size: var(--t1); margin-top: var(--s3); margin-bottom: 0; word-break: break-word; }
@media (max-height: 480px) {
  #boot .bt-top { top: calc(var(--edge-t) + var(--s3)); }
  #boot .bt-line { margin-top: var(--s2); }
  #boot .bt-foot { bottom: calc(var(--edge-b) + var(--s3)); }
}

/* ---- the game's top buttons ------------------------------------------------------------------------------------- */
#pu-top { position: absolute; top: var(--edge-t); right: var(--edge-r); display: flex; gap: var(--s2); pointer-events: none; z-index: 2; }
#pu-top button { background: var(--glass); border: 1px solid var(--glass-line); color: var(--text); padding: 0 var(--s3) 0 10px;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); font-weight: 600; }        /* a fold menu tile: glass; its icon: the kit's Icon button */
#pu-top button:hover { background: var(--glass-hover); }
#pu-help { --ic: var(--i-help); order: 1; } #pu-music { --ic: var(--i-music); order: 2; } #pu-snd { --ic: var(--i-sound); order: 3; }
#pu-set { --ic: var(--i-set); order: 1; } #pn-roombtn { --ic: var(--i-rooms); order: 4; } #pu-mapbtn { --ic: var(--i-map); order: 5; } #pu-time { --ic: var(--i-time); order: 0; } #pu-full { --ic: var(--i-full); order: 6; } #pu-full[data-on="1"] { --ic: var(--i-unfull); }
#play-ui #pu-snd.off { opacity: 1; text-decoration: none; --ic: var(--i-mute); color: var(--text-3); }
@media (max-width: 899px) {                    /* icons only: the words stay as the buttons' names */
  #pu-top button { font-size: 0; padding: 0; width: var(--touch); gap: 0; }   /* no gap beside the hidden word, so the icon sits in the middle */
}
@media (min-width: 900px) and (max-width: 1119px) {   /* a row of seven or more (Settings, Modes and the rest switched on) needs 1,090 px for its words */
  #pu-top:has(> button:nth-child(7)) button { font-size: 0; padding: 0; width: var(--touch); gap: 0; }
}

/* ---- Map ---------------------------------------------------------------------------------------------------------- */
#pu-map { position: absolute; inset: 0; z-index: 10; background: var(--veil); display: flex; align-items: center; justify-content: center; pointer-events: auto; padding: var(--edge-t) var(--edge-r) var(--edge-b) var(--edge-l); }
#pu-map[hidden] { display: none; }
#pu-mapbox { display: flex; gap: var(--pad); align-items: stretch; max-height: 100%; max-width: 100%; }
#pu-mapcv { width: min(calc(100vh - 56px), 60vw); height: min(calc(100vh - 56px), 60vw); border-radius: var(--r2); border: 1px solid var(--line); touch-action: none; display: block; flex: none; cursor: crosshair; }
#pu-maprow { display: flex; flex-direction: column; gap: var(--s2); min-width: 168px; max-width: 220px; min-height: 0; }
#pu-maprow .ui-head { margin-bottom: 0; }
#pu-maptip { color: var(--text-3); font-size: var(--t1); font-weight: 400; margin: 0; }
#pu-places { display: flex; flex-direction: column; gap: var(--s1); overflow-y: auto; overflow-x: hidden; min-height: 0; flex: 1; }
#play-ui #pu-places button { justify-content: flex-start; min-height: var(--touch); font-weight: 500; text-align: left; flex: none; }
#pu-maplock { color: var(--danger-text); font-size: var(--t1); min-height: 0; }
#pu-maplock:empty { display: none; }
@media (max-height: 480px) { #pu-mapcv { width: min(calc(100vh - 40px), 58vw); height: min(calc(100vh - 40px), 58vw); } }

/* ---- Music -------------------------------------------------------------------------------------------------------- */
#mu-panel { position: fixed; right: var(--edge-r); top: calc(var(--edge-t) + 56px); width: min(340px, calc(100vw - 32px)); max-height: calc(100vh - var(--edge-t) - 68px); overflow: auto; z-index: 30; user-select: none; -webkit-user-select: none; }
#mu-panel[hidden] { display: none; }
#mu-list { display: flex; flex-direction: column; gap: var(--s1); }
#mu-list button { justify-content: flex-start; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
#mu-list small { color: var(--text-3); }
#mu-panel .mu-row { display: flex; gap: var(--s2); margin-top: var(--s3); flex-wrap: wrap; align-items: center; }
#mu-panel .mu-row > * { flex: 1; }
#mu-panel .mu-vol span { flex: none; color: var(--text-3); font-size: var(--t1); font-weight: 600; }
#mu-panel small.mu-note { display: block; margin-top: var(--s3); color: var(--text-3); font-weight: 400; font-size: var(--t1); }
#mu-panel input[type=file] { display: none; }
#mu-panel input[type=range] { flex: 1; min-width: 120px; }

/* ---- the lobby ---------------------------------------------------------------------------------------------------- */
#pn-lobby { position: absolute; inset: 0; z-index: 20; display: flex; align-items: stretch; justify-content: flex-start; pointer-events: auto; font: 500 var(--t2)/1.4 var(--f-text); color: var(--text);
  background: linear-gradient(90deg, rgba(6, 9, 15, .66) 0%, rgba(6, 9, 15, .4) 46%, rgba(6, 9, 15, .08) 100%); }
#pn-lobby[hidden] { display: none; }
#pn-box { position: relative; display: flex; flex-direction: column; width: min(680px, 100%); height: 100%; max-height: none; border-radius: 0; border-width: 0 1px 0 0;
  padding: 0; background: rgba(10, 14, 22, .86); overflow: hidden; }
#pn-box .lb-head { display: flex; align-items: center; gap: var(--s3); padding: calc(var(--edge-t) + var(--s1)) var(--pad) var(--s2) calc(var(--edge-l) + var(--s1)); }
#pn-box .lb-head h2 { margin: 0; flex: 1; min-width: 0; font: 700 clamp(26px, 3.2vw, 36px)/1 var(--f-display); letter-spacing: -.03em; color: #fffaf0; }
#pn-box .lb-head p { margin: var(--s1) 0 0; color: var(--text-2); font-size: var(--t2); font-weight: 400; }
#pn-box .lb-help { --ic: var(--i-help); }
#pn-box .lb-body { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: var(--s2) var(--pad) var(--pad) calc(var(--edge-l) + var(--s1)); display: flex; flex-direction: column; gap: var(--s5); overscroll-behavior: contain; }
#pn-box .lb-foot { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) var(--pad) calc(var(--edge-b) + var(--s1)) calc(var(--edge-l) + var(--s1)); border-top: 1px solid var(--line); background: rgba(10, 14, 22, .92); }
#pn-box .lb-sum { flex: 1; min-width: 0; font: 600 var(--t3)/1.25 var(--f-text); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pn-box .lb-sum small { display: block; font: 400 var(--t1)/1.3 var(--f-text); color: var(--text-3); }
#pn-box .lb-foot .ui-main { min-width: 140px; }
#pn-box section { margin: 0; }
#pn-box section > .ui-label { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); }
/* dragons and name: one row of equal dragon cards (two to five share the width), the name on its own row under them */
#pn-box .lb-you { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: stretch; }
#pn-box .lb-you > .lb-dragon { flex: 1 1 0; min-width: 0; }
#pn-box .lb-dragon b, #pn-box .lb-dragon small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pn-box .lb-name { flex: 1 1 100%; display: flex; flex-direction: column; justify-content: center; gap: var(--s1); padding: 0; }
#pn-box .lb-name > input { max-width: 340px; }
#pn-box .lb-name-hint { color: var(--text-3); font-size: var(--t1); font-weight: 400; }
#pn-box .lb-name label { font: 600 var(--t1)/1.3 var(--f-text); color: var(--text-3); }
/* picture cards */
#pn-box .lb-card { position: relative; display: flex; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 0; padding: 0; min-height: 0; overflow: hidden;
  background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: var(--r3); text-align: left; color: var(--text); font-weight: 500; }
#pn-box .lb-card:hover { background: rgba(255, 255, 255, .09); border-color: var(--line-strong); }
#pn-box .lb-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: #1a2230; transition: transform var(--m3) var(--ease); }
#pn-box .lb-card:hover img { transform: scale(1.03); }
#pn-box .lb-card .lb-cap { display: block; padding: var(--s2) var(--s2) var(--s2); }
#pn-box .lb-card b { display: block; font: 600 var(--t2)/1.25 var(--f-text); color: var(--text); }
#pn-box .lb-card small { display: block; margin-top: 2px; font: 400 var(--t1)/1.3 var(--f-text); color: var(--text-3); }
#pn-box .lb-card.pick { border-color: var(--gold); background: var(--gold-tint); box-shadow: inset 0 0 0 1px var(--gold); }
#pn-box .lb-card.pick b::after { content: ""; display: inline-block; width: 7px; height: 7px; margin-left: 6px; border-radius: 50%; background: var(--gold); vertical-align: 2px; }
#pn-box .lb-dragon img { aspect-ratio: 4 / 3; }
#pn-box .lb-places { display: flex; gap: var(--s2); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; padding: 2px 2px var(--s2); margin: -2px -2px 0;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; overscroll-behavior-x: contain; }
#pn-box .lb-places .lb-card { flex: 0 0 clamp(150px, 27%, 196px); scroll-snap-align: start; }
#pn-box .lb-places .lb-card.noimg { justify-content: center; min-height: var(--main); }
/* rooms */
#pn-box #pn-count { margin: 0 0 var(--s2); font-size: var(--t2); }
#pn-box .lb-rooms-quiet { margin: 0; color: var(--text-3); font-size: var(--t2); font-weight: 400; }
#pn-rooms { display: flex; flex-direction: column; gap: var(--s1); max-height: 30vh; overflow: auto; margin-bottom: var(--s2); }
#pn-rooms:empty { display: none; }
#pn-rooms .rm { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: var(--r2); padding: 2px 2px 2px var(--s3); }
#pn-rooms .rm span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#pn-rooms .lb-none { color: var(--text-2); font-weight: 400; padding: var(--s1) 0; }
#pn-box .lb-code { display: flex; gap: var(--s2); align-items: center; }
#pn-box .lb-code input { flex: 1; }
#pn-box .lb-in { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; margin-bottom: var(--s2); padding: var(--s2) var(--s2) var(--s2) var(--s3); border: 1px solid var(--gold); border-radius: var(--r3); background: var(--gold-tint); }
#pn-code { font: 700 var(--t5)/1 var(--f-display); letter-spacing: .02em; color: var(--gold); user-select: text; -webkit-user-select: text; }
#pn-box .lb-in .ui-quiet { flex: 1; min-width: 8em; }
#pn-note { color: var(--text-3); font-size: var(--t1); font-weight: 400; margin: var(--s2) 0 0; }
#pn-note:empty, #pn-err:empty { display: none; }
#pn-err { color: var(--danger-text); font-size: var(--t2); margin: var(--s2) 0 0; }
/* rooms with records (src/parts/rooms.js): the list, join by code, the form to make a room */
#pn-rooms[hidden], #pn-box .lb-code[hidden], #rm-wrap[hidden], #rm-form[hidden], #rm-wrap [hidden] { display: none; }
.ui-panel input[type=password] { font: 500 var(--t3)/1.2 var(--f-text); color: var(--text); background: rgba(255, 255, 255, .06); border: 1px solid var(--line-strong);
  border-radius: var(--r2); min-height: var(--touch); padding: 0 var(--s3); min-width: 0; width: 100%; user-select: text; -webkit-user-select: text; }
.ui-panel input[type=password]::placeholder { color: var(--text-3); }
.ui-panel input[type=password]:focus-visible { outline: 2px solid var(--gold); outline-offset: 0; border-color: transparent; }
#rm-wrap { display: flex; flex-direction: column; gap: var(--s2); }
#rm-list { display: flex; flex-direction: column; gap: var(--s1); max-height: 30vh; overflow: auto; }
#rm-list .rm { display: flex; gap: var(--s2); align-items: center; justify-content: space-between; background: rgba(255, 255, 255, .05); border: 1px solid var(--line); border-radius: var(--r2); padding: 2px 2px 2px var(--s3); }
#rm-list .rm span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-weight: 400; }
#rm-list .rm b { color: var(--text); font-weight: 600; }
#rm-list .lb-none { color: var(--text-2); font-weight: 400; padding: var(--s1) 0; }
#rm-wrap .rm-row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
#rm-wrap .rm-row > input { flex: 1 1 150px; width: auto; }
#rm-wrap .rm-end { justify-content: flex-end; }
#rm-wrap .rm-more, #rm-wrap .rm-modeline { margin: 0; font-size: var(--t1); }
#rm-maketoggle { align-self: flex-start; }
#rm-form { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s3); border: 1px solid var(--line); border-radius: var(--r3); background: rgba(255, 255, 255, .04); }
#rm-wrap .rm-check { display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--touch); color: var(--text-2); font-weight: 500; cursor: pointer; }
#rm-wrap .rm-check[hidden] { display: none; }      /* (the rule above is as strong as the [hidden] one and comes later: without this the tick showed for an open room) */
#rm-wrap .rm-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--gold); }
#rm-wrap .rm-modes { flex-wrap: wrap; align-self: flex-start; }
#rm-mine { display: flex; flex-direction: column; gap: var(--s1); }
/* Cairn Country's row in the lobby (src/parts/territory.js) */
#ld-lobby .ld-row { display: flex; gap: var(--s3); align-items: center; }
#ld-lobby .ld-row p { margin: 0; flex: 1; min-width: 0; color: var(--text-2); font-weight: 400; }
#ld-lobby .ld-row button { flex: none; }
#ld-lobby .ld-row button[aria-pressed="true"] { background: var(--gold-tint); border-color: var(--gold); }
#ld-lobby #ld-honest { margin: var(--s2) 0 0; font-size: var(--t1); }
@media (max-width: 480px) { #ld-lobby .ld-row { flex-direction: column; align-items: stretch; } }
/* sound */
#pn-sound .lb-seg-wrap { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
/* the game's own buttons and readings step out while the lobby is open */
#play-ui:has(> #pn-lobby:not([hidden])) :is(#pu-top, .pu-touch, #pu-stat, #nt-root) { visibility: hidden; }
@media (max-width: 720px) { #pn-box { width: 100%; border-right: 0; } #pn-lobby { background: rgba(6, 9, 15, .4); } }
@media (max-width: 560px) { #pn-box .lb-you > .lb-dragon { flex-basis: 96px; } }
@media (max-height: 480px) {
  #pn-box .lb-body { gap: var(--s4); }
  #pn-box .lb-head h2 { font-size: 24px; }
  #pn-box .lb-head p { display: none; }
  /* short screens: the dragons become one row of picture chips, the name field under them */
  #pn-box .lb-dragon { flex-direction: row; align-items: center; min-height: 52px; }
  #pn-box .lb-dragon img { width: min(68px, 42%); aspect-ratio: 4 / 3; flex: none; }
  #pn-box .lb-dragon .lb-cap { padding: 0 var(--s2); }
  #pn-box .lb-dragon small { display: none; }
  #pn-box .lb-head { padding-top: calc(var(--edge-t) + 2px); padding-bottom: var(--s1); }
  #pn-box .lb-body { gap: var(--s3); padding-top: var(--s1); padding-bottom: var(--s2); }
  #pn-box .lb-name { padding: 0; }
  #pn-box .lb-name label, #pn-box .lb-name-hint { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #pn-box .lb-places .lb-card img { aspect-ratio: 16 / 9; }
  #pn-box .lb-places .lb-card b, #pn-box .lb-places .lb-card small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  #pn-box .lb-foot { padding-top: var(--s2); }
  #pn-box .lb-foot .ui-main { min-height: 48px; }
  #pn-box .lb-places .lb-card { flex-basis: 150px; }
  #pn-box .lb-card .lb-cap { padding: 6px var(--s2) var(--s2); }
}
@media (min-height: 900px) and (min-width: 1500px) {
  :root { --t1: 13px; --t2: 14px; --t3: 16px; --t4: 20px; }
  #pn-box { width: 820px; } #pn-box .lb-places .lb-card { flex-basis: 236px; }
}
/* a panel open: every notice steps out (and keeps its own time) */
body:has(#mu-panel:not([hidden]), #ui-help:not([hidden]), #pu-map:not([hidden]), #tm-panel:not([hidden]), #ui-settings:not([hidden]), #ui-iosguide:not([hidden]), #md-result:not([hidden])) #nt-root { visibility: hidden; }

/* ---- the controls view ------------------------------------------------------------------------------------------- */
#ui-help { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; background: var(--veil);
  padding: var(--edge-t) var(--edge-r) var(--edge-b) var(--edge-l); font: 500 var(--t2)/1.4 var(--f-text); color: var(--text); }
#ui-help[hidden] { display: none; }
#ui-help .ui-panel { width: min(980px, 100%); max-height: 100%; display: flex; flex-direction: column; }
#ui-help .hp-tabs { flex: none; }                  /* the device tabs: the kit's segmented choice (.ui-seg-row.ui-seg-wide) */
#ui-help .hp-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: var(--pad); min-height: 0; overflow: hidden; flex: 1; }
#ui-help .hp-art { display: flex; align-items: center; justify-content: center; min-width: 0; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--s2); }
#ui-help .hp-art svg { width: 100%; height: auto; max-height: min(calc(100vh - var(--edge-t) - var(--edge-b) - 96px), 420px); display: block; }
#ui-help .hp-lists { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: var(--s1); }
#ui-help .hp-ok { min-height: var(--touch); padding: 0 var(--s4); font-size: var(--t2); flex: none; }
#ui-help .hp-ok[hidden] { display: none; }
#ui-help .hp-sit h4 { display: flex; align-items: center; gap: var(--s2); margin: 0 0 var(--s1); font: 600 var(--t2)/1.3 var(--f-display); color: var(--gold); }
#ui-help .hp-sit dl { display: grid; grid-template-columns: auto 1fr; gap: 3px var(--s3); margin: 0; }
#ui-help .hp-sit dt { font: 600 var(--t1)/1.5 var(--f-text); color: var(--text); white-space: nowrap; }
#ui-help .hp-sit dd { margin: 0; color: var(--text-2); font-size: var(--t1); line-height: 1.5; font-weight: 400; }
#ui-help .hp-note { margin: 0; color: var(--text-3); font-size: var(--t1); font-weight: 400; }
#ui-help svg text { font-family: var(--f-text); }
@media (max-width: 760px), (max-height: 480px) {
  #ui-help .hp-body { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
  #ui-help .hp-art { padding: var(--s1); }
  #ui-help .ui-head h2 { font-size: var(--t3); }
  #ui-help .hp-tabs button { padding: 0 var(--s2); font-size: var(--t1); }
}
@media (max-width: 560px) and (orientation: portrait) { #ui-help .hp-body { grid-template-columns: 1fr; overflow-y: auto; } #ui-help .hp-lists { overflow: visible; } }

/* the turn prompt in the game */
#play-ui #pu-turn { background: var(--ink); font: 600 var(--t4)/1.3 var(--f-display); color: var(--text); flex-direction: column; gap: var(--s3); text-align: center; padding: var(--s5); }
@media (max-height: 480px) { #boot.failed .bt-line { display: none; } }
@media (min-height: 900px) and (min-width: 1500px) { #ui-help .ui-panel { width: min(1180px, 100%); } #ui-help .hp-art svg { max-height: 460px; } }

/* ---- the status block top left (src/ui/status.js): health, fire and stamina bars, fireballs, speed and height ------------
   one small panel like the top buttons, so it reads over bright sky, snow and night alike; it grows with its content */
#play-ui #pu-stat { position: absolute; left: var(--edge-l); top: var(--edge-t); display: flex; flex-direction: column; gap: 4px;
  padding: 6px 9px 5px 7px; box-sizing: border-box; border-radius: var(--r3); background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); font: 600 var(--t1)/1 var(--f-text); color: var(--text); }
#play-ui .st-row { --c: var(--text); display: flex; align-items: center; gap: 5px; height: 9px; }
#play-ui .st-ic { flex: none; width: 9px; height: 9px; background: var(--c); -webkit-mask: var(--ic) center / contain no-repeat; mask: var(--ic) center / contain no-repeat; transition: background var(--m2) var(--ease); }
#play-ui .st-row .bar { position: relative; flex: 1; min-width: 88px; height: 4px; border-radius: 3px; background: var(--meter-track); overflow: hidden; }      /* the Meter line */
#play-ui .st-row .bar i { position: absolute; inset: 0; display: block; background: var(--c); transform-origin: 0 50%; transition: transform var(--m2) linear, background var(--m2) var(--ease); }
#play-ui .st-hp { --c: var(--danger); --ic: var(--i-heart); }
#play-ui .st-br { --c: var(--ember); --ic: var(--i-flame); }
#play-ui .st-stm { --c: var(--text); --ic: var(--i-bolt); }
#play-ui .st-stm.over { --c: var(--gold); }
#play-ui .st-br.locked, #play-ui .st-stm.winded { --c: var(--text-3); }                /* fire after running dry, stamina out of breath: grey until they come back */
#play-ui .st-br.locked .bar, #play-ui .st-stm.winded .bar { background: repeating-linear-gradient(135deg, var(--meter-track) 0 3px, rgba(255, 255, 255, .05) 3px 6px); }
#play-ui .st-hp.low .st-ic, #play-ui .st-hp.low .bar i { animation: st-pulse 1s var(--ease) infinite; }
#play-ui .st-hp.low { --c: #ff6a55; }
#play-ui .st-hp.hit .bar i, #play-ui .st-hp.hit .st-ic { background: #fff; transition: none; }    /* a moment of white as health drops */
@keyframes st-pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { #play-ui .st-hp.low .st-ic, #play-ui .st-hp.low .bar i { animation: none; } }
#play-ui .st-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 4px var(--s3); margin-top: 1px; min-height: 12px; }
/* fireballs: one dot each, any count; ready is a full ember dot, spent a hollow ring, the next one fills round as it comes back */
#play-ui :is(#pu-em, .ui-dots) { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
#play-ui :is(#pu-em, .ui-dots) span { --k: 0; width: 6px; height: 6px; border-radius: 50%; box-sizing: border-box; border: 1px solid rgba(255, 255, 255, .38); }
#play-ui :is(#pu-em, .ui-dots) span.on { background: var(--ember); border-color: var(--ember); box-shadow: 0 0 4px rgba(255, 179, 71, .55); }
#play-ui :is(#pu-em, .ui-dots) span.next { border-color: rgba(255, 179, 71, .6); background: conic-gradient(rgba(255, 179, 71, .75) calc(var(--k) * 1turn), transparent 0); }
/* speed and height: quiet, numbers in fixed widths so they do not jitter */
#play-ui #pu-info { font: 500 var(--t1)/1 var(--f-text); color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
#play-ui #pu-info b { font-weight: 600; color: var(--text); }
#play-ui #pu-info i { display: inline-block; width: 1px; height: 9px; margin: 0 5px; vertical-align: -1px; background: var(--line-strong); }
@media (min-width: 1200px) and (min-height: 700px) {           /* desktop: a touch larger, still small */
  #play-ui #pu-stat { gap: 5px; padding: 7px 11px 6px 9px; }
  #play-ui .st-row .bar { min-width: 120px; height: 5px; }
  #play-ui .st-row, #play-ui .st-ic { height: 10px; } #play-ui .st-ic { width: 10px; }
  #play-ui :is(#pu-em, .ui-dots) span { width: 7px; height: 7px; } #play-ui :is(#pu-em, .ui-dots) { gap: 4px; }
}

/* ---- speed: the Boost button's ring and states, the lock chip, the streaks (src/speed.js) ----------- */
/* the ring round Boost is the stamina: paper while it rests, gold in overdrive, quiet grey while out of breath */
#play-ui #pu-boost { --st: 1; --ring: var(--text); overflow: visible; line-height: 1.05; transition: background var(--m1) var(--ease), border-color var(--m2) var(--ease); }
#play-ui #pu-boost::before { content: ""; position: absolute; inset: -7px; border-radius: 50%; pointer-events: none;
  background: conic-gradient(var(--ring) calc(var(--st) * 1turn), rgba(255, 255, 255, .16) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px)); }
#play-ui #pu-boost[data-speed="over"] { --ring: var(--gold); background: var(--gold-tint); border-color: var(--gold); font-size: var(--t1); }
#play-ui #pu-boost[data-speed="locked"] { --ring: var(--gold); background: rgba(240, 179, 90, .55); border-color: var(--gold); color: var(--on-paper); }
#play-ui #pu-boost[data-speed="winded"] { --ring: var(--text-3); color: var(--text-2); }
#play-ui #pu-boost[data-speed="ground"]::before { opacity: .55; }
/* the lock chip: above Boost while overdrive is on, a tap locks it on (or stops it) */
#play-ui #pu-lock { right: calc(max(22px, env(safe-area-inset-right)) + 20px); bottom: 210px; width: auto; height: var(--touch); padding: 0 var(--s3); }      /* the kit's gold Chip, 44 tall here */
#play-ui #pu-lock[hidden] { display: none; }
/* air streaks at overdrive speed: thin rays from the middle of the view, nothing in the middle itself */
#play-ui #pu-streak { position: absolute; inset: -10%; pointer-events: none; opacity: 0; will-change: opacity, transform;
  background: repeating-conic-gradient(from 3deg, rgba(242, 240, 233, .2) 0deg .35deg, transparent .35deg 4.1deg, rgba(242, 240, 233, .12) 4.1deg 4.3deg, transparent 4.3deg 9.7deg);
  -webkit-mask: radial-gradient(closest-side, transparent 52%, rgba(0, 0, 0, .55) 78%, #000 100%); mask: radial-gradient(closest-side, transparent 52%, rgba(0, 0, 0, .55) 78%, #000 100%); }
@media (prefers-reduced-motion: reduce) { #play-ui #pu-streak { display: none; } }
@media (pointer: fine) { #play-ui #pu-lock { transform: scale(.8); transform-origin: bottom right; opacity: .8; } }

/* ---- the admin's Time panel (src/ui/timepanel.js; only on a device holding the admin key) ----------------------------- */
#tm-panel { position: fixed; right: var(--edge-r); top: calc(var(--edge-t) + 56px); width: min(360px, calc(100vw - 32px)); max-height: calc(100vh - var(--edge-t) - 68px); overflow: auto; z-index: 30;
  user-select: none; -webkit-user-select: none; display: flex; flex-direction: column; gap: var(--s3); }
#tm-panel[hidden] { display: none; }
#tm-panel .ui-head { margin-bottom: 0; }
#tm-panel .tm-now { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
#tm-panel #tm-clock { font: 700 var(--t5)/1 var(--f-display); letter-spacing: -.01em; color: var(--text); font-variant-numeric: tabular-nums; }
#tm-panel #tm-state { font: 600 var(--t1)/1.3 var(--f-text); color: var(--gold); }
#tm-panel input[type=range] { width: 100%; margin: 0; }
#tm-panel .tm-scale { display: flex; justify-content: space-between; margin-top: calc(var(--s2) * -1); color: var(--text-3); font: 500 var(--t1)/1 var(--f-text); font-variant-numeric: tabular-nums; }
#tm-panel .tm-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s1); }
#tm-panel .tm-presets button { flex-direction: column; gap: 2px; padding: var(--s1) var(--s2); font-size: var(--t1); }
#tm-panel .tm-presets small { color: var(--text-3); font: 500 11px/1 var(--f-text); font-variant-numeric: tabular-nums; }
#tm-panel .tm-row .ui-seg { width: 100%; } #tm-panel .tm-row .ui-seg-row { flex: 1; } #tm-panel .tm-row .ui-seg-row button { flex: 1; }
#tm-panel .tm-foot { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
#tm-panel #tm-note { margin: 0; flex: 1; min-width: 10em; color: var(--text-3); font: 400 var(--t1)/1.35 var(--f-text); }
@media (max-height: 480px) {
  #tm-panel { width: min(520px, calc(100vw - 32px)); gap: var(--s2); }
  #tm-panel .tm-presets { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  #tm-panel .tm-presets small, #tm-panel .tm-scale { display: none; }
  #tm-panel #tm-clock { font-size: var(--t4); }
}

/* ---- full screen (src/ui/fullscreen.js): the top-row button, the lobby's button (the phone's one-time offer is a notice) */
#pn-box .lb-full { --ic: var(--i-full); }
#pn-box .lb-full[data-on="1"] { --ic: var(--i-unfull); }
@media (max-width: 560px) { #pn-box .lb-full { font-size: 0; padding: 0; width: var(--touch); } }

/* ---- Settings (src/ui/settings-panel.js): the same panel; groups in two columns, one under the other on a narrow screen ---- */
#pn-box .lb-set { --ic: var(--i-set); }
@media (max-width: 560px) { #pn-box .lb-set { font-size: 0; padding: 0; width: var(--touch); gap: 0; } }
#ui-settings { position: fixed; inset: 0; z-index: 41; display: flex; align-items: center; justify-content: center; background: var(--veil);
  padding: var(--edge-t) var(--edge-r) var(--edge-b) var(--edge-l); font: 500 var(--t2)/1.4 var(--f-text); color: var(--text); }
#ui-settings[hidden] { display: none; }
#ui-settings .ui-panel { width: min(780px, 100%); max-height: 100%; display: flex; flex-direction: column; }
#ui-settings .st-restart { min-height: var(--touch); padding: 0 var(--s4); font-size: var(--t2); flex: none; }
#ui-settings .st-restart[hidden] { display: none; }
#ui-settings .st-body { display: flex; align-items: flex-start; gap: var(--s3) var(--s5); min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: 3px; margin: -3px; }                    /* (room for the focus ring inside the scrolling box) */
#ui-settings .st-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: var(--s4); }
#ui-settings .st-group { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; margin: 0; }
#ui-settings .st-group h3 { margin: 0; font: 600 var(--t2)/1.3 var(--f-display); color: var(--gold); }
#ui-settings .st-main { display: flex; align-items: center; gap: var(--s3); min-height: var(--touch); }
#ui-settings .st-name { flex: 1; min-width: 0; font: 600 var(--t2)/1.3 var(--f-text); color: var(--text); }
#ui-settings .ui-seg-row { flex: none; }
#ui-settings .st-line { margin: 2px 0 0; min-height: 1.4em; color: var(--text-2); font: 400 var(--t1)/1.4 var(--f-text); }
#ui-settings .st-line.wait { color: var(--gold); }
#ui-settings .st-row.st-wide .st-main { flex-wrap: wrap; } #ui-settings .st-row.st-wide .ui-seg-row { flex: 1 1 100%; flex-wrap: wrap; }      /* a row of many choices (the time of day) wraps under its name */
/* an on-off switch: the kit's Switch (.ui-switch, above) */
@media (max-width: 600px) { #ui-settings .st-body { flex-direction: column; align-items: stretch; gap: var(--s4); } #ui-settings .st-col { flex: none; } }
@media (max-height: 480px) { #ui-settings .st-col { gap: var(--s3); } #ui-settings .st-group { gap: var(--s1); } #ui-settings .ui-head h2 { font-size: var(--t3); } }
/* (a quality choice the device did not hold is told by the notices: an Event, or a system Choice to go back to Auto) */

/* ---- the iPhone and iPad guide to the Home Screen (src/ui/ios-guide.js): the same panel; three drawn steps in a row,
   one under the other on an upright phone; the way out is always in view (the steps scroll, the foot does not) ---- */
#ui-iosguide { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; background: var(--veil);
  padding: var(--edge-t) var(--edge-r) var(--edge-b) var(--edge-l); font: 500 var(--t2)/1.4 var(--f-text); color: var(--text); }
#ui-iosguide[hidden] { display: none; }
#ui-iosguide .ui-panel { width: min(860px, 100%); max-height: 100%; display: flex; flex-direction: column; }
#ui-iosguide[data-steps="1"] .ui-panel { width: min(560px, 100%); }
#ui-iosguide .ig-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#ui-iosguide[data-steps="1"] .ig-steps { grid-template-columns: minmax(0, 200px) minmax(0, 1fr); }
#ui-iosguide[data-steps="1"] .ig-steps li { display: contents; }
#ui-iosguide .ig-steps li { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
#ui-iosguide .ig-art { display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .03); border: 1px solid var(--line); border-radius: var(--r3); padding: var(--s1); }
#ui-iosguide .ig-art svg { display: block; width: 100%; height: auto; max-height: min(132px, 30vh); }
#ui-iosguide svg text { font-family: var(--f-text); }
#ui-iosguide .ig-words h3 { display: flex; align-items: center; gap: var(--s2); margin: 0 0 2px; font: 600 var(--t2)/1.3 var(--f-display); color: var(--text); }
#ui-iosguide .ig-words h3 b { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; background: var(--gold-tint); border: 1px solid var(--gold);
  font: 700 var(--t1)/1 var(--f-text); color: var(--gold); }
#ui-iosguide .ig-words p { margin: 0; color: var(--text-2); font: 400 var(--t1)/1.45 var(--f-text); }
#ui-iosguide .ig-more { margin: var(--s2) 0 0; color: var(--text-2); font: 400 var(--t1)/1.45 var(--f-text); }
#ui-iosguide .ig-more[hidden] { display: none; }
#ui-iosguide .ig-foot { display: flex; align-items: center; gap: var(--s3); margin-top: var(--s3); flex: none; }
#ui-iosguide .ig-note { flex: 1; min-width: 0; margin: 0; color: var(--text-3); font: 400 var(--t1)/1.4 var(--f-text); }
#ui-iosguide .ig-note.pick { color: var(--text); user-select: all; -webkit-user-select: all; word-break: break-all; }
#ui-iosguide .ig-copy[hidden] { display: none; }
#ui-iosguide .ig-go, #ui-iosguide .ig-copy { flex: none; }
@media (max-height: 480px) {
  #ui-iosguide .ui-head h2 { font-size: var(--t3); }
  #ui-iosguide .ig-art svg { max-height: min(104px, 27vh); }
  #ui-iosguide .ig-foot { margin-top: var(--s2); } #ui-iosguide .ig-go { min-height: 48px; }
}
@media (orientation: portrait) and (max-width: 600px) {
  #ui-iosguide .ig-steps { grid-template-columns: 1fr; }
  #ui-iosguide .ig-steps li { flex-direction: row; align-items: center; gap: var(--s3); }
  #ui-iosguide .ig-art { flex: 0 0 46%; }
  #ui-iosguide .ig-words { flex: 1; min-width: 0; }
  #ui-iosguide[data-steps="1"] .ig-steps { grid-template-columns: 1fr; }
  #ui-iosguide[data-steps="1"] .ig-steps li { display: flex; flex-direction: column; align-items: stretch; }
  #ui-iosguide[data-steps="1"] .ig-art { flex: none; }
  #ui-iosguide .ig-foot { flex-wrap: wrap; }
  #ui-iosguide .ig-note { flex: 1 1 100%; }
  #ui-iosguide .ig-go { flex: 1 1 auto; }
}
/* the way into it from the Controls view */
#ui-help .hp-home { align-self: flex-start; flex: none; }

/* ---- the lighter play screen (switch "hud", src/ui/hud-light.js); nothing below applies with it off ------------------ */
/* the fold: one button top right; the rest unfold from it to the left (a second row under the first if they do not fit),
   in a fixed order that keeps today's left-to-right row: Modes, Controls, Settings, Music, Sound, Lobby, Map, Full screen */
#play-ui.hud-light #pu-top { flex-direction: row-reverse; flex-wrap: wrap; justify-content: flex-start; align-content: flex-start;
  max-width: calc(100vw - var(--edge-l) - var(--edge-r) - 160px); }
#play-ui.hud-light #pu-fold { --ic: var(--i-tiles); order: -1; position: relative; }
/* open, the button keeps its icon and shows as pressed (the house's .on look, as Full screen when on) */
#play-ui.hud-light #pu-fold.on, #play-ui.hud-light #pu-fold.on:hover { background: var(--gold-tint); border-color: var(--gold); }      /* (a touch leaves hover on it) */
#play-ui.hud-light #pu-fold.attn::after { content: ""; position: absolute; top: 7px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
#play-ui.hud-light #pu-top.open #pu-fold.attn::after { display: none; }
#play-ui.hud-light #pu-full { order: 1; } #play-ui.hud-light #pu-mapbtn { order: 2; } #play-ui.hud-light #pn-roombtn { order: 3; } #play-ui.hud-light #pu-snd { order: 4; }
#play-ui.hud-light #pu-music { order: 5; } #play-ui.hud-light #pu-set { order: 6; } #play-ui.hud-light #pu-help { order: 7; }
#play-ui.hud-light #pu-modes, #play-ui.hud-light #pu-practice { order: 8; } #play-ui.hud-light #pu-time { order: 9; }
/* folded: the tiles keep their places (so nothing jumps when they come back) but are not there to see, tap or tab to */
#play-ui.hud-light #pu-top > button:not(#pu-fold) { opacity: 0; visibility: hidden; pointer-events: none; transform: translateX(calc((var(--fi, 0) + 1) * 18px)) scale(.8);
  transition: opacity var(--m1) var(--ease), transform var(--m1) var(--ease), visibility 0s linear var(--m1); }
/* unfolding: each tile slides out of the button, the nearest first, 22 ms apart; 220 ms each */
#play-ui.hud-light #pu-top.open > button:not(#pu-fold) { opacity: 1; visibility: visible; pointer-events: auto; transform: none;
  transition: opacity var(--m2) var(--ease) calc(var(--fi, 0) * 22ms), transform var(--m2) var(--ease) calc(var(--fi, 0) * 22ms), visibility 0s linear calc(var(--fi, 0) * 22ms); }
@media (prefers-reduced-motion: reduce) { #play-ui.hud-light #pu-top > button:not(#pu-fold), #play-ui.hud-light #pu-top.open > button:not(#pu-fold) { transition: none; transform: none; } }
:root { --i-tiles: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='4' y='4' width='6.5' height='6.5' rx='1.5'/%3E%3Crect x='13.5' y='4' width='6.5' height='6.5' rx='1.5'/%3E%3Crect x='4' y='13.5' width='6.5' height='6.5' rx='1.5'/%3E%3Crect x='13.5' y='13.5' width='6.5' height='6.5' rx='1.5'/%3E%3C/svg%3E"); }
/* the top left, bare: no panel and no border; the health bar and the numbers sit on the picture, kept readable over snow,
   bright sky, forest, night and fire by a thin dark halo (a shadow on the words, a drop shadow on the bar), not a plate.
   On a touch screen only health, speed and height; with keys or a pad (pointer: fine) the small fire and stamina bars
   and the fireball dots stay under health, bare too: there the buttons are not under the thumbs to be read */
#play-ui.hud-light #pu-stat { padding: 2px 0 0 2px; gap: 6px; background: none; border: 0; border-radius: 0; -webkit-backdrop-filter: none; backdrop-filter: none;
  text-shadow: 0 0 2px rgba(6, 9, 15, .75), 0 1px 3px rgba(6, 9, 15, .55); }
#play-ui.hud-light #pu-stat .st-row { filter: drop-shadow(0 0 1px rgba(6, 9, 15, .7)) drop-shadow(0 1px 2px rgba(6, 9, 15, .45)); }
#play-ui.hud-light #pu-stat .st-row .bar { min-width: 112px; background: var(--meter-track-bare); }
#play-ui.hud-light #pu-info { font-size: var(--t2); color: rgba(242, 240, 233, .82); }
#play-ui.hud-light #pu-info i { box-shadow: 0 0 2px rgba(6, 9, 15, .8); }
@media (pointer: coarse) { #play-ui.hud-light :is(.st-br, .st-stm, #pu-em) { display: none; } }
/* the meters as lines on their own buttons (src/ui/hud-light.js createLines): a thin ring on the button's edge, in place
   of its border, so a full meter looks like the button did before and nothing gets louder. Paper while there is plenty;
   full brightness when low; the house's ember only when dangerously low; grey with a tick at the comeback mark while
   locked out (fire after running dry, stamina out of breath); gold while overdrive burns the stamina. --hl eases
   between the overlay's ten paints a second (a registered number, so it can be transitioned) */
@property --hl { syntax: "<number>"; inherits: true; initial-value: 1; }
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl { --hc: rgba(242, 240, 233, .72); --ht: rgba(255, 255, 255, .2); --hd: rgba(176, 186, 200, .8);
  border-color: transparent; overflow: visible; transition: --hl 140ms linear, background var(--m1) var(--ease), opacity var(--m2) var(--ease); }
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl::before { content: ""; position: absolute; inset: -2px; border-radius: 50%; pointer-events: none; opacity: 1;
  background: conic-gradient(var(--hc) calc(var(--hl) * 1turn), var(--ht) 0);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2.6px), #000 calc(100% - 2px)); }
/* a thin dark halo under the line, so it still reads over bright cloud, snow and sky (the stills showed it vanish there) */
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl::before { z-index: 1; }
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; pointer-events: none; z-index: 0;
  background: rgba(6, 9, 15, .3); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4.8px), #000 calc(100% - 4.2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4.8px), #000 calc(100% - 4.2px)); }
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl[data-hl="low"] { --hc: rgba(255, 255, 255, .98); }
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl[data-hl="empty"] { --hc: var(--ember); }
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl[data-hl="over"] { --hc: var(--gold); }
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl[data-hl="rest"] { --hc: rgba(242, 240, 233, .45); }
#play-ui.hud-light :is(#pu-flame, #pu-boost, #pu-ball, #pu-turnbtn).hl[data-hl="spent"] { --hc: var(--hd); }
#play-ui.hud-light :is(#pu-flame, #pu-boost).hl:is([data-hl="locked"], [data-hl="winded"])::before {      /* both come back at 35 % */
  background: conic-gradient(var(--hd) 0 calc(min(var(--hl), .335) * 1turn), var(--ht) 0 .34turn, rgba(242, 240, 233, .9) 0 .352turn, var(--ht) 0); }
#play-ui.hud-light #pu-boost.hl[data-speed="ground"]::before { opacity: .55; }
/* Ball: five segments, one per fireball; --hl counts them (3.4: three ready, the fourth 40 % back) */
#play-ui.hud-light #pu-ball.hl::before { background: conic-gradient(
    transparent 0 0.014turn,
    var(--hc) 0.014turn calc((0.014 + clamp(0, var(--hl) - 0, 1) * 0.172) * 1turn),
    var(--ht) 0 0.186turn,
    transparent 0 0.214turn,
    var(--hc) 0.214turn calc((0.214 + clamp(0, var(--hl) - 1, 1) * 0.172) * 1turn),
    var(--ht) 0 0.386turn,
    transparent 0 0.414turn,
    var(--hc) 0.414turn calc((0.414 + clamp(0, var(--hl) - 2, 1) * 0.172) * 1turn),
    var(--ht) 0 0.586turn,
    transparent 0 0.614turn,
    var(--hc) 0.614turn calc((0.614 + clamp(0, var(--hl) - 3, 1) * 0.172) * 1turn),
    var(--ht) 0 0.786turn,
    transparent 0 0.814turn,
    var(--hc) 0.814turn calc((0.814 + clamp(0, var(--hl) - 4, 1) * 0.172) * 1turn),
    var(--ht) 0 0.986turn,
    transparent 0); }
/* Land (Fly on the ground) in the top-right corner, just under the Menu button and smaller, 44 px (owner, 2026-11-20:
   "make land button smaller and on top right corner so it appears under menu", then "just simple land button
   placement"): the same button and word, only moved and smaller, 8 px under Menu and centred on it */
#play-ui.hud-light #pu-land { top: calc(var(--edge-t) + var(--touch) + 22px); bottom: auto; right: var(--edge-r); width: var(--tb-small); height: var(--tb-small); }
/* the overdrive lock chip sat above Boost, where Land now is on a short phone: on the lighter screen it sits under the read-out, top left */
#play-ui.hud-light #pu-lock { left: var(--edge-l); right: auto; top: calc(var(--edge-t) + 96px); bottom: auto; transform-origin: top left; }      /* (owner, 2026-11-20: a bit bigger and a bit lower than the first 44 px right under the Menu button) */


/* ---- on-screen notices (src/ui/notice.js; docs/ui/NOTICES.md: the pick "A · Quiet edges" and "After the review") --------
   Every note in play is one of a few kinds, each with its own place, look and time. Bare words with one halo at the sides;
   nothing lasting over the middle; no plate on any notice (the Choice too is one line, a button and a close mark).
   On touch no notice explains a labelled button (owner, 2026-11-20: "its already trivial what that buttons do they have
   labels"): the module says nothing there. Text sizes are in rem, so a larger text setting grows them. */
:root {
  --nt-halo: 0 0 2px rgba(6, 9, 15, .9), 0 0 4px rgba(6, 9, 15, .55), 0 1px 9px rgba(6, 9, 15, .5);       /* every bare word over the world */
  --nt-halo-big: 0 0 3px rgba(6, 9, 15, .9), 0 0 6px rgba(6, 9, 15, .55), 0 2px 18px rgba(6, 9, 15, .5);  /* the Moment */
  --nt-halo-mark: drop-shadow(0 0 1px rgba(6, 9, 15, .85)) drop-shadow(0 1px 2px rgba(6, 9, 15, .5));    /* arrows, dots, icons */
  --nt-amber: #ffb020;                      /* a warning; gold is yours and the way, red only danger */
  --nt-quiet: rgba(242, 240, 233, .88);     /* Status, Guide, sub-lines */
  --nt-glass: var(--glass); --nt-glass-line: var(--glass-line);       /* the mode chip (a Status that can be tapped): the kit's one glass */
  --nt-small: .75rem; --nt-text: .8125rem; --nt-moment: 1.375rem; --nt-moment-sub: .75rem;   /* 12, 13, 22, 12 px at the usual text size */
  --nt-read-h: 46px;                        /* where the left column starts under the read-out (the module measures it; this is the first guess) */
  --nt-col-w: min(40vw, 340px);             /* the left column */
  --nt-top-w: calc(100vw - 336px);          /* the top stack: clear of the read-out and the Menu with Land under it */
  --nt-cluster: 306px;                      /* the right thumb's buttons from the right edge */
  --nt-lock-step: 84px;                     /* the Events step right of the overdrive Lock chip while it shows (lighter screen) */
}
@media (pointer: fine) { :root { --nt-read-h: 84px; } }
@media (min-width: 1200px) and (min-height: 700px) { :root { --nt-small: .8125rem; --nt-text: .875rem; --nt-moment: 1.875rem; --nt-moment-sub: .8125rem; --nt-top-w: calc(100vw - 480px); } }
#play-ui .nt-root { position: absolute; inset: 0; z-index: 1; pointer-events: none; color: var(--text); text-shadow: var(--nt-halo); font: 500 var(--nt-text)/1.3 var(--f-text);
  --nt-col-y: calc(var(--edge-t) + var(--nt-read-h)); --nt-top-y: var(--edge-t); }
#play-ui .nt-root.nt-hidden { visibility: hidden; }
#play-ui .nt-root [hidden] { display: none !important; }
#play-ui .nt-root .nt-out { opacity: 0; }
#play-ui .nt-root kbd.nt-key { display: inline-block; min-width: 1.5em; padding: 0 4px; margin: 0 1px; box-sizing: border-box; border: 1px solid rgba(242, 240, 233, .5); border-bottom-width: 2px;
  border-radius: var(--r1); font: 600 .6875rem/1.45 var(--f-text); text-align: center; color: var(--text); text-shadow: none; background: rgba(6, 9, 15, .22); }
#play-ui .nt-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* the left column: Status rows (2 at most), then Events (2 on a phone, 3 on a desktop); it ends by 36 % of the height */
#play-ui .nt-col { position: absolute; left: var(--edge-l); top: var(--nt-col-y); width: var(--nt-col-w); display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
#play-ui .nt-statuses, #play-ui .nt-events { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; max-width: 100%; }
#play-ui .nt-statuses:empty, #play-ui .nt-events:empty { display: none; }
#play-ui .nt-root.nt-col-wait .nt-col { visibility: hidden; }      /* only while a Moment would touch it (a large text on a phone) */
#play-ui .nt-status { max-width: 100%; font: 600 var(--nt-small)/1.3 var(--f-text); color: var(--nt-quiet); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#play-ui .nt-status.nt-ic-flame::before, #play-ui .nt-status.nt-ic-rooms::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; background: var(--gold);
  -webkit-mask: var(--i-flame) center / contain no-repeat; mask: var(--i-flame) center / contain no-repeat; filter: var(--nt-halo-mark); }
#play-ui .nt-status.nt-ic-rooms::before { background: currentColor; -webkit-mask-image: var(--i-rooms); mask-image: var(--i-rooms); }
#play-ui .nt-status.nt-chip { pointer-events: auto; display: inline-flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 10px; margin: 0; box-sizing: border-box; text-shadow: none; color: var(--text);
  background: var(--nt-glass); border: 1px solid var(--nt-glass-line); border-radius: var(--r3); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); cursor: pointer; }
#play-ui .nt-event { position: relative; max-width: 100%; padding-left: 13px; box-sizing: border-box; font: 500 var(--nt-text)/1.3 var(--f-text); overflow-wrap: anywhere; transition: opacity var(--m3) var(--ease); }
#play-ui .nt-event::before { content: ""; position: absolute; left: 1px; top: calc(.65em - 3px); width: 6px; height: 6px; border-radius: 50%; background: rgba(242, 240, 233, .7); box-shadow: 0 0 0 1px rgba(6, 9, 15, .5); }
#play-ui .nt-event.good::before { background: var(--gold); } #play-ui .nt-event.bad::before { background: var(--danger); }
#play-ui.hud-light:has(#pu-lock:not([hidden])) .nt-events { margin-left: var(--nt-lock-step); max-width: calc(100% - var(--nt-lock-step)); }
/* the top stack: an Alert, then a Reply, then a Guide (two lines at most on a phone); under the unfolded menu's tiles */
#play-ui .nt-top { position: absolute; left: 50%; top: var(--nt-top-y); transform: translateX(-50%); width: max-content; max-width: var(--nt-top-w); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
#play-ui .nt-alert, #play-ui .nt-reply { font: 600 var(--nt-text)/1.3 var(--f-text); overflow-wrap: anywhere; transition: opacity var(--m2) var(--ease); }
#play-ui .nt-alert { display: flex; align-items: baseline; gap: 7px; }
#play-ui .nt-alert::before { content: ""; flex: none; width: 13px; height: 12px; background: var(--nt-amber); filter: var(--nt-halo-mark); clip-path: polygon(50% 0, 100% 100%, 0 100%); align-self: center; }
#play-ui .nt-alert.danger::before { background: var(--danger-text); }
#play-ui .nt-alert.danger { color: var(--danger-text); }
#play-ui .nt-guide { font: 500 var(--nt-small)/1.45 var(--f-text); color: var(--nt-quiet); overflow-wrap: anywhere; transition: opacity var(--m3) var(--ease); }
/* the Moment: the big beats, briefly, in the upper third; its title and sub-line end above the middle third */
#play-ui .nt-moment { position: absolute; left: 50%; top: var(--nt-moment-y, 22%); transform: translateX(-50%); width: max-content; max-width: 70vw; text-align: center; text-shadow: var(--nt-halo-big); transition: opacity var(--m3) var(--ease); }
#play-ui .nt-moment b { display: block; font: 700 var(--nt-moment)/1.1 var(--f-display); letter-spacing: -.015em; color: #fffaf0; overflow-wrap: anywhere; }
#play-ui .nt-moment.nt-flame b::before { content: ""; display: inline-block; width: .8em; height: .8em; margin-right: .25em; vertical-align: -.05em; background: var(--gold); -webkit-mask: var(--i-flame) center / contain no-repeat; mask: var(--i-flame) center / contain no-repeat; filter: var(--nt-halo-mark); }
#play-ui .nt-moment span { display: block; margin-top: 2px; font: 500 var(--nt-moment-sub)/1.25 var(--f-text); color: var(--nt-quiet); }
#play-ui .nt-moment.nt-count b { font-size: calc(var(--nt-moment) * 1.6); font-variant-numeric: tabular-nums; }
/* the Choice: one bare line, the main button and a close mark, right of the middle, short of the right thumb's buttons;
   only the two buttons take touches */
#play-ui .nt-choice, #play-ui .nt-progress { position: absolute; bottom: var(--edge-b); right: var(--nt-cluster); max-width: calc(100vw - var(--edge-l) - var(--nt-cluster)); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#play-ui .nt-choice.nt-wait, #play-ui .nt-progress.nt-aside { visibility: hidden; }
#play-ui .nt-cline { margin: 0; max-width: 100%; font: 600 var(--nt-small)/1.3 var(--f-text); color: var(--text); text-align: right; overflow-wrap: anywhere; }
#play-ui .nt-crow { display: flex; align-items: center; gap: 4px; }
#play-ui .nt-choice button { pointer-events: auto; touch-action: manipulation; -webkit-tap-highlight-color: transparent; cursor: pointer; margin: 0; font: inherit; }
#play-ui .nt-act { min-height: var(--touch); min-width: var(--touch); max-width: 60vw; padding: 4px var(--s3); box-sizing: border-box; border-radius: var(--r2); border: 1px solid var(--paper); background: var(--paper); color: var(--on-paper);
  font: 700 var(--nt-text)/1.15 var(--f-text); text-shadow: none; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 1px 6px rgba(6, 9, 15, .35); }
#play-ui .nt-act:active { transform: scale(.985); }
#play-ui .nt-act kbd.nt-key { border-color: rgba(16, 20, 28, .45); color: var(--on-paper); background: transparent; }
#play-ui .nt-x { width: var(--touch); height: var(--touch); padding: 0; border: 0; background: transparent; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
#play-ui .nt-x::before { content: ""; width: 16px; height: 16px; background: currentColor; -webkit-mask: var(--i-close) center / contain no-repeat; mask: var(--i-close) center / contain no-repeat; filter: var(--nt-halo-mark); }
:where(#play-ui .nt-choice) button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
/* the Progress of what was chosen, in the Choice's place: bare words and a 3 px gold line */
#play-ui .nt-progress { align-items: stretch; min-width: 160px; font: 600 var(--nt-text)/1.3 var(--f-text); text-align: right; }
#play-ui .nt-progress small { font: 500 var(--nt-small)/1.3 var(--f-text); color: var(--nt-quiet); }
#play-ui .nt-progress i { display: block; height: 3px; margin-top: 4px; border-radius: 2px; background: rgba(255, 255, 255, .26); box-shadow: 0 0 0 1px rgba(6, 9, 15, .35); overflow: hidden; }
#play-ui .nt-progress i::after { content: ""; display: block; height: 100%; width: var(--k, 0%); background: var(--gold); }
/* a Direction: a gold chevron at the screen's edge with its name (for 6 s) and the distance, or a diamond on the place
   when it is in view; a threat is a red chevron with no words */
#play-ui .nt-marks { position: absolute; inset: 0; }
#play-ui .nt-mark { position: absolute; left: 0; top: 0; width: max-content; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 3px; will-change: transform; }
#play-ui .nt-mark i { width: 0; height: 0; border-left: 7px solid transparent; border-right: 7px solid transparent; border-bottom: 13px solid var(--gold); filter: var(--nt-halo-mark); }
#play-ui .nt-mark span { max-width: 120px; display: flex; flex-direction: column; align-items: center; text-align: center; }
#play-ui .nt-mark b { font: 600 var(--nt-small)/1.15 var(--f-text); overflow-wrap: anywhere; }
#play-ui .nt-mark small { font: 600 var(--nt-small)/1.15 var(--f-text); color: var(--text); font-variant-numeric: tabular-nums; }
#play-ui .nt-mark small:empty { display: none; }
#play-ui .nt-mark.here i { width: 9px; height: 9px; border: 0; background: var(--gold); transform: rotate(45deg) !important; border-radius: 1px; }
#play-ui .nt-mark.threat i { border-left-width: 9px; border-right-width: 9px; border-bottom: 18px solid var(--danger); }
@media (prefers-reduced-motion: reduce) { #play-ui .nt-root * { transition: none !important; } }

/* ---- notices batch 6: Cairn Country ---- */
/* (src/lands/hud.js hands every Cairn Country word to its kind; docs/ui/NOTICES.md rows 77-108.) The land under you is a
   Status row with a small flame: yours in your colour (the danger red when its fire burns low), someone else's in theirs. */
#play-ui .nt-status.nt-ic-land::before, #play-ui .nt-status.nt-ic-land-low::before, #play-ui .nt-status.nt-ic-land-foe::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px;
  background: var(--ld-me, var(--gold)); -webkit-mask: var(--i-flame) center / contain no-repeat; mask: var(--i-flame) center / contain no-repeat; filter: var(--nt-halo-mark); }
#play-ui .nt-status.nt-ic-land-low { color: var(--danger-text); }
#play-ui .nt-status.nt-ic-land-foe::before { background: var(--ld, #ff8a3c); }
/* the Choice's place with words only (what a cairn is while sitting by it, with no count running): no line under them */
#play-ui .nt-progress.nt-nobar i { display: none; }

/* ---- notices batch 5: modes ---- */
/* the mode chip (#md-bar, src/parts/modes/kit.js): the one Status row that can be tapped, first in the left column (so it
   never meets the column), glass like the Menu: 36 tall folded (its name, clock and score), a tap opens it (its name and
   numbers over its line, Skip and Leave); it folds by itself a few seconds after it opens. Its warning is the Alert at the
   top, not a red chip. While the top menu is unfolded the chip steps below its tiles (as the top stack does) */
#play-ui #md-bar { pointer-events: auto; position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name time score" "line line leave";
  align-items: center; gap: 2px 10px; max-width: 100%; min-height: 36px; box-sizing: border-box; padding: 3px 4px 4px 10px; margin: 0; color: var(--text); text-shadow: none;
  cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  background: var(--nt-glass); border: 1px solid var(--nt-glass-line); border-radius: 6px; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
#play-ui #md-bar:has(> button:first-of-type:not([hidden])) { grid-template-areas: "name time score" "line skip leave"; }      /* Skip beside Leave */
#play-ui .nt-root.nt-menu #md-bar { margin-top: max(0px, calc(var(--nt-top-y) - var(--nt-col-y))); }
#play-ui #md-bar::before { content: ""; position: absolute; inset: -4px 0; }      /* a 44 px hit area round the 36 px chip */
#play-ui #md-bar .md-txt { display: contents; }
#play-ui #md-bar .md-txt > *, #play-ui #md-bar > * { position: relative; }       /* (over that area, so its buttons take their own taps) */
#play-ui #md-bar .md-txt b { grid-area: name; min-width: 0; font: 600 var(--nt-small)/1.25 var(--f-text); color: var(--nt-quiet); overflow-wrap: anywhere; }
#play-ui #md-bar .md-txt span { grid-area: line; min-width: 0; font: 600 var(--nt-text)/1.3 var(--f-text); color: var(--text); overflow-wrap: anywhere; }
#play-ui #md-bar.md-noline .md-txt span { display: none; }
#play-ui #md-bar .md-num { font: 600 var(--nt-text)/1.1 var(--f-display); font-variant-numeric: tabular-nums; color: var(--text); text-align: center; }
#play-ui #md-bar .md-txt + .md-num { grid-area: time; } #play-ui #md-bar .md-num + .md-num { grid-area: score; }
#play-ui #md-bar .md-num small { display: inline; margin-left: 3px; font: 500 10px/1.3 var(--f-text); color: var(--nt-quiet); letter-spacing: .02em; }      /* beside the number: one short row */
#play-ui #md-bar button { min-height: var(--touch); min-width: var(--touch); padding: 0 var(--s2); font: 600 var(--nt-small)/1 var(--f-text); border-radius: 5px;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--nt-glass-line); color: var(--text); }
#play-ui #md-bar button:first-of-type { grid-area: skip; } #play-ui #md-bar button:last-of-type { grid-area: leave; }
#play-ui #md-bar button:active { background: var(--gold-tint); border-color: var(--gold); }
/* folded: one line, its name and the numbers (the label beside the number); Skip stays on a training chip */
#play-ui #md-bar.md-min { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 2px 10px; }
#play-ui #md-bar.md-min .md-txt b { color: var(--text); }
#play-ui #md-bar.md-min .md-txt span, #play-ui #md-bar.md-min button { display: none; }
#play-ui #md-bar.md-min.md-pin button:first-of-type:not([hidden]) { display: inline-flex; align-items: center; }
#play-ui #md-bar.md-min.md-pin { padding-right: 3px; }
#play-ui #md-bar:focus-visible, #play-ui #md-bar button:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
