/* ─────────────────────────────────────────────────────────────
   VanWichtel – "Bad Bentheim im Winter"
   Grundidee für die Lesbarkeit:
   • Alle Größen in rem → richten sich nach der Schriftgröße des Handys
     UND nach dem eigenen A / A+ / A++ Schalter.
   • Texte stehen immer auf hellem, deckendem "Papier" mit dunkler Schrift.
   • Schnee fällt HINTER den Karten, nie über dem Text.
   ───────────────────────────────────────────────────────────── */

@font-face { font-family: "Atkinson"; src: url(/fonts/atkinson-400.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson"; src: url(/fonts/atkinson-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Weihnacht"; src: url(/fonts/christmas-700.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --night-1: #081130;
  --night-2: #1b2e6a;
  --gold: #ffd77a;
  --red: #a8231b;
  --red-dark: #7d1912;
  --green: #17633a;
  --paper: #fffaf0;
  --paper-2: #f6ecd6;
  --ink: #1b1b29;
  --muted: #4a4658;
  --line: #d9cbb0;
  --radius: 1.1rem;
  --body: "Atkinson", "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --title: "Weihnacht", "Mountains of Christmas", Georgia, "Times New Roman", serif;
}

/* Schriftgrößen-Stufen (Schalter oben) */
html { font-size: 112.5%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-size="gross"] { font-size: 137.5%; }
html[data-size="riesig"] { font-size: 168.75%; }

* { box-sizing: border-box; }
html { background: var(--night-1); }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--body);
  line-height: 1.55;
  color: var(--ink);
  overflow-x: hidden;
}
/* Nachthimmel als feste Ebene (zuverlässiger als "background-attachment: fixed" auf iPhones) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, var(--night-1) 0%, #0f1d4d 45%, var(--night-2) 100%);
}

/* ── Hintergrund: Burg + Schnee ─────────────────────────────── */
.scene {
  position: fixed; left: 0; right: 0; bottom: 0;
  height: min(58vh, 34rem);
  width: 100%;
  object-fit: cover; object-position: center bottom;
  z-index: 0; pointer-events: none; user-select: none;
}
#snow { position: fixed; inset: 0; z-index: 1; pointer-events: none; }

