/* Garde-fous responsive de livraison.
   Cette feuille est chargée en dernier pour que les 3 présentations et les
   4 styles de slider respectent le même contrat sur téléphone. */

html,
body{
  min-width:0;
  max-width:100%;
}

body[data-home-layout] #finePrint{
  font-size:clamp(12px,.9vw,14px)!important;
  line-height:1.45!important;
  overflow-wrap:anywhere;
}

body[data-background-mode="preset-1"] footer{
  border-top-color:rgba(255,255,255,.14);
  background:rgba(3,15,48,.88);
  color:#f5f8ff;
}

body[data-background-mode="preset-5"] footer{
  border-top-color:rgba(255,244,232,.16);
  background:rgba(28,3,8,.9);
  color:#fff4e8;
}

@media(max-width:860px){
  body:not(.admin-body){overflow-x:clip}

  body[data-home-layout] .hero.old-layout,
  body[data-home-layout] .hero-copy,
  body[data-home-layout] .prize-stage,
  body[data-home-layout] .hero-actions,
  body[data-home-layout] .fine-print{
    min-width:0!important;
    max-width:100%!important;
  }

  body[data-home-layout] #heroTitle{
    box-sizing:border-box!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }

  body[data-home-layout] #heroTitleText{
    display:block;
    max-width:100%;
  }

  body[data-home-layout] .hero.old-layout>.hero-actions{
    width:100%!important;
  }

  body[data-home-layout] #playBtn,
  body[data-home-layout] #parcelsBtn{
    box-sizing:border-box!important;
    max-width:100%!important;
    min-width:0!important;
    min-height:44px!important;
  }

  body[data-home-layout] #playBtn{
    gap:10px!important;
    height:auto!important;
    padding:10px 14px 10px 16px!important;
  }

  body[data-home-layout] #playBtnLabel{
    position:relative!important;
    inset:auto!important;
    display:block!important;
    flex:1 1 auto!important;
    min-width:0!important;
    max-width:100%!important;
    white-space:normal!important;
    overflow-wrap:anywhere!important;
    text-overflow:clip!important;
    line-height:1.25!important;
  }

  body[data-background-mode^="preset-"] footer{
    max-width:100%;
    padding-inline:17px;
    font-size:13px;
    line-height:1.45;
  }

  body[data-background-mode^="preset-"] footer span{
    max-width:100%;
    overflow-wrap:anywhere;
  }
}

@media(max-width:340px){
  body[data-home-layout] .hero.old-layout{padding-inline:10px!important}
  body[data-home-layout] .hero.old-layout>.hero-copy{padding-inline:11px!important}
}

@media(prefers-reduced-motion:reduce){
  body[data-home-layout] .prize-card,
  body[data-home-layout] .prize-vector,
  body[data-home-layout] #playBtn{
    animation-duration:.01ms!important;
    animation-iteration-count:1!important;
  }

  #resultModal.open .result-card,
  #resultModal.open .result-card::before,
  #resultModal.open .result-card .result-icon,
  .result-confetti-layer,
  .result-confetti-layer *{
    animation:none!important;
    transition:none!important;
  }
}

/* L'iframe d'administration garde son défilement, mais sans la barre qui
   réduisait visuellement l'aperçu et donnait l'impression d'un second site. */
html:has(body.admin-preview-mode),
body.admin-preview-mode{
  scrollbar-width:none;
  -ms-overflow-style:none;
}
html:has(body.admin-preview-mode)::-webkit-scrollbar,
body.admin-preview-mode::-webkit-scrollbar{
  display:none;
  width:0;
  height:0;
}

/* Anneau double lisible sur fonds clairs comme sombres. */
:where(a,button,input,select,textarea,[tabindex]):focus-visible{
  outline:3px solid #111827!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 5px #fff!important;
}

/* --------------------------------------------------------------------------
   Finition de livraison : les skins restent différents, mais tous puisent
   leurs surfaces dans la palette de la présentation active. Cette section est
   volontairement placée dans la dernière feuille chargée afin d'éviter que
   les anciennes variantes de slider réintroduisent des couleurs étrangères.
   -------------------------------------------------------------------------- */
