/* ---------- Grundlagen ---------- */
:root {
  --night: #0f2a1d;
  --night-2: #163a29;
  --pine: #1f5c3d;
  --pine-light: #2e7d52;
  --berry: #b3262e;
  --berry-dark: #8e1c23;
  --gold: #d9a520;
  --gold-soft: #f6e7b8;
  --cream: #fffaf0;
  --paper: #ffffff;
  --ink: #23302a;
  --muted: #66746c;
  --line: #e6e0d2;
  --ok: #1f7a46;
  --ok-bg: #e5f4ea;
  --bad: #b3262e;
  --bad-bg: #fbe9ea;
  --info-bg: #fdf6df;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", serif;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: #1b4431;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background:
    radial-gradient(ellipse 900px 600px at 15% 0, rgba(217, 165, 32, 0.16), transparent 70%),
    radial-gradient(ellipse 900px 700px at 95% 5%, rgba(46, 125, 82, 0.35), transparent 70%),
    linear-gradient(180deg, var(--night) 0, var(--night-2) 700px, #1b4431 100%);
}

a { color: var(--berry); text-underline-offset: 2px; }
a:hover { color: var(--berry-dark); }

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0 0 0.5em; color: var(--night); }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; margin-top: 1.25em; }
p { margin: 0 0 0.9em; }
code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.9em; background: #f3efe4; padding: 0.1em 0.35em; border-radius: 6px; }

