/* =========================================================================
   Wer wird Donut-Millionär? – Simpsons-Quiz
   Design: Springfield statt TV-Studio. Vorspann-Himmel mit ziehenden
   Wolken, grüne Hügel, Cartoon-Karten mit dicken Umrandungen und harten
   Schatten, Donut-Buchstaben bei den Antworten. Die Mechanik ist WWM,
   der Look ist Simpsons. Bewusst ein festes Thema (immer Tag in
   Springfield), daher kein Dark-Mode.
   ========================================================================= */

:root {
  --sky: #70d1fe;          /* Vorspann-Himmel */
  --sky-deep: #3fb8f5;
  --grass: #7ec850;        /* Springfield-Hügel */
  --grass-deep: #5aa838;
  --yellow: #ffd90f;       /* Simpsons-Gelb */
  --yellow-deep: #f2bf00;
  --cream: #fff9e6;        /* Kartengrund */
  --ink: #3a2410;          /* Cartoon-Umrandung / Text */
  --ink-soft: #7a5c3e;
  --pink: #ff8ccd;         /* Donut-Glasur */
  --pink-deep: #ec5fae;
  --right: #4caf3f;        /* richtig */
  --wrong: #d6182f;        /* Duff-Rot: falsch */
  --locked: #ff9b1a;       /* eingeloggte Antwort */

  --border: 3px solid var(--ink);
  --shadow: 5px 6px 0 rgba(58, 36, 16, 0.28);

  --font-display: "Arial Black", "Franklin Gothic Heavy", "Impact", sans-serif;
  --font-body: "Trebuchet MS", "Segoe UI", Verdana, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

/* Himmel auch auf html: Sicherheitsnetz, falls eine Ebene mal nicht
   gezeichnet wird (iOS-Overscroll, Repaint-Aussetzer) – dann ist der
   Hintergrund blau statt weiß. */
html { background: var(--sky); }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/*
 * Kulisse (Himmel-Verlauf, Wolken, Hügel) als eigene fixe Ebene.
 * Bewusst KEIN negativer z-index und KEINE body-Pseudoelemente:
 * iOS Safari zeichnet fixierte Ebenen mit z-index -1 nach
 * programmatischem Scrollen teils falsch oder gar nicht (weißer
 * Himmel, verrutschte Hügel). Stattdessen liegt die Kulisse als
 * erstes Element im body und der Inhalt via z-index darüber.
 */
.backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    /* Grüne Hügel am unteren Rand */
    radial-gradient(ellipse 55% 130px at 18% calc(100% + 25px), var(--grass) 0 99%, transparent 100%),
    radial-gradient(ellipse 60% 150px at 85% calc(100% + 40px), var(--grass-deep) 0 99%, transparent 100%),
    /* Vorspann-Himmel */
    linear-gradient(180deg, var(--sky) 0%, var(--sky-deep) 100%);
}

