:root {
  --bg: #16121f;
  --card: #231c31;
  --line: #3a2f50;
  --text: #f4f0fa;
  --muted: #a99cbf;
  --accent: #ff3d7f;
  --accent2: #7c5cff;
  --ok: #2ec27e;
  --bad: #e5484d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
body { padding: env(safe-area-inset-top) 16px calc(24px + env(safe-area-inset-bottom)); -webkit-tap-highlight-color: transparent; }
main { max-width: 720px; margin: 0 auto; }
main.narrow { max-width: 460px; }
h1, h2 { margin: 0 0 .6em; }
h2 { font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
a { color: var(--accent); word-break: break-all; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.error { color: #ff8a8f; min-height: 1em; }

.logo { font-size: 2.6rem; font-weight: 900; text-align: center; margin: 1.2em 0 .1em; letter-spacing: -.02em; }
.logo span { color: var(--accent); }
.logo.small { font-size: 1.2rem; margin: 0; }
.bar { display: flex; align-items: center; gap: 12px; padding: 14px 0; }
.bar .logo { flex: 1; text-align: left; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bad); }
.dot.on { background: var(--ok); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; margin: 14px 0; }
form, label { display: flex; flex-direction: column; gap: 10px; }
label { margin-bottom: 12px; color: var(--muted); font-size: .9rem; }
input, select {
  font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line);
  border-radius: 12px; padding: 12px 14px; width: 100%;
}
#code { text-transform: uppercase; text-align: center; font-size: 1.6rem; letter-spacing: .3em; font-weight: 800; }

button, .btn {
  font: inherit; font-weight: 700; color: var(--text); background: var(--line); border: 0; border-radius: 12px;
  padding: 11px 16px; cursor: pointer; text-decoration: none; display: inline-block; text-align: center;
}
button:disabled { opacity: .4; cursor: not-allowed; }
.big { display: block; width: 100%; padding: 16px; font-size: 1.15rem; background: var(--accent); margin: 10px 0; }
.big.alt { background: var(--accent2); }
.big small { opacity: .8; }
.ghost { display: block; width: 100%; background: transparent; color: var(--muted); margin-top: 8px; }
.row { display: flex; gap: 10px; align-items: center; }
.row select { flex: 1; }
.row.wrap { flex-wrap: wrap; justify-content: center; margin-top: 12px; }

.code { font-size: 4rem; font-weight: 900; letter-spacing: .15em; color: var(--accent); }

.scores { list-style: none; margin: 0; padding: 0; }
.scores li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.scores li:last-child { border: 0; }
.scores li.me .pname { color: var(--accent); }
.scores li.offline { opacity: .45; }
.pname { flex: 1; font-weight: 700; }
.ptag { color: var(--muted); font-size: .8rem; }
.pscore { font-weight: 900; font-size: 1.2rem; min-width: 3.5em; text-align: right; }
.pscore small { color: var(--muted); font-weight: 400; font-size: .7rem; }
.x { background: transparent; color: var(--muted); padding: 4px 8px; }

.track { display: flex; gap: 14px; align-items: center; text-align: left; background: var(--bg); border-radius: 14px; padding: 10px; margin-top: 12px; }
.track img, .noimg { width: 84px; height: 84px; border-radius: 10px; object-fit: cover; flex: none; }
.noimg { display: grid; place-items: center; background: var(--line); font-size: 2rem; }
.tname { font-weight: 800; font-size: 1.15rem; }
.tartist { color: var(--muted); }
.towners { font-size: .8rem; color: var(--accent2); margin-top: 4px; filter: brightness(1.4); }

.who { font-size: 2.2rem; font-weight: 900; color: var(--accent); }
.buzzed { border-color: var(--accent); box-shadow: 0 0 40px #ff3d7f44; }
.win { border-color: gold; }
.trophy { font-size: 4rem; }
.pulse { font-size: 4rem; animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.2); opacity: .6; } }

.judge { display: grid; gap: 4px; }
.big.bad { background: var(--bad); }
.big.ok { background: #1f8f5c; }
.big.ok2 { background: var(--ok); }

.buzzer {
  display: block; width: min(78vw, 340px); aspect-ratio: 1; margin: 24px auto; border-radius: 50%;
  font-size: 2.6rem; font-weight: 900; background: radial-gradient(circle at 35% 30%, #ff7aa8, var(--accent) 55%, #b3134c);
  box-shadow: 0 12px 0 #7d0d35, 0 20px 40px #0008; user-select: none; touch-action: manipulation;
  transition: transform .05s, box-shadow .05s;
}
.buzzer:active, .buzzer.pressed { transform: translateY(10px); box-shadow: 0 2px 0 #7d0d35, 0 8px 20px #0008; }
.buzzer:disabled { background: var(--line); box-shadow: none; font-size: 1.4rem; opacity: .7; }
.logo i { font-style: normal; font-weight: 500; color: var(--muted); font-size: .7em; }
