:root {
  --bg: #111;
  --fg: #eee;
  --dim: #888;
  --accent: #ffd54f;
  --chord: #4fc3f7;
  --active-bg: #263238;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 18px;
  min-height: 100dvh;
}
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #222;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
header h1 { font-size: 1.1rem; margin: 0; }
header button {
  background: none; border: 1px solid #444; color: var(--fg);
  border-radius: 6px; padding: 0.3rem 0.6rem; font-size: 1rem;
}

#setup {
  padding: 1rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  border-bottom: 1px solid #222;
}
#setup.hidden { display: none; }
#setup label { display: flex; flex-direction: column; font-size: 0.85rem; color: var(--dim); gap: 0.25rem; }
#setup input, #setup textarea {
  background: #1b1b1b; border: 1px solid #333; color: var(--fg);
  padding: 0.5rem; border-radius: 6px; font-size: 1rem; font-family: inherit;
  width: 100%;
}
#setup textarea { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.85rem; white-space: pre; }
#setup .row { display: flex; gap: 0.5rem; }
#setup .row label { flex: 1; }
#loadBtn {
  padding: 0.7rem; font-size: 1rem; background: var(--accent); color: #111;
  border: none; border-radius: 6px; font-weight: 600;
}
.status { margin: 0; color: var(--dim); font-size: 0.9rem; min-height: 1.2em; }
.status.error { color: #ff6b6b; }

#player-wrap {
  position: sticky; top: 3rem; background: var(--bg); z-index: 5;
  border-bottom: 1px solid #222;
}
#player { aspect-ratio: 16 / 9; width: 100%; }
#player iframe { width: 100%; height: 100%; display: block; }

#offset-bar {
  display: flex; gap: 0.3rem; align-items: center;
  padding: 0.4rem 0.75rem;
  border-bottom: 1px solid #222;
  font-size: 0.85rem;
  flex-wrap: wrap;
}
#offset-bar .label { color: var(--dim); margin-right: 0.3rem; }
#offset-bar button {
  background: #1b1b1b; border: 1px solid #333; color: var(--fg);
  border-radius: 4px; padding: 0.3rem 0.5rem; font-size: 0.85rem;
}
#offsetVal { min-width: 4em; text-align: center; color: var(--accent); }

#lyrics {
  padding: 40vh 1rem;
  font-size: 1.2rem;
  line-height: 1.6;
}
.line {
  padding: 0.3rem 0.5rem;
  margin: 0.2rem 0;
  border-radius: 6px;
  transition: background 0.1s;
}
.line.active {
  background: var(--active-bg);
  color: #fff;
}
.line.past { color: var(--dim); }
.line .chords {
  display: block;
  color: var(--chord);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: pre;
  margin-bottom: 0.1rem;
}
.line .text { display: block; }
.section-hdr {
  color: var(--accent);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 1rem 0 0.3rem;
}
