#candyInfoStage {
  position: relative;
  width: min(100vw, calc(100svh * 3840 / 2143));
  aspect-ratio: 3840 / 2143;
  flex: none;
  isolation: isolate;
}
#candyInfoStage #photo, #candyInfoPatch, #candyInfoCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
}
#candyInfoPatch[hidden], #candyInfoCanvas[hidden], #candyInfoPlay[hidden] { display: none; }
#shade { background: none; }
#infoPanel {
  position: fixed;
  inset: 0;
  width: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: visible;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  pointer-events: none;
}
#infoPanel > :not(.menu):not(section) { display: none; }
.menu {
  position: absolute;
  left: clamp(18px, 26vw, 490px);
  top: 29%;
  width: min(350px, 27vw);
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin: 0;
  pointer-events: auto;
}
.menu a { min-height: 48px; }
.menu a[aria-hidden="true"] { visibility: hidden; }
.menu .arrived { animation: appear 300ms ease-out; }
.choice-hint { margin: 0 0 4px; color: #fff; text-shadow: 0 1px 5px #000; font-size: 14px; text-align: center; }
body.candy-intro .choice-hint { visibility: hidden; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
#infoPanel > section { display: none; }
#infoPanel > section:target {
  display: block;
  position: fixed;
  z-index: 5;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100svh - 100px);
  overflow: auto;
  padding: 24px;
  border: 1px solid rgba(215,175,69,.7);
  border-radius: 20px;
  background: rgba(12,12,12,.97);
  color: white;
  box-shadow: 0 20px 90px #000c;
  pointer-events: auto;
}
#infoPanel > section:target ~ .menu { display: none; }
.info-return { display: inline-block; min-height: 44px; color: var(--gold-light); padding: 8px 0; }
#candyInfoPlay {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 6;
  padding: 10px 18px;
  min-height: 44px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  background: #17130c;
  color: var(--gold-light);
  font: 700 1rem system-ui, sans-serif;
}
@media (max-width: 768px) {
  #container { align-items: flex-start; }
  #candyInfoStage { width: 100%; }
  .menu { left: 16px; right: 16px; top: min(57vw, 46svh); width: auto; gap: 7px; }
  .menu a { min-height: 44px; }
  #backBtn { bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .menu .arrived { animation: none; } }

/* Les cadeaux restent proches de la main, sans modifier le décor. */
.menu { left: min(calc(clamp(18px, 35vw, 680px) + 10ch), calc(100vw - 250px)); top: calc(47% - 55px); width: max-content; max-width: 60vw; justify-items: start; gap: 6px; }
.menu a {
  position: relative; display: inline-flex; width: max-content; max-width: 100%;
  min-height: 48px; padding: 3px 15px 3px 5px; gap: 7px;
  border: 2px solid #b6914b; border-radius: 7px;
  background-image: linear-gradient(145deg,#f6dfa4ad,#b9975a88 52%,#ecd5a0a8), url('/assets/decor-candy.webp');
  background-size: 100% 100%, 1400% auto; background-position: center, 10% 88%;
  box-shadow: inset 0 0 0 2px #fff3c080, 0 5px 14px #0009;
  color: #3a1b11; font-weight: 900; text-shadow: 0 1px #fff8;
}
.menu a::before { content: ""; position: absolute; left: 49px; top: 0; bottom: 0; width: 5px; background: #9d2030; opacity: .8; }
.gift-icon { flex: none; display: inline-block; width: 43px; height: 43px; position: relative; border-radius: 4px; background-repeat: no-repeat; background-size: 500% auto; }
.gift-visio { background-image: url('/assets/choix-visio.png'); background-position: 25% 82%; }
.gift-telephone { background-image: url('/assets/choix-telephone.png'); background-position: 75% 0%; }
.gift-sms { background-image: url('/assets/choix-sms.png'); background-position: 25% 82%; }
.gift-animation { background-image: url('/assets/choix-video-animee.png'); background-position: 100% 0%; }
.choice-hint { color: #ff2929; font-size: clamp(16px,1.15vw,20px); font-weight: 900; text-align: left; text-shadow: 0 2px 3px #000,0 0 7px #000; }
#backBtn { right: auto; left: clamp(10px, 13vw, 250px); bottom: max(12px, calc((100svh - min(100svh, 100vw * 2143 / 3840)) / 2 + 12px)); }
#backBtn.candy-back-flash { animation: back-flash 1s ease-in-out 4; }
@keyframes back-flash { 0%,100% { filter: brightness(1); box-shadow: 0 8px 28px #0009; } 50% { filter: brightness(1.7); box-shadow: 0 0 25px 8px #ffe080; } }
@media (max-width: 768px) {
  .menu { left: min(calc(7% + 10ch), calc(100vw - 220px)); right: auto; top: calc(min(59vw, 42svh) - 50px); max-width: 92vw; }
  .menu a { min-height: 44px; font-size: 14px; }
  .gift-icon { width: 38px; height: 38px; }
  .menu a::before { left: 43px; }
  #backBtn { left: 10px; right: auto; bottom: max(10px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { #backBtn.candy-back-flash { animation: none; } }
