* { box-sizing:border-box; }
[hidden] { display:none !important; }
html, body { height:100%; margin:0; overflow:hidden; background:#1c1620; color:#fff; font:15px/1.5 ui-rounded,"SF Pro Rounded","Arial Rounded MT Bold",system-ui,sans-serif; }
.visually-hidden { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
kbd { display:inline-block; padding:0 .45em; border-radius:5px; background:#ffffff26; font:inherit; font-weight:800; }

/* The game fills the whole window. */
.stage { position:fixed; inset:0; overflow:hidden; background:#1c1620; }
canvas { display:block; width:100%; height:100%; outline:none; }

/* HUD: drawn over the canvas, chunky and friendly. */
.hud { position:absolute; inset:0; pointer-events:none; font-family:ui-rounded,"SF Pro Rounded","Arial Rounded MT Bold",system-ui,sans-serif; }
.hearts { position:absolute; top:18px; left:20px; display:flex; gap:.4vw; }
.hearts i { width:30px; aspect-ratio:1; background:#ff4466; filter:drop-shadow(0 2px 0 #7a1024) drop-shadow(0 0 1px #000);
  clip-path:path('M15 27 C6 20 1 15 1 9 C1 4 5 1 9 1 C12 1 14 3 15 5 C16 3 18 1 21 1 C25 1 29 4 29 9 C29 15 24 20 15 27 Z'); }
.title-card { position:absolute; left:4%; bottom:7%; display:flex; flex-direction:column; color:#fff; text-shadow:0 2px 0 #3a2533, 0 0 12px #000a; opacity:0; }
.title-card.show { animation:title-card 4.5s ease forwards 0.4s; }
.title-card span { font-size:clamp(11px,1.3vw,15px); font-weight:700; letter-spacing:.14em; text-transform:uppercase; opacity:.85; }
.title-card strong { font-size:clamp(20px,3vw,38px); font-weight:800; letter-spacing:-.01em; }
@keyframes title-card { 0% { opacity:0; transform:translateY(8px); } 12%,75% { opacity:1; transform:none; } 100% { opacity:0; } }
.bubble { position:absolute; transform:translate(-50%,-100%); max-width:min(300px,32%); padding:.6em .9em; border-radius:14px; background:#fff; color:#3a1422;
  font-size:clamp(11px,1.25vw,15px); font-weight:700; line-height:1.3; text-align:center; box-shadow:0 3px 0 #c8203f, 0 8px 20px #0005; }
.bubble::after { content:""; position:absolute; left:50%; bottom:-9px; transform:translateX(-50%); border:9px solid transparent; border-bottom:0; border-top-color:#fff; }
.prompt { position:absolute; left:50%; bottom:6%; transform:translateX(-50%); padding:.4em .9em; border-radius:99px; background:#1b1420cc; color:#fff; font-weight:700; font-size:clamp(11px,1.2vw,14px); }
.prompt kbd { background:#fff; color:#1b1420; border:0; margin-right:.3em; font-weight:800; }
.dialog { --accent:#f2dfb4; --tag-ink:#3a2533; --bg:#1b1420e8; --ink:#fff;
  position:absolute; left:50%; bottom:5%; transform:translateX(-50%); width:min(640px,86%); padding:1.1em 1.5em 1.8em; border-radius:18px;
  background:var(--bg); color:var(--ink); border:3px solid var(--accent); box-shadow:0 10px 30px #0007; font:700 clamp(13px,1.6vw,19px)/1.45 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; }
.dialog p { margin:0; white-space:pre-line; }
.dialog__next { position:absolute; right:1em; bottom:.45em; font-size:.66em; font-weight:800; color:var(--accent); }
.dialog__next kbd { padding:0 .45em; border-radius:5px; background:var(--accent); color:var(--tag-ink); font-weight:900; }
.dialog__next i { display:inline-block; font-style:normal; animation:bob 1s ease-in-out infinite; }
.dialog--auto .dialog__next { display:none; }
@keyframes bob { 50% { transform:translateY(3px); } }

/* Chrome kept to the corners so the diorama gets the whole screen. */
.corner { position:absolute; top:16px; right:16px; display:flex; gap:8px; }
.corner a, .corner button { padding:.45em .9em; border:0; border-radius:99px; background:#1b1420b3; color:#fff; font:700 13px/1.4 inherit; font-family:inherit; text-decoration:none; cursor:pointer; backdrop-filter:blur(6px); }
.corner a:hover, .corner button:hover { background:#1b1420e6; }
.corner a:focus-visible, .corner button:focus-visible { outline:3px solid #7bb0ff; outline-offset:2px; }
.help { position:absolute; right:16px; bottom:12px; margin:0; color:#ffffffb3; font-size:12px; font-weight:700; text-shadow:0 1px 2px #000a; }
.toast { position:absolute; top:16px; left:50%; transform:translateX(-50%); margin:0; padding:.35em .9em; border-radius:99px; background:#1b1420cc; font-size:13px; font-weight:700; opacity:0; transition:opacity .3s; pointer-events:none; }
.toast.show { opacity:1; }
@media (max-width:600px) { .help { display:none; } }

/* The start screen: one click, so the browser allows sound. */
.gate { position:absolute; inset:0; z-index:20; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.4em;
  background:radial-gradient(ellipse at center, #1a2250 0%, #07081a 70%); transition:opacity .6s ease; }
.gate.gone { opacity:0; pointer-events:none; }
.gate__title { margin:0; font-size:clamp(34px,5vw,64px); font-weight:900; letter-spacing:-.02em; -webkit-text-stroke:2px #1f6fe0; paint-order:stroke fill; }
.gate__sub { margin:0 0 1.4em; font-size:clamp(15px,1.8vw,22px); font-weight:800; color:#ffd98a; }
.gate__start { padding:.7em 2.2em; border:0; border-radius:99px; background:#1f6fe0; color:#fff; font:800 clamp(16px,1.6vw,20px)/1 inherit; font-family:inherit; cursor:pointer;
  box-shadow:0 4px 0 #1450a8, 0 10px 30px #1f6fe066; transition:transform .12s ease, box-shadow .12s ease; }
.gate__start:hover { transform:translateY(-2px); }
.gate__start:active { transform:translateY(2px); box-shadow:0 2px 0 #1450a8; }
.gate__start:focus-visible { outline:3px solid #ffd98a; outline-offset:4px; }
.gate__hint { margin:1.2em 0 0; font-size:13px; font-weight:700; color:#ffffff99; }
/* An iPhone in Safari: how to get the whole screen – from the Home Screen
   (main.js shows it each time; the X puts it away). First of all, in front
   of the landscape notice (.rotate). */
.install { position:absolute; inset:0; z-index:45; display:flex; align-items:center; justify-content:center; overflow-y:auto;
  padding:calc(16px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
  background:#0b0a14; color:#fff; font:600 15px/1.45 system-ui, sans-serif; touch-action:pan-y; }
.install[hidden] { display:none; }
.install__box { width:min(30em, 100%); margin:auto; text-align:center; }
.install__icon { width:72px; height:72px; border-radius:18px; box-shadow:0 6px 20px #0008; }
.install h2 { margin:.4em 0 .3em; font-size:24px; font-weight:900; color:#ffd24a; }
.install p { margin:.3em 0; color:#ffffffd9; }
.install ol { display:inline-block; margin:.6em 0; padding-left:1.4em; text-align:left; }
.install li { margin:.35em 0; }
.install__share svg { width:1.05em; height:1.25em; vertical-align:-.25em; color:#4aa3ff; }
.install__note { font-size:13px; color:#ffffff99 !important; }
.install__close { position:absolute; top:calc(12px + env(safe-area-inset-top)); right:calc(12px + env(safe-area-inset-right)); width:44px; height:44px;
  border:0; border-radius:50%; background:#ffffff1f; color:#fff; font-size:20px; cursor:pointer; }
.install__browser { margin-top:.8em; padding:.6em 1.3em; border:1px solid #ffffff40; border-radius:99px; background:transparent; color:#ffffffcc; font:inherit; cursor:pointer; }

/* Cutscenes: letterbox bars, fade, and the HUD steps aside. */
.hud::before, .hud::after { content:""; position:absolute; left:0; right:0; height:0; background:#000; transition:height .7s ease; z-index:1; }
.hud::before { top:0; } .hud::after { bottom:0; }
.letterbox .hud::before, .letterbox .hud::after { height:11vh; }
.in-cutscene .hearts, .in-cutscene .corner, .in-cutscene .help, .in-cutscene .prompt, .in-cutscene .bubble { display:none; }
.skip-hint { position:absolute; right:18px; bottom:14px; margin:0; font-size:12px; font-weight:700; color:#ffffff99; display:none; z-index:2; }
.in-cutscene .skip-hint { display:block; }
.skip-hint__armed { display:none; color:#fff; }
.skip-hint.armed .skip-hint__armed { display:inline; } .skip-hint.armed .skip-hint__idle { display:none; }
.fade { position:absolute; inset:0; background:#000; opacity:1; pointer-events:none; z-index:10; }
.dialog { z-index:3; }
.dialog__name { position:absolute; top:-.95em; left:1.2em; padding:.15em .8em; border-radius:99px; background:var(--accent); color:var(--tag-ink); font-size:.8em; font-weight:800; }
.dialog--scene { bottom:13vh; }

.title-screen { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center; pointer-events:none;
  opacity:0; transition:opacity 1.2s ease; text-shadow:0 3px 0 #1a1030, 0 0 30px #0009; z-index:2; }
.title-screen.show { opacity:1; }
.title-screen__eyebrow { margin:0 0 .6em; font-size:clamp(11px,1.2vw,14px); font-weight:700; letter-spacing:.3em; text-transform:uppercase; color:#cfe0ff; }
.title-screen h2 { margin:0; font-size:clamp(44px,8vw,110px); font-weight:900; line-height:.95; letter-spacing:-.02em; color:#fff;
  -webkit-text-stroke:2px #1f6fe0; paint-order:stroke fill; }
.title-screen__sub { margin:.3em 0 0; font-size:clamp(18px,2.6vw,34px); font-weight:800; color:#ffd98a; }
.title-screen__press { margin-top:3.5em; font-size:clamp(12px,1.3vw,16px); font-weight:800; letter-spacing:.2em; text-transform:uppercase; animation:pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity:.35; } }

.phone { position:absolute; right:8%; top:50%; transform:translateY(-50%) translateY(30px) scale(.96); opacity:0; transition:opacity .35s ease, transform .35s ease;
  height:min(560px,70vh); aspect-ratio:9/17; padding:12px; border-radius:36px; background:#16181d; box-shadow:0 20px 60px #0009, inset 0 0 0 2px #333842; z-index:2; }
.phone.show { opacity:1; transform:translateY(-50%); }
.phone__screen { height:100%; padding:22px 16px; border-radius:26px; background:#f6f8fb; color:#1b2330; display:flex; flex-direction:column; gap:10px; font-size:13px; overflow:hidden; }
.phone__shop { margin:0; font-weight:900; font-size:15px; color:#e8456a; }
.phone__item { display:flex; gap:10px; align-items:center; padding:10px; border-radius:14px; background:#fff; box-shadow:0 2px 8px #0001; }
.phone__item div { flex:1; display:flex; flex-direction:column; } .phone__item small { color:#7a8494; } .phone__thumb { font-size:28px; }
.phone__label { margin:6px 0 0; font-size:11px; font-weight:800; color:#7a8494; text-transform:uppercase; letter-spacing:.08em; }
.phone__note { margin:0; min-height:5.2em; padding:10px; border-radius:12px; background:#fff; border:2px solid #1f6fe0; font-weight:600; line-height:1.35; }
.phone__note::after { content:"|"; animation:pulse 1s steps(1) infinite; color:#1f6fe0; }
.phone__buy { margin-top:auto; padding:12px; border:0; border-radius:14px; background:#1f6fe0; color:#fff; font:800 15px/1 inherit; font-family:inherit; transition:transform .15s; }
.phone__buy.pressed { transform:scale(.94); background:#1558bd; }
.phone__done { margin:0; padding:10px; border-radius:12px; background:#dff5e5; color:#1d7a3a; font-weight:900; text-align:center; display:flex; flex-direction:column; }
.phone__done small { font-weight:700; color:#3f8f58; }

.ticket { position:absolute; right:6%; top:18%; width:min(320px,36vw); padding:16px 20px; border-radius:16px; background:#fffdf6; color:#1b2330;
  box-shadow:0 12px 40px #0008; border-top:8px solid #1f6fe0; transform:translateX(calc(100% + 8vw)) rotate(3deg); opacity:0; transition:transform .5s cubic-bezier(.2,1.2,.4,1), opacity .3s; z-index:2; }
.ticket.show { transform:rotate(-2deg); opacity:1; }
.ticket__eyebrow { display:block; font-size:11px; font-weight:800; letter-spacing:.14em; text-transform:uppercase; color:#1f6fe0; }
.ticket strong { display:block; font-size:22px; font-weight:900; margin:.1em 0 .4em; }
.ticket dl { display:grid; grid-template-columns:auto 1fr; gap:2px 14px; margin:0; font-size:14px; } .ticket dt { color:#7a8494; font-weight:700; } .ticket dd { margin:0; font-weight:800; }

/* Narrator subtitles, set in the bottom letterbox bar like a storybook caption. */
.subtitle { position:absolute; left:50%; bottom:2.2vh; transform:translateX(-50%); width:min(900px,86%); margin:0; text-align:center; z-index:4;
  font:italic 600 clamp(14px,1.6vw,21px)/1.4 Georgia,"Iowan Old Style","Palatino Linotype",serif; color:#f4ead2; text-shadow:0 2px 6px #000;
  opacity:0; transition:opacity .5s ease; pointer-events:none; }
.subtitle.show { opacity:1; }

/* The dream's end: a glitching error across the screen. */
.glitch-text { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; margin:0; z-index:5; pointer-events:none;
  font:900 clamp(40px,8vw,120px)/1 ui-monospace,SFMono-Regular,Menlo,monospace; letter-spacing:.04em; color:#ff2a3a;
  text-shadow:-4px 0 #00e5ff, 4px 0 #ff00c8, 0 0 30px #ff2a3a; opacity:0; }
.glitch-text.show { opacity:1; animation:glitch .18s steps(2) infinite; }
@keyframes glitch { 0% { transform:translate(0,0) skewX(0); clip-path:inset(0 0 0 0); } 25% { transform:translate(-6px,2px) skewX(-8deg); clip-path:inset(10% 0 55% 0); }
  50% { transform:translate(5px,-3px); clip-path:inset(0 0 0 0); } 75% { transform:translate(-2px,4px) skewX(6deg); clip-path:inset(60% 0 5% 0); } }

.continued { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; margin:0; z-index:5; pointer-events:none;
  font:italic 700 clamp(26px,4vw,54px)/1 Georgia,"Iowan Old Style",serif; color:#f4ead2; text-shadow:0 3px 12px #000; opacity:0; transition:opacity 1s ease; }
.continued.show { opacity:1; }

/* The alarm: a red pulse at the edges of the screen. */
.alarm .stage::after { content:""; position:absolute; inset:0; pointer-events:none; z-index:1; box-shadow:inset 0 0 12vw #ff002a88; animation:alarm 1.25s ease-in-out infinite; }
@keyframes alarm { 50% { box-shadow:inset 0 0 4vw #ff002a22; } }

/* Debug: jump to a scene. */
.debug-bar { position:absolute; left:16px; bottom:12px; z-index:30; display:flex; align-items:flex-end; gap:8px; }
.debug-scene, .debug-gfx { display:flex; align-items:center; gap:6px; padding:4px 8px; border-radius:8px;
  background:#000a; color:#ffffffb3; font:700 11px/1 system-ui,sans-serif; }
.debug-gfx { flex-direction:column; align-items:flex-start; }
.debug-gfx summary { cursor:pointer; padding:3px 0; }
.debug-gfx #debug-fps { color:#8fd0ff; margin-left:.4em; }
.debug-gfx div { display:flex; flex-direction:column; gap:5px; padding:6px 0 3px; }
.debug-gfx label { display:flex; align-items:center; gap:6px; font-weight:600; cursor:pointer; }
.debug-scene select { font:600 12px system-ui,sans-serif; background:#1b1420; color:#fff; border:1px solid #ffffff44; border-radius:6px; padding:3px 6px; }
.debug-unlock { font:700 12px system-ui,sans-serif; padding:6px 10px; border-radius:8px; border:1px solid #ffffff44; background:#1b1420d9; color:#fff; cursor:pointer; }
.debug-unlock:hover { background:#2c2236; }

/* Points to the objective marker when it is off screen. */
.marker-arrow { position:absolute; width:0; height:0; z-index:2; pointer-events:none; transform:translate(-50%,-50%) rotate(var(--angle, 0rad)); }
.marker-arrow::before { content:""; position:absolute; left:-14px; top:-18px; width:0; height:0; border-top:18px solid transparent; border-bottom:18px solid transparent;
  border-left:30px solid #ffd24a; filter:drop-shadow(0 0 6px #ffb300) drop-shadow(0 2px 0 #9a6a00); animation:nudge .8s ease-in-out infinite; }
@keyframes nudge { 50% { transform:translateX(6px); } }

/* Reading something held up to the camera (Miss Picki's note). */
.read-hint { position:absolute; left:50%; bottom:3.5vh; transform:translateX(-50%); margin:0; z-index:4; padding:.35em .9em; border-radius:99px;
  background:#1b1420cc; color:#fff; font-size:13px; font-weight:700; opacity:0; transition:opacity .4s ease; pointer-events:none; }
.read-hint.show { opacity:1; }
.read-hint kbd { background:#fff; color:#1b1420; border:0; margin-right:.3em; font-weight:800; }

/* Item get: a card over the scene while Picki holds up what he found. */
/* (At the bottom: what he holds up over his head stays in view.) */
.item-get { position:absolute; left:50%; bottom:calc(11vh + 2vh); transform:translate(-50%, 12px) scale(.96); z-index:4; display:flex; flex-direction:column; align-items:center; gap:.35em;
  padding:1em 1.6em 1.1em; border-radius:18px; background:#1b1420e8; border:3px solid #ffd24a; box-shadow:0 0 40px #ffb30055, 0 12px 30px #0008;
  color:#fff; text-align:center; opacity:0; transition:opacity .4s ease, transform .4s ease; pointer-events:none; max-width:min(560px, 86%); }
.item-get.show { opacity:1; transform:translate(-50%, 0) scale(1); }
.item-get strong { font-size:clamp(20px,2.4vw,30px); font-weight:900; color:#ffd24a; }
.item-get span { font-size:clamp(13px,1.4vw,17px); font-weight:700; }
.item-get em { font-style:normal; font-size:13px; font-weight:700; color:#ffffffb3; }
.item-get small { margin-top:.4em; font-size:12px; font-weight:700; color:#ffffffb3; }
.item-get kbd { background:#fff; color:#1b1420; border:0; font-weight:800; }

/* Dialog boxes per speaker (data-style, from SPEAKER_STYLES in lines.js). */
.dialog[data-style="mum"] { --accent:#f4a7ba; --tag-ink:#4a1726; --bg:#2a1520ec; }
.dialog[data-style="dad"] { --accent:#8fc3ec; --tag-ink:#10263a; --bg:#121f2bec; }
.dialog[data-style="mila"] { --accent:#d9c4ff; --tag-ink:#2e1f4d; --bg:#221a33ec; border-radius:28px; font-style:italic; }
.dialog[data-style="gabel"] { --accent:#f0a030; --tag-ink:#1d1d1d; --bg:#1f1c17ee; border-radius:8px; padding-top:1.4em; }
.dialog[data-style="gabel"]::before { content:""; position:absolute; left:0; right:0; top:0; height:8px; border-radius:4px 4px 0 0;
  background:repeating-linear-gradient(-45deg, #f2c230 0 10px, #1d1d1d 10px 20px); }
.dialog[data-style="gabel"] .dialog__name { border-radius:4px; text-transform:uppercase; letter-spacing:.1em; top:-1.05em; }
.dialog[data-style="mystery"] { --accent:#6b1024; --tag-ink:#ff5a70; --bg:#0b0508f2; --ink:#ffd0d8; }
.dialog[data-style="mystery"] .dialog__name { animation:mystery .4s steps(2) infinite; }
.dialog[data-style="mystery"] p { text-shadow:1px 0 #ff2a4a88, -1px 0 #00e5ff55; }
@keyframes mystery { 50% { transform:translate(1px,-1px); opacity:.75; } }
.dialog[data-style="miss"] { --accent:#e8365a; --tag-ink:#fff; --bg:#1a0710f2; --ink:#ffe6ec; font-style:italic; box-shadow:0 0 28px #e8365a55, 0 10px 30px #0007; }
.dialog[data-style="miss"] .dialog__name::after { content:" ♥"; }
.dialog[data-style="note"] { --accent:#c9a15f; --tag-ink:#fff; --bg:#fff8e8f5; --ink:#3a2533; border-radius:6px; font-weight:600; }
.dialog[data-style="note"] .dialog__name { background:#1f6fe0; }

/* The ending: credits rolling over the morning town, the delivery slip, the end. */
.credits { position:absolute; inset:0; z-index:6; overflow:hidden; pointer-events:none; opacity:0; transition:opacity 1.2s ease;
  background:linear-gradient(180deg, #0008, #0002 30%, #0002 70%, #0008); }
.credits.show { opacity:1; }
.credits__roll { position:absolute; left:0; right:0; top:100%; display:flex; flex-direction:column; align-items:center; gap:1.2em; text-align:center; color:#fff;
  text-shadow:0 2px 10px #000a; }
.credits.rolling .credits__roll { animation:roll var(--roll, 14s) linear forwards; }
@keyframes roll { to { transform:translateY(calc(-100vh - 100%)); } }
.credits__title { margin:0; font:900 clamp(40px,6vw,80px)/1 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; -webkit-text-stroke:2px #1f6fe0; paint-order:stroke fill; }
.credits__subtitle { margin:-.6em 0 2em; font-size:clamp(18px,2.4vw,30px); font-weight:800; color:#ffd98a; }
.credits__label { margin:0; font-size:13px; font-weight:800; letter-spacing:.25em; text-transform:uppercase; color:#ffffffb3; }
.credits__name { margin:-.45em 0 2em; font:700 clamp(22px,3vw,36px)/1.2 Georgia,"Iowan Old Style",serif; }
.credits__thanks { margin:1em 0 0; font:italic 700 clamp(20px,2.6vw,32px)/1 Georgia,serif; color:#ffd98a; }

.slip { position:absolute; left:50%; top:50%; z-index:7; width:min(420px,86%); padding:1.4em 1.6em; transform:translate(-50%,-44%) rotate(-2deg); opacity:0;
  background:#fffdf6; color:#1b2330; border-radius:6px; box-shadow:0 20px 60px #0009; transition:opacity .6s ease, transform .6s ease;
  background-image:repeating-linear-gradient(0deg, transparent 0 26px, #dbe5f3 26px 27px); font:600 15px/1.5 ui-rounded,system-ui,sans-serif; pointer-events:none; }
.slip.show { opacity:1; transform:translate(-50%,-50%) rotate(-2deg); }
.slip__head { margin:0 0 .8em; font-weight:900; letter-spacing:.1em; text-transform:uppercase; color:#1f6fe0; }
.slip dl { display:grid; grid-template-columns:auto 1fr; gap:.2em 1.2em; margin:0; } .slip dt { color:#7a8494; } .slip dd { margin:0; font-weight:800; }
.slip__new { margin:.8em 0 0; font-weight:900; color:#1d7a3a; }
.slip__stamp { position:absolute; right:1.2em; bottom:1.4em; margin:0; padding:.2em .6em; border:4px solid #e0203f; border-radius:8px; color:#e0203f;
  font:900 22px/1 ui-monospace,Menlo,monospace; transform:rotate(-12deg); opacity:.85; }
.slip small { display:block; margin-top:1.2em; color:#7a8494; font-weight:700; }
.slip kbd { background:#1b2330; color:#fff; border:0; }

.the-end { position:absolute; inset:0; z-index:11; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1em;
  opacity:0; pointer-events:none; transition:opacity 1.5s ease; color:#fff; }
.the-end.show { opacity:1; }
.the-end p { margin:0; font:italic 700 clamp(40px,6vw,72px)/1 Georgia,serif; }
.the-end small { font-size:13px; font-weight:700; color:#ffffff99; }
.glitch-text.teaser { font-size:clamp(20px,3vw,40px); letter-spacing:.3em; text-shadow:0 0 16px #ff2a3a; animation:none; }

/* Dungeon HUD: empty hearts, and the keys you are carrying. */
.hearts i.empty { background:#3a2a30; filter:drop-shadow(0 2px 0 #1a1014) drop-shadow(0 0 1px #000); }
.keys { position:absolute; top:22px; left:140px; padding:.15em .6em; border-radius:99px; background:#1b1420b3; color:#ffd24a; font-weight:800; font-size:15px; }

/* The storey you are on, under the hearts, in its colour (rooms/floors.js). */
.storey { position:absolute; top:58px; left:20px; display:flex; align-items:center; gap:.5em; padding:.2em .75em .2em .3em; border-radius:99px;
  background:#1b1420cc; color:#fff; font:800 14px/1.2 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; }
.storey b { padding:.1em .55em; border-radius:99px; background:var(--storey,#f2c230); color:#1b1420; letter-spacing:.04em; }
.in-cutscene .storey, .in-cutscene .keys { display:none; }

/* The Lagerplan: every storey side by side, the rooms you have seen. */
.lagerplan { position:absolute; inset:0; z-index:5; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.6em;
  background:#0a0709e6; color:#f2dfb4; font:800 15px ui-rounded,"SF Pro Rounded",system-ui,sans-serif; }
.lagerplan h3 { margin:0; font-size:clamp(20px,2.4vw,30px); letter-spacing:.08em; text-transform:uppercase; }
.lagerplan canvas { width:min(96vw, 1500px); aspect-ratio:3.2; max-height:62vh; }
.lagerplan p { margin:0; opacity:.8; }

.storey i { font-style:normal; font-weight:700; opacity:.75; padding-left:.5em; border-left:1px solid #ffffff33; }
.storey kbd, .lagerplan kbd { padding:0 .35em; border-radius:4px; background:#ffffff22; font:inherit; }
.lagerplan__intro { max-width:min(640px,90vw); text-align:center; line-height:1.45; padding:.6em 1em; border-radius:12px; background:#ffd24a1f; border:2px solid #ffd24a; color:#ffe9a8; opacity:1 !important; }

/* The menu (menu.js): the main menu over the sleeping town, the pause menu
   over the game. Chunky rounded pills like the rest of the HUD; the selected
   item is the one lit up, whether chosen by keys, pad or mouse. */
.menu { position:absolute; inset:0; z-index:12; display:flex; align-items:center; justify-content:flex-start; padding:0 max(16px, 7vw);
  background:linear-gradient(90deg, #07081acc 0%, #07081a88 38%, #07081a00 70%); color:#fff; }
.menu[data-panel="brightness"], .menu[data-panel="confirm"], .menu--pause { justify-content:center; background:#07081ab8; backdrop-filter:blur(3px); }
.menu__panel { display:flex; flex-direction:column; gap:.9em; width:min(420px, 100%); max-height:calc(100vh - 110px); animation:menu-in .35s ease both; }
.menu__panel--wide { width:min(620px, 100%); }
.menu__panel--brightness { width:min(640px, 100%); align-items:stretch; text-align:center; }
.menu__panel--confirm, .menu__panel--pause { width:min(460px, 100%); text-align:center; }
@keyframes menu-in { from { opacity:0; transform:translateY(10px); } }
.menu__logo { margin-bottom:1em; white-space:nowrap; text-shadow:0 3px 0 #1a1030, 0 0 30px #0009; }
.menu__eyebrow { margin:0 0 .5em; font-size:clamp(10px,1.1vw,13px); font-weight:700; letter-spacing:.3em; text-transform:uppercase; color:#cfe0ff; }
.menu__logo h2 { margin:0; font-size:clamp(40px,6.5vw,92px); font-weight:900; line-height:.95; letter-spacing:-.02em; -webkit-text-stroke:2px #1f6fe0; paint-order:stroke fill; }
.menu__sub { margin:.25em 0 0; font-size:clamp(17px,2.2vw,28px); font-weight:800; color:#ffd98a; }
.menu__title { margin:0 0 .2em; font-size:clamp(24px,3vw,38px); font-weight:900; letter-spacing:-.01em; -webkit-text-stroke:1.5px #1f6fe0; paint-order:stroke fill; }
.menu__text { margin:0; font-size:15px; font-weight:700; line-height:1.45; color:#ffffffcc; }
.menu__list { display:flex; flex-direction:column; gap:.45em; }
.menu__scroll { display:flex; flex-direction:column; gap:.4em; overflow-y:auto; min-height:0; padding:4px 6px 4px 2px; margin:0 -6px 0 -2px; scrollbar-width:thin; scrollbar-color:#ffffff44 transparent; }
.menu__group { margin:.8em 0 .1em; font-size:11px; font-weight:800; letter-spacing:.22em; text-transform:uppercase; color:#ffd98a; }
.menu__group:first-child { margin-top:0; }
.menu__row { display:flex; gap:.6em; justify-content:center; }
.menu__row .menu__item { flex:1; justify-content:center; text-align:center; }
.menu__foot { margin:.6em 0 0; font-size:12px; font-weight:700; color:#ffffff88; }
/* The key legend along the bottom of every menu screen. */
.menu__keys { position:absolute; left:50%; bottom:14px; transform:translateX(-50%); display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:.2em .5em;
  width:max-content; max-width:calc(100vw - 32px); margin:0; padding:.35em .9em; border-radius:99px; background:#1b1420cc; backdrop-filter:blur(6px);
  font-size:12px; font-weight:700; color:#ffffffcc; white-space:nowrap; }
.menu__keys kbd { background:#fff; color:#1b1420; margin-right:.15em; font-weight:800; }
.menu__keys kbd + kbd { margin-left:-.05em; }
.menu__keys span { opacity:.4; }

.menu__item { position:relative; display:flex; align-items:center; gap:.8em; width:100%; min-height:46px; padding:.55em 1.1em; border:0; border-radius:99px;
  background:#1b1420b3; color:#fff; font:800 clamp(15px,1.5vw,18px)/1.2 ui-rounded,"SF Pro Rounded","Arial Rounded MT Bold",system-ui,sans-serif; text-align:left;
  cursor:pointer; outline:none; backdrop-filter:blur(6px); transition:background .12s ease, transform .12s ease, box-shadow .12s ease; }
.menu__item.is-selected { background:#1f6fe0; box-shadow:0 4px 0 #1450a8, 0 8px 24px #1f6fe055; transform:translateX(6px); }
.menu__row .menu__item.is-selected, .menu__panel--brightness .menu__item.is-selected, .menu__panel--confirm .menu__item.is-selected, .menu__panel--pause .menu__item.is-selected { transform:translateY(-2px); }
.menu__item:focus-visible { outline:3px solid #ffd98a; outline-offset:2px; }
.menu__item:disabled { cursor:default; color:#ffffff66; background:#1b142073; }
.menu__label { flex:1; }
.menu__detail { font-size:12px; font-weight:700; color:#ffffffa6; text-align:right; }
.menu__item.is-selected .menu__detail { color:#ffffffd9; }
.menu__item--quiet { background:#1b142080; font-weight:700; }
.menu__item--danger.is-selected { background:#c8203f; box-shadow:0 4px 0 #7a1024; }
.menu__item--back { margin-top:.4em; }

/* Switches and sliders. */
.menu__toggle b, .menu__slider b { min-width:3.2em; font-size:14px; text-align:right; }
.menu__toggle[aria-checked="true"] b { color:#ffd98a; }
.menu__item.is-selected.menu__toggle[aria-checked="true"] b { color:#fff; }
.menu__track { position:relative; flex:1.3; height:10px; border-radius:99px; background:#ffffff26; cursor:pointer; }
.menu__track::before { content:""; position:absolute; inset:-12px 0; }   /* a bigger target to click */
.menu__track i { position:absolute; left:0; top:0; bottom:0; border-radius:inherit; background:#ffd98a; }
.menu__slider.is-selected .menu__track i { background:#fff; }
.menu__slider { cursor:default; flex-wrap:wrap; }
.menu__slider .menu__detail { flex-basis:100%; text-align:left; }

/* The Klangarchiv: a play mark, and how far the playing track has got. */
.menu__item--sound { border-radius:16px; }
.menu__play { flex:none; width:0; height:0; border-top:7px solid transparent; border-bottom:7px solid transparent; border-left:11px solid currentColor; opacity:.7; }
.menu__item--sound.is-playing .menu__play { width:11px; height:12px; border:0; border-left:4px solid currentColor; border-right:4px solid currentColor; opacity:1; }
.menu__item--sound.is-playing::after { content:""; position:absolute; left:14px; right:14px; bottom:5px; height:3px; border-radius:99px;
  background:linear-gradient(90deg, #ffd98a calc(var(--progress, 0) * 100%), #ffffff26 0); }
.menu__item--chapter { border-radius:16px; }

/* Brightness: the game's darkest colour on black, its brightest on white. */
.menu__tiles { display:flex; gap:clamp(12px,3vw,32px); justify-content:center; margin:.4em 0 .6em; }
.menu__tiles figure { margin:0; display:flex; flex-direction:column; gap:.5em; flex:1; max-width:min(220px, 26vh); }
.menu__tile { --tile:#000; aspect-ratio:1; border-radius:18px; background:var(--tile); display:flex; align-items:center; justify-content:center; box-shadow:0 10px 30px #0008; }
.menu__tile svg { width:62%; }
.menu__tile--light { --tile:#fff; }
.menu__tiles figcaption { font-size:13px; font-weight:800; color:#ffffffb3; }

/* The HUD and the corner chrome step aside for the menu. */
.in-menu:not(.in-pause) .hud, .in-menu .corner, .in-menu .help, .in-menu .title-screen { display:none; }
.in-pause .prompt, .in-pause .bubble { display:none; }
@media (max-width:600px) {
  .menu { justify-content:center; background:#07081ab8; }
  .menu__item.is-selected { transform:none; }
}

/* The dungeon items he has (with their keys), under the storey label. */
.items-bar { position:absolute; top:92px; left:20px; display:flex; gap:.4em; font:800 13px/1.2 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; color:#fff; }
.items-bar span { padding:.2em .6em; border-radius:99px; background:#1b1420cc; }
.items-bar kbd { padding:0 .35em; border-radius:4px; background:#ffffff22; font:inherit; }
.in-cutscene .items-bar { display:none; }

/* Hearts and keys in one row: the keys sit level with the hearts and move
   along as hearts are added. */
.vitals { position:absolute; top:18px; left:20px; display:flex; align-items:center; gap:.9em; }
.vitals .hearts, .vitals .keys { position:static; }
.vitals .keys { display:flex; align-items:center; gap:.3em; height:26px; }
.vitals .keys[hidden] { display:none; }
.in-cutscene .vitals .keys { display:none; }

/* The boss's name, big across the screen as the fight begins. */
.boss-title { position:absolute; left:0; right:0; top:34%; z-index:4; display:flex; flex-direction:column; align-items:center; gap:.1em;
  pointer-events:none; opacity:0; transform:scale(1.15); transition:opacity .35s ease, transform .6s cubic-bezier(.2,.9,.2,1);
  font-family:ui-rounded,"SF Pro Rounded",system-ui,sans-serif; text-shadow:0 4px 0 #3a0f30, 0 0 30px #ff3aa0aa; }
.boss-title.show { opacity:1; transform:scale(1); }
.boss-title span { font-weight:800; font-size:clamp(14px,1.6vw,20px); letter-spacing:.4em; text-transform:uppercase; color:#ffb8e4; }
.boss-title strong { font-weight:900; font-size:clamp(46px,7vw,96px); line-height:1; color:#fff; letter-spacing:.02em; }
.boss-title em { font-style:normal; font-weight:800; font-size:clamp(18px,2.2vw,30px); color:#ff5fc8; }

/* The trailer (cutscenes/trailer.js): title cards and the closing logo, over
   the picture and the fade. The debug chrome steps aside, and the skip hint
   shows for a moment at the start (and again once Esc is pressed). */
.trailer { position:absolute; inset:0; z-index:11; pointer-events:none; }
.trailer__card { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; margin:0; padding:0 16px; text-align:center;
  font:italic 700 clamp(22px,3.4vw,46px)/1.2 Georgia,"Iowan Old Style","Palatino Linotype",serif; color:#f4ead2; text-shadow:0 3px 14px #000;
  opacity:0; transform:scale(.98); transition:opacity .35s ease, transform 2.5s ease-out; }
.trailer__card.show { opacity:1; transform:scale(1.03); }
.trailer__card--over { align-items:flex-end; padding-bottom:calc(11vh + 3vh); font-size:clamp(20px,2.8vw,38px); }
.trailer__card--big { font:900 clamp(40px,7vw,96px)/1 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; font-style:normal;
  color:#fff; -webkit-text-stroke:2px #1f6fe0; paint-order:stroke fill; }
.trailer__logo { position:absolute; inset:0; display:flex; flex-direction:column; align-items:center; justify-content:center; text-align:center;
  text-shadow:0 3px 0 #1a1030, 0 0 30px #0009; opacity:0; transform:scale(.96); transition:opacity 1.2s ease, transform 3s ease-out; }
.trailer__logo.show { opacity:1; transform:scale(1); }
.trailer__logo h2 { margin:0; font-size:clamp(48px,9vw,124px); font-weight:900; line-height:.95; letter-spacing:-.02em; -webkit-text-stroke:2px #1f6fe0; paint-order:stroke fill; }
.trailer__sub { margin:.3em 0 0; font-size:clamp(18px,2.6vw,34px); font-weight:800; color:#ffd98a; }
.trailer__play { margin:2.2em 0 0; padding:.45em 1.2em; border-radius:99px; background:#1f6fe0; font-size:clamp(13px,1.4vw,17px); font-weight:800; text-shadow:none; box-shadow:0 4px 0 #1450a8; }
.in-trailer .debug-bar, .in-trailer .corner, .in-trailer .help { display:none; }
.no-dev-bar .debug-bar { display:none; }
.in-trailer .skip-hint { animation:trailer-hint 4s ease forwards; }
.in-trailer .skip-hint.armed { animation:none; opacity:1; }
@keyframes trailer-hint { 0%, 70% { opacity:1; } 100% { opacity:0; } }
.in-trailer .hud > * { display:none !important; }
/* In the tower montage his hearts and item bar are shown, as in play. */
.in-trailer.trailer-hud .hud > .vitals, .in-trailer.trailer-hud .hud > .items-bar:not([hidden]) { display:flex !important; }
.in-trailer.trailer-hud .hearts { display:flex; }
.in-trailer.trailer-hud .vitals { top:calc(11vh + 1.5vh); }
.in-trailer.trailer-hud .items-bar { top:calc(11vh + 6.5vh); }
/* Miss Picki's own lines: pink, rounded, glowing (the narrator's are serif). */
.trailer__card--miss { font:italic 800 clamp(22px,3vw,40px)/1.2 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; color:#ff7ab8; letter-spacing:.02em;
  text-shadow:0 0 18px #ff2d8acc, 0 2px 10px #000; }
.trailer__card--small { align-items:center; justify-content:center; padding:0; font:700 18px/1 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; font-style:normal; color:#ffffff99; text-shadow:none; animation:pulse 1.6s ease-in-out infinite; }
.trailer__item { position:absolute; right:4vw; top:calc(11vh + 2.2vh); margin:0; padding:.35em .9em .35em .4em; border-radius:99px; background:#1b1420cc;
  font:800 clamp(13px,1.4vw,18px)/1.2 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; color:#ffd24a; opacity:0; transform:translateX(10px); transition:opacity .2s ease, transform .2s ease; }
.trailer__item.show { opacity:1; transform:none; }
.trailer__item kbd { background:#ffd24a; color:#1b1420; margin-right:.35em; }
.in-trailer .toast { top:calc(11vh + 1.5vh); }
/* The trailer's seekbar: shown while the mouse moves, a mark per section. */
.trailer__seek { position:absolute; left:4vw; right:4vw; bottom:calc(11vh + 1.5vh); display:flex; align-items:center; gap:.8em; padding:.5em .9em; border-radius:99px;
  background:#1b1420cc; backdrop-filter:blur(6px); color:#fff; font:700 12px/1 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; pointer-events:auto;
  opacity:0; transition:opacity .25s ease; }
.trailer__seek.show { opacity:1; }
.trailer__track { position:relative; flex:1; display:flex; align-items:center; }
.trailer__track input { width:100%; margin:0; accent-color:#ffd24a; cursor:pointer; }
.trailer__ticks { position:absolute; left:8px; right:8px; top:50%; height:0; pointer-events:none; }
.trailer__ticks i { position:absolute; top:-7px; width:2px; height:14px; margin-left:-1px; border-radius:1px; background:#ffffff66; }
#trailer-seek-time { min-width:6.5em; text-align:right; font-variant-numeric:tabular-nums; }
.trailer-recording .skip-hint, .trailer-recording .trailer__seek { display:none !important; }

/* Bonus → Figuren: the character's card beside the turntable (gallery.js). */
.menu__panel--characters { width:min(400px, 100%); }
.menu__card { display:flex; flex-direction:column; gap:.25em; padding:1em 1.2em 1.1em; border-radius:18px; background:#1b1420b3; backdrop-filter:blur(6px); min-height:12.5em; }
.menu__card .menu__group { margin:0; }
.menu__name { margin:0; font-size:clamp(26px,3vw,38px); font-weight:900; letter-spacing:-.01em; line-height:1.05; color:#fff; }
.menu__role { margin:0 0 .4em; font-size:14px; font-weight:800; color:#ffd24a; }
.menu__card .menu__text { font-size:14px; }
.menu__item--flip { justify-content:space-between; }
.menu__item--flip .menu__label { flex:1; text-align:center; }
.menu__flip { display:inline-flex; align-items:center; justify-content:center; width:1.8em; height:1.8em; border-radius:50%; background:#ffffff1f; cursor:pointer; }
.menu__flip:hover { background:#ffffff40; }
.menu[data-panel="characters"] { background:linear-gradient(90deg, #07081acc 0%, #07081a66 34%, #07081a00 55%); }


/* The any% TAS (Bonus menu): its clock in the corner, its time at the end. */
.tas-clock { position:absolute; top:16px; right:16px; display:flex; align-items:center; gap:.3em; margin:0; padding:.3em .35em .3em .9em; border-radius:99px; background:#1b1420cc;
  font:700 14px/1 ui-rounded,"SF Pro Rounded",system-ui,sans-serif; font-variant-numeric:tabular-nums; z-index:6; }
.tas-clock[hidden] { display:none; }
.tas-speed { display:flex; gap:2px; margin-left:.5em; }
.tas-speed button { padding:.35em .6em; border:0; border-radius:99px; background:transparent; color:#ffffffaa; font:inherit; cursor:pointer; }
.tas-speed button:hover { color:#fff; background:#ffffff1a; }
.tas-speed button[aria-pressed="true"] { background:#ffd24a; color:#1b1420; }
.tas-speed button:focus-visible { outline:2px solid #ffd98a; outline-offset:1px; }
/* With its scenes the letterbox covers the top edge: the clock sits below it. */
.tas-scenes.letterbox .tas-clock { top:calc(11vh + 12px); }
.tas-clock b { color:#ffd24a; margin-right:.3em; }
.tas-done { position:absolute; inset:0; z-index:12; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.35em; background:#07081ae6; text-align:center; padding:0 16px; }
.tas-done span { font-size:clamp(15px,1.8vw,22px); font-weight:800; color:#ffd98a; }
.tas-done strong { font-size:clamp(44px,8vw,96px); font-weight:900; font-variant-numeric:tabular-nums; -webkit-text-stroke:2px #1f6fe0; paint-order:stroke fill; }
.tas-done em { font-style:normal; font-size:14px; font-weight:700; color:#ffffffaa; }
.tas-done small { margin-top:1.4em; font-size:13px; font-weight:700; color:#ffffff99; }
.in-tas .skip-hint, .in-tas .corner { display:none !important; }

/* The performance check at the first start: a plain notice covering the
   test scene (.perf-check--hide; without it, with &perfVisible, the scene is
   seen under a small box). */
.perf-check { position:absolute; left:50%; top:1.2em; transform:translateX(-50%); z-index:19; padding:.8em 1.4em; border-radius:14px;
  background:rgba(12,10,20,.78); color:#fff; text-align:center; font-weight:700; min-width:16em; }
.perf-check--hide { inset:0; left:0; top:0; transform:none; border-radius:0; display:flex; flex-direction:column; align-items:center; justify-content:center; background:#0b0a12; }
.perf-check__title { margin:0; font-size:1.1em; }
.perf-check__step { margin:.3em 0 .6em; font-weight:500; opacity:.8; }
.perf-check__bar { height:6px; border-radius:3px; background:rgba(255,255,255,.15); overflow:hidden; }
.perf-check--hide .perf-check__bar { width:min(16em, 60vw); margin-top:.9em; }
.perf-check__bar i { display:block; height:100%; width:0; background:#ffd24a; transition:width .3s ease; }

/* ── Touch (touch.js): phones and tablets ─────────────────────────────────
   The controls show only in play (.touch__… .is-play); keyboard hints give
   way to them. Safe areas keep them off the notch and the home bar. */
.touch { position:absolute; inset:0; z-index:12; pointer-events:none; display:none;
  -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
body.touch-ui .touch { display:block; }
.touch.is-play .touch__zone, .touch.is-play .touch__pad, .touch.is-play .touch__btn--top { visibility:visible; }
.touch__zone, .touch__pad, .touch__btn--top { visibility:hidden; }
.touch__zone { position:absolute; left:0; top:0; bottom:0; width:48%; pointer-events:auto; touch-action:none; }
.touch__base { position:absolute; width:128px; height:128px; margin:-64px 0 0 -64px; border-radius:50%;
  background:rgba(255,255,255,.08); border:2px solid rgba(255,255,255,.28); opacity:0; transition:opacity .12s; }
.touch__base.is-on { opacity:1; }
.touch__knob { position:absolute; left:50%; top:50%; width:58px; height:58px; border-radius:50%;
  background:rgba(255,255,255,.55); box-shadow:0 2px 10px rgba(0,0,0,.35); transform:translate(-50%, -50%); }
.touch__pad { position:absolute; right:calc(14px + env(safe-area-inset-right)); bottom:calc(16px + env(safe-area-inset-bottom));
  width:230px; height:210px; pointer-events:none; }
.touch__btn { position:absolute; display:flex; align-items:center; justify-content:center; text-align:center;
  border-radius:50%; background:rgba(20,18,32,.55); border:2px solid rgba(255,255,255,.35); color:#fff;
  font:700 12px/1.1 system-ui, sans-serif; pointer-events:auto; touch-action:none; box-shadow:0 2px 10px rgba(0,0,0,.3); }
.touch__btn[hidden] { display:none; }
.touch__btn.is-down { background:rgba(255,210,74,.55); border-color:#ffd24a; transform:scale(.94); }
.touch__btn--jump { width:86px; height:86px; right:0; bottom:0; font-size:13px; background:rgba(47,127,224,.55); }
.touch__btn--cut { width:74px; height:74px; right:96px; bottom:6px; background:rgba(210,60,60,.5); }
.touch__btn--use { width:68px; height:68px; right:22px; bottom:98px; }
.touch__btn--use.is-ready { border-color:#ffd24a; box-shadow:0 0 0 3px rgba(255,210,74,.35), 0 2px 10px rgba(0,0,0,.3); }
.touch__btn--item { width:54px; height:54px; font-size:11px; }
.touch__btn--shield { right:170px; bottom:84px; }
.touch__btn--hook { right:108px; bottom:112px; }
.touch__btn--bomb { right:170px; bottom:146px; }
.touch__btn--top { position:absolute; top:calc(10px + env(safe-area-inset-top)); width:48px; height:48px; font-size:12px; pointer-events:auto; }
.touch__btn--pause { right:calc(12px + env(safe-area-inset-right)); font-size:18px; }
.touch__btn--plan { right:calc(68px + env(safe-area-inset-right)); }
/* Keyboard hints make no sense on a phone: the keys go, the words stay. */
body.touch-ui .help, body.touch-ui .menu__keys { display:none; }
body.touch-ui kbd { display:none; }
.touch-only { display:none; }
body.touch-ui .touch-only { display:inline; }
body.touch-ui .storey i, body.touch-ui .corner { display:none; }
body.touch-ui .stage { touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
/* Held upright: the game is only played on its side. A notice covers it
   all (the game pauses, main.js) until the phone is turned. */
.rotate { display:none; }
@media (orientation: portrait) {
  body.touch-ui .rotate { position:absolute; inset:0; z-index:40; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:.6em;
    padding:2em; text-align:center; background:#0b0a14; color:#fff; font:700 15px/1.4 system-ui, sans-serif; touch-action:none; }
  body.touch-ui .rotate strong { font-size:22px; font-weight:900; }
  body.touch-ui .rotate span:last-child { color:#ffffffb3; }
}
.rotate__phone { width:46px; height:78px; margin-bottom:.8em; border:4px solid #fff; border-radius:10px; position:relative; animation:rotate-turn 2.4s ease-in-out infinite; }
.rotate__phone::after { content:""; position:absolute; left:50%; bottom:5px; width:12px; height:4px; margin-left:-6px; border-radius:2px; background:#fff; }
@keyframes rotate-turn { 0%, 25% { transform:rotate(0); } 50%, 85% { transform:rotate(-90deg); } 100% { transform:rotate(0); } }
/* A phone on its side is short: a menu taller than the screen scrolls (the
   main menu's own list still scrolls inside it). */
@media (max-height: 520px) {
  body.touch-ui .menu { align-items:flex-start; overflow-y:auto; -webkit-overflow-scrolling:touch; touch-action:pan-y;
    padding-top:calc(12px + env(safe-area-inset-top)); padding-bottom:calc(12px + env(safe-area-inset-bottom)); }
  body.touch-ui .menu__panel { margin-block:auto; max-height:none; gap:.6em; }
  body.touch-ui .menu__logo { margin-bottom:.3em; }
  body.touch-ui .menu__logo h2 { font-size:clamp(30px, 11vh, 56px); }
  body.touch-ui .menu__title { font-size:22px; }
}
/* (The skip hint moves up out of the subtitles' way, where a thumb reaches it.) */
body.touch-ui .skip-hint { top:calc(12px + env(safe-area-inset-top)); bottom:auto; right:calc(16px + env(safe-area-inset-right)); padding:.6em .9em; }
