/* Sanfte Seitenübergänge zwischen den Navigationen */
@view-transition {
  navigation: auto;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-display);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

h1 {
  margin-top: 0;
}

code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 0.1em 0.4em;
  border-radius: var(--radius-sm);
  font-size: 0.9em;
}

.error {
  color: var(--error);
}

/* ---------- Login ---------- */
.page-login {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 1rem;
}

.auth-card {
  background: var(--surface);
  padding: 2.5rem;
  border-radius: var(--radius);
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow-xl);
}

.auth-card h1 {
  margin: 0 0 0.25rem;
  text-align: center;
}

.subtitle {
  text-align: center;
  color: var(--text-muted);
  margin-top: 0;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--surface-2);
  border-radius: var(--radius-md);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--primary);
  border-color: transparent;
}

button {
  cursor: pointer;
  font-size: 1rem;
  border: none;
  border-radius: var(--radius-md);
}

/* ---------- Buttons: Basisklasse .btn + Modifier .btn--* ----------
   Geteilte Basis (auch für <a class="btn">): vereinheitlicht Cursor und
   Radius. Bewusst OHNE font-family — <button> behält die System-Schrift
   (S2-Entscheidung: nur Radius angleichen). Die Modifier liefern
   Farbe/Padding/Border etc. */
.btn {
  cursor: pointer;
  border-radius: var(--btn-radius);
}

#login-form button,
.btn--primary {
  background: var(--primary);
  color: var(--text-on-primary);
  padding: 0.7rem;
  font-weight: 600;
  transition: background 0.15s;
}

#login-form button:hover,
.btn--primary:hover {
  background: var(--primary-hover);
}

.hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 0;
  margin-top: 1.5rem;
}

/* ---------- Topbar (Komponente, via renderTopbar erzeugt) ---------- */
/* Aufbau: Logo (links) · Nav (mitte) · Stats (rechts) · XP-Bar (unten).
   Markup wird zentral in level.js generiert; alle Farben via Tokens. */
.topbar {
  --progress-h: 1.125rem;            /* Höhe der EP-Leiste — Single Source für alle Bezüge */
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-base);
  min-height: 64px;
  padding: 0 var(--space-lg);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* Nur wenn die EP-Leiste gerendert wird (eingeloggt), unten Platz dafür reservieren.
   Abgemeldet (nur Logo + Anmelden) bleibt der Header kompakt — kein Leerraum. */
.topbar:has(.topbar-progress) {
  min-height: calc(64px + var(--progress-h));
  padding-bottom: var(--progress-h);
}

/* Logo links: SVG-Logomark + Wordmark, klickbar → Dashboard */
.topbar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-shrink: 0;
  text-decoration: none;
}

.topbar-logo-mark {
  display: block;
  flex-shrink: 0;
}

.topbar-wordmark {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-weight: var(--fw-bold);
  letter-spacing: -0.5px;
  line-height: 1;
  color: var(--text);
}

.topbar-wordmark-accent {
  background: var(--gradient-text-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* Nav-Links in der Mitte mit URL-basiertem Active-State */
.topbar-nav {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.topbar-nav-link {
  font-size: var(--fs-body);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  padding: var(--space-sm) var(--space-base);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}

.topbar-nav-link:hover {
  color: var(--text);
}

.topbar-nav-link.active {
  color: var(--purple-500);
  font-weight: var(--fw-semibold);
  background: var(--brand-muted);
}

/* Deaktivierte Nav-Platzhalter (Team/Rangliste – Feature noch nicht gebaut).
   Als <span> nicht navigierbar; not-allowed-Cursor + Tooltip "Kommt bald". */
.topbar-nav-link--disabled,
.topbar-nav-link--disabled:hover {
  color: var(--text-subtle);
  cursor: not-allowed;
}

/* Hamburger-Button: nur auf Mobile sichtbar (siehe Media-Query unten) */
.topbar-hamburger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
}
.topbar-hamburger:hover {
  background: var(--brand-muted);
  color: var(--purple-500);
}

/* Auf schmalen Screens ausblenden, damit die Nav nicht überläuft */
@media (max-width: 768px) {
  .topbar-nav-link--disabled {
    display: none;
  }
}

/* Stats-Gruppe rechts: Pills · Level-Badge · Avatar */
.topbar-stats {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 5px var(--space-md);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  white-space: nowrap;
}

.topbar-pill--energy   { color: var(--energy); }
.topbar-pill--trophies { color: var(--gold); }

/* Level-Badge: eigenständiges Inline-SVG (Hexagon in Tier-Farbe, ggf. Prestige-Kreis),
   erzeugt in layout.js. Optik komplett aus dem SVG – hier nur Ausrichtung. */
.topbar-level-badge {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

/* EP-Progress-Bar am unteren Topbar-Rand: Füllung + lesbare EP-Zahl (volle Breite) */
.topbar-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--progress-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--border);
  overflow: hidden;
}

.topbar-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--gradient-brand);
  border-radius: 0 2px 2px 0;
  transition: width 0.4s ease;
}

