/* Heilige Nacht: tiefes Tannengrün, Goldstern, Beerenrot; Karten wie Glas im Kerzenlicht */
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/fraunces-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../fonts/nunito-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../fonts/nunito-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Nunito Sans"; src: url("../fonts/nunito-sans-latin-800-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }

:root {
  --night: #0c2019;
  --night-2: #12302a;
  --glass: rgba(22, 52, 44, 0.72);
  --glass-2: rgba(255, 255, 255, 0.06);
  --line: rgba(226, 189, 92, 0.28);
  --snow: #f6f1e7;
  --muted: #b9c8bf;
  --gold: #e2bd5c;
  --gold-deep: #b98f2c;
  --berry: #c0283f;
  --berry-hi: #d93a52;
  --ok: #8fd6a8;
  --warn: #f0b45a;
  --display: "Fraunces", "Georgia", "Times New Roman", serif;
  --body: "Nunito Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 18px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--night); }
body {
  margin: 0; min-height: 100vh; color: var(--snow); font-family: var(--body); font-size: 16px; line-height: 1.55;
  background:
    radial-gradient(1200px 520px at 50% -120px, rgba(226, 189, 92, 0.16), transparent 70%),
    radial-gradient(900px 600px at 100% 30%, rgba(192, 40, 63, 0.10), transparent 70%),
    linear-gradient(180deg, #0a1b2a 0%, var(--night) 34%, #0a1a15 100%);
  background-attachment: fixed;
  padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right));
}
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: 26px; }
h3 { font-size: 19px; font-weight: 600; }
p { margin: 0; }
a { color: var(--gold); }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.eyebrow, .label { font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; font-weight: 700; color: var(--gold); }

/* ---------- Hero ---------- */
.hero { position: relative; z-index: 1; text-align: center; padding: max(36px, env(safe-area-inset-top)) 0 0; display: grid; justify-items: center; gap: 10px; }
.star { width: 54px; height: 54px; fill: var(--gold); filter: drop-shadow(0 0 18px rgba(226, 189, 92, 0.75)); }
@media (prefers-reduced-motion: no-preference) { .star { animation: glow 3.2s ease-in-out infinite; } }
@keyframes glow { 50% { filter: drop-shadow(0 0 32px rgba(226, 189, 92, 0.95)); transform: scale(1.04); } }
.hero h1 { font-size: clamp(44px, 10vw, 84px); line-height: 1; }
.hero h1 span { color: var(--gold); font-style: italic; font-weight: 400; }
.verse { margin: 6px 0 0; max-width: 44ch; }
.verse blockquote { margin: 0; font-family: var(--display); font-style: italic; font-weight: 400; font-size: clamp(19px, 3vw, 24px); line-height: 1.4; color: var(--snow); }
.verse figcaption { margin-top: 6px; color: var(--gold); font-size: 14px; letter-spacing: 0.08em; }
.trees { width: calc(100% + 2 * max(16px, env(safe-area-inset-left))); margin: 18px calc(-1 * max(16px, env(safe-area-inset-left))) 0; height: 90px; fill: #081712; opacity: 0.95; display: block; }

/* ---------- Layout ---------- */
.wrap { position: relative; z-index: 1; max-width: 1000px; margin: 0 auto; padding-block: 8px 24px; display: grid; gap: 22px; }
.card {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; display: grid; gap: 16px; min-width: 0;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
.card-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; }
.ornament { display: flex; align-items: center; gap: 12px; color: var(--gold); }
.ornament::before, .ornament::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--line), transparent); }
.two { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; }
@media (max-width: 780px) { .two { grid-template-columns: 1fr; } }

.notice { border-radius: 14px; padding: 14px 16px; background: var(--glass); border: 1px solid var(--line); }
.notice.err { border-color: var(--berry-hi); background: rgba(192, 40, 63, 0.22); }
.notice.ok { border-color: var(--ok); background: rgba(143, 214, 168, 0.12); }
.notice button { margin-left: 6px; }

/* ---------- Controls ---------- */
button { font: inherit; cursor: pointer; }
.btn {
  font-weight: 700; border-radius: 12px; border: 1px solid var(--line); background: var(--glass-2); color: var(--snow);
  padding: 10px 16px; min-height: 44px; transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--gold); }
