/* =========================================================
   UNIVERS KAWAII & HISTOIRE D'AMOUR ANIMÉE
   Design pastel doux, bisou hyper-expressif, bougies et cadeau
   ========================================================= */

:root {
  --bg-gradient: linear-gradient(135deg, #fff0f6 0%, #fbf5ff 50%, #f0f9ff 100%);
  --card-bg: #ffffff;
  
  --color-pink-soft: #ffccd5;
  --color-pink-bubble: #ff758f;
  --color-pink-deep: #ff4d6d;
  --color-vanilla: #fff3b0;
  --color-mint: #d8f3dc;
  
  --ink-soft: #4a3e3d;
  --outline-cute: 3px solid var(--ink-soft);
  --shadow-fluffy: 0 12px 32px rgba(255, 154, 162, 0.25);
  --shadow-card: 0 20px 50px rgba(114, 9, 183, 0.08), 0 8px 20px rgba(255, 182, 193, 0.15);

  --font-cute: 'Fredoka', 'Nunito', 'Segoe UI', system-ui, sans-serif;
  --font-text: 'Quicksand', 'Segoe UI', system-ui, sans-serif;

  /* Couleurs d'action lisibles (texte blanc à 4.5:1 minimum) */
  --color-cta: #e0245e;
  --color-cta-hover: #c81e4f;
  --color-pink-text: #c81e4f;
  --ink-muted: #6b5f5e;
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-cute);
  background: var(--bg-gradient);
  color: var(--ink-soft);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
  user-select: none;
  padding: 14px 10px;
}

#kawaiiCanvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
}

/* =========================================================
   HEADER
   ========================================================= */
.kawaii-header {
  width: 100%;
  max-width: 840px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  z-index: 10;
}

.logo-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.95);
  border: var(--outline-cute);
  padding: 8px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 15px rgba(255, 117, 143, 0.2);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.logo-sparkle {
  font-size: 1.1rem;
  animation: heartPulse 1.4s infinite ease-in-out;
}

@keyframes heartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}

.header-btns {
  display: flex;
  gap: 10px;
}

