﻿:root {
  color-scheme: dark;   /* the page is already dark: browsers' forced dark modes must leave its colours alone */
  --bg: #05031a;
  --panel: rgba(18, 12, 46, 0.94);
  --panel2: #1b1242;
  --ink: #120a1f;
  --cyan: #3ff0ff;
  --pink: #ff3fd8;
  --yellow: #ffe53f;
  --green: #5bff7a;
  --red: #ff5b7a;
  --violet: #8a5cff;
  --gold: #ffc83f;
  /* Fills for buttons with WHITE text: deep enough for white letters to read clearly (never white on the bright neon tones). */
  --cyan-btn: #0a6f92;
  --green-btn: #137a36;
  --text: #f2eeff;
  --muted: #c4bcec;
  /* One fine pixel family, thin strokes. Reading text, buttons, labels: Galmuri14 at 16px.
     Headings and big numbers: Galmuri14 regular at 21 / 28 / 42px (1.5x, 2x, 3x of its 14px grid, no bold).
     Tiny tags: Galmuri11 at 12px. */
  --font: 'Galmuri14', 'Galmuri11', 'Courier New', monospace;
  --bold: 'Galmuri14', 'Galmuri11', 'Courier New', monospace;
  --tiny: 'Galmuri11', 'Galmuri14', 'Courier New', monospace;
  --head: var(--bold);
  --body: var(--font);
  --tag: 400 12px/1.3 var(--tiny);
  --label: 400 16px/1.25 var(--font);
  /* The header and the speakers' names: a thicker cut at a whole multiple, so letters never wobble. */
  --hdr: 400 20px/1 'Galmuri9', var(--font);
  /* Polished gold bar: a bright top face, two diagonal shine streaks, deep amber underneath, dark brown edge. Hard stops = pixel bands. */
  --gold-bar: linear-gradient(112deg, transparent 0 22%, rgba(255, 255, 235, 0.6) 22% 27%, transparent 27% 33%, rgba(255, 255, 235, 0.35) 33% 35%, transparent 35%),
    linear-gradient(180deg, #fff8cc 0 14%, #ffe36a 14% 32%, #ffcc22 32% 56%, #f2a40c 56% 78%, #c97400 78% 100%);
  --gold-edge: 0 0 0 3px #4a2400, 0 0 16px rgba(255, 196, 40, 0.45), inset 0 2px 0 0 #fffbe6, inset 0 -3px 0 0 #8a4600, inset 2px 0 0 0 #ffe9a0, inset -2px 0 0 0 #a85e00;
  --name: 700 12px/1.3 'Galmuri11', var(--tiny);
  --read: 16px;
  --bar: 60px;
}

* { box-sizing: border-box; font-synthesis: none; }
b, strong { font-weight: 400; color: #fff; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 400 var(--read)/1.3 var(--font); overflow: hidden; -webkit-font-smoothing: none; font-smooth: never; }
a { color: var(--cyan); }
canvas { image-rendering: pixelated; }
button { font: inherit; }
p { margin: 0 0 12px; }
::selection { background: var(--pink); color: #fff; }
.label { font: var(--tag); text-transform: uppercase; color: var(--cyan); }
[hidden] { display: none !important; }

/* Pixel frame: 3px border with stepped (two-pixel) corners. Set --bc for the colour. */
.px {
  --bc: var(--cyan);
  background: var(--panel);
  box-shadow:
    0 -3px 0 0 var(--bc), 0 3px 0 0 var(--bc), -3px 0 0 0 var(--bc), 3px 0 0 0 var(--bc),
    0 -6px 0 -3px var(--bc), 0 6px 0 -3px var(--bc), -6px 0 0 -3px var(--bc), 6px 0 0 -3px var(--bc),
    inset 0 3px 0 0 rgba(255, 255, 255, 0.07), inset 0 -3px 0 0 rgba(0, 0, 0, 0.25);
  margin: 6px;
}
.px.pink { --bc: var(--pink); }
.px.yellow { --bc: var(--yellow); }
.px.violet { --bc: var(--violet); }
.glow { filter: drop-shadow(0 0 10px rgba(63, 240, 255, 0.35)); }
.px.pink.glow { filter: drop-shadow(0 0 12px rgba(255, 63, 216, 0.45)); }
.px.yellow.glow { filter: drop-shadow(0 0 14px rgba(255, 229, 63, 0.45)); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 400 16px/1 var(--font); text-transform: uppercase; text-decoration: none;
  color: var(--ink); background: var(--yellow); border: 0; padding: 10px 16px 12px; margin: 5px; cursor: pointer;
  box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink),
    inset -3px -3px 0 0 rgba(0, 0, 0, 0.25), inset 3px 3px 0 0 rgba(255, 255, 255, 0.45);
}
.btn:hover { filter: brightness(1.1); }
.btn:active { transform: translateY(2px); box-shadow: 0 -3px 0 0 var(--ink), 0 3px 0 0 var(--ink), -3px 0 0 0 var(--ink), 3px 0 0 0 var(--ink), inset 3px 3px 0 0 rgba(0, 0, 0, 0.3); }
.btn:disabled { filter: grayscale(1) brightness(0.7); cursor: not-allowed; }
.btn.cyan { background: var(--cyan-btn); color: #fff; }
.btn.pink { background: #d42aae; color: #fff; }
.btn.green { background: var(--green-btn); color: #fff; }
.btn.red { background: #c9254a; color: #fff; }
.btn.gold { background: var(--gold-bar); color: #2a0f00; }
.btn.ghost { background: var(--panel2); color: var(--text); }
.btn.ghost.on { background: var(--cyan-btn); color: #fff; }
.btn.small { padding: 6px 10px 8px; }
.btn.big { padding: 14px 24px 16px; }
.btn.snd.off { opacity: 0.5; text-decoration: line-through; }
.chip { background: var(--panel2); color: var(--muted); border: 0; padding: 6px 12px 8px; cursor: pointer; font: var(--label); text-transform: uppercase; }
.chip.on { background: var(--cyan-btn); color: #fff; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.center-row { justify-content: center; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- layout ---------- */
#space-bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; image-rendering: pixelated; }
#space { position: fixed; inset: 0; z-index: 1; }
/* Drifting planets: slow, back and forth along the edges of the window. They turn round before they reach the
   globe in the middle, so none of them ever slides behind it. */
#planets { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#planets canvas { position: absolute; image-rendering: pixelated; will-change: transform; }
#planets .p-giant { right: 2vw; top: 7vh; animation: drift-giant 160s ease-in-out infinite alternate; }
#planets .p-ocean { left: -3vw; bottom: 2vh; animation: drift-ocean 210s ease-in-out infinite alternate; }
#planets .p-red { left: 4vw; top: 12vh; animation: drift-red 120s ease-in-out infinite alternate; }
#planets .p-moon { left: 24vw; top: 3vh; animation: drift-moon 90s ease-in-out infinite alternate; }
@keyframes drift-giant { to { transform: translate(-3vw, 48vh); } }
@keyframes drift-ocean { to { transform: translate(5vw, -30vh); } }
@keyframes drift-red { to { transform: translate(5vw, 22vh); } }
@keyframes drift-moon { to { transform: translate(46vw, 2vh); } }
/* A tall phone has free sky above and below the globe, not beside it. */
@media (max-aspect-ratio: 1/1) {
  #planets .p-giant { right: 2vw; top: 9vh; animation-name: drift-giant-tall; }
  #planets .p-ocean { left: -12vw; bottom: 3vh; animation-name: drift-ocean-tall; }
  #planets .p-red { left: 4vw; top: 20vh; animation-name: drift-red-tall; }
  #planets .p-moon { left: 60vw; top: auto; bottom: 22vh; animation-name: drift-moon-tall; }
  @keyframes drift-giant-tall { to { transform: translate(-44vw, 5vh); } }
  @keyframes drift-ocean-tall { to { transform: translate(52vw, -5vh); } }
  @keyframes drift-red-tall { to { transform: translate(34vw, -9vh); } }
  @keyframes drift-moon-tall { to { transform: translate(-40vw, 4vh); } }
}
@media (prefers-reduced-motion: reduce) { #planets canvas { animation: none; } }
#space .globe-canvas { width: 100% !important; height: 100% !important; image-rendering: pixelated; touch-action: none; display: block; }
#space.aiming .globe-canvas { cursor: crosshair; }

.topbar {
  position: relative; z-index: 40; height: var(--bar); display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: rgba(5, 3, 26, 0.92); border-bottom: 3px solid #2a1a6a; box-shadow: 0 3px 0 0 rgba(63, 240, 255, 0.15);
}
.brand { display: flex; align-items: center; text-decoration: none; padding: 0 4px 4px; }
/* Neon sign: coloured letters with a soft glow of the same colour (white letters with a cyan halo were unreadable). */
.brand b { font: 700 22px/1 'Galmuri11', var(--bold); color: var(--cyan); text-shadow: 0 0 10px rgba(63, 240, 255, 0.45); animation: neon 7s linear infinite; }
.brand b i { font-style: normal; color: #ff6ae4; text-shadow: 0 0 10px rgba(255, 63, 216, 0.5); }
/* A tired neon sign: steady most of the time, two short dips per cycle. */
@keyframes neon { 0%, 46%, 49%, 52%, 86%, 88%, 100% { opacity: 1; } 47.5% { opacity: 0.72; } 50.5% { opacity: 0.85; } 87% { opacity: 0.8; } }
@media (prefers-reduced-motion: reduce) { .brand b { animation: none; } }
.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 6px 10px 8px; font: var(--hdr); text-transform: uppercase; }
.nav a:hover, .nav a.on { color: #fff; background: var(--cyan-btn); }
/* About: the head of the WitchHouse cat in its witch hat */
.nav a.cat-link { display: grid; place-items: center; width: 49px; height: 44px; padding: 0; margin-left: 4px; background: none; }
.nav a.cat-link canvas { width: 45px; height: 42px; display: block; }
.nav a.cat-link:hover, .nav a.cat-link.on { background: none; filter: drop-shadow(0 0 6px var(--cyan)) brightness(1.15); }
/* The bug-report robot drifts in space just under the bar. */
.bug-btn { position: fixed; z-index: 35; left: 10px; top: calc(var(--bar) + 10px); width: 48px; height: 48px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(10, 30, 22, 0.85); box-shadow: 0 0 0 3px var(--green), 0 0 14px rgba(91, 255, 122, 0.5); display: grid; place-items: center; animation: bob 3s ease-in-out infinite alternate; }
.bug-btn:hover { background: #124a2c; }
.bug-btn canvas { width: 32px; height: 32px; display: block; }
/* Time Travel: the PRO tier, in gold */
.tt-btn { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 2px 8px; border: 0; cursor: pointer; font: var(--hdr); text-transform: uppercase;
  color: #2a0f00; background: var(--gold-bar); box-shadow: var(--gold-edge); }
.tt-btn:hover { filter: brightness(1.08) saturate(1.1); }
.tt-btn canvas { width: 40px; height: 22px; display: block; }
.snd-btn { flex: 0 0 auto; width: 40px; height: 44px; background: var(--panel2); color: var(--cyan); border: 0; cursor: pointer; font: 400 16px/1 var(--font); padding: 0 0 4px; }
.snd-btn.off { color: #8a84b8; text-decoration: line-through; }
.auth-chip { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; cursor: pointer; background: var(--panel2); padding: 3px 10px 3px 3px; border: 0; color: var(--text); font: var(--hdr); max-width: 240px; }
.auth-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-bottom: 3px; }
.auth-chip canvas { flex: 0 0 auto; width: 48px !important; height: 48px !important; }

.view { position: relative; z-index: 10; display: none; height: calc(100dvh - var(--bar)); overflow-y: auto; padding: 18px 16px 40px; pointer-events: none; }
.view.on { display: block; }
.view > * { pointer-events: auto; }
.view.solid { background: rgba(5, 3, 26, 0.86); pointer-events: auto; padding-top: 70px; }   /* room for the bug robot floating at the top-left */
.wrap { max-width: 920px; margin: 0 auto; }

/* ---------- footer ---------- */
.foot { max-width: 920px; margin: 34px auto 0; padding: 14px 6px 0; border-top: 3px solid #22185a; color: var(--muted); font: var(--tag); text-transform: uppercase; display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; text-align: center; }
.foot a, .foot button { color: var(--muted); background: none; border: 0; padding: 0; font: inherit; text-transform: inherit; cursor: pointer; text-decoration: underline; }
.foot a:hover, .foot button:hover { color: var(--cyan); }
#v-home .foot { background: rgba(5, 3, 26, 0.8); padding: 10px; border: 0; max-width: 600px; margin-top: 14px; margin-bottom: 190px; }

/* ---------- home ---------- */
.home-card { max-width: 620px; padding: 20px; margin: 2vh auto 0; text-align: center; }
.home-card h1 { font: 400 28px/1.15 var(--bold); margin: 4px 0 10px; color: var(--yellow); text-shadow: 3px 3px 0 var(--ink); }
.home-card .date { font: var(--label); color: var(--cyan); text-transform: uppercase; }
.home-card .lead { color: #e6e0ff; }
.home-ship { display: block; margin: -6px auto 4px; animation: bob 2.4s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(-5px) rotate(-2deg); } to { transform: translateY(5px) rotate(2deg); } }
.lineup { display: flex; justify-content: center; gap: 8px; margin: 12px 0 14px; }
.lineup > div { background: var(--panel2); padding: 8px 8px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; font: var(--tag); color: var(--muted); min-width: 68px; }
.lineup > div.vip { box-shadow: inset 0 0 0 3px var(--yellow); color: var(--yellow); }
.lineup canvas { filter: brightness(0) drop-shadow(0 0 0 #3a2a7a) opacity(0.75); }
.loot-note { margin: 10px 0 0; }
.draft-banner { position: fixed; z-index: 45; top: var(--bar); right: 0; background: #c0209c; color: #fff; font: var(--tag); text-transform: uppercase; padding: 4px 8px; pointer-events: none; opacity: 0.85; }

/* ---------- windows (modals) ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: rgba(5, 3, 26, 0.8); display: grid; place-items: center; padding: 14px; overflow-y: auto; }
.win { width: min(640px, 100%); --bc: var(--pink); }
.win-head { display: flex; align-items: center; gap: 10px; background: var(--bc); color: var(--ink); padding: 6px 8px 8px 12px; font: var(--label); text-transform: uppercase; }
.win-head span { flex: 1; }
.win-x { flex: 0 0 auto; width: 36px; height: 36px; border: 0; padding: 0 0 4px; cursor: pointer; background: var(--ink); color: #fff; font: 400 16px/1 var(--font); }
.win-x:hover { background: var(--red); }
.win.cyanhead { --bc: var(--cyan); }
.win.gold { --bc: var(--gold); }
.win-body { padding: 14px 16px 16px; }
.lore-h { font: var(--label); color: var(--cyan); margin: 10px 0 6px; text-transform: uppercase; }
.pro-pic { position: relative; line-height: 0; margin-bottom: 14px; box-shadow: 0 0 0 3px var(--gold); }
.pro-pic canvas { width: 100% !important; height: auto !important; }
.pro-pic .soon { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-8deg); background: #c0209c; color: #fff; font: 400 28px/1 var(--bold); padding: 8px 16px 12px; box-shadow: 0 0 0 3px var(--ink), 6px 6px 0 0 rgba(0, 0, 0, 0.5); white-space: nowrap; }

/* The photo from home: one big picture that always fits the screen, closed with the cross. */
.photo { width: auto; max-width: 100%; --bc: var(--yellow); }
.photo .frame { line-height: 0; background: #000; }
.photo .frame canvas { display: block; width: min(calc(100vw - 52px), calc((100dvh - 250px) * var(--ar)), 960px) !important; height: auto !important; aspect-ratio: var(--ar); }
/* width:0 + min-width:100% = the caption wraps to the picture's width instead of stretching the window */
.photo .cap { padding: 10px 14px 12px; color: #fffbe0; width: 0; min-width: 100%; }
.photo .cap b { color: var(--yellow); }

/* ---------- the talk scene ---------- */
#v-play { padding: 0; overflow: hidden; }
.play { width: min(900px, 100%); height: 100%; margin: 0 auto; display: flex; flex-direction: column; cursor: pointer; user-select: none; -webkit-user-select: none; }
.play.away { display: none; }
.stage-wrap { position: relative; flex: 0 0 auto; width: 100%; max-width: calc(44dvh * 240 / 136); margin: 0 auto; aspect-ratio: 240 / 136; }
.stage { width: 100%; height: 100%; display: block; }
.stage-tag, .stage-score { position: absolute; top: 8px; font: var(--label); text-transform: uppercase; padding: 2px 8px 5px; background: rgba(5, 3, 26, 0.75); }
.stage-tag { left: 8px; color: var(--pink); }
.stage-score { right: 8px; color: var(--yellow); }
.stage-score:empty, .stage-tag:empty { display: none; }

/* pocket items hovering over the table */
.clue-layer { position: absolute; inset: 0; pointer-events: none; }
.clue { position: absolute; width: clamp(46px, 12%, 84px); aspect-ratio: 1; margin-left: calc(clamp(46px, 12%, 84px) / -2); padding: 0; border: 0; background: none; cursor: pointer; pointer-events: auto;
  animation: clue-in 0.55s var(--d) backwards cubic-bezier(0.2, 1.4, 0.4, 1); }
.clue canvas { width: 100% !important; height: 100% !important; object-fit: contain; display: block;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px rgba(255, 255, 255, 0.85)); animation: clue-float 2.4s var(--f) ease-in-out infinite alternate; }
.clue:hover canvas { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 12px var(--yellow)); }
.clue.seen canvas { filter: drop-shadow(0 0 2px var(--green)) drop-shadow(0 0 5px rgba(91, 255, 122, 0.6)); }
@keyframes clue-in { from { transform: translate(140%, 260%) scale(0.15) rotate(200deg); opacity: 0; } }
@keyframes clue-float { from { transform: translateY(-5px) rotate(-4deg); } to { transform: translateY(6px) rotate(4deg); } }

.talk { flex: 1 1 0; min-height: 0; display: flex; align-items: flex-end; gap: 10px; padding: 6px 10px 4px; }
.dock { flex: 0 0 auto; line-height: 0; }
.head { width: 96px; height: 96px; box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px #2a6a3a; }
.dock.right .head { box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px #8a6a10; }
.head.on { box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px var(--green), 0 0 18px rgba(91, 255, 122, 0.6); }
.dock.right .head.on { box-shadow: 0 0 0 3px var(--ink), 0 0 0 6px var(--yellow), 0 0 18px rgba(255, 229, 63, 0.6); }
.log { flex: 1 1 0; min-width: 0; height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 6px 6px 8px; scrollbar-width: none; }
.log::-webkit-scrollbar { display: none; }
.log::before { content: ''; flex: 1 0 0; }
.bubble { --bc: var(--green); position: relative; max-width: 96%; align-self: flex-start; padding: 8px 14px 12px; background: #0d2a1c; color: #eafff0;
  font: 400 var(--read)/1.3 var(--font); box-shadow: 0 -3px 0 0 var(--bc), 0 3px 0 0 var(--bc), -3px 0 0 0 var(--bc), 3px 0 0 0 var(--bc); animation: bubble-in 0.16s ease-out; }
/* Earlier lines step back by getting darker, never see-through: the starry page must not show through text. */
.bubble:not(:last-child) { filter: brightness(0.62); }
.bubble.human { --bc: #8a9aff; background: #1a1a48; color: #eef0ff; }
.bubble.vip { --bc: var(--yellow); background: #4a3606; color: #fffbe0; align-self: flex-end; box-shadow: 0 -3px 0 0 var(--bc), 0 3px 0 0 var(--bc), -3px 0 0 0 var(--bc), 3px 0 0 0 var(--bc), 0 0 16px rgba(255, 229, 63, 0.35); }
.bubble.claim { --bc: var(--pink); box-shadow: 0 -3px 0 0 var(--bc), 0 3px 0 0 var(--bc), -3px 0 0 0 var(--bc), 3px 0 0 0 var(--bc), 0 0 16px rgba(255, 63, 216, 0.5); }
.bubble.claim:not(:last-child) { filter: none; }
.bubble .who { display: block; font: var(--name); color: var(--bc); margin-bottom: 2px; text-transform: uppercase; }
.bubble .ttl { color: var(--yellow); }
.bubble .icon { float: left; margin: 4px 12px 4px 0; line-height: 0; filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.7)); }
/* The whole line is laid out at once and revealed letter by letter, so a bubble never changes size while typing. */
.txt .rest { visibility: hidden; }
.txt.typing .shown::after { content: '▌'; position: absolute; animation: blink 0.6s steps(2, start) infinite; color: var(--cyan); }
@keyframes bubble-in { from { transform: translateY(10px); opacity: 0; } }
@keyframes blink { to { visibility: hidden; } }

.controls { flex: 0 0 auto; min-height: 66px; display: flex; align-items: center; justify-content: center; gap: 4px; flex-wrap: wrap; padding: 2px 8px 10px; }
.tap-hint { font: var(--label); color: var(--cyan); text-transform: uppercase; visibility: hidden; margin: 0 8px; flex: 1 0 100%; text-align: center; }
/* I KNOW and NOT SURE: centred, far apart, so a thumb never hits the wrong one */
.choice { display: flex; justify-content: center; align-items: flex-start; gap: clamp(28px, 14vw, 140px); width: 100%; padding-top: 4px; }
.choice .alt { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tap-hint.still { visibility: visible; color: var(--yellow); }
.play.waiting .tap-hint { visibility: visible; animation: blink 0.9s steps(2, start) infinite; }
.cost { font: var(--tag); color: var(--muted); text-transform: uppercase; }

/* ---------- aiming: a small panel in the corner, the planet stays in full view ---------- */
.hud { position: fixed; z-index: 30; top: calc(var(--bar) + 10px); left: 68px; width: min(340px, calc(100% - 78px)); padding: 8px 10px 10px; pointer-events: auto; }
.hud-top { display: flex; align-items: center; gap: 6px; }
.hud .tag { flex: 1; font: var(--tag); color: var(--pink); text-transform: uppercase; }
.hud .tag b { display: block; font: var(--label); color: var(--yellow); }
.hud .btn { margin: 0; }
.hud-body { margin-top: 8px; }
.hud.shut .hud-body { display: none; }
.hud.shut { width: auto; }
.hud .q { color: #fffbe0; margin-bottom: 8px; }
.hud-clues { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hud-clues .chip { padding: 5px; line-height: 0; width: 48px; height: 48px; }
.hud-clues .chip canvas { width: 100% !important; height: 100% !important; object-fit: contain; }
.hint { position: fixed; z-index: 30; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; padding: 6px 10px; max-width: calc(100% - 20px); }
.hint span { font: var(--label); color: var(--cyan); text-transform: uppercase; padding: 0 6px 3px; }
.hint .btn { margin: 3px; white-space: nowrap; }
.test-day { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
/* After a drop: the points, the distance and a key to the two flags on the planet. */
.reveal { display: flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 4px 12px; padding: 0 6px; }
.reveal b { font: 400 28px/1 var(--bold); padding-bottom: 4px; }
.reveal .key { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font: var(--tag); padding: 0; }
.reveal .dot { width: 10px; height: 10px; display: inline-block; box-shadow: 0 0 0 2px var(--ink); }
.reveal .dot.you { background: #ff9a2e; } .reveal .dot.home { background: #5bff7a; margin-left: 8px; }
.hud .tag { min-width: 0; }
.hud .tag b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fx { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.fx-sprite { position: absolute; left: 0; top: 0; transform-origin: 50% 50%; filter: drop-shadow(0 0 6px rgba(63, 240, 255, 0.5)); }
.fx-beam { position: absolute; width: 60px; margin-left: -30px; background: linear-gradient(to bottom, rgba(170, 255, 240, 0.85), rgba(170, 255, 240, 0.15)); clip-path: polygon(32% 0, 68% 0, 100% 100%, 0 100%); }
.fx-burst { position: absolute; width: 12px; height: 12px; margin: -6px 0 0 -6px; background: #fff;
  box-shadow: 18px 0 0 -2px var(--yellow), -18px 0 0 -2px var(--yellow), 0 18px 0 -2px var(--yellow), 0 -18px 0 -2px var(--yellow), 13px 13px 0 -3px #fff, -13px 13px 0 -3px #fff, 13px -13px 0 -3px #fff, -13px -13px 0 -3px #fff;
  animation: burst 0.5s ease-out forwards; }
@keyframes burst { from { transform: scale(0.2); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }

.sheet { position: fixed; z-index: 30; bottom: 14px; left: 50%; transform: translateX(-50%); width: min(680px, calc(100% - 24px)); padding: 12px 16px 14px; max-height: 64dvh; overflow-y: auto; }
.sheet-top { display: flex; align-items: center; gap: 14px; }
.big-pts { font: 400 42px/1 var(--bold); padding-bottom: 6px; }
.tier-line { color: #fff; }
.tally { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.tally span { background: var(--panel2); padding: 2px 8px 5px; }
.tally .ok-t, .tally .bad-t { color: #fff; }
.who-line { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 8px 10px; background: var(--panel2); }
.who-line .label { display: block; }
.outro { display: flex; align-items: center; gap: 12px; margin: 8px 0; padding: 8px 10px; background: #0d2a1c; box-shadow: inset 0 0 0 3px #2a6a3a; color: #eafff0; }
.outro canvas { flex: 0 0 auto; }
.ok-t { color: var(--green); } .bad-t { color: var(--red); }
.fun { color: #d8d0ff; margin: 8px 0; }
.fun b { color: var(--cyan); }
.sources { color: var(--muted); margin: 6px 0 10px; }
.sources a { margin-right: 10px; }

/* ---------- loot window ---------- */
.loot { position: relative; overflow: hidden; width: min(460px, 100%); padding: 22px 20px; text-align: center; }
.loot > * { position: relative; }
.loot .rays { position: absolute; inset: -60%; background: repeating-conic-gradient(rgba(255, 229, 63, 0.2) 0 15deg, transparent 15deg 30deg); animation: spin 16s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kicker { font: var(--label); color: var(--yellow); text-transform: uppercase; }
.loot-art { display: grid; place-items: center; min-height: 170px; margin: 12px 0; }
.loot-art canvas { filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 16px var(--yellow)); animation: bob 1.6s ease-in-out infinite alternate; }
.loot h2 { font: 400 28px/1.15 var(--bold); margin: 0 0 8px; color: #fff; }
.shine { box-shadow: 0 0 0 3px var(--yellow), 0 0 0 6px var(--ink), 0 0 20px var(--yellow); animation: shine 1.1s ease-in-out infinite alternate; }
@keyframes shine { to { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--ink), 0 0 34px var(--yellow); } }

/* ---------- day cleared: Larry rests next to the planet ---------- */
.cleared { position: fixed; z-index: 30; right: 24px; top: calc(50% + 33px); transform: translateY(-50%); width: 340px; max-height: calc(100dvh - 90px); overflow-y: auto; padding: 12px 14px; text-align: center; }
.cleared .row { justify-content: center; }
.cleared .btn { margin: 3px; }
.cleared-ship { display: block; margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer; animation: bob 2.2s ease-in-out infinite alternate; }
.cleared-ship canvas { display: block; width: 160px; height: 88px; }
.cleared-ship:hover { filter: drop-shadow(0 0 8px var(--cyan)); }
.cleared .quote { color: #eafff0; margin: 6px 0; }
.cleared-score { font: 400 42px/1.1 var(--bold); color: var(--yellow); margin: 4px 0 2px; }
.countdown { font: var(--label); color: var(--cyan); text-transform: uppercase; }

/* ---------- Larry's cabin, bottom-left ---------- */
.cabin { position: fixed; z-index: 20; left: 12px; bottom: 12px; width: clamp(230px, 27vw, 368px); line-height: 0; filter: drop-shadow(0 0 10px rgba(63, 240, 255, 0.3)); }
.cabin-cnv { width: 100%; height: auto; display: block; cursor: grab; touch-action: none; background: var(--bg); }
.cabin-note { position: absolute; right: 8px; top: 8px; font: var(--tag); line-height: 1.3; text-transform: uppercase; background: var(--yellow); color: var(--ink); border: 0; padding: 3px 6px 4px; cursor: pointer; }
.cabin-note:disabled { background: rgba(5, 3, 26, 0.7); color: var(--muted); cursor: default; }
.drag-ghost { position: fixed; z-index: 75; pointer-events: none; image-rendering: pixelated; filter: drop-shadow(0 0 8px #fff); }

/* ---------- result ---------- */
.result-grid { display: grid; grid-template-columns: 300px 1fr; gap: 22px; align-items: start; }
.card-preview { width: 100%; image-rendering: auto; display: block; box-shadow: 0 0 0 3px var(--yellow), 0 0 0 6px var(--ink); }
.title-box { padding: 16px; }
.title-box h2 { font: 400 28px/1.15 var(--bold); margin: 6px 0; }
.title-art { float: right; margin: 0 0 8px 12px; }
.reward { display: flex; align-items: center; gap: 16px; padding: 12px 14px; margin-top: 14px; }
.reward canvas { flex: 0 0 auto; }
.reward p { margin: 2px 0 0; }

/* ---------- ranks ---------- */
.board { width: 100%; border-collapse: collapse; }
.board td { padding: 8px 6px; border-bottom: 3px solid #22185a; vertical-align: middle; }
.board tr.me td { background: rgba(63, 240, 255, 0.1); }
.board canvas { display: block; }
.board .rank { color: var(--muted); width: 56px; }
.board .nick { color: #fff; }
.board .title { color: var(--muted); }
.board .score { font: 400 16px/1 var(--font); text-align: right; color: var(--yellow); white-space: nowrap; }

/* ---------- profile: fitting room, cabin guests, souvenirs ---------- */
.fit { display: grid; grid-template-columns: 240px 1fr; gap: 16px; align-items: start; }
.fit-larry { display: grid; place-items: center; padding: 10px; min-height: 260px; background: radial-gradient(circle at 50% 60%, #2a1a6a, #120a2e); }
.fit-slot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fit-slot > b { flex: 0 0 72px; font: var(--tag); color: var(--cyan); }
.piece { width: 76px; height: 76px; padding: 0; border: 0; background: var(--panel2); cursor: pointer; display: grid; place-items: center; overflow: hidden; }
.piece canvas { display: block; }
.piece.sel { box-shadow: 0 0 0 3px var(--yellow); }
.piece.none { color: var(--muted); font: var(--tag); }
.locker { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tile { background: var(--panel2); padding: 10px 8px; text-align: center; cursor: pointer; border: 0; color: var(--text); position: relative; font: inherit; }
.tile canvas { margin: 0 auto; display: block; }
.tile .nm { color: #fff; margin-top: 6px; word-break: break-word; }
.tile .ds { color: var(--muted); margin-top: 2px; }
.tile .dt { font: var(--tag); color: var(--yellow); margin-top: 6px; }
.tile.sel { box-shadow: 0 0 0 3px var(--yellow); }
.tile.locked { cursor: default; opacity: 0.55; }
.tile.trophy { cursor: default; }
.tr-art { height: 96px; display: grid; place-items: center; filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.6)); }
.big-name { font: 400 28px/1.15 var(--bold); }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stats div { background: var(--panel2); padding: 8px; text-align: center; }
.stats b { display: block; font: 400 28px/1.2 var(--bold); color: var(--yellow); }
.stats span { font: var(--tag); color: var(--muted); text-transform: uppercase; }
h2.sec { font: 400 21px/1.2 var(--bold); color: var(--cyan); margin: 26px 0 10px; text-transform: uppercase; }
.panel { padding: 16px; }

/* ---------- how to play: a picture guide ---------- */
.guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 22px 26px; counter-reset: step; }
.g-step { position: relative; background: var(--panel2); padding: 12px 12px 14px; counter-increment: step; box-shadow: 0 0 0 3px #2e2168; }
.g-step::before { content: counter(step); position: absolute; left: -10px; top: -10px; width: 36px; height: 36px; display: grid; place-items: center; background: var(--yellow); color: var(--ink); font: 400 16px/1 var(--font); padding-bottom: 4px; box-shadow: 0 0 0 3px var(--ink); z-index: 2; }
.g-step:not(:last-child)::after { content: '▶'; position: absolute; right: -22px; top: 50%; transform: translateY(-50%); color: var(--yellow); font: 400 16px/1 var(--font); }
.g-art { position: relative; height: 150px; margin-bottom: 10px; background: #0a0624; display: flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden; box-shadow: inset 0 0 0 3px #22185a; }
.g-art canvas { flex: 0 0 auto; }
.g-art .mini-bubble { background: #0d2a1c; color: #eafff0; box-shadow: 0 0 0 3px var(--green); padding: 2px 8px 6px; max-width: 150px; }
.g-art .mini-btn { font: 400 12px/1 var(--tiny); padding: 5px 8px 6px; color: #fff; background: var(--green-btn); box-shadow: 0 0 0 3px var(--ink); text-transform: uppercase; white-space: nowrap; }
.g-art .mini-btn.no { background: #c0209c; color: #fff; }
.g-art .mini-btn.gh { background: var(--panel2); color: var(--text); }
.g-art .stack { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.g-art .glowy { filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 7px rgba(255, 255, 255, 0.85)); }
.g-art .arrow { color: var(--yellow); font: 400 16px/1 var(--font); animation: blink 1s steps(2, start) infinite; }
.g-art .tap { position: absolute; font: var(--tag); color: var(--cyan); bottom: 6px; left: 0; right: 0; text-align: center; text-transform: uppercase; }
.g-step b { display: block; color: var(--yellow); text-transform: uppercase; }
.g-step p { margin: 4px 0 0; color: #ddd6ff; }
.pts { width: 100%; border-collapse: collapse; }
.pts td { padding: 6px 8px; border-bottom: 3px solid #22185a; }
.pts td:last-child { text-align: right; color: var(--yellow); white-space: nowrap; }
.pts tr:last-child td { border: 0; color: var(--green); }
.prose p, .prose li { color: #ddd6ff; }
.prose h3 { font: 400 21px/1.2 var(--bold); color: var(--yellow); margin: 18px 0 6px; }

/* ---------- about ---------- */
.about-hero { display: flex; align-items: center; gap: 18px; }
.about-hero canvas { flex: 0 0 auto; width: 204px; height: 216px; }
.about-hero .say { position: relative; padding: 12px 16px 16px; }
.about-hero h2 { font: 400 28px/1.15 var(--bold); margin: 0 0 8px; color: var(--yellow); }
.support { display: flex; align-items: flex-end; justify-content: center; gap: 6px; margin-top: 18px; padding: 16px 10px 12px; background: radial-gradient(circle at 50% 100%, #3a2a00, transparent 70%); }
.support canvas { flex: 0 0 auto; }
.support .mid { text-align: center; padding-bottom: 14px; }

/* ---------- forms ---------- */
.input { width: 100%; font: 400 16px/1.2 var(--font); padding: 8px 12px 10px; background: var(--ink); color: var(--yellow); border: 0; box-shadow: inset 0 0 0 3px var(--violet); outline: none; }
textarea.input { font-weight: 400; min-height: 150px; resize: vertical; color: var(--text); }
.input:focus { box-shadow: inset 0 0 0 3px var(--cyan); }
.err { color: var(--red); min-height: 1.4em; }

#toast { position: fixed; z-index: 90; top: calc(var(--bar) + 12px); left: 50%; transform: translateX(-50%); padding: 8px 14px 10px; background: var(--yellow); color: var(--ink); display: none; max-width: calc(100% - 24px); }
#toast.on { display: block; }

/* Narrow desktop: the gold button and the brand keep only their pictures. */
@media (max-width: 1180px) {
  .tt-btn span { display: none; }
  .tt-btn { padding: 0 8px; }
}
@media (max-width: 900px) {
  .auth-chip span { display: none; }
  .auth-chip { padding: 2px; }
  .cleared { right: 12px; width: 300px; }
}
@media (max-width: 760px) {
  :root { --bar: 58px; --read: 18px; }   /* phones: a bit larger reading text */
  .topbar { padding: 0 6px; gap: 5px; }
  .topbar .snd-btn { display: none; }   /* sound switches are on the home card */
  /* Phones: tab-sized labels in the bar; "About" lives in the footer. */
  .topbar { gap: 3px; }
  .brand { padding: 0 2px 4px 0; flex: 0 1 auto; min-width: 0; }
  .brand b { font-size: 11px; }   /* whole multiples only: 11px here, 22px on wider screens */
  .nav { gap: 0; margin-left: auto; flex: 0 0 auto; }
  .nav a { padding: 8px 4px 9px; font: 700 11px/1 'Galmuri11', var(--tiny); }
  .nav a.cat-link { width: 32px; height: 30px; margin-left: 2px; }
  .nav a.cat-link canvas { width: 30px; height: 28px; }
}
/* The smallest phones: the wordmark stacks as PIXEL over NEWS so it never runs into the menu. */
@media (max-width: 360px) {
  .brand b { display: flex; flex-direction: column; line-height: 1.1; }
}
@media (max-width: 760px) {
  .bug-btn { width: 40px; height: 40px; left: 6px; top: calc(var(--bar) + 6px); }
  .bug-btn canvas { width: 28px; height: 28px; }
  .stage-tag { left: 52px; }
  .hud { left: 52px; width: calc(100% - 60px); }
  .tt-btn { height: 36px; padding: 0 4px; }
  .tt-btn canvas { width: 30px; height: 17px; }
  .snd-btn { width: 30px; height: 36px; }
  .view { padding: 14px 10px 30px; }
  .view.solid { padding-top: 58px; }
  #v-play { padding: 0; }
  .auth-chip canvas { width: 40px !important; height: 40px !important; }
  .home-card { padding: 14px 10px; }
  .home-card h1 { font-size: 21px; }
  .lineup > div { min-width: 0; padding: 6px 4px 4px; }
  .btn { padding: 8px 10px 10px; }
  .btn.big { padding: 12px 16px 14px; }
  .stage-wrap { max-width: calc(36dvh * 240 / 136); }
  .stage-tag, .stage-score { font: var(--tag); top: 4px; padding: 3px 6px 4px; }
  /* Phones: bubbles get the full width, the talking heads sit in their own row underneath. */
  .talk { display: grid; grid-template: "log log" minmax(0, 1fr) "larry vip" auto / 1fr 1fr; gap: 6px 8px; padding: 4px 8px; align-items: stretch; }
  .log { grid-area: log; height: auto; min-height: 0; }
  .dock { grid-area: larry; justify-self: start; padding: 0 0 2px 6px; }
  .dock.right { grid-area: vip; justify-self: end; padding: 0 6px 2px 0; }
  .head { width: 60px; height: 60px; }
  .bubble { padding: 6px 10px 10px; max-width: 100%; }
  .controls { min-height: 58px; }
  .tap-hint { font: var(--tag); }
  .result-grid { grid-template-columns: 1fr; }
  .card-preview { max-width: 300px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .locker { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .sheet { max-height: 72dvh; }
  .big-pts { font-size: 28px; }
  .fit { grid-template-columns: 1fr; }
  .fit-larry { min-height: 0; }
  .g-step:not(:last-child)::after { content: '▼'; right: 50%; top: auto; bottom: -24px; transform: translateX(50%); }
  .about-hero { flex-direction: column; text-align: center; }
  .about-hero h2 { font-size: 21px; }
  .support { flex-wrap: wrap; }
  /* The day-cleared sign moves to the top, so the cabin keeps the bottom corner. */
  .cleared { left: 10px; right: 10px; width: auto; top: calc(var(--bar) + 10px); transform: none; max-height: calc(100dvh - 250px); padding: 8px 10px; }
  .cleared-ship canvas { width: 112px; height: 62px; }
  .cleared-score { font-size: 28px; }
  .cabin { width: 230px; left: 8px; bottom: 8px; }
  .hint span { font: var(--tag); }
  .hint { width: calc(100% - 16px); bottom: 10px; }
  .win-body { padding: 12px; }
  .photo .frame canvas { width: min(calc(100vw - 40px), calc((100dvh - 280px) * var(--ar))) !important; }
}

/* Phones: the cabin sits in the bottom-left corner, so pages end above it instead of running underneath. */
@media (max-width: 760px) {
  body:has(.cabin:not([hidden])) .view { height: calc(100dvh - var(--bar) - 138px); }
}
@media (max-width: 760px) {
  /* Less going on behind the text on a small screen. */
  #planets { opacity: 0.45; }
  .draft-banner { top: auto; bottom: 0; }
}
/* While the player aims at the planet, the drifting backdrop planets step aside: next to the globe they read as part of the map. */
body:has(#space.aiming) #planets { display: none; }
@media (max-width: 760px) {
  /* Aiming on a phone: only the two buttons stay on top; the question is in the bar at the bottom. */
  .hud .tag { display: none; }
  .hud { left: auto; right: 8px; width: auto; padding: 6px 8px 8px; }
  .hud:not(.shut) { left: 52px; }
  .hint .extra { display: none; }
}
