:root {
  /* Farben aus der Einladung: Flieder/Lavendel + zartes Gelb + Creme */
  --bg: #f4eefb;            /* heller Lavendel-Hintergrund */
  --bg-warm: #fdf8ec;       /* cremig */
  --card: #ffffff;
  --ink: #3f3651;           /* dunkles Violett-Grau fuer Text */
  --muted: #8b82a0;
  --lilac: #b9a3df;         /* Flieder */
  --lilac-soft: #e7ddf6;
  --purple: #6b5aa6;        /* kraeftiges Violett (Akzent/Buttons) */
  --purple-dark: #54457f;
  --yellow: #f6e9a0;        /* zartes Gelb */
  --yellow-soft: #fbf4ce;
  --line: #e7e0f0;
  --danger: #b3534b;
  --radius: 16px;
  --shadow: 0 8px 26px rgba(90, 70, 130, 0.10);
  --font: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --script: "Great Vibes", cursive;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
h1, h2 { font-weight: 500; letter-spacing: 0.2px; color: var(--purple-dark); }
a { color: var(--purple); }

/* --- Topbar --- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: 0.8rem 1.5rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 10;
}
.brand { font-family: var(--script); font-size: 1.9rem; line-height: 1; text-decoration: none; color: var(--purple-dark); }
.brand span { font-family: var(--font); color: var(--muted); font-weight: 300; font-size: 0.8rem; letter-spacing: 1px; }
.topbar nav { display: flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.topbar nav a {
  text-decoration: none; color: var(--ink);
  padding: 0.4rem 0.9rem; border-radius: 999px; font-size: 0.95rem;
}
.topbar nav a:hover { background: var(--bg); }
.topbar nav a.on { background: var(--lilac); color: #fff; }
.logout { margin: 0; }
.logout button {
  background: none; border: 1px solid var(--line); color: var(--muted);
  padding: 0.4rem 0.9rem; border-radius: 999px; cursor: pointer; font-size: 0.9rem; font-family: inherit;
}
.logout button:hover { color: var(--ink); border-color: var(--lilac); }

/* --- Layout --- */
.container { max-width: 1000px; margin: 0 auto; padding: 1.5rem 1.2rem 3rem; }
.hero { text-align: center; margin: 1.8rem 0 2.2rem; }
.hero h1 { margin: 0 0 0.3rem; font-family: var(--script); font-size: 3rem; line-height: 1.05; color: var(--purple-dark); }
.hero p { margin: 0; color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 2rem 0; }
.device-hint {
  background: var(--yellow-soft); border: 1px solid #ecdf9e; color: #8a7536;
  padding: 0.7rem 1rem; border-radius: var(--radius); font-size: 0.9rem;
}

/* --- Karten / Formulare --- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.upload-card, .post-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 1.5rem; margin-bottom: 2.2rem;
  border-top: 4px solid var(--lilac);
}
.upload-card h2, .post-card h2 { margin-top: 0; }
.field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-size: 0.85rem; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
input[type=text], input[type=password], input[type=file], textarea {
  font: inherit; padding: 0.65rem 0.8rem; border: 1px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--ink); width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--lilac); border-color: var(--lilac); }
textarea { resize: vertical; }
.hint { color: var(--muted); font-size: 0.85rem; margin: 0.5rem 0 0; }

button[type=submit], .btn-link {
  display: inline-block; background: var(--purple); color: #fff; border: none;
  padding: 0.7rem 1.6rem; border-radius: 999px; font-size: 1rem; cursor: pointer;
  text-decoration: none; transition: background 0.15s; font-family: inherit; font-weight: 400;
}
button[type=submit]:hover, .btn-link:hover { background: var(--purple-dark); }

/* --- Galerie --- */
.gallery {
  display: grid; gap: 1.2rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-bottom: 2rem;
}
.gallery figure { margin: 0; overflow: hidden; display: flex; flex-direction: column; }
.gallery img, .gallery video { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--lilac-soft); }
figcaption { padding: 0.8rem 1rem; }
.caption-text { margin: 0 0 0.3rem; }
.meta { margin: 0; font-size: 0.8rem; color: var(--muted); }
.meta .author { color: var(--purple); font-weight: 500; }

