/* Worlds of walterwakefield 2026: game styles.
   Change colours, fonts and sizes HERE (the custom properties below). Image paths live in data.js. */
@font-face { font-family: 'Pixelify Sans'; src: url('../brand-mockup/fonts/PixelifySans.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }

:root {
  /* brand colours */
  --brand-blue: #3b85ed; --brand-pink: #f299ff; --brand-green: #00bd8c; --brand-orange: #fcb24f; --brand-lime: #12d473; --brand-deep: #002929;
  /* galaxy colours (map labels, glows, face borders) */
  --g-hq: #f2c94c; --g-branding: #ff7a45; --g-digital: #3b85ed; --g-investor: #3fbf6f; --g-marketing: #b67cf0; --g-motion: #f2b33d; --g-sustainability: #2fc9b0;
  /* interface: black see-through boxes with thin light borders */
  --box: rgba(0, 0, 0, .62); --box-strong: rgba(0, 0, 0, .78); --box-ui: rgba(9, 14, 36, .8); --line-ui: rgba(255, 255, 255, .32); --line: rgba(255, 255, 255, .3); --line-strong: rgba(255, 255, 255, .85);
  --text: #fff; --muted: rgba(255, 255, 255, .72); --right: var(--brand-green); --wrong: var(--brand-orange); --main-btn: var(--brand-blue); --main-btn-hover: #6ba3f2;
  --page-bg: #05080c;
  /* fonts: IvyOra for big headings, Inter for body, Pixelify Sans for map labels, counters and small game buttons */
  --font-head: 'ivyora-display', Georgia, 'Times New Roman', serif;
  --font-body: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-pixel: 'Pixelify Sans', monospace;
  --font-mono: ui-monospace, Menlo, Consolas, monospace;   /* the debug panel's font: used for the in-planet panels */
  /* type sizes scale with the stage (1cqw = 1% of the stage width) but never get too small to read on a phone */
  --fs-body: clamp(12px, 1.45cqw, 44px);
  --fs-small: clamp(11px, 1.1cqw, 34px);
  --fs-h1: clamp(20px, 3.2cqw, 96px);
  --fs-h2: clamp(15px, 2cqw, 60px);
  --fs-intro-head: clamp(22px, 3.6cqw, 110px);
  --fs-intro-body: clamp(14px, 2cqw, 60px);
  --fs-pixel: clamp(11px, 1.25cqw, 38px);
  --radius: 1.1cqw;
  /* sizes on the planet */
  --player-h: 13;   /* not used by CSS, documented in data.js (host.h) and game.js (PLAYER_H) */
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--page-bg); overflow: hidden; font-family: var(--font-body); color: var(--text); -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus { outline: none; }
:focus-visible { outline: max(2px, .22cqw) solid #fff; outline-offset: max(2px, .25cqw); box-shadow: 0 0 0 max(2px, .22cqw) #000; }
[tabindex="-1"]:focus-visible { outline: none; box-shadow: none; }
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; }
[hidden] { display: none !important; }

/* ---------- one 16:9 stage, letterboxed, scaled to the window ---------- */
#stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(100vw, calc(100dvh * 16 / 9)); height: min(calc(100vw * 9 / 16), 100dvh); container-type: size; overflow: hidden; background: #000; font-size: var(--fs-body); line-height: 1.4; }
#stage.shake { animation: stageShake .09s linear 6; }
@keyframes stageShake { 0% { translate: 0 0; } 25% { translate: -.5cqw .3cqw; } 50% { translate: .4cqw -.4cqw; } 75% { translate: -.3cqw -.2cqw; } 100% { translate: 0 0; } }
.screen { position: absolute; inset: 0; display: none; overflow: hidden; }
.screen.on { display: block; animation: fadeIn .45s ease-out both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- shared boxes, headings and buttons ---------- */
.panel { background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8cqw 2cqw; -webkit-backdrop-filter: blur(.5cqw); backdrop-filter: blur(.5cqw); }
.pxbox { background: var(--box-strong); border: 2px solid var(--line-strong); border-radius: .5cqw; font-family: var(--font-pixel); font-variant-ligatures: none; text-transform: uppercase; letter-spacing: .04em; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 400; margin: 0; letter-spacing: .01em; }
h1 { font-size: var(--fs-h1); line-height: 1.05; }
h2 { font-size: var(--fs-h2); line-height: 1.15; }
p { margin: 0; }
.eyebrow { margin: 0 0 .5cqw; font-size: var(--fs-small); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); }
.btn { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .8cqw; border: 1px solid var(--line-strong); background: rgba(255, 255, 255, .08); border-radius: .7cqw; padding: .75cqw 1.5cqw; font-weight: 600; font-size: var(--fs-body); text-decoration: none; line-height: 1.2; color: var(--text); }
.btn:hover { background: rgba(255, 255, 255, .2); }
.btn.main { background: var(--main-btn); border-color: var(--main-btn); color: #05070a; }
.btn.main:hover { background: var(--main-btn-hover); border-color: var(--main-btn-hover); }
kbd { font: 600 var(--fs-small) var(--font-body); border: 1px solid currentColor; border-radius: .35cqw; padding: .05cqw .45cqw; opacity: .8; }
.pxbtn { font-family: var(--font-pixel); font-variant-ligatures: none; font-size: var(--fs-pixel); line-height: 1.1; letter-spacing: .03em; color: var(--text); background: var(--box-strong); border: 2px solid var(--line-strong); border-radius: .5cqw; padding: .7cqw 1.2cqw; }
.pxbtn:hover { background: rgba(40, 44, 56, .9); }
@media (hover: none) { .touch-hide { display: none; } }

/* ---------- mute (every screen) ---------- */
.mute { position: absolute; z-index: 40; right: 1.5cqw; top: 1.5cqw; }

/* ---------- caption bar ---------- */
.captions { position: absolute; z-index: 35; left: 50%; bottom: 2cqw; transform: translateX(-50%); max-width: 62cqw; width: max-content; pointer-events: none; opacity: 0; transition: opacity .25s; text-align: center; background: var(--box-strong); border: 1px solid var(--line); border-radius: .8cqw; padding: .7cqw 1.4cqw; font-size: var(--fs-body); line-height: 1.35; }
.captions.on { opacity: 1; }
.captions b { font-weight: 700; color: var(--brand-orange); margin-right: .4em; }
.captions.is-avg { border-color: var(--brand-orange); }
body[data-screen="intro"] .captions, body[data-screen="title"] .captions { display: none; }
body[data-screen="map"] .captions { bottom: auto; top: 1.5cqw; max-width: 46cqw; }
body[data-screen="finale"] .captions, body[data-screen="board"] .captions { display: none; }


/* ---------- 1. TITLE (look copied from art/title-v2/title.html) ---------- */
.t-bg { position: absolute; inset: -2%; background: center / cover no-repeat; animation: drift 28s ease-in-out infinite alternate; }
@keyframes drift { from { transform: scale(1) translateX(0); } to { transform: scale(1.04) translateX(-.6%); } }
.t-flash { position: absolute; inset: 0; pointer-events: none; opacity: 0; mix-blend-mode: screen; background: radial-gradient(ellipse 45% 60% at 80% 25%, rgba(200,215,255,.55), transparent 70%); animation: tflash 9s infinite; }
@keyframes tflash { 0%, 71%, 74%, 77%, 100% { opacity: 0; } 72% { opacity: .9; } 73% { opacity: .2; } 75.5% { opacity: .6; } }
.t-shade { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 50% 30% at 50% 17%, rgba(0,10,15,.45), transparent 70%), linear-gradient(to top, rgba(0,0,0,.55), transparent 28%); }
.t-motes { position: absolute; inset: 0; pointer-events: none; }
.t-motes i { position: absolute; bottom: -2cqh; width: .45cqw; aspect-ratio: 1; animation: moteRise linear infinite; opacity: 0; }
@keyframes moteRise { 0% { transform: translateY(0); opacity: 0; } 10% { opacity: .9; } 90% { opacity: .9; } 100% { transform: translateY(-70cqh); opacity: 0; } }
.t-wordmark { position: absolute; top: 3.2cqh; left: 2.6cqw; width: 11cqw; opacity: .92; }
.t-logo { position: absolute; left: 50%; top: 2cqh; width: 35cqw; transform: translateX(-50%); animation: bob 4.2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translate(-50%, 0) rotate(-.4deg); } 50% { transform: translate(-50%, -1.1cqh) rotate(.4deg); } }
.t-logo img { display: block; width: 100%; filter: drop-shadow(0 1.2cqh 1.4cqh rgba(0,0,0,.55)) drop-shadow(0 0 2cqh rgba(242,153,255,.25)); }
.glint { position: absolute; width: 2.4cqw; aspect-ratio: 1; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, #fff 0 10%, rgba(255,255,255,0) 32%), linear-gradient(transparent 47%, #fff 47% 53%, transparent 53%), linear-gradient(90deg, transparent 47%, #fff 47% 53%, transparent 53%);
  -webkit-mask: radial-gradient(circle, #000 20%, transparent 70%); mask: radial-gradient(circle, #000 20%, transparent 70%); animation: twinkle 3.6s ease-in-out infinite; }
@keyframes twinkle { 0%, 60%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); } 70% { opacity: 1; transform: scale(1) rotate(45deg); } 80% { opacity: 0; transform: scale(.3) rotate(90deg); } }
.t-lineup { position: absolute; left: 0; right: 0; bottom: 0; height: 34cqh; pointer-events: none; z-index: 1; }
.t-lineup > * { pointer-events: auto; }
.t-console { position: absolute; z-index: 2; left: 50%; bottom: 3.5cqh; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 1.6cqh; padding: 1.6cqh 2.4cqw 1.8cqh; border-radius: 2cqw; background: rgba(0,0,0,.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 1.4cqh 3cqh rgba(0,0,0,.45); }
.start { position: relative; border: 0; overflow: hidden; font: 900 2.6cqw/1 var(--font-body); letter-spacing: .14em; color: #fff; padding: 1.7cqh 5.2cqw 1.9cqh; border-radius: 1.3cqw;
  background: linear-gradient(#6aa6f5 0%, var(--brand-blue) 45%, #2a6fd6 100%);
  box-shadow: 0 .2cqh 0 rgba(255,255,255,.55) inset, 0 -.5cqh 0 rgba(0,0,120,.35) inset, 0 .9cqh 0 #1d3fb8, 0 .9cqh 0 .25cqh var(--brand-deep), 0 1.6cqh 2.2cqh rgba(0,0,0,.5), 0 0 3cqh rgba(59,133,237,.55);
  text-shadow: 0 .35cqh 0 rgba(0,20,90,.55); animation: pulse 2.2s ease-in-out infinite; transition: transform .08s; }
.start::before { content: ""; position: absolute; left: 6%; right: 6%; top: 7%; height: 42%; border-radius: 1cqw 1cqw 2.5cqw 2.5cqw; background: linear-gradient(rgba(255,255,255,.55), rgba(255,255,255,.08)); pointer-events: none; }
.start::after { content: ""; position: absolute; top: -20%; bottom: -20%; width: 22%; left: -40%; background: linear-gradient(100deg, transparent, rgba(255,255,255,.7), transparent); transform: skewX(-18deg); animation: sweep 3.4s ease-in-out infinite; pointer-events: none; }
.start:hover { filter: brightness(1.08); }
.start:active { transform: translateY(.7cqh); }
.start span { position: relative; z-index: 1; }
@keyframes pulse { 0%, 100% { filter: drop-shadow(0 0 1cqh rgba(59,133,237,.4)); } 50% { filter: drop-shadow(0 0 2.4cqh rgba(242,153,255,.65)); } }
@keyframes sweep { 0%, 55% { left: -40%; } 85%, 100% { left: 130%; } }
.t-row { display: flex; gap: .8cqw; }
.small { font: 600 max(11px, .95cqw)/1 var(--font-body); color: #fff; letter-spacing: .02em; padding: 1cqh 1.3cqw; border-radius: 99px; border: 1px solid rgba(255,255,255,.22); background: rgba(0,0,0,.45); transition: background .15s, border-color .15s; }
.small:hover { background: rgba(0,0,0,.65); border-color: rgba(255,255,255,.5); }

/* ---------- 2. INTRO ---------- */
.shots { position: absolute; inset: 0; background: #000; }
.shot { position: absolute; inset: -4%; background: center / cover no-repeat; opacity: 0; transition: opacity 1.2s ease; }
.shot.on { opacity: 1; }
.shot.grey { filter: grayscale(.85) brightness(.75); }
.shot.pan-in.on { animation: panIn 9s ease-out both; }
.shot.pan-left.on { animation: panLeft 14s linear both; }
.shot.pan-right.on { animation: panRight 14s linear both; }
@keyframes panIn { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes panLeft { from { transform: translateX(3%) scale(1.06); } to { transform: translateX(-3%) scale(1.06); } }
@keyframes panRight { from { transform: translateX(-3%) scale(1.08); } to { transform: translateX(3%) scale(1.02); } }
.intro-text { position: absolute; left: 6cqw; right: 6cqw; bottom: 6cqw; max-width: 64cqw; padding: 2.2cqw 2.6cqw; background: var(--box); border: 1px solid var(--line); border-radius: var(--radius); -webkit-backdrop-filter: blur(.5cqw); backdrop-filter: blur(.5cqw); }
.intro-text:empty { display: none; }
.intro-text h2 { font-size: var(--fs-intro-head); line-height: 1.08; margin-bottom: 1cqw; }
.intro-text p { font-size: var(--fs-intro-body); line-height: 1.4; margin-top: .6cqw; opacity: 0; transform: translateY(.6cqw); transition: opacity .6s, transform .6s; }
.intro-text p.on { opacity: 1; transform: none; }
.intro-text h2 { animation: rise .6s ease-out both; }
.skip { position: absolute; z-index: 36; right: 1.5cqw; bottom: 1.5cqw; background: var(--box-strong); }
@keyframes rise { from { opacity: 0; transform: translateY(.8cqw); } to { opacity: 1; transform: none; } }

/* ---------- 3. HOW TO PLAY ---------- */
.howto-bg { position: absolute; inset: 0; background: center / cover no-repeat; filter: blur(.4cqw) brightness(.45); transform: scale(1.05); }
.howto { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 80cqw; text-align: center; padding: 2.6cqw 3cqw; }
.howto h1 { font-size: calc(var(--fs-h1) * 1.15); }
.steps { list-style: none; margin: 2.2cqw 0 1.6cqw; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 2cqw; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: .8cqw; }
.steps h2 { font-size: var(--fs-h2); }
.steps p { font-size: var(--fs-small); color: var(--muted); max-width: 22cqw; line-height: 1.4; }
.step-pic { width: 18cqw; height: 11cqw; border: 1px solid var(--line); border-radius: .8cqw; background: rgba(255,255,255,.05); position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: .8cqw; }
.step-pic.walk img { height: 9cqw; image-rendering: pixelated; animation: walkDemo 2.4s ease-in-out infinite alternate; }
@keyframes walkDemo { from { transform: translateX(-3cqw); } to { transform: translateX(1cqw); } }
/* the walterwakefield man (game.js): an 8-frame walk strip (96x136 per frame) shown one frame at a time; he walks right, turns, walks back */
.step-pic.walk img.strip { width: auto; aspect-ratio: 96 / 136; object-fit: cover; object-position: 0 0; animation: walkTurn 4.8s ease-in-out infinite, walkCycle .8s steps(8, jump-none) infinite; }
@keyframes walkCycle { from { object-position: 0% 0; } to { object-position: 100% 0; } }
@keyframes walkTurn { 0% { transform: translateX(-3cqw); } 49.9% { transform: translateX(1cqw); } 50% { transform: translateX(1cqw) scaleX(-1); } 100% { transform: translateX(-3cqw) scaleX(-1); } }
.step-pic .keys { display: flex; gap: .3cqw; }
.step-pic kbd { font-size: var(--fs-body); padding: .2cqw .6cqw; opacity: 1; }
.cardsicon { display: grid; grid-template-columns: 1fr 1fr; gap: .6cqw; padding: 1.2cqw 2.4cqw; }
.cardsicon i { display: grid; place-items: center; border: 1px solid var(--line); border-radius: .4cqw; background: rgba(255,255,255,.06); font-style: normal; font-weight: 700; }
.cardsicon i.ok { border: 2px solid var(--right); background: rgba(0,189,140,.25); color: var(--right); }
.step-pic.colour img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; }
.step-pic.colour img + img { clip-path: inset(0 0 0 50%); animation: wipe 3s ease-in-out infinite alternate; }
@keyframes wipe { from { clip-path: inset(0 0 0 85%); } to { clip-path: inset(0 0 0 15%); } }
.win { font-family: var(--font-head); font-size: var(--fs-h2); margin-bottom: 1.4cqw; }

/* ---------- 4. MAP ---------- */
.map-back { position: absolute; inset: 0; background: #070b16 center / cover no-repeat; filter: blur(1cqw) brightness(.4); transform: scale(1.1); }
.map-world { position: absolute; left: 0; top: 0; width: 100cqw; height: calc(100cqw * 768 / 1376); transform-origin: 0 0; transition: transform 1s cubic-bezier(.6, 0, .2, 1); }
.map-world > img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-world.zoomed .map-labels { opacity: 0; pointer-events: none; }
.map-labels { transition: opacity .4s; }
.gal { position: absolute; transform: translate(-50%, -50%); border: 0; background: none; padding: 0; color: var(--text); }
.gal-hit { width: 18cqw; height: 15cqw; border-radius: 50%; }
.gal-hit:hover + .gal-label, .gal-hit:focus-visible + .gal-label, .gal-label:hover { background: rgba(20, 24, 36, .95); transform: translate(-50%, -50%) scale(1.06); }
.gal-label { min-width: 10.5cqw; padding: .45cqw .9cqw .5cqw; background: rgba(8, 12, 22, .88); border: 2px solid var(--c); border-radius: .5cqw; font-family: var(--font-pixel); font-variant-ligatures: none; font-size: var(--fs-pixel); line-height: 1.1; text-align: center; white-space: nowrap; transition: transform .15s, background .15s; box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.gal-label small { display: block; margin-top: .25cqw; font-family: var(--font-body); font-size: max(9px, .78cqw); color: var(--muted); letter-spacing: .02em; }
.gal-label.lit { box-shadow: 0 0 1.4cqw var(--c), 0 0 0 1px rgba(0,0,0,.6); }
.glow { position: absolute; width: 22cqw; aspect-ratio: 1.5; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; mix-blend-mode: screen; opacity: 0; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 70%, #fff), color-mix(in srgb, var(--c) 45%, transparent) 55%, transparent); box-shadow: 0 0 4cqw 1cqw color-mix(in srgb, var(--c) 60%, transparent); transition: opacity 1s; }
.glow.lit { opacity: calc(.55 + var(--n, 1) * .15); animation: glowPulse 2.4s ease-in-out infinite alternate; }
@keyframes glowPulse { from { filter: brightness(.8); } to { filter: brightness(1.3); } }
.hud { position: absolute; z-index: 5; left: 1.5cqw; top: 1.5cqw; padding: .7cqw 1.1cqw; font-size: var(--fs-pixel); line-height: 1.25; display: flex; flex-direction: column; }
.meet { position: absolute; z-index: 5; right: 12cqw; top: 1.5cqw; }
.quote { position: absolute; z-index: 5; right: 1.5cqw; bottom: 1.5cqw; width: 22cqw; padding: .9cqw 1.2cqw; background: var(--box-strong); border: 2px solid var(--line-strong); border-radius: .5cqw; font-size: var(--fs-small); line-height: 1.35; }
.quote em { font-style: italic; font-weight: 700; color: var(--brand-orange); }
.quote span { font-style: italic; }
.faces { position: absolute; z-index: 6; left: 1.5cqw; bottom: 1.2cqw; display: flex; gap: .45cqw; padding: .5cqw .6cqw; background: var(--box); border: 1px solid var(--line); border-radius: .7cqw; transition: box-shadow .3s; }
.faces.flash { box-shadow: 0 0 0 2px #fff, 0 0 2cqw rgba(255,255,255,.6); }
.face { position: relative; width: 4cqw; display: flex; flex-direction: column; align-items: center; gap: .2cqw; padding: 0; border: 0; background: none; color: var(--text); }
.face .pic { width: 3.6cqw; height: 3.6cqw; border: 2px solid var(--c); border-radius: .45cqw; overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,.08); }
.face .pic img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; image-rendering: pixelated; }
.face .pic img.tall { object-fit: cover; object-position: 50% 0; }
.face .pic .initial { font: 700 1.7cqw/1 var(--font-pixel); color: #fff; }
.face .nm { font-family: var(--font-pixel); font-variant-ligatures: none; font-size: max(9px, .8cqw); line-height: 1; white-space: nowrap; }
.face .tick, .marker .tick { position: absolute; right: -.3cqw; top: -.4cqw; width: 1.5cqw; height: 1.5cqw; min-width: 14px; min-height: 14px; border-radius: 50%; background: var(--right); color: #00150f; display: grid; place-items: center; font-size: max(9px, .9cqw); font-weight: 800; border: 1px solid #fff; }
.face:hover .pic, .face:focus-visible .pic { box-shadow: 0 0 1cqw var(--c); transform: translateY(-.2cqw); }
.face.next .pic { animation: nextPulse 1.2s ease-in-out infinite alternate; }
@keyframes nextPulse { from { box-shadow: 0 0 0 0 #fff; } to { box-shadow: 0 0 0 .3cqw #fff, 0 0 1.5cqw var(--c); } }
.face .tip { position: absolute; bottom: calc(100% + .7cqw); left: 50%; transform: translateX(-50%); white-space: nowrap; background: var(--box-strong); border: 1px solid var(--line); border-radius: .4cqw; padding: .35cqw .7cqw; font-size: var(--fs-small); pointer-events: none; opacity: 0; transition: opacity .15s; }
.face .tip b { font-weight: 700; }
.face:hover .tip, .face:focus-visible .tip { opacity: 1; }
.galaxy-view { position: absolute; inset: 0; z-index: 4; }
.gv-head { position: absolute; left: 1.5cqw; top: 7cqw; display: flex; flex-direction: column; align-items: flex-start; gap: .8cqw; }
.gv-head h2 { font-size: var(--fs-h1); text-shadow: 0 .2cqw 1cqw #000; }
.marker { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: .3cqw; border: 0; background: none; padding: 0; color: var(--text); animation: popIn .45s cubic-bezier(.2, 1.5, .4, 1) both; }
.marker .disc { position: relative; width: 7cqw; height: 7cqw; border-radius: 50%; border: 2px solid var(--c); background: rgba(5, 8, 16, .75); display: grid; place-items: center; overflow: hidden; }
.marker .disc img { height: 86%; image-rendering: pixelated; }
.marker .disc img.square { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; }
.marker .disc .initial { font: 700 2.6cqw/1 var(--font-pixel); }
.marker .lbl { font-family: var(--font-pixel); font-variant-ligatures: none; font-size: var(--fs-pixel); background: var(--box-strong); border: 1px solid var(--line); border-radius: .4cqw; padding: .2cqw .6cqw; white-space: nowrap; }
.marker .lbl small { display: block; font: 600 max(9px, .75cqw)/1.2 var(--font-body); color: var(--muted); text-align: center; }
.marker.playable .disc { box-shadow: 0 0 1.6cqw var(--c); }
.marker.playable .lbl small { color: var(--brand-green); }
.marker:hover .disc, .marker:focus-visible .disc { transform: scale(1.06); }
.marker .tick { right: .2cqw; top: .2cqw; }
@keyframes popIn { from { opacity: 0; scale: .4; } to { opacity: 1; scale: 1; } }
.map-tip { position: absolute; z-index: 7; left: 1.5cqw; bottom: 8.6cqw; width: 26cqw; padding: .9cqw 1.2cqw; font-size: var(--fs-body); animation: rise .4s ease-out both; }
.map-tip b { font-family: var(--font-head); font-weight: 400; font-size: var(--fs-h2); display: block; margin-bottom: .3cqw; }

/* coming-soon card and other small modals */
.modal { position: absolute; inset: 0; z-index: 38; display: grid; place-items: center; background: rgba(0,0,0,.45); }
.modal .cs-card { width: 38cqw; text-align: center; padding: 2.2cqw; display: flex; flex-direction: column; align-items: center; gap: .9cqw; animation: rise .3s ease-out both; }
.modal .cs-card .disc { width: 8cqw; height: 8cqw; border-radius: 50%; border: 2px solid var(--c); overflow: hidden; display: grid; place-items: center; background: rgba(255,255,255,.06); }
.modal .cs-card .disc img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 10%; image-rendering: pixelated; }
.modal .cs-card .disc .initial { font: 700 3cqw/1 var(--font-pixel); }

/* BugHerd 14: the round Figma avatar (its own coloured circle and white ring) in the face strip, planet markers,
   coming-soon card and Adrian's map tip. The holder goes round; the galaxy colour stays as the outer ring. */
:is(.face .pic, .marker .disc, .modal .cs-card .disc):has(> img.ava) { border-radius: 50%; background: none; }
:is(.face .pic, .marker .disc, .modal .cs-card .disc, .map-tip .tip-face) > img.ava { width: 100%; height: 100%; object-fit: contain; object-position: 50% 50%; image-rendering: auto; }

/* ---------- 5. PLANET ---------- */
.world { position: absolute; inset: 0; }
.layer { position: absolute; inset: 0; }
.layer img { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity 1.4s ease; }
.layer img.on { opacity: 1; }
.layer img.first { opacity: 1; }
.avg-slot { position: absolute; inset: 0; visibility: hidden; }
.avg-slot.on { visibility: visible; }
.actors { position: absolute; inset: 0; pointer-events: none; }
.host, .player { position: absolute; transform: translate(-50%, -100%); }
.host { image-rendering: pixelated; animation: idle 1.6s ease-in-out infinite; transform-origin: 50% 100%; }
@keyframes idle { 0%, 100% { transform: translate(-50%, -100%) scaleY(1); } 50% { transform: translate(-50%, -100%) scaleY(.975) translateY(.4%); } }
.player { aspect-ratio: auto; display: flex; align-items: flex-end; justify-content: center; filter: drop-shadow(0 .25cqw .2cqw rgba(0,0,0,.5)); }
.player img { height: 100%; width: auto; display: block; transform-origin: 50% 100%; }
.planet-hud { position: absolute; left: 1.5cqw; top: 1.5cqw; padding: clamp(6px, .6cqw, 18px) clamp(8px, .9cqw, 26px); border-radius: clamp(4px, .4cqw, 12px); background: var(--box-ui); border-color: var(--line-ui); transition: opacity .3s; }
.planet-hud h1 { font: 400 clamp(13px, 1.2cqw, 36px) / 1.15 var(--font-pixel); font-variant-ligatures: none; text-transform: uppercase; letter-spacing: .05em; }
.planet-hud .eyebrow { margin-bottom: .2cqw; font: 400 clamp(10px, .78cqw, 24px) / 1.3 var(--font-mono); letter-spacing: .08em; }
.planet-map { position: absolute; z-index: 5; right: 12cqw; top: 1.5cqw; }
.planet-map.has-icon { padding: .35cqw .6cqw; line-height: 0; }
.planet-map img { height: max(26px, 2.9cqw); width: auto; image-rendering: pixelated; display: block; }
body.in-dialog .planet-hud { opacity: 0; pointer-events: none; }
.talk { position: absolute; z-index: 6; transform: translate(-50%, -100%); background: var(--box-ui); border-color: var(--line-ui); font: 600 clamp(12px, .98cqw, 30px) / 1.2 var(--font-mono); padding: .45em .8em; border-radius: clamp(3px, .3cqw, 10px); animation: talkIn .3s ease-out both; }
.talk kbd { font: 600 clamp(11px, .84cqw, 26px) / 1 var(--font-mono); padding: .1em .35em; }
@keyframes talkIn { from { opacity: 0; transform: translate(-50%, -80%); } to { opacity: 1; transform: translate(-50%, -100%); } }
.touch { position: absolute; z-index: 6; left: 1.5cqw; right: 1.5cqw; bottom: 1.5cqw; display: none; justify-content: space-between; pointer-events: none; }
body.touch-ui .touch { display: flex; }
body.in-dialog .touch { display: none; }
.arrow { pointer-events: auto; width: max(56px, 8cqw); height: max(56px, 8cqw); border-radius: 1cqw; border: 2px solid var(--line-strong); background: var(--box); font-size: max(20px, 2.6cqw); touch-action: none; user-select: none; -webkit-user-select: none; }
.arrow:active, .arrow.down { background: rgba(255,255,255,.25); }
.ui { position: absolute; inset: 0; pointer-events: none; }
.ui > * { pointer-events: auto; }
.saved-banner { position: absolute; z-index: 8; left: 50%; top: 40%; transform: translate(-50%, -50%); text-align: center; pointer-events: none; }
.saved-banner b { display: block; font: 400 calc(var(--fs-h1) * 2) / 1 var(--font-head); text-shadow: 0 .3cqw 1.6cqw rgba(0,0,0,.8), 0 0 3cqw rgba(252,178,79,.6); animation: bannerIn 2.6s ease-out both; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(.6); } 15% { opacity: 1; transform: scale(1.05); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; } }

/* ---------- in-planet panels: speech, quiz, score, strengths and cause (client feedback 1 Dec) ----------
   Compact, like the debug panel and the team map labels: small crisp monospace text, pixel-font uppercase headings,
   a navy see-through box with a thin light border, docked bottom left so the planet, the Visitor and the host stay
   in view. Nothing here is wider than 34% of the stage. Sizes follow the stage (cqw) with a readable minimum. */
#stage { --ui-fs: clamp(12px, .98cqw, 30px); --ui-fs-small: clamp(11px, .84cqw, 26px); --ui-fs-head: clamp(13px, 1.2cqw, 36px); --ui-pad: clamp(8px, .85cqw, 26px); --ui-gap: clamp(5px, .5cqw, 16px); }
.ui .panel { position: absolute; left: 1.5cqw; bottom: 1.5cqw; top: auto; width: min(34cqw, calc(100cqw - 3cqw)); max-height: calc(100cqh - 9cqw); overflow: auto;
  padding: var(--ui-pad); border-radius: clamp(4px, .4cqw, 12px); background: var(--box-ui); border: 1px solid var(--line-ui);
  font: 400 var(--ui-fs) / 1.45 var(--font-mono); -webkit-backdrop-filter: blur(.4cqw); backdrop-filter: blur(.4cqw);
  animation: rise .3s ease-out both; transition: opacity .35s, transform .35s; }
.ui .panel.away { animation: none; opacity: 0; transform: translateY(1.5cqw); pointer-events: none; }
.ui .panel h1, .ui .panel h2 { font: 400 var(--ui-fs-head) / 1.15 var(--font-pixel); font-variant-ligatures: none; text-transform: uppercase; letter-spacing: .05em; }
.ui .panel h2 { font-size: var(--ui-fs); color: var(--muted); }
.ui .eyebrow { font: 400 var(--ui-fs-small) / 1.3 var(--font-mono); letter-spacing: .08em; margin: 0 0 .25em; }
.ui p { font-size: var(--ui-fs); }
.ui .btn { font: 600 var(--ui-fs) / 1.2 var(--font-mono); gap: .5em; padding: .45em .8em; border-radius: clamp(3px, .3cqw, 10px); }
.ui kbd { font: 600 var(--ui-fs-small) / 1 var(--font-mono); padding: .1em .35em; border-radius: 3px; }
/* speech box: small pixel portrait, pixel-font name, the line in monospace */
.panel.speech { display: flex; gap: var(--ui-pad); align-items: flex-start; }
.portrait { flex: none; width: clamp(30px, 3cqw, 90px); height: clamp(60px, 6cqw, 180px); image-rendering: pixelated; object-fit: contain; object-position: bottom; }
.speech .body { flex: 1; min-width: 0; }
.speech .name { margin-bottom: .4em; color: var(--brand-orange); }
.speech .line { font-size: var(--ui-fs); line-height: 1.5; }
.speech .actions { margin-top: .9em; display: flex; align-items: center; gap: var(--ui-gap); flex-wrap: wrap; }
.mark { display: inline-block; margin-top: .6em; font-size: var(--ui-fs-small); font-weight: 600; color: var(--brand-orange); border: 1px dashed var(--brand-orange); border-radius: 3px; padding: .1em .5em; }
/* quiz: a vertical list of answer chips, each a real button with its number key */
.qhead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ui-gap); margin-bottom: .7em; }
.round { flex: none; font: 400 var(--ui-fs-small) / 1 var(--font-pixel); text-transform: uppercase; letter-spacing: .05em; border: 1px solid var(--line-ui); border-radius: 3px; padding: .35em .5em; white-space: nowrap; }
.cards { display: grid; grid-template-columns: 1fr; gap: var(--ui-gap); margin: 0; padding: 0; list-style: none; }
.card { display: flex; align-items: flex-start; gap: .7em; width: 100%; text-align: left; background: rgba(255,255,255,.05); border: 1px solid var(--line-ui); border-radius: clamp(3px, .3cqw, 10px); padding: .55em .7em; font: 400 var(--ui-fs) / 1.4 var(--font-mono); }
.card:hover:not([aria-disabled="true"]) { background: rgba(255,255,255,.13); border-color: var(--line-strong); }
.card[aria-disabled="true"] { cursor: default; }
.badge { flex: none; display: grid; place-items: center; width: 1.6em; height: 1.6em; border: 1px solid var(--line-strong); border-radius: 3px; font: 700 var(--ui-fs-small) / 1 var(--font-mono); }
.card.true { border-color: var(--right); background: rgba(0,189,140,.2); box-shadow: inset 0 0 0 1px var(--right); }
.card.true .badge { background: var(--right); border-color: var(--right); color: #00150f; }
.card.pickedwrong { border-color: var(--wrong); background: rgba(252,178,79,.16); box-shadow: inset 0 0 0 1px var(--wrong); }
.card.pickedwrong .badge { background: var(--wrong); border-color: var(--wrong); color: #1a1000; }
.card.dim { opacity: .55; }
.qfoot { display: flex; align-items: center; justify-content: space-between; gap: var(--ui-gap); margin-top: .7em; min-height: 2.2em; }
.fb { font-weight: 600; min-width: 0; }
.fb.hint { font-weight: 400; color: var(--muted); font-size: var(--ui-fs-small); }
.fb.ok { color: var(--right); } .fb.no { color: var(--wrong); }
/* score card */
.pips { display: flex; gap: var(--ui-gap); margin: .7em 0; }
.pip { display: grid; place-items: center; min-width: 3.4em; height: 1.9em; border-radius: 3px; border: 1px solid var(--line-ui); font: 700 var(--ui-fs-small) / 1 var(--font-mono); padding: 0 .5em; }
.pip.ok { border-color: var(--right); background: rgba(0,189,140,.2); }
.pip.no { border-color: var(--wrong); background: rgba(252,178,79,.16); }
.score-actions { margin-top: .9em; display: flex; gap: var(--ui-gap); flex-wrap: wrap; }
/* planet saved: strengths and the cause, stacked in one compact column */
.chead { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--ui-gap); }
.cols { display: grid; grid-template-columns: 1fr; gap: .9em; margin-top: .8em; }
.cols h2 { margin-bottom: .5em; }
.strengths { list-style: none; margin: 0; padding: 0; display: grid; gap: .45em; }
.strengths li { border-left: 3px solid var(--c); padding: 0 0 0 .6em; }
.strengths b { display: block; font-weight: 700; }
.strengths span { display: block; font-size: var(--ui-fs-small); color: var(--muted); line-height: 1.35; }
.goal { display: flex; align-items: center; gap: .6em; margin-bottom: .5em; }
.goal .num { flex: none; display: grid; place-items: center; width: 2.4em; height: 2.4em; background: #e5243b; border-radius: 3px; font: 700 var(--ui-fs) var(--font-mono); }
.goal b { display: block; font-weight: 700; }
.goal span { font-size: var(--ui-fs-small); color: var(--muted); }
.cause-actions { margin-top: .7em; display: flex; gap: var(--ui-gap); flex-wrap: wrap; }
/* captions move to the bottom right while a panel is open, so they never sit on top of it */
body.in-dialog[data-screen="planet"] .captions { left: auto; right: 1.5cqw; transform: none; max-width: 36cqw; font: 400 var(--ui-fs) / 1.45 var(--font-mono); padding: .6cqw .9cqw; border-radius: .4cqw; background: var(--box-ui); border-color: var(--line-ui); }

/* ---------- Mr Average puppet (copied from art/planet-adrian/scene.html; parts placed in % of the 1335 x 1469 artwork) ---------- */
.avg { position: absolute; left: 14cqw; width: 36cqw; aspect-ratio: 1335 / 1469; top: 40cqw; transition: top .8s cubic-bezier(.3, 1.4, .5, 1); filter: brightness(.82) contrast(1.05); }
.avg[data-pos="up"] { top: 10.5cqw; }
.avg[data-pos="hide"] { top: 40cqw; transition-duration: .55s; transition-timing-function: ease-in; }
.avg .p { position: absolute; }
.avg .p > img { width: 100%; height: 100%; display: block; }
.avg .rig { position: absolute; inset: 0; }
.avg .body { left: 0; top: 12.25%; width: 100%; height: 55.1%; }
.avg .armL { left: 0; top: 45.6%; width: 28.1%; height: 40.5%; transform-origin: 50.6% 3%; }
.avg .armR { left: 74.5%; top: 47%; width: 25.5%; height: 31.3%; transform-origin: 45% 3%; }
.avg .head { left: 37.1%; top: 0; width: 34.1%; height: 20.4%; transform-origin: 50% 100%; }
.avg .jaw { left: 51.2%; top: 76%; width: 45.5%; height: 25.7%; }
.avg .lid { position: absolute; width: 16%; height: 15%; border-radius: 40% 40% 50% 50%; background: linear-gradient(#6b6d6c, #3c3e3e); transform-origin: 50% 0; transform: scaleY(0); transition: transform .07s; }
.avg .lidL { left: 43%; top: 37%; } .avg .lidR { left: 74%; top: 44%; }
.avg.blink .lid, .avg.winkR .lidR { transform: scaleY(1); }
.avg .tag { position: absolute; left: 8.5%; top: 22%; width: 15%; transform: rotate(-8deg); background: #fff; border-radius: .4cqw; box-shadow: 0 .2cqw .6cqw rgba(0,0,0,.5); overflow: hidden; text-align: center; }
.avg .tag b { display: block; background: #e0242b; color: #fff; font: 800 .62cqw/1.25 var(--font-body); padding: .25cqw 0 .15cqw; letter-spacing: .02em; }
.avg .tag b small { display: block; font-weight: 500; font-size: .45cqw; }
.avg .tag i { display: block; font: 700 1.05cqw/1.5 "Marker Felt", "Comic Sans MS", cursive; font-style: normal; color: #1d1d1f; padding: .2cqw 0 .3cqw; }
.avg.laugh .head { animation: hLaugh .22s ease-in-out infinite alternate; }
.avg.laugh .jaw { animation: jChat .11s steps(2) infinite alternate; }
.avg.laugh .armL { animation: aSlapL .3s ease-in-out infinite alternate; }
.avg.laugh .armR { animation: aSlapR .3s ease-in-out infinite alternate; }
.avg.laugh .rig { animation: shakeP .09s linear infinite alternate; }
@keyframes hLaugh { from { transform: rotate(-7deg) translateY(-6%); } to { transform: rotate(3deg) translateY(2%); } }
@keyframes jChat { from { transform: translateY(0); } to { transform: translateY(38%); } }
@keyframes aSlapL { from { transform: rotate(-2deg); } to { transform: rotate(-12deg); } }
@keyframes aSlapR { from { transform: rotate(2deg); } to { transform: rotate(12deg); } }
@keyframes shakeP { from { transform: translate(-.3%, 0); } to { transform: translate(.3%, -.6%); } }
.avg.cringe .head { transform: translateY(22%) scaleY(.9); transition: transform .18s; }
.avg.cringe .lid { transform: scaleY(.7); }
.avg.cringe .rig { transform: rotate(-1.5deg) scale(.97); transform-origin: 50% 100%; transition: transform .2s; animation: shiver .06s linear infinite alternate; }
.avg.cringe .armL { transform: rotate(7deg); transition: transform .2s; }
.avg.cringe .armR { transform: rotate(-7deg); transition: transform .2s; }
/* right answer: arms up in front of his face, and a short-circuit flicker (eyes stutter, the whole puppet glitches) */
.avg.guard .armL { transform: rotate(-48deg) translateY(-4%); transition: transform .15s; }
.avg.guard .armR { transform: rotate(44deg) translateY(-4%); transition: transform .15s; }
.avg.zap .rig { animation: shiver .05s linear infinite alternate, zapFlicker .5s steps(1) infinite; }
@keyframes zapFlicker { 0% { filter: none; } 12% { filter: brightness(1.6) saturate(.4); } 20% { filter: none; } 46% { filter: brightness(.6); } 52% { filter: none; } 78% { filter: brightness(1.4) hue-rotate(150deg); } 84% { filter: none; } }
@keyframes shiver { from { translate: -.25% 0; } to { translate: .25% 0; } }
.avg .eyes { display: none; }
.avg .sparks { position: absolute; inset: 0; pointer-events: none; }
.avg .sparks i { position: absolute; width: .35cqw; height: .35cqw; background: #fff6c8; box-shadow: 0 0 .6cqw #ffd25a, 0 0 1.2cqw #8fd3ff; animation: spark .6s ease-out forwards; }
@keyframes spark { from { opacity: 1; transform: translate(0, 0); } to { opacity: 0; transform: translate(var(--dx), var(--dy)); } }
.avg-name { position: absolute; left: 3cqw; top: 9cqw; color: #fff; opacity: 0; transform: translateX(-2cqw); transition: .5s; pointer-events: none; text-shadow: 0 .2cqw .8cqw #000; z-index: 3; }
.avg-name.on { opacity: 1; transform: none; }
.avg-name b { display: block; font: 400 4.2cqw/1 var(--font-head); letter-spacing: .02em; }
.avg-name span { font-size: 1.1cqw; letter-spacing: .3em; text-transform: uppercase; opacity: .8; }
.avg-clip { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; z-index: 3; pointer-events: none; }
.avg-clip.full { z-index: 33; object-fit: cover; background: #000; }

/* cutaways (full screen, letterboxed) */
.cutaway { position: absolute; inset: 0; z-index: 33; display: none; overflow: hidden; background: #050506; }
.cutaway.on { display: block; animation: fadeIn .15s both; }
.cutaway::before, .cutaway::after { content: ""; position: absolute; left: 0; right: 0; height: 7.5cqw; background: #000; z-index: 4; animation: bars .4s ease-out both; }
.cutaway::before { top: 0; } .cutaway::after { bottom: 0; }
@keyframes bars { from { height: 0; } to { height: 7.5cqw; } }
.cutaway .bgblur { position: absolute; inset: -5%; width: 110%; height: 110%; object-fit: cover; filter: blur(.8cqw) brightness(.35) saturate(.4); }
.cutaway .cuHead { position: absolute; left: 50%; top: 56%; width: 40cqw; aspect-ratio: 1580 / 1400; translate: -50% -50%; animation: push 3.6s cubic-bezier(.2, .8, .3, 1) forwards; }
.cutaway .cuHead img { position: absolute; inset: 0; width: 100%; height: 100%; }
.cutaway .cuShake { position: absolute; inset: 0; animation: shakeP .08s linear infinite alternate; }
.cutaway .cuBrow { animation: browLaugh .2s ease-in-out infinite alternate; }
.cutaway .cuJaw { animation: cuJaw .13s steps(2) infinite alternate; }
@keyframes push { from { scale: .78; rotate: 0deg; } 40% { rotate: -4deg; } 70% { rotate: 3deg; } to { scale: 1.08; rotate: -2deg; } }
@keyframes browLaugh { from { transform: translateY(-1%); } to { transform: translateY(5%); } }
@keyframes cuJaw { from { transform: translateY(2%); } to { transform: translateY(9%); } }
.cutaway .ha { position: absolute; z-index: 3; color: #fff; font: 900 5cqw/1 var(--font-body); letter-spacing: .04em; text-shadow: 0 .3cqw 0 #000, 0 0 2cqw rgba(0,0,0,.8); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes pop { from { scale: 0; opacity: 0; } to { scale: 1; opacity: 1; } }
.cutaway .cuName { position: absolute; z-index: 5; left: 4cqw; bottom: 9cqw; color: #fff; font: 400 2.6cqw/1 var(--font-head); opacity: .9; }
.cutaway.defeat .bgblur { filter: blur(.6cqw) brightness(.5) saturate(.6); }
.sunbeam { position: absolute; z-index: 2; right: -10%; top: -20%; width: 70%; height: 140%; transform: rotate(28deg); transform-origin: 100% 0; background: linear-gradient(90deg, transparent, rgba(255, 226, 150, .55) 35%, rgba(255, 240, 200, .85) 50%, rgba(255, 226, 150, .55) 65%, transparent); filter: blur(1.5cqw); mix-blend-mode: screen; opacity: 0; animation: beamIn 1s .3s ease-out forwards; }
@keyframes beamIn { to { opacity: 1; } }
.avg.big { left: 50%; top: 9cqw; width: 44cqw; translate: -50% 0; z-index: 1; transition: top 2.4s ease-in, opacity .6s; }
.avg.big.sinking { top: 27cqw; }
.avg.big .eyes { display: block; position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.avg.big .eyes i { position: absolute; width: 3.4cqw; height: 1.8cqw; box-shadow: 0 0 1.5cqw .4cqw rgba(170, 225, 255, .9), 0 0 4cqw 1cqw rgba(120, 200, 255, .5); border-radius: 50%; translate: -50% -50%; background: radial-gradient(closest-side, #fff, #d9f1ff 45%, rgba(140, 210, 255, 0)); opacity: 0; transition: opacity .4s, transform .2s; }
.avg.big .eyes i:first-child { left: 54.5%; top: 9.2%; } .avg.big .eyes i:last-child { left: 65.1%; top: 10.6%; }
.avg.big.eyesonly .rig, .avg.big.eyesonly .sparks { opacity: 0; transition: opacity .8s; }
.avg.big.eyesonly .eyes i { opacity: 1; }
.avg.big.eyesout .eyes i { transform: scaleY(0); opacity: 0; }
.flower { position: absolute; width: 1.4cqw; height: 1.4cqw; z-index: 2; background: radial-gradient(circle, #fff7c2 0 22%, transparent 24%), radial-gradient(circle at 50% 15%, var(--c) 0 24%, transparent 26%), radial-gradient(circle at 85% 50%, var(--c) 0 24%, transparent 26%), radial-gradient(circle at 50% 85%, var(--c) 0 24%, transparent 26%), radial-gradient(circle at 15% 50%, var(--c) 0 24%, transparent 26%); transform: scale(0); animation: bloom .5s cubic-bezier(.2, 1.6, .4, 1) forwards; }
@keyframes bloom { to { transform: scale(1); } }
.clouds { position: absolute; z-index: 3; left: -10%; right: -10%; bottom: 0; height: 42%; background:
  radial-gradient(ellipse 18% 40% at 10% 40%, #6b7280 0 60%, transparent 62%), radial-gradient(ellipse 22% 45% at 32% 35%, #7b8290 0 60%, transparent 62%),
  radial-gradient(ellipse 20% 42% at 55% 40%, #6e7584 0 60%, transparent 62%), radial-gradient(ellipse 22% 48% at 78% 34%, #7d8492 0 60%, transparent 62%),
  radial-gradient(ellipse 18% 40% at 96% 42%, #6b7280 0 60%, transparent 62%), linear-gradient(to bottom, transparent 40%, #5d6371 41%); filter: blur(.4cqw); }

/* ---------- 6. FINALE ---------- */
.finale-bg { position: absolute; inset: 0; background: center / cover no-repeat; animation: panIn 20s ease-out both; }
.finale-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.65) 0, rgba(0,0,0,.2) 65%, transparent); }
.finale-bg.dim { filter: blur(.4cqw) brightness(.5); }
.finale-text { position: absolute; left: 5cqw; top: 5cqw; width: 58cqw; z-index: 2; }
.finale-text h1 { font-size: calc(var(--fs-h1) * 1.5); text-shadow: 0 .2cqw 1.2cqw rgba(0,0,0,.6); margin-bottom: 1.4cqw; }
.finale-text p { font-size: var(--fs-intro-body); line-height: 1.45; margin-bottom: .9cqw; text-shadow: 0 .1cqw .6cqw rgba(0,0,0,.8); opacity: 0; transform: translateY(.6cqw); transition: opacity .7s, transform .7s; }
.finale-text p.on { opacity: 1; transform: none; }
.finale-text p.sign { font-family: var(--font-head); font-size: var(--fs-h2); }
.finale-text .btn { margin-top: 1cqw; animation: rise .4s ease-out both; }

/* ---------- 7. LEADERBOARD ---------- */
.board { position: absolute; inset: 4cqw 4cqw; display: grid; grid-template-columns: 1fr 1fr; gap: 2.4cqw; align-items: start; }
.board .panel { position: relative; }
.board-you h1 { font-size: calc(var(--fs-h1) * 1.3); margin: .2cqw 0 .6cqw; }
.board-you form { margin-top: 1.8cqw; }
.board-you label { display: block; font-weight: 600; margin-bottom: .6cqw; }
.name-row { display: flex; gap: .8cqw; }
.name-row input { flex: 1; min-width: 0; background: rgba(255,255,255,.08); border: 1px solid var(--line-strong); border-radius: .7cqw; padding: .75cqw 1cqw; font-size: var(--fs-body); }
.name-row input::placeholder { color: rgba(255,255,255,.45); }
.form-msg { min-height: 2.2em; margin-top: .6cqw; font-size: var(--fs-small); color: var(--muted); }
.form-msg.bad { color: var(--wrong); }
.form-msg.good { color: var(--right); }
.board-actions { display: flex; gap: 1cqw; margin-top: 1cqw; flex-wrap: wrap; }
.board-top h2 { margin-bottom: 1cqw; }
.board-top ol { list-style: none; margin: 0; padding: 0; counter-reset: r; }
.board-top li { counter-increment: r; display: flex; justify-content: space-between; gap: 1cqw; padding: .55cqw .8cqw; border-bottom: 1px solid rgba(255,255,255,.1); font-size: var(--fs-body); }
.board-top li::before { content: counter(r) "."; width: 2.4cqw; color: var(--muted); font-family: var(--font-pixel); }
.board-top li span { flex: 1; }
.board-top li b { font-family: var(--font-pixel); font-weight: 400; letter-spacing: .03em; }
.board-top li.me { background: rgba(59,133,237,.25); border-radius: .5cqw; border-bottom-color: transparent; }
.board-top .empty { color: var(--muted); }
.board-top .empty::before { content: none; }

/* ---------- debug panel (?debug=1) ---------- */
.debug { position: absolute; z-index: 50; right: 1.5cqw; top: 6cqw; width: 23cqw; max-height: 80cqh; overflow: auto; background: rgba(0,0,0,.88); border: 1px dashed var(--brand-orange); border-radius: .5cqw; padding: .6cqw .8cqw; font: 12px/1.4 ui-monospace, Menlo, Consolas, monospace; }
.debug summary { cursor: pointer; color: var(--brand-orange); font-weight: 700; }
.debug h4 { margin: .6cqw 0 .3cqw; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.debug .row { display: flex; flex-wrap: wrap; gap: 4px; }
.debug button { font: 11px ui-monospace, Menlo, monospace; padding: 3px 6px; border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.08); }
.debug button.on { background: var(--brand-green); color: #000; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }

/* ---------- small stages (phones in landscape) ---------- */
body.in-dialog .avg-name { display: none; }
@container (max-width: 760px) {
  .face { width: 3.9cqw; }
  .face .nm { display: none; }
  .map-tip { display: none; }
  body[data-screen="map"] .captions { max-width: 44cqw; font-size: var(--fs-small); padding: .5cqw .9cqw; }
  .quote { width: 20cqw; }
}

/* ---------- v3: title and map art bleed to the window edges ----------
   The stage stays 16:9 (buttons, text and HUD keep their places); only the space and rock pictures are scaled up by
   --cover (set in game.js: how much bigger a 16:9 picture must be to cover the whole window) round the stage centre,
   so there are no black bars at the sides or top and bottom whatever the window shape. */
body[data-screen="title"], body[data-screen="map"] { background: #000; }
body[data-screen="title"] #stage, body[data-screen="map"] #stage, #s-title, #s-map { overflow: visible; }
body[data-screen="map"] #stage { background: transparent; }
#s-title .tv-art, #s-map .gx-bg { transform-origin: 0 0; scale: var(--cover, 1); translate: calc((1 - var(--cover, 1)) * 50cqw) calc((1 - var(--cover, 1)) * 50cqh); }
#s-map .gx-bg { translate: calc((1 - var(--cover, 1)) * 50cqw) calc((1 - var(--cover, 1)) * (100cqw * 1536 / 2752) / 2); }
@media (max-aspect-ratio: 1/1) { #s-title .tv-art { scale: 1; translate: 0 0; } }   /* phones upright: the title art has its own full-window layout */
/* v3: a hand cursor on everything clickable */
#stage button, #stage a, #stage [role="button"], .w3d-mark { cursor: pointer; }

/* v3: "Next: <name>" jump button, bottom centre of the planet */
.next-person { position: absolute; right: calc(2.2cqw + (100vw - 100cqw) / 2); bottom: calc(2.2cqw + (100dvh - 100cqh) / 2); z-index: 30; }
.next-person { background: var(--box-ui); border: 2px solid var(--line-ui); color: #fff; font: 400 clamp(12px, 1cqw, 30px) / 1 var(--font-pixel); text-transform: uppercase; letter-spacing: .05em; box-shadow: none; }
.next-person:hover { background: #000; }
body.w3d-intro .next-person { visibility: hidden; }

/* preloader (index.html): black screen, pixel caps label and a thin white bar, like the other UI boxes */
#preload { position: fixed; inset: 0; z-index: 9999; background: #000; display: grid; place-items: center; transition: opacity .4s; }
#preload.done { opacity: 0; pointer-events: none; }
#preload .pl-box { width: min(320px, 60vw); display: grid; gap: 12px; }
#preload .pl-label { color: #fff; font: 400 18px / 1 var(--font-pixel); text-transform: uppercase; letter-spacing: .08em; text-align: center; }
#preload .pl-bar { position: relative; height: 10px; border-radius: 99px; overflow: hidden; background: rgba(255, 255, 255, .14); }
/* the bar moves from the first moment, before any script has arrived: this layer creeps to 85% on its own; the real
   progress (the i, set by index.html) runs over it once the scripts are in */
#preload .pl-bar::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 0; animation: plCreep 12s cubic-bezier(.15, .7, .3, 1) forwards;
  background: linear-gradient(90deg, var(--brand-blue, #3b85ed), var(--brand-pink, #f299ff), var(--brand-green, #00bd8c), var(--brand-orange, #fcb24f)); background-size: min(320px, 60vw) 100%; }
@keyframes plCreep { to { width: 85%; } }
#preload .pl-bar i { position: relative; }
#preload .pl-bar i { display: block; height: 100%; width: 0; transition: width .2s;   /* the planet loading screen's colour bar */
  background: linear-gradient(90deg, var(--brand-blue, #3b85ed), var(--brand-pink, #f299ff), var(--brand-green, #00bd8c), var(--brand-orange, #fcb24f)); background-size: min(320px, 60vw) 100%;
  box-shadow: 0 0 12px rgba(140, 170, 255, .9); }

/* music licence credit (CC BY 4.0) on the how-to screen */
.music-credit { margin-top: 1em; font-size: 11px; line-height: 1.4; opacity: .7; max-width: 60ch; }

/* v3: the nameplate over the person you reach (name and job title) */
.name-tag { pointer-events: none; font: 400 clamp(12px, 1cqw, 30px) / 1.1 var(--font-pixel); text-transform: uppercase; letter-spacing: .05em; color: #fff; white-space: nowrap; }
body[data-screen="planet"] .name-tag[hidden] { display: none; }

/* sound on/off: the same pixel label as "Next" (capitals, same size) */
.mute { font: 400 clamp(12px, 1cqw, 30px) / 1.1 var(--font-pixel); letter-spacing: .05em; text-transform: uppercase; }

/* a finished planet: how many people you've met, and a button to the next unfinished planet */
.planet-done { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 31; width: min(90%, 34em); padding: 1.4em 1.6em; text-align: center; background: var(--box-ui); border: 2px solid var(--line-ui); color: #fff; font-size: clamp(13px, 1.1cqw, 26px); }
.planet-done[hidden] { display: none; }
.planet-done .pd-eyebrow { margin: 0 0 .5em; font: 400 1.5em / 1 var(--font-pixel); text-transform: uppercase; letter-spacing: .05em; color: #fcb24f; }
.planet-done #pdText { margin: 0 0 1.1em; line-height: 1.4; }
.planet-done .pd-row { display: flex; gap: .6em; justify-content: center; flex-wrap: wrap; }
.planet-done .btn { font: 400 1em / 1 var(--font-pixel); text-transform: uppercase; letter-spacing: .05em; }
.planet-done .pd-stay { background: transparent; border: 2px solid var(--line-ui); color: #fff; box-shadow: none; }
body.w3d-intro .planet-done { visibility: hidden; }

/* 3 Dec: How to play is a floating window in the middle (same box as the planet-complete card), with × in the top right;
   the credits sit small, in capitals, centred along the bottom of the screen. Five type sizes: eyebrow/buttons (pixel),
   heading, step titles, body, credits. */
#s-howto .howto { left: 50%; top: 46%; transform: translate(-50%, -50%); width: min(92%, 60em); max-height: calc(100cqh - 11cqw); overflow-y: auto; box-sizing: border-box;
  padding: 1.8em 2.4em 2em; background: var(--box-ui); border: 2px solid var(--line-ui); border-radius: 4px; font-size: clamp(13px, 1.1cqw, 26px); }
#s-howto .eyebrow { margin: 0 0 .4em; font: 400 1em / 1 var(--font-pixel); letter-spacing: .08em; text-transform: uppercase; color: var(--brand-orange, #fcb24f); }
#s-howto h1 { font-size: 2.4em; }
#s-howto .howto-story { margin: .6em auto 0; max-width: 40em; font-size: 1em; line-height: 1.45; }
#s-howto .steps { margin: 1.4em 0 1.2em; gap: 1.4em; }
#s-howto .steps li { gap: .6em; }
#s-howto .steps h2 { font-size: 1.5em; }
#s-howto .steps p { font-size: 1em; max-width: 18em; }
#s-howto .step-pic { width: 100%; max-width: 16em; height: 9em; }
#s-howto .step-pic kbd { font-size: 1em; }
#s-howto .win { margin: 0 0 1em; font-size: 1em; font-family: var(--font-body); }
#s-howto .btn { font: 400 1em / 1 var(--font-pixel); text-transform: uppercase; letter-spacing: .05em; padding: .8em 1.6em; }
.howto-x { position: absolute; top: 16px; right: 16px; }
.howto-x:hover, .howto-x:focus-visible { color: var(--brand-orange, #fcb24f); }
/* step 2's picture: a little talk box */
.talkicon { flex-direction: row; align-items: center; justify-content: flex-start; padding: 0 1.2em; gap: .9em; }
.talkicon > div { flex: 1; display: flex; flex-direction: column; gap: .5em; }
.talkicon .talk-ava { flex: none; width: 3.4em; height: 3.4em; border-radius: 50%; border: 3px solid #00bd8c; background: #2b2f3a; image-rendering: pixelated; object-fit: cover; }
.talkicon span { font: 400 1em / 1 var(--font-pixel); }
.talkicon i { display: block; height: .35em; width: 80%; border-radius: 2px; background: rgba(255, 255, 255, .25); }
.talkicon i + i { width: 55%; }
.howto-credits { position: absolute; left: 50%; bottom: 1.2cqw; transform: translateX(-50%); width: min(94%, 110em); text-align: center; font-size: clamp(8px, .62cqw, 15px); line-height: 1.5; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .55); }
.howto-credits .music-credit { margin: .3em 0 0; max-width: none; font-size: 1em; opacity: 1; }
/* 3 Dec: the sound toggle is a square pixel speaker icon (game.js setMute) */
.mute { padding: .55cqw; line-height: 0; }
.mute svg { width: max(22px, 2cqw); height: max(22px, 2cqw); display: block; }
.mute svg { width: max(22px, 2.9cqw); height: max(22px, 2.9cqw); }
.mute { padding: .35cqw; }
body.planet-3d[data-screen="planet"] .planet-map { right: calc(1.5cqw + max(30px, 3.6cqw) + 4px + .8cqw); }   /* just left of the sound icon */
.meet { right: calc(1.5cqw + max(30px, 3.6cqw) + 4px + .8cqw); }   /* just left of the sound icon */
/* the speaker icon at a whole multiple of its 16px pixel grid (32px), so its pixels stay sharp; the button keeps the map
   button's height */
.mute svg { width: 32px; height: 32px; }
.mute { padding: 0; display: grid; place-items: center; box-sizing: border-box; height: calc(max(26px, 2.9cqw) + .7cqw + 4px); width: calc(max(26px, 2.9cqw) + .7cqw + 4px); }

/* 3 Dec: every close button is the same: a thin X in a ghost box (2px white outline, 4px corners, clear fill), like the
   other buttons. The X is two 2px lines, so it stays thin at any size. */
body :is(.wk-x, .howto-x, .chat-x, .ad-x, .ph-x) { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; box-sizing: border-box; border: 2px solid rgba(255, 255, 255, .85); border-radius: 4px;
  background: transparent; color: #fff; font-size: 0; line-height: 0; opacity: 1; cursor: pointer; }
body :is(.wk-x, .howto-x, .chat-x, .ad-x, .ph-x)::before, body :is(.wk-x, .howto-x, .chat-x, .ad-x, .ph-x)::after { content: ''; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; margin: -1px 0 0 -8px; background: currentColor; rotate: 45deg; }
body :is(.wk-x, .howto-x, .chat-x, .ad-x, .ph-x)::after { rotate: -45deg; }
body :is(.wk-x, .howto-x, .chat-x, .ad-x, .ph-x):hover, body :is(.wk-x, .howto-x, .chat-x, .ad-x, .ph-x):focus-visible { background: rgba(255, 255, 255, .14); border-color: #fff; color: #fff; outline: none; }

/* 3 Dec: the living sky (play/space.js) and the loading screen's pixel bar and rotating lines (play/motion.js) */
.space-sky { pointer-events: none; display: block; }
#s-title .tv-sky { left: 0; top: 0; width: 100%; height: 100%; }
.gx-sky { background: none !important; }
.ev-sky { inset: 0; width: 100%; height: 100%; }
#s-finale.play .ev-sky { animation: evIn 1s 1.2s both; }
/* while the first loader is up, the title's and map's animated parts wait hidden (play/motion.js) */
body.motion-wait #s-title :is(.tv-title, .tv-icon, .tv-scientist, .tv-steampunk, .tv-rocks3, .tv-rocks2a, .tv-rocks2b, .tv-rockstop), body.motion-wait #s-map :is(#mapLabels, #faces) { opacity: 0; }
.mw { display: inline-block; }
