/* Hollow Drum — black, white and one electric blue. Circles and lines only. */
:root {
  --k: #000; --w: #fff; --e: #2b5cff; --e-hi: #6f8dff; --g1: rgba(255,255,255,.62); --g2: rgba(255,255,255,.32); --g3: rgba(255,255,255,.14);
  --f: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --beat: .789s;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; color: var(--w); font-family: var(--f); -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
button { font: inherit; color: inherit; background: none; border: 0; }
canvas#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.num { font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; }

/* panels: black, one white hairline */
.panel { background: rgba(0,0,0,.86); border: 1px solid var(--w); }
.head { display: flex; align-items: center; justify-content: center; gap: 14px; font-stretch: 62%; font-weight: 900; font-size: clamp(34px, 4vw, 52px); line-height: 1; letter-spacing: .01em; text-transform: uppercase; }
.head i { width: .5em; height: .5em; border-radius: 50%; background: var(--e); }

/* menus: inverted bar on focus, a blue dot leads */
.menu { display: flex; flex-direction: column; align-items: stretch; gap: 0; }
.menu button { position: relative; padding: 12px 34px; font-stretch: 100%; font-weight: 800; font-size: clamp(15px, 1.4vw, 18px); letter-spacing: .22em; text-transform: uppercase; color: var(--g1); text-align: left; transition: color .12s, background .12s; }
.menu button b { font-stretch: 62%; font-weight: 900; font-size: 1.15em; letter-spacing: .02em; margin-left: .6em; color: var(--w); }
.menu button::before { content: ""; position: absolute; left: 12px; top: 50%; width: 10px; height: 10px; border-radius: 50%; background: var(--e); transform: translateY(-50%) scale(0); transition: transform .15s; }
.menu button.is-focus { background: var(--w); color: var(--k); }
.menu button.is-focus b { color: var(--k); }
.menu button.is-focus::before { transform: translateY(-50%) scale(1); }

/* ───────── screens ───────── */
.screen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; visibility: hidden; transition: opacity .3s, visibility 0s .3s; }
.screen.is-on { opacity: 1; visibility: visible; transition: opacity .3s; }

