/* Unser Zuhause – warm, ruhig, mobil zuerst */
:root {
  --bg: #f6f1e7; --bg2: #efe7d8; --card: #fffdf8; --card2: #fbf7ef; --line: #e6dccb;
  --ink: #2f2a24; --ink2: #5c5348; --muted: #8a7f71;
  --sage: #6f8466; --sage2: #8a9a7b; --sage-soft: #e3e9dc; --olive: #7d8450;
  --terra: #b8673f; --terra-soft: #f3e0d3; --blue: #5f7d95; --blue-soft: #dfe7ee;
  --gold: #c99a3b; --danger: #b04a3a; --danger-soft: #f6dcd5; --ok: #5e8c61;
  --shadow: 0 1px 2px rgba(60, 45, 25, .06), 0 6px 18px rgba(60, 45, 25, .07);
  --shadow-lg: 0 10px 40px rgba(40, 30, 15, .18);
  --r: 18px; --r-sm: 12px; --tab-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-round: ui-rounded, "SF Pro Rounded", -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1a17; --bg2: #24211d; --card: #2a2622; --card2: #312c27; --line: #3d3731;
    --ink: #f1ebe0; --ink2: #d2c8b9; --muted: #a39887;
    --sage: #9bb38f; --sage2: #8fa585; --sage-soft: #2f3a2c; --olive: #b2b97e;
    --terra: #e08f63; --terra-soft: #47302a; --blue: #94b3cb; --blue-soft: #2a3540;
    --gold: #e0b75c; --danger: #e47a66; --danger-soft: #4a2a24; --ok: #8fc093;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1a17; --bg2: #24211d; --card: #2a2622; --card2: #312c27; --line: #3d3731;
  --ink: #f1ebe0; --ink2: #d2c8b9; --muted: #a39887;
  --sage: #9bb38f; --sage2: #8fa585; --sage-soft: #2f3a2c; --olive: #b2b97e;
  --terra: #e08f63; --terra-soft: #47302a; --blue: #94b3cb; --blue-soft: #2a3540;
  --gold: #e0b75c; --danger: #e47a66; --danger-soft: #4a2a24; --ok: #8fc093;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 18px rgba(0, 0, 0, .25);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45; }
body { min-height: 100vh; overflow-x: hidden; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--sage); }
h1, h2, h3 { font-family: var(--font-round); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.65rem; font-weight: 700; }
h2 { font-size: 1.2rem; font-weight: 700; }
h3 { font-size: 1.02rem; font-weight: 650; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 18px; height: 18px; }
svg.i.l { width: 28px; height: 28px; }

/* ---------- Grundlayout ---------- */
#app { max-width: 760px; margin: 0 auto; min-height: 100vh; padding-bottom: calc(var(--tab-h) + var(--safe-b) + 24px); }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 10px) 16px 10px; 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 .title { flex: 1; min-width: 0; }
.topbar .title h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.iconbtn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: var(--card); color: var(--ink); box-shadow: var(--shadow); cursor: pointer; }
.iconbtn:active { transform: scale(.95); }
.sync { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); padding: 6px 10px;
  border-radius: 999px; background: var(--card); box-shadow: var(--shadow); white-space: nowrap; }
.sync .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.sync.saving .dot { background: var(--gold); animation: pulse 1s infinite; }
.sync.offline .dot, .sync.error .dot { background: var(--danger); }
.sync.offline { color: var(--danger); }
main { padding: 4px 16px 16px; }
.section { margin: 18px 0 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.section h2 { font-size: 1.08rem; }

/* ---------- Tab-Leiste ---------- */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: center;
  padding: 6px 8px calc(var(--safe-b) + 6px); background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-top: 1px solid var(--line); }
.tabbar nav { display: flex; width: 100%; max-width: 560px; justify-content: space-around; }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; text-decoration: none;
  color: var(--muted); font-size: .7rem; font-weight: 600; border-radius: 14px; min-height: 52px; justify-content: center; }
.tabbar a.on { color: var(--sage); }
.tabbar a.on svg { stroke-width: 2.2; }

