:root {
  --rose: #e0447c;
  --rose-deep: #c2185b;
  --ink: #7a2e4f;
  --blush: #ffe3ee;
}

* { box-sizing: border-box; }

html, body { margin: 0; height: 100%; }

body {
  min-height: 100dvh;
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 8%, rgba(255,255,255,.95) 0, transparent 40%),
    radial-gradient(circle at 50% 56%, rgba(255,255,255,.55) 0, transparent 42%),
    radial-gradient(circle at 90% 88%, rgba(255,170,205,.65) 0, transparent 45%),
    linear-gradient(170deg, #ffe9f2 0%, #ffd6e5 48%, #ffbfd5 100%);
  background-color: #ffd6e5;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- Ciel : bokeh, cœurs & étincelles ---------- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }

.bokeh-dot {
  position: absolute;
  width: var(--s); height: var(--s);
  border-radius: 50%;
  background: radial-gradient(circle, var(--c) 0, transparent 68%);
  opacity: var(--o);
  animation: drift var(--d) ease-in-out var(--delay) infinite alternate;
}
@keyframes drift { to { transform: translate3d(var(--dx), var(--dy), 0); } }

.bg-heart {
  position: absolute;
  bottom: -40px;
  width: var(--s);
  height: var(--s);
  color: var(--c);
  opacity: var(--o);
  animation: riseUp var(--d) linear var(--delay) infinite;
}
.bg-heart svg { width: 100%; height: 100%; fill: currentColor; animation: sway 3.2s ease-in-out infinite alternate; }
@keyframes riseUp { to { transform: translate3d(0, calc(-100dvh - 80px), 0); } }
@keyframes sway { from { transform: translateX(-14px) rotate(-12deg); } to { transform: translateX(14px) rotate(12deg); } }

.spark {
  position: absolute;
  width: 14px; height: 14px;
  color: #fff;
  opacity: 0;
  animation: twinkle var(--d) ease-in-out var(--delay) infinite;
}
.spark svg { width: 100%; height: 100%; fill: currentColor; filter: drop-shadow(0 0 3px rgba(255,255,255,.9)); }
.spark.gold { color: #ffe6a6; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.2) rotate(0); } 50% { opacity: 1; transform: scale(var(--k, 1)) rotate(45deg); } }

/* ---------- Guirlande ---------- */
.bunting {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 70px;
  z-index: 2;
  pointer-events: none;
  animation: fadeDown 1s .1s ease both;
}
.bunting svg.string { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flag {
  position: absolute;
  width: 26px; height: 32px;
  margin-left: -13px;
  transform-origin: 50% 0;
  transform: rotate(var(--r));
  animation: flutter var(--d) ease-in-out var(--delay) infinite alternate;
}
.flag::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.35), transparent 50%), var(--c);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.flag i {
  position: absolute;
  left: 50%; top: 6px;
  width: 10px; height: 10px;
  margin-left: -5px;
  color: #fff;
  opacity: .9;
}
.flag i svg { width: 100%; height: 100%; fill: currentColor; display: block; }
@keyframes flutter { from { transform: rotate(calc(var(--r) - 5deg)); } to { transform: rotate(calc(var(--r) + 5deg)); } }

/* ---------- Mise en page ---------- */
.app {
  position: relative;
  z-index: 1;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(70px, calc(env(safe-area-inset-top) + 58px)) 16px max(14px, env(safe-area-inset-bottom));
  text-align: center;
}

.intro { position: relative; }
.kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: #d0698f;
  animation: fadeDown .9s .2s ease both;
}
.kicker span { display: inline-block; color: #ff6b9b; letter-spacing: 0; margin: 0 6px; animation: beat 1.6s ease-in-out infinite; }
h1 {
  position: relative;
  margin: 6px 0 8px;
  font-family: "Dancing Script", cursive;
  font-size: min(64px, 8vh);
  font-weight: 700;
  line-height: .9;
}
h1 > span {
  display: block;
  padding: 0 .12em;
  background: linear-gradient(100deg, #ff5c93 0%, #c2185b 40%, #ffd1e2 50%, #c2185b 60%, #ff6b9b 100%) 0 0 / 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 #fff) drop-shadow(0 8px 14px rgba(224,68,124,.28));
  animation: titlePop .9s cubic-bezier(.25,1.6,.45,1) both, shimmer 7s ease-in-out 2s infinite;
}
h1 > .w1 { animation-delay: .35s, 2s; }
h1 > .w2 { animation-delay: .55s, 2.25s; }
@keyframes titlePop { from { opacity: 0; transform: translateY(16px) scale(.6) rotate(-4deg); } }
@keyframes shimmer { 0%, 70% { background-position: 100% 0; } 100% { background-position: -60% 0; } }
.title-spark {
  position: absolute;
  width: 18px; height: 18px;
  color: #fff;
  animation: twinkle 2.6s ease-in-out infinite;
}
.title-spark svg { width: 100%; height: 100%; fill: currentColor; filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 2px #ff9ec2); }
.title-spark.t1 { left: 4%; top: 6%; }
.title-spark.t2 { right: 2%; top: 44%; width: 14px; height: 14px; animation-delay: -1.1s; }
.title-spark.t3 { left: 26%; bottom: -4%; width: 11px; height: 11px; animation-delay: -.5s; }
.sub { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.45; animation: fadeDown .9s .8s ease both; }

@keyframes fadeDown { from { opacity: 0; transform: translateY(-16px); } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }

/* ---------- Cadeaux ---------- */
.gifts {
  flex: 1;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 6px;
}

.gift {
  --S: 110px;   /* côté de la boîte */
  --H: 84px;    /* hauteur de la boîte */
  --L: 120px;   /* côté du couvercle */
  --LH: 27px;   /* hauteur du couvercle */
  --OV: 11px;   /* recouvrement couvercle / boîte */
  --RW: 9px;    /* demi-largeur du ruban */
  --rx0: -22deg;
  --tx: 0deg;
  --ty: 0deg;
  position: relative;
  width: 49%;
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  outline: none;
  animation: drop 1.1s cubic-bezier(.3,1.45,.5,1) both;
}
.gift[data-gift="1"] {
  --ry: 30deg;
  --paper: #ff9fc3;
  --paper-pattern:
    radial-gradient(circle, rgba(255,255,255,.88) 2.5px, transparent 3.2px) 0 0 / 18px 18px,
    radial-gradient(circle, rgba(255,255,255,.88) 2.5px, transparent 3.2px) 9px 9px / 18px 18px;
  --rb: #e0245e;     /* ruban */
  --rl: #ff7fa6;     /* reflet satiné */
  --rd: #a90f42;     /* bord du ruban */
  --inside: #b3164f;
  animation-delay: .9s;
}
.gift[data-gift="2"] {
  --ry: -30deg;
  --paper: #fff4f8;
  --paper-pattern:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-13 -14 50 50'%3E%3Cpath fill='%23ff9fc0' d='M12 21.2s-7.6-4.7-10-9.6C.2 7.9 2.4 3.6 6.6 3.6c2.4 0 4.2 1.4 5.4 3.2 1.2-1.8 3-3.2 5.4-3.2 4.2 0 6.4 4.3 4.6 8-2.4 4.9-10 9.6-10 9.6z'/%3E%3C/svg%3E") 0 0 / 22px 22px,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-13 -14 50 50'%3E%3Cpath fill='%23ffc7da' d='M12 21.2s-7.6-4.7-10-9.6C.2 7.9 2.4 3.6 6.6 3.6c2.4 0 4.2 1.4 5.4 3.2 1.2-1.8 3-3.2 5.4-3.2 4.2 0 6.4 4.3 4.6 8-2.4 4.9-10 9.6-10 9.6z'/%3E%3C/svg%3E") 11px 11px / 22px 22px;
  --rb: #eeae35;
  --rl: #ffe9a8;
  --rd: #b97d12;
  --inside: #b5476e;
  animation-delay: 1.1s;
}
@keyframes drop {
  0% { opacity: 0; transform: translateY(-140px) scale(.5) rotate(-8deg); }
  60% { opacity: 1; }
}

.float { position: relative; display: block; animation: bob 3.2s ease-in-out infinite; }
.gift[data-gift="2"] .float, .gift[data-gift="2"] .shadow { animation-delay: -1.6s; }
@keyframes bob { 50% { transform: translateY(-8px); } }

/* halo d'invitation derrière le cadeau à ouvrir */
.aura {
  position: absolute;
  left: 50%; top: 46%;
  width: 210px; height: 210px;
  margin: -105px 0 0 -105px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.95) 0, rgba(255,214,231,.6) 35%, transparent 68%);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .6s, transform .6s;
  pointer-events: none;
}
.gift.next .aura { opacity: 1; transform: scale(1); animation: auraPulse 2.4s ease-in-out infinite; }
@keyframes auraPulse { 50% { transform: scale(.86); opacity: .7; } }

.scene {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: calc(var(--S) + 64px);
  height: calc(var(--H) + 108px);
  perspective: 1000px;
  perspective-origin: 50% 30%;
  transform-origin: 50% 88%;
  transition: transform .25s cubic-bezier(.3,1.6,.5,1);
}
.gift:active .scene { transform: scale(.95); }

.box {
  position: relative;
  width: var(--S);
  height: var(--H);
  margin-bottom: 22px;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--rx0) + var(--tx))) rotateY(calc(var(--ry) + var(--ty)));
}

