/* ==========================================================
   Auf eine kuhle Runde! – Design passend zum Fotorahmen
   Holz, Kuhflecken, Hochlandkuh, Sonnenblumen, Herzen
   Alle Dateien liegen auf dem eigenen Server (keine Google-Fonts,
   keine externen Dienste – gut für Datenschutz & Sicherheit).
   ========================================================== */
:root {
  --wall: #ece4d8;
  --wall-2: #e2d7c8;
  --wood: #f8eedd;
  --wood-2: #efdfc4;
  --wood-edge: #c9a57a;
  --ink: #3e2416;
  --ink-soft: #6e4c36;
  --muted: #8a6d58;
  --spot: #7a4a2b;
  --sun: #f2b31c;
  --sun-deep: #d38b0c;
  --leaf: #5d7c35;
  --leaf-dark: #405a22;
  --danger: #a33a28;
  --ok-bg: #e8efd9;
  --ok-ink: #3d5a1f;
  --err-bg: #f8e3dc;
  --err-ink: #8a2f1f;
  --shadow: 0 18px 40px rgba(80, 52, 28, .16), 0 3px 8px rgba(80, 52, 28, .08);
  --script: "Noteworthy", "Marker Felt", "Chalkboard SE", "Bradley Hand", "Segoe Print", "Comic Sans MS", "Comic Neue", cursive;
  --sans: "Avenir Next", "Nunito", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(ellipse at 50% 0%, #f6f0e6 0%, transparent 60%),
    linear-gradient(180deg, var(--wall) 0%, var(--wall-2) 100%);
}
img { max-width: 100%; }
a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }

.script { font-family: var(--script); font-weight: 700; letter-spacing: .01em; }
.eyebrow { margin: 0 0 4px; font-size: .74rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--leaf); }
.fine { margin: 10px 0 0; font-size: .8rem; color: var(--muted); }

/* ---------- Holzplanken-Karte ---------- */
.plank-card {
  position: relative;
  background:
    repeating-linear-gradient(177deg, transparent 0 26px, rgba(150, 105, 55, .07) 26px 27px, transparent 27px 41px, rgba(150, 105, 55, .05) 41px 42px),
    linear-gradient(180deg, var(--wood) 0%, var(--wood-2) 100%);
  border: 1px solid rgba(170, 125, 75, .35);
  border-radius: 24px 30px 20px 28px / 28px 20px 30px 22px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -10px 22px rgba(160, 110, 55, .12);
}
.spotted { overflow: hidden; }
.spotted::before, .spotted::after {
  content: ""; position: absolute; pointer-events: none; opacity: .85;
  background: url("assets/fleck.svg") center / contain no-repeat;
}
.spotted::before { width: 92px; height: 82px; right: -26px; top: -18px; transform: rotate(18deg); }
.spotted::after { width: 70px; height: 70px; left: -30px; bottom: -30px; background-image: url("assets/fleck2.svg"); transform: rotate(-12deg); }

/* ---------- Knöpfe ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 11px 20px;
  border: 0; border-radius: 14px;
  font-weight: 800; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-primary { background: var(--ink); color: #fff7ea; box-shadow: 0 6px 0 #24130a, 0 10px 18px rgba(62, 36, 22, .25); }
.btn-primary:hover { background: #573421; }
.btn-primary:active { box-shadow: 0 3px 0 #24130a; transform: translateY(3px); }
.btn-light { background: #fffaf1; color: var(--ink); border: 2px solid var(--ink); }
.btn-light:hover { background: #fff3d6; }
.btn-ghost { background: transparent; color: var(--ink); min-height: 42px; padding: 8px 14px; border: 2px solid rgba(62, 36, 22, .25); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-danger { background: #fff4f0; color: var(--danger); border: 2px solid rgba(163, 58, 40, .35); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-small { min-height: 40px; padding: 8px 12px; font-size: .85rem; border-radius: 11px; }
.btn-small.btn-primary { box-shadow: 0 4px 0 #24130a; }
.btn-heart { width: 20px; height: 19px; color: var(--sun); }

.pill { display: inline-block; padding: 5px 13px; border-radius: 999px; background: #fff6e2; border: 2px solid var(--ink); font-weight: 800; font-size: .82rem; white-space: nowrap; }
.pill-admin { background: var(--sun); }
.date-pill {
  display: inline-block; margin: 0; padding: 4px 12px; border-radius: 999px;
  background: var(--leaf); color: #fffbea; font-weight: 800; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase;
}

/* ==========================================================
   LOGIN – der Fotorahmen als Begrüßung
   ========================================================== */
