/* Filzaboo – Eltern-Bereich (app.filzaboo.de/eltern). Look wie die Homepage (Website/style.css), mobil zuerst.
   Keine externen Anfragen: Schriften liegen in fonts/ (SIL OFL, siehe OFL-*.txt). */
@font-face { font-family: "Grandstander"; src: url("fonts/Grandstander.woff2?v=07f00a05") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Lexend"; src: url("fonts/Lexend.woff2?v=514f7f64") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --ink: #2E2340;
  --muted: #5E5670;
  --cream: #FFF6E6;
  --paper: #F6E7CF;
  --stitch: #C79A6B;
  --green: #5FB14D;
  --green-dark: #3F8A33;
  --pink: #F7C3D2;
  --yellow: #FFE39A;
  --blue: #BFE0F7;
  --blue-dark: #4F8DB8;
  --orange: #FFD2A6;
  --orange-dark: #E08A3C;
  --lilac: #E0D4F4;
  --red: #C8463D;
  --radius: 24px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 500 16px/1.55 "Lexend", system-ui, sans-serif;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,.35) 0 1px, transparent 1.5px) 0 0 / 7px 7px,
    radial-gradient(circle at 70% 60%, rgba(120,80,40,.06) 0 1px, transparent 1.6px) 0 0 / 9px 9px,
    var(--paper);
  -webkit-text-size-adjust: 100%;
}
.view { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-dark); }
h1, h2, h3, h4 { font-family: "Grandstander", "Lexend", system-ui, sans-serif; font-weight: 800; line-height: 1.15; margin: 0 0 .5em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.05rem; margin-bottom: .4em; }
p { margin: 0 0 1em; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.warn { color: var(--red); font-weight: 700; }

/* ---------------------------------------------------------------- Karten mit Naht */
.stitch-card {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 26px 22px;
  outline: 3px dashed var(--stitch);
  outline-offset: -10px;
  box-shadow: 0 8px 0 rgba(199,154,107,.35), 0 16px 32px rgba(46,35,64,.12);
}

/* ---------------------------------------------------------------- Knöpfe aus Filz */
.btn, .btn-danger {
  --c1: #78C765; --c2: var(--green); --shade: var(--green-dark);
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px;
  font: 800 1.1rem/1.1 "Grandstander", system-ui, sans-serif;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(var(--c1), var(--c2));
  padding: .7em 1.3em;
  border: 0;
  border-radius: 999px;
  box-shadow: 0 5px 0 var(--shade), 0 10px 20px rgba(46,35,64,.2);
  outline: 2px dashed rgba(255,255,255,.75);
  outline-offset: -7px;
  text-shadow: 0 2px 0 rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active, .btn-danger:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--shade), 0 5px 12px rgba(46,35,64,.2); }
