:root{font-family:-apple-system,BlinkMacSystemFont,"Noto Sans JP","Segoe UI",sans-serif;color:#253332;background:#f5f7f7;font-synthesis:none;--green:#1e6559;--muted:#71807e;--line:#e3e9e7}*{box-sizing:border-box}body{margin:0}button,input,select{font:inherit}button{cursor:pointer;border:1px solid var(--line);background:white;color:inherit;border-radius:8px;min-height:44px;padding:8px 14px;transition:background .15s}button:hover{background:#eaf1ef}button:disabled{opacity:.5;cursor:wait}button:focus-visible,input:focus-visible,select:focus-visible,a:focus-visible{outline:3px solid #cf9b3e;outline-offset:3px}button[aria-pressed=true]{background:#e5f0eb;color:#175b4e}input[type=range]{accent-color:var(--green);min-width:0}input[type=checkbox]{accent-color:var(--green)}.topbar{height:86px;background:#142a29;color:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 36px}.brand{display:flex;gap:12px;align-items:center;color:inherit;text-decoration:none;font-family:Georgia,serif;font-size:27px}.brand-icon{font-family:sans-serif;font-size:38px;color:#ddc494}.brand small{font-family:sans-serif;display:block;font-size:10px;letter-spacing:2.2px;margin-top:5px;color:#becdca}.connection{background:#243c39;color:#e3ebe8;border-color:#49605a;font-size:14px}.app{display:grid;grid-template-columns:302px minmax(0,1fr);max-width:1800px;margin:auto}aside{padding:32px 20px;background:#fff;border-right:1px solid var(--line);height:calc(100dvh - 86px);position:sticky;top:0;overflow:auto}.eyebrow{font-size:11px;font-weight:700;letter-spacing:2px;color:var(--muted)}h2{font-size:19px;margin:9px 0 24px}.library-heading{display:flex;align-items:start;justify-content:space-between}.search{display:flex;align-items:center;gap:8px;padding:0 12px;background:#f4f6f5;border:1px solid var(--line);border-radius:8px}.search span{font-size:26px;color:var(--muted)}.search input{min-width:0;width:100%;border:0;background:none;outline:none;height:44px;font-size:14px}.filters{display:flex;gap:3px;margin:18px 0 26px}.filters button{padding:6px 11px;min-height:38px;border:0;font-size:14px;flex:1;white-space:nowrap}.list-label{display:flex;justify-content:space-between;color:var(--muted);font-size:12px;margin:0 4px 12px}.song-row{width:100%;text-align:left;display:flex;gap:12px;border:1px solid transparent;padding:16px 10px;margin:3px 0;border-radius:9px}.song-row.active{background:#eaf2ee;border-color:#cfdfd7}.song-number{font-family:Georgia,serif;font-size:19px;color:#8a9a95;padding-top:1px}.song-row.active .song-number{color:var(--green)}.song-row strong{display:block;font-size:14px;font-weight:600;line-height:1.65}.song-row small{display:block;color:var(--muted);font-size:12px;margin-top:6px}.import-button{width:100%;margin-top:24px;border-style:dashed}.library-note{font-size:12px;line-height:1.8;color:var(--muted)}main{min-width:0;padding:28px 42px 16px}.breadcrumb{display:flex;align-items:center;gap:12px;font-size:12px;color:var(--muted);margin-bottom:28px}.breadcrumb button{font-size:12px;min-height:24px;padding:0;border:0;background:none}.song-heading{display:flex;justify-content:space-between;gap:20px;align-items:center}.song-kicker{display:flex;align-items:center;gap:14px}.badge{font-size:12px;padding:4px 9px;background:#e5efdf;color:#4b6a34;border-radius:4px}h1{font-size:clamp(23px,2.2vw,34px);letter-spacing:-.6px;margin:13px 0 10px;line-height:1.45}.song-heading p{font-size:13px;color:var(--muted);margin:0}.best{border-left:1px solid var(--line);padding-left:28px;flex-shrink:0}.best>span{display:block;font-size:12px;color:var(--muted)}.best strong{display:block;font-family:Georgia,serif;font-size:32px;margin-top:8px;font-weight:400}.best small{font-size:14px}.song-details{display:flex;gap:0;flex-wrap:wrap;font-size:12px;color:#62706c;margin:22px 0 24px}.song-details span{padding:0 15px;border-right:1px solid #d9dfdc}.song-details span:first-child{padding-left:0}.song-details span:last-child{border:0}.practice{background:white;border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:0 4px 16px #20362a04}.practice-toolbar{display:flex;align-items:center;justify-content:space-between;padding:14px 20px;border-bottom:1px solid var(--line);gap:10px}.tabs{display:flex;padding:3px;background:#f2f5f3;border-radius:8px}.tabs button{border:0;min-height:36px;font-size:13px;padding:7px 15px}.tabs button[aria-pressed=true]{background:white;box-shadow:0 1px 4px #16332915}.zoom{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:12px}.zoom button{border:0;min-height:36px;padding:3px 9px;font-size:18px}#notice{font-size:12px;color:#637b71;padding:10px 22px;background:#f7faf8;line-height:1.7}#score-scroll{height:350px;overflow:auto;position:relative;padding:14px 18px;overscroll-behavior:contain}#osmd-container{min-width:280px}#loading{position:absolute;inset:0;display:grid;place-items:center;background:white;z-index:2;color:var(--muted)}#loading[hidden]{display:none}#countdown{position:absolute;inset:0;z-index:3;background:#ffffffc9;text-align:center;align-content:center;font-size:80px;color:var(--green)}.score-footer{padding:14px 22px;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:10px;font-size:12px;color:var(--muted)}.legend{display:flex;gap:16px}.good{color:#358368}.late{color:#a77924}.miss{color:#c16463}.transport{padding:18px 0 22px}.timeline{display:flex;align-items:center;gap:14px;font-size:12px;color:var(--muted);font-variant-numeric:tabular-nums}.timeline input{flex:1;width:100%;height:24px}.controls{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:14px;flex-wrap:wrap}.play-controls{display:flex;align-items:center;gap:8px}.icon-button{border:0;background:transparent;font-size:22px;padding:8px 12px}.play-button{background:var(--green);border-color:var(--green);color:white;min-width:176px;padding:12px 22px;font-size:14px;font-weight:600}.play-button:hover{background:#164d43}.settings{display:flex;align-items:center;gap:16px;font-size:12px;flex-wrap:wrap}.settings label{display:flex;align-items:center;gap:8px}.settings select{border:0;background:transparent;padding:10px 0;color:var(--green);font-weight:600}.settings button{font-size:12px;min-height:38px;background:transparent}.settings button[aria-pressed=true]{background:#e5f0eb}.volume input{width:70px}#tracks{display:flex;gap:12px;flex-wrap:wrap;margin-top:12px;font-size:12px}#tracks label{display:flex;align-items:center;gap:4px}.keyboard-panel{border:1px solid var(--line);border-radius:12px;background:#fff;padding:18px 22px 8px}.keyboard-title{display:flex;align-items:center;justify-content:space-between;gap:12px;font-size:12px;color:var(--muted);margin-bottom:14px}.keyboard-title h2{font-size:14px;color:#394b45;margin:0}.keyboard-title>div{display:flex;align-items:center;gap:10px}.keyboard-title button{min-height:28px;padding:2px 9px;border:0}.keyboard-panel p{text-align:center;font-size:11px;color:var(--muted);margin:12px 0 7px}#keyboard{height:112px;position:relative;display:flex;user-select:none;touch-action:none;padding:0 1px 2px;background:#bcc7c1;border-radius:5px;overflow:hidden}.piano-key{border-radius:0 0 4px 4px;border:1px solid #bbc5bf;flex:1;padding:0;display:flex;align-items:end;justify-content:center;background:linear-gradient(#fff,#f3f5f3);color:#849089;font-size:11px;padding-bottom:8px;min-width:0;touch-action:none}.piano-key.black{position:absolute;z-index:1;top:0;height:65%;width:4.6%;background:linear-gradient(#34443d,#18231e);color:#bcc8c0;border-color:#1a2921;padding-bottom:6px}.piano-key.pressed{background:#badbc7}.piano-key.black.pressed{background:#4f9b78}.piano-key.expected{box-shadow:inset 0 -5px #c6a568}footer{display:flex;justify-content:space-between;font-size:11px;color:#8d9994;margin-top:24px}footer span{font-family:Georgia,serif}#close-library{display:none}dialog{border:1px solid var(--line);border-radius:16px;max-width:min(450px,calc(100vw - 32px));padding:32px;color:inherit;box-shadow:0 20px 80px #142a2940}dialog::backdrop{background:#10292277}dialog p{font-size:14px;line-height:1.9}dialog h2{font-size:24px}.dialog-close{float:right;border:0;font-size:24px;margin:-15px -15px 0 0}#result-score{font-family:Georgia,serif;font-size:64px;color:var(--green)}#midi-inputs{font-size:14px;line-height:2}.empty{font-size:14px;color:var(--muted);padding:24px 0}.delete-song{font-size:12px;min-height:28px;padding:3px 10px;margin-left:36px}
@media(min-width:1500px){#score-scroll{height:430px}main{padding:36px 58px}.app{grid-template-columns:320px minmax(0,1fr)}}@media(max-width:1100px){.app{grid-template-columns:255px minmax(0,1fr)}main{padding:24px}.topbar{padding:0 24px}.settings{gap:10px}#tags{width:100%;margin-top:10px;padding-left:0}.best{padding-left:15px}.volume{display:none}}@media(max-width:760px){.topbar{height:72px;padding:0 18px}.brand{font-size:23px}.brand-icon{font-size:32px}.brand small{font-size:8px}.connection{font-size:12px;padding:8px 10px}.app{display:block}aside{display:none;position:fixed;inset:0;z-index:10;height:100dvh;width:min(360px,100vw);box-shadow:0 0 0 100vmax #142a2980;padding:26px 20px}aside.open{display:block}#close-library{display:block}main{padding:20px 16px}.breadcrumb{margin-bottom:20px}.breadcrumb button{font-size:13px;min-height:36px;padding:0 6px;background:#e8eeea}.song-heading{gap:12px}h1{font-size:23px;margin-top:10px}.song-heading p{font-size:12px}.best{padding-left:12px}.best strong{font-size:26px}.best>span{font-size:11px}.song-details{margin:18px 0}.practice-toolbar{padding:10px}.tabs button{font-size:12px;padding:7px 10px}.zoom{gap:1px;font-size:11px}#notice{padding:9px 12px}#score-scroll{height:310px;padding:12px 0}.score-footer{padding:12px;font-size:11px}.legend{gap:10px}#live-score{max-width:130px;text-align:right}.controls{justify-content:center}.play-controls{width:100%;justify-content:center}.play-button{flex:1;max-width:280px}.settings{justify-content:center;gap:14px;width:100%}.keyboard-panel{padding:14px 10px 8px}.keyboard-title{gap:6px}.keyboard-title h2{font-size:12px}.keyboard-title>div{gap:4px}#keyboard{height:120px}.keyboard-panel p span{display:none}footer{font-size:10px;gap:10px}.song-details span{padding:0 10px}#tags{padding-left:0}dialog .play-button{width:100%}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}@media(max-width:360px){.best{display:none}.zoom span{display:none}}
/* Keep core controls legible across desktop and touch layouts. */
.song-heading p,.song-details,.settings,.settings button,.tabs button,.connection,.keyboard-title,.score-footer,#tracks{font-size:14px}.song-row strong{font-size:15px}.song-row small,.library-note,.list-label,.timeline,.keyboard-panel p,#notice{font-size:13px}.song-details{line-height:1.8}.keyboard-title button,.zoom button{min-width:36px;min-height:36px}@media(max-width:760px){.settings{gap:10px}.keyboard-title{flex-wrap:wrap}.score-footer{font-size:12px}.song-details{font-size:13px}.tabs button{font-size:13px}.song-heading p{font-size:13px}}
/* Four judgements share their palette across notes, counters and feedback. */
.perfect{color:#38bdf8}.good{color:#9acd32}.bad{color:#f4dc78}.miss{color:#ec4899}
.score-footer{flex-wrap:wrap;align-items:center}.legend{flex-wrap:wrap;gap:8px 16px;font-weight:600}.legend>span{white-space:nowrap}#last-judgement{font-weight:800;min-width:70px}#judgement-counts{display:flex;flex-wrap:wrap;gap:8px;padding:0 22px 14px}.judgement-chip{border:1px solid currentColor;border-radius:6px;padding:5px 9px;font-size:13px;font-weight:600;background:white;font-variant-numeric:tabular-nums}#result-detail{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:16px 0}.result-note{font-size:12px!important;color:var(--muted)}
.note-burst{position:absolute;z-index:2;width:0;height:0;pointer-events:none;contain:layout style}.note-burst::before{content:'';position:absolute;left:-9px;top:-9px;width:18px;height:18px;border:2px solid currentColor;border-radius:50%;animation:note-ring .5s ease-out both}.note-burst b{position:absolute;left:0;top:-24px;white-space:nowrap;font-size:13px;line-height:1.2;font-weight:800;background:#ffffffed;padding:2px 5px;border-radius:4px;transform:translateX(-50%);animation:note-label .6s ease-out both}.note-burst i{position:absolute;left:-3px;top:-3px;width:6px;height:6px;border-radius:50%;background:currentColor;animation:note-particle .55s ease-out both}.note-burst.perfect i{border-radius:1px}
@keyframes note-particle{from{transform:translate(0,0) scale(.4);opacity:1}to{transform:translate(var(--dx),var(--dy)) scale(.1) rotate(120deg);opacity:0}}
@keyframes note-ring{from{transform:scale(.4);opacity:.9}to{transform:scale(2.8);opacity:0}}
@keyframes note-label{0%{transform:translate(-50%,0);opacity:0}15%{opacity:1}70%{opacity:1}100%{transform:translate(-50%,-17px);opacity:0}}
@media(max-width:760px){.score-footer .legend{width:100%;justify-content:space-between;gap:6px;font-size:12px}#judgement-counts{padding:0 12px 12px;gap:6px}.judgement-chip{padding:4px 7px;font-size:12px}}
@media(prefers-reduced-motion:reduce){.note-burst::before,.note-burst i{display:none}.note-burst b{animation:none}}

/* Bad and Miss pop only their label, without a ring or particles. */
.note-burst.bad::before,.note-burst.miss::before{display:none}

.arrangement-panel{background:#edf4f1;border:1px solid #d2e2da;border-radius:10px;padding:18px;margin-bottom:20px}.arrangement-panel[hidden],#arrangement-options[hidden]{display:none}.arrangement-panel h2{font-size:17px;margin:0 0 8px}.arrangement-panel p{font-size:13px;line-height:1.7;margin:8px 0;color:#52665c}.arrangement-fields{display:flex;align-items:end;flex-wrap:wrap;gap:12px}.arrangement-fields label{display:flex;flex:1;min-width:180px;flex-direction:column;gap:6px;font-size:14px}.arrangement-fields select{max-width:100%;min-height:44px;width:100%;padding:8px;border:1px solid #c9d7d0;border-radius:6px;background:white;color:#253332}.arrangement-fields button{font-size:14px}@media(max-width:760px){.arrangement-fields{display:grid;grid-template-columns:minmax(0,1fr)}.arrangement-fields label{min-width:0}}

/* Score-first workspace: secondary panels open only when needed. */
.topbar{height:48px;padding:0 20px}.brand{font-size:20px;gap:8px}.brand-icon{font-size:27px}.brand small{display:none}.connection{min-height:36px;padding:6px 12px}
.app{display:block;max-width:none}main{padding:8px 20px 12px}
#library{display:none;position:fixed;inset:0 auto 0 0;z-index:10;width:min(360px,100vw);height:100dvh;padding:24px 20px;box-shadow:0 0 0 100vmax #142a2980}#library.open{display:block}#close-library{display:block}
.score-heading{display:flex;align-items:center;gap:20px;min-height:44px}.breadcrumb{margin:0;flex-shrink:0}.breadcrumb button{min-height:44px;padding:0 10px;font-size:13px;background:#e8eeea}.song-heading{min-width:0}.song-heading h1{margin:0;font-size:clamp(17px,2vw,24px);line-height:1.4;overflow-wrap:anywhere}
.score-options{margin:4px 0 8px}.score-options>summary,.keyboard-panel>summary{cursor:pointer;min-height:44px;padding:12px;font-size:13px;color:var(--green);border-radius:6px}.score-options>summary:hover,.keyboard-panel>summary:hover{background:#e8eeea}summary:focus-visible{outline:3px solid #cf9b3e;outline-offset:2px}.options-content{padding:4px 12px 16px;border:1px solid var(--line);border-radius:8px;background:white}.song-details{margin:12px 0;gap:8px 0}.song-details #tags{width:auto;margin:0;padding:0 15px}.arrangement-panel{margin-bottom:12px;padding:12px}.settings{justify-content:flex-start}.settings .volume{display:flex}#tracks:empty{display:none}
.practice{display:flex;flex-direction:column;height:calc(100dvh - 280px);min-height:360px;border-radius:8px}.practice-toolbar{padding:4px 12px;flex-shrink:0}.tabs button,.zoom button{min-height:40px}.zoom button{min-width:40px}#notice{padding:4px 14px;font-size:12px;flex-shrink:0}#score-scroll{height:auto;flex:1;min-height:200px;padding:8px 12px}.score-footer{padding:5px 14px;font-size:12px;flex-shrink:0}#judgement-counts{padding:0 14px 6px;gap:6px;flex-shrink:0}.judgement-chip{padding:2px 7px;font-size:12px}#judgement-counts:empty{display:none}
.transport{display:flex;align-items:center;gap:20px;padding:6px 0}.timeline{flex:1}.controls{margin:0;flex-shrink:0}.play-controls{width:auto}.play-button{min-width:156px;min-height:44px;padding:10px 16px}.keyboard-panel{padding:0 10px;border-radius:8px}.keyboard-panel[open]{padding-bottom:8px}.keyboard-title{margin:4px 0 8px}#keyboard{height:100px}footer{margin-top:10px;font-size:10px;gap:12px;flex-wrap:wrap}
@media(max-width:760px){.topbar{padding:0 10px}main{padding:6px 8px 10px}.score-heading{gap:10px}.breadcrumb button{font-size:12px;padding:0 8px}.song-heading h1{font-size:17px}.practice-toolbar{padding:4px 6px}.tabs button{padding:7px 8px}.practice{height:calc(100dvh - 300px);min-height:340px}#score-scroll{padding:6px 0}.score-footer{gap:4px 8px;padding:4px 8px}.score-footer .legend{width:auto;flex:1;font-size:11px;gap:6px}#live-score{font-size:11px}#judgement-counts{padding:0 8px 5px}.transport{gap:8px;flex-wrap:wrap}.timeline{min-width:110px;gap:6px}.controls{justify-content:center}.play-controls{gap:2px}.play-button{font-size:12px;min-width:130px;padding:10px}.icon-button{padding:8px}.keyboard-panel p span{display:none}}
@media(max-width:420px){.transport{justify-content:center}.timeline{flex-basis:100%}.practice{height:calc(100dvh - 340px)}.score-heading{align-items:center}.song-heading h1{font-size:16px}}
@media(max-height:550px) and (orientation:landscape){.practice{height:75dvh;min-height:300px}}

/* Combine judgement names and counts into a single unbroken row. */
.score-footer #judgement-counts{display:flex;flex-wrap:nowrap;gap:12px;padding:0;max-width:100%;min-width:0;overflow-x:auto;align-items:center}
#judgement-counts .judgement-chip{flex:none;white-space:nowrap;border:0;padding:3px 0;font-size:12px}
@media(max-width:420px){.score-footer #judgement-counts{gap:8px}#judgement-counts .judgement-chip{font-size:11px}}