/* ---------- Karten / Kacheln ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 16px; margin: 10px 0; }
.card.soft { background: var(--card2); box-shadow: none; border: 1px solid var(--line); }
.card.tap { cursor: pointer; transition: transform .15s ease; }
.card.tap:active { transform: scale(.985); }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.card-h h3 { flex: 1; }
.badge-i { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--sage-soft); color: var(--sage); flex: none; }
.badge-i.terra { background: var(--terra-soft); color: var(--terra); }
.badge-i.blue { background: var(--blue-soft); color: var(--blue); }
.badge-i.gold { background: color-mix(in srgb, var(--gold) 18%, var(--card)); color: var(--gold); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
@media (min-width: 640px) { .grid-auto { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; } }
.kpi { font-family: var(--font-round); font-size: 1.9rem; font-weight: 750; letter-spacing: -.02em; }
.kpi.s { font-size: 1.25rem; }
.kpi.pos { color: var(--ok); }
.kpi.neg { color: var(--danger); }
.stat { background: var(--card2); border-radius: var(--r-sm); padding: 10px 12px; }
.stat .l { font-size: .75rem; color: var(--muted); }
.stat .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.hello { margin: 6px 0 4px; }
.hello .date { color: var(--muted); font-size: .95rem; }

/* ---------- Listen ---------- */
.list { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; margin: 10px 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 13px 14px; min-height: 56px; border-bottom: 1px solid var(--line); cursor: pointer; }
.row:last-child { border-bottom: 0; }
.row:active { background: var(--card2); }
.row .main { flex: 1; min-width: 0; }
.row .t { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: .82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.row.static { cursor: default; }
.empty { text-align: center; padding: 28px 16px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--sage2); margin-bottom: 6px; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: .74rem; font-weight: 650;
  background: var(--sage-soft); color: var(--sage); white-space: nowrap; }