/* Ziehende Wolken wie im Vorspann */
.backdrop::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(ellipse 90px 42px at 120px 90px, #fff 0 98%, transparent 100%),
    radial-gradient(ellipse 60px 32px at 200px 70px, #fff 0 98%, transparent 100%),
    radial-gradient(ellipse 70px 34px at 60px 72px, #fff 0 98%, transparent 100%),
    radial-gradient(ellipse 110px 46px at 460px 220px, #ffffffdd 0 98%, transparent 100%),
    radial-gradient(ellipse 70px 36px at 545px 200px, #ffffffdd 0 98%, transparent 100%);
  background-size: 720px 420px;
  background-repeat: repeat;
  animation: clouds 90s linear infinite;
}
@keyframes clouds {
  from { background-position: 0 0; }
  to { background-position: 720px 0; }
}

/* Inhalt liegt über der Kulisse */
.titlecard, .stage {
  position: relative;
  z-index: 1;
}

/* Im Quiz verschwindet die Titelkarte auf ALLEN Bildschirmgrößen:
   Fokus auf die Runde, alles ohne Scrollen im Blick. */
body[data-screen="quiz"] .titlecard { display: none; }
body[data-screen="quiz"] .stage { padding-top: 12px; }
/* Mittlere Breiten: Platz lassen für die schwebenden Audio-Knöpfe
   rechts oben, damit sie nicht mit den Jokern kollidieren */
@media (min-width: 701px) and (max-width: 1219px) {
  body[data-screen="quiz"] .stage { padding-top: 72px; }
}

button { font-family: inherit; cursor: pointer; }
button:focus-visible {
  outline: 3px solid var(--pink-deep);
  outline-offset: 3px;
}

.hidden { display: none !important; }

/* Musik & Ton an/aus – schwebt oben rechts */
.audio-controls {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10;
  display: flex;
  gap: 8px;
}
.btn-audio {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: var(--border);
  background: var(--cream);
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.25);
}
.btn-audio:hover { background: var(--yellow); }
.btn-audio--off { opacity: 0.45; filter: grayscale(1); }

/* ------------------------------------------------------------ Titelkarte */

.titlecard {
  padding: 40px 16px 10px;
  text-align: center;
}

.titlecard h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: 0.01em;
  color: var(--yellow);
  transform: rotate(-2deg);
  /* Cartoon-Outline + harter Schattenwurf */
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
    -3px 0 0 var(--ink), 3px 0 0 var(--ink),
    0 -3px 0 var(--ink), 0 3px 0 var(--ink),
    4px 4px 0 rgba(58, 36, 16, 0.22);
  text-wrap: balance;
}

.titlecard p {
  margin: 14px auto 0;
  max-width: 34rem;
  font-weight: 700;
  color: var(--ink);
}

/* ------------------------------------------------------------ Grundgerüst */

.stage {
  max-width: 1080px;
  margin: 0 auto;
  padding: 26px 16px 170px; /* unten Platz für die Hügel */
}

.panel-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 10px;
}

/* ------------------------------------------------------------ Startscreen */

.start {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.start__rules {
  text-align: left;
  background: var(--cream);
  border: var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 18px 22px;
  margin: 0 0 28px;
  line-height: 1.55;
  transform: rotate(-0.4deg);
}
.start__rules ul { margin: 8px 0 0; padding-left: 20px; }
.start__rules li { margin-bottom: 6px; }
.start__rules strong { color: var(--pink-deep); }



.btn-big {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: linear-gradient(180deg, var(--yellow) 0%, var(--yellow-deep) 100%);
  border: var(--border);
  border-radius: 999px;
  padding: 16px 44px;
  box-shadow: 0 6px 0 var(--ink), 6px 12px 0 rgba(58, 36, 16, 0.25);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-big:hover { transform: translateY(-2px); }
.btn-big:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--ink); }

.start__buttons {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.btn-daily { font-size: 0.95rem; }

/* Pinke Donut-Glasur für alles rund ums Duell */
.btn-challenge {
  background: linear-gradient(180deg, var(--pink) 0%, var(--pink-deep) 100%);
}

/* Duell-Herausforderung aus einem geteilten Link */
.duel-banner {
  background: #ffeef8;
  border: var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px 20px 18px;
  margin: 0 0 26px;
  transform: rotate(-0.4deg);
}
.duel-banner__title {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--pink-deep);
}
.duel-banner__text { margin: 0; font-weight: 700; line-height: 1.5; }
.duel-banner__buttons {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}
.duel-banner .btn-big { font-size: 1.05rem; padding: 12px 28px; }

/* Heute schon gespielt: Ergebnis statt Knopf */
.daily-done {
  width: 100%;
  max-width: 360px;
  background: var(--cream);
  border: var(--border);
  border-radius: 16px;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.22);
  padding: 12px 16px 14px;
}
.daily-done p { margin: 0 0 6px; }
.daily-done__title { font-family: var(--font-display); font-size: 0.9rem; }
.daily-done__result { font-weight: 700; }
.daily-done__streak { font-weight: 700; font-size: 0.88rem; color: var(--pink-deep); }
.daily-done__next {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.daily-done .btn-quit { margin-top: 4px; }

/* Emoji-Raster im Wordle-Stil (fünf Felder pro Zeile) */
.grid-emoji {
  white-space: pre-line;
  font-size: 1.15rem;
  line-height: 1.3;
  letter-spacing: 0.12em;
}

/* Training: Themen-Auswahl und Nachsitzen */
.start__training { margin-top: 22px; }
.training__buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.topic-picker {
  margin: 14px auto 0;
  max-width: 460px;
  background: var(--cream);
  border: var(--border);
  border-radius: 16px;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.22);
  padding: 12px 14px 14px;
}
.topic-picker__hint { margin: 0 0 10px; font-size: 0.85rem; color: var(--ink-soft); line-height: 1.45; }
.topic-picker__buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.topic {
  padding: 9px 6px;
  line-height: 1.2;
  border-radius: 999px;
  border: var(--border);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.8rem;
  box-shadow: 2px 3px 0 rgba(58, 36, 16, 0.22);
}
.topic:hover { background: var(--yellow); }

