:root{--navy:#071b43;--blue:#2563eb;--cyan:#55d6ff;--purple:#865dff;--green:#20c997;--red:#ff5074;--ink:#102144;--muted:#6d7992;--card:rgba(255,255,255,.92);--shadow:0 20px 55px rgba(13,39,89,.15)}
*{box-sizing:border-box}html{min-height:100%;background:#eef6ff}body{margin:0;min-height:100vh;min-height:100dvh;font-family:Inter,ui-rounded,"Segoe UI",system-ui,sans-serif;color:var(--ink);background:radial-gradient(circle at 10% 0,#d8f5ff 0,transparent 35%),radial-gradient(circle at 95% 95%,#e8dcff 0,transparent 40%),linear-gradient(145deg,#f8fbff,#edf5ff);overflow-x:hidden}.ambient{position:fixed;border-radius:50%;filter:blur(6px);opacity:.28;pointer-events:none}.a1{width:230px;height:230px;background:#54d9ff;top:-100px;right:-70px}.a2{width:280px;height:280px;background:#9970ff;bottom:-150px;left:-130px}.app-shell{position:relative;width:min(100%,900px);min-height:100vh;min-height:100dvh;margin:auto;padding:env(safe-area-inset-top) 16px env(safe-area-inset-bottom)}.screen{display:none;min-height:100vh;min-height:100dvh;animation:screenIn .35s ease}.screen.active{display:block}@keyframes screenIn{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}button{font:inherit;cursor:pointer;-webkit-tap-highlight-color:transparent}.hero{text-align:center;padding:42px 10px 25px}.brand-mark{display:grid;place-items:center;width:64px;height:64px;margin:0 auto 12px;border-radius:20px;color:#fff;font-size:34px;background:linear-gradient(135deg,var(--blue),var(--purple));box-shadow:0 13px 30px rgba(78,91,231,.3);transform:rotate(-4deg)}.eyebrow{margin:0 0 5px;font-size:11px;letter-spacing:.18em;font-weight:900;color:var(--blue)}h1{font-size:clamp(38px,10vw,64px);line-height:1;margin:0;color:var(--navy);letter-spacing:-.05em}h1 span{color:var(--blue)}.subtitle{color:var(--muted);margin:10px 0 0}.games-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:14px;padding-bottom:32px}.game-card{position:relative;min-height:176px;border:1px solid rgba(255,255,255,.8);border-radius:25px;padding:20px;text-align:left;color:var(--ink);background:var(--card);box-shadow:var(--shadow);overflow:hidden;transition:.2s transform,.2s box-shadow}.game-card:not(.locked):active{transform:scale(.97)}.game-card::after{content:"";position:absolute;width:90px;height:90px;border-radius:50%;right:-25px;top:-28px;background:var(--accent);opacity:.12}.game-card .number{font-size:11px;font-weight:900;color:var(--accent);letter-spacing:.12em}.game-card .game-icon{font-size:37px;margin:15px 0 9px}.game-card h2{font-size:18px;margin:0 0 5px}.game-card p{font-size:12px;line-height:1.35;color:var(--muted);margin:0}.game-card.locked{opacity:.58;filter:saturate(.5);cursor:default}.soon{display:inline-block;margin-top:12px;padding:4px 8px;border-radius:99px;background:#edf1f7;font-size:9px;font-weight:800;color:#73809a}.topbar{display:flex;align-items:center;gap:10px;padding:18px 0 12px;position:sticky;top:0;z-index:5;backdrop-filter:blur(12px)}.icon-btn{width:42px;height:42px;border:0;border-radius:14px;background:#fff;color:var(--navy);font-size:32px;line-height:1;box-shadow:0 6px 16px #b7c7e366}.progress-wrap{flex:1}.progress-text{display:flex;justify-content:space-between;font-size:11px;font-weight:800;margin-bottom:5px}.progress-text span{max-width:65%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.progress{height:7px;border-radius:99px;background:#dbe5f4;overflow:hidden}.progress i{display:block;width:5%;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--cyan),var(--blue));transition:width .35s ease}.timer{font-variant-numeric:tabular-nums;font-weight:900;font-size:13px;background:#fff;border-radius:14px;padding:12px 10px;box-shadow:0 6px 16px #b7c7e366}.game-area{padding:10px 0 30px}.prompt-card{background:var(--card);border:1px solid #fff;border-radius:29px;padding:20px;box-shadow:var(--shadow);text-align:center}.instruction{font-size:13px;color:var(--muted);font-weight:700;margin:0 0 15px}.keyboard{position:relative;height:180px;display:flex;margin:0 auto;width:min(100%,520px);filter:drop-shadow(0 12px 10px rgba(17,37,76,.12));user-select:none;touch-action:manipulation}.white-key{position:relative;flex:1;height:100%;border:1px solid #a9b5c7;border-radius:0 0 8px 8px;background:linear-gradient(#fff,#f1f5fa);z-index:1;transition:.13s}.white-key:first-child{border-radius:7px 0 8px 8px}.white-key:last-child{border-radius:0 7px 8px 8px}.black-key{position:absolute;top:0;width:8.7%;height:61%;border:0;border-radius:0 0 7px 7px;background:linear-gradient(160deg,#263248,#050b16);z-index:2;transform:translateX(-50%);transition:.13s}.playable .white-key,.playable .black-key{cursor:pointer}.key-label{position:absolute;bottom:8px;left:0;right:0;font-size:10px;font-weight:800;color:#93a0b3;opacity:.7}.black-key .key-label{color:#fff;bottom:6px}.white-key.active,.black-key.active{background:linear-gradient(#73e1ff,#2476ef);box-shadow:inset 0 0 0 3px #ffffff77}.white-key.correct,.black-key.correct{background:linear-gradient(#64ebc4,#10aa7d);box-shadow:0 0 22px #2ed6a888}.white-key.wrong,.black-key.wrong{background:linear-gradient(#ff8298,#e9345d);animation:shake .3s}.options{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;margin-top:16px}.option{min-height:72px;border:2px solid transparent;border-radius:20px;background:#fff;color:var(--navy);font-size:25px;font-weight:900;box-shadow:0 8px 20px #b7c7e344;transition:.18s}.option:active{transform:scale(.97)}.option.wrong{color:#fff;background:var(--red);animation:shake .35s;pointer-events:none;opacity:0;transform:scale(.85)}.option.correct{color:#fff;background:var(--green);transform:scale(1.03)}@keyframes shake{25%{transform:translateX(-7px)}50%{transform:translateX(7px)}75%{transform:translateX(-4px)}}.note-display{display:grid;place-items:center;min-height:130px;margin-bottom:18px;border-radius:25px;background:linear-gradient(135deg,var(--navy),#123c88);color:#fff;box-shadow:0 15px 30px #123c8844}.note-display strong{font-size:clamp(45px,15vw,74px);text-shadow:0 5px 15px #0004}.hint{font-size:11px;color:var(--muted);margin:14px 0 0}.result-card{max-width:590px;margin:22px auto;padding:28px 20px;background:var(--card);border:1px solid #fff;border-radius:30px;box-shadow:var(--shadow);text-align:center}.trophy{font-size:58px;animation:bounce .9s ease both}@keyframes bounce{0%{transform:scale(.2) rotate(-15deg)}60%{transform:scale(1.2) rotate(8deg)}100%{transform:scale(1)}}.result-card h2{font-size:34px;margin:2px}.result-label{margin:18px 0 0;color:var(--muted);font-size:12px}.final-time{font-size:48px;font-weight:950;color:var(--blue);font-variant-numeric:tabular-nums}.muted,.save-message{font-size:12px;color:var(--muted)}.score-form{margin:20px 0}.score-form label{display:block;font-size:12px;font-weight:800;margin-bottom:7px}.score-form div{display:flex;gap:7px}.score-form input{min-width:0;flex:1;border:2px solid #dce6f2;border-radius:14px;padding:13px;font:inherit;outline:none}.score-form input:focus{border-color:var(--blue)}.score-form button,.primary,.secondary{border:0;border-radius:14px;padding:13px 16px;font-weight:900}.score-form button,.primary{background:linear-gradient(135deg,var(--blue),var(--purple));color:#fff}.leaderboard{margin-top:20px;text-align:left}.leaderboard h3{font-size:14px}.score-row{display:grid;grid-template-columns:32px 1fr auto;align-items:center;padding:10px 8px;border-top:1px solid #e6edf6;font-size:13px}.score-row b:last-child{font-variant-numeric:tabular-nums;color:var(--blue)}.empty{text-align:center;color:var(--muted);font-size:12px;padding:15px}.result-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin-top:19px}.secondary{background:#e9eff8;color:var(--ink)}.toast{position:fixed;left:50%;bottom:26px;transform:translate(-50%,20px);opacity:0;z-index:10;padding:11px 17px;border-radius:99px;background:var(--navy);color:#fff;font-size:13px;font-weight:800;transition:.25s;pointer-events:none}.toast.show{opacity:1;transform:translate(-50%,0)}
@media(min-width:700px){.games-grid{grid-template-columns:repeat(4,1fr)}.game-card{min-height:205px}.keyboard{height:235px}.prompt-card{padding:28px}.options{max-width:520px;margin:20px auto 0}}
@media(max-width:390px){.hero{padding-top:28px}.game-card{padding:15px;min-height:158px}.keyboard{height:155px}.topbar{gap:6px}.timer{font-size:11px;padding:12px 7px}.final-time{font-size:42px}}
:root{color-scheme:dark;--navy:#eaf2ff;--blue:#5d8cff;--ink:#edf4ff;--muted:#9aaac2;--card:rgba(18,27,45,.94);--shadow:0 20px 55px rgba(0,0,0,.38)}
html{background:#070b13}body{background:radial-gradient(circle at 10% 0,#102b4a 0,transparent 35%),radial-gradient(circle at 95% 95%,#211a45 0,transparent 40%),linear-gradient(145deg,#0b111d,#070b13)}
.ambient{opacity:.12}.screen{animation-duration:.16s}.game-card{border-color:#293650}.game-card.locked{opacity:.42}.soon{background:#202b3d;color:#9aaac2}.topbar{background:linear-gradient(#080d17ee,#080d1700);padding-top:10px}.icon-btn,.timer{background:#172238;color:var(--ink);box-shadow:0 6px 16px #0006}.progress{background:#26334a}.progress i{transition-duration:.1s}.game-area{min-height:calc(100dvh - 78px);display:grid;align-items:center;padding:12px 0 84px}.prompt-card{width:100%;border-color:#293650}.option{background:#202b3d;color:#edf4ff;box-shadow:0 8px 20px #0005;transition-duration:.07s}.white-key,.black-key{transition-duration:.06s}.white-key.wrong,.black-key.wrong,.option.wrong{animation-duration:.12s}.note-display{background:linear-gradient(135deg,#101d36,#182e5c)}.result-card{border-color:#293650}.score-form input{background:#111a2a;border-color:#34435d;color:#fff}.score-row{border-color:#293650}.secondary{background:#26334a;color:#edf4ff}.toast{background:#253551;transition-duration:.1s;bottom:18px}
@media(min-width:700px){.game-area{padding-bottom:90px}}
@media(max-height:700px){.game-area{min-height:calc(100dvh - 68px);padding:4px 0 30px}.prompt-card{padding:14px}.keyboard{height:145px}.note-display{min-height:88px;margin-bottom:10px}.options{margin-top:10px}.option{min-height:58px}.hint{margin-top:8px}}
.degree-game{max-width:560px;margin:auto}.degree-panel{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:0 auto 18px;padding:20px;border-radius:24px;background:linear-gradient(135deg,#101d36,#182e5c);box-shadow:0 15px 30px #0004;text-align:left}.degree-panel>div{display:flex;flex-direction:column;gap:4px;padding:4px 10px}.degree-panel span{font-size:11px;font-weight:800;letter-spacing:.12em;color:#9fb3d5}.degree-panel strong{font-size:clamp(38px,12vw,58px);line-height:1;color:#fff}.degree-panel small{font-size:.58em;color:#b8c9e8}.chord-options{margin-top:0}.chord-options .option{font-size:clamp(24px,8vw,36px)}
.degree-options .option{font-size:clamp(21px,7vw,31px)}
.chord-game{max-width:620px;margin:auto}.formula-display{display:flex;min-height:150px;flex-direction:column;justify-content:center;gap:12px;margin-bottom:18px;padding:20px;border-radius:24px;background:linear-gradient(135deg,#101d36,#182e5c);box-shadow:0 15px 30px #0004}.formula-display span{font-size:11px;font-weight:900;letter-spacing:.15em;color:#9fb3d5}.formula-display strong{font-size:clamp(30px,9vw,50px);letter-spacing:.04em;color:#fff}.compact-options .option{font-size:clamp(19px,6vw,29px);overflow-wrap:anywhere}.chord-keyboard{position:relative;display:flex;width:100%;height:170px;margin:0 auto 18px;border:2px solid #35435a;border-radius:9px 9px 13px 13px;background:#dfe5ee;overflow:hidden;filter:drop-shadow(0 12px 10px #0005);user-select:none}.chord-white{position:relative;flex:1;height:100%;border-right:1px solid #8590a0;background:linear-gradient(#fff,#e8edf4);z-index:1}.chord-white:last-of-type{border-right:0}.chord-black{position:absolute;top:0;width:4.5%;height:61%;border-radius:0 0 4px 4px;background:linear-gradient(160deg,#263248,#050b16);transform:translateX(-50%);z-index:2}.chord-white.active{background:linear-gradient(#72dfff,#347ff1);box-shadow:inset 0 0 0 2px #ffffff55}.chord-black.active{background:linear-gradient(#77e5ff,#246fe5);box-shadow:0 0 12px #3f9cff}.chord-game .hint{margin-bottom:0}
.chord-symbol{display:flex;min-height:105px;flex-direction:column;justify-content:center;gap:5px;margin-bottom:14px;border-radius:22px;background:linear-gradient(135deg,#101d36,#182e5c)}.chord-symbol span{font-size:10px;font-weight:900;letter-spacing:.15em;color:#9fb3d5}.chord-symbol strong{font-size:clamp(34px,11vw,52px);color:#fff}.keyboard-options{display:grid;grid-template-columns:1fr 1fr;gap:10px}.keyboard-option{min-width:0;padding:9px 7px 0;border:2px solid #2c3950;border-radius:17px;background:#202b3d;box-shadow:0 8px 20px #0004;transition:.07s}.keyboard-option:active{transform:scale(.98)}.keyboard-option.wrong{border-color:var(--red);background:#5b1f31;animation:shake .12s;opacity:0}.keyboard-option.correct{border-color:var(--green);background:#123d36;transform:scale(1.02)}.mini-keyboard{height:78px;margin:0;filter:none;border-width:1px;border-radius:4px 4px 7px 7px}.mini-keyboard .chord-black{border-radius:0 0 2px 2px}.reverse-chord-game{max-width:650px}
@media(max-height:700px){.degree-panel{padding:12px;margin-bottom:10px}.degree-panel strong{font-size:36px}.degree-game .hint{display:none}}
@media(max-height:700px){.formula-display{min-height:95px;padding:12px;margin-bottom:10px}.chord-keyboard{height:120px;margin-bottom:10px}.chord-game .hint{display:none}.compact-options .option{min-height:52px}}
@media(max-height:700px){.chord-symbol{min-height:70px;margin-bottom:8px}.chord-symbol strong{font-size:31px}.keyboard-options{gap:7px}.keyboard-option{padding:6px 5px 0}.mini-keyboard{height:60px;margin:0}}
.feedback-flash{position:fixed;inset:0;z-index:999;display:grid;place-items:center;opacity:0;pointer-events:none;border:0 solid transparent}.feedback-flash span{display:grid;place-items:center;width:112px;height:112px;border-radius:50%;font-size:76px;font-weight:950;line-height:1;color:#fff;opacity:0;transform:scale(.35)}.feedback-flash.feedback-play{animation:feedbackScreen .25s ease-out both}.feedback-flash.feedback-play span{animation:feedbackSymbol .25s cubic-bezier(.2,.9,.25,1.35) both}.feedback-correct{--feedback:#20c997;--feedback-bg:rgba(32,201,151,.28)}.feedback-wrong{--feedback:#ff3e66;--feedback-bg:rgba(255,42,84,.32)}.feedback-correct span{background:#0aad7e;box-shadow:0 0 0 12px #20c99744,0 0 55px #20c997}.feedback-wrong span{background:#e92750;box-shadow:0 0 0 12px #ff507444,0 0 55px #ff3e66}.feedback-wrong.feedback-play span{animation:feedbackWrong .25s ease-out both}@keyframes feedbackScreen{0%{opacity:0;border-width:0;background:transparent}20%{opacity:1;border-width:12px;border-color:var(--feedback);background:var(--feedback-bg)}100%{opacity:0;border-width:3px;border-color:var(--feedback);background:transparent}}@keyframes feedbackSymbol{0%{opacity:0;transform:scale(.3)}35%{opacity:1;transform:scale(1.18)}100%{opacity:0;transform:scale(.9)}}@keyframes feedbackWrong{0%{opacity:0;transform:scale(.35) rotate(-8deg)}30%{opacity:1;transform:scale(1.12) rotate(7deg)}55%{transform:scale(1) translateX(-10px)}75%{transform:scale(1) translateX(10px)}100%{opacity:0;transform:scale(.9)}}
.categories-grid{display:grid;grid-template-columns:1fr;gap:13px;max-width:720px;margin:0 auto;padding-bottom:35px}.category-card{display:grid;grid-template-columns:58px 1fr 25px;align-items:center;gap:14px;min-height:118px;padding:18px;border:1px solid #293650;border-radius:24px;background:var(--card);color:var(--ink);text-align:left;box-shadow:var(--shadow);transition:.12s;overflow:hidden}.category-card:active{transform:scale(.98)}.category-icon{display:grid;place-items:center;width:58px;height:58px;border-radius:18px;background:color-mix(in srgb,var(--accent) 20%,#111a2a);font-size:30px}.category-card span{font-size:9px;font-weight:900;letter-spacing:.14em;color:var(--accent)}.category-card h2{margin:3px 0 5px;font-size:20px}.category-card p{margin:0;color:var(--muted);font-size:12px;line-height:1.35}.category-card>b{font-size:32px;color:var(--accent)}.category-header{display:flex;align-items:flex-start;gap:14px;max-width:720px;margin:0 auto;padding:24px 0 22px}.category-header h2{margin:2px 0 0;font-size:clamp(27px,8vw,40px)}.category-header .subtitle{font-size:13px}.category-header .icon-btn{flex:0 0 auto}.scale-game{max-width:650px;margin:auto}.scale-target{display:grid;grid-template-columns:1fr auto;align-items:end;gap:3px 15px;margin-bottom:14px;padding:15px 20px;border-radius:22px;background:linear-gradient(135deg,#101d36,#182e5c);text-align:left}.scale-target span{font-size:10px;font-weight:900;letter-spacing:.14em;color:#9fb3d5}.scale-target strong{grid-row:2;font-size:clamp(38px,12vw,58px);line-height:1;color:#fff}.scale-target small{grid-column:2;grid-row:1/3;align-self:center;color:#a9bad4;font-size:12px;font-weight:800}.scale-keyboard{position:relative;display:flex;width:100%;height:180px;margin:0 auto 12px;border:2px solid #35435a;border-radius:8px 8px 12px 12px;background:#dfe5ee;overflow:hidden;filter:drop-shadow(0 10px 9px #0005);touch-action:manipulation}.scale-white{position:relative;flex:1;height:100%;padding:0;border:0;border-right:1px solid #8590a0;background:linear-gradient(#fff,#e8edf4);z-index:1}.scale-black{position:absolute;top:0;width:4.5%;height:61%;padding:0;border:0;border-radius:0 0 4px 4px;background:linear-gradient(160deg,#263248,#050b16);transform:translateX(-50%);z-index:2}.scale-white.active,.scale-black.active{background:linear-gradient(#75dfff,#347ff1);box-shadow:inset 0 0 0 2px #ffffff66}.scale-white.scale-correct,.scale-black.scale-correct{background:linear-gradient(#63e8bd,#0aaa79);box-shadow:0 0 20px #20c997}.scale-white.scale-wrong,.scale-black.scale-wrong{background:linear-gradient(#ff718d,#e92750);box-shadow:0 0 20px #ff3e66}.scale-white.scale-missing,.scale-black.scale-missing{background:linear-gradient(#ffe36e,#e6a817);animation:missingPulse .32s ease-in-out infinite alternate}@keyframes missingPulse{to{filter:brightness(1.35);box-shadow:0 0 24px #ffd84d}}.scale-spelling{min-height:20px;margin:9px 0;color:var(--muted);font-size:11px;font-weight:700}.scale-check{width:100%;margin-top:3px}.scale-check:disabled{opacity:.38;cursor:not-allowed;filter:saturate(.4)}
@media(min-width:700px){.categories-grid{grid-template-columns:1fr 1fr}.category-card{min-height:145px}.scale-keyboard{height:220px}}
@media(max-height:700px){.category-header{padding:12px 0}.scale-target{padding:10px 15px;margin-bottom:8px}.scale-target strong{font-size:35px}.scale-keyboard{height:125px;margin-bottom:6px}.scale-spelling{margin:5px 0}.scale-check{padding:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important}}
