@font-face{font-family:Round;src:url(fonts/rounded-ui.woff) format("woff");font-display:swap}
:root{color-scheme:light;--ink:#303d50;--plum:#6f4774;--paper:#fffdf7;--sky:#d9eef8;--berry:#f6d9e9;--green:#d9ecd1;--line:#ddd1dd;font-family:Round,"Hiragino Maru Gothic ProN","Yu Gothic",system-ui,sans-serif;background:#f8eaf2;color:var(--ink)}
*{box-sizing:border-box}body{margin:0;background:radial-gradient(circle at 18% 14%,#fff6e6 0,transparent 32%),linear-gradient(#f8eaf2,#edf6e8);min-height:100vh}button,select{font:inherit;color:inherit}button{cursor:pointer;touch-action:manipulation}button:focus-visible,select:focus-visible{outline:3px solid #6e5294;outline-offset:3px}button:disabled{cursor:default;opacity:.52}
header{max-width:880px;margin:auto;padding:15px 20px 0;display:flex;align-items:center;justify-content:space-between}.brand{letter-spacing:.13em;color:var(--plum);font-size:.85rem;font-weight:900}
main{width:min(880px,100%);margin:auto;padding:12px 16px 20px}.hero{position:relative;display:flex;align-items:center;justify-content:space-between;overflow:hidden;padding:18px 5%;border-radius:31px;background:radial-gradient(circle at 88% 50%,#fff1b6 0 11%,transparent 11.4%),linear-gradient(155deg,#fdf1f7 25%,#e4ebfb 68%,#d9eccd 68%);border:2px solid #fff9;min-height:150px}.hero img{width:clamp(74px,18vw,145px);height:auto;flex:none;align-self:end;filter:drop-shadow(0 4px 2px #73617b28)}.kicker{font-size:.85rem;color:var(--plum);margin:0;font-weight:900}h1{font-size:clamp(1.5rem,5.5vw,2.6rem);line-height:1.16;margin:.18em 0 .28em;color:#55325d}.hero p:last-child{margin:0;max-width:30em;font-size:.93rem}
.controls,.board{background:#fffdf8;border:1px solid #fff;margin-top:12px;border-radius:24px;padding:12px 18px;box-shadow:0 3px 8px #6f477413}.controls{display:flex;gap:10px 18px;flex-wrap:wrap}fieldset{border:0;padding:0;margin:0;min-width:0}legend,.selects label span{display:block;font-weight:900;font-size:.78rem;color:var(--plum);margin-bottom:4px}.choice,.selects,.buttons{display:flex;flex-wrap:wrap;gap:6px}.selects label{min-width:88px;flex:1}.selects select{font-size:1rem;padding:0 6px;width:100%;height:44px;border:1px solid var(--line);background:#fff;border-radius:11px}
button{border:1px solid var(--line);background:#fff;border-radius:13px;font-weight:850;min-height:44px;min-width:44px;padding:3px 10px}.choice button[aria-pressed=true]{background:#eedbed;border-color:#b184b5;color:#513358}
.board h2{margin:0 0 4px;font-size:clamp(1.15rem,4vw,1.55rem);color:var(--plum)}.sub{margin:0 0 12px;font-size:.88rem}.trail{display:grid;grid-template-columns:repeat(var(--count),minmax(0,1fr));gap:5px;padding:9px;border-radius:16px;background:#eaf2df;margin-bottom:12px}.tile{width:100%;border:2px solid #d1c1cf;border-radius:12px;background:var(--tile,#fff);min-width:0;min-height:56px;padding:0;display:grid;place-content:center;text-align:center;font-size:clamp(.9rem,3.4vw,1.55rem);font-weight:900;position:relative}.fixed{border-color:#fff9}.tile.empty{border:2px dashed #a486a7;background:var(--paper);color:var(--plum)}.tile.sounding{border-color:#75539b;box-shadow:0 0 0 2px #75539b}.tile svg{width:100%;max-width:82px;min-width:27px;height:auto;display:block}.tile .octave{display:block;font-size:.6em;line-height:1}.bank{display:flex;justify-content:center;gap:6px;flex-wrap:wrap;margin:0 0 12px}.bank .tile{width:clamp(46px,12vw,94px)}.buttons button{font-size:.91rem}#check{background:#e5d7f1;color:#442d62}#next{background:#f6e4ac;color:#4a3b16}#status{margin:.5em 0 0;min-height:1.5em;font-weight:800;font-size:.92rem}footer{padding:10px 3px;font-size:.76rem;color:#57495b}footer a{color:inherit}
@media(max-width:420px){main{padding-inline:9px}.controls,.board{padding-inline:9px}.trail{padding:5px;gap:4px}.choice button{padding-inline:7px}.hero{padding-inline:4%}}

/* Movement clues are independent of the chosen note notation. */
.shape-hints{margin:0 0 10px}.shape-hints legend{margin-bottom:5px}
.trail{--step:clamp(18px,4vw,28px);--box:clamp(46px,8vw,57px);grid-template-columns:repeat(var(--count),minmax(0,64px));justify-content:center;align-items:start}
.trail>.tile{height:var(--box);min-height:0;border-radius:10px}
.trail[data-shape="height"]{background:repeating-linear-gradient(0deg,#faf9ff 0,#faf9ff calc(var(--step) - 1px),#ceddec calc(var(--step) - 1px),#ceddec var(--step));outline:1px solid #c0d9eb}
.trail:is([data-shape="height"],[data-shape="arrow"])>.tile{margin-top:calc(var(--drop) * var(--step));box-shadow:0 3px 0 #b6cbdf}
.trail:is([data-shape="height"],[data-shape="arrow"])>.tile.sounding{box-shadow:0 0 0 2px #75539b}

.trail[data-shape="arrow"]{grid-template-columns:repeat(var(--jumps),minmax(0,64px) clamp(9px,3vw,24px)) minmax(0,64px);gap:0;background:#f1f7ff;outline:1px solid #c0d9eb}
.box-arrow{display:block;align-self:start;height:var(--step);margin-top:calc(var(--drop) * var(--step) + (var(--box) - var(--step))/2);color:#315e80;pointer-events:none}
.box-arrow svg{display:block;width:100%;height:100%;overflow:visible}
.box-arrow.fall{color:#8c436b}
.box-arrow.fall svg{transform:scaleY(-1)}

.route-editor:not([hidden]){margin:0 0 10px}.route-editor button{color:#285e81;background:#e1f4ff}.route-editor button.fall{color:#823d63;background:#ffe7f1}
/* Compact centered arrows and a real, shared treble staff. */
.box-arrow{display:grid;place-items:center}
.box-arrow svg{width:clamp(15px,100%,27px);height:100%;margin-inline:auto;justify-self:center}
.score-panel{margin-top:16px;border:1px solid #bddae8;border-radius:22px;padding:12px;background:#f4faff}
.score-panel h3{margin:0 0 6px;color:#51447c;font-size:clamp(1.05rem,4vw,1.35rem)}
.score-panel p{font-size:.86rem;margin:0 0 10px}.score-panel fieldset{margin:8px 0}
.score-staff{display:block;width:100%;height:auto;min-height:140px;max-height:250px;background:#fffdf7;border:1px solid #cbdfec;border-radius:15px;touch-action:manipulation;cursor:crosshair}
.score-panel .buttons{margin:8px 0}
#scoreCheck{background:#e8dff6}#scoreHear{background:#f4daea}#scoreStatus:empty{display:none}
.trail>.tile{--disc:min(100%,var(--box));width:var(--disc);aspect-ratio:1;height:auto;min-height:0;justify-self:center;border-radius:50%}
.trail{--box:clamp(43px,8vw,53px);grid-template-columns:repeat(var(--count),minmax(0,var(--box)))}
.trail[data-shape="arrow"]{grid-template-columns:repeat(var(--jumps),minmax(0,var(--box)) clamp(12px,4.2vw,30px)) minmax(0,var(--box))}
.bank .tile{border-radius:50%;width:clamp(45px,13vw,63px);min-height:0;aspect-ratio:1}
.trail .tile svg,.bank .tile svg{width:83%;margin:auto}
@media(max-width:420px){.trail[data-shape="arrow"]{--small-box:min(43px,calc((100vw - 50px - var(--jumps)*12px)/var(--count)));--box:var(--small-box);grid-template-columns:repeat(var(--jumps),minmax(0,var(--box)) 12px) minmax(0,var(--box))}.box-arrow svg{width:12px}}

/* Unbroken labels and arrows measured between the visible circles. */
.trail{position:relative}
.trail .tile,.bank .tile{display:flex;align-items:center;justify-content:center;line-height:1.05}
.tile .tile-label,.tile .note-word{display:block;white-space:nowrap;word-break:keep-all}
.tile .octave{margin-bottom:.16em}
.tile .note-word.compact{font-size:.82em;letter-spacing:-.025em}
.trail .tile svg,.bank .tile svg{width:83%;min-width:0;margin:auto}
.box-arrow{height:0;margin:0}
.arrow-overlay{position:absolute;inset:0;pointer-events:none;overflow:visible}

/* A shared music-making scene, decorative and outside the game controls. */
.hero{gap:14px;background:radial-gradient(ellipse at 83% 40%,#fff1bd 0 17%,transparent 18%),linear-gradient(155deg,#fdf1f7 24%,#e4effb 70%,#d9eccd 70%)}
.village-hero{flex:0 0 clamp(220px,39vw,370px);align-self:end;pointer-events:none}
.hero .village-hero img{display:block;width:100%;height:auto;filter:none}
@media(max-width:550px){.hero{display:block;padding-bottom:8px}.village-hero{width:clamp(220px,82%,300px);margin:6px auto 0}.hero p:last-child{max-width:none}}
