:root {
  --cream: #faf6f0;
  --cream-2: #f3ece2;
  --ink: #3a352f;
  --ink-soft: #6f675d;
  --sage: #8a9a7b;
  --sage-dark: #6f7f61;
  --gold: #b89b5e;
  --line: #e6ddd0;
  --card: #ffffff;
  --danger: #c05a4d;
  --shadow: 0 6px 24px rgba(90, 74, 52, 0.10);
  --radius: 16px;
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

/* --- Fixierter, dezent verschwommener Hintergrund ---
   position:fixed statt background-attachment:fixed -> bleibt auch auf
   Handys (iOS/Android) beim Scrollen sauber stehen.
   Foto austauschbar unter: public/img/background.jpg */
body { background: transparent; }
body::before {
  content: "";
  position: fixed;
  inset: -40px;                 /* Ueberstand, damit die weichen Blur-Raender ausserhalb liegen */
  z-index: -2;
  background: url("../img/background.jpg") center center / cover no-repeat;
  filter: blur(3px) saturate(1.03);
  transform: scale(1.06);
}
body::after {                    /* heller Schleier fuer Lesbarkeit */
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(250, 246, 240, 0.50), rgba(250, 246, 240, 0.70));
}

body {
  min-height: 100dvh;
  padding-bottom: 78px; /* Platz fuer Bottom-Nav */
}

.app {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 18px;
}

/* --- Kopf --- */
.hero {
  text-align: center;
  padding: 34px 18px 10px;
  /* weicher heller Lichtschleier hinter dem Kopf -> Text bleibt auf jedem Foto lesbar */
  background: radial-gradient(115% 75% at 50% 32%, rgba(250, 246, 240, 0.82), rgba(250, 246, 240, 0) 72%);
}
.hero .eyebrow {
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 12px;
  color: #9c7f3f;
  margin: 0 0 8px;
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.9);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(38px, 12vw, 60px);
  line-height: 1.02;
  margin: 0;
  color: var(--ink);
  text-shadow: 0 1px 14px rgba(255, 255, 255, 0.9);
}
.hero .date {
  margin-top: 12px;
  font-family: var(--serif);
  font-size: 20px;
  color: var(--ink);
  text-shadow: 0 1px 10px rgba(255, 255, 255, 0.9);
}
.hero .rule {
  width: 54px;
  height: 1px;
  background: var(--gold);
  margin: 18px auto;
  opacity: 0.6;
}

.page-title {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  margin: 26px 2px 4px;
}
.page-sub {
  color: var(--ink-soft);
  margin: 0 2px 20px;
  font-size: 15px;
}

/* --- Karten --- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 15px 18px;
  border: none;
  border-radius: 12px;
  background: var(--sage);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease;
  text-decoration: none;
}
.btn:active { transform: scale(0.985); }
.btn:hover { background: var(--sage-dark); }
.btn.secondary {
  background: transparent;
  color: var(--sage-dark);
  border: 1.5px solid var(--sage);
}
.btn.secondary:hover { background: rgba(138, 154, 123, 0.08); }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: #a98c50; }
.btn.danger { background: var(--danger); }
.btn.small { width: auto; padding: 9px 14px; font-size: 14px; border-radius: 10px; }
.btn:disabled { opacity: 0.55; cursor: default; }

/* --- Formulare --- */
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 6px; color: var(--ink-soft); }
input[type=text], input[type=date], input[type=password], input[type=url], textarea, select {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--sage);
}
textarea { resize: vertical; min-height: 90px; }
.field { margin-bottom: 16px; }

/* --- Grosse Upload-Flaeche --- */
.dropzone {
  border: 2px dashed var(--sage);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, var(--cream-2));
  text-align: center;
  padding: 38px 20px;
  cursor: pointer;
}
.dropzone .ico { font-size: 46px; }
.dropzone h3 { font-family: var(--serif); font-size: 24px; margin: 12px 0 4px; }
.dropzone p { color: var(--ink-soft); margin: 0; font-size: 14px; }

/* --- Galerie --- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.tile {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--cream-2);
  cursor: pointer;
}
.tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(58, 53, 47, 0.28);
  color: #fff;
  font-size: 30px;
}
.tile .badge {
  position: absolute; top: 6px; left: 6px;
  background: rgba(0,0,0,0.55); color:#fff;
  font-size: 10px; padding: 2px 7px; border-radius: 20px;
}
.tile .like {
  position: absolute; bottom: 6px; right: 6px;
  display: flex; align-items: center; gap: 4px;
  background: rgba(0,0,0,0.5); color: #fff; border: none;
  padding: 4px 9px; border-radius: 20px; font-size: 13px; font-weight: 700;
  cursor: pointer; width: auto; backdrop-filter: blur(4px);
}
.tile .like .h { color: rgba(255,255,255,0.85); transition: transform 0.15s; }
.tile .like.liked .h { color: #ff6b81; }
.tile .like.liked { background: rgba(255,107,129,0.28); }
.tile .like:active .h { transform: scale(1.35); }

.empty {
  text-align: center;
  color: var(--ink-soft);
  padding: 40px 20px;
}
.empty .ico { font-size: 40px; }

/* --- Lightbox --- */
.lightbox {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(28, 24, 20, 0.94);
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
}
.lightbox.open { display: flex; }
.lightbox img, .lightbox video { max-width: 100%; max-height: 86dvh; border-radius: 8px; }
.lightbox .close {
  position: absolute; top: 14px; right: 16px;
  color: #fff; font-size: 34px; background: none; border: none; cursor: pointer;
  width: auto; padding: 4px 10px;
}