.login-page { display: flex; justify-content: center; }
.login-shell { width: min(100%, 560px); padding: 22px 16px 34px; display: flex; flex-direction: column; align-items: center; }

.booth { position: relative; width: min(100%, 520px); container-type: inline-size; animation: swing-in .7s cubic-bezier(.2, .8, .3, 1.2) both; }
.booth-frame { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 26px rgba(80, 52, 28, .25)); position: relative; z-index: 2; pointer-events: none; }
.booth-window {
  position: absolute; z-index: 1;
  left: 15.9%; top: 19%; width: 72.6%; height: 67.2%;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  gap: 2.2cqw; padding: 7cqw 6cqw 0 6cqw; text-align: center;
  background:
    radial-gradient(ellipse at 60% 30%, rgba(255, 251, 242, .95) 0%, rgba(255, 248, 235, .6) 45%, transparent 75%),
    linear-gradient(180deg, #efe6d9, #e4d8c8);
}
.booth-window .date-pill { font-size: clamp(9px, 2.5cqw, 13px); }
.booth-hello { margin: 1cqw 0 0; font-family: var(--script); font-weight: 700; font-size: clamp(22px, 7.6cqw, 42px); line-height: 1.08; color: var(--ink); }
.booth-sub { margin: 0; max-width: 34ch; font-size: clamp(12px, 3.3cqw, 17px); color: var(--ink-soft); font-weight: 600; }

.login-card { width: min(100%, 440px); margin-top: -6px; padding: 24px 24px 22px; z-index: 3; animation: rise .6s .15s ease both; }
.login-card h1 { margin: 0 0 12px; font-size: 1.9rem; line-height: 1.1; text-align: center; }
.login-form { display: grid; gap: 10px; }
.login-form label { font-weight: 800; font-size: .92rem; }
.login-form input, .hash-out {
  width: 100%; min-height: 54px; padding: 14px 16px;
  border: 2px solid rgba(62, 36, 22, .3); border-radius: 14px;
  background: #fffdf8; color: var(--ink); font-size: 1.05rem;
}
.login-form input:focus { border-color: var(--ink); outline: none; box-shadow: 0 0 0 4px rgba(242, 179, 28, .45); }
.pw-row { position: relative; }
.pw-row input { padding-right: 58px; }
.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); cursor: pointer;
  display: grid; place-items: center;
}
.pw-toggle svg { width: 24px; height: 24px; }
.pw-toggle[aria-pressed="true"] { color: var(--leaf); background: rgba(93, 124, 53, .12); }
.login-form .btn { margin-top: 6px; width: 100%; }
.form-error { margin: 0; padding: 10px 12px; border-radius: 12px; background: var(--err-bg); color: var(--err-ink); font-weight: 700; font-size: .9rem; }
.login-card .fine { text-align: center; }
.login-foot { margin-top: 24px; font-family: var(--script); font-size: 1.15rem; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; }
.foot-heart { width: 22px; height: 20px; color: var(--ink); }
.hash-label { display: block; margin: 18px 0 6px; font-weight: 800; }
.hash-out { font-family: ui-monospace, Menlo, monospace; font-size: .85rem; resize: none; margin-bottom: 10px; }

