:root { color-scheme: dark; --board: #123e35; --ink: #f6f3e9; --muted: #b5cbc0; --line: #ffffff29; --yellow: #f7cd72; --green: #78e6ae; --red: #ff9399; font-family: 'Segoe UI', Arial, sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: radial-gradient(ellipse at 15% 5%, #32614c55, transparent 60%), radial-gradient(ellipse at 90% 70%, #08271e88, transparent 70%), var(--board); min-height: 100vh; }
body::before { content: ''; position: fixed; inset: 0; opacity: .09; pointer-events: none; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.5' filter='url(%23n)'/%3E%3C/svg%3E"); }
.app { width: min(1600px, 100%); padding: 0 clamp(16px, 3.4vw, 56px); margin: auto; position: relative; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; border: 1px solid var(--line); border-radius: 9px; background: #ffffff04; min-height: 52px; padding: 12px 18px; transition: background .12s, border-color .12s; }
button:hover { background: #ffffff12; border-color: #ffffff65; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
button:disabled { cursor: wait; opacity: .6; }
header { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; font: 600 25px Georgia, serif; white-space: nowrap; }
.brand svg { width: 31px; height: 31px; }
.header-actions { display: flex; gap: 10px; }
.quiet { font-size: 16px; border-color: transparent; }
.intro { display: flex; justify-content: space-between; gap: 20px; align-items: end; padding: 26px 0 28px; }
.eyebrow { margin: 0; color: var(--yellow); font-size: 14px; font-weight: 650; letter-spacing: .17em; }
.intro h1 { margin: 10px 0 0; font: 400 clamp(32px, 3.4vw, 48px)/1.12 Georgia, serif; letter-spacing: -.03em; }
.intro h1 em { color: #c8ddcf; font-style: normal; }
.intro > p { color: var(--muted); line-height: 1.65; margin: 0 0 2px; font-size: 17px; }
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px 44px; }
fieldset { min-width: 0; border: 0; margin: 0; padding: 0; }
legend { font-size: 18px; font-weight: 600; padding: 0 0 13px; }
.step { color: #b7cdbda3; font-size: 13px; letter-spacing: .05em; margin-right: 10px; }
.options { display: flex; gap: 7px; }
.spellings label { display: flex; flex: 1; align-items: center; gap: 10px; min-height: 52px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.spellings input { width: 22px; height: 22px; margin: 0; accent-color: var(--yellow); cursor: pointer; }
.spellings label:has(input:checked) { border-color: var(--yellow); color: var(--yellow); background: #f7cd7217; }
.options button { flex: 1; padding-inline: 8px; white-space: nowrap; font-size: 16px; }
.options button[aria-pressed="true"], .mode-options button[aria-pressed="true"] { background: #f7cd7217; border-color: var(--yellow); color: var(--yellow); }
.sizes button { font-size: 21px; }
.sizes button:last-child { flex: 1.9; font-size: 16px; }
.helper { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.mode-options { display: flex; gap: 8px; }
.mode-options button { flex: 1; text-align: left; padding: 12px; }
.mode-options strong { display: block; font-size: 17px; font-weight: 600; margin-bottom: 4px; }
.mode-options small { color: var(--muted); font-size: 14px; }
.start-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px 0; }
.start-row p { color: var(--muted); font-size: 14px; margin: 0; max-width: 48%; }
.start-row p.error { color: var(--red); }
.start-actions { display: flex; gap: 12px; }
.primary { background: var(--yellow); color: #19392b; font-weight: 700; border-color: var(--yellow); min-width: 190px; }
.primary:hover { background: #ffdb91; }
.primary span { margin-left: 26px; }
.secondary { background: #ffffff08; }
.piano-caption { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 13px; letter-spacing: .12em; margin-bottom: 11px; }
.piano-case { padding: 13px 10px 10px; background: #16251f; border: 1px solid #ffffff1a; border-radius: 9px; box-shadow: 0 14px 32px #0003, inset 0 5px #ffffff05; }
#keyboard { display: block; width: 100%; height: 168px; touch-action: none; user-select: none; -webkit-user-select: none; overflow: hidden; }
.piano-key { cursor: pointer; pointer-events: fill; }
.piano-key.white { fill: url(#white-fill); }
.piano-key.black { fill: url(#black-fill); }
.key-outline { fill: none; stroke: #17372a; stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.key-detail { fill: #ffffff0b; pointer-events: none; }
.piano-key.target { fill: #f7cd72; }
.piano-key.pressed { fill: #9cb9c7; }
.piano-key.good, .piano-key.reveal { fill: #78e6ae; }
.piano-key.bad { fill: #ff9399; }
.piano-key:focus-visible { outline: none; stroke: #e19b20; stroke-width: 5; vector-effect: non-scaling-stroke; }
.keyboard-hint { text-align: center; color: var(--muted); font-size: 14px; margin: 15px 0 0; }
footer { margin: 27px 0 18px; text-align: center; color: #a5bcb0; font-size: 12px; }
footer a { color: inherit; text-underline-offset: 3px; }
.stage-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 24px; }
.scores { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 26px; font-size: 15px; color: var(--muted); }
#exercise-time { font-variant-numeric: tabular-nums; }
.scores span { white-space: nowrap; }
.scores strong { font-size: 24px; color: var(--ink); margin-right: 5px; }
.question-area { text-align: center; min-height: 236px; display: flex; flex-direction: column; justify-content: center; align-items: center; }
#instruction { font-size: clamp(20px, 2vw, 28px); margin: 18px 0 0; color: #d0ded3; }
#prompt { font: 500 clamp(76px, 8.7vw, 138px)/1.1 Georgia, serif; margin: 5px 0; letter-spacing: -.04em; }
#prompt.long-prompt { font-size: clamp(44px, 6vw, 84px); }
#feedback { font-size: 20px; min-height: 28px; margin: 6px 0 0; color: var(--muted); }
#feedback.good { color: var(--green); }
#feedback.bad { color: var(--red); }
.timer { width: min(620px, 80%); height: 65px; margin: 4px auto 24px; display: flex; align-items: center; gap: 12px; position: relative; }
.fuse-graphic { flex: 1; min-width: 0; }
.fuse-graphic svg { display: block; width: 100%; height: 62px; overflow: visible; }
.fuse-track, .fuse-line { stroke-width: 5; fill: none; stroke-linecap: round; }
.fuse-track { stroke: #ffffff19; }
.fuse-line { stroke: var(--yellow); stroke-dasharray: 1; }
.dynamite rect { fill: #d95049; stroke: #ffb39a; stroke-width: 1.5; }
.dynamite ellipse { fill: #ff9986; stroke: #913c34; stroke-width: 1; }
.dynamite path { fill: none; stroke-linecap: round; }
.dynamite .stick-shine { stroke: #ffb39a; stroke-width: 2; }
.dynamite .bundle-band { stroke: #644939; stroke-width: 5; }
.dynamite .stick-fuse { stroke: var(--yellow); stroke-width: 3; }
#spark { fill: #ffeaa7; }
.count { display: flex; align-items: baseline; gap: 7px; min-width: 123px; }
.count strong { font-variant-numeric: tabular-nums; font-size: 40px; color: var(--yellow); }
.count span { color: var(--muted); font-size: 14px; }
.timer.urgent .count strong { color: var(--red); }
#poof { position: absolute; left: 0; top: -15px; background: #f8e9b9; color: #503e29; border: 4px solid #e1be65; border-radius: 45% 55% 40% 60%; padding: 13px 22px; transform: rotate(-8deg); font-weight: 900; font-size: 28px; animation: poof .35s ease-out; }
@keyframes poof { from { transform: scale(.3) rotate(-18deg); opacity: .4; } to { transform: scale(1) rotate(-8deg); opacity: 1; } }
.no-timer { text-align: center; font-size: 17px; color: var(--muted); margin: 10px 0 28px; }
body.playing #keyboard { height: clamp(230px, 33vh, 410px); }
body.playing .piano-caption { font-size: 14px; }
body.playing footer { display: none; }
body.playing .keyboard-hint { font-size: 17px; }
.answer-bank { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 8px; margin: 22px 0 0; }
.answer-bank.naturals { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.answer-bank button { min-height: 80px; font-size: clamp(22px, 2vw, 31px); font-weight: 600; padding: 10px 5px; background: #ffffff08; }
.answer-bank button.enharmonic { font-size: clamp(17px, 1.6vw, 25px); }
.answer-bank button.good { background: var(--green); color: #12382c; border-color: var(--green); }
.answer-bank button.bad { background: var(--red); color: #521e25; border-color: var(--red); }
body.free .question-area { min-height: 200px; }
body.free #prompt { font-size: clamp(60px, 6vw, 90px); }
body.free #keyboard { height: clamp(280px, 43vh, 480px); }
@media (min-width: 1800px) { .app { width: 96%; } button { min-height: 62px; } body.playing .answer-bank button { min-height: 100px; } }
@media (max-width: 1050px) { .settings-grid { gap: 22px; } .mode-options small { display: none; } .spellings { flex-wrap: wrap; } .spellings button { flex-basis: 40%; } .answer-bank { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 650px) { header { min-height: 74px; } .brand { font-size: 21px; gap: 6px; } .brand svg { width: 24px; } .quiet { padding: 10px 6px; font-size: 14px; } .header-actions { gap: 2px; } .intro { padding: 22px 0; } .intro > p { display: none; } .settings-grid { grid-template-columns: 1fr; } .options button { min-height: 52px; } .mode-options small { display: block; font-size: 12px; } .spellings { flex-wrap: nowrap; } .spellings button { font-size: 14px; flex-basis: auto; white-space: normal; } .start-row { flex-direction: column; align-items: stretch; } .start-row p { max-width: none; } .start-actions { display: grid; grid-template-columns: 1fr 1fr; } .primary { min-width: 0; } .primary span { margin-left: 6px; } .stage-top { align-items: flex-start; } .scores { gap: 12px; font-size: 12px; } .scores strong { display: block; margin: 0; text-align: center; } .stage-top .eyebrow { font-size: 12px; max-width: 100px; line-height: 1.7; } .question-area { min-height: 205px; } .timer { width: 95%; margin-bottom: 18px; } .count { min-width: 100px; } .count strong { font-size: 34px; } body.playing #keyboard { height: 230px; } .answer-bank, .answer-bank.naturals { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 7px; } .answer-bank button { min-height: 65px; } .piano-case { padding-inline: 5px; } }
@media (max-height: 800px) and (min-width: 900px) { header { min-height: 64px; } .stage-top { margin-top: 12px; } .scores strong { font-size: 22px; } .question-area { min-height: 152px; } #instruction { margin-top: 0; font-size: 22px; } #prompt { font-size: 80px; } #prompt.long-prompt { font-size: 60px; } #feedback { font-size: 18px; min-height: 22px; } .timer { height: 52px; margin-bottom: 14px; } .fuse-graphic svg { height: 52px; } body.playing #keyboard { height: 220px; } body.playing .piano-caption { font-size: 13px; margin-bottom: 8px; } .answer-bank { margin-top: 14px; } .answer-bank button { min-height: 68px; } body.playing .keyboard-hint { font-size: 15px; margin-top: 10px; } }
@media (max-height: 800px) and (min-width: 900px) and (max-width: 1050px) { body.playing #keyboard { height: 190px; } .question-area { min-height: 130px; } #prompt { font-size: 64px; } #prompt.long-prompt { font-size: 48px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.piano-case { margin-inline: auto; max-width: 100%; }
.answer-bank button.reveal { background: var(--green); color: #12382c; border-color: var(--green); }
.piano-key.selected { fill: var(--green); }
@media (max-width: 800px) { .mode-options { flex-wrap: wrap; } .mode-options button { flex-basis: 45%; } }
.key-outline { stroke-width: .7; stroke: #59645b; }
.times { flex-wrap: wrap; }
.times button { min-width: 70px; }
.start-actions { display: flex; }
#results { text-align: center; padding: clamp(40px, 8vh, 100px) 0; }
#results h1 { font: 400 clamp(40px, 5vw, 72px) Georgia, serif; margin: 18px 0 38px; }
.result-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; max-width: 900px; margin: auto; }
.result-grid div { padding: 26px 12px; background: #ffffff08; border: 1px solid var(--line); border-radius: 9px; }
.result-grid strong { display: block; color: var(--yellow); font-size: clamp(36px, 5vw, 62px); }
.result-grid span { display: block; font-size: 18px; margin-top: 10px; }
.result-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 36px; }
@media (max-width: 650px) { .result-grid { grid-template-columns: repeat(2, 1fr); } }
