/* style.css — all styling */
:root {
  --bg: #0c1020;
  --bg2: #141a32;
  --surface: rgba(255,255,255,0.04);
  --surface-strong: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.10);
  --text: #eef2ff;
  --muted: #9aa4c7;
  --accent: #7c5cff;
  --accent2: #34d399;
  --good: #34d399;
  --bad: #fb7185;
  --shadow: 0 18px 50px -20px rgba(0,0,0,0.6);
  color-scheme: dark;
}

html[data-theme="dark"] {
  --bg: #0c1020;
  --bg2: #141a32;
  --surface: rgba(255,255,255,0.04);
  --surface-strong: rgba(255,255,255,0.07);
  --border: rgba(255,255,255,0.10);
  --text: #eef2ff;
  --muted: #9aa4c7;
  color-scheme: dark;
}

html[data-theme="light"] {
  --bg: #eef1fb;
  --bg2: #ffffff;
  --surface: rgba(20,26,50,0.04);
  --surface-strong: rgba(20,26,50,0.06);
  --border: rgba(20,26,50,0.12);
  --text: #1a1f3a;
  --muted: #5a6488;
  color-scheme: light;
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #eef1fb;
    --bg2: #ffffff;
    --surface: rgba(20,26,50,0.04);
    --surface-strong: rgba(20,26,50,0.06);
    --border: rgba(20,26,50,0.12);
    --text: #1a1f3a;
    --muted: #5a6488;
    color-scheme: light;
  }
  html[data-theme="dark"] {
    --bg: #0c1020;
    --bg2: #141a32;
    --surface: rgba(255,255,255,0.04);
    --surface-strong: rgba(255,255,255,0.07);
    --border: rgba(255,255,255,0.10);
    --text: #eef2ff;
    --muted: #9aa4c7;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 80% -10%, rgba(124,92,255,0.22), transparent 60%),
              radial-gradient(900px 600px at -10% 110%, rgba(52,211,153,0.14), transparent 60%),
              linear-gradient(180deg, var(--bg), var(--bg2));
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.app {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 20px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #5b8bff);
  box-shadow: 0 8px 20px -8px rgba(124,92,255,0.7);
}

.brand-text h1 {
  font-size: 20px;
  margin: 0;
  letter-spacing: -0.01em;
  font-weight: 700;
}
.brand-text p {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.stats { display: flex; gap: 8px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  min-width: 64px;
}
.stat-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.stat-value {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.progress {
  height: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px;
  transition: width 0.5s cubic-bezier(.2,.7,.2,1);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  animation: rise 0.45s cubic-bezier(.2,.7,.2,1);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.lyric-wrap {
  position: relative;
  padding: 8px 8px 18px 34px;
  border-bottom: 1px dashed var(--border);
  margin-bottom: 18px;
}
.quote-mark {
  position: absolute;
  left: 0; top: -6px;
  font-size: 44px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.55;
  font-family: Georgia, "Times New Roman", serif;
}
.lyric {
  margin: 0;
  font-size: 18px;
  line-height: 1.55;
  font-style: italic;
  letter-spacing: 0.005em;
}
.lyric-extra {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-style: italic;
  animation: rise 0.4s ease;
}

.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 18px;
}
@media (max-width: 480px) {
  .choices { grid-template-columns: 1fr; }
}

.choice {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  padding: 14px 14px;
  border-radius: 13px;
  cursor: pointer;
  text-align: left;
  transition: transform .15s ease, border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.choice:hover:not(:disabled) {
  border-color: rgba(124,92,255,0.6);
  background: rgba(124,92,255,0.12);
  transform: translateY(-1px);
}
.choice:active:not(:disabled) { transform: translateY(0); }
.choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.choice:disabled { cursor: default; }
.choice.correct {
  border-color: var(--good);
  background: rgba(52,211,153,0.16);
  color: var(--good);
  box-shadow: 0 0 0 1px var(--good) inset;
  animation: pop 0.3s ease;
}
.choice.wrong {
  border-color: var(--bad);
  background: rgba(251,113,133,0.14);
  color: var(--bad);
  box-shadow: 0 0 0 1px var(--bad) inset;
  animation: shake 0.35s ease;
}
@keyframes pop {
  0% { transform: scale(0.97); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions.center { justify-content: center; }

.btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface-strong);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, opacity .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: var(--surface-strong); border-color: rgba(124,92,255,0.5); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #5b8bff);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 10px 22px -10px rgba(124,92,255,0.8);
}
.btn-primary:hover { filter: brightness(1.07); }

.feedback {
  margin: 14px 0 0;
  font-size: 13.5px;
  font-weight: 600;
  min-height: 18px;
  color: var(--muted);
}
.feedback.good { color: var(--good); }
.feedback.bad { color: var(--bad); }

.end-card { text-align: center; padding: 36px 24px; }
.end-title { margin: 0 0 8px; font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.end-score { margin: 0; font-size: 56px; font-weight: 800; line-height: 1; background: linear-gradient(135deg, var(--accent), var(--accent2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.end-sub { margin: 6px 0 14px; color: var(--muted); font-size: 13px; }
.end-rank { margin: 0 0 22px; font-size: 14.5px; font-weight: 600; color: var(--text); }

.foot { text-align: center; color: var(--muted); font-size: 12px; }
.foot p { margin: 0; }