/* --- Gaestebuch --- */
.entry {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.entry .msg { font-family: var(--serif); font-size: 19px; line-height: 1.4; color: var(--ink); white-space: pre-wrap; }
.entry .meta { margin-top: 8px; font-size: 13px; color: var(--gold); font-weight: 600; }

/* --- Bottom-Navigation --- */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  display: flex;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.tabbar a {
  flex: 1;
  text-align: center;
  padding: 10px 4px 12px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 600;
}
.tabbar a .ti { display: block; font-size: 22px; line-height: 1.2; }
.tabbar a.active { color: var(--sage-dark); }

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 92px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff;
  padding: 12px 20px; border-radius: 24px;
  font-size: 14px; z-index: 80;
  opacity: 0; transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--danger); }

/* --- Fortschritt --- */
.progress { height: 8px; background: var(--cream-2); border-radius: 20px; overflow: hidden; margin-top: 14px; display: none; }
.progress.show { display: block; }
.progress > div { height: 100%; width: 0; background: var(--sage); transition: width 0.2s; }

/* --- In-App-Kamera --- */
.cam { position: fixed; inset: 0; z-index: 70; background: #000; display: none; flex-direction: column; }
.cam.open { display: flex; }
.cam video, .cam canvas { flex: 1; width: 100%; min-height: 0; object-fit: cover; background: #000; }
.cam .top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: flex-end; padding: 14px; padding-top: calc(14px + env(safe-area-inset-top)); }
.cam .close { background: rgba(0,0,0,0.45); color: #fff; border: none; font-size: 26px; width: 44px; height: 44px; border-radius: 50%; cursor: pointer; }
.cam .bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 26px; padding-bottom: calc(18px + env(safe-area-inset-bottom)); background: #000; }
.cam .bar .side { width: 54px; display: flex; justify-content: center; flex: 0 0 auto; }
.cam .cambtn { background: rgba(255,255,255,0.16); color: #fff; border: none; width: 54px; height: 54px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.cam .shutter { width: 72px; height: 72px; border-radius: 50%; background: #fff; border: 5px solid rgba(255,255,255,0.45); cursor: pointer; flex: 0 0 auto; }
.cam .shutter:active { transform: scale(0.94); }
.cam .send { background: var(--sage); color: #fff; border: none; padding: 15px 26px; border-radius: 30px; font-size: 17px; font-weight: 700; cursor: pointer; }
.cam .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
/* Namens-/Datums-Einblendung (Live-Vorschau) — wird beim Auslösen ins Bild eingebrannt */
.cam-brand { position: absolute; left: 0; right: 0; bottom: 118px; text-align: center; pointer-events: none; padding: 0 20px; z-index: 2; text-shadow: 0 2px 12px rgba(0,0,0,0.65); }
.cam-brand .cb-line { width: 46px; height: 2px; background: rgba(242,230,201,0.9); margin: 0 auto 10px; }
.cam-brand .cb-names { font-family: var(--serif); font-size: 30px; font-weight: 600; color: #fff; line-height: 1.1; }
.cam-brand .cb-date { font-family: var(--serif); font-size: 16px; color: #f2e6c9; letter-spacing: 0.14em; margin-top: 4px; }
/* Zierrahmen (Live-Vorschau) — im Bild wird er beim Ausloesen eingebrannt */
.cam-frame { position: absolute; inset: 5%; border: 1.5px solid rgba(255,255,255,0.92); pointer-events: none; z-index: 1; }
.cam-frame::after { content: ''; position: absolute; inset: 9px; border: 1px solid rgba(255,255,255,0.6); }
/* Zoom-Regler */
.cam-zoom { position: absolute; left: 50%; transform: translateX(-50%); bottom: 104px; width: 62%; max-width: 320px; z-index: 3; accent-color: #fff; }
.cam .flash.go { animation: flash 0.28s ease; }
@keyframes flash { 0% { opacity: 0.85; } 100% { opacity: 0; } }

/* --- Easter Egg --- */
.egg-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  background: rgba(28, 24, 20, 0.92);
  opacity: 0; transition: opacity 0.35s ease;
  padding: 24px; overflow: hidden; cursor: pointer;
}
.egg-overlay.show { opacity: 1; }
.egg-img {
  max-width: 92%; max-height: 82dvh; border-radius: 12px;
  box-shadow: 0 14px 55px rgba(0,0,0,0.55);
  transform: scale(0.8); transition: transform 0.45s cubic-bezier(.2,.9,.3,1.35);
}
.egg-overlay.show .egg-img { transform: scale(1); }
.egg-close {
  position: absolute; top: calc(16px + env(safe-area-inset-top, 0)); right: 18px;
  width: 48px; height: 48px; border-radius: 50%;
  background: rgba(255,255,255,0.16); color: #fff; border: none;
  font-size: 28px; line-height: 1; cursor: pointer; z-index: 3;
  backdrop-filter: blur(4px); display: flex; align-items: center; justify-content: center;
}
.egg-close:active { transform: scale(0.92); }
.egg-heart {
  position: absolute; bottom: -34px; color: #ff6b81;
  pointer-events: none; animation: eggrise 3s ease-in forwards;
  text-shadow: 0 2px 8px rgba(0,0,0,0.35);
}
@keyframes eggrise {
  from { transform: translateY(0) rotate(0); opacity: 1; }
  to { transform: translateY(-112dvh) rotate(45deg); opacity: 0; }
}

.muted { color: var(--ink-soft); font-size: 14px; }
.center { text-align: center; }
.spacer { height: 8px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; }
hr.soft { border: none; border-top: 1px solid var(--line); margin: 18px 0; }
