body {
  font-family: sans-serif;
  text-align: center;
  margin: 0;
  padding: 20px 16px;
  background: #1e1b2e;
  color: #f2f0fa;
}

/* Versteckte Elemente wirklich verstecken (auch Knöpfe) */
[hidden] { display: none !important; }

/* Kopfzeile: links Zurück, Mitte Titel, rechts Knöpfe */
#kopfzeile { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; max-width: 520px; margin: 0 auto 12px; min-height: 48px; }
.kopf-links { justify-self: start; }
.kopf-rechts { justify-self: end; display: flex; gap: 6px; }
.kopf-mitte { display: flex; align-items: center; gap: 8px; }
#kopf-titel { margin: 0; font-size: 26px; }
button.kopf-knopf { width: 44px; height: 44px; padding: 0; margin: 0; font-size: 22px; background: #48426a; border-radius: 50%; }
button.info-knopf { width: 28px; height: 28px; font-size: 16px; font-weight: bold; font-style: italic; font-family: serif; }

/* Fenster über allem (Infos, Pause, Einstellungen) */
.fenster-hintergrund { position: fixed; inset: 0; background: rgba(10, 8, 20, 0.75); z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; }
.fenster { max-width: 420px; width: 100%; box-sizing: border-box; animation: hereingleiten 0.25s ease-out; }
.fenster p { white-space: pre-line; }

/* Ein/Aus-Schalter (Ton, Musik, Vibration) */
.schalter-zeile { display: flex; align-items: center; justify-content: space-between; background: #48426a; border-radius: 12px; padding: 12px 14px; margin: 8px 0; text-align: left; }
input.schalter { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 15px; background: #2c2842; position: relative; cursor: pointer; transition: background 0.2s; }
input.schalter::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #f2f0fa; transition: transform 0.2s; }
input.schalter:checked { background: #2fb36d; }
input.schalter:checked::after { transform: translateX(22px); }

/* Ladeanzeige: drehender Kreis */
.lade-kreis { width: 48px; height: 48px; border: 5px solid #48426a; border-top-color: #f5c542; border-radius: 50%; animation: drehen 0.8s linear infinite; }
@keyframes drehen { to { transform: rotate(360deg); } }

/* Nur der Bildschirm mit der Klasse "aktiv" ist sichtbar */
.bildschirm { display: none; max-width: 520px; margin: 0 auto; }
.bildschirm.aktiv { display: block; animation: einblenden 0.3s ease-out; }

.karte {
  background: #2c2842;
  border-radius: 16px;
  padding: 20px;
}

button, input[type="text"], input[type="email"], input[type="password"] {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 10px 0;
  padding: 14px;
  font-size: 18px;
  border-radius: 12px;
  border: none;
}

button {
  background: #7c5cff;
  color: white;
  cursor: pointer;
  /* weicher Übergang für die Klick-Animation */
  transition: transform 0.1s, filter 0.1s;
}
/* Beim Drücken wird der Knopf kurz kleiner und heller */
button:active { transform: scale(0.94); filter: brightness(1.2); }
button.zweitrangig { background: #48426a; }
button:disabled { opacity: 0.5; }

/* Mehrere Elemente nebeneinander */
.reihe { display: flex; gap: 10px; }
.reihe > * { flex: 1; }

.auswahl {
  display: block;
  background: #48426a;
  border-radius: 12px;
  padding: 12px;
  margin: 6px 0;
  text-align: left;
}

#kategorien { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

input[type="range"] { width: 100%; }

.hinweis { color: #b8b2d6; font-size: 15px; }

/* Nach der Antwort: richtig = grün (pulsiert), falsch = rot (wackelt) */
button.richtig { background: #2fb36d; opacity: 1; animation: pulsieren 0.4s ease-out; }
button.falsch { background: #e5484d; opacity: 1; animation: wackeln 0.4s ease-out; }

/* Haken bzw. Kreuz rechts an der Antwort */
#spielfeld button, #spielfeld .sortier-ergebnis, .mathe-anzeige { position: relative; }
#spielfeld .richtig::after, #spielfeld .falsch::after {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-weight: bold; font-size: 20px; animation: einblenden 0.3s;
}
#spielfeld .richtig::after { content: "✓"; }
#spielfeld .falsch::after { content: "✗"; }
#spielfeld .kaertchen.richtig::after, #spielfeld .kaertchen.falsch::after { right: 6px; top: 12px; font-size: 14px; }

/* Intro vor jeder Runde */
.intro-karte { background: #2c2842; border: 2px solid #f5c542; border-radius: 16px; padding: 30px 20px; margin-top: 20px; animation: hereingleiten 0.4s ease-out; }
.intro-karte h2 { font-size: 30px; margin: 0 0 10px; }

/* Frage blendet weich aus, bevor die nächste kommt */
#spielfeld { transition: opacity 0.3s, transform 0.3s; }
#spielfeld.ausblenden { opacity: 0; transform: translateY(-12px); }

/* Punkte hüpfen kurz, wenn man einen Punkt bekommt */
#punkte.hochzaehlen { animation: hochzaehlen 0.5s ease-out; }

/* Auflösung (Schätzfrage, Reihenfolge) */
.aufloesung {
  background: #2c2842;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 12px 0;
  text-align: left;
  white-space: pre-line;  /* Zeilenumbrüche im Text anzeigen */
}

/* Schätzfrage: Eingabefeld mit Einheit daneben */
.schaetz-reihe { align-items: center; }
.schaetz-reihe .einheit { flex: 0 0 auto; color: #b8b2d6; }
input.schaetz-eingabe { font-size: 24px; text-align: center; }
input.richtig { background: #2fb36d; color: white; }
input.teilweise { background: #f5c542; color: #1e1b2e; }
input.falsch { background: #e5484d; color: white; }

/* Reihenfolge: Antworten mit Platznummer */
button.sortier-knopf { background: #48426a; text-align: left; display: flex; gap: 10px; }
button.sortier-knopf.gewaehlt { background: #7c5cff; }
.sortier-knopf .platz { min-width: 28px; font-weight: bold; }
.sortier-ergebnis { border-radius: 12px; padding: 12px 14px; margin: 8px 0; text-align: left; }
.sortier-ergebnis.richtig { background: #2fb36d; }
.sortier-ergebnis.teilweise { background: #f5c542; color: #1e1b2e; }
.sortier-ergebnis.falsch { background: #e5484d; }

/* Kärtchen: 3 nebeneinander */
.kaertchen-gitter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
button.kaertchen { margin: 0; padding: 10px 6px; font-size: 15px; min-height: 60px; background: #48426a; }
button.kaertchen.richtig { background: #2fb36d; }
button.kaertchen.falsch { background: #e5484d; }
button.kaertchen.verpasst { opacity: 1; box-shadow: inset 0 0 0 3px #2fb36d; }

/* Entweder oder: Aussage groß in der Mitte, zwei Knöpfe nebeneinander */
.eo-bereich.neu { animation: hereingleiten 0.3s ease-out; }
.eo-aussage { background: #2c2842; border-radius: 12px; padding: 20px 14px; margin: 10px 0; font-size: 20px; font-weight: bold; }
.eo-meldung { font-weight: bold; }

/* Mathe: Aufgabe, Anzeige und Tastenfeld */
.mathe-aufgabe { font-size: 32px; }
.mathe-anzeige { background: #f2f0fa; color: #1e1b2e; border-radius: 12px; padding: 12px; font-size: 32px; font-weight: bold; min-height: 40px; margin: 10px auto; max-width: 260px; }
.mathe-anzeige.richtig { background: #2fb36d; color: white; }
.mathe-anzeige.falsch { background: #e5484d; color: white; }
.tastenfeld { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 320px; margin: 0 auto; }
.tastenfeld button { margin: 0; font-size: 24px; padding: 16px 0; }
.tastenfeld button.ok { background: #2fb36d; }

/* ===== Startseite, Profil, Charakter ===== */
button.gross { padding: 22px; font-size: 22px; font-weight: bold; }
button.klein { flex: 0 0 auto; width: auto; padding: 10px 14px; }
.name-feld { background: #48426a; border-radius: 12px; padding: 12px; font-weight: bold; text-align: left; }
.name-reihe { align-items: center; }
.profil-kopf { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.profil-kopf .name-feld { flex: 1; }
button.profilbild { width: 64px; height: 64px; padding: 0; margin: 0; border-radius: 50%; background: #48426a; overflow: hidden; flex: 0 0 auto; border: 3px solid #7c5cff; }
.profilbild svg { width: 100%; height: 100%; }
.figur-gross svg { width: 100%; max-width: 150px; height: auto; display: block; margin: 0 auto; }
.charakter-bereich { display: flex; gap: 12px; align-items: center; margin: 12px 0; }
.charakter-bereich > * { flex: 1; }
.pfeil-reihe { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
button.pfeil { width: 40px; flex: 0 0 40px; padding: 8px 0; margin: 0; }
.teil-name { flex: 1; font-size: 14px; line-height: 1.2; }
.teil-name small { color: #b8b2d6; }
.kommt-bald { font-size: 22px; margin: 40px 0; }
/* Sammlung: Emotes als Gitter, Sprüche als Liste, Rahmenfarbe nach Seltenheit */
.emote-gitter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sammel-karte { margin: 6px 0; background: #48426a; border: 3px solid #8a84a8; padding: 10px 6px; }
.emote-gitter .sammel-karte { margin: 0; }
.sammel-karte small { display: block; color: #d8d4ec; font-size: 12px; margin-top: 4px; }
.sammel-bild { font-size: 40px; height: 56px; display: flex; align-items: center; justify-content: center; }
.sammel-bild img { max-width: 56px; max-height: 56px; }
.sammel-name { font-size: 15px; }
.seltenheit-selten { border-color: #3b82f6; }
.seltenheit-episch { border-color: #a855f7; }
.seltenheit-legendär { border-color: #f5c542; }
.sammel-karte.ausgeruestet { background: #7c5cff; }
.sammel-karte.gesperrt { opacity: 0.45; filter: grayscale(0.8); }

button.gefahr { background: #e5484d; }

/* Lobby, Spieler-ID und Freunde */
.id-zeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: #48426a; border-radius: 12px; padding: 6px 6px 6px 12px; margin: 10px 0; }
.id-zeile button { margin: 0; }
.lobby-code-box { background: #48426a; border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.lobby-code-box strong { display: block; font-size: 34px; letter-spacing: 6px; margin: 4px 0; }
.lobby-code-box button { margin: 6px 0 0; }
.spieler-zeile { display: flex; align-items: center; gap: 10px; background: #48426a; border-radius: 12px; padding: 6px 10px; margin: 6px 0; text-align: left; }
.spieler-zeile > span { flex: 1; }
.spieler-zeile button { margin: 0; }
.spieler-zeile.frei { opacity: 0.45; border: 2px dashed #8a84a8; background: none; padding: 12px; }
.spieler-bild { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: #2c2842; flex: 0 0 auto; }
.spieler-bild svg { width: 100%; height: 100%; }

/* Spielgeld, Shop und Battlepass */
.dollar-anzeige { text-align: right; font-weight: bold; color: #f5c542; margin: 4px 0; }
.shop-reihe > :first-child { flex: 7; }
.shop-reihe > :last-child { flex: 3; }
button.bp-knopf { background: linear-gradient(135deg, #f5c542, #e8962e); color: #1e1b2e; }
.shop-karte { display: flex; flex-direction: column; border-radius: 12px; }
.shop-karte button { margin: 8px 0 0; padding: 8px; font-size: 15px; }
.belohnung { color: #f5c542; font-weight: bold; white-space: pre-line; }
#bp-balken { height: 100%; background: #f5c542; }
.bp-zeile { display: grid; grid-template-columns: 44px 1fr 1fr; gap: 6px; align-items: center; margin: 6px 0; opacity: 0.6; }
.bp-zeile.erreicht, .bp-kopf { opacity: 1; }
.bp-kopf { font-size: 14px; color: #b8b2d6; }
.bp-nummer { font-weight: bold; }
button.bp-feld { margin: 0; padding: 10px 4px; font-size: 14px; background: #48426a; }
button.bp-feld.premium { background: #5a4a2a; }
button.bp-feld.abholbar { background: #2fb36d; animation: leuchten 1.4s ease-in-out infinite; }
button.bp-feld.abgeholt { opacity: 0.6; }

/* Haustier sitzt unten rechts neben dem Charakter */
.figur-gross { position: relative; }
.haustier { position: absolute; right: 0; bottom: 0; font-size: 42px; }
.haustier img { width: 56px; height: 56px; }
.fusszeile { margin-top: 30px; font-size: 14px; color: #b8b2d6; }
.fusszeile a { color: #b8b2d6; }

/* ===== Lobby: aufklappbare Bereiche, < Zahl >, Kategorie-Cards ===== */
details.aufklapp { background: #48426a; border-radius: 14px; padding: 4px 12px; margin: 10px 0; text-align: left; }
details.aufklapp > summary { font-size: 20px; font-weight: bold; padding: 10px 0; cursor: pointer; list-style: none; }
details.aufklapp > summary::-webkit-details-marker { display: none; }
details.aufklapp > summary::before { content: "›"; display: inline-block; width: 22px; transition: transform 0.2s; }
details.aufklapp[open] > summary::before { transform: rotate(90deg); }
.stepper-zeile { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 8px 0; }
.stepper { display: flex; align-items: center; gap: 6px; }
button.stepper-knopf { width: 44px; height: 44px; padding: 0; margin: 0; font-size: 22px; background: #2c2842; }
.stepper-wert { min-width: 64px; text-align: center; font-size: 20px; font-weight: bold; background: #2c2842; border-radius: 10px; padding: 9px 6px; }
.modus-schalter { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 16px 0 8px; font-weight: bold; }
.modus-werte { margin-bottom: 10px; }
.modus-block { display: flex; flex-direction: column; align-items: center; gap: 4px; transition: opacity 0.2s; }
.modus-block.inaktiv { opacity: 0.35; pointer-events: none; }
.kategorie-gitter { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 10px; }
button.kategorie-karte { position: relative; margin: 0; padding: 10px 8px 6px; background: #2c2842; border: 3px solid transparent; display: flex; flex-direction: column; align-items: center; }
button.kategorie-karte.an { border-color: #7c5cff; }
button.kategorie-karte:not(.an) { opacity: 0.5; }
.kat-name { font-weight: bold; font-size: 16px; }
.kat-bild { font-size: 46px; line-height: 1.2; }
.kat-haken { position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 6px; border: 2px solid #f2f0fa; font-size: 16px; line-height: 22px; }
button.kategorie-karte.an .kat-haken { background: #2fb36d; border-color: #2fb36d; }
.schwierigkeit-schalter { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 6px; font-size: 13px; }
.schwierigkeit-schalter.inaktiv { opacity: 0.35; }
.schwierigkeit-schalter input.schalter:checked { background: #e5484d; }
.einladen-knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.einladen-knoepfe button { margin: 0; font-size: 15px; padding: 12px 6px; }
.einladen-knoepfe button:first-child { grid-row: span 2; }
.freundes-liste { max-height: 40vh; overflow-y: auto; }

/* ===== Tier-Charaktere ===== */
/* Das Bild ist 1em groß – die Größe kommt also von der Schriftgröße des Kästchens drumherum */
.avatar { width: 1em; height: 1em; border-radius: 50%; border: 0.05em solid transparent; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; position: relative; margin: 0 auto; }
.avatar-tier { font-size: 0.6em; line-height: 1; }
.avatar-tier img { width: 1.4em; height: 1.4em; object-fit: contain; }
.avatar-extra { position: absolute; top: -0.02em; right: -0.02em; font-size: 0.28em; }
.figur-gross { font-size: 130px; }
button.profilbild { font-size: 58px; border: none; background: none; }
.spieler-bild { font-size: 40px; overflow: visible; background: none; }
.karten-bild { font-size: 64px; margin-bottom: 4px; }
.charakter-vorschau { display: flex; gap: 14px; align-items: center; text-align: left; margin: 10px 0; }
.charakter-vorschau .figur-gross { flex: 0 0 auto; }
.charakter-infos small { display: block; color: #b8b2d6; margin: 2px 0 6px; }
.charakter-infos p { margin: 0; }
.charakter-gitter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
button.charakter-karte { margin: 0; padding: 8px 4px; background: #48426a; border: 3px solid transparent; }
button.charakter-karte .karten-bild { font-size: 52px; }
button.charakter-karte small { display: block; font-size: 12px; line-height: 1.2; }
button.charakter-karte.gewaehlt { border-color: #f5c542; background: #5a4f8a; }
button.charakter-karte.gesperrt { opacity: 0.45; filter: grayscale(0.8); }
.shop-karte.gekauft { opacity: 0.6; }
.shop-detail .detail-bild { font-size: 150px; }
.shop-detail .sammel-bild.detail-bild { font-size: 90px; height: auto; }
.detail-text { font-style: italic; font-size: 18px; }
@media (max-width: 420px) {
  .charakter-gitter { grid-template-columns: repeat(3, 1fr); }
  .figur-gross { font-size: 100px; }
}

/* Erfolge-Liste */
.erfolg-eintrag { background: #48426a; border-radius: 12px; padding: 12px 14px; margin: 8px 0; text-align: left; opacity: 0.75; }
.erfolg-eintrag.geschafft { opacity: 1; border-left: 5px solid #2fb36d; }
.erfolg-eintrag p { margin: 4px 0 8px; }
.erfolg-balken { height: 8px; background: #2c2842; border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
.erfolg-balken > div { height: 100%; background: #f5c542; }

/* Erfolg-Box oben rechts */
#erfolg-box { position: fixed; top: 12px; right: 12px; z-index: 10; display: flex; flex-direction: column; gap: 8px; }
.erfolg-meldung {
  display: flex; align-items: center; gap: 12px;
  background: #2c2842; border: 2px solid #f5c542; border-radius: 14px;
  padding: 10px 14px; max-width: 280px; text-align: left;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  animation: reinGleiten 0.4s ease-out;
}
.erfolg-meldung.weg { animation: rausGleiten 0.5s ease-in forwards; }
.erfolg-text small { color: #f5c542; display: block; }
.erfolg-haken { display: flex; flex-direction: column; align-items: center; font-size: 12px; color: #2fb36d; font-weight: bold; }
.erfolg-haken svg { width: 36px; height: 36px; }
.erfolg-haken circle { fill: none; stroke: #2fb36d; stroke-width: 4; stroke-dasharray: 150; stroke-dashoffset: 150; animation: zeichnen 0.5s 0.6s ease-out forwards; }
.erfolg-haken path { fill: none; stroke: #2fb36d; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: zeichnen 0.3s 1.1s ease-out forwards; }
.erfolg-haken span { opacity: 0; animation: einblenden 0.3s 1.3s forwards; }

/* Infobox mit Extra-Fakt nach der Antwort */
.infobox {
  background: #2c2842;
  border-left: 5px solid #f5c542;
  border-radius: 12px;
  padding: 12px 16px;
  margin: 14px 0 4px;
  text-align: left;
}
.infobox p { margin: 6px 0 0; }

/* Siegertreppchen auf dem Endbildschirm */
#treppchen { display: flex; align-items: flex-end; justify-content: center; gap: 8px; margin-bottom: 10px; }
.stufe { flex: 1; max-width: 140px; animation: hereingleiten 0.5s ease-out backwards; }
.stufe .name { font-weight: bold; }
.stufe .punktzahl { font-size: 14px; color: #b8b2d6; margin-bottom: 6px; }
.stufe .block { background: #48426a; border-radius: 10px 10px 0 0; font-size: 28px; font-weight: bold; padding-top: 10px; }
.platz1 .block { height: 110px; background: #f5c542; color: #1e1b2e; }
.platz2 .block { height: 80px; background: #b8c2d6; color: #1e1b2e; }
.platz3 .block { height: 60px; background: #cd8a4f; color: #1e1b2e; }
.platz1 { animation-delay: 0.3s; }
.platz3 { animation-delay: 0.15s; }

/* Rückblick: alle Fragen zum Aufklappen */
#rueckblick { text-align: left; }
#rueckblick details { background: #48426a; border-radius: 12px; padding: 10px 14px; margin: 8px 0; border-left: 5px solid #e5484d; }
#rueckblick details.richtig { border-left-color: #2fb36d; }
#rueckblick details.teilweise { border-left-color: #f5c542; }
#rueckblick summary { cursor: pointer; list-style: none; display: flex; gap: 8px; }
#rueckblick summary::-webkit-details-marker { display: none; }
#rueckblick .info-symbol { margin-left: auto; color: #f5c542; font-size: 20px; }
#rueckblick p { margin: 8px 0 0; color: #dcd8f0; }

/* Timer-Balken über der Frage */
#timer { display: none; height: 10px; background: #48426a; border-radius: 5px; overflow: hidden; }
#timer-balken { height: 100%; width: 100%; background: #4cd38a; transition: background 0.3s, width 0.1s linear; }
#timer-balken.knapp { background: #ff5c7a; }
#timer-zahl { margin: 6px 0; color: #b8b2d6; }

/* Neue Fragen und Antwort-Knöpfe gleiten von unten herein */
#spielfeld > * { animation: hereingleiten 0.3s ease-out backwards; }
#spielfeld > :nth-child(2) { animation-delay: 0.05s; }
#spielfeld > :nth-child(3) { animation-delay: 0.1s; }
#spielfeld > :nth-child(4) { animation-delay: 0.15s; }
#spielfeld > :nth-child(5) { animation-delay: 0.2s; }

@keyframes einblenden {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes hereingleiten {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulsieren {
  50% { transform: scale(1.05); }
}
@keyframes wackeln {
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
@keyframes hochzaehlen {
  40% { transform: scale(1.3); color: #4cd38a; }
}
@keyframes reinGleiten {
  from { transform: translateX(120%); }
  to { transform: translateX(0); }
}
@keyframes rausGleiten {
  to { transform: translateX(120%); opacity: 0; }
}
@keyframes zeichnen {
  to { stroke-dashoffset: 0; }
}

/* Seiten Impressum und Datenschutz */
.rechtstext { max-width: 720px; margin: 0 auto; text-align: left; line-height: 1.5; }
.rechtstext a { color: #b8a8ff; }
@keyframes leuchten {
  50% { box-shadow: 0 0 14px 2px #4cd38a; }
}
