@font-face {
  font-family: "Nunito";
  src: url("../assets/Nunito-VariableFont_wght.ttf?v=2.1.7") format("truetype");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --sky: #dff4fb;
  --mint: #38c8a0;
  --mint-dark: #168d73;
  --coral: #ff765f;
  --navy: #243248;
  --ink-soft: #5f7083;
  --cream: #fffaf0;
  --white: #fffdf9;
  --line: #d7e2e8;
  --shadow: 0 14px 34px rgba(35, 54, 75, .13);
  --safe-top: max(12px, env(safe-area-inset-top));
  --safe-bottom: max(16px, env(safe-area-inset-bottom));
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--navy);
  background: #b9d9e2;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: #b9d9e2; }
body { min-height: 100dvh; overflow-x: hidden; }
button, input { font: inherit; letter-spacing: 0; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid rgba(36, 50, 72, .35); outline-offset: 3px; }
img, video, canvas { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.app-shell {
  position: relative;
  width: min(100%, 480px);
  min-height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
  background: var(--sky);
  box-shadow: 0 0 50px rgba(27, 55, 72, .24);
}

.topbar {
  position: relative;
  z-index: 30;
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  height: calc(62px + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  color: var(--navy);
  background: rgba(255, 253, 249, .96);
  border-bottom: 1px solid rgba(95, 112, 131, .16);
}

.brand-lockup { display: flex; align-items: center; min-width: 0; gap: 9px; }
.brand-lockup > span:last-child { min-width: 0; }
.brand-lockup strong { display: block; overflow: hidden; font-size: 14px; font-weight: 900; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.brand-lockup small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 8px; font-weight: 900; line-height: 1; }
.brand-mark { display: grid; grid-template-columns: repeat(3, 5px); align-items: end; gap: 2px; width: 26px; height: 26px; padding: 5px; background: var(--mint); border-radius: 7px; }
.brand-mark i { display: block; background: #fff; border-radius: 3px 3px 1px 1px; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 14px; }
.brand-mark i:nth-child(3) { height: 11px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn { display: inline-grid; width: 40px; height: 40px; padding: 0; place-items: center; color: var(--navy); border: 0; border-radius: 7px; background: transparent; cursor: pointer; }
.icon-btn:hover { background: #edf3f5; }
.icon-btn.is-hidden { visibility: hidden; }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.demo-pill { height: 34px; padding: 0 11px; color: var(--ink-soft); font-size: 11px; font-weight: 900; border: 1px solid var(--line); border-radius: 7px; background: #fff; cursor: pointer; }

.eyebrow { display: block; color: var(--mint-dark); font-size: 11px; font-weight: 900; line-height: 1.2; letter-spacing: .06em; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy); letter-spacing: 0; }
p { color: var(--ink-soft); font-weight: 700; line-height: 1.45; }

.primary-btn, .secondary-btn, .text-btn {
  min-height: 50px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 900;
  cursor: pointer;
}
.primary-btn { color: #fff; border: 1px solid var(--mint-dark); background: var(--mint-dark); box-shadow: 0 7px 0 #0f6d5a; }
.primary-btn:active { transform: translateY(4px); box-shadow: 0 3px 0 #0f6d5a; }
.primary-btn:disabled { cursor: wait; opacity: .68; transform: none; box-shadow: 0 4px 0 #0f6d5a; }
.secondary-btn { color: var(--navy); border: 1px solid var(--line); background: #fff; }
.text-btn { color: var(--ink-soft); border: 0; background: transparent; }
.action-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

.mascot { position: relative; display: inline-block; width: 100px; aspect-ratio: 1 / 2; overflow: hidden; }
.mascot img { position: absolute; top: 0; left: calc(var(--sprite) * -100%); width: 500%; height: 100%; max-width: none; object-fit: fill; }

/* Passport */
.home-screen { min-height: calc(100dvh - 62px); padding-bottom: calc(28px + var(--safe-bottom)); }
.passport-hero { position: relative; min-height: 360px; padding: 32px 24px 0; overflow: hidden; background: #cfeef4; border-bottom: 1px solid rgba(35, 50, 72, .1); }
.hero-copy { position: relative; z-index: 2; max-width: 350px; }
.hero-copy h1 { max-width: 330px; margin: 7px 0 8px; font-size: clamp(30px, 9vw, 42px); font-weight: 900; line-height: 1.02; }
.hero-copy p { max-width: 360px; margin-bottom: 0; font-size: 15px; }
.hero-squad { position: absolute; left: -12%; bottom: -4px; width: 124%; height: 165px; }
.hero-squad::before { content: ""; position: absolute; inset: 40px 7% 0; background: rgba(255, 255, 255, .55); border-radius: 50% 50% 0 0; }
.hero-squad img { position: relative; width: 100%; height: 100%; object-fit: contain; object-position: center bottom; }

.recovery-notice { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; margin: 14px 18px 0; padding: 11px 12px; border: 1px solid #e6c884; border-radius: 8px; background: #fff8e6; }
.recovery-notice > span { display: grid; width: 34px; height: 34px; place-items: center; color: #8a6415; border-radius: 50%; background: #ffe7ad; }
.recovery-notice svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.recovery-notice p { margin: 0; color: #64522d; font-size: 12px; line-height: 1.35; }

.passport-section { padding: 24px 18px 20px; background: var(--white); border-bottom: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 15px; }
.section-heading h2 { margin: 3px 0 0; font-size: 24px; font-weight: 900; }
.progress-fraction { font-size: 20px; font-weight: 900; color: var(--coral); }
.passport-slots { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
.passport-slot { position: relative; display: grid; min-width: 0; height: 126px; padding: 8px 4px 7px; place-items: center; align-content: end; overflow: hidden; border: 1px dashed #b7c5cf; border-radius: 8px; background: #f4f7f8; }
.passport-slot.is-collected { border-style: solid; border-color: var(--slot); background: color-mix(in srgb, var(--slot) 12%, white); }
.passport-slot strong { position: relative; z-index: 2; margin-top: 2px; font-size: 14px; font-weight: 900; }
.passport-slot small { position: relative; z-index: 2; max-width: 100%; overflow: hidden; color: var(--ink-soft); font-size: 8px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.passport-mascot { position: absolute; top: 5px; width: 46px; }
.slot-lock { display: grid; width: 36px; height: 36px; margin-bottom: 12px; place-items: center; color: #9aabba; border: 2px solid #b9c6cf; border-radius: 50%; }
.slot-lock svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.next-step { display: grid; grid-template-columns: 62px 1fr; gap: 15px; margin: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: var(--shadow); }
.next-step h2 { margin: 4px 0 5px; font-size: 22px; font-weight: 900; }
.next-step p { margin-bottom: 0; font-size: 13px; }
.scan-icon { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; width: 62px; height: 62px; padding: 10px; border: 2px solid var(--navy); border-radius: 7px; background: #fff; }
.scan-icon i { border: 3px solid var(--navy); }
.scan-icon i:last-child { border-width: 0 3px 3px 0; }
.next-host { grid-column: 1 / -1; display: flex; align-items: center; min-height: 82px; gap: 14px; padding: 8px 14px; color: var(--navy); font-size: 13px; font-weight: 900; border-radius: 7px; background: #eef8f6; }
.next-host .mascot { width: 42px; }
.identity-note { margin: 16px 20px 0; text-align: center; font-size: 12px; }
.data-action { display: block; min-height: 40px; margin: 8px auto 0; padding: 0 14px; color: var(--ink-soft); font-size: 11px; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; border: 0; background: transparent; cursor: pointer; }
.gift-ready { grid-template-columns: 82px 1fr; }
.gift-ready .primary-btn { grid-column: 1 / -1; }
.gift-visual { position: relative; width: 76px; height: 68px; margin-top: 10px; background: var(--coral); border: 4px solid var(--navy); border-radius: 7px; }
.gift-visual::before { content: ""; position: absolute; left: -8px; right: -8px; top: 22px; height: 14px; background: #ffca58; border: 3px solid var(--navy); }
.gift-visual span { position: absolute; left: 29px; top: -8px; width: 14px; height: 76px; background: #ffca58; border: 3px solid var(--navy); }
.gift-visual i::before, .gift-visual i::after { content: ""; position: absolute; top: -18px; width: 31px; height: 22px; border: 5px solid #ffca58; }
.gift-visual i::before { left: 7px; border-radius: 20px 3px 3px 20px; transform: rotate(20deg); }
.gift-visual i::after { right: 7px; border-radius: 3px 20px 20px 3px; transform: rotate(-20deg); }

/* Demo drawer */
.demo-scrim { position: fixed; z-index: 80; inset: 0; background: rgba(21, 36, 50, .48); }
.demo-drawer { position: fixed; z-index: 90; left: 50%; bottom: 0; width: min(100%, 480px); max-height: 86dvh; padding: 10px 18px calc(18px + var(--safe-bottom)); overflow: auto; background: var(--white); border-radius: 8px 8px 0 0; transform: translate(-50%, 105%); transition: transform .28s ease; }
.demo-drawer.is-open { transform: translate(-50%, 0); }
.drawer-handle { width: 42px; height: 5px; margin: 0 auto 16px; border-radius: 4px; background: #ced9df; }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; }
.drawer-heading h2 { margin: 3px 0 14px; font-size: 24px; }
.demo-stations { display: grid; gap: 8px; }
.demo-stations button { display: grid; grid-template-columns: 38px 1fr 22px; align-items: center; min-height: 68px; padding: 7px 12px; text-align: left; color: var(--navy); border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; }
.demo-stations button > span { min-width: 0; }
.demo-stations small { display: block; color: var(--mint-dark); font-size: 9px; font-weight: 900; }
.demo-stations strong { display: block; overflow: hidden; font-size: 15px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.drawer-mascot { width: 31px; }
.demo-stations svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.demo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }

/* Station intro */
.intro-screen { min-height: calc(100dvh - 62px); background: var(--white); }
.intro-visual { position: relative; height: min(47dvh, 420px); min-height: 320px; overflow: hidden; background: color-mix(in srgb, var(--accent) 17%, var(--sky)); border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, white); }
.intro-visual::before { content: ""; position: absolute; left: 50%; bottom: -130px; width: 390px; height: 390px; border: 2px solid rgba(255, 255, 255, .75); border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 0 42px rgba(255, 255, 255, .16), 0 0 0 86px rgba(255, 255, 255, .12); }
.station-number { position: absolute; top: 24px; left: 22px; color: rgba(36, 50, 72, .18); font-size: 78px; font-weight: 900; line-height: 1; }
.intro-mascot { position: absolute; z-index: 2; left: 50%; bottom: 0; width: min(44vw, 205px); transform: translateX(-50%); animation: mascot-idle 2.2s ease-in-out infinite; }
.gesture-demo { position: absolute; z-index: 3; right: 24px; bottom: 40px; width: 82px; height: 82px; border: 2px solid rgba(36, 50, 72, .2); border-radius: 50%; }
.gesture-demo i { position: absolute; display: block; background: var(--navy); }
.gesture-demo i:first-child { left: 26px; top: 17px; width: 30px; height: 42px; border-radius: 18px 18px 12px 12px; transform: rotate(-15deg); }
.gesture-demo i:nth-child(2), .gesture-demo i:nth-child(3) { top: 37px; width: 12px; height: 3px; }
.gesture-demo i:nth-child(2) { left: 8px; }
.gesture-demo i:nth-child(3) { right: 8px; }
.gesture-face i:nth-child(2), .gesture-face i:nth-child(3) { top: 32px; width: 6px; height: 6px; border-radius: 50%; }
.gesture-portal { border-radius: 7px; }
.gesture-dash i:first-child { transform: rotate(0); animation: gesture-slide 1.5s ease-in-out infinite; }
.gesture-beat i:nth-child(2), .gesture-beat i:nth-child(3) { top: auto; bottom: 10px; width: 18px; height: 18px; border-radius: 50%; animation: beat-pulse 1s infinite alternate; }
.intro-content { padding: 26px 22px calc(28px + var(--safe-bottom)); }
.intro-content h1 { margin: 5px 0 10px; font-size: 34px; font-weight: 900; line-height: 1.05; }
.intro-instruction { min-height: 48px; margin-bottom: 18px; font-size: 16px; }
.intro-meta { display: grid; grid-template-columns: 110px 1fr; gap: 8px; margin-bottom: 18px; }
.intro-meta span { min-height: 54px; padding: 10px; color: var(--ink-soft); font-size: 11px; font-weight: 800; line-height: 1.35; border: 1px solid var(--line); border-radius: 7px; background: #f8fafb; }
.intro-meta span:first-child { display: grid; place-items: center; color: var(--navy); text-align: center; }
.intro-content > .primary-btn { width: 100%; }
.privacy-note { margin: -7px 2px 14px; padding-left: 22px; color: var(--ink-soft); font-size: 10px; line-height: 1.4; background: radial-gradient(circle at 7px 7px, var(--mint-dark) 0 4px, transparent 4.5px); }
.best-score { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; padding: 10px 12px; border-radius: 7px; background: color-mix(in srgb, var(--accent) 12%, white); }
.best-score span { color: var(--ink-soft); font-size: 12px; font-weight: 800; }
.best-score strong { font-size: 22px; }

/* Game shell */
.game-screen { display: flex; min-height: calc(100dvh - 62px); flex-direction: column; background: #0e1720; }
.game-hud { position: relative; z-index: 25; display: flex; align-items: center; justify-content: space-between; min-height: 48px; gap: 12px; padding: 6px 14px; color: #fff; background: #182532; }
.game-hud > div:first-child { min-width: 0; }
.game-hud small { display: block; color: var(--accent); font-size: 9px; font-weight: 900; }
.game-hud strong { display: block; overflow: hidden; font-size: 14px; font-weight: 900; text-overflow: ellipsis; white-space: nowrap; }
.hud-status { max-width: 54%; overflow: hidden; color: #cbd7df; font-size: 11px; font-weight: 800; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.game-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #101b25; }
.game-loader { display: grid; min-height: 100%; place-content: center; justify-items: center; gap: 14px; color: #fff; text-align: center; background: #17283a; }
.game-loader .mascot { width: 92px; animation: loader-bounce .8s ease-in-out infinite alternate; }
.game-loader strong { font-size: 17px; }
.game-loader > span { width: 96px; height: 6px; overflow: hidden; border-radius: 4px; background: rgba(255,255,255,.18); }
.game-loader > span::after { content: ""; display: block; width: 45%; height: 100%; border-radius: inherit; background: var(--mint); animation: loader-slide 1s ease-in-out infinite alternate; }

/* Shared camera games */
.camera-game { position: absolute; inset: 0; overflow: hidden; background: #111b24; touch-action: none; }
.camera-feed { width: 100%; height: 100%; object-fit: cover; }
.camera-feed.is-mirrored { transform: scaleX(-1); }
.camera-shade { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 -220px 130px -95px rgba(9, 17, 24, .82), inset 0 110px 90px -70px rgba(9, 17, 24, .45); }
.camera-shade.soft { box-shadow: inset 0 -220px 130px -95px rgba(9, 17, 24, .74); }
.game-timer { position: absolute; z-index: 12; top: 14px; right: 14px; display: grid; width: 50px; height: 34px; place-items: center; color: #fff; font-size: 14px; font-weight: 900; border: 1px solid rgba(255,255,255,.5); border-radius: 7px; background: rgba(17, 29, 40, .62); backdrop-filter: blur(8px); }

/* Tilt */
.calibration-panel { position: absolute; z-index: 20; inset: 0; display: grid; padding: 34px; align-content: center; justify-items: center; text-align: center; color: #fff; background: rgba(12, 22, 30, .7); backdrop-filter: blur(7px); transition: opacity .35s ease, visibility .35s; }
.calibration-panel.is-complete { opacity: 0; visibility: hidden; }
.calibration-panel strong { margin: 18px 0 5px; font-size: 23px; font-weight: 900; }
.calibration-panel p { max-width: 250px; margin-bottom: 16px; color: #d6e0e7; font-size: 13px; }
.face-guide { position: relative; display: block; width: 142px; height: 176px; border: 3px solid #fff; border-radius: 50% 50% 45% 45%; }
.face-guide::before, .face-guide::after { content: ""; position: absolute; top: 72px; width: 18px; height: 7px; border-top: 3px solid #fff; }
.face-guide::before { left: 31px; }
.face-guide::after { right: 31px; }
.mini-progress { width: 190px; height: 7px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.2); }
.mini-progress i { display: block; width: 0; height: 100%; background: var(--mint); transition: width .08s linear; }
.calibration-fallback { margin-top: 18px; padding: 10px 16px; color: #fff; font-size: 12px; font-weight: 900; border: 1px solid rgba(255,255,255,.65); border-radius: 7px; background: rgba(255,255,255,.12); }
.tilt-question { position: absolute; z-index: 9; top: 18px; left: 16px; right: 16px; padding-right: 56px; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.35); }
.tilt-question span { color: #a9ead9; font-size: 9px; font-weight: 900; letter-spacing: .06em; }
.tilt-question h2 { max-width: 360px; margin: 4px 0 0; color: #fff; font-size: clamp(18px, 5.5vw, 25px); font-weight: 900; line-height: 1.08; }
.tilt-choice { position: absolute; z-index: 11; top: 47%; display: grid; width: 128px; height: 128px; padding: 19px 11px 12px; place-items: center; align-content: center; text-align: center; color: var(--navy); border: 0; border-radius: 8px; background: rgba(255, 253, 249, .94); box-shadow: 0 7px 20px rgba(0,0,0,.2); transform: translateY(-50%); transition: transform .2s ease, background .2s ease, color .2s ease; cursor: pointer; }
.tilt-choice.left { left: 14px; }
.tilt-choice.right { right: 14px; }
.tilt-choice svg { position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px); overflow: visible; fill: none; stroke-width: 5; }
.choice-track { stroke: rgba(255,255,255,.38); }
.choice-progress { stroke: var(--mint); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .05s linear; }
.tilt-choice small { color: var(--mint-dark); font-size: 9px; font-weight: 900; }
.tilt-choice strong { max-width: 100%; font-size: 15px; font-weight: 900; line-height: 1.08; }
.tilt-choice.is-active { color: #fff; background: #167f6b; transform: translateY(-50%) scale(1.04); }
.tilt-choice.is-active small { color: #d7fff4; }
.tilt-choice.is-confirmed { z-index: 15; color: #fff; background: var(--mint-dark); transform: translateY(-50%) scale(1.3); animation: choice-confirm .65s ease both; }
.tilt-footer { position: absolute; z-index: 10; left: 16px; right: 16px; bottom: 22px; display: flex; align-items: center; gap: 12px; color: #fff; }
.round-track { flex: 1; height: 7px; overflow: hidden; border-radius: 5px; background: rgba(255,255,255,.28); }
.round-track i { display: block; height: 100%; background: var(--mint); transition: width .3s ease; }
.tilt-footer > strong { min-width: 110px; font-size: 11px; text-align: right; }

/* Face power */
.ar-power { position: absolute; z-index: 9; display: block; aspect-ratio: 1 / .72; opacity: 0; pointer-events: none; transform-origin: center; transition: opacity .2s; }
.ar-power.is-visible { opacity: 1; }
.ar-power .ear { position: absolute; top: -34%; width: 25%; height: 75%; border: 4px solid #243248; border-radius: 50% 50% 44% 44%; background: #fffdf7; transform-origin: bottom center; }
.ar-power .ear::after { content: ""; position: absolute; inset: 16% 30%; border-radius: inherit; background: #ff9c91; }
.ar-power .ear.left { left: 15%; transform: rotate(-10deg); }
.ar-power .ear.right { right: 15%; transform: rotate(10deg); }
.power-gem { position: absolute; left: 50%; top: 28%; width: 24%; aspect-ratio: 1; border: 4px solid #243248; border-radius: 50%; background: var(--mint); transform: translateX(-50%); }
.power-gem::after { content: ""; position: absolute; inset: 31%; border-radius: 50%; background: #fff; }
.ar-power b { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: #ffca58; opacity: 0; }
.ar-power b:nth-of-type(1) { left: 5%; top: 18%; }
.ar-power b:nth-of-type(2) { right: 4%; top: 8%; }
.ar-power b:nth-of-type(3) { right: 18%; bottom: 3%; }
.ar-power.level-1 .power-gem { box-shadow: 0 0 0 9px rgba(56,200,160,.25); }
.ar-power.level-2 b { opacity: 1; animation: power-spark 1s ease-in-out infinite alternate; }
.ar-power.level-3 { filter: drop-shadow(0 0 16px rgba(255,202,88,.75)); }
.ar-power.is-bursting { animation: ar-burst .7s ease; }
.face-target { position: absolute; z-index: 7; left: 50%; top: 43%; width: 62%; aspect-ratio: .77; border: 2px dashed rgba(255,255,255,.52); border-radius: 50%; transform: translate(-50%,-50%); transition: opacity .2s; }
.face-target.is-found { opacity: .15; }
.face-target span::before, .face-target span::after { content: ""; position: absolute; left: 50%; width: 18px; height: 2px; background: #fff; transform: translateX(-50%); }
.face-target span::before { top: -2px; }
.face-target span::after { bottom: -2px; }
.face-prompt { position: absolute; z-index: 12; left: 14px; right: 14px; bottom: 22px; display: grid; grid-template-columns: 48px 1fr; min-height: 118px; gap: 12px; padding: 14px 15px 17px; color: var(--navy); border-radius: 8px; background: rgba(255,253,249,.96); box-shadow: 0 10px 26px rgba(0,0,0,.22); }
.prompt-count { display: flex; height: 48px; align-items: baseline; justify-content: center; border-radius: 7px; background: #e4f7f1; }
.prompt-count strong { font-size: 26px; font-weight: 900; }
.prompt-count span { color: var(--ink-soft); font-size: 11px; font-weight: 900; }
.prompt-copy small { color: var(--mint-dark); font-size: 9px; font-weight: 900; }
.prompt-copy h2 { margin: 1px 0 2px; font-size: 21px; font-weight: 900; }
.prompt-copy p { margin: 0; font-size: 11px; }
.expression-meter { position: absolute; left: 15px; right: 15px; bottom: 9px; height: 6px; overflow: hidden; border-radius: 5px; background: #dfe6e7; }
.expression-meter i { display: block; width: 0; height: 100%; background: var(--mint); transition: width .08s linear; }
.power-pips { position: absolute; z-index: 12; top: 16px; left: 16px; display: flex; gap: 6px; }
.power-pips i { width: 28px; height: 8px; border: 1px solid rgba(255,255,255,.8); border-radius: 5px; background: rgba(13,26,35,.4); }
.power-pips i.is-complete { background: var(--mint); }

/* Portal Hunt */
.portal-vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 120px 20px rgba(12, 25, 34, .48); }
.portal-reticle { position: absolute; z-index: 4; left: 50%; top: 47%; width: 130px; height: 130px; border: 2px solid rgba(255,255,255,.48); border-radius: 50%; transform: translate(-50%,-50%); pointer-events: none; }
.portal-reticle::before, .portal-reticle::after { content: ""; position: absolute; background: rgba(255,255,255,.7); }
.portal-reticle::before { left: 50%; top: -10px; width: 2px; height: 20px; }
.portal-reticle::after { top: 50%; left: -10px; width: 20px; height: 2px; }
.portal-reticle span { position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; border-radius: 50%; background: var(--mint); transform: translate(-50%,-50%); }
.portal-target { position: absolute; z-index: 9; display: grid; width: 104px; height: 132px; padding: 5px; place-items: center; overflow: hidden; border: 2px solid #fff; border-radius: 8px; background: rgba(255,253,249,.9); box-shadow: 0 10px 26px rgba(0,0,0,.28); transform: translate(-50%,-50%) scale(.84); transition: opacity .12s, transform .2s; cursor: pointer; }
.portal-target.is-near { transform: translate(-50%,-50%) scale(1); animation: target-breathe .8s ease-in-out infinite alternate; }
.portal-target .mascot { width: 48px; }
.portal-target > .found-label { position: absolute; inset: auto 0 0; padding: 5px; color: #fff; font-size: 9px; font-weight: 900; background: var(--mint-dark); opacity: 0; }
.portal-target.is-found { opacity: 1 !important; transform: translate(-50%,-50%) scale(1.3) rotate(4deg); pointer-events: none; }
.portal-target.is-found > .found-label { opacity: 1; }
.portal-counter { position: absolute; z-index: 11; top: 14px; left: 14px; padding: 9px 12px; color: #fff; border: 1px solid rgba(255,255,255,.45); border-radius: 7px; background: rgba(17,29,40,.65); backdrop-filter: blur(8px); }
.portal-counter span { display: block; color: #cde8e2; font-size: 8px; font-weight: 900; }
.portal-counter strong { font-size: 17px; font-weight: 900; }
.portal-hint { position: absolute; z-index: 10; left: 50%; bottom: 48px; width: max-content; max-width: calc(100% - 28px); padding: 9px 13px; color: #fff; font-size: 11px; font-weight: 900; border-radius: 7px; background: rgba(17,29,40,.75); opacity: .75; transform: translateX(-50%); transition: opacity .2s; }
.portal-hint.is-visible { color: var(--navy); background: #ffca58; opacity: 1; animation: hint-nudge .7s ease-in-out infinite alternate; }
.motion-mode { position: absolute; z-index: 10; right: 14px; bottom: 14px; color: rgba(255,255,255,.72); font-size: 8px; font-weight: 900; }
.portal-game.is-complete::after { content: "PORTAL TEAM ASSEMBLED"; position: absolute; z-index: 20; inset: 0; display: grid; place-items: center; color: #fff; font-size: 24px; font-weight: 900; text-align: center; background: rgba(22, 141, 115, .68); animation: portal-open 1s ease both; }

/* Power Dash */
.dash-game, .beat-game { position: absolute; inset: 0; overflow: hidden; touch-action: none; background: #122536; }
.dash-game canvas, .beat-game canvas { width: 100%; height: 100%; object-fit: fill; touch-action: none; }
.dash-stats, .beat-stats { position: absolute; z-index: 8; top: 14px; left: 14px; right: 14px; display: grid; grid-template-columns: repeat(3, 1fr); color: #fff; border: 1px solid rgba(255,255,255,.23); border-radius: 8px; background: rgba(14, 27, 38, .68); backdrop-filter: blur(8px); }
.dash-stats > div, .beat-stats > div { padding: 8px 10px; text-align: center; }
.dash-stats > div + div, .beat-stats > div + div { border-left: 1px solid rgba(255,255,255,.18); }
.dash-stats small, .beat-stats small { display: block; color: #b8cad5; font-size: 8px; font-weight: 900; }
.dash-stats strong, .beat-stats strong { display: block; font-size: 18px; font-weight: 900; }
.combo-stat strong { color: #ffca58; }
.frenzy-banner { position: absolute; z-index: 9; left: 50%; top: 90px; padding: 9px 17px; color: var(--navy); font-size: 14px; font-weight: 900; border: 2px solid #fff; border-radius: 7px; background: #ffca58; opacity: 0; transform: translate(-50%,-20px) scale(.8); transition: .2s; }
.frenzy-banner.is-visible { opacity: 1; transform: translate(-50%,0) scale(1); animation: frenzy-pulse .55s ease-in-out infinite alternate; }
.dash-countdown, .beat-countdown { position: absolute; z-index: 20; inset: 0; display: grid; align-content: center; justify-items: center; color: #fff; background: rgba(11,21,30,.72); backdrop-filter: blur(4px); transition: opacity .25s; }
.dash-countdown strong, .beat-countdown strong { font-size: 100px; font-weight: 900; line-height: 1; }
.dash-countdown span, .beat-countdown span { margin-top: 10px; font-size: 14px; font-weight: 900; }
.dash-countdown.is-gone, .beat-countdown.is-gone { opacity: 0; pointer-events: none; }
.dash-game.is-hit { animation: game-shake .28s ease; }

/* Beat Finale */
.beat-stats strong { color: #fff; }
.beat-game::after { content: "TAP"; position: absolute; z-index: 3; left: 0; right: 0; bottom: 4%; color: rgba(255,255,255,.35); font-size: 10px; font-weight: 900; text-align: center; pointer-events: none; }

@keyframes choice-confirm { 0% { transform: translateY(-50%) scale(1.02); } 55% { transform: translateY(-50%) scale(1.3); } 100% { transform: translateY(-50%) scale(1.22); } }
@keyframes power-spark { to { transform: scale(1.5); opacity: .45; } }
@keyframes ar-burst { 50% { transform: translate(-50%,-52%) scale(1.25) rotate(var(--roll, 0deg)); } }
@keyframes target-breathe { to { filter: drop-shadow(0 0 16px rgba(56,200,160,.95)); } }
@keyframes hint-nudge { to { transform: translateX(calc(-50% + 8px)); } }
@keyframes portal-open { from { opacity: 0; transform: scale(1.4); } to { opacity: 1; transform: scale(1); } }
@keyframes frenzy-pulse { to { transform: translate(-50%,0) scale(1.06); } }
@keyframes game-shake { 25% { transform: translateX(-10px); } 50% { transform: translateX(10px); } 75% { transform: translateX(-5px); } }

/* Victory */
.victory-screen { position: relative; min-height: 100dvh; padding: calc(48px + var(--safe-top)) 22px calc(28px + var(--safe-bottom)); overflow: hidden; text-align: center; background: color-mix(in srgb, var(--accent) 16%, var(--sky)); }
.victory-hero { position: relative; z-index: 2; }
.sticker-burst { position: relative; display: grid; width: 210px; height: 240px; margin: 0 auto 24px; place-items: center; border: 3px solid var(--navy); border-radius: 50%; background: var(--accent); box-shadow: 12px 12px 0 rgba(36, 50, 72, .16); animation: sticker-pop .55s cubic-bezier(.2, 1.45, .45, 1); }
.victory-mascot { width: 112px; }
.sticker-burst > span { position: absolute; bottom: 16px; padding: 5px 10px; color: #fff; font-size: 10px; font-weight: 900; border-radius: 5px; background: var(--navy); }
.victory-hero h1 { margin: 6px 0 8px; font-size: 34px; font-weight: 900; }
.victory-hero p { max-width: 360px; margin: 0 auto 20px; font-size: 14px; }
.score-panel { position: relative; z-index: 2; display: grid; grid-template-columns: repeat(3, 1fr); margin: 0 auto 18px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); box-shadow: var(--shadow); }
.score-panel > div { min-width: 0; padding: 13px 5px; }
.score-panel > div + div { border-left: 1px solid var(--line); }
.score-panel small { display: block; color: var(--ink-soft); font-size: 9px; font-weight: 900; }
.score-panel strong { display: block; margin-top: 3px; font-size: 25px; font-weight: 900; }
.score-panel .star-rating { color: #f3ae28; font-size: 19px; white-space: nowrap; }
.victory-actions { position: relative; z-index: 2; display: grid; gap: 12px; }
.victory-actions > .primary-btn { width: 100%; }
.celebration i { position: absolute; z-index: 1; width: 12px; height: 24px; background: var(--coral); animation: confetti-fall 2.5s linear infinite; }
.celebration i:nth-child(1) { left: 8%; top: -30px; }
.celebration i:nth-child(2) { left: 26%; top: -10px; background: #ffca58; animation-delay: .3s; }
.celebration i:nth-child(3) { left: 52%; top: -20px; background: var(--mint); animation-delay: .7s; }
.celebration i:nth-child(4) { left: 74%; top: -14px; background: #745ce8; animation-delay: .2s; }
.celebration i:nth-child(5) { left: 91%; top: -30px; background: #65bff2; animation-delay: .9s; }

/* Final reward */
.final-screen { min-height: calc(100dvh - 62px); padding: 26px 18px calc(30px + var(--safe-bottom)); background: var(--sky); }
.final-screen.final-loading { padding: 0; }
.final-screen.final-loading .game-loader { min-height: calc(100dvh - 62px); }
.final-heading { text-align: center; }
.final-heading h1 { margin: 6px 0 8px; font-size: 32px; font-weight: 900; line-height: 1.05; }
.final-heading p { margin-bottom: 18px; font-size: 13px; }
.media-preview { position: relative; width: min(100%, 360px); aspect-ratio: 9 / 16; margin: 0 auto 14px; overflow: hidden; border: 1px solid rgba(36, 50, 72, .22); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.media-preview img, .media-preview video { width: 100%; height: 100%; object-fit: cover; }
.render-progress { position: absolute; left: 16px; right: 16px; bottom: 16px; height: 46px; padding: 9px 12px; color: #fff; border-radius: 7px; background: rgba(20, 34, 47, .86); }
.render-progress::before { content: ""; position: absolute; left: 12px; right: 12px; bottom: 9px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .24); }
.render-progress span { position: absolute; z-index: 2; left: 12px; bottom: 9px; height: 4px; border-radius: 3px; background: var(--mint); transition: width .15s linear; }
.render-progress strong { display: block; font-size: 11px; }
.render-progress.is-fallback { height: 58px; }
.final-actions { display: grid; gap: 10px; max-width: 360px; margin: 0 auto 22px; }
.voucher { position: relative; max-width: 400px; margin: 0 auto; padding: 24px 24px 20px; overflow: hidden; text-align: center; border: 2px dashed var(--coral); border-radius: 8px; background: var(--white); }
.voucher::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--coral); }
.voucher h2 { margin: 5px 0 7px; font-size: 27px; font-weight: 900; }
.voucher p { margin-bottom: 12px; font-size: 13px; }
.voucher-code { display: block; padding: 13px; color: var(--navy); font-size: 24px; font-weight: 900; letter-spacing: .08em; border: 1px solid var(--line); border-radius: 7px; background: #f4f7f8; }
.voucher small { display: block; margin: 10px 0 16px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.voucher .primary-btn { width: 100%; }
.voucher.is-claimed { opacity: .7; filter: grayscale(.3); }
.voucher-cut { position: absolute; top: 118px; width: 24px; height: 24px; border-radius: 50%; background: var(--sky); }
.voucher-cut.left { left: -14px; }
.voucher-cut.right { right: -14px; }
.voucher-demo { position: absolute; top: 14px; right: 14px; padding: 4px 7px; color: #7a4c42; font-size: 8px; font-weight: 900; letter-spacing: .06em; border: 1px solid #f2b0a4; border-radius: 5px; background: #fff0ec; }
.save-warning { max-width: 360px; margin: 0 auto 12px; padding: 9px 11px; color: #6b5421; font-size: 11px; border: 1px solid #edd38e; border-radius: 7px; background: #fff8e5; }

/* Errors */
.error-screen { display: grid; min-height: calc(100dvh - 62px); padding: 42px 28px calc(32px + var(--safe-bottom)); align-content: center; justify-items: center; text-align: center; background: var(--sky); }
.error-mascot { width: 118px; margin-bottom: 18px; }
.error-screen h1 { max-width: 360px; margin: 7px 0 10px; font-size: 30px; font-weight: 900; }
.error-screen p { max-width: 340px; margin-bottom: 22px; }
.error-screen .primary-btn, .error-screen .text-btn { width: min(100%, 340px); }

/* Local data control */
.data-screen { display: grid; min-height: calc(100dvh - 62px); padding: 42px 28px calc(32px + var(--safe-bottom)); align-content: center; justify-items: center; text-align: center; background: var(--sky); }
.data-shield { display: grid; width: 82px; height: 82px; margin-bottom: 20px; place-items: center; color: var(--mint-dark); border: 2px solid #a8d8cd; border-radius: 50%; background: #e9f8f4; }
.data-shield svg { width: 42px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.data-screen h1 { margin: 7px 0 10px; font-size: 30px; font-weight: 900; }
.data-screen p { max-width: 340px; margin-bottom: 24px; font-size: 14px; }
.data-screen .primary-btn, .data-screen .text-btn { width: min(100%, 340px); }
.danger-btn { border-color: #a63e35; background: #bf4e43; box-shadow: 0 7px 0 #84342d; }
.danger-btn:active { box-shadow: 0 3px 0 #84342d; }

/* Pause recovery */
.resume-screen { display: grid; min-height: calc(100dvh - 62px); padding: 38px 28px calc(28px + var(--safe-bottom)); align-content: center; justify-items: center; text-align: center; background: color-mix(in srgb, var(--accent) 12%, var(--sky)); }
.resume-visual { position: relative; width: 156px; height: 190px; margin-bottom: 20px; }
.resume-mascot { width: 96px; }
.resume-visual > .mascot { position: absolute; left: 30px; top: 0; }
.resume-visual > span { position: absolute; right: 2px; bottom: 10px; display: grid; width: 62px; height: 62px; place-items: center; border: 4px solid var(--white); border-radius: 50%; background: var(--accent); box-shadow: var(--shadow); }
.resume-visual > span::before, .resume-visual > span::after { content: ""; position: absolute; background: #fff; }
.resume-visual > span::before { width: 5px; height: 20px; border-radius: 3px; transform: translateX(-6px); }
.resume-visual > span::after { width: 5px; height: 20px; border-radius: 3px; transform: translateX(6px); }
.resume-screen h1 { max-width: 350px; margin: 6px 0 9px; font-size: 32px; font-weight: 900; }
.resume-screen p { max-width: 350px; margin-bottom: 22px; font-size: 14px; }
.resume-screen .primary-btn, .resume-screen .text-btn { width: min(100%, 350px); }

/* Field diagnostics */
.diagnostics-screen { min-height: calc(100dvh - 62px); padding: 24px 18px calc(30px + var(--safe-bottom)); background: #eef7f8; }
.diagnostics-heading { position: relative; margin-bottom: 16px; padding-right: 88px; }
.diagnostics-heading h1 { margin: 5px 0 7px; font-size: 30px; font-weight: 900; }
.diagnostics-heading p { margin-bottom: 0; font-size: 12px; }
.diagnostic-state { position: absolute; top: 0; right: 0; padding: 6px 9px; font-size: 9px; font-weight: 900; text-transform: uppercase; border-radius: 6px; background: #dfe7eb; }
.diagnostic-state.is-ready { color: #0e755e; background: #d9f5ec; }
.diagnostic-state.is-degraded { color: #775b1a; background: #fff0c7; }
.diagnostic-state.is-blocked { color: #8a3c33; background: #ffe1dc; }
.diagnostic-panel { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.diagnostic-panel h2 { margin: 0 0 10px; font-size: 17px; font-weight: 900; }
.diagnostic-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.diagnostic-panel-heading > span { color: var(--ink-soft); font-size: 10px; font-weight: 900; }
.diagnostic-row { display: flex; min-height: 34px; align-items: center; justify-content: space-between; gap: 14px; border-top: 1px solid #e8eef1; }
.diagnostic-row span { color: var(--ink-soft); font-size: 12px; font-weight: 700; }
.diagnostic-row strong { flex: 0 0 auto; color: var(--navy); font-size: 11px; font-weight: 900; }
.diagnostic-row strong.is-ready { color: var(--mint-dark); }
.diagnostic-row strong.is-limited { color: #9a6a17; }
.diagnostic-progress { min-height: 34px; margin: 10px 0; padding: 9px 10px; font-size: 11px; border-radius: 6px; background: #f1f6f7; }
.diagnostic-panel .secondary-btn, .diagnostics-back { width: 100%; }

@keyframes mascot-idle { 0%, 100% { transform: translateX(-50%) translateY(0) rotate(-1deg); } 50% { transform: translateX(-50%) translateY(-8px) rotate(1deg); } }
@keyframes gesture-slide { 0%, 100% { left: 17px; } 50% { left: 37px; } }
@keyframes beat-pulse { to { transform: scale(1.3); opacity: .6; } }
@keyframes sticker-pop { from { transform: scale(.35) rotate(-14deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes confetti-fall { to { transform: translateY(105dvh) rotate(430deg); } }
@keyframes loader-bounce { to { transform: translateY(-10px); } }
@keyframes loader-slide { to { transform: translateX(122%); } }

@media (max-width: 420px) {
  .hero-squad { left: 0; width: 100%; }
}

@media (max-height: 720px) {
  .passport-hero { min-height: 330px; }
  .hero-squad { height: 145px; }
  .intro-visual { height: 300px; min-height: 300px; }
  .intro-content { padding-top: 18px; }
  .intro-content h1 { font-size: 29px; }
  .victory-screen { padding-top: calc(22px + var(--safe-top)); }
  .sticker-burst { width: 155px; height: 180px; margin-bottom: 16px; }
  .victory-mascot { width: 83px; }
}

@media (min-width: 700px) {
  body { padding: 22px 0; }
  .app-shell { min-height: calc(100dvh - 44px); border-radius: 8px; }
  .demo-drawer { bottom: 22px; }
}

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