/* Écrans invités */
.screen {
  width: 100%; max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; gap: 20px;
  padding: calc(28px + env(safe-area-inset-top)) 22px calc(22px + env(safe-area-inset-bottom)) 22px;
}
.grow { flex-grow: 1; }
.center { text-align: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 10px; }

.wordmark { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.wordmark .w1 { font-size: 20px; font-weight: 500; letter-spacing: 5px; }
.wordmark .w2 { font-size: 10px; letter-spacing: 8px; color: var(--gold); }

.logo-box { height: 44px; max-width: 140px; display: flex; align-items: center; }
.logo-box img { max-height: 44px; max-width: 140px; object-fit: contain; }
.logo-ph { font-size: 11px; letter-spacing: 3px; color: var(--gold); text-transform: uppercase; }

.gains-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--gold); background: transparent; color: var(--gold); font-size: 13px; font-weight: 600; letter-spacing: 1px; cursor: pointer; }
.gains-pill .dot { width: 8px; height: 8px; border-radius: 4px; background: var(--gold-light); }

.banner { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: var(--surface); border-left: 3px solid var(--gold); }
.banner .b1 { font-size: 11px; letter-spacing: 3px; color: var(--gold); text-transform: uppercase; }
.banner .b2 { font-size: 14px; line-height: 1.4; color: rgba(255,255,255,0.85); }

.stars { display: flex; gap: 8px; justify-content: center; }
.stats { display: flex; gap: 12px; }
.stat { flex: 1; padding: 12px 14px; background: var(--surface); display: flex; align-items: baseline; justify-content: space-between; }
.stat .k { font-size: 10px; letter-spacing: 2px; color: var(--text-2); text-transform: uppercase; }
.stat .v { font-size: 20px; font-weight: 300; white-space: nowrap; }
.stat .v.gold { color: var(--gold); }

/* Formulaire */
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 12px; letter-spacing: 3px; color: var(--text-2); text-transform: uppercase; }
.field input { height: 54px; padding: 0 16px; background: var(--surface); border: 1px solid rgba(255,255,255,0.2); color: var(--text); font-size: 17px; border-radius: 0; }
.field input::placeholder { color: rgba(255,255,255,0.45); }
.error { color: var(--red-text); font-size: 14px; min-height: 18px; }

.event-card { display: flex; align-items: center; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid rgba(212,171,19,0.35); color: var(--text); text-decoration: none; cursor: pointer; width: 100%; text-align: left; }
.event-card .lg { width: 56px; height: 56px; flex-shrink: 0; border: 1px solid var(--gold-line); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.event-card .lg img { max-width: 100%; max-height: 100%; }
.event-card .n { font-size: 18px; font-weight: 500; }
.event-card .t { font-size: 14px; color: var(--text-2); }

/* En-tête de défi */
.ch-head .lbl { font-size: 22px; font-weight: 500; }
.ring { position: relative; width: 64px; height: 64px; flex-shrink: 0; }
.ring svg { position: absolute; inset: 0; }
.ring .num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 500; }

.prepare-count { font-size: 120px; font-weight: 300; line-height: 1; color: var(--gold); }
@keyframes epPop { 0% { transform: scale(0.6); opacity: 0 } 70% { transform: scale(1.08); opacity: 1 } 100% { transform: scale(1) } }
.pop { animation: epPop 0.5s ease-out both; }
@keyframes epShake { 0%,100% { transform: translateX(0) } 20% { transform: translateX(-10px) } 40% { transform: translateX(10px) } 60% { transform: translateX(-6px) } 80% { transform: translateX(6px) } }
.shake { animation: epShake 0.4s ease-in-out; }