/* EP-Zahl ("34 / 200 EP") zentriert über der Füllung; Token-Farbe für Text auf Brand-Gradient.
   text-shadow (einziger Nicht-Token-Wert) sichert Lesbarkeit über Füllung UND Track. */
.topbar-progress-text {
  position: relative;
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
  line-height: 1;
  color: var(--text-on-primary);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* Zurück-Link zum Eltern-Fach (über dem Themen-Titel auf fach.html) */
.breadcrumb-back {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s;
}

.breadcrumb-back:hover {
  color: var(--text);
}

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: var(--btn-border);
  padding: 0.4rem 0.8rem;
}

.btn--ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ---------- Container ---------- */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Tool-Modus: breiterer Container ohne künstliche Maximalbreite */
.container-tool {
  padding: 1.5rem;
}

/* ---------- Persönliches Dashboard ---------- */
.db-layout {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.db-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 2rem 2.5rem;
  flex-wrap: wrap;
}

.db-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 600;
}

.db-headline {
  margin: 0 0 0.25rem;
  font-size: 2rem;
}

.db-sub {
  margin: 0;
  color: var(--text-muted);
}

.btn--cta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--text-on-primary);
  padding: 0.85rem 1.75rem;
  border-radius: var(--radius-cta);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  transition: background 0.15s, transform 0.15s;
}

.btn--cta:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* Deko-Kind des CTA (Pfeil) — kein Button-Modifier, bleibt .btn-arrow */
.btn-arrow {
  font-size: 1.1rem;
  transition: transform 0.15s;
}

.btn--cta:hover .btn-arrow {
  transform: translateX(3px);
}

/* Stats-Reihe (4 Karten: Themen · Quiz-Punkte · Lerntage · Energie) */
.db-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

@media (max-width: 768px) {
  .db-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .db-stats {
    grid-template-columns: 1fr;
  }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.stat-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Letzte Aktivität */
.db-section-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

.db-recent-empty {
  background: var(--surface);
  border: 1px dashed var(--surface-2);
  border-radius: var(--radius);
  padding: 2.5rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.db-recent-icon {
  font-size: 2.5rem;
}

/* Liste der zuletzt gelernten Themen */
.db-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.db-recent-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
}

.db-recent-name {
  flex: 1;
  font-weight: 600;
  color: var(--text);
}

.db-recent-score {
  font-weight: 700;
  color: var(--text);
}

.db-recent-time {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Aktions-Karte (Trophäen-Tausch) im Stat-Grid */
.stat-card--action {
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.stat-card--action:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.stat-card--action .stat-value {
  font-size: 1.1rem;
}

.btn--ghost-sm {
  display: inline-block;
  background: transparent;
  color: var(--text-muted);
  border: var(--btn-border);
  border-radius: var(--btn-radius);
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  text-decoration: none;
}

.btn--ghost-sm:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* ---------- Fächerübersicht ---------- */
.page-sub {
  color: var(--text-muted);
  margin: -0.5rem 0 1.5rem;
}

/* ---------- Fach-Seite (Themen-Übersicht je Fach) ---------- */
.fach-seite-header {
  margin-bottom: 1.5rem;
}

.fach-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 600;
}

.fach-vollname {
  margin: 0 0 0.4rem;
  font-size: 1.75rem;
}

.fach-beschreibung {
  margin: 0;
  color: var(--text-muted);
}

/* Stats-Leiste: horizontale Reihe von Stat-Pillen */
.fach-stats-bar {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.stat-pill {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius-cta);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 130px;
}

.stat-pill-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stat-pill-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

/* Überschrift über dem Themen-Grid */
.themen-titel {
  margin: 0 0 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* Leer-Zustand wenn noch keine Themen vorhanden */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 2rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--surface-2);
  border-radius: var(--radius);
}

.empty-icon {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 0.75rem;
}

/* SVG-Icons (zentral via icons.js gerendert).
   Monochrome Icons erben die Textfarbe (currentColor); farbige Icons
   behalten ihre eigenen Farbverläufe. */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* Hinweis-Icons (Warnung / Platzhalter) in der Token-Warnfarbe */
.icon-hinweis {
  color: var(--warning);
}

/* Karten: Vollname als kleiner Untertitel unter dem Kürzel */
.card-vollname {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: 0.4rem;
  line-height: 1.3;
}

/* ---------- Fach-Karten ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.5rem;
  position: relative;
  transition: transform 0.15s, border-color 0.15s;
}

.card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

/* Abgeschlossenes Thema: grüner Rahmen */
.card--done {
  border-color: var(--success);
}

.card--done:hover {
  border-color: var(--success);
  filter: brightness(1.08);
}

/* Häkchen-Badge oben rechts für abgeschlossene Themen:
   gefüllter Erfolgs-Kreis mit weißem Haken */
.card-check {
  position: absolute;
  top: 0.9rem;
  right: 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--success);
  color: var(--text-on-primary);
}