/* ── Werkzeugleiste (Schrift + Schnee) ──────────────────────── */
.toolbar {
  position: relative; z-index: 3;
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-end; align-items: center;
  padding: .6rem .8rem 0;
}
.toolbar .group {
  display: flex; gap: .25rem; align-items: center;
  background: rgba(8, 17, 48, .75); border: 1px solid rgba(255, 215, 122, .35);
  border-radius: 999px; padding: .2rem;
}
.toolbar button {
  font: inherit; font-weight: 700; color: #fff; background: transparent;
  border: 0; border-radius: 999px; min-width: 2.75rem; min-height: 2.75rem; padding: 0 .7rem; cursor: pointer;
}
.toolbar button[aria-pressed="true"] { background: var(--gold); color: var(--night-1); }
.toolbar .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── Kopf ───────────────────────────────────────────────────── */
header.hero { position: relative; z-index: 2; text-align: center; padding: 1.2rem 1rem 1.6rem; color: #fff; }
.hero h1 {
  font-family: var(--title); font-weight: 700;
  /* an der Bildschirmbreite ausgerichtet, damit er auch bei A++ in eine Zeile passt */
  font-size: min(11.5vw, 4.4rem); line-height: 1.05; margin: 0; white-space: nowrap;
  color: var(--gold);
  text-shadow: 0 0 .35em rgba(255, 215, 122, .65), 0 0 1.2em rgba(255, 180, 60, .35), 0 .08em 0 #7a4b00;
  letter-spacing: .02em;
}
.hero h1 .stern { display: inline-block; font-family: var(--body); font-size: .5em; vertical-align: .55em; animation: funkeln 3s ease-in-out infinite; }
.hero h1 .stern:last-child { animation-delay: 1.5s; }
@keyframes funkeln { 50% { opacity: .35; transform: scale(.8) rotate(20deg); } }
.hero p { margin: .4rem 0 0; font-size: 1.05rem; color: #f2ecdc; text-shadow: 0 1px 3px #000; }

/* ── Inhalt ─────────────────────────────────────────────────── */
main {
  position: relative; z-index: 2;
  max-width: 40rem; margin: 0 auto;
  padding: 0 .9rem 38vh; /* unten Platz, damit die Burg zu sehen ist */
  display: grid; gap: 1.2rem;
}
.card {
  background: var(--paper);
  border-radius: var(--radius);
  padding: 1.3rem 1.2rem;
  box-shadow: 0 .6rem 2rem rgba(0, 0, 0, .45), inset 0 0 0 3px var(--paper-2);
  position: relative;
}
.card h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 .7rem; color: var(--night-1); }
.card h3 { font-size: 1.15rem; margin: 1.2rem 0 .5rem; }
.card p { margin: 0 0 .8rem; }
.card > :last-child { margin-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Geschenk-Karte mit Schleife */
.card.geschenk { padding-top: 2.4rem; border: 3px solid var(--red); }
/* Geschenkband quer über den oberen Rand – nicht hinter dem Text */
.card.geschenk::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: .9rem;
  background: repeating-linear-gradient(135deg, var(--red) 0 .6rem, #c9372d .6rem 1.2rem);
  border-radius: calc(var(--radius) - 3px) calc(var(--radius) - 3px) 0 0;
  pointer-events: none;
}
.card.geschenk > * { position: relative; z-index: 1; } /* Inhalt liegt über dem Geschenkband */
.card.geschenk .schleife { position: absolute; top: -1.3rem; left: 50%; transform: translateX(-50%); font-size: 2.4rem; line-height: 1; }
.empfaenger {
  font-family: var(--title); font-weight: 700; color: var(--red);
  font-size: clamp(2.2rem, 10vw, 3.2rem); line-height: 1.1; text-align: center; margin: .2rem 0 1rem; overflow-wrap: anywhere;
}

/* Wunsch-Anzeige */
.wunsch { background: #fff; border: 2px dashed var(--line); border-radius: .8rem; padding: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.links { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; gap: .5rem; }
.links a {
  display: block; padding: .75rem 1rem; border-radius: .7rem; background: #eef3ff; color: #12307a;
  font-weight: 700; text-decoration: underline; overflow-wrap: anywhere;
}

/* ── Formulare ──────────────────────────────────────────────── */
label { display: block; font-weight: 700; margin: 1rem 0 .35rem; }
input[type="text"], input[type="email"], input[type="url"], input[type="date"], input[type="number"], input[type="password"], textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  background: #fff; border: 2px solid #b9ab90; border-radius: .7rem;
  padding: .75rem .85rem; min-height: 3rem;
}
textarea { min-height: 8rem; resize: vertical; }
input:focus, textarea:focus, select:focus, button:focus-visible, a:focus-visible {
  outline: 4px solid #2a6df4; outline-offset: 2px;
}
.hint { font-size: .9rem; color: var(--muted); margin: .3rem 0 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  min-height: 3.2rem; padding: .7rem 1.3rem; border-radius: .9rem; border: 0;
  background: var(--red); color: #fff;
  box-shadow: 0 .25rem 0 var(--red-dark);
}
.btn:active { transform: translateY(2px); box-shadow: 0 .1rem 0 var(--red-dark); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.gruen { background: var(--green); box-shadow: 0 .25rem 0 #0d4426; }
.btn.hell { background: #fff; color: var(--ink); border: 2px solid #b9ab90; box-shadow: none; }
.btn.klein { min-height: 2.75rem; padding: .4rem .9rem; }
.btn.breit { width: 100%; }
.reihe { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

.check { display: flex; gap: .8rem; align-items: center; font-weight: 700; margin: 1rem 0; cursor: pointer; }
.check input { width: 2rem; height: 2rem; accent-color: var(--green); flex: none; }

/* Meldungen */
.meldung { border-radius: .8rem; padding: .8rem 1rem; margin: .8rem 0 0; font-weight: 700; }
.meldung.ok { background: #e3f4e8; color: #0d4426; border: 2px solid #8fcca4; }
.meldung.fehler { background: #fde7e5; color: #7d1912; border: 2px solid #f0a49d; }
.meldung:empty { display: none; }

/* Nachrichten */
.nachrichten { display: grid; gap: .6rem; margin: .6rem 0; }
.nachricht { padding: .7rem .9rem; border-radius: .8rem; max-width: 90%; white-space: pre-wrap; overflow-wrap: anywhere; }
.nachricht .wer { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); }
.nachricht.ich { justify-self: end; background: #e3f4e8; }
.nachricht.andere { justify-self: start; background: #fff; border: 2px solid var(--line); }

/* Admin-Liste */
.person { border: 2px solid var(--line); border-radius: .9rem; padding: .3rem 1rem 1rem; margin: 0 0 1rem; background: #fff; }
.person .kopf { display: flex; justify-content: space-between; align-items: center; gap: .5rem; margin-top: .6rem; }
.ausnahme { margin-top: 1rem; border-top: 2px dashed var(--line); padding-top: .6rem; }
.ausnahme summary { cursor: pointer; font-weight: 700; min-height: 2.75rem; display: flex; align-items: center; }
.ausnahme summary::before { content: "▸"; margin-right: .5rem; }
.ausnahme[open] summary::before { content: "▾"; }
.ausnahme .check { margin: .5rem 0; font-weight: 400; }
.status-liste { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.status-liste li { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; background: #fff; border-radius: .7rem; padding: .6rem .8rem; border: 2px solid var(--line); }
.badge { font-weight: 700; padding: 0 .55rem; border-radius: .5rem; font-size: .9rem; }
.badge.ja { background: #e3f4e8; color: #0d4426; }
.badge.nein { background: #fff1d6; color: #7a4b00; }
code.link { display: block; font-size: .8rem; overflow-wrap: anywhere; background: #f2f2f2; padding: .3rem .5rem; border-radius: .4rem; margin-top: .3rem; }

footer { position: relative; z-index: 2; text-align: center; color: #d8d2c2; font-size: .85rem; padding: 0 1rem 1rem; }

[hidden] { display: none !important; }

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