/* ==========================================================================
   Mariellas Wunschliste
   Visuelle Grundlage: das Aquarell-Wandbild im Kinderzimmer –
   warmes Cremeweiß, Sandgreige, Altrosa, Salbeigrün, viel Luft.
   ========================================================================== */

:root {
  /* Flächen */
  --bg:        #faf5ef;   /* Wandton, warmes Creme */
  --bg-deep:   #f3ebe0;   /* Sandgreige für ruhige Flächen */
  --card:      #fffdfa;
  --border:    #e9dccd;
  --border-soft: #f0e6da;

  /* Schrift */
  --ink:       #463c34;   /* warmes Dunkelbraun statt Schwarz */
  --ink-soft:  #665c53;
  --ink-faint: #6f655c;

  /* Akzente aus dem Bild */
  --rose:      #9b5265;   /* Koralle / Seestern, dunkel genug für Text */
  --rose-mid:  #c98a99;
  --rose-soft: #f7e8ea;
  --sage:      #5f6a48;   /* Seegras */
  --sage-soft: #edf0e4;
  --pearl:     #efe6db;

  --radius:    18px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(70,60,52,.05);
  --shadow:    0 2px 4px rgba(70,60,52,.04), 0 14px 34px -20px rgba(70,60,52,.30);
  --shadow-lg: 0 3px 6px rgba(70,60,52,.05), 0 26px 52px -26px rgba(70,60,52,.38);

  --ease:      cubic-bezier(.22,.61,.36,1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0 0 72px;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-x: hidden;
}

main, footer { max-width: 760px; margin-inline: auto; padding-inline: 20px; }

::selection { background: var(--rose-soft); color: var(--ink); }

/* ==========================================================================
   Das Wandbild liegt als feste Ebene hinter der ganzen Seite.
   Oben trägt die leere Wand die Überschrift, darunter bleiben Seepferdchen
   und Schildkröte sichtbar; die Karten darüber sind leicht durchscheinend.
   ========================================================================== */

.page-art {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  /* So groß wie möglich, aber nie höher als der Bildschirm:
     1.4485 ist das Seitenverhältnis des Ausschnitts. Nichts wird beschnitten. */
  width: min(100%, calc((100vh - 8px) * 1.4485), 1800px);
  z-index: -2;
  pointer-events: none;
  line-height: 0;
}

.page-art img {
  display: block;
  width: 100%;
  height: auto;
}

/* Schleier: oben fast deckend für die Schrift, in der Bildmitte offen,
   nach unten hin wieder deckend, damit die Liste ruhig steht. */
.page-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to right,
      var(--bg) 0%, rgba(250,245,239,.55) 4%,
      rgba(250,245,239,0) 13%, rgba(250,245,239,0) 87%,
      rgba(250,245,239,.55) 96%, var(--bg) 100%),
    linear-gradient(to bottom,
      rgba(250,245,239,.93) 0%,
      rgba(250,245,239,.88) 16%,
      rgba(250,245,239,.68) 26%,
      rgba(250,245,239,.20) 36%,
      rgba(250,245,239,.24) 72%,
      rgba(250,245,239,.68) 84%,
      var(--bg) 97%);
}

/* Je schmaler das Fenster, desto weniger Kopffreiheit hat das Bild –
   also rutscht es nach unten, damit der Text auf ruhigem Grund steht. */
@media (max-width: 900px) {
  .page-art {
    top: clamp(30px, 7vw, 80px);
    width: min(100%, calc((100vh - clamp(30px, 7vw, 80px) - 8px) * 1.4485));
  }
}
@media (max-width: 640px) {
  .page-art {
    top: clamp(96px, 24vw, 150px);
    width: 100%;   /* Hochformat, passt auf schmalen Displays ohnehin */
  }
}

/* ---------- Kopfbereich: nur noch Titel und Kurzerklärung ---------- */

.hero {
  position: relative;
  text-align: center;
  padding: clamp(34px, 5.5vw, 56px) 20px 0;
  min-height: clamp(300px, 42vh, 430px);
}

.hero-text {
  max-width: 640px;
  margin: 0 auto;
  will-change: transform;
}

.hero h1 {
  margin: 0 0 .3em;
  font-family: "Cormorant Garamond", Iowan Old Style, Palatino, Georgia, serif;
  font-weight: 600;
  font-size: clamp(2.3rem, 7.6vw, 3.6rem);
  line-height: 1;
  letter-spacing: -.015em;
  color: var(--ink);
  text-wrap: balance;
}

