*{box-sizing:border-box} :root{font-family:"Microsoft YaHei","PingFang SC",system-ui,sans-serif;color:#355b4e;background:#f8fbf2;font-synthesis:none}body{margin:0;min-width:320px;background:radial-gradient(ellipse at 50% 35%,#fffdf3 10%,#f4faed 72%)}button,input,select{font:inherit}button,a{-webkit-tap-highlight-color:transparent}button{cursor:pointer;touch-action:manipulation}button:disabled{cursor:default}button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible{outline:4px solid #35796c;outline-offset:5px}button{border:0}button:hover:not(:disabled){filter:brightness(1.025)}[hidden]{display:none!important}.svg-defs{position:absolute;width:0;height:0;overflow:hidden}.topbar{height:88px;max-width:1500px;margin:auto;padding:22px 48px;display:flex;align-items:center;justify-content:space-between;position:relative;z-index:2}.brand{display:flex;align-items:center;gap:10px;color:#668576;font-size:15px;font-weight:800;text-decoration:none;letter-spacing:1px}.brand-mark{display:grid;place-items:center;width:35px;height:35px;background:#dfeddb;border-radius:12px;color:#77a38a}.brand svg{width:22px;height:22px}.icon-button{height:48px;width:48px;flex-shrink:0;border-radius:18px;background:#fffdf5;border:1px solid #e1e8d9;color:#728675;display:grid;place-items:center;box-shadow:0 3px 0 #e8eddd;font-size:32px}.icon-button svg{width:24px;height:24px}.home{min-height:calc(100svh - 88px);display:flex;align-items:center;flex-direction:column;position:relative;isolation:isolate;overflow:hidden;padding:8px 24px 30px}.home-heading{text-align:center;z-index:2}.eyebrow{font-size:13px;letter-spacing:2px;color:#849780;font-weight:700;display:inline-flex;align-items:center;gap:7px}.eyebrow>span{width:7px;height:7px;border-radius:50%;background:#96c4a2}h1{font-size:clamp(44px,4.9vw,72px);letter-spacing:3px;margin:11px 0 10px;font-weight:950;color:#365b4d;line-height:1.2;position:relative}h1>span{color:#e3a246}.title-spark{color:#e8bc6b;width:24px;height:24px;position:absolute;right:-38px;top:0;transform:rotate(15deg)}.home-heading p{margin:0;color:#849384;font-size:17px;letter-spacing:1px}.play-scene{position:relative;width:min(880px,90vw);height:clamp(285px,43svh,425px);margin:4px auto 0;flex-shrink:0}.scene-orbit{position:absolute;inset:9% 8% 1%;border-radius:50%;background:radial-gradient(ellipse,#fdf0ce88 0%,#f1f6dc99 60%,#f1f6dc00 73%);border:1px dashed #dce5c6;transform:rotate(-8deg)}.scene-ground{position:absolute;bottom:1%;left:10%;right:10%;height:15%;border-radius:50%;background:#dceccc80;z-index:-1}.character{position:absolute;width:28%;bottom:7%;z-index:2}.character-mint{left:9%}.character-gold{right:9%}.robot{width:100%;height:auto;display:block;position:relative;z-index:2;animation:bob 3.8s ease-in-out infinite;filter:drop-shadow(0 8px 3px #526a3610)}.character-gold .robot{animation-delay:-1.8s}.podium{height:49px;background:#d6ebcd;border:3px solid #f5fbe9;border-radius:50%;position:relative;margin:-17px 2% 0;box-shadow:0 10px 0 #c0d9b5,0 17px 22px #52794710;display:flex;gap:13px;justify-content:center;align-items:center;z-index:3}.character-gold .podium{background:#f5e6bd;box-shadow:0 10px 0 #ead29a,0 17px 22px #52794710}.team-name{font-size:13px;letter-spacing:2px;font-weight:800;color:#72906b}.character-gold .team-name{color:#b59857}.stars{display:flex;gap:4px;color:#dba74b;font-size:21px}.stars .empty{color:#d8cfae}.stars .lit{animation:star-light 3.8s infinite}.speech-bubble{position:absolute;right:0;top:0;z-index:4;padding:11px 19px;background:#fffef9;border:1px solid #e5eddc;border-radius:22px 22px 22px 5px;box-shadow:0 6px 15px #657c4010;font-size:15px;color:#6b8873;font-weight:700;transform:rotate(-6deg)}.speech-bubble span{color:#dca74c;margin-left:6px}.character-gold .speech-bubble{right:-5%;transform:rotate(7deg);top:2%;color:#b2945e}.word-card{position:absolute;left:50%;top:16%;transform:translateX(-50%) rotate(-6deg);width:137px;padding:15px 18px 12px;text-align:center;display:flex;align-items:center;flex-direction:column;background:#fffef8;border-radius:24px;border:2px solid #ecebd5;box-shadow:0 10px 0 #eae9cf,0 18px 30px #82904b10;z-index:3;animation:card-float 5s ease-in-out infinite}.apple{width:61px;height:64px}.word-card strong{font-size:28px;letter-spacing:1px;margin:5px 0 1px}.word-card>span{font-size:14px;color:#93a087}.card-check{position:absolute;right:-13px;top:-12px;background:#99ceb2;color:white;border:4px solid #fffef6;border-radius:50%;width:36px;height:36px;font-weight:900;font-size:22px}.deco{position:absolute;color:#e8c979;width:25px;height:25px}.star-one{left:5%;top:30%;transform:rotate(13deg)}.star-two{right:8%;top:29%;width:17px}.star-three{left:44%;bottom:11%;width:18px;color:#91b6a0}.floating-letter{position:absolute;font-size:26px;font-weight:850;width:49px;height:52px;display:grid;place-items:center;border-radius:13px;opacity:.6}.letter-a{left:18%;top:5%;background:#e5eedc;color:#86b0a1;transform:rotate(-17deg)}.letter-b{right:18%;top:4%;background:#f2e9d2;color:#ceae70;transform:rotate(15deg)}.cloud{position:absolute;width:74px;height:18px;border-radius:20px;background:white;opacity:.8}.cloud:before,.cloud:after{content:"";position:absolute;background:white;border-radius:50%;width:31px;height:31px;bottom:0;left:10px}.cloud:after{width:40px;height:40px;left:27px}.cloud-one{top:20%;left:1%}.cloud-two{top:19%;right:0;transform:scale(.8)}.energy-path{position:absolute;left:41%;top:62%;display:flex;align-items:center;gap:12px;transform:rotate(-22deg);color:#e7bc63}.energy-path i{width:6px;height:6px;background:#ecd396;border-radius:50%}.energy-path svg{width:23px;height:23px;animation:star-light 3s infinite}.start-area{display:flex;flex-direction:column;align-items:center;gap:17px;z-index:5;margin-top:8px}.start-button{height:82px;min-width:320px;padding:0 48px;background:#f4bd57;border:3px solid #ffe9ab;box-shadow:0 7px 0 #d99a3b,0 13px 26px #c5a05728;border-radius:30px;color:#604e2f;font-size:29px;font-weight:900;letter-spacing:3px;display:flex;justify-content:center;align-items:center;gap:17px;transition:transform .15s,box-shadow .15s}.start-button:active{transform:translateY(5px);box-shadow:0 2px 0 #d99a3b}.start-button>svg{width:26px;height:26px}.button-star{font-size:20px;color:#fff8df;margin-left:8px}.start-note{font-size:13px;color:#98a48c;letter-spacing:2px}.grass{position:absolute;width:190px;height:90px;border-radius:50%;background:#dcebc988;bottom:-54px;z-index:-1}.grass-left{left:8%;transform:rotate(10deg)}.grass-right{right:5%;width:290px;transform:rotate(-8deg)}dialog{border:1px solid #e0e7d4;border-radius:30px;padding:30px;background:#fffef8;color:#355b4e;box-shadow:0 30px 100px #304e3933;width:min(520px,calc(100% - 32px));max-height:calc(100svh - 40px);overflow:auto}dialog::backdrop{background:#42664d44;backdrop-filter:blur(7px)}.dialog-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.dialog-heading h2{font-size:26px;margin:7px 0 0}.dialog-heading .eyebrow{font-size:11px}form>label,.name-fields label{display:flex;flex-direction:column;gap:10px;margin:17px 0;font-weight:700;font-size:14px}select,input[type=text],input:not([type]){height:50px;border:1px solid #d9e3cd;background:#f7faef;border-radius:14px;padding:0 12px;color:#456553;width:100%;min-width:0}.name-fields{display:grid;grid-template-columns:1fr 1fr;gap:14px}.name-fields label{margin:0}form>.switch-row{flex-direction:row;align-items:center;justify-content:space-between;min-height:35px}.switch-row input{width:24px;height:24px;accent-color:#58a98f}.settings-note{font-size:12px;line-height:1.9;color:#8b9781}.save-button{border-radius:18px;min-height:56px;background:#f4c263;color:#655231;font-weight:800;width:100%;font-size:18px}.soft-button{background:#eaf2df;color:#65805b;min-height:48px;padding:10px 24px;border-radius:17px;font-weight:700}.game{max-width:1100px;padding:12px 35px 30px;margin:auto}.game-toolbar{display:flex;align-items:center;justify-content:space-between;font-size:14px;color:#819079}.battle-teams{display:flex;align-items:center;justify-content:space-between;gap:20px}.battle-team{display:flex;align-items:center;flex:1;gap:15px}.battle-team>svg{height:155px;width:140px}.battle-team>div{flex:1}.battle-team h2{font-size:19px;margin:0 0 7px;overflow-wrap:anywhere}.battle-team p{font-size:13px;color:#81927d;margin:5px 0}.gold-team{text-align:right}progress{width:100%;height:15px;appearance:none;border:0;border-radius:15px;overflow:hidden;background:#e6ebda}progress::-webkit-progress-bar{background:#e6ebda;border-radius:15px}progress::-webkit-progress-value{background:#70c6a7;border-radius:15px;transition:width .3s}.gold-team progress::-webkit-progress-value{background:#efbf64}progress::-moz-progress-bar{background:#70c6a7}.versus{color:#dbc98f;font-size:25px}.question-panel{background:#fffef8;border:2px solid #e8eddc;box-shadow:0 8px 0 #e9eeda;border-radius:29px;text-align:center;padding:22px 28px}.game-status{font-size:15px;color:#889878;min-height:23px}.question-panel>h2{font-size:36px;margin:14px 0 22px;overflow-wrap:anywhere}.answers{display:grid;grid-template-columns:1fr 1fr;gap:12px}.answer-option{min-height:64px;border:2px solid #e5eacf;border-radius:19px;background:#f6f8eb;color:#526d4e;padding:12px;font-size:20px;overflow-wrap:anywhere}.answer-option:disabled{opacity:.65}.answer-option.selected{background:#e0f1df;border-color:#77b694;opacity:1}.answer-option.correct{background:#d8efdf;border-color:#61a47c;opacity:1}.answer-option.wrong{background:#fae2d6;border-color:#dcac94;opacity:1}.answer-feedback{color:#78926f;font-size:16px;margin:14px 0 0;min-height:23px}.submit{background:#f7cc7c;margin-top:12px;min-width:200px;color:#705b36}.buzz-controls{display:flex;gap:28px;margin-top:24px}.buzz{min-height:72px;border-radius:24px;flex:1;font-size:24px;font-weight:800;box-shadow:0 5px 0 #b2d9bd;color:#3a7661;background:#a3ddc4;border:2px solid #d8f2dd}.gold-buzz{background:#f5d188;border-color:#fff0c6;color:#997036;box-shadow:0 5px 0 #dbbc77}.buzz:disabled{opacity:.5}kbd{font:12px inherit;background:#ffffff66;border-radius:7px;padding:5px 10px;margin-left:8px}.result-dialog{text-align:center}.result-star{font-size:70px;color:#eabd5b}.result-dialog h2{font-size:30px}.result-dialog p{white-space:pre-line;line-height:1.8;color:#849075}.result-dialog .soft-button{margin-top:12px;width:100%}body.reduced *,body.reduced *:before,body.reduced *:after{animation:none!important;transition:none!important}@keyframes bob{0%,100%{transform:translateY(0) rotate(-1deg)}50%{transform:translateY(-8px) rotate(1deg)}}@keyframes star-light{0%,100%{opacity:.5;transform:scale(.95)}50%{opacity:1;transform:scale(1.08)}}@keyframes card-float{0%,100%{transform:translateX(-50%) rotate(-6deg) translateY(0)}50%{transform:translateX(-50%) rotate(-3deg) translateY(-7px)}}
@media(min-height:900px) and (min-width:1100px){.home{padding-top:40px}.play-scene{margin-top:12px}.start-area{margin-top:22px}}
@media(max-width:900px){.topbar{padding:18px 28px;height:78px}.home{min-height:calc(100svh - 78px)}.play-scene{width:min(800px,96vw)}.home-heading p{font-size:15px}.game{padding:6px 24px 28px}.battle-team>svg{height:125px;width:105px}.battle-team{gap:8px}.battle-team h2{font-size:17px}}
@media(orientation:portrait) and (min-height:850px){.home{justify-content:center;padding-bottom:80px}.play-scene{height:360px;margin:25px 0 18px}.home-heading h1{font-size:60px}.character{width:34%}.start-button{height:88px;min-width:340px}.game{padding-top:24px}.battle-teams{margin:25px 0}.question-panel{padding:30px}.answer-option{min-height:83px}.buzz-controls{margin-top:32px}}
@media(max-height:720px) and (min-width:700px){.topbar{height:68px;padding-top:12px;padding-bottom:12px}.home{min-height:calc(100svh - 68px);padding-top:0;padding-bottom:18px}.home-heading h1{font-size:47px;margin:7px 0}.play-scene{height:280px;width:710px}.start-button{height:65px;font-size:25px;min-width:290px}.start-area{gap:12px;margin-top:0}.battle-team>svg{height:105px;width:100px}.question-panel{padding:16px 24px}.question-panel>h2{margin:10px 0 14px;font-size:29px}.answer-option{min-height:53px}.buzz-controls{margin-top:17px}.buzz{min-height:60px}.game{padding-top:0}}
@media(max-width:600px){.topbar{padding:15px 20px}.brand{font-size:12px}.home{padding:10px 16px 32px}.home-heading h1{font-size:43px;letter-spacing:1px}.title-spark{right:-21px;width:17px}.eyebrow{font-size:11px;letter-spacing:1px}.home-heading p{font-size:13px;letter-spacing:0}.play-scene{height:290px;margin-top:10px}.character{width:39%;bottom:9%}.character-mint{left:0}.character-gold{right:0}.word-card{width:94px;top:5%;border-radius:18px;padding:10px}.apple{width:43px;height:43px}.word-card strong{font-size:21px}.word-card>span{font-size:12px}.speech-bubble{font-size:11px;top:-2%;padding:8px 12px}.character-gold .speech-bubble{right:0}.podium{height:39px;gap:5px;margin-top:-12px}.stars{font-size:15px;gap:2px}.team-name{font-size:11px}.letter-a{left:9%;top:8%;font-size:22px}.letter-b{right:8%;top:8%;font-size:22px}.energy-path{top:65%;left:42%;gap:6px}.start-button{min-width:280px;height:76px;font-size:26px}.game{padding:5px 14px 25px}.battle-team>svg{width:65px;height:90px}.battle-team h2{font-size:13px}.battle-team p{font-size:10px}.battle-teams{gap:5px}.versus{font-size:15px}.battle-team{gap:3px}.question-panel{padding:18px 12px}.question-panel>h2{font-size:28px}.answer-option{font-size:17px;min-height:58px}.buzz-controls{gap:12px}.buzz{font-size:17px;min-height:64px}.buzz kbd{display:none}.soft-button{padding:10px 16px}.game-toolbar{font-size:12px}dialog{padding:23px}.dialog-heading h2{font-size:22px}}
.access-form{width:min(440px,calc(100vw - 40px));text-align:center}.access-form>label{font-size:15px;display:block;margin:0 0 10px;color:#73856b}.access-row{display:flex;gap:8px;background:#fffdf5;padding:7px;border:2px solid #e6e6cc;border-radius:23px;box-shadow:0 5px 0 #e7e8cf}.access-row input{min-width:0;width:100%;height:51px;padding:0 15px;border:0;background:transparent;border-radius:15px;font-size:18px;color:#456553}.access-submit{flex-shrink:0;padding:0 20px;min-height:51px;border-radius:16px;background:#f4bd57;color:#604e2f;font-weight:800;font-size:16px}.access-form p{font-size:12px;color:#86947c;margin:9px 0 0;line-height:1.5}.access-form #accessError{color:#a7503c;margin:0;min-height:0}.access-form #accessError:not(:empty){margin-top:7px}.icon-button:disabled{opacity:.45;cursor:default}.access-form input[aria-invalid=true]{background:#fff0e7}@media(max-height:800px){.home:has(.access-form:not([hidden])) .play-scene{height:270px;width:min(710px,94vw)}}
@media(max-width:600px){.access-submit{padding:0 12px;font-size:14px}.access-row input{font-size:16px;padding:0 8px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
/* v0.1.2: the home and arena each occupy the available viewport. */
html,body{height:100%;overflow:hidden;overscroll-behavior:none}body{height:100dvh;display:flex;flex-direction:column}.topbar{height:68px;min-height:68px;width:100%;padding-top:10px;padding-bottom:10px;flex-shrink:0}.home{height:calc(100dvh - 68px);min-height:0;flex:1;display:grid;grid-template-rows:auto minmax(0,1fr) auto;justify-items:center;align-content:stretch;padding:8px 20px 18px;gap:6px}.home-heading h1{font-size:clamp(38px,5vw,64px);margin:5px 0}.home-heading p{font-size:15px}.home .play-scene,.home:has(.access-form:not([hidden])) .play-scene{height:100%;max-height:425px;min-height:0;width:min(880px,94vw,calc((100dvh - 310px)*2));margin:0;align-self:center}.home .character{height:94%;max-height:355px;width:29%;bottom:5%}.home .robot{height:calc(100% - 35px);width:100%;object-fit:contain}.home .podium{height:40px;margin:-5px 2% 0}.home .speech-bubble{top:0}.home .word-card{top:17%;width:clamp(90px,12vw,137px);padding:10px}.home .apple{height:clamp(35px,6vh,64px)}.home .word-card strong{font-size:clamp(21px,2.3vw,28px)}.home .start-area{margin:0;gap:10px}.home .start-button{height:68px;min-width:300px;font-size:27px}.home .grass{position:absolute}.game{width:100%;height:calc(100dvh - 68px);min-height:0;display:grid;grid-template-rows:48px minmax(78px,17%) minmax(0,1fr) 64px;gap:10px;padding:0 28px 16px}.battle-teams{margin:0;min-height:0}.battle-team{height:100%;min-width:0}.battle-team>svg{height:100%;max-height:140px;width:100px}.battle-team>div{min-width:0}.question-panel{min-height:0;padding:12px 20px;display:grid;grid-template-rows:24px minmax(38px,auto) minmax(100px,1fr) auto 48px;gap:7px;align-items:center}.question-panel>h2{font-size:clamp(24px,3.4vh,36px);margin:0;line-height:1.2}.game-status{font-size:14px;min-height:0}.answers{min-height:0;height:100%;gap:8px}.answer-option{min-height:0;padding:6px 10px;font-size:clamp(16px,2.7vh,21px);line-height:1.25}.answer-option:disabled{opacity:1}.answer-feedback{margin:0;min-height:22px;font-size:14px;line-height:1.4}.question-panel .submit{margin:0;grid-row:5;justify-self:center;min-height:44px}.buzz-controls{margin:0;gap:22px}.buzz{min-height:0;font-size:22px}.settings-dialog{width:min(640px,calc(100vw - 32px));padding:22px;max-height:calc(100dvh - 24px)}#settingsForm{display:grid;grid-template-columns:1fr 1fr;gap:12px 18px}#settingsForm>.dialog-heading,#settingsForm>.name-fields,#settingsForm>.settings-note,#settingsForm>.save-button,#settingsForm>#saveMessage{grid-column:1/-1}#settingsForm>.dialog-heading{margin:0}#settingsForm>label{margin:0}#settingsForm>.switch-row{margin:0}#settingsForm>.settings-note{margin:0}#settingsForm>#saveMessage:empty{display:none}#newLibraryButton{align-self:end;min-height:50px;font-size:14px}.library-dialog{width:min(680px,calc(100vw - 32px));padding:20px;max-height:calc(100dvh - 24px)}#libraryForm{display:flex;flex-direction:column;gap:8px}#libraryForm .dialog-heading{margin:0}#libraryForm>label{margin:0;gap:4px}#libraryName{height:42px}.library-tools{display:flex;gap:8px;align-items:center}.library-tools>*{flex:1;min-width:0;font-size:13px}.library-tools select{height:44px;padding:0 6px}.library-tools .soft-button{padding:8px;min-height:44px}.file-picker{position:relative;text-align:center;display:grid;place-items:center;cursor:pointer}.file-picker input{position:absolute;inset:0;width:100%;opacity:0;cursor:pointer}.import-help{font-size:12px;line-height:1.6;margin:0;color:#72836c}#libraryText{width:100%;height:76px;resize:none;border:1px solid #d9e3cd;border-radius:12px;padding:10px;background:#f7faef;font:14px/1.5 inherit;color:#355b4e}.preview-heading,.preview-pager{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:12px}.preview-heading button,.preview-pager button{min-height:36px;padding:6px 14px}.library-preview{height:100px;border:1px solid #e0e8d6;border-radius:12px;overflow:hidden}.library-preview>div{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:3px 12px;font-size:13px;height:25px;background:#f7faef}.library-preview>div:nth-child(even){background:#fffef8}.library-preview strong,.library-preview span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#libraryError{font-size:12px;color:#9e6347;margin:0;min-height:18px}.library-dialog .save-button{min-height:46px}
@media(orientation:portrait){.home .play-scene{max-height:500px;width:96vw}.home .character{width:34%;height:90%;max-height:350px}.home .character-mint{left:4%}.home .character-gold{right:4%}.home .word-card{top:18%}.home .start-area{padding-bottom:20px}.game{grid-template-rows:48px minmax(90px,18%) minmax(0,1fr) 72px;padding-bottom:25px}.home-heading{padding-top:15px}}
@media(max-height:680px){.home-heading .eyebrow{display:none}.home-heading h1{font-size:40px}.home .start-button{height:58px;font-size:24px}.home .play-scene,.home:has(.access-form:not([hidden])) .play-scene{width:min(720px,92vw)}.home .character{width:27%;max-height:250px}.home .word-card{top:8%;padding:6px}.home .apple{height:35px}.home .word-card strong{font-size:21px}.home .start-note{font-size:11px}.game{gap:6px;grid-template-rows:44px 72px minmax(0,1fr) 54px;padding-bottom:12px}.game-toolbar .soft-button{min-height:42px}.question-panel{padding:7px 15px;grid-template-rows:20px minmax(30px,auto) minmax(82px,1fr) auto 40px;gap:4px}.question-panel .submit{min-height:38px;padding:6px 20px}.game-status,.answer-feedback{font-size:12px}.question-panel>h2{font-size:26px}.battle-team h2{font-size:16px}.battle-team p{font-size:12px}.library-dialog{padding:14px}#libraryForm{gap:5px}#libraryForm h2{font-size:22px}#libraryText{height:56px}.library-preview{height:100px}.settings-dialog{padding:16px}#settingsForm{gap:8px 14px}#settingsForm .dialog-heading h2{font-size:23px}}
/* Keep SVG intrinsic proportions so feet remain on their podiums. */
.home .character{height:auto;max-height:none}.home .robot{height:auto;max-height:none;width:100%;aspect-ratio:300/330}
/* Five bright worlds; team colors remain stable for recognition. */
body{--world:#f4fae9;--glow:#fffdf0;--ink:#355b4e;--muted:#708568;--panel:#fffef8;--line:#dfe8cd;--soft:#e9f2dc;--accent:#f4bd57;--accentInk:#68502c;--ground:#d3e9bd;background:radial-gradient(ellipse at 50% 30%,var(--glow),var(--world));color:var(--ink)}
body[data-theme=ocean]{--world:#cceafa;--glow:#f1fcff;--ink:#28577d;--muted:#547b98;--panel:#f6fdff;--line:#badcea;--soft:#d9edf9;--accent:#77c8ee;--accentInk:#234f73;--ground:#9bd2ed}
body[data-theme=peach]{--world:#fbd7e3;--glow:#fff6ed;--ink:#864b66;--muted:#976c7c;--panel:#fff7fa;--line:#efc8d9;--soft:#fae2ec;--accent:#ee99b7;--accentInk:#733b56;--ground:#efb9d0}
body[data-theme=sunshine]{--world:#fff0af;--glow:#fffbde;--ink:#795823;--muted:#967537;--panel:#fffdf0;--line:#ead79a;--soft:#faedc1;--accent:#f6b35a;--accentInk:#734921;--ground:#edd778}
body[data-theme=lilac]{--world:#e4d6fa;--glow:#faf4ff;--ink:#655082;--muted:#827092;--panel:#fcf8ff;--line:#d9c7ec;--soft:#eee2fa;--accent:#bea1e6;--accentInk:#533f70;--ground:#ccb7e9}
.topbar{max-width:1600px;gap:16px;padding-left:28px;padding-right:28px}.toolbar{display:flex;gap:8px;align-items:center}.tool-button{display:flex;align-items:center;justify-content:center;gap:7px;min-width:70px;height:46px;padding:0 12px;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--ink);font-size:13px;font-weight:800;white-space:nowrap;box-shadow:0 3px 0 var(--line)}.tool-button>span:first-child{font-size:20px}.tool-button:disabled{opacity:.5}.home-heading h1{color:var(--ink)}.home-heading h1>span{color:var(--accentInk)}.home-heading p,.eyebrow,.start-note,.brand,.game-status,.game-toolbar,.battle-team p{color:var(--muted)}.home .start-button,.save-button,.submit{background:var(--accent);color:var(--accentInk);border-color:var(--panel)}.home .start-button{box-shadow:0 7px 0 var(--line),0 12px 24px #50452215}.scene-orbit{border-color:var(--line);background:radial-gradient(ellipse,var(--glow),transparent)}.scene-ground,.grass{background:var(--ground)}.question-panel,dialog,.word-card,.speech-bubble{background:var(--panel);border-color:var(--line);color:var(--ink)}.question-panel{box-shadow:0 7px 0 var(--line)}.answer-option,.soft-button{background:var(--soft);border-color:var(--line);color:var(--ink)}.utility-dialog{width:min(570px,calc(100vw - 28px));padding:24px}.utility-dialog .dialog-heading h2{font-size:24px;margin:0}.utility-dialog .dialog-heading{margin-bottom:18px}.theme-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.theme-grid button{min-height:83px;border-radius:20px;background:var(--swatch);color:#354339;font-weight:800;font-size:17px;border:4px solid transparent}.theme-grid button[aria-pressed=true]{border-color:var(--ink);box-shadow:inset 0 0 0 3px #fff9}.help-steps{list-style:none;counter-reset:help;padding:0;margin:0;display:grid;gap:13px}.help-steps li{counter-increment:help;display:grid;grid-template-columns:36px 1fr;gap:5px 10px;font-size:14px;line-height:1.6}.help-steps li:before{content:counter(help);grid-row:span 2;background:var(--accent);color:var(--accentInk);height:36px;border-radius:13px;display:grid;place-items:center;font-weight:900}.help-steps b{font-size:17px}.help-steps li span{grid-column:2}.utility-note{font-size:13px;line-height:1.7;color:var(--muted);margin:12px 0 0}.music-row{display:flex;align-items:center;justify-content:space-between;min-height:58px;gap:20px;font-size:17px}.music-row input[type=checkbox]{width:26px;height:26px;accent-color:var(--ink)}.music-row input[type=range]{width:55%;accent-color:var(--ink)}.sound-tests{display:flex;gap:12px;margin-top:20px}.sound-tests>*{flex:1}.bank-label{display:grid;gap:8px;font-weight:700}.bank-words{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:14px 0;min-height:164px}.bank-words>div{display:flex;align-items:center;justify-content:space-between;gap:8px;background:var(--soft);padding:8px 12px;border-radius:12px;min-width:0;font-size:13px}.bank-words strong,.bank-words span{overflow-wrap:anywhere;min-width:0}.utility-dialog .save-button{margin-top:16px}
@media(max-width:1000px){.topbar{padding-left:20px;padding-right:20px}.brand>span:last-child{display:none}.toolbar{gap:7px}.tool-button{min-width:66px;padding:0 10px}}
@media(max-width:620px){.topbar{padding-left:10px;padding-right:10px;gap:8px}.brand{display:none}.toolbar{width:100%;justify-content:space-between;gap:5px}.tool-button{min-width:0;flex:1;flex-direction:column;gap:0;font-size:11px;height:48px;padding:2px}.tool-button>span:first-child{font-size:18px}.utility-dialog{padding:18px}.utility-dialog .dialog-heading h2{font-size:21px}.theme-grid button{font-size:15px}.bank-words{gap:5px}.bank-words>div{padding:7px;font-size:12px}}
@media(max-height:650px){.utility-dialog{padding:18px}.utility-dialog .dialog-heading{margin-bottom:12px}.help-steps{gap:8px}.help-steps li{line-height:1.4}.utility-note{font-size:12px}.theme-grid button{min-height:68px}}
.bank-examples{display:flex;gap:10px;margin-top:12px}.bank-examples>button{flex:1;font-size:14px;padding:8px}.library-tools{flex-wrap:wrap}.library-tools>button,.library-tools>.file-picker,.library-tools>select{flex:1 1 20%}.library-tools>button{white-space:nowrap}.library-dialog .library-tools{gap:5px}.library-dialog .library-tools .soft-button{font-size:12px}
@media(max-height:650px){#bankDialog .bank-words{min-height:144px;margin:8px 0;gap:5px}#bankDialog .bank-examples{margin-top:8px}#bankDialog .save-button{margin-top:8px;min-height:44px}#bankDialog .utility-note{margin-top:7px}#bankDialog .dialog-heading{margin-bottom:8px}}
#learningNotice:empty{display:none}#learningNotice{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);z-index:10000;width:max-content;max-width:90vw;background:#fff8df;color:#755329;padding:10px 18px;border:1px solid #e5cd8e;border-radius:16px;font-size:13px;box-shadow:0 5px 20px #0001}#resumeDialog{line-height:1.8}#resumeDialog>.soft-button{margin-top:12px}#confirmMessage{font-size:21px;line-height:1.6}#manageNotice{font-size:13px;line-height:1.6}#manageName{overflow-wrap:anywhere}#reviewOptions{height:auto;margin:14px 0;min-height:130px}#reviewOptions .answer-option{min-height:60px}#reviewFeedback{min-height:28px;font-size:15px}#reviewPrompt{font-size:30px;margin:12px 0}.game-toolbar #speakWord{padding:8px 15px}.game-toolbar{gap:8px}#bankDialog .bank-words{min-height:128px;margin:8px 0}#bankDialog .bank-words>div{padding:5px 9px}#bankDialog .bank-examples{margin-top:8px}#bankDialog .save-button{margin-top:8px;min-height:42px}#bankDialog .soft-button{min-height:38px}#bankDialog .dialog-heading{margin-bottom:8px}#bankDialog .utility-note{margin-top:7px}
@media(max-height:650px){#bankDialog{padding:14px}#bankDialog .bank-words{min-height:112px;gap:4px}#bankDialog .bank-words>div{font-size:12px;padding:3px 8px}#bankDialog select{height:42px}#bankDialog .bank-label{gap:4px}#bankDialog .bank-examples{margin-top:5px}#bankDialog .soft-button{min-height:34px}#bankDialog .utility-note{line-height:1.4}#bankDialog .dialog-heading h2{font-size:22px}}
@media(max-width:600px){.game-toolbar{font-size:10px}.game-toolbar .soft-button{font-size:12px;padding:7px 9px}.game-toolbar #speakWord{padding:7px 9px}}

/* Prevent focus from scrolling the fixed home scene after returning from a match. */
.home{overflow:clip}
/* Six-card teacher guide, based on the supplied reference. */
#helpDialog{width:min(960px,calc(100vw - 32px));padding:30px 34px;border:1px solid var(--line);border-radius:32px;background:linear-gradient(135deg,var(--panel),var(--world));color:var(--ink);max-height:calc(100dvh - 24px)}
#helpDialog .dialog-heading{margin-bottom:22px;gap:12px}#helpDialog .dialog-heading h2{font-size:34px;color:var(--ink);display:flex;align-items:baseline;gap:14px;flex-wrap:wrap}#helpTitle>span{font-size:19px;color:var(--muted)}#helpDialog .icon-button{background:var(--soft);box-shadow:none;border:0;color:var(--ink);font-size:36px;width:44px;height:44px;min-width:44px}
.help-cards{display:grid;grid-template-columns:1fr 1fr;gap:14px}.help-cards section{padding:16px 18px;border:1px solid var(--line);border-radius:20px;background:var(--panel)}.help-cards h3{margin:0 0 8px;font-size:20px;line-height:1.4;color:var(--ink)}.help-cards p{margin:0;font-size:15px;line-height:1.75;color:var(--ink)}
@media(max-height:700px){#helpDialog{padding:20px 24px}#helpDialog .dialog-heading{margin-bottom:14px}#helpDialog .dialog-heading h2{font-size:28px}.help-cards{gap:10px}.help-cards section{padding:12px 14px}.help-cards h3{font-size:18px;margin-bottom:5px}.help-cards p{font-size:14px;line-height:1.55}}
@media(max-width:600px){#helpDialog{padding:18px}.help-cards{grid-template-columns:1fr}#helpDialog .dialog-heading h2{font-size:26px}#helpTitle>span{font-size:15px}}
.pause-dialog{width:min(460px,calc(100vw - 40px));text-align:center;padding:30px;background:var(--panel);color:var(--ink);border:3px solid var(--line)}.pause-symbol{margin:auto;display:grid;place-items:center;width:72px;height:72px;border-radius:24px;background:var(--soft);font-size:44px;font-weight:900}.pause-dialog h2{font-size:36px;margin:16px 0 10px}.pause-dialog p{font-size:17px;color:var(--muted);margin:0 0 24px}.pause-dialog button{display:block;width:100%;min-height:64px;font-size:24px;margin-top:14px;border-radius:22px}.pause-dialog::backdrop{background:#35576b66;backdrop-filter:blur(5px)}
.answer-badge{display:block;font-size:clamp(12px,1.5vh,16px);font-weight:800;line-height:1.3;margin-top:5px}.answer-option.correct .answer-badge{color:#256d46}.answer-option.wrong .answer-badge{color:#975e3d}.answer-feedback.review-answer{font-size:clamp(19px,2.8vh,28px);font-weight:850;color:#2d7956;line-height:1.3;overflow-wrap:anywhere}.feedback-actions{grid-row:5;display:flex;justify-content:center;gap:12px;min-width:0}.feedback-actions .soft-button{min-width:0;min-height:44px;padding:8px 20px;font-size:16px}.question-panel .feedback-actions .submit{margin:0;min-width:0}
@media(max-height:680px){.answer-feedback.review-answer{font-size:18px}.feedback-actions{gap:8px}.feedback-actions .soft-button{min-height:38px;font-size:14px;padding:6px 16px}.answer-badge{font-size:12px;margin-top:2px}}