/* Score-Badge: zeigt den letzten Quiz-Prozentwert */
.card-score {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--success);
  background: rgba(34, 197, 94, 0.12);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
}

.card-icon {
  display: block;
  margin-bottom: 0.5rem;
}

/* Illustratives Content-Icon (Fach-/Themen-SVG via <img>).
   Größe steuert die Variable --icon-size; der Helper setzt nur
   style="--icon-size: 3rem" (Karten) bzw. 1.25rem (Profil-Zeile).
   Default 3rem, falls die Variable fehlt. */
.content-icon {
  display: inline-block;
  width: var(--icon-size, 3rem);
  height: var(--icon-size, 3rem);
  object-fit: contain;
  vertical-align: middle;
}

/* Fallback-Badge: erster Buchstabe in farbigem Kreis (solange keine SVG da ist).
   Größe + font-size leiten sich aus --icon-size ab — Berechnung lebt im CSS,
   nicht im JS. Hintergrund nutzt --primary (kein dedizierter Brand-Token in
   tokens.css vorhanden). */
.content-icon-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--icon-size, 3rem);
  height: var(--icon-size, 3rem);
  vertical-align: middle;
  border-radius: var(--radius-full);
  background: var(--primary);
  color: var(--text-on-primary);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: calc(var(--icon-size, 3rem) * 0.5);
  line-height: 1;
  user-select: none;
}

.card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}

.card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--surface-2);
  /* Mobile: horizontal scrollen statt umbrechen, wenn Reiter zu schmal werden */
  overflow-x: auto;
  flex-wrap: nowrap;
}

.tab {
  background: transparent;
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  border-radius: 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}

.tab.active {
  color: var(--text);
  border-bottom-color: var(--primary);
}

.tab:hover {
  color: var(--text);
}

/* ---------- Theorie ---------- */
.theorie-block {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  border: 1px solid var(--surface-2);
}

.theorie-block h3 {
  margin-top: 0;
  color: var(--primary);
}

.theorie-block p {
  margin-bottom: 0;
}

/* ---------- Quiz ---------- */
.frage {
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 0 0 1rem;
}

.frage legend {
  font-weight: 600;
  padding: 0 0.5rem;
}

.option {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0;
  color: var(--text);
  cursor: pointer;
}

.frage.correct {
  border-color: var(--success);
}

.frage.wrong {
  border-color: var(--error);
}

.quiz-result {
  margin-top: 1rem;
  font-weight: 600;
  font-size: 1.1rem;
}

/* ---------- Footer (fix unten) ---------- */
.site-footer {
  margin-top: auto;
  width: 100%;
  background: var(--surface);
  border-top: 1px solid var(--surface-2);
  padding: 12px 24px;
  display: flex;
  justify-content: center;
}

.footer-inner {
  display: flex;
  gap: 24px;
  align-items: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.footer-inner nav {
  display: flex;
  gap: 16px;
}

.footer-inner a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-speed, 0.15s);
}

.footer-inner a:hover {
  color: var(--primary);
}