.lede {
  margin: 0 auto;
  max-width: 56ch;
  color: var(--ink-soft);
  font-size: clamp(.92rem, 2.2vw, 1rem);
  line-height: 1.62;
  text-wrap: balance;      /* gleich lange Zeilen statt ausgefranster Absatz */
}

.lede strong { color: var(--rose); font-weight: 600; }

/* Perlen, die langsam aufsteigen */
.bubbles {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
}

.bubbles span {
  position: absolute;
  left: var(--x);
  bottom: -60px;
  width: var(--s);
  height: var(--s);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, #fff 0%, rgba(255,255,255,.72) 34%,
                    rgba(255,255,255,.20) 60%, rgba(255,255,255,.04) 74%),
    rgba(255,255,255,.42);
  border: 1px solid rgba(165,110,128,.62);
  box-shadow: 0 0 7px rgba(255,255,255,.85), inset 0 -2px 5px rgba(186,120,140,.30);
  animation: rise var(--dur, 22s) linear infinite;
  animation-delay: var(--d);
  opacity: 0;
}

@keyframes rise {
  0%   { transform: translate3d(0, 0, 0) scale(.8);                          opacity: 0; }
  10%  {                                                                     opacity: .95; }
  50%  { transform: translate3d(var(--drift, 0px), -55vh, 0) scale(1.02);    opacity: .85; }
  88%  {                                                                     opacity: .5; }
  100% { transform: translate3d(0, -112vh, 0) scale(1.15);                   opacity: 0; }
}

/* ==========================================================================
   Kennzahlen
   ========================================================================== */

.summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 34px 0 16px;
}

.stat {
  background: rgba(255,253,250,.84);
  backdrop-filter: blur(9px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 10px 15px;
  text-align: center;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease);
}

.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-num {
  display: block;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 2.15rem;
  font-weight: 600;
  line-height: 1;
  color: var(--rose);
  font-variant-numeric: lining-nums proportional-nums;
  letter-spacing: -.015em;
}

.stat-label {
  display: block;
  margin-top: 4px;
  font-size: .76rem;
  letter-spacing: .06em;
  color: var(--ink-faint);
}

/* ==========================================================================
   Werkzeugleiste
   ========================================================================== */

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 8px;
  padding-inline: 4px;
  justify-content: center;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: .89rem;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
  transition: color .25s var(--ease);
}

.switch:hover { color: var(--rose); }

.switch input {
  accent-color: var(--rose);
  width: 17px;
  height: 17px;
  cursor: pointer;
}

/* ==========================================================================
   Schaltflächen
   ========================================================================== */

button {
  font: inherit;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .28s var(--ease), background-color .25s var(--ease),
              border-color .25s var(--ease), color .25s var(--ease),
              box-shadow .28s var(--ease);
}

button.primary {
  border: none;
  background: var(--rose);
  color: #fff;
  font-weight: 600;
  letter-spacing: .01em;
  padding: 12px 26px;
  box-shadow: 0 8px 18px -10px rgba(155,82,101,.75);
}
button.primary:hover { background: #864456; transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(155,82,101,.8); }
button.primary:active { transform: translateY(0); }
button.primary:disabled { opacity: .5; cursor: default; transform: none; box-shadow: none; }

button.ghost {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--ink);
  padding: 11px 22px;
  font-weight: 500;
}
button.ghost:hover { border-color: var(--rose-mid); color: var(--rose); transform: translateY(-1px); }

button.small { padding: 8px 17px; font-size: .89rem; }

button.linkish {
  border: none;
  background: none;
  color: var(--ink-faint);
  font-size: .82rem;
  letter-spacing: .04em;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  padding: 5px 7px;
}
button.linkish:hover { color: var(--rose); }

:focus-visible {
  outline: 2px solid var(--rose);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ==========================================================================
   Admin-Leiste und Formular
   ========================================================================== */

.adminbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 11px;
  background: linear-gradient(135deg, var(--rose-soft), #fdf4f1);
  border: 1px solid #f0dade;
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 20px;
  animation: slide-down .5s var(--ease) both;
}

@keyframes slide-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: none; }
}

.adminbar-label {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--rose);
  margin-right: auto;
}

.panel {
  background: rgba(255,253,250,.92);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 26px;
  animation: slide-down .45s var(--ease) both;
}

.panel h2 {
  margin: 0 0 20px;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.6rem;
  font-weight: 600;
  letter-spacing: -.01em;
}

