/* Tombola de Noël B.Mobile — nuit d'hiver, rouge profond, or discret, orange B.Mobile pour l'action */
:root {
  --night: #14100e;
  --night-2: #1d1714;
  --night-3: #2a211c;
  --line: #3a2e27;
  --cream: #f5ede0;
  --cream-dim: #c9bba8;
  --muted: #9d8f7e;
  --red: #8f1d22;
  --red-deep: #5e1216;
  --gold: #c9a45c;
  --gold-soft: #e3cc95;
  --orange: #f26b1d;   /* orange B.Mobile */
  --orange-ink: #1a0d05;
  --amber: #d99a2b;
  --ok: #7fb685;
  --danger: #f08a7e;
  --radius: 10px;
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Figtree', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tap: 48px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--night); color: var(--cream);
  font: 400 16px/1.55 var(--sans);
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(143, 29, 34, .28), transparent 70%);
  background-repeat: no-repeat;
  min-height: 100vh;
}
a { color: var(--gold-soft); }
button { font: inherit; }
[hidden] { display: none !important; }
.nowrap { white-space: nowrap; }
.muted { color: var(--muted); }
.fine { color: var(--muted); font-size: 13px; margin: 10px 0 0; }

/* ---------- Bandeaux ---------- */
.net, .demo-banner { padding: 10px 16px; text-align: center; font-size: 14px; font-weight: 500; }
.net { background: var(--danger); color: #2a0b07; position: sticky; top: 0; z-index: 50; }
.demo-banner { background: repeating-linear-gradient(-45deg, #2b2117 0 14px, #251c14 14px 28px); color: var(--gold-soft); border-bottom: 1px solid var(--line); }

/* ---------- En-tête ---------- */
.top { display: flex; align-items: center; gap: 14px; max-width: 1180px; margin: 0 auto; padding: 18px 20px; }
.brand { font-family: var(--sans); font-weight: 700; letter-spacing: .06em; color: var(--orange); text-decoration: none; font-size: 20px; }
.top-tag { color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.top .kiosk-only { margin-left: auto; }
.kiosk-only { display: none; }
body.kiosk .kiosk-only { display: inline-flex; }

/* ---------- Héros ---------- */
main { max-width: 1180px; margin: 0 auto; padding: 0 20px 140px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: center; padding: 36px 0 56px; }
.eyebrow { color: var(--gold); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 600; margin: 0 0 14px; }
h1 { font-family: var(--serif); font-weight: 500; font-size: clamp(38px, 5.4vw, 68px); line-height: 1.02; letter-spacing: -.015em; margin: 0 0 18px; }
h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; margin: 0; }
.lede { font-size: clamp(17px, 1.7vw, 20px); color: var(--cream-dim); max-width: 34ch; margin: 0 0 30px; }
.lede-sm { color: var(--cream-dim); margin: 6px 0 0; }

.facts { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 0 36px; margin: 0 0 16px; }
.facts div { border-left: 1px solid var(--line); padding-left: 14px; }
.facts div:first-child { border-left: 0; padding-left: 0; }
.facts dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.facts dd { margin: 4px 0 0; font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.facts dd small { color: var(--muted); font-size: 16px; font-weight: 500; }
.meter { height: 4px; background: var(--night-3); border-radius: 2px; max-width: 420px; overflow: hidden; margin-bottom: 18px; }
.meter span { display: block; height: 100%; width: 0; background: var(--gold); transition: width .6s ease; }
.status-line { color: var(--cream-dim); font-size: 14px; min-height: 1.5em; margin: 0 0 22px; }

/* ---------- Boutons ---------- */
.btn-primary, .btn-ghost, .btn-link { cursor: pointer; border-radius: var(--radius); min-height: var(--tap); padding: 0 22px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 600; font-size: 16px; transition: background-color .15s, color .15s, border-color .15s, transform .1s; }
.btn-primary { background: var(--orange); color: var(--orange-ink); border: 0; }
.btn-primary:hover { background: #ff7c31; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--night-3); color: var(--muted); cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--cream-dim); }
.btn-link { background: none; border: 0; color: var(--cream-dim); padding: 0; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.wide { width: 100%; }
:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 3px; }

/* ---------- Le lot : billet ---------- */
.ticket { display: grid; grid-template-columns: 1fr 72px; background: var(--cream); color: #241a14; border-radius: 14px; position: relative; overflow: hidden; }
.ticket::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 6px; background: var(--red); }
.ticket-main { padding: 30px 26px 24px; }
.ticket-label { margin: 0 0 6px; text-transform: uppercase; letter-spacing: .14em; font-size: 11px; font-weight: 700; color: var(--red); }
.ticket-title { font-family: var(--serif); font-size: 26px; line-height: 1.15; margin: 0 0 18px; font-weight: 500; }
.ticket-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; color: #5b4a3e; }
.ticket-points li::before { content: "✦"; color: var(--gold); margin-right: 8px; font-size: 11px; }
.ticket-stub { border-left: 2px dashed #cdbca5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: #efe3cf; writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--serif); color: var(--red); font-size: 20px; letter-spacing: .08em; }
.stub-n { font-family: var(--sans); font-size: 11px; letter-spacing: .14em; color: #7b6655; }
.prize-figure { margin: 0 0 18px; border-radius: 8px; overflow: hidden; aspect-ratio: 16/9; background: #e8dccb; }
.prize-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Gagnant ---------- */
.winner { border: 1px solid var(--gold); border-radius: 14px; padding: 26px; text-align: center; margin-bottom: 40px; }
.winner-n { font-family: var(--serif); font-size: 30px; margin: 0; }
.winner-n strong { color: var(--gold-soft); font-weight: 600; }

/* ---------- Grille ---------- */
.grid-section { border-top: 1px solid var(--line); padding-top: 40px; scroll-margin-top: 20px; }
.grid-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; margin-bottom: 18px; }
.grid-head p { margin: 0; }
.legend { list-style: none; padding: 0; margin: 0 0 22px; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--cream-dim); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 18px; height: 18px; border-radius: 5px; display: inline-block; }
.sw-available { border: 1.5px solid var(--cream-dim); }
.sw-selected { background: var(--orange); }
.sw-reserved { background: repeating-linear-gradient(-45deg, var(--amber) 0 3px, transparent 3px 6px); border: 1.5px solid var(--amber); }
.sw-sold { background: var(--red); }
.sw-blocked { border: 1.5px dashed var(--muted); background: var(--night-3); }

.grid { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 8px; }
.cell { position: relative; aspect-ratio: 1 / 1; min-height: 44px; border-radius: 9px; border: 1.5px solid #5b4c41; background: var(--night-2); color: var(--cream); font: 600 clamp(15px, 1.7vw, 20px) / 1 var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; display: grid; place-items: center; padding: 0; transition: background-color .15s, border-color .15s, color .15s, transform .12s; -webkit-tap-highlight-color: transparent; }
.cell:hover:not(:disabled) { border-color: var(--cream); }
.cell:active:not(:disabled) { transform: scale(.96); }
.cell[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--orange-ink); }
.cell.reserved { border-color: var(--amber); color: var(--amber); background: repeating-linear-gradient(-45deg, rgba(217,154,43,.16) 0 6px, transparent 6px 12px), var(--night-2); cursor: not-allowed; }
.cell.sold { background: var(--red-deep); border-color: var(--red); color: rgba(245, 237, 224, .55); cursor: not-allowed; }
.cell.sold::after { content: "✦"; position: absolute; top: 4px; right: 6px; font-size: 9px; color: var(--gold); }
.cell.blocked { background: var(--night-3); border-style: dashed; border-color: var(--muted); color: var(--muted); cursor: not-allowed; }
.cell.winner-cell { background: var(--gold); border-color: var(--gold-soft); color: #2a1c08; }
.cell.flash { animation: flash .9s ease; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(201,164,92,.7); } 100% { box-shadow: 0 0 0 10px rgba(201,164,92,0); } }

/* ---------- Barre de sélection ---------- */
.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: rgba(20, 16, 14, .96); border-top: 1px solid var(--line); padding: 12px 20px calc(12px + env(safe-area-inset-bottom)); backdrop-filter: blur(6px); }
.bar-inner { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 12px; }
.bar-sel { margin: 0 auto 0 0; display: flex; flex-direction: column; line-height: 1.3; }
.bar-sel span { color: var(--cream-dim); font-size: 14px; }
.bar-sel strong { font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---------- Panneaux (formulaire, paiement, confirmation) ---------- */
.panel { border-top: 1px solid var(--line); padding: 44px 0 20px; scroll-margin-top: 10px; }
.panel-inner { max-width: 640px; margin: 0 auto; }
.panel-inner.center { text-align: center; }
.back { margin-bottom: 18px; min-height: 40px; }
.recap { color: var(--cream-dim); margin: 8px 0 26px; }
form { display: grid; gap: 16px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 500; color: var(--cream-dim); }
input:not([type="checkbox"]) { min-height: var(--tap); border-radius: 8px; border: 1px solid var(--line); background: var(--night-2); color: var(--cream); padding: 0 14px; font: 400 17px var(--sans); }
input:not([type="checkbox"]):focus { border-color: var(--gold); outline: none; }
input[aria-invalid="true"] { border-color: var(--danger) !important; }
.field-err { color: var(--danger); font-size: 13px; }
.check { grid-template-columns: 26px 1fr; align-items: start; gap: 10px; font-weight: 400; color: var(--cream); font-size: 15px; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--orange); }
.check.optional { color: var(--cream-dim); }
.privacy { font-size: 13px; color: var(--cream-dim); border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.privacy p { margin: 0 0 6px; }
.privacy p:last-child { margin: 0; }
.todo { color: var(--amber); }
.error { color: var(--danger); margin: 0; font-weight: 500; }

.big-recap { font-size: 22px; margin: 18px 0 6px; }
.big-recap strong { font-family: var(--serif); font-weight: 600; color: var(--gold-soft); }
.timer { color: var(--cream-dim); margin: 0 0 26px; }
.timer strong { color: var(--cream); font-variant-numeric: tabular-nums; }
#pay-btn { margin-bottom: 14px; }
.seal { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 26px; }
.seal.ok { border-color: var(--gold); color: var(--gold); }
.seal.ok::before { content: "✓"; }
.seal.bad { border-color: var(--danger); color: var(--danger); }
.seal.bad::before { content: "×"; }
.seal.wait::before { content: ""; width: 22px; height: 22px; border: 2px solid var(--muted); border-top-color: var(--gold); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sim-tag { display: inline-block; border: 1px dashed var(--gold); color: var(--gold-soft); border-radius: 6px; padding: 2px 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }

.foot { border-top: 1px solid var(--line); margin-top: 60px; padding-top: 20px; color: var(--muted); font-size: 13px; }
.foot p { margin: 0 0 4px; }
.foot a { color: var(--cream-dim); }

/* ---------- Inactivité (boutique) ---------- */
.idle { position: fixed; inset: 0; z-index: 60; background: rgba(10, 8, 7, .82); display: grid; place-items: center; padding: 20px; }
.idle-box { background: var(--night-2); border: 1px solid var(--line); border-radius: 14px; padding: 30px; max-width: 420px; text-align: center; }
.idle-title { font-family: var(--serif); font-size: 26px; margin: 0 0 10px; }

/* ---------- Mode boutique (tablette) ---------- */
body.kiosk { --tap: 60px; font-size: 18px; user-select: none; -webkit-user-select: none; }
body.kiosk input { user-select: text; -webkit-user-select: text; }
body.kiosk .brand { pointer-events: none; }
body.kiosk .grid { gap: 10px; }
body.kiosk .cell { font-size: clamp(18px, 2.2vw, 24px); min-height: 56px; }
body.kiosk .hero { padding-top: 16px; }
body.kiosk .foot { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 36px; padding-bottom: 40px; }
  .prize { max-width: 520px; }
}
@media (max-width: 640px) {
  main { padding: 0 16px 150px; }
  .top { padding: 14px 16px; }
  .facts { grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
  .facts dd { font-size: 22px; }
  .grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
  .cell { aspect-ratio: auto; height: 54px; font-size: 18px; }
  .row { grid-template-columns: 1fr; }
  .bar-inner .btn-ghost { display: none; }
  .ticket-title { font-size: 22px; }
}
@media (min-width: 641px) and (max-width: 900px) and (orientation: portrait) {
  body.kiosk .grid { grid-template-columns: repeat(10, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.no-border { border-top: 0; }
.stack { display: grid; gap: 12px; margin-top: 26px; }
/* Le bouton « Recommencer » n'existe qu'en mode boutique */
body:not(.kiosk) .kiosk-only { display: none !important; }
/* Sur grand écran (site), grille plus compacte */
@media (min-width: 1000px) { body:not(.kiosk) .grid { max-width: 820px; } }

/* ---------- Réservation à régler en boutique ---------- */
.seal.hold { border-color: var(--gold); color: var(--gold); }
.seal.hold::before { content: "✦"; font-size: 22px; }
.resa-ticket { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin: 26px 0 8px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-align: left; }
.resa-ticket > div { padding: 14px 16px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 0; }
.resa-ticket > div:nth-child(2) { border-left: 0; }
.resa-ticket .resa-ref { grid-column: 1 / -1; border-top: 0; border-left: 0; background: var(--night-2); text-align: center; padding: 18px 16px; }
.resa-ticket .resa-wide { grid-column: 1 / -1; border-left: 0; }
.resa-ticket dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.resa-ticket dd { margin: 4px 0 0; font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.resa-ticket .resa-ref dd { font-family: var(--serif); font-size: clamp(24px, 4vw, 32px); color: var(--gold-soft); letter-spacing: .04em; user-select: all; -webkit-user-select: all; }
.resa-actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 12px 20px; margin-top: 22px; }
.resa-confirm { margin-top: 18px; border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.resa-confirm p { margin: 0; }
@media (max-width: 640px) {
  .resa-ticket { grid-template-columns: 1fr 1fr; }
  .resa-ticket > div:nth-child(2) { grid-column: 1 / -1; }
  .resa-ticket > div:nth-child(3) { border-left: 0; }
}