.f {
  position: absolute;
  left: 0; top: 0;
  display: block;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background:
    linear-gradient(90deg,
      transparent calc(50% - var(--RW)),
      var(--rd) calc(50% - var(--RW)), var(--rb) calc(50% - var(--RW) + 2.5px),
      var(--rl) calc(50% - 2px), var(--rb) calc(50% + 4px),
      var(--rd) calc(50% + var(--RW) - .5px), transparent calc(50% + var(--RW))),
    var(--paper-pattern),
    var(--paper);
}
.f::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--shade, transparent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.28);
}

/* parois de la boîte (légèrement débordantes pour des arêtes sans fente) */
.box > .f.w { width: calc(var(--S) + 1px); height: var(--H); left: -.5px; }
.box > .f.front { transform: translateZ(calc(var(--S) / 2)); }
.box > .f.back  { transform: rotateY(180deg) translateZ(calc(var(--S) / 2)); }
.box > .f.left  { transform: rotateY(-90deg) translateZ(calc(var(--S) / 2)); }
.box > .f.right { transform: rotateY(90deg) translateZ(calc(var(--S) / 2)); }
.box > .f.w {
  --shade:
    linear-gradient(180deg, transparent var(--OV), rgba(110,0,45,.34) var(--OV), rgba(110,0,45,.08) calc(var(--OV) + 9px), transparent calc(var(--OV) + 16px)),
    linear-gradient(180deg, rgba(255,255,255,.14), transparent 45%, rgba(100,0,45,.12));
}
.box > .f.left, .box > .f.right {
  --shade:
    linear-gradient(180deg, transparent var(--OV), rgba(110,0,45,.38) var(--OV), rgba(110,0,45,.1) calc(var(--OV) + 9px), transparent calc(var(--OV) + 16px)),
    linear-gradient(180deg, rgba(110,0,50,.12), rgba(90,0,40,.24));
}

