/* LTB 500K campaign preview.
   Layout concept: a cheerful sky-and-coin arcade world. Navy is structure (borders, hard shadows, type),
   yellow is the coin/action color, orange marks the high score, pink is a rare pop.
   Colors and fonts come from the 500K Campaign Brand Sheet. Single light look by design. */

@font-face { font-family: "Press Start 2P"; src: url("assets/fonts/press-start-2p.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "Space Mono"; src: url("assets/fonts/space-mono.woff2") format("woff2"); font-display: swap; }
@font-face { font-family: "VT323"; src: url("assets/fonts/vt323.woff2") format("woff2"); font-display: swap; }

:root {
  color-scheme: light;
  --navy: #0F1B4D;
  --blue: #2563EB;
  --sky: #DBEAFE;
  --white: #FFFFFF;
  --yellow: #FFD400;
  --orange: #E8441A;
  --cream: #F7E8C8;
  --pink: #FF3EA5;
  --ink-soft: #3A4573; /* navy tinted for secondary text, AA on white/sky/cream */

  --f-display: "Press Start 2P", "Courier New", monospace;
  --f-body: "Space Mono", ui-monospace, "Courier New", monospace;
  --f-score: "VT323", "Courier New", monospace;

  --gutter: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  --shadow: 6px 6px 0 var(--navy);
  --shadow-sm: 4px 4px 0 var(--navy);
  --border: 3px solid var(--navy);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--white);
  color: var(--navy);
  font: 16px/1.7 var(--f-body);
}
img { max-width: 100%; height: auto; }
img, .px { image-rendering: pixelated; }
h1, h2, h3 { font-family: var(--f-display); font-weight: 400; margin: 0; text-wrap: balance; }
h2 { font-size: clamp(20px, 3.2vw, 32px); line-height: 1.45; }
h3 { font-size: clamp(14px, 1.6vw, 17px); line-height: 1.6; }
p { margin: 0; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1180px; margin-inline: auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.skip { position: absolute; left: 8px; top: -60px; z-index: 50; background: var(--white); border: var(--border); padding: 8px 12px; }
.skip:focus { top: 8px; }

/* Bars */
.preview-bar { background: var(--navy); color: var(--white); font-size: 12px; line-height: 1.5; padding-block: 7px; text-align: center; letter-spacing: .02em; }
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--white); border-bottom: var(--border); }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--white); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 14px; }
.logo { font: 13px/1.6 var(--f-display); text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.logo span { color: var(--blue); }
.nav { display: flex; gap: 26px; font-size: 14px; }
.nav a { text-decoration: none; }
.nav a:hover { text-decoration: underline; text-underline-offset: 5px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 48px; padding: 12px 20px;
  font: 12px/1.5 var(--f-display); letter-spacing: .02em; text-decoration: none; text-align: center;
  background: var(--yellow); color: var(--navy);
  border: var(--border); box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--navy); }
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--navy); }
.btn img { width: 26px; height: auto; }
.btn-white { background: var(--white); }
.btn-lg { min-height: 58px; padding: 14px 24px; font-size: 13px; }
.btn-sm { min-height: 42px; padding: 9px 14px; font-size: 10px; }
.btn-full { width: 100%; }
.arcade-choices { display: grid; gap: 10px; margin: 20px 0; }
.arcade-choices .btn { white-space: normal; overflow-wrap: anywhere; min-width: 0; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.link-btn { background: none; border: 0; padding: 6px 2px; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }
.actions-center { justify-content: center; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.row-nowrap { flex-wrap: nowrap; }

/* Shared */
.band { padding-block: clamp(56px, 8vw, 104px); }
.band-sky { background: var(--sky); }
.band-white { background: var(--white); }
.band-cream { background: var(--cream); }
.panel { background: var(--white); border: var(--border); box-shadow: var(--shadow); }
.eyebrow { font: 11px/1.6 var(--f-display); letter-spacing: .08em; color: var(--blue); margin-bottom: 16px; }
.eyebrow-orange { color: var(--orange); }
.eyebrow-pink { color: var(--pink); }
.section-head { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 24px 56px; align-items: end; margin-bottom: 40px; }
.section-lede { max-width: 46ch; color: var(--ink-soft); }
.tag { display: inline-block; font: 15px/1 var(--f-score); letter-spacing: .06em; background: var(--sky); color: var(--navy); border: 2px solid var(--navy); padding: 4px 7px 3px; vertical-align: middle; }
.tag-pink { background: var(--pink); color: var(--navy); }
.fine { font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
.status-line { font-size: 13px; min-height: 1.6em; margin-top: 12px; color: var(--ink-soft); }
.field-label { display: block; font: 16px/1.2 var(--f-score); letter-spacing: .06em; color: var(--blue); margin: 18px 0 6px; }
input[type=text], textarea { width: 100%; min-width: 0; border: 2px solid var(--navy); background: var(--white); padding: 10px 12px; font-size: 14px; line-height: 1.5; resize: none; }

/* 1. Hero */
.hero { padding-block: clamp(40px, 6vw, 80px) clamp(48px, 7vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px 56px; align-items: center; }
.hero h1 { display: grid; gap: 10px; }
.hero-lead { font: clamp(15px, 1.8vw, 20px)/1.5 var(--f-body); color: var(--navy); }
.hero-number { font-size: clamp(40px, 6.2vw, 92px); line-height: 1.05; letter-spacing: -.04em; color: var(--navy); text-shadow: 5px 5px 0 var(--yellow); }
.hero-unit { font-size: clamp(22px, 3.2vw, 38px); color: var(--blue); line-height: 1.3; }
.hero-sub { font-size: clamp(17px, 1.8vw, 21px); margin-top: 20px; max-width: 32ch; }
.hero-bridge { margin-top: 14px; max-width: 52ch; color: var(--ink-soft); font-size: 15px; }
.hero-card { margin: 0; padding: 0; overflow: hidden; }
.hero-card-scene { position: relative; height: 300px; background: var(--sky); border-bottom: var(--border);
  background-image: radial-gradient(var(--white) 1.5px, transparent 1.6px); background-size: 22px 22px; }
.hc-cloud { position: absolute; width: 96px; }
.hc-cloud.a { left: 18px; top: 24px; }
.hc-cloud.b { right: 22px; top: 70px; width: 80px; }
.hc-spark { position: absolute; width: 28px; left: 46%; top: 30px; }
.hc-players { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; align-items: flex-end; gap: 14px; }
.hc-players img { height: 150px; width: auto; }
.hc-players .hc-heart { height: 46px; align-self: center; margin-bottom: 30px; }
.hc-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: var(--yellow); border-top: var(--border);
  background-image: repeating-linear-gradient(90deg, transparent 0 30px, var(--navy) 30px 33px); }
.hero-card figcaption { text-align: center; padding: 14px 12px 16px; font: 11px/1.8 var(--f-display); color: var(--blue); }
.hero-card figcaption span { font: 20px/1.2 var(--f-score); color: var(--navy); }

.quest-teaser { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "label title meta" "bar bar bar"; gap: 12px 24px; align-items: center;
  margin-top: 48px; padding: 20px 24px; text-decoration: none; background: var(--cream); }
.quest-teaser:hover { background: #FBEFD6; }
.qt-label { grid-area: label; display: inline-flex; gap: 10px; align-items: center; font: 11px/1.5 var(--f-display); }
.qt-title { grid-area: title; font-size: 17px; }
.qt-meta { grid-area: meta; display: inline-flex; gap: 10px; align-items: center; font: 22px/1 var(--f-score); white-space: nowrap; }
.qt-bar { grid-area: bar; display: grid; grid-template-columns: repeat(25, 1fr); gap: 3px; border: var(--border); padding: 3px; background: var(--white); }
.qt-bar i { height: 14px; background: var(--white); border: 1px solid var(--sky); }
.qt-bar i.on { background: var(--yellow); border-color: var(--navy); }

/* 2. Quest */
.quest-board { padding: clamp(16px, 3vw, 32px); }
.quest-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.6fr); gap: 16px; align-items: stretch; }
.stat { border: var(--border); background: var(--sky); padding: 10px 14px 12px; display: grid; }
.stat:first-child { background: var(--yellow); }
.stat-num { font: clamp(40px, 5vw, 60px)/1 var(--f-score); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; line-height: 1.4; }
.stat-goal { background: var(--white); }
.sample-note { align-self: center; font-size: 13px; color: var(--ink-soft); }
.sample-note .tag { margin-right: 6px; }
.loading { margin: 28px 0 18px; }
.loading-head { display: flex; justify-content: space-between; font: 10px/1.5 var(--f-display); margin-bottom: 8px; }
.loading-bar { height: 22px; border: var(--border); background: var(--white); padding: 3px; }
.loading-bar i { display: block; height: 100%; width: 0; background: var(--yellow) repeating-linear-gradient(90deg, transparent 0 14px, var(--navy) 14px 16px); transition: width .5s; }
.gift-grid { display: grid; grid-template-columns: repeat(50, minmax(0, 1fr)); gap: 4px; padding: 10px; border: var(--border); background: var(--sky); }
.gift { aspect-ratio: 1; background: var(--white); border: 2px solid #A9C3EE; position: relative; }
.gift.filled { background: var(--yellow) url("assets/px/coin.png") center / 62% auto no-repeat; border-color: var(--navy); }
.gift.demo { background-color: var(--pink); }
.gift.fresh { animation: pop .6s steps(4) 1; }
@keyframes pop { 0% { transform: scale(.3); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.quest-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px 24px; margin-top: 18px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 20px; list-style: none; margin: 0; padding: 0; font-size: 13px; }
.legend li { display: inline-flex; gap: 8px; align-items: center; }
.lg { width: 16px; height: 16px; border: 2px solid var(--navy); display: inline-block; }
.lg-sample { background: var(--yellow); }
.lg-demo { background: var(--pink); }
.lg-empty { background: var(--white); border-color: #A9C3EE; }
.quest-actions { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }

/* 3. Road */
.road-stage { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.road-scene { position: relative; min-height: 300px; background: var(--sky); border-right: var(--border);
  background-image: radial-gradient(var(--white) 1.5px, transparent 1.6px); background-size: 24px 24px; }
.rs-cloud { position: absolute; width: 90px; }
.rs-cloud.a { left: 6%; top: 26px; } .rs-cloud.b { left: 44%; top: 56px; width: 70px; } .rs-cloud.c { right: 6%; top: 18px; width: 78px; }
.rs-sun { position: absolute; right: 16%; top: 60px; width: 54px; height: 54px; background: var(--yellow); border: 3px solid var(--navy);
  clip-path: polygon(25% 0,75% 0,75% 12%,88% 12%,88% 25%,100% 25%,100% 75%,88% 75%,88% 88%,75% 88%,75% 100%,25% 100%,25% 88%,12% 88%,12% 75%,0 75%,0 25%,12% 25%,12% 12%,25% 12%); }
.rs-student { position: absolute; left: 10%; bottom: 44px; height: 96px; width: auto; }
.rs-coins { position: absolute; left: 32%; bottom: 120px; display: flex; gap: 10px; }
.rs-coins img { width: 26px; }
.rs-coins img:nth-child(2) { transform: translateY(-12px); }
.rs-blob { position: absolute; left: 52%; bottom: 44px; width: 54px; }
.rs-flag { position: absolute; right: 22%; bottom: 44px; width: 4px; height: 110px; background: var(--navy); }
.rs-flag span { position: absolute; left: 4px; top: 0; background: var(--orange); color: var(--white); border: 2px solid var(--navy); font: 9px/1 var(--f-display); padding: 6px 6px; }
.rs-trophy { position: absolute; right: 6%; bottom: 44px; width: 62px; }
.rs-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 44px; background: var(--yellow); border-top: var(--border);
  background-image: repeating-linear-gradient(90deg, transparent 0 30px, var(--navy) 30px 33px); }
.road-start { display: grid; align-content: center; justify-items: start; gap: 18px; padding: 28px; background: var(--white); }
.press-start { font: 15px/1.5 var(--f-display); color: var(--orange); }
.road-hint { font-size: 13px; color: var(--ink-soft); }
.levels { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.level { position: relative; background: var(--white); border: var(--border); box-shadow: var(--shadow-sm); padding: 18px; display: grid; gap: 8px; align-content: start; }
.level-tag { font: 20px/1 var(--f-score); color: var(--blue); letter-spacing: .03em; }
.level strong { font: 12px/1.7 var(--f-display); font-weight: 400; }
.level p { font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.level-boss { background: var(--yellow); }
.level-boss p { color: var(--navy); }
.cleared { position: absolute; top: -12px; right: 10px; font: 15px/1 var(--f-score); background: var(--orange); color: var(--white); border: 2px solid var(--navy); padding: 4px 7px 3px; letter-spacing: .06em; }

/* 4. Impact */
.impact-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 48px 72px; align-items: center; }
.impact-copy p + p { margin-top: 14px; }
.impact-copy h2 { margin-bottom: 22px; }
.levelup { background: var(--sky); padding: clamp(16px, 2.6vw, 28px); }
.levelup-top { display: flex; justify-content: space-between; align-items: center; }
.player-tag { font: 10px/1 var(--f-display); background: var(--pink); border: var(--border); box-shadow: var(--shadow-sm); padding: 9px 14px; }
.levelup-title { font-size: clamp(30px, 4.6vw, 52px); color: var(--orange); margin: 16px 0 18px; line-height: 1.15; }
.levelup-body { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; }
.photo-slot { position: relative; min-height: 220px; border: var(--border); box-shadow: var(--shadow-sm); display: grid; place-items: center; text-align: center;
  background-color: #EAF2FF; background-image: conic-gradient(#C9DBF8 25%, transparent 0 50%, #C9DBF8 0 75%, transparent 0); background-size: 18px 18px; }
.ps-label { font: 18px/1.3 var(--f-score); color: var(--blue); background: rgba(255,255,255,.85); padding: 6px 10px; }
.ps-avatar { position: absolute; right: -10px; bottom: -10px; background: var(--yellow); border: var(--border); padding: 8px 10px 4px; }
.ps-avatar img { width: 52px; }
.levelup-stats { margin: 0; display: grid; gap: 10px; }
.ls { border: var(--border); padding: 8px 10px; box-shadow: 3px 3px 0 var(--navy); }
.ls dt { font: 9px/1.4 var(--f-display); }
.ls dd { margin: 4px 0 0; font: 26px/1 var(--f-score); }
.ls-white { background: var(--white); } .ls-cream { background: var(--cream); } .ls-yellow { background: var(--yellow); }
.levelup-name { font: 15px/1.6 var(--f-display); margin-top: 22px; }
.levelup-line { color: var(--ink-soft); font-size: 14px; margin-top: 4px; }
.xp { margin-top: 16px; }
.xp span { display: block; font: 8px/1.5 var(--f-display); color: var(--blue); margin-bottom: 6px; }
.xp i { display: grid; grid-template-columns: repeat(20, 1fr); gap: 2px; border: 2px solid var(--navy); padding: 2px; background: var(--white); }
.xp i b { height: 12px; background: var(--white); border: 1px solid var(--sky); }
.xp i b.on { background: var(--yellow); border-color: var(--navy); }
.story-note { margin-top: 18px; font-size: 12px; line-height: 1.6; color: var(--ink-soft); }

/* 5. Arcade */
.challenge-banner { display: flex; gap: 18px; align-items: center; padding: 16px 20px; margin-bottom: 40px; background: var(--yellow); }
.challenge-banner p { flex: 1; min-width: 0; font-size: 15px; }
.cabinets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.cabinet { display: flex; flex-direction: column; }
.cab-art { height: 150px; border-bottom: var(--border); display: flex; align-items: center; justify-content: center; gap: 16px; overflow: hidden; }
.cab-art img { height: 84px; width: auto; }
.cab-runner { background: var(--yellow); }
.cab-runner .cab-coin { height: 34px; }
.cab-make10 { background: var(--sky); gap: 4px; align-items: flex-end; padding-bottom: 22px; }
.cab-make10 .t { font: 36px/1 var(--f-score); width: 46px; height: 46px; display: grid; place-items: center; border: var(--border); }
.t1 { background: var(--blue); color: var(--white); } .t2 { background: var(--yellow); transform: translateY(-46px); } .t3 { background: var(--pink); } .t4 { background: var(--white); }
.cab-typing { background: var(--sky); position: relative; }
.cab-typing .word { position: absolute; font: 11px/1 var(--f-display); border: 2px solid var(--navy); background: var(--white); padding: 6px 8px; left: 18%; top: 22%; }
.cab-typing .w2 { left: auto; right: 16%; top: 44%; background: var(--yellow); }
.cab-typing img { position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%); height: 54px; }
.cab-body { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cab-kind { font: 18px/1 var(--f-score); color: var(--blue); letter-spacing: .05em; }
.cab-body p:not(.cab-kind):not(.cab-best) { font-size: 14px; color: var(--ink-soft); }
.cab-best { margin-top: auto; font: 20px/1 var(--f-score); padding-top: 6px; }
.cab-best b { font-weight: 400; color: var(--orange); font-variant-numeric: tabular-nums; }
.cabinet .btn { align-self: flex-start; }
#arcade .fine { margin-top: 20px; }

/* 6. Invite */
.invite-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.invite-card { padding: clamp(18px, 2.6vw, 28px); display: flex; flex-direction: column; gap: 10px; }
.invite-card > img { height: 46px; width: auto; align-self: flex-start; }
.invite-card p { font-size: 14px; color: var(--ink-soft); }
.invite-card .row { margin-top: 6px; }
.invite-link { padding: 18px clamp(18px, 2.6vw, 28px) 16px; margin-top: 24px; background: var(--cream); }
.invite-link .field-label { margin-top: 0; }

/* 7. Dream */
.dream { --scene-h: 300px; background: linear-gradient(var(--cream) 0 calc(100% - var(--scene-h) + 40px), var(--sky) 0); padding-bottom: 0; text-align: center; overflow: hidden; }
.dream-copy { max-width: 820px; }
.dream-copy h2 { font-size: clamp(22px, 3.8vw, 38px); }
.dream-copy p:not(.eyebrow) { margin: 20px auto 0; max-width: 54ch; }
.dream-scene { position: relative; height: var(--scene-h); max-width: 980px; margin: 40px auto 0; }
.dream-bubble { position: absolute; width: 96px; height: 76px; background: var(--white); border: var(--border); box-shadow: var(--shadow-sm); display: grid; place-items: center; }
.dream-bubble img { width: 52px; }
.dream-bubble.b1 { left: 8%; top: 30px; } .dream-bubble.b2 { left: 27%; top: 0; } .dream-bubble.b3 { right: 26%; top: 6px; } .dream-bubble.b4 { right: 8%; top: 42px; }
.dream-bubble.b1 img { width: 64px; }
.dream-spark { position: absolute; width: 24px; }
.s1 { left: 44%; top: 14px; } .s2 { right: 40%; top: 86px; width: 18px; } .s3 { left: 20%; top: 120px; width: 18px; }
.dream-kids { position: absolute; left: 0; right: 0; bottom: 52px; display: flex; justify-content: center; align-items: flex-end; gap: 28px; z-index: 2; }
.dream-kids img { height: 118px; width: auto; }
.dream-ground { position: absolute; left: -50vw; right: -50vw; bottom: 0; height: 54px; background: var(--yellow); border-top: var(--border);
  background-image: repeating-linear-gradient(90deg, transparent 0 30px, var(--navy) 30px 33px); }

/* Footer */
.site-footer { background: var(--navy); color: var(--white); padding-block: 36px 28px; }
.site-footer .logo span { color: var(--yellow); }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px 40px; }
.footer-row p:not(.logo) { font-size: 14px; max-width: 52ch; margin-top: 8px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 14px; align-items: center; }
.site-footer .fine { color: #C9D3F2; margin-top: 20px; }

/* Dialogs */
.dialog { width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: clamp(20px, 4vw, 34px);
  color: var(--navy); background: var(--white); border: var(--border); box-shadow: 8px 8px 0 var(--navy); }
.dialog::backdrop { background: rgba(15, 27, 77, .72); }
.dialog h2 { font-size: clamp(16px, 2.4vw, 20px); margin: 4px 0 18px; padding-right: 32px; }
.dialog > img { margin-bottom: 14px; }
.dialog-close { position: absolute; top: 10px; right: 10px; width: 40px; height: 40px; border: 2px solid var(--navy); background: var(--sky); font: 26px/1 var(--f-body); display: grid; place-items: center; }
.give-real { display: grid; gap: 14px; padding-bottom: 22px; border-bottom: 2px dashed var(--navy); }
.give-demo { display: grid; gap: 12px; padding-top: 20px; }
.give-demo .tag { justify-self: start; }
.give-demo p:not(.tag) { font-size: 14px; color: var(--ink-soft); }
body:has(dialog[open]) { overflow: hidden; }

.dialog-game { width: min(980px, calc(100% - 16px)); padding: clamp(12px, 2.2vw, 24px); }
.game-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding-right: 48px; }
.game-head h2 { margin: 0; padding: 0; font-size: clamp(13px, 1.8vw, 17px); }
.game-score { font: 18px/1 var(--f-score); }
.game-score b { font-weight: 400; font-size: 30px; color: var(--orange); font-variant-numeric: tabular-nums; }
.game-tools { display: flex; gap: 8px; margin-left: auto; }
.tool-btn { border: 2px solid var(--navy); background: var(--white); padding: 6px 12px; font-size: 13px; min-height: 38px; }
.tool-btn[aria-pressed=true] { background: var(--yellow); }
.game-help { font-size: 13px; color: var(--ink-soft); margin: 10px 0 12px; }
.game-stage { position: relative; display: grid; place-items: center; background: var(--sky); border: var(--border); height: min(60vh, 540px); height: min(60dvh, 540px); min-height: 240px; overflow: hidden; }
.game-stage canvas { display: block; image-rendering: pixelated; touch-action: none; outline: none; }
.game-stage canvas:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.game-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 10px; }
.game-controls:empty { display: none; }
.game-controls button { min-width: 64px; min-height: 52px; border: var(--border); background: var(--white); box-shadow: 3px 3px 0 var(--navy); font: 11px/1 var(--f-display); padding: 8px 12px; touch-action: manipulation; }
.game-controls button:active { background: var(--yellow); transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--navy); }

/* In-game overlays (HTML, so text stays crisp and readable) */
.ov { position: absolute; z-index: 3; }
.ov-center { inset: 0; display: grid; place-items: center; padding: 12px; background: rgba(219, 234, 254, .82); }
.ov-card { background: var(--white); border: var(--border); box-shadow: var(--shadow-sm); padding: clamp(14px, 3vw, 24px); max-width: 440px; width: 100%; text-align: center; display: grid; gap: 12px; justify-items: center; }
.ov-card h3 { font-size: clamp(14px, 2.4vw, 20px); color: var(--navy); }
.ov-card p { font-size: 14px; color: var(--ink-soft); }
.ov-kicker { font: 18px/1 var(--f-score); color: var(--orange); letter-spacing: .06em; }
.ov-choices { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.ov-choice { border: var(--border); background: var(--sky); padding: 10px 14px 8px; display: grid; justify-items: center; gap: 6px; font: 10px/1.2 var(--f-display); min-width: 110px; }
.ov-choice img { height: 56px; width: auto; }
.ov-choice[aria-pressed=true] { background: var(--yellow); box-shadow: 3px 3px 0 var(--navy); }
.ov-banner { left: 50%; top: clamp(34px, 9%, 48px); transform: translateX(-50%); width: min(92%, 520px); background: var(--white); border: var(--border); box-shadow: var(--shadow-sm); padding: 10px 14px; display: grid; gap: 4px; text-align: left; pointer-events: none; animation: drop .35s steps(5) 1; }
.ov-banner .ov-kicker { font-size: 16px; color: var(--blue); }
.ov-banner strong { font: clamp(10px, 1.6vw, 13px)/1.5 var(--f-display); font-weight: 400; }
.ov-banner p { font-size: clamp(12px, 1.5vw, 14px); line-height: 1.5; color: var(--ink-soft); }
@keyframes drop { from { transform: translate(-50%, -24px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.ov-hud { left: 8px; right: 8px; top: 8px; display: flex; justify-content: space-between; gap: 10px; pointer-events: none; font: clamp(16px, 2.2vw, 22px)/1 var(--f-score); color: var(--navy); }
.ov-hud .pill { background: rgba(255,255,255,.9); border: 2px solid var(--navy); padding: 3px 8px 2px; white-space: nowrap; }
.ov-hud .hearts { letter-spacing: 2px; color: var(--pink); }
.ov-pause { inset: 0; display: grid; place-items: center; background: rgba(15, 27, 77, .45); }

/* Results */
.results { margin-top: 4px; }
.results-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.results-copy { display: grid; gap: 12px; align-content: start; }
.results-copy .eyebrow { margin: 0; }
#results-title { font: clamp(56px, 9vw, 96px)/1 var(--f-score); color: var(--blue); }
.results-best { font: 22px/1.2 var(--f-score); }
.results-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.results-actions .btn { font-size: 10px; min-height: 44px; padding: 9px 12px; }
.results-give { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--cream); border: 2px solid var(--navy); padding: 12px 14px; }
.results-give p { flex: 1; min-width: 200px; font-size: 14px; }
.results-card { margin: 0; text-align: center; }
#story-preview { display: block; width: 100%; max-width: 260px; height: auto; margin: 0 auto 8px; border: var(--border); box-shadow: var(--shadow-sm); background: var(--sky); }

.toast { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: var(--navy); color: var(--white); padding: 12px 18px; border: 2px solid var(--yellow); font-size: 14px; max-width: calc(100% - 32px); }

/* Responsive */
@media (max-width: 1000px) {
  .gift-grid { grid-template-columns: repeat(25, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .nav { gap: 16px; font-size: 13px; }
  .section-head { grid-template-columns: 1fr; gap: 14px; }
  .quest-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sample-note { grid-column: 1 / -1; }
  .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .impact-grid { grid-template-columns: 1fr; }
  .cabinets { grid-template-columns: 1fr; max-width: 560px; }
  .cabinet { flex-direction: row; }
  .cab-art { width: 38%; height: auto; min-height: 180px; border-bottom: 0; border-right: var(--border); flex-direction: column; gap: 8px; }
  .cab-art img { height: 64px; }
}
@media (max-width: 760px) {
  .header-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; }
  .header-row > .logo { grid-column: 1; grid-row: 1; }
  .header-row > .btn { grid-column: 2; grid-row: 1; }
  .nav { grid-column: 1 / -1; grid-row: 2; justify-content: space-between; gap: 8px; }
  .nav a { display: inline-flex; align-items: center; min-height: 44px; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 420px; }
  .road-stage { grid-template-columns: 1fr; }
  .road-scene { border-right: 0; border-bottom: var(--border); min-height: 240px; }
  .invite-grid { grid-template-columns: 1fr; }
  .results-grid { grid-template-columns: 1fr; }
  .results-card { order: -1; }
  #story-preview { max-width: 170px; }
  .quest-teaser { grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "title" "bar" "meta"; padding: 16px; }
  .qt-title { font-size: 15px; }
}
@media (max-width: 560px) {
  body { font-size: 15px; }
  .logo { font-size: 10px; }
  .header-row { padding-block: 10px; }
  .btn-sm { font-size: 9px; padding: 8px 10px; min-height: 40px; }
  .eyebrow { font-size: 10px; }
  .hero-number { font-size: clamp(36px, 12.2vw, 60px); }
  .hero-card-scene { height: 240px; }
  .cab-art.cab-typing { display: block; }
  .hc-players img { height: 116px; }
  .hc-players .hc-heart { height: 34px; }
  .gift-grid { grid-template-columns: repeat(20, minmax(0, 1fr)); gap: 2px; padding: 6px; }
  .gift { border-width: 1px; }
  .quest-stats { gap: 8px; }
  .stat { padding: 8px 8px 10px; }
  .stat-label { font-size: 11px; }
  .levels { grid-template-columns: 1fr; }
  .levelup-body { grid-template-columns: 1fr; }
  .photo-slot { min-height: 190px; }
  .levelup-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ls dt { font-size: 7px; }
  .ls dd { font-size: 20px; }
  .cabinet { flex-direction: column; }
  .cab-art { width: auto; min-height: 0; height: 130px; border-right: 0; border-bottom: var(--border); flex-direction: row; }
  .row-nowrap { flex-wrap: wrap; }
  .row-nowrap .btn { width: 100%; }
  .dream { --scene-h: 250px; }
  .dream-bubble { width: 66px; height: 54px; }
  .dream-bubble img { width: 36px; }
  .dream-bubble.b1 img { width: 44px; }
  .dream-bubble.b1 { left: 2%; } .dream-bubble.b4 { right: 2%; } .dream-bubble.b2 { left: 24%; } .dream-bubble.b3 { right: 22%; }
  .dream-kids img { height: 96px; }
  .dialog-game { width: 100%; max-width: 100%; max-height: 100dvh; height: 100dvh; margin: 0; border-width: 0; box-shadow: none; }
  .game-stage { height: 54vh; height: 54dvh; }
  .game-tools { margin-left: 0; width: 100%; }
  .tool-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* Keep wide pixel sprites inside their cabinet artwork. */
.cab-art img { max-width: 32%; object-fit: contain; }

/* Share panel */
.share-panel { display: grid; gap: 10px; }
.share-native { display: none; }
.share-panel[data-share-mode="native"] .share-native { display: inline-flex; }
.share-panel[data-share-mode="native"] [data-share-network], .share-panel[data-share-mode="native"] [data-share-copy] { display: none; }
.share-panel[data-share-mode="native"] .share-buttons:not(:has([data-share-card])) { display: none; }
.share-panel .status-line:empty { display: none; }
.share-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }
.share-buttons .btn { font-size: 9px; padding-inline: 6px; }