body[data-background-mode="preset-1"]{
  --delivery-slider-deep:#071b48;
  --delivery-slider-mid:#0a3c99;
  --delivery-slider-accent:#ffd54a;
  --delivery-slider-soft:#eef4ff;
  --delivery-slider-text:#ffffff;
  --delivery-slider-shadow:rgba(0,8,36,.3);
}
body[data-background-mode="preset-3"]{
  --delivery-slider-deep:#12364d;
  --delivery-slider-mid:#f05a47;
  --delivery-slider-accent:#ffd455;
  --delivery-slider-soft:#fff8dd;
  --delivery-slider-text:#ffffff;
  --delivery-slider-shadow:rgba(18,54,77,.24);
}
body[data-background-mode="preset-5"]{
  --delivery-slider-deep:#30070b;
  --delivery-slider-mid:#6f1721;
  --delivery-slider-accent:#ffb14a;
  --delivery-slider-soft:#fff4e8;
  --delivery-slider-text:#fff4e8;
  --delivery-slider-shadow:rgba(23,3,8,.42);
}

/* Le choix de fond du logo doit être littéral : « sans fond » ne conserve
   aucune carte de thème, les autres options utilisent le pseudo-élément commun. */
body[data-background-mode^="preset-"] #brandLogo[data-logo-background]{
  isolation:isolate!important;
  overflow:visible!important;
  border-color:transparent!important;
  background:transparent!important;
  box-shadow:none!important;
}
body[data-background-mode^="preset-"] #brandLogo[data-logo-background]::before{display:block}
body[data-background-mode^="preset-"] #brandLogo[data-logo-background="none"]::before{display:none!important}
body[data-background-mode^="preset-"] #brandLogo[data-logo-background="none"]{filter:none!important}

/* Médaillon et vitrine reprennent automatiquement la palette du thème. */
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="medallion"]{
  background:linear-gradient(145deg,color-mix(in srgb,var(--delivery-slider-accent) 86%,#fff),color-mix(in srgb,var(--delivery-slider-mid) 76%,var(--delivery-slider-soft)))!important;
  box-shadow:0 18px 0 color-mix(in srgb,var(--delivery-slider-deep) 16%,transparent),0 32px 62px var(--delivery-slider-shadow)!important;
}
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="medallion"] .prize-icon-stage{
  border-color:color-mix(in srgb,var(--delivery-slider-soft) 92%,#fff)!important;
  background:radial-gradient(circle,var(--delivery-slider-soft) 0 50%,var(--delivery-slider-accent) 51% 69%,var(--delivery-slider-mid) 70%)!important;
  box-shadow:0 18px 34px var(--delivery-slider-shadow),inset 0 0 0 3px color-mix(in srgb,var(--delivery-slider-deep) 16%,transparent)!important;
}
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="medallion"] .prize-caption{
  color:var(--delivery-slider-text)!important;
  border-color:var(--delivery-slider-soft)!important;
  background:var(--delivery-slider-deep)!important;
  box-shadow:0 8px 0 color-mix(in srgb,var(--delivery-slider-deep) 26%,transparent)!important;
}
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="medallion"] .prize-caption h2{color:var(--delivery-slider-text)!important}
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="medallion"] .slider-arrow{
  border-color:var(--delivery-slider-soft)!important;
  background:var(--delivery-slider-deep)!important;
  color:var(--delivery-slider-accent)!important;
  box-shadow:0 9px 18px var(--delivery-slider-shadow)!important;
}

body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="showcase"]{
  border-color:color-mix(in srgb,var(--delivery-slider-accent) 58%,transparent)!important;
  background:radial-gradient(ellipse at 50% 13%,color-mix(in srgb,var(--delivery-slider-soft) 30%,transparent),transparent 43%),linear-gradient(180deg,color-mix(in srgb,var(--delivery-slider-mid) 78%,var(--delivery-slider-deep)),var(--delivery-slider-deep))!important;
  box-shadow:inset 0 0 0 7px rgba(255,255,255,.025),0 32px 70px var(--delivery-slider-shadow)!important;
}
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="showcase"] .prize-icon-stage{
  background:radial-gradient(ellipse at 50% 2%,color-mix(in srgb,var(--delivery-slider-soft) 94%,#fff),color-mix(in srgb,var(--delivery-slider-accent) 34%,transparent) 48%,color-mix(in srgb,var(--delivery-slider-deep) 28%,transparent) 76%)!important;
}
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="showcase"] .prize-caption{
  color:var(--delivery-slider-text)!important;
  border-top-color:var(--delivery-slider-accent)!important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--delivery-slider-mid) 68%,var(--delivery-slider-deep)),var(--delivery-slider-deep))!important;
}
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="showcase"] .prize-caption h2{color:var(--delivery-slider-text)!important}
body[data-home-layout][data-background-mode^="preset-"] .hero.old-layout>.prize-stage[data-slider-style="showcase"] .slider-arrow{
  border-color:var(--delivery-slider-accent)!important;
  background:linear-gradient(145deg,var(--delivery-slider-soft),var(--delivery-slider-accent))!important;
  color:var(--delivery-slider-deep)!important;
  box-shadow:0 10px 24px var(--delivery-slider-shadow)!important;
}