/* ==========================================================
   GALERIE
   ========================================================== */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px max(16px, calc((100% - 1100px) / 2)); padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(248, 238, 221, .88);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); backdrop-filter: blur(10px) saturate(1.2);
  border-bottom: 2px solid rgba(170, 125, 75, .3);
}
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; min-width: 0; }
.brand img { width: 40px; height: auto; flex-shrink: 0; }
.brand span { font-size: 1.35rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.logout-form { margin: 0; }

.content { width: min(100% - 32px, 1100px); margin: 0 auto; }

.hero { padding: 26px 0 8px; }
.sign { margin: 0 auto 6px; max-width: 760px; line-height: 0; animation: swing-in .7s cubic-bezier(.2, .8, .3, 1.2) both; }
.sign img { width: 100%; height: auto; filter: drop-shadow(0 12px 18px rgba(80, 52, 28, .22)); }
.hero-card { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; padding: 26px 30px; margin: 0 auto; max-width: 900px; }
.cow-medal {
  width: 168px; height: 168px; border-radius: 50%; object-fit: cover; display: block;
  border: 6px solid #fffaf0; box-shadow: 0 0 0 4px var(--sun), 0 12px 24px rgba(80, 52, 28, .25);
}
.cow-medal.small { width: 120px; height: 120px; margin: 0 auto 8px; }
.hero-copy { position: relative; z-index: 1; }
.hero-copy h2 { margin: 8px 0 6px; font-size: clamp(1.7rem, 4.4vw, 2.4rem); line-height: 1.1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-copy p:not(.date-pill) { margin: 0; color: var(--ink-soft); font-weight: 600; }
.title-heart { width: 30px; height: 28px; color: var(--danger); flex-shrink: 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }

.notice { margin: 18px 0 0; padding: 13px 16px; border-radius: 14px; font-weight: 700; border: 2px solid transparent; }
.notice-success { background: var(--ok-bg); color: var(--ok-ink); border-color: rgba(93, 124, 53, .35); }
.notice-error { background: var(--err-bg); color: var(--err-ink); border-color: rgba(163, 58, 40, .3); }

/* Upload */
.upload { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px 30px; margin: 22px 0 0; scroll-margin-top: 90px; }
.upload h2, .gallery h2 { margin: 0 0 8px; font-size: clamp(1.7rem, 4vw, 2.2rem); line-height: 1.1; }
.upload-text p { margin: 0 0 10px; color: var(--ink-soft); font-size: .95rem; }
.privacy-note { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem !important; }
.mini-heart { width: 18px; height: 17px; flex-shrink: 0; margin-top: 2px; color: var(--leaf); }
.meter { margin-top: 12px; }
.meter small { font-size: .78rem; color: var(--muted); }
.meter-bar { height: 12px; border-radius: 99px; background: rgba(62, 36, 22, .1); overflow: hidden; border: 1px solid rgba(62, 36, 22, .15); margin-bottom: 4px; }
.meter-fill { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--leaf), var(--sun)); }
.w-0{width:0}.w-5{width:5%}.w-10{width:10%}.w-15{width:15%}.w-20{width:20%}.w-25{width:25%}.w-30{width:30%}.w-35{width:35%}.w-40{width:40%}.w-45{width:45%}.w-50{width:50%}.w-55{width:55%}.w-60{width:60%}.w-65{width:65%}.w-70{width:70%}.w-75{width:75%}.w-80{width:80%}.w-85{width:85%}.w-90{width:90%}.w-95{width:95%}.w-100{width:100%}