.icon { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.right { text-align: right; }
.pre { white-space: pre-line; }
.break { word-break: break-all; }
.top-gap { margin-top: 1rem; }
.ok-text { color: var(--ok); font-weight: 600; }
.inline { display: inline; }
ul.plain { padding-left: 1.2em; margin: 0; }
ul.plain li { margin-bottom: 0.5em; }

.wrap { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 24px; padding-bottom: 32px; position: relative; z-index: 1; }

/* ---------- Schnee ---------- */
.snow {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image:
    radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,0.9), transparent 60%),
    radial-gradient(2px 2px at 120px 80px, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(3px 3px at 200px 150px, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(2px 2px at 300px 40px, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(3px 3px at 340px 220px, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(2px 2px at 60px 250px, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 250px 300px, rgba(255,255,255,0.9), transparent 60%),
    radial-gradient(2.5px 2.5px at 160px 360px, rgba(255,255,255,0.6), transparent 60%);
  background-size: 380px 400px;
  animation: snowfall 22s linear infinite;
  opacity: 0.75;
}
.snow::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 40px 60px, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(2px 2px at 150px 20px, rgba(255,255,255,0.6), transparent 60%),
    radial-gradient(1.5px 1.5px at 220px 180px, rgba(255,255,255,0.7), transparent 60%),
    radial-gradient(2px 2px at 90px 140px, rgba(255,255,255,0.5), transparent 60%);
  background-size: 260px 260px;
  animation: snowfall 34s linear infinite;
}
@keyframes snowfall {
  from { background-position: 0 0; }
  to { background-position: 60px 400px; }
}
@media (prefers-reduced-motion: reduce) {
  .snow, .snow::after { animation: none; }
  .spin-slow .icon { animation: none !important; }
}

/* ---------- Kopfzeile ---------- */
.site-header {
  position: relative;
  z-index: 2;
  background: rgba(10, 30, 20, 0.55);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; }
.brand:hover { color: var(--gold-soft); }
.brand-star { color: var(--gold); fill: var(--gold); width: 1.4em; height: 1.4em; filter: drop-shadow(0 0 6px rgba(217, 165, 32, 0.6)); }
.nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.nav a, .nav-logout button {
  display: inline-flex; align-items: center; gap: 6px;
  color: rgba(255, 255, 255, 0.85); text-decoration: none;
  padding: 7px 11px; border-radius: 999px; font-size: 0.95rem;
  background: none; border: 0; cursor: pointer; font: inherit;
}
.nav a:hover, .nav-logout button:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav a.active { background: rgba(255, 255, 255, 0.16); color: #fff; }
.nav a.nav-admin { color: var(--gold-soft); }
.nav-logout { margin: 0; }
@media (max-width: 640px) {
  .nav { width: 100%; justify-content: space-between; }
  .nav a span { display: none; }
  .nav a, .nav-logout button { padding: 9px 12px; }
  .nav a .icon, .nav-logout .icon { width: 1.35em; height: 1.35em; }
}

.site-footer { position: relative; z-index: 1; color: rgba(255, 255, 255, 0.55); text-align: center; padding: 18px 0 24px; font-size: 0.9rem; }

/* ---------- Karten ---------- */
.card {
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 24px;
  margin-bottom: 18px;
  position: relative;
}
.card.narrow { max-width: 520px; margin-left: auto; margin-right: auto; }
.card-head { text-align: center; margin-bottom: 1rem; }
.big-icon { color: var(--berry); margin-bottom: 0.5rem; }
.big-icon .icon { width: 44px; height: 44px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 1.2rem; }
.section-title .icon { color: var(--berry); }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.78rem; color: var(--muted); margin: 0 0 0.2em; font-weight: 600; }
.spin-slow .icon { animation: spin 12s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.hero { text-align: center; color: #fff; padding: 12px 0 22px; }
.hero h1 { color: #fff; font-size: 2.2rem; margin-bottom: 0.3em; }
.hero p { color: rgba(255, 255, 255, 0.82); max-width: 520px; margin: 0 auto; }
.hero-icon { color: var(--gold); }
.hero-icon .icon { width: 56px; height: 56px; filter: drop-shadow(0 0 12px rgba(217, 165, 32, 0.5)); }

.round-card { border-top: 6px solid var(--berry); }
.round-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.round-head h1 { margin-bottom: 0.4em; }

/* ---------- Fakten ---------- */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 8px 0 4px; }
.fact { display: flex; gap: 10px; align-items: flex-start; background: var(--cream); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.fact .icon { color: var(--pine); width: 1.5em; height: 1.5em; margin-top: 2px; }
.fact-label { display: block; font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.fact-value { display: block; font-weight: 600; }
.fact-extra { display: inline-block; margin-top: 4px; font-size: 0.82rem; background: var(--berry); color: #fff; padding: 1px 9px; border-radius: 999px; }
.info-box { display: flex; gap: 10px; margin-top: 12px; background: var(--info-bg); border-radius: 12px; padding: 12px 14px; }
.info-box p { margin: 0; }
.info-box .icon { color: var(--gold); margin-top: 3px; }

/* ---------- Badges, Chips ---------- */
.badge { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; vertical-align: middle; }
.badge-open { background: var(--ok-bg); color: var(--ok); }
.badge-drawn { background: var(--info-bg); color: #8a6200; }
.badge-released { background: var(--berry); color: #fff; }
.badge-soft { background: #efeadd; color: var(--muted); font-weight: 600; margin-left: 4px; }

.chips { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { background: var(--cream); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; font-size: 0.95rem; }
.chip-me { background: var(--pine); border-color: var(--pine); color: #fff; }

/* ---------- Status & Aufgaben ---------- */
.status-line { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.status-line > .icon { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: #efeadd; color: var(--muted); }
.status-line.ok > .icon { background: var(--ok-bg); color: var(--ok); }
.status-line.bad > .icon { background: var(--bad-bg); color: var(--bad); }
.status-line strong { display: block; }
.status-line span { display: block; }

.todo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin-bottom: 12px; }
.todo { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; border: 2px dashed var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, background .15s; }
.todo:hover { border-color: var(--berry); color: var(--ink); background: #fffdf8; }
.todo > .icon { width: 30px; height: 30px; color: var(--berry); }
.todo strong, .todo .muted { display: block; }
.todo.done { border-style: solid; border-color: #cfe7d7; background: #f7fcf9; }
.todo.done > .icon { color: var(--ok); }

.steps { list-style: none; display: flex; gap: 8px; padding: 0; margin: 18px 0 0; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--muted); padding: 6px 12px 6px 6px; border-radius: 999px; background: #f5f1e6; }
.steps li span { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #e3dccb; font-weight: 700; font-size: 0.8rem; }
.steps li.done span { background: var(--ok); color: #fff; }
.steps li.current { color: var(--ink); font-weight: 600; background: var(--gold-soft); }
.steps li.current span { background: var(--berry); color: #fff; }

.checklist { list-style: none; padding: 0; margin: 0 0 14px; }
.checklist li { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist li .icon { width: 22px; height: 22px; padding: 3px; border-radius: 50%; }
.checklist li.ok .icon { background: var(--ok-bg); color: var(--ok); }
.checklist li.bad .icon { background: var(--bad-bg); color: var(--bad); }
.checklist li.bad { color: var(--bad); font-weight: 600; }
.checklist li.skipped { color: var(--muted); }
.checklist li.skipped .icon { background: #f0ece2; color: var(--muted); }

/* ---------- Umschlag (Ergebnis) ---------- */
.reveal-card { padding: 0; overflow: hidden; }
.envelope > summary {
  list-style: none;
  cursor: pointer;
  display: flex; align-items: center; gap: 18px;
  padding: 26px 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.08) 25%, transparent 25%) 0 0 / 28px 28px,
    linear-gradient(135deg, var(--berry), var(--berry-dark));
  color: #fff;
}
.envelope > summary::-webkit-details-marker { display: none; }
.envelope > summary:hover .envelope-icon { transform: rotate(-8deg) scale(1.06); }
.envelope-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--gold); color: var(--berry-dark); transition: transform .2s; flex-shrink: 0; box-shadow: 0 0 0 6px rgba(255,255,255,0.15); }
.envelope-icon .icon { width: 34px; height: 34px; }
.envelope-text strong { display: block; font-family: var(--font-display); font-size: 1.4rem; }
.envelope-text span { opacity: 0.9; }
.envelope[open] > summary { padding: 14px 24px; }
.envelope[open] .envelope-text span { display: none; }
.envelope[open] .envelope-icon { width: 44px; height: 44px; }
.envelope[open] .envelope-icon .icon { width: 24px; height: 24px; }
.envelope-content { padding: 22px 24px 24px; animation: pop .45s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px) scale(0.98); } to { opacity: 1; transform: none; } }
.receiver-name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 7vw, 3rem);
  font-weight: 700;
  color: var(--berry);
  text-align: center;
  margin: 0 0 0.1em;
  line-height: 1.1;
}

/* ---------- Wunschliste ---------- */
.wishes { list-style: none; padding: 0; margin: 0; }
.wish { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-bottom: 1px dashed var(--line); }
.wish:last-child { border-bottom: 0; }
.wish-main { flex: 1; min-width: 0; padding-left: 26px; position: relative; }
.wish-main::before { content: ""; position: absolute; left: 4px; top: 0.5em; width: 10px; height: 10px; border-radius: 50%; background: var(--berry); box-shadow: 0 0 0 3px #f8dcdd; }
.wish-title { font-weight: 600; }
.wish-text { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }
.wish-link { display: inline-flex; align-items: center; gap: 4px; font-size: 0.9rem; margin-top: 2px; word-break: break-all; }
.wish-note { display: flex; gap: 10px; background: var(--info-bg); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.wish-note .icon { color: var(--gold); margin-top: 3px; }
.wish-note p { margin: 2px 0 0; }

.inline-banner { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: var(--info-bg); border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }

/* ---------- Listen & Tabellen ---------- */
.list { list-style: none; padding: 0; margin: 0 0 14px; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.list-row:last-child { border-bottom: 0; }
.list-row .icon { color: var(--berry); }

.table-wrap { overflow-x: auto; margin: 0 -4px 12px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table th { text-align: left; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); padding: 8px 6px; border-bottom: 2px solid var(--line); white-space: nowrap; }
.table td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.pairs td { font-size: 1.05rem; }
.table .arrow { color: var(--berry); width: 40px; text-align: center; }

details.more { margin: 10px 0; }
details.more > summary { cursor: pointer; color: var(--muted); font-weight: 600; padding: 4px 0; }

.copy-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.code-box { font-size: 1.05rem; padding: 8px 12px; background: var(--cream); border: 1px dashed var(--gold); border-radius: 10px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- Formulare ---------- */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 5px; font-weight: 600; font-size: 0.95rem; }
.form label small { font-weight: 400; color: var(--muted); }
.form > .btn:not(.btn-block) { justify-self: start; }
.print-sheet .section-title { margin-top: 1.5rem; }
.form-inline { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .grow { flex: 1; min-width: 200px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: end; }
@media (max-width: 560px) { .grid-2 { grid-template-columns: 1fr; } }
fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 16px; margin: 0; display: grid; gap: 12px; }
legend { font-weight: 700; padding: 0 6px; font-family: var(--font-display); color: var(--night); }

input:not([type="checkbox"]), select, textarea {
  width: 100%;
  font: inherit;
  font-weight: 400;
  color: var(--ink);
  padding: 10px 12px;
  border: 1.5px solid #d8d1bf;
  border-radius: 10px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 44px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pine-light); box-shadow: 0 0 0 3px rgba(46, 125, 82, 0.2); }
.form label.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--berry); flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-weight: 600; font-size: 0.97rem;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--pine);
  background: #fff;
  color: var(--pine);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, color .15s, transform .05s, box-shadow .15s;
  line-height: 1.2;
}
.btn:hover { background: var(--pine); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn-primary { background: var(--berry); border-color: var(--berry); color: #fff; box-shadow: 0 4px 12px rgba(179, 38, 46, 0.3); }
.btn-primary:hover { background: var(--berry-dark); border-color: var(--berry-dark); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: #f1ede3; color: var(--ink); }
.btn-danger { border-color: var(--bad); color: var(--bad); }
.btn-danger:hover { background: var(--bad); color: #fff; }
.btn-small { padding: 6px 12px; font-size: 0.88rem; }
.btn-icon { padding: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn[disabled]:hover { background: var(--berry); }

/* ---------- Hinweise ---------- */
.alert { border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; font-weight: 500; position: relative; z-index: 1; }
.alert p { margin: 0 0 0.5em; }
.alert-success { background: var(--ok-bg); color: #135c33; border-left: 5px solid var(--ok); }
.alert-error { background: var(--bad-bg); color: #7d1a20; border-left: 5px solid var(--bad); }
.alert-info { background: var(--info-bg); color: #6b4d00; border-left: 5px solid var(--gold); }
.main > .alert { box-shadow: var(--shadow); }

/* ---------- Admin-Unternavigation ---------- */
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.subnav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,0.1); color: #fff; text-decoration: none; font-weight: 600; font-size: 0.93rem; }
.subnav a:hover { background: rgba(255,255,255,0.2); color: #fff; }
.subnav a.active { background: var(--gold); color: var(--night); }
.main > p > a { color: var(--gold-soft); }

/* ---------- Druckansicht ---------- */
.print-page { background: #f3efe4; display: block; }
.print-actions { display: flex; gap: 10px; justify-content: center; padding: 16px; }
.print-sheet { background: #fff; max-width: 720px; margin: 0 auto 32px; padding: 36px 40px; border-radius: 12px; box-shadow: var(--shadow); border-top: 8px solid var(--berry); }
.print-head { display: flex; align-items: center; gap: 8px; font-family: var(--font-display); color: var(--muted); margin-bottom: 24px; }
.print-hello { font-family: var(--font-display); font-size: 1.3rem; }

@media print {
  body, .print-page { background: #fff !important; }
  .snow, .site-header, .site-footer, .no-print { display: none !important; }
  .print-sheet { box-shadow: none; margin: 0; max-width: none; padding: 0; border-top: 0; }
  .card { box-shadow: none; }
  a { color: inherit; }
}

@media (max-width: 520px) {
  .card { padding: 18px 16px; border-radius: 14px; }
  .card.reveal-card { padding: 0; }
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.8rem; }
  .envelope > summary { padding: 20px 16px; gap: 14px; }
  .envelope-content { padding: 18px 16px; }
  .print-sheet { padding: 24px 18px; }
}
