/* ============ Familien-Wunschliste ============ */
:root {
    --bg: #0d1b2a;
    --bg-2: #13263b;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-2: #f6f7f9;
    --text: #1b2430;
    --muted: #6b7686;
    --line: #e6e9ee;
    --red: #d63a45;
    --red-dark: #b52c36;
    --green: #1f8a5b;
    --green-soft: #e3f4ec;
    --gold: #f2c14e;
    --radius: 18px;
    --shadow: 0 10px 30px rgba(3, 12, 24, 0.25), 0 2px 6px rgba(3, 12, 24, 0.12);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
    font-family: var(--font);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(214, 58, 69, 0.35), transparent 60%),
        radial-gradient(900px 500px at 110% 10%, rgba(31, 138, 91, 0.30), transparent 60%),
        linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 100%);
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

/* ---- Schnee ---- */
.snow {
    position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .55;
    background-image:
        radial-gradient(2px 2px at 20px 30px, #fff 50%, transparent 51%),
        radial-gradient(2px 2px at 140px 80px, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 90px 150px, #fff 50%, transparent 51%),
        radial-gradient(2.5px 2.5px at 210px 200px, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 260px 40px, #fff 50%, transparent 51%);
    background-size: 300px 260px;
    animation: snow 22s linear infinite;
}
@keyframes snow { from { background-position: 0 0; } to { background-position: 60px 260px; } }
@media (prefers-reduced-motion: reduce) { .snow { animation: none; } }

/* ---- Layout ---- */
.topbar, .container, .footer { position: relative; z-index: 1; }

.topbar {
    display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
    padding: 14px clamp(16px, 4vw, 40px);
    background: rgba(13, 27, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky; top: 0;
    color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; }
.brand-icon { font-size: 1.4rem; }

.tabs { display: flex; gap: 4px; background: rgba(255,255,255,.08); padding: 4px; border-radius: 999px; }
.tabs a { color: rgba(255,255,255,.75); text-decoration: none; padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .92rem; transition: .15s; }
.tabs a:hover { color: #fff; }
.tabs a.active { background: #fff; color: var(--text); }

.user { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .92rem; }
.user-name { font-weight: 600; }
.link-muted { color: rgba(255,255,255,.65); text-decoration: none; }
.link-muted:hover { color: #fff; text-decoration: underline; }

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 48px; flex: 1; }

.footer { text-align: center; color: rgba(255,255,255,.5); padding: 24px; font-size: .9rem; }

.page-head { color: #fff; margin-bottom: 24px; }
.page-head h1 { margin: 0 0 4px; font-size: clamp(1.6rem, 3vw, 2.2rem); letter-spacing: -.02em; }
.page-head .muted { color: rgba(255,255,255,.7); margin: 0; }

.grid-2 { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 24px; align-items: start; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---- Karten ---- */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(18px, 3vw, 28px);
    margin-bottom: 24px;
}
.card h2 { margin: 0 0 16px; font-size: 1.2rem; display: flex; align-items: center; gap: 10px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-accent { border-top: 4px solid var(--gold); }

.pill { background: var(--surface-2); color: var(--muted); border-radius: 999px; padding: 6px 12px; font-size: .85rem; font-weight: 600; white-space: nowrap; }
.pill-soft { background: #fdecee; color: var(--red); padding: 3px 10px; font-size: .75rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hint { margin: 16px 0 0; }

/* ---- Formulare ---- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row-tight { gap: 4px; flex-wrap: nowrap; }

.field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .92rem; }
.req { color: var(--red); font-style: normal; }

input[type=text], input[type=url], input[type=password], textarea {
    font: inherit; font-weight: 400;
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 12px;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 60px; }
input:focus, textarea:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 4px rgba(214, 58, 69, .15); }
.has-error input, .has-error textarea { border-color: var(--red); background: #fff7f7; }
.error { color: var(--red); font-weight: 500; }

.input-suffix { position: relative; }
.input-suffix input { padding-right: 40px; }
.input-suffix span { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }

.inline-form { display: flex; gap: 10px; }
.inline-form input { flex: 1; }
@media (max-width: 480px) { .inline-form { flex-direction: column; } }

/* ---- Buttons ---- */
.btn {
    font: inherit; font-weight: 600;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 12px 20px; border-radius: 12px; border: 0;
    cursor: pointer; text-decoration: none; transition: transform .1s, background .15s, box-shadow .15s;
    white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--red); color: #fff; box-shadow: 0 4px 14px rgba(214, 58, 69, .35); }
.btn-primary:hover { background: var(--red-dark); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: #18734b; }
.btn-ghost { background: transparent; color: var(--muted); border: 1.5px solid var(--line); }
.btn-ghost:hover { color: var(--text); border-color: #cfd5dd; }
.btn-danger-ghost { background: transparent; color: var(--red); border: 1.5px solid #f3c6ca; }
.btn-danger-ghost:hover { background: #fff3f4; }
.btn-small { padding: 7px 12px; font-size: .85rem; border-radius: 10px; }
.btn-block { width: 100%; }

.icon-btn {
    width: 36px; height: 36px; display: inline-grid; place-items: center;
    border-radius: 10px; border: 0; background: transparent; cursor: pointer; font-size: 1rem; text-decoration: none;
    transition: background .15s;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---- Flash ---- */
.flash { padding: 12px 16px; border-radius: 12px; margin-bottom: 20px; font-weight: 500; box-shadow: var(--shadow); }
.flash-ok { background: var(--green-soft); color: #145c3d; }
.flash-error { background: #fdecee; color: #8f1f28; }
.auth-card .flash { box-shadow: none; margin: 0 0 16px; text-align: left; }

/* ---- Avatare ---- */
.avatar {
    width: 32px; height: 32px; flex: none;
    display: inline-grid; place-items: center;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--red), #f07167);
    color: #fff; font-weight: 700; font-size: .9rem;
}
.avatar-lg { width: 56px; height: 56px; font-size: 1.4rem; }

/* ---- Login / Wer bist du ---- */
.auth-card {
    max-width: 420px; margin: 8vh auto 0;
    background: var(--surface); border-radius: 24px; box-shadow: var(--shadow);
    padding: 36px clamp(20px, 5vw, 36px); text-align: center;
}
.auth-card-wide { max-width: 640px; }
.auth-card h1 { margin: 8px 0 4px; letter-spacing: -.02em; }
.auth-card > .muted { margin: 0 0 24px; }
.auth-card .field { text-align: left; }
.auth-icon { font-size: 3rem; line-height: 1; }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.member-btn {
    font: inherit; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 18px 10px; border-radius: 16px;
    border: 1.5px solid var(--line); background: #fff;
    transition: .15s;
}
.member-btn:hover { border-color: var(--red); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.member-name { font-weight: 700; word-break: break-word; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 24px 0 16px; font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- Wunschliste (eigene) ---- */
.wish-list { list-style: none; margin: 0; padding: 0; }
.wish {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 14px 0; border-bottom: 1px solid var(--line);
}
.wish:last-child { border-bottom: 0; }
.wish-main { min-width: 0; }
.wish-title { font-weight: 600; word-break: break-word; }
.wish-note { color: var(--muted); font-size: .88rem; margin-top: 2px; word-break: break-word; }
.wish-link { display: inline-block; margin-top: 4px; color: var(--red); text-decoration: none; font-size: .88rem; font-weight: 500; word-break: break-all; }
.wish-link:hover { text-decoration: underline; }
.wish-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.price { font-weight: 700; color: var(--green); white-space: nowrap; font-variant-numeric: tabular-nums; }

.empty { text-align: center; padding: 32px 12px; color: var(--muted); }
.empty-icon { font-size: 2.6rem; }

/* ---- Filter-Chips ---- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    background: rgba(255,255,255,.1); color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem;
    border: 1px solid rgba(255,255,255,.15); transition: .15s;
}
.chip:hover { background: rgba(255,255,255,.18); }
.chip.active { background: #fff; color: var(--text); }
.chip-count { background: rgba(0,0,0,.15); border-radius: 999px; padding: 1px 8px; font-size: .78rem; }
.chip.active .chip-count { background: var(--surface-2); color: var(--muted); }

.mini-list { margin: 0; padding-left: 20px; line-height: 1.8; }

/* ---- Tabelle (alle Wünsche) ---- */
.table-wrap { overflow-x: auto; }
.wish-table { width: 100%; border-collapse: collapse; }
.wish-table th {
    text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em;
    color: var(--muted); font-weight: 700; padding: 0 12px 10px; border-bottom: 1px solid var(--line);
}
.wish-table td { padding: 14px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.wish-table tr:last-child td { border-bottom: 0; }
.wish-table .num { text-align: right; }
.wish-table tr.is-reserved .wish-title { text-decoration: line-through; color: var(--muted); }

.badge { display: inline-block; background: var(--surface-2); color: var(--muted); padding: 5px 10px; border-radius: 8px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.badge-green { background: var(--green-soft); color: var(--green); }

@media (max-width: 680px) {
    .wish-table thead { display: none; }
    .wish-table, .wish-table tbody, .wish-table tr, .wish-table td { display: block; width: 100%; }
    .wish-table tr { padding: 12px 0; border-bottom: 1px solid var(--line); }
    .wish-table tr:last-child { border-bottom: 0; }
    .wish-table td { border: 0; padding: 4px 0; text-align: left !important; }
    .wish-table td[data-label="Link"]:has(.muted) { display: none; }
    .topbar { gap: 12px; }
    .tabs { order: 3; width: 100%; justify-content: center; }
    .user { margin-left: auto; }
    .user-name { display: none; }
}

/* ---- Gefahrenzone ---- */
.danger-zone { color: rgba(255,255,255,.6); font-size: .9rem; }
.danger-zone summary { cursor: pointer; margin-bottom: 12px; }
.danger-zone .btn { background: rgba(255,255,255,.95); }
