/* Halloween-Buffet – Schwarz und Orange für die Gartenparty. */
:root {
  color-scheme: dark;
  --night: #100e0c;
  --crypt: #1e1914;
  --crypt-2: #2a2119;
  --line: #58402b;
  --bone: #f3e9da;
  --ash: #b8aa99;
  --pumpkin: #ff8a1f;
  --pumpkin-deep: #e5680c;
  --ember: #ffc46b;
  --moss: #c0ca7b;
  --blood: #ff7a7c;
  --radius-s: 6px;
  --radius-m: 14px;
  --display: "Pirata One", "Luminari", "Palatino", Georgia, serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

body {
  margin: 0;
  background:
    radial-gradient(ellipse 66% 38% at 50% 0%, #47240f 0%, transparent 74%),
    radial-gradient(ellipse 40% 28% at 100% 38%, rgba(110, 48, 12, .16) 0%, transparent 75%),
    var(--night);
  background-attachment: fixed;
  color: var(--bone);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
}

.page {
  max-width: 880px;
  margin: 0 auto;
  padding-inline: 16px;
  padding-block: clamp(56px, 8vw, 92px) 80px;
  display: grid;
  gap: 56px;
}

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.05; text-wrap: balance; margin: 0; }
h2 { font-size: clamp(2rem, 5vw, 2.6rem); color: var(--ember); }
h3 { font-size: 1.5rem; }
p { margin: 0; }
.muted { color: var(--ash); }
.small { font-size: 0.9rem; }

/* ---------- Kopf ---------- */

.hero {
  position: relative;
  /* Oben Platz für das Bild-Banner, der Text beginnt in dessen ausgeblendetem unteren Rand */
  padding: 50% clamp(20px, 5vw, 48px) 36px;
  border-radius: 22px;
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--night);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(255, 122, 20, .08);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 1024 / 600;
  background:
    linear-gradient(0deg, var(--night) 0%, rgba(12, 9, 8, .6) 22%, transparent 45%),
    url("assets/buffet-3d.jpg") 60% 0 / cover no-repeat;
}
.hero-text { position: relative; max-width: 40rem; display: grid; gap: 14px; }
.hero h1 {
  font-size: clamp(2.6rem, 11vw, 5.6rem);
  color: var(--pumpkin);
  /* Glühende Schrift wie aus einer Kürbislaterne */
  background: linear-gradient(180deg, #ffe3a3 0%, #ffa232 38%, #ff6a00 62%, #9c3300 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 14px rgba(255, 110, 10, .55)) drop-shadow(0 0 40px rgba(255, 80, 0, .3));
  animation: candle 4.2s infinite;
}
.facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 0;
  font-size: 1.05rem;
}
.facts dt { color: var(--ash); font-size: 0.85rem; }
.facts dd { margin: 0; font-weight: 700; }
.invite-note { color: var(--ash); max-width: 42ch; }

@keyframes candle {
  0%, 100% { filter: drop-shadow(0 0 14px rgba(255, 110, 10, .55)) drop-shadow(0 0 40px rgba(255, 80, 0, .3)); }
  40% { filter: drop-shadow(0 0 8px rgba(255, 110, 10, .35)) drop-shadow(0 0 22px rgba(255, 80, 0, .15)); }
  44% { filter: drop-shadow(0 0 16px rgba(255, 130, 20, .65)) drop-shadow(0 0 48px rgba(255, 80, 0, .35)); }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1, .hero::after, .fog::before, .fog::after, .bat, .bat use, .spider, .eye, .drip { animation: none !important; }
  .bats { display: none; }
  .wish.leaving { transition: none; }
}

/* ---------- Abschnitte ---------- */