/* Quiz */
.q-title { margin: 0; font-size: 26px; font-weight: 400; line-height: 1.3; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt { min-height: 62px; display: flex; align-items: center; gap: 14px; padding: 10px 18px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 19px; text-align: left; cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.opt .letter { width: 28px; height: 28px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; border: 1px solid var(--gold); color: var(--gold); font-size: 13px; font-weight: 600; }
.opt.picked { border-color: var(--gold); background: rgba(212,171,19,0.15); }
.opt.right { background: var(--gold); border-color: var(--gold); color: var(--bg); }
.opt.right .letter { border-color: var(--bg); color: var(--bg); }
.opt.wrong { background: rgba(139,30,45,0.6); border-color: var(--red); }
.opt:disabled { cursor: default; }

/* Vrai / faux */
.steps { display: flex; gap: 8px; }
.steps span { flex: 1; height: 6px; background: rgba(255,255,255,0.15); transition: background 0.3s; }
.steps span.cur { background: rgba(255,255,255,0.5); }
.steps span.ok { background: var(--gold); }
.steps span.ko { background: var(--red); }
.vf-card { min-height: 190px; padding: 24px 20px; background: var(--surface); border: 2px solid transparent; display: flex; align-items: center; transition: border-color 0.2s; }
.vf-card p { margin: 0; font-size: 24px; line-height: 1.35; }
.vf-card.ok { border-color: var(--gold); }
.vf-card.ko { border-color: var(--red); }
@keyframes epSlide { from { opacity: 0; transform: translateX(40px) } to { opacity: 1; transform: translateX(0) } }
.slide { animation: epSlide 0.35s ease-out both; }
.vf-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vf-btns button { height: 92px; font-size: 26px; font-weight: 600; letter-spacing: 4px; cursor: pointer; }
.vf-btns .t { background: var(--gold); border: none; color: var(--bg); }
.vf-btns .f { background: transparent; border: 2px solid var(--gold); color: var(--gold); }

/* Roue */
.wheel-wrap { position: relative; width: 320px; height: 344px; margin: 0 auto; flex-shrink: 0; }
.wheel-rot { position: absolute; top: 34px; left: 10px; width: 300px; height: 300px; will-change: transform; }
@keyframes epBlinkA { 0%,100% { opacity: 1 } 50% { opacity: 0.25 } }
@keyframes epBlinkB { 0%,100% { opacity: 0.25 } 50% { opacity: 1 } }
.lights-a { animation: epBlinkA 1.2s ease-in-out infinite; }
.lights-b { animation: epBlinkB 1.2s ease-in-out infinite; }
.fast .lights-a, .fast .lights-b { animation-duration: 0.3s; }

/* Machine à sous */
.cabinet { background: var(--surface); border: 2px solid var(--gold); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
.reels { position: relative; display: flex; gap: 8px; justify-content: center; }
.reel { position: relative; width: 92px; height: 288px; overflow: hidden; background: var(--bg); border: 1px solid var(--gold-line); }
.strip { will-change: transform; }
.sym { height: 96px; display: flex; align-items: center; justify-content: center; font-size: 52px; font-weight: 500; line-height: 1; }
.fade-t, .fade-b { position: absolute; left: 0; right: 0; height: 80px; pointer-events: none; }
.fade-t { top: 0; background: linear-gradient(#202020, rgba(32,32,32,0)); }
.fade-b { bottom: 0; background: linear-gradient(rgba(32,32,32,0), #202020); }
.payline { position: absolute; top: 96px; left: -6px; right: -6px; height: 96px; border-top: 2px solid var(--gold); border-bottom: 2px solid var(--gold); pointer-events: none; }
.paytable { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; font-size: 12px; color: var(--text-2); }

/* Dés */
.tray { position: relative; height: 340px; flex-shrink: 0; overflow: hidden; background: var(--felt); border: 2px solid var(--gold); box-shadow: inset 0 0 40px rgba(0,0,0,0.55); }
.tray .brand { position: absolute; top: 12px; left: 0; right: 0; text-align: center; font-size: 10px; letter-spacing: 6px; color: rgba(212,171,19,0.55); }
.die { position: absolute; width: 72px; height: 72px; }
.die .face { width: 72px; height: 72px; padding: 10px; background: var(--ivory); border-radius: 14px; box-shadow: inset 0 -5px 0 rgba(0,0,0,0.12), 6px 10px 14px rgba(0,0,0,0.5); display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.die .face span { display: flex; align-items: center; justify-content: center; }
.die .face i { width: 12px; height: 12px; border-radius: 6px; background: #131313; }
.die .face i.off { opacity: 0; }
.die .face.one i { background: #8B1E2D; }
@keyframes epGlow { 0%,100% { box-shadow: 0 0 0 rgba(253,216,53,0) } 50% { box-shadow: 0 0 26px rgba(253,216,53,0.7) } }
.glow { animation: epGlow 1.2s ease-in-out infinite; }

/* Course */
.lanes { position: relative; border: 1px solid rgba(212,171,19,0.35); background: var(--surface-2); }
.lane { position: relative; height: 62px; border-bottom: 1px dashed rgba(255,255,255,0.12); border-left: 3px solid transparent; }
.lane.me { background: rgba(212,171,19,0.12); border-left-color: var(--gold); }
.lane .nm { position: absolute; top: 5px; left: 10px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.lane.me .nm { color: var(--gold); }
.lane .finish { position: absolute; top: 0; right: 0; width: 8px; height: 100%; background: repeating-linear-gradient(0deg, #F7F3E8 0px, #F7F3E8 6px, #131313 6px, #131313 12px); }
.horse { position: absolute; bottom: 4px; font-size: 36px; line-height: 1; color: var(--ivory); transition: left 0.1s linear; }
.lane.me .horse { color: var(--gold); }
@keyframes epGallop { 0%,100% { transform: scaleX(-1) translateY(0) rotate(0deg) } 50% { transform: scaleX(-1) translateY(-4px) rotate(-6deg) } }
.horse { transform: scaleX(-1); }
.horse.run { animation: epGallop 0.32s ease-in-out infinite; }
.horse.sprint { animation: epGallop 0.18s ease-in-out infinite; text-shadow: -6px 0 0 rgba(253,216,53,0.45), -14px 0 0 rgba(253,216,53,0.2); }
.horse.tired { animation: epGallop 0.6s ease-in-out infinite; opacity: 0.6; }
.peloton { position: relative; height: 26px; background: var(--surface); border-right: 4px solid var(--gold); }
.peloton i { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: rgba(247,243,232,0.55); transition: left 0.1s linear; }
.peloton i.me { width: 12px; height: 12px; background: var(--gold); top: 7px; z-index: 2; }
.top3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.top3 div { padding: 8px 10px; background: var(--surface); min-width: 0; }
.top3 .k { font-size: 10px; letter-spacing: 2px; color: var(--text-2); text-transform: uppercase; }
.top3 .v { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.comment { min-height: 22px; text-align: center; font-size: 15px; font-style: italic; color: var(--gold-light); }
@keyframes epDelta { 0% { transform: scale(0.5); opacity: 0 } 30% { transform: scale(1.25); opacity: 1 } 100% { transform: scale(1); opacity: 1 } }
.delta { display: inline-block; animation: epDelta 0.45s ease-out both; font-size: 15px; font-weight: 600; }

/* Résultats */
.res-list { display: flex; flex-direction: column; gap: 8px; }
.res-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-left: 3px solid var(--gold); }
.res-item .pos { font-size: 20px; font-weight: 600; color: var(--gold); width: 26px; }
.res-item .nm { flex-grow: 1; font-size: 17px; }
.res-item .amt { font-size: 17px; font-weight: 500; color: var(--gold); }
.res-item.me { background: rgba(212,171,19,0.15); }
.bigwin { font-size: 72px; font-weight: 300; line-height: 1; color: var(--gold); }

/* Tickets */
.ticket { position: relative; background: var(--gold); color: var(--bg); }
.ticket .top { padding: 18px 20px 14px; display: flex; flex-direction: column; gap: 4px; }
.ticket .cut { border-top: 2px dashed rgba(19,19,19,0.45); margin: 0 12px; }
.ticket .bot { padding: 14px 20px 18px; display: flex; align-items: flex-end; justify-content: space-between; }
.ticket .k { font-size: 11px; letter-spacing: 3px; text-transform: uppercase; font-weight: 500; }
.ticket.paid { opacity: 0.55; }
.stamp-wrap { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(19,19,19,0.3); }
@keyframes epStamp { 0% { transform: rotate(-14deg) scale(2.2); opacity: 0 } 60% { transform: rotate(-14deg) scale(0.92); opacity: 1 } 100% { transform: rotate(-14deg) scale(1); opacity: 1 } }
.stamp { padding: 6px 20px; border: 4px solid #131313; color: #131313; background: rgba(212,171,19,0.92); font-size: 32px; font-weight: 600; letter-spacing: 6px; transform: rotate(-14deg); }
.stamp.anim { animation: epStamp 0.45s ease-out both; }
.ticket-mini { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border-left: 3px solid var(--gold); width: 100%; color: var(--text); border-top: none; border-right: none; border-bottom: none; text-align: left; cursor: pointer; }
.ticket-mini .amt { font-size: 22px; font-weight: 500; color: var(--gold); min-width: 92px; }
.ticket-mini .lb { flex-grow: 1; font-size: 15px; }
.ticket-mini .st { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--text-3); }
.ticket-mini .st.todo { color: var(--gold-light); }

.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; }
.keypad button { height: 52px; background: var(--surface); border: 1px solid var(--line); color: var(--text); font-size: 22px; cursor: pointer; }
.keypad button:active { transform: scale(0.96); }
.dots { display: flex; gap: 14px; justify-content: center; height: 18px; align-items: center; }
.dots i { width: 14px; height: 14px; border-radius: 7px; border: 2px solid var(--gold); }
.dots i.on { background: var(--gold); }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--surface); border: 1px solid var(--gold); color: var(--text); padding: 10px 16px; font-size: 14px; z-index: 50; max-width: 90vw; }
.offline { position: fixed; top: 0; left: 0; right: 0; padding: 6px; text-align: center; font-size: 12px; background: var(--red); color: #fff; z-index: 60; }

/* ===== v2 : nouveaux défis ===== */
.felt { position: relative; background: var(--felt); border: 2px solid var(--gold); overflow: hidden; }
.ep-site { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-left: 3px solid var(--gold); font-size: 14px; line-height: 1.4; color: rgba(255,255,255,0.85); }
.ep-site div { flex: 1; }
.ep-site .btn { flex-shrink: 0; min-height: 44px; padding: 0 14px; font-size: 12px; }
.tt-over { position: absolute; inset: 0; background: rgba(19,19,19,0.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; padding: 16px; z-index: 5; }
.tt-over[hidden] { display: none; }

/* Cartes à jouer */
.pcard { position: relative; flex-shrink: 0; box-sizing: border-box; background: #FFFEF9; border: 1px solid #D9D3C3; box-shadow: inset 0 0 0 5px #FFFEF9, inset 0 0 0 6px rgba(0,0,0,0.05), 0 14px 30px rgba(0,0,0,0.55); }
.pcard.flip1 { animation: epFlipA 0.45s ease-out both; }
.pcard.flip0 { animation: epFlipB 0.45s ease-out both; }
@keyframes epFlipA { 0% { transform: rotateY(90deg) translateX(30px); opacity: 0.4 } 100% { transform: rotateY(0) translateX(0); opacity: 1 } }
@keyframes epFlipB { 0% { transform: rotateY(90deg) translateX(30px); opacity: 0.4 } 100% { transform: rotateY(0) translateX(0); opacity: 1 } }

/* Tap-Tap Croupier */
.tt-zone { position: relative; flex: 1 1 auto; min-height: 360px; max-height: 470px; background: #1A1A1A; border: 1px solid var(--gold-line); overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
.tt-body { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; }
.tt-head { position: absolute; top: 6%; left: 50%; width: 200px; height: 220px; margin-left: -100px; transform-origin: 50% 95%; pointer-events: none; }
.tt-head.bonk-a { animation: epBonkA 0.28s ease-out; }
.tt-head.bonk-b { animation: epBonkB 0.28s ease-out; }
.tt-head .bump { opacity: 0; transform: scale(0.01); transform-box: fill-box; transform-origin: center; transition: transform 0.25s ease-out, opacity 0.15s; }
.tt-head .bump.on { opacity: 1; transform: scale(1); }
.tt-stars { position: absolute; top: 4%; left: 0; right: 0; text-align: center; color: var(--gold-light); font-size: 26px; letter-spacing: 30px; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.tt-stars.on { opacity: 1; animation: epWobble 1.2s ease-in-out infinite; }
.tt-word { position: absolute; padding: 4px 12px; background: var(--gold-light); color: var(--bg); font-size: 24px; font-weight: 700; letter-spacing: 1px; pointer-events: none; z-index: 4; }
.tt-word.a { animation: epBurstA 0.6s ease-out forwards; }
.tt-word.b { animation: epBurstB 0.6s ease-out forwards; }
@keyframes epBonkA { 0% { transform: rotate(0) } 30% { transform: rotate(-9deg) translateX(-8px) scale(0.96,1.03) } 60% { transform: rotate(5deg) translateX(4px) } 100% { transform: rotate(0) } }
@keyframes epBonkB { 0% { transform: rotate(0) } 30% { transform: rotate(9deg) translateX(8px) scale(0.96,1.03) } 60% { transform: rotate(-5deg) translateX(-4px) } 100% { transform: rotate(0) } }
@keyframes epBurstA { 0% { transform: translate(-50%,-50%) scale(0.4) rotate(-12deg); opacity: 0 } 25% { transform: translate(-50%,-50%) scale(1.15) rotate(-6deg); opacity: 1 } 100% { transform: translate(-50%,-80%) rotate(-6deg); opacity: 0 } }
@keyframes epBurstB { 0% { transform: translate(-50%,-50%) scale(0.4) rotate(10deg); opacity: 0 } 25% { transform: translate(-50%,-50%) scale(1.15) rotate(6deg); opacity: 1 } 100% { transform: translate(-50%,-80%) rotate(6deg); opacity: 0 } }
@keyframes epWobble { 0%,100% { transform: rotate(-4deg) } 50% { transform: rotate(4deg) } }

/* Pile de jetons */
.pile-zone { position: relative; flex: 1 1 auto; min-height: 380px; max-height: 540px; background: #1A1A1A; border: 1px solid var(--gold-line); overflow: hidden; touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; }
.pile-world { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transition: transform 0.35s ease-out; }
.pchip { position: absolute; left: 0; height: 24px; border-radius: 5px; box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -3px 0 rgba(0,0,0,0.35), 0 2px 3px rgba(0,0,0,0.45); }
.pchip.moving { will-change: transform; box-shadow: inset 0 1px 0 rgba(255,255,255,0.45), inset 0 -3px 0 rgba(0,0,0,0.35), 0 5px 10px rgba(0,0,0,0.5); }
.pchip.fall.a { animation: epFallA 0.9s ease-in forwards; }
.pchip.fall.b { animation: epFallB 0.9s ease-in forwards; }
@keyframes epFallA { to { transform: translateY(520px) rotate(28deg); opacity: 0 } }
@keyframes epFallB { to { transform: translateY(520px) rotate(-28deg); opacity: 0 } }
.pile-perfect { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font-size: 15px; letter-spacing: 4px; color: var(--gold-light); text-transform: uppercase; opacity: 0; pointer-events: none; }
.pile-perfect.on { animation: epFadeUp 1s ease-out both; }
@keyframes epFadeUp { 0% { opacity: 0; transform: translateY(8px) } 20% { opacity: 1; transform: none } 80% { opacity: 1 } 100% { opacity: 0 } }

/* Plus haut / plus bas */
.hb-table { min-height: 360px; display: flex; align-items: center; justify-content: center; perspective: 900px; }
.hb-prev { position: absolute; left: -28px; top: 50%; margin-top: -122px; transform: scale(0.52) rotate(-10deg); opacity: 0.6; }
.hb-msg { position: absolute; bottom: 14px; left: 0; right: 0; text-align: center; font-size: 16px; font-weight: 500; }
.hb-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hb-btns button { height: 84px; font-family: inherit; font-size: 18px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; cursor: pointer; }
.hb-btns .up { background: var(--gold); border: none; color: var(--bg); }
.hb-btns .down { background: transparent; border: 2px solid var(--gold); color: var(--gold); }
.hb-btns button:disabled { opacity: 0.45; cursor: default; }

/* Mémoire */
.mm-grid { padding: 22px; display: grid; grid-template-columns: 1fr 1fr; gap: 22px; justify-items: center; }
.mm-chip { width: min(128px, 34vw); height: min(128px, 34vw); padding: 0; border: none; border-radius: 50%; background: transparent; cursor: pointer; filter: brightness(0.85); box-shadow: 0 6px 14px rgba(0,0,0,0.5); transition: transform 0.12s ease-out, filter 0.12s, box-shadow 0.12s; touch-action: manipulation; }
.mm-chip svg { width: 100%; height: 100%; display: block; }
.mm-grid.dim .mm-chip { filter: brightness(0.6); }
.mm-chip.lit, .mm-grid.dim .mm-chip.lit { transform: scale(1.1); filter: brightness(1.35); box-shadow: 0 0 34px rgba(253,216,53,0.85); }

/* Chasse au code */
.cc-card { animation: epFloat 3s ease-in-out infinite; }
@keyframes epFloat { 0%,100% { transform: rotate(-6deg) translateY(0) } 50% { transform: rotate(-4deg) translateY(-6px) } }
.cc-boxes { display: flex; justify-content: center; gap: 12px; }
.cc-boxes div { width: 58px; height: 70px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 2px solid rgba(255,255,255,0.2); font-size: 38px; }
.cc-boxes div.cur { border-color: var(--gold); }
.cc-pad button { height: 52px; }

/* Écran sans connexion */
.offline-screen .spin { width: 40px; height: 40px; border: 3px solid rgba(255,255,255,0.15); border-top-color: var(--gold); border-radius: 50%; animation: epSpin 1s linear infinite; }
@keyframes epSpin { to { transform: rotate(360deg) } }

/* Encaissement groupé */
.pay-choice { display: flex; flex-direction: column; gap: 10px; }
.paid-all { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 18px; background: var(--gold); color: var(--bg); text-align: center; position: relative; overflow: hidden; }
.paid-all .stamp-wrap { position: static; inset: auto; display: flex; justify-content: center; margin-top: 8px; background: none; pointer-events: none; }

/* ===== v3 : écran de consignes ===== */
.rules-count { width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--gold); display: flex; align-items: center; justify-content: center; font-size: 28px; font-weight: 500; color: var(--gold); }
.rules-steps { margin: 0; padding: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 12px; }
.rules-steps li { counter-increment: st; position: relative; padding: 12px 14px 12px 54px; background: var(--surface); font-size: 18px; line-height: 1.4; }
.rules-steps li::before { content: counter(st); position: absolute; left: 12px; top: 50%; margin-top: -15px; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--bg); font-weight: 600; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.rules-tip { padding: 12px 14px; border-left: 3px solid var(--gold); background: rgba(212,171,19,0.08); font-size: 16px; line-height: 1.4; }
.rules-tip.warn { border-left-color: var(--gold-light); background: rgba(253,216,53,0.14); font-weight: 600; font-size: 18px; }
.rules-prize { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; font-size: 17px; color: var(--gold); }
/* Démonstration animée de la Pile de jetons */
.demo-pile { position: relative; width: 300px; max-width: 100%; margin: 0 auto; height: 120px; background: #1A1A1A; border: 1px solid var(--gold-line); overflow: hidden; }
.demo-pile i { position: absolute; height: 16px; border-radius: 4px; background: linear-gradient(180deg, #EFCF5A, #D4AB13 45%, #8A6D08); box-shadow: inset 0 -2px 0 rgba(0,0,0,0.35); }
.dp-stack i { left: 95px; width: 110px; }
.dp-stack i:nth-child(1) { bottom: 8px; background: linear-gradient(180deg, #B23A4B, #8B1E2D 45%, #4E0E17); }
.dp-stack i:nth-child(2) { bottom: 25px; }
.dp-stack i:nth-child(3) { bottom: 42px; background: linear-gradient(180deg, #3A5F8F, #1E3A5F 45%, #0D1D33); }
.dp-move { position: absolute; left: 0; right: 0; bottom: 59px; height: 16px; animation: dpSlide 3s ease-in-out infinite; }
.dp-move i { left: 0; width: 110px; }
.dp-tap { position: absolute; top: 8px; right: 10px; font-size: 12px; letter-spacing: 3px; color: var(--gold-light); font-weight: 600; animation: dpTap 3s ease-in-out infinite; }
@keyframes dpSlide { 0% { transform: translateX(0); opacity: 1 } 20% { transform: translateX(180px) } 45% { transform: translateX(95px) } 46%,85% { transform: translateX(95px); opacity: 1 } 100% { transform: translateX(95px); opacity: 0 } }
@keyframes dpTap { 0%,40% { opacity: 0 } 45%,60% { opacity: 1; transform: scale(1.1) } 70%,100% { opacity: 0 } }

/* ===== v3 : écrans de jeu qui tiennent dans l'écran, bouton principal toujours visible ===== */
.screen.game { height: 100vh; height: 100dvh; min-height: 0; overflow-y: auto; overflow-x: hidden; gap: 14px; padding-top: calc(14px + env(safe-area-inset-top)); padding-bottom: calc(14px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.screen.game > .btn, .screen.game > .hb-btns, .screen.game > .vf-btns, .screen.game .cta { position: sticky; bottom: 0; z-index: 8; box-shadow: 0 -16px 14px -4px var(--bg), 0 14px 0 0 var(--bg); flex-shrink: 0; }
.screen.game > .grow { min-height: 0; }
.tt-zone { min-height: 240px; flex: 1 1 0; }
.pile-zone { min-height: 260px; flex: 1 1 0; }
.hb-table { min-height: 300px; }
.mm-chip { width: min(128px, 34vw, 17vh); height: min(128px, 34vw, 17vh); }
@media (max-height: 760px) {
  .wheel-wrap, .reels, .tray, .hb-table .pcard, .cc-card { zoom: 0.84; }
  .hb-table { min-height: 260px; }
  .ch-head .lbl { font-size: 19px; }
  .q-title { font-size: 22px; }
  .opt { min-height: 52px; font-size: 17px; }
  .vf-card { min-height: 140px; }
  .vf-card p { font-size: 21px; }
}
@media (max-height: 640px) {
  .wheel-wrap, .reels, .tray, .hb-table .pcard, .cc-card { zoom: 0.7; }
  .hb-table { min-height: 220px; }
  .bigwin { font-size: 56px; }
  .prepare-count { font-size: 90px; }
  .rules-steps li { font-size: 16px; padding-top: 9px; padding-bottom: 9px; }
}
.slide.out, .vf-card.out { animation: epSlideOut 0.25s ease-in forwards; }
@keyframes epSlideOut { to { opacity: 0; transform: translateX(-40px) } }
/* Tap-Tap : score final au niveau du torse, la tête du chef reste visible */
.tt-over.low { inset: auto 0 0 0; top: min(calc(6% + 222px), 66%); height: auto; justify-content: center; gap: 4px; padding: 6px 12px 10px; background: linear-gradient(180deg, rgba(19,19,19,0) 0%, rgba(19,19,19,0.9) 22%, rgba(19,19,19,0.96) 100%); }
.tt-over.low .pop { font-size: 52px !important; }

/* V4 : bandeau d'attente une fois qu'on a fini un défi */
.waitpill { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); width: fit-content; max-width: 440px; margin: 0 auto; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: rgba(19,19,19,0.94); border: 1px solid var(--gold-line); color: var(--text-1, #F7F3E8); font-size: 14px; line-height: 1.3; box-shadow: 0 6px 24px rgba(0,0,0,0.5); animation: epPillIn 0.3s ease-out; pointer-events: none; }
.waitpill b { color: var(--gold); font-weight: 600; white-space: nowrap; }
.waitpill span { text-align: center; }
.waitpill i { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); animation: epPillDot 1.2s ease-in-out infinite; }
.waitpill.all { border-color: var(--gold); }
.waitpill.all i { background: var(--gold-light); }
@keyframes epPillIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes epPillDot { 0%, 100% { opacity: 0.3; } 50% { opacity: 1; } }

/* V4 : course à la cravache */
.arrived { text-align: center; font-size: 22px; font-weight: 300; color: #fff; padding: 6px 0; animation: epPillIn 0.3s ease-out; }
.arrived[hidden] { display: none; }
.arrived b { color: var(--gold); font-weight: 600; }
.cr-tap { flex: 1 1 auto; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: #1A1A1A; border: 1px solid var(--gold); touch-action: manipulation; user-select: none; -webkit-user-select: none; cursor: pointer; padding: 12px; }
.cr-tap-t { font-size: 34px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase; color: var(--gold); pointer-events: none; }
.cr-tap .small { pointer-events: none; }
.cr-tap.hit { animation: epCrHit 0.12s ease-out; }
.cr-tap.off { opacity: 0.45; border-color: var(--gold-line); }
.cr-gauge { width: 80%; height: 8px; background: rgba(255,255,255,0.1); pointer-events: none; }
.cr-gauge i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--gold-light)); transition: width 0.2s linear; }
@keyframes epCrHit { 0% { background: rgba(212,171,19,0.28); } 100% { background: #1A1A1A; } }
/* le bouton grisé du bas (« Lancers épuisés », « En selle ✓ »…) laisse la place au bandeau d'attente */
.has-pill .screen.game > .btn[disabled] { visibility: hidden; }
