:root {
  --ink: #2d2850;
  --purple: #6c4cff;
  --purple-dark: #4e32d4;
  --pink: #ff5d9e;
  --orange: #ff9c42;
  --yellow: #ffd94d;
  --blue: #43a9ff;
  --mint: #42d3b4;
  --cream: #fff9ea;
  --white: #fff;
  --shadow: 0 12px 32px rgba(70, 48, 150, .16);
  --soft-shadow: 0 6px 0 rgba(54, 38, 128, .12);
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }

body {
  font-family: "Trebuchet MS", "Arial Rounded MT Bold", system-ui, sans-serif;
  color: var(--ink);
  background: #f0ebff;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

button { font: inherit; }

.app-shell {
  width: 100%;
  height: 100dvh;
  min-height: 320px;
  background:
    radial-gradient(circle at 8% 10%, rgba(255,255,255,.85) 0 4%, transparent 4.2%),
    radial-gradient(circle at 92% 86%, rgba(255,255,255,.72) 0 5%, transparent 5.2%),
    linear-gradient(135deg, #f7f3ff 0%, #e6f8ff 55%, #fff4df 100%);
}

.screen { display: none; width: 100%; height: 100%; }
.screen.active { display: flex; }

.install-screen {
  position: relative;
  align-items: center;
  justify-content: center;
  gap: clamp(28px, 6vw, 100px);
  padding: max(22px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  overflow-y: auto;
  background:
    radial-gradient(circle at 12% 14%, rgba(255,255,255,.9) 0 5%, transparent 5.2%),
    radial-gradient(circle at 88% 82%, rgba(255,255,255,.72) 0 6%, transparent 6.2%),
    linear-gradient(135deg, #f5efff, #ddf8ff 54%, #fff0d4);
}
.welcome-brand { display: flex; align-items: center; gap: clamp(18px, 3vw, 38px); width: min(46vw, 650px); }
.welcome-brand h1 { margin: 0; font-size: clamp(48px, 7vw, 102px); line-height: .92; letter-spacing: -.065em; }
.welcome-brand h1 span { color: var(--purple); }
.welcome-brand p:last-child { max-width: 500px; margin: 16px 0 0; color: #6b6485; font-size: clamp(15px, 1.55vw, 22px); line-height: 1.4; font-weight: 800; }
.mini-logo { position: relative; flex: 0 0 clamp(145px, 18vw, 235px); aspect-ratio: 1; border: 9px solid white; border-radius: 35%; background: var(--purple); box-shadow: var(--shadow); transform: rotate(-3deg); }
.mini-logo::before, .mini-logo::after { content: ""; position: absolute; top: 21%; width: 37%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset -8px -7px 0 rgba(42,27,115,.1); }
.mini-logo::before { left: 12%; background: var(--pink); }
.mini-logo::after { right: 12%; background: var(--mint); }
.mini-logo i { position: absolute; z-index: 2; left: 50%; bottom: 10%; transform: translateX(-50%); color: var(--yellow); font-size: clamp(44px, 6vw, 76px); font-style: normal; }
.mini-logo span { position: absolute; z-index: 3; display: grid; place-items: center; width: 31%; aspect-ratio: 1; border-radius: 30%; color: white; font-size: clamp(20px, 3vw, 39px); font-weight: 900; box-shadow: var(--soft-shadow); }
.mini-logo span:nth-child(1) { left: -9%; top: -9%; background: var(--blue); }
.mini-logo span:nth-child(2) { right: -8%; top: -8%; background: var(--pink); }
.mini-logo span:nth-child(3) { right: -9%; bottom: 2%; background: var(--orange); }

.install-panel { width: min(570px, 47vw); padding: clamp(20px, 3vw, 38px); border: 5px solid white; border-radius: 34px; background: rgba(255,255,255,.78); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.step-label { margin: 0 0 5px; color: var(--pink); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.install-panel h2, .catalog-header h2 { margin: 0; font-size: clamp(25px, 3vw, 43px); line-height: 1.08; }
.platform-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.platform-card { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px; min-width: 0; min-height: 120px; border: 3px solid transparent; border-radius: 24px; padding: 16px; color: var(--ink); background: white; box-shadow: 0 6px 0 rgba(55,38,128,.1); text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease; }
.platform-card:hover, .platform-card:focus-visible { transform: translateY(-3px); border-color: var(--platform); outline: none; }
.platform-card.android { --platform: #23af77; }
.platform-card.ios { --platform: #262337; }
.platform-icon { display: grid; place-items: center; width: 50px; aspect-ratio: 1; border-radius: 16px; background: color-mix(in srgb, var(--platform) 13%, white); font-size: 28px; }
.apple-icon { color: white; background: var(--platform); font-size: 15px; font-weight: 900; }
.platform-card b, .platform-card small { display: block; }
.platform-card b { font-size: clamp(15px, 1.4vw, 20px); }
.platform-card small { margin-top: 3px; color: #77708c; font-size: 11px; line-height: 1.25; font-weight: 700; }
.platform-card i { grid-column: 1 / -1; justify-self: start; padding: 5px 10px; border-radius: 999px; color: var(--platform); background: color-mix(in srgb, var(--platform) 12%, white); font-size: 11px; font-style: normal; font-weight: 900; }
.platform-card.selected { border-color: var(--platform); }
.install-guide { display: flex; flex-direction: column; gap: 3px; min-height: 62px; margin-top: 14px; padding: 11px 14px; border-radius: 17px; color: #615a7b; background: #f1edff; font-size: 12px; line-height: 1.35; }
.install-guide b { color: var(--purple-dark); font-size: 13px; }
.install-guide ol { margin: 5px 0 0; padding-left: 20px; }
.install-guide.android-guide { background: #e5faf2; }
.install-guide.android-guide b { color: #087c55; }
.install-guide.ios-guide { background: #edf3ff; }
.install-guide.ios-guide b { color: #354c93; }
.continue-button { width: 100%; margin-top: 14px; border: 0; border-radius: 18px; padding: 13px 18px; color: white; background: var(--purple); box-shadow: 0 6px 0 var(--purple-dark); font-weight: 900; cursor: pointer; }
.continue-button span { margin-left: 7px; }

.games-screen { flex-direction: column; overflow-y: auto; padding: max(16px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(22px, env(safe-area-inset-left)); background: linear-gradient(145deg, #f4efff, #e4f9ff 55%, #fff3dc); }
.catalog-header { flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; width: min(1400px, 100%); margin: 0 auto 16px; }
.catalog-header > div:nth-child(2) { text-align: center; }
.catalog-brand { display: flex; align-items: center; gap: 10px; font-size: clamp(20px, 2.3vw, 34px); }
.catalog-brand > span { display: grid; place-items: center; width: 42px; aspect-ratio: 1; border-radius: 13px; color: var(--yellow); background: var(--purple); box-shadow: var(--soft-shadow); }
.catalog-brand i { color: var(--purple); font-style: normal; }
.catalog-install-button { justify-self: end; border: 0; border-radius: 16px; padding: 10px 15px; color: var(--purple-dark); background: white; box-shadow: var(--soft-shadow); font-size: 13px; font-weight: 900; cursor: pointer; }
.game-catalog { flex: 1 0 auto; display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); grid-template-rows: repeat(2, minmax(120px, 1fr)); gap: clamp(10px, 1.4vw, 20px); width: min(1400px, 100%); margin: auto; }
.game-card { position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto 1fr; align-items: center; min-width: 0; min-height: 0; overflow: hidden; border: 4px solid white; border-radius: 27px; padding: clamp(12px, 1.5vw, 20px); color: var(--ink); background: var(--game-soft); box-shadow: 0 8px 0 color-mix(in srgb, var(--game) 15%, transparent); text-align: left; cursor: pointer; transition: transform .17s ease, box-shadow .17s ease; }
.game-card:hover, .game-card:focus-visible { transform: translateY(-4px); box-shadow: 0 12px 0 color-mix(in srgb, var(--game) 20%, transparent); outline: 3px solid color-mix(in srgb, var(--game) 35%, transparent); }
.game-card.available::after { content: ""; position: absolute; right: -15%; bottom: -42%; width: 75%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--game) 13%, transparent); }
.game-number { align-self: start; color: color-mix(in srgb, var(--game) 72%, #333); font-size: 11px; font-weight: 900; letter-spacing: .08em; }
.game-picture { justify-self: end; font-size: clamp(31px, 4vw, 58px); filter: drop-shadow(0 5px 0 rgba(60,45,100,.1)); }
.game-copy { position: relative; z-index: 2; grid-column: 1 / -1; align-self: end; }
.game-copy b, .game-copy small, .game-copy em { display: block; }
.game-copy b { font-size: clamp(14px, 1.25vw, 20px); line-height: 1.1; }
.game-copy small { margin-top: 5px; color: #716a84; font-size: clamp(10px, .85vw, 12px); line-height: 1.25; font-weight: 700; }
.game-copy em { width: max-content; margin-top: 9px; padding: 5px 10px; border-radius: 999px; color: white; background: var(--game); font-size: 10px; font-style: normal; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; }
.game-card.coming { filter: saturate(.82); }
.game-card.coming .game-copy em { color: var(--game); background: white; }

.catalog-back-button { display: flex; align-items: center; gap: 7px; min-height: 42px; border: 0; border-radius: 15px; padding: 8px 13px; color: var(--purple-dark); background: white; box-shadow: var(--soft-shadow); font-size: 13px; font-weight: 900; cursor: pointer; }
.orange-text { color: #e86f25; }
.airship-start-screen { position: relative; align-items: center; justify-content: center; gap: clamp(30px, 6vw, 100px); padding: clamp(20px, 3vw, 48px); overflow-y: auto; background: linear-gradient(180deg, #d9f5ff 0 68%, #fff0cb 68%); }
.airship-start-screen::after { content: ""; position: absolute; left: 0; right: 0; bottom: 22%; height: 7%; background: rgba(255,255,255,.72); clip-path: polygon(0 55%, 8% 32%, 17% 63%, 27% 25%, 38% 70%, 48% 28%, 60% 62%, 72% 20%, 84% 61%, 93% 30%, 100% 55%, 100% 100%, 0 100%); }
.airship-hero { position: relative; z-index: 1; width: min(40vw, 560px); height: min(70vh, 530px); }
.hero-airship { position: absolute; z-index: 3; left: 50%; top: 48%; width: min(31vw, 420px); transform: translate(-50%, -50%) rotate(-4deg); animation: heroFly 3s ease-in-out infinite alternate; }
.hero-balloon { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 2.05; border: 7px solid white; border-radius: 52% 48% 48% 52% / 55% 55% 45% 45%; color: white; background: linear-gradient(180deg, #ff9c42 0 31%, #ffcf4b 31% 61%, #f15a91 61%); box-shadow: inset -18px -10px 0 rgba(80,40,90,.08), var(--shadow); font-size: clamp(45px, 8vw, 100px); font-weight: 900; }
.hero-balloon::before { content: ""; position: absolute; left: 16%; right: 16%; top: 0; bottom: 0; border: 5px solid rgba(255,255,255,.6); border-block: 0; border-radius: 50%; }
.hero-gondola { position: relative; display: grid; place-items: center; width: 34%; height: clamp(42px, 8vh, 72px); margin: 10px auto 0; border-radius: 13px 13px 38px 38px; color: var(--yellow); background: var(--purple); box-shadow: inset 0 -8px 0 rgba(50,30,140,.2), var(--soft-shadow); font-size: 28px; }
.hero-gondola::before, .hero-gondola::after { content: ""; position: absolute; bottom: 92%; width: 3px; height: 23px; background: #5e5276; transform-origin: bottom; }
.hero-gondola::before { left: 20%; transform: rotate(-17deg); }
.hero-gondola::after { right: 20%; transform: rotate(17deg); }
.hero-cloud, .race-cloud { position: absolute; border-radius: 999px; background: rgba(255,255,255,.9); box-shadow: -25px 10px 0 white, 28px 7px 0 white; }
.hero-cloud { width: 90px; height: 31px; }
.cloud-one { left: 4%; top: 16%; }
.cloud-two { right: 8%; bottom: 18%; transform: scale(.75); }
.hero-candy { position: absolute; z-index: 4; display: grid; place-items: center; width: clamp(42px, 5vw, 68px); aspect-ratio: 1; border: 5px solid white; border-radius: 19px; color: white; background: var(--candy, var(--pink)); box-shadow: var(--soft-shadow); font-size: clamp(19px, 2.5vw, 32px); font-weight: 900; }
.candy-one { --candy:var(--blue); left: 1%; bottom: 19%; transform: rotate(-11deg); }
.candy-two { --candy:var(--pink); right: 2%; top: 12%; transform: rotate(9deg); }
.candy-three { --candy:var(--mint); right: 8%; bottom: 4%; transform: rotate(-5deg); }
.airship-mode-panel { position: relative; z-index: 2; width: min(680px, 52vw); padding: clamp(20px, 2.7vw, 36px); border: 5px solid white; border-radius: 34px; background: rgba(255,255,255,.82); box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.airship-mode-panel h2 { margin: 0; font-size: clamp(26px, 3.3vw, 48px); line-height: 1.05; }
.airship-intro { margin: -5px 0 16px; color: #716985; font-size: clamp(12px, 1.25vw, 17px); line-height: 1.35; font-weight: 800; }
.airship-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.airship-mode-grid button { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; min-width: 0; min-height: 83px; border: 3px solid transparent; border-radius: 20px; padding: 10px; color: var(--ink); background: white; box-shadow: 0 5px 0 color-mix(in srgb, var(--level) 18%, transparent); text-align: left; cursor: pointer; transition: transform .16s, border-color .16s; }
.airship-mode-grid button:hover, .airship-mode-grid button:focus-visible { transform: translateY(-3px); border-color: var(--level); outline: none; }
.airship-mode-grid button > span { grid-row: 1 / 3; display: grid; place-items: center; width: 42px; aspect-ratio: 1; border-radius: 14px; color: white; background: var(--level); font-size: 21px; font-weight: 900; }
.airship-mode-grid b, .airship-mode-grid small { min-width: 0; }
.airship-mode-grid b { align-self: end; font-size: clamp(12px, 1.2vw, 17px); }
.airship-mode-grid small { align-self: start; color: #7c748e; font-size: 10px; font-weight: 700; }

.airship-game-screen { position: relative; flex-direction: column; background: linear-gradient(180deg, #bcecff 0%, #eafaff 72%, #fff0cc 72%); }
.airship-header { position: relative; z-index: 10; flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); }
.airship-header .catalog-back-button { justify-self: start; }
.airship-mode-chip { justify-self: center; background: white; }
.airship-timer { justify-self: end; }
.airship-layout { position: relative; z-index: 2; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: clamp(70px, 9vw, 126px) 1fr clamp(70px, 9vw, 126px); gap: clamp(7px, 1.4vw, 20px); padding: 0 max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.airship-playfield { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto 1fr; gap: 4px; }
.airship-problem-card { justify-self: center; display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 25px); min-width: min(620px, 76%); min-height: clamp(62px, 12vh, 105px); padding: 7px 25px; border: 5px solid white; border-radius: 25px; background: rgba(255,255,255,.92); box-shadow: var(--shadow); }
.airship-problem { font-size: clamp(31px, 6vh, 64px); line-height: 1; font-weight: 900; white-space: nowrap; }
.airship-star-track { display: flex; justify-content: center; gap: 7px; min-height: clamp(32px, 5vh, 46px); }
.turbo-star { position: relative; display: grid; place-items: center; width: clamp(28px, 4.3vh, 43px); aspect-ratio: 1; border: 0; padding: 0; color: #b7d5df; background: transparent; filter: drop-shadow(0 3px 0 rgba(80,70,130,.12)); font-size: clamp(25px, 4vh, 41px); cursor: default; }
.turbo-star::before { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; }
.turbo-star.ready { color: var(--yellow); cursor: pointer; animation: starGlow .8s ease-in-out infinite alternate; }
.turbo-star.used { color: #dbe7eb; }
.turbo-star span { position: relative; z-index: 2; font-size: .42em; }
.sky-race { position: relative; min-height: 0; overflow: hidden; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2vw, 30px); border: 5px solid rgba(255,255,255,.82); border-radius: 30px; background: linear-gradient(180deg, rgba(92,191,238,.14), rgba(255,255,255,.2)); box-shadow: inset 0 -20px 0 rgba(255,255,255,.28); }
.finish-cloud { position: absolute; z-index: 5; left: 8%; right: 8%; top: 7%; height: 8px; border-radius: 5px; background: repeating-linear-gradient(90deg, white 0 15px, #ff668f 15px 30px); box-shadow: 0 3px 0 rgba(66,76,130,.12); }
.finish-cloud span { position: absolute; left: 50%; top: -11px; transform: translateX(-50%); padding: 4px 10px; border-radius: 999px; color: white; background: var(--pink); font-size: 9px; font-weight: 900; letter-spacing: .08em; }
.race-cloud { z-index: 0; width: 65px; height: 22px; opacity: .62; }
.rc-one { left: 5%; top: 35%; }
.rc-two { right: 8%; top: 52%; transform: scale(.72); }
.rc-three { left: 45%; top: 73%; transform: scale(.52); }
.air-lane { position: relative; min-width: 0; border-inline: 2px dashed rgba(255,255,255,.52); }
.air-lane:first-of-type { border-left: 0; }
.air-lane:last-of-type { border-right: 0; }
.airship-vehicle { position: absolute; z-index: 3; left: 50%; bottom: calc(7% + var(--progress)); width: clamp(72px, 10vw, 130px); transform: translateX(-50%); transition: bottom .42s cubic-bezier(.2,.85,.35,1.15); }
.ship-balloon { width: 100%; aspect-ratio: 1.85; border: 4px solid white; border-radius: 52% 48% 49% 51% / 56% 55% 45% 44%; background: linear-gradient(180deg, var(--ship) 0 42%, color-mix(in srgb, var(--ship) 72%, white) 42% 68%, var(--ship) 68%); box-shadow: inset -8px -6px 0 rgba(45,35,90,.08), 0 5px 8px rgba(60,60,110,.15); }
.star-balloon::after { content: "★"; display: grid; place-items: center; height: 100%; color: var(--yellow); font-size: clamp(19px, 3vw, 35px); }
.ship-gondola { position: relative; display: grid; place-items: center; width: 39%; height: clamp(22px, 4vh, 37px); margin: 5px auto 0; border-radius: 7px 7px 19px 19px; color: white; background: color-mix(in srgb, var(--ship) 77%, #2d2850); font-size: 9px; }
.ship-gondola::before, .ship-gondola::after { content: ""; position: absolute; bottom: 90%; width: 2px; height: 10px; background: #615675; }
.ship-gondola::before { left: 18%; transform: rotate(-16deg); }
.ship-gondola::after { right: 18%; transform: rotate(16deg); }
.air-player-label { position: absolute; z-index: 6; left: 50%; bottom: 3px; display: flex; align-items: center; gap: 6px; min-width: max-content; transform: translateX(-50%); padding: 4px 9px; border-radius: 999px; color: var(--ink); background: rgba(255,255,255,.9); box-shadow: 0 4px 0 rgba(68,55,130,.09); font-size: clamp(10px, 1.1vw, 14px); }
.your-air .air-player-label { color: white; background: var(--purple); }
.air-player-label span { font-weight: 900; }
.airship-game-screen.screen-shake .airship-problem-card { animation: screenShake .34s linear; }
.airship-vehicle.turbo { animation: turboBurst .55s ease-out; }

@keyframes heroFly { to { transform: translate(-50%, calc(-50% - 15px)) rotate(2deg); } }
@keyframes turboBurst { 0% { filter: drop-shadow(0 0 0 #ffd94d); } 50% { filter: drop-shadow(0 12px 14px #ffd94d); transform: translateX(-50%) scale(1.16); } }

.flight-status { justify-self: end; display: flex; align-items: center; gap: 9px; }
.flight-lives { min-width: 92px; padding: 9px 12px; border-radius: 16px; color: #ef4779; background: white; box-shadow: var(--soft-shadow); font-size: clamp(17px, 2vw, 25px); font-weight: 900; letter-spacing: 2px; white-space: nowrap; }
.flight-lives .lost { color: #d7d1df; }
.flight-distance { display: flex; align-items: baseline; justify-content: center; min-width: 82px; padding: 8px 11px; border-radius: 16px; color: white; background: var(--ink); box-shadow: var(--soft-shadow); }
.flight-distance b { font-size: clamp(19px, 2.5vw, 31px); line-height: 1; font-variant-numeric: tabular-nums; }
.flight-distance small { margin-left: 3px; opacity: .75; font-size: 10px; font-weight: 900; }
.answer-flight-layout { grid-template-columns: 1fr; padding-inline: max(12px, env(safe-area-inset-left), env(safe-area-inset-right)); }
.airship-playfield { grid-template-rows: 1fr auto; gap: 7px; }
.flight-answer-dock { justify-self: center; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: clamp(15px, 3vw, 42px); width: min(950px, 94%); min-height: clamp(78px, 15vh, 126px); padding: 8px clamp(15px, 2.5vw, 30px); border: 5px solid white; border-radius: 28px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.flight-answer-dock .airship-problem { font-size: clamp(27px, 5.7vh, 60px); }
.answer-bubbles { display: grid; grid-template-columns: repeat(4, minmax(55px, 1fr)); align-items: center; justify-items: center; gap: clamp(7px, 1.3vw, 16px); }
.answer-bubble { --bubble:#6c4cff; position: relative; display: grid; place-items: center; width: clamp(58px, 10vh, 94px); aspect-ratio: 1; border: 5px solid white; border-radius: 50%; color: white; background: radial-gradient(circle at 30% 25%, rgba(255,255,255,.55) 0 7%, transparent 8%), linear-gradient(145deg, color-mix(in srgb, var(--bubble) 72%, white), var(--bubble)); box-shadow: inset -8px -9px 0 rgba(47,30,110,.1), 0 7px 0 color-mix(in srgb, var(--bubble) 28%, transparent); font-size: clamp(21px, 4.4vh, 42px); font-weight: 900; cursor: pointer; transition: transform .13s, filter .13s; }
.answer-bubble:hover, .answer-bubble:focus-visible { transform: translateY(-4px) scale(1.04); outline: 3px solid color-mix(in srgb, var(--bubble) 35%, transparent); }
.answer-bubble:active { transform: translateY(3px); }
.answer-bubble.correct { --bubble:#25b88a; animation: bubbleCorrect .38s ease-out; }
.answer-bubble.wrong { --bubble:#e84f70; animation: bubbleWrong .32s linear; opacity: .55; }
.answer-bubble:disabled { cursor: default; }
.flight-world { position: relative; min-height: 0; overflow: hidden; border: 5px solid rgba(255,255,255,.86); border-radius: 30px; background: linear-gradient(180deg, #8ddcff 0%, #d8f6ff 64%, #fff0ba 64%); box-shadow: inset 0 -15px 0 rgba(255,255,255,.25), var(--shadow); }
.flight-world::before { content: ""; position: absolute; left: 0; bottom: 11%; width: 220%; height: 37%; opacity: .62; background: repeating-linear-gradient(115deg, transparent 0 7%, rgba(99,195,180,.42) 7.2% 13%, transparent 13.2% 19%); animation: sceneryScroll 8s linear infinite; }
.flight-world::after { content: ""; position: absolute; left: 0; bottom: 6%; width: 220%; height: 17%; background: radial-gradient(ellipse at 8% 100%, #56bd83 0 8%, transparent 8.5%), radial-gradient(ellipse at 23% 100%, #71cc91 0 11%, transparent 11.5%), radial-gradient(ellipse at 42% 100%, #4bb47a 0 9%, transparent 9.5%), radial-gradient(ellipse at 62% 100%, #70ca8f 0 12%, transparent 12.5%), radial-gradient(ellipse at 82% 100%, #4eb77a 0 10%, transparent 10.5%); background-size: 50% 100%; animation: sceneryScroll 4.5s linear infinite; }
.scroll-cloud { position: absolute; z-index: 1; width: 76px; height: 25px; border-radius: 999px; background: rgba(255,255,255,.83); box-shadow: -24px 8px 0 rgba(255,255,255,.83), 27px 6px 0 rgba(255,255,255,.83); animation: cloudScroll var(--cloud-speed, 11s) linear infinite; }
.cloud-a { --cloud-speed:12s; left: 105%; top: 16%; }
.cloud-b { --cloud-speed:16s; left: 135%; top: 36%; transform: scale(.72); animation-delay: -7s; }
.cloud-c { --cloud-speed:9s; left: 115%; top: 55%; transform: scale(.5); animation-delay: -3s; }
.flight-ship { position: absolute; z-index: 8; left: 20%; top: var(--ship-y); width: clamp(105px, 15vw, 190px); transform: translate(-50%, -50%) rotate(var(--ship-angle, 0deg)); transition: top .08s linear, filter .15s; filter: drop-shadow(0 8px 7px rgba(45,47,100,.2)); }
.flight-balloon { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 2.05; border: 5px solid white; border-radius: 52% 48% 48% 52% / 55% 55% 45% 45%; background: linear-gradient(180deg, #ff9c42 0 31%, #ffd45c 31% 62%, #f15a91 62%); box-shadow: inset -11px -8px 0 rgba(70,35,80,.08); }
.flight-balloon::before { content: ""; position: absolute; left: 17%; right: 17%; top: 0; bottom: 0; border: 4px solid rgba(255,255,255,.55); border-block: 0; border-radius: 50%; }
.flight-balloon span { position: relative; z-index: 2; color: white; font-size: clamp(22px, 3.5vw, 42px); }
.flight-gondola { position: relative; width: 35%; height: clamp(23px, 4.5vh, 40px); margin: 5px auto 0; border-radius: 7px 7px 22px 22px; background: var(--purple); box-shadow: inset 0 -6px 0 rgba(47,28,135,.2); }
.flight-gondola::before, .flight-gondola::after { content: ""; position: absolute; bottom: 90%; width: 2px; height: 13px; background: #625575; }
.flight-gondola::before { left: 18%; transform: rotate(-17deg); }
.flight-gondola::after { right: 18%; transform: rotate(17deg); }
.flight-flame { position: absolute; left: -8%; top: 43%; width: 20%; height: 14%; border-radius: 80% 12% 12% 80%; background: linear-gradient(90deg, #ff5d68, #ffd94d); animation: flamePulse .18s ease-in-out infinite alternate; }
.flight-ship.lifting { --ship-angle:-7deg; }
.flight-ship.falling { --ship-angle:5deg; }
.flight-ship.invulnerable { animation: shipBlink .18s linear infinite alternate; }
.flight-ship.crash { animation: shipCrash .45s ease-out; }
.obstacle-layer { position: absolute; z-index: 6; inset: 0; pointer-events: none; }
.flight-obstacle { position: absolute; bottom: 6%; left: var(--obstacle-x); width: var(--obstacle-width); height: var(--obstacle-height); min-width: 42px; border: 4px solid white; border-bottom: 0; border-radius: 22px 22px 4px 4px; background: repeating-linear-gradient(0deg, #a66cf0 0 18px, #f4c765 18px 36px, #f077a7 36px 54px); box-shadow: inset -9px 0 0 rgba(60,35,100,.08), 0 7px 0 rgba(58,50,110,.12); }
.flight-obstacle::before { content: ""; position: absolute; left: -5%; right: -5%; top: -10px; height: 20px; border-radius: 50% 50% 12px 12px; background: white; box-shadow: inset 0 -7px 0 #f7a2c3; }
.flight-obstacle.spikes { border-radius: 12px 12px 0 0; background: repeating-linear-gradient(135deg, #51c9af 0 18px, #35a88f 18px 36px); }
.flight-obstacle.spikes::before { top: -18px; height: 27px; clip-path: polygon(0 100%, 12% 0, 25% 100%, 38% 0, 51% 100%, 64% 0, 77% 100%, 90% 0, 100% 100%); background: #ffdc61; box-shadow: none; }
.flight-obstacle.hit { opacity: .35; filter: grayscale(.7); }
.flight-ground { position: absolute; z-index: 5; left: 0; right: 0; bottom: 0; height: 7%; background: repeating-linear-gradient(90deg, #4aab73 0 35px, #68c98d 35px 70px); box-shadow: inset 0 8px 0 rgba(255,255,255,.26); }
.flight-hint { position: absolute; z-index: 10; left: 50%; bottom: 8%; transform: translateX(-50%); padding: 5px 11px; border-radius: 999px; color: #655c78; background: rgba(255,255,255,.82); font-size: clamp(9px, .9vw, 12px); font-weight: 900; white-space: nowrap; animation: hintFade 5s both; }
.flight-world.life-lost { animation: dangerFlash .35s linear; }

@keyframes sceneryScroll { to { transform: translateX(-50%); } }
@keyframes cloudScroll { from { translate: 0 0; } to { translate: -155vw 0; } }
@keyframes flamePulse { to { transform: scaleX(1.35); filter: brightness(1.25); } }
@keyframes shipBlink { to { opacity: .35; } }
@keyframes shipCrash { 50% { transform: translate(-50%, -50%) rotate(18deg) scale(.88); filter: drop-shadow(0 0 18px #ff456f); } }
@keyframes dangerFlash { 50% { box-shadow: inset 0 0 0 14px rgba(255,50,90,.45), var(--shadow); } }
@keyframes hintFade { 0%,70% { opacity: 1; } 100% { opacity: 0; } }
@keyframes bubbleCorrect { 50% { transform: scale(1.2); filter: drop-shadow(0 0 13px #56e6b8); } }
@keyframes bubbleWrong { 25% { transform: translateX(-7px); } 50% { transform: translateX(7px); } 75% { transform: translateX(-4px); } }

.mint-text { color: #168c71; }
.scales-start-screen { position: relative; align-items: center; justify-content: center; gap: clamp(30px, 6vw, 100px); padding: clamp(20px, 3vw, 48px); overflow-y: auto; background: linear-gradient(160deg, #e0fbf4, #fff5dc 62%, #ffe5ef); }
.scales-hero { position: relative; width: min(40vw, 560px); height: min(70vh, 520px); }
.hero-scale { position: absolute; left: 50%; top: 50%; width: min(35vw, 450px); height: 72%; transform: translate(-50%, -43%); }
.hero-scale-beam { position: absolute; z-index: 3; left: 4%; right: 4%; top: 22%; height: 17px; border-radius: 12px; background: var(--purple); box-shadow: 0 7px 0 rgba(63,43,145,.14); transform: rotate(-3deg); }
.hero-scale-beam::after { content: ""; position: absolute; left: 50%; top: -15px; width: 34px; aspect-ratio: 1; border: 8px solid var(--orange); border-radius: 50%; transform: translateX(-50%); background: white; }
.hero-pan { position: absolute; top: 33px; display: grid; place-items: center; width: 38%; height: 90px; border-radius: 10px 10px 65px 65px; color: white; background: var(--mint); box-shadow: inset 0 -11px 0 rgba(38,80,100,.11), var(--shadow); font-size: clamp(17px, 2.5vw, 30px); font-weight: 900; }
.hero-pan::before, .hero-pan::after { content: ""; position: absolute; bottom: 90%; width: 3px; height: 55px; background: #6b607e; transform-origin: bottom; }
.hero-pan::before { left: 17%; transform: rotate(18deg); }
.hero-pan::after { right: 17%; transform: rotate(-18deg); }
.hero-pan.left { left: 0; background: var(--orange); }
.hero-pan.right { right: 0; background: var(--mint); }
.hero-scale-post { position: absolute; left: 50%; top: 24%; width: 20%; height: 54%; transform: translateX(-50%); display: grid; place-items: end center; padding-bottom: 12px; clip-path: polygon(44% 0, 56% 0, 72% 88%, 100% 100%, 0 100%, 28% 88%); color: var(--yellow); background: var(--purple); font-size: 32px; }
.hero-scale-base { position: absolute; left: 24%; right: 24%; bottom: 6%; height: 12%; border-radius: 50% 50% 18px 18px; background: var(--purple-dark); box-shadow: var(--soft-shadow); }
.place-block { position: absolute; z-index: 4; display: grid; place-items: center; min-width: 80px; height: 58px; padding: 0 13px; border: 5px solid white; border-radius: 18px; color: white; background: var(--block, var(--blue)); box-shadow: var(--soft-shadow); font-size: clamp(14px, 1.8vw, 21px); font-weight: 900; }
.pb-one { --block:var(--blue); left: 1%; top: 6%; transform: rotate(-8deg); }
.pb-two { --block:var(--pink); right: 0; top: 15%; transform: rotate(7deg); }
.pb-three { --block:var(--orange); right: 9%; bottom: 3%; transform: rotate(-4deg); }
.scales-mode-panel { width: min(680px, 52vw); padding: clamp(20px, 2.7vw, 36px); border: 5px solid white; border-radius: 34px; background: rgba(255,255,255,.83); box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.scales-mode-panel h2 { margin: 0; font-size: clamp(27px, 3.4vw, 49px); line-height: 1.05; }
.scales-intro { margin: -5px 0 16px; color: #716985; font-size: clamp(12px, 1.25vw, 17px); line-height: 1.35; font-weight: 800; }
.scales-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.scales-mode-grid button { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 9px; min-width: 0; min-height: 83px; border: 3px solid transparent; border-radius: 20px; padding: 10px; color: var(--ink); background: white; box-shadow: 0 5px 0 color-mix(in srgb, var(--level) 18%, transparent); text-align: left; cursor: pointer; transition: transform .16s, border-color .16s; }
.scales-mode-grid button:hover, .scales-mode-grid button:focus-visible { transform: translateY(-3px); border-color: var(--level); outline: none; }
.scales-mode-grid button > span { grid-row: 1 / 3; display: grid; place-items: center; width: 43px; aspect-ratio: 1; border-radius: 14px; color: white; background: var(--level); font-size: 15px; font-weight: 900; }
.scales-mode-grid b, .scales-mode-grid small { min-width: 0; }
.scales-mode-grid b { align-self: end; font-size: clamp(12px, 1.2vw, 17px); }
.scales-mode-grid small { align-self: start; color: #7c748e; font-size: 10px; font-weight: 700; }

.scales-game-screen { position: relative; flex-direction: column; background: linear-gradient(180deg, #fff1d2 0 66%, #e1faf4 66%); }
.scales-game-screen::before { content: ""; position: absolute; inset: 0; opacity: .35; background-image: radial-gradient(circle, white 0 5px, transparent 6px); background-size: 70px 70px; }
.scales-header { position: relative; z-index: 10; flex: 0 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); }
.scales-header .catalog-back-button { justify-self: start; }
.scales-mode-chip { justify-self: center; background: white; }
.scales-timer { justify-self: end; }
.scales-layout { position: relative; z-index: 2; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: clamp(70px, 9vw, 126px) 1fr clamp(70px, 9vw, 126px); gap: clamp(7px, 1.4vw, 20px); padding: 0 max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.scales-playfield { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto 1fr; gap: 3px; }
.scales-problem-card { justify-self: center; display: flex; align-items: center; justify-content: center; gap: clamp(10px, 1.5vw, 22px); min-width: min(760px, 88%); min-height: clamp(62px, 12vh, 105px); padding: 7px 24px; border: 5px solid white; border-radius: 25px; background: rgba(255,255,255,.94); box-shadow: var(--shadow); }
.scales-problem { font-size: clamp(24px, 5vh, 52px); line-height: 1; font-weight: 900; white-space: nowrap; }
.scales-star-track { display: flex; justify-content: center; gap: 7px; min-height: clamp(32px, 5vh, 46px); }
.weight-star { position: relative; display: grid; place-items: center; width: clamp(28px, 4.3vh, 43px); aspect-ratio: 1; border: 0; padding: 0; color: #d7cbb3; background: transparent; filter: drop-shadow(0 3px 0 rgba(80,70,130,.12)); font-size: clamp(25px, 4vh, 41px); cursor: default; }
.weight-star::before { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; }
.weight-star.ready { color: var(--yellow); cursor: pointer; animation: starGlow .8s ease-in-out infinite alternate; }
.weight-star.used { color: #e7ddca; }
.weight-star span { position: relative; z-index: 2; font-size: .42em; }
.scales-arena { min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(7px, 1.6vw, 24px); align-items: stretch; padding-top: 2px; }
.scale-player { min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; border: 4px solid rgba(255,255,255,.75); border-radius: 26px; padding: 6px; background: rgba(255,255,255,.3); }
.your-scale { background: rgba(255,255,255,.64); }
.scale-player-label { z-index: 5; display: flex; align-items: center; gap: 7px; min-width: 82px; padding: 4px 10px; border-radius: 999px; background: white; box-shadow: 0 4px 0 rgba(70,50,130,.09); font-size: clamp(10px, 1.1vw, 15px); }
.your-scale .scale-player-label { color: white; background: var(--purple); }
.scale-player-label span { margin-left: auto; font-weight: 900; }
.scale-machine { position: relative; width: min(100%, 310px); flex: 1 1 auto; min-height: 120px; }
.scale-beam { position: absolute; z-index: 4; left: 7%; right: 7%; top: 30%; height: clamp(8px, 1.5vh, 14px); border-radius: 10px; background: var(--orange); box-shadow: 0 5px 0 rgba(110,60,80,.11); transform: rotate(var(--tilt)); transition: transform .42s cubic-bezier(.2,.85,.35,1.15); }
.scale-beam::after { content: ""; position: absolute; left: 50%; top: 50%; width: clamp(18px, 3vw, 31px); aspect-ratio: 1; border: 6px solid var(--purple); border-radius: 50%; transform: translate(-50%, -50%); background: white; }
.scale-pan { position: absolute; top: clamp(23px, 5vh, 44px); display: flex; align-items: flex-end; justify-content: center; width: 39%; height: clamp(45px, 9vh, 78px); border-radius: 8px 8px 55px 55px; box-shadow: inset 0 -8px 0 rgba(40,55,90,.1), 0 5px 8px rgba(70,60,110,.12); transform: rotate(var(--counter-tilt)); transition: transform .42s; }
.scale-pan::before, .scale-pan::after { content: ""; position: absolute; bottom: 92%; width: 2px; height: clamp(27px, 6vh, 50px); background: #71677d; transform-origin: bottom; }
.scale-pan::before { left: 17%; transform: rotate(18deg); }
.scale-pan::after { right: 17%; transform: rotate(-18deg); }
.target-pan { left: 0; background: #ffbb66; }
.load-pan { right: 0; background: var(--mint); }
.target-pan span { align-self: center; font-size: clamp(20px, 4vw, 42px); }
.scale-ingredients { display: flex; flex-wrap: wrap-reverse; align-content: flex-start; justify-content: center; gap: 1px; width: 85%; max-height: 90%; padding-bottom: 7px; overflow: hidden; }
.ingredient { width: clamp(10px, 1.5vw, 18px); aspect-ratio: 1; border: 2px solid rgba(255,255,255,.6); border-radius: 50%; background: var(--ingredient); box-shadow: inset -3px -3px 0 rgba(60,40,90,.08); animation: scoopDrop .3s ease-out both; }
.scale-post { position: absolute; z-index: 2; left: 50%; top: 31%; width: 19%; height: 51%; transform: translateX(-50%); display: grid; place-items: end center; padding-bottom: 8px; clip-path: polygon(43% 0, 57% 0, 72% 88%, 100% 100%, 0 100%, 28% 88%); color: var(--yellow); background: #31a790; font-size: clamp(15px, 2.5vw, 28px); }
.player-post { background: var(--purple); }
.scale-base { position: absolute; z-index: 3; left: 24%; right: 24%; bottom: 8%; height: 10%; border-radius: 50% 50% 12px 12px; background: #257f70; box-shadow: var(--soft-shadow); }
.your-scale .scale-base { background: var(--purple-dark); }
.scale-machine.precision { animation: precisionPulse .6s ease-out; }

@keyframes precisionPulse { 50% { filter: drop-shadow(0 0 16px #ffd94d); transform: scale(1.06); } }

.arcade-start-screen { align-items: center; justify-content: center; gap: clamp(30px, 6vw, 100px); padding: clamp(20px, 3vw, 48px); overflow-y: auto; background: linear-gradient(145deg, var(--arcade-soft, #e2f5ff), white 55%, #fff2d7); }
.arcade-hero { position: relative; display: grid; place-items: center; width: min(39vw, 500px); height: min(68vh, 500px); }
.arcade-hero::before { content: ""; width: min(30vw, 390px); aspect-ratio: 1; border: 9px solid white; border-radius: 38%; background: var(--arcade, var(--blue)); box-shadow: var(--shadow); transform: rotate(-5deg); }
.arcade-hero-icon { position: absolute; z-index: 3; display: grid; place-items: center; width: 62%; aspect-ratio: 1; font-size: clamp(75px, 13vw, 170px); filter: drop-shadow(0 12px 0 rgba(45,32,100,.12)); animation: float 2.4s ease-in-out infinite; }
.arcade-hero i { position: absolute; z-index: 4; display: block; width: 15%; aspect-ratio: 1; border: 5px solid white; border-radius: 28%; background: var(--dot, var(--pink)); box-shadow: var(--soft-shadow); }
.arcade-hero i:nth-of-type(1) { --dot:var(--pink); left: 4%; top: 9%; transform: rotate(-12deg); }
.arcade-hero i:nth-of-type(2) { --dot:var(--yellow); right: 2%; top: 16%; transform: rotate(11deg); }
.arcade-hero i:nth-of-type(3) { --dot:var(--mint); left: 8%; bottom: 5%; transform: rotate(8deg); }
.arcade-hero i:nth-of-type(4) { --dot:var(--orange); right: 7%; bottom: 2%; transform: rotate(-7deg); }
.arcade-mode-panel { width: min(680px, 54vw); padding: clamp(20px, 2.7vw, 36px); border: 5px solid white; border-radius: 34px; background: rgba(255,255,255,.84); box-shadow: var(--shadow); backdrop-filter: blur(15px); }
.arcade-mode-panel h2 { margin: 0; font-size: clamp(27px, 3.4vw, 49px); line-height: 1.05; }
.arcade-intro { margin: -4px 0 16px; color: #706985; font-size: clamp(12px, 1.25vw, 17px); line-height: 1.35; font-weight: 800; }
.arcade-mode-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.arcade-mode-button { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; min-width: 0; min-height: 92px; border: 3px solid transparent; border-radius: 20px; padding: 12px; color: var(--ink); background: white; box-shadow: 0 5px 0 color-mix(in srgb, var(--arcade) 17%, transparent); text-align: left; cursor: pointer; transition: transform .16s, border-color .16s; }
.arcade-mode-button:hover, .arcade-mode-button:focus-visible { transform: translateY(-3px); border-color: var(--arcade); outline: none; }
.arcade-mode-button span { display: grid; place-items: center; width: 34px; aspect-ratio: 1; margin-bottom: 6px; border-radius: 11px; color: white; background: var(--arcade); font-weight: 900; }
.arcade-mode-button b { font-size: clamp(12px, 1.25vw, 17px); }
.arcade-mode-button small { margin-top: 3px; color: #7c748e; font-size: 10px; font-weight: 700; }
.reference-note { display: flex; align-items: center; gap: 9px; margin-top: 14px; padding: 9px 12px; border-radius: 16px; color: #625b78; background: var(--arcade-soft); }
.reference-note > span { color: var(--arcade); font-size: 23px; }
.reference-note p, .reference-note b, .reference-note small { display: block; margin: 0; }
.reference-note b { font-size: 11px; }
.reference-note small { margin-top: 2px; font-size: 9px; line-height: 1.3; }

.arcade-game-screen { position: relative; flex-direction: column; background: linear-gradient(150deg, var(--arcade-soft, #edf5ff), white 55%, #fff1d6); }
.arcade-header { position: relative; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 7px max(12px, env(safe-area-inset-left)); }
.arcade-header .catalog-back-button { justify-self: start; }
.arcade-header .mode-chip { justify-self: center; background: white; }
.arcade-status { justify-self: end; display: flex; align-items: center; gap: 7px; }
.arcade-lives { min-width: 82px; padding: 9px 10px; border-radius: 16px; color: #e84970; background: white; box-shadow: var(--soft-shadow); font-weight: 900; letter-spacing: 2px; white-space: nowrap; }
.arcade-lives .lost { color: #d9d4df; }
.arcade-score { display: flex; align-items: baseline; min-width: 72px; padding: 8px 10px; border-radius: 16px; color: white; background: var(--arcade); box-shadow: var(--soft-shadow); }
.arcade-score b { font-size: 24px; line-height: 1; }
.arcade-score small { margin-left: 3px; font-size: 8px; font-weight: 900; }
.arcade-layout { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(330px, .85fr); gap: clamp(10px, 2vw, 26px); padding: 0 max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
.arcade-scene { --progress:0%; position: relative; min-width: 0; min-height: 0; overflow: hidden; border: 6px solid white; border-radius: 34px; background: var(--arcade-soft); box-shadow: var(--shadow); }
.scene-label { position: absolute; z-index: 4; left: 18px; top: 15px; padding: 7px 12px; border-radius: 999px; color: white; background: var(--arcade); font-size: 12px; font-weight: 900; }
.scene-track { position: absolute; z-index: 3; left: 8%; right: 8%; bottom: 16%; display: grid; grid-template-columns: repeat(10, 1fr); align-items: center; gap: 5px; }
.scene-token { aspect-ratio: 1; border: 3px solid white; background: rgba(255,255,255,.64); box-shadow: 0 4px 0 rgba(50,40,100,.1); transition: transform .22s, background .22s, opacity .22s; }
.scene-token.done { background: var(--arcade); transform: translateY(-7px) scale(1.08); }
.scene-avatar { position: absolute; z-index: 6; left: var(--avatar-left, 7%); bottom: 27%; transform: translateX(-50%); font-size: clamp(54px, 9vw, 115px); filter: drop-shadow(0 9px 0 rgba(50,38,100,.12)); transition: left .38s cubic-bezier(.2,.85,.35,1.15), transform .25s; }
.scene-avatar.celebrate { transform: translateX(-50%) translateY(-16px) rotate(-7deg) scale(1.1); }
.scene-decor { position: absolute; inset: 0; pointer-events: none; }
.game-ice { background: linear-gradient(#bcecff, #effcff 66%, #83cde9 66%); }
.game-ice .scene-token { border-radius: 50% 44% 48% 40%; background: #dff9ff; }
.game-ice .scene-token.done { background: #76ccec; }
.game-bubbles { background: linear-gradient(145deg, #ffe4f1, #ebedff); }
.game-bubbles .scene-track { inset: 16% 10% 13%; grid-template-columns: repeat(5, 1fr); }
.game-bubbles .scene-token { border-radius: 50%; background: radial-gradient(circle at 30% 25%, white 0 10%, transparent 11%), color-mix(in srgb, var(--arcade) 30%, white); }
.game-bubbles .scene-token.done { opacity: .15; transform: scale(.2); }
.game-bubbles .scene-avatar { left: 50%; bottom: 38%; }
.game-line { background: linear-gradient(#fff3df 0 70%, #ffe2ea 70%); }
.game-line .scene-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 6px; border-radius: 5px; background: var(--ink); }
.game-line .scene-token { position: relative; border-radius: 50%; background: white; }
.game-line .scene-token::after { content: attr(data-value); position: absolute; left: 50%; top: 110%; transform: translateX(-50%); font-size: 9px; font-weight: 900; }
.game-fractions { background: linear-gradient(145deg, #fff0d0, #ffe4c5); }
.game-fractions .scene-track { left: 17%; right: 17%; bottom: 18%; grid-template-columns: repeat(8, 1fr); gap: 2px; padding: 13px; border: 6px solid #b87935; border-radius: 24px; background: #e2a65d; }
.game-fractions .scene-token { border-radius: 8px; background: #f5c77e; }
.game-fractions .scene-token.done { background: #ff6fa8; }
.game-fractions .scene-avatar { bottom: 43%; }
.game-robots { background: linear-gradient(#e7edff, #cbd6ff); }
.game-robots .scene-track { left: 22%; right: 22%; bottom: 14%; grid-template-columns: repeat(5, 1fr); }
.game-robots .scene-token { border-radius: 11px; background: #9aa9e8; }
.game-robots .scene-token.done { background: #4dd0b1; box-shadow: 0 0 16px #4dd0b1; }
.game-robots .scene-avatar { left: 50%; bottom: 34%; font-size: clamp(78px, 14vw, 180px); }
.game-geometry { background: linear-gradient(145deg, #f8eadc, #ffe8c7); }
.game-geometry .scene-track { left: 20%; right: 20%; bottom: 13%; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 13px; border-radius: 18px; background: #7b432c; }
.game-geometry .scene-token { border-radius: 5px; background: #b86a42; }
.game-geometry .scene-token.done { background: #f2b353; }
.game-geometry .scene-avatar { bottom: 45%; }
.game-space { background: radial-gradient(circle at 20% 20%, #5d4ea0 0 2px, transparent 3px), radial-gradient(circle at 75% 35%, white 0 2px, transparent 3px), linear-gradient(145deg, #1f1949, #52409a); background-size: 65px 65px, 85px 85px, auto; }
.game-space .scene-token { border-radius: 50%; background: var(--planet, #ff9b49); }
.game-space .scene-token:nth-child(3n) { --planet:#50d7b8; }
.game-space .scene-token:nth-child(3n+1) { --planet:#ff6fa8; }
.game-space .scene-avatar { bottom: 35%; }
.arcade-challenge { align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: clamp(18px, 3vw, 38px); border: 6px solid white; border-radius: 34px; background: rgba(255,255,255,.9); box-shadow: var(--shadow); }
.arcade-prompt { margin: 0 0 clamp(16px, 3vh, 30px); color: var(--ink); font-size: clamp(24px, 3.4vw, 48px); line-height: 1.13; text-align: center; font-weight: 900; }
.arcade-choices { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(10px, 1.5vw, 17px); width: min(500px, 100%); }
.arcade-choice { min-height: clamp(62px, 11vh, 105px); border: 4px solid white; border-radius: 24px; color: white; background: var(--choice, var(--arcade)); box-shadow: inset -8px -9px 0 rgba(45,30,90,.1), 0 6px 0 color-mix(in srgb, var(--choice) 28%, transparent); font-size: clamp(19px, 3vw, 38px); font-weight: 900; cursor: pointer; transition: transform .13s; }
.arcade-choice:hover, .arcade-choice:focus-visible { transform: translateY(-4px); outline: 3px solid color-mix(in srgb, var(--choice) 35%, transparent); }
.arcade-choice.correct { --choice:#25b88a; animation: bubbleCorrect .38s ease-out; }
.arcade-choice.wrong { --choice:#e84f70; animation: bubbleWrong .32s linear; opacity: .55; }
.arcade-choice:disabled { cursor: default; }
.arcade-scene.life-lost { animation: dangerFlash .35s linear; }

.start-screen {
  padding: clamp(18px, 3vw, 48px);
  gap: clamp(20px, 4vw, 64px);
  align-items: center;
  justify-content: center;
}

.brand-panel, .mode-panel { position: relative; z-index: 1; }
.brand-panel { display: flex; align-items: center; gap: clamp(16px, 3vw, 42px); max-width: 700px; }
.brand-panel h1 { margin: 0; font-size: clamp(46px, 7vw, 100px); line-height: .9; letter-spacing: -5px; }
.brand-panel h1 span { color: var(--purple); }
.eyebrow { margin: 0 0 8px; color: var(--pink); font-weight: 900; text-transform: uppercase; letter-spacing: .12em; font-size: clamp(11px, 1vw, 15px); }
.tagline { max-width: 470px; margin: 18px 0 0; font-size: clamp(15px, 1.6vw, 22px); line-height: 1.35; font-weight: 700; }

.brand-art { position: relative; flex: 0 0 clamp(130px, 18vw, 245px); height: clamp(180px, 34vh, 320px); }
.logo-bowl { position: absolute; left: 12%; right: 12%; bottom: 4%; height: 35%; border-radius: 15px 15px 90px 90px; background: var(--purple); box-shadow: inset 0 -12px 0 rgba(52,31,173,.25), var(--shadow); }
.logo-bowl::before { content: ""; position: absolute; left: -6%; right: -6%; top: -12px; height: 22px; border-radius: 20px; background: var(--purple-dark); }
.logo-bowl::after { content: "★"; color: var(--yellow); position: absolute; inset: 22% 0 auto; text-align: center; font-size: clamp(36px, 5vw, 68px); }
.logo-scoops i { position: absolute; width: 48%; aspect-ratio: 1; border-radius: 50%; box-shadow: inset -9px -8px 0 rgba(0,0,0,.07); }
.logo-scoops i:nth-child(1) { background: var(--pink); left: 5%; bottom: 34%; }
.logo-scoops i:nth-child(2) { background: var(--mint); right: 5%; bottom: 34%; }
.logo-scoops i:nth-child(3) { background: var(--orange); left: 26%; bottom: 53%; }
.floating-number { position: absolute; z-index: 3; display: grid; place-items: center; width: 48px; aspect-ratio: 1; border-radius: 16px; color: white; font-size: 26px; font-weight: 900; box-shadow: var(--soft-shadow); animation: float 3s ease-in-out infinite; }
.floating-number.n1 { background: var(--blue); left: -2%; top: 8%; transform: rotate(-12deg); }
.floating-number.n2 { background: var(--pink); right: -4%; top: 6%; animation-delay: -.9s; }
.floating-number.n3 { background: var(--yellow); color: var(--ink); right: -2%; top: 40%; transform: rotate(9deg); animation-delay: -1.8s; }

.mode-panel { width: min(720px, 52vw); max-height: calc(100dvh - 24px); overflow-y: auto; scrollbar-width: thin; padding: clamp(18px, 2.2vw, 32px); border: 4px solid white; border-radius: 34px; background: rgba(255,255,255,.72); backdrop-filter: blur(16px); box-shadow: var(--shadow); }
.mode-heading { display: flex; justify-content: flex-start; align-items: center; gap: 16px; margin-bottom: 20px; }
.mode-heading h2 { margin: 0; font-size: clamp(25px, 3vw, 42px); }
.back-button { flex: 0 0 auto; display: grid; place-items: center; width: 45px; aspect-ratio: 1; border: 0; border-radius: 15px; color: var(--purple); background: #ede8ff; font-size: 25px; font-weight: 900; cursor: pointer; }
.install-button { display: flex; align-items: center; gap: 8px; border: 0; padding: 11px 16px; border-radius: 16px; background: #ede8ff; color: var(--purple-dark); font-weight: 900; cursor: pointer; }
.install-button span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 8px; color: white; background: var(--purple); }
.mode-groups { display: grid; gap: 14px; }
.mode-group-title { margin: 0 0 8px 3px; color: #665f82; font-size: clamp(13px, 1.25vw, 17px); text-transform: uppercase; letter-spacing: .07em; }
.addition-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mode-card { --card: var(--purple); display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 70px; border: 3px solid transparent; border-radius: 20px; padding: 9px; color: var(--ink); background: white; box-shadow: 0 5px 0 rgba(54,38,128,.08); text-align: left; cursor: pointer; transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.mode-card:hover, .mode-card:focus-visible { transform: translateY(-3px); border-color: var(--card); box-shadow: 0 9px 0 color-mix(in srgb, var(--card) 18%, transparent); outline: none; }
.mode-card.purple { --card: var(--purple); } .mode-card.blue { --card: var(--blue); } .mode-card.mint { --card: var(--mint); } .mode-card.orange { --card: var(--orange); } .mode-card.pink { --card: var(--pink); }
.mode-icon { flex: 0 0 48px; display: grid; place-items: center; aspect-ratio: 1; border-radius: 15px; color: white; background: var(--card); font-size: 17px; font-weight: 900; }
.mode-card b, .mode-card small { display: block; }
.mode-card b { font-size: clamp(13px, 1.25vw, 18px); white-space: nowrap; }
.mode-card small { margin-top: 2px; overflow: hidden; color: #77718f; font-size: clamp(9px, .9vw, 12px); font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.multiply-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.multiply-button { --card: var(--purple); display: grid; place-items: center; min-width: 0; min-height: 50px; border: 3px solid transparent; border-radius: 16px; background: color-mix(in srgb, var(--card) 13%, white); color: var(--card); box-shadow: 0 4px 0 color-mix(in srgb, var(--card) 18%, transparent); font-size: clamp(15px, 1.7vw, 23px); font-weight: 900; cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.multiply-button:hover, .multiply-button:focus-visible { transform: translateY(-3px); border-color: var(--card); background: white; outline: none; }
.multiply-button:active { transform: translateY(2px); box-shadow: 0 1px 0 color-mix(in srgb, var(--card) 18%, transparent); }
.round-note { margin: 14px 0 0; text-align: center; color: #716a8f; font-size: 14px; font-weight: 800; }
.round-note span { margin-right: 5px; }

.game-screen { position: relative; flex-direction: column; background: linear-gradient(180deg, #dff7ff 0 56%, #fff3d7 56%); }
.game-screen::before { content: ""; position: absolute; left: 0; right: 0; top: 54%; height: 4%; background: rgba(255,255,255,.7); transform: skewY(-1deg); }
.game-header { position: relative; z-index: 10; flex: 0 0 auto; display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: 10px; padding: max(8px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left)); }
.round-icon-button { width: clamp(38px, 5vh, 54px); aspect-ratio: 1; border: 0; border-radius: 16px; background: white; color: var(--purple); box-shadow: var(--soft-shadow); font-size: 25px; font-weight: 900; cursor: pointer; }
.mode-chip { padding: 10px 16px; border-radius: 16px; background: rgba(255,255,255,.78); color: var(--ink); font-weight: 900; font-size: clamp(12px, 1.25vw, 17px); }
.status-effects { display: flex; justify-content: center; gap: 8px; min-width: 0; }
.effect-chip { display: flex; align-items: center; gap: 4px; padding: 6px 10px; border-radius: 999px; background: white; font-size: 12px; font-weight: 900; box-shadow: 0 4px 10px rgba(80,50,150,.12); }
.timer { display: flex; align-items: baseline; justify-content: center; min-width: 84px; padding: 7px 14px; border-radius: 18px; background: var(--ink); color: white; box-shadow: var(--soft-shadow); }
.timer span { font-size: clamp(23px, 3vw, 38px); line-height: 1; font-weight: 900; font-variant-numeric: tabular-nums; }
.timer small { margin-left: 4px; opacity: .75; font-size: 11px; font-weight: 900; }
.timer.urgent { background: #ed3f69; animation: pulse .6s ease-in-out infinite alternate; }

.game-layout { position: relative; z-index: 2; flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: clamp(70px, 9vw, 126px) 1fr clamp(70px, 9vw, 126px); gap: clamp(7px, 1.4vw, 20px); padding: 0 max(10px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)); }
.keypad { display: grid; grid-template-rows: repeat(5, minmax(0, 1fr)); gap: clamp(5px, 1vh, 10px); min-height: 0; }
.keypad button { border: 0; border-radius: clamp(13px, 1.5vw, 22px); color: white; font-size: clamp(27px, 5.4vh, 54px); line-height: 1; font-weight: 900; cursor: pointer; box-shadow: 0 clamp(4px, .8vh, 8px) 0 rgba(53,35,133,.17); transition: transform .08s ease, box-shadow .08s ease, filter .08s ease; }
.left-keypad button { background: linear-gradient(145deg, #7d60ff, #6142e7); }
.right-keypad button { background: linear-gradient(145deg, #ff72aa, #ee4d8c); }
.keypad button:active, .keypad button.pressed { transform: translateY(5px); box-shadow: 0 1px 0 rgba(53,35,133,.17); filter: brightness(1.08); }
.keypad button:disabled { filter: grayscale(.5); opacity: .65; cursor: default; }

.playfield { min-width: 0; min-height: 0; display: grid; grid-template-rows: auto auto 1fr; align-items: start; }
.star-track { display: flex; justify-content: center; align-items: center; gap: clamp(3px, .7vw, 10px); min-height: clamp(31px, 5.2vh, 52px); padding: 1px 0 4px; }
.star-bonus { position: relative; display: grid; place-items: center; width: clamp(29px, 4.3vh, 45px); aspect-ratio: 1; border: 0; padding: 0; background: transparent; color: #c7bfdb; cursor: default; font-size: clamp(25px, 4.2vh, 43px); line-height: 1; filter: drop-shadow(0 3px 0 rgba(72,50,130,.12)); }
.star-bonus::before { content: "★"; position: absolute; inset: 0; display: grid; place-items: center; }
.star-bonus .bonus-picture { position: relative; z-index: 2; font-size: .45em; filter: none; }
.star-bonus.locked .bonus-picture { display: none; }
.star-bonus.ready { color: var(--yellow); cursor: pointer; animation: starGlow .8s ease-in-out infinite alternate; }
.star-bonus.used { color: #e4dff0; }
.star-bonus.used .bonus-picture { opacity: .5; }
.star-bonus .threshold { position: absolute; right: -2px; bottom: -1px; z-index: 3; display: grid; place-items: center; min-width: 15px; height: 15px; padding: 0 3px; border-radius: 8px; background: var(--ink); color: white; font-size: 8px; font-weight: 900; }

.problem-card { position: relative; justify-self: center; display: flex; align-items: center; justify-content: center; gap: clamp(12px, 2vw, 28px); width: min(680px, 82%); min-height: clamp(70px, 14vh, 132px); padding: 10px 30px; border: 5px solid white; border-radius: 28px; background: rgba(255,255,255,.88); box-shadow: var(--shadow); overflow: hidden; }
.problem { font-size: clamp(32px, 7vh, 76px); line-height: 1; font-weight: 900; letter-spacing: .01em; white-space: nowrap; }
.answer { min-width: 1.45em; padding: .12em .22em; border-radius: .35em; background: #ede8ff; color: var(--purple); font-size: clamp(32px, 7vh, 76px); line-height: 1; text-align: center; font-weight: 900; font-variant-numeric: tabular-nums; }
.answer.empty { color: #aaa3c2; }
.answer.correct { color: #168c71; background: #c9f8e9; }
.cream-cover { position: absolute; inset: -10%; z-index: 6; display: none; align-items: center; justify-content: center; background: rgba(255,255,255,.95); color: #d679ac; font-size: clamp(18px, 3vw, 38px); font-weight: 900; }
.cream-cover.active { display: flex; animation: creamIn .35s ease-out; }
.cream-cover i { position: absolute; width: 30%; aspect-ratio: 1.8; border-radius: 50%; background: white; box-shadow: 0 5px 18px rgba(80,50,120,.15); }
.cream-cover i:nth-child(1) { left: 5%; top: 5%; transform: rotate(15deg); }
.cream-cover i:nth-child(2) { right: 1%; top: 25%; transform: rotate(-10deg); }
.cream-cover i:nth-child(3) { left: 32%; bottom: -10%; width: 42%; }
.cream-cover b { position: relative; z-index: 2; }

.arena { align-self: stretch; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2vw, 30px); align-items: end; padding: 3px clamp(3px, 2vw, 24px) 0; }
.player { min-width: 0; display: flex; flex-direction: column; align-items: center; }
.player-name { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; padding: 4px 10px; border-radius: 999px; background: rgba(255,255,255,.72); font-size: clamp(11px, 1.25vw, 17px); }
.player.you .player-name { background: #6c4cff; color: white; transform: scale(1.08); }
.mini-avatar { display: grid; place-items: center; width: 22px; aspect-ratio: 1; border-radius: 50%; font-size: 10px; }
.mini-avatar.fox { color: #7b3514; background: var(--orange); }
.mini-avatar.panda { color: var(--ink); background: white; border: 4px solid var(--ink); }
.mini-avatar.player-avatar { color: var(--yellow); background: rgba(255,255,255,.16); }
.icecream-stage { position: relative; width: min(100%, 210px); height: clamp(125px, 30vh, 285px); }
.effect-anchor { position: absolute; left: 50%; top: 45%; width: 1px; height: 1px; }
.scoops { position: absolute; z-index: 2; left: 50%; bottom: clamp(32px, 6vh, 56px); width: clamp(78px, 10vw, 126px); height: calc(100% - 36px); transform: translateX(-50%); }
.scoop { --scoop-color: var(--pink); position: absolute; left: 50%; bottom: var(--y, calc(var(--i) * clamp(7px, 1.25vh, 13px))); width: clamp(42px, 6.2vw, 76px); aspect-ratio: 1.15; border: 3px solid rgba(255,255,255,.55); border-radius: 52% 48% 45% 55% / 60% 55% 45% 40%; background: var(--scoop-color); box-shadow: inset -7px -8px 0 rgba(45,25,90,.09), 0 4px 7px rgba(55,35,110,.13); transform: translateX(calc(-50% + var(--x))) rotate(var(--r)); animation: scoopDrop .35s cubic-bezier(.2,.9,.3,1.3) both; }
.scoop::after { content: ""; position: absolute; width: 18%; aspect-ratio: 1; left: 22%; top: 18%; border-radius: 50%; background: rgba(255,255,255,.34); }
.bowl { position: absolute; z-index: 3; left: 50%; bottom: 1px; width: clamp(94px, 12vw, 150px); height: clamp(40px, 7vh, 66px); border-radius: 9px 9px 60px 60px; transform: translateX(-50%); box-shadow: inset 0 -9px 0 rgba(35,25,90,.13), 0 7px 0 rgba(46,34,100,.10); }
.bowl::before { content: ""; position: absolute; left: -5%; right: -5%; top: -6px; height: 13px; border-radius: 20px; background: inherit; filter: brightness(.9); }
.bowl i { position: absolute; left: 50%; top: 18%; width: 24%; aspect-ratio: 1; transform: translateX(-50%) rotate(45deg); border-radius: 5px; background: rgba(255,255,255,.65); }
.bowl-orange { background: var(--orange); }
.bowl-purple { background: var(--purple); }
.bowl-mint { background: var(--mint); }
.score-pill { display: flex; align-items: center; justify-content: center; min-width: 72px; height: clamp(30px, 5vh, 44px); margin-top: 3px; padding: 4px 13px; border-radius: 999px; background: white; box-shadow: 0 4px 0 rgba(70,50,130,.10); font-size: clamp(14px, 1.8vw, 22px); font-weight: 900; font-variant-numeric: tabular-nums; }
.score-pill.solved { gap: 5px; color: var(--purple); }
.score-pill.solved span { color: #79728f; font-size: .58em; text-transform: uppercase; letter-spacing: .06em; }
.score-pill.delta.ahead { color: #d94176; background: #ffe5ef; }
.score-pill.delta.behind { color: #168c71; background: #d6faef; }
.score-pill.delta.neutral { color: #7a7390; }
.player.frozen { filter: saturate(.4) hue-rotate(140deg); }
.player.blocked .icecream-stage::after { content: ""; position: absolute; z-index: 5; left: 15%; right: 15%; top: 28%; height: 34%; border-radius: 50%; background: white; box-shadow: -25px 12px 0 white, 26px 9px 0 white; animation: creamIn .3s ease-out; }
.player.shielded .icecream-stage::before { content: ""; position: absolute; z-index: 6; inset: 14% 15% 7%; border: 5px solid rgba(75,169,255,.72); border-radius: 50% 50% 42% 42%; background: rgba(160,225,255,.12); box-shadow: inset 0 0 18px rgba(60,160,255,.25), 0 0 18px rgba(60,160,255,.25); }

.toast { position: fixed; z-index: 30; left: 50%; top: 10%; max-width: min(80vw, 520px); padding: 11px 18px; border-radius: 16px; background: var(--ink); color: white; box-shadow: var(--shadow); transform: translate(-50%, -20px); opacity: 0; pointer-events: none; text-align: center; font-size: clamp(13px, 1.5vw, 18px); font-weight: 900; transition: opacity .18s, transform .18s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.effect-layer { position: fixed; inset: 0; z-index: 25; pointer-events: none; overflow: hidden; }
.flying-effect { position: absolute; z-index: 2; font-size: clamp(32px, 6vw, 72px); filter: drop-shadow(0 6px 7px rgba(50,30,90,.2)); animation: flyEffect 1.1s ease-in-out both; }
.bee-swarm { position: absolute; left: -15%; top: 42%; font-size: clamp(30px, 5vw, 65px); letter-spacing: 18px; animation: beesFly 1.8s linear both; }
.dog-run { position: absolute; top: 44%; font-size: clamp(45px, 8vw, 92px); animation: dogDash .6s ease-in-out alternate infinite; }
.screen-shake { animation: screenShake .34s linear; }
.snowed::after { content: "❄"; position: fixed; z-index: 22; inset: 0; display: grid; place-items: center; color: rgba(50,170,255,.22); font-size: 45vh; pointer-events: none; animation: snowPulse 1s ease-in-out infinite alternate; }

.result-screen { position: relative; flex-direction: column; align-items: center; justify-content: center; padding: 18px; text-align: center; background: linear-gradient(135deg, #f7eaff, #e0f9ff 52%, #fff0cc); }
.result-screen h2 { margin: 0; font-size: clamp(32px, 5vw, 66px); }
.result-summary { min-height: 1.4em; margin: 8px 0 10px; color: #756e90; font-size: clamp(14px, 1.8vw, 22px); font-weight: 800; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: clamp(12px, 3vw, 42px); width: min(900px, 90vw); min-height: 47vh; }
.result-player { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; width: min(25vw, 240px); padding: 15px 12px 0; border-radius: 30px 30px 10px 10px; color: var(--ink); background: rgba(255,255,255,.72); box-shadow: var(--shadow); }
.result-player.place-1 { order: 2; height: 44vh; background: #fff4b9; }
.result-player.place-2 { order: 1; height: 36vh; }
.result-player.place-3 { order: 3; height: 30vh; }
.place-medal { position: absolute; top: 10px; left: 12px; display: grid; place-items: center; width: 36px; aspect-ratio: 1; border-radius: 50%; background: var(--ink); color: white; font-weight: 900; }
.result-face { position: relative; width: clamp(80px, 13vh, 145px); aspect-ratio: 1; margin-bottom: 9px; border-radius: 50%; background: var(--face, var(--orange)); box-shadow: inset -10px -12px 0 rgba(50,30,90,.09); }
.result-face::before, .result-face::after { content: ""; position: absolute; top: 35%; width: 10%; aspect-ratio: .75; border-radius: 50%; background: var(--ink); }
.result-face::before { left: 28%; } .result-face::after { right: 28%; }
.mouth { position: absolute; left: 50%; top: 58%; width: 34%; height: 19%; transform: translateX(-50%); border: 6px solid var(--ink); border-top: 0; border-radius: 0 0 40px 40px; }
.calm .mouth { height: 0; border-width: 0 0 5px; border-radius: 0; }
.sad .mouth { top: 66%; height: 18%; border: 6px solid var(--ink); border-bottom: 0; border-radius: 40px 40px 0 0; }
.sad::after { box-shadow: 9px 19px 0 -2px #55b9ff; }
.result-player h3 { margin: 0; font-size: clamp(15px, 2vw, 24px); }
.result-score { margin: 5px 0 12px; font-size: clamp(13px, 1.5vw, 18px); font-weight: 900; }
.result-score b { display: block; color: var(--purple); font-size: 1.45em; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 14px; }
.primary-button, .secondary-button { border: 0; border-radius: 18px; padding: 13px 24px; font-size: clamp(14px, 1.5vw, 18px); font-weight: 900; cursor: pointer; }
.primary-button { color: white; background: var(--purple); box-shadow: 0 6px 0 var(--purple-dark); }
.secondary-button { color: var(--purple); background: white; box-shadow: 0 6px 0 #ddd5f7; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -10%; width: 12px; height: 24px; border-radius: 4px; background: var(--c); transform: rotate(var(--r)); animation: confettiFall var(--d) linear infinite; animation-delay: var(--delay); }

.orientation-card { display: none; }

@keyframes float { 0%,100% { translate: 0 0; } 50% { translate: 0 -10px; } }
@keyframes pulse { to { transform: scale(1.06); } }
@keyframes starGlow { from { transform: scale(1); filter: drop-shadow(0 0 3px rgba(255,194,0,.4)); } to { transform: scale(1.13) rotate(4deg); filter: drop-shadow(0 0 11px rgba(255,194,0,.9)); } }
@keyframes scoopDrop { from { opacity: 0; translate: 0 -120px; scale: .5; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes creamIn { from { transform: scale(1.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes flyEffect { 0% { left: var(--from-x); top: var(--from-y); transform: rotate(-20deg) scale(.7); } 50% { top: calc(min(var(--from-y), var(--to-y)) - 80px); transform: rotate(18deg) scale(1.15); } 100% { left: var(--to-x); top: var(--to-y); transform: rotate(0) scale(.75); } }
@keyframes beesFly { to { left: 110%; transform: translateY(-35px); } }
@keyframes dogDash { from { transform: translateX(-10px) rotate(-5deg); } to { transform: translateX(14px) rotate(6deg); } }
@keyframes snowPulse { to { transform: scale(1.08) rotate(8deg); opacity: .6; } }
@keyframes screenShake { 0%,100% { transform: translate(0); } 15% { transform: translate(-12px, 4px); } 30% { transform: translate(10px, -5px); } 45% { transform: translate(-8px, -2px); } 60% { transform: translate(7px, 4px); } 75% { transform: translate(-4px, 1px); } }
@keyframes confettiFall { to { top: 110%; transform: rotate(720deg) translateX(40px); } }

@media (max-height: 560px) {
  .install-screen { gap: 28px; padding-block: 12px; }
  .mini-logo { flex-basis: min(155px, 34vh); border-width: 6px; }
  .welcome-brand h1 { font-size: clamp(43px, 7vw, 72px); }
  .welcome-brand p:last-child { margin-top: 9px; font-size: 13px; }
  .install-panel { padding: 15px 18px; border-radius: 26px; }
  .install-panel h2 { font-size: clamp(21px, 3vw, 32px); }
  .platform-grid { margin-top: 10px; }
  .platform-card { min-height: 86px; padding: 10px; border-radius: 18px; }
  .platform-icon { width: 40px; border-radius: 12px; font-size: 22px; }
  .apple-icon { font-size: 12px; }
  .platform-card i { display: none; }
  .install-guide { min-height: 48px; margin-top: 9px; padding: 7px 11px; }
  .install-guide ol { display: flex; gap: 18px; margin-top: 3px; }
  .continue-button { margin-top: 9px; padding-block: 10px; }
  .games-screen { padding-block: 10px; }
  .catalog-header { margin-bottom: 9px; }
  .catalog-brand > span { width: 34px; }
  .game-catalog { grid-template-rows: repeat(2, minmax(105px, 1fr)); gap: 9px; }
  .game-card { border-width: 3px; border-radius: 20px; padding: 10px; }
  .game-picture { font-size: clamp(26px, 7vh, 40px); }
  .game-copy small { margin-top: 2px; }
  .game-copy em { margin-top: 5px; padding-block: 3px; font-size: 8px; }
  .airship-start-screen { gap: 28px; padding-block: 12px; }
  .airship-hero { width: 35vw; height: 78vh; }
  .hero-airship { width: min(28vw, 300px); }
  .hero-gondola { height: 35px; }
  .airship-mode-panel { padding: 15px 18px; border-radius: 25px; }
  .airship-mode-panel .mode-heading { margin-bottom: 8px; }
  .airship-mode-panel h2 { font-size: clamp(24px, 3vw, 34px); }
  .airship-intro { margin-bottom: 8px; font-size: 11px; }
  .airship-mode-grid { gap: 7px; }
  .airship-mode-grid button { min-height: 59px; padding: 6px; border-radius: 15px; }
  .airship-mode-grid button > span { width: 32px; border-radius: 10px; font-size: 16px; }
  .airship-mode-panel .round-note { margin-top: 7px; }
  .airship-header { padding-top: 5px; }
  .airship-problem-card { min-height: 55px; border-width: 3px; }
  .airship-star-track { min-height: 28px; }
  .sky-race { border-width: 3px; border-radius: 21px; }
  .airship-vehicle { width: clamp(65px, 9vw, 95px); }
  .ship-gondola { height: 20px; }
  .flight-lives { min-width: 76px; padding: 6px 8px; font-size: 16px; }
  .flight-distance { min-width: 64px; padding: 6px 8px; }
  .flight-world { border-width: 3px; border-radius: 21px; }
  .flight-ship { width: clamp(88px, 13vw, 130px); }
  .flight-gondola { height: 20px; }
  .flight-hint { bottom: 7%; }
  .flight-answer-dock { min-height: 66px; padding-block: 4px; border-width: 3px; border-radius: 20px; }
  .flight-answer-dock .airship-problem { font-size: clamp(24px, 5vh, 40px); }
  .answer-bubble { width: clamp(48px, 9vh, 66px); border-width: 3px; font-size: clamp(18px, 4vh, 29px); }
  .scales-start-screen { gap: 28px; padding-block: 12px; }
  .scales-hero { width: 35vw; height: 78vh; }
  .hero-scale { width: min(29vw, 310px); }
  .hero-pan { height: 58px; }
  .scales-mode-panel { padding: 15px 18px; border-radius: 25px; }
  .scales-mode-panel .mode-heading { margin-bottom: 8px; }
  .scales-mode-panel h2 { font-size: clamp(24px, 3vw, 34px); }
  .scales-intro { margin-bottom: 8px; font-size: 11px; }
  .scales-mode-grid { gap: 7px; }
  .scales-mode-grid button { min-height: 59px; padding: 6px; border-radius: 15px; }
  .scales-mode-grid button > span { width: 32px; border-radius: 10px; font-size: 12px; }
  .scales-mode-panel .round-note { margin-top: 7px; }
  .scales-header { padding-top: 5px; }
  .scales-problem-card { min-height: 55px; border-width: 3px; }
  .scales-star-track { min-height: 28px; }
  .scale-player { border-width: 3px; border-radius: 20px; padding: 3px; }
  .scale-machine { min-height: 100px; }
  .arcade-start-screen { gap: 26px; padding-block: 12px; }
  .arcade-hero { width: 34vw; height: 78vh; }
  .arcade-hero::before { width: min(27vw, 280px); border-width: 6px; }
  .arcade-mode-panel { padding: 14px 18px; border-radius: 25px; }
  .arcade-mode-panel .mode-heading { margin-bottom: 7px; }
  .arcade-mode-panel h2 { font-size: clamp(23px, 3vw, 34px); }
  .arcade-intro { margin-bottom: 8px; font-size: 11px; }
  .arcade-mode-button { min-height: 64px; padding: 8px; border-radius: 15px; }
  .arcade-mode-button span { width: 25px; margin-bottom: 3px; }
  .reference-note { margin-top: 7px; padding-block: 5px; }
  .arcade-header { padding-top: 5px; }
  .arcade-layout { gap: 8px; padding-bottom: 7px; }
  .arcade-scene, .arcade-challenge { border-width: 3px; border-radius: 22px; }
  .arcade-challenge { padding: 10px; }
  .arcade-prompt { margin-bottom: 10px; font-size: clamp(21px, 5vh, 35px); }
  .arcade-choice { min-height: 55px; border-width: 3px; border-radius: 17px; font-size: clamp(17px, 4vh, 28px); }
  .arcade-lives { min-width: 68px; padding: 6px 7px; font-size: 13px; }
  .arcade-score { min-width: 58px; padding: 6px 7px; }
  .arcade-score b { font-size: 18px; }
  .game-header { padding-top: 5px; }
  .star-track { min-height: 29px; padding-bottom: 1px; }
  .problem-card { min-height: 60px; border-width: 3px; border-radius: 20px; }
  .player-name { margin-bottom: 0; padding-block: 2px; }
  .icecream-stage { height: clamp(105px, 27vh, 150px); }
  .score-pill { height: 27px; }
  .start-screen { padding: 12px 24px; }
  .brand-art { height: 180px; }
  .mode-panel { padding: 12px 18px; }
  .mode-heading { margin-bottom: 6px; }
  .mode-groups { gap: 7px; }
  .mode-group-title { margin-bottom: 4px; font-size: 11px; }
  .addition-grid { gap: 6px; }
  .mode-card { min-height: 48px; padding: 5px 7px; border-radius: 15px; }
  .mode-icon { flex-basis: 36px; border-radius: 11px; font-size: 13px; }
  .multiply-grid { gap: 5px; }
  .multiply-button { min-height: 35px; border-radius: 12px; }
  .round-note { margin-top: 6px; font-size: 11px; }
}

@media (max-width: 1500px) {
  .start-screen { gap: clamp(18px, 3vw, 42px); }
  .brand-panel { flex-direction: column; gap: 6px; width: min(40vw, 520px); min-width: 0; text-align: center; }
  .brand-art { flex-basis: auto; width: min(205px, 20vw); height: min(225px, 38vh); }
  .brand-panel h1 { font-size: clamp(44px, 6vw, 76px); letter-spacing: -4px; }
  .tagline { margin-top: 12px; font-size: clamp(14px, 1.45vw, 19px); }
}

@media (max-width: 880px) {
  .install-screen { gap: 18px; }
  .welcome-brand { width: 40vw; }
  .mini-logo { flex-basis: min(140px, 19vw); }
  .welcome-brand h1 { font-size: clamp(39px, 6vw, 56px); }
  .install-panel { width: 56vw; }
  .platform-card { min-height: 92px; }
  .catalog-header { grid-template-columns: auto 1fr auto; }
  .catalog-brand b { display: none; }
  .game-catalog { grid-template-columns: repeat(2, minmax(230px, 1fr)); grid-template-rows: none; }
  .game-card { min-height: 110px; }
  .catalog-back-button { min-width: 42px; justify-content: center; padding-inline: 9px; font-size: 11px; }
  .airship-start-screen { gap: 18px; }
  .airship-hero { width: 35vw; }
  .airship-mode-panel { width: 61vw; }
  .airship-mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .airship-layout { grid-template-columns: 65px 1fr 65px; gap: 6px; }
  .airship-problem-card { min-width: 85%; }
  .flight-status { gap: 4px; }
  .flight-lives { min-width: 70px; padding-inline: 7px; font-size: 14px; }
  .flight-distance { min-width: 58px; padding-inline: 7px; }
  .flight-distance b { font-size: 18px; }
  .flight-answer-dock { width: 98%; gap: 10px; padding-inline: 10px; }
  .answer-bubbles { gap: 5px; }
  .scales-start-screen { gap: 18px; }
  .scales-hero { width: 35vw; }
  .scales-mode-panel { width: 61vw; }
  .scales-mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scales-layout { grid-template-columns: 65px 1fr 65px; gap: 6px; }
  .scales-problem-card { min-width: 92%; padding-inline: 12px; }
  .scales-problem { font-size: clamp(20px, 4.5vh, 38px); }
  .arcade-start-screen { gap: 18px; }
  .arcade-hero { width: 34vw; }
  .arcade-mode-panel { width: 62vw; }
  .arcade-layout { grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); }
  .arcade-status { gap: 3px; }
  .arcade-lives { min-width: 62px; padding-inline: 5px; font-size: 12px; }
  .arcade-score { min-width: 50px; }
  .start-screen { gap: 20px; }
  .brand-panel { width: 37vw; }
  .brand-art { flex-basis: auto; width: min(180px, 20vw); height: min(210px, 45vh); }
  .tagline { margin-top: 10px; font-size: 14px; }
  .mode-panel { width: 59vw; border-radius: 25px; }
  .game-layout { grid-template-columns: 65px 1fr 65px; gap: 6px; }
  .problem-card { width: 90%; padding-inline: 15px; }
  .arena { gap: 4px; padding-inline: 2px; }
  .podium { min-height: 43vh; }
}

@media (orientation: portrait) and (max-width: 900px) {
  body.game-active .app-shell { display: none; }
  body.game-active .orientation-card { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px; text-align: center; background: linear-gradient(150deg, #6c4cff, #a45cff); color: white; }
  .orientation-card strong { font-size: 28px; }
  .orientation-card span { opacity: .85; font-weight: 700; }
  .turn-phone { display: grid; place-items: center; width: 90px; aspect-ratio: .62; border: 6px solid white; border-radius: 15px; font-size: 50px; animation: turnDevice 1.7s ease-in-out infinite; }
  .install-screen { flex-direction: column; justify-content: flex-start; gap: 22px; padding: 24px 18px 30px; }
  .welcome-brand { flex-direction: column; width: 100%; text-align: center; }
  .mini-logo { flex-basis: auto; width: min(150px, 38vw); }
  .welcome-brand h1 { font-size: clamp(46px, 15vw, 75px); }
  .welcome-brand p:last-child { margin: 10px auto 0; font-size: 14px; }
  .install-panel { width: min(570px, 100%); padding: 20px; }
  .platform-grid { grid-template-columns: 1fr; }
  .platform-card { min-height: 100px; }
  .games-screen { padding: 15px 12px 24px; }
  .catalog-header { grid-template-columns: auto 1fr auto; gap: 10px; }
  .catalog-brand > span { width: 38px; }
  .catalog-brand b { display: none; }
  .catalog-header > div:nth-child(2) { text-align: left; }
  .catalog-header h2 { font-size: 27px; }
  .catalog-install-button { padding-inline: 10px; font-size: 0; }
  .catalog-install-button::first-letter { font-size: 18px; }
  .game-catalog { grid-template-columns: 1fr; grid-template-rows: none; gap: 11px; }
  .game-card { min-height: 125px; }
  .start-screen { flex-direction: column; justify-content: flex-start; gap: 12px; padding: 15px; overflow-y: auto; }
  .brand-panel { width: 100%; justify-content: center; }
  .brand-art { display: none; }
  .brand-panel h1 { font-size: 45px; }
  .tagline { display: none; }
  .mode-panel { width: 100%; max-height: none; overflow: visible; }
  .addition-grid { grid-template-columns: 1fr; }
  .multiply-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .airship-start-screen { flex-direction: column; justify-content: flex-start; gap: 5px; padding: 15px; }
  .airship-hero { width: 100%; height: 190px; }
  .hero-airship { width: min(260px, 62vw); }
  .hero-gondola { height: 35px; }
  .hero-candy { width: 40px; border-width: 3px; }
  .airship-mode-panel { width: 100%; }
  .airship-mode-grid { grid-template-columns: 1fr 1fr; }
  .scales-start-screen { flex-direction: column; justify-content: flex-start; gap: 5px; padding: 15px; }
  .scales-hero { width: 100%; height: 190px; }
  .hero-scale { width: min(280px, 70vw); height: 180px; }
  .hero-pan { height: 50px; }
  .place-block { min-width: 63px; height: 41px; border-width: 3px; font-size: 12px; }
  .scales-mode-panel { width: 100%; }
  .scales-mode-grid { grid-template-columns: 1fr 1fr; }
  .arcade-start-screen { flex-direction: column; justify-content: flex-start; gap: 4px; padding: 15px; }
  .arcade-hero { width: 100%; height: 190px; }
  .arcade-hero::before { width: min(170px, 42vw); }
  .arcade-hero-icon { width: 135px; font-size: 88px; }
  .arcade-mode-panel { width: 100%; }
  .arcade-mode-grid { grid-template-columns: 1fr; }
}

@keyframes turnDevice { 0%,20% { transform: rotate(0); } 70%,100% { transform: rotate(90deg); } }

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