section { display: grid; gap: 20px; }
.section-head { display: grid; gap: 6px; }
.section-head p { color: var(--ash); max-width: 60ch; }
.section-head.with-art {
  grid-template-columns: 1fr auto;
  column-gap: 20px;
  align-items: center;
}
.section-head.with-art > :not(.art) { grid-column: 1; }
.art {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: clamp(96px, 18vw, 150px);
  height: auto;
  margin-block: -18px;
  /* Schwarzer Bildgrund verschwindet auf dem dunklen Untergrund */
  mix-blend-mode: lighten;
  -webkit-mask-image: radial-gradient(circle, #000 52%, transparent 71%);
  mask-image: radial-gradient(circle, #000 52%, transparent 71%);
}

/* Wunschliste als Speisekarte */
.menu { list-style: none; margin: 0; padding: 0; border-top: 1px dashed var(--line); }
.wish {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  align-items: center;
  padding: 16px 4px;
  border-bottom: 1px dashed var(--line);
  transition: opacity .35s ease, transform .35s ease;
}
.wish.leaving { opacity: 0; transform: translateX(24px); }
.wish-name { font-size: 1.2rem; font-weight: 700; }
.wish-meta { color: var(--ash); font-size: 0.92rem; }
.wish-meta .cat { color: var(--ember); }
.claim-form {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 8px;
}
.claim-form input { flex: 1 1 200px; }

.empty {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-m);
  color: var(--ash);
}

/* Eigenes Gericht */
.bring {
  background: var(--crypt);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
  padding: 24px;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.form-grid .wide { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field label { font-size: 0.92rem; color: var(--ash); }

input, select, textarea {
  font: inherit;
  color: var(--bone);
  background: var(--night);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 10px 12px;
  width: 100%;
  min-width: 0;
}
input::placeholder { color: #7d6d90; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  border-radius: 999px;
  padding: 10px 20px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.btn {
  background: linear-gradient(180deg, #ffa53a, #f06d0c);
  color: #240f00;
  box-shadow: 0 0 0 1px rgba(255, 170, 80, .35) inset, 0 6px 18px rgba(255, 106, 0, .22);
  transition: box-shadow .2s ease, transform .2s ease;
}
.btn:hover { box-shadow: 0 0 0 1px rgba(255, 200, 120, .6) inset, 0 0 26px rgba(255, 122, 20, .6); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--bone); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ash); }
.btn-link { background: none; border: none; padding: 0; color: var(--ash); font-weight: 400; text-decoration: underline; text-underline-offset: 3px; }
.btn-link:hover { color: var(--blood); }
.btn-danger { background: transparent; color: var(--ash); border-color: var(--line); padding: 6px 14px; font-size: 0.9rem; }
.btn-danger:hover, .btn-danger.armed { color: var(--blood); border-color: var(--blood); }
button:disabled { opacity: .55; cursor: wait; }

.form-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.error { color: var(--blood); font-size: 0.95rem; }

/* Buffet-Übersicht */
.table {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 24px 32px;
}
.course h3 { color: var(--bone); font-size: 1.35rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; margin-bottom: 8px; }
.course ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.course li { display: grid; }
.mine-tag { color: var(--moss); font-size: 0.85rem; white-space: nowrap; }
.count { color: var(--ash); font-family: var(--body); font-size: 0.95rem; }

/* Hinweis unten */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  max-width: min(520px, calc(100% - 32px));
  background: var(--crypt-2);
  border: 1px solid var(--moss);
  color: var(--bone);
  padding: 12px 18px;
  border-radius: var(--radius-m);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  z-index: 10;
}
.toast.bad { border-color: var(--blood); }

footer { color: var(--ash); font-size: 0.9rem; text-align: center; }

/* ---------- Grusel ---------- */

body { position: relative; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Kürbis-Schleim tropft vom oberen Rand */
.drip {
  display: block;
  width: 100%;
  height: clamp(44px, 6vw, 76px);
  margin-bottom: calc(-1 * clamp(44px, 6vw, 76px));
  position: relative;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 4px 10px rgba(255, 100, 0, .35));
  transform-origin: top;
  animation: ooze 6s ease-in-out infinite;
}
@keyframes ooze { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(1.08); } }

.hero { container-type: inline-size; isolation: isolate; }
.hero-text { z-index: 3; }

/* Flackerndes Kerzenlicht über dem Bild */
.hero::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 1024 / 600;
  background:
    radial-gradient(circle at 44% 52%, rgba(255, 140, 30, .28), transparent 16%),
    radial-gradient(circle at 80% 56%, rgba(255, 140, 30, .26), transparent 15%),
    radial-gradient(circle at 92% 40%, rgba(255, 190, 90, .22), transparent 9%);
  mix-blend-mode: screen;
  pointer-events: none;
  animation: flame 2.6s infinite steps(1);
}
@keyframes flame {
  0% { opacity: .9; } 12% { opacity: .55; } 18% { opacity: 1; } 40% { opacity: .75; }
  46% { opacity: .95; } 70% { opacity: .6; } 76% { opacity: 1; } 90% { opacity: .8; }
}

