:root {
  --bg: #0b0e1a;
  --panel: #151a2e;
  --accent: #6ad7ff;
  --accent2: #ff5fb0;
  --good: #58e08a;
  --text: #e8ecff;
  --muted: #8a92b2;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  min-height: 100vh;
}

a { color: var(--accent); }

.wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 16px;
}

h1 { font-size: 1.6rem; margin: 0 0 4px; }
h2 { font-size: 1.1rem; color: var(--muted); font-weight: 500; margin-top: 0; }

.card {
  background: var(--panel);
  border: 1px solid #222a44;
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0;
}

button {
  font: inherit;
  font-weight: 600;
  color: #04121a;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  padding: 14px 22px;
  cursor: pointer;
}
button.secondary { background: #2a3355; color: var(--text); }
button:disabled { opacity: 0.5; cursor: default; }

input[type="text"] {
  font: inherit;
  width: 100%;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #2a3355;
  background: #0e1322;
  color: var(--text);
  margin: 8px 0 16px;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.muted { color: var(--muted); }
.big { font-size: 3rem; font-weight: 800; letter-spacing: 0.02em; }
.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #0e1322;
  border: 1px solid #2a3355;
  font-size: 0.85rem;
}

/* Host */
.hud { display: flex; justify-content: space-between; align-items: baseline; }
canvas {
  width: 100%;
  display: block;
  background: #070a14;
  border-radius: 16px;
}
.players { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.player-chip {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel);
  border-left: 6px solid var(--accent);
}
.player-chip .score { font-size: 1.4rem; font-weight: 800; }

.meter {
  height: 220px;
  border-radius: 16px;
  background: #070a14;
  position: relative;
  overflow: hidden;
}

/* Phone: countdown + lyrics */
.countdown {
  text-align: center;
  font-size: 6rem;
  font-weight: 800;
  color: var(--accent);
  margin: 10px 0 0;
  line-height: 1.1;
}
.countdown[hidden], #lyrics[hidden] { display: none; }
#lyrics { margin: 14px 0 6px; }
.lyric-line {
  text-align: center;
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.3;
  min-height: 2.4em;
}
.lyric-line .active { color: var(--accent); }
.lyric-line .sung { color: var(--muted); }
.lyric-next { text-align: center; color: var(--muted); font-size: 1.1rem; margin-top: 8px; min-height: 1.3em; }

/* Results overlay */
.results-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 15, 0.82);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}
.results-overlay[hidden] { display: none; }
.results-card {
  background: var(--panel);
  border: 1px solid #2a3355;
  border-radius: 20px;
  padding: 28px;
  width: min(640px, 100%);
  max-height: 90vh;
  overflow: auto;
  animation: pop 0.25s ease-out;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.results-card h1 { text-align: center; font-size: 2rem; }
.results-list { list-style: none; margin: 16px 0 0; padding: 0; }
.results-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: #0e1322;
  margin-bottom: 10px;
  border-left: 6px solid var(--accent);
}
.results-row.winner {
  background: linear-gradient(90deg, rgba(255,209,102,0.18), #0e1322);
  border-left-color: var(--accent2);
}
.results-rank { font-size: 1.5rem; width: 2.2rem; text-align: center; }
.results-info { flex: 1; min-width: 0; }
.results-name { font-weight: 700; font-size: 1.1rem; }
.results-stars { color: var(--accent2); letter-spacing: 2px; }
.results-rating { color: var(--muted); font-size: 0.85rem; }
.results-bar { height: 8px; border-radius: 999px; background: #1b2240; margin-top: 8px; overflow: hidden; }
.results-bar > span { display: block; height: 100%; background: var(--accent); }
.results-score { font-size: 1.6rem; font-weight: 800; min-width: 4.5rem; text-align: right; }