/* ---------- Fach-Level-Leiste ---------- */
.fach-level-leiste {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.fach-level-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.fach-level-info strong {
  color: var(--text);
}

.fach-level-bar {
  background: var(--surface-2);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
}

#fach-level-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.fach-level-leiste small {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ---------- Dashboard: Fortschrittsbalken & Hinweis in Stat-Karte ---------- */
.stat-progress-bar {
  background: var(--surface-2);
  border-radius: var(--radius-full);
  height: 6px;
  overflow: hidden;
  margin-top: 0.5rem;
  width: 100%;
}

.stat-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

/* ---------- Tages-Quiz Karte (Dashboard) ---------- */
.tagesquiz-card {
  background: var(--surface);
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.tagesquiz-card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.3rem;
}

.tagesquiz-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Tages-Quiz Seite ---------- */
.quiz-screen {
  display: flex;
  justify-content: center;
  padding: 3rem 1rem;
}

/* .quiz-screen[hidden] hat Spezifität 0,2,0 und schlägt .quiz-screen (0,1,0) —
   nötig weil display:flex das hidden-Attribut sonst übertrumpft. */
.quiz-screen[hidden] {
  display: none;
}

.quiz-screen-inner {
  text-align: center;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.quiz-screen-icon {
  font-size: 4rem;
  display: block;
}

.quiz-screen-inner h2 {
  margin: 0;
  font-size: 1.75rem;
}

.quiz-screen-inner p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.quiz-screen-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.5rem;
}

.quiz-energie-hinweis {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  font-size: 0.9rem;
}

.btn--lg {
  padding: 0.85rem 2rem;
  font-size: 1.05rem;
}

/* Tagesquiz: einheitliche Breite während des Quiz-Flows, damit der
   Wechsel von #screen-start zu #screen-quiz keinen Layout-Sprung erzeugt. */
#screen-quiz {
  max-width: 100%;
  margin-inline: auto;
}

@media (min-width: 600px) {
  #screen-quiz {
    max-width: 600px;
  }
}

/* Lebensbalken */
.leben-container {
  margin-bottom: 1.5rem;
}

.leben-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.leben-bar {
  background: var(--surface-2);
  border-radius: var(--radius-full);
  height: 12px;
  overflow: hidden;
}

#leben-fill {
  height: 100%;
  background: var(--success);
  border-radius: var(--radius-full);
  transition: width 0.3s ease, background 0.3s ease;
}

#leben-fill.leben-niedrig {
  background: var(--error);
}