.start__badges { margin-top: 42px; }

/* ------------------------------------------------------------ Statistik */

.start__stats { margin-top: 42px; }

/* Sechs Kacheln: immer zwei saubere Dreierreihen */
.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  max-width: 480px;
  margin: 0 auto;
}

.stat {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--cream);
  border: var(--border);
  border-radius: 14px;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.2);
  padding: 10px 14px;
}
.stat__value {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.stat__label {
  font-size: 0.7rem;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ------------------------------------------------------------ Abzeichen */

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

/* Kompakte Einheitskacheln: nur Icon + Name. Die Beschreibung
   erscheint als Sprechblase bei Hover bzw. Antippen (badge--info,
   Umschalten in js/game.js). */
.badge {
  position: relative;
  width: 96px;
  height: 92px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: var(--cream);
  border: var(--border);
  border-radius: 12px;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.22);
  padding: 6px;
  filter: grayscale(1);
  opacity: 0.55;
  cursor: pointer;
}
/* Beim Nachlesen volle Deckkraft, damit die Blase lesbar ist */
.badge:hover, .badge--info { opacity: 1; }
.badge--owned {
  filter: none;
  opacity: 1;
  background: var(--yellow);
}
.badge--new { animation: badge-pop 0.5s ease; }
@keyframes badge-pop {
  0% { transform: scale(0.6) rotate(-6deg); }
  70% { transform: scale(1.08) rotate(2deg); }
  100% { transform: scale(1); }
}
.badge__icon { font-size: 1.25rem; line-height: 1; }
.badge__name {
  font-weight: 700;
  font-size: 0.62rem;
  text-align: center;
  color: var(--ink);
  line-height: 1.2;
}
/* Beschreibung als Sprechblase über der Kachel */
.badge__desc {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 0.68rem;
  text-align: center;
  color: var(--ink);
  line-height: 1.3;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.25);
  z-index: 5;
}
.badge:hover .badge__desc,
.badge--info .badge__desc { display: block; }
.badge--owned .badge__desc { color: var(--ink); }

/* ------------------------------------------------------------ Quizscreen */

.quiz {
  max-width: 760px;
  margin: 0 auto;
}

.quiz__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.question-level {
  font-family: var(--font-display);
  font-size: 0.9rem;
  color: var(--ink);
  letter-spacing: 0.05em;
  background: var(--yellow);
  border: var(--border);
  border-radius: 999px;
  padding: 6px 16px;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.25);
}

/* --- Joker --- */

.jokers { display: flex; gap: 10px; }

.joker {
  min-width: 78px;
  padding: 8px 14px;
  border-radius: 999px;
  border: var(--border);
  background: var(--cream);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.2;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.25);
  transition: transform 0.1s ease;
}
.joker:hover:not(:disabled) { transform: scale(1.06); background: var(--yellow); }
.joker:disabled { cursor: default; }
.joker--used {
  opacity: 0.4;
  text-decoration: line-through;
  box-shadow: none;
}
.joker small { display: block; font-weight: 400; font-size: 0.68rem; color: var(--ink-soft); }

/* --- Frage & Antworten --- */

