/* ════════════════════════════════════════════════════════════════════
   YouMe Bakery — pop-ups et décors saisonniers
   Fichier lié à js/saisons.js — les fêtes se règlent dans js/saisons.js
   ════════════════════════════════════════════════════════════════════ */

:root {
  --ym-police-titre: var(--serif, "Fraunces", Georgia, serif);
  --ym-police-texte: var(--sans, "Inter", system-ui, sans-serif);
  --ym-or: #d9b46a;
  --ym-or-clair: #f1d9a4;
  --ym-brun: #3a2414;
}

/* ───────── Couches ───────── */
.ym-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1001;
}
.ym-canvas { position: absolute; inset: 0; }

.ym-fond {
  position: fixed;
  inset: 0;
  z-index: 1000;
  animation: ym-fondu 0.6s ease-out both;
}
.ym-fond--nuit {
  background: radial-gradient(120% 90% at 50% 40%, rgba(16, 20, 48, 0.62), rgba(5, 7, 20, 0.86));
}
.ym-fond--jour {
  background: radial-gradient(120% 90% at 50% 40%, rgba(60, 40, 20, 0.12), rgba(40, 25, 10, 0.38));
}
.ym-scene {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* ───────── Pop-up en verre ───────── */
.ym-popup {
  position: relative;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 34px 30px 30px;
  border-radius: 26px;
  text-align: center;
  font-family: var(--ym-police-texte);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  backdrop-filter: blur(22px) saturate(150%);
}
.ym-popup--nuit {
  color: #f8f3ea;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.03)), rgba(20, 22, 48, 0.3);
  border: 1px solid rgba(241, 217, 164, 0.32);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.ym-popup--jour {
  color: var(--ym-brun);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.75), rgba(255, 250, 242, 0.45));
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 30px 70px rgba(60, 35, 10, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.ym-entree--douce { animation: ym-entree-douce 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.ym-entree--zoom { animation: ym-entree-zoom 1.1s cubic-bezier(0.16, 1, 0.3, 1) both; }

.ym-illu-zone {
  display: flex;
  justify-content: center;
  margin: -6px 0 10px;
}
.ym-illu { width: 112px; height: auto; overflow: visible; }
.ym-illu--large { width: 170px; }

.ym-surtitre {
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-weight: 500;
  opacity: 0.8;
  color: var(--ym-or);
  animation: ym-monte 0.8s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ym-popup--jour .ym-surtitre { color: #9c7430; }

.ym-titre {
  margin: 0.55rem 0 0;
  font-family: var(--ym-police-titre);
  font-weight: 500;
  font-size: clamp(1.8rem, 6vw, 2.35rem);
  color: inherit;
  line-height: 1.08;
  letter-spacing: 0.005em;
  animation: ym-monte 0.9s 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ym-popup--nuit .ym-titre {
  background: linear-gradient(180deg, #fff8e8 20%, var(--ym-or-clair) 60%, var(--ym-or) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(241, 217, 164, 0.25);
}
.ym-entree--zoom .ym-titre { font-size: clamp(2.2rem, 8vw, 3rem); }

.ym-filet {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px auto 14px;
  animation: ym-fondu 1s 0.45s both;
}
.ym-filet span { width: 46px; height: 1px; background: currentColor; opacity: 0.35; }
.ym-filet i { width: 6px; height: 6px; transform: rotate(45deg); background: var(--ym-or); }

.ym-texte {
  margin: 0 auto 20px;
  max-width: 32ch;
  font-size: 0.98rem;
  line-height: 1.6;
  opacity: 0.9;
  animation: ym-monte 0.9s 0.4s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.ym-compte {
  display: inline-block;
  margin: -4px 0 20px;
  padding: 5px 14px;
  border: 1px solid var(--ym-or);
  border-radius: 999px;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ym-or);
  animation: ym-fondu 1s 0.55s both;
}
.ym-popup--jour .ym-compte { color: #9c7430; border-color: rgba(156, 116, 48, 0.55); }

.ym-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s;
  animation: ym-monte 0.9s 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.ym-popup--nuit .ym-bouton {
  color: #23170a;
  background: linear-gradient(135deg, #f6e2b3, var(--ym-or) 55%, #b98d3e);
  box-shadow: 0 10px 30px rgba(217, 180, 106, 0.35);
}
.ym-popup--jour .ym-bouton {
  color: #fff8ec;
  background: linear-gradient(135deg, #5b3a1e, #2e1c0e);
  box-shadow: 0 10px 26px rgba(46, 28, 14, 0.3);
}
.ym-bouton:hover { transform: translateY(-2px); }
.ym-bouton svg { transition: transform 0.25s; }
.ym-bouton:hover svg { transform: translateX(4px); }

.ym-fermer {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.3s;
}
.ym-popup--jour .ym-fermer { background: rgba(58, 36, 20, 0.07); }
.ym-popup:focus { outline: none; }
.ym-fermer:focus-visible { outline: 1px solid var(--ym-or); outline-offset: 2px; }
.ym-fermer:hover { background: rgba(255, 255, 255, 0.24); transform: rotate(90deg); }

/* ───────── Bonnet sur le logo (position calculée par js/saisons.js) ───────── */
.ym-logo-saison { position: relative; }
.ym-bonnet {
  position: absolute;
  height: auto;
  transform: rotate(16deg);
  transform-origin: 30% 90%;
  pointer-events: none;
  mix-blend-mode: normal;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.25));
  animation: ym-bonnet-pose 0.9s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.ym-bonnet-pompon { transform-origin: 80px 22px; animation: ym-pompon 3s ease-in-out infinite; }

/* ───────── Neige sur le grand titre ───────── */
.ym-titre-neige { display: inline-block; animation: ym-fondu 1.2s ease-out both; }

/* ───────── Loy Krathong (illustration) ───────── */
.ym-k-flamme { transform-origin: 70px 24px; animation: ym-flamme 0.9s ease-in-out infinite alternate; }
.ym-k-halo { animation: ym-halo 2.4s ease-in-out infinite alternate; }
.ym-k-eau { animation: ym-eau 4s ease-in-out infinite alternate; }
.ym-k-eau2 { animation-delay: -2s; }
.ym-k-encens { animation: ym-halo 1.6s ease-in-out infinite alternate; }

/* ───────── Bretzel + bière ───────── */
.ym-b-bretzel {
  transform-origin: 135px 76px;
  animation: ym-pop 1s 0.35s cubic-bezier(0.34, 1.7, 0.64, 1) both, ym-balance 3.5s 1.4s ease-in-out infinite;
}
.ym-b-chope { transform-origin: 46px 106px; animation: ym-trinque 3.5s 0.9s ease-in-out infinite; }
.ym-b-mousse { animation: ym-mousse 2.4s ease-in-out infinite alternate; transform-origin: 46px 30px; }
.ym-b-bulle { animation: ym-bulle 2.6s linear infinite; }
.ym-b-bulle2 { animation-delay: -0.6s; animation-duration: 2.2s; }
.ym-b-bulle3 { animation-delay: -1.3s; }
.ym-b-bulle4 { animation-delay: -1.9s; animation-duration: 3s; }
.ym-b-bulle5 { animation-delay: -0.9s; animation-duration: 2.8s; }

/* ───────── Drapeau suisse ondulant ───────── */
.ym-d-bande { animation: ym-onde 1.6s ease-in-out infinite alternate; }
.ym-d-ombre { opacity: 0; animation: ym-ombre 1.6s ease-in-out infinite alternate; }

/* ───────── Couronne, lanterne, citrouille, lapin, Grittibänz ───────── */
.ym-c-couronne { transform-origin: 60px 80px; animation: ym-pop 0.9s 0.3s cubic-bezier(0.34, 1.7, 0.64, 1) both; }
.ym-c-reflet { animation: ym-reflet 3.2s 1s ease-in-out infinite; }
.ym-scintille { transform-box: fill-box; transform-origin: center; animation: ym-scintille 2s ease-in-out infinite; }
.ym-scintille2 { animation-delay: -1s; }
.ym-l-balance { transform-origin: 40px 0; animation: ym-lanterne 3.6s ease-in-out infinite; }
.ym-l-halo { animation: ym-halo 2.2s ease-in-out infinite alternate; }
.ym-p-visage { animation: ym-flamme-p 0.15s steps(2) infinite alternate; }
.ym-p-halo { animation: ym-halo 1.8s ease-in-out infinite alternate; }
.ym-illu-lapin { width: 120px; animation: ym-saut-sur-place 1.4s ease-in-out infinite; }
.ym-g-salut { transform-origin: 50px 110px; animation: ym-pop 0.9s 0.3s cubic-bezier(0.34, 1.7, 0.64, 1) both; }
.ym-g-bras { transform-origin: 34px 50px; animation: ym-coucou 1.2s 1.2s ease-in-out infinite alternate; }

/* ───────── Nouvel An chinois : lampions ───────── */
.ym-lampions { position: absolute; top: var(--ym-haut, 0px); left: 0; right: 0; }
.ym-lampion {
  position: absolute;
  top: 0;
  width: 46px;
  transform: translateX(-50%);
  transform-origin: top center;
  animation: ym-lanterne 4s ease-in-out infinite;
  display: flex;
  align-items: flex-end;
}
.ym-lampion::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 50px;
  left: 50%;
  width: 1px;
  background: #b48a3a;
}
.ym-lampion-svg .ym-l-balance { animation: none; }
.ym-lampion-svg { width: 46px; filter: drop-shadow(0 4px 10px rgba(208, 38, 28, 0.35)); }

/* ───────── Cœurs ───────── */
.ym-coeur {
  position: absolute;
  height: auto;
  transform: translate(-50%, -50%) rotate(var(--rot));
  animation: ym-coeur 2.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  filter: drop-shadow(0 4px 8px rgba(201, 24, 74, 0.25));
}

/* ───────── Lapins ───────── */
.ym-lapin-course {
  position: absolute;
  left: 0;
  animation-name: ym-traverse;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
}
.ym-lapin-course--gauche { animation-name: ym-traverse-inverse; }
.ym-lapin-course--gauche .ym-lapin-saut { transform: scaleX(-1); }
.ym-lapin-saut svg { display: block; width: 100%; animation: ym-saut 0.62s cubic-bezier(0.3, 0, 0.7, 1) infinite; }

/* ───────── Guirlandes (Suisse, Bavière) ───────── */
.ym-guirlande { position: absolute; top: var(--ym-haut, 0px); left: 0; right: 0; height: 60px; }
.ym-guirlande-fil { position: absolute; inset: 0; width: 100%; height: 100%; }
.ym-fanion {
  position: absolute;
  width: 26px;
  transform: translateX(-50%);
  transform-origin: top center;
  animation: ym-fanion 2.6s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.18));
}
.ym-fanion svg { display: block; width: 100%; height: auto; }
.ym-fanion--baviere { width: 22px; }

/* ───────── Halloween ───────── */
.ym-hw-citrouille { position: absolute; bottom: 10px; width: 84px; }
.ym-hw-citrouille--g { left: 10px; }
.ym-hw-citrouille--d { right: 10px; width: 64px; }
.ym-hw-svg { width: 100%; height: auto; overflow: visible; }
.ym-fantome {
  position: absolute;
  top: 18vh;
  left: 0;
  width: 70px;
  animation: ym-fantome-traverse 16s linear infinite;
}
.ym-fantome-flotte { animation: ym-flotte 2.4s ease-in-out infinite alternate; }
.ym-fantome svg { width: 100%; height: auto; filter: drop-shadow(0 8px 14px rgba(40, 30, 70, 0.3)); }

/* ───────── Téléphone ───────── */
@media (max-width: 640px) {
  .ym-popup { padding: 30px 22px 24px; border-radius: 22px; }
  .ym-illu { width: 92px; }
  .ym-illu--large { width: 140px; }
  .ym-fanion { width: 18px; }
  .ym-fanion--baviere { width: 15px; }
  .ym-fanion:nth-child(odd) { display: none; }
  .ym-lampion:nth-child(2), .ym-lampion:nth-child(4) { display: none; }
  .ym-lampion, .ym-lampion-svg { width: 34px; }
  .ym-hw-citrouille { width: 60px; }
  .ym-hw-citrouille--d { width: 46px; }
  .ym-fantome { width: 50px; }
}

/* Respecte les personnes qui ont désactivé les animations */
@media (prefers-reduced-motion: reduce) {
  .ym-decor *, .ym-popup, .ym-popup *, .ym-fond, .ym-bonnet, .ym-bonnet *, .ym-titre-neige {
    animation: none !important;
    transition: none !important;
  }
}

/* Badge du mode aperçu (?saison=AAAA-MM-JJ) */
.ym-apercu {
  position: fixed;
  left: 12px;
  bottom: 12px;
  z-index: 1003;
  max-width: calc(100vw - 24px);
  padding: 6px 10px;
  border-radius: 8px;
  background: #222;
  color: #fff;
  font: 12px/1.4 system-ui, sans-serif;
}

/* ───────── Animations ───────── */
@keyframes ym-fondu { from { opacity: 0; } to { opacity: 1; } }
@keyframes ym-monte { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes ym-entree-douce {
  from { opacity: 0; transform: translateY(26px) scale(0.96); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
@keyframes ym-entree-zoom {
  0% { opacity: 0; transform: scale(0.25); filter: blur(12px); }
  60% { opacity: 1; filter: none; }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes ym-pop {
  from { opacity: 0; transform: scale(0.2) rotate(-12deg); }
  to { opacity: 1; transform: none; }
}
@keyframes ym-balance { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-5deg); } }
@keyframes ym-trinque {
  0%, 70%, 100% { transform: rotate(0); }
  78% { transform: rotate(9deg); }
  86% { transform: rotate(-3deg); }
}
@keyframes ym-mousse { from { transform: scaleY(1); } to { transform: scaleY(1.08) translateY(-1px); } }
@keyframes ym-bulle {
  0% { transform: translateY(0); opacity: 0; }
  15% { opacity: 0.9; }
  100% { transform: translateY(-70px); opacity: 0; }
}
@keyframes ym-onde {
  from { transform: translateY(calc(var(--amp) * -1)); }
  to { transform: translateY(var(--amp)); }
}
@keyframes ym-ombre { from { opacity: 0; } to { opacity: 0.16; } }
@keyframes ym-reflet { 0% { transform: translateX(0) skewX(-20deg); } 60%, 100% { transform: translateX(190px) skewX(-20deg); } }
@keyframes ym-scintille { 0%, 100% { transform: scale(0.4); opacity: 0.3; } 50% { transform: scale(1.1); opacity: 1; } }
@keyframes ym-lanterne { 0%, 100% { transform: translateX(-50%) rotate(-4deg); } 50% { transform: translateX(-50%) rotate(4deg); } }
.ym-illu .ym-l-balance { animation-name: ym-lanterne-illu; }
@keyframes ym-lanterne-illu { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes ym-flamme { from { transform: scale(1, 1); opacity: 0.9; } to { transform: scale(0.88, 1.12); opacity: 1; } }
@keyframes ym-flamme-p { from { opacity: 0.85; } to { opacity: 1; } }
@keyframes ym-halo { from { opacity: 0.55; } to { opacity: 1; } }
@keyframes ym-eau { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
@keyframes ym-saut-sur-place {
  0%, 100% { transform: translateY(0); }
  30% { transform: translateY(-14px); }
  50% { transform: translateY(0); }
}
@keyframes ym-coucou { from { transform: rotate(0); } to { transform: rotate(18deg); } }
@keyframes ym-bonnet-pose {
  from { opacity: 0; transform: translateY(-30px) rotate(-10deg); }
  to { opacity: 1; transform: rotate(16deg); }
}
@keyframes ym-pompon { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(10deg); } }
@keyframes ym-coeur {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(var(--rot)) scale(0); }
  18% { opacity: 1; transform: translate(-50%, -50%) rotate(var(--rot)) scale(1.15); }
  30% { transform: translate(-50%, -50%) rotate(var(--rot)) scale(1); }
  75% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 40px)) rotate(var(--rot)) scale(0.9); }
}
@keyframes ym-traverse { from { transform: translateX(-120px); } to { transform: translateX(calc(100vw + 40px)); } }
@keyframes ym-traverse-inverse { from { transform: translateX(calc(100vw + 40px)); } to { transform: translateX(-120px); } }
@keyframes ym-saut {
  0% { transform: translateY(0) scale(1.06, 0.92); }
  25% { transform: translateY(-34px) scale(0.96, 1.06) rotate(-6deg); }
  50% { transform: translateY(-42px) rotate(0deg); }
  80% { transform: translateY(-8px) rotate(6deg); }
  100% { transform: translateY(0) scale(1.06, 0.92); }
}
@keyframes ym-fanion {
  0%, 100% { transform: translateX(-50%) rotate(-7deg) skewY(2deg); }
  50% { transform: translateX(-50%) rotate(7deg) skewY(-3deg); }
}
@keyframes ym-fantome-traverse {
  0% { transform: translate(-100px, 0); opacity: 0; }
  5% { opacity: 1; }
  25% { transform: translate(25vw, 6vh); }
  50% { transform: translate(50vw, -2vh); }
  75% { transform: translate(75vw, 8vh); }
  95% { opacity: 1; }
  100% { transform: translate(calc(100vw + 40px), 0); opacity: 0; }
}
@keyframes ym-flotte { from { transform: translateY(-8px) rotate(-4deg); } to { transform: translateY(8px) rotate(4deg); } }
