:root {
  --bg: #0e0b1a;
  --fg: #f4eefb;
  --muted: #998fb2;
  --accent: #ff5f9e;
  --accent-2: #6dd3ff;
  --card: #1b1530;
  --card-2: #251c40;
  --border: #322a55;
  --good: #5be39c;
  --bad: #ff6b6b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #1b1530, #0e0b1a);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-weight: 800; letter-spacing: 0.5px; font-size: 20px; color: var(--accent); }
main { max-width: 920px; margin: 32px auto; padding: 0 20px; }
h1, h2, h3 { margin-top: 0; }
input[type=text], input[type=url], textarea {
  width: 100%; padding: 10px 12px; font: inherit;
  background: var(--card); color: var(--fg);
  border: 1px solid var(--border); border-radius: 8px;
}
textarea { min-height: 220px; resize: vertical; }
button, .btn {
  display: inline-block; padding: 10px 16px; font: inherit; font-weight: 600;
  background: var(--accent); color: #1a0a17; border: 0; border-radius: 8px;
  cursor: pointer; transition: transform .05s ease;
}
button:hover, .btn:hover { filter: brightness(1.08); text-decoration: none; }
button:active { transform: translateY(1px); }
button.secondary, .btn.secondary { background: var(--card-2); color: var(--fg); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; margin-bottom: 16px;
}
.muted { color: var(--muted); }
.messages { list-style: none; padding: 0; }
.msg { padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; }
.msg.error { background: #3a1418; color: #ffb4b4; }
.msg.success { background: #143a25; color: #b4ffcd; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > * { flex: 0 0 auto; }
.row.spread { justify-content: space-between; }
.grow { flex: 1 1 auto; }
.parody-list { list-style: none; padding: 0; }
.parody-list li {
  padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--card); margin-bottom: 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.parody-list .title { font-weight: 600; }
.parody-list .sub { color: var(--muted); font-size: 13px; }
.progress { background: var(--card-2); border-radius: 999px; overflow: hidden;
  height: 8px; }
.progress > div { height: 100%; background: var(--accent-2); transition: width .3s ease; }
.status-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; background: var(--card-2); color: var(--muted);
}
.status-pill.ready { background: #143a25; color: var(--good); }
.status-pill.failed { background: #3a1418; color: var(--bad); }

/* lyric editor + player */
.lyric-list { list-style: none; padding: 0; margin: 0; }
.lyric-list li {
  display: grid; grid-template-columns: 80px 80px 1fr 36px;
  align-items: center; gap: 10px;
  padding: 8px 10px; border-bottom: 1px solid var(--border);
}
.lyric-list li.active { background: rgba(255, 95, 158, 0.16); }
.lyric-list li.timed .text { color: var(--fg); }
.lyric-list li:not(.timed) .text { color: var(--muted); }
.lyric-list .text { padding: 4px 0; outline: none; }
.lyric-list .text[contenteditable=true]:focus { background: var(--card-2); border-radius: 4px; }
.lyric-list input.time { background: var(--card-2); border: 1px solid var(--border);
  color: var(--fg); padding: 4px 6px; border-radius: 6px; font: inherit; width: 100%; }
.lyric-list .del { background: transparent; color: var(--muted); padding: 2px 8px; font-size: 18px; }
.tap-pad {
  position: sticky; bottom: 0; background: rgba(14, 11, 26, 0.94);
  padding: 16px 0; border-top: 1px solid var(--border);
  display: flex; gap: 12px; align-items: center;
}
.tap-pad .big-tap {
  flex: 1 1 auto; padding: 28px; font-size: 24px; font-weight: 800;
}
.tap-pad .upcoming { color: var(--accent-2); font-size: 18px; font-weight: 600; }

/* karaoke playback view */
.stage {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 60vh; text-align: center; gap: 12px;
}
.stage .now {
  font-size: clamp(28px, 8vw, 72px); font-weight: 800;
  line-height: 1.15; max-width: 92vw;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stage .next {
  font-size: clamp(16px, 3.5vw, 22px); color: var(--muted); max-width: 92vw;
}
.qr-block { text-align: center; }
.qr-block img { background: white; padding: 8px; border-radius: 12px; max-width: 220px; }
.role-toggle { display: flex; gap: 8px; }
.role-toggle button { background: var(--card-2); color: var(--fg); }
.role-toggle button.active { background: var(--accent); color: #1a0a17; }
.sync-stats { font-size: 12px; color: var(--muted); font-family: ui-monospace, monospace; }
.session-controls { display: flex; gap: 12px; flex-wrap: wrap; }
.session-controls button { padding: 14px 22px; font-size: 18px; }
.stage .now .diff { color: var(--accent); }              /* word diff */
.stage .now .w    { opacity: 0.45; transition: opacity .12s ease, color .12s ease; }
.stage .now .w.on { opacity: 1; color: var(--accent); }  /* per-word highlight */
