/* ==========================================================================
   bolo.salutcestgreg.fr — ticket à gratter, thème trattoria
   ========================================================================== */

:root{
  --rosso:        #c8102e;
  --rosso-scuro:  #7d0d1c;
  --rosso-notte:  #2b0a0c;
  --verde:        #0e8a52;
  --verde-scuro:  #0a5c37;
  --crema:        #f7efdd;
  --crema-ombra:  #e6d8ba;
  --oro:          #e6bd63;
  --oro-chiaro:   #fff0c2;
  --oro-scuro:    #9d6f1f;
  --inchiostro:   #241512;

  --font-display: "Bodoni Moda", "Didot", "Times New Roman", serif;
  --font-sign:    "Alfa Slab One", "Rockwell", Georgia, serif;
  --font-body:    "Jost", "Futura", "Avenir Next", system-ui, sans-serif;

  --ticket-w: min(92vw, 400px);
}

*,
*::before,
*::after{ box-sizing: border-box; }

html{
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body{
  margin: 0;
  min-height: 100svh;
  font-family: var(--font-body);
  color: var(--crema);
  background: var(--rosso-notte);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* --- bandeau tricolore tout en haut ------------------------------------- */
.tricolore-top{
  position: fixed;
  inset: 0 0 auto 0;
  height: 5px;
  z-index: 40;
  background: linear-gradient(90deg,
    var(--verde) 0 33.33%,
    var(--crema) 33.33% 66.66%,
    var(--rosso) 66.66% 100%);
  box-shadow: 0 1px 12px rgba(0,0,0,.5);
}

/* --- fond ---------------------------------------------------------------- */
.bg{
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 8%, #6d1418 0%, #4a0e13 38%, #2b0a0c 72%, #1b0607 100%);
}

.bg__glow{
  position: absolute;
  left: 50%;
  top: 46%;
  width: min(140vw, 1000px);
  aspect-ratio: 1;
  translate: -50% -50%;
  background: radial-gradient(circle, rgba(230,189,99,.20) 0%, rgba(230,189,99,.07) 34%, transparent 66%);
  animation: breathe 9s ease-in-out infinite;
}

@keyframes breathe{
  0%, 100%{ opacity: .75; scale: 1;    }
  50%     { opacity: 1;   scale: 1.06; }
}

.bg__stripes{
  position: absolute;
  inset: -20%;
  opacity: .05;
  background: repeating-linear-gradient(115deg,
    #fff 0 2px, transparent 2px 26px);
}

.bg__grain{
  position: absolute;
  inset: 0;
  opacity: .3;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.bg__vignette{
  position: absolute;
  inset: 0;
  background: radial-gradient(115% 80% at 50% 45%, transparent 40%, rgba(0,0,0,.55) 100%);
}

/* --- icônes flottantes --------------------------------------------------- */
.floaters{
  position: absolute;
  inset: 0;
  color: var(--oro);
  overflow: hidden;
}

.floater{
  position: absolute;
  opacity: .085;
  will-change: transform;
  animation: drift 22s ease-in-out infinite;
}

.f1{ width: 34px;  top: 14%; left: 8%;   animation-duration: 19s; }
.f2{ width: 86px;  top: 68%; left: 5%;   animation-duration: 25s; animation-delay: -6s;  rotate: -18deg; }
.f3{ width: 58px;  top: 20%; right: 9%;  animation-duration: 23s; animation-delay: -11s; rotate: 12deg; }
.f4{ width: 66px;  top: 74%; right: 7%;  animation-duration: 27s; animation-delay: -3s; }
.f5{ width: 96px;  top: 44%; left: -3%;  animation-duration: 31s; animation-delay: -15s; opacity: .05; }

@keyframes drift{
  0%,100%{ translate: 0 0;      }
  33%    { translate: 14px -22px; }
  66%    { translate: -10px 16px; }
}

@media (max-width: 620px){
  .f2, .f5{ display: none; }
}

/* --- scène --------------------------------------------------------------- */
.stage{
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;   /* sans effet si le contenu dépasse : min-height, pas height */
  gap: clamp(16px, 2.8vh, 26px);
  min-height: 100svh;
  padding: clamp(30px, 5vh, 54px) 20px clamp(24px, 4vh, 40px);
}

/* --- en-tête ------------------------------------------------------------- */
.head{
  text-align: center;
  max-width: 38rem;
  animation: rise .9s cubic-bezier(.2,.8,.25,1) both;
}

@keyframes rise{
  from{ opacity: 0; translate: 0 16px; }
  to  { opacity: 1; translate: 0 0;    }
}

.eyebrow{
  margin: 0 0 clamp(10px, 2vh, 16px);
  font-family: var(--font-sign);
  font-size: clamp(.8rem, 3vw, .95rem);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--oro);
  text-shadow: 0 1px 0 rgba(0,0,0,.45);
}

.eyebrow__star{
  color: var(--crema);
  opacity: .6;
  font-size: .85em;
  vertical-align: .12em;
  letter-spacing: 0;
  margin: 0 .35em;
}

.title{
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(1.85rem, 8.4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: -.015em;
  color: var(--crema);
  text-shadow: 0 3px 24px rgba(0,0,0,.5), 0 1px 0 rgba(0,0,0,.4);
}

.title em{
  display: inline-block;
  font-style: italic;
  font-weight: 700;
  background: linear-gradient(180deg, #fffaea 0%, #ffdf9c 42%, var(--oro) 72%, #c99a3e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-right: .06em;
}

.lede{
  margin: clamp(14px, 2.4vh, 20px) 0 0;
  font-size: clamp(1.1rem, 4.6vw, 1.3rem);
  font-weight: 400;
  line-height: 1.45;
  color: var(--crema);
  text-shadow: 0 2px 14px rgba(0,0,0,.5);
}

.lede strong{
  display: inline-block;
  font-weight: 600;
  color: var(--oro-chiaro);
  text-shadow: 0 0 22px rgba(230,189,99,.45);
  animation: ledeGlow 2.8s ease-in-out infinite;
}

@keyframes ledeGlow{
  0%, 100%{ text-shadow: 0 0 20px rgba(230,189,99,.30); }
  50%     { text-shadow: 0 0 30px rgba(230,189,99,.75); }
}

/* petit chevron qui désigne le ticket */
.lede-arrow{
  display: block;
  width: 22px;
  height: 22px;
  margin: clamp(8px, 1.6vh, 14px) auto 0;
  color: var(--oro);
  opacity: .8;
  animation: bob 1.9s ease-in-out infinite;
}

@keyframes bob{
  0%, 100%{ translate: 0 0;   opacity: .55; }
  50%     { translate: 0 7px; opacity: 1;   }
}

body.started .lede-arrow{
  opacity: 0;
  animation: none;
  transition: opacity .4s ease;
}

/* --- serviette à carreaux ------------------------------------------------ */
.ticket-zone{
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  /* la nappe tournée déborde ; on lui réserve la place pour qu'elle ne
     recouvre pas la légende qui suit */
  margin: 6px 0 clamp(20px, 3vh, 30px);
  perspective: 1100px;
  animation: rise 1s cubic-bezier(.2,.8,.25,1) .12s both;
}

/* tout ce qui suit le ticket doit passer AU-DESSUS de la nappe */
.ticket-caption,
.again,
.foot{
  position: relative;
  z-index: 2;
}

.napkin{
  position: absolute;
  inset: -26px -30px;
  rotate: -5deg;
  border-radius: 3px;
  background:
    repeating-linear-gradient(0deg,  rgba(200,16,46,.86) 0 20px, transparent 20px 40px),
    repeating-linear-gradient(90deg, rgba(200,16,46,.86) 0 20px, transparent 20px 40px),
    var(--crema);
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
  opacity: .92;
}

.napkin::after{
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(75% 65% at 50% 40%, transparent 40%, rgba(80,0,10,.35) 100%);
}

/* --- ticket -------------------------------------------------------------- */
.ticket{
  --notch: 12px;
  --tear: 128px;
  position: relative;
  width: var(--ticket-w);
  padding: 16px 16px 12px;
  border-radius: 12px;
  background:
    linear-gradient(178deg, #fffaf0 0%, var(--crema) 45%, #efe3c8 100%);
  color: var(--inchiostro);
  box-shadow:
    0 2px 0 rgba(255,255,255,.75) inset,
    0 -2px 0 rgba(0,0,0,.06) inset,
    0 26px 48px rgba(0,0,0,.5),
    0 6px 14px rgba(0,0,0,.35);
  transform-style: preserve-3d;
  transition: box-shadow .5s ease;
}

@supports (mask-composite: intersect) or (-webkit-mask-composite: source-in){
  .ticket{
    -webkit-mask:
      radial-gradient(circle var(--notch) at 0    var(--tear), transparent 97%, #000 100%),
      radial-gradient(circle var(--notch) at 100% var(--tear), transparent 97%, #000 100%);
            mask:
      radial-gradient(circle var(--notch) at 0    var(--tear), transparent 97%, #000 100%),
      radial-gradient(circle var(--notch) at 100% var(--tear), transparent 97%, #000 100%);
    -webkit-mask-composite: source-in;
            mask-composite: intersect;
  }
}

.ticket__glare{
  position: absolute;
  inset: 0;
  border-radius: 12px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
  background: radial-gradient(52% 44% at var(--gx, 50%) var(--gy, 0%),
              rgba(255,255,255,.85) 0%, rgba(255,255,255,0) 70%);
  mix-blend-mode: soft-light;
}

.ticket.tilting .ticket__glare{ opacity: .9; }

/* en-tête du ticket */
.ticket__head{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px 10px;
}

.ticket__brandline{ min-width: 0; }

.ticket__brand{
  display: block;
  font-family: var(--font-sign);
  font-size: clamp(.95rem, 4.2vw, 1.16rem);
  line-height: 1.1;
  letter-spacing: -.01em;
  white-space: nowrap;
  color: var(--rosso-scuro);
}

.ticket__sub{
  display: block;
  margin-top: 4px;
  font-size: .66rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(36,21,18,.68);
}

.ticket__serial{
  flex: none;
  margin-top: 2px;
  padding: 4px 8px;
  border: 1px solid rgba(36,21,18,.25);
  border-radius: 4px;
  font-size: .64rem;
  font-weight: 500;
  letter-spacing: .04em;
  font-variant-numeric: tabular-nums;
  color: rgba(36,21,18,.7);
  background: rgba(255,255,255,.5);
}

.ticket__flag{
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg,
    var(--verde) 0 33.33%,
    #fffdf6 33.33% 66.66%,
    var(--rosso) 66.66% 100%);
}

/* ligne de perforation */
.perf{
  display: flex;
  align-items: center;
  height: 20px;
  margin: 0 -4px;
}

.perf__line{
  flex: 1;
  height: 2px;
  background: repeating-linear-gradient(90deg,
    rgba(36,21,18,.28) 0 5px, transparent 5px 11px);
}

/* --- zone à gratter ------------------------------------------------------ */
.scratch{
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.96;
  border-radius: 9px;
  overflow: hidden;
  background:
    radial-gradient(85% 70% at 50% 34%, #3c241a 0%, #23130f 55%, #150b09 100%);
  box-shadow:
    0 0 0 1px rgba(36,21,18,.3),
    0 8px 18px rgba(0,0,0,.32) inset;
  touch-action: none;
}

/* le lot */
.prize{
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 16px 14px;
  text-align: center;
}

.prize::before{
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 46% at 50% 44%, rgba(230,189,99,.28) 0%, transparent 72%),
    repeating-conic-gradient(from 0deg at 50% 44%,
      rgba(230,189,99,.038) 0deg 6deg, transparent 6deg 12deg);
  opacity: 0;
  transition: opacity 1.1s ease .1s;
}

.ticket.revealed .prize::before{ opacity: 1; }

.stars{
  display: flex;
  gap: 4px;
  font-size: clamp(.9rem, 3.6vw, 1.05rem);
  line-height: 1;
  color: var(--oro);
}

.stars span{
  opacity: .18;
  translate: 0 4px;
  filter: drop-shadow(0 0 6px rgba(230,189,99,0));
}

.ticket.revealed .stars span{
  animation: starPop .55s cubic-bezier(.2,1.5,.4,1) forwards;
}

.ticket.revealed .stars span:nth-child(1){ animation-delay: .30s; }
.ticket.revealed .stars span:nth-child(2){ animation-delay: .40s; }
.ticket.revealed .stars span:nth-child(3){ animation-delay: .50s; }
.ticket.revealed .stars span:nth-child(4){ animation-delay: .60s; }
.ticket.revealed .stars span:nth-child(5){ animation-delay: .70s; }

@keyframes starPop{
  0%  { opacity: .18; scale: .7; translate: 0 4px; }
  60% { opacity: 1;   scale: 1.35; translate: 0 0; }
  100%{ opacity: 1;   scale: 1;   translate: 0 0;
        filter: drop-shadow(0 0 8px rgba(230,189,99,.65)); }
}

.prize__label{
  margin: 10px 0 0;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(247,239,221,.6);
}

.score{
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .1em;
  margin-top: 2px;
}

.score__num{
  font-family: var(--font-display);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(2.05rem, 9.4vw, 2.55rem);
  line-height: 1.05;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums lining-nums;
  background: linear-gradient(178deg, #fff8e2 0%, var(--oro) 48%, #a9761f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(230,189,99,.35));
}

.score__den{
  font-family: var(--font-display);
  font-size: clamp(.9rem, 3.6vw, 1rem);
  font-weight: 500;
  color: rgba(230,189,99,.62);
}

.prize__rule{
  display: flex;
  align-items: center;
  gap: 9px;
  width: 74%;
  margin: 9px 0 8px;
  color: rgba(230,189,99,.6);
}

.prize__rule span{
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230,189,99,.42), transparent);
}

.prize__rule svg{
  width: 17px;
  height: 17px;
  flex: none;
}

.verdict{
  margin: 0;
  font-size: clamp(.86rem, 3.5vw, .95rem);
  font-style: italic;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(247,239,221,.82);
  max-width: 27ch;
}

/* --- la pellicule dorée --------------------------------------------------- */
.foil{
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
  touch-action: none;
  transition: opacity .75s ease, scale .75s cubic-bezier(.2,.8,.25,1), filter .75s ease;
}

.foil:active{ cursor: grabbing; }

.ticket.revealed .foil{
  opacity: 0;
  scale: 1.08;
  filter: blur(6px) brightness(1.6);
  pointer-events: none;
}

/* reflet qui balaie la pellicule */
.sheen{
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  transition: opacity .5s ease;
}

.sheen::after{
  content: "";
  position: absolute;
  top: -60%;
  left: -70%;
  width: 45%;
  height: 220%;
  rotate: 18deg;
  background: linear-gradient(90deg,
    transparent 0%, rgba(255,255,255,.04) 30%,
    rgba(255,255,255,.30) 50%,
    rgba(255,255,255,.04) 70%, transparent 100%);
  filter: blur(4px);
  animation: sweep 3.6s cubic-bezier(.5,0,.5,1) infinite;
}

@keyframes sweep{
  0%       { translate: 0 0; }
  55%, 100%{ translate: 340% 0; }
}

.scratching .sheen,
.revealed   .sheen{ opacity: 0; }

/* --- l'indice (main) ------------------------------------------------------ */
.hint{
  position: absolute;
  inset: auto 0 13%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  pointer-events: none;
  color: rgba(37,20,12,.62);
  transition: opacity .35s ease, translate .35s ease;
}

.hint__icon{
  width: 30px;
  height: 38px;
  animation: tap 2.3s ease-in-out infinite;
  filter: drop-shadow(0 2px 3px rgba(255,255,255,.35));
}

@keyframes tap{
  0%, 100%{ translate: 0 0;    rotate: 0deg; }
  15%     { translate: -7px 3px; rotate: -9deg; }
  30%     { translate: 7px 3px;  rotate: 9deg; }
  45%     { translate: 0 0;    rotate: 0deg; }
}

.hint__text{
  font-size: .74rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(37,20,12,.72);
  text-shadow: 0 1px 0 rgba(255,240,200,.4);
}

.scratching .hint,
.revealed   .hint{
  opacity: 0;
  translate: 0 8px;
}

/* --- pied du ticket ------------------------------------------------------- */
.ticket__foot{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 2px 2px;
}

.barcode{
  width: 88px;
  height: 20px;
  opacity: .55;
  background: repeating-linear-gradient(90deg,
    var(--inchiostro) 0 1px, transparent 1px 3px,
    var(--inchiostro) 3px 5px, transparent 5px 6px,
    var(--inchiostro) 6px 9px, transparent 9px 11px,
    var(--inchiostro) 11px 12px, transparent 12px 15px);
}

.ticket__legal{
  font-size: .62rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  color: rgba(36,21,18,.55);
}

/* --- tampon "buon appetito" ----------------------------------------------- */
.stamp{
  position: absolute;
  right: -22px;
  top: -24px;
  z-index: 3;
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  rotate: -14deg;
  border: 3px double var(--rosso);
  border-radius: 50%;
  color: var(--rosso);
  background: rgba(250,244,230,.94);
  box-shadow: 0 8px 22px rgba(0,0,0,.45), 0 0 0 4px rgba(250,244,230,.14);
  opacity: 0;
  scale: 2.4;
  pointer-events: none;
  filter: blur(1px);
}

.stamp::before{
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(200,16,46,.55);
  border-radius: 50%;
}

.stamp__in{
  font-family: var(--font-sign);
  font-size: .82rem;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .02em;
  opacity: .82;
}

.ticket.revealed ~ .stamp{
  animation: stampIn .5s cubic-bezier(.2,1.1,.3,1) 1s forwards;
}

@keyframes stampIn{
  0%  { opacity: 0;   scale: 2.4; filter: blur(3px); rotate: -26deg; }
  70% { opacity: .95; scale: .94; filter: blur(0);   rotate: -12deg; }
  100%{ opacity: .88; scale: 1;   filter: blur(0);   rotate: -14deg; }
}

/* le numéro de série laisse la place au tampon */
.ticket.revealed .ticket__serial{
  opacity: 0;
  transition: opacity .3s ease .85s;
}

@media (max-width: 400px){
  .stamp{ width: 86px; height: 86px; right: -14px; top: -20px; }
  .stamp__in{ font-size: .68rem; }
  .stamp::before{ inset: 5px; }
}

/* --- légende + bouton rejouer --------------------------------------------- */
.ticket-caption{
  margin: 0;
  min-height: 1.2em;
  font-size: .76rem;
  font-weight: 500;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(247,239,221,.62);
  text-align: center;
  transition: opacity .3s ease;
}

.again{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid rgba(230,189,99,.42);
  border-radius: 2px;
  background: rgba(230,189,99,.08);
  color: var(--oro);
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
  animation: rise .5s ease both;
}

.again svg{ width: 15px; height: 15px; }

.again:hover{
  background: rgba(230,189,99,.18);
  border-color: var(--oro);
  color: var(--oro-chiaro);
}

.again[hidden]{ display: none; }

/* --- pied de page --------------------------------------------------------- */
.foot{
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: clamp(6px, 1.4vh, 14px);
  width: min(100%, 360px);
}

.foot__rule{
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230,189,99,.3), transparent);
}

.brand{
  display: inline-flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  opacity: 1;
}

.brand__chip{
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 40px;
  background: var(--crema);
  box-shadow: 0 3px 10px rgba(0,0,0,.35);
  isolation: isolate;
}

.brand__logo{
  width: 58px;
  height: auto;
  display: block;
  mix-blend-mode: multiply;
}

.brand__name{
  font-family: var(--font-body);
  font-size: .8rem;
  font-weight: 500;
  letter-spacing: .09em;
  text-transform: lowercase;
  color: var(--crema);
}

/* --- bouton son ------------------------------------------------------------ */
.sound{
  position: fixed;
  top: 16px;
  right: 14px;
  z-index: 30;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(247,239,221,.16);
  border-radius: 50%;
  background: rgba(20,6,7,.4);
  backdrop-filter: blur(6px);
  color: rgba(247,239,221,.6);
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease;
}

.sound:hover{
  color: var(--oro);
  border-color: rgba(230,189,99,.45);
}

/* le navigateur a refusé la lecture auto : on attire l'œil, un clic suffit */
.sound.pending{
  color: var(--oro);
  border-color: rgba(230,189,99,.6);
  animation: soundPulse 2s ease-in-out infinite;
}

@keyframes soundPulse{
  0%, 100%{ box-shadow: 0 0 0 0 rgba(230,189,99,.45); }
  70%     { box-shadow: 0 0 0 11px rgba(230,189,99,0); }
}

.sound svg{ width: 17px; height: 17px; }
.sound .sound__off{ display: none; }
.sound.muted .sound__on{ display: none; }
.sound.muted .sound__off{ display: block; }

/* --- calque effets (confettis / poussière) --------------------------------- */
.fx{
  position: fixed;
  inset: 0;
  z-index: 25;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --- accessibilité mouvement ----------------------------------------------- */
@media (prefers-reduced-motion: reduce){
  *,
  *::before,
  *::after{
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .floater, .bg__glow{ animation: none; }
}

/* ==========================================================================
   Tenir dans un écran, sans scroll
   Le ticket est dimensionné par la HAUTEUR disponible (svh = hauteur la plus
   petite, barres du navigateur affichées) et non par la largeur.
   ========================================================================== */

/* grand écran : on peut se permettre un gros ticket */
@media (min-width: 760px) and (min-height: 900px){
  :root{ --ticket-w: 420px; }
}

/* la plupart des téléphones en portrait (iPhone 14 ≈ 390 × 664) */
@media (max-height: 840px){
  :root{ --ticket-w: min(90vw, 400px, 44svh); }

  .stage{ gap: clamp(7px, 1.3vh, 15px); padding: 18px 16px 14px; }

  .eyebrow{ font-size: .78rem; margin-bottom: 7px; }
  .title{ font-size: clamp(1.6rem, 7.4vw, 2.5rem); }
  .lede{ font-size: clamp(1rem, 4.2vw, 1.14rem); margin-top: 10px; }
  .lede-arrow{ width: 18px; height: 18px; margin-top: 7px; }

  .ticket-zone{ margin: 0 0 18px; }
  .napkin{ inset: -14px -18px; rotate: -4deg; }

  .ticket{ padding: 11px 12px 9px; }
  .ticket__head{ padding-bottom: 7px; }
  .ticket__brand{ font-size: 1rem; }
  .ticket__sub{ font-size: .55rem; margin-top: 2px; letter-spacing: .04em; }
  .ticket__serial{ font-size: .58rem; padding: 3px 6px; }
  .perf{ height: 13px; }
  .scratch{ aspect-ratio: 1 / .9; }
  .ticket__foot{ padding: 8px 2px 0; }
  .barcode{ width: 70px; height: 15px; }
  .ticket__legal{ font-size: .56rem; }

  .prize__label{ margin-top: 6px; font-size: .62rem; }
  .prize__rule{ margin: 6px 0 5px; }

  .ticket-caption{ font-size: .68rem; }
  .foot{ margin-top: 2px; }
  .brand__chip{ padding: 5px 9px; }
  .brand__logo{ width: 46px; }
  .brand__name{ font-size: .74rem; }
  .again{ padding: 8px 15px; font-size: .72rem; }
}

/* petits téléphones (iPhone SE ≈ 375 × 553) */
@media (max-height: 640px){
  :root{ --ticket-w: min(88vw, 41svh); }

  .stage{ gap: 6px; padding: 12px 14px 10px; }
  .eyebrow{ font-size: .7rem; margin-bottom: 5px; }
  .title{ font-size: clamp(1.4rem, 6.6vw, 2rem); }
  .lede{ font-size: .97rem; margin-top: 7px; }
  .lede-arrow{ width: 15px; height: 15px; margin-top: 4px; }

  /* trop étroit pour la ligne complète : on garde l'essentiel */
  .ticket__sub,
  .ticket__serial{ display: none; }

  .ticket-zone{ margin-bottom: 14px; }
  .perf{ height: 10px; }
  .ticket__foot{ padding-top: 6px; }
  .barcode{ width: 58px; height: 13px; }
  .ticket__legal{ font-size: .52rem; }
  .brand__logo{ width: 40px; }
  .brand__name{ font-size: .68rem; }
  .ticket-caption{ font-size: .62rem; }
}

/* paysage : on met le texte à gauche et le ticket à droite */
@media (max-height: 580px) and (min-width: 640px){
  .stage{
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: clamp(24px, 5vw, 60px);
    padding: 14px 20px;
  }

  .head{ text-align: left; max-width: 24rem; }
  .lede-arrow{ margin-left: 0; rotate: -90deg; }

  :root{ --ticket-w: min(38vw, 62svh); }

  .ticket-caption{ flex-basis: 100%; order: 3; }
  .again{ order: 4; }
  .foot{ order: 5; flex-basis: 100%; justify-content: center; }
}
