:root {
  color-scheme: dark;
  --ink: #f8f5ed;
  --muted: #9ca6b9;
  --dim: #667087;
  --bg: #090d18;
  --panel: rgba(17, 24, 42, .84);
  --panel-solid: #11182a;
  --line: rgba(255,255,255,.12);
  --gold: #ffcb66;
  --gold-2: #f79445;
  --blue: #6ea8ff;
  --green: #1ed760;
  --danger: #ff7f78;
  --radius: 24px;
  --shadow: 0 30px 80px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px),
    radial-gradient(circle at 75% 10%, #18254a 0, transparent 34%),
    var(--bg);
  background-size: 48px 48px, 48px 48px, auto, auto;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.ambient { position: fixed; width: 36rem; height: 36rem; border-radius: 50%; filter: blur(100px); opacity: .11; pointer-events: none; }
.ambient-one { background: var(--gold); top: -18rem; left: -12rem; }
.ambient-two { background: var(--blue); right: -18rem; bottom: -22rem; }

.site-header { width: min(1180px, calc(100% - 40px)); height: 82px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.05rem; font-weight: 900; letter-spacing: .08em; }
.brand > span:last-child > span { color: var(--gold); }
.brand-mark { height: 25px; display: flex; align-items: center; gap: 3px; }
.brand-mark i { display: block; width: 3px; border-radius: 4px; background: var(--gold); }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(5) { height: 9px; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 17px; }
.brand-mark i:nth-child(3) { height: 25px; }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.04); cursor: pointer; }
.icon-button:hover { background: rgba(255,255,255,.09); }
.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-off { display: none; }
.is-muted .sound-on { display: none; }
.is-muted .sound-off { display: block; }

.app-shell { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 70px; }
.screen { display: none; animation: enter .5s cubic-bezier(.2,.8,.2,1); }
.screen.is-active { display: grid; }
@keyframes enter { from { opacity: 0; transform: translateY(12px); } }

