/* style.css — HymnGuess styling */
* { box-sizing: border-box; }

:root {
  --bg: #0f1117;
  --bg-2: #161a26;
  --surface: #1c2230;
  --surface-2: #232a3a;
  --border: #2c3447;
  --text: #eef1f8;
  --muted: #9aa3b8;
  --accent: #f0c674;
  --accent-2: #e8a93d;
  --good: #6ee0a3;
  --bad: #ff7e7e;
  --ring: rgba(240,198,116,0.45);
  --shadow: 0 10px 30px rgba(0,0,0,0.4);
}

@media (prefers-color-scheme: light) {
  :root {
    --bg: #f6f2e9;
    --bg-2: #efe9da;
    --surface: #ffffff;
    --surface-2: #f3ecdc;
    --border: #e2d8c0;
    --text: #2a2316;
    --muted: #7a7158;
    --accent: #b8842c;
    --accent-2: #9a6e1f;
    --good: #2f9e63;
    --bad: #c64545;
    --ring: rgba(184,132,44,0.4);
    --shadow: 0 8px 24px rgba(80,60,20,0.12);
  }
}

html[data-theme="dark"] {
  --bg: #0f1117; --bg-2: #161a26; --surface: #1c2230; --surface-2: #232a3a;
  --border: #2c3447; --text: #eef1f8; --muted: #9aa3b8;
  --accent: #f0c674; --accent-2: #e8a93d;
  --good: #6ee0a3; --bad: #ff7e7e;
  --ring: rgba(240,198,116,0.45);
  --shadow: 0 10px 30px rgba(0,0,0,0.4);
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #f6f2e9; --bg-2: #efe9da; --surface: #ffffff; --surface-2: #f3ecdc;
  --border: #e2d8c0; --text: #2a2316; --muted: #7a7158;
  --accent: #b8842c; --accent-2: #9a6e1f;
  --good: #2f9e63; --bad: #c64545;
  --ring: rgba(184,132,44,0.4);
  --shadow: 0 8px 24px rgba(80,60,20,0.12);
  color-scheme: light;
}

html { color-scheme: dark; }
@media (prefers-color-scheme: light) { html { color-scheme: light; } }

body {
  margin: 0;
  background:
    radial-gradient(1100px 600px at 15% -10%, rgba(240,198,116,0.08), transparent 60%),
    radial-gradient(900px 500px at 110% 10%, rgba(110,224,163,0.05), transparent 55%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.app {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 18px 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

/* Topbar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: linear-gradient(160deg, var(--surface), var(--surface-2));
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--accent);
  box-shadow: var(--shadow);
}
.brand-name { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.brand-sub { margin: 2px 0 0; color: var(--muted); font-size: 12.5px; }

.stats { display: flex; gap: 8px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 14px;
  display: flex; flex-direction: column; align-items: center;
  min-width: 64px;
}
.stat-label { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.stat-val { font-size: 18px; font-weight: 700; color: var(--accent); }

/* Stage */
.stage { display: flex; flex-direction: column; gap: 16px; }

.lyric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 24px 22px;
  position: relative;
  box-shadow: var(--shadow);
}
.round-pill {
  position: absolute; top: -12px; left: 22px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #1a1305;
  font-size: 11.5px; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.25);
}
.lyric-lead { margin: 6px 0 10px; color: var(--muted); font-size: 13px; }
.lyric {
  margin: 0 0 14px;
  font-size: clamp(20px, 4.6vw, 26px);
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  font-style: italic;
  border-left: 3px solid var(--accent);
  padding-left: 16px;
}
.meta-row { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 14px; }
.meta {
  font-size: 13px; color: var(--muted);
  transition: opacity 0.3s ease;
}
.meta-hidden { opacity: 0; filter: blur(6px); user-select: none; }
.hint-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.hint-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.hint-btn:disabled { opacity: 0.5; cursor: default; }

/* Choices */
.choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 560px) {
  .choices { grid-template-columns: 1fr; }
}
.choice {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  text-align: left;
  padding: 16px 18px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 0 rgba(255,255,255,0.02) inset;
}
.choice::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: transparent; border-radius: 14px 0 0 14px;
  transition: background 0.15s ease;
}
.choice:hover:not(.locked) {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.choice:hover:not(.locked)::before { background: var(--accent); }
.choice:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 2px;
}
.choice:active:not(.locked) { transform: translateY(0); }
.choice.locked { cursor: default; }
.choice.correct {
  border-color: var(--good);
  background: color-mix(in srgb, var(--good) 14%, var(--surface));
}
.choice.correct::before { background: var(--good); }
.choice.wrong {
  border-color: var(--bad);
  background: color-mix(in srgb, var(--bad) 14%, var(--surface));
  animation: shake 0.4s ease;
}
.choice.wrong::before { background: var(--bad); }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* Feedback */
.feedback {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px 18px;
  animation: rise 0.3s ease;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fb-title { margin: 0; font-size: 15.5px; font-weight: 700; }
.fb-correct { color: var(--good); }
.fb-wrong { color: var(--bad); }
.fb-sub { margin: 3px 0 0; color: var(--muted); font-size: 12.5px; }
.next-btn {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #1a1305;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.next-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.next-btn:active { transform: translateY(0); }

/* Progress */
.progress-wrap { display: flex; flex-direction: column; gap: 10px; }
.progress-track {
  height: 8px; 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(--accent-2));
  border-radius: 999px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-foot {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 12.5px; color: var(--muted); gap: 12px;
}
.restart-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px; border-radius: 8px;
  font-size: 12px; cursor: pointer;
  transition: all 0.15s ease;
}
.restart-btn:hover { color: var(--accent); border-color: var(--accent); }

.foot { text-align: center; color: var(--muted); font-size: 11.5px; padding-top: 4px; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 50;
  animation: rise 0.25s ease;
}

/* End overlay */
.end-overlay {
  position: fixed; inset: 0;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(6px);
  display: grid; place-items: center;
  padding: 20px;
  z-index: 60;
  animation: rise 0.3s ease;
}
.end-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 32px 28px;
  max-width: 420px; width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}
.end-card h2 { margin: 0 0 12px; color: var(--accent); font-size: 22px; }
.end-score { margin: 0 0 8px; font-size: 16px; font-weight: 600; }
.end-rank { margin: 0 0 22px; color: var(--muted); font-size: 13.5px; line-height: 1.5; }
.end-btn {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  color: #1a1305;
  border: none;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.end-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }

@media (max-width: 420px) {
  .stat { min-width: 52px; padding: 6px 10px; }
  .stat-val { font-size: 16px; }
  .lyric-card { padding: 22px 18px 18px; }
  .brand-name { font-size: 19px; }
}
