.school-dialog{
 width:min(94vw,680px);height:min(86dvh,690px);max-width:100%;max-height:100dvh;
 margin:auto;padding:0;box-sizing:border-box;overflow:hidden;border:3px solid #a9b69b;
 border-radius:27px;background:#fff9ea;color:#415746;font-family:Nunito,'Segoe UI',system-ui,sans-serif;
}
.school-dialog[open]{display:flex;flex-direction:column}
.school-subjects{
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;max-width:570px;
 gap:clamp(6px,2vw,15px);margin:auto 0;
}
.school-subject{
 --subject-color:#c5a477;--subject-ink:#74502f;
 display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(6px,1.7vw,12px);
 min-width:0;min-height:clamp(110px,22vw,164px);padding:8px 3px;
 border:2px solid var(--subject-color);border-radius:19px;box-shadow:0 4px 0 var(--subject-color);
 background:#fff1ce;color:var(--subject-ink);font-weight:800;font-size:clamp(16px,4vw,23px);
}
.school-subject[data-subject="plus"]{--subject-color:#98b69d;--subject-ink:#346048;background:#e1efda}
.school-subject[data-subject="minus"]{--subject-color:#b1a2c6;--subject-ink:#68547f;background:#eee6f5}
.school-subject .school-glyph{width:clamp(41px,9vw,62px);height:clamp(41px,9vw,62px)}
.school-subject:hover{filter:brightness(1.025)}
.school-subject:active{transform:translateY(2px);box-shadow:0 2px 0 var(--subject-color)}
.school-subject:focus-visible{outline:3px solid #758fac;outline-offset:3px}
.school-dialog::backdrop{background:#32483873;backdrop-filter:blur(3px)}
.school-head{
 display:flex;align-items:center;gap:8px;flex:none;padding:9px 14px 8px;background:#eef1db;
 border-bottom:2px solid #d9dfc7;
}
.school-title{flex:1;min-width:0;margin:0;font:800 clamp(19px,4vw,25px)/1.15 Nunito,'Segoe UI',system-ui,sans-serif;color:#48634e}
.school-glyph{display:inline-flex;width:25px;height:25px;flex:none;color:inherit}
.school-glyph svg{width:100%;height:100%;display:block}
.school-dialog button{font-family:inherit;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.school-tool,.school-primary,.school-secondary,.school-small{
 display:inline-flex;justify-content:center;align-items:center;gap:8px;min-height:48px;padding:6px 14px;
 font-size:16px;font-weight:800;color:#425c43;background:#f9f7e7;border:2px solid #bdc7ac;border-radius:16px;
 box-shadow:0 3px 0 #adb69d;
}
.school-tool{width:48px;flex:0 0 48px;padding:7px}
.school-tool:focus-visible,.school-choice:focus-visible,.school-primary:focus-visible,.school-secondary:focus-visible{outline:3px solid #758fac;outline-offset:3px}
.school-tool:active,.school-primary:active,.school-secondary:active{transform:translateY(2px);box-shadow:0 1px 0 #adb69d}
.school-primary{min-width:145px;padding:6px 18px;background:#d7e9bd;border-color:#9dac86;font-size:18px}
.school-primary:disabled{opacity:.55}
.school-secondary,.school-small{min-width:44px;background:#f0ebf2;border-color:#c7bdce;color:#63576b}
.school-main{
 flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;gap:clamp(7px,2dvh,15px);
 overflow:auto;overscroll-behavior:contain;padding:clamp(12px,3dvh,23px) clamp(10px,3vw,23px) 17px;
 background:repeating-linear-gradient(90deg,transparent 0 67px,#eedfc54d 68px 69px),#fff9ea;
}
.school-board{
 position:relative;isolation:isolate;box-sizing:border-box;width:100%;flex:none;color:#fffbe5;
 background:#4c695c;border:7px solid #c7a380;border-radius:18px;text-align:center;
 box-shadow:0 3px 0 #a88c72,inset 0 0 0 2px #364f44;padding:12px;
}
.school-board::after{
 content:'';position:absolute;bottom:1px;right:18px;width:27px;height:4px;background:#efe0cb;border-radius:3px;
}
.school-board h3{margin:0;color:inherit;font-family:Nunito,'Segoe UI',system-ui,sans-serif;font-weight:800}
.school-cover{display:flex;align-items:center;justify-content:center;gap:14px;min-height:94px}
.school-cover h3,.school-result-board h3{font-size:clamp(24px,5vw,36px);line-height:1.12}
.school-cover-book{display:grid;place-items:center;width:54px;height:54px;color:#f4d79d;transform:rotate(-7deg)}
.school-cover-book .school-glyph{width:48px;height:48px}
.school-roster{width:100%;text-align:center;margin:0}
.school-roster h3{margin:4px 0 8px;font:750 19px/1.2 Nunito,'Segoe UI',system-ui,sans-serif;color:#52684f}
.school-roster .pet-picker{margin-inline:auto}
.school-tip{margin:1px 0;color:#62705d;font-weight:650;font-size:15px;text-align:center}
.school-notice{
 flex:none;display:flex;justify-content:center;align-items:center;gap:8px;margin:0;
 padding:4px 10px 10px;color:#596a55;font-size:14px;font-weight:700;text-align:center;
}
.school-notice:empty{display:none}
.school-wordboard{container-type:inline-size;margin-top:auto;min-height:146px;padding:8px 12px 18px}
.school-board-row{display:flex;align-items:center;justify-content:space-between;min-height:33px;gap:8px}
.school-learner{display:flex;align-items:center;gap:4px;max-width:62%;min-width:0;font-weight:750;font-size:14px;color:#fff4d3}
.school-learner canvas{flex:none}.school-learner > span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.school-friend-label{display:grid;gap:1px;text-align:left;line-height:1.15}
.school-friend-label b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.school-pet-points{color:#f8d392;font-size:12px}
.school-score{display:inline-flex;align-items:center;gap:6px;min-height:31px;padding:2px 9px;border:1px solid #8b9f89;border-radius:12px;background:#405c51;color:#fff5da;font-size:17px;font-variant-numeric:tabular-nums}
.school-score .school-glyph{width:19px;height:19px;color:#e3bd75}.school-score svg{fill:#f8cf7e}
.school-wordboard .school-word{
 margin:9px auto 0;width:100%;color:#fffcea;font:700 clamp(24px,8.1vw,55px)/1.35 Nunito,'Segoe UI',system-ui,sans-serif;
 font-size:clamp(17px,min(13cqw,calc(145cqw / var(--letters))),55px);letter-spacing:.025em;outline:none;overflow-wrap:anywhere;
}
.school-answers{
 display:grid;grid-template-columns:repeat(3,minmax(0,1fr));width:100%;gap:clamp(5px,1.8vw,13px);
 padding:7px 0 8px;margin-bottom:auto;
}
.math-formula{
 margin:9px 0 3px;color:inherit;outline:none;text-align:center;white-space:nowrap;
 font:800 clamp(25px,8.8vw,54px)/1.25 Nunito,'Segoe UI',system-ui,sans-serif;font-variant-numeric:tabular-nums;
}
.school-board h3.math-formula{margin:8px auto 3px}
.math-apple-aid{
 display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:4px;
 align-items:center;width:100%;max-width:500px;margin:7px auto 0;
}
.math-apple-group{
 display:flex;align-items:center;justify-content:center;align-content:center;
 gap:3px;flex-wrap:wrap;padding:5px;min-height:28px;box-sizing:border-box;border-radius:9px;
 background:#f5eddb;color:#e39585;font-variant-numeric:tabular-nums;
}
.math-apple-group.added{color:#efc575;background:#f7efd9}
.math-apple-group.removed{color:#c5b8ad;background:#e7e5d7}
.math-apple,.math-apple-crate{position:relative;display:inline-flex;flex:none;width:18px;height:20px}
.math-apple-crate{width:30px;height:26px}
.math-apple-group svg{width:100%;height:100%}
.math-apple-crate b{
 position:absolute;left:0;right:0;bottom:2px;text-align:center;
 font:800 12px/1 Nunito,'Segoe UI',system-ui,sans-serif;color:#453523;
}
.math-apple-group.removed > span::after{
 content:'';position:absolute;left:0;top:42%;width:100%;height:2px;border-radius:2px;
 transform:rotate(-40deg);background:#6c5a50;box-shadow:0 1px 0 #fff8e9;
}
.math-apple-sign{font-size:20px;line-height:1;color:#f7e8b9}
.math-answer-number{font:800 clamp(28px,8vw,50px)/1 Nunito,'Segoe UI',system-ui,sans-serif;color:#405c51;font-variant-numeric:tabular-nums}
.math-solution{color:#486955;gap:10px}
.math-solution .school-glyph{background:#68966b;color:#fffdf0;border-radius:50%;padding:5px;width:32px;height:32px}
.math-solution .math-formula{font-size:clamp(24px,6.6vw,38px);margin:0}
.school-choice{
 position:relative;display:grid;place-items:center;box-sizing:border-box;width:100%;min-width:0;
 min-height:86px;aspect-ratio:1.02;padding:4px;isolation:isolate;
 background:#fffdf3;color:#3d6543;border:2px solid #babb9e;border-radius:clamp(12px,3vw,21px);
 box-shadow:0 4px 0 #c4b493;transform:rotate(var(--card-turn));transition:transform .14s ease,background-color .14s;
}
.school-choice:hover:not(:disabled){background:#fffdf3;border-color:#8fa784;transform:rotate(0)}
.school-choice:active:not(:disabled){transform:translateY(3px) rotate(0);box-shadow:0 1px 0 #b3a78e}
.school-choice:disabled{opacity:1;cursor:default}
.school-picture{display:block;width:100%;height:auto;max-height:155px;overflow:visible}
.school-choice.right{background:#e1edd5;border-color:#7ca278;transform:rotate(0) scale(1.04)}
.school-choice.right > .school-glyph{position:absolute;top:4px;right:4px;width:24px;height:24px;padding:2px;border-radius:50%;background:#59865a;color:white}
.school-dialog[data-phase="lesson"] .school-notice:not(:empty){padding:3px 8px 10px}
.school-result-board{margin-top:auto;display:grid;gap:6px;min-height:108px;align-content:center}
.school-solution{container-type:inline-size;display:flex;align-items:center;justify-content:center;gap:clamp(8px,2.3vw,15px);width:100%;margin:0;min-height:116px;padding:5px 0}
.school-solution-picture{position:relative;display:grid;place-items:center;flex-shrink:0;width:clamp(80px,23vw,134px);aspect-ratio:1;padding:3px;border:2px solid #94af85;border-radius:19px;background:#fffdf3;box-shadow:0 3px 0 #b5bf96}
.school-solution-picture>.school-glyph{position:absolute;right:-4px;bottom:-4px;padding:2px;border-radius:50%;color:white;background:#59865a}
.school-solution .school-word{margin:0;max-width:65%;text-align:center;overflow-wrap:anywhere;color:#405d4d;font:800 clamp(20px,6vw,39px)/1.2 Nunito,'Segoe UI',system-ui,sans-serif;font-size:clamp(15px,min(9.2cqw,calc(90cqw / var(--letters))),39px)}
.school-summary{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:8px;color:#4c6549;font-size:17px;font-weight:750;margin:1px 0}
.school-earned{padding:3px 9px;border-radius:11px;background:#f2e5c4;color:#745d36;font-size:15px}
.school-actions{display:flex;justify-content:center;flex-wrap:wrap;gap:9px;margin:3px 0 auto}
@media(max-width:700px),(max-height:520px){
 .school-dialog{width:100%;height:100dvh;max-width:none;margin:0;border:0;border-radius:0}
 .school-head{padding-top:max(8px,env(safe-area-inset-top));padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
 .school-main{padding-bottom:max(15px,env(safe-area-inset-bottom))}
}
@media(max-height:460px) and (min-width:530px){
 .school-head{padding-block:3px}.school-tool{min-height:44px;width:44px;flex-basis:44px}
 .school-main{padding-block:6px;gap:5px}
 .school-cover{min-height:49px;padding:2px 8px}.school-cover-book,.school-cover-book .school-glyph{width:35px;height:35px}
 .school-wordboard{min-height:75px;max-width:610px;padding:2px 10px 7px}
 .school-board-row{min-height:24px}.school-learner canvas{height:26px!important;width:35px!important}
 .school-wordboard .school-word{font-size:clamp(26px,4.4vw,37px);line-height:1.05;margin:0}
 .school-answers{max-width:500px;gap:8px;padding:3px 0}.school-choice{aspect-ratio:1.48;min-height:72px}
 .school-picture{max-height:91px}.school-result-board{min-height:68px;gap:3px}
 .school-solution{min-height:64px;padding:0}.school-solution-picture{width:65px}.school-summary{font-size:15px}
 .school-board h3.math-formula{font-size:30px;margin:1px auto}
 .math-apple-aid{margin-top:3px}.math-apple-group{gap:2px;padding:3px}
 .math-apple{width:15px;height:17px}.math-apple-crate{width:26px;height:23px}
}
@media(prefers-reduced-motion:reduce){
 .school-dialog *{scroll-behavior:auto!important;animation:none!important;transition:none!important}
 .school-choice,.school-choice.right{transform:none}
}


.school-turn{margin:0;color:#365a42;font-weight:800;text-align:center}
.school-color-dialog{width:min(94vw,560px);max-height:90dvh;overflow:auto;text-align:center;padding:clamp(12px,4vw,26px);color:#394d3e}
.school-color-dialog::backdrop{background:#25382b88}
.school-color-dialog h2{font-size:clamp(20px,5vw,29px);margin:.3em 0 .65em}
.school-color-tier{margin:0;color:#806333;font-weight:750}
.school-color-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.school-color-option{display:grid;justify-items:center;gap:3px;padding:6px;min-height:54px;min-width:0;background:#f9f8ec;border:1px solid #b3bd9f;color:#344c3e;font-weight:750;font-size:clamp(12px,3.4vw,15px)}
.school-color-option canvas{max-width:100%;object-fit:contain}
.school-color-status{margin:.4em 0 0;font-size:13px}.school-color-status:empty{display:none}
@media(orientation:landscape) and (max-height:510px){.school-color-options{grid-template-columns:repeat(4,minmax(0,1fr))}}
.school-main>*{flex-shrink:0;max-width:100%}
.school-dialog{max-height:100vh;max-height:100dvh}
.school-dialog .school-head{min-height:0;flex-wrap:nowrap}
@media(max-width:700px),(max-height:520px){
 .school-dialog{height:100vh;height:100dvh;inset:0}
 .school-main{padding-inline:max(10px,env(safe-area-inset-left)) max(10px,env(safe-area-inset-right))}
}
@media(max-height:520px) and (min-width:530px){
 .school-dialog[data-phase="lobby"] .school-main{display:grid;grid-template-columns:minmax(160px,1fr) minmax(0,1.3fr);align-content:safe center}
 .school-dialog[data-phase="lobby"] .school-roster{grid-column:2;grid-row:1 / 3}
 .school-dialog[data-phase="lobby"] .school-actions{margin:0}
 .school-dialog[data-phase="lesson"] .school-main{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);align-content:safe center}
 .school-dialog[data-phase="lesson"] .school-wordboard{grid-column:1;grid-row:2 / 4;margin:0}
 .school-dialog[data-phase="lesson"] .school-turn{grid-column:1 / -1}
 .school-dialog[data-phase="lesson"] .school-tip{grid-column:2;grid-row:2}
 .school-dialog[data-phase="lesson"] .school-answers{grid-column:2;grid-row:3;margin:0}
}

#wishdecision{width:min(360px,calc(100% - 24px));padding:22px 18px;border:2px solid #70936d;border-radius:18px;background:#fff9e9;color:#364c39;text-align:center}
#wishdecision::backdrop{background:#23392888}
#wishdecision h2{font-size:clamp(22px,6vw,29px);margin:0 0 8px}
#wishdecision p{margin:8px 0 16px;overflow-wrap:anywhere}
#wishdecision div{display:flex;gap:8px}
#wishdecision button{flex:1;min-width:0;min-height:48px;padding:7px;border:1px solid transparent;color:white;font-weight:700}
#wishdecision .wish-continue{background:#386a48}
#wishdecision .wish-home{background:#a23d3c}
#wishdecision button:focus-visible,.school-color-later:focus-visible{outline:3px solid #264f66;outline-offset:2px}
.school-color-later{position:fixed;z-index:15;right:12px;top:68px;min-height:44px;background:#fff6d9;color:#354f3a;border:2px solid #638365}

