/* =====================================================================
   Familien App – Design-System „Ruhiger Planer“
   Kühl-neutrale Flächen, eine Akzentfarbe, Linien statt Schatten, Inter.
   Alle Werte kommen aus den Tokens unten; Komponenten verwenden nur Tokens.
   ===================================================================== */

/* ---------- Schrift (selbst gehostet, SIL Open Font License, siehe fonts/LICENSE-Inter.txt) ---------- */
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/inter-400.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/inter-500.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/inter-600.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/inter-700.woff2) format('woff2'); }

/* ---------- Tokens ---------- */
:root {
  /* Flächen & Text */
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;      /* Felder, Chips, Segment-Hintergrund */
  --surface-3: #eef0f4;      /* Hover */
  --ink: #151a26;
  --ink-2: #3d4556;
  --muted: #5d6677;          /* ≥ 5,3 : 1 auf --bg */
  --line: #e3e6ec;
  --line-strong: #cfd4dd;

  /* Akzent (einzige Markenfarbe) */
  --accent: #3451c7;         /* weiße Schrift 6,6 : 1 */
  --accent-hover: #2b44ab;
  --accent-text: #3451c7;    /* Akzent als Schrift auf Flächen */
  --accent-soft: #e9edfb;
  --accent-ink: #ffffff;
  --focus: #3451c7;

  /* Status */
  --ok: #2b7a4b;   --ok-soft: #e6f4ec;   --ok-text: #237032;
  --warn: #a14700; --warn-soft: #fff1e0;
  --danger: #c02626; --danger-soft: #fdecec;

  /* Rubrik-Töne (nur für Symbole, Markierungen, Fortschritt) */
  --blue: #2a5bd7; --green: #2b7a4b; --orange: #b4530f; --violet: #6741c7; --teal: #1d6f80; --pink: #b8325e;
  --gold: #f5b301; --gold-2: #fab005; --gold-ink: #3d2a00;

  /* Abstände (4/8-Raster) */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-8: 32px;

  /* Radien */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;
  --radius: var(--r-lg); --radius-sm: var(--r-md);

  /* Schatten (sparsam – nur für Schwebendes) */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, .10);
  --shadow: var(--shadow-sm);

  /* Typografie */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 13px; --fs-base: 15px; --fs-md: 17px; --fs-lg: 20px; --fs-xl: 26px; --fs-2xl: 32px;
  --lh: 1.45;

  /* Bewegung */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --t-fast: 150ms; --t: 200ms; --t-slow: 250ms;

  /* Maße */
  --nav-h: 64px;
  --content: 720px;
  --gutter: max(var(--s-4), calc((100% - var(--content)) / 2 + var(--s-4)));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218; --surface: #171b23; --surface-2: #1d222c; --surface-3: #252b37;
    --ink: #e9ecf2; --ink-2: #c3c9d4; --muted: #9aa3b2; --line: #2a303c; --line-strong: #394150;
    --accent: #4a63d9; --accent-hover: #5a72e0; --accent-text: #9db0ff; --accent-soft: #232b48; --accent-ink: #ffffff; --focus: #9db0ff;
    --ok: #3f9d63; --ok-soft: #16281e; --ok-text: #69db7c;
    --warn: #ffb35c; --warn-soft: #33240f;
    --danger: #ff6b6b; --danger-soft: #3a1717;
    --blue: #7aa2ff; --green: #69db7c; --orange: #ffa94d; --violet: #b197fc; --teal: #66d9e8; --pink: #f783ac;
    --gold: #f5b301; --gold-2: #e09b00;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow-md: 0 8px 24px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
.t-blue { --tint: var(--blue); } .t-green { --tint: var(--green); } .t-orange { --tint: var(--orange); }
.t-violet { --tint: var(--violet); } .t-teal { --tint: var(--teal); } .t-pink { --tint: var(--pink); }

/* ---------- Grundlagen ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); font-size: var(--fs-base); line-height: var(--lh);
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  font-feature-settings: 'cv11', 'ss01'; /* Inter: ruhigere Ziffern und „a“ */
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-text); }
h1, h2, h3 { font-weight: 700; letter-spacing: -.015em; }
svg.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
svg.icon.sm { width: 16px; height: 16px; stroke-width: 2; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.list :focus-visible, .chat-list :focus-visible { outline-offset: -3px; }

/* ---------- Seitengerüst ---------- */
.app { min-height: 100%; display: flex; flex-direction: column; }
main { flex: 1; width: 100%; max-width: var(--content); margin: 0 auto; padding: var(--s-1) var(--s-4) calc(var(--nav-h) + env(safe-area-inset-bottom) + 96px); }
.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--s-3);
  padding: calc(env(safe-area-inset-top) + var(--s-3)) var(--gutter) var(--s-3);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.topbar h1 { flex: 1; margin: 0; font-size: var(--fs-xl); line-height: 1.15; letter-spacing: -.025em; }