.pill.terra { background: var(--terra-soft); color: var(--terra); }
.pill.blue { background: var(--blue-soft); color: var(--blue); }
.pill.danger { background: var(--danger-soft); color: var(--danger); }
.pill.gray { background: var(--bg2); color: var(--muted); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; font-weight: 600;
  font-size: .9rem; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
a.chip, a.btn { text-decoration: none; color: inherit; }
a.btn:not(.sec):not(.danger) { color: #fff; }
.chip.on { background: var(--sage); border-color: var(--sage); color: #fff; }
.chip .cnt { font-size: .75rem; opacity: .85; }

/* ---------- Schaltflächen / Formulare ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 14px; padding: 12px 18px;
  min-height: 48px; font-weight: 650; background: var(--sage); color: #fff; cursor: pointer; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.sec { background: var(--card2); color: var(--ink); border: 1px solid var(--line); }
.btn.terra { background: var(--terra); }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.ghost { background: transparent; color: var(--sage); padding: 8px 10px; min-height: 40px; }
.btn.block { width: 100%; }
.btn.small { min-height: 38px; padding: 8px 12px; font-size: .9rem; border-radius: 11px; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.btnrow > .btn { flex: 1; }
.fab { position: fixed; right: max(18px, calc(50% - 362px)); bottom: calc(var(--tab-h) + var(--safe-b) + 18px); z-index: 25; width: 58px; height: 58px;
  border-radius: 20px; border: 0; background: var(--terra); color: #fff; box-shadow: var(--shadow-lg); display: grid; place-items: center; cursor: pointer; }
.fab:active { transform: scale(.94); }
label.f { display: block; margin: 12px 0; }
label.f > span { display: block; font-size: .82rem; font-weight: 650; color: var(--ink2); margin-bottom: 5px; }
label.f > small { display: block; color: var(--muted); font-size: .76rem; margin-top: 4px; }
input.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); background: var(--card2); border-radius: 12px;
  padding: 12px 13px; min-height: 48px; font-size: 16px; outline: none; appearance: none; -webkit-appearance: none; }
textarea.in { min-height: 96px; resize: vertical; }
select.in { background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--sage2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage2) 25%, transparent); }
input[type="color"].in { padding: 4px; height: 48px; }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; }
.toggle .sw { width: 50px; height: 30px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.toggle input:checked + .sw { background: var(--sage); }
.toggle input:checked + .sw::after { transform: translateX(20px); }
.seg { display: flex; background: var(--bg2); border-radius: 12px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; padding: 9px 6px; border-radius: 9px; font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--ink2); min-height: 40px; }
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.err { color: var(--danger); font-size: .9rem; margin: 8px 0; }
.note { background: var(--blue-soft); color: var(--ink2); border-radius: var(--r-sm); padding: 10px 12px; font-size: .88rem; margin: 10px 0; }
.note.warn { background: var(--terra-soft); }
.note.danger { background: var(--danger-soft); }

/* ---------- Fortschritt / Diagramme ---------- */
.bar { height: 10px; border-radius: 999px; background: var(--bg2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--sage2), var(--sage)); width: 0; transition: width .9s cubic-bezier(.2, .8, .2, 1); }
.bar.terra > i { background: linear-gradient(90deg, #d08a62, var(--terra)); }
.bar.over > i { background: var(--danger); }
.bar.thick { height: 14px; }
.ring { position: relative; width: 86px; height: 86px; flex: none; }
.ring svg { transform: rotate(-90deg); }
.ring .v { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-round); font-weight: 750; font-size: 1.15rem; }
.ring circle.fg { transition: stroke-dashoffset 1s cubic-bezier(.2, .8, .2, 1); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: .82rem; margin-top: 10px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.chart { width: 100%; overflow: visible; }
.chart text { font-size: 10px; fill: var(--muted); }
.motiv { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; }
.motiv svg { color: var(--gold); margin-top: 1px; }

/* ---------- Einkaufsliste ---------- */
.quickadd { display: flex; gap: 8px; position: sticky; top: calc(var(--safe-t) + 64px); z-index: 10; padding: 6px 0; background: var(--bg); }
.quickadd input { flex: 1; }
.quickadd .btn { min-width: 52px; padding: 0 14px; }
.shop-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; min-height: 58px; border-bottom: 1px solid var(--line); }
.shop-item:last-child { border-bottom: 0; }
.check { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--sage2); display: grid; place-items: center; cursor: pointer; flex: none; background: transparent; color: #fff; }
.check.on { background: var(--sage); border-color: var(--sage); }
.check.on svg { animation: pop .35s ease; }
.shop-item .name { flex: 1; font-weight: 600; font-size: 1.02rem; cursor: pointer; min-width: 0; }
.shop-item.done .name { text-decoration: line-through; color: var(--muted); font-weight: 500; }
.shop-item .qty { color: var(--terra); font-weight: 650; margin-left: 6px; }
.sugg { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.sugg button { border: 1px dashed var(--sage2); background: transparent; border-radius: 999px; padding: 6px 12px; font-size: .88rem; color: var(--sage); cursor: pointer; }

/* ---------- Galerie / Seiten ---------- */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.gallery .ph { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg2); cursor: pointer; }
.gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery .ph span { position: absolute; left: 6px; bottom: 6px; font-size: .68rem; background: rgba(0,0,0,.5); color: #fff; padding: 1px 6px; border-radius: 6px; }
.pages { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; }
.pages .pg { flex: none; width: 92px; height: 124px; border-radius: 10px; background: var(--bg2); display: grid; place-items: center; overflow: hidden; position: relative; cursor: pointer; border: 1px solid var(--line); }
.pages .pg img { width: 100%; height: 100%; object-fit: cover; }
.pages .pg span { position: absolute; bottom: 4px; right: 6px; font-size: .7rem; color: var(--muted); }

/* ---------- Kalender ---------- */
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.cal .dow { font-size: .72rem; color: var(--muted); padding: 4px 0; font-weight: 650; }
.cal .d { aspect-ratio: 1; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-variant-numeric: tabular-nums; position: relative; font-size: .92rem; }
.cal .d.out { color: var(--muted); opacity: .5; }
.cal .d.today { background: var(--sage-soft); color: var(--sage); font-weight: 750; }
.cal .d.sel { background: var(--sage); color: #fff; }
.cal .d .dots { display: flex; gap: 2px; height: 6px; margin-top: 2px; }
.cal .d .dots i { width: 5px; height: 5px; border-radius: 50%; background: var(--terra); }
.cal .d.sel .dots i { background: #fff; }

/* ---------- Overlays ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(30, 22, 12, .38); z-index: 50; animation: fade .2s ease; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-height: 92vh; overflow-y: auto; background: var(--bg);
  border-radius: 24px 24px 0 0; padding: 8px 16px calc(var(--safe-b) + 20px); box-shadow: var(--shadow-lg); animation: up .28s cubic-bezier(.2, .8, .2, 1);
  max-width: 760px; margin: 0 auto; overscroll-behavior: contain; }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 4px auto 10px; }
.sheet .sh-h { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; position: sticky; top: -8px; background: var(--bg); padding: 6px 0; z-index: 2; }
.sheet .sh-h h2 { flex: 1; }
.fullscreen { position: fixed; inset: 0; z-index: 60; background: #111; color: #fff; display: flex; flex-direction: column; }
.fullscreen .fs-bar { display: flex; gap: 8px; align-items: center; padding: calc(var(--safe-t) + 8px) 12px 8px; }
.fullscreen .fs-body { flex: 1; position: relative; overflow: hidden; display: grid; place-items: center; touch-action: none; }
.fullscreen .fs-foot { padding: 10px 12px calc(var(--safe-b) + 12px); display: flex; gap: 8px; flex-wrap: wrap; }
.fullscreen img.view { max-width: 100%; max-height: 100%; object-fit: contain; }
.handle { position: absolute; width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%; border: 3px solid #fff; background: rgba(184, 103, 63, .55); touch-action: none; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + var(--safe-b) + 22px); transform: translateX(-50%); z-index: 70; background: var(--ink); color: var(--bg);
  padding: 11px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; max-width: calc(100% - 32px); animation: up .25s ease; }
.toast.err { background: var(--danger); color: #fff; }
.celebrate { position: fixed; inset: 0; pointer-events: none; z-index: 80; overflow: hidden; }
.celebrate i { position: absolute; top: 40%; left: 50%; width: 8px; height: 12px; border-radius: 2px; animation: burst 1.1s cubic-bezier(.15, .7, .3, 1) forwards; }
.searchbox { display: flex; gap: 8px; align-items: center; }
.searchbox input { flex: 1; }
.hit-g { margin: 14px 0 4px; font-size: .78rem; font-weight: 750; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
mark { background: color-mix(in srgb, var(--gold) 35%, transparent); color: inherit; border-radius: 3px; }
.qr { background: #fff; padding: 12px; border-radius: 16px; display: inline-block; }
.qr svg { display: block; width: 210px; height: 210px; }
.codes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-family: ui-monospace, Menlo, Consolas, monospace; background: var(--card2); padding: 12px; border-radius: 12px; }
.auth { max-width: 420px; margin: 0 auto; padding: calc(var(--safe-t) + 40px) 20px 40px; }
.auth .logo { width: 76px; height: 76px; border-radius: 22px; margin-bottom: 14px; box-shadow: var(--shadow); }
.perm-grid { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; align-items: center; }
.perm-grid select { min-height: 40px; padding: 6px 30px 6px 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.t th, table.t td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; }
table.t td.n, table.t th.n { text-align: right; font-variant-numeric: tabular-nums; }

@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes pop { 0% { transform: scale(.3); } 70% { transform: scale(1.2); } 100% { transform: scale(1); } }
@keyframes burst { to { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; } }
:root[data-motion="reduced"] *, :root[data-motion="reduced"] *::before, :root[data-motion="reduced"] *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---- 4.0: Schnellaktionen, Punkte, Sparmeilensteine ---- */
.quick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 0 0 14px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: var(--card); border-radius: 16px;
  padding: 12px 4px 10px; box-shadow: var(--shadow); color: var(--ink); font: inherit; font-size: .78rem; font-weight: 600; cursor: pointer; min-height: 76px; }
.qa:active { transform: scale(.96); }
.qa span:last-child { text-align: center; line-height: 1.15; }
.tap { cursor: pointer; }
.bar.gold > i { background: linear-gradient(90deg, #e2c27a, var(--gold)); }
.card.xp { background: linear-gradient(135deg, color-mix(in srgb, var(--sage) 14%, var(--card)), var(--card)); }
.milestones { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.milestones .ms { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; padding: 3px 8px; border-radius: 999px;
  background: var(--bg2); color: var(--muted); }
.milestones .ms.on { background: color-mix(in srgb, var(--gold) 22%, var(--card)); color: var(--ink); }
.milestones .ms.on svg { color: var(--gold); }
.milestones .ms.was { outline: 1px dashed var(--gold); }
.num.neg { color: var(--danger); }
.num.pos { color: var(--ok); }
.card.setup { border: 1px dashed var(--terra); }
.btn:disabled, .check:disabled { opacity: .55; cursor: default; }
@media (max-width: 360px) { .quick { grid-template-columns: repeat(3, minmax(0, 1fr)); } }


/* ---- 5.0: Familienabenteuer ---- */
.gamebtn { position: fixed; z-index: 26; right: max(16px, calc(50% - 360px)); bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  width: 50px; height: 50px; border-radius: 16px; display: grid; place-items: center; text-decoration: none;
  background: linear-gradient(140deg, #6f8a5e, #3f5a4a); box-shadow: 0 6px 18px rgba(40, 60, 40, .35); border: 2px solid rgba(255,255,255,.6); }
body:has(.fab) .gamebtn { bottom: calc(var(--tab-h) + var(--safe-b) + 88px); }
.gamebtn:active { transform: scale(.94); }
.gamebtn.hidden { display: none; }
@media (max-height: 560px) { .gamebtn { width: 42px; height: 42px; border-radius: 13px; } body:has(.fab) .gamebtn { bottom: calc(var(--tab-h) + var(--safe-b) + 82px); } }
.game { --g1: #f6efe2; }
.g-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.g-back { font-weight: 700; }
.g-stats { display: flex; align-items: center; gap: 10px; }
.g-stats .ring .v { font-size: .9rem; }
.coins { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; background: var(--card); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow); }
.coin { display: inline-block; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe7a0, #e0b33c 60%, #b8862a); box-shadow: inset 0 0 0 1.5px #c99a3b; vertical-align: -2px; margin-right: 3px; }
.g-tabs { margin-bottom: 6px; }
.g-mission h3 { margin: 6px 0 2px; }
.g-mission.surprise { border: 2px solid var(--gold); background: linear-gradient(135deg, color-mix(in srgb, var(--gold) 12%, var(--card)), var(--card)); }
.g-mission.done { opacity: .7; }
.g-mtop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.g-rew { display: flex; gap: 10px; flex-wrap: wrap; font-size: .85rem; font-weight: 700; color: var(--ink2); margin: 6px 0; }
.g-hint { display: block; color: inherit; text-decoration: none; }
.g-editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 620px) { .g-editor { grid-template-columns: 260px minmax(0, 1fr); } }
.g-preview { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 8px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.sw-c { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.sw-c.on { outline: 3px solid var(--sage); outline-offset: 2px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.g-grid.small { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.g-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 16px; border: 2px solid transparent;
  background: var(--card); box-shadow: var(--shadow); font: inherit; color: var(--ink); cursor: pointer; min-height: 120px; text-align: center; }
.g-item b { font-size: .8rem; line-height: 1.15; }
.g-item.own { border-color: color-mix(in srgb, var(--sage) 45%, transparent); }
.g-item.equipped { border-color: var(--sage); background: color-mix(in srgb, var(--sage) 10%, var(--card)); }
.g-item.locked { opacity: .55; }
.g-ach { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 16px; background: var(--bg2); color: var(--muted); text-align: center; }
.g-ach.on { background: color-mix(in srgb, var(--gold) 16%, var(--card)); color: var(--ink); box-shadow: var(--shadow); }
.g-ach.on svg { color: var(--gold); }
.g-scene { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); overflow: hidden; }
.isohome { width: 100%; height: auto; display: block; touch-action: manipulation; }
.isohome .cell { cursor: pointer; }
.isohome .cell:hover { filter: brightness(1.06); }
.g-family { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.g-member { display: flex; flex-direction: column; align-items: center; gap: 2px; background: var(--card); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); }
.g-levelup { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 18px 26px; border-radius: 20px; background: var(--card); box-shadow: 0 12px 40px rgba(0,0,0,.25); text-align: center; animation: gpop .5s cubic-bezier(.2, 1.4, .4, 1); }
.g-levelup svg { width: 40px; height: 40px; color: var(--gold); }
@keyframes gpop { from { transform: translateX(-50%) scale(.6); opacity: 0; } to { transform: translateX(-50%) scale(1); opacity: 1; } }
:root[data-motion="reduced"] .g-levelup { animation: none; }
@media (prefers-reduced-motion: reduce) { .g-levelup { animation: none; } }