.question {
  min-height: 96px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px 30px;
  margin-bottom: 20px;
  background: var(--yellow);
  border: var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  transform: rotate(-0.5deg);
  position: relative;
  overflow: hidden; /* Turbo-Leiste folgt der Rundung */
}

/*
 * Turbo-Leiste am Unterrand der Fragekarte: brennt ab wie eine
 * Zündschnur. Die ersten 5 Sekunden bleibt sie voll (voller Bonus),
 * bis Sekunde 30 läuft sie leer – wie BONUS_FULL_S/BONUS_ZERO_S in
 * js/game.js. Beim Einloggen bleibt sie stehen (turbo--paused).
 */
.turbo {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 7px;
  background: var(--yellow-deep);
}
.turbo__fill {
  height: 100%;
  background: var(--pink-deep);
  transform-origin: left center;
  animation: turbo-burn 25s linear 5s forwards;
}
.turbo--paused .turbo__fill { animation-play-state: paused; }
@keyframes turbo-burn {
  to { transform: scaleX(0); }
}

/* Episodenkontext als kleiner Chip über der Frage */
.question__context {
  display: inline-block;
  background: var(--cream);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
}
.question p {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink);
  text-wrap: balance;
  overflow-wrap: break-word; /* Notbremse für sehr lange Namen */
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.answer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 18px 10px 10px;
  border: var(--border);
  border-radius: 999px;
  background: var(--cream);
  color: var(--ink);
  font-size: 1rem;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.1s ease, opacity 0.3s ease, background 0.15s ease;
}
.answer:hover:not(:disabled):not(.answer--locked):not(.answer--correct):not(.answer--wrong) {
  background: #fff3bd;
  transform: translateY(-2px);
}

