/* =========================================================
   BURGER CH'WAYA — Tombola (section #tombola)
   Toutes les règles sont préfixées .tb · mobile d'abord.
   Réutilise les variables de css/style.css (:root).
   ========================================================= */

.tb {
  --tb-paper: #FBF7EF;
  --tb-chase: 1.4s;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
  color: var(--cream);
  padding: clamp(104px, 12vw, 180px) 0 clamp(84px, 10vw, 150px);
}
@supports (overflow: clip) { .tb { overflow: clip; } }
.tb [hidden] { display: none !important; }
.tb__wrap { position: relative; z-index: 1; }

/* ---------- Store de snack (rayures + festons) ---------- */
.tb__awning {
  --aw: clamp(26px, 3.2vw, 44px);
  position: absolute; left: 0; right: 0; top: 0; z-index: 2;
  height: calc(var(--aw) * 1.6);
  pointer-events: none;
  filter: drop-shadow(0 10px 0 rgba(0, 0, 0, .35));
}
.tb__awning::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(rgba(0, 0, 0, .32), transparent 42%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .1) 0, rgba(0, 0, 0, .16) var(--aw)),
    repeating-linear-gradient(90deg, var(--red) 0 var(--aw), var(--cream) 0 calc(var(--aw) * 2));
  -webkit-mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--aw) / 2) no-repeat,
    radial-gradient(circle at 50% 0, #000 calc(var(--aw) / 2 - .5px), transparent calc(var(--aw) / 2)) 0 100% / var(--aw) calc(var(--aw) / 2) repeat-x;
          mask:
    linear-gradient(#000 0 0) top / 100% calc(100% - var(--aw) / 2) no-repeat,
    radial-gradient(circle at 50% 0, #000 calc(var(--aw) / 2 - .5px), transparent calc(var(--aw) / 2)) 0 100% / var(--aw) calc(var(--aw) / 2) repeat-x;
}

/* ---------- En-tête ---------- */
.tb__head { display: grid; gap: 26px; margin-bottom: clamp(34px, 5vw, 70px); }
.tb__title { font-size: clamp(66px, 10.4vw, 176px); }
.tb__script {
  font-family: var(--f-display); text-transform: uppercase; letter-spacing: .01em; color: var(--red-hot);
  font-size: clamp(30px, 3.2vw, 50px); line-height: 1.1;
  margin: 8px 0 0 .3em;
  transform: rotate(-6deg); transform-origin: left center;
  text-shadow: 0 0 22px rgba(255, 59, 36, .45);
}
.tb__lead { font-size: clamp(17px, 1.35vw, 21px); font-weight: 600; line-height: 1.5; color: rgba(245, 236, 221, .86); max-width: 30em; }
.tb__lead b { color: var(--cream); font-weight: 800; }

/* Les vraies chances (même langage que la liste des horaires) */
.tb__odds { margin-top: 26px; max-width: 520px; }
.tb__odds-t {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font-weight: 800; font-stretch: 125%; text-transform: uppercase; letter-spacing: .14em; font-size: 12px; color: var(--muted);
}
.tb__odds-t b { font-family: var(--f-display); font-weight: 400; font-stretch: 100%; letter-spacing: .02em; font-size: 22px; color: var(--cheese); }
.tb__odds-list { list-style: none; margin: 0; padding: 0; }
.tb__odds-list li {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 2px; border-bottom: 1px solid var(--line);
  font-weight: 700; font-stretch: 110%; text-transform: uppercase; letter-spacing: .06em; font-size: 13px;
}
.tb__odds-list i { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, rgba(245, 236, 221, .28) 0 3px, transparent 3px 8px); }
.tb__odds-list b { font-family: var(--f-mono); font-weight: 700; letter-spacing: 0; font-size: 14px; }
.tb__odds-list .is-jackpot { color: var(--cheese); }
.tb__odds-list .is-lose { color: var(--muted); }
.tb__odds-note { margin-top: 12px; font-size: 13.5px; color: var(--muted); }

/* ---------- Bandeau « mode démo » (rubalise) ---------- */
.tb__demo {
  display: flex; justify-content: center;
  margin: 0 auto 30px; max-width: 980px; padding: 9px 10px;
  background: repeating-linear-gradient(-45deg, var(--cheese) 0 16px, var(--black) 16px 32px);
  border-radius: 10px; transform: rotate(-1deg);
}
.tb__demo span {
  background: var(--black); color: var(--cheese);
  padding: 7px 12px; border-radius: 99px; text-align: center;
  font-weight: 800; font-stretch: 112%; text-transform: uppercase; letter-spacing: .05em; font-size: 11px;
}

/* ---------- Scène : roue + carte ---------- */
.tb__play { display: grid; gap: clamp(36px, 5vw, 72px); align-items: center; }
.tb__stage { position: relative; width: min(100%, 460px); margin: 0 auto; padding-top: 10.5%; }

.tb__rays {
  position: absolute; z-index: -1; left: 50%; top: 55%;
  width: 290%; aspect-ratio: 1; translate: -50% -50%;
  border-radius: 50%; pointer-events: none;
  background: repeating-conic-gradient(rgba(227, 18, 11, .22) 0 6deg, transparent 6deg 12deg);
  -webkit-mask: radial-gradient(closest-side, #000 16%, transparent 74%);
          mask: radial-gradient(closest-side, #000 16%, transparent 74%);
  animation: tb-rays 140s linear infinite;
}
@keyframes tb-rays { to { rotate: 1turn; } }

.tb__wheel {
  position: relative; aspect-ratio: 1; border-radius: 50%;
  /* aperçu avant génération du SVG (et sans JS) */
  background: conic-gradient(from -15deg, var(--cheese) 0 30deg, var(--red) 0 60deg, var(--black) 0 90deg, var(--red) 0 120deg, var(--cream) 0 150deg, var(--red) 0 180deg, var(--black) 0 210deg, var(--red) 0 240deg, var(--cream) 0 270deg, var(--red) 0 300deg, var(--black) 0 330deg, var(--red) 0 360deg);
}
.tb__wheel.is-built { background: none; }
.tb__wheel::before {
  content: ''; position: absolute; inset: 1.5%; z-index: -1; border-radius: 50%;
  box-shadow: 0 36px 60px -16px rgba(0, 0, 0, .85), 0 0 90px rgba(255, 59, 36, .22);
}
.tb__sway, .tb__rotor { position: absolute; inset: 0; border-radius: 50%; }
.tb__sway { animation: tb-sway 6s ease-in-out infinite; }
.tb.is-spinning .tb__sway, .tb.has-result .tb__sway { animation: none; }
@keyframes tb-sway { 0%, 100% { rotate: 0deg; } 25% { rotate: 1.4deg; } 75% { rotate: -1.4deg; } }
.tb.is-spinning .tb__rotor { will-change: transform; }
.tb__rotor svg, .tb__rim { display: block; width: 100%; height: 100%; }
.tb__rim { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: visible; }

/* Cases */
.tb__wedge { stroke: none; }
.tb__seg--red .tb__wedge { fill: var(--red); }
.tb__seg--black .tb__wedge { fill: var(--black); }
.tb__seg--cream .tb__wedge { fill: var(--cream); }
.tb__seg--jackpot .tb__wedge { fill: url(#tbJackpot); }
.tb__jk-a { stop-color: #FFE27A; }
.tb__jk-b { stop-color: var(--cheese); }
.tb__jk-c { stop-color: #E08E00; }
.tb__lab { font-family: var(--f-display); letter-spacing: .03em; fill: var(--cream); }
.tb__seg--cream .tb__lab, .tb__seg--jackpot .tb__lab { fill: var(--ink); }
.tb__sub { font-family: var(--f-mono); font-weight: 700; letter-spacing: .16em; fill: var(--red-deep); }
.tb__star { fill: #fff; }
.tb__sep { stroke: rgba(245, 236, 221, .32); stroke-width: 1.2; }
.tb__peg { fill: var(--cream); stroke: var(--black); stroke-width: 1.4; }
.tb__seg { transition: opacity .5s var(--ease); }
.tb__rotor.has-hit .tb__seg { opacity: .38; }
.tb__rotor.has-hit .tb__seg.is-hit { opacity: 1; }

/* Couronne d'ampoules (chenillard) */
.tb__rim-band { fill: none; stroke: var(--char); stroke-width: 17; }
.tb__rim-gold { fill: none; stroke: var(--cheese); stroke-width: 2.2; }
.tb__rim-edge { fill: none; stroke: var(--black); stroke-width: 2.5; }
.tb__bulb {
  animation: tb-chase var(--tb-chase) steps(1, end) infinite;
  animation-delay: calc(var(--tb-chase) * var(--k, 0) / -3);
}
.tb__bulb-halo { fill: var(--cheese); opacity: .32; }
.tb__bulb-core { fill: #FFF1C2; stroke: var(--cheese); stroke-width: 1.4; }
.tb.is-spinning { --tb-chase: .42s; }
.tb.is-win .tb__bulb { animation: tb-blink .26s steps(1, end) infinite; }
@keyframes tb-chase { 0% { opacity: 1; } 33.34% { opacity: .22; } }
@keyframes tb-blink { 50% { opacity: .18; } }

/* Petit éclat sur le jackpot (calque à part : pas de repeinte de la roue) */
.tb__glint {
  position: absolute; width: 7%; aspect-ratio: 1; translate: -50% -50%;
  pointer-events: none; opacity: 0;
  animation: tb-glint 3.4s var(--ease) infinite;
}
.tb__glint::before {
  content: ''; position: absolute; inset: 0; background: #fff;
  clip-path: polygon(50% 0, 58% 42%, 100% 50%, 58% 58%, 50% 100%, 42% 58%, 0 50%, 42% 42%);
}
@keyframes tb-glint {
  0%, 60%, 100% { opacity: 0; transform: scale(.2) rotate(0deg); }
  72% { opacity: 1; transform: scale(1) rotate(45deg); }
  86% { opacity: 0; transform: scale(.35) rotate(90deg); }
}

/* Case gagnante éclairée, flash */
.tb__spot {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0;
  background: linear-gradient(rgba(255, 194, 26, .7), rgba(255, 194, 26, 0) 48%);
  clip-path: polygon(50% 50%, 37.6% 3.6%, 50% 2%, 62.4% 3.6%);
  transition: opacity .4s var(--ease);
}
.tb__spot.is-on { opacity: 1; }
.tb__spot.is-lose { background: linear-gradient(rgba(245, 236, 221, .45), rgba(245, 236, 221, 0) 48%); }
.tb__spot.is-win { animation: tb-spot .9s ease-in-out infinite alternate; }
@keyframes tb-spot { from { opacity: .45; } to { opacity: 1; } }
.tb__flash {
  position: absolute; inset: -30%; z-index: 3; border-radius: 50%;
  pointer-events: none; opacity: 0;
  background: radial-gradient(closest-side, rgba(255, 248, 222, .95), rgba(255, 194, 26, .55) 42%, rgba(255, 59, 36, 0) 100%);
}

/* Moyeu rouge + logo */
.tb__hub {
  position: absolute; left: 50%; top: 50%; z-index: 2;
  width: 27%; aspect-ratio: 1; translate: -50% -50%;
  padding: 2.4%; border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, var(--red-hot), var(--red) 46%, var(--red-deep));
  box-shadow: 0 0 0 3px var(--black), 0 0 0 5px var(--cheese), 0 10px 22px rgba(0, 0, 0, .55);
}
.tb__hub img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* Pointeur à clapet */
.tb__pointer {
  position: absolute; z-index: 4; left: 50%; top: 0;
  width: 13%; margin-left: -6.5%;
  transform-origin: 50% 29.8%;
  filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .5));
}
.tb__pointer svg { display: block; width: 100%; height: auto; overflow: visible; }
.tb__pointer-body { fill: var(--red); stroke: var(--black); stroke-width: 3; stroke-linejoin: round; }
.tb__pointer-shine { fill: none; stroke: rgba(255, 255, 255, .55); stroke-width: 3; stroke-linecap: round; }
.tb__pointer-pin { fill: var(--cheese); stroke: var(--black); stroke-width: 3; }
.tb__pointer-dot { fill: var(--black); }

/* Sticker « 10 % de gagnants » */
.tb__sticker {
  position: absolute; z-index: 5; right: -2%; top: 7%;
  width: 23%; aspect-ratio: 1; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: var(--cheese); color: var(--ink);
  outline: 2px dashed rgba(20, 18, 16, .45); outline-offset: -7px;
  box-shadow: 4px 4px 0 var(--black);
  rotate: 12deg;
}
.tb__sticker b { display: block; font-family: var(--f-display); font-weight: 400; font-size: clamp(22px, 2.3vw, 34px); line-height: .95; }
.tb__sticker small { display: block; font-weight: 800; font-stretch: 120%; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; font-size: clamp(10px, .82vw, 11px); }

/* Entrée en scène (classe ajoutée par le JS seulement) */
.tb.tb--anim .tb__wheel { transition: translate 1.3s var(--ease), rotate 1.3s var(--ease), opacity .6s var(--ease); }
.tb.tb--anim .tb__pointer { transition: translate .7s var(--ease-back) .95s, opacity .3s .95s; }
.tb.tb--anim .tb__sticker { transition: scale .6s var(--ease-back) 1.15s; }
.tb.tb--anim:not(.is-in) .tb__wheel { translate: 55% 0; rotate: 220deg; opacity: 0; }
.tb.tb--anim:not(.is-in) .tb__pointer { translate: 0 -40px; opacity: 0; }
.tb.tb--anim:not(.is-in) .tb__sticker { scale: 0; }
/* tirage lancé avant que la roue ait fait son entrée : elle se met en place sans glisser */
.tb.tb--anim.is-spinning .tb__wheel, .tb.tb--anim.is-spinning .tb__pointer, .tb.tb--anim.is-spinning .tb__sticker { transition: none; }

/* ---------- Carte : billet (recto) / ticket de caisse (verso) ---------- */
.tb__card { width: 100%; max-width: 470px; margin: 0 auto; perspective: 1800px; }
.tb__card-in { display: grid; transform-style: preserve-3d; transition: transform .95s var(--ease); }
.tb__card.is-flipped .tb__card-in { transform: rotateY(180deg); }
.tb__face { grid-area: 1 / 1; align-self: start; min-width: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.tb__face--back { transform: rotateY(180deg); }

.tb__billet {
  position: relative;
  display: grid; grid-template-columns: 44px minmax(0, 1fr);
  color: var(--ink); border-radius: var(--r);
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .45), transparent 55%),
    radial-gradient(rgba(110, 70, 30, .10) .8px, transparent 1.3px) 0 0 / 7px 7px,
    radial-gradient(rgba(110, 70, 30, .07) .8px, transparent 1.3px) 3px 4px / 11px 11px,
    var(--paper);
  box-shadow: 10px 10px 0 var(--red), 0 40px 60px -30px rgba(0, 0, 0, .9);
  rotate: -1deg;
}
.tb__stub {
  display: grid; place-items: center;
  background: var(--red); color: #fff;
  border-radius: var(--r) 0 0 var(--r);
  border-right: 3px dotted var(--paper);
}
.tb__stub > span {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-family: var(--f-display); text-transform: uppercase; letter-spacing: .14em; font-size: 15px; white-space: nowrap;
}
.tb__billet-body { display: flex; flex-direction: column; gap: 12px; padding: 20px 18px 16px; min-width: 0; }
.tb__billet-top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px;
  padding-bottom: 12px; border-bottom: 2px dashed rgba(20, 18, 16, .28);
}
.tb__billet-t { font-family: var(--f-display); text-transform: uppercase; font-size: 26px; line-height: 1; }
.tb__billet-no { font-family: var(--f-mono); font-size: 12px; color: rgba(20, 18, 16, .68); white-space: nowrap; }

.tb__field { display: block; }
.tb__label { display: block; margin-bottom: 8px; font-weight: 800; font-stretch: 120%; text-transform: uppercase; letter-spacing: .1em; font-size: 12px; }
.tb__input {
  display: block; width: 100%; min-height: 56px; padding: 12px 16px;
  border: 2px solid var(--ink); border-radius: var(--r);
  background: #fff; color: var(--ink);
  font-family: var(--f-mono); font-size: 20px; font-weight: 700; letter-spacing: .04em;
  transition: border-color .25s, box-shadow .25s, background-color .25s;
}
.tb__input::placeholder { color: rgba(20, 18, 16, .36); }
.tb__input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 5px rgba(227, 18, 11, .16); }
.tb__input[aria-invalid="true"] { border-color: var(--red); background: #FFF3F1; }
.tb__hint { margin-top: -4px; font-size: 13px; color: rgba(20, 18, 16, .66); }

.tb__check {
  display: flex; align-items: flex-start; gap: 12px;
  min-height: 44px; padding: 6px 0;
  font-size: 15px; font-weight: 600; line-height: 1.35; cursor: pointer;
}
.tb__check input {
  -webkit-appearance: none; appearance: none;
  flex: none; width: 28px; height: 28px; margin: 0;
  border: 2px solid var(--ink); border-radius: 8px;
  background: #fff center / 17px no-repeat; cursor: inherit; /* hérite du label (curseur maison du site respecté) */
  transition: background-color .2s, border-color .2s, transform .3s var(--ease-back);
}
.tb__check input:checked {
  background-color: var(--red); border-color: var(--red); transform: scale(1.06);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.6l3.2 3L13 4.6' fill='none' stroke='%23fff' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.tb__check input[aria-invalid="true"] { border-color: var(--red); box-shadow: 0 0 0 4px rgba(227, 18, 11, .2); }
.tb__check span { padding-top: 3px; }
.tb__check em { font-style: normal; font-size: 13px; font-weight: 700; color: var(--red-deep); }

.tb__err { font-size: 14.5px; font-weight: 700; line-height: 1.4; color: var(--red-deep); }
.tb__err:empty { margin-top: -12px; }
.tb__err:not(:empty) { padding: 10px 12px; border-radius: 12px; background: rgba(227, 18, 11, .1); border-left: 4px solid var(--red); }

.tb__go { margin-top: 2px; }
.tb__go[aria-disabled="true"] { opacity: .72; }
.tb__go[aria-disabled="true"]:not(:where(.has-cursor *)) { cursor: progress; }
.tb.is-off .tb__go { --bg: var(--char); box-shadow: none; }
.tb.is-off .tb__go:not(:where(.has-cursor *)) { cursor: not-allowed; }

.tb__fine { font-size: 13px; color: rgba(20, 18, 16, .7); text-align: center; }
.tb__link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
  background: none; border: 0; font: inherit; font-weight: 800; color: var(--red-deep); cursor: pointer;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}

.tb__mine {
  padding: 12px 14px 4px; border-radius: var(--r);
  background: var(--cheese); color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink); rotate: .6deg;
}
.tb__mine p { font-family: var(--f-mono); font-size: 13px; line-height: 1.4; }
.tb__mine span { font-family: var(--f-body); font-weight: 800; font-stretch: 120%; text-transform: uppercase; letter-spacing: .1em; font-size: 11px; }
.tb__mine b { font-size: 19px; letter-spacing: .04em; }
.tb__mine-sub { color: rgba(20, 18, 16, .78); }
.tb__mine .tb__link { color: var(--ink); }

.tb__shop { padding: 10px 12px; border: 2px dashed currentColor; border-radius: 12px; font-size: 14px; font-weight: 700; line-height: 1.4; }
.tb__shop.is-ok { color: #17652F; }
.tb__shop.is-need { color: var(--red-deep); }

/* Ticket de caisse */
.tb__paper-wrap { filter: drop-shadow(0 26px 28px rgba(0, 0, 0, .55)); rotate: .8deg; }
.tb__paper {
  background: var(--tb-paper); color: #1a1a1a;
  font-family: var(--f-mono); font-size: 13.5px; line-height: 1.5;
  padding: 30px 22px;
  -webkit-mask: linear-gradient(#000, #000) 0 10px / 100% calc(100% - 20px) no-repeat, radial-gradient(circle at 10px 0, transparent 7px, #000 7.5px) 0 0 / 20px 10px repeat-x, radial-gradient(circle at 10px 10px, transparent 7px, #000 7.5px) 0 100% / 20px 10px repeat-x;
          mask: linear-gradient(#000, #000) 0 10px / 100% calc(100% - 20px) no-repeat, radial-gradient(circle at 10px 0, transparent 7px, #000 7.5px) 0 0 / 20px 10px repeat-x, radial-gradient(circle at 10px 10px, transparent 7px, #000 7.5px) 0 100% / 20px 10px repeat-x;
}
.tb__rhead { text-align: center; }
.tb__rhead img { width: 48px; height: 48px; margin: 0 auto 8px; border-radius: 50%; filter: grayscale(1) contrast(1.2); }
.tb__rbrand { font-weight: 700; font-size: 17px; letter-spacing: .12em; }
.tb__rmeta { margin-top: 2px; font-size: 11px; line-height: 1.5; color: #555; }
.tb__rsep { margin: 16px 0; border-top: 2px dashed #b9b2a6; }
.tb__rbody { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.tb__rbody:focus, .tb__rbody:focus-visible { outline: none; }
.tb__rstate { font-family: var(--f-display); text-transform: uppercase; font-size: 48px; line-height: .95; color: var(--red); }
.tb__card.is-jackpot .tb__rstate { text-shadow: 3px 3px 0 var(--cheese); }
.tb__rline { display: flex; align-items: baseline; gap: 8px; text-align: left; font-size: 12.5px; text-transform: uppercase; }
.tb__rline span { flex: none; }
.tb__rline i { flex: 1; min-width: 12px; border-bottom: 1px dotted #8f8a82; transform: translateY(-4px); }
.tb__rline b { text-align: right; }
.tb__rline--prize { font-size: 14px; }
.tb__rlabel { margin-top: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: #555; }
.tb__code {
  padding: 10px 6px; border: 3px solid #1a1a1a; border-radius: var(--r); background: #fff;
  font-weight: 700; font-size: clamp(30px, 9.6vw, 44px); line-height: 1.05; letter-spacing: .04em;
  overflow-wrap: anywhere;
}
.tb__code--sm { font-size: clamp(24px, 7vw, 32px); }
.tb__copy {
  align-self: center; min-height: 44px; padding: 0 20px; border: 0; border-radius: 99px;
  background: #1a1a1a; color: #fff; cursor: pointer;
  font-family: var(--f-mono); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .08em;
  transition: background-color .25s;
}
.tb__copy:hover { background: var(--red); }
.tb__copy.is-done { background: #17652F; }
.tb__rcta { margin-top: 6px; font-weight: 700; font-size: 15px; }
.tb__rdemo { font-size: 12px; font-weight: 700; color: var(--red-deep); }
.tb__stamp {
  align-self: center; margin: 4px 0 10px; padding: 6px 16px 4px;
  font-family: var(--f-display); text-transform: uppercase; font-size: 42px; line-height: 1;
  color: var(--red); border: 4px solid currentColor; border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--tb-paper), inset 0 0 0 4px currentColor;
  rotate: -7deg; opacity: .92;
}
.tb__stamp--ink { color: #1a1a1a; }
.tb__rmsg { font-size: 14px; line-height: 1.5; }
.tb__rmsg b { white-space: nowrap; }
.tb__rnext { font-weight: 700; font-size: 18px; line-height: 1.3; }
.tb__rsmall { font-size: 12px; color: #555; }
.tb__rlast { display: flex; flex-direction: column; gap: 8px; }
.tb__rlast:empty { display: none; }
.tb__rlink { align-self: center; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.tb__back {
  display: flex; align-items: center; min-height: 44px; margin: 0 auto; padding: 0 12px;
  background: none; border: 0; color: #1a1a1a; cursor: pointer;
  font-family: var(--f-mono); font-weight: 700; font-size: 13px; text-transform: uppercase;
  text-decoration: underline; text-underline-offset: 3px;
}
.tb__rfoot { margin-top: 10px; text-align: center; font-size: 11px; letter-spacing: .1em; color: #6b6b6b; }

/* Impression du ticket et coup de tampon */
.tb__card.is-flipped .tb__rbody > * { animation: tb-print .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms + .4s); }
.tb__card.is-flipped .tb__rbody > .tb__stamp { animation: tb-stamp .42s cubic-bezier(.5, 0, .75, 0) .75s both; }
@keyframes tb-print { from { opacity: 0; transform: translateY(10px); } }
@keyframes tb-stamp { from { opacity: 0; transform: scale(2.6); } }

/* Focus lisible sur le papier */
.tb__billet :focus-visible, .tb__paper :focus-visible, .tb__rules :focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
.tb__input:focus-visible, .tb__billet:focus { outline: none; }
.tb__paper .tb__rbody:focus-visible { outline: none; }

/* ---------- Règlement (dialog) ---------- */
.tb__rules {
  width: min(560px, calc(100% - 32px)); max-width: none;
  max-height: calc(100% - 32px);
  margin: auto; padding: 0; border: 0;
  background: transparent; color: var(--ink); overflow: visible;
}
.tb__rules:not([open]) { display: none; }
.tb__rules.is-fallback { position: fixed; inset: 0; z-index: 500; }
.tb__rules[open] { animation: tb-pop .45s var(--ease-back); }
.tb__rules::backdrop { background: rgba(11, 10, 9, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
/* Le dialog est dans la « top layer », au-dessus du curseur maison du site (cursor: none partout) : curseur natif ici */
.tb__rules, .tb__rules::backdrop { cursor: auto; }
.tb__rules :is(a, button) { cursor: pointer; }
@keyframes tb-pop { from { opacity: 0; transform: translateY(24px) scale(.96); } }
.tb__rules-paper {
  position: relative;
  max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
  overflow-y: auto; overscroll-behavior: contain;
  padding: 26px 20px 20px; border-radius: var(--r);
  background: var(--paper);
  box-shadow: 10px 10px 0 var(--red);
}
.tb__rules-x {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; border: 0; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--cream); font-size: 16px; cursor: pointer;
}
.tb__rules-k { padding-right: 52px; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--red-deep); }
.tb__rules-t { margin: 4px 0 16px; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: clamp(42px, 8vw, 62px); line-height: .95; }
.tb__rules-list { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 14px; counter-reset: tbr; }
.tb__rules-list > li { position: relative; padding-left: 40px; font-size: 15px; line-height: 1.5; counter-increment: tbr; }
.tb__rules-list > li::before {
  content: counter(tbr, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--cream); font-family: var(--f-mono); font-size: 11px;
}
.tb__rules-prizes { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.tb__rules-prizes li { position: relative; padding-left: 18px; font-family: var(--f-mono); font-size: 13.5px; }
.tb__rules-prizes li::before { content: '→'; position: absolute; left: 0; color: var(--red-deep); }
.tb__rules a { font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.tb__nw { white-space: nowrap; }

/* Lecteurs d'écran uniquement */
.tb__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* ---------- Grands écrans ---------- */
@media (min-width: 600px) {
  .tb__demo span { font-size: 12px; letter-spacing: .1em; font-stretch: 120%; padding: 7px 16px; }
  .tb__billet { grid-template-columns: 52px minmax(0, 1fr); }
  .tb__billet-body { padding: 24px 24px 18px; }
  .tb__paper { padding: 32px 28px; }
}
@media (min-width: 960px) {
  .tb__head { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: end; column-gap: clamp(40px, 6vw, 110px); }
  .tb__play { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); column-gap: clamp(40px, 5vw, 96px); }
  .tb__play { align-items: start; }
  .tb__stage { width: min(100%, 590px); }
  /* calé en haut : le ticket (plus long) s'étire vers le bas sans faire sauter le billet */
  .tb__card { margin: clamp(48px, 6.5vw, 100px) 0 0; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .tb__sway, .tb__rays, .tb__glint, .tb__spot.is-win, .tb__rules[open] { animation: none; }
  .tb__bulb, .tb.is-win .tb__bulb { animation: none; opacity: 1; }
  .tb__card-in, .tb__seg { transition: none; }
  .tb__card.is-flipped .tb__rbody > *, .tb__card.is-flipped .tb__rbody > .tb__stamp { animation: none; }
}

/* Rien ne tourne tant que la section n'est pas à l'écran */
.tb:not(.is-live) *, .tb:not(.is-live) *::before, .tb:not(.is-live) *::after { animation-play-state: paused !important; }

/* Très petits écrans (320 px) : le numéro reste lisible en entier */
@media (max-width: 359px) {
  .tb__billet { grid-template-columns: 34px minmax(0, 1fr); }
  .tb__billet-body { padding-inline: 14px; }
  .tb__input { font-size: 17px; letter-spacing: 0; padding-inline: 12px; }
  .tb__sticker { width: 27%; }
  .tb__sticker small { font-size: 9px; font-stretch: 100%; letter-spacing: 0; }
}