.field { margin-bottom: 16px; display: flex; flex-direction: column; }
.field.grow { flex: 1 1 260px; }

.row { display: flex; flex-wrap: wrap; gap: 16px; }
.row .field { margin-bottom: 16px; }

label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  margin-bottom: 6px;
  color: var(--ink-soft);
}

.req { color: var(--rose); }
.hint { font-weight: 400; color: var(--ink-faint); letter-spacing: 0; }

input[type=text], input[type=url], input[type=password] {
  font: inherit;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fffefc;
  color: var(--ink);
  width: 100%;
  min-width: 0;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}

input::placeholder { color: #9d9086; }

input[type=text]:focus, input[type=url]:focus, input[type=password]:focus {
  outline: none;
  border-color: var(--rose-mid);
  box-shadow: 0 0 0 3px var(--rose-soft);
}

.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }

.form-msg { font-size: .87rem; color: var(--ink-soft); }
.form-msg.error { color: var(--rose); font-weight: 600; }
.form-msg.ok { color: var(--sage); font-weight: 600; }

/* Bildstatus im Formular */

.imgstatus {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  font-size: .85rem;
  color: var(--ink-soft);
}

.imgstatus img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 9px;
  background: var(--card);
  border: 1px solid var(--border-soft);
}

.imgstatus.found  { background: var(--sage-soft); }
.imgstatus.found  #image-status-text { color: var(--sage); font-weight: 600; }
.imgstatus.failed { background: var(--rose-soft); }
.imgstatus.failed #image-status-text { color: var(--rose); }

/* ==========================================================================
   Hinweiskasten
   ========================================================================== */

.notice {
  background: var(--rose-soft);
  border: 1px solid #f0dade;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 24px;
  font-size: .92rem;
  line-height: 1.6;
}

.notice code {
  background: var(--card);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: .88em;
}

/* ==========================================================================
   Wunschkarten
   ========================================================================== */

.list { display: flex; flex-direction: column; gap: 14px; }

.wish {
  display: grid;
  grid-template-columns: 92px 1fr auto;
  gap: 18px;
  align-items: center;
  background: rgba(255,253,250,.84);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  transition: transform .4s var(--ease), box-shadow .4s var(--ease),
              border-color .4s var(--ease);
}

.wish:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border);
}

.wish.no-image { grid-template-columns: 1fr auto; }

.wish.taken {
  background: rgba(243,235,224,.82);
  box-shadow: var(--shadow-sm);
  border-color: var(--border);
}
.wish.taken:hover { transform: none; box-shadow: var(--shadow-sm); }
.wish.taken .wish-title { text-decoration: line-through; text-decoration-thickness: 1px; }
.wish.taken .thumb, .wish.taken .wish-body { opacity: .6; }

.thumb {
  width: 92px;
  height: 92px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--border-soft);
  padding: 5px;
  transition: transform .45s var(--ease);
}

.wish:hover .thumb { transform: scale(1.04); }

.wish-body { min-width: 0; }

.wish-title {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.4rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.005em;
  overflow-wrap: anywhere;
}

.wish-meta {
  margin: 6px 0 0;
  font-size: .87rem;
  color: var(--ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  align-items: center;
}

.price {
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}

.wish-meta a {
  color: var(--rose);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.wish-meta a:hover { border-bottom-color: var(--rose-mid); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--sage);
}

.badge::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
  opacity: .7;
}

.wish-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.wish-actions .admin-row { display: flex; gap: 7px; }

.icon-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--ink-faint);
  padding: 5px 11px;
  font-size: .77rem;
  border-radius: 999px;
}
.icon-btn:hover { color: var(--rose); border-color: var(--rose-mid); }

.empty {
  text-align: center;
  color: var(--ink-faint);
  padding: 52px 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.35rem;
  font-style: italic;
}

.skeleton {
  height: 126px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--bg-deep) 25%, #f8f2ea 50%, var(--bg-deep) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.6s infinite;
}

@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ==========================================================================
   Fußbereich
   ========================================================================== */

footer { padding-top: 28px; padding-bottom: 12px; text-align: center; color: var(--ink-faint); }

.shell-divider {
  display: block;
  width: 108px;
  height: 1px;
  margin: 0 auto 22px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  position: relative;
}

.shell-divider::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px; height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--rose-soft);
  border: 1px solid var(--rose-mid);
}

footer small { font-size: .82rem; letter-spacing: .03em; }

.login { margin-top: 18px; }

#login-form {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  animation: slide-down .35s var(--ease) both;
}