/* title */
.title { flex-direction: column; justify-content: flex-start; padding: max(5vh, 26px) 20px max(4vh, 18px); background: linear-gradient(180deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 38%, rgba(0,0,0,0) 62%, rgba(0,0,0,.8) 100%); }
.logo { position: relative; display: inline-grid; justify-items: start; padding: .3em .4em .2em 7.4em; font-size: clamp(10px, 1.35vw, 20px); }
.logo-disc { position: absolute; left: 1.2em; top: 50%; width: 5em; height: 5em; margin-top: -2.5em; border-radius: 50%; background: var(--e); box-shadow: 0 0 0 .5em #000, 0 0 0 .62em var(--w); animation: discBeat var(--beat) cubic-bezier(.2,.8,.3,1) infinite; }
@keyframes discBeat { 0% { transform: scale(1.08); } 45%, 100% { transform: scale(1); } }
.logo-rings { position: absolute; left: 0; top: 50%; width: 7.4em; height: 7.4em; margin-top: -3.7em; fill: none; stroke: var(--w); stroke-width: 1; opacity: .5; overflow: visible; }
.logo-hollow { position: relative; font-stretch: 125%; font-weight: 900; font-size: 2.6em; line-height: 1; letter-spacing: .32em; color: transparent; -webkit-text-stroke: .045em var(--w); padding-left: .12em; }
.logo-drum { position: relative; font-stretch: 62%; font-weight: 900; font-size: 9.6em; line-height: .78; letter-spacing: -.01em; color: var(--w); margin-top: .02em; text-shadow: .025em .025em 0 var(--e); }
.tagline { margin-top: 1.4em; display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: clamp(11px, 1.05vw, 14px); letter-spacing: .34em; text-transform: uppercase; color: var(--g1); }
.tagline i { width: 5px; height: 5px; border-radius: 50%; background: var(--w); }
.prompt { margin-top: auto; display: flex; gap: 16px; align-items: center; font-weight: 800; font-size: clamp(13px, 1.3vw, 17px); letter-spacing: .36em; text-transform: uppercase; color: var(--w); animation: beat var(--beat) steps(1) infinite; }
.prompt em { width: 12px; height: 12px; border-radius: 50%; background: var(--e); animation: dot var(--beat) cubic-bezier(.2,.8,.3,1) infinite; }
@keyframes beat { 0% { opacity: 1; } 50% { opacity: .55; } }
@keyframes dot { 0% { transform: scale(1.8); } 60%, 100% { transform: scale(1); } }
.settings { margin-top: 2.2vh; display: flex; gap: 0; border: 1px solid var(--g2); }
.settings button { display: flex; align-items: baseline; gap: .8em; padding: 10px 18px; font-weight: 800; font-size: 11.5px; letter-spacing: .28em; text-transform: uppercase; color: var(--g1); transition: background .12s, color .12s; }
.settings button + button { border-left: 1px solid var(--g2); }
.settings button b { font-stretch: 62%; font-weight: 900; font-size: 16px; letter-spacing: .02em; color: var(--w); }
.settings button:hover { background: var(--w); color: var(--k); } .settings button:hover b { color: var(--e); }
.title.is-on .logo { animation: logoIn .7s cubic-bezier(.2,.9,.25,1) both; }
@keyframes logoIn { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }

/* pause */
.pause { background: rgba(0,0,0,.6); }
.pause .panel { padding: 30px 0 18px; min-width: min(360px, 88vw); display: grid; gap: 20px; transform: scale(.96); transition: transform .25s cubic-bezier(.2,.9,.3,1.3); }
.pause.is-on .panel { transform: none; }

/* results */
.results { background: rgba(0,0,0,.78); }
.res { display: grid; grid-template-columns: auto 1fr; grid-template-areas: "head head" "seal stats" "menu menu"; gap: 26px 56px; align-items: center; padding: 24px; max-width: 1000px; width: 100%; }
.res-head { grid-area: head; display: flex; align-items: center; gap: 18px; border-bottom: 1px solid var(--g2); padding-bottom: 16px; }
.res-glyph { font-stretch: 62%; font-weight: 900; font-size: clamp(40px, 4.4vw, 60px); line-height: .8; color: var(--e); }
.res-head h2 { font-stretch: 62%; font-weight: 900; font-size: clamp(30px, 3.8vw, 52px); line-height: .9; text-transform: uppercase; letter-spacing: .01em; }
.res-head p { font-weight: 700; letter-spacing: .3em; text-transform: uppercase; font-size: 11px; color: var(--g1); margin-top: 6px; }
.seal-wrap { grid-area: seal; display: grid; justify-items: center; gap: 14px; }
.seal { position: relative; width: clamp(160px, 19vw, 240px); aspect-ratio: 1; display: grid; place-items: center; border-radius: 50%; background: var(--w); opacity: 0; }
body[data-grade="S"] .seal { background: var(--e); }
.seal b { font-stretch: 62%; font-weight: 900; font-size: clamp(120px, 15vw, 190px); line-height: 1; color: var(--k); transform: translateY(.02em); }
body[data-grade="S"] .seal b { color: var(--w); }
.seal-ring { position: absolute; inset: -14px; border-radius: 50%; border: 1px solid var(--w); opacity: 0; }
.seal-ring.r2 { inset: -30px; border-color: var(--e); }
.results.is-on .seal { animation: slam .5s .4s cubic-bezier(.3,1.5,.5,1) both; }
.results.is-on .seal-ring { animation: shock .9s .55s ease-out both; } .results.is-on .seal-ring.r2 { animation-delay: .62s; }
@keyframes slam { 0% { opacity: 0; transform: scale(2.4); } 60% { opacity: 1; transform: scale(.94); } 100% { opacity: 1; transform: scale(1); } }
@keyframes shock { 0% { opacity: 1; transform: scale(.8); } 100% { opacity: 0; transform: scale(1.6); } }
.seal-note { font-weight: 800; letter-spacing: .28em; text-transform: uppercase; font-size: 11px; color: var(--g1); text-align: center; }
.res-stats { grid-area: stats; display: grid; gap: 20px; }
.res-stats label { display: block; font-weight: 700; font-size: 10.5px; letter-spacing: .34em; text-transform: uppercase; color: var(--g1); margin-bottom: 2px; }
.res-score { position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 14px; }
.res-score label { width: 100%; }
.res-score b { font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; font-size: clamp(64px, 8vw, 108px); line-height: .82; }
.newbest { display: none; align-items: center; gap: 8px; font-style: normal; font-weight: 800; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; background: var(--e); color: var(--w); padding: 7px 12px; margin-bottom: 6px; }
body.new-best .newbest { display: inline-flex; animation: pop .4s 1s cubic-bezier(.3,1.7,.5,1) both; }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.res-row { display: flex; gap: clamp(20px, 3.4vw, 46px); }
.res-row b { font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; font-size: clamp(32px, 3.4vw, 44px); line-height: .9; }
.counts { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--g2); border-bottom: 1px solid var(--g2); }
.counts li { display: grid; padding: 10px 16px; border-left: 1px solid var(--g3); } .counts li:first-child { border-left: 0; padding-left: 0; }
.counts label::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.c-perfect label::before { background: var(--e); } .c-great label::before { background: var(--w); } .c-good label::before { border: 1px solid var(--w); } .c-miss label::before { background: #555; }
.counts b { font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; font-size: 30px; line-height: 1; }
.unlock { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; }
.unlock::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--e); }
.unlock:empty { display: none; }
.res-menu { grid-area: menu; flex-direction: row; justify-content: flex-start; border-top: 1px solid var(--g2); padding-top: 10px; }
.res-menu button { text-align: center; padding-left: 34px; }
.res > * { opacity: 0; }
.results.is-on .res > * { animation: rise .45s cubic-bezier(.2,.9,.3,1) both; }
.results.is-on .res-stats { animation-delay: .65s; } .results.is-on .res-menu { animation-delay: .95s; } .results.is-on .seal-wrap { animation-delay: .25s; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ───────── HUD ───────── */
#hud > * { opacity: 0; transition: opacity .35s; }
body[data-screen="play"][data-phase="song"] #hud > *, body[data-screen="paused"] #hud > *, body[data-screen="ending"] #hud > *, body[data-screen="attract"] #hud > [data-attract] { opacity: 1; }
body[data-screen="attract"] [data-attract] { visibility: visible; }
.plate { position: fixed; left: max(18px, 2vw); top: max(16px, 2.4vh); display: flex; align-items: center; gap: 14px; }
.plate-glyph { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--e); font-stretch: 62%; font-weight: 900; font-size: 22px; }
.plate-text b { display: block; font-stretch: 62%; font-weight: 900; font-size: 26px; line-height: .9; text-transform: uppercase; letter-spacing: .01em; }
.plate-text span { display: block; margin-top: 5px; font-weight: 700; font-size: 10px; letter-spacing: .3em; text-transform: uppercase; color: var(--g1); }
.scorebox { position: fixed; right: max(18px, 2vw); top: max(12px, 2vh); text-align: right; padding: 8px 10px 6px 18px; background: linear-gradient(to left, rgba(0,0,0,.9) 55%, rgba(0,0,0,0)); padding-left: 48px; }
.scorebox label { font-weight: 700; font-size: 10px; letter-spacing: .4em; text-transform: uppercase; color: var(--g1); }
.scorebox .digits { display: block; font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; font-size: clamp(42px, 4.6vw, 66px); line-height: .88; }
.songbar { position: relative; margin-top: 8px; margin-left: auto; width: clamp(140px, 15vw, 220px); height: 1px; background: var(--g2); }
.songbar i { position: absolute; inset: -1px 0; background: var(--e); transform-origin: left; transform: scaleX(0); }
#core { position: fixed; left: var(--cx, 50vw); top: var(--cy, 50vh); width: var(--cd, 220px); height: var(--cd, 220px); transform: translate(-50%, -50%); pointer-events: none; }
#core .gauge { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#grooveArc { transition: stroke-dasharray .2s; }
body.groove-low #grooveArc { stroke: #fff; animation: lowpulse .4s steps(1) infinite; }
@keyframes lowpulse { 50% { opacity: .2; } }
.combo { position: absolute; inset: 0; isolation: isolate; display: grid; place-content: center; text-align: center; transition: opacity .2s; }
.combo b { font-stretch: 62%; font-weight: 900; font-variant-numeric: tabular-nums; line-height: .82; font-size: calc(var(--cd, 220px) * (.36 + var(--tier, 0) * .03)); color: var(--w); }
.combo span { font-weight: 800; font-size: max(8px, calc(var(--cd, 220px) * .05)); letter-spacing: .5em; padding-left: .5em; text-transform: uppercase; color: var(--g1); margin-top: .3em; }
.combo::before { content: ''; position: absolute; left: 50%; top: 50%; width: 64%; height: 64%; transform: translate(-50%, -50%); border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.86) 70%, rgba(0,0,0,0)); z-index: -1; }
.combo.zero { opacity: 0; }
.combo.bump b { animation: bump .14s ease-out; }
@keyframes bump { from { transform: scale(1.14); } to { transform: scale(1); } }
.combo.milestone { animation: shake .5s cubic-bezier(.36,.07,.19,.97); }
.combo.milestone b { color: var(--e-hi); }
@keyframes shake { 10%, 90% { transform: translate(-2px, 1px); } 20%, 80% { transform: translate(4px, -2px) scale(1.1); } 30%, 50%, 70% { transform: translate(-6px, 2px) scale(1.16); } 40%, 60% { transform: translate(6px, -1px) scale(1.1); } }
#judge { position: fixed; left: var(--cx, 50vw); top: calc(var(--cy, 50vh) - var(--cd, 220px) * .5 - 58px); transform: translate(-50%, -100%); text-align: center; pointer-events: none; white-space: nowrap; }
#judge b { display: block; font-stretch: 125%; font-weight: 900; font-style: italic; font-size: clamp(20px, 2.6vw, 36px); letter-spacing: .06em; text-transform: uppercase; line-height: 1; opacity: 0; }
#judge i { display: block; font-style: normal; font-weight: 800; font-size: 10px; letter-spacing: .44em; margin-top: 6px; opacity: 0; color: var(--g1); text-transform: uppercase; }
#judge.go b { animation: judge .5s cubic-bezier(.2,1.6,.4,1) both; }
#judge.go i { animation: judgeSub .5s ease-out both; }
#judge.perfect b { color: var(--w); text-shadow: .06em .06em 0 var(--e); }
#judge.great b { color: var(--w); }
#judge.good b { color: transparent; -webkit-text-stroke: 1.2px var(--w); }
#judge.miss b { color: #6a6a6a; }
@keyframes judge { 0% { opacity: 0; transform: scale(1.6); } 22% { opacity: 1; transform: scale(.95); } 40% { transform: scale(1.02); } 75% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: translateY(-8px); } }
@keyframes judgeSub { 0%, 15% { opacity: 0; } 30%, 75% { opacity: 1; } 100% { opacity: 0; } }
.fever-banner { position: fixed; left: 50%; top: max(18px, 2.6vh); transform: translateX(-50%) scaleX(0); display: flex; align-items: center; gap: 14px; padding: 8px 22px; font-stretch: 125%; font-weight: 900; font-style: italic; font-size: 15px; letter-spacing: .3em; text-transform: uppercase; color: var(--w); background: var(--e); opacity: 0 !important; transition: transform .3s cubic-bezier(.2,1.4,.4,1), opacity .2s; }
.fever-banner i { width: 8px; height: 8px; border-radius: 50%; background: var(--w); }
.fever-banner em { font-style: normal; font-stretch: 62%; letter-spacing: 0; font-size: 1.4em; }
body.fever .fever-banner { opacity: 1 !important; transform: translateX(-50%) scaleX(1); animation: feverPulse var(--beat) steps(1) infinite; }
@keyframes feverPulse { 0% { background: var(--w); color: var(--k); } 25% { background: var(--e); color: var(--w); } }
body.fever .combo b { color: var(--w); text-shadow: .05em .05em 0 var(--e); }
body.fever #grooveArc { stroke: #fff; }
body.missflash #hud { filter: grayscale(1) brightness(.7); }
#hud { transition: filter .2s; }
.keys { position: fixed; inset: 0; pointer-events: none; }
.keys span { position: absolute; left: var(--x); top: var(--y); transform: translate(-50%, -50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-stretch: 100%; font-weight: 900; font-size: 13px; color: var(--w); background: rgba(0,0,0,.8); box-shadow: inset 0 0 0 1px var(--w); transition: background .06s, color .06s; }
.keys span.on { background: var(--w); color: var(--k); }
body.touch .keys { display: none; }
.taps { position: fixed; left: 0; right: 0; bottom: 0; height: 22vh; display: none; grid-template-columns: repeat(4, 1fr); padding: 0 0 max(12px, env(safe-area-inset-bottom)); pointer-events: none; }
body.touch .taps { display: grid; }
.taps i { position: relative; align-self: end; height: 72px; border-top: 1px solid var(--g2); border-left: 1px solid var(--g3); background: linear-gradient(180deg, rgba(0,0,0,0), rgba(0,0,0,.65)); transition: background .06s; }
.taps i:first-child { border-left: 0; }
.taps i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: inset 0 0 0 2px var(--w); }
.taps i:nth-child(2)::after, .taps i:nth-child(3)::after { box-shadow: inset 0 0 0 2px var(--e-hi); }
.taps i.on { background: linear-gradient(180deg, rgba(43,92,255,0), rgba(43,92,255,.55)); }
.taps i.on::after { background: var(--w); }
.countdown { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%); font-stretch: 62%; font-weight: 900; font-size: clamp(110px, 16vw, 200px); line-height: 1; pointer-events: none; }
.countdown.tick { animation: cd .5s ease-out both; }
@keyframes cd { from { transform: translate(-50%, -50%) scale(1.5); opacity: 0; } 30% { opacity: 1; transform: translate(-50%, -50%) scale(1); } to { opacity: 0; transform: translate(-50%, -50%) scale(.92); } }

