/* One teaching surface and one chosen input method at every viewport. */
body[data-classroom]{background:#153746;color:#fff3d9;overflow:hidden;min-width:320px}body[data-classroom] #app{height:100dvh;display:grid;grid-template-rows:auto auto minmax(0,1fr);isolation:isolate}body[data-classroom] button{min-height:44px;min-width:44px;padding:9px 15px;border-radius:14px;background:#254c5c;color:#fff3d9;border:1px solid #8bb1b27a;font-weight:700;filter:none;box-shadow:0 3px #102b37}body[data-classroom] button:hover:not(:disabled){background:#366575;color:#fff8e7;filter:none}body[data-classroom] button:active:not(:disabled){background:#3b7181;color:#fff8e7}body[data-classroom] button:disabled{opacity:.5}body[data-classroom] .classroom-primary{background:#f1ce83;color:#253a40;border-color:#ffedbe;box-shadow:0 3px #9e7943}body[data-classroom] .classroom-primary:hover:not(:disabled){background:#ffe0a0;color:#253a40}body[data-classroom] .classroom-primary:active:not(:disabled){background:#e6bc6b;color:#253a40}
.classroom-world{position:fixed;inset:0;z-index:-1;pointer-events:none;opacity:.4}.classroom-world>svg,.classroom-world .world-art{width:100%;height:100%;object-fit:cover}.classroom-world:after{content:'';position:absolute;inset:0;background:linear-gradient(#112e4066,#0b23354d)}.classroom-hud{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:12px 3%;z-index:3;background:#102d3ee6;border-bottom:1px solid #8ab9b44a}.classroom-brand strong{display:block;font-size:25px;letter-spacing:2px;color:#ffe6a7}.classroom-brand small{font-size:11px;color:#bfd8d4}.classroom-toolbar{display:flex;align-items:center;gap:9px}.classroom-toolbar #race-time{font-size:18px;font-variant-numeric:tabular-nums;min-width:65px;text-align:center;color:#fff0bf}.classroom-instruction{display:flex;align-items:center;justify-content:center;gap:22px;min-height:47px;padding:8px 20px;background:#102f3ac7}.classroom-instruction strong{font-size:17px}.classroom-instruction>span{font-size:13px;color:#c5dfdc}.classroom-board{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:28px;max-width:1480px;width:100%;margin:auto;padding:16px 30px 14px;min-height:0;height:100%;overflow:hidden}.team-lane{--team:#9ce3da;display:grid;grid-template-rows:60px 8px 138px minmax(0,1fr) 35px 46px;min-height:0;border:1px solid #87b9bd85;background:#103342c9;border-radius:24px;padding:10px 20px 13px;position:relative;overflow:hidden}.team-1{--team:#ffc4ce;background:#3f3040c9;border-color:#c694ab88}.lane-hud{display:flex;align-items:center;gap:12px;min-width:0}.lane-hud h2{font-size:24px;color:var(--team);margin:0}.lane-score{margin-left:auto;display:flex;align-items:baseline;gap:8px;color:#fff4d4}.lane-score strong{font-size:38px;font-variant-numeric:tabular-nums}.lane-score>span{font-size:16px;color:#d9e9e1}.lane-mascot{width:55px;height:55px;pointer-events:none}.lane-mascot svg{width:100%;height:100%}.goal-track{background:#091e2d;border-radius:10px;overflow:hidden;height:8px}.goal-track i{height:100%;display:block;width:0;background:var(--team);transition:width .2s}.lane-note{display:flex;align-items:center;justify-content:center;gap:12px;background:#f8f0d8;border:3px solid #cfb57d;border-radius:16px;margin:9px auto;width:min(100%,420px);color:#234154;overflow:hidden}.lane-note .staff{width:260px;height:auto;max-height:120px;flex:1;min-width:0}.pitch-caption{padding:8px 14px 8px 0;display:flex;flex-direction:column;gap:6px;min-width:80px}.pitch-caption strong{font-size:20px}.pitch-caption small{font-size:12px;color:#36546a}.controller-stage{min-height:0;position:relative;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#608c95 #153442}.controller-dock{--reach:1;position:relative;width:100%;height:470px;top:calc(max(0px,100% - 470px)*var(--reach));margin:0 auto}.pipe-window{position:relative;height:470px;max-width:310px;margin:0 auto;overflow:hidden;border-radius:18px;background:linear-gradient(90deg,#ffffff04,#aec7ba09,#ffffff04)}.pipe-track{position:absolute;width:216px;height:900px;top:-330px;left:calc(50% - 130px)}.pipe-track>.recorder-art{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.pipe-caption{position:absolute;top:10px;right:12px;font-size:11px;color:#e4e9cf;pointer-events:none}.classroom-board .pipe-key,.practice-new-controls .pipe-key{position:absolute;display:flex;align-items:center;justify-content:center;padding:0;width:72px;height:52px;min-height:52px;border-radius:25px;transform:translate(-50%,-50%);background:#c8e3d310;border:1px solid #f0e7cd77;box-shadow:0 2px #0a2431;touch-action:none;user-select:none;-webkit-user-select:none}.pipe-key .hole-face{display:flex;gap:3px;align-items:center;justify-content:center;pointer-events:none}.pipe-key i{display:block;width:25px;height:25px;border-radius:50%;border:2px solid #9d8974;background:#f7ecd2;box-shadow:inset 1px 2px 4px #7b694133}.pipe-key em{width:15px;height:15px;border-radius:50%;border:1px solid #9d8974;background:#f7ecd2}.pipe-key b{position:absolute;left:calc(100% + 2px);top:50%;transform:translateY(-50%);font-size:13px;font-weight:700;color:#f8edd4;background:#183e4ae6;border-radius:5px;padding:2px;pointer-events:none;white-space:nowrap}.pipe-key[data-hole-state="2"] i,.pipe-key[data-hole-state="2"] em{background:#071a23;border-color:#c5e5dc;box-shadow:inset 1px 1px 2px #d2f6e94d}.pipe-key[data-hole-state="1"] i{background:linear-gradient(90deg,#071a23 50%,#f7ecd2 50%);border-color:#d3e1cd}.pipe-key.paired-key[data-hole-state="1"] i{background:#071a23}.pipe-key.paired-key[data-hole-state="1"] em{background:#f7ecd2}.classroom-board .pipe-key:hover:not(:disabled),.practice-new-controls .pipe-key:hover:not(:disabled){background:#b0ddce26}.classroom-board .pipe-key:active:not(:disabled),.practice-new-controls .pipe-key:active:not(:disabled){background:#c5f5e344;translate:none;transform:translate(-50%,-50%)}.classroom-board .thumb-key,.practice-new-controls .thumb-key{top:40px;left:calc(50% - 70px);width:60px;height:54px;transform:translate(-50%,-50%)}.thumb-key b{left:50%;top:calc(100% + 8px);transform:translateX(-50%);font-size:11px}.lane-feedback{text-align:center;align-self:center;font-size:15px;color:#e8f0d5;line-height:1.4}.lane-actions{display:flex;justify-content:center;gap:10px;align-items:center}.lane-actions>button{font-size:13px;padding:7px 22px;box-shadow:none}.team-lane.celebrating{border-color:var(--team);box-shadow:inset 0 0 25px #e9d39e36}.celebrating .lane-mascot{animation:classroom-win .6s ease-out}@keyframes classroom-win{40%{transform:translateY(-12px) rotate(-8deg)}75%{transform:translateY(0) rotate(4deg)}}
.number-controls{display:grid;grid-template-columns:repeat(4,minmax(44px,1fr));gap:14px;max-width:410px;margin:25px auto;padding:12px}.classroom-board .pad-key,.practice-new-controls .pad-key{min-height:100px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;touch-action:none;border:2px solid #c0cdbb;background:#f5edcf;color:#234653;box-shadow:0 4px #67858a}.pad-key b{font-size:32px}.pad-key span{font-size:12px}.pad-key small{font-size:12px;font-weight:700}.classroom-board .pad-key[data-hole-state="2"],.practice-new-controls .pad-key[data-hole-state="2"]{background:#102e3b;color:#fff5d8;border-color:#8fd5ce}.classroom-board .pad-key[data-hole-state="1"],.practice-new-controls .pad-key[data-hole-state="1"]{background:linear-gradient(90deg,#102e3b 50%,#f5edcf 50%);color:#fff5d8}.pad-key[data-hole-state="1"]>*{background:#1b4050;border-radius:5px;padding:1px 4px}.classroom-board .pad-key:hover:not(:disabled),.practice-new-controls .pad-key:hover:not(:disabled){background:#dbe9d8;color:#234653}.classroom-board .pad-key[data-hole-state="2"]:hover:not(:disabled),.practice-new-controls .pad-key[data-hole-state="2"]:hover:not(:disabled){background:#245a69;color:#fff5d8}.classroom-board .pad-key[data-hole-state="1"]:hover:not(:disabled),.practice-new-controls .pad-key[data-hole-state="1"]:hover:not(:disabled){background:linear-gradient(90deg,#245a69 50%,#dbe9d8 50%);color:#fff5d8}
body[data-classroom] dialog.classroom-dialog{padding:26px 30px;border:1px solid #b8ceb5;background:#f5efd9;color:#244651;border-radius:22px;max-width:calc(100vw - 26px);width:760px;max-height:calc(100dvh - 32px);overflow:auto;box-shadow:0 18px 80px #061b29bb}body[data-classroom] dialog::backdrop{background:#082333b8;backdrop-filter:blur(2px)}.classroom-dialog h2{font-size:27px;margin:0 0 17px;color:#244651}.classroom-dialog p{line-height:1.8;font-size:14px}.classroom-dialog label{color:#244651;font-size:14px}.classroom-dialog select{display:block;width:100%;min-height:46px;padding:8px;border:1px solid #6f9091;border-radius:10px;background:#fffdf3;color:#244651;margin:6px 0 12px}.classroom-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px 20px}.classroom-dialog .classroom-check{display:flex;align-items:center;gap:9px;margin:12px 0}.classroom-dialog input[type=checkbox]{width:20px;height:20px;accent-color:#246b77}.classroom-dialog fieldset{padding:14px;border:1px solid #9cb8ad;border-radius:14px;margin:16px 0}.classroom-small{font-size:12px!important;color:#3c5963}.classroom-dialog .dialog-actions{position:static;display:flex;justify-content:flex-end;flex-wrap:wrap;gap:10px;margin:18px 0 0}.classroom-dialog .dialog-actions a{color:#244651}.classroom-link{display:inline-flex;align-items:center;min-height:44px;padding:9px}.height-control{display:flex!important;flex-direction:column;gap:10px;margin:20px 0;font-size:17px!important}.height-control input{width:100%;height:36px;accent-color:#276b79}.height-control>span{font-size:12px}.range-shortcuts{display:flex;gap:8px;margin-bottom:12px}.range-shortcuts button{font-size:12px}#classroom-notes{display:grid;grid-template-columns:1fr 1fr;gap:10px;max-height:300px;overflow:auto}.pitch-choice{display:grid;grid-template-columns:24px 1fr;align-items:center;gap:5px;background:#fffaf0;border:1px solid #9daf9e;border-radius:10px;padding:9px;min-width:0}.pitch-choice .staff{height:75px;width:100%;min-width:0}.pitch-choice span{grid-column:1/3;font-size:11px;line-height:1.5}.classroom-menu{display:flex;flex-wrap:wrap;gap:10px;margin-bottom:18px}.classroom-how{padding-left:25px}.classroom-how li{padding:10px 0;line-height:1.8}.classroom-result{display:grid;grid-template-columns:1fr 1fr;gap:20px}.classroom-result>section{padding:25px;text-align:center;background:#e3e9d5;border-radius:18px}.classroom-result strong{display:block;font-size:48px;color:#244651}.classroom-result span{font-size:15px;color:#244651}.practice-note-paper .staff{display:block;height:110px;width:100%;max-width:330px;margin:auto}.practice-new-controls{height:340px;overflow:auto;border-radius:18px;background:#214857}.practice-new-controls .pipe-window{height:470px}.practice-new-controls .number-controls{margin:0 auto;padding-top:25px}.practice-new-controls .pipe-caption{color:#f6e9c8}#settings-error{color:#8b2944;font-weight:700}
@media(min-width:1600px){.classroom-hud{padding:17px 4%}.classroom-brand strong{font-size:30px}.classroom-hud button{font-size:17px}.classroom-board{max-width:1750px;padding-top:20px;gap:50px}.team-lane{grid-template-rows:74px 9px 157px minmax(0,1fr) 38px 48px;padding:14px 28px}.lane-note .staff{max-height:142px}.lane-hud h2{font-size:30px}.lane-score strong{font-size:44px}.lane-note .pitch-caption strong{font-size:25px}.classroom-instruction strong{font-size:20px}}
@media(max-width:700px){.classroom-hud{flex-wrap:wrap;gap:8px;padding:8px 12px}.classroom-brand strong{font-size:18px;letter-spacing:1px}.classroom-brand small{font-size:9px}.classroom-toolbar{gap:5px;flex-wrap:wrap;justify-content:flex-end;margin-left:auto}.classroom-toolbar button{font-size:12px;padding:8px 10px;min-width:44px}.classroom-toolbar #race-time{font-size:12px;min-width:46px}.classroom-instruction{display:block;text-align:center;padding:5px 10px;min-height:43px}.classroom-instruction strong{font-size:13px;display:block}.classroom-instruction>span{font-size:10px;display:block;margin-top:3px}.classroom-board{gap:9px;padding:8px 9px}.team-lane{padding:7px 5px 8px;border-radius:17px;grid-template-rows:43px 6px 100px minmax(0,1fr) 38px 44px}.lane-mascot{display:none}.lane-hud{gap:4px;padding:0 5px}.lane-hud h2{font-size:16px}.lane-score{gap:3px}.lane-score strong{font-size:27px}.lane-score>span{font-size:10px}.lane-note{display:block;position:relative;margin:6px 0;width:100%;border-width:2px}.lane-note .staff{display:block;width:100%;height:68px;max-height:none}.pitch-caption{position:absolute;bottom:2px;left:0;right:0;padding:0;text-align:center;display:flex;flex-direction:row;justify-content:center;gap:6px;min-width:0}.pitch-caption strong{font-size:12px}.pitch-caption small{font-size:9px}.lane-feedback{font-size:11px;line-height:1.5;padding:0 2px}.lane-actions>button{padding:8px 12px;font-size:11px}.pipe-window{width:100%;border-radius:12px}.pipe-caption{font-size:9px;right:4px;top:10px}.classroom-board .pipe-key{width:60px;height:52px}.classroom-board .thumb-key{left:24px;width:48px}.pipe-key b{font-size:11px;left:calc(100% + 1px)}.thumb-key b{font-size:9px;left:50%}.number-controls{grid-template-columns:1fr 1fr;gap:9px;padding:8px 4px;margin:10px auto}.classroom-board .pad-key{min-height:79px;padding:6px 2px;gap:3px}.pad-key b{font-size:25px}.pad-key span{font-size:10px}.pad-key small{font-size:10px}body[data-classroom] dialog.classroom-dialog{padding:21px 16px}.classroom-dialog h2{font-size:23px}.classroom-fields{gap:9px 12px}.classroom-dialog label{font-size:12px}.classroom-dialog select{font-size:12px}.pitch-choice span{font-size:10px}.pitch-choice .staff{height:60px}.classroom-dialog .dialog-actions{gap:7px}.classroom-dialog .dialog-actions button{font-size:12px;padding:9px 12px}}
@media(max-height:600px) and (min-width:701px){.classroom-hud{padding:5px 15px}.classroom-brand strong{font-size:18px}.classroom-brand small{display:none}.classroom-instruction{min-height:33px;padding:4px 10px}.classroom-instruction strong{font-size:13px}.classroom-board{padding:6px 15px;gap:18px}.team-lane{grid-template-rows:37px 5px 86px minmax(0,1fr) 27px 44px;padding:6px 12px}.lane-mascot{width:34px;height:34px}.lane-hud h2{font-size:18px}.lane-score strong{font-size:27px}.lane-note .staff{max-height:75px}.pitch-caption strong{font-size:16px}.controller-stage:after{content:'可上下滑動，查看完整指孔';display:block;position:sticky;bottom:0;font-size:10px;background:#173c4eed;text-align:center;pointer-events:none}.lane-feedback{font-size:12px}}
@media(prefers-reduced-motion:reduce){.celebrating .lane-mascot{animation:none}.goal-track i{transition:none}.classroom-world *{animation:none!important}}

body[data-classroom] .bell-key{position:absolute;bottom:5px;left:50%;transform:translateX(-50%);font-size:12px;white-space:nowrap;touch-action:none;z-index:4;background:#f5edcf;color:#234653}.bell-key[data-hole-state="2"]{background:#102e3b!important;color:#fff5d8!important}.number-controls .bell-key{position:static;transform:none;grid-column:1/-1}
/* All seven front holes fit ordinary 720px boards; the height slider now has
   useful spare travel on taller classroom displays. No input method is swapped. */
.controller-dock,.pipe-window{height:350px}.controller-dock{top:calc(max(0px,100% - 350px)*var(--reach))}.pipe-track{width:192px;height:800px;top:-343px;left:calc(50% - 116px)}.classroom-board .pipe-key,.practice-new-controls .pipe-key{height:46px;min-height:46px;width:64px}.classroom-board .thumb-key,.practice-new-controls .thumb-key{top:26px;left:calc(50% - 60px);width:48px;height:46px}.pipe-caption{top:65px;right:5px;font-size:10px}.practice-new-controls .pipe-window{height:350px}.practice-new-controls{height:350px}
@media(max-width:700px){.pipe-track{left:calc(50% - 104px)}.classroom-board .thumb-key{left:22px}.pipe-caption{font-size:8px;right:3px;top:61px}.classroom-board .pipe-key{width:60px}.classroom-board .thumb-key{width:44px}}
@media(min-width:701px) and (min-height:601px) and (max-height:800px){.classroom-hud{padding:8px 3%}.classroom-brand strong{font-size:22px}.classroom-instruction{min-height:38px;padding:6px 15px}.classroom-board{padding:8px 24px;gap:24px}.team-lane{padding:7px 15px 8px;grid-template-rows:44px 6px 96px minmax(0,1fr) 26px 44px}.lane-mascot{width:42px;height:42px}.lane-hud h2{font-size:22px}.lane-score strong{font-size:32px}.lane-note{margin:6px auto}.lane-note .staff{max-height:83px}.lane-feedback{font-size:13px}.lane-actions button{min-height:40px;padding:7px 20px}}
/* Bell closure belongs to the chosen control group, never floats over modal actions. */
body[data-classroom] .number-controls .bell-key{position:static;transform:none;grid-column:1/-1;width:100%;min-height:44px}.number-controls{margin:0 auto}
.classroom-instruction .state-legend{display:inline-flex;align-items:center;gap:13px;font-size:11px;color:#f4efd7}.state-legend>span{display:flex;align-items:center;gap:5px}.state-legend i{display:inline-block;width:13px;height:13px;border:1px solid #d5ddc8;border-radius:50%;background:#f7ecd2}.state-legend .legend-closed{background:#071a23}.state-legend .legend-half{background:linear-gradient(90deg,#071a23 50%,#f7ecd2 50%)}.touch-test-pads{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin:25px 0}.touch-test-pads button{touch-action:none;min-height:180px;font-size:21px}.touch-test-pads button:nth-child(2){background:#634859}.touch-test-pads strong{display:block;font-size:16px;margin-top:20px}
@media(max-width:700px){.classroom-instruction .state-legend{font-size:9px;gap:13px;justify-content:center;margin-top:4px}.state-legend i{width:11px;height:11px}.touch-test-pads{gap:10px}.touch-test-pads button{font-size:16px;padding:10px}.touch-test-pads strong{font-size:12px}}
@media(max-width:700px) and (max-height:780px){.team-lane{grid-template-rows:40px 6px 90px minmax(0,1fr) 28px 44px}.lane-note .staff{height:60px}.lane-note .pitch-caption strong{font-size:11px}}
/* An advanced bell control sits beside hole 7, not on top of its hit target. */
body[data-classroom] .pipe-window .bell-key{left:calc(50% - 70px);bottom:4px;width:52px;height:46px;padding:3px 0;font-size:10px;line-height:1.2;white-space:normal}.bell-key .state-word{display:block;font-size:9px;margin-top:2px}
@media(max-width:700px){.pipe-track{left:calc(50% - 100px)}body[data-classroom] .pipe-window .bell-key{left:22px;width:44px}}
/* Neutralize the retired screen's fixed generic header height: wrapped
   controls must never cover the live instruction strip on small screens. */
body[data-classroom] .classroom-hud{width:100%;max-width:none;height:auto;min-height:62px;margin:0}
@media(max-width:700px){body[data-classroom] .classroom-hud{min-height:0}.classroom-toolbar button{padding:8px}}

body[data-players=solo] .classroom-board{grid-template-columns:minmax(0,1fr);width:min(100%,680px);margin-inline:auto}body[data-players=solo] .classroom-result{grid-template-columns:1fr}
