/* Bangrr look: black canvas, lime neon, Archivo Black headings, Roboto Mono text. Phone first. */
:root {
  --bg: #000;
  --sheet: #191919;
  --glass: rgba(255, 255, 255, 0.05);
  --hair: rgba(255, 255, 255, 0.1);
  --fg: #dce3dc;
  --muted: #a3a3a3;
  --lime: hsl(123 100% 61%);
  --purple: hsl(266 100% 67%);
  --pink: hsl(330 100% 70%);
  --blue: hsl(197 100% 61%);
  --yellow: hsl(49 89% 63%);
  --bronze: #d08a3e;
  --display: 'Archivo Black', 'Arial Black', sans-serif;
  --mono: 'Roboto Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 14px/1.45 var(--mono); }
body { padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
#app { max-width: 480px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; text-align: left; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.logo { font: 28px var(--display); color: var(--lime); letter-spacing: 0.02em; }
.h { font: 26px/1.05 var(--display); color: #fff; margin: 0; text-wrap: balance; }
.sub { color: var(--muted); font-size: 13px; display: block; }
.label { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 6px 0 0; }
.center { text-align: center; }
.back { color: var(--muted); }
.link { color: var(--muted); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.stack { display: grid; gap: 10px; }
.card { display: flex; gap: 12px; align-items: center; width: 100%; background: var(--glass); border: 1px solid var(--hair); border-radius: 12px; padding: 10px; }
.card img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.card > span { min-width: 0; }
.card b { color: #fff; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ic { width: 48px; height: 48px; border-radius: 12px; flex: none; display: grid; place-items: center; font: 18px var(--display); color: #000; }
.chips { display: flex; gap: 6px; margin-top: 4px; }
.chip { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; border: 1px solid var(--hair); border-radius: 12px; padding: 2px 7px; color: var(--muted); }
.btn { display: block; width: 100%; text-align: center; background: var(--lime); color: #000; font: 16px var(--display); letter-spacing: 0.02em; border-radius: 10px; padding: 14px; }
.btn.ghost { background: transparent; color: #fff; border: 1px solid var(--hair); }
.row { display: flex; gap: 10px; }
.row .btn { flex: 1; }
.win { color: var(--lime) !important; }
.lose { color: var(--pink) !important; }

/* The round screen */
#round { position: fixed; inset: 0; z-index: 5; background: var(--bg); overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); }
#round > * { width: 100%; max-width: 480px; margin: 0 auto; }
#round .bgimg { position: fixed; inset: 0; max-width: none; background-size: cover; background-position: center; filter: blur(40px) brightness(0.3); transform: scale(1.2); z-index: -1; }
.songbar { display: flex; gap: 10px; align-items: center; }
.songbar img { width: 44px; height: 44px; border-radius: 8px; }
.songbar b { color: #fff; display: block; }
.stage { flex: 1; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.grade { font: 44px/1 var(--display); text-align: center; }
.pad, .ring { align-self: center; width: min(64vw, 260px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; text-align: center; font: 18px/1.1 var(--display); color: #fff; touch-action: manipulation; user-select: none; -webkit-user-select: none; }
.pad { border: 3px solid var(--lime); background: radial-gradient(circle, hsl(123 100% 61% / 0.18), transparent 70%); }
.pad.spin { animation: breathe 1.4s ease-in-out infinite; }
.pad.hit { background: var(--lime); color: #000; }
.ring { border: 3px solid var(--blue); background: radial-gradient(circle, hsl(197 100% 61% / 0.15), transparent 70%); }
.ring b { font: 28px var(--display); }
.ring.beat { animation: beat 0.25s ease-out; }
.ring.tap { animation: tap 0.18s ease-out; }
@keyframes breathe { 50% { transform: scale(0.96); } }
@keyframes beat { from { box-shadow: 0 0 0 10px hsl(197 100% 61% / 0.5); } }
@keyframes tap { from { transform: scale(0.94); background: hsl(197 100% 61% / 0.4); } }
.dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.dots i { width: 12px; height: 12px; border-radius: 50%; background: var(--hair); }
.hud { display: flex; justify-content: space-between; font: 16px var(--display); color: #fff; }
canvas.lanes { width: 100%; height: min(62vh, 520px); border-radius: 10px; touch-action: none; }
.wave { display: flex; gap: 4px; align-items: center; justify-content: center; height: 64px; }
.wave i { width: 6px; height: 12px; border-radius: 3px; background: var(--purple); }
.wave.playing i { animation: bar 0.5s ease-in-out infinite alternate; }
.wave i:nth-child(3n) { animation-delay: -0.2s; } .wave i:nth-child(3n + 1) { animation-delay: -0.35s; }
@keyframes bar { to { height: 56px; } }
.timer { height: 6px; border-radius: 3px; background: var(--hair); overflow: hidden; }
.timer i { display: block; height: 100%; width: 100%; background: var(--pink); }
.timer i.run { width: 0; transition: width 5s linear; }
.options { display: grid; gap: 10px; }
.duel { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.duel .card { flex-direction: column; align-items: stretch; text-align: center; gap: 6px; }
.duel .card img { width: 100%; height: auto; aspect-ratio: 1; }
.rank { font: 26px var(--display); color: #fff; }
.option.right { border-color: var(--lime); background: hsl(123 100% 61% / 0.12); }
.option.wrong { border-color: var(--pink); background: hsl(330 100% 70% / 0.12); }

/* Fight */
.vs { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; background: var(--glass); border: 1px solid var(--hair); border-radius: 12px; padding: 10px; }
.vs > div { min-width: 0; display: grid; }
.vs b { color: #fff; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vs .right { text-align: right; }
.p { font: 20px var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.mult { font-size: 11px; color: var(--muted); }

dialog { background: var(--sheet); color: var(--fg); border: 1px solid var(--hair); border-radius: 24px; max-width: 420px; padding: 20px; }
dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
input[type='range'] { width: 100%; accent-color: var(--lime); }
[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { .pad.spin, .wave.playing i { animation: none; } }