/* ───────── song select ───────── */
#select { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: clamp(14px, 2.6vh, 28px); padding: max(4vh, 22px) 16px max(3vh, 16px); opacity: 0; visibility: hidden; transition: opacity .35s, visibility 0s .35s; background: linear-gradient(180deg, rgba(0,0,0,.7) 0%, rgba(0,0,0,.35) 50%, rgba(0,0,0,.85) 100%); }
body[data-screen="play"][data-phase="select"] #select { opacity: 1; visibility: visible; transition: opacity .35s; }
.sel-head { text-align: center; }
.sel-kicker { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 10.5px; letter-spacing: .44em; text-transform: uppercase; color: var(--g1); }
.sel-kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--e); }
.sel-head h2 { font-stretch: 62%; font-weight: 900; font-size: clamp(40px, 5vw, 68px); line-height: .9; text-transform: uppercase; }
.placards { display: flex; gap: 0; align-items: stretch; justify-content: center; border: 1px solid var(--g2); background: rgba(0,0,0,.7); }
.placard { position: relative; width: clamp(200px, 22vw, 290px); padding: 20px 22px 18px; display: grid; justify-items: start; gap: 8px; cursor: pointer; transition: background .2s, color .2s; color: var(--g1); }
.placard + .placard { border-left: 1px solid var(--g2); }
.placard .pn { font-stretch: 62%; font-weight: 900; font-size: 22px; line-height: 1; color: var(--g2); }
.placard .pg { justify-self: center; width: clamp(92px, 9vw, 128px); height: auto; margin: 4px 0 6px; fill: none; stroke: currentColor; stroke-width: 1.2; overflow: visible; }
.placard .pg .dot { fill: var(--e); stroke: none; }
.placard h3 { font-stretch: 62%; font-weight: 900; font-size: clamp(24px, 2.2vw, 32px); line-height: .9; text-transform: uppercase; color: var(--w); }
.placard .meta { display: flex; gap: 8px; align-items: baseline; font-weight: 700; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; }
.placard .meta b { font-stretch: 62%; font-weight: 900; font-size: 20px; letter-spacing: 0; color: var(--w); }
.placard .meta span { margin-left: 6px; }
.placard .best { display: flex; gap: 10px; align-items: center; min-height: 32px; margin-top: 4px; }
.placard .best .g { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--w); color: var(--k); font-stretch: 62%; font-weight: 900; font-size: 19px; }
.placard .best .s { font-stretch: 62%; font-weight: 900; font-size: 20px; color: var(--w); }
.placard .best .s.none { font-stretch: 100%; font-weight: 700; font-size: 10px; letter-spacing: .26em; text-transform: uppercase; color: var(--g2); }
.placard.sel { background: var(--w); color: var(--k); }
.placard.sel h3, .placard.sel .meta b, .placard.sel .best .s { color: var(--k); }
.placard.sel .pn { color: var(--e); }
.placard.sel .best .g { background: var(--k); color: var(--w); }
.placard.sel .pg { animation: ringBeat var(--beat) cubic-bezier(.2,.8,.3,1) infinite; }
@keyframes ringBeat { 0% { transform: scale(1.06); } 50%, 100% { transform: scale(1); } }
.placard.locked h3, .placard.locked .meta, .placard.locked .pg, .placard.locked .best { opacity: .18; }
.placard .lock { display: none; position: absolute; inset: 0; place-content: center; justify-items: center; gap: 12px; text-align: center; padding: 20px; }
.placard.locked .lock { display: grid; }
.placard .lock i { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 2px solid currentColor; }
.placard .lock i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 140%; height: 2px; background: currentColor; transform: translate(-50%, -50%) rotate(-45deg); }
.placard .lock span { font-weight: 800; font-size: 10px; letter-spacing: .22em; text-transform: uppercase; line-height: 1.7; color: inherit; }
.placard.locked.sel { background: #1a1a1a; color: var(--w); }
.placard.deny { animation: deny .35s; }
@keyframes deny { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.diffs { display: flex; border: 1px solid var(--g2); }
.diffs button { display: flex; align-items: center; gap: 10px; padding: 9px 20px; font-weight: 800; font-size: 12px; letter-spacing: .26em; text-transform: uppercase; color: var(--g1); cursor: pointer; }
.diffs button + button { border-left: 1px solid var(--g2); }
.diffs button i { font-style: normal; font-size: 8px; letter-spacing: 3px; color: var(--e-hi); }
.diffs button.sel { background: var(--e); color: var(--w); }
.diffs button.sel i { color: var(--w); }
.sel-foot { margin-top: auto; display: grid; justify-items: center; gap: 12px; }
.plaque-btn { position: relative; width: 112px; height: 112px; border-radius: 50%; display: grid; place-content: center; justify-items: center; gap: 4px; cursor: pointer; background: var(--w); color: var(--k); box-shadow: 0 0 0 8px rgba(0,0,0,.6), 0 0 0 9px var(--w); animation: discBeat var(--beat) cubic-bezier(.2,.8,.3,1) infinite; }
.plaque-btn span { font-stretch: 62%; font-weight: 900; font-size: 30px; line-height: .9; text-transform: uppercase; }
.plaque-btn small { font-weight: 800; font-size: 8.5px; letter-spacing: .24em; text-transform: uppercase; color: #555; }
.plaque-btn:hover, .plaque-btn:focus-visible { background: var(--e); color: var(--w); outline: none; } .plaque-btn:hover small { color: var(--w); }
.plaque-btn.locked { background: #222; color: #666; box-shadow: 0 0 0 8px rgba(0,0,0,.6), 0 0 0 9px #444; animation: none; }
.sel-hint { font-weight: 700; font-size: 10.5px; letter-spacing: .24em; text-transform: uppercase; color: var(--g1); }
.sel-hint b { font-weight: 900; font-size: 13px; color: var(--w); margin: 0 4px 0 14px; letter-spacing: .1em; }
body.touch .sel-hint { display: none; }

/* ───────── calibration ───────── */
#calib { position: fixed; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.82); opacity: 0; visibility: hidden; transition: opacity .25s, visibility 0s .25s; z-index: 20; }
body.calibrating #calib { opacity: 1; visibility: visible; transition: opacity .25s; }
.calib-panel { padding: 30px 30px 18px; width: min(440px, 92vw); display: grid; gap: 20px; justify-items: center; text-align: center; }
.calib-say { font-weight: 600; font-size: 14px; line-height: 1.6; color: var(--g1); max-width: 32ch; }
.calib-ring { width: 130px; height: 130px; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--w); box-shadow: 0 0 0 10px #000, 0 0 0 11px var(--g2); }
.calib-ring.tick { animation: ctick .3s ease-out; }
.calib-ring.lead.tick { animation-name: ctickLead; }
@keyframes ctick { from { background: var(--e); transform: scale(1.06); } }
@keyframes ctickLead { from { background: #333; } }
.calib-ring b { font-stretch: 62%; font-weight: 900; font-size: 64px; }
.calib-res { font-weight: 700; font-size: 11px; letter-spacing: .26em; text-transform: uppercase; color: var(--g1); }
.calib-res b { font-stretch: 62%; font-weight: 900; font-size: 22px; color: var(--w); letter-spacing: 0; margin-left: .4em; }
.calib-menu { flex-direction: row; border-top: 1px solid var(--g2); width: 100%; justify-content: center; padding-top: 8px; }
.calib-menu button { padding: 10px 20px 10px 30px; font-size: 13px; }

/* ───────── wipe: a circle that closes and opens on the beat ───────── */
.wipe { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: grid; place-items: center; background: #000; clip-path: circle(0% at 50% 50%); }
.wipe svg { width: 180px; height: 180px; fill: none; stroke: var(--w); stroke-width: 1.5; }
.wipe .w-dot { fill: var(--e); stroke: none; }
.wipe.is-in { clip-path: circle(75% at 50% 50%); transition: clip-path .42s cubic-bezier(.7,0,.3,1); }
.wipe.is-out { clip-path: circle(0% at 50% 50%); transition: clip-path .42s cubic-bezier(.7,0,.3,1); }

/* ───────── unattended modes ───────── */
body[data-screen="poster"] #hud, body[data-screen="logo"] #hud { display: none; }
body[data-screen="attract"] .plate, body[data-screen="attract"] .scorebox, body[data-screen="attract"] .keys, body[data-screen="attract"] .taps { display: none; }
body[data-screen="logo"] .title { background: none; padding: 0; justify-content: center; }
body[data-screen="logo"] .title > :not(.logo) { display: none; }
body[data-screen="logo"] .logo-disc { animation: none; }

/* ───────── portrait / narrow ───────── */
@media (max-aspect-ratio: 1/1) {
  .logo { font-size: clamp(9px, 2.5vw, 19px); }
  .title { padding-top: max(8vh, 30px); }
  .placards { flex-direction: column; width: min(460px, 94vw); }
  .placard { width: 100%; grid-template-columns: auto auto 1fr auto; grid-template-areas: "n g t b" "n g m b"; align-items: center; gap: 2px 14px; padding: 12px 16px; }
  .placard + .placard { border-left: 0; border-top: 1px solid var(--g2); }
  .placard .pn { grid-area: n; } .placard .pg { grid-area: g; width: 54px; margin: 0; }
  .placard h3 { grid-area: t; align-self: end; } .placard .meta { grid-area: m; align-self: start; } .placard .meta span { display: none; }
  .placard .best { grid-area: b; margin: 0; }
  .res { grid-template-columns: 1fr; grid-template-areas: "head" "seal" "stats" "menu"; gap: 16px; justify-items: center; text-align: center; }
  .res-head { justify-content: center; width: 100%; } .res-row { justify-content: center; } .res-score { justify-content: center; }
  .res-menu { justify-content: center; width: 100%; }
  .seal { width: clamp(120px, 30vw, 200px); } .seal b { font-size: clamp(90px, 22vw, 150px); }
}
@media (max-width: 520px) {
  .plate-glyph { width: 36px; height: 36px; font-size: 18px; } .plate-text b { font-size: 19px; } .plate-text span { font-size: 8.5px; letter-spacing: .2em; }
  .scorebox .digits { font-size: 36px; } .songbar { width: 110px; }
  .settings button { padding: 9px 12px; letter-spacing: .16em; font-size: 10.5px; }
  .prompt { letter-spacing: .2em; font-size: 12px; gap: 10px; }
  .tagline { letter-spacing: .2em; font-size: 9.5px; gap: 8px; }
  .diffs button { padding: 8px 12px; font-size: 10.5px; letter-spacing: .16em; }
  .counts li { padding: 8px 8px; } .counts b { font-size: 24px; } .counts label { letter-spacing: .14em; font-size: 9px; }
  .res-row b { font-size: 28px; } .res-score b { font-size: 60px; }
  .fever-banner { top: 76px; font-size: 12px; }
  .menu button { letter-spacing: .14em; }
}
