/* =====================================================================
   Hitster Lernapp – Designsystem
   Hitster-verwandt, aber klar eigenständig:
   – Hitster nutzt kräftiges Pink auf Weiß und ein Vinyl-Motiv.
   – Wir nutzen Beerentöne (Berry/Burgundy) auf einem warmen Dunkelblau,
     mit Cremeflächen und Gold-Akzenten – ruhiger, edler, fokussiert.
   ===================================================================== */

:root {
  /* Brand */
  --berry:        #C8366E;
  --berry-deep:   #9B2454;
  --berry-soft:   #F2C8D8;
  --gold:         #E8B547;
  --mint:         #5FBF7E;
  --coral:        #E36F4D;

  /* Neutral surfaces */
  --night:        #191629;
  --night-soft:   #221E36;
  --night-line:   #2D2843;
  --cream:        #FAF3E7;
  --cream-soft:   #F1E8D6;
  --ink:          #1B1426;
  --ink-soft:     #6E6481;
  --ink-faint:    #B7AEC6;

  /* Layout */
  --radius-lg:    20px;
  --radius-md:    14px;
  --radius-sm:    8px;
  --shadow:       0 10px 30px rgba(0, 0, 0, 0.18);
  --shadow-soft:  0 4px 14px rgba(0, 0, 0, 0.08);

  --maxw:         960px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(160deg, var(--night) 0%, #1F1A33 60%, #2A2247 100%);
  color: var(--cream);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  letter-spacing: -0.005em;
}
body::before {
  /* subtle berry glow top-right */
  content: "";
  position: fixed;
  top: -200px; right: -200px;
  width: 500px; height: 500px;
  background: radial-gradient(circle at center, rgba(200, 54, 110, 0.25), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Topbar ---------- */
.topbar {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 28px;
  z-index: 1;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}
.brand-mark {
  display: inline-block;
  width: 28px; height: 28px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, var(--berry-soft) 0%, var(--berry) 30%, var(--berry-deep) 100%);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.05) inset, 0 0 18px rgba(200,54,110,0.5);
}
.brand-name { color: var(--cream); }
.brand-name em {
  font-style: normal;
  color: var(--gold);
  font-weight: 700;
}
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 999px;
  padding: 6px 6px 6px 14px;
  font-size: 0.9rem;
}
.user-chip button {
  background: rgba(255,255,255,0.08);
  border: 0;
  color: var(--cream);
  width: 24px; height: 24px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.user-chip button:hover { background: var(--berry); }
.hidden { display: none !important; }

/* ---------- Main & screens ---------- */
main#app {
  flex: 1;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 24px 28px 60px;
  position: relative;
  z-index: 1;
}

.screen { animation: fadeIn 0.25s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Cards ---------- */
.card {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow);
}
.card.dark {
  background: var(--night-soft);
  color: var(--cream);
  border: 1px solid var(--night-line);
}
.card + .card { margin-top: 18px; }

/* ---------- Typography ---------- */
h1.display {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 800;
  margin: 0 0 0.25rem;
  letter-spacing: -0.02em;
}
h2.section {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
}
.eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--berry);
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.muted { color: var(--ink-soft); }
.cream-muted { color: var(--ink-faint); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center; gap: 8px;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 999px;
  padding: 12px 22px;
  transition: transform 0.08s, background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--berry);
  color: white;
  box-shadow: 0 6px 18px rgba(200, 54, 110, 0.35);
}
.btn-primary:hover { background: var(--berry-deep); }
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn-secondary.on-dark {
  color: var(--cream);
  border-color: var(--cream);
}
.btn-secondary:hover { background: var(--ink); color: var(--cream); }
.btn-secondary.on-dark:hover { background: var(--cream); color: var(--ink); }
.btn-gold {
  background: var(--gold);
  color: var(--ink);
}
.btn-gold:hover { filter: brightness(0.93); }
.btn-ghost {
  background: transparent;
  color: var(--berry);
  padding: 8px 14px;
}
.btn-ghost:hover { background: var(--berry-soft); }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* ---------- Form ---------- */
.field {
  display: block;
  width: 100%;
  font-size: 1.1rem;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  border: 2px solid var(--cream-soft);
  background: white;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field:focus {
  border-color: var(--berry);
  box-shadow: 0 0 0 4px var(--berry-soft);
}

/* ---------- Onboarding ---------- */
.welcome-hero {
  text-align: center;
  padding: 36px 24px 18px;
}
.welcome-hero .brand-mark {
  width: 56px; height: 56px; margin-bottom: 12px;
}
.welcome-form {
  max-width: 460px;
  margin: 24px auto 0;
}
.spotify-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: center;
  margin-top: 18px;
}
.spotify-status {
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.spotify-status .ok { color: var(--mint); font-weight: 700; }

/* ---------- Hub ---------- */
.hub-greeting {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 22px;
}
.stat {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-md);
  padding: 14px 16px;
}
.stat .num { font-size: 1.6rem; font-weight: 800; color: var(--gold); }
.stat .lbl { font-size: 0.78rem; color: var(--ink-faint); letter-spacing: 0.08em; text-transform: uppercase; }

