/* ============================================================
   Lavendel-Design.  Farben oben anpassbar.
   ============================================================ */
:root {
    --bg:        #faf5ee;   /* Hintergrund bleibt warm/creme */
    --karte:     #ffffff;
    --ink:       #3c3147;
    --muted:     #9a8fa6;
    --lav:       #d7b5ff;   /* Pastell-Lavendel (Basis) */
    --lav-soft:  #efe2ff;   /* helle Abstufung */
    --lav-line:  #e7d8f7;
    --lav-deep:  #9d6fd6;   /* Knöpfe / aktive Elemente */
    --lav-deeper:#6f44ad;   /* Überschriften / Akzenttext */
    --heart:     #db5a9d;   /* Like-Herz */
    --schatten:  0 10px 30px rgba(110, 68, 173, 0.12);
    --schatten-s:0 4px 14px rgba(110, 68, 173, 0.10);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: 'Mulish', system-ui, sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 15% -5%, rgba(215,181,255,0.22), transparent 42%),
        radial-gradient(circle at 100% 110%, rgba(215,181,255,0.18), transparent 45%);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}
.huelle { max-width: 1080px; margin: 0 auto; padding: 18px 16px 64px; }

/* ---------- Kopf (kompakt) ---------- */
.kopf { text-align: center; margin: 10px 0 16px; }
.logo {
    font-family: 'Cormorant Garamond', serif; font-weight: 600;
    font-size: clamp(2rem, 6vw, 3rem); margin: 0; line-height: 1.05; color: var(--ink);
}
.untertitel {
    font-family: 'Cormorant Garamond', serif; font-style: italic;
    font-size: 1.1rem; color: var(--lav-deeper); margin: 4px 0 0;
}

/* ---------- Karten / Formulare ---------- */
.karte {
    background: var(--karte); max-width: 440px; margin: 0 auto;
    padding: 30px 26px; border-radius: 20px; box-shadow: var(--schatten);
    border: 1px solid var(--lav-line);
}
.karte h2 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.8rem; margin: 0 0 6px; text-align: center; }
.hinweis { color: var(--muted); text-align: center; margin: 0 0 20px; font-size: 0.95rem; }
.formular { display: flex; flex-direction: column; gap: 8px; }
.formular label { font-weight: 600; font-size: 0.86rem; margin-top: 8px; }
.formular input {
    font-family: inherit; font-size: 1.05rem; padding: 13px 15px;
    border: 1px solid var(--lav-line); border-radius: 12px; background: #fdfbff; color: var(--ink);
}
.formular input:focus { outline: none; border-color: var(--lav-deep); box-shadow: 0 0 0 3px rgba(157,111,214,0.18); }

