:root{font-family:ui-rounded,'SF Pro Rounded','Avenir Next',system-ui,sans-serif;color:#365148;background:#eff3ec;font-synthesis:none;-webkit-tap-highlight-color:transparent}*{box-sizing:border-box}body{margin:0;overscroll-behavior:none;user-select:none;-webkit-user-select:none}button,select{font:inherit;color:inherit}button{border:0;cursor:pointer;touch-action:manipulation}button:focus-visible,a:focus-visible,select:focus-visible{outline:3px solid #dc9d3d;outline-offset:3px}button:active{transform:translateY(2px)}button:disabled{opacity:.45;cursor:wait}[hidden]{display:none!important}.app{height:100vh;height:100dvh;min-height:580px;max-width:1500px;margin:auto;padding:12px max(18px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:10px}header{height:60px;flex-shrink:0;display:flex;align-items:center;gap:18px}.brand{display:flex;align-items:center;gap:12px}.brand-mark{font-family:Georgia,serif;color:#bc795a;font-size:43px;transform:rotate(-10deg)}h1{font-family:Georgia,'Songti SC',serif;font-size:29px;font-weight:500;letter-spacing:-.8px;margin:0}.brand p{font-size:12px;color:#829282;margin:3px 0 0}.header-tools{display:flex;gap:9px;margin-left:auto}.round{display:grid;place-items:center;border-radius:50%;width:48px;height:48px;border:1px solid #dfe6d9;background:#fffdf5;font-size:23px}.round[aria-pressed=false]{background:#e4e9df;color:#9ba798}.modes{display:flex;gap:5px;width:min(590px,100%);padding:5px;border-radius:18px;background:#e0e8dd;margin:0 auto;flex-shrink:0}.modes button{flex:1;border-radius:13px;background:none;min-height:46px;display:flex;align-items:center;justify-content:center;gap:8px;font-size:15px;font-weight:650;white-space:nowrap}.modes b{font-size:25px;font-weight:400}.modes button[aria-pressed=true]{background:#547c69;color:#fff;box-shadow:0 3px 8px #365a4820}.desk{max-width:1100px;width:100%;align-self:center;border:1px solid #dde5d5;border-radius:21px;background:#fffdf6;padding:10px 20px 8px;flex-shrink:0;box-shadow:0 6px 20px #34572f04}.pattern-row{display:flex;align-items:center;gap:15px}#patterns{display:flex;gap:8px;flex:1;min-width:0}.pattern{display:flex;align-items:center;gap:10px;min-height:49px;padding:5px 12px;border-radius:12px;text-align:left;background:#f0f2e8;border:1px solid transparent;min-width:0;flex:1;max-width:310px}.pattern.selected{border-color:#b7cdae;background:#e9efdf}.pattern-num{color:#b28b50;font-family:Georgia,serif;font-size:22px}.pattern strong{display:block;font-size:14px;font-weight:650;line-height:1.3}.pattern small{font-size:10px;color:#84927e;margin-top:3px;display:block}.pattern-row label{margin-left:auto;display:flex;align-items:center;gap:7px;font-size:12px;color:#84917d}.pattern-row select{height:44px;border:1px solid #dce2d3;border-radius:10px;background:#f4f5ec;padding:0 8px;max-width:115px}.lesson{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:63px;margin-top:4px}h2{font-size:22px;font-weight:650;margin:0;letter-spacing:-.4px}#subhint{font-size:12px;color:#82907d;margin:5px 0 0;line-height:1.5}.transport{display:flex;gap:8px}.primary,.secondary{height:47px;border-radius:14px;padding:0 16px;white-space:nowrap;font-size:14px;font-weight:650}.primary{background:#c68159;color:#fff;box-shadow:0 3px 0 #a96845;min-width:110px}.secondary{background:#edf0e5;padding:0 14px;font-size:26px}.phrase-row{display:flex;align-items:center;gap:12px;height:30px;font-size:10px;color:#8a9683}.bars{display:flex;gap:5px}.bars span{height:24px;min-width:25px;display:flex;align-items:center;justify-content:center;gap:4px;border:1px solid #dfe7d5;border-radius:7px;color:#9aa690;padding:0 6px}.bars i{font-style:normal}.bars span.current{background:#e5eccd;color:#4d734e;border-color:#b6ca9c;font-weight:700}.bars span.done{background:#eff2e5;color:#79906b}.bars span[data-bar="3"].current{background:#ffe6bc;border-color:#e5bb7e;color:#9d6c31}#progress-label{margin-left:auto;font-variant-numeric:tabular-nums}#beat-strip{height:29px;display:flex;align-items:center;gap:5px}.beat-step{flex:1;height:22px;display:flex;align-items:center;justify-content:center;gap:4px;background:#eff1e8;border-radius:6px;color:#9da78e;min-width:0;border:1px solid transparent}.beat-step.now{border-color:#b9cba1;background:#e1ebcb}.beat-step.played{opacity:.5}.beat-dot{height:7px;width:7px;border-radius:50%;background:var(--dot)}.beat-step .beat-count{font-size:9px;margin-right:3px}.stage{position:relative;display:flex;flex-direction:column;flex:1;min-height:260px;max-width:1230px;width:100%;align-self:center;background:radial-gradient(ellipse at 50% 35%,#f6f8ed,#e8efdf);border:1px solid #d9e3cd;border-radius:25px;padding:7px 12px 8px;box-shadow:inset 0 -7px 0 #d9e3ca,0 6px 0 #ccd8be,0 12px 25px #4f63351a}.stage::before{content:'';pointer-events:none;position:absolute;inset:12% 8% 9%;background:#dce5ce;border-radius:50%;transform:perspective(550px) rotateX(8deg);opacity:.6}.stage-top,.stage-bottom{display:flex;align-items:center;justify-content:space-between;font-size:10px;color:#8e9d83;min-height:23px;gap:10px;position:relative;z-index:1}.studio-name{letter-spacing:2px;font-size:8px}.stage-top #sound-state{margin-left:auto}#retry{background:#fff6e4;color:#9c633a;border-radius:8px;min-height:32px;padding:0 12px;font-size:11px}.stage-bottom{font-size:11px;min-height:25px;justify-content:center}.stage-tip{position:absolute;right:0;font-size:9px;color:#9aa78d}.kit{position:relative;flex:1;min-height:205px;width:100%;max-width:1120px;margin:auto;touch-action:none}.stands{width:100%;height:100%;position:absolute;inset:0;pointer-events:none}.pad{background:none;position:absolute;display:flex;align-items:center;justify-content:center;touch-action:none;padding:0;outline-offset:-4px!important;border-radius:50%;-webkit-user-select:none;user-select:none;transform:none}.pad svg{width:100%;height:100%;overflow:visible;pointer-events:none;max-height:100%;display:block}.pad:active{transform:none}.pad .label{position:absolute;left:50%;bottom:5%;transform:translateX(-50%);min-width:70px;max-width:100%;text-align:center;white-space:nowrap;padding:5px 11px;border-radius:20px;font-size:12px;font-weight:650;letter-spacing:.1px;background:#fffdf0e8;color:#5c715c;box-shadow:0 2px 6px #294b3910;border:1px solid #e5e9d8;pointer-events:none}.pad .label kbd{font-size:9px;color:#a6ad96;margin-left:5px;font-family:inherit;font-weight:400}.pad .status{position:absolute;right:7%;top:8%;width:24px;height:24px;display:none;place-items:center;border-radius:50%;background:#efb844;color:#fff;font-size:15px;font-weight:750;pointer-events:none}.pad[data-pad="crash"]{left:0%;top:0%;width:32%;height:40%;z-index:2}.pad[data-pad="ride"]{left:69%;top:0%;width:31%;height:40%;z-index:2}.pad[data-pad="tom"]{left:37%;top:9%;width:26%;height:39%;z-index:3}.pad[data-pad="hat"]{left:0%;top:42%;width:20%;height:42%;z-index:3}.pad[data-pad="snare"]{left:21%;top:49%;width:25%;height:47%;z-index:4}.pad[data-pad="floor"]{left:77%;top:48%;width:23%;height:49%;z-index:4}.pad[data-pad="kick"]{left:47%;top:49%;width:29%;height:51%;z-index:4}.pad[data-pad="kick"] .label{bottom:29%;font-size:14px}.pad .guide-ring{fill:none;stroke:#e9ae37;stroke-width:6;opacity:0}.pad .hit-ring{fill:none;stroke:#fff7cf;stroke-width:7;opacity:0}.pad.expected .guide-ring{opacity:1;filter:drop-shadow(0 0 6px #ffc95bb0);animation:glow 1.15s ease-in-out infinite}.pad.expected .label{border-color:#edcc7c;background:#fff1c3;color:#826024}.pad.expected .status{display:grid}.pad.matched .guide-ring{stroke:#69aa7c;opacity:1;animation:none;filter:drop-shadow(0 0 5px #94d49b)}.pad.matched .status{background:#6ca87b;display:grid}.pad.matched .label{border-color:#b4cfa2;background:#e9f2d7;color:#52754f}.pad.playing .guide-ring{stroke:#79b690;opacity:.9}.pad.struck .moving{animation:thump .16s ease-out;transform-origin:50% 45%;transform-box:fill-box}.pad.cymbal.struck .moving{animation:wobble .32s ease-out}.pad.struck .hit-ring{animation:ripple .3s ease-out}.pad.held .label{background:#ecf2db}footer{text-align:center;font-size:10px;color:#9fa993;min-height:17px;margin-top:4px}dialog{border:1px solid #dfe6d4;border-radius:24px;padding:22px;background:#fffdf5;color:#405a4d;width:min(640px,90vw);max-height:85vh;box-shadow:0 15px 80px #183e2d40;overflow:auto}dialog::backdrop{background:#23463666;backdrop-filter:blur(5px)}.dialog-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:15px}.dialog-heading h2{font-family:Georgia,'Songti SC',serif;font-weight:500;font-size:25px}.about-copy{font-size:13px;line-height:1.85;user-select:text;-webkit-user-select:text}.about-copy a{color:#3e8260}.about-copy h3{margin:20px 0 8px}#celebration{position:fixed;inset:0;pointer-events:none;overflow:hidden;z-index:20}.spark{position:absolute;left:var(--x);top:40%;color:var(--color);font-size:var(--size);animation:float 1.6s ease-out forwards}@keyframes glow{0%,100%{opacity:.65;stroke-width:5}50%{opacity:1;stroke-width:8}}@keyframes thump{0%{transform:scale(1)}30%{transform:scale(.96)}100%{transform:scale(1)}}@keyframes wobble{0%,100%{transform:rotate(0deg)}25%{transform:rotate(-3deg)}65%{transform:rotate(2deg)}}@keyframes ripple{from{opacity:.9;stroke-width:8}to{opacity:0;stroke-width:1}}@keyframes float{from{transform:translateY(0) rotate(-10deg);opacity:1}to{transform:translateY(-180px) rotate(25deg);opacity:0}}
@media(orientation:portrait){.app{min-height:660px}.stage{min-height:330px}.stage::before{inset:7% 3% 4%;border-radius:45%}.stands{opacity:.35}.pad[data-pad="crash"]{left:0;top:0;width:33%;height:28%}.pad[data-pad="ride"]{left:67%;top:0;width:33%;height:28%}.pad[data-pad="tom"]{left:34%;top:18%;width:32%;height:30%}.pad[data-pad="hat"]{left:0;top:30%;width:30%;height:29%}.pad[data-pad="snare"]{left:1%;top:60%;width:32%;height:34%}.pad[data-pad="floor"]{left:68%;top:45%;width:32%;height:39%}.pad[data-pad="kick"]{left:34%;top:60%;width:33%;height:39%}.pad .label{font-size:12px}.pad[data-pad="kick"] .label{bottom:29%;font-size:13px}.stage-tip{display:none}.pattern{max-width:none}}
@media(max-width:600px){.app{padding:8px 10px;gap:7px;min-height:625px}header{height:48px;gap:9px}.brand{gap:6px}.brand-mark{font-size:31px}h1{font-size:24px}.brand p{display:none}.header-tools{gap:5px}.round{width:44px;height:44px;font-size:21px}.modes button{font-size:12px;min-height:43px;gap:4px}.modes b{font-size:20px}.desk{padding:8px 10px 5px;border-radius:17px}.pattern-row{gap:6px}.pattern{padding:4px 7px;min-height:45px;gap:6px;border-radius:9px}.pattern strong{font-size:11px}.pattern small{display:none}.pattern-num{font-size:19px}#patterns{gap:5px}.pattern-row label>span{display:none}.pattern-row select{height:42px;padding:0 3px;font-size:11px;max-width:74px}.lesson{min-height:61px;gap:6px}h2{font-size:17px}#subhint{font-size:10px;line-height:1.5;max-width:230px}.transport{gap:4px}.primary{height:44px;min-width:80px;font-size:11px;padding:0 9px}.secondary{height:44px;font-size:21px;padding:0 10px}.phrase-row{height:28px;gap:6px;font-size:9px}.bars{gap:3px}.bars span{height:21px;min-width:22px;padding:0 4px}.beat-step{gap:2px}.beat-dot{width:5px;height:5px}.beat-step .beat-count{font-size:7px;margin-right:0}#beat-strip{gap:3px;height:24px}.stage{padding:6px 6px 8px;min-height:290px;border-radius:21px}.stage-top,.stage-bottom{font-size:9px;min-height:20px}.studio-name{font-size:6px;letter-spacing:1px}.stage-top #sound-state{font-size:8px}.pad .label{font-size:10px!important;padding:4px 7px;min-width:48px;bottom:1%}.pad .label kbd{display:none}.pad .status{width:19px;height:19px;font-size:12px;right:0;top:0}.pad[data-pad="kick"] .label{bottom:22%}.kit{min-height:220px}footer{font-size:8px;margin-top:3px;min-height:12px}}
@media(orientation:landscape) and (max-height:650px){.app{gap:6px;min-height:510px}header{height:45px}.modes button{min-height:38px}.desk{padding-top:5px}.pattern{min-height:42px}.pattern small{display:none}.lesson{min-height:53px}h2{font-size:19px}.stage{min-height:220px}.kit{min-height:175px}.stage-top{min-height:17px}.stage-bottom{min-height:18px}.pad .label{font-size:10px;padding:3px 7px}.pad .label kbd{display:none}footer{display:none}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important}}

.pad .status{right:auto;left:50%;top:3%;transform:translateX(-50%)}

/* Free play shows the instrument first; lessons appear only in lesson modes. */
.app{min-height:0}
body[data-play-mode="free"] .lesson{min-height:32px;margin:0;justify-content:center;text-align:center}
body[data-play-mode="free"] .lesson h2{font-size:16px;font-weight:500;color:#6c7e70}
body[data-play-mode="free"] #subhint,body[data-play-mode="free"] .transport{display:none}
@media(max-width:600px){body[data-play-mode="free"] .lesson h2{font-size:14px}}

body[data-play-mode="free"] .desk{padding:0;border:0;background:none;box-shadow:none}
body[data-play-mode="free"] .pattern-row,body[data-play-mode="free"] .phrase-row,body[data-play-mode="free"] #beat-strip{display:none}
@media(orientation:landscape) and (max-height:650px){.app{min-height:0;gap:6px;padding-top:6px;padding-bottom:10px}.stage,.kit{min-height:0}}
@media(orientation:landscape) and (max-height:500px){
 .app{display:grid;grid-template-columns:minmax(240px,.85fr) minmax(0,1fr);grid-template-rows:48px auto minmax(0,1fr);gap:6px 12px;padding:6px max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left))}
 header{height:48px;gap:10px;min-width:0}.brand{gap:4px}.brand-mark,.brand p{display:none}h1{font-size:21px}.header-tools{gap:5px}.round{width:44px;height:44px}
 .modes{width:100%;margin:0;align-self:center;padding:2px;border-radius:14px}.modes button{min-height:44px;font-size:12px;gap:5px}.modes b{font-size:20px}
 .desk{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);gap:0 16px;padding:4px 10px;border-radius:14px}
 .pattern-row{gap:7px;min-width:0}#patterns{gap:5px}.pattern{min-height:44px;padding:3px 6px;gap:5px}.pattern-num{font-size:18px}.pattern strong{font-size:11px}.pattern small{display:none}.pattern-row label>span{display:none}.pattern-row select{height:44px;padding:0 4px;font-size:11px;max-width:76px}
 .lesson{min-height:44px;margin:0;gap:6px}.lesson h2{font-size:14px}#subhint{font-size:10px;margin-top:2px;line-height:1.3}.transport{gap:5px}.primary,.secondary{height:44px;padding:0 9px;font-size:11px;min-width:0}.secondary{font-size:22px}
 .phrase-row{height:25px;gap:7px;font-size:9px}.bars{gap:3px}.bars span{height:20px;min-width:20px;padding:0 4px}.bars i{font-size:9px}#beat-strip{height:25px;gap:3px}.beat-step{height:19px;gap:2px}.beat-dot{width:5px;height:5px}.beat-step .beat-count{font-size:8px}
 body[data-play-mode="free"] .desk{display:block}body[data-play-mode="free"] .lesson{min-height:24px}body[data-play-mode="free"] .lesson h2{font-size:13px}
 .stage{grid-column:1/-1;min-height:0;padding:3px 8px 6px;border-radius:18px;box-shadow:inset 0 -5px 0 #d9e3ca,0 4px 0 #ccd8be}.kit{min-height:0}.stage-top{min-height:17px;font-size:8px}.stage-bottom{min-height:18px;font-size:9px}.studio-name{font-size:7px}.pad .label{font-size:9px;padding:2px 6px}.pad .label kbd{display:none}.pad .status{width:20px;height:20px;font-size:12px}footer{display:none}
}

@media(orientation:landscape) and (max-height:500px){.stage{align-self:stretch;height:100%}}

.modes button{min-height:44px}