.upload-form { display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.upload-form input[type=file] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.drop {
  display: flex; align-items: center; gap: 14px; min-height: 86px; padding: 14px 16px; cursor: pointer;
  background: rgba(255, 252, 245, .85); border: 3px dashed rgba(122, 74, 43, .45); border-radius: 18px;
  transition: border-color .15s, background-color .15s, transform .15s;
}
.drop:hover, .drop.is-over { border-color: var(--sun-deep); background: #fff7df; }
.upload-form input[type=file]:focus-visible + .previews, .upload-form input[type=file]:focus-visible ~ .drop { outline: 3px solid var(--sun); }
.drop img { width: 52px; height: auto; flex-shrink: 0; transition: transform .4s; }
.drop:hover img { transform: rotate(25deg); }
.drop strong, .drop small { display: block; }
.drop strong { font-size: 1.05rem; }
.drop small { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.previews:empty { display: none; }
.previews img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; border: 3px solid #fffaf0; box-shadow: 0 3px 8px rgba(80, 52, 28, .2); }
.upload-form .btn { width: 100%; }
.upload-form .btn[disabled] { opacity: .7; cursor: progress; }
.upload-form .fine { margin: 0; text-align: center; }

/* Galerie */
.gallery { padding: 44px 0 16px; scroll-margin-top: 80px; }
.gallery-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.gallery-head h2 { margin: 0; }
.photo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px; }
.photo-card {
  position: relative; min-width: 0; padding: 10px 10px 12px;
  background:
    repeating-linear-gradient(178deg, transparent 0 18px, rgba(150, 105, 55, .07) 18px 19px),
    linear-gradient(180deg, var(--wood), var(--wood-2));
  border: 1px solid rgba(170, 125, 75, .35);
  border-radius: 16px 20px 14px 18px;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .2s ease;
}
.photo-card::before {
  content: ""; position: absolute; z-index: 2; left: -16px; top: -18px; width: 52px; height: 57px;
  background: url("assets/sonnenblume.webp") center / contain no-repeat; pointer-events: none;
  transform: rotate(-12deg);
}
.tilt-r { transform: rotate(.8deg); }
.tilt-l { transform: rotate(-.8deg); }
.photo-card:hover { transform: rotate(0) translateY(-4px); box-shadow: 0 24px 46px rgba(80, 52, 28, .22); }
.photo-tile { position: relative; z-index: 1; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 9px; background: #e6dccb; box-shadow: inset 0 0 0 2px rgba(62, 36, 22, .12); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.photo-tile:hover img { transform: scale(1.04); }
.photo-actions { position: relative; z-index: 1; display: flex; gap: 8px; margin-top: 10px; }
.photo-actions > * { flex: 1; }
.photo-actions form { margin: 0; display: flex; }
.photo-actions form .btn { flex: 1; }

.empty { text-align: center; padding: 34px 20px; max-width: 560px; margin: 0 auto; }
.empty h3 { margin: 6px 0; font-size: 1.6rem; }
.empty p { margin: 0; color: var(--ink-soft); }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px; flex-wrap: wrap; margin: 30px 0 0; font-weight: 700; color: var(--ink-soft); }

.kind-note { text-align: center; margin: 36px 0 30px; font-size: 1.35rem; color: var(--ink-soft); display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.site-foot { text-align: center; padding: 22px 16px calc(22px + env(safe-area-inset-bottom)); color: var(--muted); font-size: .85rem; border-top: 2px solid rgba(170, 125, 75, .25); background: rgba(248, 238, 221, .6); }

/* ---------- Großansicht ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  background: rgba(40, 24, 14, .88); animation: fade .2s ease both;
}
.lightbox img { max-width: 100%; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); border-radius: 12px; border: 8px solid var(--wood); box-shadow: 0 20px 50px rgba(0, 0, 0, .45); background: var(--wood); }
.lb-bar { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; justify-content: center; }
.lb-bar .btn { min-width: 52px; }
.lb-close { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; }
.no-scroll { overflow: hidden; }

/* ---------- Bewegung ---------- */
@keyframes swing-in { from { opacity: 0; transform: translateY(-14px) rotate(-1.5deg); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 820px) {
  .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
}
@media (max-width: 700px) {
  .hero { padding-top: 18px; }
  .hero-card { grid-template-columns: 1fr; text-align: center; padding: 22px 18px; gap: 14px; }
  .cow-medal { width: 130px; height: 130px; margin: 0 auto; }
  .hero-copy h2 { justify-content: center; }
  .hero-actions { justify-content: center; }
  .hero-actions .btn { flex: 1 1 140px; }
  .upload { grid-template-columns: 1fr; gap: 18px; padding: 22px 18px; }
  .brand span { font-size: 1.15rem; }
  .brand img { width: 34px; }
  .photo-actions { flex-direction: column; }
}
@media (max-width: 420px) {
  .photo-grid { gap: 16px; }
  .photo-card { padding: 7px 7px 9px; }
  .photo-card::before { width: 40px; height: 44px; left: -10px; top: -12px; }
  .tilt-r, .tilt-l { transform: none; }
  .pill-admin { display: none; }
  .login-card { padding: 20px 18px; }
}

/* ---------- Bausteine aus dem bisherigen Aufbau ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.booth-divider { margin: 0; color: var(--sun-deep); letter-spacing: .5em; font-size: clamp(11px, 3cqw, 16px); }
.foot-flower { width: 24px; height: auto; }
.login-foot { font-family: var(--sans); font-size: .85rem; color: var(--muted); }

.welcome { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 28px 32px; max-width: none; }
.welcome-copy { position: relative; z-index: 1; max-width: 680px; }
.welcome h2 { margin: 4px 0 8px; font-size: clamp(1.8rem, 4.6vw, 2.6rem); line-height: 1.1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.welcome p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-weight: 600; }
.welcome .cow-medal { position: relative; z-index: 1; flex-shrink: 0; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 0; }
.action-card { display: flex; align-items: center; gap: 14px; padding: 18px 20px; text-decoration: none; transition: transform .15s ease; }
.action-card:hover { transform: translateY(-3px); }
.action-icon { width: 50px; height: 50px; border-radius: 15px; background: var(--sun); color: var(--ink); display: grid; place-items: center; flex-shrink: 0; box-shadow: inset 0 -3px 0 var(--sun-deep); }
.upload-card .action-icon { background: #dfe8cc; box-shadow: inset 0 -3px 0 #b8c99a; }
.action-icon svg { width: 26px; height: 26px; }
.action-card strong, .action-card small { display: block; }
.action-card strong { font-size: 1.05rem; }
.action-card small { font-size: .82rem; color: var(--muted); }
.action-arrow { margin-left: auto; font-size: 1.4rem; font-weight: 800; color: var(--leaf); }
.upload { max-width: none; }

.photo-open { position: absolute; right: 8px; top: 8px; padding: 4px 9px; background: rgba(255, 250, 240, .92); border-radius: 9px; font-size: .74rem; font-weight: 800; color: var(--ink); }
.photo-stamp { position: absolute; left: 8px; bottom: 8px; padding: 3px 10px; background: rgba(255, 250, 240, .92); border: 2px solid var(--ink); border-radius: 999px; font-family: var(--script); font-weight: 700; font-size: .78rem; color: var(--ink); }
.photo-actions { align-items: center; justify-content: space-between; }
.photo-actions > * { flex: 0 1 auto; }
.moment { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; color: var(--muted); font-weight: 700; }
.moment .mini-heart { margin: 0; color: var(--danger); width: 15px; height: 14px; }
.note-flower { width: 30px; height: auto; }

@media (max-width: 700px) {
  .welcome { flex-direction: column-reverse; text-align: center; padding: 22px 18px; }
  .welcome h2 { justify-content: center; }
  .action-grid { grid-template-columns: 1fr; gap: 10px; }
  .photo-actions { flex-direction: column; align-items: stretch; }
  .photo-actions .btn { width: 100%; }
  .moment { justify-content: center; }
}

@media (max-width: 520px) {
  .photo-actions .moment { display: none; }
  .photo-actions .btn-small { font-size: .8rem; padding: 8px 6px; }
  .dl-long { display: none; }
}

/* ---------- Login: Karte mit Kuh, Sonnenblumen & Flecken ---------- */
.hero-login { width: min(100%, 500px); padding: 34px clamp(22px, 6vw, 48px) 28px; text-align: center; overflow: visible; animation: rise .6s ease both; }
.hero-login.spotted { overflow: hidden; }
.corner-flower { position: absolute; z-index: 2; height: auto; pointer-events: none; filter: drop-shadow(0 4px 6px rgba(80, 52, 28, .2)); }
.cf-top { width: 92px; right: -14px; top: -12px; transform: rotate(14deg); }
.cf-bottom { width: 70px; left: -12px; bottom: -14px; transform: rotate(-18deg); }
.login-cow { width: 150px; height: 150px; margin: 18px auto 8px; }
.login-title { margin: 6px 0 8px; font-size: clamp(2.2rem, 9vw, 3rem); line-height: 1.05; color: var(--ink); }
.login-title em { font-style: normal; color: #b0612b; }
.intro { margin: 0 auto; max-width: 320px; color: var(--ink-soft); font-weight: 600; }
.heart-divider { display: flex; justify-content: center; align-items: center; gap: 10px; margin: 14px 0 18px; color: var(--danger); }
.div-heart { width: 16px; height: 15px; opacity: .7; }
.div-heart.big { width: 24px; height: 22px; opacity: 1; }
.hero-login .login-form { text-align: left; }
.hero-login .fine { text-align: center; }
.hero-login .date-pill { position: relative; z-index: 1; }
.login-shell { justify-content: center; min-height: 100vh; min-height: 100dvh; }

/* Galerie: Willkommen mit Sonnenblume */
.welcome { overflow: hidden; }
.welcome h1 { margin: 4px 0 8px; font-size: clamp(1.8rem, 4.6vw, 2.6rem); line-height: 1.1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cf-welcome { width: 64px; left: -10px; top: -12px; transform: rotate(-14deg); }
@media (max-width: 700px) { .welcome h1 { justify-content: center; } }
.hero-login { padding-bottom: 52px; }
.cf-top { right: auto; left: -14px; transform: rotate(-14deg); }
.cf-bottom { left: auto; right: -10px; bottom: -14px; transform: rotate(16deg); }

/* ==========================================================
   BEWEGUNG – sanft & verspielt (wird bei „Bewegung reduzieren“ abgeschaltet)
   ========================================================== */
/* Sonnenblumen wiegen sich im Wind */
.corner-flower { transform: none; rotate: var(--r, 0deg); transform-origin: 50% 85%; animation: sway 3.8s ease-in-out infinite alternate; }
.cf-top { --r: -14deg; }
.cf-bottom { --r: 16deg; animation-duration: 4.6s; animation-delay: -1.5s; }
.cf-welcome { --r: -14deg; }
@keyframes sway { from { rotate: calc(var(--r, 0deg) - 7deg); } to { rotate: calc(var(--r, 0deg) + 7deg); } }
.photo-card::before { transform: none; rotate: -12deg; transform-origin: 50% 80%; animation: sway-card 4s ease-in-out infinite alternate; }
.photo-card:nth-child(3n+2)::before { animation-delay: -1.3s; }
.photo-card:nth-child(3n)::before { animation-delay: -2.6s; }
@keyframes sway-card { from { rotate: -19deg; } to { rotate: -5deg; } }
.brand img { animation: spin 24s linear infinite; }
@keyframes spin { to { rotate: 360deg; } }
.drop img { animation: sway 3s ease-in-out infinite alternate; --r: 0deg; }

/* Herzen schlagen */
.div-heart { animation: beat 1.6s ease-in-out infinite; }
.div-heart:nth-child(2) { animation-delay: .2s; }
.div-heart:nth-child(3) { animation-delay: .4s; }
.title-heart, .moment .mini-heart { animation: beat 1.8s ease-in-out infinite; transform-origin: center; }
@keyframes beat { 0%, 60%, 100% { scale: 1; } 15% { scale: 1.25; } 30% { scale: .95; } 45% { scale: 1.12; } }

/* Kuh: wippt leise, beim Antippen „Muuh!“ */
.cow-btn { position: relative; display: block; margin: 0 auto; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 50%; -webkit-tap-highlight-color: transparent; }
.cow-btn .cow-medal { animation: bob 3.2s ease-in-out infinite; }
.cow-btn.login-cow { width: auto; height: auto; margin: 18px auto 8px; }
.cow-btn.login-cow .cow-medal { width: 150px; height: 150px; }
.welcome .cow-btn { position: relative; z-index: 1; flex-shrink: 0; margin: 0; }
@keyframes bob { 0%, 100% { translate: 0 0; rotate: 0deg; } 50% { translate: 0 -6px; rotate: 2deg; } }
.cow-btn.is-mooing .cow-medal { animation: wiggle .7s ease-in-out; }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 20% { rotate: -9deg; } 40% { rotate: 8deg; } 60% { rotate: -6deg; } 80% { rotate: 4deg; } }
.moo-bubble {
  position: absolute; left: 78%; top: -6px; z-index: 3; white-space: nowrap;
  padding: 6px 12px; border-radius: 16px 16px 16px 4px; background: #fffaf0; border: 2px solid var(--ink);
  font-family: var(--script); font-weight: 700; font-size: 1.05rem; color: var(--ink);
  box-shadow: 0 6px 14px rgba(80, 52, 28, .2);
  opacity: 0; scale: .5; transform-origin: 0 100%; pointer-events: none; transition: opacity .2s, scale .25s cubic-bezier(.3, 1.6, .5, 1);
}
.cow-btn.is-mooing .moo-bubble { opacity: 1; scale: 1; }
.welcome .moo-bubble { left: auto; right: 70%; border-radius: 16px 16px 4px 16px; transform-origin: 100% 100%; }

/* Kuhflecken schweben im Hintergrund */
.bg-spots { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg-spots span { position: absolute; display: block; width: var(--s, 90px); height: var(--s, 90px); opacity: .06; background: url("assets/fleck.svg") center / contain no-repeat; animation: drift var(--d, 26s) ease-in-out infinite alternate; }
.bg-spots span:nth-child(even) { background-image: url("assets/fleck2.svg"); }
@keyframes drift { from { translate: 0 0; rotate: 0deg; } to { translate: var(--dx, 40px) var(--dy, -60px); rotate: 40deg; } }

/* Fallende Blüten & Herzchen */
.petal-layer { position: fixed; inset: 0; z-index: 60; pointer-events: none; overflow: hidden; }
.petal { position: absolute; top: -40px; width: 14px; height: 24px; border-radius: 50% 50% 50% 50% / 70% 70% 30% 30%; background: linear-gradient(160deg, #ffd34d, var(--sun) 55%, var(--sun-deep)); opacity: .9; animation: fall var(--t, 7s) linear forwards; }
.petal.leaf { background: linear-gradient(160deg, #8fae55, var(--leaf)); width: 12px; height: 20px; }
.petal.heart-p { background: none; width: auto; height: auto; color: var(--danger); font-size: 20px; border-radius: 0; }
@keyframes fall {
  0% { translate: 0 0; rotate: 0deg; }
  25% { translate: var(--sway, 40px) 25vh; }
  50% { translate: calc(var(--sway, 40px) * -1) 55vh; }
  75% { translate: var(--sway, 40px) 80vh; }
  100% { translate: 0 110vh; rotate: var(--spin, 540deg); }
}

/* Karten und Fotos erscheinen beim Scrollen */
.js .reveal { opacity: 0; translate: 0 26px; transition: opacity .6s ease, translate .6s cubic-bezier(.2, .8, .3, 1.1); }
.js .reveal.is-visible { opacity: 1; translate: 0 0; }
.js .reveal-group .action-card { opacity: 0; translate: 0 18px; transition: opacity .5s ease, translate .5s ease, transform .15s ease; }
.js .reveal-group.is-visible .action-card { opacity: 1; translate: 0 0; }
.js .reveal-group.is-visible .action-card:nth-child(2) { transition-delay: .12s; }

/* Kleine Extras */
.action-card:hover .action-arrow, .btn:hover > span[aria-hidden] { animation: nudge .6s ease-in-out infinite alternate; }
@keyframes nudge { to { translate: 5px 0; } }
.upload-card:hover .action-arrow { animation-name: nudge-up; }
@keyframes nudge-up { to { translate: 0 -4px; } }
.action-card:hover .action-icon { animation: hop .5s ease; }
@keyframes hop { 40% { translate: 0 -6px; rotate: -6deg; } }
.hero-login.shake { animation: shake .45s ease; }
@keyframes shake { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }
.notice-success { animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { from { scale: .9; opacity: 0; } }
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 230, 160, .35) 50%, transparent 70%); translate: -120% 0; pointer-events: none; }
.btn-primary:hover::after { translate: 120% 0; transition: translate .7s ease; }

/* Größere Bildschirme (iPad quer, Computer) */
@media (min-width: 1000px) {
  .photo-grid { gap: 30px; }
  .welcome { padding: 36px 44px; }
  .welcome .cow-medal { width: 190px; height: 190px; }
  .hero-login { width: 520px; }
}

@media (prefers-reduced-motion: reduce) {
  .bg-spots, .petal-layer { display: none; }
  .js .reveal, .js .reveal-group .action-card { opacity: 1; translate: none; }
}
.cow-btn .cow-medal.login-cow { margin: 0; }

/* ---------- Fotos auswählen / aufnehmen ---------- */
.file-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
.drop { position: relative; min-height: 96px; border-style: solid; border-color: var(--sun); background: linear-gradient(180deg, #fffbea, #fff3cf); box-shadow: 0 6px 0 var(--sun-deep), 0 12px 20px rgba(80, 52, 28, .15); user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent; }
.drop strong { font-size: 1.2rem; }
.drop:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--sun-deep), 0 6px 12px rgba(80, 52, 28, .15); }
.drop-arrow { margin-left: auto; width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: #fff7ea; font-weight: 900; font-size: 1.3rem; animation: nudge-up .8s ease-in-out infinite alternate; }
.drop:focus-within, .drop:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; }
#photos:focus-visible + .cam-btn, #photos:focus-visible ~ .drop { outline: 3px solid var(--sun); }
.cam-btn { width: 100%; gap: 10px; }
.cam-btn svg { width: 22px; height: 22px; }
.js .no-js-only { display: none; }
.progress { padding: 12px 14px; border-radius: 14px; background: #fffaf0; border: 2px solid rgba(62, 36, 22, .15); }
.progress-bar { height: 14px; border-radius: 99px; background: rgba(62, 36, 22, .1); overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 2%; border-radius: 99px; background: linear-gradient(90deg, var(--leaf), var(--sun)); transition: width .25s ease; background-size: 40px 40px; }
.progress p { margin: 8px 0 0; font-weight: 800; font-size: .9rem; color: var(--ink-soft); text-align: center; }
.upload-form.is-busy .drop, .upload-form.is-busy .cam-btn { opacity: .55; pointer-events: none; }
label.action-card { cursor: pointer; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
label.action-card:active { transform: translateY(2px) scale(.99); }

/* ---------- Auswahl beim Herunterladen ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 70; background: rgba(40, 24, 14, .55); display: flex; align-items: flex-end; justify-content: center; padding: 14px 14px max(14px, env(safe-area-inset-bottom)); animation: fade .2s ease both; }
.sheet { width: min(100%, 440px); padding: 20px 18px 16px; display: grid; gap: 10px; animation: rise .3s cubic-bezier(.2, .8, .3, 1.1) both; }
.sheet-title { margin: 0; text-align: center; font-size: 1.6rem; line-height: 1.1; }
.sheet-status { margin: 0 0 4px; text-align: center; color: var(--ink-soft); font-weight: 700; font-size: .92rem; }
.sheet .btn { width: 100%; }
.sheet .btn[disabled] { opacity: .5; cursor: progress; }