/* Frage-Flow */
.frage-zaehler {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.frage-container {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.frage-text {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.5;
}

.antwort-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.antwort-btn {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
}

.antwort-btn:hover:not(:disabled) {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--text-on-primary);
}

.antwort-btn:disabled {
  cursor: default;
}

.antwort-btn.antwort-richtig {
  background: rgba(34, 197, 94, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.antwort-btn.antwort-falsch {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--error);
  color: var(--error);
}

.feedback-box {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}

.feedback-richtig {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.feedback-falsch {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

/* Ergebnis-Screen */
.ergebnis-score {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}

.ergebnis-belohnungen {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  width: 100%;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.ergebnis-zeile {
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.ergebnis-highlight {
  color: var(--text);
  font-weight: 700;
}

/* ---------- Prestige-Feier (Zyklus-Abschluss) ---------- */
.ergebnis-prestige {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  animation: prestige-pop 0.5s ease-out both;
}

/* Runder Badge in der bestehenden Prestige-Bildsprache (oranger Kreis + weiße
   Zahl, wie der Sub-Kreis im Topbar-Level-Badge), mit Gold-Ring und Gold-Glow. */
.prestige-badge {
  width: 96px;
  height: 96px;
  border-radius: var(--radius-full);
  background: var(--prestige);
  border: 3px solid var(--gold);
  box-shadow: var(--glow-gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
}

.prestige-badge-zahl {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-display);
  line-height: 1;
  color: var(--text-on-primary);
}

.prestige-badge-label {
  font-size: var(--fs-label);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-primary);
}

/* Höhere Spezifität als .quiz-screen-inner p (setzt sonst muted-Farbe/Margin). */
.ergebnis-prestige .prestige-titel {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-h2);
  color: var(--prestige);
}

@keyframes prestige-pop {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* ---------- Tausch-Seite ---------- */
.tausch-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tausch-werte {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  justify-content: center;
}

.tausch-wert {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.tausch-icon {
  font-size: 2.5rem;
}

.tausch-zahl {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.tausch-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.tausch-pfeil {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.tausch-kurs {
  text-align: center;
  background: var(--surface-2);
  border-radius: var(--radius);
  padding: 0.6rem 1rem;
  font-size: 1rem;
  color: var(--text-muted);
}

.tausch-meldung {
  text-align: center;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
}

.tausch-erfolg {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.tausch-fehler {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

.tausch-hinweis {
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* ---------- Statische Seiten (Impressum, Datenschutz) ---------- */
.static-content {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 720px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.static-content h2 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--primary);
}

.static-content p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.6;
}

.static-hinweis {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Mobile Grundoptimierung ---------- */
@media (max-width: 768px) {
  .topbar {
    padding: 0 var(--space-md);
    gap: var(--space-sm);
  }

  /* Wordmark ausblenden – nur Logomark bleibt, spart Breite */
  .topbar-wordmark {
    display: none;
  }

  .topbar-stats {
    gap: var(--space-xs);
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

  /* Hamburger sichtbar; Nav wird zum abklappbaren Panel unter der Topbar */
  .topbar-hamburger {
    display: inline-flex;
  }

  .topbar-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-xs);
    margin: 0;
    padding: var(--space-sm);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    display: none;
  }

  .topbar--nav-open .topbar-nav {
    display: flex;
  }

  .topbar-nav-link {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .antwort-grid {
    grid-template-columns: 1fr;
  }

  .btn--primary {
    width: 100%;
    text-align: center;
  }
}

/* ---------- Profil-Seite ---------- */
.profil-section {
  margin-bottom: 2.5rem;
}

.profil-section-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 1rem;
}

.profil-global-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.profil-level-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.profil-level-badge {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.profil-ep-text {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Rang-Zeile unter der Level-Anzeige: Tier-Name (eingefärbt) · Level · ggf. Prestige */
.profil-rang {
  font-size: var(--fs-caption);
  opacity: 0.9;
  margin-top: 4px;
}
.profil-rang-tier[data-tier="bronze"] { color: #CD7F32; font-weight: 600; }
.profil-rang-tier[data-tier="silber"] { color: #A0A0A0; font-weight: 600; }
.profil-rang-tier[data-tier="gold"]   { color: #FFD700; font-weight: 600; }
.profil-rang-tier[data-tier="platin"] { color: #00CFFF; font-weight: 600; }

.profil-bar-wrap {
  height: 10px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.profil-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.profil-global-stats {
  display: flex;
  gap: 2.5rem;
  padding-top: 0.25rem;
}

.profil-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.profil-stat-icon {
  font-size: 1.3rem;
}

.profil-stat-wert {
  font-size: 1.2rem;
  font-weight: 700;
}

.profil-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.profil-faecher {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.profil-lade-text {
  color: var(--text-muted);
  margin: 0;
}

.profil-fach-row {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  display: grid;
  grid-template-columns: 2fr 80px 3fr 80px;
  align-items: center;
  gap: 1rem;
}

.profil-fach-name {
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profil-fach-level {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.profil-fach-bar-wrap {
  height: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.profil-fach-bar-fill {
  height: 100%;
  background: var(--primary);
  border-radius: var(--radius-full);
  transition: width 0.4s ease;
}

.profil-fach-antworten {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
  white-space: nowrap;
}

.profil-grafik-wrap {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.25rem;
}

#level-grafik {
  width: 100%;
  height: auto;
  display: block;
}

.profil-grafik-hinweis {
  margin: 0.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 600px) {
  .profil-fach-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
  }

  .profil-fach-bar-wrap {
    grid-column: 1 / -1;
  }

  .profil-global-stats {
    gap: 1.25rem;
  }
}

/* Allgemeine Profil-Karte (Einstellungen, Konto) */
.profil-card {
  background: var(--surface);
  border: 1px solid var(--surface-2);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Konto-Zeile: Label links, Wert rechts */
.profil-konto-zeile {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.profil-konto-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.profil-konto-wert {
  font-weight: 600;
  word-break: break-all;
}

.profil-abmelden-btn {
  align-self: flex-start;
  color: var(--error);
  border-color: var(--error);
}

.profil-abmelden-btn:hover {
  color: var(--error);
  border-color: var(--error);
  filter: brightness(1.15);
}

/* Platzhalter-Box für zukünftige Sektionen */
.profil-placeholder {
  background: var(--surface);
  border: 1px dashed var(--surface-2);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.profil-placeholder-icon {
  font-size: 2rem;
}

.profil-placeholder p {
  margin: 0;
  font-size: 0.9rem;
}

/* Einstellungs-Zeile: Info links, Toggle rechts */
.profil-setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.profil-setting-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.profil-setting-label {
  font-weight: 600;
  font-size: 0.95rem;
}

.profil-setting-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.profil-setting-hinweis {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--surface-2);
  padding-top: 0.75rem;
}
