/* Zuhause – Design-Tokens (Basis: Wetter-Dashboard, dunkles Slate-Design) */
:root {
  color-scheme: dark;

  /* Flächen */
  --bg: #0d1b4c;
  --card: #1b3178;
  --card-2: #0a143f80;
  --card-hover: #233c8c;
  --line: #2f4892;

  /* Text */
  --txt: #eef3ff;
  --mut: #aab9e6;

  /* Akzent (pro Bereich umschaltbar) */
  --acc: #ffc727;
  --acc-txt: #0a1233;
  --acc-soft: #ffc72726;

  /* Status */
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --ok-soft: #22c55e22;
  --warn-soft: #f59e0b22;
  --bad-soft: #ef444422;

  /* Daten-Farben */
  --rain: #3b82f6;
  --temp: #f97316;
  --radar: #a855f7;

  /* Quest-Bereich (nur dort als Akzent) */
  --q-acc: #8b7cff;
  --q-gold: #ffc857;
  --q-green: #4bd7a5;
  --bronze: #c98855;
  --silver: #d7deeb;

  /* Radien */
  --r-card: 18px;
  --r-inner: 12px;
  --r-btn: 14px;
  --r-pill: 999px;

  /* Abstände */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;

  /* Typo */
  --font: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --font-head: "Arial Rounded MT Bold", "SF Pro Rounded", ui-rounded, "Segoe UI Black", system-ui, sans-serif;
  --out: #0a1233;
  --fs-h1: 1.3rem;
  --fs-title: .95rem;
  --fs-big: 2.6rem;
  --fs-body: 1rem;
  --fs-note: .8rem;
  --fs-label: .75rem;

  /* Bedienung */
  --touch: 44px;
  --appbar-h: 52px;
  --tabbar-h: 60px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --shadow: 0 12px 40px rgba(0, 0, 0, .45);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

/* Quest-Bereich bekommt seinen lila Akzent */
body[data-tab="quests"] {
  --acc: var(--q-acc);
  --acc-txt: #ffffff;
  --acc-soft: #8b7cff22;
}

/* P126/P133: Kinder-Look „Sternenhimmel & Sonne“ – ruhiges Nachtblau, sonnengelber Akzent, runde Schrift,
   dicke „drückbare“ Knöpfe. Gut lesbar (Kontrast), kein Lila-auf-Lila mehr. Später wählbar (Person → Stil). */
body.kid {
  --bg: #0b1736;
  --card: #15244b;
  --card-hover: #1c2e5c;
  --card-2: #0b173699;
  --line: #2a3d72;
  --txt: #f3f6ff;
  --mut: #aebde3;
  --acc: #ffd23f;
  --acc-txt: #2a1d00;
  --acc-soft: #ffd23f26;
  --r-card: 22px;
  --r-btn: 16px;
  --r-inner: 14px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", "Segoe UI", system-ui, sans-serif;
  background:
    radial-gradient(1.5px 1.5px at 12% 18%, #ffffffb0 50%, transparent 52%),
    radial-gradient(1px 1px at 33% 8%, #ffffff90 50%, transparent 52%),
    radial-gradient(2px 2px at 71% 14%, #ffe9a8c0 50%, transparent 52%),
    radial-gradient(1px 1px at 86% 31%, #ffffff80 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 52% 26%, #ffffff70 50%, transparent 52%),
    radial-gradient(1px 1px at 24% 42%, #ffffff60 50%, transparent 52%),
    radial-gradient(700px 380px at 92% -6%, #ffd23f1c, transparent 70%),
    linear-gradient(180deg, #0b1736 0%, #112552 55%, #16306a 100%);
  background-attachment: fixed;
}
body.kid .card { border: 1px solid #ffffff12; box-shadow: 0 8px 22px #00000055, inset 0 1px 0 #ffffff10; }
body.kid .card h2 { color: var(--txt); font-weight: 800; letter-spacing: .01em; }
body.kid .section-title { color: var(--acc); letter-spacing: .05em; }
body.kid .btn { font-weight: 800; box-shadow: 0 4px 0 #c79a12; }
body.kid .btn:active { transform: translateY(3px); box-shadow: 0 1px 0 #c79a12; opacity: 1; }
body.kid .btn.ghost, body.kid .btn.subtle { box-shadow: 0 3px 0 #00000066; background: #1c2e5c; border-color: #33498a; }
body.kid .btn.danger { box-shadow: 0 3px 0 #7f1d1d88; }
body.kid .btn.ghost:active, body.kid .btn.subtle:active, body.kid .btn.danger:active { box-shadow: 0 1px 0 #00000066; }
body.kid .input { background: #0e1c3f; border-color: #33498a; border-radius: 14px; }
body.kid .input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-soft); }
body.kid .chip:not(.acc):not(.ok):not(.warn):not(.bad) { background: #ffffff12; color: var(--txt); }
body.kid .chip.acc { background: var(--acc); color: var(--acc-txt); }
body.kid .list-item { border-radius: 16px; }
body.kid input[type="checkbox"], body.kid input[type="radio"], body.kid input[type="range"] { accent-color: var(--acc); }
body.kid .note { color: var(--mut); }

/* P129: Admin sieht die App „als“ jemand anderes */
.viewas-bar {
  position: fixed; left: 0; right: 0; top: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: calc(env(safe-area-inset-top, 0px) + 6px) 12px 6px;
  background: #b45309; color: #fff; font-size: 0.85rem; text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}
.viewas-bar .btn { background: #fff; color: #7c2d12; }
body.view-as { padding-top: var(--viewas-h, 46px); }
body.view-as .appbar { top: var(--viewas-h, 46px); } /* P134: Balken verdeckt Kopfzeile/Seitenleiste nicht mehr */
@media (min-width: 900px) { body.view-as .tabbar { top: var(--viewas-h, 46px); } }

/* P130: kleiner Radio-Player, wenn das Radio außerhalb von Mein Zuhause weiterläuft.
   P131: unten LINKS – rechts sitzen schon ＋-Knopf (.fab) und Chat-Leiste; über der Fokus-Pille bleibt er frei. */
.hr-mini {
  position: fixed; left: calc(12px + var(--safe-left, 0px)); bottom: calc(var(--safe-bottom, 0px) + 16px); z-index: 26;
  display: flex; align-items: center; gap: 2px; max-width: min(calc(100vw - 110px), 320px);
  background: var(--card, #1e293b); color: inherit; border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); padding: 4px;
}
body.with-tabs .hr-mini { bottom: calc(var(--tabbar-h, 64px) + var(--safe-bottom, 0px) + 16px); }
body:has(.focus-pill:not([hidden])) .hr-mini { bottom: calc(var(--tabbar-h, 64px) + var(--safe-bottom, 0px) + 70px); }
@media (min-width: 900px) {
  body.with-tabs .hr-mini { left: calc(var(--side-w, 236px) + 16px); bottom: calc(var(--safe-bottom, 0px) + 16px); }
  body:has(.focus-pill:not([hidden])) .hr-mini { bottom: calc(var(--safe-bottom, 0px) + 16px); } /* Fokus-Pille sitzt am PC rechts */
}
.hr-mini[hidden] { display: none; }
.hr-mini button { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 8px 10px; border-radius: 999px; }
.hr-mini-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: left; }
.hr-mini-t small { opacity: 0.75; }
.hr-mini-x { font-size: 1.05rem; }
.hr-mini button:hover { background: rgba(148, 163, 184, 0.15); }
/* P133: Radio-Kachel auf der Startseite */
.wd .wd-radio-btn { margin-top: 8px; position: relative; z-index: 1; }