/* --- Pinnwand --- */
.wall { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.note { padding: 1.2rem 1.3rem; border-left: 4px solid var(--yellow); }
.note .message-text { margin: 0 0 0.6rem; white-space: pre-wrap; }

/* --- Aktionen --- */
.owner-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.owner-actions button {
  font: inherit; font-size: 0.8rem; padding: 0.3rem 0.8rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; cursor: pointer; color: var(--ink);
}
.owner-actions .btn-delete { color: var(--danger); border-color: #e7c9c5; }
.owner-actions button:hover { border-color: var(--lilac); }

/* --- Einladung --- */
.einladung-wrap { text-align: center; }
.einladung-wrap img {
  max-width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line);
}
.event-facts {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: center; margin: 1.5rem 0;
}
.event-facts .fact {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.4rem; box-shadow: var(--shadow); min-width: 180px;
}
.event-facts .fact .big { font-family: var(--script); font-size: 1.8rem; color: var(--purple-dark); }

/* --- Login / Fehler --- */
.login-page {
  display: flex; align-items: center; justify-content: center; min-height: 100vh;
  background: linear-gradient(135deg, #e7ddf6 0%, #f4eefb 45%, #fbf4ce 100%);
  padding: 1.5rem;
}
.login-card {
  background: var(--card); padding: 2.6rem 2.2rem; border-radius: 22px;
  box-shadow: var(--shadow); text-align: center; width: min(400px, 94vw);
  border-top: 5px solid var(--lilac);
}
.login-card .rings { font-size: 2rem; }
.login-card h1 { font-family: var(--script); font-size: 3.2rem; margin: 0.2rem 0 0.1rem; color: var(--purple-dark); line-height: 1; }
.login-card .date { color: var(--purple); letter-spacing: 3px; font-size: 0.9rem; margin: 0.2rem 0 0.4rem; }
.login-card .subtitle { color: var(--muted); margin: 0 0 1.6rem; font-style: italic; }
.login-card form { display: flex; flex-direction: column; gap: 0.8rem; text-align: left; }
.login-card label { font-size: 0.85rem; color: var(--muted); }
.login-card button { margin-top: 0.4rem; }
.error { background: #fbeae8; color: var(--danger); padding: 0.6rem 0.8rem; border-radius: 10px; font-size: 0.9rem; }

/* --- Footer --- */
.site-footer { text-align: center; color: var(--muted); padding: 2.5rem 1rem; font-size: 0.9rem; }
.site-footer .names { font-family: var(--script); font-size: 1.5rem; color: var(--lilac); display: block; }

/* --- Topbar: Begruessung --- */
.who { color: var(--muted); font-size: 0.85rem; padding: 0 0.4rem; }

/* --- Login/RSVP Ergaenzungen --- */
.login-card.wide { width: min(460px, 94vw); }
.eyebrow { margin: 0; letter-spacing: 4px; text-transform: uppercase; font-size: 0.72rem; color: var(--purple); }
.login-hint { color: var(--muted); font-size: 0.82rem; margin: 1rem 0 0; }
.login-card .date { color: var(--purple); letter-spacing: 2px; font-size: 0.9rem; margin: 0.2rem 0 0.6rem; }
.rsvp-buttons { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; }
.rsvp-yes { background: var(--purple); color: #fff; border: none; padding: 0.8rem; border-radius: 999px; font: inherit; font-size: 1.05rem; cursor: pointer; }
.rsvp-yes:hover { background: var(--purple-dark); }
.rsvp-no { background: #fff; color: var(--muted); border: 1px solid var(--line); padding: 0.7rem; border-radius: 999px; font: inherit; cursor: pointer; }
.rsvp-no:hover { border-color: var(--muted); color: var(--ink); }
.code-box { background: var(--lilac-soft); border-radius: var(--radius); padding: 1rem; margin: 1.2rem 0 0.4rem; }
.code-label { display: block; font-size: 0.8rem; color: var(--purple); letter-spacing: 1px; text-transform: uppercase; }
.code-value { font-size: 2.6rem; font-weight: 600; letter-spacing: 0.5rem; color: var(--purple-dark); }

/* --- Direktaufnahme / Upload-Buttons (mobil-freundlich) --- */
.capture-row { display: flex; gap: 0.8rem; margin-bottom: 1.1rem; }
.big-btn {
  flex: 1; text-align: center; cursor: pointer; border-radius: 14px; padding: 1.1rem 0.6rem;
  font-size: 1.05rem; font-weight: 400; border: 1px solid var(--line); user-select: none;
}
.big-btn.camera { background: var(--purple); color: #fff; border-color: var(--purple); }
.big-btn.choose { background: #fff; color: var(--ink); }
.big-btn:active { transform: scale(0.98); }
.upload-card.uploading { opacity: 0.6; pointer-events: none; }

/* --- Admin --- */
.stats { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.2rem 0 1.8rem; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1.1rem; min-width: 95px; text-align: center; box-shadow: var(--shadow); font-size: 0.8rem; color: var(--muted); }
.stat .num { display: block; font-size: 1.6rem; font-weight: 600; color: var(--purple-dark); }
.admin-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.3rem 1.4rem; margin-bottom: 1.6rem; }
.admin-card h2 { margin-top: 0; }
.inline-form { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.inline-form input[type=number] { width: 90px; }
.btn-secondary { margin-top: 0.9rem; background: var(--lilac); color: #fff; border: none; padding: 0.6rem 1.2rem; border-radius: 999px; font: inherit; cursor: pointer; }
.btn-secondary:hover { background: var(--purple); }
.link-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; padding: 0.6rem 0; border-bottom: 1px solid var(--line); }
.link-status { min-width: 150px; font-size: 0.9rem; }
.link-field { flex: 1; min-width: 180px; font-size: 0.8rem; color: var(--muted); }
.btn-copy { background: var(--purple); color: #fff; border: none; padding: 0.45rem 0.9rem; border-radius: 999px; font: inherit; font-size: 0.85rem; cursor: pointer; }
.btn-copy:hover { background: var(--purple-dark); }
.btn-mini-del { background: none; border: 1px solid #e7c9c5; color: var(--danger); border-radius: 999px; padding: 0.35rem 0.7rem; font: inherit; font-size: 0.8rem; cursor: pointer; }
.badge { display: inline-block; padding: 0.1rem 0.55rem; border-radius: 999px; font-size: 0.75rem; color: #fff; }
.badge.ok { background: #5a9b6b; }
.badge.no { background: #b3534b; }
.badge.open { background: var(--lilac); }
.guest-table { width: 100%; border-collapse: collapse; }
.guest-table td { padding: 0.5rem 0.4rem; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.g-code { font-weight: 600; letter-spacing: 2px; color: var(--purple-dark); }

/* --- Kommentar-Link in der Galerie --- */
.comments-link { display: inline-block; margin-top: 0.4rem; font-size: 0.82rem; text-decoration: none; color: var(--purple); }
.comments-link:hover { text-decoration: underline; }

/* --- Detailseite --- */
.back-link { text-decoration: none; color: var(--muted); }
.detail { overflow: hidden; }
.detail-media { background: #000; text-align: center; }
.detail-media img, .detail-media video { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; }
.detail-info { padding: 1rem 1.3rem; }
.caption-text.big { font-size: 1.1rem; margin: 0 0 0.4rem; }

/* --- Kommentare --- */
.comments { margin-top: 1.8rem; }
.comment { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.8rem 1rem; margin-bottom: 0.8rem; box-shadow: var(--shadow); }
.comment-head { display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem; }
.comment-head .author { color: var(--purple); font-weight: 600; }
.comment-head .meta { color: var(--muted); }
.btn-del-comment { margin-left: auto; background: none; border: 1px solid #e7c9c5; color: var(--danger); border-radius: 999px; width: 26px; height: 26px; cursor: pointer; line-height: 1; }
.comment-text { margin: 0.5rem 0 0; white-space: pre-wrap; }
.comment audio { width: 100%; margin-top: 0.6rem; }
.comment-form { display: flex; gap: 0.6rem; margin: 1rem 0 0.8rem; align-items: flex-start; }
.comment-form textarea { flex: 1; }
.voice-recorder { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; }
.rec-btn { background: var(--lilac); color: #fff; border: none; padding: 0.6rem 1.1rem; border-radius: 999px; font: inherit; cursor: pointer; }
.rec-btn:hover { background: var(--purple); }
.rec-btn.recording { background: var(--danger); animation: pulse 1.2s infinite; }
.rec-status { color: var(--muted); font-size: 0.85rem; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.6; } }

@media (max-width: 540px) {
  .grid2 { grid-template-columns: 1fr; }
  .hero h1 { font-size: 2.2rem; }
  .login-card h1 { font-size: 2.6rem; }
  .comment-form { flex-direction: column; }
  .comment-form button { width: 100%; }
  .topbar { padding: 0.7rem 1rem; }
  .topbar nav { gap: 0.15rem; font-size: 0.9rem; }
  .who { display: none; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0.7rem; }
  .big-btn { padding: 1.3rem 0.5rem; font-size: 1.1rem; }
}