.start-screen { grid-template-columns: minmax(0, .9fr) minmax(430px, .76fr); gap: clamp(48px, 9vw, 120px); align-items: center; min-height: calc(100vh - 190px); }
.eyebrow { margin: 0 0 14px; color: var(--gold); font-size: .75rem; font-weight: 850; letter-spacing: .19em; text-transform: uppercase; }
.intro-copy h1, .summary-screen h1 { max-width: 720px; margin: 0; font-size: clamp(3.6rem, 7vw, 7.3rem); line-height: .89; letter-spacing: -.07em; }
.intro-copy h1 em { color: var(--gold); font-family: Georgia, "Times New Roman", serif; font-weight: 500; }
.lead { max-width: 580px; margin: 30px 0 24px; color: #c7cedb; font-size: clamp(1.05rem, 1.7vw, 1.3rem); }
.collection-note { color: var(--muted); font-size: .92rem; }
.collection-note strong { color: var(--ink); }

.setup-card { padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
fieldset { min-width: 0; margin: 0 0 26px; padding: 0; border: 0; }
legend { margin-bottom: 12px; color: var(--muted); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.choice-card { position: relative; display: grid; grid-template-columns: 44px 1fr 20px; gap: 13px; align-items: center; min-height: 67px; margin-top: 9px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.025); cursor: pointer; transition: .2s ease; }
.choice-card:hover { border-color: rgba(255,203,102,.45); background: rgba(255,255,255,.05); }
.choice-card:has(input:checked) { border-color: var(--gold); background: rgba(255,203,102,.08); box-shadow: inset 0 0 0 1px rgba(255,203,102,.12); }
.choice-card input { position: absolute; opacity: 0; }
.choice-card strong, .choice-card small { display: block; }
.choice-card > span:not(.choice-icon):not(.source-icon):not(.radio-dot) { min-width: 0; }
.choice-card strong { font-size: .98rem; }
.choice-card small { margin-top: 2px; color: var(--muted); font-size: .8rem; }
.choice-icon, .source-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; background: rgba(110,168,255,.12); color: var(--blue); font-family: Georgia, serif; font-size: 1.15rem; font-weight: 800; }
.choice-blind { color: var(--gold); background: rgba(255,203,102,.1); }
.source-icon svg { width: 22px; fill: currentColor; }
.source-icon.spotify { color: var(--green); background: rgba(30,215,96,.1); }
.source-icon.spotify svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.radio-dot { width: 17px; height: 17px; border: 1px solid #697389; border-radius: 50%; box-shadow: inset 0 0 0 4px transparent; }
.choice-card:has(input:checked) .radio-dot { border-color: var(--gold); background: var(--gold); box-shadow: inset 0 0 0 4px var(--panel-solid); }

.battle-beta-card { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 13px; align-items: center; min-height: 64px; margin-top: 14px; padding: 9px 13px; overflow: hidden; border: 1px solid rgba(110,168,255,.3); border-radius: 15px; color: var(--ink); background: linear-gradient(105deg, rgba(110,168,255,.1), rgba(255,203,102,.045)); text-decoration: none; transition: .2s ease; }
.battle-beta-card::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--blue); }
.battle-beta-card:hover { border-color: rgba(110,168,255,.65); background: linear-gradient(105deg, rgba(110,168,255,.16), rgba(255,203,102,.075)); transform: translateY(-1px); }
.battle-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: rgba(110,168,255,.14); font-size: .75rem; font-weight: 950; letter-spacing: -.03em; }
.battle-copy { min-width: 0; }
.battle-title { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.battle-title strong { font-size: .98rem; }
.battle-copy small { display: block; margin-top: 2px; color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.beta-badge { padding: 2px 6px; border: 1px solid rgba(255,203,102,.36); border-radius: 999px; color: var(--gold); background: rgba(255,203,102,.09); font-size: .61rem; font-weight: 900; letter-spacing: .08em; line-height: 1.3; text-transform: uppercase; }
.battle-action { padding: 5px 9px; border-radius: 999px; color: #dbe8ff; background: rgba(110,168,255,.14); font-size: .7rem; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }

.spotify-setup { margin: -10px 0 25px; padding: 17px; border: 1px solid rgba(30,215,96,.25); border-radius: 14px; background: rgba(30,215,96,.06); }
.spotify-setup p { margin: 0 0 8px; color: var(--muted); font-size: .82rem; }
.spotify-setup p strong { color: var(--ink); }
.spotify-setup label { display: block; margin: 13px 0 6px; color: var(--muted); font-size: .78rem; font-weight: 700; }
.inline-field { display: flex; gap: 8px; }
.inline-field input { min-width: 0; flex: 1; height: 42px; padding: 0 12px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: #0a1020; }
.inline-field input:focus { outline: 2px solid var(--green); outline-offset: 2px; }
.small-button { padding: 0 13px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.07); cursor: pointer; }
.redirect-note { margin-top: 12px !important; overflow-wrap: anywhere; }
.redirect-note code { color: #b8c5dd; font-size: .74rem; }
.spotify-button { width: 100%; height: 44px; margin-top: 5px; display: flex; align-items: center; justify-content: center; gap: 9px; border: 0; border-radius: 22px; color: #051109; background: var(--green); font-weight: 800; cursor: pointer; }
.spotify-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.spotify-button:hover { filter: brightness(1.08); }

.primary-button { width: 100%; min-height: 58px; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border: 0; border-radius: 14px; color: #171106; background: linear-gradient(115deg, var(--gold), #ffd98c); font-weight: 900; cursor: pointer; box-shadow: 0 10px 30px rgba(255,203,102,.15); transition: .2s ease; }
.primary-button:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 14px 35px rgba(255,203,102,.24); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; box-shadow: none; }
.primary-button span:last-child { font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; }
.form-note { margin: 13px 8px 0; color: var(--dim); text-align: center; font-size: .73rem; }

.game-screen { min-height: calc(100vh - 160px); }
.game-topbar { display: grid; grid-template-columns: 1fr minmax(240px, 420px) 1fr; gap: 20px; align-items: center; margin-bottom: 34px; }
.text-button { justify-self: start; padding: 9px 0; border: 0; color: var(--muted); background: none; cursor: pointer; }
.text-button:hover { color: var(--ink); }
.round-progress { color: var(--muted); text-align: center; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.round-progress strong { color: var(--ink); }
.progress-track, .timer-track { height: 4px; margin-top: 10px; overflow: hidden; border-radius: 3px; background: rgba(255,255,255,.09); }
.progress-track span, .timer-track span { display: block; width: 10%; height: 100%; border-radius: inherit; background: var(--gold); transition: width .35s ease; }
.score-box { justify-self: end; display: flex; align-items: baseline; gap: 10px; }
.score-box span { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.score-box strong { font-size: 1.8rem; }
.play-area { display: grid; grid-template-columns: .78fr 1.22fr; gap: 18px; }
.track-panel, .timeline-panel { min-height: 370px; padding: clamp(25px, 4vw, 46px); border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); }
.track-panel { position: relative; overflow: hidden; display: flex; flex-direction: column; }
.track-panel::after { content: ""; position: absolute; width: 250px; height: 250px; right: -130px; bottom: -130px; border-radius: 50%; border: 38px solid rgba(255,203,102,.04); box-shadow: 0 0 0 38px rgba(255,203,102,.025); }
.track-identity, .blind-identity { min-height: 145px; }
.track-identity, .blind-identity, .result-copy { min-width: 0; }
.track-identity p, .blind-identity p { margin: 0 0 7px; color: var(--muted); font-size: 1rem; }
.track-identity h2, .blind-identity h2 { max-width: 430px; margin: 0; font-size: clamp(1.7rem, 3vw, 2.7rem); line-height: 1.08; letter-spacing: -.04em; }
.track-identity h2, .blind-identity h2, .result-copy h2 { overflow-wrap: anywhere; hyphens: auto; }
.blind-identity { display: flex; align-items: center; gap: 18px; }
.blind-identity > span { width: 66px; height: 66px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,203,102,.3); border-radius: 50%; color: var(--gold); background: rgba(255,203,102,.08); font: 500 2rem Georgia, serif; }
.player-row { position: relative; z-index: 1; display: flex; align-items: center; gap: 17px; margin-top: auto; }
.play-button { width: 60px; height: 60px; flex: 0 0 auto; display: grid; place-items: center; border: 0; border-radius: 50%; color: #151006; background: var(--gold); cursor: pointer; }
.play-button:disabled { cursor: wait; opacity: .4; }
.play-button svg { width: 28px; fill: currentColor; }
.pause-icon { display: none; }
.play-button.is-playing .play-icon { display: none; }
.play-button.is-playing .pause-icon { display: block; }
.timer-wrap { flex: 1; }
.timer-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .78rem; }
.timer-meta strong { color: var(--ink); }
.timer-track span { width: 100%; background: linear-gradient(90deg, var(--gold-2), var(--gold)); }
.player-message { min-height: 21px; margin: 16px 0 0 77px; color: var(--muted); font-size: .78rem; }
.retry-button { position: relative; z-index: 1; align-self: flex-start; margin: 5px 0 0 77px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: rgba(255,255,255,.05); font-size: .78rem; cursor: pointer; }
.retry-button:hover { border-color: var(--gold); }

.timeline-panel { display: flex; flex-direction: column; }
.timeline-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.timeline-heading h2 { margin: 0; font-size: clamp(1.5rem, 2.7vw, 2.15rem); letter-spacing: -.04em; }
.timeline-heading output { min-width: 105px; color: var(--gold); font: 500 clamp(2rem, 4vw, 3.4rem)/1 Georgia, serif; text-align: right; }
.timeline-wrap { position: relative; margin: 60px 0 43px; padding-top: 30px; }
.timeline-decade-labels { position: absolute; inset: 0 0 auto; height: 28px; }
.timeline-decade-labels span { position: absolute; color: var(--dim); font-size: .67rem; transform: translateX(-50%); }
.timeline-decade-labels span:first-child { transform: none; }
.timeline-decade-labels span:last-child { transform: translateX(-100%); }
#yearSlider { width: 100%; height: 6px; margin: 0; border-radius: 6px; outline: none; appearance: none; background: linear-gradient(90deg, var(--gold) var(--slider-progress, 50%), rgba(255,255,255,.13) var(--slider-progress, 50%)); cursor: pointer; }
#yearSlider::-webkit-slider-thumb { width: 28px; height: 28px; appearance: none; border: 7px solid var(--gold); border-radius: 50%; background: #101728; box-shadow: 0 0 0 5px rgba(255,203,102,.15), 0 5px 18px rgba(0,0,0,.5); }
#yearSlider::-moz-range-thumb { width: 14px; height: 14px; border: 7px solid var(--gold); border-radius: 50%; background: #101728; box-shadow: 0 0 0 5px rgba(255,203,102,.15), 0 5px 18px rgba(0,0,0,.5); }
.timeline-dots { position: absolute; inset: 56px 0 auto; display: flex; justify-content: space-between; pointer-events: none; }
.timeline-dots i { width: 2px; height: 7px; background: rgba(255,255,255,.15); }
.year-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: auto 0 24px; color: var(--muted); font-size: .78rem; }
.year-stepper button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 50%; background: rgba(255,255,255,.04); font-size: 1.3rem; cursor: pointer; }
.year-stepper button:hover { border-color: var(--gold); }
.confirm-button { margin-top: 0; }

.result-dialog { width: min(740px, calc(100% - 32px)); max-width: none; max-height: calc(100dvh - 24px); padding: 0; overflow-x: hidden; overflow-y: auto; border: 0; color: var(--ink); background: transparent; }
.result-dialog, .result-panel { min-width: 0; }
.result-dialog:focus-visible { outline: none; }
body:has(.result-dialog[open]) { overflow: hidden; }
.result-dialog[open] { animation: result-in .28s cubic-bezier(.2,.8,.2,1); }
.result-dialog::backdrop { background: rgba(4, 7, 14, .8); backdrop-filter: blur(9px); animation: backdrop-in .22s ease; }
@keyframes result-in { from { opacity: 0; transform: translateY(18px) scale(.97); } }
@keyframes backdrop-in { from { opacity: 0; } }
.result-panel { display: grid; grid-template-columns: 104px 1fr; gap: 22px 26px; align-items: center; margin: 0; padding: 32px; border: 1px solid rgba(255,203,102,.36); border-radius: 24px; background: radial-gradient(circle at 7% 0%, rgba(255,203,102,.16), transparent 42%), linear-gradient(135deg, #171c2a, #101729 72%); box-shadow: 0 35px 100px rgba(0,0,0,.62); }
.result-points { width: 104px; height: 104px; display: grid; place-content: center; border: 1px solid rgba(255,203,102,.42); border-radius: 50%; text-align: center; background: rgba(255,203,102,.08); box-shadow: inset 0 0 30px rgba(255,203,102,.05); }
.result-points strong { color: var(--gold); font-size: 1.5rem; line-height: 1; }
.result-points span { margin-top: 4px; color: var(--muted); font-size: .65rem; text-transform: uppercase; }
.result-copy p, .result-copy h2 { margin: 0; }
.result-copy > p:first-child { color: var(--gold); font-size: .74rem; font-weight: 800; text-transform: uppercase; }
.result-copy h2 { margin: 3px 0; font-size: 1.25rem; }
.result-copy > p:last-child { color: var(--muted); font-size: .9rem; }
.result-facts, .result-panel > .source-block, .result-panel > .music-links { grid-column: 1 / -1; width: 100%; }
.song-fact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.song-fact-grid > div { min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.035); }
.song-fact-grid .fact-wide { grid-column: 1 / -1; }
.song-fact-grid dt { margin-bottom: 4px; color: var(--dim); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.song-fact-grid dd { margin: 0; color: #dce2ec; font-size: .82rem; overflow-wrap: anywhere; }
.song-fact-grid dd strong, .song-fact-grid dd small { display: block; }
.song-fact-grid dd strong { color: var(--ink); font-size: .95rem; }
.song-fact-grid dd small { margin-top: 2px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.source-block { min-width: 0; }
.source-heading { display: block; margin-bottom: 7px; color: var(--dim); font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.source-block > div, .music-links { display: flex; flex-wrap: wrap; gap: 7px; }
.source-block a, .music-links a { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; color: #dce2ec; background: rgba(255,255,255,.035); font-size: .74rem; text-decoration: none; }
.source-block a:hover, .music-links a:hover { border-color: var(--gold); color: var(--ink); }
.source-block p { margin: 7px 0 0; color: var(--muted); font-size: .72rem; }
.music-links small { flex-basis: 100%; margin-top: 2px; color: var(--dim); font-size: .68rem; }
.next-button { position: sticky; z-index: 2; bottom: 0; grid-column: 1 / -1; width: 100%; box-shadow: 0 -10px 28px rgba(10,14,25,.72); }

.summary-screen { justify-items: center; max-width: 820px; margin: 0 auto; text-align: center; }
.summary-screen h1 { font-size: clamp(3rem, 7vw, 5.8rem); }
.final-score { margin: 28px 0 6px; display: flex; align-items: baseline; justify-content: center; gap: 10px; }
.final-score strong { color: var(--gold); font: 500 clamp(4rem, 10vw, 8rem)/1 Georgia, serif; }
.final-score span { color: var(--muted); }
.summary-message { max-width: 520px; margin: 10px auto 30px; color: var(--muted); font-size: 1.05rem; }
.round-list { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 24px; text-align: left; }
.round-item { min-width: 0; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.025); overflow: hidden; }
.round-item[open] { border-color: rgba(255,203,102,.32); background: rgba(255,255,255,.04); }
.round-summary { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 18px; gap: 10px; align-items: center; padding: 13px 14px; cursor: pointer; list-style: none; }
.round-summary::-webkit-details-marker { display: none; }
.round-number { color: var(--dim); font-size: .75rem; }
.round-title { min-width: 0; }
.round-title strong, .round-title small { display: block; overflow-wrap: anywhere; }
.round-title strong { font-size: .9rem; line-height: 1.3; }
.round-title small { margin-top: 2px; color: var(--muted); font-size: .72rem; line-height: 1.35; }
.round-summary > b { color: var(--gold); font-size: .9rem; white-space: nowrap; }
.round-toggle { position: relative; width: 18px; height: 18px; }
.round-toggle::before, .round-toggle::after { content: ""; position: absolute; inset: 8px 3px auto; height: 2px; border-radius: 2px; background: var(--muted); transition: transform .2s ease; }
.round-toggle::after { transform: rotate(90deg); }
.round-item[open] .round-toggle::after { transform: rotate(0); }
.round-expanded { display: grid; gap: 14px; padding: 14px; border-top: 1px solid var(--line); }
.summary-preview-button { width: 100%; min-width: 0; min-height: 54px; display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 11px; align-items: center; padding: 8px 12px; border: 1px solid rgba(255,203,102,.3); border-radius: 12px; color: var(--ink); text-align: left; background: rgba(255,203,102,.07); cursor: pointer; }
.summary-preview-button:hover:not(:disabled) { border-color: var(--gold); background: rgba(255,203,102,.12); }
.summary-preview-button:disabled { cursor: wait; opacity: .7; }
.summary-preview-symbol { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #171106; background: var(--gold); }
.summary-preview-symbol::before { content: ""; width: 0; height: 0; margin-left: 2px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid currentColor; }
.summary-preview-button.is-playing .summary-preview-symbol::before { width: 9px; height: 12px; margin-left: 0; border: 0; border-left: 3px solid currentColor; border-right: 3px solid currentColor; }
.summary-preview-button > span:last-child { min-width: 0; }
.summary-preview-button strong, .summary-preview-button small { display: block; overflow-wrap: anywhere; }
.summary-preview-button strong { font-size: .82rem; }
.summary-preview-button small { color: var(--muted); font-size: .7rem; }
.summary-actions { width: min(100%, 520px); display: grid; grid-template-columns: 1.25fr .75fr; gap: 10px; }
.secondary-button { border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.04); cursor: pointer; }
.secondary-button:hover { background: rgba(255,255,255,.08); }

.toast { position: fixed; z-index: 10; left: 50%; bottom: 28px; max-width: calc(100% - 32px); padding: 11px 17px; border: 1px solid var(--line); border-radius: 24px; color: var(--ink); background: #171e30; box-shadow: 0 12px 45px rgba(0,0,0,.45); opacity: 0; pointer-events: none; transform: translate(-50%, 15px); transition: .25s ease; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

@media (max-width: 900px) {
  .start-screen { grid-template-columns: 1fr; min-height: auto; gap: 40px; }
  .intro-copy { max-width: 680px; }
  .setup-card { max-width: 620px; }
  .play-area { grid-template-columns: 1fr; }
  .track-panel, .timeline-panel { min-height: 330px; }
  .result-panel { grid-template-columns: 92px 1fr; }
  .result-points { width: 92px; height: 92px; }
}

@media (min-width: 901px) and (max-height: 860px) {
  .site-header { height: 58px; }
  .app-shell { padding: 12px 0 24px; }
  .game-screen { min-height: auto; }
  .game-topbar { margin-bottom: 12px; }
  .track-panel, .timeline-panel { min-height: 288px; padding: 25px 30px; }
  .track-identity, .blind-identity { min-height: 98px; }
  .track-identity h2, .blind-identity h2 { font-size: clamp(1.55rem, 2.5vw, 2.2rem); }
  .play-button { width: 52px; height: 52px; }
  .timeline-wrap { margin: 42px 0 29px; }
  .year-stepper { margin-bottom: 16px; }
  .primary-button { min-height: 50px; }
  .result-panel { gap: 16px; margin: 0; padding: 22px; }
  .result-points { width: 60px; height: 60px; }
  .result-points strong { font-size: 1.25rem; }
  .result-copy h2 { font-size: 1.08rem; }
  .next-button { width: 100%; }
}

@media (max-width: 620px) {
  .site-header, .app-shell { width: min(100% - 24px, 1180px); }
  .site-header { height: 67px; }
  .app-shell { padding-top: 22px; }
  .intro-copy h1 { font-size: clamp(3.25rem, 17vw, 5rem); }
  .lead { margin-top: 23px; }
  .setup-card { padding: 18px; border-radius: 19px; }
  .choice-card { grid-template-columns: 39px 1fr 18px; padding: 9px 11px; }
  .choice-icon, .source-icon { width: 37px; height: 37px; }
  .battle-beta-card { grid-template-columns: 39px minmax(0, 1fr) auto; gap: 11px; padding: 9px 10px; }
  .battle-icon { width: 37px; height: 37px; }
  .inline-field { align-items: stretch; flex-direction: column; }
  .small-button { height: 40px; }
  .game-topbar { grid-template-columns: auto 1fr auto; gap: 12px; margin-bottom: 20px; }
  .text-button { width: 38px; overflow: hidden; color: transparent; }
  .text-button::before { content: "×"; color: var(--muted); font-size: 1.5rem; }
  .score-box span { display: none; }
  .score-box strong { font-size: 1.35rem; }
  .track-panel, .timeline-panel { min-height: 310px; padding: 23px 19px; border-radius: 18px; }
  .track-identity, .blind-identity { min-height: 120px; }
  .player-message, .retry-button { margin-left: 0; }
  .timeline-heading { align-items: end; }
  .timeline-heading output { min-width: 80px; font-size: 2.2rem; }
  .timeline-wrap { margin: 53px 0 35px; }
  .timeline-decade-labels span:nth-child(even) { display: none; }
  .result-panel { grid-template-columns: auto minmax(0, 1fr); gap: 14px; }
  .result-dialog { width: calc(100% - 24px); }
  .result-panel { padding: 22px 18px; border-radius: 19px; }
  .result-points { width: 66px; height: 66px; }
  .next-button { grid-column: 1 / -1; width: 100%; }
  .song-fact-grid { grid-template-columns: minmax(0, 1fr); }
  .song-fact-grid .fact-wide { grid-column: auto; }
  .round-summary { grid-template-columns: 27px minmax(0, 1fr) auto 18px; gap: 9px; }
  .summary-actions { grid-template-columns: 1fr; }
  .secondary-button { min-height: 50px; }
}

@media (max-width: 360px) {
  .site-header, .app-shell { width: calc(100% - 20px); }
  .app-shell { padding-top: 16px; }
  .intro-copy h1 { font-size: clamp(2.85rem, 16vw, 3.45rem); }
  .setup-card { padding: 15px; }
  .choice-card { grid-template-columns: 36px minmax(0, 1fr) 17px; gap: 10px; }
  .battle-beta-card { grid-template-columns: 36px minmax(0, 1fr); gap: 10px; }
  .battle-icon { width: 36px; height: 36px; }
  .battle-action { display: none; }
  .track-panel, .timeline-panel { padding: 20px 15px; }
  .timeline-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .timeline-heading output { min-width: 70px; font-size: 2rem; }
  .result-dialog { width: calc(100% - 20px); }
  .result-panel { grid-template-columns: 58px minmax(0, 1fr); gap: 12px; padding: 18px 14px; }
  .result-points { width: 58px; height: 58px; }
  .result-points strong { font-size: 1.15rem; }
  .result-copy h2 { font-size: 1.05rem; line-height: 1.25; }
  .summary-screen h1 { font-size: 2.55rem; }
  .final-score { flex-wrap: wrap; margin-top: 20px; }
  .round-summary { grid-template-columns: 23px minmax(0, 1fr) auto 16px; gap: 8px; padding: 11px 10px; }
  .round-expanded { padding: 11px 10px; }
  .source-block a, .music-links a { padding: 6px 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