/* Antwort-Buchstabe als Donut mit Streuseln */
.answer__letter {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: var(--border);
  background:
    radial-gradient(circle 2.2px at 26% 30%, #fff 0 2.2px, transparent 3px),
    radial-gradient(circle 2.2px at 68% 22%, var(--yellow) 0 2.2px, transparent 3px),
    radial-gradient(circle 2.2px at 80% 62%, #6ec6ff 0 2.2px, transparent 3px),
    radial-gradient(circle 2.2px at 38% 74%, #fff 0 2.2px, transparent 3px),
    radial-gradient(circle 2.2px at 18% 60%, var(--yellow) 0 2.2px, transparent 3px),
    radial-gradient(circle 2.2px at 60% 78%, #6ec6ff 0 2.2px, transparent 3px),
    linear-gradient(180deg, var(--pink) 0%, var(--pink-deep) 100%);
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
}

.answer__text { font-weight: 600; flex: 1; }
.answer__poll {
  font-family: var(--font-display);
  color: var(--pink-deep);
  font-size: 0.9rem;
}

.answer--locked {
  background: var(--locked);
  animation: blink 0.6s steps(2) infinite;
  font-weight: 700;
}
.answer--correct {
  background: var(--right);
  color: #fff;
  font-weight: 700;
  animation: none;
}
.answer--correct .answer__poll { color: #fff; }
.answer--wrong {
  background: var(--wrong);
  color: #fff;
}
.answer--wrong .answer__poll { color: #fff; }

.answer--hidden { opacity: 0; pointer-events: none; }

@keyframes blink { 50% { opacity: 0.7; } }

@media (prefers-reduced-motion: reduce) {
  .backdrop::before { animation: none; }
  .answer--locked { animation: none; }
  .badge--new { animation: none; }
  .btn-big, .joker, .answer { transition: none; }
}

/* --- Hinweise (Frink, Publikum, Fun-Fact) --- */

.hint, .poll, .bonus, .note {
  margin-top: 16px;
  padding: 12px 18px;
  border-radius: 16px;
  font-size: 0.95rem;
  line-height: 1.5;
  border: var(--border);
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.2);
}
.hint { background: #e6f6ff; }
.poll { background: #ffeef8; }
.bonus { background: #fff3bd; font-weight: 700; }
.note {
  background: var(--cream);
  color: var(--ink-soft);
  font-style: italic;
}
/* Schwarm-Statistik: wie eine Notiz, aber sachlich statt kursiv */
.crowd {
  background: #e6f6ff;
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
}

/* „Frage melden“: bewusst unauffällig, damit es nicht vom Spiel ablenkt */
.report {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}
.report__reasons { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-report {
  background: transparent;
  border: 2px dashed rgba(58, 36, 16, 0.35);
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-report:hover, .btn-report:focus-visible { border-style: solid; color: var(--ink); }
.report__thanks { color: var(--ink-soft); font-weight: 700; }

.quiz__actions {
  margin-top: 22px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-continue {
  font-size: 1rem;
  padding: 12px 30px;
}

.btn-quit {
  background: var(--cream);
  border: var(--border);
  color: var(--ink);
  border-radius: 999px;
  padding: 9px 20px;
  font-weight: 700;
  font-size: 0.85rem;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.25);
}
.btn-quit:hover { background: var(--yellow); }

/* ------------------------------------------------------------ Bestenliste */

.start__board { margin-top: 42px; }

.board {
  max-width: 520px;
  margin: 0 auto;
  text-align: left;
  background: var(--cream);
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 16px;
}
.board--end { margin-top: 28px; }

/* Reiter: Woche / Heute / Region / Global */
.board__tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}
.board__tab {
  flex: 1 1 auto;
  padding: 6px 10px;
  border-radius: 999px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  font-size: 0.78rem;
  white-space: nowrap;
}
.board__tab:hover { background: #fff3bd; }
.board__tab[aria-selected="true"] {
  background: var(--pink-deep);
  color: #fff;
}

.board__list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rank;
}

.board__row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  font-size: 0.88rem;
  border-bottom: 1px dashed rgba(58, 36, 16, 0.2);
  counter-increment: rank;
}
.board__row:last-child { border-bottom: 0; }
/* Eigener, gerade abgeschickter Eintrag */
.board__row--me {
  background: var(--yellow);
  border-radius: 8px;
  padding-left: 6px;
  padding-right: 6px;
}
.board__row::before {
  content: counter(rank) ".";
  font-family: var(--font-display);
  font-size: 0.75rem;
  color: var(--ink-soft);
  min-width: 1.4em;
}
.board__name {
  font-weight: 700;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board__meta { color: var(--ink-soft); font-size: 0.75rem; }
.board__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.board__empty {
  color: var(--ink-soft);
  font-size: 0.85rem;
  font-style: italic;
  padding: 4px 0;
}

.end__breakdown {
  margin: -6px 0 14px;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 700;
}

/* ------------------------------------------------------------ Endscreen */

.end {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.end h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  color: var(--yellow);
  transform: rotate(-1.5deg);
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
    3px 3px 0 rgba(58, 36, 16, 0.22);
  text-wrap: balance;
  margin: 10px 0 6px;
}

.end__amount {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 3.2rem);
  color: var(--cream);
  text-shadow:
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink),
    -2px 2px 0 var(--ink), 2px 2px 0 var(--ink),
    3px 3px 0 rgba(58, 36, 16, 0.22);
  margin: 18px 0;
}
.end--won .end__amount { color: var(--yellow); }

.end__text { line-height: 1.6; color: var(--ink); max-width: 30rem; margin: 0 auto 10px; font-weight: 600; }

.end__reached {
  margin: -8px 0 14px;
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--ink);
}

/* Bestenlisten-Eintrag am Spielende */
.end-entry {
  margin: 22px auto 0;
  max-width: 380px;
  background: var(--cream);
  border: var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 18px;
}
.end-entry label { font-weight: 700; display: block; margin-bottom: 8px; }
.end-entry__row { display: flex; gap: 8px; }
.end-entry__row input {
  flex: 1;
  min-width: 0;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  border: var(--border);
  border-radius: 999px;
  padding: 8px 16px;
}
.end-entry__row input:focus-visible {
  outline: 3px solid var(--pink-deep);
  outline-offset: 2px;
}
.end-entry__error {
  margin: 10px 0 0;
  color: var(--wrong);
  font-weight: 700;
  font-size: 0.85rem;
}
.end-entry__done {
  margin: 22px 0 0;
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 1rem;
}
.end-entry__notop {
  margin: 16px 0 0;
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.end__badges-title {
  font-family: var(--font-display);
  color: var(--ink);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 26px 0 12px;
}

.end__actions {
  margin-top: 34px;
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
}

.end__share {
  margin: 18px 0 6px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.end__duel {
  margin: 0 auto 14px;
  max-width: 420px;
  background: #ffeef8;
  border: var(--border);
  border-radius: 14px;
  box-shadow: 3px 4px 0 rgba(58, 36, 16, 0.2);
  padding: 10px 14px;
  font-weight: 700;
  line-height: 1.45;
}
.end__grid { margin: 0 0 10px; }
.end__hint {
  margin: 0 auto 10px;
  max-width: 30rem;
  font-size: 0.88rem;
  font-style: italic;
  color: var(--ink-soft);
}
/* Übungsrunden: kein Teilen, keine Bestenliste */
.end--practice .end__only-challenge { display: none !important; }

/* ------------------------------------------------------------ Footer & Rechtliches */

.site-footer {
  margin-top: 60px;
  text-align: center;
  font-size: 0.8rem;
}
.site-footer a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px dotted var(--ink-soft);
}
.site-footer a:hover { border-bottom-style: solid; }
.site-footer__version { margin-left: 10px; color: var(--ink-soft); font-size: 0.75rem; }

.legal {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.legal__card { margin: 0; transform: none; }
.legal__card p { margin: 8px 0 0; line-height: 1.55; }
.legal__back { text-align: center; margin: 14px 0 0; }
.legal__back-btn { display: inline-block; text-decoration: none; }

/* ------------------------------------------------------------ Responsiv */

@media (max-width: 700px) {
  .answers { grid-template-columns: 1fr; }
  .quiz__top { flex-direction: column; align-items: stretch; }
  .jokers { justify-content: center; }
  .question-level { text-align: center; }
  .question { padding: 18px 22px; transform: none; }
  .start__rules { transform: none; }
  .audio-controls { top: 8px; right: 8px; }
  .btn-audio { width: 42px; height: 42px; }
  .titlecard h1 { line-height: 1.15; }
  .titlecard { padding-left: 60px; padding-right: 60px; }
  .quiz__actions { flex-direction: column-reverse; align-items: stretch; }
  .quiz__actions .btn-continue { width: 100%; order: 1; }
  .btn-quit { align-self: center; }

  /* Im Quiz zählt jeder Pixel: Abstände straffen, damit Frage,
     Antworten, Erklärtext und Weiter-Button möglichst ohne Scrollen
     auf einen Blick passen. (Titelkarte wird global ausgeblendet.) */
  body[data-screen="quiz"] .question-level {
    align-self: flex-start;
    max-width: calc(100% - 104px); /* rechts schweben 🎵 und 🔊 */
    font-size: 0.82rem;
    padding: 6px 12px;
  }
  .quiz__top { margin-bottom: 10px; gap: 8px; }
  .joker { padding: 7px 10px; font-size: 0.75rem; }
  .question { min-height: 0; padding: 12px 16px; margin-bottom: 12px; gap: 8px; }
  .question p { font-size: 1.05rem; line-height: 1.4; }
  .answers { gap: 9px; }
  .answer { min-height: 50px; padding: 6px 12px 6px 6px; font-size: 0.95rem; }
  .answer__letter { width: 36px; height: 36px; font-size: 0.85rem; }
  .hint, .poll, .bonus, .note { margin-top: 10px; padding: 10px 14px; font-size: 0.9rem; line-height: 1.45; }
  .quiz__actions { margin-top: 14px; gap: 10px; }
  .board { padding: 10px 12px; }
  .stat { padding: 9px 6px; }
  .stat__label { font-size: 0.62rem; letter-spacing: 0.04em; }
  .board__tab { padding: 6px 8px; font-size: 0.74rem; }
  .end__share .btn-big { width: 100%; }
}
