@font-face{font-family:'Fraunces';src:url('./fonts/fraunces-soft.woff') format('woff');font-style:normal;font-weight:300 600;font-display:swap}
@font-face{font-family:'DM Sans';src:url('./fonts/dm-sans.woff') format('woff');font-style:normal;font-weight:400 600;font-display:swap}
:root{--font-ui:'DM Sans',system-ui,-apple-system,'Segoe UI',sans-serif;--font-display:'Fraunces',Georgia,'Times New Roman',serif;--ink:#49312d;--muted:#806c69;--line:#b8a29d;--paper:#fffdfc;--blush:#ecd9d7;--sky-top:#f6eeee;--sky-bottom:#eaded5;font-family:var(--font-ui)}
body[data-mood=cozy]{--sky-top:#fff8ef;--sky-bottom:#eadbd5}
body[data-mood=playful]{--sky-top:#fff0f1;--sky-bottom:#f6dfcc}
body[data-mood=dreamy]{--sky-top:#ece9fa;--sky-bottom:#e3edf5}
body[data-mood=tender]{--sky-top:#fff8f7;--sky-bottom:#efd8e0}
body[data-mood=bright]{--sky-top:#fff7d9;--sky-bottom:#e1eff1}
body[data-mood=reflective]{--sky-top:#eeeaf2;--sky-bottom:#d8e2eb}
body{background:var(--sky-bottom);color:var(--ink)}#game{background:linear-gradient(165deg,var(--sky-top),var(--sky-bottom))}
.wordmark,.hero h1,.prompt h1,.prompt #instruction,.result h2,.score,.sheet h2{font-family:var(--font-display);font-weight:400;letter-spacing:-.02em;font-optical-sizing:auto}
.wordmark{font-size:30px}.wordmark i,.hero h1 em{color:#a77578}.hero h1{font-size:clamp(58px,9vw,108px);letter-spacing:-1px}.prompt #instruction{font-size:36px}.eyebrow{font-weight:400;font-size:15px;letter-spacing:.12em}.prompt #subtitle{font-weight:400;font-size:20px}.prompt p,.result p,.hero p{font-weight:400;color:var(--muted)}
.icon,.secondary,.primary,.bird-controls .animal-part{background:var(--paper);color:var(--ink);border:1.5px solid var(--line);box-shadow:0 3px 0 #d9c6c480;backdrop-filter:none;font-family:var(--font-ui);font-weight:400}
.icon{border-radius:48% 52% 51% 49%}.primary,.secondary{font-size:21px;border-radius:24px 27px 23px 26px}.primary{background:#f1dede}.primary:not(:disabled):hover{background:#ebd0d2}.secondary:hover,.bird-controls .animal-part:not(:disabled):hover{background:#f9eeee}
.bird-controls .animal-part{border-radius:18px 20px 17px 21px;font-size:20px;transition:background .25s,color .25s,box-shadow .2s}
.bird-controls .animal-part[aria-pressed=true]{outline:none;border-color:#765a54;box-shadow:0 0 0 2px #b48f8729,0 3px 0 #d9c6c480}
.bird-controls .animal-part.learned,.bird-controls .animal-part.learned:hover{background:#668274;border-color:#506d60;color:#fffdfc;box-shadow:0 3px 0 #4f6b5e33}
.part-stage.notes .part-notes{font-family:var(--font-ui);font-size:20px;font-weight:400;line-height:1.15}
.keyboard{background:#e8d9d7;border:1.5px solid #b39b96;padding:8px;gap:4px;border-radius:24px 27px 22px 26px;box-shadow:0 4px 0 #c8b0ac66}
.key{background:#fffefd;color:#715752;border:1px solid #cbb5b0;box-shadow:inset 0 -5px #ecdedc;border-radius:8px 9px 13px 11px;padding-bottom:12px}
.key b{font-family:var(--font-ui);font-size:22px;font-weight:400}.key small{font-family:var(--font-ui);font-size:13px;font-weight:400;color:#8d7570;opacity:1}
.key.black:after{background:#62534f;border:1px solid #493b37;box-shadow:inset 0 -5px #4b3c38;border-radius:0 0 9px 8px}
.key.held{background:#efd3d6;box-shadow:inset 0 -2px #d5aeb3}.sheet,.sheet header{background:#fff9f8}.sheet h3{font-weight:400;font-size:26px}.sheet article{font-size:20px}.sheet p,.sheet a{color:var(--ink)}.result{background:transparent}.result p{font-size:20px}.reward-controls button{font-size:21px}
@media(max-width:600px){.wordmark{font-size:25px}.prompt #instruction{font-size:32px}.prompt #subtitle{font-size:18px}.eyebrow{font-size:13px}.bird-controls .animal-part{font-size:18px}.keyboard{padding:6px;gap:3px;border-radius:18px 21px 17px 20px}.key b{font-size:20px}.part-stage.notes .part-notes{font-size:18px}}
@media(max-height:600px){.prompt #instruction{font-size:28px}.key b{font-size:18px}.key small{display:none}}

.bird-controls .animal-part{height:58px;min-height:58px}.prompt #subtitle:empty{display:none;min-height:0}.prompt .eyebrow{letter-spacing:.05em}

@property --sky-top{syntax:'<color>';inherits:true;initial-value:#f8f5f4}@property --sky-bottom{syntax:'<color>';inherits:true;initial-value:#eee9e8}body[data-mood=neutral]{--sky-top:#f8f5f4;--sky-bottom:#eee9e8}#game{transition:--sky-top 1.8s ease,--sky-bottom 1.8s ease}

#game{transition:opacity .75s ease,--sky-top 1.8s ease,--sky-bottom 1.8s ease}.hud .icon{width:44px;height:44px;background:none;border:0;border-radius:0;box-shadow:none}.hud .icon svg{width:25px;height:25px}.sound-off{opacity:1}.sound-off-shape{display:none}.sound-off .sound-off-shape{display:block}.sound-off .sound-on-shape{display:none}

/* Soft ink outlines, with slightly uneven corners like the bird illustration. */
.primary,.secondary,.bird-controls .animal-part{border:1.5px solid #927771;border-radius:12px 18px 13px 16px / 16px 12px 18px 13px;box-shadow:none;background:#fffdfc}
.primary:not(:disabled):hover,.secondary:not(:disabled):hover,.bird-controls .animal-part:not(:disabled):hover{background:#f5e9e7}
.primary:active,.secondary:active,.bird-controls .animal-part:active{transform:translateY(1px)}
.bird-controls .animal-part:nth-child(even){border-radius:17px 11px 16px 12px / 12px 17px 11px 16px}
.bird-controls .animal-part[aria-pressed=true]{border-color:var(--ink);box-shadow:none;background:#f2e6e4}
.bird-controls .animal-part.learned,.bird-controls .animal-part.learned:hover{background:#668274;color:#fffdfc;box-shadow:none}
.home-bottom #start{min-width:168px;padding:10px 30px;background:#fffdfc;font-size:24px}
.keyboard{background:#f0e7e5;border-color:#927771;border-radius:15px 21px 16px 19px / 20px 16px 21px 14px;box-shadow:none}
.key{border-color:#ae928c;border-radius:5px 8px 11px 7px / 7px 5px 9px 12px;box-shadow:none}
.key:nth-child(even){border-radius:8px 5px 8px 11px / 5px 8px 12px 7px}
.key.black:after{background:#62504b;border-color:#49312d;border-radius:1px 2px 8px 6px / 2px 1px 6px 9px;box-shadow:none}
.key.held{background:#efd3d6;box-shadow:none}

/* Independent transparent artwork; background color remains CSS-controlled. */
#game:before{content:'';position:absolute;inset:0;background:url('./art/paper-grain.png') repeat;background-size:420px;pointer-events:none;z-index:0}
#game:after{content:'';position:absolute;inset:110px 0 220px;background:url('./art/foliage.png') center/100% 100% no-repeat;pointer-events:none;opacity:.55;z-index:0}
.illustrated-branches{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0}
body[data-state=home] #game:before,body[data-state=home] #game:after,body[data-state=home] .illustrated-branches{visibility:hidden}
@media(max-height:500px){#game:after{display:none}}

/* Separate edge strips keep the foliage's natural aspect ratio at every size. */
#game:after{display:none}
.edge-foliage{position:absolute;inset:110px 0 220px;pointer-events:none;z-index:0;opacity:.5}
.edge-foliage:before,.edge-foliage:after{content:'';position:absolute;top:0;bottom:0;width:clamp(30px,8vw,100px);background-image:url('./art/foliage.png');background-repeat:no-repeat;background-size:auto 100%}
.edge-foliage:before{left:0;background-position:left center}.edge-foliage:after{right:0;background-position:right center}
body[data-state=home] .edge-foliage{visibility:hidden}
@media(max-height:500px){.edge-foliage{display:none}}

/* Wide or landscape screens: the piano spans the screen with the part buttons in a row on top. */
@media(min-width:700px),(max-height:900px) and (orientation:landscape){
 .dock{padding:10px max(16px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}
 .dock-inner{max-width:1200px} /* the piano spans the screen, but stops growing on very wide displays */
 .dock .keyboard{height:clamp(76px,11vh,112px)}
 .prompt{top:52px}.prompt .eyebrow{margin-bottom:2px}
}
/* Short ones (phones on their side) also move the prompt to the top edge. */
@media(max-height:500px) and (orientation:landscape){
 .prompt{top:8px}.prompt h1,.prompt #instruction{font-size:24px;margin:0}.prompt .eyebrow{margin:0 0 2px;font-size:12px}
 .key b{font-size:18px}
 .dock .keyboard{height:64px}
}

/* Perches: one image per bird (art/perch.png: log, sprigs and pole), faded out by a mask in placePosts. */
.perch-post{position:absolute;pointer-events:none}
.perch-post img{display:block;width:100%;height:100%}

/* The round label and instruction are kept for screen readers but no longer take screen space. */
.prompt{position:absolute;top:0;left:0;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;transform:none}

/* Home: one bird on its post (the scene shows it); starting the game zooms out and slides the others in. */
body[data-state=home] .bird-grove,body[data-transition=true] .bird-grove{visibility:visible}
body[data-state=home] .illustrated-branches{visibility:visible}
body[data-transition] .bird-perch{transition:none}
body[data-transition] #animal-scene{z-index:1}
body[data-transition=true] #home{opacity:0;transition:opacity .45s ease;pointer-events:none}

/* Bigger logo on the game screen. */
.hud .wordmark{font-size:clamp(34px,5.5vw,50px);line-height:1}
@media(max-height:500px) and (orientation:landscape){.hud .wordmark{font-size:28px}}

/* Background leaves and sprigs are switched off for now; delete this rule to bring them back. */
.edge-foliage,#game:after{display:none!important}

/* Home hint: plain text, since a tap anywhere (except the bird) starts the game. */
.home-bottom #start.primary{min-width:0;padding:10px 16px;border:0;border-radius:0;background:none;box-shadow:none;font-size:22px;color:var(--muted);animation:start-hint 2s ease-in-out infinite}
.home-bottom #start.primary:disabled{animation:none;opacity:.5}
@keyframes start-hint{0%,100%{opacity:.35}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){.home-bottom #start.primary{animation:none}}

/* The game is not selectable text: no blue highlight on posts or birds, no image dragging. */
#game,#game *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
#game img{-webkit-user-drag:none}

/* Type: Fraunces (soft serif) for the logo and headings, DM Sans for everything else. */
.primary,.secondary,.bird-controls .animal-part,.key b,.home-bottom #start.primary{font-weight:500}
.hero h1{letter-spacing:-.035em;font-weight:400}
.hud .wordmark{font-size:clamp(26px,4.6vw,40px)}
@media(max-height:500px) and (orientation:landscape){.hud .wordmark{font-size:24px}}
.hero h1{white-space:nowrap;font-size:clamp(38px,13.4vw,108px)}

/* ---- Bottom UI: numbered badges on the posts, a quiet dock, a softer piano ---- */
.part-badges{position:absolute;inset:0;z-index:3;pointer-events:none;overflow:hidden}
.part-badges .part-badge{position:absolute;display:grid;place-items:center;padding:0;margin:0;min-height:0;border:1.5px solid #7a5c4c;border-radius:50%;background:#fffdfc;color:#5b4338;font-family:var(--font-ui);font-weight:600;line-height:1;box-shadow:none;pointer-events:auto;cursor:pointer;transform:none;transition:background .25s,color .25s,border-color .25s,transform .12s}
.part-badges .part-badge:hover{background:#f6ece6}
.part-badges .part-badge:active{transform:scale(.93)}
.part-badges .part-badge[aria-pressed=true]{border-color:#49312d;background:#f2e3d8}
.part-badges .part-badge.learned,.part-badges .part-badge.learned:hover{background:#668274;border-color:#506d60;color:#fffdfc;animation:badge-pop .4s ease}
@keyframes badge-pop{0%{transform:scale(.6)}60%{transform:scale(1.15)}100%{transform:scale(1)}}
.part-badges .part-badge:disabled{filter:none}
.part-badges .part-badge:focus-visible{outline:3px solid #c66743;outline-offset:3px}

.dock{padding:10px max(20px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(20px,env(safe-area-inset-left))}
.dock-inner{position:relative;display:flex;flex-direction:column;margin-left:auto;margin-right:auto}
.dock-note{display:block;order:-1;margin:0 0 8px;text-align:center;font-family:var(--font-ui);font-size:14px;color:var(--muted)}
.dock-note:empty{display:none}
.dock .bird-controls{position:absolute;right:0;bottom:calc(100% + 6px);width:auto;margin:0;min-height:0;display:block}
.keyboard{height:120px}
@media(min-width:700px),(max-height:900px) and (orientation:landscape){.dock .keyboard{height:clamp(76px,11vh,112px)}}
@media(max-height:500px) and (orientation:landscape){.dock .keyboard{height:64px}.dock-note{margin-bottom:4px;font-size:13px}}

.keyboard{gap:0;padding:6px;border:2px solid #6b4a3a;border-radius:14px;background:#c9a27a url('./art/wood-tile.png') repeat;background-size:auto 48px;box-shadow:none}
.key,.key:nth-child(even),.key:first-child,.key:last-child{border:2px solid #6b4a3a;border-radius:3px 3px 12px 12px;background:#fff8ee;box-shadow:none;color:#6b4a3a;padding-bottom:14px}
.key+.key{margin-left:-2px}
.key b{font-weight:500}
.key small{font-size:12px;color:#8a6d5e}
.key.black:after{width:46%;right:-23%;height:60%;background:linear-gradient(#7a5a47,#553b2d);border:2px solid #6b4a3a;border-radius:0 0 6px 6px;box-shadow:none}
.key.held{background:#f6e0c8;box-shadow:none}
@media(hover:none){.key small{display:none}}
.primary,.secondary{border:1.5px solid #8a6d5e;border-radius:16px}

/* Hand-drawn piano: only the shapes wobble (tray, key outlines, black keys); the letters stay crisp on top. */
.keyboard{position:relative;isolation:isolate;border:0;background:none;padding:7px}
.keyboard::before{content:'';position:absolute;inset:0;z-index:-1;border:2px solid #6b4a3a;border-radius:14px;background:#c9a27a url('./art/wood-tile.png') repeat;background-size:auto 48px;filter:url(#hand-lines)}
.key,.key:nth-child(even),.key:first-child,.key:last-child{position:relative;border:0;border-radius:0;background:none;margin-left:0}
.key::before{content:'';position:absolute;inset:0;z-index:-1;border:2px solid #6b4a3a;border-radius:3px 3px 12px 12px;background:#fff8ee;filter:url(#hand-lines);transition:background .06s}
.key+.key::before{left:-2px}
.key.held{background:none}
.key.held::before{background:#f6e0c8}
.key.black:after{filter:url(#hand-lines)}

/* The dock is always laid out (just invisible before the game starts) and its hint line keeps its height,
   so the birds' layout is computed from the real dock size from the very first frame: no snap later. */
#dock[hidden]{display:block!important;visibility:hidden;pointer-events:none}
.dock-note{min-height:20px}
.dock-note:empty{display:block;visibility:hidden}
@media(max-height:500px) and (orientation:landscape){.dock-note{min-height:17px}}

/* The numbers are carved into the perch art now: the badges are invisible tap targets over them,
   and only show a green check once a part is learned. */
.part-badges .part-badge{background:transparent;border-color:transparent;color:transparent}
.part-badges .part-badge:hover{background:rgba(255,255,255,.18)}
.part-badges .part-badge[aria-pressed=true]{background:rgba(255,255,255,.22);border-color:rgba(107,74,58,.5);box-shadow:0 0 0 2px rgba(255,248,238,.7)}
.part-badges .part-badge.learned,.part-badges .part-badge.learned:hover{background:#668274;border-color:#506d60;color:#fffdfc;animation:badge-pop .4s ease}

/* The whole melody, shown above the piano once every part is learned. It overlays the dock, so the birds never shift. */
.final-notes{position:absolute;left:0;right:0;bottom:calc(100% - 22px);display:flex;flex-wrap:wrap;justify-content:center;gap:4px;pointer-events:none;animation:final-in .5s ease}
.final-notes[hidden]{display:none}
.final-note{min-width:clamp(22px,6.2vw,30px);height:clamp(26px,7vw,34px);padding:0 4px;display:grid;place-items:center;border:1.5px solid #6b4a3a;border-radius:8px;background:#fff8ee;color:#6b4a3a;font:600 clamp(13px,3.6vw,16px)/1 var(--font-ui);transition:background .15s,color .15s,transform .15s}
.final-note.done{background:#668274;border-color:#506d60;color:#fffdfc}
.final-note.next{box-shadow:0 0 0 2px rgba(102,130,116,.55);transform:translateY(-2px)}
@keyframes final-in{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

/* The tap targets over the carved numbers are invisible in every state (no ring, tint or outline). */
.part-badges .part-badge:not(.learned),.part-badges .part-badge:not(.learned):hover,.part-badges .part-badge:not(.learned)[aria-pressed=true],.part-badges .part-badge:not(.learned):active{background:transparent!important;border-color:transparent!important;box-shadow:none!important;outline:none!important;transform:none}
.part-badges .part-badge:not(.learned):focus-visible{outline:2px solid rgba(102,130,116,.8)!important;outline-offset:2px}
.part-badges .part-badge.learned[aria-pressed=true]{outline:none!important;box-shadow:none!important}

/* Piano: shapes come from one svg (piano-art.mjs); the keys themselves are transparent buttons with crisp labels. */
.keyboard{position:relative;isolation:isolate;border:0!important;background:none!important;box-shadow:none!important;padding:7px}
.keyboard::before{content:none!important}
.piano-art{position:absolute;inset:0;z-index:-1;pointer-events:none;overflow:visible}
.piano-art .wk{fill:url(#piano-white)}.piano-art .wk.held{fill:url(#piano-white-down)}
.piano-art .bk{fill:url(#piano-black)}
.key,.key:nth-child(even),.key:first-child,.key:last-child{background:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;margin-left:0!important}
.key::before{content:none!important}
.key.black:after{display:none!important}

/* Hearts: a bird lets one out beside it when it has finished its part. Pop, float, sway and fade run as
   separate animations so each gets its own easing and the motion reads as one soft spring. */
.part-heart{position:absolute;pointer-events:none;transform:translate(-50%,-50%)}
.part-heart svg{display:block;width:100%;height:100%;overflow:visible;will-change:translate,scale,rotate,opacity;
 animation:heart-pop .55s cubic-bezier(.34,1.56,.64,1) both,heart-float 1.9s cubic-bezier(.22,.61,.36,1) both,heart-sway 1.9s ease-in-out both,heart-fade 1.9s ease-in-out both;animation-delay:inherit}
.part-heart .heart-body{fill:url(#heart-fill);stroke:#6b4a3a;stroke-width:1.9;stroke-linejoin:round}
.part-heart .heart-shine{fill:none;stroke:#fff;stroke-opacity:.8;stroke-width:1.7;stroke-linecap:round}
@keyframes heart-pop{from{scale:.15}to{scale:1}}
@keyframes heart-float{from{translate:0 4px}to{translate:var(--drift) -58px}}
@keyframes heart-sway{0%{rotate:-10deg}45%{rotate:7deg}100%{rotate:-3deg}}
@keyframes heart-fade{0%{opacity:0}10%{opacity:1}62%{opacity:1}100%{opacity:0}}
@media(prefers-reduced-motion:reduce){.part-heart svg{animation:heart-fade-only 1.6s ease-in-out both}@keyframes heart-fade-only{0%,100%{opacity:0}15%,70%{opacity:1}}}

/* No check mark on learned posts: the hearts and the melody row carry the feedback. */
.part-badges .part-badge.learned,.part-badges .part-badge.learned:hover{background:transparent!important;border-color:transparent!important;color:transparent!important;animation:none}

/* The hint fades out once the first bird is solved; the progress row (solved notes and ???) fades in over it. */
.dock-note{transition:opacity .45s ease}
.dock-note.gone{opacity:0}
.final-notes{gap:4px 14px}
.final-group{display:inline-flex;gap:4px}
.final-note.unknown{min-width:clamp(40px,11vw,54px);border-style:dashed;background:rgba(255,248,238,.55);color:#8a6d5e;letter-spacing:.1em}

/* The next key to play glows once every part is learned. */
.piano-art .wg{fill:url(#piano-white-down);opacity:0;pointer-events:none} /* same fill as a pressed key */
.piano-art .wg.on{animation:key-glow 1.5s ease-in-out infinite}
@keyframes key-glow{0%,100%{opacity:.25}50%{opacity:1}}
@media(prefers-reduced-motion:reduce){.piano-art .wg.on{animation:none;opacity:.85}}

/* Win screen: a round play/stop button for the jingle, then a pulsing tap-anywhere line. */
.reward-controls{flex-direction:column;align-items:center;gap:14px;bottom:max(34px,env(safe-area-inset-bottom))}
.jingle-toggle{width:54px;height:54px;display:grid;place-items:center;padding:0;border:1.5px solid #6b4a3a;border-radius:50%;background:#fffdfc;cursor:pointer;transition:background .2s,transform .12s}
.jingle-toggle:hover{background:#f6ece6}.jingle-toggle:active{transform:scale(.94)}
.jingle-toggle svg{width:24px;height:24px;fill:#6b4a3a;stroke:#6b4a3a;stroke-width:2;stroke-linejoin:round;grid-area:1/1}
.jingle-toggle .i-pause{display:none;stroke-width:0}
.jingle-toggle.playing .i-play{display:none}.jingle-toggle.playing .i-pause{display:block}
.reward-controls #next.primary{min-width:0;padding:8px 16px;border:0;border-radius:0;background:none;box-shadow:none;font-size:20px;color:var(--muted);animation:start-hint 2s ease-in-out infinite}
.reward-controls #next.primary:hover{background:none}
@media(prefers-reduced-motion:reduce){.reward-controls #next.primary{animation:none}}

/* Restart: a smaller round button beside play/pause; play/pause stays centred over the tap-anywhere line. */
.jingle-row{position:relative;display:flex;justify-content:center}
.jingle-reset{position:absolute;left:calc(100% + 14px);top:50%;transform:translateY(-50%);width:42px;height:42px;display:grid;place-items:center;padding:0;border:1.5px solid #6b4a3a;border-radius:50%;background:#fffdfc;cursor:pointer;transition:background .2s,transform .12s}
.jingle-reset:hover{background:#f6ece6}.jingle-reset:active{transform:translateY(-50%) scale(.93)}
.jingle-reset svg{width:20px;height:20px;fill:#6b4a3a}

/* ---- How to play: a compact illustrated card ---- */
.guide{border:0;padding:0;background:none;color:var(--ink);max-width:none;max-height:none;margin:auto;overflow:visible}
.guide::backdrop{background:rgba(74,50,40,.38);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px)}
.guide[open]{animation:guide-in .3s cubic-bezier(.2,.8,.2,1)}
@keyframes guide-in{from{opacity:0;transform:translateY(10px) scale(.97)}to{opacity:1;transform:none}}
.guide-card{position:relative;width:min(460px,calc(100vw - 28px));max-height:min(88dvh,760px);overflow:auto;padding:28px 26px 22px;border:1.5px solid #6b4a3a;border-radius:24px;background:linear-gradient(#fffaf4,#fbf1e6);box-shadow:0 18px 50px rgba(74,50,40,.28)}
.guide-close{position:absolute;top:14px;right:14px;width:40px;height:40px;display:grid;place-items:center;padding:0;border:1.5px solid #6b4a3a;border-radius:50%;background:#fffdfc;cursor:pointer;transition:background .2s,transform .12s}
.guide-close:hover{background:#f6ece6}.guide-close:active{transform:scale(.94)}
.guide-close svg{width:20px;height:20px;fill:none;stroke:#6b4a3a;stroke-width:2;stroke-linecap:round}
.guide h2{margin:0 52px 6px 0;font-family:var(--font-display);font-weight:400;font-size:clamp(28px,7vw,34px);letter-spacing:-.02em;line-height:1.1}
.guide-lede{margin:0 0 20px;font-family:var(--font-ui);font-size:16px;line-height:1.5;color:var(--muted)}
.guide-steps{list-style:none;margin:0;padding:0;display:grid;gap:16px}
.guide-steps li{display:grid;grid-template-columns:64px 1fr;gap:14px;align-items:center}
.step-art{width:64px;height:64px;display:block;border:1.5px solid #6b4a3a;border-radius:18px;background:#fff8ee;overflow:hidden}
.step-art svg{display:block;width:100%;height:100%}
.guide h3{margin:0 0 2px;font-family:var(--font-display);font-weight:400;font-size:20px;letter-spacing:-.01em}
.guide-steps p{margin:0;font-family:var(--font-ui);font-size:15px;line-height:1.45;color:var(--muted)}
.guide-tip{margin:20px 0 0;padding:10px 14px;border-radius:14px;background:rgba(201,162,122,.2);font-family:var(--font-ui);font-size:14.5px;color:#5b4338;text-align:center}
.guide-foot{margin:14px 0 0;font-family:var(--font-ui);font-size:13px;color:#8a6d5e;text-align:center}
.guide-foot a{color:inherit}
@media(max-width:380px){.guide-card{padding:24px 18px 18px}.guide-steps li{grid-template-columns:56px 1fr;gap:12px}.step-art{width:56px;height:56px;border-radius:15px}}
@media(prefers-reduced-motion:reduce){.guide[open]{animation:none}}

.guide-card:focus{outline:none}

.guide .keys{white-space:nowrap;font-weight:600;color:#5b4338;letter-spacing:.04em}

.jingle-reset{position:static!important;transform:none!important;width:54px!important;height:54px!important}.jingle-reset:active{transform:scale(.94)!important}.jingle-reset svg{width:24px!important;height:24px!important}

/* Home -> game: the logo flies to the header while the rest of the home screen fades. */
body[data-transition=true] #home{opacity:1;transition:none}
body[data-transition=true] .home-bottom{opacity:0;transition:opacity .35s ease}
.hero h1{will-change:transform}
body[data-transition=true] .hero h1{transition:transform 1.2s cubic-bezier(.6,0,.2,1)}

/* One logo style on the home and game screens (so the flight between them is seamless). */
.wordmark,.hero h1{letter-spacing:-.035em;font-weight:400}.wordmark em,.hero h1 em{font-style:normal;color:#a77578}.wordmark .logo-note,.hero h1 .logo-note{font-style:normal;color:#c68b48;font-size:.72em;letter-spacing:inherit}
/* Pin the optical size so the big home logo and the small header logo are the very same letterforms. */
.wordmark,.hero h1{font-optical-sizing:none;font-variation-settings:"opsz" 48;font-kerning:normal;text-rendering:geometricPrecision}

/* The dock (piano and the finished melody above it) fades in and out instead of popping. */
#dock{opacity:1;transition:opacity 1s ease,transform 1s cubic-bezier(.22,.61,.36,1),visibility 0s linear 0s}
#dock[hidden]{opacity:0;transition:opacity .7s ease,transform 1s cubic-bezier(.22,.61,.36,1),visibility 0s linear .7s}

/* Smooth appear/disappear for the end-of-melody UI (they are absolutely placed, so keeping them laid out while hidden is safe). */
#reward-controls{transition:opacity .6s ease,visibility 0s linear 0s}
#reward-controls[hidden]{display:flex!important;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .4s ease,visibility 0s linear .4s}
#result{transition:opacity .6s ease,visibility 0s linear 0s}
#result[hidden]{display:block!important;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .4s ease,visibility 0s linear .4s}
/* The how-to-play card eases out as well as in. */
.guide{transition:opacity .22s ease,transform .22s ease,overlay .22s allow-discrete,display .22s allow-discrete}
.guide::backdrop{transition:background .22s ease,backdrop-filter .22s ease}
.guide:not([open]){opacity:0;transform:translateY(8px) scale(.98)}
.guide:not([open])::backdrop{background:rgba(74,50,40,0);backdrop-filter:blur(0)}
@media(prefers-reduced-motion:reduce){#dock,#reward-controls,#result,.guide{transition:none!important}}

/* Newly learned parts ease into the melody row instead of popping. */
.final-group.fresh{animation:chip-in .5s cubic-bezier(.2,.8,.2,1) both}
@keyframes chip-in{from{opacity:0;transform:translateY(6px) scale(.92)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:reduce){.final-group.fresh{animation:none}}