.kawaii-btn {
  background: #ffffff;
  border: var(--outline-cute);
  color: var(--ink-soft);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: var(--font-cute);
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kawaii-btn:hover {
  transform: translateY(-2px) scale(1.05);
  background: #fff5f7;
  border-color: var(--color-pink-bubble);
}

.kawaii-btn.active {
  background: var(--color-pink-soft);
}

.kawaii-btn.icon-btn {
  padding: 8px 12px;
}

/* =========================================================
   CARTE PRINCIPALE
   ========================================================= */
.kawaii-card {
  width: 100%;
  max-width: 840px;
  background: var(--card-bg);
  border: var(--outline-cute);
  border-radius: 36px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
}

.scene-header {
  background: linear-gradient(135deg, #ffe5ec 0%, #ffccd5 100%);
  border-bottom: var(--outline-cute);
  padding: 16px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.step-chip {
  background: var(--color-pink-deep);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(255, 77, 109, 0.3);
}

.scene-title {
  font-size: clamp(1.2rem, 3.8vw, 1.75rem);
  font-weight: 700;
  color: var(--ink-soft);
}

/* =========================================================
   CLAIRIÈRE & DÉCORS
   ========================================================= */
.characters-meadow {
  min-height: 410px;
  background: linear-gradient(180deg, #f0f7ff 0%, #eef5ff 60%, #e0f2fe 100%);
  border-bottom: var(--outline-cute);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding-bottom: 24px;
}

.sunny-cloud {
  position: absolute;
  top: 140px;
  right: 7%;
  width: 100px;
  height: 38px;
  background: #ffffff;
  border-radius: 999px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
  animation: cloudDrift 6s infinite alternate ease-in-out;
}
.sunny-cloud::before, .sunny-cloud::after {
  content: '';
  position: absolute;
  background: #ffffff;
  border-radius: 50%;
}
.sunny-cloud::before { width: 44px; height: 44px; top: -20px; left: 16px; }
.sunny-cloud::after { width: 36px; height: 36px; top: -15px; left: 48px; }

.cloud-face {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto auto;
  justify-items: center;
  z-index: 2;
}
.cloud-eye {
  width: 4px; height: 4px;
  background: var(--ink-soft);
  border-radius: 50%;
  display: inline-block;
  margin: 0 6px;
}
.cloud-smile {
  grid-column: 1 / -1;
  width: 8px; height: 4px;
  border-bottom: 2px solid var(--ink-soft);
  border-radius: 0 0 8px 8px;
  margin-top: 2px;
}

@keyframes cloudDrift {
  0% { transform: translateX(0); }
  100% { transform: translateX(18px); }
}

.floating-balloon {
  position: absolute;
  font-size: 1.8rem;
  animation: balloonFloat 4s infinite ease-in-out;
}
.balloon-1 { top: 150px; left: 6%; animation-delay: 0s; }
.balloon-2 { top: 270px; left: 9%; animation-delay: 1.2s; font-size: 1.4rem; }
.balloon-3 { top: 245px; right: 15%; animation-delay: 2.1s; font-size: 1.5rem; }

@keyframes balloonFloat {
  0%, 100% { transform: translateY(0) rotate(-3deg); }
  50% { transform: translateY(-14px) rotate(4deg); }
}

.pastel-hills {
  position: absolute;
  bottom: 0;
  left: -20%;
  right: -20%;
  height: 80px;
  background: #d8f3dc;
  border-top: 3px solid #b7e4c7;
  border-radius: 50% 50% 0 0;
}

/* BULLE DE DIALOGUE */
.bubble-wrapper {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 580px;
  z-index: 10;
}

.kawaii-speech-bubble {
  background: rgba(255, 255, 255, 0.96);
  border: var(--outline-cute);
  border-radius: 22px;
  padding: 14px 22px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.06);
  text-align: center;
  position: relative;
  backdrop-filter: blur(8px);
  animation: bubblePopIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes bubblePopIn {
  0% { transform: scale(0.8); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.kawaii-speech-bubble.bubble-pop {
  animation: bubblePopIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.kawaii-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -11px;
  left: 50%;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  background: #fff;
  border-right: var(--outline-cute);
  border-bottom: var(--outline-cute);
  transform: rotate(45deg);
}

.kawaii-speech-bubble p {
  font-family: var(--font-cute);
  font-size: 1.05rem;
  line-height: 1.45;
  color: var(--ink-soft);
  font-weight: 600;
}

/* =========================================================
   SCÈNE DES MASCOTTES & ANIMATION DU BISOU EN DIRECT
   ========================================================= */
.kawaii-duo-stage {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 40px;
  position: relative;
  z-index: 5;
  width: 100%;
}

.kawaii-creature {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  cursor: pointer;
  animation: creatureBreathe 3s infinite ease-in-out;
  transition: transform 0.65s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes creatureBreathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

/* ========== LORS DU GROS BISOU (ANIMATION VISIBLE EN CONTACT) ========== */
.creature-white.kissing-active {
  transform: translateX(65px) translateY(-8px) rotate(14deg);
  z-index: 10;
}

.creature-brown.kissing-active {
  transform: translateX(-65px) translateY(-4px) rotate(-10deg);
  z-index: 9;
}

/* Paws pendant le bisou (câlin des bras) */
.creature-white.kissing-active #pawWhiteRight {
  transform: rotate(-60deg) translate(8px, -6px);
  animation: pawHug 1.5s infinite alternate ease-in-out;
}

.creature-brown.kissing-active #pawBrownLeft {
  transform: rotate(60deg) translate(-8px, -6px);
  animation: pawHug 1.5s infinite alternate-reverse ease-in-out;
}

@keyframes pawHug {
  0% { transform: rotate(-50deg); }
  100% { transform: rotate(-70deg) translateY(-2px); }
}

/* ZONE CENTRALE DU BISOU (BADGE ET CŒUR PULSANT ENTRE LEURS BOUCHES) */
.kiss-zone-center {
  position: absolute;
  top: 65px;
  left: 50%;
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
}

.kiss-zone-center.show {
  display: flex;
  animation: kissSurge 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes kissSurge {
  0% { transform: translateX(-50%) scale(0.3); opacity: 0; }
  100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.smooch-pop-badge {
  background: #ff4d6d;
  color: #fff;
  border: 2.5px solid var(--ink-soft);
  font-size: 0.95rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(255, 77, 109, 0.4);
  animation: badgeWiggle 1s infinite alternate ease-in-out;
  margin-bottom: 2px;
}

@keyframes badgeWiggle {
  0% { transform: rotate(-6deg) scale(1); }
  100% { transform: rotate(6deg) scale(1.08); }
}

.kiss-heart-pulse {
  font-size: 2.6rem;
  animation: heartThrob 0.8s infinite alternate ease-in-out;
  filter: drop-shadow(0 4px 12px rgba(255, 77, 109, 0.5));
}

@keyframes heartThrob {
  0% { transform: scale(0.9); }
  100% { transform: scale(1.3); }
}

.kiss-sparkles-floating {
  display: flex;
  gap: 16px;
  font-size: 1.2rem;
  margin-top: -6px;
}
.k-spark {
  animation: sparkRise 1.5s infinite ease-out;
}
.k-spark.s1 { animation-delay: 0s; }
.k-spark.s2 { animation-delay: 0.4s; font-size: 1rem; }
.k-spark.s3 { animation-delay: 0.8s; }

@keyframes sparkRise {
  0% { transform: translateY(0); opacity: 0.8; }
  100% { transform: translateY(-20px); opacity: 0; }
}

/* ACCESSOIRES */
.creature-bow {
  position: absolute;
  top: -8px;
  left: 6px;
  font-size: 1.7rem;
  z-index: 10;
  animation: accessoryTilt 2.5s infinite ease-in-out;
}

.creature-hat {
  position: absolute;
  top: -18px;
  right: 12px;
  font-size: 1.9rem;
  z-index: 10;
  animation: accessoryTilt 2.5s infinite ease-in-out reverse;
}

@keyframes accessoryTilt {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(8deg); }
}

/* TÊTE RONDE */
.creature-head {
  width: 110px;
  height: 94px;
  border: var(--outline-cute);
  border-radius: 55px 55px 48px 48px;
  position: relative;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.creature-white .creature-head,
.creature-white .creature-body,
.creature-white .ear,
.creature-white .paw,
.creature-white .foot {
  background: #ffffff;
}

.creature-brown .creature-head,
.creature-brown .creature-body,
.creature-brown .ear,
.creature-brown .paw,
.creature-brown .foot {
  background: #ffd29d;
}

.ears-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  position: absolute;
  top: -16px;
  z-index: -1;
}

.ear {
  width: 32px;
  height: 32px;
  border: var(--outline-cute);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inner-ear {
  width: 16px;
  height: 16px;
  background: #ffb4c2;
  border-radius: 50%;
}

.eyes-row {
  display: flex;
  gap: 34px;
  margin-top: 10px;
}

.kawaii-eye {
  width: 13px;
  height: 15px;
  background: var(--ink-soft);
  border-radius: 50%;
  position: relative;
  animation: eyeBlink 4s infinite;
}

.sparkle-spark {
  width: 5px;
  height: 5px;
  background: #ffffff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
}

/* YEUX FERMÉS TOUT HEUREUX (PENDANT LE BISOU ^ ^) */
.kawaii-eye.eye-closed {
  height: 6px;
  border-radius: 8px 8px 0 0;
  border-top: 3.5px solid var(--ink-soft);
  background: transparent;
  animation: none;
}
.kawaii-eye.eye-closed .sparkle-spark {
  display: none;
}

@keyframes eyeBlink {
  0%, 96%, 100% { transform: scaleY(1); }
  98% { transform: scaleY(0.1); }
}

.blush-row {
  position: absolute;
  top: 48px;
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0 14px;
}

.blush-cheek {
  width: 16px;
  height: 10px;
  background: #ff9ebb;
  border-radius: 50%;
  opacity: 0.75;
  transition: all 0.3s ease;
}

/* Blush extra rose lors du bisou */
.blush-cheek.blush-extra {
  background: #ff3366;
  opacity: 1;
  transform: scale(1.4);
  box-shadow: 0 0 14px rgba(255, 51, 102, 0.7);
}

.mouth-cute {
  margin-top: 4px;
  border-bottom: 2.5px solid var(--ink-soft);
  transition: all 0.2s ease;
}

.mouth-happy {
  width: 14px;
  height: 6px;
  border-radius: 0 0 10px 10px;
}

/* BOUCHE DE BISOU QUI S'AVANCE VERS L'AUTRE (PUCKER) */
.mouth-kissing-pucker {
  width: 14px;
  height: 10px;
  background: #ff4d6d;
  border: 2px solid var(--ink-soft);
  border-radius: 50%;
  transform: translateX(10px) rotate(-10deg);
  box-shadow: 0 2px 6px rgba(255, 77, 109, 0.4);
}

.mouth-bigsmile {
  width: 16px;
  height: 10px;
  background: #ff758f;
  border: 2px solid var(--ink-soft);
  border-radius: 2px 2px 14px 14px;
}

.creature-body {
  width: 90px;
  height: 68px;
  border: var(--outline-cute);
  border-radius: 40px 40px 32px 32px;
  margin-top: -14px;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

.belly-patch {
  width: 46px;
  height: 42px;
  background: #fff6eb;
  border-radius: 50%;
  position: absolute;
  bottom: 8px;
}

.paw {
  width: 20px;
  height: 24px;
  border: var(--outline-cute);
  border-radius: 12px;
  position: absolute;
  top: 10px;
  transition: transform 0.4s ease;
}
.paw-left { left: -8px; transform: rotate(15deg); }
.paw-right { right: -8px; transform: rotate(-15deg); }

.paw-wave {
  animation: pawWaving 1.4s infinite ease-in-out;
  transform-origin: bottom center;
}

@keyframes pawWaving {
  0%, 100% { transform: rotate(-10deg); }
  50% { transform: rotate(25deg); }
}

.feet-row {
  display: flex;
  gap: 22px;
  margin-top: -8px;
  z-index: 2;
}

.foot {
  width: 24px;
  height: 14px;
  border: var(--outline-cute);
  border-radius: 10px 10px 8px 8px;
}

.char-tag {
  background: #fff;
  border: 2px solid var(--ink-soft);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 8px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

/* =========================================================
   GÂTEAU D'ANNIVERSAIRE AVEC BOUGIES FLAMBOYANTES
   Deux étages, glaçage qui coule, vermicelles et plateau
   ========================================================= */
.birthday-cake-center {
  --frosting-pink: #ff9fb6;
  --frosting-cream: #fffaf2;

  display: none;
  flex-direction: column;
  align-items: center;
  position: relative;
  margin-bottom: 4px;
  z-index: 10;
  animation: cakeAppear 0.55s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
}

.birthday-cake-center.show {
  display: flex;
}

@keyframes cakeAppear {
  0% { transform: scale(0.3) translateY(40px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Lueur chaude des bougies, qui s'éteint avec elles */
.cake-glow {
  position: absolute;
  top: -46px;
  left: 50%;
  width: 190px;
  height: 140px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(255, 209, 102, 0.55) 0%, rgba(255, 209, 102, 0.18) 55%, transparent 100%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.6s ease;
  animation: cakeGlowPulse 2.4s infinite ease-in-out;
}

.birthday-cake-center.is-blown .cake-glow {
  animation: none;
  opacity: 0;
}

@keyframes cakeGlowPulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* Bougies */
.cake-candles {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  position: relative;
  z-index: 1;
  margin-bottom: -7px;
}

.candle {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.candle-1 { --candle-color: #ff8fab; }
.candle-2 { --candle-color: #7fd1ae; }
.candle-3 { --candle-color: #b49cff; }

.stick {
  width: 10px;
  height: 30px;
  background: repeating-linear-gradient(-45deg, var(--candle-color) 0 4px, #ffffff 4px 8px);
  border: 2px solid var(--ink-soft);
  border-radius: 4px 4px 2px 2px;
}

.candle-2 .stick {
  height: 38px;
}

.wick {
  width: 2px;
  height: 5px;
  background: var(--ink-soft);
  border-radius: 1px;
}

.flame {
  width: 12px;
  height: 20px;
  margin-bottom: -1px;
  background: radial-gradient(ellipse at 50% 72%, #ffffff 0 16%, #fff3b0 30%, #ffbe0b 62%, #ff7b54 100%);
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  box-shadow: 0 0 10px 2px rgba(255, 190, 11, 0.7), 0 0 24px 8px rgba(255, 190, 11, 0.25);
  transform-origin: bottom center;
  animation: flameFlicker 0.35s infinite alternate ease-in-out;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

@keyframes flameFlicker {
  0% { transform: scaleY(1) rotate(-3deg); }
  100% { transform: scaleY(1.18) rotate(4deg); }
}

.flame.blown-out {
  animation: none;
  transform: scale(0);
  opacity: 0;
}

.smoke {
  position: absolute;
  top: -14px;
  width: 6px;
  height: 14px;
  border-radius: 50%;
  background: rgba(170, 165, 180, 0.55);
  filter: blur(1px);
  opacity: 0;
}

.smoke.active {
  animation: smokeRise 1.4s forwards ease-out;
}

@keyframes smokeRise {
  0% { opacity: 0.85; transform: translateY(0) scale(1); }
  60% { opacity: 0.45; transform: translate(4px, -20px) scale(2); }
  100% { opacity: 0; transform: translate(-3px, -34px) scale(2.8); }
}

/* Étages */
.cake-tier {
  position: relative;
  z-index: 2;
  border: var(--outline-cute);
}

.tier-top {
  width: 120px;
  height: 46px;
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(180deg, #fff6e2 0%, #ffe6bd 100%);
}

.tier-bottom {
  width: 164px;
  height: 58px;
  margin-top: -3px;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(180deg, #ffd9e2 0%, #ffc1d0 100%);
}

/* Glaçage qui coule (bande pleine + gouttes arrondies) */
.tier-drip {
  position: absolute;
  inset: 0 0 auto 0;
  height: 24px;
  border-radius: 13px 13px 0 0;
  --drip: var(--frosting-pink);
  background:
    linear-gradient(var(--drip), var(--drip)) top / 100% 10px no-repeat,
    radial-gradient(circle at 50% 0, var(--drip) 0 8px, transparent 8.5px) 0 4px / 20px 16px repeat-x,
    radial-gradient(ellipse 5px 11px at 50% 0, var(--drip) 0 96%, transparent 100%) 9px 6px / 34px 20px repeat-x;
}

.tier-bottom .tier-drip {
  --drip: var(--frosting-cream);
  border-radius: 15px 15px 0 0;
}

.tier-sprinkles {
  position: absolute;
  inset: 26px 12px 10px;
  background:
    radial-gradient(circle, #7fd1ae 1.6px, transparent 2.1px) 0 0 / 22px 14px,
    radial-gradient(circle, #ffd166 1.6px, transparent 2.1px) 11px 7px / 22px 14px,
    radial-gradient(circle, #b49cff 1.5px, transparent 2px) 5px 3px / 31px 17px;
}

.cake-plaque {
  position: absolute;
  left: 50%;
  bottom: 9px;
  transform: translateX(-50%);
  z-index: 1;
  min-width: 34px;
  padding: 0 10px;
  background: #ffffff;
  border: 2px solid var(--ink-soft);
  border-radius: 999px;
  font-family: var(--font-cute);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: var(--color-cta, #e0245e);
}

.cake-berry {
  position: absolute;
  top: -14px;
  font-size: 1.05rem;
  line-height: 1;
  z-index: 3;
}
.cake-berry.b1 { left: -4px; transform: rotate(-12deg); }
.cake-berry.b2 { left: 50%; top: -9px; transform: translateX(-50%); font-size: 0.95rem; }
.cake-berry.b3 { right: -4px; transform: rotate(12deg); }

/* Plateau */
.cake-plate {
  position: relative;
  z-index: 1;
  width: 190px;
  height: 16px;
  margin-top: -7px;
  background: linear-gradient(180deg, #ffffff 0%, #f1e8ee 100%);
  border: var(--outline-cute);
  border-radius: 50%;
  box-shadow: 0 8px 14px rgba(74, 62, 61, 0.12);
}

/* =========================================================
   LE CADEAU PASTEL REBONDISSANT
   Nœud, pois, étiquette, ombre au sol et rayons à l'ouverture
   ========================================================= */
.gift-showcase-zone {
  display: none;
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, #fff9fb 0%, #fdeef4 70%);
  z-index: 25;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
}

.gift-showcase-zone.show {
  display: flex;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.gift-stage {
  position: relative;
  width: 250px;
  height: 236px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 16px;
}

.sparkling-halo {
  position: absolute;
  inset: 6px 10px 20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.45) 0%, rgba(255, 182, 193, 0.35) 42%, transparent 70%);
  animation: haloPulse 2.6s infinite ease-in-out;
}

@keyframes haloPulse {
  0%, 100% { transform: scale(0.94); opacity: 0.8; }
  50% { transform: scale(1.06); opacity: 1; }
}

.gift-rays {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 440px;
  height: 440px;
  translate: -50% -56%;
  scale: 0.3;
  opacity: 0;
  background: repeating-conic-gradient(from 0deg, rgba(255, 209, 102, 0.6) 0 9deg, transparent 9deg 30deg);
  -webkit-mask: radial-gradient(circle, #000 18%, transparent 66%);
  mask: radial-gradient(circle, #000 18%, transparent 66%);
  transition: opacity 0.4s ease, scale 0.9s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
  animation: raysSpin 10s linear infinite;
  pointer-events: none;
}

.gift-showcase-zone.is-opened .gift-rays {
  opacity: 1;
  scale: 1;
}

@keyframes raysSpin {
  to { rotate: 360deg; }
}

.gift-twinkle {
  position: absolute;
  font-size: 1.1rem;
  animation: gateTwinkle 2.4s infinite ease-in-out;
  pointer-events: none;
}
.gift-twinkle.t1 { top: 18px; left: 14px; }
.gift-twinkle.t2 { top: 34px; right: 10px; font-size: 1rem; animation-delay: 0.6s; }
.gift-twinkle.t3 { bottom: 70px; left: 0; font-size: 0.95rem; animation-delay: 1.2s; }
.gift-twinkle.t4 { bottom: 96px; right: -2px; animation-delay: 1.8s; }

/* La boîte */
.kawaii-gift-box {
  width: 170px;
  height: 172px;
  position: relative;
  z-index: 2;
  cursor: pointer;
  transition: transform 0.3s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
  animation: cuteRattle 1.8s infinite ease-in-out;
  outline: none;
}

.kawaii-gift-box:hover {
  transform: scale(1.08) rotate(-3deg);
}

.kawaii-gift-box.opened {
  animation: none;
  transform: none;
}

@keyframes cuteRattle {
  0%, 80%, 100% { transform: scale(1) rotate(0deg); }
  85% { transform: scale(1.06) rotate(-4deg); }
  90% { transform: scale(1.06) rotate(4deg); }
  95% { transform: scale(1.03) rotate(-2deg); }
}

.gift-cube {
  position: absolute;
  bottom: 0;
  left: 10px;
  width: 150px;
  height: 112px;
  border: var(--outline-cute);
  border-radius: 12px 12px 18px 18px;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 3.5px, transparent 4px) 0 0 / 26px 26px,
    radial-gradient(circle, rgba(255, 255, 255, 0.8) 3.5px, transparent 4px) 13px 13px / 26px 26px,
    linear-gradient(160deg, #ffc6d4 0%, #ff9fb6 100%);
  box-shadow: inset -12px -10px 0 rgba(224, 36, 94, 0.08);
  overflow: hidden;
  transform-origin: bottom center;
}

.cube-ribbon,
.lid-ribbon {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 28px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #fff3b0 0%, #ffe38a 100%);
  border-left: 2px solid var(--ink-soft);
  border-right: 2px solid var(--ink-soft);
}

/* Étiquette suspendue */
.sweet-tag {
  position: absolute;
  bottom: 14px;
  right: 8px;
  z-index: 3;
  max-width: 138px;
  padding: 3px 8px 3px 15px;
  background: #ffffff;
  border: 2px solid var(--ink-soft);
  border-radius: 5px 10px 10px 5px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transform: rotate(-7deg);
  transform-origin: left center;
}

.sweet-tag::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--color-pink-soft);
  border: 1.5px solid var(--ink-soft);
}

/* Couvercle */
.gift-lid-box {
  position: absolute;
  top: 30px;
  left: 0;
  z-index: 3;
  width: 170px;
  height: 40px;
  transition: transform 0.75s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1)), opacity 0.5s ease 0.25s;
}

.lid-rim {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: linear-gradient(180deg, #ffb3c6 0%, #ff8fab 100%);
  border: var(--outline-cute);
  border-radius: 14px;
  box-shadow: 0 5px 0 rgba(224, 36, 94, 0.12);
}

.lid-rim::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 12px;
  width: 36px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
}

/* Le nœud */
.gift-bow {
  position: absolute;
  top: -32px;
  left: 50%;
  width: 100px;
  height: 46px;
  transform: translateX(-50%);
  z-index: 4;
  animation: bowWiggle 1.8s infinite ease-in-out;
  transform-origin: 50% 80%;
}

@keyframes bowWiggle {
  0%, 78%, 100% { transform: translateX(-50%) rotate(0deg); }
  86% { transform: translateX(-50%) rotate(-6deg); }
  93% { transform: translateX(-50%) rotate(5deg); }
}

.bow-loop {
  position: absolute;
  top: 4px;
  width: 42px;
  height: 32px;
  background: linear-gradient(180deg, #fff3b0 0%, #ffd76a 100%);
  border: 2.5px solid var(--ink-soft);
  border-radius: 70% 30% 30% 70% / 60% 40% 60% 40%;
}

.bow-loop::after {
  content: '';
  position: absolute;
  top: 9px;
  right: 6px;
  width: 14px;
  height: 10px;
  border-radius: 50%;
  background: rgba(214, 154, 20, 0.35);
}

.bow-loop.left {
  left: 4px;
  transform: rotate(-12deg);
}

.bow-loop.right {
  right: 4px;
  transform: scaleX(-1) rotate(-12deg);
}

.bow-knot {
  position: absolute;
  top: 13px;
  left: 50%;
  width: 20px;
  height: 20px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, #ffe38a 0%, #ffc94a 100%);
  border: 2.5px solid var(--ink-soft);
  border-radius: 8px;
  z-index: 2;
}

.bow-tail {
  position: absolute;
  top: 26px;
  width: 13px;
  height: 30px;
  background: #ffe38a;
  border: 2px solid var(--ink-soft);
  border-radius: 2px 2px 3px 3px;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
}
.bow-tail.left { left: 35px; transform: rotate(20deg); }
.bow-tail.right { right: 35px; transform: rotate(-20deg); }

/* Ombre au sol, qui suit le petit tremblement */
.gift-shadow {
  position: absolute;
  bottom: 8px;
  left: 50%;
  width: 156px;
  height: 18px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(74, 62, 61, 0.2) 0%, transparent 70%);
  animation: giftShadow 1.8s infinite ease-in-out;
}

@keyframes giftShadow {
  0%, 80%, 100% { transform: translateX(-50%) scaleX(1); }
  88% { transform: translateX(-50%) scaleX(1.08); }
}

/* Ouverture : le couvercle s'envole, la boîte rebondit */
.kawaii-gift-box.opened .gift-lid-box {
  transform: translate(46px, -130px) rotate(28deg);
  opacity: 0;
}

.kawaii-gift-box.opened .gift-bow {
  animation: none;
}

.kawaii-gift-box.opened .gift-cube {
  animation: giftSquish 0.7s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1)) forwards;
}

@keyframes giftSquish {
  0% { transform: scale(1); }
  30% { transform: scale(1.14, 0.84); }
  60% { transform: scale(0.95, 1.08); }
  100% { transform: scale(1); }
}

/* Invitation à toucher */
.open-me-prompt {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: var(--outline-cute);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-pink-text, #c81e4f);
  box-shadow: 0 4px 12px rgba(224, 36, 94, 0.18);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.tap-hand {
  display: inline-block;
  animation: tapBob 1.2s infinite ease-in-out;
}

@keyframes tapBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.gift-showcase-zone.is-opened .open-me-prompt {
  opacity: 0;
  transform: translateY(8px);
}

/* =========================================================
   BARRE BASSE & FOOTER
   ========================================================= */
.scene-subtext-bar {
  display: none;
}

.kawaii-footer {
  padding: 16px 24px;
  background: #fff8fa;
  border-top: var(--outline-cute);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dots-tracker {
  display: flex;
  gap: 10px;
}

.dot-candy {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #eedfe3;
  border: 2px solid var(--ink-soft);
  cursor: pointer;
  transition: all 0.25s ease;
}

.dot-candy.active {
  background: var(--color-pink-bubble);
  transform: scale(1.35);
}

.nav-button-group {
  display: flex;
  gap: 12px;
}

.candy-btn {
  border: var(--outline-cute);
  padding: 10px 22px;
  border-radius: 999px;
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.candy-btn.primary {
  background: var(--color-pink-bubble);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 117, 143, 0.4);
}
.candy-btn.primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  background: var(--color-pink-deep);
}

.candy-btn.secondary {
  background: #ffffff;
  color: var(--ink-soft);
}
.candy-btn.secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #fff0f3;
}

.candy-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* =========================================================
   MODALE DU CADEAU RÉVÉLÉ
   Carte de vœux : bandeau festonné, cachet cœur, lettre
   ========================================================= */
.sweet-modal-backdrop {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(255, 159, 182, 0.35) 0%, rgba(74, 46, 56, 0.72) 70%);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  overflow-y: auto;
}

.sweet-modal-backdrop.open {
  display: flex;
  animation: fadeIn 0.3s ease;
}

.sweet-card {
  --head-bg: #ffc8d6;

  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto;
  overflow: hidden;
  background: #ffffff;
  border: var(--outline-cute);
  border-radius: 32px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(74, 46, 56, 0.35), 0 10px 24px rgba(224, 36, 94, 0.18);
  animation: sweetPop 0.55s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
}

@keyframes sweetPop {
  0% { transform: scale(0.6) translateY(50px) rotate(-4deg); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

/* ---------- Bandeau ---------- */
.sweet-card-head {
  position: relative;
  padding: 34px 24px 46px;
  background: linear-gradient(160deg, #ffe0e8 0%, var(--head-bg) 100%);
}

/* Bord festonné, comme une carte découpée */
.sweet-card-head::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -11px;
  height: 12px;
  background: radial-gradient(circle at 50% 0, var(--head-bg) 0 10px, transparent 10.5px) 0 0 / 22px 12px repeat-x;
}

.head-confetti {
  position: absolute;
  inset: 0;
  opacity: 0.9;
  background:
    radial-gradient(circle, #ffffff 2.5px, transparent 3px) 0 0 / 38px 30px,
    radial-gradient(circle, #ffe38a 2.5px, transparent 3px) 19px 15px / 38px 30px,
    radial-gradient(circle, #b8ecd2 2px, transparent 2.5px) 9px 22px / 47px 34px;
  -webkit-mask: linear-gradient(180deg, #000 0%, transparent 85%);
  mask: linear-gradient(180deg, #000 0%, transparent 85%);
}

.head-float {
  position: absolute;
  font-size: 1.7rem;
  animation: balloonFloat 4s infinite ease-in-out;
}
.head-float.hf1 { top: 16px; left: 18px; }
.head-float.hf2 { top: 22px; right: 18px; font-size: 1.5rem; animation-delay: 1.4s; }

.card-title {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0;
}

.title-eyebrow {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--color-pink-text, #c81e4f);
}

.title-name {
  font-size: clamp(2rem, 8vw, 2.7rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink-soft);
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.9);
  text-wrap: balance;
  overflow-wrap: anywhere;
}

/* Cachet cœur posé sur la jointure */
.love-seal {
  position: absolute;
  left: 50%;
  bottom: -38px;
  z-index: 2;
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  transform: translateX(-50%) rotate(-8deg);
  font-size: 1.8rem;
  background: #ffffff;
  border: var(--outline-cute);
  border-radius: 50%;
  box-shadow: 0 6px 16px rgba(224, 36, 94, 0.25);
  animation: sealBeat 1.6s infinite ease-in-out;
}

@keyframes sealBeat {
  0%, 100% { transform: translateX(-50%) rotate(-8deg) scale(1); }
  15% { transform: translateX(-50%) rotate(-8deg) scale(1.12); }
  30% { transform: translateX(-50%) rotate(-8deg) scale(1); }
  45% { transform: translateX(-50%) rotate(-8deg) scale(1.08); }
}

/* ---------- Corps ---------- */
.sweet-card-body {
  padding: 54px 26px 18px;
}

/* Les 3 piliers précieux qu'il incarne */
.trinity-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-bottom: 18px;
}

.trinity-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border: 2px solid var(--ink-soft);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 3px 0 rgba(74, 62, 61, 0.12);
}

.pill-brother { background: #e0f2fe; color: #075985; }
.pill-teacher { background: #fef3c7; color: #92400e; }
.pill-love { background: #ffe4e6; color: #be123c; }

/* La lettre */
.love-letter {
  position: relative;
  margin-bottom: 22px;
  padding: 22px 22px 20px;
  background: #fffaf3;
  border: 2px dashed #f3b8c8;
  border-radius: 22px;
  text-align: left;
}

.love-letter::before {
  content: '\201C';
  position: absolute;
  top: 6px;
  right: 14px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 3.2rem;
  line-height: 1;
  color: #ffb3c6;
  pointer-events: none;
}

.card-message-text {
  font-family: var(--font-text);
  font-size: 1.02rem;
  line-height: 1.65;
  color: #554a49;
  text-wrap: pretty;
}

.card-message-text p + p {
  margin-top: 12px;
}

.card-message-text p:first-child:not(:only-child) {
  padding-right: 34px;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.card-message-text p:last-child:not(:only-child),
.highlight-line {
  font-weight: 700;
  color: var(--color-pink-text, #c81e4f);
}

/* Le bouton vers le vrai cadeau */
.action-btn-wrapper {
  margin: 0 0 8px;
}

.super-candy-btn {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-height: 58px;
  padding: 14px 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, var(--color-cta, #e0245e), #d81b60);
  border: var(--outline-cute);
  border-radius: 999px;
  color: #ffffff;
  font-family: var(--font-cute);
  font-size: clamp(1rem, 3.6vw, 1.15rem);
  font-weight: 700;
  letter-spacing: 0.3px;
  text-decoration: none;
  box-shadow: 0 6px 0 #a3153f, 0 14px 28px rgba(224, 36, 94, 0.35);
  transition: transform 0.2s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1)), box-shadow 0.2s ease;
}

/* Reflet qui passe sur le bouton */
.super-candy-btn::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  transform: skewX(-20deg);
  animation: btnShine 3s infinite ease-in-out 1.2s;
}

@keyframes btnShine {
  0%, 60% { left: -60%; }
  100% { left: 130%; }
}

.super-candy-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 0 #a3153f, 0 18px 32px rgba(224, 36, 94, 0.4);
}

.super-candy-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #a3153f, 0 8px 16px rgba(224, 36, 94, 0.3);
}

.super-candy-btn svg {
  flex-shrink: 0;
  transition: transform 0.25s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1));
}

.super-candy-btn:hover svg {
  transform: translateX(4px);
}

.text-replay-btn {
  min-height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  border-radius: 999px;
  color: var(--ink-muted, #6b5f5e);
  font-family: var(--font-cute);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.text-replay-btn:hover {
  color: var(--ink-soft);
  background: #fff0f4;
}

/* Apparition en cascade */
.sweet-modal-backdrop.open .reveal {
  animation: revealUp 0.5s var(--ease-bounce, cubic-bezier(0.34, 1.56, 0.64, 1)) both;
  animation-delay: calc(var(--i, 0) * 80ms + 250ms);
}

.title-eyebrow.reveal,
.title-name.reveal {
  display: block;
}

@keyframes revealUp {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: none; }
}

@media (max-width: 650px) {
  .sweet-modal-backdrop {
    padding: 14px;
  }

  .sweet-card {
    border-radius: 28px;
  }

  .sweet-card-head {
    padding: 30px 18px 42px;
  }

  .head-float { font-size: 1.35rem; }

  .sweet-card-body {
    padding: 42px 16px 14px;
  }

  .love-letter {
    padding: 20px 16px 16px;
  }

  .card-message-text {
    font-size: 0.98rem;
    line-height: 1.6;
  }

  .trinity-pill {
    font-size: 0.75rem;
    padding: 5px 11px;
  }

  .sweet-card-body {
    padding-top: 50px;
  }

  .super-candy-btn {
    padding: 14px 18px;
    gap: 8px;
    font-size: 0.92rem;
    letter-spacing: 0;
  }
}

/* =========================================================
   ÉCRAN D'ACCUEIL SIMPLE AVEC BOUTON PLAY
   ========================================================= */
.autoplay-gate-overlay {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 245, 248, 0.98) 0%, rgba(255, 235, 240, 0.98) 100%);
  backdrop-filter: blur(10px);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.autoplay-card {
  background: #ffffff;
  border: var(--outline-cute);
  border-radius: 32px;
  padding: 38px 30px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 16px 45px rgba(255, 117, 143, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  animation: sweetPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.gate-icon-bounce {
  font-size: 3rem;
  animation: cuteBob 1.5s infinite ease-in-out;
}

.gate-title {
  font-family: var(--font-cute);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0;
}

.play-start-btn {
  background: linear-gradient(135deg, #ff758f 0%, #ff4d6d 100%);
  color: #ffffff;
  border: var(--outline-cute);
  border-radius: 999px;
  padding: 16px 30px;
  font-family: var(--font-cute);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(255, 77, 109, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  animation: playPulse 1.8s infinite ease-in-out;
  margin-top: 6px;
}

.play-start-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 12px 28px rgba(255, 77, 109, 0.55);
  background: linear-gradient(135deg, #ff6381 0%, #ff3355 100%);
}

.play-start-btn:active {
  transform: translateY(1px) scale(0.98);
}

.play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: #ffffff;
  color: #ff4d6d;
  border-radius: 50%;
  font-size: 0.95rem;
  font-weight: 900;
  padding-left: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@keyframes playPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* =========================================================
   MODALE DE CONFIGURATION
   ========================================================= */
.config-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 250;
  padding: 20px;
}

.config-modal-backdrop.open {
  display: flex;
}

.config-window {
  background: #ffffff;
  border: var(--outline-cute);
  border-radius: 28px;
  width: 100%;
  max-width: 500px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.config-header {
  background: #ffe5ec;
  border-bottom: var(--outline-cute);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.config-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.x-btn {
  background: transparent;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--ink-soft);
}

.config-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.config-body::-webkit-scrollbar {
  width: 8px;
}
.config-body::-webkit-scrollbar-track {
  background: #fff0f3;
  border-radius: 10px;
}
.config-body::-webkit-scrollbar-thumb {
  background: #ffb4c2;
  border-radius: 10px;
}
.config-body::-webkit-scrollbar-thumb:hover {
  background: var(--color-pink-bubble);
}

.field-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: left;
}

.field-item label {
  font-size: 0.85rem;
  font-weight: 700;
}

.field-item input,
.field-item textarea {
  border: 2px solid var(--ink-soft);
  border-radius: 12px;
  padding: 10px 14px;
  font-family: var(--font-cute);
  font-size: 0.95rem;
  outline: none;
}

.field-item input:focus,
.field-item textarea:focus {
  border-color: var(--color-pink-deep);
}

.tip {
  font-size: 0.75rem;
  color: #8c8180;
}

/* CONTRÔLE DU SON DANS LA MODALE */
.sound-toggle-card {
  width: 100%;
}

.modal-sound-btn {
  width: 100%;
  background: #fdf2f8;
  border: 2px solid var(--color-pink-bubble);
  color: var(--ink-soft);
  padding: 12px 18px;
  border-radius: 14px;
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 117, 143, 0.15);
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sound-btn:hover {
  transform: translateY(-2px);
  background: #fce7f3;
}

.modal-sound-btn.active {
  background: #ecfdf5;
  border-color: #10b981;
  color: #065f46;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.modal-sound-btn.muted {
  background: #f3f4f6;
  border-color: #d1d5db;
  color: #6b7280;
  box-shadow: none;
}

/* SÉLECTEUR DE MUSIQUE */
.audio-import-box {
  background: #fff8fa;
  border: 2px dashed var(--color-pink-bubble);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.browse-audio-btn {
  background: #ffffff;
  border: 2px solid var(--ink-soft);
  color: var(--ink-soft);
  padding: 10px 18px;
  border-radius: 999px;
  font-family: var(--font-cute);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.browse-audio-btn:hover {
  transform: translateY(-2px);
  background: #fff0f3;
  border-color: var(--color-pink-deep);
}

.audio-current-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #635857;
  max-width: 90%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.audio-mini-controls {
  display: flex;
  gap: 8px;
}

.preview-mini-btn {
  background: #e0f2fe;
  color: #0369a1;
  border: 1.5px solid #7dd3fc;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--font-cute);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.preview-mini-btn:hover {
  background: #bae6fd;
}

.preview-mini-btn.remove {
  background: #ffe4e6;
  color: #be123c;
  border-color: #fda4af;
}

.preview-mini-btn.remove:hover {
  background: #fecdd3;
}

/* OUTIL DE ROGNAGE (TRIMMER) */
.audio-trimmer-card {
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #ffccd5;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
  margin-top: 6px;
}

.trimmer-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4a3e3d;
  text-align: left;
}

.trimmer-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-scrubber-slider {
  flex: 1;
  height: 6px;
  accent-color: var(--color-pink-bubble);
  cursor: pointer;
}

.trimmer-time-display {
  font-family: monospace;
  font-size: 0.78rem;
  font-weight: 700;
  color: #6a605f;
  min-width: 85px;
  text-align: right;
}

.trimmer-inputs-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.time-input-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.time-input-group label {
  font-size: 0.68rem;
  color: #726b77;
  font-weight: 600;
}

.time-digit-input {
  width: 50px;
  text-align: center;
  font-family: monospace;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1.5px solid var(--ink-soft);
  border-radius: 8px;
  padding: 4px;
  outline: none;
}
.time-digit-input:focus {
  border-color: var(--color-pink-deep);
}

.time-sep {
  font-weight: 900;
  font-size: 1.2rem;
  margin-top: 10px;
}

.trim-action-pill {
  background: #fdf2f8;
  color: #be185d;
  border: 1.5px solid #fbcfe8;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-cute);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.2s;
}
.trim-action-pill:hover {
  background: #fce7f3;
  transform: translateY(-1px);
}

.trim-action-pill.test-btn {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}
.trim-action-pill.test-btn:hover {
  background: #d1fae5;
}

.trim-helper-text {
  font-size: 0.75rem;
  color: #4a3e3d;
  background: #fff0f3;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #ffccd5;
}

.config-footer {
  padding: 14px 20px;
  display: flex;
  justify-content: flex-end;
  background: #ffffff;
  border-top: 1.5px solid #ffe5ec;
  flex-shrink: 0;
}

.save-candy-btn {
  background: var(--color-pink-deep);
  color: #fff;
  border: var(--outline-cute);
  padding: 12px 24px;
  border-radius: 999px;
  font-family: var(--font-cute);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.save-candy-btn:hover {
  transform: translateY(-2px);
  background: #ff3355;
}

/* =========================================================
   RESPONSIVE (MOBILE)
   ========================================================= */
@media (min-width: 768px) {
  .characters-meadow {
    min-height: 440px;
  }

  .kawaii-duo-stage {
    transform: scale(1.18);
    transform-origin: bottom center;
  }
}

@media (max-width: 650px) {
  .characters-meadow {
    min-height: 380px;
  }

  .sunny-cloud {
    top: 128px;
    right: 4%;
    transform-origin: right center;
    scale: 0.7;
  }

  .balloon-1 { top: 135px; left: 3%; font-size: 1.4rem; }
  .balloon-2 { display: none; }
  .balloon-3 { top: 215px; right: 3%; font-size: 1.2rem; }

  .kawaii-duo-stage.with-cake {
    gap: 4px;
    transform: scale(0.8);
  }

  .card-message-text {
    font-size: 1rem;
    line-height: 1.55;
  }

  .kawaii-duo-stage {
    gap: 16px;
    transform: scale(0.9);
  }

  .creature-white.kissing-active {
    transform: translateX(45px) translateY(-6px) rotate(12deg);
  }

  .creature-brown.kissing-active {
    transform: translateX(-45px) translateY(-4px) rotate(-8deg);
  }

  .birthday-cake-center {
    transform: scale(0.85);
  }

  .kawaii-speech-bubble p {
    font-size: 0.95rem;
  }

  .kawaii-footer {
    flex-direction: column;
    gap: 14px;
  }

  .nav-button-group {
    width: 100%;
    justify-content: space-between;
  }
}


/* =========================================================
   FINITIONS DESIGN
   Accessibilité, accueil, décor, navigation et carte finale
   ========================================================= */

body {
  min-height: 100dvh;
}

button,
a {
  touch-action: manipulation;
}

:focus-visible {
  outline: 3px solid var(--color-cta);
  outline-offset: 3px;
}

.kawaii-gift-box:focus-visible {
  outline-offset: 10px;
  border-radius: 24px;
}

/* ---------- Écran d'accueil ---------- */
.autoplay-card {
  position: relative;
  overflow: hidden;
  gap: 10px;
  padding: 46px 32px 28px;
  max-width: 440px;
}

.autoplay-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 10px;
  background: repeating-linear-gradient(90deg,
    var(--color-pink-soft) 0 24px,
    var(--color-vanilla) 24px 48px,
    var(--color-mint) 48px 72px);
  border-bottom: 2px solid var(--ink-soft);
}

.gate-envelope {
  position: relative;
  width: 104px;
  height: 104px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #ffe5ec 70%);
  border: var(--outline-cute);
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-fluffy);
}

.gate-heart {
  font-size: 3rem;
  line-height: 1;
  animation: cuteBob 1.8s infinite ease-in-out;
}

.gate-orbit {
  position: absolute;
  font-size: 1.1rem;
  animation: gateTwinkle 2.4s infinite ease-in-out;
}
.gate-orbit.o1 { top: -6px; right: -10px; }
.gate-orbit.o2 { bottom: 2px; left: -16px; animation-delay: 0.8s; }
.gate-orbit.o3 { top: 12px; left: -14px; font-size: 0.9rem; animation-delay: 1.6s; }

@keyframes gateTwinkle {
  0%, 100% { transform: scale(0.8) rotate(-8deg); opacity: 0.6; }
  50% { transform: scale(1.15) rotate(8deg); opacity: 1; }
}

.gate-eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--color-pink-text);
}

.gate-title {
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1.15;
  text-wrap: balance;
}

.gate-subtitle {
  font-family: var(--font-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-muted);
  max-width: 36ch;
  text-wrap: balance;
}

.play-start-btn {
  margin-top: 14px;
  min-height: 58px;
  padding: 12px 30px 12px 12px;
  background: linear-gradient(135deg, var(--color-cta) 0%, #d81b60 100%);
  white-space: nowrap;
  font-size: 1.1rem;
}

.play-start-btn:hover {
  background: linear-gradient(135deg, var(--color-cta-hover) 0%, #c2185b 100%);
}

.play-icon {
  width: 38px;
  height: 38px;
  padding-left: 2px;
  color: var(--color-cta);
}

.gate-hint {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-text);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-muted);
}

/* ---------- En-tête ---------- */
.kawaii-btn.icon-btn {
  width: 46px;
  height: 46px;
  padding: 0;
  justify-content: center;
}

.kawaii-btn.icon-btn svg {
  transition: transform 0.6s var(--ease-bounce);
}

.kawaii-btn.icon-btn:hover svg {
  transform: rotate(90deg);
}

/* ---------- Bandeau de scène ---------- */
.scene-title {
  text-wrap: balance;
}

.scene-title.title-swap {
  animation: titleSwap 0.45s var(--ease-bounce);
}

@keyframes titleSwap {
  0% { opacity: 0; transform: translateY(10px) scale(0.96); }
  100% { opacity: 1; transform: none; }
}

/* ---------- Décor de la clairière ---------- */
.characters-meadow {
  background: linear-gradient(180deg, #e8f3ff 0%, #f3f0ff 55%, #fff3f7 100%);
}

.soft-sun {
  position: absolute;
  top: 108px;
  right: 13%;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff6c2 0%, #ffe38a 60%, #ffd166 100%);
  box-shadow: 0 0 0 12px rgba(255, 227, 138, 0.25), 0 0 40px rgba(255, 209, 102, 0.45);
  animation: sunGlow 5s infinite ease-in-out;
}

@keyframes sunGlow {
  0%, 100% { box-shadow: 0 0 0 10px rgba(255, 227, 138, 0.22), 0 0 34px rgba(255, 209, 102, 0.4); }
  50% { box-shadow: 0 0 0 18px rgba(255, 227, 138, 0.18), 0 0 50px rgba(255, 209, 102, 0.5); }
}

.pastel-hills.back {
  left: -45%;
  right: 15%;
  height: 118px;
  background: #e7f7ea;
  border-top-color: #cfeed6;
}

.meadow-flowers {
  position: absolute;
  inset: auto 0 0 0;
  height: 70px;
  pointer-events: none;
}

.flower {
  position: absolute;
  font-size: 1.15rem;
  transform-origin: bottom center;
  animation: flowerSway 3.2s infinite ease-in-out;
}
.flower.f1 { left: 4%; bottom: 12px; }
.flower.f2 { left: 12%; bottom: 30px; font-size: 0.95rem; animation-delay: 0.6s; }
.flower.f3 { right: 5%; bottom: 16px; animation-delay: 1.1s; }
.flower.f4 { right: 13%; bottom: 34px; font-size: 0.95rem; animation-delay: 1.7s; }

@keyframes flowerSway {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

/* ---------- Barre de navigation ---------- */
.dots-tracker {
  align-items: center;
  gap: 12px;
}

.dot-candy {
  appearance: none;
  position: relative;
  width: 14px;
  height: 14px;
  padding: 0;
  font: inherit;
  transition: width 0.3s var(--ease-bounce), background-color 0.2s ease;
}

/* Zone de toucher agrandie sans changer le dessin */
.dot-candy::before {
  content: '';
  position: absolute;
  inset: -9px;
}

.dot-candy.done {
  background: var(--color-pink-soft);
}

.dot-candy.active {
  width: 32px;
  border-radius: 999px;
  background: var(--color-cta);
  transform: none;
}

.dot-candy:hover:not(.active) {
  background: var(--color-pink-soft);
}

.candy-btn {
  min-height: 48px;
  padding: 10px 22px;
  gap: 8px;
}

.candy-btn.primary {
  background: var(--color-cta);
  box-shadow: 0 6px 16px rgba(224, 36, 94, 0.35);
}

.candy-btn.primary:hover:not(:disabled) {
  background: var(--color-cta-hover);
}

.candy-btn.primary svg {
  transition: transform 0.25s var(--ease-bounce);
}

.candy-btn.primary:hover svg {
  transform: translateX(3px);
}

.candy-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.candy-btn.is-hidden {
  visibility: hidden;
}

/* ---------- Le cadeau ---------- */
.open-me-prompt {
  color: var(--color-pink-text);
  padding: 8px 18px;
}

/* ---------- Paramètres ---------- */
.save-candy-btn {
  background: var(--color-cta);
}

.save-candy-btn:hover {
  background: var(--color-cta-hover);
}

.x-btn {
  min-width: 44px;
  min-height: 44px;
}

/* ---------- Téléphone ---------- */
@media (max-width: 650px) {
  .autoplay-card {
    padding: 40px 22px 24px;
  }

  .play-start-btn {
    width: 100%;
    justify-content: flex-start;
  }

  .play-start-btn .play-text {
    flex: 1;
    text-align: center;
    padding-right: 26px;
  }

  .soft-sun {
    top: 104px;
    right: 9%;
    width: 52px;
    height: 52px;
  }

  .flower { font-size: 0.95rem; }
  .flower.f2, .flower.f4 { display: none; }

  .candy-btn {
    padding: 10px 18px;
  }
}

/* ---------- Animations réduites si demandé ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@keyframes cuteBob {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-6px) rotate(4deg); }
}


/* =========================================================
   RESPONSIVE COMPLET
   La scène s'adapte à la largeur ET à la hauteur de l'écran,
   la carte finale tient dans l'écran et son message défile.
   ========================================================= */

/* Échelle des mascottes : réglée par la taille d'écran */
:root {
  --stage-s: 1;
  --cake-s: 1;
}

@media (min-width: 768px) {
  :root { --stage-s: 1.18; }
}

@media (max-width: 650px) {
  :root { --stage-s: 0.9; --cake-s: 0.89; }
}

@media (max-width: 380px) {
  :root { --cake-s: 0.74; }
}

.kawaii-duo-stage {
  transform: scale(var(--stage-s));
  transform-origin: bottom center;
}

.kawaii-duo-stage.with-cake {
  transform: scale(calc(var(--stage-s) * var(--cake-s)));
}

body {
  padding:
    max(12px, env(safe-area-inset-top))
    max(10px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom))
    max(10px, env(safe-area-inset-left));
}

/* La clairière prend la hauteur disponible, sans excès */
.characters-meadow {
  min-height: clamp(260px, calc(100dvh - 330px), 460px);
}

/* ---------- Écrans de hauteur moyenne ---------- */
@media (max-height: 760px) {
  :root { --stage-s: 0.95; }

  .kawaii-header { margin-bottom: 8px; }
  .scene-header { padding: 12px 18px; gap: 4px; }
}

@media (max-height: 760px) and (max-width: 650px) {
  :root { --stage-s: 0.8; }

  .kawaii-footer {
    padding: 12px 16px;
    gap: 10px;
  }
}

/* ---------- Petits téléphones (hauteur) ---------- */
@media (max-height: 660px) {
  :root { --stage-s: 0.8; }

  body { padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }

  .logo-pill { padding: 6px 14px; font-size: 0.85rem; }
  .kawaii-btn.icon-btn { width: 42px; height: 42px; }

  .scene-header { padding: 8px 16px; }
  .step-chip { font-size: 0.68rem; padding: 3px 12px; }
  .scene-title { font-size: 1.15rem; }

  .characters-meadow { padding-bottom: 14px; }
  .bubble-wrapper { top: 10px; }
  .kawaii-speech-bubble { padding: 10px 16px; border-radius: 18px; }
  .kawaii-speech-bubble p { font-size: 0.9rem; line-height: 1.4; }

  .gift-stage { scale: 0.82; margin: -20px 0; }
  .open-me-prompt { margin-top: 0; font-size: 0.88rem; }

  .candy-btn { min-height: 44px; padding: 8px 16px; }
}

@media (max-height: 660px) and (max-width: 650px) {
  :root { --stage-s: 0.7; }

  .balloon-3 { display: none; }
}

/* ---------- Petits téléphones (largeur) ---------- */
@media (max-width: 360px) {
  .logo-pill { padding: 6px 12px; font-size: 0.82rem; }

  .char-tag { font-size: 0.7rem; padding: 2px 8px; }

  .play-start-btn {
    font-size: 1rem;
    white-space: normal;
  }

  .play-start-btn .play-text { padding-right: 0; }

  .candy-btn { padding: 8px 14px; font-size: 0.9rem; }
}

/* ---------- Téléphone couché (paysage) ---------- */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --stage-s: 0.55; --cake-s: 1; }

  body { padding-top: max(6px, env(safe-area-inset-top)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }

  .kawaii-header { margin-bottom: 6px; }
  .logo-pill { padding: 4px 12px; font-size: 0.8rem; }
  .kawaii-btn.icon-btn { width: 38px; height: 38px; }

  .kawaii-card { border-radius: 24px; }

  .scene-header {
    flex-direction: row;
    justify-content: center;
    gap: 10px;
    padding: 6px 16px;
  }
  .scene-title { font-size: 1.05rem; }

  .characters-meadow {
    min-height: max(190px, calc(100dvh - 178px));
    padding-bottom: 8px;
  }

  .bubble-wrapper { top: 6px; max-width: 560px; }
  .kawaii-speech-bubble { padding: 6px 14px; border-radius: 16px; }
  .kawaii-speech-bubble p { font-size: 0.82rem; line-height: 1.35; }

  .sunny-cloud { top: 70px; }
  .soft-sun { top: 46px; width: 48px; height: 48px; }
  .balloon-1 { top: 76px; }
  .balloon-2, .balloon-3 { display: none; }
  .pastel-hills { height: 52px; }
  .pastel-hills.back { height: 74px; }

  .gift-stage { scale: 0.6; margin: -48px 0 -44px; }
  .open-me-prompt { margin-top: 0; padding: 5px 14px; font-size: 0.82rem; }

  .kawaii-footer { flex-direction: row; padding: 6px 16px; gap: 10px; }
  .nav-button-group { width: auto; }
  .candy-btn { min-height: 40px; padding: 6px 16px; font-size: 0.88rem; }

  /* Accueil */
  .autoplay-gate-overlay { overflow-y: auto; }
  .autoplay-card { margin: auto; padding: 22px 24px 16px; gap: 6px; }
  .gate-envelope { width: 64px; height: 64px; margin-bottom: 0; }
  .gate-heart { font-size: 2rem; }
  .gate-title { font-size: 1.4rem; }
  .play-start-btn { margin-top: 6px; min-height: 48px; }
}

/* Accueil : toujours atteignable si l'écran est minuscule */
.autoplay-gate-overlay {
  overflow-y: auto;
}

.autoplay-card {
  margin: auto;
}

/* =========================================================
   CARTE FINALE : tient dans l'écran, le message défile
   ========================================================= */
.sweet-modal-backdrop {
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
}

.sweet-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 28px);
}

.sweet-card-head,
.sweet-card-actions {
  flex-shrink: 0;
}

.sweet-card-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #ffb3c6 transparent;
  padding-bottom: 14px;

  /* Ombres douces qui n'apparaissent que s'il reste du texte à lire */
  background:
    linear-gradient(#ffffff 30%, rgba(255, 255, 255, 0)) center top,
    linear-gradient(rgba(255, 255, 255, 0), #ffffff 70%) center bottom,
    radial-gradient(farthest-side at 50% 0, rgba(74, 62, 61, 0.16), transparent) center top,
    radial-gradient(farthest-side at 50% 100%, rgba(74, 62, 61, 0.16), transparent) center bottom;
  background-repeat: no-repeat;
  background-size: 100% 40px, 100% 40px, 100% 12px, 100% 12px;
  background-attachment: local, local, scroll, scroll;
}

.sweet-card-body:focus-visible {
  outline-offset: -4px;
  border-radius: 0;
}

.sweet-card-body .love-letter {
  margin-bottom: 0;
}

.sweet-card-actions {
  position: relative;
  z-index: 1;
  padding: 14px 26px 12px;
  background: #ffffff;
  border-top: 2px dashed #f6d3dc;
}

.sweet-card-actions .action-btn-wrapper {
  margin: 0;
}

.sweet-card-actions .text-replay-btn {
  margin-top: 4px;
}

@media (max-width: 650px) {
  .sweet-card-actions { padding: 12px 16px 10px; }
}

/* Carte sur écran bas : bandeau plus compact */
@media (max-height: 720px) {
  .sweet-card-head { padding: 22px 18px 36px; }
  .head-float { font-size: 1.25rem; }
  .title-name { font-size: clamp(1.7rem, 7vw, 2.2rem); }
  .love-seal { width: 50px; height: 50px; bottom: -32px; font-size: 1.5rem; }
  .sweet-card-body { padding-top: 44px; }
  .trinity-badges { margin-bottom: 14px; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .sweet-card { max-width: 600px; border-radius: 24px; }
  .sweet-card-head { padding: 12px 18px 24px; }
  .head-float { display: none; }
  .card-title { flex-direction: row; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 10px; }
  .title-eyebrow { font-size: 0.75rem; }
  .title-name { font-size: 1.5rem; }
  .love-seal { width: 40px; height: 40px; bottom: -24px; font-size: 1.2rem; }
  .sweet-card-body { padding-top: 32px; }
  .trinity-badges { margin-bottom: 12px; }
  .sweet-card-actions { padding: 8px 20px 6px; display: flex; align-items: center; gap: 12px; }
  .sweet-card-actions .action-btn-wrapper { flex: 1; }
  .super-candy-btn { min-height: 46px; padding: 10px 18px; font-size: 0.92rem; }
  .sweet-card-actions .text-replay-btn { margin-top: 0; font-size: 0.8rem; white-space: nowrap; }
}

/* Petits écrans : carte finale plus légère */
@media (max-width: 380px) {
  .head-float { display: none; }
  .title-eyebrow { font-size: 0.75rem; letter-spacing: 1.5px; }
  .trinity-badges { gap: 6px; }
  .trinity-pill { font-size: 0.72rem; padding: 4px 10px; }
  .super-candy-btn { font-size: 0.85rem; min-height: 52px; }
  .replay-long { display: none; }
}

@media (max-height: 500px) and (orientation: landscape) {
  .super-candy-btn { white-space: nowrap; }
  .replay-long { display: none; }
}

/* Écrans peu hauts : décors remontés pour rester au-dessus des collines */
@media (max-height: 760px) and (min-width: 651px) {
  .balloon-1 { top: 96px; }
  .balloon-2 { display: none; }
  .balloon-3 { top: 170px; }
  .sunny-cloud { top: 104px; }
  .soft-sun { top: 78px; }
}
