:root {
  --orange: #ff7518;
  --purple: #6a0dad;
  --dark: #1a1424;
  --dark2: #241a33;
  --text: #f2e9ff;
  --green: #3ddc84;
  --red: #ff5470;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  /* Detaillierter gruseliger Vollbild-Hintergrund (Friedhof, Spukhaus, Mond,
     Nebel) aus assets/img/page-bg.svg. "fixed" sorgt für einen dezenten
     Parallax-Effekt beim Scrollen; die Kachel-Textur liegt zusätzlich
     halbtransparent darüber für mehr Struktur/Tiefe. */
  background:
    url('assets/img/bg-texture.svg') repeat,
    url('assets/img/page-bg.svg') center bottom / cover no-repeat fixed,
    radial-gradient(circle at 20% 20%, #2a1b3d, #0d0714 70%);
  background-size: 400px 400px, cover, cover;
  background-attachment: scroll, fixed, fixed;
  color: var(--text);
  font-family: 'Segoe UI', system-ui, sans-serif;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Leicht wabernde Nebelschicht über dem gesamten Hintergrund für zusätzliche
   Gruselstimmung – rein dekorativ, blockiert keine Klicks (pointer-events none). */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 100%, rgba(74,58,104,0.35), transparent 60%);
  animation: fogDrift 18s ease-in-out infinite alternate;
}
@keyframes fogDrift {
  0% { opacity: 0.6; transform: translateX(-2%); }
  100% { opacity: 0.95; transform: translateX(2%); }
}

/* Schwebender Musik-Button (unten rechts, immer sichtbar) zum Starten/
   Stoppen der synthetischen Loop-Hintergrundmusik (assets/spooky-audio.js) */
.music-toggle {
  position: fixed;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 100;
  background: var(--dark2);
  color: var(--text);
  border: 2px solid var(--orange);
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  font-size: 0.9rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.music-toggle:hover {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 6px 22px rgba(255,117,24,0.4);
}
.music-toggle.playing {
  background: var(--orange);
  color: #1a1424;
  animation: musicPulse 1.6s ease-in-out infinite;
}
@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,117,24,0.5); }
  50% { box-shadow: 0 0 0 10px rgba(255,117,24,0); }
}

a { color: var(--orange); }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(0,0,0,0.4);
  border-bottom: 2px solid var(--orange);
}
.topbar .brand {
  font-size: 1.4rem;
  font-weight: bold;
  text-decoration: none;
  color: var(--orange);
}
.topbar nav a, .topbar nav .link-btn {
  margin-left: 1rem;
  color: var(--text);
  text-decoration: none;
  background: none;
  border: none;
  font: inherit;
  cursor: pointer;
}
.topbar nav a:hover, .topbar nav .link-btn:hover { color: var(--orange); }
.inline-form { display: inline; }

.container {
  flex: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1rem;
  width: 100%;
}
.container.wide { max-width: 1140px; }

.hero { text-align: center; margin-bottom: 2rem; }
.hero h1 { font-size: 2.2rem; }
.subtitle { color: #d9c2ff; font-size: 1.1rem; }

/* Hero-Bereich mit Halloween-Nachtsilhouette */
.hero-banner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 2rem;
  border: 1px solid #3a2a54;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}
.hero-banner img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}
.hero-banner .hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(13,7,20,0.1), rgba(13,7,20,0.75));
  padding: 1rem;
}
.hero-banner h1 {
  margin: 0 0 0.4rem;
  font-size: 2.4rem;
  text-shadow: 0 0 12px rgba(255,117,24,0.6);
}
.hero-banner .subtitle { margin: 0; }

/* Icons */
.icon {
  display: inline-block;
  width: 1.4em;
  height: 1.4em;
  vertical-align: -0.28em;
  margin-right: 0.4em;
}
.icon-lg { width: 3rem; height: 3rem; margin: 0 auto 0.5rem; display: block; }
h1 .icon, h2 .icon { filter: drop-shadow(0 0 6px rgba(255,117,24,0.5)); }

.card { position: relative; overflow: hidden; }
.card.with-web::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 60px; height: 60px;
  background: url('assets/img/corner-web.svg') no-repeat;
  background-size: contain;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}
.card.with-web > * { position: relative; z-index: 1; }
.card.with-web h1,
.card.with-web h2 {
  padding-left: 2.6rem;
}

