:root {
  --bg: #121226;
  --bg2: #1c1c3a;
  --accent: #ff5fa2;
  --accent2: #5f9fff;
  --text: #f4f4fb;
  --muted: #9a9ac0;
  --ok: #4fd68c;
  --ko: #ff6b6b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: radial-gradient(circle at top, var(--bg2), var(--bg));
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
}

h1 {
  font-size: 1.6rem;
  margin: 8px 0 20px;
  text-align: center;
}

h1 span { color: var(--accent); }

.card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 20px;
  width: 100%;
  max-width: 480px;
  margin-bottom: 16px;
}

input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 10px;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 1rem;
  font-weight: 600;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: white;
  width: 100%;
  margin-bottom: 8px;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; }

button.secondary {
  background: rgba(255,255,255,0.1);
}

.timer {
  font-size: 2.5rem;
  font-weight: 800;
  text-align: center;
  margin: 12px 0;
}

.timer.urgent { color: var(--ko); }

.leaderboard { list-style: none; padding: 0; margin: 0; }
.leaderboard li {
  display: flex;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: rgba(255,255,255,0.04);
}
.leaderboard li:first-child {
  background: linear-gradient(90deg, rgba(255,95,162,0.25), transparent);
  font-weight: 700;
}

.badge-ok { color: var(--ok); font-weight: 700; }
.badge-ko { color: var(--ko); font-weight: 700; }

.qcm-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  margin: 4px 0 12px;
  cursor: pointer;
}
.qcm-toggle input { width: auto; margin: 0; }

.answer-choice {
  display: block;
  width: 100%;
  text-align: left;
  background: rgba(255,255,255,0.08);
  margin-bottom: 8px;
  padding: 14px 16px;
  font-weight: 500;
}
.answer-choice.selected {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}
.answer-choice.correct {
  background: rgba(79, 214, 140, 0.25);
  border: 1px solid var(--ok);
}
.answer-choice.wrong {
  background: rgba(255, 107, 107, 0.2);
  border: 1px solid var(--ko);
}
.answer-choice:disabled { opacity: 1; cursor: default; }

.mode-tabs {
  display: flex;
  gap: 8px;
}
.mode-tabs button {
  margin: 0;
  background: rgba(255,255,255,0.08);
}
.mode-tabs button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.theme-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.theme-tabs button {
  width: auto;
  margin: 0;
  padding: 8px 14px;
  font-size: 0.9rem;
  background: rgba(255,255,255,0.08);
}
.theme-tabs button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
}

.song-group-title {
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 12px 0 6px;
}
.song-group-title:first-child { margin-top: 0; }

.song-list { max-height: 280px; overflow-y: auto; }
.song-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  margin-bottom: 4px;
  background: rgba(255,255,255,0.04);
}
.song-row.played { opacity: 0.4; }
.song-row button { width: auto; margin: 0; padding: 8px 12px; }

.status-msg {
  text-align: center;
  color: var(--muted);
  margin: 6px 0 14px;
}

.sub-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sub-row .toggle { width: auto; padding: 4px 8px; font-size: 0.8rem; }
