/* Maskottchen-Komponente (seit v1.33.17)
   Groesse steuert das Jinja-Makro templates/macros/maskottchen.html
   (width/height-Attribute); hier nur Praesentation + optionale Effekte. */
.maskottchen {
  display: inline-block;
  vertical-align: middle;
  object-fit: contain;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

/* Animationen (Autoplay seit v1.33.24): Der WebP-Loop wird direkt als src
   gerendert und laeuft von selbst. Die Loops tragen einen weissen Hintergrund
   (Quell-Assets) — auf den hellen Flaechen der App (Seitenhintergrund
   #faf7f2, weisse Karten) laesst 'multiply' den Kasten vollstaendig
   verschwinden: Weiss multipliziert mit der Flaeche = Flaeche. Die Figur
   verdunkelt sich dabei nur um den Faktor der Flaeche (<5 % bei #faf7f2) und
   wirkt dadurch eingebettet. Nur wo der Untergrund hell ist (ueberall, wo
   Maskottchen stehen) — auf dunklen Flaechen kommt kein Loop zum Einsatz.
   Bei 'prefers-reduced-motion: reduce' tauscht mascot-ui.js auf das statische
   PNG (mit Alpha) und entfernt die Klasse. */
.maskottchen--anim { mix-blend-mode: multiply; }

/* Sanfter Schwebe-Effekt — nur wo die Klasse explizit gesetzt wird. */
.maskottchen--float {
  animation: maskottchen-float 3.4s ease-in-out infinite;
}
@keyframes maskottchen-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5%); }
}
@media (prefers-reduced-motion: reduce) {
  .maskottchen--float { animation: none; }
}

/* ---------- Lade-Overlay (seit v1.33.18) ----------
   Singleton in base.html (Makro templates/macros/lade_overlay.html), gesteuert
   von static/js/mascot-ui.js. Herzstueck = animiertes Maskottchen (WebP-Loop);
   die schwebenden Zutaten-Emojis liegen drumherum (Styles in style.css). */
