/* ==========================================================================
   MoveTo — Familien-Design (AssistUK / GazeTo-Informationsarchitektur).
   Statusbar oben, 5-Tab-Bottom-Nav, Aktivitäts-Kacheln mit 16:9-Tiles.
   Cursor/Dwell-Ring/Status-Pille kommen aus move-core.css.
   Tokens und Typografie wie GazeTo: DM Sans (Text), Merriweather (Titel),
   Oswald (Eyebrows/Labels), AssistUK-Blau #4b698c.
   ========================================================================== */
:root {
  --c-accent: #4b698c;
  --c-accent-light: #6388ad;
  --c-accent-dark: #3a5a7c;
  --c-accent-bg: #eef2f7;
  --c-bg: #f5f5f7;
  --c-surface: #ffffff;
  --c-surface-alt: #f0f1f4;
  --c-border: #e4e7ee;
  --c-fg1: #1d1d1f;
  --c-fg2: #555e6e;
  --c-fg3: #818a99;
  --c-stufe-1: #ec4899;
  --c-stufe-2: #f97316;
  --c-stufe-3: #eab308;
  --c-stufe-4: #22c55e;
  --c-stufe-5: #06b6d4;
  --c-stufe-6: #6366f1;
  --c-stufe-7: #a855f7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 18px rgba(0, 0, 0, 0.08);
  --gradient-brand: linear-gradient(135deg, #1a3a6a 0%, #4b698c 100%);
  --f-heading: 'Merriweather', Georgia, serif;
  --f-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --f-label: 'Oswald', 'DM Sans', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--f-body);
  color: var(--c-fg1);
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
}

/* ── Statusbar (Familien-Header, Maße wie GazeTo) ── */
.statusbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(26px);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 30;
}
.statusbar__brand {
  display: flex;
  align-items: center;
  gap: 11px;
  border: none;
  background: none;
  font-family: var(--f-label);
  font-size: 19px;
  font-weight: 600;
  color: var(--c-fg1);
  cursor: pointer;
  padding: 4px 6px;
}
.statusbar__brand-logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--gradient-brand);
  color: #fff;
  font-weight: 700;
  font-size: 20px;
}
.statusbar__brand-sub {
  font-family: var(--f-body);
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--c-fg3);
}
.statusbar__spacer { flex: 1; }
.statusbar__stars {
  font-weight: 700;
  color: #d97706;
  background: #fef3c7;
  border-radius: 999px;
  padding: 7px 14px;
  white-space: nowrap;
  font-size: 0.92rem;
}
.statusbar__stars:empty { display: none; }
.statusbar__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 48px;
  min-width: 48px;
  padding: 10px 16px;
  border: 1px solid transparent;
  border-radius: 980px;
  background: transparent;
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--c-fg2);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}
.statusbar__btn:hover { background: var(--c-surface-alt); color: var(--c-fg1); }
.statusbar__btn svg { width: 20px; height: 20px; }
.statusbar__btn.is-on { color: #fff; background: var(--c-accent); }
.statusbar__btn--font { font-family: var(--f-heading); font-weight: 700; }
body.is-run .statusbar__stars, body.is-run .statusbar__btn { display: none; }

/* Schriftgröße A−/A+ (wie GazeTo: data-font-scale auf <html>) */
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; }

/* Vorlesen: Mitlese-Markierung (wie GazeTo .tts-reading) */
.tts-reading {
  background: rgba(75, 105, 140, 0.16) !important;
  outline: 2px solid var(--c-accent);
  outline-offset: 3px;
  border-radius: 6px;
  scroll-margin: 120px;
}
.high-contrast .tts-reading {
  background: rgba(255, 214, 10, 0.28) !important;
  outline-color: #ffd60a;
}

