/* ==========================================================================
   ScanTo — Scanning-spezifisches CSS
   Nutzt AssistUK-Tokens (tokens.css) — gleiche Optik wie GazeTo/TouchTo.
   ========================================================================== */

:root {
  --scan-focus: #f59e0b;          /* Bernstein — hochkontrastiger Scan-Fokus */
  --scan-focus-row: #fcd34d;      /* helleres Gelb für Zeilen-Highlight */
  --scan-select: #10b981;         /* Grün — Bestätigung */
  --scan-dim-opacity: 0.32;
}

[data-theme="contrast"] {
  --scan-focus: #ffd400;
  --scan-focus-row: #ffe680;
  --scan-select: #00e08a;
  /* 31.10.2026: gedimmt bleibt lesbar (0.18 ergab Text um 1,5:1). */
  --scan-dim-opacity: 0.75;
}

/* CVI-Theme: maximaler Kontrast, reduzierte Komplexität (Gelb auf Schwarz),
   größere Schrift. Für Cerebral Visual Impairment (Forschung: ~100% der
   CVI-AAC-Nutzer profitieren). Am besten mit auditivem Scanning kombiniert. */
[data-theme="cvi"] {
  --color-bg: #000;
  --color-surface: #000;
  --color-text: #ffe600;
  --color-text-secondary: #ffe600;
  --color-text-muted: #cccc00;
  --color-border: #ffe600;
  --color-primary: #ffe600;
  --color-primary-dark: #ffe600;
  --color-primary-bg: #1a1a00;
  --scan-focus: #ffe600;
  --scan-focus-row: #fff04d;
  --scan-select: #00ff88;
  /* 31.10.2026: gedimmt = Gelb auf Schwarz, leicht zurueckgenommen (rund 6:1 statt 1,1:1).
     Der Fokus bleibt eindeutig: voller Ring 7px + Leuchten, gedimmte Felder ohne Ring. */
  --scan-dim-opacity: 0.6;
}
[data-theme="cvi"] body { background: #000; color: #ffe600; }
[data-theme="cvi"] .scan-card { background: #000; border-color: #ffe600; color: #ffe600; }
[data-theme="cvi"] .scan-card__label, [data-theme="cvi"] .scan-prompt { color: #ffe600; }
[data-theme="cvi"] .scan-prompt { font-size: 2rem; }
[data-theme="cvi"] .scan-card__emoji { font-size: 4rem; }
[data-theme="cvi"] .statusbar, [data-theme="cvi"] .bottom-nav { background: #000; border-color: #ffe600; }
[data-theme="cvi"] .bottom-nav__item { color: #cccc00; }
[data-theme="cvi"] .bottom-nav__item.is-active { color: #ffe600; }
[data-theme="cvi"] .btn-primary-blue { background: #ffe600; color: #000; }
[data-theme="cvi"] .btn-ghost-pill, [data-theme="cvi"] .btn--outline { background: #000; color: #ffe600; border-color: #ffe600; }
[data-theme="cvi"] .scan-focus { box-shadow: 0 0 0 7px #ffe600, 0 0 30px rgba(255,230,0,0.8) !important; }
[data-theme="cvi"] .runner-bar__stufe { background: #ffe600; color: #000; }
/* Gesperrte Felder: sonst Browser-Grau rgba(16,16,16,.3) = 2:1 auf Weiss. */
[data-theme="contrast"] .scan-card:disabled { color: #000; }

/* ── App-Grundlayout ──────────────────────────────────────────────────── */
body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--color-bg, #f5f5f7);
  color: var(--color-text, #1a1a1a);
  line-height: 1.5;
}
#app { min-height: 100vh; display: flex; flex-direction: column; }
#app-content { flex: 1; padding: 20px 22px 96px; max-width: 1100px; margin: 0 auto; width: 100%; box-sizing: border-box; }

.page { width: 100%; }
.page-head { margin-bottom: 18px; }
.page-title { font-family: 'Merriweather', Georgia, serif; font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 6px; color: var(--color-primary-dark, #3a5a7c); }
.page-lead { font-size: 1.05rem; color: var(--color-text-secondary, #4a4a4a); margin: 0; }
.section__title { font-family: 'Merriweather', Georgia, serif; font-size: 1.4rem; margin: 0 0 14px; color: var(--color-primary-dark, #3a5a7c); }
.eyebrow { display: inline-block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-primary, #4b698c); margin-bottom: 8px; }

/* ── Statusbar / Nav ──────────────────────────────────────────────────── */
.statusbar {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 20px; background: rgba(255,255,255,0.95);
  border-bottom: 1px solid var(--color-border, #e4e7ee);
  position: sticky; top: 0; z-index: 20;
}
.statusbar__brand { display: flex; align-items: center; gap: 10px; border: none; background: none; cursor: pointer; font-weight: 800; font-size: 1.15rem; color: var(--color-brand-deep, #1a3a6a); }
.statusbar__brand-logo img { width: 30px; height: 30px; border-radius: 7px; display: block; }
.statusbar__spacer { flex: 1; }
/* Pill-Buttons in GazeTo-Optik: transparent, beim Hover/Aktiv gefüllt. */
.statusbar__btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 999px; border: 1px solid transparent;
  background: transparent; color: var(--color-text-secondary, #4a4a4a);
  font-family: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer;
  min-height: 48px; min-width: 48px;
  transition: background 0.15s, color 0.15s;
}
.statusbar__btn:hover { background: var(--color-primary-bg, #eef2f7); color: var(--color-text, #1a1a1a); }
.statusbar__btn.is-on { background: var(--color-primary, #4b698c); color: #fff; }
.statusbar__btn i, .statusbar__btn svg { width: 20px; height: 20px; }
.statusbar__btn--font { font-weight: 800; font-size: 1rem; }
.statusbar__avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #fff;
  font-weight: 800; font-size: 18px;
  border: 2px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  background: var(--color-primary, #4b698c);
  cursor: pointer; flex-shrink: 0;
}
@media (max-width: 900px) {
  .statusbar__btn-label { display: none; }
  .statusbar__btn--font .statusbar__btn-label { display: inline; } /* A−/A+ = Label selbst */
}

/* Vorlesen: Markierung des gerade gesprochenen Elements */
.tts-reading {
  background: rgba(75, 105, 140, 0.16) !important;
  outline: 2px solid var(--color-primary, #4b698c);
  outline-offset: 3px;
  border-radius: 6px;
  scroll-margin: 120px;
}
[data-theme="contrast"] .tts-reading, [data-theme="cvi"] .tts-reading {
  background: rgba(255, 214, 10, 0.28) !important;
  outline-color: #ffd60a;
}

/* Schriftgröße (Statusbar A−/A+) */
html[data-font-scale="s"]  { font-size: 15px; }
html[data-font-scale="m"]  { font-size: 16px; }
html[data-font-scale="l"]  { font-size: 17.5px; }
html[data-font-scale="xl"] { font-size: 19px; }

.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around; align-items: center;
  background: #fff; border-top: 1px solid var(--color-border, #e4e7ee);
  padding: 6px 0 max(6px, env(safe-area-inset-bottom));
}
.bottom-nav__item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: none; background: none; cursor: pointer; padding: 6px 14px;
  color: var(--color-text-muted, #525252); font-size: 0.8rem; font-weight: 600; min-height: 56px;
}
.bottom-nav__item i { width: 24px; height: 24px; }
.bottom-nav__item.is-active { color: var(--color-primary, #4b698c); }

/* Erhobener Mittel-Button „Mein Bereich" (GazeTo-Disc) */
.bottom-nav__item--primary { position: relative; justify-content: flex-end; }
.bottom-nav__primary-disc {
  display: flex; align-items: center; justify-content: center;
  width: 60px; height: 60px; border-radius: 50%;
  margin-top: -30px; margin-bottom: 2px;
  background: linear-gradient(140deg, #4b698c, #2f4a6b);
  color: #fff;
  border: 4px solid #fff;
  box-shadow: 0 8px 22px rgba(75, 105, 140, 0.5), 0 2px 6px rgba(0, 0, 0, 0.22);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}
.bottom-nav__primary-disc i, .bottom-nav__primary-disc svg { width: 28px; height: 28px; color: #fff; }
.bottom-nav__item--primary .bottom-nav__label { color: var(--color-primary, #4b698c); font-weight: 700; }
.bottom-nav__item--primary:hover .bottom-nav__primary-disc { transform: translateY(-2px) scale(1.04); }
.bottom-nav__item--primary.is-active .bottom-nav__primary-disc {
  transform: scale(1.06);
  box-shadow: 0 10px 26px rgba(75, 105, 140, 0.6), 0 0 0 3px rgba(255, 214, 10, 0.5);
}
[data-theme="cvi"] .bottom-nav__primary-disc { background: #ffe600; border-color: #000; }
[data-theme="cvi"] .bottom-nav__primary-disc i, [data-theme="cvi"] .bottom-nav__primary-disc svg { color: #000; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn-primary-blue {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-primary, #4b698c); color: #fff; border: none;
  padding: 14px 26px; border-radius: 999px; font-size: 1.05rem; font-weight: 700;
  cursor: pointer; min-height: 56px;
}
.btn-primary-blue i { width: 20px; height: 20px; }
.btn-ghost-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: #fff; color: var(--color-primary-dark, #3a5a7c);
  border: 1.5px solid var(--color-border, #e4e7ee);
  padding: 12px 22px; border-radius: 999px; font-size: 1rem; font-weight: 700;
  cursor: pointer; min-height: 52px;
}
.btn-ghost-pill i { width: 18px; height: 18px; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }
.btn { padding: 12px 18px; border-radius: 12px; font-size: 0.95rem; font-weight: 700; cursor: pointer; min-height: 48px; }
.btn--outline { background: #fff; border: 1.5px solid var(--color-border, #e4e7ee); color: var(--color-text, #1a1a1a); }
.btn--active { background: var(--color-primary, #4b698c); color: #fff; border-color: var(--color-primary, #4b698c); }

/* ── Home ─────────────────────────────────────────────────────────────── */
.home-hero { padding: 24px 0 8px; }
.home-hero__title { font-family: 'Merriweather', Georgia, serif; font-size: clamp(1.9rem, 5vw, 2.8rem); margin: 0 0 12px; line-height: 1.1; color: var(--color-primary-dark, #3a5a7c); }
.home-hero__lead { font-size: 1.1rem; color: var(--color-text-secondary, #4a4a4a); max-width: 640px; margin: 0 0 20px; }
.home-hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.home-stufen { margin-top: 32px; }
.stufen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.stufe-card {
  position: relative; text-align: left; border: 2px solid var(--st-color, #4b698c);
  border-radius: 16px; background: #fff; padding: 16px 14px; cursor: pointer;
  display: flex; flex-direction: column; gap: 6px; min-height: 130px;
}
.stufe-card__num { width: 32px; height: 32px; border-radius: 50%; color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.stufe-card__icon i { width: 26px; height: 26px; color: var(--st-color, #4b698c); }
.stufe-card__name { font-weight: 800; font-size: 1.05rem; color: var(--color-text, #1a1a1a); }
.stufe-card__short { font-size: 0.85rem; color: var(--color-text-muted, #525252); }
.home-note { margin-top: 24px; font-size: 0.9rem; color: var(--color-text-muted, #525252); display: flex; align-items: flex-start; gap: 6px; }
.home-note i { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

/* ── Activities list (GazeTo-Kacheln mit Bild) ────────────────────────── */
.act-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.act-tile {
  background: #fff; border: 1px solid var(--color-border, #e4e7ee);
  border-radius: 22px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; text-align: left;
  display: flex; flex-direction: column; padding: 0;
}
.act-tile:hover { transform: translateY(-5px); box-shadow: 0 10px 26px rgba(0,0,0,0.12); }
.act-tile__media { position: relative; width: 100%; aspect-ratio: 4/3; background: var(--color-primary-bg, #eef2f7); overflow: hidden; }
.act-tile__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.act-tile__placeholder {
  position: absolute; inset: 0; display: grid; place-items: center;
  color: var(--color-primary, #4b698c);
}
.act-tile__placeholder i, .act-tile__placeholder svg { width: 40px; height: 40px; }
.act-tile__chip {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  font-size: 11px; font-weight: 700; color: #fff;
  padding: 4px 10px; border-radius: 999px; letter-spacing: 0.04em;
}
.act-tile__body { padding: 14px 16px 18px; }
.act-tile__title { font-family: 'Merriweather', Georgia, serif; font-weight: 700; font-size: 1.05rem; color: var(--color-text, #1a1a1a); margin: 0 0 3px; }
.act-tile__focus {
  font-size: 13px; color: var(--color-text-secondary, #4a4a4a); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Stern (→ "Mein Bereich") oben rechts auf der Medienfläche */
.act-tile__star {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  line-height: 1; padding: 0; color: #9ca3af;
  transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.act-tile__star:hover { transform: scale(1.1); }
.act-tile__star i, .act-tile__star svg { width: 24px; height: 24px; stroke: currentColor; fill: none; }
.act-tile__star.is-on { color: #f59e0b; background: rgba(255, 251, 235, 0.97); }
.act-tile__star.is-on svg { fill: currentColor; }
[data-theme="cvi"] .act-tile { background: #000; border-color: #ffe600; }
[data-theme="cvi"] .act-tile__title { color: #ffe600; }
[data-theme="cvi"] .act-tile__media { background: #1a1a00; }

/* Stufen-Abschnitte in der Übungs-Übersicht */
.act-stufe-section { margin-bottom: 28px; }
.act-stufe-head { margin: 8px 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--st-color, #4b698c); }
.act-stufe-head__title { display: flex; align-items: center; gap: 12px; }
.act-stufe-head__num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 800; font-size: 1.1rem;
}
.act-stufe-head__label { font-weight: 800; font-size: 1.35rem; }
.act-stufe-head__sub { display: block; margin-top: 4px; font-size: 0.9rem; color: var(--color-text-secondary, #4a4a4a); }

/* ── Runner ───────────────────────────────────────────────────────────── */
.page-runner { display: flex; flex-direction: column; height: calc(100vh - 140px); }
.runner-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; flex-wrap: wrap; }
.runner-bar__title { display: flex; align-items: center; gap: 10px; }
.runner-bar__stufe { font-size: max(14px, 0.875rem); line-height: 1.2; font-weight: 700; background: var(--color-primary, #4b698c); color: #fff; padding: 3px 10px; border-radius: 999px; }
.runner-bar__name { font-weight: 800; font-size: 1.2rem; }
.runner-bar__ctrls { display: flex; gap: 8px; }
.runner-ctrl { padding: 10px 16px; min-height: 48px; }
.runner-hint { font-size: 0.95rem; color: var(--color-text-secondary, #4a4a4a); background: var(--color-primary-bg, #eef2f7); border-radius: 10px; padding: 10px 14px; margin-bottom: 12px; }
.runner-stage { flex: 1; min-height: 360px; position: relative; }

/* ── Scan-Bühne (Aktivitäten) ─────────────────────────────────────────── */
.scan-stage { width: 100%; height: 100%; display: flex; flex-direction: column; }
.scan-prompt { font-size: 1.5rem; font-weight: 800; text-align: center; margin-bottom: 16px; color: var(--color-primary-dark, #3a5a7c); }
.scan-progress { text-align: center; font-size: 0.95rem; color: var(--color-text-muted, #525252); margin-top: 12px; }

.scan-grid { display: grid; gap: 16px; flex: 1; align-content: center; }
.scan-grid--row { grid-template-columns: repeat(3, 1fr); }
.scan-grid--3x3 { grid-template-columns: repeat(3, 1fr); max-width: 560px; margin: 0 auto; width: 100%; }

.scan-card {
  border: 3px solid var(--color-border, #e4e7ee); border-radius: 20px; background: #fff;
  cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; padding: 20px; min-height: 130px; transition: opacity 0.15s, transform 0.1s;
}
.scan-card--grid { min-height: 110px; }
.scan-card__emoji { font-size: 3.2rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.scan-card__img { width: 84px; height: 84px; object-fit: contain; display: block; }
.scan-card--grid .scan-card__img { width: 72px; height: 72px; }
.seq-output .scan-card__img, .seq-out-item .scan-card__img { width: 40px; height: 40px; }
.scan-card__label { font-size: 1.1rem; font-weight: 700; }
[data-theme="cvi"] .scan-card__img { filter: drop-shadow(0 0 2px #ffe600); }

.scan-bigtarget { transition: opacity 0.15s; }
.scan-bigtarget__hint { transition: opacity 0.4s; pointer-events: none; }

/* ── Scan-Fokus-Visualisierung (Kern!) ────────────────────────────────── */
.scan-focus {
  border-color: var(--scan-focus, #f59e0b) !important;
  box-shadow: 0 0 0 var(--scan-focus-width, 5px) var(--scan-focus, #f59e0b), 0 0 22px rgba(245,158,11,0.55) !important;
  transform: scale(1.04);
  outline: none;
}
.scan-focus-row {
  border-color: var(--scan-focus-row, #fcd34d) !important;
  box-shadow: 0 0 0 var(--scan-focus-width, 5px) var(--scan-focus-row, #fcd34d) !important;
}
.scan-dim { opacity: var(--scan-dim-opacity, 0.32); }
/* Kontrastlauf 31.10.2026 (hell): Knöpfe mit Text bleiben gedimmt lesbar (.82 wie Fahrt/Bowling,
   der Fokus bleibt der volle Ring); gesperrte Karten nicht im Browser-Grau rgba(16,16,16,.3) = 2:1. */
.world-controls .kunst-knopf.scan-dim, .miteinander .atelier__bar .kunst-knopf.scan-dim, .schatz .schatz__kiste.scan-dim { opacity: 0.82; }
:where(html:not([data-theme="cvi"]):not([data-theme="contrast"])) .scan-card:disabled { color: #555; }
.scan-selected {
  border-color: var(--scan-select, #10b981) !important;
  box-shadow: 0 0 0 6px var(--scan-select, #10b981), 0 0 28px rgba(16,185,129,0.6) !important;
  transform: scale(1.07);
}

/* ── Zeile-Spalte eindeutig: Zeilen-Balken + Feldrahmen (01.11.2026) ──────────
   Die Engine (scan-engine.js, „Zeilen-Balken“) legt EIN Overlay um alle Felder der
   aktiven Zeile (.scan-balken--zeile) und in der Feldphase einen starken Rahmen um
   genau ein Feld (.scan-feld-rahmen); die gewählte Zeile bleibt als schwacher Balken
   (.scan-balken--gewaehlt). Felder anderer Zeilen: .scan-aus (deutlich gedimmt).
   Unabhängig von der Familien-CSS: die Overlays liegen über der Übung (fixed, 2030),
   unter Titel/Hinweis/Pause/Stopp (2040/2050). Farbe/Breite folgen „Scan-Markierung“.
   Doppelrand (Kante innen + außen) hält ≥ 3:1 auf hellem UND dunklem Grund. */
:root {
  --scan-balken: var(--scan-focus, #f59e0b);
  /* Schwarz statt Dunkelbraun: auf mittelbraunen Bretträndern (Schach, Leuchtdichte ~0,12) erreichten
     weder Bernstein noch Braun 3:1 (gemessen 2,9 bzw. 2,0) — Schwarz 3,4:1, auf Weiß 21:1. */
  --scan-balken-kante: #000;
  --scan-balken-glow: rgba(245, 158, 11, 0.45);
  --scan-balken-flaeche: rgba(245, 158, 11, 0.10);
  --scan-balken-breite: calc(var(--scan-focus-width, 5px) + 2px);
  --scan-aus-opacity: 0.38;
}
[data-theme="contrast"] { --scan-balken-glow: rgba(255, 212, 0, 0.35); --scan-balken-flaeche: rgba(255, 212, 0, 0.12); --scan-aus-opacity: 0.45; }
[data-theme="cvi"] { --scan-balken-glow: rgba(255, 230, 0, 0.30); --scan-balken-flaeche: transparent; --scan-aus-opacity: 0.42; }
.scan-balken, .scan-feld-rahmen {
  position: fixed; z-index: 2030; pointer-events: none; box-sizing: border-box; margin: 0;
  border: var(--scan-balken-breite) solid var(--scan-balken); border-radius: 16px;
  box-shadow: 0 0 0 3px var(--scan-balken-kante), inset 0 0 0 3px var(--scan-balken-kante), 0 0 24px 6px var(--scan-balken-glow);
  background: var(--scan-balken-flaeche);
}
/* Feldphase: Zeile nur noch als schwacher Balken — man sieht, wo man ist */
.scan-balken--gewaehlt {
  border-width: 3px; background: transparent;
  box-shadow: 0 0 0 2px var(--scan-balken-kante), inset 0 0 0 2px var(--scan-balken-kante);
}
.scan-feld-rahmen {
  z-index: 2031; border-width: calc(var(--scan-focus-width, 5px) + 3px); border-radius: 18px; background: transparent;
  animation: scan-feld-puls 1.6s ease-in-out infinite;
}
@keyframes scan-feld-puls {
  50% { box-shadow: 0 0 0 3px var(--scan-balken-kante), inset 0 0 0 3px var(--scan-balken-kante), 0 0 8px 2px var(--scan-balken-glow); }
}
[data-theme="cvi"] .scan-balken, [data-theme="cvi"] .scan-feld-rahmen {   /* Gelb auf Schwarz, schwarzer Doppelrand */
  box-shadow: 0 0 0 4px #000, inset 0 0 0 4px #000, 0 0 22px 4px var(--scan-balken-glow);
}
[data-theme="cvi"] .scan-balken--gewaehlt { box-shadow: 0 0 0 3px #000, inset 0 0 0 3px #000; }
/* Andere Zeilen deutlich zurück (schlägt die milden .scan-dim-Werte der Familien) */
.scan-aus { opacity: var(--scan-aus-opacity, 0.38) !important; }
/* Im Balken-Modus trägt der Balken die Zeile: kein zusätzlicher Ring je Feld aus dieser Datei */
.scan-focus-row:not(.scan-focus) { box-shadow: none !important; }
html[data-scan-zeile="felder"] .scan-focus-row:not(.scan-focus) { box-shadow: 0 0 0 var(--scan-focus-width, 5px) var(--scan-focus-row, #fcd34d) !important; }
@media (prefers-reduced-motion: reduce) {
  .scan-feld-rahmen { animation: none !important; }
}
/* Pause → „Ton anpassen“ (eigener Scanner, scan-pause-ton.js): gleiche Sprache ohne Overlay */
.pton .pton-zeile--fokus {
  outline: var(--scan-balken-breite) solid var(--scan-balken); outline-offset: 4px;
  box-shadow: 0 0 0 4px var(--scan-balken-kante), 0 0 0 calc(var(--scan-balken-breite) + 7px) var(--scan-balken-kante);
}
.pton .pton-zeile:has(.scan-focus), .pton .pton-fuss:has(.scan-focus) { outline: 3px solid var(--scan-balken); outline-offset: 4px; }
.pton:has(.pton-zeile--fokus, .scan-focus) :is(.pton-zeile, .pton-fuss):not(.pton-zeile--fokus):not(:has(.scan-focus)) { opacity: var(--scan-aus-opacity, 0.38); }

/* ── Result ───────────────────────────────────────────────────────────── */
.page-result { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.result-card { background: #fff; border-radius: 24px; padding: 36px 32px; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,0.08); max-width: 440px; }
.result-card__icon i { width: 56px; height: 56px; color: var(--scan-select, #10b981); }
.result-card__title { font-family: 'Merriweather', Georgia, serif; font-size: 1.8rem; margin: 12px 0 8px; }
.result-card__score { font-size: 1.3rem; font-weight: 800; color: var(--color-primary, #4b698c); margin-bottom: 4px; }
.result-card__sub { color: var(--color-text-muted, #525252); margin-bottom: 20px; }
.result-card__btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── Settings ─────────────────────────────────────────────────────────── */
.settings-card { background: #fff; border-radius: 18px; padding: 20px 22px; margin-bottom: 18px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); }
.settings-card__title { font-size: 1.2rem; font-weight: 800; margin: 0 0 16px; color: var(--color-primary-dark, #3a5a7c); }
.settings-row { margin-bottom: 18px; }
.settings-row--col { display: flex; flex-direction: column; gap: 8px; }
.settings-row--toggle { display: flex; align-items: center; justify-content: space-between; }
.settings-label { font-weight: 700; font-size: 0.98rem; }
.settings-hint { font-size: 0.85rem; color: var(--color-text-muted, #525252); margin: 6px 0 14px; line-height: 1.45; }
/* Bilder, Klänge und Musik (Herkunft, KI-Kennzeichnung) — Etikett = Wort + Symbol */
.quellen { margin-top: 18px; border-top: 1px solid var(--color-border, #e4e9f0); padding-top: 14px; }
.quellen__titel { font-size: 1.05rem; margin: 0 0 4px; }
.quellen__kopf { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; margin: 12px 0 0; }
.quellen a { color: inherit; text-decoration: underline; }
.ki-etikett { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 2px solid currentColor;
  border-radius: 999px; font-size: 0.8rem; font-weight: 800; letter-spacing: .04em; line-height: 1.2; }
.ki-etikett svg { flex: none; }
/* Button-Gruppe direkt in einer Karte (z.B. Diagnostik) braucht Abstand zum Folgetext */
.settings-card .btn-group { margin-bottom: 6px; }

/* Taster-Zuordnung (Tasten-Chips) */
.keymap-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.keymap-chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px;
  border-radius: 10px; background: var(--color-primary, #4b698c); color: #fff;
  font-weight: 700; font-size: 0.95rem; min-height: 40px;
}
.keymap-chip__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(255,255,255,0.25); color: #fff; font-size: 1.1rem; line-height: 1;
}
.keymap-chip__x:hover { background: rgba(255,255,255,0.45); }
.keymap-add { min-height: 40px; }
[data-theme="cvi"] .keymap-chip { background: #ffe600; color: #000; }
[data-theme="cvi"] .keymap-chip__x { background: rgba(0,0,0,0.25); color: #000; }
.settings-slider-row { display: flex; align-items: center; gap: 14px; }
.settings-slider { flex: 1; height: 8px; }
.settings-slider__value { font-weight: 700; font-size: 0.95rem; min-width: 80px; text-align: right; color: var(--color-primary, #4b698c); }

.toggle { width: 56px; height: 32px; border-radius: 999px; background: #cbd0da; border: none; cursor: pointer; position: relative; transition: background 0.15s; }
.toggle--on { background: var(--color-success, #10b981); }
.toggle__knob { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: left 0.15s; }
.toggle--on .toggle__knob { left: 27px; }

/* ── Sprachwahl: 101 Sprachen, SVG-Flaggen-Grid mit Suche (Settings + Onboarding) ── */
.settings-input {
  padding: 10px 14px; border-radius: 12px; font-size: 0.95rem;
  border: 1.5px solid var(--color-border, #e4e7ee); background: #fff;
  color: var(--color-text, #1a1a1a); font-family: inherit; min-height: 44px;
  width: 100%; box-sizing: border-box;
}
.lang-search { display: block; max-width: 320px; margin-bottom: 10px; }
.lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--color-border, #e4e7ee);
  border-radius: 14px;
  padding: 12px;
}
/* Unterer Rand in Hoehe der festen Fussleiste: Ohne ihn steckt die letzte
   Zeile des Gitters dahinter, auch wenn man ganz nach unten gerollt hat
   (gemessen am 15.08.2026 auf einem 375er iPhone). */
.lang-grid { padding-bottom: 64px; }
.lang-grid--onb { margin-top: 12px; text-align: left; }
.lang-btn {
  display: flex; align-items: center; gap: 10px;
  min-height: 52px; min-width: 0; padding: 8px 12px;
  border-radius: 12px; border: 1.5px solid var(--color-border, #e4e7ee);
  background: #fff; color: var(--color-text, #1a1a1a);
  font-family: inherit; font-weight: 600; font-size: 0.92rem;
  cursor: pointer; text-align: left;
}
.lang-btn:hover { background: var(--color-primary-bg, #eef2f7); }
.lang-btn--active {
  border-color: var(--color-primary, #4b698c);
  background: var(--color-primary-bg, #eef2f7);
  box-shadow: 0 0 0 2px var(--color-primary, #4b698c);
}
.lang-btn__flag {
  width: 30px; height: 21px; object-fit: cover; border-radius: 3px;
  flex-shrink: 0; box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.lang-btn__name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="cvi"] .lang-btn { background: #000; color: #ffe600; border-color: #ffe600; }
[data-theme="cvi"] .lang-btn--active { box-shadow: 0 0 0 2px #ffe600; border-color: #ffe600; }
[data-theme="cvi"] .settings-input { background: #000; color: #ffe600; border-color: #ffe600; }

/* ── Recovery-Delay-Overlay (sichtbare Erholungspause nach Auswahl) ─────── */
.scan-recovery {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%);
  background: var(--scan-select, #10b981); color: #fff; font-weight: 700;
  padding: 8px 20px; border-radius: 999px; z-index: 50; display: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2); transition: opacity 0.2s; font-size: 0.95rem;
}

/* ── Diagnostik ────────────────────────────────────────────────────────── */
.diag-bigbtn { border: 3px solid var(--color-primary, #4b698c); background: var(--color-primary-bg, #eef2f7); }
.settings-select { font-family: inherit; }

/* ── Barrierefreiheit: sichtbarer Tastatur-/Switch-Fokus (WCAG 2.4.7) ───── */
*:focus-visible {
  outline: 3px solid var(--color-primary-dark, #3a5a7c);
  outline-offset: 2px;
  border-radius: 6px;
}
[data-theme="contrast"] *:focus-visible,
[data-theme="cvi"] *:focus-visible { outline-color: #ffe600; }

/* Größere Touch-Targets (WCAG 2.5.5): Toggle-Trefferfläche + Slider-Thumb */
.toggle { min-height: 44px; min-width: 56px; }
.settings-slider { height: 28px; }
.settings-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--color-primary, #4b698c); cursor: pointer; }
.settings-slider::-moz-range-thumb { width: 30px; height: 30px; border: none; border-radius: 50%; background: var(--color-primary, #4b698c); cursor: pointer; }
.statusbar__brand { min-height: 48px; }

/* ===== Statusbar: Themen + Schmal-Layout ================================ */
[data-theme="cvi"] .statusbar__btn { background: #000; color: #ffe600; border-color: #ffe600; }
[data-theme="cvi"] .statusbar__btn.is-on { background: #ffe600; color: #000; }
[data-theme="cvi"] .statusbar__avatar { background: #ffe600; color: #000; border-color: #ffe600; }
[data-theme="cvi"] .sb-lang-menu, [data-theme="cvi"] .sb-avatar-menu { background: #000 !important; border-color: #ffe600 !important; }
[data-theme="cvi"] .sb-lang-menu button, [data-theme="cvi"] .sb-avatar-menu button { color: #ffe600 !important; }
@media (max-width: 560px) {
  /* Umbrechen statt schrumpfen: Acht Knöpfe à 48 px passen mit Abstand nicht
     in eine 375-px-Reihe (sie bräuchten 432 px). Vorher wurden sie deshalb auf
     42 px gestutzt — unter dem Tipp-Mindestmaß von 48 px und weit unter den
     64 px fürs Verweilen. Jetzt bricht die Leiste um. */
  .statusbar { padding: 8px 10px; gap: 4px; flex-wrap: nowrap; }
  .statusbar__btn { min-width: 48px; min-height: 48px; padding: 8px 10px; }
  .statusbar__brand span:not(.statusbar__brand-logo) { display: none; } /* nur Logo auf Schmal */
}

/* ===== Mein Bereich (Nutzer-Hub) ======================================== */
.hub-top { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 20px; }
.hub-top__greet { font-family: 'Merriweather', Georgia, serif; font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 700; color: var(--color-primary-dark, #3a5a7c); }
.hub-top__sub { font-size: 1.05rem; color: var(--color-text-secondary, #4a4a4a); }
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.hub-tile {
  position: relative; border: 3px solid var(--tile-color, #4b698c); border-radius: 24px;
  overflow: hidden; cursor: pointer; padding: 0; background: var(--color-primary-bg, #eef2f7);
  aspect-ratio: 16/10; box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  transition: transform 0.15s, box-shadow 0.15s;
}
.hub-tile:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0,0,0,0.16); }
.hub-tile__img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hub-tile__glow { position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.62), transparent 55%); }
.hub-tile__body { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; }
.hub-tile__title { color: #fff; font-weight: 800; font-size: 1.25rem; text-shadow: 0 1px 4px rgba(0,0,0,0.6); }
.hub-tile__star {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: rgba(255, 251, 235, 0.95); color: #f59e0b;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.hub-tile__star i, .hub-tile__star svg { width: 24px; height: 24px; fill: currentColor; stroke: currentColor; }
.hub-hint { margin-top: 18px; font-size: 0.95rem; color: var(--color-text-muted, #525252); text-align: center; }
.hub-empty { text-align: center; padding: 40px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.hub-empty__icon {
  width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center;
  background: var(--color-primary-bg, #eef2f7); color: var(--color-primary, #4b698c);
}
.hub-empty__icon i, .hub-empty__icon svg { width: 32px; height: 32px; }
.hub-empty__text { max-width: 46ch; color: var(--color-text-secondary, #4a4a4a); line-height: 1.5; margin: 0; }
[data-theme="cvi"] .hub-tile { border-color: #ffe600; background: #1a1a00; }
[data-theme="cvi"] .hub-top__greet, [data-theme="cvi"] .hub-top__sub { color: #ffe600; }

/* ===== Gamification ===================================================== */
/* Statusbar-Sterne (Sammel-Motivator) */
.statusbar__stars {
  display: inline-flex; align-items: center; gap: 5px; min-height: 44px; min-width: 44px; padding: 4px 12px; /* 44 x 44 (15.11.2026) */
  border: none; border-radius: 999px; cursor: pointer; font-weight: 800; font-size: 0.95rem;
  background: linear-gradient(135deg, #ffe28a, #ffc83d); color: #6b4e00;
  box-shadow: 0 2px 6px rgba(245,158,11,0.35);
}
.statusbar__stars-icon { font-size: 1.05rem; line-height: 1; }

/* Ergebnis: schwebende Belohnungs-Ballons */
.result-sky { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.result-balloon {
  position: absolute; bottom: -120px; width: 88px; height: auto;
  animation: balloon-rise 3.4s ease-out forwards;
}
@keyframes balloon-rise {
  0%   { transform: translateY(0) rotate(-4deg); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: translateY(-90vh) rotate(4deg); opacity: 0; }
}
.page-result { position: relative; }
.result-card { position: relative; z-index: 1; }

/* Verdiente Sterne (1–3) */
.result-stars { display: flex; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.result-star { font-size: 2.6rem; color: #d9dce3; line-height: 1; transition: color .2s; }
.result-star.is-on { color: #f5a623; animation: star-pop .5s ease-out both; }
@keyframes star-pop {
  0% { transform: scale(0.2) rotate(-20deg); opacity: 0; }
  60% { transform: scale(1.25) rotate(8deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* Verdienter Sticker */
.result-sticker {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  margin: 10px auto 4px; padding: 10px 16px; max-width: 380px;
  background: var(--color-primary-bg, #eef4fb); border-radius: 14px;
}
.result-sticker__emoji { font-size: 2.4rem; line-height: 1; animation: star-pop .5s .2s both; }
.result-sticker__text { font-weight: 700; font-size: 0.98rem; text-align: left; }
.result-card__total { margin-top: 6px; font-weight: 700; color: var(--color-text-secondary, #4a4a4a); }
.result-card__total-star { color: #f5a623; }

/* Auswertungs-Kennzahlen */
.result-metrics {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 10px;
  margin: 14px auto 6px; max-width: 460px;
}
.result-metric {
  flex: 1 1 90px; min-width: 84px; padding: 10px 6px; border-radius: 12px;
  background: var(--color-primary-bg, #eef4fb);
}
.result-metric__val { font-size: 1.5rem; font-weight: 800; color: var(--color-primary-dark, #3a5a7c); }
.result-metric__lbl { font-size: 0.78rem; color: var(--color-text-secondary, #4a4a4a); }
[data-theme="cvi"] .result-metric { background: #1a1a1a; }
[data-theme="cvi"] .result-metric__val { color: #ffe600; }

/* Sammlung-Screen */
.coll-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 12px 0 22px; }
.coll-stat {
  text-align: center; padding: 16px 8px; border-radius: 16px; background: #fff;
  border: 1px solid var(--color-border, #e4e7ee); border-top: 4px solid var(--c, #4b698c);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.coll-stat__icon { font-size: 1.8rem; }
.coll-stat__value { font-size: 1.8rem; font-weight: 800; color: var(--c, #4b698c); }
.coll-stat__label { font-size: 0.82rem; color: var(--color-text-secondary, #4a4a4a); }
.coll-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 14px; }
.coll-sticker {
  text-align: center; padding: 14px 8px; border-radius: 16px; background: #fff;
  border: 1px solid var(--color-border, #e4e7ee); box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
.coll-sticker__emoji { font-size: 2.6rem; line-height: 1.1; }
.coll-sticker__label { font-weight: 700; font-size: 0.9rem; margin-top: 4px; }
.coll-sticker__count { font-size: 0.85rem; color: #f59e0b; font-weight: 800; }
.coll-empty { text-align: center; padding: 30px 16px; }
.coll-empty__emoji { font-size: 3.4rem; }
.coll-empty p { color: var(--color-text-secondary, #4a4a4a); margin: 8px 0 16px; }

/* ===== Scanning-Bericht (druckfertig) ================================== */
.page-report-doc { max-width: 820px; margin: 0 auto; color: #1a1a1a; }
.report-header {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding-bottom: 16px; margin-bottom: 8px; border-bottom: 3px solid var(--color-primary, #4b698c);
}
.report-brand { display: flex; align-items: center; gap: 12px; }
.report-brand__logo { width: 44px; height: 44px; border-radius: 10px; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; background: var(--color-primary, #4b698c); color: #fff; font-weight: 800; }
.report-brand__logo img { width: 100%; height: 100%; object-fit: cover; }
.report-brand__name { font-size: 1.5rem; font-weight: 800; color: var(--color-brand-deep, #1a3a6a); line-height: 1; }
.report-brand__sub { font-size: 0.95rem; color: var(--color-text-secondary, #4a4a4a); }
.report-meta { text-align: right; font-size: 0.9rem; }
.report-meta__line { margin: 2px 0; }
.report-meta__label { color: var(--color-text-muted, #525252); }
.report-meta__val { font-weight: 700; }

.report-section { margin: 18px 0; }
.report-section__title { font-size: 1.15rem; font-weight: 800; color: var(--color-primary-dark, #3a5a7c); margin: 0 0 10px; padding-bottom: 4px; border-bottom: 1px solid var(--color-border, #e4e7ee); }

.report-deflist { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; }
.report-def { display: flex; justify-content: space-between; gap: 12px; font-size: 0.95rem; border-bottom: 1px dotted #d8dde6; padding-bottom: 4px; }
.report-def__label { color: var(--color-text-secondary, #4a4a4a); }
.report-def__val { font-weight: 700; text-align: right; }

.report-kpis { display: flex; flex-wrap: wrap; gap: 12px; }
.report-kpi { flex: 1 1 120px; text-align: center; padding: 14px 8px; border-radius: 14px; background: var(--color-primary-bg, #eef4fb); border: 1px solid var(--color-border, #e4e7ee); }
.report-kpi__val { font-size: 1.8rem; font-weight: 800; color: var(--color-primary-dark, #3a5a7c); }
.report-kpi__lbl { font-size: 0.82rem; color: var(--color-text-secondary, #4a4a4a); }

.report-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.report-table th { text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--color-text-muted, #525252); padding: 6px 8px; border-bottom: 2px solid var(--color-border, #e4e7ee); }
.report-table td { padding: 8px; border-bottom: 1px solid #eef; }
.report-table__label { font-weight: 700; }
.report-table__value { font-weight: 800; color: var(--color-primary-dark, #3a5a7c); white-space: nowrap; }
.report-table__interp { color: var(--color-text-secondary, #4a4a4a); }
.report-row-muted td { color: #9aa3b2; }
.report-badge { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: var(--color-primary, #4b698c); color: #fff; font-weight: 700; font-size: .82rem; }

.report-tips { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.report-tip { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border-left: 4px solid #94a3b8; background: #f8fafc; font-size: 0.95rem; line-height: 1.45; }
.report-tip__icon i { width: 20px; height: 20px; }
.report-tip--good { border-left-color: #10b981; background: #ecfdf5; }
.report-tip--good .report-tip__icon { color: #10b981; }
.report-tip--warn { border-left-color: #f59e0b; background: #fffbeb; }
.report-tip--warn .report-tip__icon { color: #d97706; }
.report-tip--info { border-left-color: #4b698c; background: #eef4fb; }
.report-tip--info .report-tip__icon { color: #4b698c; }
.report-empty { padding: 20px; text-align: center; color: var(--color-text-secondary, #4a4a4a); background: var(--color-primary-bg, #eef4fb); border-radius: 12px; }
.report-text { font-size: 0.95rem; color: var(--color-text-secondary, #2f2f2f); margin: 0; }
.report-footer { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--color-border, #e4e7ee); font-size: 0.78rem; color: var(--color-text-muted, #6b7280); }
.report-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 20px; }

/* Druck: nur den Bericht, kein App-Chrome */
@media print {
  .statusbar, .bottom-nav, .skip-link, #aria-status, .report-actions { display: none !important; }
  body, #app, #app-content { background: #fff !important; }
  #app-content { padding: 0 !important; }
  .page { padding: 0 !important; }
  .page-report-doc { max-width: 100%; }
  .report-section, .report-tip, .report-kpi, .report-table tr { page-break-inside: avoid; }
  .report-kpi, .report-tip, .report-def { box-shadow: none !important; }
  a[href]:after { content: ''; }
}

/* prefers-reduced-motion: Scan-Skalierung/Animationen neutralisieren */
@media (prefers-reduced-motion: reduce) {
  .scan-focus, .scan-selected, .stufe-card, .act-tile, .hub-tile { transform: none !important; }
  .scan-recovery { transition: none !important; }
  .result-balloon { animation: none !important; opacity: 0.9; bottom: auto; top: 10%; }
  .result-star.is-on, .result-sticker__emoji { animation: none !important; }
}

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 8px; top: 8px; background: #fff; padding: 8px 14px; z-index: 100; border-radius: 8px; min-height: 44px; box-sizing: border-box; display: inline-flex; align-items: center; } /* nur bei Fokus sichtbar, dann 44 px hoch */
/* RTL (11.11.2026): links außerhalb wäre in he/ar scrollbar und verschob die Seite um ~1000 px */
[dir="rtl"] .skip-link { left: auto; right: -999px; }
[dir="rtl"] .skip-link:focus { left: auto; right: 8px; }

@media (max-width: 760px) {
  /* Beide Leisten waren `nowrap` und brauchten zusammen 439 px. Auf einem
     390er iPhone stand dadurch der Avatar der Statusleiste ausserhalb des
     Bildschirms, und von der unteren Navigation lag „Fortschritt" halb
     draussen — beides nicht erreichbar (gemessen 01.08.2026).
     Die Statusleiste bricht um; die Navigationsknoepfe teilen sich die Breite
     gleichmaessig (`flex: 1 1 0` braucht `min-width: 0`, sonst schrumpft ein
     Flex-Kind nie unter seinen Text). Danach: 10/10 und 5/5 im Bild. */
  .statusbar { flex-wrap: nowrap; }
  .statusbar__spacer { display: none; }
  .bottom-nav__item { flex: 1 1 0; min-width: 0; }
}

@media (max-width: 600px) {
  .scan-grid--row { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .scan-card__emoji { font-size: 2.4rem; }
  .runner-bar__name { font-size: 1rem; }
}

/* Bereich Ansteuerung (24.10.2026): ein breiter Knopf öffnet den gemeinsamen Baustein (Hausregel ≥ 220 × 96 px) */
.btn--anst { min-width: 320px; min-height: 96px; font-size: 1.15rem; font-weight: 600; }

/* ── Keine Emojis (25.10.2026): Bilder statt Zeichen ─────────────────────── */
.result-sticker__emoji { width: 64px; height: 64px; object-fit: contain; }
.coll-sticker__emoji { width: 72px; height: 72px; object-fit: contain; display: block; margin: 0 auto; }
.coll-empty__emoji { width: 96px; height: auto; }
.coll-stat__icon svg { width: 1.8rem; height: 1.8rem; color: var(--c, #4b698c); }
.scan-card__wort { font-size: 1.3rem; font-weight: 800; text-align: center; }
.scan-card__ruecken { display: block; width: 64px; height: 64px; border-radius: 12px;
  background: repeating-linear-gradient(45deg, #4b698c 0 8px, #6388ad 8px 16px); }
[data-theme="cvi"] .scan-card__ruecken { background: repeating-linear-gradient(45deg, #ffe600 0 8px, #000 8px 16px); }

/* ── Hilfen gegen zu viele Schritte (25.10.2026) ─────────────────────────── */
.act-tile__schritte { margin: 4px 0 0; font-size: 0.82rem; font-weight: 700; color: var(--color-primary-dark, #3a5a7c); }
.scan-card--leer { visibility: hidden; }
.scan-frage { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: var(--color-surface, #fff); border-radius: 16px; padding: 16px; }
.scan-frage__text { font-size: 1.6rem; font-weight: 800; text-align: center; }
.scan-frage__bild { width: 120px; height: 120px; object-fit: contain; }
.scan-frage__knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 560px; }
.scan-frage__knopf { min-width: 120px; min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.scan-frage__knopf svg { width: 56px; height: 56px; stroke-width: 3; }
.scan-frage__ja svg { color: #15803d; }
.scan-frage__nein svg { color: #dc2626; }

/* ── Malkunst (25.10.2026) ───────────────────────────────────────────────── */
.kunst { display: flex; flex-direction: column; gap: 12px; height: 100%; }
.kunst__leinwand { position: relative; flex: none; height: auto; border-radius: 16px; overflow: hidden; background: #0b1530; }
.kunst__canvas { position: absolute; inset: 0; display: block; }
.kunst__flaeche { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff; }
.kunst__hinweis { pointer-events: none; transition: opacity .4s; font-size: 1.4rem; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.6); text-align: center; padding: 0 16px; }
.kunst__leiste { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr; gap: 12px; }
.kunst-knopf { min-width: 96px; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; position: relative; }
.kunst-knopf svg { width: 44px; height: 44px; }
.kunst-knopf--malen svg { width: 56px; height: 56px; }
.kunst-knopf--fertig svg { color: #15803d; }
.kunst__probe { display: block; width: 64px; height: 10px; border-radius: 5px; }

/* ── Spiele ──────────────────────────────────────────────────────────────── */
.rennen { display: flex; flex-direction: column; gap: 14px; height: 100%; }
.rennen__bahn { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.rennen__spur { position: relative; height: 96px; border-radius: 16px; background: var(--color-surface-alt, #f5f5f5); overflow: hidden; }
.rennen__spur--ich { background: #dbeafe; }
.rennen__spur--sie { background: #ffedd5; }
.rennen__ziel { position: absolute; right: 0; top: 0; bottom: 0; width: 22px;
  background: repeating-linear-gradient(0deg, #111 0 11px, #fff 11px 22px); background-size: 22px 22px; }
.rennen__figur { position: absolute; top: 8px; left: 0; width: 80px; height: 80px; object-fit: contain; transition: left .35s ease-out; }
.rennen__knopf { align-self: center; min-width: 260px; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.rennen__knopf svg { width: 56px; height: 56px; }
.schatz__kiste { min-height: 160px; }
.schatz__kiste--offen { background: #fef9c3; }
.spiel-zelle { display: flex; align-items: center; justify-content: center; }
.spiel-stein { display: block; width: 64px; height: 64px; border-radius: 50%; box-shadow: inset 0 -6px 0 rgba(0,0,0,.18); }
.spiel-stein--du { background: #2563eb; }
.spiel-stein--app { background: #f97316; }
[data-theme="cvi"] .spiel-stein--du { background: #ffe600; }
[data-theme="cvi"] .spiel-stein--app { background: #ffffff; }
.vier { display: flex; flex-direction: column; gap: 10px; height: 100%; align-items: center; }
.vier__kopf { display: grid; grid-template-columns: repeat(7, minmax(96px, 1fr)); gap: 8px; width: 100%; max-width: 900px; }
.vier__spalte { min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.vier__spalte svg { width: 36px; height: 36px; }
.vier__brett { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; width: 100%; max-width: 900px; padding: 8px; border-radius: 16px; background: #1e3a8a; }
.vier__loch { aspect-ratio: 1; max-height: 9vh; justify-self: center; width: 100%; max-width: 9vh; border-radius: 50%; background: #0b1530; display: flex; align-items: center; justify-content: center; }
.vier__loch .spiel-stein { width: 90%; height: 90%; }
@media (max-width: 900px) {
  .kunst__leiste { grid-template-columns: repeat(5, minmax(96px, 1fr)); }
}

/* Sterne als Lucide-Symbol statt Schriftzeichen (25.10.2026) */
.statusbar__stars-icon svg, .result-star svg, .result-card__total-star svg { width: 1em; height: 1em; fill: currentColor; vertical-align: -0.12em; }
.statusbar__stars-icon { color: #f5a623; }

/* ── Übungsrahmen wie GazeTo (25.10.2026) ────────────────────────────────────
   Vollflächig über Kopfleiste und Navigation; Glasknöpfe oben rechts,
   Logo oben links, Pause-Ebene als dunkles Panel. */
body.runner-laeuft .bottom-nav, body.runner-laeuft .statusbar { display: none; }
.screen-runner {
  position: fixed; inset: 0; z-index: 2000;
  height: 100vh; height: 100dvh; height: var(--runner-h, 100dvh);
  background: var(--color-bg, #f4f6f9);
  display: flex; flex-direction: column;
}
[data-theme="cvi"] .screen-runner { background: #000; }
.screen-runner .page-runner {
  flex: 1; height: auto; max-width: none; width: 100%; margin: 0;
  padding: 92px 24px 20px; box-sizing: border-box; display: flex; flex-direction: column;
}
.screen-runner .runner-stage { flex: 1; min-height: 0; }
.runner-logo {
  position: fixed; top: 20px; left: 20px; z-index: 2050; box-sizing: content-box;
  height: 30px; width: auto; padding: 5px 10px; border-radius: 10px;
  background: rgba(15, 23, 42, 0.55); opacity: 0.92; pointer-events: none;
}
.runner-titel {
  position: fixed; top: 26px; left: 50%; transform: translateX(-50%); z-index: 2040;
  display: flex; align-items: center; gap: 10px; max-width: calc(100vw - 420px);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.runner-rund {
  position: fixed; top: 20px; z-index: 2050; width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  background: rgba(20, 23, 29, 0.55); color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.35); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  transition: transform .15s ease, background .15s ease;
}
.runner-rund svg { width: 26px; height: 26px; }
.runner-rund:hover { background: rgba(75, 105, 140, 0.85); transform: scale(1.08); }
.runner-rund:focus-visible { outline: 3px solid #4b698c; outline-offset: 3px; }
.runner-pause { right: 88px; }
.runner-end { right: 20px; }
/* Audit 14.11.2026 (P2-7): Der Hinweis stand unten Mitte über der Bühne und verdeckte in den ersten
   5 s Scanfelder (Malen, Spaziergang, Sport, Wahl …). Jetzt steht er in der Kopfzeile des Rahmens
   (oberhalb von padding-top 92 px der Bühne, zwischen Logo und Glasknöpfen) an der Stelle des Titels;
   der Titel kommt zurück, wenn der Hinweis ausblendet. Lange Texte verkleinert runner.js (hinweisEinpassen).
   P2-10: Solange die Übung noch keine Scanfelder hat, zeigt er eine Ladeanzeige „Gleich geht's los“. */
.screen-runner .runner-hint {
  position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 2040;
  width: max-content; max-width: min(760px, calc(100vw - 330px)); max-height: 72px; box-sizing: border-box; overflow: hidden;
  margin: 0; text-align: center; display: flex; align-items: center; justify-content: center; gap: 12px;
  background: rgba(20, 23, 29, 0.82); color: #fff; border-radius: 22px; padding: 8px 18px;
  font-size: 1rem; line-height: 1.25; transition: opacity .6s ease; pointer-events: none;
}
.screen-runner .runner-hint--weg { opacity: 0; }
.screen-runner.runner--hinweis .runner-titel { visibility: hidden; }
.runner-hint__kreis { width: 26px; height: 26px; flex: none; border-radius: 50%; border: 4px solid rgba(255,255,255,.28); border-top-color: #fff;
  animation: runner-laden-dreh 1s linear infinite; }
.runner-hint--laden { font-weight: 700; font-size: 1.15rem; }
[data-theme="cvi"] .screen-runner .runner-hint { background: #000; color: #ffe600; border: 2px solid #ffe600; }
[data-theme="cvi"] .runner-hint__kreis { border-color: rgba(255,230,0,.3); border-top-color: #ffe600; }
@keyframes runner-laden-dreh { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .runner-hint__kreis, .fahrt__laden-kreis { animation-duration: 3s; } }
@media (max-width: 600px) {
  /* Zwischen Logo und Glasknöpfen bleibt kein Platz für Text: nur die Ladeanzeige als Kreis */
  .screen-runner .runner-hint { max-width: calc(100vw - 260px); padding: 8px; }
  .screen-runner .runner-hint:not(.runner-hint--laden) { display: none; }
  .screen-runner .runner-hint--laden .runner-hint__text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}

.runner-pause-ebene {
  position: fixed; inset: 0; z-index: 2100; display: flex; align-items: center; justify-content: center;
  background: rgba(15, 17, 22, 0.86); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); padding: 24px;
}
.runner-pause-ebene[hidden] { display: none; }
.runner-pause-ebene__panel {
  width: 100%; max-width: 480px; display: flex; flex-direction: column; gap: 14px;
  padding: 32px 30px 26px; border-radius: 28px; background: rgba(22, 26, 33, 0.96); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.14); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
}
.runner-pause-ebene__titel { margin: 0 0 6px; font-weight: 800; font-size: 30px; letter-spacing: .04em; text-transform: uppercase; text-align: center; color: #fff; }
.runner-pause-ebene__sub { margin: 0 0 4px; text-align: center; font-size: 1rem; line-height: 1.4; color: rgba(255, 255, 255, 0.78); }
.pause-btn {
  width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: center; gap: 12px;
  font: inherit; font-weight: 700; font-size: 1.18rem; padding: 14px 24px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 255, 255, 0.08); color: #fff; border: 2px solid rgba(255, 255, 255, 0.32);
}
.pause-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.pause-btn:hover { background: rgba(255, 255, 255, 0.16); }
.pause-btn--primaer { background: #4b698c; border: none; box-shadow: 0 8px 22px rgba(75, 105, 140, 0.45); }
.pause-btn--primaer:hover { background: #3a5a7c; }
.pause-btn--gefahr { background: rgba(220, 38, 38, 0.14); color: #fca5a5; border-color: rgba(248, 113, 113, 0.55); }
.pause-btn--gefahr:hover { background: rgba(220, 38, 38, 0.28); color: #fff; }
.pause-reihe { display: flex; gap: 10px; }
.pause-reihe .pause-btn { flex: 1; min-width: 0; }
@media (max-width: 760px) {
  .runner-titel { display: none; }
  .screen-runner .page-runner { padding: 92px 12px 12px; }
}

/* ── Etappe 2: Fahrten, Takt, Rahmen fangen, Ja/Nein, Noch mal (26.10.2026) ── */
.fahrt { position: relative; height: 100%; min-height: 300px; border-radius: 16px; overflow: hidden; background: #0b1530; }
.fahrt__buehne { position: absolute; inset: 0; }
.fahrt__flaeche { position: absolute; inset: 0; width: 100%; height: 100%; background: transparent; border: none; cursor: pointer;
  display: flex; align-items: flex-end; justify-content: center; padding-bottom: 28px; color: #fff; }
.fahrt__hinweis { pointer-events: none; transition: opacity .6s; font-size: 1.5rem; font-weight: 800; background: rgba(15,25,40,.7);
  padding: 12px 24px; border-radius: 999px; text-align: center; }
.fahrt__laden { flex: 1 0 100%; min-height: 96px; display: flex; align-items: center; justify-content: center; gap: 14px;
  font-size: 1.2rem; font-weight: 700; color: var(--color-text, #1f2937); }
.fahrt__laden-kreis { width: 30px; height: 30px; border-radius: 50%; border: 4px solid rgba(75,105,140,.25); border-top-color: #4b698c;
  animation: runner-laden-dreh 1s linear infinite; flex: none; }
[data-theme="cvi"] .fahrt__laden { color: #fff; }
[data-theme="cvi"] .fahrt__laden-kreis { border-color: rgba(255,230,0,.3); border-top-color: #ffe600; }
.takt { display: flex; flex-direction: column; align-items: center; gap: 12px; height: 100%; }
.takt__flaeche { flex: 1; width: 100%; min-height: 260px; background: transparent; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.takt__ring { position: relative; width: min(60vh, 90%); aspect-ratio: 1; }
.takt__licht { position: absolute; width: 22%; aspect-ratio: 1; transform: translate(-50%, -50%) scale(.8); border-radius: 50%;
  background: var(--farbe); opacity: .28; transition: opacity .15s, transform .15s; box-shadow: 0 0 0 4px rgba(0,0,0,.06); }
.takt__licht--an { opacity: 1; transform: translate(-50%, -50%) scale(1.05); box-shadow: 0 0 34px var(--farbe); }
.takt__licht--klang { animation: takt-klang .5s ease-out; }
@keyframes takt-klang { 0% { transform: translate(-50%,-50%) scale(1.35); } 100% { transform: translate(-50%,-50%) scale(1.05); } }
.takt__melodie { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 28px; }
.takt__note { width: 24px; height: 24px; border-radius: 50%; transition: transform .2s; }
.takt__note--spielt { transform: scale(1.4); }
.rahmen__feld { min-height: 240px; display: flex; align-items: center; justify-content: center; }
.rahmen__bild { width: 60%; max-width: 180px; height: auto; object-fit: contain; }
.rahmen__feld--stern { background: #fef9c3; }
.rahmen__feld--jubel { animation: rahmen-jubel .6s ease-out; }
@keyframes rahmen-jubel { 0% { transform: scale(1.12); } 100% { transform: scale(1); } }
.janein, .nochmal { display: flex; flex-direction: column; align-items: center; gap: 16px; height: 100%; }
.janein__karte, .nochmal__buehne { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; position: relative; }
.janein__bild { width: min(34vh, 260px); height: auto; object-fit: contain; }
.janein__frage { font-size: 1.8rem; font-weight: 800; text-align: center; }
.janein__knoepfe { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; width: 100%; max-width: 640px; }
.janein__knopf { min-height: 140px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.janein__knopf svg { width: 60px; height: 60px; stroke-width: 3; }
.janein__ja svg { color: #15803d; }
.janein__nein svg { color: #dc2626; }
.nochmal__nochmal svg { color: #2563eb; }
.nochmal__anders svg { color: #7c3aed; }
.janein__knopf--gewaehlt { background: #dcfce7; }
.nochmal__bild { width: min(36vh, 280px); height: auto; object-fit: contain; }
.nochmal__bild--hopp { animation: nochmal-hopp .8s ease-out; }
@keyframes nochmal-hopp { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-40px) scale(1.12) rotate(-6deg); }
  60% { transform: translateY(0) scale(.96) rotate(4deg); } 100% { transform: translateY(0) scale(1); } }
.nochmal__name { font-size: 1.6rem; font-weight: 800; }
.nochmal__funke { position: absolute; left: 50%; top: 45%; width: 14px; height: 14px; border-radius: 50%; pointer-events: none;
  animation: nochmal-funke .9s ease-out forwards; }
@keyframes nochmal-funke { 0% { transform: rotate(var(--w)) translateX(0); opacity: 1; } 100% { transform: rotate(var(--w)) translateX(170px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .nochmal__bild--hopp, .takt__licht--klang, .rahmen__feld--jubel, .nochmal__funke { animation: none; }
}
