:root {
  --bg: #0a0a0a;
  --fg: #e8e8e8;
  --accent: #d4a017;
  --accent-hover: #e8b420;
  --muted: #777;
  --card: #141414;
  --border: #2a2a2a;
  --radius: 12px;
  --dock-h: 88px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px var(--dock-h);
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: baseline; gap: 10px; }
.logo { font-weight: 700; letter-spacing: 0.06em; color: var(--accent); }
.ver { font-size: 12px; color: var(--muted); }

.btn-ghost {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}
.btn-ghost:hover { color: var(--fg); border-color: var(--fg); }

/* Stage */
.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 28px;
  text-align: center;
}

.title {
  font-size: clamp(1.9rem, 7vw, 3rem);
  font-weight: 300;
  margin-bottom: 6px;
}
.title .accent { color: var(--accent); font-weight: 600; }

.subtitle {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}

/* Voices */
.voices-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--muted);
}

.voices-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.btn-circle {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 20px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.btn-circle:hover { border-color: var(--accent); color: var(--accent); }

.voice-count {
  font-size: 26px;
  font-weight: 600;
  min-width: 36px;
  color: var(--fg);
}

.voice-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  min-height: 28px;
}

.pill {
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  list-style: none;
}
.pill.active { border-color: var(--accent); color: var(--accent); }

/* Modes */
.modes {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

.mode {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}
.mode.active {
  background: var(--accent);
  color: #111;
  border-color: var(--accent);
  font-weight: 600;
}
.mode:hover:not(.active) { border-color: var(--muted); color: var(--fg); }

/* Lyrics */
.lyrics {
  width: 100%;
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  padding: 18px 16px;
  background: var(--card);
  border-radius: var(--radius);
  margin-bottom: 18px;
  text-align: left;
  scroll-behavior: smooth;
}

.line {
  padding: 7px 0;
  font-size: 17px;
  color: var(--muted);
  transition: color 0.18s, transform 0.18s;
}
.line.active {
  color: var(--fg);
  font-weight: 600;
  transform: translateX(4px);
}
.line.past { color: #3a3a3a; }
.line.placeholder {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 15px;
}

/* Progress */
.progress-block { width: 100%; margin-bottom: 12px; }

.progress-track {
  height: 4px;
  background: #222;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 6px;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.1s linear;
}

.time-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

/* Dock */
.dock {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(to top, #0a0a0a 60%, transparent);
  max-width: 640px;
  margin: 0 auto;
}

.btn-play {
  width: 56px; height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #111;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.btn-play:hover { background: var(--accent-hover); }

.btn-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  font-size: 18px;
  cursor: pointer;
}
.btn-icon:hover { border-color: var(--accent); }

.btn-clap {
  padding: 10px 18px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #111;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}
.btn-clap:hover { background: var(--accent-hover); }

.btn-start {
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.btn-start:hover { background: var(--accent); color: #111; }

/* Playing state */
body.is-playing .btn-play { font-size: 0; }
body.is-playing .btn-play::before { content: "⏸"; font-size: 22px; }

/* Dialog */
.dialog {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: grid;
  place-items: center;
  z-index: 100;
  padding: 20px;
}
.dialog[hidden] { display: none; }

.dialog-content {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 360px;
  width: 100%;
  text-align: left;
}
.dialog-content h2 { margin-bottom: 14px; font-size: 1.2rem; }
.dialog-content ul { margin: 0 0 16px 18px; color: var(--muted); }
.dialog-content li { margin-bottom: 6px; }
.dialog-content kbd {
  background: #222;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: var(--fg);
}
.dialog-content p { font-size: 14px; color: var(--muted); margin-bottom: 18px; }

/* Focus visible */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus:not(:focus-visible) { outline: none; }