/* Hoher Kontrast (Gelb auf Schwarz, Token-Überschreibung wie GazeTo) */
.high-contrast {
  --c-accent: #ffd60a;
  --c-accent-light: #ffe566;
  --c-accent-dark: #ffe566;
  --c-accent-bg: #1a1a1a;
  --c-bg: #000;
  --c-surface: #1a1a1a;
  --c-surface-alt: #2a2a2a;
  --c-border: #fff;
  --c-fg1: #fff;
  --c-fg2: #fff;
  --c-fg3: #ffd60a;
  --gradient-brand: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
  --shadow-sm: none;
  --shadow-md: none;
}
.high-contrast .statusbar,
.high-contrast .bottom-nav { background: rgba(0, 0, 0, 0.94); }
.high-contrast .statusbar__stars { background: #1a1a1a; color: #ffd60a; }

/* Hilfe-Dialog */
.mt-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 16, 28, 0.55);
  padding: 20px;
}
.mt-help-card {
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--c-surface);
  color: var(--c-fg1);
  border: 1px solid var(--c-border);
  border-radius: 18px;
  padding: 24px 26px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.3);
}
.mt-help-card h2 { font-family: var(--f-heading); margin: 0 0 12px; font-size: 1.4rem; }
.mt-help-card p { margin: 0 0 10px; line-height: 1.5; color: var(--c-fg2); }
.mt-help-ok {
  margin-top: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: none;
  border-radius: 980px;
  background: var(--c-accent);
  color: #fff;
  font-family: var(--f-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.high-contrast .mt-help-ok { color: #000; }

/* ── Inhalt ── */
.mt-app { flex: 1; overflow-y: auto; padding: 18px 22px 96px; }
body.is-run .mt-app { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.mt-foot {
  flex: none;
  padding: 8px 20px 76px;
  font-size: 0.8rem;
  color: var(--c-fg3);
  background: var(--c-bg);
  text-align: center;
}
body.is-run .mt-foot { display: none; }

/* ── Bottom-Navigation (5 Reiter, Familie) ── */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex;
  /* Tabs über die volle Breite verteilt — gleiche Abstände wie GazeTo */
  justify-content: space-around;
  align-items: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(26px);
  border-top: 1px solid var(--c-border);
}
body.is-run .bottom-nav { display: none; }
.bottom-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 86px;
  padding: 6px 10px;
  border: none;
  background: none;
  font-family: var(--f-label);
  font-size: 12px;
  color: var(--c-fg3);
  cursor: pointer;
  border-radius: 12px;
}
.bottom-nav__item svg { width: 24px; height: 24px; }
.bottom-nav__item:hover { color: var(--c-fg1); }
.bottom-nav__item.is-active { color: var(--c-accent); }
.bottom-nav__item--primary { margin-top: -26px; }
.bottom-nav__primary-disc {
  width: 58px;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(26, 58, 106, 0.35);
}
.bottom-nav__primary-disc svg { width: 26px; height: 26px; }
.bottom-nav__item--primary.is-active .bottom-nav__primary-disc {
  box-shadow: 0 6px 22px rgba(26, 58, 106, 0.55);
}

/* ── Seitenkopf je Screen ── */
.page { max-width: 1100px; margin: 0 auto; }
.page-head { margin: 10px 0 18px; }
.page-head__eyebrow {
  font-family: var(--f-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  color: var(--c-accent);
  margin: 0 0 4px;
}
.page-head__title {
  font-family: var(--f-heading);
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: var(--c-fg1);
}
.page-head__lead { margin: 0; color: var(--c-fg2); max-width: 720px; line-height: 1.55; }

/* ── Hero (Start) ── */
.hero {
  background: var(--gradient-brand);
  border-radius: 20px;
  color: #fff;
  padding: 28px 28px 24px;
  margin-bottom: 22px;
}
.hero__title { font-family: var(--f-heading); font-size: 1.9rem; margin: 0 0 8px; }
.hero__sub { margin: 0 0 16px; opacity: 0.92; max-width: 640px; line-height: 1.5; }
.hero__btns { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── Sektionen ── */
.mt-section { margin: 22px 0; }
.mt-section__title {
  font-family: var(--f-heading);
  margin: 0 0 2px;
  font-size: 1.3rem;
  color: var(--c-fg1);
}
.mt-section__hint { margin: 0 0 12px; color: var(--c-fg2); font-size: 0.95rem; }

/* ── Aktivitäts-Kacheln (16:9-Tile + Text, GazeTo-Stil) ── */
.act-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 560px) { .act-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 920px) { .act-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1240px) { .act-grid { grid-template-columns: repeat(4, 1fr); } }

.act-card {
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  text-align: left;
  padding: 0;
  font: inherit;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.2s;
}
.act-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.act-card__media {
  width: 100%;
  aspect-ratio: 16/9;
  background: var(--c-surface-alt);
  position: relative;
}
.act-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.act-card__star {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  z-index: 5;
  transition: transform 0.15s, color 0.15s;
}
.act-card__star:hover { transform: scale(1.1); }
.act-card__star.is-on { color: #f59e0b; background: rgba(255, 251, 235, 0.97); }
.act-card__star svg { width: 24px; height: 24px; fill: none; stroke: currentColor; }
.act-card__star.is-on svg { fill: currentColor; }
.act-card__body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.act-card__name {
  font-family: var(--f-heading);
  font-size: 1.06rem;
  font-weight: 700;
  margin: 0;
  color: var(--c-fg1);
}
.act-card__desc {
  margin: 0;
  color: var(--c-fg2);
  font-size: 0.92rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.act-card__tags { margin-top: auto; padding-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--c-surface-alt);
  color: var(--c-fg2);
}
.pill--stufe-1 { background: #fce7f3; color: #9d174d; }
.pill--stufe-2 { background: #ffedd5; color: #9a3412; }
.pill--stufe-3 { background: #fef9c3; color: #854d0e; }
.pill--stufe-4 { background: #dcfce7; color: #166534; }
.pill--stufe-5 { background: #cffafe; color: #155e75; }
.pill--stufe-6 { background: #e0e7ff; color: #3730a3; }
.pill--stufe-7 { background: #f3e8ff; color: #6b21a8; }
.pill--sport { background: #dcfce7; color: #166534; }
.pill--musik { background: #f3e8ff; color: #6b21a8; }
.pill--hands { background: #ffe4e6; color: #9f1239; }
.pill--sticker { background: #fef3c7; color: #b45309; }

/* ── Filter-Chips (Förderung, GazeTo-Stufen-Tabs) ── */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--c-border);
  background: var(--c-surface);
  font: inherit;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--c-fg2);
  cursor: pointer;
}
.chip:hover { border-color: var(--c-accent); color: var(--c-fg1); }
.chip.is-active { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.chip__dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 7px; flex: none; }
.chip__count {
  margin-left: 7px;
  background: rgba(0, 0, 0, 0.07);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 0.8rem;
  font-weight: 700;
}
.chip.is-active .chip__count { background: rgba(255, 255, 255, 0.25); }

/* ── Stufen-Banner (Förderung, GazeTo-Referenz: Bild + Scrim + Erklärung) ── */
.stufe-banner {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  min-height: 200px;
  margin: 0 0 20px;
  display: flex;
  align-items: flex-end;
  background: var(--c-accent);
}
.stufe-banner__media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
}
.stufe-banner__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 18, 32, 0.78) 0%, rgba(10, 18, 32, 0.38) 55%, rgba(10, 18, 32, 0.05) 100%);
}
.stufe-banner__text { position: relative; padding: 22px 26px; color: #fff; max-width: 640px; }
.stufe-banner__eyebrow {
  font-family: var(--f-label);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  opacity: 0.92;
  margin-bottom: 4px;
}
.stufe-banner__title { font-family: var(--f-heading); font-size: 1.65rem; font-weight: 700; margin-bottom: 6px; }
.stufe-banner__desc { font-size: 0.96rem; line-height: 1.5; opacity: 0.96; }

/* ── Stufen-Sektionen in der „Alle"-Ansicht ── */
.stufe-sec { margin: 30px 0 10px; }
.stufe-sec__head { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; }
.stufe-sec__dot { width: 14px; height: 14px; border-radius: 50%; flex: none; }
.stufe-sec__title { font-family: var(--f-heading); font-size: 1.35rem; font-weight: 700; margin: 0; color: var(--c-fg1); }
.stufe-sec__count { color: var(--c-fg3); font-size: 0.9rem; font-weight: 700; }
.stufe-sec__hint { margin: 0 0 14px; color: var(--c-fg2); max-width: 780px; line-height: 1.5; }

/* ── Statistik-Chips ── */
.stat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 14px 0; }
.stat-chip {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 12px 18px;
  min-width: 130px;
}
.stat-chip__num { font-family: var(--f-heading); font-size: 1.5rem; font-weight: 700; color: var(--c-accent-dark); }
.stat-chip__label { font-size: 0.85rem; color: var(--c-fg3); }

/* ── Sticker-Album (Tiles) ── */
.mt-album {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.mt-album__cell {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-radius: 14px;
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  overflow: hidden;
  text-align: center;
  padding-bottom: 10px;
}
.mt-album__cell img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.mt-album__cell.is-locked { opacity: 0.5; background: var(--c-surface-alt); }
.mt-album__q {
  width: 100%;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 800;
  color: #9aa6b8;
  background: var(--c-surface-alt);
}
.mt-album__name { font-size: 0.82rem; font-weight: 600; color: var(--c-fg2); padding: 0 6px; }

/* ── Buttons ── */
.mt-btn {
  min-height: 48px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1.5px solid #c9d3e0;
  background: var(--c-surface);
  font: inherit;
  font-weight: 700;
  color: var(--c-accent-dark);
  cursor: pointer;
}
.mt-btn:hover { border-color: var(--c-accent); }
.mt-btn:disabled { opacity: 0.5; cursor: default; }
.mt-btn--primary { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.mt-btn--primary:hover { background: var(--c-accent-dark); }
.mt-btn--hero { background: #fff; border-color: #fff; color: var(--c-accent-dark); }
.mt-btn--hero:hover { background: #eef2f7; }
.mt-btn--ghost-hero { background: transparent; border-color: rgba(255,255,255,0.6); color: #fff; }
.mt-btn--ghost-hero:hover { border-color: #fff; }
.mt-btn--toggle { min-width: 80px; }
.mt-btn--bar { min-height: 44px; padding: 8px 16px; border-radius: 12px; }

/* ── Aktivitäts-Bühne (Runner) ── */
.mt-runbar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
}
.mt-runbar__title { font-family: var(--f-heading); font-weight: 700; color: #1a3a6a; font-size: 1.05rem; }
.mt-runbar__time {
  margin-left: auto;
  font-weight: 700;
  color: var(--c-fg2);
  font-variant-numeric: tabular-nums;
  min-width: 56px;
  text-align: right;
}
.mt-stage { flex: 1; position: relative; overflow: hidden; background: #0b1530; }
.mt-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* ── Einstellungen ── */
.mt-setting {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #e9edf3;
}
.mt-setting__label { flex: 1; font-weight: 600; color: #2b3648; }
.mt-select {
  min-height: 48px;
  font: inherit;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid #c9d3e0;
  background: var(--c-surface);
}
.mt-range { width: 220px; accent-color: var(--c-accent); }

/* ── Verlauf ── */
.mt-log { display: flex; flex-direction: column; gap: 6px; }
.mt-log__row {
  display: flex;
  gap: 14px;
  align-items: baseline;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  padding: 10px 14px;
}
.mt-log__name { font-weight: 700; color: #1a3a6a; min-width: 180px; }
.mt-log__info { color: var(--c-fg2); flex: 1; }
.mt-log__date { color: #8b93a3; font-size: 0.85rem; }

/* ── Test-Karten (Einschätzung) ── */
.diag-result {
  background: var(--c-accent-bg);
  border: 1px solid var(--c-border);
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  color: var(--c-fg2);
}
.diag-result strong { color: var(--c-accent-dark); }

@media (prefers-reduced-motion: reduce) {
  .act-card { transition: none; }
  .act-card:hover { transform: none; }
}
@media (max-width: 1100px) {
  /* Wie GazeTo: auf schmalen Screens nur Icons in der Statusleiste */
  .statusbar { gap: 8px; padding: 10px 12px; }
  .statusbar__btn-label { display: none; }
}
@media (max-width: 700px) {
  .statusbar__brand-sub { display: none; }
  .mt-log__name { min-width: 120px; }
  .bottom-nav__item { min-width: 60px; }
}