.topbar .sub { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .07em; }
.topbar.static { position: relative; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
.chat-head { gap: var(--s-2); padding-left: max(var(--s-2), calc((100% - var(--content)) / 2 + var(--s-2))); }
.chat-head .avatar { width: 36px; height: 36px; }
.topbar h1.chat-title { flex: none; font-size: var(--fs-md); line-height: 1.25; letter-spacing: -.01em; }
.chat-head .sub { text-transform: none; letter-spacing: 0; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around;
  padding: 0 max(0px, calc((100% - var(--content)) / 2)) env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
  box-shadow: 0 -1px 0 var(--line);
}
.nav button {
  position: relative; flex: 1; min-width: 0; max-width: 120px; height: var(--nav-h); padding: 0; border: 0; background: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); font-size: 10.5px; font-weight: 600; transition: color var(--t-fast);
}
.nav button svg.icon { width: 50px; height: 30px; padding: 4px 14px; border-radius: var(--r-full); transition: background var(--t), color var(--t); }
.nav button.active { color: var(--accent-text); }
.nav button.active svg.icon { background: var(--accent-soft); }
.nav .badge { position: absolute; top: 4px; left: calc(50% + 8px); box-shadow: 0 0 0 2px var(--surface); }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: var(--r-full); background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }
.icon-badge { position: absolute; top: -4px; right: -4px; box-shadow: 0 0 0 2px var(--bg); }

.offline { padding: var(--s-2); text-align: center; font-size: var(--fs-sm); font-weight: 600; background: var(--warn-soft); color: var(--ink); }
.load-error { background: var(--danger-soft); }
.linklike { border: 0; background: none; padding: 0; color: inherit; font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* ---------- Typo-Bausteine ---------- */
.section-title { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-6) var(--s-1) var(--s-2); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.section-title.today { color: var(--accent-text); }
.section-title.today::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cat-title { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-5) var(--s-1) var(--s-2); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.cat-emoji { font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: var(--fs-xl); font-weight: 700; letter-spacing: .12em; }
.late { color: var(--danger); font-weight: 700; }
.status-ok { color: var(--ok-text); font-weight: 600; }
.status-err { color: var(--danger); font-weight: 600; }
.steps { margin: var(--s-2) 0 var(--s-1); padding-left: var(--s-5); color: var(--ink-2); font-size: var(--fs-sm); }
.steps li + li { margin-top: var(--s-1); }

/* ---------- Layout-Helfer ---------- */
.row { display: flex; align-items: center; gap: var(--s-3); }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stack > * + * { margin-top: var(--s-3); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.grid-2 > * { min-width: 0; }
.grid-2 > .input { width: 100%; min-width: 0; }
.spacer { flex: 1; }

/* ---------- Karten & Listen ---------- */
.card { margin: 0 0 var(--s-3); padding: var(--s-4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
button.card { width: 100%; text-align: left; font: inherit; }
.card h2 { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-3); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.card h2 .spacer { flex: 1; }
.card-title { margin: 0 0 var(--s-1); font-size: var(--fs-base); }
.ic-badge { display: inline-flex; color: var(--tint, var(--muted)); }
.list { margin-bottom: var(--s-3); overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.list.flush { margin: 0 calc(-1 * var(--s-4)) calc(-1 * var(--s-4)); border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.item {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 56px; padding: var(--s-3) var(--s-4);
  background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; transition: background var(--t-fast);
}
.item:last-child { border-bottom: 0; }
.item .title { font-weight: 600; }
.item .meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: 2px; font-size: var(--fs-sm); color: var(--muted); }
.item.done .title { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.item > button.grow { align-self: stretch; display: flex; flex-direction: column; justify-content: center; min-height: 32px; padding: 0; border: 0; background: none; text-align: left; }
.item.choice { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.emoji { flex: none; width: 34px; text-align: center; font-size: 22px; }
.empty { padding: var(--s-6) var(--s-2); text-align: center; color: var(--muted); }
.empty-emoji { margin-bottom: var(--s-2); font-size: 32px; line-height: 1; }
.error-state .btn { display: inline-flex; margin-top: var(--s-3); }
.spinner { width: 26px; height: 26px; margin: 0 auto var(--s-3); border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.diag { display: flex; flex-direction: column; gap: var(--s-1); margin-top: var(--s-2); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); font-size: var(--fs-sm); }
.diag.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.diag.err { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }

/* Hinweis-Karte (z. B. „1 neue Nachricht“) */
.notice-card { display: flex; align-items: center; gap: var(--s-3); border-left: 3px solid var(--violet); }
.notice-card .title { font-weight: 600; }
.notice-card .l { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: var(--fs-sm); color: var(--muted); }
.notice-emoji { flex: none; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--r-md); background: var(--surface-2); font-size: 22px; }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 44px; padding: 0 var(--s-5); border: 0; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-ink); font-weight: 600; font-size: var(--fs-base);
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}
a.btn { text-decoration: none; }
.btn:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }
.btn.secondary { background: var(--surface); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.ghost { min-height: 32px; padding: var(--s-1) var(--s-2); background: none; color: var(--accent-text); }
.btn.danger { background: none; color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 34px; padding: 0 var(--s-3); font-size: var(--fs-sm); white-space: nowrap; }
.btn.small.redeem { min-height: 40px; }
.btn.small.redeem.secondary { background: var(--surface); color: var(--ink); }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.icon-btn.flat { border-color: transparent; background: none; }
/* Eigenes Avatar oben rechts → Profil & Einstellungen */
.me-btn { flex: none; width: 44px; height: 44px; border-radius: var(--r-full); }
.me-btn .avatar { width: 34px; height: 34px; font-size: 13px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line); }
.me-btn .icon-badge { top: 0; right: 0; }
.fab {
  position: fixed; z-index: 9; right: max(var(--s-5), calc((100% - var(--content)) / 2 + var(--s-5))); bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--s-4));
  display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; border: 0; border-radius: var(--r-lg);
  background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow-md);
  transition: background var(--t-fast), transform var(--t-fast);
}
.fab svg.icon { width: 26px; height: 26px; }