/* Les titres de lots restent lisibles, notamment dans les trois petites
   cartes du Studio cobalt. */
body[data-home-layout][data-background-mode^="preset-"] .prize-stage[data-slider-style] .prize-caption h2{
  min-width:0!important;
  font-size:clamp(13px,1.35vw,18px)!important;
  line-height:1.16!important;
  text-wrap:balance!important;
  overflow-wrap:anywhere!important;
}
body[data-home-layout][data-background-mode^="preset-"] .prize-stage[data-slider-style][data-slider-motion="continuous"] .prize-caption{
  min-height:68px!important;
  padding:8px 9px!important;
}
body[data-home-layout][data-background-mode^="preset-"] .prize-stage[data-slider-style][data-slider-motion="continuous"] .prize-caption h2{
  max-height:3.55em!important;
  font-size:clamp(13px,1.2vw,16px)!important;
  line-height:1.18!important;
  -webkit-line-clamp:3!important;
}

/* Affiche solaire : la colonne de texte grandit avec son contenu. L'ancien
   cadre gardait une hauteur calculée trop courte et provoquait les recouvrements. */
@media(min-width:861px){
  body[data-background-mode="preset-3"] .hero.old-layout{
    width:min(1160px,calc(100% - 48px))!important;
    overflow:visible!important;
  }
  body[data-background-mode="preset-3"] .hero.old-layout>.hero-copy{
    align-self:center!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  body[data-background-mode="preset-3"] #heroTitle,
  body[data-background-mode="preset-3"] #heroTitleText{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }
  body[data-background-mode="preset-3"] .hero.old-layout>.hero-actions,
  body[data-background-mode="preset-3"] .hero.old-layout>.fine-print{
    align-self:start!important;
  }
  body[data-background-mode="preset-5"] .hero.old-layout>.hero-actions{
    justify-self:center!important;
    margin-inline:auto!important;
  }
}

/* À mi-largeur, Studio cobalt garde une vraie composition tablette au lieu
   d'être enfermé dans une colonne de téléphone de 430 px. */
@media(min-width:601px) and (max-width:860px){
  body[data-background-mode="preset-1"][data-home-layout="presentation-1"] .hero.old-layout{
    grid-template-columns:minmax(260px,.88fr) minmax(315px,1.12fr)!important;
    grid-template-areas:"copy slider" "actions slider" "fine slider"!important;
    grid-template-rows:auto auto 1fr!important;
    align-items:center!important;
    align-content:center!important;
    gap:12px 16px!important;
    width:calc(100% - 24px)!important;
    max-width:820px!important;
    min-height:calc(100svh - 46px)!important;
    padding:14px 0!important;
    overflow:visible!important;
  }
  body[data-background-mode="preset-1"][data-home-layout="presentation-1"] .hero.old-layout>.hero-copy{
    align-self:center!important;
    padding:18px 19px!important;
  }
  body[data-background-mode="preset-1"][data-home-layout="presentation-1"] .hero.old-layout>.prize-stage{
    align-self:center!important;
    height:min(520px,calc(100svh - 78px))!important;
    max-height:520px!important;
  }
  body[data-background-mode="preset-1"][data-home-layout="presentation-1"] #heroTitle{
    font-size:clamp(38px,5.7vw,52px)!important;
    overflow:visible!important;
  }
}

