/* Habillage Halloween : même mise en page, ambiance de nuit */
:root { --night: #1A1433; --night-2: #2A2050; --pumpkin: #FB7303; --moon: #FFF1C7; --cream: #FBF3E4; }
body { background: var(--cream); }
.header { background: var(--night); color: #FFFFFF; position: relative; z-index: 3; }
.header .logo { color: #FFFFFF; }
.header .logo .script { color: var(--pumpkin); }
.nav .nav__pill { background: var(--pumpkin); color: var(--night); }
.burger { border-color: #FFFFFF; color: #FFFFFF; }
.boo { background: var(--pumpkin); color: var(--night); text-align: center; font-weight: 800; font-size: 14px; letter-spacing: .08em; text-transform: uppercase; padding: 9px 16px; }
.boo .script { text-transform: none; letter-spacing: 0; font-size: 22px; font-weight: 400; margin-right: 6px; }
.hero { position: relative; overflow: hidden; background: radial-gradient(circle at 80% 18%, rgba(255,241,199,.18), transparent 32%), linear-gradient(180deg, var(--night) 0%, var(--night-2) 100%); }
.hero .wrap { position: relative; z-index: 1; }
.hero__slogan { color: #FFFFFF; }
.hero__slogan em { font-style: normal; color: var(--pumpkin); }
.hero .eyebrow-h { font-family: "Pinyon Script", cursive; font-size: clamp(30px, 3vw, 42px); color: var(--pumpkin); line-height: 1; }
.hero__frame img { border-color: var(--pumpkin); filter: saturate(.85) contrast(1.05); }
.hero__frame::after { content: ""; position: absolute; inset: 6px; border-radius: 999px 999px 28px 28px; background: linear-gradient(180deg, rgba(26,20,51,0) 55%, rgba(26,20,51,.55)); pointer-events: none; }
.badge i { background: var(--pumpkin); }
.badge span { color: var(--night); }
.btn--white { background: var(--pumpkin); color: var(--night); }
.moon { position: absolute; right: 6%; top: 8%; width: 120px; height: 120px; border-radius: 50%; background: var(--moon); box-shadow: 0 0 60px 20px rgba(255,241,199,.25); opacity: .9; }
.bats { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.bats svg { position: absolute; fill: #0D0A1C; }
@keyframes flap { 0%,100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
.bats svg { animation: flap 3.2s ease-in-out infinite; }
.bats svg:nth-child(2) { animation-delay: -1s; } .bats svg:nth-child(3) { animation-delay: -2s; }
.web { position: absolute; width: 150px; height: 150px; opacity: .35; pointer-events: none; }
.section, .band { position: relative; }
.head h2 { position: relative; }
.pumpkin-row { display: flex; justify-content: center; gap: 10px; margin-top: 8px; }
.band--blue { background: linear-gradient(180deg, var(--night-2), var(--night)); }
.band--blue .formula__price { color: var(--pumpkin); }
.band--blue .btn--yellow { background: var(--pumpkin); }
.band--yellow { background: var(--pumpkin); }
.box--call { background: var(--night); }
.box--call .script { color: var(--pumpkin); }
.loyalty { background: var(--night); }
.loyalty h3 { color: var(--pumpkin); }
.footer { background: #0D0A1C; position: relative; padding-top: 70px; overflow: hidden; }
.graves { position: absolute; left: 0; top: -1px; width: 100%; height: 72px; pointer-events: none; }
.spooky { background: var(--night); color: #FFFFFF; border-radius: 28px; padding: clamp(24px,4vw,40px); display: flex; flex-wrap: wrap; align-items: center; gap: 24px 40px; margin-top: 30px; position: relative; overflow: hidden; }
.spooky h3 { font-size: clamp(32px, 4vw, 48px); color: var(--pumpkin); }
.spooky p { max-width: 520px; }
.spooky .txt { flex: 1 1 360px; display: flex; flex-direction: column; gap: 10px; }
.spooky .note { font-size: 13px; opacity: .75; font-style: italic; }
@media (max-width: 899px) {
  .moon { width: 64px; height: 64px; right: -14px; top: 18px; opacity: .75; }
  .bats { z-index: 0; }
  .bats svg:nth-child(1) { left: auto !important; right: 50px; top: 24px !important; width: 40px; }
  .bats svg:nth-child(n+2) { display: none; }
}

/* Jeu : attrape les chauves-souris */
.game-sec { background: var(--night); color: #FFFFFF; }
.game-sec .head h2 { color: var(--pumpkin); }
.game-sec .head p { color: #E6E1F5; }
.game { position: relative; height: clamp(320px, 48vw, 440px); border-radius: 28px; overflow: hidden; background: radial-gradient(circle at 85% 20%, rgba(255,241,199,.25), transparent 30%), linear-gradient(180deg, #2A2050, #120E26); border: 3px solid var(--pumpkin); user-select: none; touch-action: manipulation; }
.game__hud { position: absolute; left: 0; right: 0; top: 0; display: flex; justify-content: space-between; padding: 14px 18px; font-weight: 800; z-index: 3; }
.game__hud b { color: var(--pumpkin); font-family: "Londrina Solid"; font-size: 28px; font-weight: 400; margin-left: 6px; }
.game__overlay { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; background: rgba(18,14,38,.82); }
.game__overlay[hidden] { display: none; }
.game__overlay h3 { font-size: clamp(30px, 4vw, 46px); color: var(--pumpkin); }
.game__overlay p { max-width: 460px; }
.bat { position: absolute; left: -90px; width: 72px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; z-index: 2; animation: fly var(--d, 3.5s) linear forwards; }
.bat svg { width: 100%; height: 100%; fill: #0A0716; filter: drop-shadow(0 0 6px rgba(251,115,3,.6)); animation: flap .35s ease-in-out infinite; }
.bat.rtl { animation-name: fly-rtl; } .bat.rtl svg { transform: scaleX(-1); }
@keyframes fly { to { transform: translate(calc(var(--w) + 180px), var(--dy, 0px)); } }
@keyframes fly-rtl { from { transform: translateX(calc(var(--w) + 180px)); } to { transform: translate(0, var(--dy, 0px)); } }
.poof { position: absolute; z-index: 3; color: var(--pumpkin); font-family: "Londrina Solid"; font-size: 30px; pointer-events: none; animation: poof .6s ease-out forwards; }
@keyframes poof { to { transform: translateY(-30px) scale(1.3); opacity: 0; } }
.entry { display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 420px; text-align: left; }
.entry label { font-weight: 700; font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.entry input[type=text], .entry input[type=tel] { min-height: 50px; border-radius: 14px; border: 2px solid #FFFFFF; background: rgba(255,255,255,.08); color: #FFFFFF; padding: 0 14px; font: inherit; }
.entry .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; }
.entry .check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--pumpkin); }
.entry .hp { position: absolute; left: -9999px; }
.entry__msg { min-height: 1.4em; font-weight: 700; }
.entry__msg.ok { color: #9BE3B4; } .entry__msg.err { color: #FFB38A; }
.game-rules { margin-top: 16px; text-align: center; font-size: 14px; color: #CFC8E6; }
.game-rules a { color: #FFFFFF; }
.game.over { height: auto; min-height: clamp(320px, 48vw, 440px); }
.game.over #g-end { position: relative; inset: auto; padding: 64px 24px 28px; }
.game button.btn { font: inherit; font-weight: 700; cursor: pointer; }
.game .btn--line-white { background: transparent; }
/* Chauves-souris voleuses de pizza */
.bat { width: 78px; height: 74px; }
.bat .wings { position: absolute; left: 0; top: 0; width: 78px; height: 36px; }
.bat .loot { position: absolute; left: 24px; top: 26px; width: 32px; height: 32px; fill: none; filter: none; animation: sway .7s ease-in-out infinite; }
.bat.rtl .wings { transform: scaleX(-1); }
@keyframes sway { 0%,100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
.game__loot { display: inline-flex; align-items: center; gap: 6px; }
.game__loot svg { width: 26px; height: 26px; }
.drop { position: absolute; z-index: 3; width: 36px; height: 36px; pointer-events: none; animation: drop 1s cubic-bezier(.5,0,.8,.4) forwards; }
.drop svg { width: 100%; height: 100%; }
@keyframes drop { 60% { opacity: 1; } to { transform: translateY(var(--fall, 200px)) rotate(200deg) scale(.7); opacity: 0; } }
.flee { position: absolute; z-index: 2; width: 72px; height: 36px; pointer-events: none; animation: flee .7s ease-in forwards; }
.flee svg { width: 100%; height: 100%; fill: #0A0716; }
@keyframes flee { to { transform: translate(40px, -140px) scale(.6); opacity: 0; } }
.reassure { font-size: 13px; color: #CFC8E6; background: rgba(255,255,255,.07); border-radius: 10px; padding: 8px 12px; }
/* La pizza entière : plus rare, plus rapide, plus de points */
.bat.big { width: 92px; height: 92px; z-index: 3; }
.bat.big .wings { width: 92px; height: 42px; filter: drop-shadow(0 0 10px rgba(254,186,6,.9)); }
.bat.big .loot { left: 24px; top: 34px; width: 46px; height: 46px; animation: spin 1.2s linear infinite; filter: drop-shadow(0 0 8px rgba(254,186,6,.8)); }
@keyframes spin { to { transform: rotate(360deg); } }
.poof--big { font-size: 26px; white-space: nowrap; color: var(--yellow); text-shadow: 0 0 10px rgba(251,115,3,.9); animation-duration: 1s; }
.drop--big { width: 52px; height: 52px; }
.game__hud > span { white-space: nowrap; display: inline-flex; align-items: center; }
.lbl-short { display: none; }
@media (max-width: 599px) {
  .lbl-long { display: none; } .lbl-short { display: inline; }
  .game__hud { padding: 12px 14px; font-size: 15px; }
  .game { height: min(68vh, 460px); min-height: 360px; }
  .game.over { min-height: min(68vh, 460px); }
}

/* ---------- Animations d'ambiance (coupées si l'appareil demande moins d'animations) ---------- */
.stars { position: absolute; inset: 0; pointer-events: none; }
.stars i { position: absolute; width: var(--s); height: var(--s); border-radius: 50%; background: #FFF1C7; opacity: .7; }
.mist { position: absolute; left: 0; right: 0; bottom: 0; height: 45%; pointer-events: none; overflow: hidden; z-index: 0; }
.mist span { position: absolute; bottom: -20%; left: -50%; width: 200%; height: 100%; background: radial-gradient(ellipse at 30% 70%, rgba(186,170,230,.22), transparent 55%), radial-gradient(ellipse at 75% 80%, rgba(186,170,230,.16), transparent 50%); filter: blur(12px); }
.mist span + span { bottom: -35%; opacity: .7; }
.spider { position: absolute; left: 58px; top: 0; width: 30px; pointer-events: none; z-index: 1; }
.spider__thread { position: absolute; left: 14px; top: 0; width: 1px; height: 30px; background: rgba(26,20,51,.45); transform-origin: top; }
.spider__body { position: absolute; left: 0; top: 26px; width: 30px; height: 30px; }
.ghost-lane { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 20; }
.ghost { position: absolute; top: 30%; left: -120px; width: 70px; height: 82px; opacity: 0; filter: drop-shadow(0 0 14px rgba(255,255,255,.5)); }
.confetti { position: absolute; top: -40px; z-index: 6; pointer-events: none; animation: confetti var(--d) cubic-bezier(.3,.6,.6,1) forwards; }
.confetti svg { width: 100%; height: 100%; }
@keyframes confetti { 80% { opacity: 1; } to { transform: translate(var(--x), 520px) rotate(var(--r)); opacity: 0; } }
.pumpkin-row svg path[fill="#1A1433"] { transition: fill .3s ease, filter .3s ease; }
.pumpkin-row svg:hover path[fill="#1A1433"] { fill: #FFC94A; filter: drop-shadow(0 0 3px #FFB000); }

@media (prefers-reduced-motion: no-preference) {
  @keyframes twinkle { 0%, 100% { opacity: .15; transform: scale(.7); } 50% { opacity: .95; transform: scale(1.15); } }
  .stars i { animation: twinkle var(--t) ease-in-out var(--d) infinite; }
  @keyframes moonglow { 0%, 100% { box-shadow: 0 0 50px 16px rgba(255,241,199,.22); } 50% { box-shadow: 0 0 80px 30px rgba(255,241,199,.38); } }
  .moon { animation: moonglow 6s ease-in-out infinite; }
  @keyframes drift { from { transform: translateX(0); } to { transform: translateX(25%); } }
  .mist span { animation: drift 28s linear infinite alternate; }
  .mist span + span { animation-duration: 40s; animation-direction: alternate-reverse; }
  @keyframes thread { 0%, 12%, 100% { transform: scaleY(1); } 45%, 62% { transform: scaleY(5.2); } }
  @keyframes dangle { 0%, 12%, 100% { transform: translateY(0) rotate(0); } 45% { transform: translateY(126px) rotate(-6deg); } 53% { transform: translateY(126px) rotate(6deg); } 62% { transform: translateY(126px) rotate(0); } }
  .spider__thread { animation: thread 9s ease-in-out infinite; }
  .spider__body { animation: dangle 9s ease-in-out infinite; }
  @keyframes candle { 0%, 100% { fill: #FFB000; } 20% { fill: #FFD666; } 40% { fill: #F08C00; } 60% { fill: #FFC94A; } 80% { fill: #E07B00; } }
  .pumpkin-row svg path[fill="#1A1433"] { animation: candle 1.8s ease-in-out infinite; filter: drop-shadow(0 0 2px #FFB000); }
  .pumpkin-row svg:nth-child(2) path[fill="#1A1433"] { animation-delay: -.6s; }
  .pumpkin-row svg:nth-child(3) path[fill="#1A1433"] { animation-delay: -1.2s; }
  @keyframes flicker { 0% { opacity: 0; } 8% { opacity: 1; } 12% { opacity: .2; } 18% { opacity: 1; } 24% { opacity: .35; } 30%, 100% { opacity: 1; } }
  .hero__slogan { animation: rise .6s cubic-bezier(.2,.7,.2,1) .08s both, flicker 1.1s linear .7s 1; }
  .fx .head.is-in h2 { animation: flicker .9s linear 1; }
  @keyframes haunt { 0%, 72% { opacity: 0; transform: translate(0, 0); } 74% { opacity: .55; } 80% { transform: translate(calc(30vw + 60px), -40px); } 86% { transform: translate(calc(60vw + 120px), 20px); } 92% { opacity: .55; transform: translate(calc(90vw + 180px), -30px); } 94%, 100% { opacity: 0; transform: translate(calc(100vw + 240px), -30px); } }
  .ghost { animation: haunt 30s ease-in-out 8s infinite; }
}
@media (max-width: 599px) { .ghost { width: 50px; height: 58px; top: 40%; } .spider { left: 40px; } }
@media print { .ghost-lane, .mist, .stars, .spider { display: none; } }
/* Pendant une partie, le décor se met en pause pour que le jeu reste fluide sur les petits téléphones */
.playing .ghost-lane { display: none; }
.playing .stars i, .playing .mist span, .playing .moon, .playing .spider__thread, .playing .spider__body, .playing .pumpkin-row path, .playing .hero .bats svg, .playing .badge i { animation-play-state: paused; }
/* Badge plus long : « Ouvert le 31 octobre ! » */
.badge span { font-size: 17px; padding: 26px; }
@media (max-width: 420px) { .badge span { font-size: 15px; padding: 20px; } }
/* Fin de partie : accélération */
.game.rush { border-color: #FF3B1F; box-shadow: 0 0 0 0 rgba(255,59,31,.6); }
.rush .game__hud #g-time { color: #FF5A3D; }
.rush-alert { position: absolute; left: 50%; top: 42%; z-index: 5; transform: translate(-50%, -50%); color: #FF5A3D; font-size: clamp(30px, 6vw, 56px); white-space: nowrap; pointer-events: none; text-shadow: 0 0 18px rgba(255,90,61,.7); animation: alert 1.6s ease-out forwards; }
@keyframes alert { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.6); } 15% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -60%) scale(1); } }
@media (prefers-reduced-motion: no-preference) {
  @keyframes pulse-red { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,59,31,.55); } 50% { box-shadow: 0 0 0 8px rgba(255,59,31,0); } }
  .game.rush { animation: pulse-red .9s ease-in-out infinite; }
}
/* Tickets et phase finale */
.tickets { font-size: 17px; background: rgba(251,115,3,.16); border: 1px solid rgba(251,115,3,.5); border-radius: 12px; padding: 10px 14px; }
.tickets strong { color: var(--pumpkin); }
.game.chaos { border-color: #FF1F1F; }
.chaos .game__hud #g-time { color: #FF3B3B; font-size: 34px; }
@media (prefers-reduced-motion: no-preference) {
  @keyframes shake { 0%, 100% { transform: translate(0, 0); } 25% { transform: translate(-2px, 1px); } 50% { transform: translate(2px, -1px); } 75% { transform: translate(-1px, -2px); } }
  .game.chaos { animation: pulse-red .5s ease-in-out infinite, shake .35s linear infinite; }
}
/* Classement public */
.board { margin-top: 28px; padding: clamp(18px, 3vw, 28px); border-radius: 24px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.15); }
.board h3 { color: var(--pumpkin); font-size: clamp(26px, 3vw, 36px); text-align: center; }
.board__sub { text-align: center; color: #CFC8E6; font-size: 14px; margin-top: 4px; }
.board__list { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; max-width: 560px; margin-inline: auto; }
.board__row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255,255,255,.06); }
.board__row--win { background: rgba(251,115,3,.18); border: 1px solid rgba(251,115,3,.55); }
.board__rank { flex: none; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 800; background: rgba(255,255,255,.12); }
.board__row--win .board__rank { background: var(--pumpkin); color: var(--night); }
.board__name { flex: 1; min-width: 0; font-weight: 700; overflow-wrap: anywhere; }
.board__score { flex: none; font-family: "Londrina Solid"; font-size: 22px; color: var(--pumpkin); }
.board__empty { text-align: center; color: #CFC8E6; font-style: italic; padding: 10px; }
