:root {
  --bg: #0e0b12;
  --panel: #1a1520;
  --panel-2: #251e2d;
  --line: #352c3f;
  --text: #f6f1f7;
  --muted: #a99db2;
  --accent: #ffc53d;
  --accent-ink: #1c1400;
  --mine: #3b2d0e;
  --danger: #ff8080;
  color-scheme: dark;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
h1, h2, p { margin: 0; }
h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 10px;
}
button, input { font: inherit; color: inherit; }
button {
  border: 1px solid var(--line);
  background: var(--panel-2);
  border-radius: 8px;
  padding: 8px 14px;
  cursor: pointer;
  min-height: 40px;
}
button:hover:not(:disabled) { border-color: var(--muted); }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 650; }
.time { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 10px;
  min-width: 0;
}
.row.mine { background: var(--mine); }
.row img { width: 64px; height: 36px; border-radius: 4px; object-fit: cover; flex: none; background: var(--panel-2); }
.row .info { flex: 1; min-width: 0; }
.row .title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.row .sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--muted); }
.row .when { flex: none; text-align: right; font-weight: 650; }
.empty { color: var(--muted); padding: 12px 8px; }

/* Lyrics */
.lyrics { display: grid; gap: 4px; }
.lyrics[hidden] { display: none; }
.lyrics p { min-height: 1.3em; line-height: 1.3; }
.lyric-prev, .lyric-next { color: var(--muted); font-size: clamp(14px, 1.4vw, 22px); }
.lyric-now { color: var(--accent); font-weight: 700; font-size: clamp(22px, 2.6vw, 40px); }
.lyrics.compact { margin-top: 10px; }
.lyrics.compact .lyric-prev { display: none; }
.lyrics.compact .lyric-now { font-size: 18px; }
.lyrics.compact .lyric-next { font-size: 14px; }

/* Host screen */
.host {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
  gap: 24px;
  padding: 24px;
  min-height: 100vh;
}
.stage { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.player-slot {
  aspect-ratio: 16 / 9;
  width: 100%;
  background: var(--panel);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  text-align: center;
}
.player-slot:has(iframe) { padding: 0; }
.player-slot iframe { width: 100%; height: 100%; border: 0; display: block; }
.start-title { font-size: clamp(28px, 4vw, 48px); font-weight: 750; }
.start-form { width: min(460px, 100%); text-align: left; }
.start-form label { display: block; font-size: 13px; margin-bottom: 6px; }
.start-form input { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
.now-title { font-size: clamp(22px, 2.6vw, 36px); font-weight: 720; line-height: 1.15; }
.now-line { display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.now-next { text-align: right; flex: none; }
.now-next .time { font-size: 30px; font-weight: 720; color: var(--accent); }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
.side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.join { display: flex; gap: 16px; align-items: center; background: var(--panel); border-radius: 12px; padding: 16px; }
.join img { width: 150px; height: 150px; background: #fff; border-radius: 8px; padding: 6px; flex: none; }
.join strong { display: block; font-size: 22px; line-height: 1.2; margin-bottom: 6px; }
.join .url { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.queue { background: var(--panel); border-radius: 12px; padding: 16px; flex: 1; overflow: auto; }
.remove { min-height: 32px; padding: 2px 10px; font-size: 13px; }
.warn { color: var(--danger); }
@media (max-width: 860px) {
  .host { grid-template-columns: minmax(0, 1fr); padding: 16px; }
}

/* Guest page */
.guest { max-width: 560px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 18px; }
.guest input { font-size: 16px; width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 44px; }
.guest h1 { font-size: 22px; font-weight: 750; }
.field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.search { display: flex; gap: 8px; }
.search input { flex: 1; min-width: 0; }
.card { background: var(--panel); border-radius: 12px; padding: 12px; }
.card .big { font-size: 18px; font-weight: 700; line-height: 1.2; }
.status { min-height: 20px; font-size: 14px; }
.status.good { color: var(--accent); font-weight: 600; }
.status.bad { color: var(--danger); }