#login-form input {
  width: auto;
  min-width: 190px;
  max-width: 250px;
  text-align: center;
}

.login-msg {
  flex-basis: 100%;
  margin: 4px 0 0;
  font-size: .84rem;
  min-height: 1.3em;
}
.login-msg.error { color: var(--rose); font-weight: 600; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ==========================================================================
   Einblenden beim Scrollen
   ========================================================================== */

/* Nur wenn JavaScript läuft – sonst bleibt alles sofort sichtbar */
html.js .reveal { opacity: 0; transform: translateY(18px); }

html.js .reveal.in {
  opacity: 1;
  transform: none;
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}

/* ==========================================================================
   Schmale Bildschirme
   ========================================================================== */

/* Auf schmalen Displays steigen die Blasen in den Rändern neben der Liste auf.
   Dafür rückt der Inhalt ein paar Pixel ein, sonst wären sie halb verdeckt. */
@media (max-width: 640px) {
  main, footer { padding-inline: 30px; }

  .bubbles span {
    width:  clamp(8px, var(--s), 16px);
    height: clamp(8px, var(--s), 16px);
    animation-name: rise-schmal;
  }
  .bubbles span:nth-child(4n+1) { left: 3px; }
  .bubbles span:nth-child(4n+2) { left: auto; right: 3px; }
  .bubbles span:nth-child(4n+3) { left: 12px; }
  .bubbles span:nth-child(4n)   { left: auto; right: 12px; }
}

/* Gleiche Bewegung, aber ohne seitliche Drift – sonst verschwinden sie
   im schmalen Randstreifen hinter den Karten. */
@keyframes rise-schmal {
  0%   { transform: translate3d(0, 0, 0) scale(.8);       opacity: 0; }
  10%  {                                                   opacity: .95; }
  50%  { transform: translate3d(2px, -55vh, 0) scale(1.02); opacity: .9; }
  88%  {                                                   opacity: .55; }
  100% { transform: translate3d(0, -112vh, 0) scale(1.15); opacity: 0; }
}

@media (max-width: 560px) {
  .hero { min-height: clamp(300px, 42vh, 400px); padding-top: 28px; }

  .summary { gap: 8px; margin-top: 26px; }
  .stat { padding: 14px 6px 12px; }
  .stat-num { font-size: 1.75rem; }
  .stat-label { font-size: .71rem; }

  .wish { grid-template-columns: 68px 1fr; gap: 14px; padding: 14px; }
  .wish.no-image { grid-template-columns: 1fr; }
  .thumb { width: 68px; height: 68px; }
  .wish-title { font-size: 1.2rem; }
  .wish-actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; }
  .wish-actions button.primary, .wish-actions button.ghost { flex: 1 1 auto; }

  .panel { padding: 20px 18px; }
}

/* ==========================================================================
   Reduzierte Bewegung respektieren
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }

  .bubbles { display: none; }
  html.js .reveal { opacity: 1; transform: none; }
  .hero-text { transform: none !important; opacity: 1 !important; }
  .wish:hover, .stat:hover { transform: none; }
}

/* ==========================================================================
   Bemerkung und Reservierung mit Passwort
   ========================================================================== */

.wish-note {
  margin: 7px 0 0;
  font-size: .87rem;
  line-height: 1.45;
  color: var(--ink-soft);
  padding-left: 11px;
  border-left: 2px solid var(--rose-soft);
  overflow-wrap: anywhere;
}

.wish.taken .wish-note { opacity: .7; }

.wish-lock {
  grid-column: 1 / -1;
  margin-top: 4px;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  background: var(--bg-deep);
  border: 1px solid var(--border-soft);
  animation: slide-down .3s var(--ease) both;
}

.wish.taken .wish-lock { background: #fffdfa; }

.lock-hint {
  margin: 0 0 10px;
  font-size: .84rem;
  line-height: 1.5;
  color: var(--ink-soft);
}

.lock-line {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.lock-line input {
  flex: 1 1 180px;
  max-width: 260px;
  width: auto;
}

.lock-msg {
  margin: 8px 0 0;
  font-size: .84rem;
  min-height: 1.2em;
  color: var(--ink-soft);
}
.lock-msg.error { color: var(--rose); font-weight: 600; }

/* ==========================================================================
   Ausklang: freier Raum, damit der Hintergrund unten unverdeckt zu sehen ist
   ========================================================================== */

.ausklang {
  height: clamp(280px, 48vh, 560px);
}