/* intérieur (visible quand le couvercle s'envole) */
.box > .f.in { width: var(--S); height: var(--H); background: linear-gradient(180deg, color-mix(in srgb, var(--inside) 70%, #fff), var(--inside) 70%, color-mix(in srgb, var(--inside) 70%, #000)); }
.box > .f.in::after { box-shadow: none; background: linear-gradient(180deg, rgba(255,236,190,.55), transparent 60%); }
.box > .f.in.ib { transform: translateZ(calc(var(--S) / -2 + 1px)); }
.box > .f.in.if { transform: rotateY(180deg) translateZ(calc(var(--S) / -2 + 1px)); }
.box > .f.in.il { transform: rotateY(90deg) translateZ(calc(var(--S) / -2 + 1px)); }
.box > .f.in.ir { transform: rotateY(-90deg) translateZ(calc(var(--S) / -2 + 1px)); }
.box > .f.floor {
  width: var(--S); height: var(--S);
  top: calc((var(--H) - var(--S)) / 2);
  transform: rotateX(90deg) translateZ(calc(var(--H) / -2 + 1px));
  background: radial-gradient(circle, #fffbe8 0%, #ffd9a0 22%, #ff9cc0 50%, var(--inside) 90%);
}
.box > .f.floor::after { box-shadow: none; }

/* ombre portée au sol, collée à la boîte */
.box > .ground {
  position: absolute;
  display: block;
  width: calc(var(--S) * 1.5); height: calc(var(--S) * 1.5);
  left: calc(var(--S) * -.25);
  top: calc((var(--H) - var(--S) * 1.5) / 2);
  transform: rotateX(90deg) translateZ(calc(var(--H) / -2 - 1px));
  background: radial-gradient(closest-side, rgba(150,10,70,.32), rgba(150,10,70,.12) 62%, transparent);
  pointer-events: none;
}

/* couvercle */
.lid {
  position: absolute;
  left: calc((var(--S) - var(--L)) / 2);
  top: calc(var(--OV) - var(--LH));
  width: var(--L);
  height: var(--LH);
  transform-style: preserve-3d;
}
.lid > .f { backface-visibility: visible; -webkit-backface-visibility: visible; }
.lid > .f.w { width: calc(var(--L) + 1px); left: -.5px; height: var(--LH); }
.lid > .f.front { transform: translateZ(calc(var(--L) / 2)); }
.lid > .f.back  { transform: rotateY(180deg) translateZ(calc(var(--L) / 2)); }
.lid > .f.left  { transform: rotateY(-90deg) translateZ(calc(var(--L) / 2)); }
.lid > .f.right { transform: rotateY(90deg) translateZ(calc(var(--L) / 2)); }
.lid > .f.w {
  --shade:
    linear-gradient(180deg, rgba(255,255,255,.5), rgba(255,255,255,0) 4px),
    linear-gradient(180deg, rgba(255,255,255,.12), transparent 50%, rgba(100,0,45,.16));
}
.lid > .f.left, .lid > .f.right {
  --shade:
    linear-gradient(180deg, rgba(255,255,255,.4), rgba(255,255,255,0) 4px),
    linear-gradient(180deg, rgba(110,0,50,.1), rgba(90,0,40,.22));
}
/* lumière qui fuit sous le couvercle */
.lid > .f.w::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 12px;
  z-index: 1;
  background: linear-gradient(0deg, #fff8dc, rgba(255,226,160,.6) 30%, transparent);
  opacity: 0;
  transition: opacity .35s;
}
.gift.leak .lid > .f.w::before { opacity: 1; }

.lid > .f.top {
  width: var(--L); height: var(--L);
  top: calc((var(--LH) - var(--L)) / 2);
  transform: rotateX(90deg) translateZ(calc(var(--LH) / 2));
  background:
    radial-gradient(circle, rgba(90,0,40,.28) 0, transparent 22%),
    linear-gradient(90deg,
      transparent calc(50% - var(--RW)),
      var(--rd) calc(50% - var(--RW)), var(--rb) calc(50% - var(--RW) + 2.5px),
      var(--rl) calc(50% - 2px), var(--rb) calc(50% + 4px),
      var(--rd) calc(50% + var(--RW) - .5px), transparent calc(50% + var(--RW))),
    linear-gradient(0deg,
      transparent calc(50% - var(--RW)),
      var(--rd) calc(50% - var(--RW)), var(--rb) calc(50% - var(--RW) + 2.5px),
      var(--rl) calc(50% - 2px), var(--rb) calc(50% + 4px),
      var(--rd) calc(50% + var(--RW) - .5px), transparent calc(50% + var(--RW))),
    var(--paper-pattern),
    var(--paper);
  --shade: linear-gradient(140deg, rgba(255,255,255,.42), rgba(255,255,255,.06) 55%, rgba(120,0,50,.06));
}

/* nœud : toujours face caméra */
.bow {
  position: absolute;
  display: block;
  width: 92px; height: 70px;
  left: calc(var(--L) / 2 - 46px);
  top: -62px;
  transform-origin: 50% 100%;
  transform: translateY(-1px) rotateY(calc(-1 * (var(--ry) + var(--ty)))) rotateX(calc(-1 * (var(--rx0) + var(--tx))));
}
.bow svg { display: block; width: 100%; height: 100%; overflow: visible; transform-origin: 50% 70%; filter: drop-shadow(0 3px 2px rgba(120,0,50,.25)); }
.gift:not(.busy):not(.opened):not(.locked) .bow svg { animation: bowWiggle 4s ease-in-out 2.4s infinite; }
@keyframes bowWiggle { 0%, 84%, 100% { transform: none; } 88% { transform: scale(1.1, .92); } 92% { transform: scale(.95, 1.06) rotate(-3deg); } 96% { transform: rotate(2deg); } }

/* lumière qui sort de la boîte */
.light {
  position: absolute;
  display: block;
  width: 300px; height: 280px;
  left: calc(var(--S) / 2 - 150px);
  top: -270px;
  transform-origin: 50% calc(100% - 10px);
  transform: rotateY(calc(-1 * (var(--ry) + var(--ty)))) rotateX(calc(-1 * (var(--rx0) + var(--tx))));
  pointer-events: none;
  visibility: hidden;
}
.gift.lit .light, .gift.opened .light { visibility: visible; }
.light > i { position: absolute; display: block; pointer-events: none; }
.light .fan {
  inset: 0;
  transform-origin: 50% 100%;
  background: conic-gradient(from -58deg at 50% 100%,
    transparent 0deg, rgba(255,247,215,.0) 2deg, rgba(255,247,215,.85) 6deg, transparent 11deg,
    rgba(255,226,236,.8) 18deg, transparent 24deg,
    rgba(255,247,215,.9) 31deg, transparent 37deg,
    rgba(255,236,200,.7) 44deg, transparent 49deg,
    rgba(255,250,228,.95) 55deg, transparent 61deg,
    rgba(255,226,236,.8) 67deg, transparent 72deg,
    rgba(255,247,215,.85) 79deg, transparent 85deg,
    rgba(255,236,200,.7) 92deg, transparent 98deg,
    rgba(255,247,215,.85) 104deg, transparent 112deg, transparent 360deg);
  -webkit-mask: radial-gradient(ellipse 50% 100% at 50% 100%, #000 18%, rgba(0,0,0,.5) 55%, transparent 96%);
  mask: radial-gradient(ellipse 50% 100% at 50% 100%, #000 18%, rgba(0,0,0,.5) 55%, transparent 96%);
  opacity: 0;
  transform: scaleY(0);
}
.light .core {
  left: 50%; bottom: -60px;
  width: 220px; height: 150px;
  margin-left: -110px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,240,1), rgba(255,236,190,.75) 35%, rgba(255,180,210,.3) 65%, transparent);
  opacity: 0;
  transform: scale(.2);
}
.light .peek {
  left: 50%; bottom: 36px;
  width: 30px; height: 30px;
  margin-left: -15px;
  color: #ff4d84;
  opacity: 0;
}
.light .peek svg { width: 100%; height: 100%; fill: currentColor; display: block; filter: drop-shadow(0 0 6px rgba(255,255,255,.9)); }

.gift.lit .fan { animation: fanIn .9s cubic-bezier(.2,1.2,.4,1) forwards; }
.gift.lit .core { animation: coreIn .7s cubic-bezier(.2,1.4,.4,1) forwards; }
@keyframes fanIn { from { opacity: 0; transform: scaleY(0) scaleX(.4); } to { opacity: 1; transform: none; } }
@keyframes coreIn { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }

.gift.opened .fan { opacity: .75; transform: none; animation: fanSway 6s ease-in-out infinite alternate; }
.gift.opened .core { opacity: .8; transform: scale(.85); animation: corePulse 2.6s ease-in-out infinite alternate; }
.gift.opened .peek { animation: peek 3s ease-in-out infinite; }
@keyframes fanSway { from { transform: rotate(-5deg) scale(.82); opacity: .55; } to { transform: rotate(5deg) scale(.9); opacity: .8; } }
@keyframes corePulse { to { opacity: .55; transform: scale(.7); } }
@keyframes peek {
  0% { opacity: 0; transform: translateY(20px) scale(.4); }
  25% { opacity: 1; }
  70% { opacity: 1; transform: translateY(-36px) scale(1) rotate(-8deg); }
  100% { opacity: 0; transform: translateY(-56px) scale(.8) rotate(6deg); }
}
.gift.opened .lid { visibility: hidden; }

/* ombre au sol (suit la lévitation) */
.shadow {
  display: block;
  width: 150px; height: 22px;
  margin-top: -20px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(180,30,90,.26), transparent);
  animation: shadowBob 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes shadowBob { 50% { transform: scale(.82); opacity: .65; } }

/* étiquette suspendue */
.tag {
  position: absolute;
  top: 40px;
  left: 4px;
  z-index: 3;
  transform-origin: 90% 50%;
  animation: tagSwing 3s ease-in-out infinite alternate;
  pointer-events: none;
}
.tag b {
  position: relative;
  display: block;
  padding: 3px 14px 4px 12px;
  font-family: "Dancing Script", cursive;
  font-size: 23px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--rose-deep);
  background: linear-gradient(180deg, #fffdf8, #fff1e4);
  clip-path: polygon(0 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 0 100%);
  border-radius: 6px 0 0 6px;
}
.tag b::after {
  content: "";
  position: absolute;
  right: 7px; top: 50%;
  width: 6px; height: 6px;
  margin-top: -3px;
  border-radius: 50%;
  background: #f0b8c9;
  box-shadow: inset 0 1px 1px rgba(120,0,50,.3);
}
.tag::after {            /* ombre de l'étiquette */
  content: "";
  position: absolute;
  inset: 4px 10px -3px 4px;
  z-index: -1;
  border-radius: 6px;
  background: rgba(160,30,80,.22);
  transform: translateY(4px);
}
.gift[data-gift="1"] .tag { transform-origin: 100% 50%; }
.gift[data-gift="2"] .tag { left: auto; right: 4px; }
.gift[data-gift="2"] .tag b { padding: 3px 12px 4px 14px; clip-path: polygon(13px 0, 100% 0, 100% 100%, 13px 100%, 0 50%); border-radius: 0 6px 6px 0; }
.gift[data-gift="2"] .tag b::after { right: auto; left: 7px; }
.gift[data-gift="2"] .tag { transform-origin: 0 50%; animation-delay: -1.5s; }
@keyframes tagSwing { from { transform: rotate(-7deg); } to { transform: rotate(5deg); } }
.gift.busy .tag, .gift.opened .tag { animation: tagFall .6s ease-in forwards; }
@keyframes tagFall { to { opacity: 0; transform: translateY(40px) rotate(-30deg); } }

.status {
  position: relative;
  margin-top: 6px;
  padding: 5px 13px 6px;
  font-size: 13px;
  font-weight: 700;
  color: #c4537d;
  background: rgba(255,255,255,.6);
  border-radius: 999px;
  box-shadow: 0 4px 12px -6px rgba(180,30,90,.4);
  transition: opacity .3s, transform .3s;
  white-space: nowrap;
}
.gift.next .status { color: #fff; background: linear-gradient(135deg, #ff7aa6, #e0447c); box-shadow: 0 6px 14px -6px rgba(224,68,124,.8); }
.gift.busy .status { opacity: 0; transform: scale(.8); }

.pointer {
  position: absolute;
  right: 2%;
  bottom: -34px;
  font-size: 26px;
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.gift.next:not(.busy) .pointer { opacity: 1; animation: point 1.1s ease-in-out 2.4s infinite; }
@keyframes point { 50% { transform: translate(-4px, -9px) rotate(-8deg); } }

/* verrouillé */
.gift .scene { transition: filter .9s ease, opacity .9s ease, transform .25s cubic-bezier(.3,1.6,.5,1); }
.gift.locked .scene { filter: saturate(.35) brightness(1.04); opacity: .78; }
.gift.locked .tag { opacity: .75; }
.lock {
  position: absolute;
  left: 50%; top: 52%;
  z-index: 4;
  width: 46px; height: 58px;
  margin-left: -23px;
  transform-origin: 50% 0;
  animation: lockSwing 2.6s ease-in-out infinite alternate;
  pointer-events: none;
}
.lock svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 6px 6px rgba(150,20,70,.3)); }
.lock .shackle { transition: transform .35s cubic-bezier(.3,1.8,.5,1); }
@keyframes lockSwing { from { transform: rotate(-6deg); } to { transform: rotate(6deg); } }
.gift.nope .lock { animation: lockJiggle .5s ease; }
@keyframes lockJiggle { 20% { transform: rotate(-22deg) scale(1.1); } 45% { transform: rotate(18deg); } 70% { transform: rotate(-10deg); } }
.gift.unlocked-anim .lock .shackle { transform: translateY(-9px); }
.gift.unlocked-anim .lock { animation: lockDrop .9s .35s cubic-bezier(.5,0,.8,.6) forwards; }
@keyframes lockDrop {
  0% { transform: none; opacity: 1; }
  25% { transform: translateY(-14px) rotate(-12deg) scale(1.1); opacity: 1; }
  100% { transform: translateY(110px) rotate(70deg) scale(.7); opacity: 0; }
}
.gift:not(.locked):not(.unlocked-anim) .lock { display: none; }

.gift.nope .scene { animation: nope .45s ease; }
@keyframes nope { 20%, 60% { transform: translateX(-7px) rotate(-3deg); } 40%, 80% { transform: translateX(7px) rotate(3deg); } }

.gift.unlocking .float { animation: unlock .8s cubic-bezier(.3,1.6,.5,1), bob 3.2s ease-in-out .8s infinite; }
@keyframes unlock { 0% { transform: scale(1); } 35% { transform: scale(1.16, .9) translateY(4px); } 60% { transform: scale(.95, 1.08) translateY(-18px); } 100% { transform: scale(1); } }

/* ---------- Étapes ---------- */
.steps {
  display: flex;
  transition: opacity .5s;
  align-items: center;
  gap: 10px;
  animation: fadeUp .8s 1.5s ease both;
}
.step {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  color: #ff8fb1;
  transition: color .5s;
}
.step svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.step svg path { fill: rgba(255,255,255,.7); stroke: currentColor; stroke-width: 1.6; transition: fill .5s; }
.step b { position: relative; margin-top: -3px; font-size: 13px; font-weight: 700; color: #c4537d; transition: color .5s; }
.step.cur { color: #ff4d84; animation: beat 1.4s ease-in-out infinite; }
.step.done { color: #ff4d84; }
.step.done svg path { fill: #ff5c8d; }
.step.done b { color: #fff; }
.track {
  position: relative;
  width: 74px; height: 4px;
  border-radius: 4px;
  background: repeating-linear-gradient(90deg, rgba(255,143,177,.55) 0 5px, transparent 5px 10px);
  overflow: hidden;
}
.track i {
  position: absolute; inset: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #ff8fb1, #ff4d84);
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform .9s cubic-bezier(.5,0,.2,1);
}
.steps.half .track i { transform: scaleX(1); }

/* ---------- Indice ---------- */
.hint {
  margin: 8px 0 0;
  min-height: 2.6em;
  font-size: 15px;
  font-weight: 600;
  color: #b94a74;
  animation: fadeUp .8s 1.7s ease both;
}
.hint.swap { animation: hintSwap .5s ease both; }
@keyframes hintSwap { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.hint.love {
  font-family: "Dancing Script", cursive;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--rose-deep);
  animation: loveIn 1s cubic-bezier(.3,1.6,.5,1) both;
}
.hint .big-heart {
  display: inline-block;
  vertical-align: -4px;
  width: 30px; height: 30px;
  margin-right: 6px;
  color: #ff4d84;
  animation: beat 1.1s ease-in-out infinite;
}
.hint .big-heart svg { width: 100%; height: 100%; fill: currentColor; }
@keyframes beat { 0%, 100% { transform: scale(1); } 15% { transform: scale(1.2); } 30% { transform: scale(1); } 45% { transform: scale(1.12); } }
@keyframes loveIn { from { opacity: 0; transform: scale(.6); } }

/* écrans plus courts (barre d'adresse visible) */
@media (max-height: 760px) {
  .app { padding-top: max(62px, calc(env(safe-area-inset-top) + 52px)); }
  .gift { --S: 106px; --H: 80px; --L: 116px; --LH: 26px; }
  .scene { height: calc(var(--H) + 100px); }
  .sub { font-size: 14px; }
}

/* ---------- Final ---------- */
.finale {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 20px max(30px, env(safe-area-inset-bottom));
  text-align: center;
  color: #fff;
  visibility: hidden;
  pointer-events: none;
}
.finale.show { visibility: visible; pointer-events: auto; }
.finale-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(255,214,228,.95) 0, rgba(255,120,165,.85) 26%, rgba(214,51,108,.92) 58%, rgba(122,16,64,.97) 100%);
  opacity: 0;
  transition: opacity 1s ease;
}
.finale.show .finale-bg { opacity: 1; }
.finale-heart {
  position: relative;
  width: 210px; height: 190px;
  margin-top: -40px;
  color: #ff2f6d;
  opacity: 0;
  transform: scale(0);
}
.finale-heart::before {
  content: "";
  position: absolute;
  inset: -70px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255,255,255,.75), rgba(255,200,220,.35) 50%, transparent);
  animation: corePulse 1.1s ease-in-out infinite alternate;
}
.finale-heart svg { position: relative; display: block; width: 100%; height: 100%; fill: url(#bigHeartGrad); }
.finale-heart .beat { display: block; width: 100%; height: 100%; }
.finale.beating .finale-heart .beat { animation: beat 1.2s ease-in-out infinite; }
.finale-love {
  position: relative;
  margin: 6px 0 0;
  font-family: "Dancing Script", cursive;
  font-size: 66px;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(160,20,80,.35), 0 0 24px rgba(255,255,255,.55);
}
.finale-love span { display: inline-block; opacity: 0; white-space: pre; }
.finale-sub {
  position: relative;
  margin: 12px 0 0;
  font-family: "Dancing Script", cursive;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  opacity: 0;
  text-shadow: 0 2px 0 rgba(160,20,80,.3);
}
.finale-back {
  position: relative;
  width: auto;
  margin-top: 34px;
  padding: 12px 22px;
  font-size: 15px;
  opacity: 0;
  pointer-events: none;
}
.finale-back.in { pointer-events: auto; }

.flash {
  position: fixed;
  inset: 0;
  z-index: 48;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), #fff 0, rgba(255,250,235,.92) 18%, rgba(255,230,240,.55) 45%, rgba(255,220,235,0) 80%);
}

.ring {
  position: fixed;
  left: 0; top: 0;
  width: 120px; height: 120px;
  margin: -60px 0 0 -60px;
  z-index: 69;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,.95);
  pointer-events: none;
}

/* ---------- Carte surprise ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(circle at 50% 40%, rgba(255,240,246,.6), rgba(255,190,214,.75));
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .35s ease, visibility 0s .35s;
}
.modal.show { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .35s ease; }

.card {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: #fffafc;
  border-radius: 30px;
  box-shadow: 0 0 0 6px #fff, 0 0 0 8px #ffc1d6, 0 30px 60px -16px rgba(160,20,80,.5);
}

.card-body { padding: 20px 22px 24px; text-align: center; }
.card-body > * { opacity: 0; }
.modal.show .card-body > * { animation: rise .6s cubic-bezier(.2,1.2,.4,1) forwards; }
.modal.show .card-body > *:nth-child(1) { animation-delay: .25s; }
.modal.show .card-body > *:nth-child(2) { animation-delay: .35s; }
.modal.show .card-body > *:nth-child(3) { animation-delay: .45s; }
.modal.show .card-body > *:nth-child(4) { animation-delay: .55s; }
.modal.show .card-body > *:nth-child(5) { animation-delay: .65s; }
.modal.show .card-body > *:nth-child(6) { animation-delay: .75s; }
.modal.show .card-body > *:nth-child(7) { animation-delay: .85s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #c2185b;
  background: #ffe4ee;
  border-radius: 999px;
}
.card h2 {
  margin: 10px 0 2px;
  font-family: "Dancing Script", cursive;
  font-size: 38px;
  line-height: 1.05;
  color: #d6336c;
}
.place {
  margin: 2px 0 0;
  font-family: "Dancing Script", cursive;
  font-size: 24px;
  font-weight: 700;
  color: #b8860b;
}
.desc { margin: 12px 0 14px; font-size: 15px; line-height: 1.55; font-weight: 500; }

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.chips li {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
  background: #ffe8f0;
  border: 1px solid #ffd0e0;
  border-radius: 999px;
}

.btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 15px 18px;
  border: 0;
  border-radius: 999px;
  font: 700 16px "Quicksand", sans-serif;
  color: #fff;
  text-decoration: none;
  background: linear-gradient(135deg, #ff7aa6, #e0447c);
  box-shadow: 0 10px 22px -8px rgba(224,68,124,.7), inset 0 1px 0 rgba(255,255,255,.4);
  transition: transform .15s;
}
.btn:active { transform: scale(.97); }
.btn.ghost {
  color: #c2185b;
  background: #fff;
  box-shadow: inset 0 0 0 2px #ffc1d6;
}

/* ---------- Toast & particules ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 60;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(194,24,91,.92);
  border-radius: 999px;
  box-shadow: 0 10px 24px -8px rgba(194,24,91,.6);
  white-space: nowrap;
  transform: translate(-50%, 120px);
  transition: transform .45s cubic-bezier(.3,1.5,.5,1);
}
.toast.show { transform: translate(-50%, 0); }

#fx { position: fixed; inset: 0; z-index: 70; pointer-events: none; overflow: hidden; }
.p { position: absolute; left: 0; top: 0; display: block; will-change: transform, opacity; }
.p svg { width: 100%; height: 100%; display: block; fill: currentColor; }
