:root{font-family:ui-rounded,"SF Pro Rounded",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#1b333e;background:#f8f4e8;font-synthesis:none;--ink:#1b333e;--teal:#287383;--muted:#748483;--paper:#f8f4e8;--orange:#dc713b;--student-orange:#e58a2c}*{box-sizing:border-box}body{margin:0}button,select,input{font:inherit}button{cursor:pointer;color:inherit}button:disabled{cursor:default;opacity:.45}button:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #277586;outline-offset:4px}button{border:0}button svg{pointer-events:none}[hidden]{display:none!important}.home{max-width:1180px;margin:auto;padding:35px 48px}.home-top{display:flex;justify-content:space-between;align-items:center}.heartstrings{font-size:12px;letter-spacing:.19em;font-weight:850}.preview-label{font-size:12px;color:#596e71;border:1px solid #cad2c7;border-radius:20px;padding:7px 12px}.welcome{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:48px;padding:65px 0}.eyebrow{font-size:11px;text-transform:uppercase;letter-spacing:.15em;font-weight:800;color:var(--teal)}.welcome h1{position:relative;font-size:clamp(60px,8vw,103px);line-height:.92;letter-spacing:-.065em;margin:24px 0}.welcome h1 span{color:var(--teal)}.welcome h1 i{font-style:normal;position:absolute;font-size:.6em;transform:rotate(12deg);color:#d18f55;margin:12px 0 0 23px}.lead{font-size:22px;font-weight:650;line-height:1.4;margin-bottom:18px}.welcome-note{font-size:14px;line-height:1.7;color:#6f807d;max-width:325px}.welcome-art{height:310px;border-radius:45% 45% 30% 40%;background:#e9ebdf;position:relative;display:flex;gap:12px;align-items:center;justify-content:center;transform:rotate(-6deg);padding:35px}.art-count{position:absolute;top:46px;font-size:10px;font-weight:850;letter-spacing:.15em;color:#788a83}.art-tile{width:115px;height:140px;transform:rotate(-5deg);background:linear-gradient(#ffffff33,#ffffff44),url(assets/tile-texture.png) center/cover;border-radius:19px;border:1px solid #d3cfbf;box-shadow:0 7px 0 #c1bdab,0 14px 18px #304a331a;color:#20313f;z-index:1}.art-tile svg{width:100%;height:100%}.art-half{width:185px;transform:rotate(9deg);margin-top:35px}.art-dash{height:2px;background:#c2cec4;position:absolute;bottom:42px;width:66%}.section-card{display:flex;align-items:center;gap:28px;background:#fffdf7;border:1px solid #deded0;border-radius:22px;padding:32px;box-shadow:0 12px 25px #243f3310}.section-number{font-size:48px;font-weight:750;color:#b4c5b7;letter-spacing:-.05em}.section-copy{flex:1}.section-copy .eyebrow{margin-top:0}.section-copy h2{font-size:28px;letter-spacing:-.035em;margin:8px 0}.section-copy>p:not(.eyebrow){font-size:14px;color:#6a7d7c;line-height:1.6}.progress-track{height:5px;border-radius:10px;background:#e4e9de;max-width:330px;overflow:hidden}.progress-track>div{height:100%;background:var(--teal);width:0}.progress-label{font-size:12px!important;margin-bottom:0}.primary,.secondary,.check-button,.play-button{border-radius:50px;padding:14px 24px;font-weight:750;min-height:46px;white-space:nowrap}.primary,.play-button{background:var(--teal);color:white}.secondary{background:#e6eadd;color:var(--ink)}.home-bottom{display:flex;justify-content:space-between;align-items:center;color:#798884;font-size:12px;padding-top:20px}.text-button{background:none;color:var(--teal);font-size:12px;padding:12px}.game{max-width:1450px;margin:auto;height:100svh;min-height:370px;padding:20px 36px 18px;display:flex;flex-direction:column;gap:20px}.game-header{display:flex;align-items:center;gap:16px}.icon-button{background:none;font-size:44px;line-height:1;width:30px;padding:0;min-height:44px}.game-title h1{font-size:29px;letter-spacing:-.04em;margin:0;font-weight:850}.game-title p{font-size:16px;margin:3px 0 0}.header-tools{display:flex;gap:12px;margin-left:auto;align-items:center}.tempo-label{display:flex;align-items:center;gap:2px;font-size:25px;font-weight:700}.tempo-label select{font-weight:700;appearance:none;background:transparent;border:0;color:var(--ink);padding:7px 4px;cursor:pointer}.replays{font-weight:700;font-size:18px;white-space:nowrap;background:#e9e9de;border-radius:40px;padding:12px 18px;font-variant-numeric:tabular-nums}.round-button{height:46px;width:46px;background:#fff;border-radius:50%;font-size:26px;line-height:1}.round-button[aria-pressed=true]{color:white;background:var(--teal)}.play-button{background:#29bf56;font-size:19px;min-width:116px;display:flex;justify-content:center;gap:10px}.play-button.playing{background:#cb6249}.play-area{flex:1;display:flex;flex-direction:column;justify-content:center;gap:16px;min-height:0}.timeline-panel{background:#e9ebdf;border-radius:25px;padding:15px 13px;position:relative}.beat-labels{display:grid;gap:10px;margin-bottom:12px;font-size:12px;font-weight:850;letter-spacing:.08em;color:#83918c;text-align:center}.beat-labels .active{color:var(--teal)}.timeline{display:grid;gap:10px;position:relative;height:91px;isolation:isolate}.slot{grid-row:1;border-radius:17px;background:#e3e8df;border:2px solid #bdc6bd;box-shadow:inset 3px 4px 6px #243b3320,inset -2px -2px 4px white;display:grid;place-items:center;color:#a3b1aa;font-size:38px;z-index:0}.placed{grid-row:1;z-index:2;border:1.5px solid #92b4bc;border-radius:17px;background:#fff;color:#172d3c;min-width:0;padding:5px 14px;box-shadow:none;touch-action:manipulation}.placed svg{width:100%;height:100%;max-width:180px}.placed.dragging{opacity:.4}.slot.drop-ok{outline:3px solid var(--teal);outline-offset:-4px}.timeline-panel>p{font-size:13px;color:#7d8e87;margin:10px 0 0}.playhead{position:absolute;top:37px;height:98px;width:2px;background:#db8c56;pointer-events:none;z-index:3}.playhead:before{content:"";position:absolute;top:-3px;left:-3px;width:8px;height:8px;border-radius:50%;background:#db8c56}.palette-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.palette-heading h2{font-size:14px;letter-spacing:.04em;margin:0;font-weight:850}.palette-heading p{font-size:13px;color:#81908b;margin:0}.palette{display:grid;grid-template-columns:repeat(var(--choices),minmax(0,1fr));gap:12px;padding-bottom:10px}.tray-tile{height:91px;border-radius:17px;border:1px solid #d2d2c4;background:linear-gradient(#ffffff55,#ffffff44),url(assets/tile-texture.png) center/cover;box-shadow:0 6px 0 #c7c3af,0 10px 13px #253c2a15;color:#192d3c;padding:8px 12px;touch-action:manipulation}.tray-tile svg{width:100%;height:100%;max-width:155px}.tray-tile:active{transform:translateY(3px);box-shadow:0 3px 0 #c7c3af}.game-footer{display:flex;gap:24px;align-items:center;justify-content:space-between;min-height:56px}.game-footer>p{flex:1;text-align:center;font-size:15px;margin:0;color:#536e70}.game-footer>p.success{color:var(--teal);font-weight:750}.check-button{background:#eb8d5e;color:white;font-size:17px}.speaker{width:48px;height:44px;color:#9aa9a0;flex-shrink:0}.speaker svg{width:100%;height:100%}.sound-waves{visibility:hidden}.speaker.sounding{color:var(--teal)}.sounding .sound-waves{visibility:visible;animation:wave 650ms ease-in-out infinite}@keyframes wave{50%{opacity:.4}}dialog{border:1px solid #d4dbd0;border-radius:24px;background:#fffdf6;color:var(--ink);padding:32px;max-width:min(560px,calc(100vw - 32px));box-shadow:0 24px 80px #162b3240}dialog::backdrop{background:#1b333e66;backdrop-filter:blur(4px)}dialog h2{font-size:28px;letter-spacing:-.04em;margin:12px 0 18px}dialog p{line-height:1.7;color:#627978}dialog h3{font-size:15px}dialog .primary{margin-top:10px}form{margin:0}.small{font-size:12px}.setting-row{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:22px 0}.setting-row select{padding:8px;border:1px solid #cdd7cd;border-radius:8px;background:white;max-width:180px}input[type=checkbox]{width:21px;height:21px;accent-color:var(--teal)}.review-row{display:flex;gap:8px}.review-tile{height:65px;min-width:55px;background:#fff;border:1px solid #cad8d4;border-radius:10px;flex:1}.review-tile svg{width:100%;height:100%}.review-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:20px}.review-actions button{font-size:12px;padding:12px 16px}.review-actions .primary{margin-top:0}a{color:var(--teal)}@media(max-width:1000px){.game{padding:15px 23px;gap:10px}.game-title h1{font-size:24px}.game-title p{font-size:14px}.header-tools{gap:8px}.replays{font-size:15px;padding:12px}.round-button{width:40px;height:40px;font-size:23px}.tempo-label{font-size:22px}.play-button{font-size:17px;padding:10px 20px;min-width:100px}.game-header{gap:12px}.timeline{height:74px}.tray-tile{height:78px}.playhead{height:79px}.home{padding:28px 32px}.welcome{gap:25px}.welcome-art{height:270px;padding:22px}.art-tile{width:90px;height:120px}.art-half{width:155px}}@media(max-width:700px) and (orientation:portrait){.home{padding:24px}.welcome{grid-template-columns:1fr;padding:38px 0;gap:15px}.welcome h1{font-size:74px}.welcome-art{height:185px;max-width:380px;margin:10px 0}.art-count{top:19px}.art-tile{height:95px;width:80px}.art-half{width:145px;margin-top:18px}.art-dash{bottom:20px}.lead br{display:none}.welcome-note{max-width:100%}.section-card{padding:22px;gap:16px;flex-wrap:wrap}.section-number{font-size:34px}.section-copy{min-width:210px}.section-card>.primary{width:100%}.home-bottom{align-items:start;gap:20px}.home-bottom p{max-width:190px;line-height:1.5}.game{padding:14px 16px;height:auto;min-height:100svh;gap:24px}.game-header{flex-wrap:wrap;gap:10px}.game-title{flex:1}.game-title h1{font-size:28px}.header-tools{margin:6px 0 0;flex:1 1 100%;justify-content:space-between;gap:6px}.tempo-label{font-size:23px}.replays{padding:10px;font-size:13px}.play-button{min-width:86px;padding:11px}.game .play-area{gap:25px;flex:1;justify-content:center;margin:18px 0}.timeline{height:88px;gap:6px}.beat-labels{gap:6px;font-size:10px}.placed{padding:5px}.timeline-panel{padding:14px 9px}.timeline-panel>p{font-size:11px;line-height:1.5}.palette{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px}.tray-tile{height:93px}.palette-heading p{font-size:10px}.palette-heading h2{font-size:12px}.game-footer{flex-wrap:wrap;gap:12px;padding-bottom:8px}.game-footer>p{font-size:13px}.game-footer>.check-button,.game-footer>.primary{width:100%}.speaker{width:41px}.playhead{top:35px;height:92px}.review-row{gap:5px}dialog{padding:25px}.section-copy h2{font-size:25px}}@media(orientation:landscape) and (max-height:540px){.game{padding:9px 22px 10px;gap:8px}.game-title h1{font-size:22px}.game-title p{font-size:12px}.timeline{height:59px}.timeline-panel{padding:10px}.beat-labels{margin-bottom:6px;font-size:10px}.timeline-panel>p{margin-top:6px;font-size:11px}.play-area{gap:10px}.palette-heading{margin-bottom:6px}.palette-heading h2{font-size:12px}.palette-heading p{font-size:11px}.tray-tile{height:66px;padding:3px 10px}.game-footer{min-height:44px;gap:18px}.game-footer p{font-size:13px}.check-button,.game-footer>.primary{padding:11px 20px;font-size:14px;min-height:40px}.speaker{height:36px;width:40px}.playhead{top:28px;height:64px}.palette{gap:10px;padding-bottom:9px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important}}
#sections{display:grid;gap:18px}.exam-card{background:#f0e8fa;border-color:#d9c9ed}.exam-card .primary,.exam-card .progress-track>div{background:#7951a6}.exam-mode{--teal:#7951a6;background:#f5effc}.exam-mode .timeline-panel{background:#eae1f4}.exam-mode .play-button,.exam-mode .check-button{background:#7951a6}.exam-mode .palette{display:flex;overflow-x:auto;padding:0 2px 12px;gap:14px}.exam-mode .tray-tile{flex:0 0 clamp(115px,18vw,210px)}#stars{color:#bd852c;white-space:nowrap;font-size:22px}#bookmarks-panel{margin-top:30px}#bookmarks-list{display:flex;gap:10px;flex-wrap:wrap}#bookmark[aria-pressed=true]{color:#bd852c;background:#fff1c9}.section-card{margin:0}.game-footer{gap:12px}

.palette.scrolling{display:flex;overflow-x:auto;overscroll-behavior-x:contain;touch-action:pan-x;padding:0 2px 12px;gap:14px;scrollbar-width:thin}.palette.scrolling .tray-tile{flex:0 0 clamp(120px,18vw,210px);touch-action:pan-x}.palette.scrolling button{user-select:none;-webkit-user-select:none}

/* Written note gates drive the speaker directly; avoid an unrelated pulse. */
.sounding .sound-waves{animation:none}
/* Keep wide three-beat cells from growing to the SVG's intrinsic height. */
.timeline{grid-template-rows:minmax(0,1fr)}.placed{min-height:0;overflow:hidden}.placed svg{display:block;margin:auto}

.celebration{text-align:center;max-width:min(600px,calc(100vw - 32px));padding:35px}.celebration-stars{display:flex;justify-content:center;gap:14px;margin:26px 0}.celebration-star{color:#b8b8a7;font-size:clamp(38px,7vw,65px);line-height:1.2}.celebration-star.revealed{color:#c38e2c;animation:star-pop .35s ease-out}.celebration-actions{display:flex;justify-content:center;gap:12px;flex-wrap:wrap}.celebration-actions .primary{margin:0}.exam-celebration{--teal:#7951a6;background:#f5effc}.celebration::backdrop{background:#20323b77}#game:not([hidden]) .play-area{animation:question-in .18s ease-out}@keyframes star-pop{from{opacity:.2;transform:scale(.65) rotate(-12deg)}70%{transform:scale(1.12)}to{opacity:1;transform:scale(1)}}@keyframes question-in{from{opacity:.4;transform:translateY(5px)}to{opacity:1;transform:translateY(0)}}@media(prefers-reduced-motion:reduce){.celebration-star.revealed,#game:not([hidden]) .play-area{animation:none}}
.testing-notice{color:var(--teal);background:#e9ebdf;padding:12px 18px;border-radius:12px;font-size:14px;margin:0 0 18px}

/* Keyboard performance is a separate reading mode, not a tile-building board. */
.midi-entry{display:block;margin:0 0 24px;border:1px solid #9cb8ad;padding:18px 24px;color:var(--teal);background:#e9ebdf;font-size:17px}
.midi-practice{max-width:1100px;margin:auto;padding:35px 40px 55px;min-height:100svh;box-sizing:border-box;color:var(--ink)}
.midi-header{display:flex;gap:30px;align-items:center;margin-bottom:30px}.midi-header h1{font-size:38px;letter-spacing:-.04em;margin:5px 0}.midi-header p{margin:6px 0}.midi-header .eyebrow{font-size:12px}
.midi-connections{display:flex;align-items:center;gap:18px;flex-wrap:wrap;background:#e9ebdf;padding:20px;border-radius:18px}.midi-connections p{flex-basis:100%;margin:0;color:#526e69}.midi-connections span{font-size:13px;color:#526e69}
.midi-practice select{background:#fffdf6;border:1px solid #afbeb3;border-radius:8px;padding:10px;max-width:300px;color:var(--ink);font:inherit}.midi-settings{display:flex;gap:30px;align-items:center;flex-wrap:wrap;margin:25px 0}.midi-settings label{display:flex;align-items:center;gap:12px}
.midi-score{display:flex;align-items:flex-start;gap:25px;margin:35px 0 15px;padding:25px 10px;min-height:150px}.midi-meter{font:bold 42px/.95 Georgia,serif;display:flex;flex-direction:column;align-items:center;margin-top:10px;width:40px;flex-shrink:0}.midi-track{position:relative;flex:1;min-width:0;border-right:2px solid var(--ink);height:112px}.midi-notes{position:relative;height:105px}.midi-symbol{position:absolute;top:0;height:100px}.midi-symbol svg{display:block;width:min(95px,100%);height:100px;overflow:visible}.midi-beats{position:relative;color:#8a9b91;font-size:15px}.midi-beats span{position:absolute;transform:translateX(-50%)}.midi-beats .active{color:var(--teal);font-weight:800}.midi-cursor{position:absolute;top:140px;height:12px;width:3px;border-radius:3px;background:var(--teal);transform:translateX(-50%);will-change:left}
.midi-message{text-align:center;min-height:26px;color:var(--teal);font-size:18px}.midi-actions{display:flex;gap:18px;justify-content:center;margin:20px 0 30px}.midi-results:not(:empty){background:#fffdf6;border:1px solid #e0e0d0;border-radius:18px;padding:20px 25px}.midi-results h2{font-size:20px;margin:0 0 15px}.midi-results p{font-size:16px;margin:10px 0}.midi-help{font-size:14px;color:#617974;line-height:1.7;margin-top:25px}
@media(max-width:700px){.midi-practice{padding:20px}.midi-header{align-items:flex-start;flex-direction:column;gap:15px}.midi-header h1{font-size:30px}.midi-settings{gap:18px}.midi-connections{gap:14px}.midi-practice select{max-width:220px}.midi-score{gap:10px;padding:20px 0}.midi-meter{width:25px;font-size:34px}.midi-actions button{flex:1}.midi-symbol svg{width:100%;max-width:95px}}
.midi-stars{display:flex;justify-content:center;gap:16px;margin:20px 0}.midi-stars .celebration-star{font-size:48px}.midi-results>h2{text-align:center}.midi-results>h3{text-align:center;font-size:18px}.midi-results .small{font-size:12px;color:#617974}
.midi-feedback-details{margin:18px 0 0}.midi-feedback-details>summary{list-style:none;display:table;margin:0 auto;padding:10px 18px;background:#e9ebdf;border:1px solid #bccdc1;border-radius:20px;color:var(--teal);font-weight:700;cursor:pointer}.midi-feedback-details>summary::-webkit-details-marker{display:none}.midi-feedback-details>summary:focus-visible{outline:3px solid var(--teal);outline-offset:3px}.midi-feedback-details[open]>summary{margin-bottom:18px}.midi-feedback-details[open]>summary:after{content:' ▴'}.midi-feedback-details:not([open])>summary:after{content:' ▾'}
.midi-notes>svg{display:block;width:100%;height:100px;overflow:visible}.midi-settings label:first-child{flex-basis:100%}.midi-settings #midi-section{max-width:min(420px,70vw);min-width:240px}
.practice-modes{display:flex;gap:8px;padding:6px;background:#e9ebdf;border-radius:18px;margin:0 0 24px;max-width:520px}.mode-choice{flex:1;padding:15px 20px;border:0;border-radius:13px;font-weight:800;font-size:16px;background:transparent;color:#627974}.mode-choice.selected{background:var(--teal);color:white;box-shadow:0 3px 10px #18373022}.midi-library-intro{font-size:16px;line-height:1.6;color:#617974;margin:0 0 22px}#midi-cards{display:grid;gap:18px}.midi-section-card{background:#edf2eb}.midi-result-dialog{width:min(600px,calc(100vw - 40px));max-height:85svh;overflow-y:auto}.midi-result-dialog::backdrop{background:#20323b77;backdrop-filter:blur(7px)}.midi-result-dialog .midi-results{border:0;background:transparent;padding:0}.midi-result-dialog .midi-stars{gap:14px;margin:26px 0}.midi-result-dialog .midi-stars .celebration-star{font-size:clamp(38px,7vw,65px)}.midi-result-dialog details{text-align:left}.midi-result-dialog .celebration-actions{margin-top:24px}

.midi-practice.exam-mode{border-radius:24px;padding:24px;--teal:#7951a6}.midi-practice.exam-mode .midi-score{background:#eee5f7}.exam-autoplay{opacity:.55}.midi-result-dialog.exam-celebration{background:#f5effc}

.practice-modes{max-width:760px;flex-wrap:wrap}.mode-choice{min-width:145px}.echo-prompt{height:105px;display:flex;align-items:center;justify-content:center;gap:14px;flex-wrap:wrap;text-align:center;color:var(--teal)}.echo-prompt>span{font-size:44px}.echo-prompt strong{font-size:22px}.echo-prompt small{flex-basis:100%;font-size:14px}.echo-feedback-score{margin:20px 0;overflow:hidden}.echo-feedback-score svg{display:block;width:100%;height:100px}

.echo-sound{display:inline-block;width:112px;height:64px;color:#9aa9a0}.echo-sound.sounding{color:var(--teal)}.echo-sound svg{display:block;width:100%;height:100%;overflow:visible}.echo-waves{opacity:0}.echo-sound.sounding .echo-waves{opacity:1;animation:echo-waves .6s ease-in-out infinite alternate}@keyframes echo-waves{from{transform:translateX(0);opacity:.65}to{transform:translateX(2px);opacity:1}}@media(prefers-reduced-motion:reduce){.echo-sound.sounding .echo-waves{animation:none}}

.echo-sound{position:relative;display:inline-flex;align-items:center;justify-content:center}.echo-note{font-size:44px;line-height:1}.echo-sound svg{position:absolute;inset:0}

.tap-entry{display:flex;align-items:center;gap:16px;flex-wrap:wrap;color:#617974;font-size:14px;margin-bottom:28px}.tap-tutorial{width:min(850px,calc(100vw - 30px));max-width:850px;max-height:94svh;overflow:auto;background:var(--paper);border:1px solid #b9c8b8;border-radius:26px;padding:28px;color:var(--ink)}.tap-tutorial::backdrop{background:#20323b88;backdrop-filter:blur(7px)}.tap-tutorial header,.tap-tutorial footer{display:flex;align-items:center;justify-content:space-between;gap:14px}.tap-tutorial h2{font-size:28px;margin:8px 0}.tap-tutorial p{line-height:1.5}.tap-tutorial footer{margin-top:22px;flex-wrap:wrap}.tap-tutorial footer span{font-size:13px;color:#617974}.tap-notation svg{width:100%;height:90px}.tap-beats{min-height:26px;text-align:center;color:var(--teal);font-weight:750}.tap-recess{padding:16px;border-radius:26px;background:#d7d2b8;box-shadow:inset 0 5px 12px #51492e55,inset 0 -2px 2px #fffaf0}.tap-pad{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;width:100%;min-height:200px;border:2px solid #fff3d8;border-radius:18px;background:linear-gradient(100deg,#e6bb7288,#f7dfab88 40%,#cda56766),url('assets/maple-pad.png') center/cover;color:#243d41;box-shadow:0 8px 0 #a68a59,0 12px 14px #51452e44,inset 0 2px 3px #fff8df;touch-action:none;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;transition:transform .07s,box-shadow .07s}.tap-pad:disabled{opacity:.7}.tap-pad strong{font-size:28px}.tap-pad small{font-size:14px}.tap-hand{font-size:40px;line-height:1}.tap-waves{position:absolute;right:24%;top:32%;width:48px;height:60px;opacity:0}.tap-pad.pressed{transform:translateY(6px);box-shadow:0 2px 0 #967747,inset 0 3px 9px #674e3266,0 0 0 4px #2a859177}.tap-pad.pressed .tap-waves,.tap-pad.example-sounding .tap-waves{opacity:1}.tap-pad.example-sounding{outline:4px solid #28738366}.tap-status{text-align:center;min-height:48px;color:var(--teal)}.tap-actions{display:flex;justify-content:center;gap:12px}@media(max-width:600px){.tap-tutorial{padding:20px}.tap-pad{min-height:175px}.tap-waves{right:12%}.tap-tutorial footer span{order:3;width:100%;text-align:center}}@media(prefers-reduced-motion:reduce){.tap-pad{transition:none}}

.echo-input-setting{display:flex;gap:14px;align-items:center;margin-bottom:20px;font-weight:750}.echo-pad-panel{max-width:800px;margin:28px auto 0}.echo-pad-panel .tap-pad{min-height:170px}.echo-pad-panel>p{text-align:center;font-size:14px;color:#617974}.echo-pad-panel .tap-pad:disabled{opacity:.65}

.midi-practice.stable-layout{padding:20px 30px}.stable-layout .midi-header{margin-bottom:12px;gap:24px}.stable-layout .midi-header h1{font-size:30px}.stable-layout .midi-header p{margin:3px 0}.stable-layout .echo-input-setting{margin-bottom:8px}.stable-layout .midi-settings{margin:8px 0;gap:18px}.stable-layout .midi-score{margin:10px 0;min-height:100px;padding:10px 8px}.stable-layout .midi-track{height:85px}.stable-layout .echo-prompt{height:78px;gap:8px}.stable-layout .midi-beats{position:absolute;bottom:-12px;width:100%}.stable-layout .midi-cursor{top:105px}.stable-layout .midi-meter{font-size:32px}.stable-layout .echo-pad-panel{margin:14px auto 0}.stable-layout .tap-recess{padding:12px}.stable-layout .tap-pad{min-height:130px;gap:6px}.stable-layout .tap-hand{font-size:28px}.stable-layout .tap-pad strong{font-size:24px}.stable-layout .echo-pad-panel>p{font-size:12px;margin:7px 0}.stable-layout .midi-message{font-size:16px;min-height:24px;margin:10px 0}.stable-layout .midi-actions{margin:10px 0}.stable-layout .midi-help{display:block}@media(min-height:850px){.stable-layout .tap-pad{min-height:200px}.stable-layout .midi-score{margin:20px 0}}@media(max-width:700px){.midi-practice.stable-layout{padding:18px}.stable-layout .midi-header{flex-direction:row;flex-wrap:wrap;gap:12px}.stable-layout .midi-header h1{font-size:26px}}

.stable-layout .midi-notes{height:85px}.stable-layout .midi-notes>svg{height:85px}

/* Reserve space for beat numbers above the pad at every viewport height. */
.stable-layout .midi-track{height:112px}
.stable-layout .midi-beats{bottom:0;height:24px;line-height:24px}
.stable-layout .midi-score{min-height:132px;margin-bottom:12px}
.stable-layout .echo-pad-panel{margin-top:22px}
.stable-layout .midi-cursor{top:114px;height:10px}

/* Balance the beat row between the score/cue and the wooden key. */
.stable-layout .midi-track{height:136px}
.stable-layout .midi-score{min-height:156px;margin-bottom:0}
.stable-layout .midi-beats{bottom:0;height:32px;line-height:32px;font-size:22px;font-weight:650;color:#657e79}
.stable-layout .echo-pad-panel{margin-top:16px}
.stable-layout .midi-cursor{top:138px;height:10px}

/* The input changes inside this shared slot; everything above and below stays anchored. */
.performance-input-area{display:grid;grid-template-areas:"input";grid-template-rows:196px;max-width:800px;margin:16px auto 0;width:100%;overflow:visible}
.performance-input-area>#midi-connections,.performance-input-area>#echo-pad-panel{grid-area:input;width:100%;height:196px;margin:0;min-height:0;max-width:none;box-sizing:border-box}
.performance-input-area>#midi-connections{align-content:center;overflow:auto}
.performance-input-area>#echo-pad-panel{display:flex;flex-direction:column;justify-content:space-between}
.performance-input-area .tap-recess{flex:1;min-height:0}
.performance-input-area .tap-pad{height:100%}
.performance-input-area #pad-turn-help{flex-shrink:0;margin:7px 0 0;line-height:20px}
.stable-layout .midi-message{height:48px;min-height:48px;display:flex;align-items:center;justify-content:center;line-height:1.4;overflow:auto;margin:8px 0}
.performance-guide{max-width:800px;margin:16px auto 0;font-size:14px;color:#617974}
.performance-guide>summary{cursor:pointer;text-align:center;font-weight:700}
.performance-guide .midi-help{margin:12px 0;line-height:1.5}
@media(min-height:850px){.performance-input-area{grid-template-rows:266px}.performance-input-area>#midi-connections,.performance-input-area>#echo-pad-panel{height:266px}}
@media(max-width:700px){.performance-input-area{grid-template-rows:246px}.performance-input-area>#midi-connections,.performance-input-area>#echo-pad-panel{height:246px}.stable-layout .midi-message{height:68px;min-height:68px}}

/* Animate individual arcs continuously; the sound gate only controls visibility.
   Keeping the phase running avoids restarting both arcs on every short note. */
.echo-sound.sounding .echo-waves{animation:none;opacity:1}
.sound-waves path,.echo-waves path,.tap-waves path{opacity:0;animation:outward-wave 360ms linear infinite both}
.sound-waves path:nth-child(2),.echo-waves .wave-outer,.tap-waves path:nth-child(2){animation-delay:90ms}
.tap-waves path:nth-child(3){animation-delay:180ms}
@keyframes outward-wave{0%,10%{opacity:1}45%,100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.sound-waves path,.echo-waves path,.tap-waves path{animation:none;opacity:1}}

.student-checkin{width:480px;max-height:90svh;overflow:auto;padding:32px;background:var(--paper)}.student-checkin::backdrop{background:#1b333e77;backdrop-filter:blur(8px)}.student-checkin h2{font-size:32px;line-height:1.15}.student-checkin label{display:flex;flex-direction:column;gap:8px;font-size:14px;font-weight:700;margin:18px 0}.student-checkin input,.student-checkin select{width:100%;padding:12px;border:1px solid #bdcbc2;border-radius:12px;background:#fffdf6;color:var(--ink);font:inherit}.student-checkin summary{cursor:pointer;color:var(--teal);font-weight:700}.student-checkin summary span{font-size:12px;font-weight:400;margin-left:8px}.student-checkin .student-start{width:100%;margin-top:8px}.student-links{display:flex;justify-content:space-between;margin-top:8px}.student-checkin .small{font-size:12px;line-height:1.5}#student-storage:empty{display:none}

#session-report{width:700px;max-width:94vw;max-height:90svh;overflow:auto}#session-report-copy,#session-report-details{white-space:pre-wrap;font-family:inherit;font-size:14px;line-height:1.65;color:var(--ink)}.report-actions{display:flex;flex-wrap:wrap;gap:10px}.home-top>div{display:flex;align-items:center;flex-wrap:wrap;justify-content:flex-end;gap:8px}

.session-end{position:fixed;right:12px;bottom:10px;z-index:10;border-radius:30px;padding:9px 15px;background:var(--teal);color:white;font-size:12px;box-shadow:0 2px 8px #1b333e33}

.mode-choice small{display:block;font-size:12px;font-weight:450;letter-spacing:0;margin-top:5px;opacity:.8}

/* Tray dimensions describe the notation; placed dimensions describe time. */
.game{height:auto;min-height:100svh}
.game .palette,.game.exam-mode .palette,.game .palette.scrolling{--tile-height:142px;display:flex;flex-wrap:wrap;align-items:start;justify-content:center;gap:18px 14px;overflow:visible;padding:16px 15px 23px;border-radius:18px;background:#e7dfc8;box-shadow:inset 0 4px 7px #66533233,inset 0 -2px 3px #fffdf3;touch-action:pan-y}
.game .palette.many-tiles{--tile-height:112px}
:is(.game,.welcome-art) .tray-tile{position:relative;isolation:isolate;overflow:hidden;flex:0 0 auto;width:calc(var(--tile-height)*var(--tile-ratio));height:var(--tile-height);border-radius:8px;border:1px solid #c5a575;padding:0;background:#ecd4aa;box-shadow:0 5px 0 #b29367,0 8px 10px #5e4b2b33,inset 0 1px 2px #fffdf2;color:#202c30;touch-action:manipulation}
:is(.game,.welcome-art) .tray-tile::before,.game .placed::before{content:"";position:absolute;width:1000px;height:1000px;left:50%;top:50%;transform:translate(-50%,-50%) rotate(90deg);background:linear-gradient(#fff8e8a6,#fff8e866),url('assets/maple-pad.png');background-size:1000px 1000px;background-position:var(--grain-x) var(--grain-y);z-index:-1;pointer-events:none}
:is(.game,.welcome-art) .tray-tile::after,.game .placed::after{content:"";position:absolute;inset:0;border-radius:inherit;box-shadow:inset 0 2px 2px #fffef0cc,inset 2px 0 3px #fff6df66,inset -1px -3px 3px #8b653033;pointer-events:none}
:is(.game,.welcome-art) .tile-symbol{position:absolute;inset:11% 12% 16%;display:flex;align-items:center;justify-content:center;pointer-events:none}
:is(.game,.welcome-art) .tile-symbol .tile-notation{display:block;width:100%;height:100%;max-width:none;margin:0;overflow:visible}
:is(.game,.welcome-art) .tile-beats{position:absolute;right:8px;bottom:5px;font:600 16px/1 Georgia,serif;color:#29302b;pointer-events:none}
:is(.game,.welcome-art) .tray-tile:active{transform:translateY(3px);box-shadow:0 2px 0 #b29367,0 3px 5px #5e4b2b33}
.game .placed{position:relative;isolation:isolate;overflow:hidden;background:#ecd4aa;border-color:#c0a77f;border-radius:10px;padding:0;box-shadow:inset 0 2px 3px #fff5dc,0 2px 3px #6b543433}
.game .placed .tile-symbol{inset:9% 12% 14%}
.game .placed .tile-symbol svg{max-width:230px}
.game .timeline{height:155px}
.game .playhead{height:162px}
@media(min-height:850px){.game .palette{--tile-height:180px}.game .palette.many-tiles{--tile-height:148px}.game .timeline{height:185px}.game .playhead{height:192px}}
@media(max-width:700px){.game .palette{--tile-height:125px;gap:16px 10px;padding:13px 10px 20px}.game .palette.many-tiles{--tile-height:105px}:is(.game,.welcome-art) .tile-beats{font-size:14px;right:6px}.game .timeline{height:135px}.game .playhead{height:142px}}
@media(orientation:landscape) and (max-height:540px){.game .palette{--tile-height:105px}.game .palette.many-tiles{--tile-height:92px}.game .timeline{height:112px}.game .playhead{height:119px}}

.welcome-art .art-tile{flex:0 0 126px;width:126px;height:180px;transform:rotate(-7deg);margin:0}
.welcome-art .art-half{transform:rotate(8deg);margin-top:20px}
.welcome-art .art-tile .tile-symbol{inset:11% 12% 16%}
#loop svg{display:block;width:26px;height:26px;margin:auto}
@media(max-width:1000px){.welcome-art .art-tile{flex-basis:105px;width:105px;height:150px}}
@media(max-width:700px) and (orientation:portrait){.welcome-art .art-tile{flex-basis:74px;width:74px;height:106px}.welcome-art .art-half{margin-top:12px}}

/* Three wooden pieces, with the pair of eighths layered in front. */
.welcome-art .art-tile{position:absolute;left:35%;top:49%;transform:translate(-50%,-50%) rotate(-12deg);margin:0;z-index:1}
.welcome-art .art-half{left:66%;top:48%;transform:translate(-50%,-50%) rotate(10deg);margin:0}
.welcome-art .art-front{left:51%;top:68%;width:148px;height:148px;transform:translate(-50%,-50%) rotate(-3deg);z-index:2}
.welcome-art .art-count{top:24px}.welcome-art .art-dash{bottom:18px}
#settings{color:var(--teal);display:grid;place-items:center}#settings svg{width:32px;height:32px;display:block}
@media(max-width:1000px){.welcome-art .art-front{width:126px;height:126px}}
@media(max-width:700px) and (orientation:portrait){.welcome-art .art-front{width:88px;height:88px}.welcome-art .art-count{top:15px}.welcome-art .art-dash{bottom:10px}}

/* Whole notes have a wide silhouette; reduce the ink without resizing the tile. */
[data-symbol="wholeNote"] .tile-symbol .tile-notation{transform:scale(.7);transform-origin:center}

/* Play surfaces must not invoke iPad selection / Look Up on a long press. */
.game,.game *,.midi-practice,.midi-practice *,.tap-tutorial,.tap-tutorial *{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.game input,.game textarea,.midi-practice input,.midi-practice textarea,.tap-tutorial input,.tap-tutorial textarea,[contenteditable="true"]{user-select:text;-webkit-user-select:text}

.tray-tile,.placed{touch-action:none;-webkit-touch-callout:none}.touch-drag-ghost{transition:none!important;box-sizing:border-box}.dragging{opacity:.35}

/* Contain gameplay in the viewport; only scroll inside it if content truly needs it. */
body:has(>.game:not([hidden])){height:100svh;overflow:hidden;overscroll-behavior:none}
.game{height:100svh;min-height:0;overflow-y:auto;overscroll-behavior:none}
.touch-drag-ghost{max-width:none!important;max-height:none!important}

/* Mode artwork swaps inside one fixed frame; the heading and navigation never move. */
.mode-art-layer{position:absolute;inset:0;pointer-events:none}
.mode-art-layer>img{display:block;width:100%;height:100%;object-fit:contain}

.daily-card{margin-top:24px;background:#edf0e4}.daily-card .section-number{color:var(--teal)}
.daily-dialog{width:700px;max-width:94vw;max-height:90svh;overflow:auto;padding:30px;background:var(--paper);border:1px solid #b9c8b8;border-radius:25px;color:var(--ink)}.daily-dialog::backdrop{background:#20323b88;backdrop-filter:blur(8px)}.daily-dialog h2{font-size:34px;margin:8px 0 16px;letter-spacing:-.035em}.daily-dialog p{line-height:1.55}.daily-dialog fieldset{border:1px solid #c8d0c1;border-radius:14px;margin:18px 0;padding:16px}.daily-dialog legend{font-weight:750;padding:0 7px}.daily-methods,.daily-tempos{display:flex;gap:18px;align-items:center;flex-wrap:wrap}.daily-dialog label{display:inline-flex;gap:8px;align-items:center;line-height:1.5}.daily-dialog input[type=checkbox]{accent-color:var(--teal);width:20px;height:20px;flex-shrink:0}.daily-dialog input[type=number]{width:78px;padding:9px;border:1px solid #b6c5bb;border-radius:9px;background:#fffdf7;color:var(--ink)}.daily-goals{display:flex;flex-direction:column;gap:16px}.daily-section-options{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.daily-dialog summary{font-weight:700;color:var(--teal);cursor:pointer}.daily-actions{display:flex;justify-content:flex-end;gap:12px;flex-wrap:wrap;margin-top:20px}#daily-error{color:#9d3b26}
.daily-toolbar{display:flex;align-items:center;gap:10px;background:#e7ecdf;border:1px solid #c8d1c0;border-radius:16px;padding:10px 14px;flex-shrink:0}.daily-toolbar>div{flex:1;min-width:0}.daily-toolbar strong{color:var(--teal);margin-right:14px}.daily-toolbar span{font-size:14px;font-variant-numeric:tabular-nums}.daily-toolbar small{display:block;margin-top:4px;color:#5b746f}.daily-toolbar button{padding:8px 14px;min-height:40px}.midi-practice>.daily-toolbar{margin:18px 0}.daily-mode .game-header .tempo-label select,.daily-mode #midi-tempo{pointer-events:none}.daily-mode .game-footer{gap:14px}
@media(max-width:650px){.daily-dialog{padding:20px}.daily-section-options{grid-template-columns:1fr}.daily-toolbar{flex-wrap:wrap}.daily-toolbar>div{flex-basis:100%}.daily-card{flex-wrap:wrap}.daily-card .section-number{font-size:36px}.daily-methods{flex-direction:column;align-items:flex-start}}

#daily-setup{font-size:14px;padding:24px}#daily-setup h2{font-size:30px;margin:6px 0 10px}#daily-setup p{margin:9px 0}#daily-setup fieldset{margin:13px 0;padding:12px}#daily-setup .daily-goals{gap:10px}#daily-setup input[type=number]{padding:7px;width:70px}#daily-setup .daily-actions{position:sticky;bottom:-24px;background:var(--paper);padding:12px 0;margin-top:12px;border-top:1px solid #d6dccd}#daily-setup .small{font-size:12px;line-height:1.4}
.daily-mode>[inert]{opacity:.55}
@media(max-height:850px) and (min-width:701px){.midi-practice.daily-mode{padding-top:12px;padding-bottom:16px}.daily-mode .midi-header h1{font-size:26px}.midi-practice.daily-mode>.daily-toolbar{margin:8px 0;padding:8px 12px}.daily-mode .midi-score{padding-top:4px;padding-bottom:4px;min-height:144px;margin-top:4px}.daily-mode .performance-input-area{grid-template-rows:156px;margin-top:10px}.daily-mode .performance-input-area>#echo-pad-panel,.daily-mode .performance-input-area>#midi-connections{height:156px}.daily-mode .tap-pad{min-height:100px}.daily-mode .midi-message{height:32px;min-height:32px;margin:4px 0}.daily-mode .midi-actions{margin:6px 0}.daily-mode .performance-guide{margin-top:8px}}
.daily-curve-controls{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin-top:14px}.daily-curve-stepper{display:flex;align-items:center;gap:8px}.daily-curve-stepper button{padding:4px 12px;min-height:36px;font-size:20px}.daily-curve-stepper input{text-align:center}
/* Never shrink the rhythm board into the status bar or footer. */
.game.daily-mode{gap:14px}.game.daily-mode .play-area{flex:1 0 auto;justify-content:flex-start;gap:16px}.game.daily-mode>.game-header,.game.daily-mode>.game-footer{flex-shrink:0}.game.daily-mode .timeline-panel,.game.daily-mode .palette-panel{flex-shrink:0}.game.daily-mode .game-footer{padding-top:6px;padding-bottom:4px}
@media(min-width:701px) and (max-height:900px){.game.daily-mode{gap:12px;padding-top:14px;padding-bottom:14px}.game.daily-mode .palette.many-tiles{--tile-height:96px;padding-top:12px;padding-bottom:18px;gap:16px 12px}.game.daily-mode .timeline{height:120px}.game.daily-mode .playhead{height:127px}.game.daily-mode .play-area{gap:12px}.game.daily-mode .timeline-panel{padding-top:12px;padding-bottom:12px}}
#daily-input-settings select{padding:9px 12px;border:1px solid #b6c5bb;border-radius:9px;background:#fffdf7;color:var(--ink);max-width:100%}.daily-midi-controls{display:flex;align-items:center;gap:14px;flex-wrap:wrap}.daily-midi-controls .primary{margin-top:0;padding:10px 18px;min-height:40px}#daily-midi-status{min-height:20px}#daily-input-settings .small{margin-bottom:10px}

/* Keep tutorial sound waves attached to their musical source. */
#tap-pad .tap-sound-emblem{width:150px;height:68px;flex:none;color:var(--teal)}
#tap-pad .tap-note{fill:#91a09a;transition:fill .08s}
#tap-pad .tap-emblem-waves{opacity:0}
#tap-pad.pressed .tap-note,#tap-pad.example-sounding .tap-note{fill:var(--teal)}
#tap-pad.pressed .tap-emblem-waves,#tap-pad.example-sounding .tap-emblem-waves{opacity:1}
.tap-emblem-waves path{opacity:0;animation:outward-wave 360ms linear infinite both}
.tap-emblem-waves path:nth-child(2){animation-delay:90ms}
@media(prefers-reduced-motion:reduce){.tap-emblem-waves path{animation:none;opacity:1}}

/* Celebrations grow with the rating; sound/reveal timing remains unchanged. */
[data-rating="1"] .celebration-star.revealed{animation:reward-modest .3s ease-out}
[data-rating="2"] .celebration-star.revealed{animation:reward-bounce .55s ease-out;filter:drop-shadow(0 0 5px #edb74366)}
[data-rating="3"] .celebration-star.revealed{animation:reward-leap .7s ease-out;filter:drop-shadow(0 0 10px #eeb43999)}
[data-rating="4"] .celebration-star.revealed{animation:reward-spin .85s cubic-bezier(.2,.7,.25,1);filter:drop-shadow(0 0 14px #ffc94ddd)}
[data-rating].star-finale::before,[data-rating].star-finale::after{content:"";position:absolute;pointer-events:none;z-index:2;left:50%;top:45%;width:7px;height:11px;border-radius:2px;opacity:0}
[data-rating="3"].star-finale::before,[data-rating="4"].star-finale::before{background:#e8b53b;box-shadow:-140px -45px #e8b53b,130px -65px #287383,-110px 65px #dc713b,155px 50px #e8b53b,-45px -95px #287383,50px 90px #dc713b;animation:reward-confetti 1s ease-out both}
[data-rating="4"].star-finale::before{animation-duration:1.7s;box-shadow:-180px -70px #e8b53b,175px -90px #287383,-145px 85px #dc713b,185px 65px #e8b53b,-60px -125px #287383,65px 115px #dc713b,-200px 15px #b58acb,205px -10px #dc713b,-90px 130px #e8b53b,110px -125px #b58acb,-35px -75px #dc713b,35px -55px #287383,-75px 35px #b58acb,80px 20px #e8b53b,-130px -110px #287383,135px 135px #dc713b,-170px 115px #e8b53b,175px -135px #b58acb,-15px 65px #e8b53b,20px -105px #dc713b}
[data-rating="4"].star-finale::after{background:#287383;box-shadow:-160px -85px #dc713b,155px -40px #e8b53b,-120px 95px #287383,145px 105px #b58acb,-20px -130px #e8b53b,15px 135px #dc713b,-215px 30px #e8b53b,210px 45px #287383,-55px -35px #e8b53b,55px 45px #dc713b,-105px -65px #b58acb,105px 75px #287383,-185px 70px #dc713b,185px -95px #e8b53b,-40px 110px #287383,40px -95px #b58acb;animation:reward-confetti 1.5s .2s ease-out both}
@keyframes reward-modest{from{opacity:.3;transform:scale(.85)}to{opacity:1;transform:scale(1)}}
@keyframes reward-bounce{0%{opacity:0;transform:scale(.6)}60%{opacity:1;transform:scale(1.2)}80%{transform:scale(.95)}100%{transform:scale(1)}}
@keyframes reward-leap{0%{opacity:0;transform:translateY(24px) scale(.4) rotate(-20deg)}55%{opacity:1;transform:translateY(-14px) scale(1.3) rotate(10deg)}80%{transform:translateY(4px) scale(.95)}100%{transform:none}}
@keyframes reward-spin{0%{opacity:0;transform:translateY(30px) scale(.2) rotate(-180deg)}60%{opacity:1;transform:translateY(-20px) scale(1.45) rotate(15deg)}80%{transform:translateY(5px) scale(.92) rotate(-5deg)}100%{transform:none}}
@keyframes reward-confetti{0%{opacity:0;transform:scale(.25) translateY(15px) rotate(-12deg)}20%{opacity:1}70%{opacity:1}100%{opacity:0;transform:scale(1.15) translateY(50px) rotate(12deg)}}
@media(prefers-reduced-motion:reduce){[data-rating] .celebration-star.revealed{animation:none}[data-rating].star-finale::before,[data-rating].star-finale::after{display:none}}

.marathon-dialog{width:min(1100px,95vw);max-width:95vw;max-height:94svh;padding:24px;overflow:auto;background:var(--paper);border:1px solid #cbd2c4;border-radius:26px;color:var(--ink)}
.marathon-dialog::backdrop{background:#20323b88;backdrop-filter:blur(7px)}
.marathon-dialog header,.marathon-dialog footer,.marathon-options{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}
.marathon-dialog h2{margin:4px 0;font-size:32px}.marathon-options{justify-content:flex-start;margin:18px 0}.marathon-options select{padding:8px;border:1px solid #b8c7bc;border-radius:10px;background:#fffdf7;color:var(--ink)}
.marathon-window{height:220px;position:relative;overflow:hidden;background:#e9ebdf;border-radius:18px;margin:18px 0 24px;contain:paint}
.marathon-strip{display:flex;position:absolute;top:14px;left:0;will-change:transform}
.marathon-measure{flex:none;border-right:2px solid #91a39b;height:185px;position:relative}
.marathon-measure small{display:block;margin:0 0 12px 24px;color:#617974}.marathon-measure svg{display:block;width:100%;height:auto}
.marathon-beats{position:absolute;bottom:0;display:flex;width:100%;color:#617974}.marathon-beats span{width:25%;transform:translateX(-4px)}
.marathon-dialog .tap-pad{min-height:130px}.marathon-dialog footer{justify-content:center;margin-top:16px}
#marathon-status{min-height:26px;color:var(--teal)}#marathon-result{text-align:center;min-height:28px;font-weight:750;color:var(--teal)}
.marathon-dialog{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}

.marathon-measure{border-right:0;box-shadow:inset -2px 0 #91a39b}
@media(max-height:800px){.marathon-dialog{padding:18px}.marathon-dialog header .eyebrow{margin:0}.marathon-dialog h2{font-size:26px}.marathon-options{margin:10px 0}.marathon-window{height:190px;margin:10px 0 18px}.marathon-measure{height:165px}.marathon-dialog .tap-pad{min-height:100px}.marathon-dialog #marathon-result{margin:12px 0}.marathon-dialog footer{margin-top:8px}}

/* Barlines sit ahead of beat one, leaving engraving space without shifting onsets. */
.marathon-measure{box-shadow:none}
.marathon-measure::before,.marathon-measure:last-child::after{content:"";position:absolute;top:12px;bottom:0;width:2px;background:#91a39b;pointer-events:none}
.marathon-measure::before{left:-26px}
.marathon-measure:last-child::after{right:26px}
.marathon-measure small{margin-left:0}

/* A little more room after each barline; note and click positions are unchanged. */
.marathon-measure::before{left:-34px}
.marathon-measure:last-child::after{display:none}
.marathon-measure.marathon-last::after{display:block;right:34px}
.marathon-strip{display:block}
.marathon-measure{position:absolute}
.marathon-options{font-size:14px;gap:12px 20px;align-items:center}
.marathon-options label{display:flex;align-items:center;gap:8px}
.marathon-options input[type=number]{width:78px;padding:8px;border:1px solid #b8c7bc;border-radius:10px;background:#fffdf7;color:var(--ink)}
.marathon-options input[type=checkbox]{width:20px;height:20px;accent-color:var(--teal)}
.marathon-options small{color:#617974}
.marathon-midi{padding:16px;background:#e9ebdf;border-radius:16px;display:flex;gap:16px;flex-wrap:wrap;align-items:center}
.marathon-midi p{width:100%;margin:0;color:#617974}
.marathon-midi select{padding:8px;border:1px solid #b8c7bc;border-radius:10px}
.marathon-result{position:relative;text-align:center;overflow:hidden;border-radius:18px;background:#fffdf7;padding:20px;margin-top:20px}
.marathon-result .celebration-stars{margin:10px 0}
.marathon-result details{text-align:left;font-size:14px;font-weight:400}
#marathon-result{min-height:0}
#marathon-result-copy{font-size:16px}
#marathon-measure-scores{max-height:160px;overflow:auto}
.marathon-dialog footer{position:sticky;bottom:-18px;background:var(--paper);padding:12px 0 4px;z-index:3}
@media(max-width:600px){.marathon-options{align-items:flex-start;gap:12px}.marathon-options>label:first-child{width:100%;flex-wrap:wrap}.marathon-options>label:first-child select{max-width:100%}.marathon-dialog{padding:16px}}

#marathon-settings{margin-top:12px}
#marathon-settings>summary{cursor:pointer;font-weight:750;color:var(--teal)}
.marathon-dialog .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}

/* Engraved margins on BOTH sides of every barline. */
.marathon-measure::before{left:0}
.marathon-measure.marathon-last::after{right:0}
.marathon-beats span{position:absolute;width:auto;transform:translateX(-50%)}
.marathon-beats{height:20px}

/* Constant temporal spacing: place barlines between the neighboring symbols. */
.marathon-measure::before{left:-34px}
.marathon-measure.marathon-last::after{right:34px}

.practice-modes{max-width:none}
.recess-styles{display:grid;grid-template-columns:1fr 1fr;gap:18px}
.recess-styles .section-card{align-items:flex-start;gap:20px}
.recess-styles .section-copy p{min-height:48px}
.practice-setup{width:min(760px,calc(100vw - 32px))}
.hub-fields{display:flex;align-items:center;gap:16px 24px;flex-wrap:wrap}
.hub-fields label,.hub-style-label{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.practice-setup select{padding:9px;border-radius:10px;border:1px solid #b8c7bc;background:#fffdf7;color:var(--ink);max-width:100%}
.practice-setup input[type=number]{width:80px}
#hub-midi{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin-top:14px}
#hub-midi-status{width:100%;margin:0}
#hub-error{color:#a33f30}
.practice-setup .daily-actions{position:sticky;bottom:-24px;background:#fffdf7;padding:16px 0 4px;z-index:2}
@media(max-width:700px){.recess-styles{grid-template-columns:1fr}.practice-modes{flex-wrap:wrap}.practice-modes .mode-choice{flex-basis:42%;padding:14px 10px}}

/* iPad long presses must remain musical input, including over child labels. */
.marathon-dialog,.marathon-dialog *,.tap-pad,.tap-pad *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.tap-pad>*{pointer-events:none}
.marathon-dialog input,.marathon-dialog textarea{-webkit-user-select:text;user-select:text}

/* Marathon shares the centered, blurred-background star celebration. */
dialog.marathon-result{position:fixed;inset:0;margin:auto;width:min(600px,calc(100vw - 32px));max-height:90svh;padding:32px;overflow:auto;background:#fffdf7;border:1px solid #cbd2c4;border-radius:26px;color:var(--ink)}
dialog.marathon-result::backdrop{background:#20323b77;backdrop-filter:blur(7px);-webkit-backdrop-filter:blur(7px)}
dialog.marathon-result .celebration-stars{margin:26px 0}
dialog.marathon-result h2{font-size:30px;letter-spacing:-.035em;margin:12px 0}
dialog.marathon-result details{margin:20px 0}
dialog.marathon-result .celebration-actions{margin-top:24px}

/* Native iPhone: a focused tile game, with a single reachable scrolling tray. */
.phone-app .home{padding:20px 18px 32px}
.phone-app .home-top{gap:12px;align-items:flex-start}
.phone-app .home-top>div{display:flex;flex-direction:column;align-items:flex-end;gap:4px}
.phone-app .home-top .secondary{font-size:13px;padding:10px 14px;min-height:44px}
.phone-app .welcome{grid-template-columns:1fr;padding:24px 0;gap:12px}
.phone-app .welcome h1{font-size:66px;margin:16px 0}
.phone-app .welcome .lead{font-size:19px;max-width:280px}
.phone-app .welcome-art{height:185px;width:100%;max-width:380px;margin:4px auto 12px}
.phone-app .welcome-note{font-size:13px}
.phone-app .practice-modes{display:block;margin-bottom:20px}
.phone-app .practice-modes .mode-choice{width:100%;min-width:0;padding:12px}
.phone-app .section-card{padding:20px;gap:12px;flex-wrap:wrap}
.phone-app .section-copy{min-width:0;flex:1}
.phone-app .section-copy h2{font-size:23px}
.phone-app .section-card>.primary{width:100%}
.phone-app .game{height:100svh;min-height:540px;padding:12px 12px 16px;gap:12px;overflow:hidden}
.phone-app .game-header{flex-wrap:wrap;gap:8px;flex-shrink:0}
.phone-app .game-title h1{font-size:23px}
.phone-app .game-title p{font-size:13px}
.phone-app .header-tools{width:100%;margin:4px 0 0;gap:6px;justify-content:space-between}
.phone-app .tempo-label{font-size:19px}
.phone-app .replays{font-size:12px;padding:10px}
.phone-app .round-button{width:44px;height:44px;flex-shrink:0}
.phone-app .play-button{font-size:16px;min-width:80px;padding:10px}
.phone-app .game .play-area{margin:0;gap:20px;min-height:0;justify-content:center}
.phone-app .game .timeline{height:125px;gap:5px}
.phone-app .game .beat-labels{gap:5px;font-size:10px}
.phone-app .game .playhead{height:132px}
.phone-app .game .timeline-panel{padding:13px 8px}
.phone-app .game .timeline-panel>p{font-size:11px;line-height:1.5}
.phone-app .game .palette,.phone-app .game .palette.many-tiles{--tile-height:125px;display:flex;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;touch-action:pan-x;gap:12px;padding:14px 12px 22px;scrollbar-width:thin}
.phone-app .game .palette .tray-tile{flex-shrink:0;touch-action:pan-x}
.phone-app .palette-heading{gap:8px}
.phone-app .palette-heading p{font-size:10px;text-align:right}
.phone-app .game-footer{flex-shrink:0;display:grid;grid-template-columns:44px 1fr;gap:8px}
.phone-app .game-footer>p{font-size:12px;line-height:1.4}
.phone-app .game-footer>.check-button,.phone-app .game-footer>.primary{grid-column:1/-1;width:100%;min-height:48px}
.phone-app dialog{max-height:90svh;overflow:auto;padding:22px;max-width:calc(100vw - 24px)}
.phone-app .celebration-actions{flex-wrap:wrap}
.phone-app .session-end{font-size:12px;padding:10px}
@media(orientation:landscape) and (max-height:540px){
 .phone-app .game{min-height:320px;padding:8px max(18px,env(safe-area-inset-left));gap:8px}
 .phone-app .game-header{flex-wrap:nowrap}.phone-app .game-title h1{font-size:20px}.phone-app .header-tools{width:auto;margin:0 0 0 auto}
 .phone-app .game .play-area{gap:10px}.phone-app .game .timeline{height:70px}.phone-app .game .playhead{height:77px}
 .phone-app .game .palette,.phone-app .game .palette.many-tiles{--tile-height:85px;padding:10px 12px 17px}
 .phone-app .game-footer{display:flex}.phone-app .game-footer>.check-button,.phone-app .game-footer>.primary{width:auto;min-height:44px}.phone-app .game-footer>p{flex:1}
}

/* The phone web view fills the screen; controls respect the hardware safe areas. */
.phone-app .home{padding-top:max(20px,env(safe-area-inset-top));padding-right:max(18px,env(safe-area-inset-right));padding-bottom:max(32px,env(safe-area-inset-bottom));padding-left:max(18px,env(safe-area-inset-left))}
.phone-app .game{display:grid;grid-template-rows:auto minmax(0,1fr) auto;min-height:0;padding-top:max(12px,env(safe-area-inset-top));padding-bottom:max(16px,env(safe-area-inset-bottom));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}
.phone-app .game .play-area{display:grid;grid-template-rows:auto auto;align-content:center;justify-content:stretch}
.phone-app .game .timeline-panel,.phone-app .game .palette-panel{min-width:0;flex-shrink:0}
@media(orientation:landscape) and (max-height:540px){
 .phone-app .game{padding-top:8px;padding-bottom:max(8px,env(safe-area-inset-bottom));padding-left:max(18px,env(safe-area-inset-left));padding-right:max(18px,env(safe-area-inset-right));gap:8px}
 .phone-app .game-header{min-height:48px;align-items:center}
 .phone-app .game-title h1{font-size:19px;line-height:1.15}
 .phone-app .game-title p{font-size:11px;line-height:1.3;margin:3px 0 0}
 .phone-app .game .play-area{gap:10px;align-content:center}
 .phone-app .game .timeline{height:55px}
 .phone-app .game .playhead{height:62px;top:28px}
 .phone-app .game .timeline-panel{padding:9px 8px}
 .phone-app .game .beat-labels{margin-bottom:6px;font-size:9px}
 .phone-app .game .timeline-panel>p{margin:6px 0 0;font-size:10px;line-height:1.3}
 .phone-app .palette-heading{margin-bottom:6px}
 .phone-app .palette-heading h2{font-size:11px}
 .phone-app .game .palette,.phone-app .game .palette.many-tiles{--tile-height:75px;padding:9px 12px 17px}
 .phone-app .game-footer{min-height:44px;gap:10px}
 .phone-app .game-footer>p{font-size:11px}
 .phone-app .game-footer>.check-button,.phone-app .game-footer>.primary{padding:10px 18px;font-size:14px}
}

.imposter-entry{margin:20px 0}
.imposter-dialog{width:min(1000px,calc(100vw - 28px));max-width:1000px;max-height:94svh;overflow:auto;padding:26px}
.imposter-dialog header,.imposter-dialog footer,.imposter-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
.imposter-dialog h2{margin:8px 0}.imposter-fields{display:flex;flex-wrap:wrap;gap:18px;margin:24px 0}.imposter-fields label{display:flex;flex-direction:column;gap:8px}.imposter-fields select,.imposter-fields input{padding:10px;border-radius:10px;border:1px solid #becabb;background:#fffdf7;color:var(--ink);max-width:100%;min-height:44px}.imposter-fields input{width:90px}
.imposter-dialog .imposter-game{display:flex;height:auto;min-height:0;overflow:visible;padding:0;margin-top:20px;gap:18px}
.imposter-dialog .imposter-toolbar strong{flex:1;color:var(--teal)}
.imposter-dialog .timeline{height:145px}.imposter-dialog .beat-labels{grid-auto-flow:column}
.imposter-dialog .imposter-tile{cursor:pointer}.imposter-tile[aria-pressed=true]{outline:3px solid var(--teal);outline-offset:3px}.imposter-tile.imposter-clue{box-shadow:0 0 0 5px #d79942}.imposter-tile.imposter-playing{filter:brightness(1.15);transform:translateY(-3px)}
.imposter-dialog .palette{--tile-height:125px;min-height:36px}.imposter-dialog .palette .tray-tile[aria-pressed=true]{outline:3px solid var(--teal);outline-offset:3px}.imposter-dialog h3{margin:0;font-size:15px}
.imposter-dialog #imposter-status{min-height:48px;margin:0;line-height:1.5}.imposter-rating{margin:0;color:var(--teal);font-weight:750}.imposter-dialog footer{justify-content:flex-start;padding:4px 0 8px}.imposter-dialog footer .primary{margin-top:0}#imposter-error{color:#a33f30}
@media(max-width:600px){.imposter-dialog{padding:18px}.imposter-dialog header h2{font-size:25px}.imposter-fields{gap:12px}.imposter-fields label:first-child{width:100%}.imposter-dialog .timeline{height:112px}.imposter-dialog .palette{--tile-height:115px;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto}.imposter-dialog footer button{font-size:13px;padding:12px 16px}.imposter-dialog .imposter-toolbar{gap:8px}.imposter-dialog .imposter-toolbar strong{width:100%;flex-basis:100%}}
@media(orientation:landscape) and (max-height:540px){.imposter-dialog{padding:16px;max-height:96svh}.imposter-dialog .timeline{height:80px}.imposter-dialog .palette{--tile-height:85px}.imposter-dialog .imposter-game{gap:12px}.imposter-dialog #imposter-status{min-height:0}.imposter-dialog header h2{font-size:24px}}
/* Keep replacement choices on one row and the commit controls within reach. */
.imposter-dialog .palette{--tile-height:105px;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;min-height:141px;touch-action:pan-x}
.imposter-dialog .imposter-game{gap:12px}
.imposter-dialog .timeline{height:115px}
.imposter-dialog footer{position:sticky;bottom:-26px;background:#fffdf6;z-index:4;padding:12px 0}
.imposter-dialog #imposter-status{min-height:30px;font-size:14px}
@media(max-width:600px){.imposter-dialog footer{bottom:-18px}.imposter-dialog .timeline{height:100px}}
@media(orientation:landscape) and (max-height:540px){.imposter-dialog .timeline{height:80px}.imposter-dialog .palette{--tile-height:85px;min-height:121px}.imposter-dialog footer{bottom:-16px}}
@media(min-width:601px) and (max-height:850px){
 .imposter-dialog{padding:18px 24px}
 .imposter-dialog header .eyebrow{margin:0 0 4px}
 .imposter-dialog header h2{font-size:25px;margin:0}
 .imposter-dialog .imposter-game{margin-top:12px;gap:8px}
 .imposter-dialog .timeline-panel{padding:10px}
 .imposter-dialog .timeline{height:88px}
 .imposter-dialog .beat-labels{margin-bottom:6px}
 .imposter-dialog .timeline-panel>p{margin:6px 0 0;font-size:11px;line-height:1.3}
 .imposter-dialog .palette{--tile-height:90px;min-height:126px;padding-top:10px;padding-bottom:20px}
 .imposter-dialog .palette-heading{margin-bottom:6px}
 .imposter-dialog #imposter-status{min-height:21px;font-size:13px}
 .imposter-dialog .imposter-rating{font-size:13px}
 .imposter-dialog footer{bottom:-18px;padding:8px 0}
}
/* The speaker marks actual piano note gates, staying quiet through rests. */
#imposter-speaker{align-self:flex-start;width:48px;height:38px;margin-bottom:-44px;position:relative}
.imposter-dialog #imposter-rating,.imposter-dialog #imposter-status{padding-left:62px}
.imposter-dialog .imposter-tile:disabled{opacity:1}
.cat-pet{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:transparent;pointer-events:auto;cursor:grab;touch-action:manipulation;-webkit-tap-highlight-color:transparent;-webkit-touch-callout:none}
.cat-pet:active{cursor:grabbing}
.cat-pet:focus-visible{outline:3px solid var(--teal);outline-offset:4px;border-radius:40%}
.cat-cuddle>img{animation:cat-cuddle .5s ease-out;transform-origin:50% 88%}
@keyframes cat-cuddle{0%,100%{transform:translateY(0) rotate(0)}30%{transform:translateY(-8px) rotate(-2deg)}65%{transform:translateY(-2px) rotate(2deg)}}
@media(prefers-reduced-motion:reduce){.cat-cuddle>img{animation:none}}
/* Challenge phrases stay fixed for their whole two-measure turn. */
.marathon-challenge{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));background:#e9ebdf;border-radius:18px;margin:18px 0 24px;padding:24px 12px;color:var(--ink);min-height:180px}
.challenge-measure{min-width:0;border-right:2px solid #8b9e95;padding:0 4px 10px}
.challenge-measure:last-child{border-right:4px double #8b9e95}
.challenge-measure small{display:block;margin:0 12px 16px;color:#617974;font-size:13px}
.challenge-measure svg{display:block;width:100%;height:auto}
@media(max-height:800px){.marathon-challenge{padding:18px 10px;min-height:145px;margin:12px 0 18px}.challenge-measure small{margin-bottom:14px}}
.marathon-status-row{display:flex;align-items:center;gap:18px}
.marathon-status-row.challenge-status{min-height:86px}
.marathon-status-row #marathon-status{margin:12px 0;flex:1}
.marathon-count{width:72px;height:72px;flex-shrink:0;border-radius:50%;display:grid;place-items:center;background:#e5ebdf;color:var(--teal)}
#marathon-count-number{font-size:56px;line-height:1;font-weight:850;font-variant-numeric:tabular-nums;display:block}
.count-pulse{animation:preparation-pulse .32s ease-out both}
@keyframes preparation-pulse{0%{opacity:.35;transform:scale(.78)}55%{opacity:1;transform:scale(1.12)}100%{opacity:1;transform:scale(1)}}
@media(prefers-reduced-motion:reduce){.count-pulse{animation:none}}

/* Rest tiles have no staff: keep the half rest comfortably within the face. */
[data-symbol="halfRest"] .tile-symbol .tile-notation{transform:translateY(14%)}

/* The illustrated wordmark occupies the existing title slot. */
.welcome h1.rhythm-wordmark{height:1.84em;max-width:460px}
.rhythm-wordmark img{position:absolute;left:0;bottom:0;display:block;width:100%;height:125%;object-fit:contain;object-position:left bottom}

.phone-app .welcome h1.rhythm-wordmark{margin-top:44px}

/* Feature the phone's sole mode beside the wordmark in landscape. */
@media(orientation:landscape){
 .phone-app .welcome{grid-template-columns:minmax(0,1fr) minmax(0,1fr);align-items:center;gap:28px}
 .phone-app .welcome-art{height:clamp(190px,48svh,280px);max-width:430px;margin:0 auto}
}

/* A single-mode phone home does not need a mode selector. */
.phone-app .practice-modes{display:none}

/* Phone hero: the wooden tiles sit directly on the page. */
.phone-app .welcome-art{background:transparent;transform:translate(-18px,-18px) rotate(-6deg)}
.phone-app .welcome-art .art-count{display:none}

/* A distinct coral puzzle destination on iPhone. */
.phone-app #imposter-entry{background:#fbe3d7;border-color:#e7b09a}
.phone-app #imposter-entry .eyebrow,.phone-app #imposter-entry h2{color:#944b32}
.phone-app #imposter-entry .primary{background:#b75d3f}
.phone-app .imposter-dialog{--teal:#b75d3f;background:#fff8f1;border-color:#e7b09a}
.phone-app .imposter-dialog .timeline-panel{background:#fbe3d7}
.phone-app .imposter-dialog .secondary{background:#fbe3d7}
@media(orientation:landscape){
 .phone-app dialog.imposter-dialog{width:calc(100vw - 20px);max-width:none;max-height:calc(100svh - 12px);padding:10px max(16px,env(safe-area-inset-left));overflow:auto}
 .phone-app .imposter-dialog header{flex-wrap:nowrap;gap:8px}
 .phone-app .imposter-dialog header .eyebrow{display:none}
 .phone-app .imposter-dialog header h2{font-size:20px;line-height:1.2;margin:0}
 .phone-app .imposter-dialog button{min-height:32px;padding:6px 14px;font-size:12px}
 .phone-app .imposter-dialog .imposter-game{display:flex;position:relative;height:auto;min-height:0;overflow:visible;padding:0;margin:6px 0 0;gap:4px}
 .phone-app .imposter-dialog .imposter-toolbar{flex-wrap:nowrap;gap:8px}
 .phone-app .imposter-dialog .imposter-toolbar strong{font-size:12px;width:auto;flex:1}
 .phone-app .imposter-dialog .timeline-panel{padding:6px 8px;border-radius:14px}
 .phone-app .imposter-dialog .beat-labels{font-size:9px;margin-bottom:4px}
 .phone-app .imposter-dialog .timeline{height:60px;gap:6px}
 .phone-app .imposter-dialog .timeline-panel>p{display:none}
 .phone-app .imposter-dialog .palette-heading{margin:0 0 3px}
 .phone-app .imposter-dialog h3{font-size:11px}
 .phone-app .imposter-dialog .palette{--tile-height:58px;min-height:78px;padding:7px 10px 13px;gap:10px}
 .phone-app .imposter-dialog #imposter-rating{font-size:11px;line-height:16px;margin:0;padding-left:38px}
 .phone-app .imposter-dialog #imposter-status{font-size:11px;line-height:15px;min-height:15px;margin:0;padding-left:38px}
 .phone-app .imposter-dialog #imposter-speaker{position:absolute;left:0;bottom:42px;width:30px;height:28px;margin:0}
 .phone-app .imposter-dialog footer{position:static;flex-wrap:nowrap;gap:8px;background:#fff8f1;padding:2px 0 0}
 .phone-app .imposter-dialog footer button{min-height:36px}
}

/* Consistent compact entry buttons and uncluttered phone puzzle tiles. */
.phone-app .section-card>.primary,.phone-app .section-card .section-copy>.primary{width:220px;max-width:100%;min-height:46px;padding:14px 20px;align-self:flex-start}
.phone-app .imposter-dialog .tile-beats{display:none}

.imposter-dialog .setting-row{justify-content:flex-start;gap:12px;width:fit-content}
.imposter-dialog .setting-row input{flex:none;margin:0}

.live-beat-count{width:72px;height:72px;flex:none;border-radius:50%;display:grid;place-items:center;background:#e5ebdf;color:var(--teal)}
.live-beat-count span{font-size:56px;line-height:1;font-weight:850;font-variant-numeric:tabular-nums;display:block}
.imposter-toolbar .live-beat-count{width:64px;height:64px}
.imposter-toolbar .live-beat-count span{font-size:50px}

.beat-status-row{display:flex;align-items:center;gap:16px;min-height:72px}
.beat-status-row>p{flex:1;margin:8px 0}

.live-beat-count,.marathon-count{position:relative;margin-bottom:20px}
.beat-cue{position:absolute;top:100%;left:50%;transform:translateX(-50%);margin-top:4px;font-size:20px;line-height:1;font-weight:850;white-space:nowrap;color:var(--teal)}
.beat-cue.count-pulse{animation:beat-cue-pulse .32s ease-out both}
@keyframes beat-cue-pulse{from{opacity:.35;transform:translateX(-50%) scale(.8)}to{opacity:1;transform:translateX(-50%) scale(1)}}
@media(prefers-reduced-motion:reduce){.beat-cue.count-pulse{animation:none}}

.practice-transport{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:6px 0}
.support-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:7px 12px;border-radius:24px;background:#e6eadd;color:var(--ink);font-size:12px;font-weight:750;border:1px solid transparent}
.support-toggle svg{width:23px;height:23px}.support-toggle b{font-size:19px;line-height:1}
.support-toggle[aria-pressed=true]{color:white;background:var(--teal)}
.restart-exam{font-size:12px;min-height:36px;padding:8px 14px}
.game{grid-template-rows:auto auto minmax(0,1fr) auto}
.game>.practice-transport{margin:0}.midi-practice>.practice-transport{display:inline-flex;margin-right:12px}
.phone-app .game{grid-template-rows:auto auto minmax(0,1fr) auto}
@media(orientation:landscape) and (max-height:540px){.phone-app .game>.practice-transport{position:absolute;top:56px;right:max(18px,env(safe-area-inset-right));z-index:3}.phone-app .support-toggle{min-height:28px;padding:3px 8px;font-size:10px}.phone-app .support-toggle svg{width:18px;height:18px}.phone-app .game .game-header{padding-bottom:30px}.phone-app .restart-exam{min-height:30px;padding:5px 8px;font-size:10px}.phone-app .imposter-dialog .practice-transport{margin:4px 0}.phone-app .imposter-dialog .support-toggle{min-height:28px}}

#echo-count-in-setting{display:none!important}

@media(orientation:landscape) and (max-height:540px){.phone-app .game{grid-template-rows:auto minmax(0,1fr) auto}}

/* Echo the wordmark's warm orange in the optional student check-in. */
#student-open{background:var(--student-orange);color:#1b333e}

#session-goal{width:560px;max-width:94vw;max-height:90svh;overflow:auto;background:var(--paper)}
#session-goal::backdrop{background:#1b333e77;backdrop-filter:blur(8px)}
#session-goal p{line-height:1.5}#session-extend{margin-top:18px}#session-extend label{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:14px}#session-extra-minutes{padding:10px;border:1px solid #bdcbc2;border-radius:12px;background:#fffdf6}
.session-end{background:#e58a2c;color:var(--ink)}

/* Playback support shares the transport row instead of reducing score space. */
.game,.phone-app .game{grid-template-rows:auto minmax(0,1fr) auto}
.header-tools>.practice-transport,.midi-settings>.practice-transport{margin:0;flex-wrap:nowrap;flex-shrink:0}
.header-tools .support-toggle{width:42px;height:42px;min-height:42px;padding:8px}
.header-tools .support-toggle span{display:none}
#exam-entry{width:490px;max-width:94vw;background:var(--paper)}#exam-entry p{line-height:1.5}
@media(orientation:landscape) and (max-height:540px){.phone-app .game .game-header{padding-bottom:0}.phone-app .header-tools .support-toggle{width:32px;height:32px;min-height:32px;padding:5px}.phone-app .header-tools{gap:6px}.phone-app .header-tools>.practice-transport{gap:5px}}

/* Center Copy Cat's listening cue on the same axis as its wooden pad. */
.performance-guide{display:none}
.midi-score{position:relative}
.midi-score:has(.echo-prompt:not([hidden])) .midi-track{position:relative}
.stable-layout .echo-prompt{position:absolute;left:calc(50% - 32.5px);top:10px;transform:translateX(-50%);width:min(600px,calc(100% - 100px));height:88px;align-content:center}
@media(min-width:701px) and (min-height:650px){
 .midi-practice.stable-layout{height:100svh;min-height:0;display:flex;flex-direction:column;padding-top:16px;padding-bottom:16px}
 .stable-layout .midi-header,.stable-layout .midi-settings,.stable-layout .echo-input-setting,.stable-layout .performance-input-area,.stable-layout .beat-status-row,.stable-layout .midi-actions{flex-shrink:0}
 .stable-layout .midi-score{flex:1;min-height:156px;max-height:260px;margin-top:10px;margin-bottom:0}
 .stable-layout .performance-input-area{margin-top:12px}
 .stable-layout .midi-actions{margin:6px 0 0}
 .stable-layout .midi-score:has(.echo-prompt:not([hidden])) .midi-track{align-self:center}
 .stable-layout .echo-prompt{top:50%;transform:translate(-50%,-65%)}
}

@media(max-width:700px){.stable-layout .echo-prompt{left:calc(50% - 17.5px)}}
.beat-sound-choice{display:inline-flex;gap:6px;align-items:center;font-size:12px}.beat-sound-choice select{padding:6px 8px;border:1px solid #bdcbc2;border-radius:12px;background:#fffdf6;color:var(--ink)}

/* Keep the counting badge's footprint before, during and after playback. */
#rhythm-beat-count[hidden]{display:grid!important;visibility:hidden}
.phone-app #rhythm-beat-count[hidden]{display:none!important}
#play{width:116px;flex-shrink:0}
.phone-app #play{width:80px}

/* Let the Rhythm Tiles hero pieces sit directly on the page, as on iPhone. */
.welcome-art:has([data-mode-art="tiles"]:not([hidden])){background:transparent;transform:translate(-20px,-24px) rotate(-6deg)}
.welcome-art .art-count{display:none}
@media(min-width:701px){
 :root:not(.phone-app) .welcome-art .art-tile{width:156px;height:222px}
 :root:not(.phone-app) .welcome-art .art-front{width:184px;height:184px}
}
@media(min-width:701px) and (max-width:1000px){
 :root:not(.phone-app) .welcome-art .art-tile{width:132px;height:188px}
 :root:not(.phone-app) .welcome-art .art-front{width:156px;height:156px}
}
.phone-app .welcome-art:has([data-mode-art="tiles"]:not([hidden])){transform:translate(-18px,-18px) rotate(-6deg)}
@media(min-width:701px){
 :root:not(.phone-app) .welcome-art .art-tile:not(.art-half):not(.art-front){left:26%;top:45%}
 :root:not(.phone-app) .welcome-art .art-half{left:70%;top:44%}
 :root:not(.phone-app) .welcome-art .art-front{left:50%;top:70%}
}

.home-top{justify-content:flex-end}

/* One practice header and transport vocabulary across the three core modes. */
.game,.midi-practice.stable-layout{max-width:1180px;width:100%;margin:0 auto;padding:20px 30px}
.practice-header,.stable-layout .practice-header{display:flex;flex-direction:column;align-items:stretch;gap:14px;margin:0;flex-shrink:0}
.practice-heading{display:flex;align-items:center;gap:18px;min-height:62px}
.practice-heading .game-title{flex:1;min-width:0}
.practice-heading h1,.stable-layout .practice-heading h1{font-size:28px;line-height:1.15;margin:0 0 5px;letter-spacing:-.04em}
.practice-heading p,.stable-layout .practice-heading p{font-size:14px;margin:0;line-height:1.3}
.practice-back{font-size:14px;font-weight:750;min-height:42px;padding:9px 15px;white-space:nowrap}
.practice-heading .replays{font-size:13px;padding:10px 14px}
.practice-toolbar,.stable-layout .practice-toolbar{display:flex;align-items:center;gap:8px;margin:0;flex-wrap:nowrap;width:100%;flex:0 0 auto}
.practice-toolbar .practice-transport{display:contents}
.practice-toolbar .support-toggle{display:inline-flex;width:auto;height:42px;min-height:42px;margin:0;padding:8px 12px;gap:6px;font-size:12px;white-space:nowrap;flex-shrink:0;background:#e6eadd;color:var(--ink);border-radius:24px}
.practice-toolbar .support-toggle span{display:inline}
.practice-toolbar .support-toggle svg{width:21px;height:21px;display:block}
.practice-toolbar .support-toggle b{font-size:19px}
.practice-toolbar .support-toggle[aria-pressed=true],.practice-toolbar .autoplay-control:has(input:checked){background:var(--teal);color:white}
.practice-toolbar .autoplay-control{position:relative;cursor:pointer}
.autoplay-control input{position:absolute;width:1px;height:1px;opacity:0}
.autoplay-control:has(input:focus-visible){outline:3px solid var(--teal);outline-offset:3px}
.autoplay-symbol{font-size:25px;line-height:1}
.practice-toolbar .tempo-label,.practice-toolbar .beat-sound-choice{display:flex;align-items:center;gap:7px;font-size:12px;font-weight:700;margin:0;white-space:nowrap;flex:0 0 auto}
.practice-toolbar select,.stable-layout .practice-toolbar select{font:inherit;font-weight:650;padding:10px 9px;border:1px solid #bdcbc2;border-radius:13px;background:#fffdf6;color:var(--ink);min-height:42px}
.practice-toolbar .beat-sound-choice select{max-width:174px}
.practice-toolbar .settings-control{width:42px;padding:8px;justify-content:center;margin-left:auto}
.practice-toolbar .play-button{width:106px;min-width:106px;min-height:42px;height:42px;padding:8px 16px;font-size:15px;flex-shrink:0}
.practice-heading .echo-input-setting{margin:0!important;display:flex;align-items:center;gap:8px;font-size:12px;font-weight:700;white-space:nowrap}
.practice-heading .echo-input-setting select{font:inherit;min-height:42px;padding:9px;border-radius:13px}
.stable-layout .practice-toolbar label:first-child{flex-basis:auto}
.game .play-area{margin:0;gap:18px}
.stable-layout .midi-actions{min-height:44px}
@media(min-width:701px) and (max-width:1050px){.practice-toolbar{gap:6px}.practice-toolbar .support-toggle{padding:8px 9px;font-size:11px}.practice-toolbar .beat-sound-choice select{max-width:145px}.practice-toolbar .beat-sound-choice{gap:5px}}
@media(max-width:700px){.practice-toolbar{flex-wrap:wrap}.practice-heading{gap:10px}.practice-heading .echo-input-setting{flex-wrap:wrap;white-space:normal}.practice-heading h1,.stable-layout .practice-heading h1{font-size:24px}.practice-toolbar .beat-sound-choice select{max-width:145px}}
.phone-app .game{padding:8px max(18px,env(safe-area-inset-left)) max(8px,env(safe-area-inset-bottom));gap:8px}
.phone-app .practice-heading{min-height:36px;gap:8px}
.phone-app .practice-heading h1{font-size:18px;margin-bottom:3px}
.phone-app .practice-heading p{font-size:10px}
.phone-app .practice-heading .replays{font-size:10px;padding:6px 9px}
.phone-app .practice-back{font-size:22px;min-height:32px;padding:2px 8px}
.phone-app .practice-back span{display:none}
.phone-app .practice-toolbar .support-toggle{width:30px;height:32px;min-height:32px;padding:5px;justify-content:center}
.phone-app .practice-toolbar .support-toggle span{display:none}
.phone-app .practice-toolbar .support-toggle svg{width:20px;height:20px}
.phone-app .practice-toolbar .tempo-label>span,.phone-app .practice-toolbar .beat-sound-choice{font-size:0;gap:0}
.phone-app .practice-toolbar select{font-size:11px;min-height:32px;height:32px;padding:5px;max-width:126px}
.phone-app .practice-toolbar .play-button{width:72px;min-width:72px;min-height:32px;height:32px;padding:5px 10px;font-size:13px}
@media(orientation:landscape) and (max-height:540px){
 .phone-app .practice-header{display:grid;grid-template-columns:minmax(120px,1fr) auto;gap:8px;align-items:center}
 .phone-app .practice-heading{position:relative;gap:5px}.phone-app .practice-heading .replays{display:block}
 .phone-app .practice-heading .game-title{overflow:hidden}.phone-app .practice-heading p{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 .phone-app .practice-toolbar{gap:5px;width:auto;flex-wrap:nowrap;margin:0}
 .phone-app .practice-toolbar .settings-control{margin-left:0}
 .phone-app .game .play-area{gap:8px}
}

@media(min-width:701px) and (max-width:900px){
 .practice-toolbar .support-toggle span{display:none}
 .practice-toolbar .autoplay-control span:last-child{display:inline}
 .practice-toolbar .beat-sound-choice{font-size:0;gap:0}
 .practice-toolbar .beat-sound-choice select{font-size:11px;max-width:130px}
}

.practice-toolbar #settings svg{width:21px;height:21px}
#midi-start::before{content:"▶";font-size:.85em;margin-right:0}
#midi-start.playing::before{content:"■"}

.practice-toolbar .beat-sound-choice{position:relative}
.groove-pending{position:absolute;top:100%;right:0;font-size:10px;line-height:16px;white-space:nowrap;color:var(--teal)}

/* Center the complete transport label and give the capsule a tactile press. */
.practice-toolbar .play-button{align-items:center;justify-content:center;line-height:1;gap:8px;box-shadow:0 3px 0 #153e272e;transition:transform 90ms ease,box-shadow 90ms ease}
.practice-toolbar .play-button:active:not(:disabled){transform:translateY(2px);box-shadow:0 1px 0 #153e272e,inset 0 2px 4px #173b342b}
@media(prefers-reduced-motion:reduce){.practice-toolbar .play-button{transition:none}}

#bookmark{display:grid;place-items:center}
#bookmark svg{width:25px;height:25px}
#bookmark[aria-pressed=true]{color:var(--teal);background:#e6eadd}
#bookmark[aria-pressed=true] svg{fill:currentColor}

/* Curriculum investigations and the single Daily Recess activity. */
.recess-styles{grid-template-columns:1fr}
.recess-styles .marathon-entry{align-items:center}
.recess-styles .section-copy p{min-height:0}
.imposter-entry{background:#fbe3d7;border-color:#e7b09a}
.imposter-entry .eyebrow,.imposter-entry h2{color:#944b32}
.imposter-entry .primary{background:#b75d3f}
.imposter-dialog{--teal:#b75d3f;background:#fff8f1;border-color:#e7b09a}
.imposter-dialog .timeline-panel,.imposter-dialog .secondary{background:#fbe3d7}
#game #timeline-help{display:none}
@media(min-width:701px) and (max-height:1000px){
 .game{gap:12px}
 .game .timeline{height:110px}
 .game .playhead{height:117px}
 .game .palette.many-tiles{--tile-height:100px;flex-wrap:nowrap;justify-content:flex-start;overflow-x:auto;overflow-y:hidden;touch-action:pan-x;padding:12px 14px 20px}
 .game .play-area{gap:12px}
}

.copycat-marathon{grid-template-columns:1fr;min-height:180px}
.copycat-marathon.echo-review{grid-template-columns:repeat(auto-fit,minmax(240px,1fr))}
.marathon-echo-prompt{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;text-align:center;min-height:130px;color:var(--teal)}
.marathon-echo-prompt>span{font-size:42px;line-height:1}
.marathon-echo-prompt strong{font-size:26px}
.marathon-echo-prompt small{font-size:13px;color:var(--muted)}
@media(max-height:800px){.copycat-marathon{min-height:145px}.marathon-echo-prompt{min-height:100px;gap:8px}.marathon-echo-prompt>span{font-size:32px}}

.copycat-marathon{height:190px;overflow:hidden}
.copycat-marathon .challenge-measure svg{height:100px;width:100%}
.copycat-marathon .challenge-measure small{margin-bottom:10px}
@media(max-height:800px){.copycat-marathon{height:180px}}

.mic-panel{background:#e6eadd;border-radius:16px;padding:12px 16px;margin:8px 0}
.mic-controls{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.mic-controls button{min-height:36px;padding:8px 14px;font-size:13px}
.mic-controls label{display:flex;align-items:center;gap:8px;font-size:12px}
.mic-controls input{width:100px}.mic-controls meter{width:110px;height:18px}
.mic-panel p{font-size:12px;line-height:1.4;margin:8px 0 0}.mic-panel details{font-size:11px;margin-top:6px}.mic-panel details label{display:inline-flex;gap:6px;align-items:center;margin-right:12px}.mic-panel input[type=number]{width:60px}

.mic-controls button[id$="-mic-check"]{background:var(--teal);color:white}

/* Copy Cat's two partners make the listen / respond handoff visible. */
#echo-prompt .echo-sound{display:none}
.stable-layout #echo-prompt{width:calc(100% - 100px);height:150px;top:0;flex-wrap:nowrap;gap:24px}
.echo-cat{width:125px;flex-shrink:0;text-align:center;opacity:.6;transition:opacity .2s}
.echo-cat img{display:block;width:100%;height:115px;object-fit:contain;transform-origin:50% 90%}
.echo-cat b{font-size:16px}
.echo-turn-copy{display:flex;flex-direction:column;gap:10px;max-width:280px}
.echo-turn-copy small{font-size:14px}
.cat-listening .echo-cat-listen,.cat-responding .echo-cat-student{opacity:1}
.cat-listening .echo-cat-listen img,.cat-responding .echo-cat-student img{animation:echo-cat-wiggle .8s ease-in-out infinite}
@keyframes echo-cat-wiggle{0%,100%{transform:rotate(-3deg) translateY(0)}50%{transform:rotate(3deg) translateY(-4px)}}
.stable-layout .midi-score:has(#echo-prompt:not([hidden])){min-height:180px}
.mic-input .performance-input-area{display:none}
#sound-settings .mic-panel{margin:16px 0;padding:16px;min-height:0}
#sound-settings .mic-controls{flex-wrap:wrap}
@media(max-height:800px){.stable-layout #echo-prompt{height:125px}.echo-cat img{height:95px}.stable-layout .midi-score:has(#echo-prompt:not([hidden])){min-height:155px}}
@media(prefers-reduced-motion:reduce){.echo-cat img{animation:none!important}}

.stable-layout #echo-prompt{top:20px}
/* The count lives above the little stage, alongside the time signature. */
.echo-stage-mode .midi-score{position:relative;min-height:320px!important;max-height:none;flex:none}
.echo-stage-mode .midi-meter{align-self:flex-start;padding-top:4px}
.echo-stage-mode .midi-track{height:290px!important;align-self:start!important}
.echo-stage-mode #echo-count-slot{position:absolute;top:0;left:50%;transform:translateX(-50%);height:82px;z-index:2}
.echo-stage-mode #echo-count-slot .live-beat-count{margin:0;width:76px;height:76px;font-size:48px}
.echo-stage-mode #echo-count-slot .beat-cue{font-size:15px}
.echo-stage-mode .midi-beats{top:14px;bottom:auto;height:36px}
.echo-stage-mode .midi-beats span{font-size:22px}
.echo-stage-mode .midi-beats:has(.active){visibility:hidden}
.echo-stage-mode .midi-cursor{display:none}
.echo-stage-mode:has(#echo-prompt:not([hidden])) .midi-beats{visibility:hidden}
.echo-stage-mode .stable-layout #echo-prompt,.stable-layout.echo-stage-mode #echo-prompt{top:95px;left:calc(50% - 32.5px);transform:translateX(-50%);width:min(720px,calc(100% - 60px));height:190px;gap:40px;align-items:flex-end}
.echo-cat{position:relative;z-index:1;opacity:.78;width:145px}
.echo-cat svg{display:block;width:100%;height:155px;overflow:visible}
.echo-cat b{display:block;margin-top:2px}
.echo-turn-copy{align-self:center;position:relative;z-index:1;max-width:240px}
.cat-stage-light{position:absolute;top:-23px;left:50%;width:0;height:0;pointer-events:none;z-index:0}
.cat-light-aim{position:absolute;transform-origin:0 0;transform:rotate(0deg);transition:transform .55s ease-in-out}
.cat-light-fixture{position:absolute;left:-16px;top:-12px;width:32px;height:23px;border-radius:7px 7px 11px 11px;background:#28434b;box-shadow:inset 0 -5px #d39a59}
.cat-light-fixture:before{content:'';position:absolute;left:6px;top:-8px;width:16px;height:12px;border:3px solid #6c8583;border-bottom:0;border-radius:7px}
.cat-light-beam{position:absolute;top:9px;left:-88px;width:176px;height:200px;clip-path:polygon(45% 0,55% 0,100% 100%,0 100%);background:linear-gradient(#edbd7155,#edbd7122);opacity:0;transition:opacity .35s}
.cat-listening .cat-light-aim{transform:rotate(48deg)}
.cat-responding .cat-light-aim{transform:rotate(-48deg)}
.cat-listening .cat-light-beam,.cat-responding .cat-light-beam{opacity:1}
.cat-listening .echo-cat-listen,.cat-responding .echo-cat-student{opacity:1}
@media(max-height:800px){.echo-stage-mode .midi-score{min-height:290px!important}.echo-stage-mode .midi-track{height:260px!important}.stable-layout.echo-stage-mode #echo-prompt{top:80px;height:175px}.echo-cat svg{height:140px}.cat-stage-light{top:-16px}}
@media(prefers-reduced-motion:reduce){.cat-light-aim,.cat-light-beam{transition:none}}
/* Keep the whole tap-input exercise inside an iPad landscape viewport. */
.echo-stage-mode .midi-score{min-height:260px!important}
.echo-stage-mode .midi-track{height:230px!important}
.stable-layout.echo-stage-mode #echo-prompt{top:88px;height:140px}
.echo-stage-mode .echo-cat svg{height:115px}
.echo-stage-mode .cat-stage-light{top:4px}
.echo-stage-mode .cat-light-beam{height:145px;width:142px;left:-71px}
@media(max-height:800px){.echo-stage-mode .performance-input-area{grid-template-rows:150px;margin-top:8px}.echo-stage-mode .performance-input-area>#echo-pad-panel,.echo-stage-mode .performance-input-area>#midi-connections{height:150px}.echo-stage-mode .tap-pad{min-height:100px}.echo-stage-mode .beat-status-row{min-height:30px}.echo-stage-mode .midi-message{margin:4px 0}.echo-stage-mode .midi-actions{margin:4px 0}}
.echo-stage-mode .cat-stage-light{top:-8px}
.echo-stage-mode .cat-light-beam{height:230px;width:160px;left:-80px}
.cat-listening .cat-light-aim{transform:rotate(60deg)}
.cat-responding .cat-light-aim{transform:rotate(-60deg)}

/* A quicker handoff and a small theatre can with barn doors. */
.cat-light-aim{transition:transform .18s cubic-bezier(.2,.8,.2,1)}
.cat-light-beam{transition:opacity .12s;background:linear-gradient(#edbd7188,#edbd7133)}
.cat-light-fixture{left:-18px;top:-18px;width:36px;height:32px;border-radius:7px 7px 4px 4px;background:linear-gradient(90deg,#28434b,#45616a 45%,#1c343e);box-shadow:inset 0 -7px #e6b46e,0 2px 3px #17333c22}
.cat-light-fixture:before{left:5px;top:-10px;width:26px;height:18px;border:3px solid #6c8583;border-bottom:0;border-radius:9px;box-sizing:border-box}
.cat-light-fixture:after{content:'';position:absolute;left:-8px;bottom:-5px;width:52px;height:12px;background:#28434b;clip-path:polygon(0 0,18% 0,23% 55%,77% 55%,82% 0,100% 0,91% 100%,9% 100%)}
@media(prefers-reduced-motion:reduce){.cat-light-aim,.cat-light-beam{transition:none}}

/* Leave the stage light's center clear; restore conventional notation labels in review. */
.echo-stage-mode #echo-count-slot{left:22%}
.echo-stage-mode:not(.echo-stage-visible) .midi-beats{top:auto;bottom:0;height:36px;visibility:visible}
.echo-stage-mode:not(.echo-stage-visible) .midi-beats:has(.active){visibility:visible}
.echo-stage-mode:not(.echo-stage-visible) .midi-track{height:155px!important}
.echo-stage-mode:not(.echo-stage-visible) .midi-score{min-height:175px!important}
.echo-stage-mode:not(.echo-stage-visible) #echo-count-slot{display:none}

/* A silent pulse for clapping: one bounce per beat, a larger bounce on beat one. */
.echo-stage-mode .echo-cat svg.yarn-pulse{position:absolute;left:calc(50% + 34px);bottom:-22px;width:58px;height:63px;overflow:visible;opacity:0;transition:opacity .12s;pointer-events:none}
.echo-stage-mode .cat-responding .echo-cat-student svg.yarn-pulse{opacity:1}
@media(prefers-reduced-motion:reduce){.echo-stage-mode .echo-cat svg.yarn-pulse{transition:none}}

/* Copy Cat keeps its setup in the gear menu and lets the partners own the stage. */
.echo-stage-mode .practice-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px}
.echo-stage-mode .practice-heading{min-width:0}
.echo-stage-mode .practice-toolbar{width:auto;margin:0;flex-wrap:nowrap}
.echo-stage-mode .practice-toolbar .settings-control{margin:0}
.echo-stage-mode .performance-input-area:has(#midi-connections){grid-template-rows:none}
.echo-stage-mode:not(.pad-input) .performance-input-area{display:none}
.copycat-playback-settings{display:flex;flex-wrap:wrap;gap:16px;align-items:center;padding:18px;margin:16px 0;border:1px solid #bccbbb;border-radius:20px}
.copycat-playback-settings label{display:flex;align-items:center;gap:8px;font-size:15px}
.copycat-playback-settings select{max-width:100%;font-size:15px;padding:10px}
.copycat-playback-settings .echo-input-setting{width:100%}
.copycat-playback-settings .practice-transport{display:flex;gap:10px;flex-wrap:wrap}
.copycat-playback-settings .support-toggle{display:inline-flex;align-items:center;gap:8px;min-height:42px;border-radius:24px;padding:10px 16px;font-size:14px;background:#e6eadd;color:var(--ink)}
.copycat-playback-settings .support-toggle svg{width:23px;height:23px}
.copycat-playback-settings .support-toggle[aria-pressed=true],.copycat-playback-settings .autoplay-control:has(input:checked){background:var(--teal);color:white}
.copycat-playback-settings .autoplay-control input{width:18px;height:18px}
.copycat-playback-settings .midi-connections{width:100%;height:auto;min-height:0;margin:0;padding:0}
.echo-stage-mode.echo-stage-visible .midi-score{min-height:340px!important}
.echo-stage-mode.echo-stage-visible .midi-track{height:310px!important}
.stable-layout.echo-stage-mode #echo-prompt{top:95px;height:210px;width:min(900px,calc(100% - 40px));gap:45px}
.echo-stage-mode .echo-cat{width:210px}
.echo-stage-mode .echo-cat>svg:not(.yarn-pulse){height:185px}
.echo-stage-mode .echo-turn-copy{max-width:245px}
.echo-stage-mode .echo-cat svg.yarn-pulse{width:80px;height:86px;bottom:-25px;left:calc(50% + 48px)}
.echo-stage-mode .cat-light-beam{height:295px;width:210px;left:-105px}
.echo-stage-mode .cat-stage-light{top:4px}
@media(max-height:800px){.echo-stage-mode.echo-stage-visible .midi-score{min-height:300px!important}.echo-stage-mode.echo-stage-visible .midi-track{height:270px!important}.stable-layout.echo-stage-mode #echo-prompt{top:85px;height:185px}.echo-stage-mode .echo-cat{width:185px}.echo-stage-mode .echo-cat>svg:not(.yarn-pulse){height:160px}.echo-stage-mode .cat-light-beam{height:265px}}
@media(max-width:1050px){.stable-layout.echo-stage-mode #echo-prompt{gap:18px}.echo-stage-mode .echo-cat{width:165px}.echo-stage-mode .echo-turn-copy{max-width:210px}}

#sound-settings:has(#copycat-playback-settings:not([hidden])){width:min(760px,92vw);max-width:92vw}
.copycat-playback-settings .tempo-label select{min-height:42px;border:1px solid #bdcbbb;border-radius:12px;background:#fffdf6;padding:8px 12px}

/* Rhythm Tiles keeps setup in its gear menu, with the board as the focus. */
.game .game-header{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:18px}
.game .game-header .practice-heading{min-width:0}
.game .header-tools.practice-toolbar{width:auto;flex-wrap:nowrap;margin:0;gap:10px}
.game .header-tools .settings-control{margin:0}
#sound-settings:has(#tiles-playback-settings:not([hidden])){width:min(760px,92vw);max-width:92vw}
#sound-settings:has(#tiles-playback-settings:not([hidden])) .setting-row:has(#grade-note-lengths),#sound-settings:has(#tiles-playback-settings:not([hidden])) .setting-row:has(#grade-note-lengths)+p{display:none}
@media(max-width:700px){.game .game-header{gap:8px}.game .game-title h1{font-size:22px}.game .game-header .replays{font-size:11px;padding:8px}.game .header-tools.practice-toolbar{gap:6px}}
@media(orientation:landscape) and (max-height:540px){
 .game{padding:9px 20px;gap:8px}
 .game .game-header{flex-shrink:0;min-height:42px}
 .game .practice-heading{min-height:42px;gap:10px}
 .game .practice-heading h1{font-size:21px}
 .game .practice-heading p{font-size:11px}
 .game .practice-back{padding:7px 12px;min-height:34px}
 .game .header-tools .play-button{min-height:34px;height:34px;padding:7px 15px;font-size:14px}
 .game .play-area{justify-content:center;gap:8px;min-height:0}
 .game .timeline-panel{padding:8px 10px;flex-shrink:0}
 .game .timeline{height:62px}
 .game .beat-labels{font-size:10px;margin-bottom:6px}
 .game .palette-heading{margin-bottom:5px}
 .game .palette-heading h2,.game .palette-heading p{font-size:11px}
 .game .palette{padding:8px 12px;flex-wrap:nowrap;overflow-x:auto;justify-content:flex-start}
 .game .tray-tile{height:76px;flex-shrink:0}
 .game .game-footer{height:46px;min-height:46px;flex-shrink:0;gap:14px}
 .game .game-footer .round-button{width:36px;height:36px;padding:7px}
 .game .game-footer .speaker{width:34px;height:34px}
 .game .game-footer p{font-size:12px;margin:0}
 .game .check-button{font-size:13px;padding:9px 16px;min-height:36px}
}
/* Give each partner half the stage, at twice the previous visible height. */
.echo-stage-mode.echo-stage-visible .midi-score{min-height:480px!important}
.echo-stage-mode.echo-stage-visible .midi-track{height:450px!important}
.stable-layout.echo-stage-mode #echo-prompt{top:65px;height:390px;width:calc(100% - 20px);gap:0;justify-content:space-between}
.echo-stage-mode .echo-cat{width:48%;max-width:440px}
.echo-stage-mode .echo-cat>svg:not(.yarn-pulse){height:370px}
.echo-stage-mode .echo-turn-copy{position:absolute;top:-8px;left:50%;transform:translateX(-50%);width:230px;max-width:230px;align-self:auto}
.echo-stage-mode .echo-turn-copy strong{font-size:18px}
.echo-stage-mode .echo-turn-copy small{font-size:12px}
.echo-stage-mode .cat-stage-light{top:4px}
.echo-stage-mode .cat-light-beam{height:390px;width:290px;left:-145px}
.echo-stage-mode .echo-cat svg.yarn-pulse{left:50%;transform:translateX(-50%);bottom:18px;width:110px;height:119px;z-index:3}
.echo-stage-mode .echo-cat b{font-size:18px}
.echo-stage-mode.pad-input .performance-input-area{grid-template-rows:110px;margin-top:4px}
.echo-stage-mode.pad-input .performance-input-area>#echo-pad-panel{height:110px}
.echo-stage-mode.pad-input .tap-recess{padding:7px}
.echo-stage-mode.pad-input .tap-pad{min-height:65px;gap:2px}
.echo-stage-mode.pad-input .tap-hand{display:none}
.echo-stage-mode.pad-input .tap-pad strong{font-size:21px}
@media(max-height:800px){
 .echo-stage-mode.echo-stage-visible .midi-score{min-height:425px!important}
 .echo-stage-mode.echo-stage-visible .midi-track{height:395px!important}
 .stable-layout.echo-stage-mode #echo-prompt{top:65px;height:335px}
 .echo-stage-mode .echo-cat>svg:not(.yarn-pulse){height:320px}
 .echo-stage-mode .cat-light-beam{height:350px}
}
.echo-stage-mode .echo-turn-copy{top:90px}
.echo-stage-mode #echo-count-slot{left:12%}
/* Petting moves the cats' parts while their bodies and speech bubbles stay put. */
.mode-art-layer>.home-cat-art{display:block;width:100%;height:100%;overflow:visible}
.home-cat-head,.home-cat-paw,.home-cat-tail{transform-box:fill-box}
.home-cat-head{transform-origin:50% 88%}
.home-cat-paw{transform-origin:50% 50%}
.ginger-tail{transform-origin:100% 90%}
.teal-tail{transform-origin:0% 90%}
.cat-cuddle .home-cat-head{animation:home-cat-nuzzle 1.2s ease-in-out 2}
.cat-cuddle .teal-head{animation-delay:.1s;animation-direction:reverse}
.cat-cuddle .home-cat-tail{animation:home-cat-tail-flick .8s ease-in-out 3}
.cat-cuddle .teal-tail{animation-direction:reverse}
.cat-cuddle .home-cat-paw{animation:home-cat-paw .6s ease-in-out 4}
.cat-cuddle .teal-paw{animation-delay:.15s}
@keyframes home-cat-nuzzle{0%,100%{transform:rotate(0)}30%{transform:rotate(-9deg) translateY(-3px)}65%{transform:rotate(6deg) translateY(1px)}}
@keyframes home-cat-tail-flick{0%,100%{transform:rotate(0) scaleX(1)}50%{transform:rotate(14deg) scaleX(.85)}}
@keyframes home-cat-paw{0%,100%{transform:translateY(0) rotate(0)}45%{transform:translateY(-8px) rotate(-10deg)}}
@media(prefers-reduced-motion:reduce){.cat-cuddle .home-cat-head,.cat-cuddle .home-cat-tail,.cat-cuddle .home-cat-paw{animation:none}}
.marathon-checkpoint{background:#fbe3d6;border-color:#eeaf94}
.marathon-checkpoint h2,.marathon-checkpoint .eyebrow{color:#984d31}
.marathon-checkpoint .primary{background:#b85f3e}
.keepbeat-entry{background:#edf0e2;border-color:#bacdb8}
.keepbeat-dialog{width:min(900px,94vw);max-width:94vw;background:var(--paper);border-radius:30px;max-height:94svh;overflow:auto}
.keepbeat-dialog header{display:flex;justify-content:space-between;align-items:center;gap:24px}
.keepbeat-dialog h2{font-size:32px;margin:8px 0 20px}
.keepbeat-dialog summary{color:var(--teal);cursor:pointer;font-weight:750}
.keepbeat-options{display:flex;flex-wrap:wrap;gap:18px;margin:18px 0}
.keepbeat-options label{display:flex;flex-direction:column;gap:6px}
.keepbeat-options select{padding:10px;border:1px solid #b9c9bc;border-radius:12px;background:#fffdf7}
.keepbeat-stage{position:relative;text-align:center;padding:22px 0 6px}
.keepbeat-stage h3{font-size:34px;margin:14px 0;color:var(--teal)}
.keepbeat-stage>p{color:var(--muted);font-size:15px}
.keepbeat-count{font-size:72px;font-weight:850;height:90px;line-height:90px;color:var(--teal)}
.keepbeat-pad{display:block;margin:24px auto 0;padding:26px 40px;min-width:260px;border-radius:28px;background:linear-gradient(#ffffff22,#ffffff22),url(assets/tile-texture.png) center/cover;box-shadow:0 5px #b39e6e;font-size:26px;font-weight:800;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.keepbeat-pad small{display:block;font-size:13px;font-weight:500;margin-top:8px}
.keepbeat-status{min-height:28px;text-align:center;color:var(--teal)}
.keepbeat-results{text-align:center;padding:10px 0 18px}
#keepbeat-stars{color:#cc932d;font-size:46px;letter-spacing:8px}
.keepbeat-dialog footer{display:flex;gap:12px;justify-content:center;margin-top:12px}
.keepbeat-dialog.silent-count *{animation:none!important;transition:none!important}
.keepbeat-dialog .mic-panel{min-height:0;margin:14px 0;padding:14px}
.keepbeat-dialog .mic-controls{flex-wrap:wrap}
@media(max-height:800px){.keepbeat-dialog{padding:24px}.keepbeat-stage{padding-top:8px}.keepbeat-stage h3{font-size:30px}.keepbeat-pad{padding:20px 36px}}

.keepbeat-sharing{padding:12px 16px;border-radius:16px;background:#e7ebdf;margin-top:12px}.keepbeat-sharing h3{margin:0}.keepbeat-sharing input{padding:9px;border:1px solid #bdcbbd;border-radius:10px;max-width:190px;margin:0 10px 8px 4px}.keepbeat-sharing button{padding:10px 16px}.keepbeat-sharing .small{margin:8px 0}#keepbeat-board select{padding:10px;border:1px solid #bdcbbd;border-radius:10px;background:#fffdf6}#keepbeat-board table{width:100%;border-collapse:collapse;margin-top:16px}#keepbeat-board th,#keepbeat-board td{text-align:left;padding:12px;border-bottom:1px solid #d7ddcf}#keepbeat-board th{color:var(--teal)}

.keepbeat-pad{width:210px;height:210px;min-width:0;padding:22px 12px;border-radius:50%;background:var(--student-orange);color:var(--ink);border:5px solid #f3b46c;box-shadow:0 8px 0 #b5671f,0 12px 20px #65452c24,inset 0 0 0 4px #ffffff30;font-size:22px;line-height:1.1;transition:transform 80ms,box-shadow 80ms}.keepbeat-pad:disabled{opacity:.65}.keepbeat-pad:active:not(:disabled){transform:translateY(6px);box-shadow:0 2px 0 #b5671f,inset 0 0 0 4px #ffffff30}.keepbeat-clap{display:block;font-size:68px;margin-bottom:10px}.keepbeat-pad small{font-size:12px}#keepbeat-checkin{display:block;margin:0 auto;padding:9px 18px;font-size:13px}@media(max-height:800px){.keepbeat-pad{width:180px;height:180px;padding:16px 10px}.keepbeat-clap{font-size:56px}}

.keepbeat-pad.tapped{animation:clap-press 180ms ease-out}@keyframes clap-press{0%,50%{transform:translateY(6px);box-shadow:0 2px 0 #b5671f,inset 0 0 0 4px #ffffff30}100%{transform:translateY(0)}}
@media(max-height:800px){.keepbeat-stage h3{margin:8px 0}.keepbeat-stage>p{margin:8px 0}.keepbeat-pad{margin-top:14px}.keepbeat-status{margin:10px 0}.keepbeat-dialog footer{margin-top:8px}}
/* The play surface reserves the same cells in every phase. Setup is a separate dialog. */
#keepbeat-dialog[open]{display:grid;grid-template-rows:64px 34px minmax(210px,1fr) 34px 84px 48px;gap:6px;height:min(780px,94svh);max-height:94svh;padding:20px 24px;overflow:hidden}
#keepbeat-dialog header{min-width:0;gap:12px}#keepbeat-dialog header .eyebrow{margin:0;font-size:10px}#keepbeat-dialog h2{font-size:30px;margin:4px 0 0}.keepbeat-header-actions{display:flex;gap:8px}.keepbeat-header-actions button{padding:10px 18px;min-height:42px}
.keepbeat-recordbar{display:flex;justify-content:space-between;align-items:center;gap:12px;min-width:0}.keepbeat-recordbar #keepbeat-best{margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.keepbeat-recordbar #keepbeat-checkin{margin:0;flex-shrink:0;padding:8px 14px}
#keepbeat-dialog .keepbeat-stage{padding:0;min-height:0;display:grid;grid-template-rows:40px 24px minmax(140px,1fr);justify-items:center;align-items:center}
#keepbeat-dialog .keepbeat-stage h3{font-size:30px;margin:0;line-height:40px}#keepbeat-dialog .keepbeat-stage>p{margin:0;font-size:14px;line-height:24px}
#keepbeat-dialog #keepbeat-count{position:absolute;top:calc(50% + 20px);left:calc(50% - 245px);transform:translateY(-50%);width:90px;height:90px;line-height:90px;font-size:72px}
#keepbeat-dialog #keepbeat-count[hidden]{display:block!important;visibility:hidden}
#keepbeat-dialog .keepbeat-pad{width:clamp(140px,24svh,200px);height:clamp(140px,24svh,200px);margin:0;padding:14px 8px;font-size:21px}
#keepbeat-dialog .keepbeat-clap{font-size:clamp(42px,7svh,64px);margin-bottom:8px}
#keepbeat-dialog .keepbeat-status{margin:0;line-height:17px;font-size:13px;align-self:center;min-height:0;text-align:center}
#keepbeat-dialog .keepbeat-results{padding:0;display:grid;grid-template-rows:36px 24px 20px;align-items:center;justify-items:center;min-height:0}
#keepbeat-dialog #keepbeat-results[hidden]{display:grid!important;visibility:hidden}
#keepbeat-dialog #keepbeat-stars{font-size:30px;line-height:36px}#keepbeat-dialog .keepbeat-results h3{font-size:17px;margin:0;line-height:24px}#keepbeat-dialog .keepbeat-results p{font-size:13px;margin:0;line-height:20px}
#keepbeat-dialog footer{margin:0;gap:10px;align-items:center}#keepbeat-dialog footer button{margin:0;min-width:120px;padding:12px 18px;min-height:46px}
#keepbeat-settings-dialog{width:min(900px,94vw);max-width:94vw;max-height:94svh;overflow:auto}#keepbeat-settings-dialog #keepbeat-settings>summary{display:none}
@media(max-height:640px){#keepbeat-dialog[open]{grid-template-rows:52px 30px minmax(160px,1fr) 30px 68px 42px;gap:3px;padding:12px 20px}#keepbeat-dialog h2{font-size:25px}#keepbeat-dialog .keepbeat-stage{grid-template-rows:32px 20px minmax(110px,1fr)}#keepbeat-dialog .keepbeat-stage h3{font-size:25px;line-height:32px}#keepbeat-dialog .keepbeat-stage>p{font-size:12px;line-height:20px}#keepbeat-dialog .keepbeat-pad{width:115px;height:115px;font-size:16px;border-width:3px}#keepbeat-dialog .keepbeat-clap{font-size:34px;margin-bottom:4px}#keepbeat-dialog .keepbeat-pad small{font-size:10px;margin-top:4px}#keepbeat-dialog .keepbeat-results{grid-template-rows:28px 20px 18px}#keepbeat-dialog #keepbeat-stars{font-size:25px;line-height:28px}#keepbeat-dialog .keepbeat-results h3{font-size:15px;line-height:20px}#keepbeat-dialog .keepbeat-results p{font-size:12px;line-height:18px}#keepbeat-dialog footer button{padding:9px 16px;min-height:40px}}
#keepbeat-dialog footer button{width:180px;flex:0 0 180px}
#keepbeat-resume{width:min(650px,94vw);max-width:94vw;padding:28px}.keepbeat-resume-actions{display:flex;gap:12px;flex-wrap:wrap;align-items:center}#keepbeat-resume button{margin:0}#keepbeat-review-form{border-top:1px solid #d4ddcd;margin-top:24px;padding-top:20px}#keepbeat-review-form label{font-weight:700;display:block;margin-bottom:12px}#keepbeat-review-form>div{display:flex;gap:12px}#keepbeat-review{width:110px;padding:12px;border:1px solid #bdcbbd;border-radius:12px;background:#fffdf6}#keepbeat-review-error:empty{display:none}#keepbeat-review-error{color:#a74329}
/* Sketch layout: the target and count-in share the center of the fixed round pad. */
#keepbeat-dialog[open]{grid-template-rows:56px 34px minmax(220px,1fr) 34px 84px 48px}
#keepbeat-dialog .keepbeat-stage{display:flex;align-items:center;justify-content:center}
#keepbeat-dialog .keepbeat-pad{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;width:clamp(180px,38svh,330px);height:clamp(180px,38svh,330px);padding:20px;border-width:6px}
#keepbeat-dialog #keepbeat-pad-caption{font-size:clamp(16px,2.6svh,23px);line-height:1.2;font-weight:750}
#keepbeat-dialog .keepbeat-number-slot{position:relative;display:grid;place-items:center;width:100%;height:clamp(80px,16svh,130px)}
#keepbeat-dialog #keepbeat-target-copy,#keepbeat-dialog #keepbeat-count{font-size:clamp(65px,14svh,115px);line-height:1;font-weight:850;font-variant-numeric:tabular-nums;letter-spacing:-.04em;color:var(--ink)}
#keepbeat-dialog #keepbeat-count{position:absolute;inset:0;transform:none;width:100%;height:100%;display:grid;place-items:center}
#keepbeat-dialog .keepbeat-pad.counting #keepbeat-target-copy{visibility:hidden}
#keepbeat-dialog .keepbeat-pad:disabled{opacity:1}
@media(max-height:640px){#keepbeat-dialog[open]{grid-template-rows:48px 30px minmax(150px,1fr) 30px 68px 42px}#keepbeat-dialog .keepbeat-pad{width:clamp(140px,34svh,205px);height:clamp(140px,34svh,205px);padding:12px;gap:2px}#keepbeat-dialog #keepbeat-target-copy,#keepbeat-dialog #keepbeat-count{font-size:64px}#keepbeat-dialog .keepbeat-number-slot{height:72px}#keepbeat-dialog #keepbeat-pad-caption{font-size:16px}}

#keepbeat-board-list{overflow-x:auto}#keepbeat-board table{font-size:14px}#keepbeat-board th,#keepbeat-board td{padding:10px 8px}#keepbeat-board td:nth-child(6){white-space:nowrap}

/* The caption follows the inner rim, leaving the whole center for the target. */
#keepbeat-dialog .keepbeat-caption-curve{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;fill:var(--ink)}
#keepbeat-dialog .keepbeat-caption-curve text,#keepbeat-dialog #keepbeat-pad-caption{font-family:inherit;font-size:31px;font-weight:850;letter-spacing:.02em}
#keepbeat-dialog .keepbeat-number-slot{position:absolute;left:10%;top:32%;width:80%;height:58%}
#keepbeat-dialog #keepbeat-target-copy,#keepbeat-dialog #keepbeat-count{font-size:clamp(80px,18svh,150px)}
#keepbeat-dialog #keepbeat-target-copy[data-digits="3"]{font-size:clamp(70px,16svh,130px)}
#keepbeat-dialog #keepbeat-target-copy[data-digits="4"]{font-size:clamp(55px,12svh,100px)}
#keepbeat-dialog #keepbeat-target-copy[data-digits="5"]{font-size:clamp(45px,10svh,80px)}
#keepbeat-dialog .keepbeat-recordbar #keepbeat-best{font-size:20px;line-height:28px;font-weight:750;color:var(--ink)}
@media(max-height:640px){#keepbeat-dialog .keepbeat-caption-curve text,#keepbeat-dialog #keepbeat-pad-caption{font-size:31px}#keepbeat-dialog #keepbeat-target-copy,#keepbeat-dialog #keepbeat-count{font-size:80px}#keepbeat-dialog #keepbeat-target-copy[data-digits="3"]{font-size:65px}#keepbeat-dialog #keepbeat-target-copy[data-digits="4"]{font-size:50px}#keepbeat-dialog #keepbeat-target-copy[data-digits="5"]{font-size:40px}#keepbeat-dialog .keepbeat-recordbar #keepbeat-best{font-size:17px}}
/* iPhone now has two practice categories. */
.phone-app .practice-modes{display:flex;flex-wrap:nowrap;gap:6px;margin-bottom:20px;padding:5px}
.phone-app .practice-modes .mode-choice{width:auto;flex:1;min-width:0;padding:12px 8px;font-size:15px}
.phone-app #keepbeat-dialog[open]{width:calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 16px);max-width:none;height:calc(100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px);max-height:none;padding:12px;grid-template-rows:44px 80px minmax(160px,1fr) 32px 76px 42px;gap:6px;overflow:hidden;margin:auto}
.phone-app #keepbeat-dialog h2{font-size:23px;margin:0}.phone-app #keepbeat-dialog header{gap:8px}.phone-app .keepbeat-header-actions{gap:6px}.phone-app .keepbeat-header-actions button{padding:8px 12px;min-height:40px;font-size:13px}.phone-app #keepbeat-settings-open .keepbeat-settings-word{display:none}
.phone-app #keepbeat-dialog .keepbeat-recordbar{display:grid;grid-template-rows:40px 32px;gap:4px;align-items:center}
.phone-app #keepbeat-dialog .keepbeat-recordbar #keepbeat-best{font-size:16px;line-height:20px;white-space:normal;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;max-height:40px}
.phone-app #keepbeat-dialog #keepbeat-checkin{justify-self:start;font-size:12px;line-height:16px;min-height:30px;padding:7px 12px}
.phone-app #keepbeat-dialog .keepbeat-pad{width:min(72vw,30svh,290px);height:auto;aspect-ratio:1;max-width:100%;padding:12px}
.phone-app #keepbeat-dialog #keepbeat-target-copy,.phone-app #keepbeat-dialog #keepbeat-count{font-size:clamp(70px,13svh,120px)}
.phone-app #keepbeat-dialog #keepbeat-target-copy[data-digits="3"]{font-size:clamp(60px,11svh,100px)}
.phone-app #keepbeat-dialog #keepbeat-target-copy[data-digits="4"]{font-size:clamp(45px,9svh,80px)}
.phone-app #keepbeat-dialog #keepbeat-target-copy[data-digits="5"]{font-size:clamp(36px,7svh,65px)}
.phone-app #keepbeat-dialog .keepbeat-status{font-size:11px;line-height:15px}.phone-app #keepbeat-dialog .keepbeat-results{grid-template-rows:30px 24px 20px}.phone-app #keepbeat-dialog #keepbeat-stars{font-size:28px;line-height:30px}.phone-app #keepbeat-dialog .keepbeat-results h3{font-size:14px;line-height:16px}.phone-app #keepbeat-dialog .keepbeat-results p{font-size:11px;line-height:14px}
.phone-app #keepbeat-dialog footer{gap:6px}.phone-app #keepbeat-dialog footer button{width:auto;flex:1 1 0;min-width:0;min-height:42px;padding:6px;font-size:12px;white-space:normal;line-height:14px}
.phone-app #keepbeat-settings-dialog,.phone-app #keepbeat-resume,.phone-app #keepbeat-board{width:calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 20px);max-width:900px;max-height:calc(100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 20px);padding:18px}
.phone-app #keepbeat-board table{font-size:12px}.phone-app #keepbeat-board th,.phone-app #keepbeat-board td{padding:8px 5px}
@media(orientation:landscape){
 .phone-app #keepbeat-dialog[open]{grid-template-columns:minmax(0,1fr) minmax(160px,30%) minmax(0,1fr);grid-template-rows:40px minmax(140px,1fr) 42px;gap:6px 10px;padding:10px 14px}
 .phone-app #keepbeat-dialog header{grid-column:1/-1;grid-row:1}
 .phone-app #keepbeat-dialog .keepbeat-recordbar{grid-column:1;grid-row:2;align-self:start;grid-template-rows:auto 32px;gap:12px;padding-top:12px}
 .phone-app #keepbeat-dialog .keepbeat-stage{grid-column:2;grid-row:2;min-width:0}
 .phone-app #keepbeat-dialog .keepbeat-pad{width:min(100%,52svh,220px)}
 .phone-app #keepbeat-dialog #keepbeat-target-copy,.phone-app #keepbeat-dialog #keepbeat-count{font-size:clamp(65px,23svh,105px)}
 .phone-app #keepbeat-dialog .keepbeat-status{grid-column:3;grid-row:2;align-self:start;padding-top:12px}
 .phone-app #keepbeat-dialog .keepbeat-results{grid-column:3;grid-row:2;align-self:end;margin-bottom:12px}
 .phone-app #keepbeat-dialog footer{grid-column:1/-1;grid-row:3}
}

/* Coated snare head with an orange shell and chrome tension hardware. */
#keepbeat-dialog .keepbeat-pad{background:var(--student-orange) url(assets/keepbeat-snare.svg) center/100% 100% no-repeat;border-color:var(--student-orange);box-shadow:0 8px 0 #ad631e,0 13px 22px #35474726;isolation:isolate}
#keepbeat-dialog .keepbeat-pad:active:not(:disabled){box-shadow:0 2px 0 #ad631e,0 5px 12px #35474720}
#keepbeat-dialog .keepbeat-caption-curve{inset:5%;width:90%;height:90%;fill:var(--ink)}

/* Player-seat snare: center the live glyph on the head, above the visible shell. */
#keepbeat-dialog .keepbeat-pad{background:transparent url(assets/keepbeat-snare-perspective.png) center/contain no-repeat;border:0;padding:0;box-shadow:none;filter:drop-shadow(0 7px 4px #35474726);transition:transform 90ms ease,filter 90ms ease}
#keepbeat-dialog .keepbeat-pad:active:not(:disabled){transform:translateY(4px) scale(.985);box-shadow:none;filter:drop-shadow(0 2px 2px #35474730)}
#keepbeat-dialog .keepbeat-pad.tapped{animation:snare-press 180ms ease-out}
@keyframes snare-press{0%,50%{transform:translateY(4px) scale(.985);filter:drop-shadow(0 2px 2px #35474730)}100%{transform:translateY(0) scale(1)}}
#keepbeat-dialog .keepbeat-caption-curve{inset:auto;left:5%;top:0;width:90%;height:78%}
#keepbeat-dialog .keepbeat-number-slot{left:12%;top:22%;width:78%;height:46%}
#keepbeat-dialog #keepbeat-target-copy,#keepbeat-dialog #keepbeat-count{letter-spacing:0;transform:translateY(-.035em)}

/* A broad elliptical baseline follows the photographed drumhead perspective. */
#keepbeat-dialog .keepbeat-caption-curve{left:0;top:0;width:100%;height:100%}
#keepbeat-dialog .keepbeat-caption-curve text,#keepbeat-dialog #keepbeat-pad-caption{font-size:26px}

#keepbeat-board .keepbeat-sharing{margin:16px 0 22px;padding:18px;border:1px solid #d4ddcd;border-radius:20px;background:#fffdf6}
#keepbeat-board .keepbeat-sharing h3{margin:0 0 8px;font-size:19px}
#keepbeat-board .keepbeat-sharing input{max-width:100%;box-sizing:border-box;padding:10px 12px;border:1px solid #bdcbbd;border-radius:12px;background:#fff}
#keepbeat-board #keepbeat-join{margin:10px 8px;background:var(--student-orange);color:var(--ink);border-radius:999px;box-shadow:0 4px 0 #b5671f}
#keepbeat-board #keepbeat-join:active:not(:disabled){transform:translateY(3px);box-shadow:0 1px 0 #b5671f}
#keepbeat-code{width:min(720px,94vw);max-width:94vw}#keepbeat-code button{margin:6px}#keepbeat-code-level{width:90px;padding:10px;border:1px solid #bdcbbd;border-radius:12px}#keepbeat-code-status{min-height:28px;color:var(--accent);font-weight:700}#keepbeat-code-tap{min-height:72px;touch-action:manipulation;user-select:none}

#keepbeat-title{touch-action:manipulation;-webkit-user-select:none;user-select:none}

#keepbeat-calibration{width:min(720px,94vw);max-width:94vw}#keepbeat-calibration button{margin:6px}#keepbeat-calibration-status{min-height:32px;font-weight:700;color:var(--accent)}#keepbeat-calibration-tap{min-height:64px;touch-action:manipulation;user-select:none}

/* Compact progress chooser: retain overflow only when accessibility text needs it. */
#keepbeat-resume{width:min(700px,94vw);padding:22px;max-height:calc(100svh - 24px);overflow:auto}
#keepbeat-resume .keepbeat-resume-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:0}
#keepbeat-resume .keepbeat-resume-header h2{font-size:26px;line-height:1.15;margin:0}
#keepbeat-resume .keepbeat-resume-header button{flex:none;min-height:44px;padding:10px 18px}
#keepbeat-resume-copy{font-size:16px;line-height:1.4;margin:14px 0;overflow-wrap:anywhere}
#keepbeat-resume .keepbeat-resume-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px}
#keepbeat-resume .keepbeat-resume-actions button{white-space:normal;min-height:46px;padding:10px 14px;font-size:16px;line-height:1.25}
#keepbeat-resume #keepbeat-review-form{margin-top:16px;padding-top:14px}
#keepbeat-resume #keepbeat-review-form label{font-size:16px;margin-bottom:8px}
#keepbeat-resume #keepbeat-review-form>div{display:grid;grid-template-columns:90px minmax(0,1fr);gap:10px}
#keepbeat-resume #keepbeat-review{width:100%;min-width:0;min-height:44px;padding:8px 12px;font-size:16px}
#keepbeat-resume #keepbeat-review-form button{min-height:44px;padding:8px 14px;font-size:16px;white-space:normal}
#keepbeat-resume #keepbeat-review-note,#keepbeat-resume .keepbeat-resume-reassurance{font-size:13px;line-height:1.3;margin:8px 0 0}
#keepbeat-resume #keepbeat-review-error{font-size:14px;margin:6px 0 0}
@media(max-height:500px) and (min-width:560px){
 #keepbeat-resume,.phone-app #keepbeat-resume{width:min(760px,calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right) - 24px));padding:14px 20px;max-height:calc(100svh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 16px)}
 #keepbeat-resume .keepbeat-resume-header h2{font-size:23px}
 #keepbeat-resume-copy{margin:8px 0;font-size:15px}
 #keepbeat-resume #keepbeat-review-form{margin-top:10px;padding-top:10px;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 16px;align-items:center}
 #keepbeat-resume #keepbeat-review-form label{margin:0}
 #keepbeat-resume #keepbeat-review-note{margin:0;grid-column:1;grid-row:2}
 #keepbeat-resume #keepbeat-review-form>div{grid-column:2;grid-row:1 / 3}
 #keepbeat-resume #keepbeat-review-error{grid-column:1/-1}
}

html.device-check-pending body{visibility:hidden}
html.phone-unavailable #home{display:none}
#phone-unavailable{min-height:100svh;display:grid;place-items:center;padding:max(24px,env(safe-area-inset-top)) max(24px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(24px,env(safe-area-inset-left));text-align:center}
.phone-unavailable-card{max-width:520px;padding:24px}
#phone-unavailable h1{font-size:clamp(28px,6vw,40px);line-height:1.1;letter-spacing:-.035em;margin:12px 0}
#phone-unavailable p:not(.eyebrow){font-size:17px;line-height:1.55;color:var(--muted)}
.phone-unavailable-note{display:block;color:var(--teal);font-size:56px;line-height:1.1}
#phone-unavailable nav{display:flex;justify-content:center;gap:22px;flex-wrap:wrap;margin-top:24px}
#phone-unavailable a{display:inline-flex;align-items:center;min-height:44px;color:var(--teal);font-weight:700}
@media(max-height:430px){.phone-unavailable-card{padding:8px 16px}.phone-unavailable-note{font-size:36px}#phone-unavailable h1{font-size:28px}#phone-unavailable nav{margin-top:8px}#phone-unavailable .eyebrow{margin:0}}
.keepbeat-board-options{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin:12px 0}.keepbeat-board-options label{display:flex;align-items:center;gap:12px;font-weight:700}.keepbeat-board-options .primary{border-radius:999px}#keepbeat-daily-exit{margin:0;flex-shrink:0;font-size:14px;padding:8px 12px}

.keepbeat-period-tabs{display:flex;gap:4px;padding:4px;border-radius:999px;background:#e7ebdf}.keepbeat-period-tabs button{border:0;border-radius:999px;padding:10px 22px;color:var(--ink);background:transparent;font:inherit;font-weight:700}.keepbeat-period-tabs [aria-selected=true]{background:var(--teal);color:white}.keepbeat-period-tabs button:focus-visible{outline:3px solid var(--student-orange);outline-offset:2px}

/* One session action in the header; reserve the left side for the student. */
.session-end{display:none!important}
.home-top{display:grid;grid-template-columns:minmax(160px,1fr) auto auto;gap:12px 16px;align-items:center}
.home-student-name{font-family:"Chalkboard SE","Chalkboard","Comic Sans MS",cursive;font-size:clamp(30px,3.6vw,48px);line-height:1.12;font-weight:700;letter-spacing:-.025em;overflow-wrap:anywhere;min-width:0;color:var(--ink)}
.home-top>nav{white-space:nowrap;font-size:14px}
.home-top>div{gap:8px}
.welcome-art:has([data-mode-art="daily"]:not([hidden])){background:transparent;transform:none}
.mode-art-layer[data-mode-art="daily"]>img{filter:drop-shadow(0 12px 12px #1b333e20);padding:0 18px}
@media(max-width:1000px){.home-top{grid-template-columns:minmax(150px,1fr) auto}.home-top>nav{grid-column:2;grid-row:2}.home-student-name{grid-column:1;grid-row:1 / span 2}.home-top>div{grid-column:2;grid-row:1}.home-top .text-button{padding:8px}.home-top>nav{font-size:12px}}

.mode-art-layer>.home-beat-drum{display:block;width:100%;height:100%;padding:0 18px;filter:drop-shadow(0 12px 12px #1b333e20)}