.modes {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.mode-card {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  text-align: left;
  cursor: pointer;
  border: 0;
  position: relative;
  transition: transform 0.12s, box-shadow 0.15s;
  font-family: inherit;
  display: flex; flex-direction: column; gap: 6px;
}
.mode-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.mode-card[disabled] { opacity: 0.5; cursor: not-allowed; }
.mode-card .num {
  position: absolute; right: 18px; top: 16px;
  background: var(--berry); color: white;
  width: 30px; height: 30px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-weight: 800; font-size: 0.9rem;
}
.mode-card .title { font-size: 1.15rem; font-weight: 800; }
.mode-card .desc { color: var(--ink-soft); font-size: 0.95rem; }
.mode-card .meta { margin-top: 10px; font-size: 0.78rem; color: var(--berry-deep); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---------- Round ---------- */
.round-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.round-meta {
  display: flex; gap: 16px;
  font-size: 0.9rem; color: var(--ink-faint);
}
.round-meta .tag {
  display: inline-flex; align-items: center; gap: 6px;
}
.round-meta .tag b { color: var(--gold); }

.progress {
  width: 100%; height: 8px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 18px;
}
.progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--berry), var(--gold));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.prompt {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 26px 28px 22px;
  margin-bottom: 18px;
}
.prompt .label { font-size: 0.75rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--berry); font-weight: 700; }
.prompt .value { font-size: 1.6rem; font-weight: 800; margin-top: 4px; }
.prompt .sub { color: var(--ink-soft); font-size: 1rem; margin-top: 4px; }

.audio-bar {
  display: flex; align-items: center; gap: 14px;
  background: var(--night-soft);
  border: 1px solid var(--night-line);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 18px;
}
.audio-bar button.play {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--berry);
  color: white;
  border: 0;
  cursor: pointer;
  font-size: 1.1rem;
  display: grid; place-items: center;
}
.audio-bar button.play:hover { background: var(--berry-deep); }
.audio-bar .audio-info { font-size: 0.9rem; color: var(--ink-faint); }

.choices { display: grid; gap: 10px; }
.choices.threecols {
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.choices.threecols .col-title { font-weight: 700; color: var(--berry); margin-bottom: 8px; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase; }
.choice {
  background: var(--cream);
  color: var(--ink);
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-family: inherit;
  font-size: 0.98rem;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
}
.choice:hover { border-color: var(--berry); }
.choice.selected { border-color: var(--berry); background: var(--berry-soft); }
.choice.correct { border-color: var(--mint); background: #DDF3E2; color: #1A4F2C; }
.choice.wrong { border-color: var(--coral); background: #FBE0D6; color: #6E2812; }
.choice[disabled] { cursor: default; }

.feedback-row {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between;
  margin-top: 18px;
}
.feedback-msg {
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
}
.feedback-msg.ok { background: rgba(95, 191, 126, 0.18); color: var(--mint); }
.feedback-msg.bad { background: rgba(227, 111, 77, 0.18); color: var(--coral); }

/* ---------- Summary ---------- */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.summary-tile {
  background: var(--cream);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
}
.summary-tile h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--berry);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.summary-tile .big {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--ink);
}
.summary-tile.dark { background: var(--night-soft); color: var(--cream); }
.summary-tile.dark h3 { color: var(--gold); }
.summary-tile.dark .big { color: var(--cream); }

.miss-list { list-style: none; padding: 0; margin: 8px 0 0; max-height: 220px; overflow: auto; }
.miss-list li { padding: 8px 0; border-bottom: 1px solid var(--cream-soft); font-size: 0.95rem; }
.miss-list li:last-child { border-bottom: 0; }
.miss-list b { color: var(--berry); }

.badge-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--gold);
  color: var(--ink);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
}
.badge.locked { background: rgba(255,255,255,0.08); color: var(--ink-faint); }

.actions-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; justify-content: center; }

/* ---------- Footer ---------- */
.footnote {
  text-align: center;
  font-size: 0.8rem;
  color: var(--ink-faint);
  padding: 10px;
  position: relative; z-index: 1;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .modes { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .choices.threecols { grid-template-columns: 1fr; gap: 10px; }
}