/* ---------- Formulare ---------- */
label.field { display: block; }
label.field > span { display: block; margin: 0 0 6px 2px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-md);
  background: var(--surface); font-size: 16px; /* iOS zoomt bei < 16 px */ outline: none; -webkit-appearance: none; appearance: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
textarea.input { min-height: 80px; resize: vertical; }
.input::placeholder { color: color-mix(in srgb, var(--muted) 85%, transparent); }
.input:focus { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 25%, transparent); }
.input:focus-visible { outline: none; }
select.input { padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 52%, calc(100% - 14px) 52%; background-size: 6px 6px; background-repeat: no-repeat; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-1) 2px; font-weight: 600; }
.switch input { position: relative; flex: none; width: 44px; height: 26px; border-radius: var(--r-full); background: var(--line-strong); -webkit-appearance: none; appearance: none; transition: background var(--t); }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--t) var(--ease); }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.item.switch { padding: var(--s-3) var(--s-4); }
.color-pick { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.color-pick button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.color-pick button.on { border-color: var(--ink); }

/* Chips & Segmente */
.chips { display: flex; gap: var(--s-2); padding: 2px 2px 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chips.wrap .chip { max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
.chip.on { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.chip .dot { width: 9px; height: 9px; }
.chip.member.on { background: var(--cb, var(--c)); border-color: var(--cb, var(--c)); color: #fff; }
.chip.member.on .dot { background: #fff !important; }
.segmented { display: flex; margin: 0 0 var(--s-4); padding: 3px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.segmented button { flex: 1; padding: 7px 6px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; transition: background var(--t-fast), color var(--t-fast); }
.segmented button.on { background: var(--surface); color: var(--accent-text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

/* Kleine Elemente */
.dot { display: inline-block; flex: none; width: 9px; height: 9px; border-radius: 50%; }
.avatar { display: inline-flex; flex: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: #fff; font-size: 14px; font-weight: 700; letter-spacing: .02em; line-height: 1; }
.avatar.sm { width: 24px; height: 24px; font-size: 10.5px; }
.avatars { display: inline-flex; }
.avatars .avatar.sm + .avatar.sm { margin-left: -4px; box-shadow: 0 0 0 2px var(--surface); }
.avatar.more { background: var(--surface-3); color: var(--ink-2); font-size: 10px; }
.avatar-space { flex: none; width: 26px; height: 26px; }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); font-size: var(--fs-xs); font-weight: 600; }
.tag.warn { background: var(--warn-soft); color: var(--warn); box-shadow: none; }
.tag.star { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: #7a5400; box-shadow: none; }
.tag.together { background: color-mix(in srgb, var(--violet) 12%, var(--surface)); color: var(--violet); box-shadow: none; }
.tag.wish, .tag.gift { background: color-mix(in srgb, var(--pink) 12%, var(--surface)); color: var(--pink); box-shadow: none; }
.tag.vis { background: var(--surface-2); color: var(--ink-2); }
@media (prefers-color-scheme: dark) { .tag.star { color: #ffd45c; } }

/* Häkchen */
.check {
  display: inline-flex; flex: none; align-items: center; justify-content: center; width: 26px; height: 26px; padding: 0;
  border: 1.5px solid var(--line-strong); border-radius: 8px; background: none; color: transparent;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.check.on { background: var(--accent); border-color: var(--accent); color: #fff; animation: pop var(--t-slow) cubic-bezier(.2, 1.6, .4, 1); }
.check svg.icon { width: 15px; height: 15px; stroke-width: 3; }
@keyframes pop { 0% { transform: scale(.8); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
.burst { position: fixed; z-index: 70; width: 7px; height: 7px; margin: -3px 0 0 -3px; border-radius: 2px; background: var(--c); pointer-events: none; animation: burst .8s var(--ease) forwards; }
.burst.glyph { width: auto; height: auto; margin: -11px 0 0 -8px; background: none; color: var(--gold); font-size: 20px; }
@keyframes burst { from { transform: translate(0, 0) scale(.6); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) scale(1) rotate(180deg); opacity: 0; } }

/* Fortschritt */
.progress { height: 8px; margin: var(--s-3) var(--s-1) 6px; overflow: hidden; border-radius: var(--r-full); background: var(--surface-3); }
.progress > span { display: block; height: 100%; border-radius: var(--r-full); background: var(--accent); transition: width var(--t-slow) var(--ease); }
.progress.green > span { background: var(--ok); }

/* ---------- Heute ---------- */
.hero {
  position: relative; display: flex; align-items: center; gap: var(--s-4);
  margin: calc(env(safe-area-inset-top) + var(--s-3)) max(var(--s-4), calc((100% - var(--content)) / 2 + var(--s-4))) var(--s-3);
  padding: var(--s-5); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.hero .sub { color: var(--muted); font-size: var(--fs-sm); font-weight: 500; }
.hero h1 { margin: 2px 0 var(--s-3); font-size: var(--fs-xl); line-height: 1.15; letter-spacing: -.025em; }
.hero-family { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s-2); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
.hero .avatars .avatar.sm { box-shadow: 0 0 0 2px var(--surface); }
.hero-ring { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: var(--s-1); padding: var(--s-1); border: 0; border-radius: var(--r-md); background: none; color: var(--ink); transition: background var(--t-fast); }
.ring-wrap { position: relative; width: 64px; height: 64px; }
.ring { width: 64px; height: 64px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; stroke-linecap: round; }
.ring-bg { stroke: var(--surface-3); }
.ring-fg { stroke: var(--accent); transition: stroke-dasharray .6s var(--ease); }
.ring-label { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: var(--fs-base); font-weight: 700; font-variant-numeric: tabular-nums; }
.ring-cap { color: var(--muted); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; }

.hero-side { flex: none; align-self: flex-start; display: flex; flex-direction: column; align-items: flex-end; gap: var(--s-1); margin: calc(-1 * var(--s-2)) calc(-1 * var(--s-2)) 0 0; }

/* ---------- Kalender ---------- */
.cal-sticky {
  position: sticky; top: 0; z-index: 4; margin: 0 calc(-1 * var(--s-4)) var(--s-2); padding: calc(env(safe-area-inset-top) + var(--s-2)) var(--s-4) var(--s-2);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
}
.weekbar { display: flex; align-items: center; gap: var(--s-2); margin: 0 0 var(--s-2); }
.weekbar .label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-md); font-weight: 600; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: var(--s-1); padding: var(--s-2) 6px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; border: 0; border-radius: var(--r-md); background: none; transition: background var(--t-fast); }
.day .wd { color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.day .num { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: var(--r-md); font-size: var(--fs-md); font-weight: 600; font-variant-numeric: tabular-nums; }
.day.today .num { background: var(--accent); color: var(--accent-ink); }
.day .dots { display: flex; gap: 2px; height: 6px; }
.day .dots .dot { width: 5px; height: 5px; }
.day-section .section-title { margin-top: var(--s-4); }
.event {
  display: flex; align-items: stretch; gap: var(--s-3); width: 100%; padding: var(--s-3) var(--s-4);
  border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; transition: background var(--t-fast);
}
.event:last-child { border-bottom: 0; }
.event .time { flex: none; width: 50px; padding-top: 1px; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; line-height: 1.3; font-variant-numeric: tabular-nums; }
.event .time .end { display: block; margin-top: 2px; color: var(--muted); font-weight: 500; }
.event .time.allday { padding-top: 2px; font-size: var(--fs-xs); line-height: 1.2; hyphens: none; }
.event .bar { flex: none; width: 3px; border-radius: 2px; background: var(--muted); }
.event .grow { min-width: 0; }
.event .title { font-weight: 600; line-height: 1.3; overflow-wrap: anywhere; }
.event .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-3); margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--muted); }
.event .meta span { display: inline-flex; align-items: flex-start; gap: 4px; min-width: 0; line-height: 1.3; overflow-wrap: anywhere; }
.event .meta span svg.icon.sm { margin-top: 1px; }
.event .meta .avatars, .event .meta .avatar { align-items: center; gap: 0; line-height: 1; }
.event.past .time, .event.past .title { color: var(--muted); }
.tag.school { background: color-mix(in srgb, var(--orange) 14%, var(--surface)); color: var(--warn); box-shadow: none; }
.tag.danger { background: var(--danger-soft); color: var(--danger); box-shadow: none; }
.event.lesson .title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--s-2); }
.event.lesson.off .subj { text-decoration: line-through; color: var(--muted); }
.lesson-note { margin-top: var(--s-1); font-size: var(--fs-sm); color: var(--ink-2); overflow-wrap: anywhere; }
.school-block + .school-block { margin-top: var(--s-4); padding-top: var(--s-3); border-top: 1px solid var(--line); }
.school-head { display: flex; align-items: center; gap: var(--s-2); width: 100%; padding: 0 0 var(--s-2); border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.school-head .title { font-weight: 700; }
.school-later .small { margin: 2px 2px 0; }
.event.past .title { font-weight: 500; }
.event.past .bar { opacity: .4; }

/* ---------- Einkauf ---------- */
.addbar { position: relative; display: flex; gap: var(--s-2); margin-bottom: var(--s-2); }
.addbar .input { flex: 1; }
.addbar .qty { flex: none; width: 84px; }
.addbar .btn { padding: 0 var(--s-4); }
.suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 4; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-md); }
.suggest button { display: flex; gap: var(--s-2); width: 100%; padding: var(--s-3) var(--s-4); border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.suggest button:last-child { border-bottom: 0; }
.cart-progress { margin: 6px 0 var(--s-1); padding: var(--s-3) var(--s-4) var(--s-3); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: var(--fs-sm); font-weight: 600; }
.cart-progress .progress { margin: var(--s-2) 0 2px; }

/* ---------- Dialoge (Bottom-Sheet) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgba(10, 14, 22, .45); animation: fade var(--t-fast) ease-out; }
.sheet {
  display: flex; flex-direction: column; width: 100%; max-width: 640px; max-height: calc(100% - env(safe-area-inset-top) - var(--s-6));
  border-radius: var(--r-lg) var(--r-lg) 0 0; background: var(--bg); box-shadow: var(--shadow-md); animation: up var(--t-slow) var(--ease);
}
.sheet:focus { outline: none; }
@media (min-width: 700px) { .sheet-backdrop { align-items: center; } .sheet { border-radius: var(--r-lg); } }
.sheet-head { display: flex; align-items: center; gap: var(--s-2); padding: var(--s-4) var(--s-3) var(--s-2) var(--s-5); }
.sheet-head h2 { flex: 1; margin: 0; font-size: var(--fs-lg); }
.sheet-body { overflow-y: auto; padding: 6px var(--s-5) var(--s-4); -webkit-overflow-scrolling: touch; }
.sheet-foot { display: flex; gap: var(--s-3); padding: var(--s-3) var(--s-5) calc(var(--s-4) + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-foot .btn { flex: 1; }
@keyframes up { from { transform: translateY(32px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; z-index: 60; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 88px); transform: translateX(-50%);
  max-width: calc(100% - var(--s-8)); padding: var(--s-3) var(--s-4); border-radius: var(--r-md);
  background: var(--ink); color: var(--surface); font-size: var(--fs-sm); font-weight: 600; box-shadow: var(--shadow-md); animation: up var(--t) var(--ease);
}
.toast.error { background: var(--danger); color: #fff; }
.toast.gold { background: var(--gold); color: var(--gold-ink); }

/* ---------- Anmeldung & Start ---------- */
.auth { max-width: 420px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 48px) var(--s-5) 40px; }
.brand { display: flex; flex-direction: column; align-items: center; gap: var(--s-3); margin-bottom: var(--s-8); text-align: center; }
.brand img { width: 72px; height: 72px; border-radius: 16px; box-shadow: var(--shadow-md); }
.brand h1 { margin: 0; font-size: var(--fs-2xl); letter-spacing: -.03em; }
.brand p { margin: 0; color: var(--ink-2); }
.boot { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-4); min-height: 100vh; min-height: 100dvh; color: var(--muted); font-weight: 600; }
.boot-logo { display: block; border-radius: 16px; box-shadow: var(--shadow-md); }
.boot p { margin: 0; }

/* ---------- Sterne & Belohnungen ---------- */
.star-card, .star-hero { position: relative; overflow: hidden; border: 0; color: var(--gold-ink); background: linear-gradient(135deg, #ffd43b, var(--gold-2)); }
.star-card { display: block; width: 100%; text-align: left; }
.star-card::after, .star-hero::after { content: "★"; position: absolute; right: -24px; top: -38px; font-size: 140px; line-height: 1; color: #fff; opacity: .22; transform: rotate(14deg); pointer-events: none; }
.star-card .l { font-size: var(--fs-sm); font-weight: 600; opacity: .85; }
.star-card .n { display: flex; align-items: center; gap: 6px; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; }
.star-card .st, .star-hero .big .st { color: #fff; text-shadow: 0 1px 4px rgba(150, 95, 0, .35); }
.star-hero { padding: var(--s-6) var(--s-4) var(--s-5); text-align: center; }
.star-hero .big { display: inline-flex; align-items: center; gap: var(--s-2); font-size: 52px; font-weight: 700; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.star-hero .sub { margin-top: 6px; font-size: var(--fs-sm); font-weight: 600; opacity: .8; }
.star-hero .muted { color: inherit; opacity: .85; }
.progress.light, .star-hero .progress { margin: var(--s-3) 0 6px; background: rgba(255, 255, 255, .5); }
.progress.light > span, .star-hero .progress > span { background: #fff; }
@media (prefers-color-scheme: dark) { .star-card, .star-hero { color: #fff7db; background: linear-gradient(135deg, #b8860b, #8a5a00); } }
.star-num { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.star-num .st { color: var(--gold); }
.star-num.neg { color: var(--danger); }
.card.pot { border-left: 3px solid var(--violet); }
.card.pot .progress { margin: var(--s-3) 0 var(--s-2); }
.card.pot .row { flex-wrap: wrap; }
.pot-count { font-size: var(--fs-md); white-space: nowrap; }

/* ---------- Wo ist? ---------- */
.map { position: relative; margin: 0 -4px; overflow: hidden; border-radius: var(--r-md); background: #e7e9ee; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.map:active { cursor: grabbing; }
.map-tiles, .map-marks { position: absolute; inset: 0; }
.map-tile { position: absolute; left: 0; top: 0; width: 256px; height: 256px; max-width: none; pointer-events: none; }
.map-mark { position: absolute; left: 0; top: 0; width: 0; height: 0; }
.map-pin { position: absolute; left: -18px; top: -18px; display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; color: #fff; font-size: var(--fs-sm); font-weight: 700; box-shadow: 0 0 0 3px #fff, var(--shadow-md); }
.map-acc { position: absolute; transform: translate(-50%, -50%); border-radius: 50%; background: color-mix(in srgb, var(--c) 18%, transparent); border: 1.5px solid color-mix(in srgb, var(--c) 55%, transparent); }
.map-label { position: absolute; top: 22px; left: 50%; transform: translateX(-50%); padding: 1px 7px; border-radius: 6px; background: var(--surface); color: var(--ink); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; box-shadow: var(--shadow-sm); }
.map-mark.stale .map-pin { filter: grayscale(.7); opacity: .75; }
.map-ctrl { position: absolute; top: var(--s-2); right: var(--s-2); display: flex; flex-direction: column; gap: 6px; }
.map-ctrl button { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: var(--fs-lg); font-weight: 600; box-shadow: var(--shadow-sm); }
.map-attrib { position: absolute; right: 0; bottom: 0; padding: 1px 6px; border-top-left-radius: 6px; background: rgba(255, 255, 255, .85); color: #333; font-size: 10px; text-decoration: none; }
@media (prefers-color-scheme: dark) { .map { background: #1b1f27; } .map-tile { filter: brightness(.78) contrast(1.08) saturate(.85); } }
.where-list .item { min-height: 58px; }
.where-list .btn.ghost { white-space: nowrap; }
.push-devices .btn.ghost { white-space: nowrap; color: var(--danger); }

/* ---------- Chat ---------- */
.chat-list .chat-row { min-height: 70px; }
.chat-row.unread .title, .chat-row.unread .meta { color: var(--ink); font-weight: 700; }
.avatar.chat-family { background: var(--accent); font-size: 18px; }
.chat-main { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 84px); }
.chat-day { margin: var(--s-4) 0 var(--s-2); text-align: center; }
.chat-day span { padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r-full); background: var(--surface); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.msg { display: flex; align-items: flex-end; gap: 6px; margin: 2px 0; }
.msg.mine { justify-content: flex-end; }
.msg.last { margin-bottom: var(--s-2); }
.msg .avatar.sm { width: 26px; height: 26px; }
.bubble { position: relative; max-width: 78%; padding: var(--s-2) var(--s-3) 6px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); line-height: 1.4; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine .bubble { border-color: transparent; background: var(--accent); color: var(--accent-ink); cursor: pointer; }
.msg.theirs.last .bubble { border-bottom-left-radius: 6px; }
.msg.mine.last .bubble { border-bottom-right-radius: 6px; }
.bubble.deleted { background: none !important; color: var(--muted) !important; font-style: italic; border: 1px dashed var(--line-strong) !important; cursor: default; }
.msg-name { margin-bottom: 1px; color: var(--cr, var(--muted)); font-size: var(--fs-xs); font-weight: 700; }
@media (prefers-color-scheme: dark) { .msg-name { color: color-mix(in srgb, var(--c, var(--muted)) 70%, #fff); } }
.msg-time { float: right; margin: 6px 0 0 var(--s-2); font-size: 10.5px; opacity: .7; font-variant-numeric: tabular-nums; }
.chat-bar {
  position: fixed; z-index: 9; left: 0; right: 0; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom));
  display: flex; align-items: flex-end; gap: var(--s-2); max-width: var(--content); margin: 0 auto; padding: var(--s-2) var(--s-3);
  border-top: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
textarea.input.chat-input { height: 42px; min-height: 42px; max-height: 120px; padding: 10px 14px; border-radius: 21px; line-height: 1.35; resize: none; }
.chat-send { flex: none; width: 42px; min-height: 42px; height: 42px; padding: 0; border-radius: 50%; }
.bubble-preview { padding: var(--s-3) var(--s-4); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); white-space: pre-wrap; }

/* ---------- Wunschlisten ---------- */
details.archive summary { margin: var(--s-3) 2px var(--s-1); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.wish-list .item.wish { align-items: center; }
.wish-prio { flex: none; width: 30px; text-align: center; font-size: 20px; }
.item.wish.taken .title { color: var(--muted); }
.item.wish.removed { opacity: .8; }
.wish-link { display: inline-flex; align-items: center; min-height: 28px; color: var(--accent-text); font-weight: 600; text-decoration: none; }
.wish-act { display: flex; flex: none; flex-direction: column; align-items: flex-end; gap: 2px; }
.wish-bought { display: flex; align-items: center; gap: 6px; min-height: 32px; padding: var(--s-1) 0; color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
.wish-bought input { width: 24px; height: 24px; accent-color: var(--accent); }
.wish-secret { cursor: default; }
@media (max-width: 560px) {
  .item.wish { flex-wrap: wrap; row-gap: 6px; }
  .item.wish > .grow { flex: 1 1 calc(100% - 50px); }
  .item.wish > .btn, .item.wish > .wish-act, .item.wish > .tag { margin-left: 42px; }
  .wish-act { flex-direction: row; align-items: center; gap: var(--s-4); }
}

/* ---------- Einstellungen ---------- */
.settings-section { margin-bottom: var(--s-2); }
.settings-section > .card, .settings-section > .list { margin-bottom: var(--s-3); }

/* ---------- Mikro-Interaktionen ---------- */
@media (hover: hover) {
  button.item:hover, a.item:hover, label.item:hover, button.event:hover, .suggest button:hover { background: var(--surface-2); }
  .chip:hover { border-color: var(--ink-2); color: var(--ink); }
  .chip.on:hover, .chip.member.on:hover { color: #fff; }
  .chip.on:hover { color: var(--surface); }
  .btn:not(.secondary):not(.ghost):not(.danger):not(:disabled):hover, .fab:hover { background: var(--accent-hover); }
  .btn.secondary:hover { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--ink-2); }
  .btn.ghost:hover, .btn.danger:hover { background: var(--surface-3); }
  .icon-btn:hover { background: var(--surface-2); border-color: var(--line-strong); }
  .icon-btn.flat:hover { background: var(--surface-3); }
  .segmented button:not(.on):hover { color: var(--ink); background: color-mix(in srgb, var(--surface) 60%, transparent); }
  button.card:hover, .hero-ring:hover { background: var(--surface-2); }
  .day:hover { background: var(--surface-2); }
  .nav button:not(.active):hover { color: var(--ink); }
  .nav button:not(.active):hover svg.icon { background: var(--surface-3); }
}
.btn:active:not(:disabled), .icon-btn:active, .fab:active, .chip:active, button.card:active { transform: scale(.97); }
main > * { animation: rise var(--t-slow) var(--ease) both; }
.chat-main > * { animation: none; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .btn:active, .icon-btn:active, .fab:active, .chip:active, button.card:active { transform: none; }
}

/* ---------- Tagesvers ---------- */
.verse-card { margin-left: 0; margin-right: 0; border-left: 3px solid var(--gold, #f5b301); }
.verse-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-2); font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.verse-card blockquote { margin: 0; font-size: var(--fs-md); line-height: 1.55; color: var(--ink); text-wrap: pretty; }
.verse-card figcaption { margin-top: var(--s-2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }

/* ---------- Pinnwand ---------- */
.field-label { display: block; margin: 0 0 6px 2px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.board { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); }
@media (min-width: 640px) { .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.card.note { min-width: 0; margin: 0; display: flex; flex-direction: column; gap: var(--s-2); }
.card.note.pinned { border-color: color-mix(in srgb, var(--violet) 35%, var(--line)); }
.note-head { display: flex; align-items: center; gap: var(--s-2); min-width: 0; }
.note-emoji { flex: none; font-size: 22px; line-height: 1; }
.card .note-title { flex: 1; min-width: 0; margin: 0; font-size: var(--fs-base); font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink); overflow-wrap: anywhere; }
.note-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: var(--fs-md); line-height: 1.5; color: var(--ink); }
.note-body a { padding: 3px 0; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.note-foot { display: flex; align-items: center; gap: var(--s-1); margin-top: var(--s-1); padding-top: var(--s-2); border-top: 1px solid var(--line); }
.board-templates { margin-top: var(--s-4); }
.chip.emoji-chip { min-width: 44px; justify-content: center; font-size: 20px; padding-left: 0; padding-right: 0; }
.note-foot .grow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Bestätigung erledigter Aufgaben ---------- */
.tag.wait { background: color-mix(in srgb, var(--gold) 18%, var(--surface)); color: var(--gold-ink); }
@media (prefers-color-scheme: dark) { .tag.wait { color: #ffd980; } }
.item.approval { flex-wrap: wrap; }
.approval-act { display: flex; gap: var(--s-2); margin-left: auto; }
@media (max-width: 420px) { .approval-act { width: 100%; justify-content: flex-end; } }

/* ---------- Spiel „Ballzauber“ ---------- */
.card.game-card { display: flex; align-items: center; gap: var(--s-3); width: 100%; text-align: left; border-left: 3px solid var(--accent); }
.game-main { padding-bottom: var(--s-8); }
.game-wrap { position: relative; width: min(100%, 420px, calc((100dvh - 210px) * 0.643)); min-width: 260px; margin: 0 auto; aspect-ratio: 360 / 560; border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); touch-action: none; user-select: none; -webkit-user-select: none; }
.game-canvas { display: block; width: 100%; height: 100%; outline: none; }
.game-canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.game-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-3); padding: var(--s-6); text-align: center; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.game-overlay[hidden] { display: none; }
.game-overlay h2 { margin: 0; font-size: var(--fs-xl); color: var(--ink); }
.game-overlay p { margin: 0; max-width: 300px; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; }
.game-overlay .btn { min-width: 200px; }
.game-logo { font-size: 44px; line-height: 1; }
.game-time { font-weight: 600; color: var(--ink) !important; }
.game-score { font-size: 48px; font-weight: 700; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.game-record { font-weight: 700; color: var(--ink) !important; }
.game-actions { width: 100%; max-width: 280px; }
.game-actions .btn { width: 100%; }
.game-best { width: min(100%, 420px); margin: var(--s-4) auto 0; }
.best-list { list-style: none; margin: 0; padding: 0; }
.best-list li { display: flex; align-items: center; gap: var(--s-2); padding: 6px 0; border-top: 1px solid var(--line); font-size: var(--fs-md); }
.best-list li:first-child { border-top: 0; }
.best-rank { width: 26px; text-align: center; }

/* ---------- Erinnerungen ---------- */
.tag.remind { background: var(--accent-soft); color: var(--accent-text); }
.chip:disabled { opacity: .45; cursor: not-allowed; }
.time-pick { display: flex; align-items: center; gap: var(--s-1); }
.time-pick select.input { flex: 1; min-width: 0; padding-right: 30px; background-position: calc(100% - 16px) 52%, calc(100% - 10px) 52%; }
.time-pick .time-sep { flex: none; font-weight: 700; color: var(--muted); }

/* Sprung aus einer Mitteilung: Ziel unter der Kopfzeile platzieren und kurz hervorheben */
[data-focus] { scroll-margin-top: calc(env(safe-area-inset-top) + 84px); }
.flash { border-radius: var(--r-md); animation: flash 2.2s var(--ease) both; }
@keyframes flash {
  0%, 35% { box-shadow: 0 0 0 3px var(--accent); background-color: var(--accent-soft); }
  100% { box-shadow: 0 0 0 3px transparent; }
}
@media (prefers-reduced-motion: reduce) { .flash { animation: none; outline: 3px solid var(--accent); outline-offset: 2px; } }
/* Tagesvers beim ersten Öffnen des Tages: liegt über der App, bis er bestätigt wird */
.verse-gate { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: calc(env(safe-area-inset-top) + var(--s-5)) var(--s-5) calc(env(safe-area-inset-bottom) + var(--s-5)); background: rgba(10, 14, 22, .55); animation: fade var(--t-fast) ease-out; overflow-y: auto; }
.verse-gate-card { width: 100%; max-width: 480px; margin: auto; padding: var(--s-6) var(--s-5) var(--s-5); border-radius: var(--r-lg); border-top: 4px solid var(--gold, #f5b301); background: var(--bg); box-shadow: var(--shadow-md); animation: up var(--t-slow) var(--ease); }
.verse-gate-card .verse-head { justify-content: center; }
.verse-gate-card blockquote { margin: var(--s-3) 0 0; font-size: var(--fs-lg); line-height: 1.55; text-align: center; color: var(--ink); text-wrap: pretty; }
.verse-gate-card figcaption { margin: var(--s-3) 0 var(--s-5); text-align: center; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
