@import url("keyboard.css");

/* Arcade page shell: match the existing games; only the palette changes. */
html,body{margin:0;min-height:100%;background:#f4f1f8}
body{padding-top:calc(65px + env(safe-area-inset-top,0px))}
@media(max-width:410px){.npx{padding:6px 2px 20px}}

.npx{font-family:ui-rounded,system-ui,-apple-system,sans-serif;width:100%;padding:12px 6px 20px;color:#292541;max-width:880px;margin:auto;position:relative}.npx *{box-sizing:border-box}.npx button{font:inherit;cursor:pointer;touch-action:manipulation}.npx button:disabled{opacity:.45}.npx-back{position:fixed;top:calc(8px + env(safe-area-inset-top,0px));left:12px;z-index:10000;display:inline-block;padding:9px 13px;border-radius:999px;background:#7653e6;color:white;text-decoration:none;box-shadow:0 3px 12px #43336733;font:700 13px system-ui,-apple-system,sans-serif;box-sizing:border-box;touch-action:manipulation}.npx-game{background:white;border:1px solid #eee9f7;border-radius:18px;overflow:hidden}.npx-game>header{display:flex;flex-direction:column;gap:10px;padding:12px 11px 9px}.npx-paper{position:relative;background:#fdfcff;border:1px solid #eee9f6;border-radius:15px;margin:4px 9px 0;min-height:186px;display:grid;place-items:center}.npx-paper svg{display:block;width:100%;height:auto;max-height:330px}.npx-paper span{position:absolute;top:9px;right:9px;background:#f0eaff;color:#6e50b6;border-radius:25px;padding:5px 9px;font-size:10px;font-weight:800}.npx-msg{min-height:43px;display:grid;place-items:center;margin:0;text-align:center;font-size:13px;font-weight:780;color:#847d97}.npx-msg.good{color:#168854}.npx-msg.bad{color:#c44c62}.npx-letters{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;margin:0 9px 14px}.npx-letters button{height:60px;min-width:0;border:2px solid #ebe6f3;background:white;border-radius:10px;color:#292442;font-size:22px;font-weight:850}.npx-letters button.bad{background:#ffe7ee;border-color:#ef9cab;color:#aa4054}.npx-letters button.good{background:#dcf8e7;border-color:#64c997;color:#147344}.npx-letters button.show{background:#efe8ff;border-color:#ac94f0;color:#6645c2}.npx-game footer{display:flex;justify-content:space-between;padding:11px;border-top:1px solid #eeeaf5}.npx-game footer button,.npx-dialog footer button{background:#f4effb;border:0;border-radius:9px;padding:11px 12px;color:#655b7e;font-weight:790;font-size:11px}.npx-game footer #npxnext,.npx-dialog footer #npxapply{background:#7653e6;color:white}.npx-shade{position:absolute;inset:0;z-index:10;background:#302346a7;display:grid;place-items:center;padding:9px;border-radius:18px}.npx-shade[hidden]{display:none}.npx-dialog{background:white;border-radius:16px;width:min(550px,100%);max-height:85vh;overflow:auto}.npx-dialog header,.npx-dialog footer{position:sticky;z-index:2;display:flex;align-items:center;justify-content:space-between;gap:7px;background:white;padding:12px;border-bottom:1px solid #eeeaf5}.npx-dialog header{top:0}.npx-dialog footer{bottom:0;border-top:1px solid #eeeaf5;border-bottom:0}.npx-dialog header button{background:#f2eff9;border:0;border-radius:9px;padding:10px;color:#62577c}.npx-dialog footer #npxapply{flex:1}.npx-dialog section{padding:7px 13px 17px}.npx-dialog h3{margin:20px 0 12px;font-size:19px;border-left:4px solid #8660da;padding-left:10px;color:#4e3292}.npx-dialog p{font-size:11px;line-height:1.6;color:#837b98}.npx-dialog a{color:#7152d5}.npx-clefs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.npx-clefs button,.npx-values button{border:1px solid #e5dfee;background:white;color:#615975;border-radius:10px;padding:6px 3px;min-height:86px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;font-size:11px;font-weight:760}.npx-clefs svg{display:block;height:58px;max-width:105px;width:100%}.npx-values{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}.npx-values svg{width:50px;height:60px}.npx-clefs button.active,.npx-values button.active,.npx-sounds button.active{border-color:#a78ef3;background:#f0e9ff;color:#5835c7}.npx-range{border-radius:11px;background:#faf8fe;padding:9px;margin:9px 0}.npx-range strong{font-size:12px;display:block;margin-bottom:8px}.npx-rangeview{display:grid;grid-template-columns:33px minmax(0,1fr) 33px;gap:4px;align-items:center;padding:4px;background:white;border-radius:11px;border:1px solid #ebe6f5}.npx-rangeview svg{display:block;width:100%;height:auto}.npx-steps{display:flex;flex-direction:column;gap:8px}.npx-steps button{min-height:35px;border:1px solid #9cdbde;background:#e6f7f7;color:#16808a;border-radius:8px;font-weight:850}.npx-steps.high button{border-color:#d9cdfb;background:#f2edff;color:#6146bd}.npx-labels{display:flex;justify-content:space-between;padding:8px 2px 0;font-weight:850;font-size:10px;color:#258b91}.npx-labels span:last-child{color:#7352cc}.npx-sounds{display:grid;grid-template-columns:1fr 1fr;gap:7px}.npx-sounds button{border:1px solid #e5dfee;border-radius:11px;background:white;padding:13px 3px;font-size:12px;font-weight:750;color:#615975}.npx-credit{margin-top:20px!important;padding-top:12px;border-top:1px solid #ebe5f6}@media(max-width:570px){.npx-game>header{gap:6px}}@media(max-width:440px){.npx-letters{gap:3px}.npx-letters button{font-size:19px;height:55px}.npx-clefs{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:360px){}

.npx-top{display:flex;align-items:center}.npx-top>small{font-size:10px;letter-spacing:.07em;font-weight:850;color:#8662c4;white-space:nowrap}
.npx-second{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:nowrap;min-width:0}
.npx-brand{display:flex;align-items:center;gap:5px;min-width:0;flex:0 1 auto}
.npx-brand-left,.npx-brand-right{display:block;width:52px;height:33px;flex:none}
.npx-brand h2{margin:0;white-space:nowrap;font-size:clamp(22px,4vw,36px);line-height:1.1;letter-spacing:-.045em;font-weight:850;color:#292541!important}
.npx-actions{display:flex;align-items:center;gap:5px;flex:none}
.npx-actions button{height:40px;display:flex;align-items:center;justify-content:center;padding:0 10px;border:1px solid #e4dcf9;border-radius:9px;background:white;color:#6245b8;font-size:11px;font-weight:800;white-space:nowrap}
.npx-actions #npxmute{width:40px;padding:0;flex:none;background:white}
.npx-actions #npxmute svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.npx-actions #npxrestart{background:#7653e6;color:white}
.npx-game>footer{display:flex;align-items:center;justify-content:flex-start;flex-wrap:wrap;gap:8px}
.npx-stats{display:flex;gap:7px;margin-left:0;flex:none}
.npx-stats span{display:flex;align-items:center;gap:8px;padding:10px 12px;border:1px solid #e8e1f3;border-radius:9px;background:#faf8fe;white-space:nowrap}
.npx-stats small{font-size:11px;font-weight:750;color:#5b5073!important}
.npx-stats b{font-size:14px;font-weight:850;color:#33245e!important}
.npx-game>footer #npxnext{margin-left:auto}
@media(max-width:650px){.npx-second{gap:6px}.npx-brand{gap:3px}.npx-brand-left,.npx-brand-right{width:34px;height:26px}.npx-brand h2{font-size:clamp(16px,4.6vw,27px)}.npx-actions{gap:4px}.npx-actions button{height:34px;font-size:10px;padding:0 7px}.npx-actions #npxmute{width:34px}.npx-stats{gap:4px}.npx-stats span{padding:10px 8px;gap:5px}}
@media(max-width:400px){.npx-game>header{padding-left:8px;padding-right:8px}.npx-brand-left,.npx-brand-right{width:25px;height:22px}.npx-brand{gap:2px}.npx-actions button{height:32px;padding:0 5px;font-size:9px}.npx-actions #npxmute{width:32px}.npx-actions #npxmute svg{width:18px;height:18px}.npx-game>footer{gap:5px;padding:9px 7px}.npx-game>footer button{font-size:10px;padding:10px 7px}.npx-stats span{padding:9px 6px;gap:4px}.npx-stats small{font-size:10px}.npx-stats b{font-size:12px}}
@media(max-width:340px){.npx-brand-left,.npx-brand-right{width:21px;height:20px}.npx-actions{gap:3px}.npx-actions button{padding:0 4px;font-size:8px}.npx-actions #npxmute{width:32px}.npx-second{gap:4px}.npx-stats span{padding:9px 4px}.npx-stats{gap:3px}.npx-stats small{font-size:9px}}
.npx-dialog .npx-load-note{display:inline;margin-top:0;font-weight:800;color:#4e3292}

.npx-top{justify-content:space-between;gap:8px;flex-wrap:wrap}
.npx-piano-state{font-size:11px;font-weight:750;color:#78623e;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.npx-piano-state:before{content:'';width:6px;height:6px;border-radius:50%;background:currentColor;flex:none}
.npx-piano-state[data-state="ready"]{color:#7150b8}.npx-piano-state[data-state="soft"],.npx-piano-state[data-state="off"]{color:#766b87}.npx-piano-state[data-state="error"]{color:#a04d45}
.npx-loadpanel{margin-top:12px;padding:12px;background:#f7f3ff;border-radius:11px;color:#574574}
.npx-loadpanel[hidden]{display:none}.npx-loadhead{display:flex;justify-content:space-between;gap:10px;align-items:baseline;font-size:12px;font-weight:750}
.npx-loadhead b{font-variant-numeric:tabular-nums;white-space:nowrap}
.npx-loadpanel progress{display:block;width:100%;height:5px;border:0;border-radius:5px;overflow:hidden;appearance:none;margin:9px 0;background:#e9e1f3}
.npx-loadpanel progress::-webkit-progress-bar{background:#e9e1f3;border-radius:5px}.npx-loadpanel progress::-webkit-progress-value{background:#9470d8;border-radius:5px}.npx-loadpanel progress::-moz-progress-bar{background:#9470d8;border-radius:5px}
.npx-loadhint{display:block;font-size:11px;line-height:1.5;font-weight:500;color:#756987;margin-top:6px}
.npx-loadpanel[data-state="ready"]{background:#f1eaff;color:#6342a3}.npx-loadpanel[data-state="ready"] progress{display:none}
.npx-loadpanel[data-state="error"]{background:#fcf2ee;color:#934d3b}
#npxretry{margin-top:9px;padding:9px 13px;border:1px solid #cfbfe7;border-radius:8px;background:white;color:#65469e;font-size:12px;font-weight:750}

@media(max-width:440px){.npx-piano-state{font-size:10px}.npx-loadhead{font-size:12px}}

.npx-actions #npxsettings{gap:4px}.npx-actions #npxsettings svg,.npx-dialog header>b svg{display:block;width:20px;height:20px;flex:none}.npx-dialog header>b{display:flex;align-items:center;gap:6px}@media(max-width:650px){.npx-actions #npxsettings svg{width:14px;height:14px}}@media(max-width:400px){.npx-actions #npxsettings{gap:3px}.npx-actions #npxsettings svg{width:12px;height:12px}}

.npx-keyboard-game{box-sizing:border-box}
.npx-keyboard-game .npx-clefs{grid-template-columns:repeat(2,minmax(0,1fr))}
.npx-keyhint{text-align:center;font-size:12px;color:#756889;margin:2px 8px 12px}
.npx-keyboard-game .npx-msg{min-height:40px}.npx-keyboard-game .npx-paper svg{max-height:290px}
@media(max-width:700px){.npx-keyhint:after{content:"Swipe the keyboard to see more keys";display:block;margin-top:5px;font-size:11px}}
/* Keep Settings inside the viewport, independent of game/content height. */
.npx-keyboard-game .npx-shade{position:fixed;inset:0;z-index:10001;border-radius:0;padding:max(12px,env(safe-area-inset-top,0px)) 12px max(12px,env(safe-area-inset-bottom,0px))}
.npx-keyboard-game .npx-dialog{max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px)}

/* Reusable music toolbar buttons: use npx-icon-button for icon-only actions.
   The shared size token also drives Restart's height at every breakpoint. */
.npx-actions{--music-action-size:40px;--music-icon-size:20px;--music-icon-roomy-size:24px}
.npx-actions button{height:var(--music-action-size)}
.npx-actions button.npx-icon-button{width:var(--music-action-size);min-width:0;aspect-ratio:1;flex:none;padding:0;gap:0;background:white;color:#6245b8}
.npx-actions .npx-icon-button svg{display:block;width:var(--music-icon-size);height:var(--music-icon-size);flex:none}
.npx-actions .npx-icon-button svg.npx-icon-roomy{width:var(--music-icon-roomy-size);height:var(--music-icon-roomy-size)}
.npx-actions button.npx-icon-button[aria-pressed="true"]{background:#eee6ff;color:#7352cc}
@media(max-width:650px){.npx-actions{--music-action-size:34px;--music-icon-size:14px;--music-icon-roomy-size:18px}}
@media(max-width:400px){.npx-actions{--music-action-size:32px;--music-icon-size:12px;--music-icon-roomy-size:16px}}
