:root {
  --bg: #0e0e12;
  --fg: #f4f4f6;
  --muted: #7a7a88;
  --accent: #ffcc33;
  --panel: #1a1a22;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--panel);
}
.topbar form { margin-left: auto; }
.brand { font-weight: 700; text-decoration: none; }
.back { font-size: 1.5rem; text-decoration: none; line-height: 1; }
.song-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

button.link {
  background: none;
  border: 0;
  color: var(--muted);
  font: inherit;
  padding: 8px;
}

/* Song list */
.song-list, .login { padding: 16px; max-width: 640px; margin: 0 auto; }
.song-list ul { list-style: none; padding: 0; margin: 0; }
.song-list li a {
  display: block;
  padding: 18px 16px;
  margin-bottom: 8px;
  background: var(--panel);
  border-radius: 12px;
  color: var(--fg);
  text-decoration: none;
  font-size: 1.15rem;
}
.song-list .empty { color: var(--muted); }

/* Login */
.login form { display: grid; gap: 16px; }
.login label { display: grid; gap: 6px; color: var(--muted); }
.login input {
  font-size: 1.1rem;
  padding: 12px;
  border-radius: 10px;
  border: 1px solid #333;
  background: var(--panel);
  color: var(--fg);
}
.error { color: #ff6b6b; }

/* Player */
.player-page { display: flex; flex-direction: column; height: 100dvh; }
#player { flex: 1; display: flex; flex-direction: column; min-height: 0; }

.lyrics-viewport {
  position: relative;
  flex: 1;
  overflow: hidden;
  mask-image: linear-gradient(to bottom, transparent 0, #000 12%, #000 85%, transparent 100%);
}

.lyrics {
  position: relative;
  padding: 0 20px;
  text-align: center;
  will-change: transform;
}

.line {
  padding: 14px 0;
  font-size: clamp(1.4rem, 6vw, 2.2rem);
  font-weight: 700;
  line-height: 1.25;
  white-space: pre-line;
  color: var(--muted);
  transition: color 0.25s, opacity 0.25s, transform 0.25s;
}
.line.current { color: var(--accent); transform: scale(1.04); }
.line.past { opacity: 0.35; }

.controls {
  padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
  background: var(--panel);
}

.scrub {
  display: flex;
  align-items: center;
  gap: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.9rem;
}
.scrub input { flex: 1; accent-color: var(--accent); }

button.play {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 18px;
  font-size: 1.3rem;
  font-weight: 700;
  border: 0;
  border-radius: 14px;
  background: var(--accent);
  color: #111;
}
button.play:disabled { opacity: 0.5; }
