.rhythm-builder{display:block!important;width:100%;max-width:900px;margin:auto}.builder-help,.builder-status{font-size:18px!important;line-height:1.5;margin:10px 0;color:inherit}.rhythm-lengths{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}.rhythm-lengths button,.rhythm-check{min-height:44px;padding:8px 12px;border:2px solid #779ab1;background:#173b54;color:#fff6df;font:18px/1.4 var(--pixel-ui,var(--pixel,monospace));cursor:pointer}.rhythm-lengths button[aria-pressed=true]{background:#ffe083;color:#152a3b;border-color:#fff0b2}.rhythm-count-grid{display:grid;grid-template-columns:repeat(var(--slots),minmax(0,1fr));grid-template-rows:32px 58px;isolation:isolate;border:2px solid #8297a7;background:#071d30}.count-slot{display:flex;align-items:flex-start;justify-content:center;padding:4px 0;border:0;border-right:1px solid #567083;background:transparent;color:#fff6df;min-width:0;font:18px/1.2 var(--pixel-ui,var(--pixel,monospace));cursor:pointer}.rhythm-block{z-index:1;min-width:0;margin:3px 2px 4px;border:3px solid #fff5d9;border-bottom:5px solid #3d5771;background:var(--block-color);color:#102031;font:24px/1 sans-serif;cursor:pointer}.rhythm-block.rest{background:repeating-linear-gradient(135deg,#122536 0 5px,#344a5b 5px 9px);color:white;font:14px/1.2 var(--pixel-ui,var(--pixel,monospace))}.rhythm-check{background:#ffe083;color:#142737;min-width:140px}.rhythm-check:disabled{opacity:.45}.rhythm-builder button:focus-visible{outline:3px solid #fff;outline-offset:2px}@media(max-width:500px){.rhythm-block{margin-left:1px;margin-right:1px;border-width:2px}.rhythm-block.rest{font-size:9px}.rhythm-lengths{gap:5px}.rhythm-lengths button{padding:7px;font-size:18px}.count-slot{font-size:18px}}

.arena:has(.rhythm-builder){z-index:9}.arena:has(.rhythm-builder) .prompt{min-height:100px;margin-bottom:10px}.arena:has(.rhythm-builder) .notation{height:120px}.arena .builder-help,.arena .builder-status{font-size:18px!important;line-height:1.2;margin:6px 0}.arena .rhythm-lengths{margin:6px 0}.arena .rhythm-count-grid{grid-template-rows:27px 44px}.arena .rhythm-check{min-height:40px;padding:4px 12px}.arena:has(.rhythm-builder) .feedback{margin-top:6px}
.arena .builder-status{position:absolute!important;width:1px!important;height:1px!important;margin:0!important;overflow:hidden;clip-path:inset(50%)}.arena .rhythm-check{margin-top:6px}

.rhythm-block,.rhythm-block.rest{font:14px/1 var(--pixel-ui,var(--pixel,monospace));overflow:hidden;padding:2px;container-type:inline-size}.rhythm-block{font-size:clamp(8px,3vw,14px)}@media(max-width:500px){.rhythm-block,.rhythm-block.rest{font-size:9px}.rhythm-block.narrow{writing-mode:vertical-rl;text-orientation:upright;letter-spacing:-1px}}

@font-face{font-family:CountingPixel;src:url('/fonts/pixelated-elegance.ttf') format('truetype');font-display:swap}
.counting-game{max-width:980px;margin:0 auto;min-width:0}.counting-game [hidden]{display:none!important}/* Approved Rows layout: music, actions, then four chronological beat rows. */
.counting-board{display:grid;grid-template-columns:minmax(260px,1fr) 100px minmax(212px,.68fr);align-items:center;gap:14px;min-width:0}
.counting-notation{background:#effbff;color:#132b3d;border:4px solid var(--pit-light,#b9f4ff);min-height:168px;display:flex;align-items:center;justify-content:center;min-width:0}
.counting-notation svg{display:block;width:100%;height:auto;max-height:168px;overflow:visible}
.counting-counts{display:grid;grid-template-rows:repeat(4,1fr);gap:8px;min-width:0}
.counting-beat{display:grid;grid-template-columns:repeat(var(--counting-division,2),minmax(44px,1fr));gap:4px;min-width:0}
.counting-game .counting-count{min-width:44px;min-height:54px;padding:6px 0;border:3px solid var(--pit-rail,#38bfd7);background:var(--pit-deep,#085582);box-shadow:inset 0 2px var(--pit-light,#b9f4ff),inset 0 -3px var(--pit-edge,#083e69);font:400 32px/1 CountingPixel,monospace!important;color:#d7e7f0;font-synthesis:none;touch-action:manipulation}.counting-game .counting-count.beat{color:#fff4be;background:var(--pit-edge,#0b446b);border-color:var(--pit-light,#d0eeff);box-shadow:inset 0 3px #506b7d,inset 0 -4px #122c40}.counting-game .counting-count[aria-pressed=true]{background:#6844bc;color:#fff;border-color:#d4bfff;box-shadow:inset 0 3px #9473d6,inset 0 -4px #41277b}.counting-game .counting-count[data-wrong=true]{background:#9c3444;color:#fff3cf;border-color:#ffd7c7;box-shadow:inset 0 3px #c65260,inset 0 -4px #672c3a}.counting-game button:disabled{opacity:1;cursor:default}.counting-actions{display:flex;flex-direction:column;gap:12px;margin:0;align-items:stretch}.counting-game .rhythm-check{min-width:0;width:100%;margin:0;background:#f5da7b;color:#203047;border-color:#fff0aa;box-shadow:inset 0 2px #fff4be,inset 0 -3px #a88538}.counting-game .rhythm-check,.counting-clear{min-height:44px;padding:8px 14px;font:22px/1.2 var(--pixel-ui,Ithaca,monospace);border:2px solid #c6e5f3;background:#b9eaff;color:#102337}.counting-clear{background:#21435a;color:#effaff;border-color:#6c8fa8}.counting-clear:disabled{opacity:.45!important}.counting-game .rhythm-check[data-state=correct]{background:#087b43;color:white;border-color:#7ee8ae;box-shadow:inset 0 3px #24995b,inset 0 -4px #064b31}.counting-game .rhythm-check[data-state=wrong]{background:#bd1637;color:white;border-color:#ff91a5;box-shadow:inset 0 3px #df3b57,inset 0 -4px #790c26}.counting-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap}.counting-rotate{font:24px/1.4 CountingPixel,monospace;color:#b9eaff;text-align:center;padding:50px 12px}.arena:has(.counting-game) .prompt{display:none}.arena:has(.counting-game) .game-top{font-family:CountingPixel,monospace}.arena:has(.counting-game) .feedback{display:none}.counting-mode #notation,.counting-mode #feedback,.counting-mode #prompt{display:none}.counting-mode #promptArea{min-width:0}.counting-mode #choices{display:block;width:100%;max-width:980px}.counting-mode #questionPanel{min-width:0}.counting-mode #activityLabel{font-family:CountingPixel,monospace!important}
@media(max-height:500px){.arena:has(.counting-game){margin-top:0;padding-inline:14px}.arena:has(.counting-game) .game-metrics{margin-top:4px;min-height:30px}.arena:has(.counting-game) .game-top{font-size:14px}.arena:has(.counting-game) .counting-actions{margin-top:6px}.counting-mode .question-heading{margin:0}.counting-game .counting-count{min-height:52px}.counting-mode .track-panel{max-height:90px;overflow:hidden}}

.counting-game .rhythm-check{min-width:0;margin:0;background:#f5da7b;color:#203047;border-color:#fff0aa}
.counting-game .rhythm-check[data-state=correct]{background:#087b43;color:white;border-color:#7ee8ae}
.counting-game .rhythm-check[data-state=wrong]{background:#bd1637;color:white;border-color:#ff91a5}
.counting-game .counting-clear{min-width:0;width:100%;padding-inline:6px}
@media(max-width:740px){.counting-board{grid-template-columns:minmax(210px,1fr) 88px minmax(196px,.85fr);gap:8px}.counting-counts{gap:6px}}
@media(max-width:590px){.counting-board{grid-template-columns:1fr;gap:12px}.counting-notation{width:100%;min-height:134px}.counting-actions{flex-direction:row;justify-content:center}.counting-game .counting-actions button{width:100px}.counting-counts{width:100%;max-width:350px;margin:auto}}
@media(orientation:landscape) and (max-height:500px){.counting-board{gap:8px;grid-template-columns:minmax(210px,1fr) 88px minmax(196px,.68fr)}.counting-game .counting-count{min-height:44px;font-size:30px!important}.counting-counts{gap:6px}.counting-game .counting-actions{margin:0}.counting-notation{min-height:150px}.counting-notation svg{max-height:150px}}
@media(orientation:landscape) and (max-height:500px) and (max-width:590px){.counting-board{grid-template-columns:minmax(0,1fr) 76px 188px;gap:6px}.counting-game .counting-actions{flex-direction:column}.counting-game .counting-actions button{width:100%;min-width:0;padding-inline:4px}.counting-game .counting-counts{width:100%}}
@media(orientation:landscape) and (max-height:500px){.counting-game .counting-count{padding-block:4px}}
