:root {
  color-scheme: light;
  --forest: #214b3b;
  --forest-deep: #17352f;
  --grass: #70a453;
  --moss: #355f3e;
  --rock: #a95d39;
  --wood: #9a5535;
  --gold: #f4c662;
  --cream: #fff6d9;
  --ink: #27332d;
  --stage-gap: clamp(10px, 1.3vw, 24px);
}

* { box-sizing: border-box; }
html, body { min-width: 320px; min-height: 100%; margin: 0; }
body { background: #17352f; color: var(--ink); font-family: "Trebuchet MS", "Segoe UI", sans-serif; overflow-x: hidden; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; touch-action: manipulation; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 4px solid #ffe17d; outline-offset: 3px; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }

.site-header { height: clamp(56px, 5vw, 78px); color: #fff8df; background: var(--forest); border-bottom: 3px solid #142f2b; box-shadow: 0 4px 14px #0a231c55; position: relative; z-index: 20; }
.site-header-inner { max-width: 1560px; height: 100%; margin: auto; padding: 0 clamp(12px, 2vw, 38px); display: flex; align-items: center; gap: clamp(10px, 1.6vw, 28px); }
.brand { color: #fff8df; display: inline-flex; align-items: center; gap: 7px; text-decoration: none; font-size: clamp(21px, 2vw, 34px); font-weight: 800; letter-spacing: -.8px; white-space: nowrap; }
.brand > span:last-child { color: var(--gold); }
.brand-mark { font-size: 1.05em; line-height: 1; }
.site-context { color: #b7d6ab; font-size: clamp(10px, .8vw, 14px); font-weight: 800; letter-spacing: 1.2px; white-space: nowrap; }
.site-context span { padding: 0 7px; color: var(--gold); }
.header-user-box { display: flex; align-items: center; gap: 7px; width: min(210px, 26vw); height: 38px; padding: 0 12px; color: #fff8df; background: #102d2a88; border: 1px solid #9ecb795c; border-radius: 999px; }
.header-user-icon { font-size: 15px; }
.header-player-input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #fff8df; font-weight: 700; }
.header-player-input::placeholder { color: #d4e8c2aa; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.header-icon-button, .help-link { border: 1px solid #b7d6ab66; border-radius: 10px; background: #12332f99; color: #fff8df; min-height: 38px; }
.header-icon-button { width: 40px; font-size: 23px; line-height: 1; }
.header-icon-button:hover, .help-link:hover { background: #386349; }
.help-link { padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 800; }
.help-link span { width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #ffe8a7; border-radius: 50%; }

.page { min-height: calc(100dvh - clamp(56px, 5vw, 78px)); padding: clamp(10px, 1.5vw, 28px) clamp(8px, 2vw, 34px) 10px; display: flex; flex-direction: column; background: radial-gradient(circle at 50% 0%, #36684b, #17352f 65%); }
.split-stage { width: 100%; max-width: 1560px; min-height: 0; margin: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--stage-gap); flex: 1 1 auto; }
.game-board { min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border: 4px solid #1b3a31; border-radius: 18px; background: #244f3e; box-shadow: 0 14px 38px #071c1a88; isolation: isolate; }
.hud { position: relative; min-height: clamp(58px, 5vw, 82px); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: clamp(7px, 1vw, 18px); padding: 7px clamp(8px, 1.1vw, 18px); color: var(--cream); background: linear-gradient(110deg, #2b6048, #3c7651 56%, #29513f); border-bottom: 3px solid #1c3e34; z-index: 4; }
.hud h1 { min-width: 0; margin: 0; text-align: center; font-size: clamp(15px, 1.65vw, 28px); line-height: 1.15; letter-spacing: .6px; text-shadow: 0 2px 2px #14312788; }
.heading-suffix { display: inline; color: #fbd77d; font-size: .72em; font-weight: 700; }
.hud-stat { min-width: clamp(65px, 6vw, 98px); padding: 4px 9px; border: 1px solid #b7d6ab66; border-radius: 12px; background: #173a3285; text-align: center; }
.stat-label { display: block; color: #c5dfac; font-size: clamp(8px, .65vw, 11px); line-height: 1; font-weight: 800; letter-spacing: 1px; }
.stat-value { display: flex; align-items: center; justify-content: center; gap: 5px; font-size: clamp(20px, 1.7vw, 30px); line-height: 1.15; }
.heart { color: #f47c66; text-shadow: 0 1px 1px #612f2a; }
.score-icon { color: var(--gold); }
.hud > .question-box { left: 18%; top: 5px; width: 69%; height: calc(100% - 10px); min-height: 0; padding: 17px 16px 5px; border-width: 3px; border-radius: 10px; z-index: 6; }
.hud > .question-box::before { top: -6px; height: 4px; }
.hud .question-counter { top: 3px; left: 10px; font-size: clamp(7px, .65vw, 11px); }
.hud .question-content { width: 100%; min-height: 0; gap: 8px; }
.hud .question-illustration { width: clamp(34px, 4vw, 58px); height: clamp(26px, 3vw, 42px); }
.hud .question-box h2 { font-size: clamp(10px, 1.15vw, 18px); line-height: 1.08; }

.pond { position: relative; flex: 1 1 auto; min-height: 520px; overflow: hidden; container-type: inline-size; background: #83c4d1 url('assets/ngarai-clean.webp') center / cover no-repeat; }
.scene-glow { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 51% 47%, #fff5bf55, transparent 34%), linear-gradient(180deg, transparent 58%, #19362d44); z-index: 1; }
.scene-vignette { position: absolute; inset: 0; pointer-events: none; box-shadow: inset 0 0 80px #132b2a66; z-index: 2; }
.level-sign, .finish-sign { position: absolute; z-index: 11; color: #3d2b25; background: linear-gradient(#f8eac8, #dab879); border: 3px solid #604032; box-shadow: 0 4px 0 #3c2b2a66, inset 0 0 0 2px #fff4c766; transform: rotate(-2deg); }
.level-sign { left: clamp(12px, 2.3cqw, 36px); top: clamp(12px, 2.5cqw, 34px); min-width: clamp(150px, 18cqw, 260px); padding: 7px 15px 8px; border-radius: 9px 12px 8px 10px; }
.level-sign::after, .finish-sign::after { content: ''; position: absolute; inset: 5px; border: 1px solid #8e5c3a88; border-radius: 5px; pointer-events: none; }
.level-sign span { display: block; font-size: clamp(9px, 1cqw, 14px); font-weight: 900; letter-spacing: 1.6px; color: #89512f; }
.level-sign strong { display: block; font-size: clamp(15px, 1.7cqw, 26px); line-height: 1.1; }
.level-sign small { display: block; margin-top: 3px; color: #66513b; font-size: clamp(9px, .9cqw, 13px); }
.finish-sign { right: clamp(14px, 4cqw, 56px); top: clamp(15px, 3cqw, 42px); min-width: clamp(62px, 6.5cqw, 98px); padding: 7px 11px 8px; text-align: center; transform: rotate(4deg); }
.finish-sign::before { content: ''; position: absolute; width: 4px; height: 62px; top: 100%; left: 50%; background: #573a2b; box-shadow: 0 4px 0 #382e2b55; }
.finish-sign span { display: block; font-size: clamp(16px, 2cqw, 30px); font-weight: 900; line-height: 1; letter-spacing: 2px; }
.finish-sign small { display: block; margin-top: 3px; font-size: clamp(7px, .75cqw, 11px); font-weight: 800; }

.question-box { position: absolute; left: 30%; top: 2.5%; width: 44%; min-height: 105px; padding: 27px 18px 13px; z-index: 12; border: 5px solid #654332; border-radius: 13px; background: linear-gradient(105deg, #f6ebd2e8, #fffbecdf); box-shadow: 0 7px 0 #3d2e2a66, inset 0 0 0 2px #fff8dfaa; text-align: center; }
.question-box::before { content: ''; position: absolute; top: -8px; left: 9%; right: 9%; height: 6px; border-radius: 6px; background: #a7683d; box-shadow: 0 2px 0 #4b302a; }
.question-counter { position: absolute; top: 7px; left: 13px; color: #795036; font-size: clamp(9px, 1cqw, 13px); font-weight: 900; letter-spacing: .5px; }
.question-content { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 52px; }
.question-illustration { width: clamp(58px, 7.5cqw, 106px); height: clamp(46px, 6cqw, 82px); flex: none; }
.question-illustration .mini-svg { width: 100%; height: 100%; }
.question-body { min-width: 0; }
.question-box h2 { margin: 0; color: #2e3029; font-size: clamp(18px, 2.25cqw, 34px); line-height: 1.2; font-weight: 800; }

.answer-field { position: absolute; inset: 0; z-index: 7; }
.route-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.route-platform { position: absolute; width: 19%; height: 15%; padding: 0; border: 0; color: #fff8db; background: transparent; transform: translate(-50%, -50%); filter: drop-shadow(0 6px 3px #17312c88) brightness(.78); opacity: .88; isolation: isolate; }
.route-platform img { width: 100%; height: 100%; object-fit: fill; display: block; }
.answer-pad { position: absolute; width: 19%; height: 15%; min-height: 68px; padding: 0; border: 0; color: #fff8db; background: transparent; transform: translate(-50%, -50%); isolation: isolate; filter: drop-shadow(0 7px 3px #17312c88); transition: filter .18s, transform .18s; }
.platform-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; z-index: -1; transition: filter .18s, transform .18s; }
.answer-pad:hover:not(:disabled), .answer-pad:focus-visible { filter: drop-shadow(0 8px 4px #17312c99) brightness(1.1); transform: translate(-50%, -50%) translateY(-4px); }
.answer-pad:focus-visible { outline: 3px solid #ffe17d; outline-offset: 2px; }
.answer-letter { position: absolute; left: 12%; top: 32%; color: #ffe5a0; font-size: clamp(15px, 2.1cqw, 30px); font-weight: 900; text-shadow: 0 2px 1px #4a2b28; }
.answer-text { position: absolute; left: 25%; right: 5%; top: 23%; bottom: 18%; display: flex; align-items: center; justify-content: center; color: #fff9df; font-size: clamp(17px, 2.3cqw, 34px); font-weight: 900; line-height: 1.05; text-align: center; text-shadow: 0 2px 2px #4a2b28; overflow-wrap: normal; word-break: normal; }
.answer-pad.medium-answer .answer-text { font-size: clamp(14px, 1.8cqw, 25px); }
.answer-pad.long-answer .answer-text { left: 22%; right: 4%; font-size: clamp(11px, 1.35cqw, 19px); line-height: 1.08; }
.answer-symbol { position: absolute; right: 9%; top: 27%; color: #ffe47b; font-size: clamp(21px, 2.6cqw, 38px); font-weight: 900; }
.pad-a { left: 27%; top: 56%; }
.pad-b { left: 50%; top: 42%; }
.pad-c { left: 73%; top: 56%; }
.answer-pad.correct .platform-art { filter: brightness(1.25) saturate(1.2); }
.answer-pad.incorrect .platform-art { filter: sepia(.8) saturate(2) hue-rotate(305deg) brightness(.7); }
.answer-pad.muted { opacity: .55; }
.answer-pad.landed .platform-art { animation: platform-land .65s ease-out; }
.home-platform { position: absolute; left: 14%; top: 91%; width: 18%; height: 11%; transform: translate(-50%, -50%); z-index: 4; filter: drop-shadow(0 6px 3px #17312c99) brightness(.8); }
.home-platform img { width: 100%; height: 100%; object-fit: fill; }
.home-platform span { position: absolute; inset: 0; display: grid; place-items: center; color: #ffe9a9; font-size: clamp(10px, 1.25cqw, 18px); font-weight: 900; text-shadow: 0 2px #4a2b28; }
.frog { position: absolute; left: 14%; top: 79%; width: 11%; height: 18%; transform: translate(-50%, -55%); z-index: 9; pointer-events: none; transform-origin: center center; }
.frog > img { width: 100%; height: 100%; object-fit: contain; display: block; filter: drop-shadow(0 7px 3px #142d2d99); }
.frog.idle > img { animation: frog-breathe 2.8s ease-in-out infinite; }
.frog.sink > img { animation: frog-sink .55s ease-in forwards; }
.frog.jumping > img { animation: frog-stretch .68s ease-in-out; }

.game-controls { position: absolute; left: 18px; right: 18px; bottom: 14px; z-index: 14; display: flex; align-items: flex-end; justify-content: space-between; pointer-events: none; }
.game-controls > * { pointer-events: auto; }
.time-group { display: flex; align-items: center; gap: 8px; }
.countdown { width: clamp(51px, 5.8cqw, 82px); height: clamp(51px, 5.8cqw, 82px); position: relative; display: grid; place-items: center; }
.countdown svg { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.countdown circle { fill: none; stroke-width: 7; }
.timer-track { stroke: #193b34cc; }
.timer-progress { stroke: var(--gold); stroke-linecap: round; stroke-dasharray: 213.63; transition: stroke-dashoffset .2s linear; }
.countdown > span { position: relative; color: #fff6d9; font-size: clamp(16px, 2cqw, 28px); font-weight: 900; text-shadow: 0 2px 2px #23332d; }
.countdown.urgent { animation: urgent-pulse .55s ease-in-out infinite; }
.elapsed { padding: 7px 16px; color: #3d3029; background: #fff5d8ee; border: 3px solid #795036; border-radius: 999px; font-weight: 900; font-variant-numeric: tabular-nums; }
.control-actions { display: flex; gap: 8px; }
.icon-button { width: 42px; height: 42px; border: 2px solid #f4d385; border-radius: 12px; color: #fff6d9; background: #23483bbd; font-size: 22px; line-height: 1; }
.icon-button:hover { background: #386349; }
.feedback { position: absolute; z-index: 20; left: 50%; bottom: 13%; transform: translateX(-50%); min-width: 220px; max-width: 82%; padding: 9px 18px; color: #fff9df; background: #214b3fee; border: 2px solid #f2d17f; border-radius: 999px; text-align: center; font-weight: 900; opacity: 0; pointer-events: none; }
.feedback.visible { opacity: 1; animation: feedback-pop .2s ease-out; }
.feedback.error { background: #713d35ee; border-color: #f39a68; }
.floating-score, .life-lost-heart { position: absolute; z-index: 22; pointer-events: none; transform: translate(-50%, -50%); font-weight: 900; animation: float-up .9s ease-out forwards; }
.floating-score { color: #fff09b; font-size: clamp(20px, 3cqw, 44px); text-shadow: 0 3px 3px #47332b; }
.life-lost-heart { color: #f7856b; font-size: clamp(28px, 4cqw, 56px); text-shadow: 0 3px #612f2a; }
.landing-ring { position: absolute; z-index: 8; width: 30px; height: 15px; border: 4px solid #ffe7a0cc; border-radius: 50%; transform: translate(-50%, -50%); animation: ring-out .7s ease-out forwards; pointer-events: none; }

.start-screen, .result-screen { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; overflow: auto; padding: clamp(18px, 3cqw, 48px); color: #fff8df; background: linear-gradient(180deg, #173b34d9, #234c3dea 60%, #17352ff2); text-align: center; }
.start-mascot { width: clamp(105px, 14cqw, 180px); height: clamp(88px, 14cqw, 170px); margin-bottom: -4px; }
.start-frog { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 9px 4px #112d2d99); animation: frog-breathe 3s ease-in-out infinite; }
.eyebrow { margin: 0 0 7px; color: #f5cf72; font-size: clamp(10px, 1.2cqw, 15px); font-weight: 900; letter-spacing: 2px; }
.start-screen h2 { max-width: 650px; margin: 0; color: #fff4c8; font-size: clamp(21px, 3cqw, 42px); line-height: 1.1; }
.start-intro { max-width: 560px; margin: 9px 0 10px; color: #dbe9c7; font-size: clamp(12px, 1.25cqw, 17px); line-height: 1.4; }
.level-picker { width: min(720px, 100%); display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 4px 0 14px; }
.subject-picker { grid-template-columns: repeat(3, 1fr); }
.level-option { min-width: 0; min-height: 105px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: #fff8df; background: #214c3fdb; border: 2px solid #9dc38199; border-radius: 14px; box-shadow: 0 4px 0 #132f2b88; transition: transform .15s, background .15s, border-color .15s; }
.level-option:hover { transform: translateY(-3px); background: #356c4ccc; }
.level-option.disabled, .level-option:disabled { cursor: not-allowed; opacity: .55; filter: grayscale(.25); transform: none; }
.level-option.disabled:hover, .level-option:disabled:hover { background: #214c3fdb; }
.level-option.active { color: #4a3027; background: #ffe8a5; border-color: #fff8df; box-shadow: 0 4px 0 #795036; }
.level-icon { width: 46px; height: 30px; display: block; margin-bottom: 3px; }
.level-icon .mini-svg { width: 100%; height: 100%; }
.level-option strong { font-size: clamp(12px, 1.4cqw, 18px); }
.level-option small { color: #c6dbb5; font-size: clamp(9px, 1cqw, 13px); }
.level-option.active small { color: #7a573b; }
.player-name-card { width: min(350px, 90%); margin: 0 auto 13px; display: flex; flex-direction: column; gap: 5px; text-align: left; }
.player-name-label { padding-left: 4px; color: #e8f0d2; font-size: 13px; font-weight: 900; }
.player-name-input { height: 42px; padding: 0 15px; border: 2px solid #a6c68a; border-radius: 999px; outline: 0; color: #3b3028; background: #fff8df; font-weight: 700; }
.primary-button, .secondary-button, .text-button { border-radius: 999px; font-weight: 900; }
.primary-button { min-height: 46px; padding: 10px 25px; border: 0; color: #4c3028; background: var(--gold); box-shadow: 0 4px 0 #795036; transition: transform .15s, filter .15s; }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.start-button { min-width: min(310px, 90%); font-size: clamp(15px, 1.5cqw, 20px); }
.start-details { margin: 10px 0 0; color: #c9dfb8; font-size: clamp(10px, 1cqw, 13px); }
.start-details span { padding: 0 3px; }
.danger-text { color: #a94c3e; }
.result-screen { background: linear-gradient(180deg, #1d473be8, #234d3fee); }
.result-mascot { font-size: clamp(40px, 7cqw, 86px); margin-bottom: -3px; }
.result-screen h2 { margin: 0; color: #ffe18a; font-size: clamp(28px, 5cqw, 72px); letter-spacing: 2px; }
.result-player { margin: 5px 0 2px; }
.result-player-badge { padding: 5px 14px; color: #4d352a; background: #fff1c9; border-radius: 999px; font-size: 13px; }
.result-message { max-width: 520px; margin: 7px 0; color: #e1edcf; font-size: clamp(14px, 1.6cqw, 20px); }
.trophy { display: block; margin: 1px 0; font-size: clamp(38px, 5cqw, 65px); }
.result-stats { width: min(650px, 96%); display: flex; justify-content: center; gap: clamp(10px, 3cqw, 42px); margin: 4px 0 14px; }
.result-stats { flex-wrap: wrap; }
.result-stats > div { min-width: 86px; display: flex; flex-direction: column; gap: 3px; }
.result-stats span { color: #bdd6aa; font-size: 11px; font-weight: 900; letter-spacing: 1.4px; }
.result-stats b { color: #fff3bf; font-size: clamp(23px, 3.5cqw, 42px); }
.result-score-detail { color: #cfe2ba; font-size: 10px; }
.result-actions { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.secondary-button { min-height: 46px; padding: 9px 19px; color: #fff5d6; background: #214b3bcc; border: 2px solid #c2d9a4; }
.secondary-button:hover { background: #3d7651; }
.text-button { margin-top: 13px; padding: 7px 12px; border: 0; color: #85503d; background: transparent; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; left: var(--x); top: -20px; width: 10px; height: 18px; background: var(--c); transform: rotate(25deg); animation: confetti-fall 3s linear infinite; animation-delay: var(--delay); }

.start-countdown { position: absolute; inset: 0; z-index: 40; display: grid; place-items: center; color: #fff7d9; }
.countdown-backdrop { position: absolute; inset: 0; background: #102a2cee; }
.countdown-burst, .countdown-ripple { position: absolute; width: 30%; aspect-ratio: 1; border: 5px solid #f5cf72aa; border-radius: 50%; }
.countdown-stage { position: relative; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.countdown-stage.pop { animation: count-pop .65s ease-out; }
.countdown-number { color: #ffe08b; font-size: clamp(70px, 14cqw, 190px); line-height: .8; text-shadow: 0 7px #7d4b35; }
.countdown-number.is-start { font-size: clamp(38px, 7cqw, 100px); }
.countdown-stage span { color: #e0edc9; font-size: clamp(12px, 1.8cqw, 22px); font-weight: 800; }
.start-countdown.fade-out { animation: fade-out .3s ease-out forwards; }

.game-footer { max-width: 1560px; width: 100%; padding: 8px 4px 0; margin: auto; color: #b9d2ac; text-align: center; font-size: 12px; }
.game-footer a { color: #f0cb70; font-weight: 800; text-underline-offset: 2px; }
.game-footer a:hover { color: #ffe18a; }
.game-footer .footer-heart { display: inline-block; color: #f15f63; text-shadow: 0 1px 1px #6f2934; animation: heart-vibrate .8s ease-in-out infinite; }
.accessibility-status { position: fixed; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.load-error { padding: 40px; color: #fff; text-align: center; }

dialog { width: min(560px, calc(100% - 28px)); max-height: 88dvh; padding: 24px; border: 0; border-radius: 18px; color: var(--ink); background: #fff8df; box-shadow: 0 20px 80px #071c1acc; }
dialog::backdrop { background: #102b2aaa; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dialog-heading h2 { margin: 0; color: #325d43; }
.close-button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: #604032; background: #f0d695; font-size: 24px; line-height: 1; }
.dialog-note { color: #5c6653; line-height: 1.5; }
.sound-row { display: flex; align-items: center; gap: 12px; padding: 14px 0 23px; font-weight: 800; }
.sound-row input { position: absolute; opacity: 0; }
.switch { width: 48px; height: 27px; margin-left: auto; padding: 3px; border-radius: 999px; background: #b4bea9; }
.switch::after { content: ''; display: block; width: 21px; height: 21px; border-radius: 50%; background: #fff8df; transition: transform .2s; }
.sound-row input:checked + .switch { background: #4d8c57; }
.sound-row input:checked + .switch::after { transform: translateX(21px); }
dialog .secondary-button { width: 100%; margin-top: 10px; color: #32513d; border-color: #9fbf88; background: transparent; }
.instructions { padding-left: 23px; line-height: 1.55; }
.instructions li { margin: 8px 0; padding-left: 4px; }

.report-dialog { width: min(800px, calc(100% - 20px)); }
.report-summary-card { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 18px 0 12px; padding: 12px; border-radius: 12px; background: #e8efda; }
.report-summary-card > div:not(.report-summary-badge) { display: flex; flex-direction: column; min-width: 90px; }
.report-summary-card span { color: #627359; font-size: 10px; font-weight: 900; letter-spacing: 1px; }
.report-summary-card b { color: #315d40; font-size: 21px; }
.report-summary-badge { margin-left: auto; padding: 7px 10px; border-radius: 999px; color: #fff; background: #a9583c; font-size: 12px; font-weight: 900; }
.report-summary-badge.passed { background: #4d8b57; }
.report-filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; padding-bottom: 3px; }
.report-filter-btn { flex: none; padding: 7px 11px; border: 1px solid #a6bd91; border-radius: 999px; color: #4f694e; background: #f8f2dc; font-size: 12px; }
.report-filter-btn.active { color: #fff; background: #4d8b57; }
.report-item { padding: 15px 0; border-top: 1px solid #d7dfc9; }
.report-item[hidden] { display: none; }
.report-item { display: flex; gap: 14px; }
.report-illustration { flex: none; width: 125px; height: 85px; padding: 4px; border-radius: 10px; background: #eef3e1; }
.report-illustration .mini-svg { width: 100%; height: 100%; }
.report-body { min-width: 0; flex: 1; }
.report-item h3 { margin: 0 0 6px; color: #345a42; font-size: 15px; line-height: 1.35; }
.report-item p { margin: 5px 0; line-height: 1.45; font-size: 14px; }
.report-status { display: inline-block; margin-right: 6px; padding: 3px 6px; border-radius: 5px; color: #fff; background: #4d8b57; font-size: 10px; vertical-align: 2px; }
.report-status.wrong { background: #ae593f; }
.report-status.unanswered { color: #596452; background: #dce4d2; }
.report-item .explanation { padding: 8px 10px; border-radius: 8px; color: #52624e; background: #edf2e5; }

@keyframes frog-breathe { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-4px) scale(1.02, .98); } }
@keyframes frog-stretch { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.12, .84); } 70% { transform: scale(.95, 1.04); } }
@keyframes frog-sink { to { opacity: 0; transform: translateY(28px) scale(.65); } }
@keyframes platform-land { 0%, 100% { transform: scale(1); } 30% { transform: scale(.92, .8); } 65% { transform: scale(1.05, 1.08); } }
@keyframes feedback-pop { from { transform: translateX(-50%) scale(.8); } to { transform: translateX(-50%) scale(1); } }
@keyframes float-up { from { opacity: 1; transform: translate(-50%, -50%); } to { opacity: 0; transform: translate(-50%, -50%) translateY(-60px); } }
@keyframes ring-out { from { opacity: .9; transform: translate(-50%, -50%) scale(.4); } to { opacity: 0; transform: translate(-50%, -50%) scale(2.2); } }
@keyframes urgent-pulse { 50% { transform: scale(1.12); } }
@keyframes confetti-fall { from { transform: translateY(-10px) rotate(0); } to { transform: translateY(700px) rotate(500deg); } }
@keyframes count-pop { 0% { transform: scale(.55); opacity: .2; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes heart-vibrate { 0%, 100% { transform: scale(1) rotate(0); } 20% { transform: scale(1.12) rotate(-7deg); } 40% { transform: scale(1.18) rotate(7deg); } 60% { transform: scale(1.08) rotate(-4deg); } 80% { transform: scale(1.12) rotate(4deg); } }

@media (min-width: 900px) {
  .page { height: calc(100dvh - clamp(56px, 5vw, 78px)); min-height: 0; }
  .pond { min-height: 0; }
}

@media (max-width: 820px) {
  .site-context { display: none; }
  .header-user-box { margin-left: auto; width: min(170px, 34vw); }
  .help-link { width: 38px; height: 38px; min-height: 38px; flex: 0 0 38px; padding: 0; justify-content: center; font-size: 0; }
  .help-link span { width: 23px; height: 23px; flex: none; font-size: 14px; line-height: 1; }
  .page { padding: 7px; }
  .pond { min-height: 510px; }
  .question-box { left: 20%; top: 2.5%; width: 60%; }
  .hud > .question-box { left: 16%; width: 70%; }
  .answer-pad { width: 25%; height: 14%; }
  .route-platform { width: 25%; height: 14%; }
  .home-platform { width: 25%; }
  .frog { width: 14%; }
}

@media (min-width: 821px) and (max-height: 1100px) {
  .start-screen, .result-screen { justify-content: flex-start; overflow-y: auto; padding-top: 8px; padding-bottom: 18px; }
  .start-mascot { width: 105px; height: 68px; }
  .start-screen h2 { font-size: clamp(21px, 2.5cqw, 34px); }
  .start-intro { margin: 5px 0 7px; }
  .level-picker { gap: 7px; margin: 3px 0 8px; }
  .level-option { min-height: 72px; padding: 5px 6px; }
  .level-icon { width: 34px; height: 24px; }
  .player-name-card { margin-bottom: 8px; }
  .player-name-input { height: 40px; }
  .primary-button { min-height: 44px; padding: 8px 23px; }
  .start-details { margin-top: 7px; }
}

@media (max-width: 560px) {
  .site-header { height: 52px; }
  .site-header-inner { padding: 0 8px; gap: 6px; }
  .brand { font-size: 19px; gap: 3px; }
  .header-user-box { height: 32px; padding: 0 8px; width: 118px; }
  .header-player-input { font-size: 11px; }
  .header-icon-button { width: 32px; min-height: 32px; font-size: 18px; }
  .help-link { width: 32px; height: 32px; min-height: 32px; flex-basis: 32px; }
  .help-link span { width: 22px; height: 22px; font-size: 13px; }
  .page { min-height: calc(100dvh - 52px); padding: 5px; }
  .game-board { border-width: 2px; border-radius: 11px; }
  .hud { min-height: 51px; padding: 4px; gap: 4px; }
  .hud h1 { font-size: 12px; }
  .heading-suffix { display: block; padding-top: 2px; font-size: 9px; }
  .hud-stat { min-width: 48px; padding: 3px 4px; border-radius: 8px; }
  .stat-label { font-size: 7px; letter-spacing: .5px; }
  .stat-value { font-size: 16px; gap: 2px; }
  .hud > .question-box { left: 15%; top: 3px; width: 70%; height: calc(100% - 6px); padding: 10px 5px 2px; border-width: 2px; border-radius: 7px; }
  .hud > .question-box::before { top: -4px; height: 3px; }
  .hud .question-counter { top: 2px; left: 5px; font-size: 6px; }
  .hud .question-content { gap: 3px; }
  .hud .question-illustration { display: none !important; }
  .hud .question-box h2 { font-size: clamp(8px, 2.3vw, 12px); line-height: 1.02; }
  .pond { min-height: 0; flex: 1 1 auto; }
  .level-sign { min-width: 125px; padding: 5px 9px 6px; }
  .level-sign strong { font-size: 13px; }
  .level-sign small { font-size: 8px; }
  .finish-sign { right: 12px; padding: 5px 8px; min-width: 55px; }
  .finish-sign span { font-size: 15px; }
  .question-box { left: 8%; top: 3%; width: 84%; min-height: 74px; padding: 22px 8px 8px; border-width: 3px; }
  .question-counter { top: 5px; left: 8px; font-size: 8px; }
  .question-content { gap: 5px; min-height: 40px; }
  .question-illustration { width: 49px; height: 38px; }
  .question-box h2 { font-size: clamp(13px, 3.8cqw, 19px); }
  .answer-pad { width: 34%; height: 13%; min-height: 49px; }
  .route-platform { width: 34%; height: 13%; }
  .pad-a { left: 22%; top: 52%; }
  .pad-b { left: 50%; top: 39%; }
  .pad-c { left: 78%; top: 52%; }
  .answer-letter { left: 14%; top: 32%; font-size: clamp(11px, 3.1cqw, 17px); }
  .answer-text { left: 29%; top: 32%; font-size: clamp(12px, 3.7cqw, 19px); }
  .answer-symbol { right: 7%; top: 25%; font-size: 18px; }
  .home-platform { left: 18%; width: 30%; height: 10%; top: 87%; }
  .home-platform span { font-size: 9px; }
  .frog { width: 18%; height: 16%; top: 82%; }
  .game-controls { left: 7px; right: 7px; bottom: 6px; }
  .countdown { width: 42px; height: 42px; }
  .countdown > span { font-size: 15px; }
  .elapsed { padding: 5px 9px; font-size: 11px; border-width: 2px; }
  .icon-button { width: 34px; height: 34px; border-radius: 9px; font-size: 18px; }
  .feedback { bottom: 16%; min-width: 0; max-width: 90%; padding: 7px 12px; font-size: 11px; }
  .start-screen, .result-screen { justify-content: flex-start; overflow-y: auto; padding: 12px 10px 20px; }
  .start-mascot { width: 70px; height: 54px; }
  .start-screen h2 { font-size: 18px; }
  .start-intro { max-width: 310px; margin: 5px 0 7px; font-size: 10px; }
  .level-picker { gap: 5px; margin-bottom: 9px; }
  .subject-picker { grid-template-columns: repeat(2, 1fr); }
  .level-option { min-height: 62px; padding: 4px 3px; border-radius: 10px; }
  .level-icon { width: 32px; height: 22px; margin-bottom: 1px; }
  .level-option strong { font-size: 11px; }
  .level-option small { font-size: 8px; }
  .player-name-card { width: min(270px, 90%); margin-bottom: 9px; }
  .player-name-label { font-size: 11px; }
  .player-name-input { height: 34px; font-size: 12px; }
  .start-button { min-height: 37px; font-size: 13px; }
  .start-details { margin-top: 6px; font-size: 9px; }
  .result-screen h2 { font-size: 34px; }
  .result-message { font-size: 12px; }
  .result-stats { gap: 4px; margin-bottom: 9px; }
  .result-stats > div { min-width: 74px; }
  .result-stats span { font-size: 8px; }
  .result-stats b { font-size: 21px; }
  .result-actions { flex-direction: column; width: 100%; gap: 7px; }
  .result-actions button { width: min(240px, 85%); min-height: 38px; font-size: 13px; }
  .game-footer { padding-top: 4px; font-size: 9px; }
  dialog { width: calc(100% - 16px); padding: 16px 13px; }
  .dialog-heading h2 { font-size: 19px; }
  .instructions { padding-left: 19px; font-size: 13px; }
  .report-item { flex-direction: column; gap: 8px; }
  .report-illustration { width: 100%; height: 68px; }
  .report-summary-card { gap: 8px; }
  .report-summary-card > div:not(.report-summary-badge) { min-width: 70px; }
  .report-summary-badge { margin-left: 0; }
}

@media (max-height: 540px) and (orientation: landscape) {
  .site-header { height: 42px; }
  .page { min-height: calc(100dvh - 42px); padding: 4px 7px; }
  .hud { min-height: 42px; }
  .pond { min-height: 0; }
  .question-box { top: 3%; min-height: 62px; padding-top: 19px; }
  .answer-pad { height: 16%; }
  .game-footer { display: none; }
}

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