.lade-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(255, 248, 240, 0.9);
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.lade-overlay.show { display: flex; }
.lade-overlay-card {
  text-align: center; background: #fff; border-radius: 24px;
  padding: 34px 48px 30px; box-shadow: 0 18px 60px rgba(0,0,0,.22);
  max-width: 92%; position: relative;
  animation: card-pop .35s ease-out;
}
.lade-overlay-scene { position: relative; width: 250px; height: 200px; margin: 0 auto; }
.lade-overlay-mascot {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  width: 190px; height: 190px;
}
.lade-overlay-text {
  margin: 10px 0 2px; color: var(--brand); font-size: 1.25rem;
  font-weight: 700; letter-spacing: .2px;
}
@keyframes card-pop {
  0% { transform: scale(.85) translateY(12px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
@media (max-width: 520px) {
  .lade-overlay-card { padding: 26px 22px 22px; }
  .lade-overlay-scene { width: 200px; height: 165px; }
  .lade-overlay-mascot { width: 155px; height: 155px; }
  .lade-overlay-text { font-size: 1.08rem; }
}

/* ---------- KI-Begleiter: Dialog-Optik (seit v1.33.18) ----------
   Figur links, Sprechblase rechts — auf /ai (Formular + Entwurf/Feedback).
   .ki-begleiter--tip  = leiser Hinweis (kleinere Figur, waermere Blase)
   .ki-begleiter-inline = kleine Figur direkt neben Eingabefeldern */
.ki-begleiter {
  display: flex; align-items: flex-end; gap: 10px;
  margin: 16px 0 8px;
}
.ki-begleiter-fig { flex: 0 0 auto; line-height: 0; }
.ki-begleiter-bubble {
  position: relative; margin: 0 0 10px; padding: 12px 16px;
  background: var(--surface, #fff); border: 1.5px solid var(--line, #eadfce);
  border-radius: 16px 16px 16px 4px;
  box-shadow: 0 4px 14px rgba(168, 68, 46, .08);
  color: var(--ink, #3a2e26); font-size: .95rem; line-height: 1.45;
  max-width: 46ch;
}
/* Sprechblasen-Schwanz (zeigt zur Figur links) */
.ki-begleiter-bubble::before {
  content: ""; position: absolute; left: -6px; bottom: 14px;
  width: 12px; height: 12px; background: inherit;
  border-left: inherit; border-bottom: inherit;
  transform: rotate(45deg);
}
.ki-begleiter--tip { margin: 10px 0 4px; }
.ki-begleiter--tip .ki-begleiter-bubble {
  background: #fff8ee; border-color: #f0e0c8; font-size: .88rem;
  padding: 9px 13px; margin-bottom: 8px;
}
.ki-begleiter-inline { flex: 0 0 auto; line-height: 0; }
@media (max-width: 520px) {
  .ki-begleiter { align-items: center; }
  .ki-begleiter-bubble { font-size: .9rem; padding: 10px 13px; }
}

/* ---------- Kontext-Einsaetze (seit v1.33.19, Maskottchen 3/5) ----------
   Leerzustaende, Flash-/Fehler-Maskottchen, Tipp-Boxen, Schritt-Motive. */

/* Flash-Alerts mit Maskottchen (base.html): Figur links, Text rechts. */
.alert--mascot { display: flex; align-items: center; gap: 10px; }
.alert--mascot .alert-mascot { flex: 0 0 auto; }
.alert--mascot .alert-text { flex: 1 1 auto; }

/* Leerzustand mit Maskottchen (index, admin/list, export). */
.empty--mascot .empty-mascot { display: block; margin: 0 auto 10px; }
.empty-title { font-size: 1.15rem; margin: 0 0 6px; color: var(--brand-dark, var(--brand)); }

/* Tipp-Boxen ("Wusstest du?" / Genuss) — warm, dosiert. */
.tipp-box { display: flex; align-items: center; gap: 14px; background: #fff8ee;
  border: 1px solid #f0e0c8; border-radius: 14px; padding: 14px 18px; }
.detail-section.tipp-box { grid-column: 1 / -1; margin-top: 14px; }
.tipp-box .tipp-fig { flex: 0 0 auto; line-height: 0; }
.tipp-box .tipp-text { margin: 0; color: var(--ink, #3a2e26); font-size: .95rem; }
.auth-card .tipp-box { margin: 14px 0 4px; }
.tipp-box--compact { padding: 10px 14px; gap: 10px; }
.tipp-box--compact .tipp-text { font-size: .88rem; color: var(--ink-soft, #6b5b4e); }

/* Fehlerkarte (404/500/CSRF): zentrierte Figur ueber der Ueberschrift. */
.auth-card--mascot { text-align: center; }
.fehler-fig { display: block; line-height: 0; margin-bottom: 4px; }
.fehler-fig .maskottchen { margin: 0 auto; }
.fehler-code { font-size: 1.7rem; font-weight: 800; color: var(--brand); margin: 0 0 2px; letter-spacing: 1px; }

@media (max-width: 600px) {
  .tipp-box { gap: 10px; padding: 12px 14px; }
  .tipp-box .tipp-text { font-size: .9rem; }
}

/* ---------- Saison-Outfit auf der Startseite (seit v1.33.20, Maskottchen 4/5) ----------
   Dezentes Feiertags-Outfit oben rechts im Hero der Startseite — rendert NUR,
   wenn gerade eine Saison aktiv ist (Slug aus mascot_header_slug()). Rein
   dekorativ: blockiert keine Klicks, verschwindet auf schmalen Screens. */
.hero { position: relative; }
.hero-season {
  position: absolute; top: 2px; right: 2px;
  width: 96px; height: 96px;
  opacity: .95; pointer-events: none;
}
@media (max-width: 899px) {
  .hero-season { display: none; }
}

/* ---------- Feinschliff (seit v1.33.21, Maskottchen 5/5) ----------
   Antwort-/Warte-Seiten der E-Mail-Flows, make-public-Dialog und die
   Bring!-Zeile der Detailseite. Muster wie .fehler-fig: Figur zentriert
   ueber dem Inhalt, rein dekorativ (aria-hidden am Wrapper). */

/* Auth-Karten (Aktivierung, Warte-Seite, Passwort vergessen). */
.auth-mascot { display: block; line-height: 0; margin: 0 0 6px; }
.auth-mascot .maskottchen { margin: 0 auto; }

/* Make-public-Bestaetigungsdialog (admin/list). */
.dialog-mascot { display: flex; justify-content: center; line-height: 0; margin: 0 0 8px; }

/* Bring!-Zeile der Detailseite: Motiv + Button in einer Reihe. */
.detail-bring { display: flex; align-items: center; gap: 10px; }
.bring-mascot { flex: 0 0 auto; line-height: 0; }

@media (max-width: 600px) {
  .auth-mascot .maskottchen { width: 76px; height: 76px; }
  .dialog-mascot .maskottchen { width: 60px; height: 60px; }
}

/* ---------- Name & Vorstellung (seit v1.33.23) ----------
   Das Maskottchen hat einen Namen (zentral in mascot.py). Der Name erscheint
   dosiert an vier Stellen: Vorstellung (Sprechblase auf /ki + Startseite fuer
   Gaeste), Sprecher-Name der Tipp-Boxen, Beisatz im Lade-Overlay und Footer.
   Formulierungen kommen aus i18n — hier nur Praesentation. */

/* Vorstellung (Sprechblase wie .ki-begleiter, etwas grosszuegiger). */
.mascot-intro { margin: 14px 0 16px; }
.mascot-intro-bubble { max-width: 52ch; }
.mascot-hello { margin: 0; font-weight: 700; color: var(--brand-dark, var(--brand, #a8442e)); }
.mascot-hello-sub { margin: 4px 0 0; font-size: .9rem; color: var(--ink-soft, #6b5b4e); }
/* Begruessung im Hero der Startseite (v1.33.24): das Maskottchen spricht selbst —
   Sprechblase links neben der Figur, ersetzt die fruehere <p>-Zeile. */
.hero-greeting { margin: 2px 0 20px; align-items: center; }
.hero-bubble { font-size: 1.02rem; max-width: 56ch; }

/* Sprecher-Name der Tipp-Boxen. */
.tipp-box .tipp-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tipp-box .tipp-name { font-size: .78rem; font-weight: 700; letter-spacing: .02em;
  color: var(--brand, #a8442e); }

/* Lade-Overlay: Name als leiser Beisatz unter dem Ladetext. */
.lade-overlay-name { margin: 2px 0 0; font-size: .88rem; color: var(--ink-soft, #6b5b4e); }

/* Footer-Gruss. */
.footer-mascot { display: inline-flex; align-items: center; gap: 6px; margin: 0 12px; vertical-align: middle; }
.footer-mascot .footer-mark { opacity: .9; }

@media (max-width: 600px) {
  .footer-mascot { margin: 8px 0 0; }
  .tipp-box .tipp-name { font-size: .73rem; }
  .mascot-hello { font-size: .95rem; }
}


/* ---------- Nom-Nom-Feinschliff (seit v1.33.24) ----------
   Dosierter Einsatz: Kategorie-Infos auf /ai (je Eingabe-Art eine kleine Box,
   das Maskottchen erklaert kurz) und der Dialog-Hinweis im Bereich 'Mit KI anpassen'
   der Rezept-Detailseite. Sprechblasen-Optik wie .ki-begleiter--tip. */
.ai-info-box { display: flex; align-items: center; gap: 10px; background: #fff8ee;
  border: 1px solid #f0e0c8; border-radius: 12px; padding: 8px 12px; margin: 0 0 10px; }
.ai-info-box .ai-info-fig { flex: 0 0 auto; line-height: 0; }
.ai-info-box .ai-info-text { margin: 0; font-size: .88rem; color: var(--ink-soft, #6b5b4e); }

/* Dialog-Hinweis im Bereich 'Mit KI anpassen' (detail.html). */
.adjust-mascot { margin: 6px 0 10px; }

@media (max-width: 600px) {
  .ai-info-box { align-items: flex-start; }
  .ai-info-box .ai-info-text { font-size: .85rem; }
}