.btn:focus-visible, .btn-danger:focus-visible, .btn-ghost:focus-visible, .btn-link:focus-visible, .chip:has(input:focus-visible), .tab:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.btn[disabled], .btn-danger[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn-secondary { --c1: #D3EBFA; --c2: var(--blue); --shade: var(--blue-dark); color: var(--ink); text-shadow: none; outline-color: rgba(255,255,255,.9); }
.btn-orange { --c1: #FFC58C; --c2: #F7A55C; --shade: var(--orange-dark); }
.btn-danger { --c1: #E36A5F; --c2: var(--red); --shade: #8E2C25; }
.btn-wide { width: 100%; }
.btn-ghost {
  min-height: 44px; padding: .5em 1em;
  font: 700 1rem/1.1 "Lexend", system-ui, sans-serif; color: var(--ink);
  background: rgba(255,255,255,.55); border: 2px dashed var(--stitch); border-radius: 999px; cursor: pointer;
}
.btn-small { min-height: 38px; padding: .35em .85em; font-size: .9rem; }
.btn-link { min-height: 44px; padding: .4em .2em; font: 600 1rem "Lexend", system-ui, sans-serif; color: var(--green-dark); background: none; border: 0; text-decoration: underline; cursor: pointer; }
.btn-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 12px; margin-top: 18px; }

/* ---------------------------------------------------------------- Formulare */
.form { display: grid; gap: 14px; }
.form-row { margin-bottom: 8px; }
.field { display: grid; gap: 6px; font-weight: 700; }
.field span { font-size: .95rem; }
.field input {
  width: 100%; min-height: 50px; padding: 10px 16px;
  font: 500 1.1rem "Lexend", system-ui, sans-serif; color: var(--ink);
  background: #fff; border: 2px solid #E4CDAF; border-radius: 16px;
  box-shadow: inset 0 2px 4px rgba(46,35,64,.06);
}
.field textarea { width: 100%; min-height: 110px; padding: 12px 16px; font: 400 1.05rem "Lexend", system-ui, sans-serif; color: var(--ink); background: #fff; border: 2px solid #E4CDAF; border-radius: 16px; box-shadow: inset 0 2px 4px rgba(46,35,64,.06); resize: vertical; }
.field textarea:focus { outline: 3px solid var(--green); outline-offset: 1px; border-color: var(--green); }
#feedback-form .chips { margin-bottom: 12px; }
.field input:focus { outline: 3px solid var(--green); outline-offset: 1px; border-color: var(--green); }
.pin-input { letter-spacing: .5em; text-align: center; max-width: 12rem; font-variant-numeric: tabular-nums; }
.pin-big { font-size: 1.8rem !important; max-width: 14rem; justify-self: start; }
.msg { margin: 0; min-height: 0; font-weight: 700; color: var(--red); }
.msg:empty { display: none; }
.msg.ok { color: var(--green-dark); }
@media (min-width: 640px) {
  .form-row { grid-template-columns: repeat(auto-fit, minmax(170px, max-content)); align-items: end; }
  .form-row .field-grow { min-width: min(100%, 320px); }
  .form-row .msg { grid-column: 1 / -1; order: 9; }
}

/* ---------------------------------------------------------------- Anmeldung */
.login { display: grid; justify-items: center; gap: 22px; padding: 28px 0 24px; }
.login .logo { width: min(320px, 72vw); filter: drop-shadow(0 6px 10px rgba(46,35,64,.25)); }
.login-card { width: min(460px, 100%); }
.login-art { width: min(300px, 70vw); border-radius: var(--radius); box-shadow: 0 10px 24px rgba(46,35,64,.15); }

/* ---------------------------------------------------------------- Kopfzeile */
.topbar { position: sticky; top: 0; z-index: 10; background: rgba(246,231,207,.92); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); border-bottom: 3px dashed rgba(199,154,107,.6); }
.topbar-inner { display: flex; align-items: center; gap: 12px; padding: 8px 0; padding-top: max(8px, env(safe-area-inset-top)); }
.topbar-logo img { width: 92px; }
.topbar .btn-ghost { min-height: 40px; padding: .4em .85em; font-size: .9rem; }
.topbar-title { font: 800 1rem "Grandstander", system-ui, sans-serif; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.app { padding: 18px 0 32px; display: grid; gap: 30px; }
.greeting { margin: 0; font-size: 1.05rem; color: var(--muted); }
.section-title { margin-bottom: .6em; }
.notice { background: var(--yellow); outline-color: #D8A93E; }

/* ---------------------------------------------------------------- Profil-Karten */
.profiles { display: grid; gap: 26px; }
@media (min-width: 900px) { .profiles { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
.loading { text-align: center; color: var(--muted); }
.profile .btn-row > .btn { flex: 1 1 auto; }
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.avatar { width: 64px; height: 64px; flex: 0 0 auto; border-radius: 50%; filter: drop-shadow(0 4px 4px rgba(46,35,64,.2)); }
.profile-name { flex: 1; min-width: 0; }
.profile-name h3 { margin: 0; overflow-wrap: anywhere; }
.badge { display: inline-block; white-space: nowrap; margin-top: 4px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 700; background: var(--blue); }
.badge.b-warn { background: var(--yellow); }
.badge.b-up { background: var(--orange); }
.badge.b-bed { background: var(--lilac); }

.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 10px; }
.stats div { background: #fff; border-radius: 16px; padding: 10px 14px; box-shadow: 0 3px 0 rgba(199,154,107,.3); }
.stats dt { font-size: .82rem; color: var(--muted); font-weight: 600; }
.stats dd { margin: 0; font: 800 1.4rem/1.2 "Grandstander", system-ui, sans-serif; }
.meter { height: 12px; border-radius: 999px; background: #EAD8BD; overflow: hidden; margin-bottom: 6px; }
.meter span { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); transition: width .4s ease; }
.meter.m-warn span { background: #E9B43A; }
.meter.m-up span { background: var(--orange-dark); }

.week { margin: 16px 0 0; }
.week figcaption { font: 800 1.05rem "Grandstander", system-ui, sans-serif; margin-bottom: 6px; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .bar { fill: var(--green); }
.chart .bar.over { fill: var(--orange-dark); }
.chart .bar.today { stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 3 2; }
.chart .track { fill: #EFE0C8; }
.chart .limit { fill: none; stroke: var(--red); stroke-width: 2; stroke-dasharray: 5 4; }
.chart .lbl { font: 600 11px "Lexend", system-ui, sans-serif; fill: var(--muted); text-anchor: middle; }
.chart .lbl.today { fill: var(--ink); font-weight: 800; }
.chart .val { font: 700 10.5px "Lexend", system-ui, sans-serif; fill: var(--ink); text-anchor: middle; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 6px 0 0; padding: 0; list-style: none; font-size: .8rem; color: var(--muted); }
.chart-legend li { display: flex; align-items: center; gap: 6px; }
.chart-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; background: var(--green); }
.chart-legend i.over { background: var(--orange-dark); }
.chart-legend i.line { height: 0; border-top: 2px dashed var(--red); border-radius: 0; background: none; }
.chart-empty { padding: 14px; border-radius: 16px; background: rgba(255,255,255,.6); color: var(--muted); font-size: .9rem; }

/* ---------------------------------------------------------------- Einstellungen */
.settings { margin-top: 20px; padding-top: 16px; border-top: 3px dashed rgba(199,154,107,.5); display: grid; gap: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-stack { flex-direction: column; align-items: stretch; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px;
  font-weight: 700; font-size: .95rem; border-radius: 999px;
  background: #fff; border: 2px solid #E4CDAF; transition: background .15s ease;
}
.chips-stack .chip span { width: 100%; border-radius: 16px; }
.chip input:checked + span { background: #D6EFCB; border-color: var(--green); outline: 2px dashed rgba(255,255,255,.9); outline-offset: -6px; box-shadow: 0 3px 0 var(--green-dark); }
.chip input:disabled + span { opacity: .55; cursor: not-allowed; }
.settings.busy { opacity: .7; pointer-events: none; }

.add-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-top: 22px; }
.add-row p { margin: 0; }

.seam { border: 0; border-top: 3px dashed rgba(199,154,107,.5); margin: 22px 0; }
.security h3 { margin-bottom: .3em; }

/* ---------------------------------------------------------------- Dialoge */
.dialog {
  width: min(480px, 100% - 24px); max-height: calc(100% - 24px);
  padding: 26px 22px; border: 0; color: var(--ink);
  background: var(--cream); border-radius: var(--radius);
  outline: 3px dashed var(--stitch); outline-offset: -10px;
  box-shadow: 0 20px 50px rgba(46,35,64,.35);
}
.dialog::backdrop { background: rgba(46,35,64,.45); }
.dialog h2 { font-size: 1.5rem; }
.avatars { border: 0; padding: 0; margin: 0; }
.avatars legend { font-weight: 700; margin-bottom: 8px; padding: 0; }
.avatar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.avatar-opt { position: relative; cursor: pointer; }
.avatar-opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.avatar-opt span { display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border-radius: 18px; border: 3px solid transparent; font-size: .85rem; font-weight: 600; }
.avatar-opt img { width: 72px; height: 72px; }
.avatar-opt input:checked + span { border-color: var(--green); background: #D6EFCB; }
.avatar-opt input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.danger-zone .btn-danger { margin-bottom: 8px; }
.tabs { display: flex; gap: 6px; background: #EFE0C8; padding: 4px; border-radius: 999px; }
.tab { flex: 1; min-height: 42px; border: 0; border-radius: 999px; background: none; font: 700 .95rem "Lexend", system-ui, sans-serif; color: var(--ink); cursor: pointer; }
.tab[aria-selected="true"] { background: #fff; box-shadow: 0 2px 0 rgba(199,154,107,.5); }
.tab-panel { display: grid; gap: 12px; }

/* ---------------------------------------------------------------- Haus wiederherstellen */
.dialog-wide { width: min(620px, 100% - 24px); }
.houses { display: flex; flex-wrap: wrap; gap: 10px; }
.houses:empty { display: none; }
.house { position: relative; cursor: pointer; }
.house input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.house span { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 6px 14px 6px 6px; border-radius: 16px; background: #fff; border: 2px solid #E4CDAF; font-weight: 700; }
.house img, .house i { width: 64px; height: 36px; border-radius: 8px; object-fit: cover; background: #EFE0C8; flex: 0 0 auto; }
.house input:checked + span { background: #D6EFCB; border-color: var(--green); box-shadow: 0 3px 0 var(--green-dark); }
.house input:focus-visible + span { outline: 3px solid var(--ink); outline-offset: 2px; }
.snapshots { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.snapshots .note { color: var(--muted); padding: 10px 2px; }
.snap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-radius: 16px; background: rgba(255,255,255,.7); }
.snap .thumb { width: 88px; height: 50px; border-radius: 10px; object-fit: cover; background: #EFE0C8; flex: 0 0 auto; }
.snap-text { flex: 1 1 140px; min-width: 0; display: grid; line-height: 1.3; }
.snap-text strong { font-weight: 800; }
.snap-text span { font-size: .85rem; color: var(--muted); }
.snap .btn { min-height: 42px; padding: .5em 1em; font-size: 1rem; }
@media (max-width: 420px) { .snap .btn { flex: 1 1 100%; } }

/* ---------------------------------------------------------------- Häuser & Mitspieler */
.house-list { display: grid; gap: 12px; }
.house-list .note, .deleted-list .note { color: var(--muted); padding: 6px 2px; margin: 0; }
.house-card { padding: 12px 14px; border-radius: 18px; background: rgba(255,255,255,.7); border: 2px solid #E4CDAF; display: grid; gap: 8px; }
.house-card h3 { margin: 0; font-size: 1.15rem; }
.house-card .muted { margin: 0; font-size: .9rem; }
.members { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.member { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border-radius: 14px; background: #fff; }
.member img { width: 40px; height: 40px; flex: 0 0 auto; }
.member span { flex: 1 1 auto; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.house-card .btn-row { margin: 0; }
.deleted-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.deleted { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 10px; border-radius: 16px; background: rgba(255,255,255,.7); }
.deleted .snap-text { flex: 1 1 180px; }
.deleted .btn { min-height: 42px; padding: .5em 1em; font-size: 1rem; }
@media (max-width: 420px) { .deleted .btn { flex: 1 1 100%; } }

/* ---------------------------------------------------------------- Deine Daten */
.your-data { display: grid; gap: 26px; }
.your-data .section-title { margin-bottom: 0; }
.your-data h3 { margin-bottom: .3em; }
.privacy { background: #F1F8EC; outline-color: #9CCB8C; }
.privacy-cols { display: grid; gap: 6px 28px; }
@media (min-width: 720px) { .privacy-cols { grid-template-columns: 1fr 1fr; } }
.privacy-col h4 { margin-top: .4em; }
.ticks, .crosses, .danger-box ul { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.ticks li, .crosses li { position: relative; padding-left: 32px; }
.ticks li::before, .crosses li::before {
  content: ""; position: absolute; left: 0; top: .1em; width: 22px; height: 22px; border-radius: 50%;
  box-shadow: 0 2px 0 rgba(46,35,64,.15);
}
.ticks li::before {
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 15px no-repeat;
}
.crosses li::before {
  background: var(--orange-dark) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 7l10 10M17 7L7 17' fill='none' stroke='white' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.privacy-eu { display: inline-block; margin: 0 0 12px; padding: 4px 12px; border-radius: 999px; background: var(--blue); font-weight: 700; font-size: .92rem; }
.privacy-you { margin: 8px 0 0; padding: 12px 16px; border-radius: 16px; background: rgba(255,255,255,.75); border: 2px dashed #9CCB8C; }
.danger-box { padding: 14px 16px; border-radius: 16px; background: #FCE3DF; border: 2px dashed #E1958C; }
.danger-box p { margin: 0 0 8px; }
.danger-box p:last-child { margin-bottom: 0; }
.danger-box ul { margin-bottom: 10px; gap: 4px; }
.danger-box li { position: relative; padding-left: 20px; }
.danger-box li::before { content: ""; position: absolute; left: 4px; top: .6em; width: 8px; height: 8px; border-radius: 50%; background: var(--red); }
.bye-card { text-align: center; }
.bye-card h1:focus { outline: none; }
.bye-card .btn-row { justify-content: center; }

/* ---------------------------------------------------------------- Meldung unten */
.toast {
  position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  width: max-content; max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: 20px;
  background: var(--ink); color: #fff; font-weight: 700; text-align: center;
  box-shadow: 0 10px 24px rgba(46,35,64,.35);
}
.toast.err { background: var(--red); }

/* ---------------------------------------------------------------- Fußzeile */
.footer { text-align: center; padding: 24px 16px calc(32px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .92rem; }
.footer p { margin: .4em 0; }
.facts { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; padding: 0; margin: 0 0 12px; font-weight: 700; color: var(--ink); }
.facts li { padding-left: 26px; position: relative; }
.facts li::before {
  content: ""; position: absolute; left: 0; top: .15em; width: 20px; height: 20px; border-radius: 50%;
  background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4 8-9' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat;
}

@media (min-width: 640px) {
  body { font-size: 17px; }
  h1 { font-size: 2.4rem; }
  h2 { font-size: 1.9rem; }
  .stitch-card { padding: 32px 30px; outline-offset: -12px; }
  .avatar { width: 80px; height: 80px; }
  .topbar-logo img { width: 140px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