.card {
  background: var(--dark2);
  border: 1px solid #3a2a54;
  border-radius: 12px;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.card.narrow { max-width: 420px; margin-left: auto; margin-right: auto; }

.cta { text-align: center; margin-top: 2rem; }

.btn {
  display: inline-block;
  background: var(--orange);
  color: #1a1424;
  font-weight: bold;
  padding: 0.7rem 1.4rem;
  border-radius: 8px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  margin: 0.3rem;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.2s ease;
  box-shadow: 0 0 0 rgba(255,117,24,0.0);
}
.btn:hover {
  background: #ff8f42;
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 0 6px 18px rgba(255,117,24,0.45);
}
.btn:active { transform: translateY(0) rotate(0deg); }
.btn-secondary { background: var(--purple); color: var(--text); }
.btn-secondary:hover { background: #7d1ed1; box-shadow: 0 6px 18px rgba(106,13,173,0.5); }
.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* Fledermaus-Divider */
.bat-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.2rem;
  margin: 1.5rem 0;
  opacity: 0.7;
}
.bat-divider img { width: 22px; height: 22px; }
.bat-divider img:nth-child(2) { animation: flutter 2.4s ease-in-out infinite; }
.bat-divider img:nth-child(1) { animation: flutter 2.1s ease-in-out infinite 0.3s; }
.bat-divider img:nth-child(3) { animation: flutter 2.7s ease-in-out infinite 0.6s; }
@keyframes flutter {
  0%, 100% { transform: translateY(0) scaleX(1); }
  50% { transform: translateY(-4px) scaleX(0.9); }
}

.form { display: flex; flex-direction: column; gap: 1rem; }
.form label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.95rem; }
.form input, .form select, .form textarea {
  padding: 0.6rem;
  border-radius: 6px;
  border: 1px solid #4c3766;
  background: #150f20;
  color: var(--text);
}
fieldset { border: none; padding: 0; display: flex; flex-direction: column; gap: 1rem; }
fieldset[disabled] { opacity: 0.6; }

.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert-success { background: rgba(61,220,132,0.15); border: 1px solid var(--green); color: var(--green); }
.alert-error { background: rgba(255,84,112,0.15); border: 1px solid var(--red); color: var(--red); }

.guest-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.guest-table th, .guest-table td {
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid #3a2a54;
  text-align: left;
  font-size: 0.9rem;
  vertical-align: top;
  word-wrap: break-word;
  overflow-wrap: break-word;
  max-width: 220px;
}
.guest-table th {
  color: var(--orange);
  white-space: nowrap;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.guest-table tbody tr:hover { background: rgba(255,117,24,0.06); }
.guest-table tbody tr:last-child td { border-bottom: none; }

/* Scrollbarer Wrapper, damit breite Tabellen die Karte nie sprengen */
.table-scroll {
  overflow-x: auto;
  margin-top: 1rem;
  border-radius: 10px;
  -webkit-overflow-scrolling: touch;
}
.table-scroll .guest-table {
  margin-top: 0;
  min-width: 640px;
}
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-thumb { background: #4c3766; border-radius: 4px; }
.table-scroll::-webkit-scrollbar-track { background: transparent; }

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-badge.yes { background: rgba(61,220,132,0.18); color: var(--green); }
.status-badge.no { background: rgba(255,84,112,0.18); color: var(--red); }
.status-badge.maybe { background: rgba(255,117,24,0.18); color: var(--orange); }
.status-badge.pending { background: rgba(242,233,255,0.12); color: var(--text); }

.actions-cell { display: flex; flex-wrap: wrap; gap: 0.4rem; }

@media (max-width: 640px) {
  .container { padding: 1.5rem 0.75rem; }
  .card { padding: 1.2rem 1.2rem; }
  .card.with-web h1, .card.with-web h2 { padding-left: 2.2rem; font-size: 1.3rem; }
  .hero-banner img { height: 180px; }
  .hero-banner h1 { font-size: 1.6rem; }
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.85rem;
  color: #b9a4d9;
  border-top: 1px solid #3a2a54;
}

/* -----------------------------------------------------------------------
   Avatare (Profilbilder) – werden konsistent im Header, in Gästeliste,
   Admin-Tabelle, Galerie und auf der Account-Seite verwendet.
   ----------------------------------------------------------------------- */
.avatar {
  border-radius: 50%;
  object-fit: cover;
  background: var(--dark2);
  border: 2px solid var(--orange);
  flex-shrink: 0;
}
.avatar-nav { width: 28px; height: 28px; margin-right: 0.4rem; vertical-align: middle; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-xs { width: 20px; height: 20px; vertical-align: middle; margin-right: 0.3rem; }
.avatar-lg { width: 96px; height: 96px; border-width: 3px; }

.nav-avatar-link { display: inline-flex; align-items: center; }

/* -----------------------------------------------------------------------
   Account-Seite (account.php)
   ----------------------------------------------------------------------- */
.account-avatar-block {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.card-section {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #3a2a54;
}
.card-section h2 { margin-top: 0; font-size: 1.15rem; }

.hint { color: #b9a4d9; font-size: 0.9rem; }

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: normal; }
.checkbox-label input[type="checkbox"] { width: auto; }

.danger-zone {
  border: 1px solid var(--red);
  border-radius: 10px;
  padding: 1.2rem;
  background: rgba(255, 84, 112, 0.06);
}
.danger-zone h2 { color: var(--red); }

.btn-danger {
  background: var(--red);
  color: #1a1424;
}
.btn-danger:hover { background: #ff7a95; }

.btn-small { padding: 0.4rem 0.8rem; font-size: 0.85rem; }

/* -----------------------------------------------------------------------
   Fotogalerie (gallery.php)
   ----------------------------------------------------------------------- */
.gallery-grid-section { margin-top: 1.5rem; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}

.gallery-item {
  margin: 0;
  background: var(--dark2);
  border: 1px solid #3a2a54;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}
.gallery-item figcaption {
  padding: 0.6rem 0.8rem;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.gallery-delete { padding: 0 0.8rem 0.6rem; }
.gallery-delete .link-btn { color: var(--red); font-size: 0.8rem; }

@media (max-width: 640px) {
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

