/* Plasmoid Worlds — UI styles. Theme is set via [data-theme] on <html>. */
:root {
  --accent: #8fb3ff;
  --font-ui: "Manrope", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
  --radius: 20px;
  --ease: cubic-bezier(.2,.7,.2,1);
  --topbar-h: 64px;
  /* bottom cluster: nav bar, the dial above it, the description card above the dial */
  --nav-b: 22px; --nav-h: 46px;
  --dial-h: 60px; --dial-gap: 10px;
  --bar-w: min(968px, calc(100vw - 140px));   /* the dots glass bar and the dial share this width */
  --dial-b: calc(var(--nav-b) + var(--nav-h) + var(--dial-gap));
  --panel-b: calc(var(--dial-b) + var(--dial-h) + 14px);
  --gutter: clamp(16px, 2.5vw, 28px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}
/* World 1 (physical) always shows the dark cosmos, so in the light theme the chrome takes the dark token set while it is
   current (html.world-dark-scene, js/app.js syncSceneTone); the theme toggle keeps its light state. */
:root[data-theme="dark"], :root[data-theme="light"].world-dark-scene {
  color-scheme: dark;
  --bg: #07080c;
  --bg-rgb: 7, 8, 12;
  --fg: #f2f2f5;
  --fg-muted: rgba(242,242,245,.66);
  --fg-faint: rgba(242,242,245,.55);
  --panel: rgba(10,12,18,.52);
  --panel-strong: rgba(10,12,18,.8);
  --line: rgba(255,255,255,.1);
  --line-strong: rgba(255,255,255,.2);
  --btn: rgba(255,255,255,.06);
  --btn-hover: rgba(255,255,255,.14);
  --accent-ui: var(--accent);
  --accent-glow: rgba(143,179,255,.55);
  --shadow: 0 20px 60px rgba(0,0,0,.45);
}
:root[data-theme="light"], :root[data-theme="dark"].world-light-scene {
  color-scheme: light;
  --bg: #f4f3ef;
  --bg-rgb: 244, 243, 239;
  --fg: #15161a;
  --fg-muted: rgba(21,22,26,.68);
  --fg-faint: rgba(21,22,26,.6);
  --panel: rgba(255,255,255,.6);
  --panel-strong: rgba(255,255,255,.84);
  --line: rgba(0,0,0,.08);
  --line-strong: rgba(0,0,0,.18);
  --btn: rgba(255,255,255,.5);
  --btn-hover: rgba(255,255,255,.85);
  --accent-ui: #3b5aa0;
  --accent-glow: rgba(143,179,255,.45);
  --shadow: 0 20px 60px rgba(30,30,40,.18);
}
@supports (color: color-mix(in oklab, red 50%, blue)) {
  :root[data-theme="dark"], :root[data-theme="light"].world-dark-scene { --accent-ui: color-mix(in oklab, var(--accent) 80%, white); --accent-glow: color-mix(in oklab, var(--accent) 60%, transparent); }
  :root[data-theme="light"]:not(.world-dark-scene), :root[data-theme="dark"].world-light-scene { --accent-ui: color-mix(in oklab, var(--accent) 55%, black); --accent-glow: color-mix(in oklab, var(--accent) 45%, transparent); }
}

/* The colour tokens are registered so they interpolate: a theme toggle or entering / leaving world 1 in the light theme
   cross-fades the whole chrome over ~0.4 s instead of snapping (browsers without @property simply switch). */
@property --bg { syntax: "<color>"; inherits: true; initial-value: #07080c; }
@property --fg { syntax: "<color>"; inherits: true; initial-value: #f2f2f5; }
@property --fg-muted { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --fg-faint { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --panel { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --panel-strong { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --line { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --line-strong { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --btn { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --btn-hover { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --accent-ui { syntax: "<color>"; inherits: true; initial-value: #8fb3ff; }
@property --dial-bg { syntax: "<color>"; inherits: true; initial-value: transparent; }
@property --tick { syntax: "<color>"; inherits: true; initial-value: #fff; }
@property --veil-line { syntax: "<color>"; inherits: true; initial-value: #cfe3ff; }
@property --num-halo { syntax: "<color>"; inherits: true; initial-value: transparent; }
:root { transition: --bg .4s var(--ease), --fg .4s var(--ease), --fg-muted .4s var(--ease), --fg-faint .4s var(--ease),
  --panel .4s var(--ease), --panel-strong .4s var(--ease), --line .4s var(--ease), --line-strong .4s var(--ease),
  --btn .4s var(--ease), --btn-hover .4s var(--ease), --accent-ui .4s var(--ease); }
@media (prefers-reduced-motion: reduce) { :root { transition: none; } }

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }   /* no iOS text autosizing (it blew up the cover's credit line) */
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow: hidden; overscroll-behavior: none; touch-action: manipulation;
}
body.no-webgl { background: radial-gradient(120% 80% at 50% 100%, var(--accent-glow), var(--bg) 70%); }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--accent-ui); outline-offset: 3px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
body.no-webgl #scene { display: none; }
/* the context was lost, could not be restored and a fresh canvas failed too (js/app.js): say so instead of a silent dark screen */
.gl-fail { display: none; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 25; width: min(92vw, 420px); padding: 16px 18px; border-radius: 16px; text-align: center; background: rgba(var(--bg-rgb), .86); border: 1px solid var(--line); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.gl-fail p { margin: 0 0 12px; font-size: 14px; line-height: 1.45; }
body.gl-failed .gl-fail { display: block; }
/* iOS after a context loss: Safari is asked to give the picture back (js/app.js); a quiet line while we wait */
.gl-wait { display: none; position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 25; white-space: nowrap; padding: 10px 18px; border-radius: 999px; font-size: 14px; background: rgba(var(--bg-rgb), .8); border: 1px solid var(--line); color: var(--fg); }
body.gl-waiting:not(.gl-failed) .gl-wait { display: block; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 10; height: calc(var(--topbar-h) + var(--safe-t));
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: var(--safe-t) max(var(--gutter), var(--safe-r)) 0 max(var(--gutter), var(--safe-l));
  background: linear-gradient(to bottom, rgba(var(--bg-rgb), .55), transparent);
  background: linear-gradient(to bottom, color-mix(in srgb, var(--bg) 55%, transparent), transparent);
  transition: opacity .4s var(--ease), transform .4s var(--ease), visibility 0s;
  touch-action: none;
}
.brand { display: flex; flex-direction: column; text-decoration: none; min-width: 0; }
/* breadcrumb back to the mundusatlas.com cover (shown only when the worlds live under /material/) */
.brand-row { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
/* with the atlas name shown (under /material/) the bar carries only «Mundus Atlas» and a small line under it
   («59 уровней плотности материального мира»); the section name is dropped (owner 2026-10-19). Without the atlas link
   (local preview at the root) the section name stays */
.brand-row:has(.atlas-link:not([hidden])) .brand-title, :root.atlas .brand-title { display: none; }
.brand-row:has(.atlas-link:not([hidden])) .brand-sub, :root.atlas .brand-sub { margin-top: 2px; }   /* tight under the name (owner 2026-10-19) */
.atlas-link { font-family: "Cinzel", "Trajan Pro", var(--font-display); font-weight: 400; font-size: 18px; letter-spacing: .06em; line-height: 1; margin-bottom: 0;   /* the cover title's face (owner 2026-10-19) */
  color: var(--fg-muted); text-decoration: none; white-space: nowrap; transition: color .2s; }
.atlas-link:hover, .atlas-link:focus-visible { color: var(--fg); }
.atlas-link[hidden] { display: none; }
:root.atlas .atlas-link[hidden] { display: inline; }   /* set before first paint (index.html), so the old name never flashes */
.brand-title { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: .01em; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--fg-muted); letter-spacing: .06em; text-transform: uppercase; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.paused .brand-sub::after { content: " · " attr(data-paused); color: var(--accent-ui); }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center;
  background: var(--btn); border: 1px solid var(--line); color: var(--fg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.icon-btn:hover { background: var(--btn-hover); border-color: var(--line-strong); }
.icon-btn:active { transform: scale(.94); }
.icon-btn[aria-pressed="true"] { background: var(--accent-ui); color: var(--bg); border-color: transparent; }
.icon-btn[hidden] { display: none; }
.icon-btn svg { width: 19px; height: 19px; }
/* toggled icons */
.ic-moon, .ic-pause, .ic-collapse { display: none; }
:root[data-theme="light"] .ic-sun { display: none; }
:root[data-theme="light"] .ic-moon { display: block; }
body.autoplay .ic-play { display: none; }
body.autoplay .ic-pause { display: block; }
body.fullscreen .ic-expand { display: none; }
body.fullscreen .ic-collapse { display: block; }

.autoplay-bar { position: fixed; top: var(--safe-t); left: 0; height: 2px; width: 0; z-index: 11; background: var(--accent-ui); opacity: 0; }
body.autoplay .autoplay-bar { opacity: .9; animation: autoplay var(--autoplay-ms, 14000ms) linear forwards; }
@keyframes autoplay { from { width: 0 } to { width: 100% } }

/* ---------- radio dial: frequency tuning across all 59 levels (js/app.js "the radio dial") ---------- */
/* A glass strip above the dots bar (same width). The SVG tape (built in JS, 1 level = 52 px; phones 34 px) scrolls
   under the fixed needle; the current world's span is tinted, its numbers in the accent, the current level larger
   (no roman numerals on the dial: the dots bar names the worlds).
   Veil lines mark the world boundaries; while pressing one, .dial-veil glows and bows over it (no arrow / name chip). */
.dial {
  position: fixed; left: 50%; bottom: calc(var(--dial-b) + var(--safe-b)); transform: translateX(-50%); z-index: 10;
  width: var(--bar-w); height: var(--dial-h); border-radius: 16px; touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
  background: var(--dial-bg); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  --dial-bg: rgba(10,12,18,.7); --tick: #fff; --veil-line: #cfe3ff; --dial-acc: var(--accent); --num-halo: rgba(10,12,18,.55); --dial-light: #fff3e0;
  transition: opacity .4s var(--ease), transform .4s var(--ease), visibility 0s,
    --dial-bg .4s var(--ease), --tick .4s var(--ease), --veil-line .4s var(--ease), --num-halo .4s var(--ease);
}
.dial:active { cursor: grabbing; }
/* keyboard focus on the dial: no ring (owner 2026-10-19: it read as a glowing border) — the tape lifts a shade and the
   needle glows as while tuning */
.dial:focus-visible { outline: none; --dial-bg: rgba(24,27,36,.8); border-color: var(--line-strong); }
.dial:focus-visible .dial-needle { box-shadow: 0 0 14px var(--accent-glow), 0 0 3px var(--accent-ui); }
:root[data-theme="light"]:not(.world-dark-scene) .dial, :root[data-theme="dark"].world-light-scene .dial { --dial-bg: rgba(255,255,255,.78); --tick: #15161a; --veil-line: #6a7fa8; --dial-acc: var(--accent-ui); --num-halo: rgba(255,255,255,.7); --dial-light: #f3dcb0; }
.dial-view {
  position: absolute; inset: 0; overflow: hidden; border-radius: inherit;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.dial-tape { position: absolute; left: 0; top: 0; width: auto; height: 100%; overflow: visible; will-change: transform; stroke: none; fill: none; }
/* numbers get a thin halo of the glass colour, so they stay legible over bright worlds */
.dial-tape text { stroke: var(--num-halo); stroke-width: 2.5px; stroke-linejoin: round; paint-order: stroke; font-family: var(--font-ui); text-anchor: middle; font-variant-numeric: tabular-nums lining-nums; }
.dl-span { fill: var(--accent); fill-opacity: 0; transition: fill-opacity .5s var(--ease); }
.dl-cl.cur .dl-span { fill-opacity: .14; }
:root[data-theme="light"]:not(.world-dark-scene) .dl-cl.cur .dl-span, :root[data-theme="dark"].world-light-scene .dl-cl.cur .dl-span { fill-opacity: .2; }
.dl-maj { stroke: var(--tick); stroke-opacity: .55; stroke-width: 1.5; }
.dl-min { stroke: var(--tick); stroke-opacity: .14; stroke-width: 1; }   /* quieter (owner 2026-10-19; was .25) */
.dl-num { font-size: 11.5px; font-weight: 600; fill: var(--tick); fill-opacity: .58; transition: font-size .3s var(--ease), fill-opacity .3s; }
.dl-cl.cur .dl-maj { stroke: var(--dial-acc); stroke-opacity: 1; stroke-width: 1.7; }
.dl-cl.cur .dl-min { stroke: var(--dial-acc); stroke-opacity: .38; }
.dl-cl.cur .dl-num { fill: var(--accent-ui); fill-opacity: 1; }
.dl-cl.cur .dl-num.now { font-size: 15.5px; font-weight: 700; fill-opacity: 1; }
.dl-veil { stroke: var(--veil-line); stroke-opacity: .4; stroke-width: 1; }
/* past level 59: the tape fades into soft light (no end line, no ticks); it brightens with the flood (--beyond = f) */
.dl-beyond { font-size: 10.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; fill: var(--tick); fill-opacity: .42;
  text-anchor: start !important; dominant-baseline: central; }
/* the pressed boundary: a brighter line that bows toward the press and glows in the accent */
.dial-veil { --press: 0; position: absolute; left: 0; top: 0; width: 24px; height: 100%; pointer-events: none; opacity: calc(var(--press) * 1.6);
  filter: drop-shadow(0 0 calc(2px + var(--press) * 8px) var(--accent-glow)) drop-shadow(0 0 calc(var(--press) * 3px) var(--accent-ui)); }
.dial-veil svg { display: block; width: 24px; height: 100%; overflow: visible; stroke: var(--accent-ui); stroke-width: calc(1px + var(--press) * 1.5px); fill: none; }
/* fixed needle: through the tick band only, a small triangle on top */
.dial-needle {
  position: absolute; left: calc(50% - 1px); top: calc(var(--dial-h) * .17); height: calc(var(--dial-h) * .45); width: 2px; border-radius: 2px; pointer-events: none;
  background: var(--accent-ui); box-shadow: 0 0 8px var(--accent-glow), 0 0 2px var(--accent-ui); transition: box-shadow .4s var(--ease);
}
.dial-needle::before { content: ""; position: absolute; left: -4px; top: -6px; border: 5px solid transparent; border-bottom: 0; border-top: 6px solid var(--accent-ui); }
.dial.tuning .dial-needle { box-shadow: 0 0 14px var(--accent-glow), 0 0 3px var(--accent-ui); }
/* the flood beyond 59 (f > 0.5): the needle and the current level take the warm light instead of Purusha's accent —
   a warm-white needle with a golden glow and a warm gold number, so both stay legible on the light glass */
.dial-needle, .dial-needle::before { transition: box-shadow .4s var(--ease), background-color .4s var(--ease), border-top-color .4s var(--ease); }
html.beyond-light .dial-needle { background: #fff6e6; box-shadow: 0 0 10px rgba(226,176,92,.95), 0 0 2px rgba(176,128,52,.9); }
html.beyond-light .dial-needle::before { border-top-color: #e2b05c; }
html.beyond-light .dl-cl.cur .dl-num.now { fill: #9c6c22; }
/* sound chosen on the cover but not started yet: a short note under the sound button (app.js armSound) */
.sound-hint { position: fixed; top: calc(var(--topbar-h) + var(--safe-t) + 2px); right: max(var(--gutter), var(--safe-r)); z-index: 11; margin: 0;
  padding: 5px 13px; border-radius: 999px; font-size: 12.5px; line-height: 1.4; color: var(--fg); pointer-events: none; max-width: calc(100vw - 32px);
  background: var(--panel-strong); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transform: translateY(-4px); transition: opacity .5s var(--ease), transform .5s var(--ease); }
.sound-hint.show { opacity: 1; transform: none; }
.sound-hint[hidden] { display: none; }
body.ui-hidden .sound-hint { display: none; }

/* hint above the needle (js/app.js renderHint): a gesture glyph + a short line. The tuning hint (.hint-live) stays until
   the first tune and demonstrates it: the tape nudges toward level 2 and back, the needle breathes, the glyph moves
   (owner 2026-11-22). The tape nudge uses the `translate` property: JS sets `transform` on the tape every frame */
.dial-hint {
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px); margin: 0; width: max-content; max-width: calc(100vw - 32px);
  display: inline-flex; align-items: center; gap: 9px; padding: 5px 14px 5px 9px;
  border-radius: 999px; font-size: 12.5px; line-height: 1.4; text-align: left; color: var(--fg); pointer-events: none;
  background: var(--dial-bg); border: 1px solid var(--line); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  opacity: 0; transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.dial.hinting .dial-hint { opacity: 1; transform: translate(-50%, 0); }
.dial.hinting .dial-hint { border-color: color-mix(in oklab, var(--accent) 34%, transparent); box-shadow: 0 0 22px color-mix(in oklab, var(--accent) 20%, transparent); }
.dial-hint-g { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--accent-ui); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.dial-hint-g.touch { width: 34px; height: 21px; }
.dial-hint-g .tip { fill: var(--accent-ui); stroke: none; }
.dial-hint-g .ring { stroke-opacity: .45; }
.dial-hint-g .chev { stroke-opacity: .55; }
.dial-hint .act { color: var(--accent-ui); }
.dial.hint-live .dial-needle { box-shadow: 0 0 14px var(--accent-glow), 0 0 3px var(--accent-ui); }   /* reduced motion: a steady glow */
@media (prefers-reduced-motion: no-preference) {
  .dial.hint-live:not(.tuning) .dial-tape { animation: dial-nudge 3.2s var(--ease) infinite; }
  .dial.hint-live:not(.tuning) .dial-needle { animation: needle-breathe 3.2s ease-in-out infinite; }
  .dial.hint-live .dial-hint-g .wheel { animation: hint-wheel 3.2s var(--ease) infinite; }
  .dial.hint-live .dial-hint-g .finger { animation: hint-finger 3.2s var(--ease) infinite; }
}
@keyframes dial-nudge { 0%, 22% { translate: 0 0; } 50% { translate: -12px 0; } 78%, 100% { translate: 0 0; } }
@keyframes needle-breathe {
  0%, 22%, 100% { box-shadow: 0 0 8px var(--accent-glow), 0 0 2px var(--accent-ui); }
  50% { box-shadow: 0 0 18px var(--accent-glow), 0 0 4px var(--accent-ui); }
}
@keyframes hint-wheel { 0%, 18% { transform: none; } 46% { transform: translateY(3.5px); } 74%, 100% { transform: none; } }
@keyframes hint-finger { 0%, 18% { transform: none; } 50% { transform: translateX(-5px); } 78%, 100% { transform: none; } }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .dial { border-radius: 14px; -webkit-backdrop-filter: none; backdrop-filter: none; --dial-bg: rgba(10,12,18,.76); }
  :root[data-theme="light"]:not(.world-dark-scene) .dial, :root[data-theme="dark"].world-light-scene .dial { --dial-bg: rgba(255,255,255,.82); }
    .dl-num { font-size: 10.5px; }
  .dl-cl.cur .dl-num.now { font-size: 13.5px; }
  .dl-beyond { font-size: 9.5px; }
  .dial-hint { font-size: 12px; }
  .dial-hint.veil { border-radius: 18px; max-width: calc(100vw - 24px); }   /* the Veil's action on its own line */
  .dial-hint.veil .sep { display: none; }
  .dial-hint.veil .act { display: block; }
}
@media (prefers-reduced-motion: reduce) { .dl-num, .dl-span { transition: none; } }

/* ---------- beyond level 59: the chrome dims to ghosts in the flood (js/app.js beyondUI; --beyond = f, per frame) ----------
   opacity on the top bar's children and filter: opacity() on the boxes, so the hide-UI / switching transitions of
   .topbar / .panel / .dial / .nav (their own opacity) are untouched; the dial and arrows keep a thin presence. */
html.beyond-on .brand, html.beyond-on .topbar-actions { opacity: calc(1 - .85 * var(--beyond)); transition: none; }
html.beyond-on .panel { filter: opacity(calc(1 - .85 * var(--beyond))); }
html.beyond-on .dial, html.beyond-on .nav { filter: opacity(calc(1 - .55 * var(--beyond))); }

/* ---------- cluster card ---------- */
.panel {
  /* desktop: hung from the top under the bar, so its top edge stays put whatever the text length or the level caption
     (owner 2026-10-19; it used to stand on the dial and grow upward). Phones stand it on the dial (below). */
  position: fixed; left: max(var(--gutter), var(--safe-l)); top: calc(var(--topbar-h) + var(--safe-t) + 22px); bottom: auto; z-index: 9;
  width: min(460px, calc(100vw - 32px));
  max-height: calc(100vh - var(--topbar-h) - var(--panel-b) - 24px - var(--safe-b) - var(--safe-t));
  max-height: calc(100dvh - var(--topbar-h) - var(--panel-b) - 24px - var(--safe-b) - var(--safe-t));
  border-radius: var(--radius); padding: 22px 24px 20px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden; touch-action: none;
  background: var(--panel); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(20px) saturate(1.3); backdrop-filter: blur(20px) saturate(1.3);
  transition: opacity .45s var(--ease), transform .45s var(--ease), padding .42s var(--ease), border-radius .42s var(--ease), visibility 0s;
}
.panel.switching { opacity: 0; transform: translateY(10px); transition-duration: .25s; }
/* while the one-time dial hint shows, the card steps up so the hint never covers it (offset measured in app.js) */
.panel.hint-lift { transform: translateY(calc(-1 * var(--hint-lift, 0px))); }
.panel.hint-lift.switching { transform: translateY(calc(10px - var(--hint-lift, 0px))); }
.panel-head { display: flex; align-items: baseline; gap: 16px; }   /* the numeral and the name share one baseline (owner 2026-10-19) */
.panel-roman {
  font-family: var(--font-display); font-weight: 500; font-size: 44px; line-height: 1; color: var(--accent-ui);
  min-width: 58px; letter-spacing: .02em; text-shadow: 0 0 24px var(--accent-glow);
}
.panel-titles { min-width: 0; flex: 1; }
.panel-name { font-family: var(--font-display); font-weight: 500; font-size: 44px; line-height: 1; margin: 0 0 6px; letter-spacing: .005em; }   /* the numeral's size (owner 2026-10-19; was 34px) */
.panel-levels { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); overflow: hidden;
  transition: opacity .42s var(--ease), filter .42s var(--ease), transform .42s var(--ease), height .42s var(--ease); }
/* the habitat caption (js/app.js setCaption): «УРОВЕНЬ 22 · Плазмоиды (духи) …», the band muted below; crossfades per level */
.panel-levels.lv-out { opacity: 0; filter: blur(2px); transform: translateY(-2px); transition-duration: .26s; }
.panel-levels .lv-now { white-space: nowrap; }
.panel-levels .lv-hab { text-transform: none; letter-spacing: .01em; font-size: 12.5px; line-height: 1.4; }
.panel-levels .lv-band { display: block; margin-top: 3px; font-size: 11px; letter-spacing: .04em; text-transform: none; opacity: .72; font-variant-numeric: tabular-nums lining-nums; }
.panel-collapse { display: grid; width: 34px; height: 34px; margin: -2px -8px 0 0; border-radius: 50%; place-items: center; color: var(--fg-muted); flex: none; transition: background .2s, color .2s; }
.panel-collapse:hover { background: var(--btn-hover); color: var(--fg); }
.panel-collapse svg { transition: transform .35s var(--ease); }
.panel-range { display: none; }
.panel-more { display: none; }
.panel-toggle { display: none; width: 36px; height: 36px; border-radius: 50%; place-items: center; color: var(--fg-muted); flex: none; }
.panel-toggle svg { transition: transform .3s var(--ease); }
.panel-body { margin-top: 16px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 4px; border-radius: 8px; touch-action: pan-y; }
.panel-body p { margin: 0 0 10px; color: var(--fg); font-size: 14.5px; }
.panel-body p:last-child { margin-bottom: 0; }
.panel-body dl { margin: 0; display: grid; grid-template-columns: 1fr; gap: 18px 0; } /* ≈1.8× the old 10px between items (owner) */
.panel-body dt { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 4px; }
.panel-body dd { margin: 0; font-size: 14.5px; }
.panel-body dd.color-row { display: flex; align-items: flex-start; gap: 8px; flex-wrap: nowrap; }
.panel-body dd.color-row > span:last-child { min-width: 0; flex: 1 1 auto; }
.panel-body dd.color-row .swatch { margin-top: calc((1.5em - 12px) / 2); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 1px var(--line-strong) inset, 0 0 10px var(--accent-glow); flex: none; }
.panel-note { font-size: 12.5px; color: var(--fg-muted); margin-top: 10px; }

/* ---------- navigation ---------- */
.nav {
  position: fixed; left: 50%; bottom: calc(var(--nav-b) + var(--safe-b)); transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 24px); touch-action: none;
  transition: opacity .4s var(--ease), transform .4s var(--ease), visibility 0s;
}
.nav-arrow { width: 44px; height: 44px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  background: var(--btn); border: 1px solid var(--line); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background .2s, transform .2s var(--ease); }
.nav-arrow:hover { background: var(--btn-hover); }
.nav-arrow:active { transform: scale(.94); }
.dots {
  list-style: none; margin: 0; padding: 6px; display: flex; align-items: center; gap: 4px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  overflow-x: auto; scrollbar-width: none; max-width: calc(100vw - 140px); touch-action: pan-x;
}
@media (min-width: 761px) and (min-height: 501px), (min-width: 761px) and (pointer: fine) {
  .dots { width: var(--bar-w); }   /* fixed width, aligned with the dial; auto margins centre the dots without clipping */
  .dots > li:first-child { margin-left: auto; }
  .dots > li:last-child { margin-right: auto; }
}
.dots::-webkit-scrollbar { display: none; }
.dot {
  height: 32px; min-width: 32px; padding: 0 10px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--fg-muted); font-size: 12px; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums;
  transition: background .25s, color .25s, min-width .3s var(--ease); white-space: nowrap; flex: none;
}
.dot-num { font-family: var(--font-display); font-weight: 600; font-size: 14px; }
.dot-name { display: none; font-weight: 500; }
.dot:hover { background: var(--btn-hover); color: var(--fg); }
.dot.active { background: var(--accent-ui); color: var(--bg); box-shadow: 0 0 18px var(--accent-glow); }
.dot.active .dot-name { display: inline; }

/* ---------- hiding the UI ---------- */
.show-ui { position: fixed; right: max(18px, var(--safe-r)); bottom: calc(18px + var(--safe-b)); z-index: 12; width: 40px; height: 40px; border-radius: 50%; display: none; place-items: center;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  background: var(--btn); border: 1px solid var(--line); color: var(--fg-muted); opacity: .55; transition: opacity .3s; }
.show-ui:hover, .show-ui:focus-visible { opacity: 1; }
body.ui-hidden .topbar, body.ui-hidden .panel, body.ui-hidden .nav, body.ui-hidden .dial { opacity: 0; pointer-events: none; visibility: hidden; transition-delay: 0s, 0s, .4s; }
body.ui-hidden .topbar { transform: translateY(-12px); }
body.ui-hidden .panel { transform: translateY(12px); }
body.ui-hidden .nav { transform: translate(-50%, 12px); }
body.ui-hidden .dial { transform: translate(-50%, 12px); }
body.ui-hidden .show-ui { display: grid; }
body.ui-hidden.idle { cursor: none; }
body.ui-hidden.idle .show-ui { opacity: 0; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px;
  background: rgba(var(--bg-rgb), .55); background: color-mix(in srgb, var(--bg) 55%, transparent); -webkit-backdrop-filter: blur(22px) saturate(1.2); backdrop-filter: blur(22px) saturate(1.2);
  animation: fade .25s var(--ease); }
.overlay[hidden] { display: none; }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.overlay-inner { --ov-pad: clamp(18px, 3vw, 36px); width: min(1100px, 100%); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; overscroll-behavior: contain; border-radius: 24px; padding: 24px var(--ov-pad) 32px;
  background: var(--panel-strong); border: 1px solid var(--line); box-shadow: var(--shadow); animation: rise .35s var(--ease); }
.overlay-text { width: min(760px, 100%); }
@keyframes rise { from { transform: translateY(14px); opacity: 0 } to { transform: none; opacity: 1 } }
.overlay-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 calc(-1 * var(--ov-pad)) 18px; padding: 8px var(--ov-pad);
  position: sticky; top: -24px; z-index: 1;
  /* opaque: the panel tint laid over the page background, so scrolled text never shows through */
  background: linear-gradient(var(--panel-strong), var(--panel-strong)), rgb(var(--bg-rgb));
  background: linear-gradient(var(--panel-strong), var(--panel-strong)), var(--bg);
}
.overlay-head::after { /* soft fade under the header: the same two layers, each fading out */
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 16px; pointer-events: none;
  background: linear-gradient(var(--panel-strong), transparent), linear-gradient(rgb(var(--bg-rgb)), rgba(var(--bg-rgb), 0));
  background: linear-gradient(var(--panel-strong), transparent), linear-gradient(var(--bg), color-mix(in srgb, var(--bg) 0%, transparent));
}
.overlay-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.overlay-link {
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--btn); color: var(--fg);
  font-size: 13px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; transition: background .2s, border-color .2s;
}
.overlay-link:hover { background: var(--btn-hover); border-color: var(--line-strong); }
/* way back to the mundusatlas.com cover at the end of the grid and About (the header back-link is hidden on phones);
   shown only where the worlds live under /material/ (js/app.js, [data-atlas-home]) */
.overlay-foot { margin: 24px 0 0; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: center; }
.overlay-foot:has(> a[hidden]) { display: none; }
.atlas-home {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 18px 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--btn); color: var(--fg); text-decoration: none;
  font-size: 13px; font-weight: 600; letter-spacing: .02em; transition: background .2s, border-color .2s;
}
.atlas-home:hover, .atlas-home:focus-visible { background: var(--btn-hover); border-color: var(--line-strong); }
.atlas-home[hidden] { display: none; }
.atlas-home svg { width: 17px; height: 17px; flex: none; color: var(--fg-muted); }
.overlay-head h2 { font-family: var(--font-display); font-weight: 500; font-size: 32px; margin: 0; line-height: 1.1; }
.overlay-inner h3 { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-muted); margin: 26px 0 8px; }
.prose, .prose p { font-size: 15.5px; line-height: 1.6; }
.prose p { margin: 0 0 12px; }
p.prose { margin: 0 0 12px; }
.prose a { color: var(--accent-ui); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.keys { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; color: var(--fg-muted); font-size: 14px; }
kbd { font: 600 12px/1 var(--font-ui); padding: 4px 7px; border-radius: 6px; border: 1px solid var(--line-strong); background: var(--btn); color: var(--fg); margin-right: 2px; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.cards > li { display: flex; } /* cards in one row share its height */
.card { display: flex; flex-direction: column; gap: 6px; text-align: left; width: 100%; flex: 1 1 auto; padding: 16px 16px 14px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--btn);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; position: relative; overflow: hidden; }
.card::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, var(--card-accent), transparent 70%); opacity: .35; pointer-events: none; }
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); }
.card.active { border-color: var(--card-accent); }
/* opening the grid scrolls the active card into view (block: nearest): keep it clear of the sticky header (offset set in js/app.js) */
.cards .card { scroll-margin-top: var(--grid-head, 84px); scroll-margin-bottom: 16px; }
.card-roman { font-family: var(--font-display); font-size: 26px; font-weight: 500; line-height: 1; color: var(--card-accent); }
.card-name { font-family: var(--font-display); font-size: 24px; font-weight: 500; line-height: 1.1; }
.card-levels { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--fg-muted); }
.card-colors { font-size: 12.5px; color: var(--fg-muted); margin-top: 4px; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
@supports (color: color-mix(in oklab, red 50%, blue)) {
  .card { background: linear-gradient(160deg, color-mix(in oklab, var(--card-accent) 26%, transparent), transparent 60%), var(--btn); }
  .card::after { background: radial-gradient(circle, color-mix(in oklab, var(--card-accent) 55%, transparent), transparent 70%); opacity: .7; }
  .card:hover { box-shadow: 0 10px 30px color-mix(in oklab, var(--card-accent) 25%, transparent); }
  .card.active { border-color: color-mix(in oklab, var(--card-accent) 70%, var(--line-strong)); box-shadow: 0 0 0 1px color-mix(in oklab, var(--card-accent) 60%, transparent) inset; }
  .card-roman { color: color-mix(in oklab, var(--card-accent) 75%, var(--fg)); }
}

.debug { position: fixed; left: 10px; top: calc(72px + var(--safe-t)); z-index: 15; /* ?debug only: above the chrome, below overlays (20) and the intro (30) */ font: 11px/1.4 ui-monospace, Menlo, monospace; padding: 6px 8px; border-radius: 8px; background: rgba(0,0,0,.6); color: #9f9; white-space: pre; pointer-events: none; }
.debug[hidden] { display: none; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- mobile layout ---------- */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  :root { --topbar-h: 56px; --gutter: 12px; }
  .brand-sub { display: none; }
  .brand-title { font-size: 19px; }
  .atlas-link { font-size: 15px; margin-bottom: 0; }
  .icon-btn { width: 36px; height: 36px; }
  .icon-btn, .nav-arrow { -webkit-backdrop-filter: none; backdrop-filter: none; background: var(--panel-strong); }
  .topbar-actions { gap: 4px; }
  #btn-fs, #btn-hide { display: none; }
  :root { --nav-b: 16px; --dial-h: 50px; --dial-gap: 8px; --bar-w: calc(100vw - 24px - var(--safe-l) - var(--safe-r)); }
  .panel { left: 10px; right: 10px; width: auto; top: auto; bottom: calc(var(--dial-b) + var(--dial-h) + 10px + var(--safe-b)); padding: 14px 16px 14px;
    max-height: calc(100vh - var(--topbar-h) - var(--dial-b) - var(--dial-h) - 22px - var(--safe-b) - var(--safe-t));
    max-height: calc(100dvh - var(--topbar-h) - var(--dial-b) - var(--dial-h) - 22px - var(--safe-b) - var(--safe-t)); }
  /* the level line runs from the card's left edge like the body below it, not in the name's column (owner 2026-10-21):
     a grid with .panel-titles dissolved — numeral, name, toggle on the first row, the level line across the second */
  .panel-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 12px; }
  .panel-titles { display: contents; }
  .panel-roman { grid-area: 1 / 1; }
  .panel-name { grid-area: 1 / 2; }
  .panel-toggle { grid-area: 1 / 3; }
  .panel-levels { grid-area: 2 / 1 / 3 / -1; margin-top: -3px; }
  /* spacing (owner 2026-10-21: "unbalanced"): the level line hugs the name (≈ 14 px of air), the head block stands a
     little further from the sections (≈ 24 px) than they do from each other (18 px) */
  .panel-roman { font-size: 26px; min-width: 34px; }   /* phones: smaller numeral and name (owner 2026-10-21; was 32px) */
  .panel-name { font-size: 26px; margin: 0; }
  .panel-toggle { display: grid; }
  .panel-collapse { display: none; }   /* phones: the body toggle instead of the desktop collapse */
  .panel-body { display: none; margin-top: 22px; }
  .panel.expanded .panel-body { display: block; }
  .panel.expanded .panel-toggle svg { transform: rotate(180deg); }
  .panel-head { cursor: pointer; }
  /* collapsed: one small centred pill «Подробнее о мире ⌃» (owner 2026-10-21) — the world's name is already in the dots
     strip and the level on the dial, so the card's head only shows once it is opened */
  .panel:not(.expanded) { left: 0; right: 0; width: max-content; margin: 0 auto; padding: 0; border-radius: 17px; overflow: visible; }   /* half its height (999px would morph through an oval); visible: the tap area below */
  .panel:not(.expanded) .panel-head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }   /* still read by screen readers */
  .panel:not(.expanded) .panel-toggle { visibility: hidden; }
  .panel:not(.expanded) .panel-more { display: flex; }
  .panel.switching:not(.expanded):not(.hint-lift) { opacity: 1; transform: none; }   /* the pill is the same in every world */
  /* the size of the world chips in the dots strip (owner 2026-10-21): 32 px tall, 12 px text; the tap area stays 44 px */
  .panel-more { position: relative; flex: 1; align-items: center; justify-content: center; gap: 5px; min-height: 32px; padding: 0 10px 0 14px; font: 500 12px/1 var(--font-ui); letter-spacing: .02em; white-space: nowrap; }
  .panel-more::after { content: ""; position: absolute; inset: -6px -4px; }
  .panel-more svg { width: 14px; height: 14px; color: var(--fg-muted); }
  /* pill <-> card morph (js/app.js togglePanel): the box glides, the text fades in after it / out before it */
  .panel.morph { transition: opacity .45s var(--ease), transform .45s var(--ease), padding .42s var(--ease), border-radius .42s var(--ease), left .42s var(--ease), width .42s var(--ease), height .42s var(--ease), visibility 0s; }
  .panel.expanded .panel-head, .panel.expanded .panel-body { animation: fade .32s var(--ease) .22s both; }
  .panel:not(.expanded) .panel-more { animation: fade .28s var(--ease) .3s both; }
  .panel.fading .panel-head, .panel.fading .panel-body { opacity: 0; transition: opacity .14s; }
  .nav { gap: 6px; }
  .nav-arrow { width: 40px; height: 40px; }
  .dots { max-width: calc(100vw - 120px); }
  .overlay { padding: 10px; }
  .overlay-inner { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); border-radius: 18px; }
  .overlay-head h2 { font-size: 26px; }
  .cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .card { padding: 12px; }
  .card-name { font-size: 20px; }
  .card-colors { font-size: 11.5px; }
}
@media (max-height: 560px) and (min-width: 761px) and (pointer: fine) {
  .panel { padding: 14px 18px; }
  .panel-roman { font-size: 30px; }
  .panel-name { font-size: 30px; }
  :root { --dial-h: 50px; --dial-gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  body.autoplay .autoplay-bar { animation: none; width: 100%; }
}

/* ---------- sound and language buttons ---------- */
.ic-sound-on { display: none; }
body.sound-on .ic-sound-off { display: none; }
body.sound-on .ic-sound-on { display: block; }
/* sound chosen but not started yet (it starts at the first tap / click): a soft ring on the sound button */
body.sound-armed #btn-sound { box-shadow: 0 0 0 1px var(--accent-ui), 0 0 14px var(--accent-glow); }
.lang-btn span { font: 700 11.5px/1 var(--font-ui); letter-spacing: .06em; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) { #btn-about { display: none; } }

/* ---------- intro screen ---------- */
.intro { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; place-items: safe center; padding: 24px; overflow-y: auto; overscroll-behavior: contain;
  background: radial-gradient(120% 90% at 50% 60%, rgba(var(--bg-rgb), .35), rgba(var(--bg-rgb), .82));
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: opacity .8s var(--ease); }
.intro[hidden] { display: none; }
.intro-btn { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }   /* a long press on a phone selected the label's text */
.intro-lang { position: absolute; top: calc(var(--safe-t) + 14px); right: max(var(--gutter), var(--safe-r)); }   /* same switch as in the bar */
.intro.leaving { opacity: 0; pointer-events: none; }
.intro-inner { max-width: 620px; text-align: center; animation: rise .9s var(--ease); }
.intro-kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-muted); margin: 0 0 14px; }
.intro-title { font-family: var(--font-display); font-weight: 500; font-size: clamp(44px, 8vw, 84px); line-height: 1; margin: 0; letter-spacing: .01em; }
.intro-levels { margin: 22px 0 18px; font-family: var(--font-display); color: var(--accent-ui); text-shadow: 0 0 30px var(--accent-glow); }
.intro-count { font-size: 56px; font-variant-numeric: tabular-nums; display: inline-block; min-width: 2ch; }
.intro-of { font-size: 22px; color: var(--fg-muted); margin-left: 6px; }
.intro-text { font-size: 16px; line-height: 1.6; color: var(--fg-muted); margin: 0 auto 28px; max-width: 520px; }
.intro-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.intro-btn { padding: 12px 22px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--btn); font-weight: 600; font-size: 14px; transition: background .2s, transform .2s var(--ease); }
.intro-btn:hover { background: var(--btn-hover); }
.intro-btn.primary { background: var(--accent-ui); color: var(--bg); border-color: transparent; box-shadow: 0 0 28px var(--accent-glow); }
.intro-btn:active { transform: scale(.97); }
.intro-hint { margin: 22px 0 0; font-size: 12px; color: var(--fg-faint); letter-spacing: .03em; }
@media (max-height: 500px) {
  .intro { padding: 14px 24px; }
  .intro-kicker { margin-bottom: 8px; }
  .intro-title { font-size: clamp(34px, 11vh, 52px); }
  .intro-levels { margin: 10px 0 8px; }
  .intro-count { font-size: 38px; }
  .intro-of { font-size: 17px; }
  .intro-text { font-size: 14.5px; line-height: 1.5; margin-bottom: 16px; }
  .intro-btn { padding: 10px 20px; }
}
body.intro-open .topbar, body.intro-open .panel, body.intro-open .nav, body.intro-open .dial { opacity: 0; pointer-events: none; }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) { #btn-save { display: none; } }
@media (max-width: 760px), (pointer: coarse) { .intro-hint { display: none; } } /* keyboard hint: not on touch screens */

/* ---------- infographics: location schematic (card) and lifespan scale (About) ---------- */
.where { margin: 14px 0 0; padding: 10px 12px 6px; border-radius: 14px; background: var(--btn); border: 1px solid var(--line); }
.where figcaption { font-size: 11px; letter-spacing: .09em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 4px; }
.where svg { display: block; max-height: 150px; }
.about-life { margin: 4px 0 6px; }
.about-life .pm-life-dot { outline: none; }
.about-life .pm-life-dot:focus-visible { filter: drop-shadow(0 0 4px var(--accent-ui)); }
.pm-life-current { margin: 6px 0 2px; font-size: 14.5px; }
/* lifespan chart parts whose look depends on the current world (js/infographics.js toggles .is-current) */
.pm-life-lbl { fill: var(--fg-muted); font-weight: 500; transition: fill .25s; }
.pm-life-dot.is-current .pm-life-lbl { fill: var(--accent-ui); font-weight: 700; }
.pm-life-lead { stroke: var(--line-strong); stroke-width: .75; }
.pm-life-dot.is-current .pm-life-lead { stroke: var(--accent-ui); }
.pm-life-pt { fill: var(--bg); stroke: var(--fg-muted); stroke-width: 1.2; }
.pm-life-dot.is-current .pm-life-pt { opacity: 0; }
.pm-life-dot:hover .pm-life-lbl { fill: var(--fg); }
.pm-life-dot.is-current:hover .pm-life-lbl { fill: var(--accent-ui); }
.pm-life-caption { margin: 2px 0 0; font-size: 12px; color: var(--fg-muted); }
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) { .where svg { max-height: 120px; } }

/* the scene handles its own pinch (in-world zoom) instead of browser page zoom */
#scene { touch-action: none; }

/* ---------- description card collapsed to a pill (desktop; js/app.js setCollapsed, key D) ---------- */
@media (min-width: 761px) and (min-height: 501px), (min-width: 761px) and (pointer: fine) {
  .panel.morph { transition: opacity .45s var(--ease), transform .45s var(--ease), padding .42s var(--ease), border-radius .42s var(--ease), width .42s var(--ease), height .42s var(--ease), visibility 0s; }
  .panel.fading .panel-body { opacity: 0; transition: opacity .14s; }
  .panel:not(.collapsed) .panel-body { animation: fade .4s var(--ease) .12s both; }
  .panel.collapsed { width: auto; padding: 8px 10px 8px 20px; border-radius: 28px; cursor: pointer; }
  .panel.collapsed .panel-body, .panel.collapsed .panel-levels { display: none; }
  .panel.collapsed .panel-head { align-items: center; gap: 10px; }   /* numeral, name, range and chevron on the pill's centre line (owner 2026-10-21) */
  .panel.collapsed .panel-roman { font-size: 24px; min-width: 0; text-shadow: 0 0 14px var(--accent-glow); }
  .panel.collapsed .panel-titles { flex: none; }
  .panel.collapsed .panel-name { font-size: 24px; margin: 0; white-space: nowrap; }
  .panel.collapsed .panel-range { display: inline; line-height: 1; font-size: 12.5px; letter-spacing: .06em; color: var(--fg-muted); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
  .panel.collapsed .panel-range::before { content: "· "; }
  .panel.collapsed .panel-collapse { margin: 0; }
  .panel.collapsed .panel-collapse svg { transform: rotate(180deg); }
  .panel.collapsed:hover { border-color: var(--line-strong); }
}

/* ---------- touch screens: ≥ 44 px targets (top bar, arrows; the dial is ≥ 50 px tall) ---------- */
@media (pointer: coarse) {
  .icon-btn, .nav-arrow { width: 44px; height: 44px; }
  .panel-toggle { width: 44px; height: 44px; margin: -6px -8px -6px 0; }
}
@media (pointer: coarse) and (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .topbar-actions { gap: 2px; }
  .topbar { gap: 6px; padding-left: max(10px, var(--safe-l)); padding-right: max(10px, var(--safe-r)); }
  /* the site name stays on one line next to five 44 px buttons (iPhone SE: 375 px) */
  .brand-title { font-size: clamp(14px, 3.9vw, 19px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* landscape phones: the card keeps a readable width instead of spanning the whole screen */
@media (max-height: 500px) and (pointer: coarse) and (min-width: 761px) {
  .panel { right: auto; width: min(460px, calc(100vw - 20px - var(--safe-l))); left: max(10px, var(--safe-l)); }
}
/* phones: spacers in the dots strip so the first and last world can be centred too */
@media (max-width: 760px), (max-height: 500px) and (pointer: coarse) {
  .dots::before, .dots::after { content: ""; flex: none; width: max(0px, calc(50vw - 60px - 26px)); }
}
