:root{color-scheme:light;--bg:#eff6f4;--surface:#fff;--surface-soft:#f6f9f8;--surface-hover:#f0f7f3;--ink:#213b3f;--muted:#667b7b;--faint:#8da09f;--line:#dde9e4;--teal:#317f73;--teal-strong:#246b63;--teal-light:#e8f4ee;--blue:#527ba4;--blue-light:#eaf1f8;--amber:#a57531;--amber-light:#fff6e9;--rose:#a95251;--rose-light:#fdf0ec;--shadow:0 17px 44px rgba(38,75,67,.06);--corner:18px;--max:1110px;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;font-synthesis:none}
[data-theme="dark"]{color-scheme:dark;--bg:#122526;--surface:#1a3031;--surface-soft:#203839;--surface-hover:#274443;--ink:#e9f1ed;--muted:#b1c7c1;--faint:#8daaa3;--line:#35514e;--teal:#7dccb4;--teal-strong:#a0e0c9;--teal-light:#25423b;--blue:#99bddd;--blue-light:#253c4e;--amber:#e8c488;--amber-light:#463e30;--rose:#edaaa5;--rose-light:#503834;--shadow:0 17px 44px rgba(0,0,0,.16)}
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--ink)}button,input,select{font:inherit}button{cursor:pointer}a{color:inherit}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #7bbaaf;outline-offset:3px}button:disabled{cursor:not-allowed;opacity:.45}h1,h2,h3,p{margin:0}h1,h2,h3{letter-spacing:-.035em}p{line-height:1.55}.app-shell{max-width:var(--max);padding:0 27px;margin:0 auto;min-height:100dvh;display:flex;flex-direction:column}.site-header{min-height:80px;display:flex;align-items:center;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line)}.brand{display:inline-flex;align-items:center;gap:11px;text-decoration:none}.brand-mark{width:37px;height:37px;position:relative;background:#276a66;border-radius:12px;display:grid;place-items:center;overflow:hidden}.mark-orbit{width:18px;height:18px;border:2px solid #e1f2e8;border-radius:50%;transform:rotate(-28deg) scaleX(.65);position:absolute}.mark-orbit:after{content:"";width:16px;height:16px;position:absolute;top:-1px;left:-2px;border:2px solid #e1f2e8;border-radius:50%;transform:rotate(65deg)}.mark-core{width:7px;height:7px;background:#d2f1dc;border-radius:50%;z-index:1}.brand-copy{display:flex;flex-direction:column;line-height:1.1}.brand-copy strong{font-size:20px;letter-spacing:-.07em;font-weight:800}.brand-copy span{font-size:10px;letter-spacing:.19em;font-weight:750;color:var(--teal);margin-top:4px}.header-actions{display:flex;align-items:center;gap:9px}.icon-button,.quiet-button,.text-button,.footer-link{border:0;background:transparent;color:var(--muted);border-radius:10px;display:inline-flex;align-items:center;justify-content:center;gap:8px}.icon-button{width:39px;height:39px;font-size:20px}.icon-button:hover,.quiet-button:hover,.text-button:hover,.footer-link:hover{background:var(--surface-hover);color:var(--ink)}.quiet-button{padding:9px 12px;font-size:13px;font-weight:650}.quiet-button svg,.icon-button svg{width:19px;height:19px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.main-content{flex:1;display:flex;min-height:0;flex-direction:column}.screen{flex:1}.screen[hidden],*[hidden]{display:none!important}.setup-grid{display:grid;grid-template-columns:minmax(300px,.85fr) minmax(400px,1fr);gap:40px;align-items:center;padding:18px 0 10px;min-height:570px}.hero-pane{align-self:stretch;display:flex;flex-direction:column;justify-content:center;padding:26px 18px 38px 13px}.eyebrow,.little-label{font-size:10px;font-weight:800;letter-spacing:.145em;color:var(--muted)}.eyebrow{display:inline-flex;align-items:center;gap:8px;color:var(--teal);margin-bottom:19px}.eyebrow-dot{height:7px;width:7px;background:#78bfa9;border-radius:50%}.hero-pane h1{font-size:clamp(63px,6.5vw,92px);font-weight:790;line-height:.97;letter-spacing:-.075em;margin-bottom:20px}.hero-pane h1 em{color:var(--teal);font-style:normal}.hero-pane>p{font-size:17px;color:var(--muted);max-width:340px}.hero-detail{display:flex;align-items:center;gap:12px;margin:31px 0 41px}.hero-detail span{padding:13px 13px;background:var(--surface);border:1px solid var(--line);color:var(--teal);border-radius:11px;font-weight:680;box-shadow:var(--shadow)}.hero-detail span:nth-child(2){transform:translateY(8px);color:var(--blue)}.hero-detail span:nth-child(3){font-size:14px}.best-summary{border-top:1px solid var(--line);max-width:275px;padding-top:22px;display:flex;flex-direction:column;gap:5px}.best-summary strong{font-size:42px;line-height:1.15;letter-spacing:-.04em}.subtle{font-size:12px;color:var(--muted)}.setup-card,.question-card,.results-card,.progress-card{background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:var(--corner)}.setup-card{padding:26px 28px 25px;display:flex;flex-direction:column;gap:18px}.section-top h2{font-size:23px;font-weight:740;margin:5px 0 0}.mode-options{border:0;margin:0;padding:0;display:grid;grid-template-columns:1fr 1fr;gap:10px}.mode-choice{display:flex;align-items:flex-start;gap:11px;background:var(--surface-soft);border:1px solid var(--line);border-radius:13px;padding:13px 11px;cursor:pointer;min-height:91px;transition:border-color .15s,background .15s}.mode-choice:hover{background:var(--surface-hover)}.mode-choice.selected{border-color:var(--teal);background:var(--teal-light)}.mode-choice input{position:absolute;opacity:0;pointer-events:none}.mode-choice:has(input:focus-visible){outline:3px solid #7bbaaf;outline-offset:2px}.mode-symbol{height:29px;width:29px;display:inline-grid;place-items:center;flex-shrink:0;font-size:21px;color:var(--teal);font-weight:700}.mode-choice strong{display:block;font-size:13px;font-weight:730}.mode-choice small{display:block;font-size:11px;color:var(--muted);line-height:1.35;margin-top:5px}.field-set{display:grid;gap:9px}.field-title{font-size:13px;font-weight:720;display:flex;justify-content:space-between;align-items:center;gap:12px}.field-note{color:var(--faint);font-size:11px;font-weight:500}.option-row{display:flex;flex-wrap:wrap;gap:8px}.choice-pill{display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:10px;background:var(--surface);padding:9px 11px;font-weight:620;font-size:12px;cursor:pointer}.choice-pill:has(input:checked){background:var(--teal-light);border-color:var(--teal);color:var(--ink)}.choice-pill input{accent-color:var(--teal-strong);margin:0;height:14px;width:14px}.choice-pill:has(input:focus-visible){outline:2px solid var(--teal);outline-offset:2px}.select-wrap select{border:1px solid var(--line);background:var(--surface-soft);color:var(--ink);width:100%;padding:11px 13px;border-radius:10px;font-size:13px;cursor:pointer}.segmented{background:var(--surface-soft);border:1px solid var(--line);padding:4px;border-radius:10px;display:flex;gap:4px}.segmented label{flex:1;display:flex}.segmented input{position:absolute;opacity:0}.segmented span,.segmented button{flex:1;text-align:center;border:0;border-radius:7px;color:var(--muted);font-size:12px;font-weight:630;padding:8px 12px;background:transparent;cursor:pointer}.segmented label:has(input:checked) span,.segmented button[aria-selected="true"]{background:var(--surface);color:var(--ink);box-shadow:0 1px 4px rgba(0,0,0,.07)}.segmented label:has(input:focus-visible) span{outline:3px solid #7bbaaf}.primary-button,.secondary-button{border:1px solid transparent;border-radius:10px;font-size:13px;font-weight:760;padding:12px 18px;display:inline-flex;align-items:center;justify-content:center;gap:12px;transition:transform .1s,background .14s}.primary-button{background:var(--teal-strong);color:#fff}.primary-button:hover:not(:disabled){background:#1d5752;transform:translateY(-1px)}[data-theme="dark"] .primary-button{background:#6fb9a8;color:#102f2c}[data-theme="dark"] .primary-button:hover{background:#8dd2bc}.secondary-button{background:var(--surface-soft);color:var(--ink);border-color:var(--line)}.secondary-button:hover{background:var(--surface-hover)}.start-button{width:100%;justify-content:space-between;font-size:14px;padding:15px 17px;margin-top:0}.form-alert{font-size:12px;color:var(--rose);background:var(--rose-light);padding:9px 11px;border-radius:8px}.under-setup{display:flex;justify-content:space-between;gap:15px;padding:8px 0 26px;color:var(--faint);font-size:11px}.site-footer{display:flex;gap:10px;align-items:center;justify-content:center;min-height:48px;border-top:1px solid var(--line);color:var(--faint);font-size:10px;font-weight:660;letter-spacing:.055em;flex-wrap:wrap}.site-footer a{margin-left:auto;text-decoration:none;font-weight:600;letter-spacing:normal}.site-footer a:hover{text-decoration:underline}.footer-link{font-size:11px;letter-spacing:0;font-weight:700;padding:5px 8px}.footer-dash{color:var(--line)}
/* Gameplay */
.game-screen{max-width:805px;width:100%;margin:0 auto;display:flex;flex-direction:column;justify-content:center;gap:16px;padding:22px 0 28px}.game-top{display:flex;gap:10px;align-items:center;justify-content:space-between;color:var(--muted);font-size:11px}.game-status{font-size:10px;font-weight:780;letter-spacing:.085em;color:var(--teal);text-align:center}.status-sep{padding:0 7px;color:var(--faint)}.question-counter{white-space:nowrap}.text-button{padding:9px 10px;font-size:12px;font-weight:640}.score-row{display:flex;align-items:stretch;gap:25px;padding:6px 6px 2px}.score-box{display:flex;flex-direction:column;gap:2px;min-width:104px}.score-box strong{font-size:39px;line-height:1.1;letter-spacing:-.055em}.secondary-score strong{color:var(--teal)}.right-score{margin-left:auto;text-align:right}.right-score strong{font-size:32px}.seconds-suffix{font-size:16px;margin-left:2px}.timer-track{height:5px;background:var(--line);border-radius:99px;overflow:hidden;flex-shrink:0}.timer-track span{height:100%;width:100%;display:block;background:var(--teal);transition:background .2s}.timer-track.is-low span{background:#b47c45}.question-card{padding:27px 32px 24px;display:flex;flex-direction:column;gap:17px;min-height:377px}.question-meta{display:flex;justify-content:space-between;align-items:center;gap:12px}.topic-chip{display:inline-flex;padding:6px 9px;font-weight:800;letter-spacing:.07em;font-size:10px;border-radius:6px;background:var(--teal-light);color:var(--teal-strong)}.topic-chip.covalent{background:var(--blue-light);color:var(--blue)}.question-kind{color:var(--faint);font-size:11px}.question-body{text-align:center;padding:15px 0 16px}.question-instruction{font-size:12px;color:var(--muted);font-weight:650}.question-body h2{font-size:clamp(27px,4.5vw,46px);letter-spacing:-.048em;font-weight:750;line-height:1.24;margin-top:14px;overflow-wrap:anywhere}.question-body h2.is-name{font-size:clamp(23px,3.2vw,33px)}#answer-form{display:grid;gap:9px}#answer-form>label{font-size:12px;font-weight:700}.answer-line{display:flex;gap:9px}#answer-input{flex:1;min-width:0;outline:0;background:var(--surface-soft);color:var(--ink);border:1px solid var(--line);border-radius:10px;padding:13px 14px;font-size:16px;font-weight:550;letter-spacing:.01em}#answer-input:focus{border-color:var(--teal);box-shadow:0 0 0 3px var(--teal-light)}#answer-input::placeholder{color:var(--faint);font-weight:450}.submit-button{min-width:112px;font-size:13px}.feedback{border:1px solid var(--line);padding:15px 17px;border-radius:11px;background:var(--amber-light);font-size:13px;line-height:1.48}.feedback.is-success{background:var(--teal-light)}.feedback.is-error{background:var(--rose-light)}.feedback-heading{display:flex;align-items:center;gap:8px;margin-bottom:5px}.feedback-heading span{display:inline-grid;place-items:center;background:rgba(80,79,64,.12);border-radius:50%;height:21px;width:21px;font-size:13px}.feedback-detail{color:var(--muted);font-size:12px;margin-top:8px}.card-actions{display:flex;align-items:center;gap:6px;justify-content:flex-start;flex-wrap:wrap}.card-actions>.next-button{margin-left:auto}.game-bottom{display:flex;justify-content:space-between;gap:12px;font-size:11px;color:var(--faint)}.results-screen,.progress-screen{display:flex;align-items:center;justify-content:center;padding:30px 0}.results-card,.progress-card{max-width:705px;width:100%;padding:33px 40px}.results-card h1,.progress-card h1{font-size:clamp(33px,5vw,47px);letter-spacing:-.06em}.results-card>p,.progress-card>p{color:var(--muted);font-size:14px;margin:8px 0 18px}.results-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin:19px 0}.result-stat{padding:15px;border:1px solid var(--line);background:var(--surface-soft);border-radius:11px}.result-stat strong{display:block;font-size:32px;line-height:1.25}.result-stat span{font-size:11px;color:var(--muted)}.results-error{background:var(--surface-soft);border:1px solid var(--line);border-radius:11px;padding:19px 21px;margin:15px 0 20px}.results-error h2{font-size:25px;margin:8px 0}.results-error #results-answer{font-size:13px;margin:8px 0;color:var(--muted)}.results-error h3{font-size:13px;margin:15px 0 6px}.results-error #results-why{font-size:13px;color:var(--muted)}.results-buttons{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.progress-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:20px 0}.progress-details .result-stat strong{font-size:29px}.progress-actions{display:flex;gap:12px;align-items:center;flex-wrap:wrap}.danger-text{color:var(--rose)}
/* Reference / dialogs */
dialog{border:0;padding:0;background:transparent;color:var(--ink);max-height:calc(100dvh - 20px)}dialog::backdrop{background:rgba(14,32,33,.5);backdrop-filter:blur(3px)}.reference-dialog{position:fixed;top:0;bottom:0;right:0;left:auto;margin:0;max-height:100dvh;height:100dvh;max-width:min(510px,100vw);width:min(510px,100vw);background:var(--surface);border-left:1px solid var(--line);box-shadow:-18px 0 60px rgba(0,0,0,.13)}.dialog-shell{height:100%;display:flex;flex-direction:column;padding:24px 25px;gap:17px}.dialog-header{display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.dialog-header .eyebrow{font-size:9px;margin:0 0 7px}.dialog-header h2{font-size:28px}.reference-tools{display:flex;gap:9px;align-items:center}.reference-tools .segmented{flex:1}.reference-tools .segmented button{white-space:nowrap;padding:10px 8px}.reference-tools input{width:45%;min-width:0;border:1px solid var(--line);border-radius:9px;color:var(--ink);background:var(--surface-soft);padding:10px;font-size:12px}.ion-list{flex:1;min-height:0;overflow:auto;border:1px solid var(--line);border-radius:12px}.ion-row{display:grid;grid-template-columns:minmax(0,1fr) 95px 55px;gap:10px;align-items:center;width:100%;padding:11px 13px;border:0;border-bottom:1px solid var(--line);background:var(--surface);text-align:left;color:var(--ink);font-size:13px}.ion-row:last-child{border-bottom:0}.ion-row:hover,.ion-row.selected{background:var(--teal-light)}.ion-row span:nth-child(2){font-weight:720;white-space:nowrap}.ion-row span:nth-child(3){text-align:right;color:var(--muted);font-size:12px}.ion-empty{padding:20px;color:var(--muted);font-size:13px}.ion-detail{border-radius:11px;background:var(--surface-soft);padding:12px 15px;color:var(--muted);font-size:12px;min-height:54px}.ion-detail strong{color:var(--ink)}.dialog-bottom{border-top:1px solid var(--line);padding-top:13px;display:flex;gap:12px;align-items:center;justify-content:space-between;font-size:10px;color:var(--faint)}.dialog-bottom a{color:var(--teal);font-weight:700;text-decoration:none;white-space:nowrap}.confirm-dialog{max-width:min(420px,calc(100vw - 25px));width:100%;border-radius:18px;background:var(--surface);padding:0;box-shadow:var(--shadow)}.confirm-card{padding:28px}.confirm-card h2{font-size:23px}.confirm-card p{color:var(--muted);font-size:13px;margin:12px 0 21px}.confirm-actions{display:flex;justify-content:flex-end;gap:10px}.visually-hidden{position:absolute!important;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.no-js{position:fixed;inset:20%;display:grid;place-items:center;background:white;color:#222;padding:20px;border-radius:15px}
@media(max-width:800px){.app-shell{padding:0 17px}.site-header{min-height:68px}.setup-grid{grid-template-columns:1fr;gap:12px;min-height:0;padding-top:16px}.hero-pane{padding:13px 5px 8px}.hero-pane h1{font-size:55px;margin:8px 0}.hero-pane>p{font-size:14px}.hero-detail{display:none}.best-summary{display:none}.setup-card{padding:19px;gap:16px}.under-setup{padding:12px 0 21px}.game-screen{padding-top:18px;justify-content:flex-start}.question-card{padding:23px 19px}.results-card,.progress-card{padding:25px}.site-footer{gap:5px}.site-footer a{margin-left:0}}
@media(max-width:480px){.app-shell{padding:0 12px}.brand-copy strong{font-size:18px}.brand-copy span{font-size:9px}.header-actions{gap:2px}.quiet-button{padding:7px}.quiet-button span{display:none}.icon-button{width:34px;height:36px}.hero-pane{padding:14px 3px 3px}.eyebrow{margin-bottom:9px}.hero-pane h1{font-size:51px;margin:5px 0 9px}.setup-card{padding:18px 14px;gap:14px}.section-top h2{font-size:21px}.mode-choice{padding:10px 7px;gap:3px;min-height:82px}.mode-symbol{width:25px;font-size:20px}.mode-choice strong{font-size:12px}.mode-choice small{font-size:10px}.choice-pill{padding:8px;font-size:11px}.option-row.levels{gap:5px}.option-row.levels .choice-pill{font-size:10px;padding:8px 5px;gap:5px}.under-setup{font-size:10px;flex-direction:column;align-items:center;gap:2px}.site-footer{font-size:9px}.game-top{flex-wrap:wrap}.game-top .game-status{order:3;width:100%;text-align:center}.score-row{gap:13px}.score-box{min-width:85px}.score-box strong{font-size:34px}.right-score strong{font-size:28px}.question-card{padding:18px 14px;min-height:0;gap:13px}.question-body{padding:12px 0}.question-body h2{font-size:32px}.question-body h2.is-name{font-size:26px}.answer-line{flex-direction:column}.answer-line input{min-height:49px}.submit-button{min-height:44px}.formula-toolbar>span{width:100%}.key-button{min-width:29px;padding:6px 7px}.card-actions{gap:0}.card-actions>.next-button{width:100%;margin:7px 0 0}.game-bottom{flex-direction:column;gap:2px;text-align:center}.results-card,.progress-card{padding:22px 17px}.results-stats{gap:5px}.result-stat{padding:11px 8px}.result-stat strong{font-size:26px}.reference-dialog{width:100vw;max-width:100vw}.dialog-shell{padding:18px 13px;gap:12px}.ion-row{grid-template-columns:minmax(0,1fr) 90px 40px;padding:11px 9px;font-size:12px}.reference-tools{flex-wrap:wrap}.reference-tools .segmented,.reference-tools input{width:100%;flex:1 0 100%}.dialog-bottom{font-size:9px;align-items:flex-start;flex-direction:column;gap:5px}}
@media(max-height:720px) and (min-width:801px){.setup-grid{min-height:0;padding:17px 0 12px}.hero-pane{padding:10px}.setup-card{padding:19px 23px;gap:12px}.mode-choice{min-height:75px}.game-screen{gap:11px;padding:10px 0}.question-card{gap:12px;padding:17px 24px;min-height:0}.question-body{padding:4px 0}.results-screen,.progress-screen{padding:15px 0}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
/* v1.1.0: quiet, screen-fitting layout. Main page never scrolls; only long
   reference/explanations/revision lists may scroll inside their own panels. */
html,body{width:100%;height:100%;overflow:hidden;scroll-behavior:auto}
.app-shell{height:100dvh;min-height:0;max-height:100dvh;overflow:hidden}
.site-header{height:62px;min-height:62px;flex-shrink:0}
.site-footer{min-height:30px;height:30px;flex-shrink:0}
.main-content,.screen{min-height:0;min-width:0}
#setup-screen{display:flex;flex-direction:column;overflow:hidden}
.setup-grid{flex:1;min-height:0;min-width:0;height:100%;padding:9px 0 6px;gap:22px;grid-template-columns:minmax(0,.85fr) minmax(0,1fr)}
.hero-pane{min-height:0;padding:12px;justify-content:center}
.hero-pane h1{font-size:clamp(42px,5.2vw,69px);margin-bottom:12px}
.hero-pane>p{font-size:14px}
.hero-detail{margin:22px 0 25px}
.best-summary{max-width:390px;padding-top:13px;gap:7px}
.best-bands{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;width:100%}
.best-bands>div{border:1px solid var(--line);border-radius:10px;padding:9px;background:var(--surface);display:flex;flex-direction:column;gap:2px;min-width:0}
.best-bands strong{font-size:clamp(22px,3vw,32px);line-height:1.1;color:var(--teal)}
.best-bands span{font-size:10px;color:var(--muted);font-weight:660;white-space:nowrap}
.setup-card{min-height:0;max-height:100%;overflow-y:auto;overscroll-behavior:contain;padding:clamp(12px,2.2vh,21px) clamp(14px,2vw,24px);gap:clamp(7px,1.35vh,13px)}
.mode-choice{min-height:67px;padding:9px}
.mode-choice small{margin-top:2px}
.section-top h2{font-size:21px}
.field-set{gap:5px}
.field-title{font-size:12px}
.choice-pill{padding:7px 10px}
.select-wrap select{padding:8px 11px}
.segmented span{padding:6px}
.start-button{padding:11px 15px}
.under-setup{padding:4px 0 6px;flex-shrink:0;font-size:10px}
.game-screen{height:100%;min-height:0;max-width:850px;justify-content:center;gap:clamp(6px,1.3vh,12px);padding:clamp(6px,1.5vh,13px) 0;overflow-y:auto;overscroll-behavior:contain}
.game-top{flex-shrink:0}
.score-row{flex-shrink:0;padding:0 5px;gap:16px}
.score-box strong{font-size:clamp(27px,4.3vh,38px)}
.right-score strong{font-size:clamp(25px,4vh,31px)}
.timer-track{flex-shrink:0}
.question-card{min-height:0;padding:clamp(13px,2.4vh,23px) clamp(14px,3vw,27px);gap:clamp(8px,1.6vh,14px);overflow-y:auto;overscroll-behavior:contain;flex-shrink:1}
.question-body{padding:clamp(4px,1.5vh,12px) 0}
.question-body h2{margin-top:9px;font-size:clamp(25px,4vw,43px)}
.question-body h2.is-name{font-size:clamp(21px,3.1vw,31px)}
#answer-form{gap:5px}
#answer-input{padding:11px 13px}
.submit-button{min-width:94px}
.feedback{padding:10px 13px;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.feedback-detail{margin-top:4px}
.card-actions{min-height:31px}
.game-bottom{flex-shrink:0}
.results-screen,.progress-screen{min-height:0;padding:9px 0}
.results-card,.progress-card{padding:clamp(14px,3vh,27px);max-height:100%;min-height:0;overflow-y:auto;overscroll-behavior:contain}
.results-card h1,.progress-card h1{font-size:clamp(27px,4vw,40px)}
.results-card>p,.progress-card>p{margin:5px 0 11px}
.results-stats{margin:12px 0}
.result-stat{padding:10px 12px}
.result-stat strong{font-size:27px}
.results-error{padding:12px 14px;margin:10px 0}
.results-error h2{font-size:22px;margin:4px 0}
.results-error h3{margin:7px 0 3px}
.progress-card{width:100%;max-width:850px;display:flex;flex-direction:column;overflow:hidden;gap:10px}
.progress-title-row{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-shrink:0}
.progress-title-row .eyebrow{margin-bottom:5px}
.progress-title-row p{font-size:12px;color:var(--muted);margin:2px 0 0}
.progress-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:15px;flex:1;min-height:0;overflow:hidden}
.progress-column,.focus-column{min-width:0;min-height:0;display:flex;flex-direction:column}
.little-heading{font-size:12px;font-weight:800;letter-spacing:.01em;margin:0 0 7px}
.progress-details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin:0;overflow-y:auto;min-height:0}
.progress-details .result-stat{padding:9px 11px}
.progress-details .result-stat strong{font-size:26px}
.progress-details .result-stat span{font-size:11px}
.focus-description{font-size:11px;color:var(--muted);line-height:1.35;margin:0 0 7px}
.focus-review{display:grid;grid-template-columns:1fr;gap:6px;overflow-y:auto;min-height:0;padding:1px 3px 4px 1px}
.focus-button{display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--surface-soft);border:1px solid var(--line);color:var(--ink);border-radius:9px;padding:9px 10px;text-align:left;font-size:12px;font-weight:690;min-height:39px;flex-shrink:0}
.focus-button:not(:disabled):hover{background:var(--teal-light);border-color:var(--teal)}
.focus-button span:last-child{color:var(--muted);font-size:10px;font-weight:540;text-align:right}
.focus-button:disabled{opacity:.62}
.progress-actions{flex-shrink:0;justify-content:space-between}
/* Responsive setup: show the best-score bands, not a tall decorative hero. */
@media(max-width:800px){
 .site-header{height:54px;min-height:54px}
 .app-shell{padding:0 12px}
 .setup-grid{grid-template-columns:1fr;grid-template-rows:auto minmax(0,1fr);align-content:stretch;gap:4px;padding:4px 0}
 .hero-pane{padding:0;display:block}
 .hero-pane .eyebrow,.hero-pane h1,.hero-pane>p,.hero-detail{display:none}
 .best-summary{display:flex;max-width:none;padding:0;border:0;gap:3px}
 .best-summary>.little-label{font-size:9px}
 .best-bands{gap:5px}
 .best-bands>div{padding:5px 7px;flex-direction:row;justify-content:center;align-items:baseline;gap:5px}
 .best-bands strong{font-size:19px}
 .best-bands span{font-size:10px}
 .best-summary>.subtle{display:none}
 .setup-card{padding:11px 13px;gap:7px}
 .section-top h2{font-size:17px;margin:1px 0 0}
 .section-top .little-label{font-size:9px}
 .mode-choice{min-height:55px;padding:7px}
 .mode-symbol{font-size:19px;width:22px;height:23px}
 .mode-choice strong{font-size:12px}
 .mode-choice small{font-size:10px;margin-top:1px}
 .field-title{font-size:11px}
 .field-note{font-size:10px}
 .choice-pill{padding:5px 8px;font-size:11px}
 .select-wrap select{padding:7px 11px}
 .segmented span{padding:5px}
 .start-button{padding:9px 11px}
 .under-setup{padding:0 0 3px;gap:5px}
 .game-screen{justify-content:center;padding:5px 0;gap:8px}
 .question-card{padding:14px 15px;gap:8px}
 .question-body{padding:5px 0}
 .question-body h2{font-size:31px}
 .question-body h2.is-name{font-size:24px}
 .results-card,.progress-card{padding:16px}
 .site-footer{height:25px;min-height:25px}
}
@media(max-width:480px){
 .brand-copy strong{font-size:17px}
 .brand-copy span{font-size:8px}
 .site-header{height:48px;min-height:48px}
 .site-footer{height:24px;min-height:24px;gap:4px}
 .site-footer a{display:none}
 .under-setup span:last-child{display:none}
 .under-setup{font-size:9px}
 .setup-card{padding:9px 10px;gap:5px}
 .mode-options{gap:6px}
 .mode-choice{min-height:52px;padding:6px 5px;gap:4px}
 .mode-choice small{font-size:9px}
 .field-set{gap:4px}
 .option-row.levels{gap:4px}
 .option-row.levels .choice-pill{padding:6px 5px;font-size:10px;gap:3px}
 .choice-pill input{height:13px;width:13px}
 .best-bands>div{padding:4px 3px;gap:3px}
 .best-bands strong{font-size:17px}
 .best-bands span{font-size:9px}
 .game-top{gap:2px;flex-wrap:nowrap;font-size:10px}
 .game-top .game-status{order:0;width:auto;flex:1}
 .game-top .question-counter{font-size:10px}
 .game-top .text-button{font-size:10px;padding:5px 2px}
 .score-row{gap:8px;padding:0 3px}
 .score-box{min-width:0}
 .score-box strong{font-size:28px}
 .score-box .little-label{font-size:8px;letter-spacing:.07em}
 .right-score strong{font-size:26px}
 .question-card{padding:10px 12px;gap:7px}
 .question-meta{gap:6px}
 .topic-chip{font-size:9px;padding:5px}
 .question-kind{font-size:10px}
 .question-body{padding:2px 0}
 .question-instruction{font-size:11px}
 .question-body h2{font-size:28px;margin-top:5px}
 .question-body h2.is-name{font-size:22px}
 .answer-line{flex-direction:row;gap:6px}
 #answer-input{min-height:43px;padding:9px 10px;font-size:16px}
 .submit-button{min-height:43px;min-width:79px;padding:9px 8px;font-size:12px}
 #answer-form>label{font-size:11px}
 .feedback{padding:9px 10px;font-size:11px}
 .feedback-detail{font-size:11px}
 .card-actions{justify-content:space-between}
 .card-actions .text-button{font-size:11px;padding:7px 5px}
 .card-actions>.next-button{width:auto;margin:0}
 .game-bottom{gap:4px;flex-direction:row;font-size:9px;text-align:left}
 .results-card,.progress-card{padding:11px}
 .results-card h1,.progress-card h1{font-size:29px}
 .results-stats{gap:5px;margin:9px 0}
 .results-error{padding:9px 10px;margin:7px 0}
 .results-error h2{font-size:20px}
 .results-error #results-answer,.results-error #results-why{font-size:12px}
 .progress-layout{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:10px}
 .progress-details{grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;overflow:visible}
 .progress-details .result-stat{padding:6px}
 .progress-details .result-stat strong{font-size:19px}
 .progress-details .result-stat span{font-size:9px;line-height:1.1;display:block}
 .focus-description{font-size:10px;margin-bottom:5px}
 .focus-button{min-height:36px;padding:6px 8px}
 .progress-actions .primary-button{padding:9px 10px;font-size:11px}
 .progress-actions .text-button{font-size:10px}
}
@media(max-height:690px){
 .site-header{min-height:46px;height:46px}
 .site-footer{min-height:22px;height:22px}
 .setup-grid{gap:3px;padding:2px 0}
 .setup-card{padding:8px 10px;gap:5px}
 .mode-choice{min-height:48px}
 .hero-detail{display:none}
 .question-card{padding-top:9px;padding-bottom:9px;gap:5px}
 .question-body{padding:0}
 .game-screen{gap:5px}
 .game-bottom{display:none}
 .question-body h2{margin-top:3px}
 .progress-card{gap:5px}
}
@media(max-height:480px) and (orientation:landscape){
 .site-header{height:39px;min-height:39px}
 .site-footer{display:flex;height:22px;min-height:22px}
 .game-screen{justify-content:flex-start}
 .game-top,.score-row{flex-shrink:0}
 .question-card{overflow-y:auto}
 .setup-grid{grid-template-columns:minmax(110px,.28fr) minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
 .hero-pane{display:flex;justify-content:center}
 .best-summary>.little-label{display:none}
 .best-bands{grid-template-columns:1fr}
 .setup-card{overflow-y:auto}
}
/* Prevent grid's intrinsic input width from pushing the answer line beyond the card. */
#answer-form,.answer-line{min-width:0;width:100%;max-width:100%}
#answer-input{width:0;flex:1 1 0;min-width:0}
.submit-button{flex:0 0 auto}
/* Landscape phones: keep all setup controls visible rather than creating a scroll panel. */
@media(max-height:480px) and (orientation:landscape){
 .setup-card{gap:3px;padding:5px 9px}
 .setup-card .section-top{display:none}
 .mode-choice{min-height:35px;padding:3px 6px;align-items:center}
 .mode-choice small{display:none}
 .mode-symbol{height:22px}
 .field-set{gap:2px}
 .choice-pill{padding:3px 7px}
 .select-wrap select{padding:5px 9px}
 .segmented span{padding:4px}
 .start-button{padding:6px 11px}
}
@media(max-height:480px) and (orientation:landscape){
 .hero-pane .eyebrow,.hero-pane h1,.hero-pane>p,.hero-detail{display:none!important}
 .hero-pane{padding:0 5px;justify-content:center}
 .best-summary{padding:0;border:0;gap:4px;max-width:100%}
 .best-summary>.little-label{display:none}
 .best-bands{grid-template-columns:1fr;gap:4px}
 .best-bands>div{padding:5px 8px;display:flex;flex-direction:row;align-items:center;justify-content:space-between}
 .best-bands strong{font-size:21px}
 .best-bands span{font-size:11px}
 .best-summary>.subtle{font-size:9px}
 .under-setup{display:none}
}

/* Games portal integration — compact return navigation, no changes to the game engine. */
.games-back-link{color:var(--teal-strong);text-decoration:none;white-space:nowrap;border:1px solid var(--line);background:var(--surface-soft);border-radius:9px;font-size:12px;font-weight:740;padding:9px 11px;display:inline-flex;align-items:center;gap:5px;line-height:1.2;min-height:37px}
.games-back-link:hover{background:var(--teal-light)}
@media(max-width:580px){.games-back-link{width:35px;min-width:35px;height:35px;min-height:35px;padding:0;justify-content:center;font-size:19px}.games-back-link .back-label{display:none}.header-actions{gap:5px}.header-actions .quiet-button{width:36px;height:36px;padding:8px}.header-actions .quiet-button span{display:none}.header-actions .icon-button{width:36px;height:36px}.site-header{gap:5px}}
@media(max-width:365px){.brand{gap:6px}.brand-mark{width:29px;height:29px}.brand-copy strong{font-size:15px}.brand-copy span{font-size:7px}.app-shell{padding-left:11px;padding-right:11px}}