/* Kriechender Nebel */
.fog {
  position: absolute;
  inset: 0 0 auto 0;
  aspect-ratio: 1024 / 600;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.fog::before, .fog::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 2%;
  width: 200%;
  height: 50%;
  background:
    radial-gradient(ellipse 22% 60% at 12% 70%, rgba(255, 214, 180, .13), transparent 70%),
    radial-gradient(ellipse 18% 45% at 32% 60%, rgba(255, 200, 160, .10), transparent 70%),
    radial-gradient(ellipse 26% 55% at 50% 75%, rgba(255, 220, 190, .12), transparent 70%);
  background-size: 50% 100%;
  background-repeat: repeat-x;
  filter: blur(6px);
  animation: drift 38s linear infinite;
}
.fog::after { bottom: -6%; opacity: .8; animation-duration: 57s; animation-direction: reverse; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Fledermäuse */
.bats { position: absolute; inset: 0; pointer-events: none; z-index: 2; overflow: hidden; }
.bat {
  position: absolute;
  left: 0;
  width: 44px;
  height: 18px;
  color: #070504;
  filter: drop-shadow(0 0 3px rgba(255, 130, 30, .6));
  animation: fly 16s linear infinite;
}
.bat use { transform-origin: center; animation: flap .22s ease-in-out infinite alternate; }
.b1 { top: 12%; }
.b2 { top: 20%; width: 30px; height: 12px; animation-delay: -5s; animation-duration: 19s; }
.b3 { top: 7%; width: 24px; height: 10px; animation-delay: -11s; animation-duration: 23s; }
@keyframes fly {
  0% { transform: translate(calc(100cqw + 60px), 0); }
  30% { transform: translate(55cqw, -18px); }
  60% { transform: translate(-80px, 12px); }
  100% { transform: translate(-80px, 12px); }
}
@keyframes flap { from { transform: scaleY(1); } to { transform: scaleY(.35); } }

/* Spinne seilt sich ab */
.spider {
  position: absolute;
  top: -8px;
  right: clamp(18px, 7%, 70px);
  width: 34px;
  height: auto;
  color: #d9c7b0;
  z-index: 2;
  transform-origin: top center;
  animation: dangle 7s ease-in-out infinite;
}
@keyframes dangle {
  0%, 100% { transform: translateY(-38px) rotate(2deg); }
  45% { transform: translateY(0) rotate(-3deg); }
  60% { transform: translateY(-6px) rotate(2deg); }
}
.eye { animation: blink 5s infinite; }
@keyframes blink { 0%, 92%, 100% { opacity: 1; } 95% { opacity: 0; } }

/* Für Getränke ist gesorgt */
.drinks {
  justify-self: start;
  padding: 6px 14px;
  border: 1px solid rgba(255, 138, 31, .45);
  border-radius: 999px;
  color: var(--ember);
  font-weight: 700;
  font-size: 0.95rem;
  background: rgba(255, 122, 20, .08);
}

/* Spinnweben an der Karte */
.bring, .graveyard { position: relative; }
.bring > :not(.web) { position: relative; }
.web {
  position: absolute;
  width: clamp(90px, 16vw, 130px);
  height: clamp(90px, 16vw, 130px);
  color: rgba(246, 234, 216, .28);
  pointer-events: none;
}
.web-tl { top: -1px; left: -1px; }
.web-tr { top: -1px; right: -1px; transform: scaleX(-1); }
.web-bl { bottom: -1px; left: -1px; transform: scaleY(-1); }
.web-br { bottom: -1px; right: -1px; transform: scale(-1, -1); }
.hero-web { z-index: 2; color: rgba(246, 234, 216, .22); }
.graveyard .web { color: rgba(246, 234, 216, .2); }

/* Große Spinnweben in allen Bildschirmecken */
.webs-fixed { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.webs-fixed .web {
  width: clamp(110px, 22vw, 260px);
  height: clamp(110px, 22vw, 260px);
  color: rgba(246, 234, 216, .16);
  filter: drop-shadow(0 0 2px rgba(255, 150, 60, .25));
}
.webs-fixed .web-tl, .webs-fixed .web-tr { top: env(safe-area-inset-top, 0px); }
.webs-fixed .web-bl, .webs-fixed .web-br { bottom: env(safe-area-inset-bottom, 0px); width: clamp(80px, 14vw, 170px); height: clamp(80px, 14vw, 170px); }

/* Zeilen glühen beim Überfahren */
.wish { border-radius: 10px; }
.wish:hover { background: linear-gradient(90deg, rgba(255, 122, 20, .09), transparent 70%); }

/* Friedhof zum Schluss */
.graveyard {
  position: relative;
  display: grid;
  gap: 6px;
  justify-items: center;
  align-content: end;
  aspect-ratio: 1024 / 520;
  padding: 24px 16px;
  border-radius: 22px;
  overflow: hidden;
  background:
    linear-gradient(180deg, var(--night) 0%, transparent 30%, transparent 55%, rgba(12, 9, 8, .9) 100%),
    url("assets/friedhof-3d.jpg") center 60% / cover no-repeat,
    var(--night);
}
.graveyard-line {
  font-family: var(--display);
  font-size: clamp(1.7rem, 5vw, 2.6rem);
  color: var(--ember);
  text-shadow: 0 0 20px rgba(255, 110, 10, .6), 0 2px 0 #000;
}

/* ---------- Gastgeber ---------- */

.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--crypt);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}
.chip b { color: var(--ember); }

.scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-m); }
table { border-collapse: collapse; width: 100%; min-width: 560px; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { white-space: nowrap; color: var(--ash); font-weight: 400; font-size: 0.9rem; background: var(--crypt); }
tr:last-child td { border-bottom: none; }
td.who { font-weight: 700; }
.status-open { color: var(--ash); }
.status-taken { color: var(--moss); }

.share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.share input { flex: 1 1 260px; }

.hero-admin h1 { font-size: clamp(2.4rem, 8vw, 4rem); color: var(--pumpkin); }

@media (max-width: 520px) {
  .section-head.with-art > p:not(.art) { grid-column: 1 / -1; }
  .art { grid-row: 1; width: 84px; margin-block: -10px; }
  body { font-size: 16px; }
  .wish { grid-template-columns: 1fr; }
  .wish > button { justify-self: start; }
  .bring { padding: 18px; }
}