.btn.primary { background: linear-gradient(180deg, var(--berry-hi), var(--berry)); border-color: transparent; color: #fff; box-shadow: 0 8px 22px rgba(192, 40, 63, 0.35); }
.btn.primary:hover { transform: translateY(-1px); }
.btn.gold { background: linear-gradient(180deg, #f0d27e, var(--gold-deep)); color: #2a1d02; border-color: transparent; }
.btn.danger { color: #ffb3bf; border-color: rgba(217, 58, 82, 0.6); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.linkish { background: none; border: none; color: var(--gold); text-decoration: underline; padding: 0; font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

input[type="text"], input[type="date"], input[type="password"], input[inputmode="numeric"], textarea, select {
  font: inherit; color: var(--snow); background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 14px; width: 100%; min-width: 0;
}
input::placeholder, textarea::placeholder { color: rgba(185, 200, 191, 0.65); }
textarea { resize: vertical; min-height: 80px; }
select option { background: var(--night-2); }
.field { display: grid; gap: 6px; }

/* ---------- Login ---------- */
.names { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.name-chip {
  border-radius: 999px; padding: 10px 18px; border: 1px solid var(--line); background: var(--glass-2); color: var(--snow);
  font-weight: 700; font-size: 17px; min-height: 46px;
}
.name-chip[aria-pressed="true"] { background: var(--gold); color: #2a1d02; border-color: var(--gold); }
.name-chip .tick { color: var(--ok); margin-left: 4px; }
.name-chip[aria-pressed="true"] .tick { color: #2a1d02; }
.pin-box { display: grid; gap: 10px; max-width: 360px; margin: 0 auto; width: 100%; text-align: center; }
.pin-box input { text-align: center; font-size: 26px; letter-spacing: 0.4em; font-weight: 800; }

/* ---------- Steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.step { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; display: grid; gap: 2px; background: var(--glass-2); }
.step .n { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--gold); }
.step.done { border-color: rgba(143, 214, 168, 0.6); }
.step.done .n { color: var(--ok); }
@media (max-width: 640px) { .steps { grid-template-columns: 1fr; } }

.facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact { border: 1px solid var(--line); border-radius: 999px; padding: 5px 14px; font-size: 14px; font-variant-numeric: tabular-nums; }
.fact b { color: var(--gold); }

/* ---------- Draw / gift ---------- */
.draw {
  position: relative; overflow: hidden; border-radius: var(--r); padding: 26px; display: grid; gap: 16px; align-content: start; min-width: 0;
  background:
    repeating-linear-gradient(90deg, transparent 0 46%, rgba(226, 189, 92, 0.85) 46% 54%, transparent 54% 100%) center / 100% 100% no-repeat,
    linear-gradient(160deg, #d33a50, #8f1529);
  box-shadow: 0 24px 60px rgba(143, 21, 41, 0.45);
}
.draw.opened { background: linear-gradient(160deg, #1d4a3d, #10302a); border: 1px solid var(--line); }
.draw.calm { background: var(--glass-2); border: 1px dashed var(--line); box-shadow: none; }
.draw > * { position: relative; }
.draw .label { color: #ffe6a3; }
.draw.calm .label, .draw.opened .label { color: var(--gold); }
.draw .tag {
  justify-self: start; background: var(--snow); color: #3a1018; border-radius: 10px; padding: 14px 18px; display: grid; gap: 4px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.3); max-width: 100%;
}
.draw .tag h2 { font-size: 26px; }

.gift { width: 150px; height: 150px; justify-self: center; position: relative; margin: 6px 0 4px; }
.gift .box { position: absolute; left: 14px; right: 14px; bottom: 0; height: 92px; border-radius: 8px; background: linear-gradient(160deg, #d33a50, #8f1529); box-shadow: inset 0 -10px 0 rgba(0, 0, 0, 0.15); }
.gift .box::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; transform: translateX(-50%); background: var(--gold); }
.gift .lid { position: absolute; left: 6px; right: 6px; bottom: 88px; height: 30px; border-radius: 6px; background: linear-gradient(160deg, #e04b61, #a51b31); transform-origin: 20% 100%; }
.gift .lid::after { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 18px; transform: translateX(-50%); background: var(--gold); }
.gift .bow { position: absolute; left: 50%; bottom: 112px; width: 60px; height: 34px; transform: translateX(-50%); }
.gift .bow::before, .gift .bow::after { content: ""; position: absolute; bottom: 0; width: 30px; height: 30px; border: 7px solid var(--gold); border-radius: 50% 50% 0 50%; }
.gift .bow::before { left: 0; transform: rotate(-20deg); }
.gift .bow::after { right: 0; transform: scaleX(-1) rotate(-20deg); }
.draw.calm .gift .box, .draw.calm .gift .lid { filter: saturate(0.7); }
@media (prefers-reduced-motion: no-preference) {
  .gift.shake { animation: shake 0.5s ease-in-out infinite; }
  @keyframes shake { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
  .gift.open .lid, .gift.open .bow { animation: lift 0.8s cubic-bezier(.2, .9, .3, 1.2) forwards; }
  @keyframes lift { to { transform: translate(-30px, -60px) rotate(-28deg); opacity: 0; } }
  .reveal { animation: rise 0.7s 0.35s cubic-bezier(.2, .9, .3, 1.1) both; }
  @keyframes rise { from { transform: translateY(24px) scale(0.9); opacity: 0; } to { transform: none; opacity: 1; } }
}
.big { font-family: var(--display); font-weight: 700; font-size: clamp(40px, 8vw, 60px); line-height: 1.02; color: var(--gold); text-shadow: 0 0 28px rgba(226, 189, 92, 0.35); }

.inner { background: rgba(0, 0, 0, 0.22); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 10px; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--gold); }

/* ---------- Overview ---------- */
.progress { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-deep), var(--gold)); }
.members { display: grid; }
.member { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 11px 0; border-bottom: 1px solid rgba(226, 189, 92, 0.14); align-items: center; }
.member:last-child { border-bottom: none; }
.member .who { font-weight: 700; }
.badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: end; }
.badge { font-size: 12px; font-weight: 700; border-radius: 999px; padding: 2px 10px; border: 1px solid rgba(185, 200, 191, 0.35); color: var(--muted); white-space: nowrap; }
.badge.ok { color: var(--ok); border-color: currentColor; }
.badge.warn { color: var(--warn); border-color: currentColor; }

/* ---------- Wishlists ---------- */
.wishes { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.wish {
  position: relative; border-radius: 14px; padding: 18px 18px 16px; display: grid; gap: 8px; align-content: start; min-width: 0;
  background: var(--snow); color: #22302a; box-shadow: 0 12px 26px rgba(0, 0, 0, 0.28);
}
.wish::before { content: ""; position: absolute; top: -7px; left: 50%; width: 14px; height: 14px; border-radius: 50%; transform: translateX(-50%); background: var(--berry); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); }
.wish h3 { color: #6b1220; }
.wish ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.wish li { overflow-wrap: anywhere; }
.wish a { color: #1f5e4b; font-weight: 700; }
.wish .empty { color: #6d7a73; font-style: italic; }
.wish .hint { font-size: 14px; color: #4d5c55; }
.wish .linkish { color: #1f5e4b; }
.draw .wish { box-shadow: none; }

/* ---------- Editor ---------- */
.idea { display: grid; grid-template-columns: 34px minmax(0, 1.4fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.idea .num { font-family: var(--display); font-weight: 700; font-size: 22px; color: var(--gold); text-align: center; }
@media (max-width: 640px) { .idea { grid-template-columns: 28px minmax(0, 1fr); } .idea input[inputmode="url"] { grid-column: 2; } }

/* ---------- Admin ---------- */
.excl { display: flex; flex-wrap: wrap; gap: 8px; }
.excl span { border: 1px solid var(--line); border-radius: 999px; padding: 4px 6px 4px 14px; display: inline-flex; gap: 8px; align-items: center; font-size: 14px; }
.excl span button { min-height: 28px; padding: 0 10px; border-radius: 99px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }

.foot { position: relative; z-index: 1; text-align: center; color: var(--muted); font-size: 14px; padding-block: 10px max(28px, env(safe-area-inset-bottom)); }
[hidden] { display: none !important; }

/* ---------- Backend ---------- */
.hero-sm { padding-bottom: 18px; }
.hero-sm h1 { font-size: clamp(34px, 7vw, 54px); }
.hero-sm .star { width: 40px; height: 40px; }
.narrow { max-width: 440px; width: 100%; justify-self: center; }
details.fam { gap: 0; }
details.fam > summary { list-style: none; cursor: pointer; }
details.fam > summary::-webkit-details-marker { display: none; }
.fam-title { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: space-between; }
.fam-title h2::before { content: "▸ "; color: var(--gold); font-size: 0.8em; }
details.fam[open] .fam-title h2::before { content: "▾ "; }
.fam-body { display: grid; gap: 4px; margin-top: 18px; }
.sub { display: grid; gap: 10px; padding: 16px 0; border-top: 1px solid rgba(226, 189, 92, 0.16); min-width: 0; }
.sub h3 { color: var(--gold); }
.grid3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.link-row { flex-wrap: nowrap; }
.link-text { flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap; background: rgba(0, 0, 0, 0.28); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
@media (max-width: 640px) { .link-row { flex-wrap: wrap; } .link-text { flex-basis: 100%; } }
.member-edit { display: grid; gap: 8px; padding: 12px 0; border-bottom: 1px solid rgba(226, 189, 92, 0.12); }
.member-edit:last-child { border-bottom: none; }
.member-edit .badges { flex-wrap: nowrap; }
@media (max-width: 640px) { .member-edit > .row { flex-wrap: wrap !important; } }
.small-btns .btn { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.checks li.ok { color: var(--ok); }
.checks li.bad { color: #ff9aaa; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.check-table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.check-table th, .check-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid rgba(226, 189, 92, 0.14); white-space: nowrap; }
.check-table th { color: var(--gold); font-weight: 700; font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.check-table td.bad { color: #ff9aaa; font-weight: 800; }
.example { margin: 0; padding-left: 18px; columns: 2 180px; }
.warn-text { color: var(--warn); }