/* ---------- Knöpfe ---------- */
.knopf {
    display: inline-block; text-align: center; font-family: inherit;
    font-size: 1rem; font-weight: 700; color: #fff; background: var(--lav-deep);
    border: none; padding: 14px 24px; border-radius: 12px; cursor: pointer;
    text-decoration: none; transition: transform .15s, background .2s; box-shadow: var(--schatten-s);
}
.knopf:hover { background: var(--lav-deeper); transform: translateY(-2px); }
.knopf-rand { color: var(--lav-deeper); background: var(--lav-soft); box-shadow: none; }
.knopf-rand:hover { background: #e4d2fb; }

/* ---------- Meldungen ---------- */
.meldung { max-width: 560px; margin: 0 auto 18px; padding: 13px 18px; border-radius: 12px; text-align: center; font-size: 0.95rem; }
.meldung.ok     { background: var(--lav-soft); color: var(--lav-deeper); border: 1px solid var(--lav-line); }
.meldung.fehler { background: #fbecea; color: #9a4b3f; border: 1px solid #f0d2cc; }

/* ---------- Reiter ---------- */
.reiter { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 20px; }
.reiter a {
    text-decoration: none; font-weight: 600; font-size: 0.92rem; color: var(--lav-deeper);
    background: var(--karte); border: 1px solid var(--lav-line); padding: 8px 16px;
    border-radius: 999px; transition: all .15s;
}
.reiter a:hover { background: var(--lav-soft); }
.reiter a.aktiv { background: var(--lav-deep); color: #fff; border-color: var(--lav-deep); box-shadow: var(--schatten-s); }

/* ---------- Upload-Block ---------- */
.upload-block { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.hochladen-knopf {
    font-family: inherit; font-size: 1.05rem; font-weight: 700; color: #fff;
    background: var(--lav-deep); border: none; padding: 14px 28px; border-radius: 14px;
    cursor: pointer; box-shadow: var(--schatten); transition: transform .15s, background .2s;
}
.hochladen-knopf:hover { background: var(--lav-deeper); transform: translateY(-2px); }
.upload-kat { color: var(--muted); font-size: 0.9rem; }
.versteckt { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }

/* ---------- Abschnittstitel ---------- */
.abschnitt {
    font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.5rem;
    text-align: center; margin: 26px 0 14px; color: var(--ink);
}
.leer { text-align: center; color: var(--muted); padding: 30px 16px; font-size: 1.05rem; }

/* ---------- Kacheln (gemeinsam) ---------- */
.kachel { position: relative; margin: 0; border-radius: 14px; overflow: hidden; background: var(--karte); box-shadow: var(--schatten-s); }
.kachel img { display: block; width: 100%; image-orientation: from-image; cursor: zoom-in; }
.kachel.q { aspect-ratio: 1 / 1; }
.kachel.q img { width: 100%; height: 100%; object-fit: cover; }
.heic { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 120px; background: var(--lav-soft); text-decoration: none; }
.heic span { font-size: 2rem; }

/* Namensflagge unten links */
.namensflag {
    position: absolute; left: 8px; bottom: 8px; max-width: 70%;
    background: rgba(111,68,173,0.82); color: #fff; font-size: 0.75rem; font-weight: 600;
    padding: 4px 10px; border-radius: 999px; backdrop-filter: blur(2px);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Like-Knopf unten rechts */
.like {
    position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,0.9); border: none; border-radius: 999px; padding: 5px 9px;
    cursor: pointer; font-family: inherit; font-size: 0.78rem; font-weight: 700; color: var(--muted);
    box-shadow: 0 2px 6px rgba(0,0,0,0.12); transition: transform .1s;
}
.like:hover { transform: scale(1.06); }
.like:active { transform: scale(0.94); }
.like svg { width: 15px; height: 15px; fill: none; stroke: var(--muted); stroke-width: 2; }
.like.aktiv { color: var(--heart); }
.like.aktiv svg { fill: var(--heart); stroke: var(--heart); }

/* ---------- Raster (Kategorie, quadratisch) ---------- */
.raster { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 6px; }
.highlights .kachel { box-shadow: var(--schatten); border: 2px solid var(--lav); }

/* ---------- Kollage (Gesamt, frei/masonry) ---------- */
.kollage { columns: 4 200px; column-gap: 12px; }
.kollage .kachel { break-inside: avoid; margin-bottom: 12px; }

/* ---------- Auswahl-Dialog ---------- */
.wahl { position: fixed; inset: 0; background: rgba(60,49,71,0.5); display: none; align-items: flex-end; justify-content: center; z-index: 200; }
.wahl.offen { display: flex; }
.wahl-box { background: var(--karte); width: 100%; max-width: 460px; border-radius: 20px 20px 0 0; padding: 24px 22px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; box-shadow: 0 -10px 40px rgba(0,0,0,0.2); }
.wahl-box h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.5rem; text-align: center; margin: 0 0 6px; }
.abbrechen { background: none; border: none; color: var(--muted); font-family: inherit; font-size: 0.95rem; padding: 8px; cursor: pointer; }
@media (min-width: 560px) { .wahl { align-items: center; } .wahl-box { border-radius: 20px; } }

/* ---------- Lade-Overlay ---------- */
.lade-overlay { position: fixed; inset: 0; background: rgba(250,245,238,0.85); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 14px; z-index: 300; color: var(--lav-deeper); }
.lade-overlay.offen { display: flex; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--lav-soft); border-top-color: var(--lav-deep); border-radius: 50%; animation: dreh 0.9s linear infinite; }
@keyframes dreh { to { transform: rotate(360deg); } }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(45,35,55,0.93); display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px; z-index: 400; padding: 24px; }
.lightbox.offen { display: flex; }
.lightbox img { max-width: 92vw; max-height: 82vh; border-radius: 10px; image-orientation: from-image; }
.lightbox p { color: #f3ecff; font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.3rem; margin: 0; }
.lightbox-zu { position: absolute; top: 16px; right: 22px; background: none; border: none; color: #fff; font-size: 2.4rem; cursor: pointer; }

/* ---------- Verwaltung ---------- */
.admin-leiste { text-align: center; color: var(--muted); background: var(--karte); border: 1px solid var(--lav-line); border-radius: 12px; padding: 12px; margin-bottom: 20px; }
.admin-leiste a { color: var(--lav-deeper); }
.admin-aktionen { position: absolute; top: 8px; right: 8px; left: 8px; display: flex; gap: 6px; justify-content: flex-end; }
.mini { font-family: inherit; font-size: 0.8rem; font-weight: 700; padding: 7px 10px; border-radius: 9px; border: none; background: rgba(255,255,255,0.92); color: var(--ink); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.mini.gut { background: var(--lav-deep); color: #fff; }
.mini.schlecht { background: #f6dcd6; color: #9a4b3f; }
.admin-leiste .mini { box-shadow: none; }

/* ---------- QR-Seite ---------- */
.qr-bereich { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.qr-karte { background: var(--karte); border: 1px solid var(--lav-line); border-radius: 18px; padding: 22px; text-align: center; box-shadow: var(--schatten-s); }
.qr-karte h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.6rem; margin: 0 0 14px; color: var(--lav-deeper); }
.qr-bild { display: flex; justify-content: center; }
.qr-bild img, .qr-bild canvas { border-radius: 10px; }
.qr-url { font-size: 0.7rem; color: var(--muted); word-break: break-all; margin: 12px 0 0; }

/* ---------- Fuß ---------- */
.fuss { text-align: center; margin-top: 50px; color: var(--muted); font-family: 'Cormorant Garamond', serif; }
.fuss .flourish { color: var(--lav); font-size: 1.4rem; display: block; }
.fuss p { font-style: italic; font-size: 1.15rem; margin: 4px 0 0; }

/* ---------- Handy ---------- */
@media (max-width: 560px) {
    .huelle { padding-left: 10px; padding-right: 10px; }
    .raster, .highlights { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .kollage { columns: 2 140px; column-gap: 10px; }
    .karte { padding: 26px 20px; }
}

/* ---------- Druck (für QR-Codes) ---------- */
@media print {
    body { background: #fff; }
    .reiter, .admin-leiste, .fuss, .untertitel { display: none; }
    .qr-karte { break-inside: avoid; border: 1px solid #ccc; box-shadow: none; }
}

/* ---------- Kopf-Banner mit floralen Ranken ---------- */
.kopf-banner { display: flex; align-items: center; justify-content: center; gap: 0; margin-bottom: 6px; flex-wrap: nowrap; }
.sprig { flex: 0 0 auto; line-height: 0; }
.sprig svg { width: clamp(72px, 17vw, 150px); height: auto; display: block; }
.sprig.links { transform: scaleX(-1); }
.deko { flex: 0 1 auto; line-height: 0; min-width: 0; }
.deko img { width: clamp(90px, 24vw, 380px); max-width: 100%; height: auto; display: block; }

/* ---------- Rundes Paar-Bild im Kopf ---------- */
.paar-bild {
    flex: 0 0 auto; position: relative; z-index: 2;
    width: clamp(96px, 26vw, 140px); aspect-ratio: 1/1; margin: 0 -12px;
    border-radius: 50%; overflow: hidden; border: 4px solid #fff; box-shadow: var(--schatten);
}
.paar-bild img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 560px) { .kopf-banner { gap: 0; } }

/* ---------- Runde Kategorie-Navigation ---------- */
.kat-nav { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin: 6px 0 22px; }
.kat-kreis-link { text-decoration: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; }
.kat-kreis {
    width: 64px; height: 64px; border-radius: 50%; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: #fff; border: 1px solid var(--lav-line); box-shadow: var(--schatten-s); transition: all .15s;
}
.kat-kreis img { width: 100%; height: 100%; object-fit: cover; }
.kat-kreis.platzhalter { background: var(--lav-soft); color: var(--lav-deeper); font-family: 'Cormorant Garamond', serif; font-size: 1.8rem; font-weight: 600; }
.kat-kreis.platzhalter svg { width: 26px; height: 26px; fill: var(--lav-deep); }
.kat-kreis-link.aktiv .kat-kreis { border: 3px solid var(--lav-deep); box-shadow: 0 0 0 3px var(--lav-soft); }
.kat-label { font-size: 0.82rem; font-weight: 600; color: var(--ink); text-align: center; }
.kat-kreis-link.aktiv .kat-label { color: var(--lav-deeper); }

/* ---------- Upload als erste Kachel ---------- */
.kachel.upload {
    aspect-ratio: 1/1; border: 2px dashed var(--lav-deep); background: var(--lav-soft);
    color: var(--lav-deeper); display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; cursor: pointer; font-family: inherit; box-shadow: none;
}
.kachel.upload:hover { background: #e6d6fb; }
.kachel.upload .plus { font-size: 2.4rem; line-height: 1; font-weight: 300; }
.kachel.upload .upload-text { font-size: 0.85rem; font-weight: 700; }

/* ---------- "Ohne Namen"-Textknopf ---------- */
.textknopf { background: none; border: none; color: var(--muted); font-family: inherit; font-size: 0.9rem; padding: 6px; margin-top: 2px; cursor: pointer; text-decoration: underline; }
.textknopf:hover { color: var(--lav-deeper); }

/* ---------- Lightbox-Pfeile ---------- */
.lb-pfeil {
    position: absolute; top: 50%; transform: translateY(-50%);
    background: rgba(255,255,255,0.16); border: none; color: #fff; font-size: 2.4rem; line-height: 1;
    width: 48px; height: 48px; border-radius: 50%; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.lb-pfeil:hover { background: rgba(255,255,255,0.28); }
.lb-pfeil.prev { left: 14px; }
.lb-pfeil.next { right: 14px; }
@media (max-width: 560px) { .lb-pfeil { width: 40px; height: 40px; font-size: 2rem; } }

/* ---------- Ansicht-Umschalter (Gesamt) ---------- */
.ansicht-schalter { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 2px 0 10px; font-size: 0.9rem; font-weight: 600; color: var(--muted); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.schieber { position: absolute; inset: 0; background: #d9cfe6; border-radius: 999px; transition: .25s; cursor: pointer; }
.schieber::before { content: ""; position: absolute; height: 20px; width: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + .schieber { background: var(--lav-deep); }
.switch input:checked + .schieber::before { transform: translateX(20px); }

/* ---------- Polaroid-Kollage ---------- */
.pol-wand { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0; padding: 30px 14px; transition: opacity 1s ease; min-height: 320px; }
.polaroid { position: relative; background: #fff; padding: 9px 9px 8px; border-radius: 3px; box-shadow: 0 8px 22px rgba(60,49,71,.20); margin: -7px; }
.pol-bild { width: 162px; }
.polaroid.s .pol-bild { width: 132px; }
.polaroid.m .pol-bild { width: 164px; }
.polaroid.l .pol-bild { width: 198px; }
.pol-bild img { width: 100%; height: auto; display: block; image-orientation: from-image; }
.polaroid figcaption { text-align: center; margin-top: 7px; }
.pol-name { display: block; font-family: 'Caveat', cursive; font-size: 1.45rem; color: #5b5165; line-height: 1.05; }
.pol-kat  { display: block; font-family: 'Times New Roman', Times, serif; font-size: 0.78rem; color: #9a8fa6; letter-spacing: .4px; margin-top: 1px; }
.pol-herz { width: 15px; height: 15px; display: inline-block; vertical-align: middle; }
@media (max-width: 560px) {
    .pol-wand { padding: 12px 0; }
    .polaroid { padding: 7px 7px 6px; margin: -6px; }
    .pol-bild { width: 116px; }
    .polaroid.s .pol-bild { width: 96px; }
    .polaroid.m .pol-bild { width: 118px; }
    .polaroid.l .pol-bild { width: 145px; }
    .pol-name { font-size: 1.05rem; }
    .pol-kat  { font-size: 0.66rem; }
    .pol-herz { width: 13px; height: 13px; }
}

/* ---------- Hinweis zur Polaroid-Collage ---------- */
.pol-hinweis { text-align: center; color: var(--muted); font-size: 0.85rem; font-style: italic; margin: 0 auto 10px; max-width: 460px; }