@media(max-width:600px){
  body[data-home-layout] .client-layout{padding-bottom:max(8px,env(safe-area-inset-bottom))}
  body[data-home-layout^="presentation-"][data-background-mode^="preset-"] .hero.old-layout>.hero-actions{
    position:relative!important;
    inset:auto!important;
    left:auto!important;
    right:auto!important;
    bottom:auto!important;
    width:100%!important;
    margin-inline:auto!important;
    min-height:0!important;
    padding-bottom:0!important;
  }
  body[data-home-layout] #playBtn{
    width:100%!important;
    min-height:48px!important;
    height:auto!important;
  }
  body[data-home-layout] #playBtnLabel{
    min-height:1.25em!important;
    max-height:none!important;
  }
  body[data-background-mode="preset-1"][data-home-layout="presentation-1"] .hero.old-layout{max-width:430px!important}
}

/* Dernier garde-fou typographique : les feuilles historiques des sliders
   utilisaient un sélecteur très spécifique et pouvaient encore ramener les
   noms à 9,5 px. Le même niveau de spécificité garantit un texte net et
   lisible dans toutes les combinaisons, y compris le défilement continu. */
html body[data-home-layout][data-background-mode] .hero.old-layout>
.prize-stage[data-slider-style] #prizeSlider .prize-caption h2,
html body[data-home-layout][data-background-mode] .hero.old-layout>
.prize-stage[data-slider-style][data-slider-motion="continuous"] #prizeSlider .prize-caption h2{
  max-height:4.6em!important;
  font-family:'DM Sans',sans-serif!important;
  font-size:clamp(13px,1.3vw,16px)!important;
  font-weight:800!important;
  line-height:1.15!important;
  letter-spacing:-.02em!important;
  text-shadow:none!important;
  overflow-wrap:anywhere!important;
  -webkit-line-clamp:4!important;
}
html body[data-background-mode="preset-1"][data-home-layout="presentation-1"] .hero.old-layout>
.prize-stage[data-slider-style="floating-deck"] #prizeSlider .prize-card.slot-0 .prize-caption h2{
  font-size:clamp(14px,1.5vw,17px)!important;
}

/* Fenêtre des conditions d'un lot : compacte sur bureau et téléphone. */
#prizeModal .modal-card.prize-detail{box-sizing:border-box;width:min(420px,calc(100vw - 28px));max-height:min(86dvh,700px);padding:22px 24px 20px;border-radius:22px;overflow-y:auto}
#prizeModal .prize-detail-visual{width:116px;height:116px;margin:0 auto 10px}
#prizeModal .prize-detail-visual img{width:88px;height:88px}
#prizeModal .prize-detail .eyebrow{margin-bottom:6px;font-size:.7rem}
#prizeModal .prize-detail h2{font-size:clamp(1.35rem,4vw,1.85rem);line-height:1.13;margin:0 0 8px}
#prizeModal .prize-detail-description{font-size:.88rem;margin-bottom:10px}
#prizeModal .conditions-box{margin:12px 0;padding:11px 13px}
#prizeModal .prize-detail .btn{min-height:44px}
@media(max-width:600px){
  #prizeModal.modal{align-items:center;padding:14px}
  #prizeModal .modal-card.prize-detail{width:min(390px,100%);max-height:calc(100dvh - 28px);border-radius:20px;padding:20px 18px 16px}
  #prizeModal .prize-detail-visual{width:94px;height:94px;margin-bottom:7px}
  #prizeModal .prize-detail-visual img{width:72px;height:72px}
}

body[data-home-layout] .hero.old-layout>.prize-stage[data-prize-layout="empty"] {
  height:auto!important;
  min-height:0!important;
}
body[data-home-layout] .prize-stage[data-prize-layout="empty"] #prizeSlider {
  display:grid!important;
  place-items:center;
  width:100%!important;
  height:auto!important;
  min-height:0!important;
  padding:1rem!important;
}
.prize-stage[data-prize-layout="empty"] .prize-empty {
  margin:0;
  padding:.55em 1em;
  border-radius:1em;
  background:#fff;
  color:#29251f;
  text-align:center;
  overflow-wrap:anywhere;
}
body[data-home-layout] .prize-stage[data-prize-layout="empty"] :is(.slider-arrow,.slider-dots),
body[data-home-layout] .prize-stage[data-prize-layout="empty"]::before,
body[data-home-layout] .prize-stage[data-prize-layout="empty"]::after {
  display:none!important;
}
