:root {
  --coal: #1b1a18;
  --coal-2: #232220;
  --coal-3: #2d2b28;
  --line: #3a3733;
  --mute: #a39c92;
  --cream: #f4efe6;
  --ember: #ec6526;
  --ember-2: #ff8a3d;
  --gold: #e7b35a;
  --heat: 0;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --brush: "Kaushan Script", "Brush Script MT", cursive;
  --body: "Manrope", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--coal);
  color: var(--cream);
  font: 400 16px/1.5 var(--body);
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; touch-action: manipulation; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

#fire { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

.app {
  position: relative; z-index: 1;
  height: 100dvh;
  max-width: 560px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) 27dvh;
  grid-template-areas: "top" "panel" "stage";
  padding-bottom: env(safe-area-inset-bottom);
}
.app[data-step="intro"] { grid-template-rows: auto minmax(0, 1fr) 36dvh; }
.app[data-step="plat"].grilling { grid-template-rows: auto minmax(0, 1fr) 36dvh; }
.app[data-step="nom"] { grid-template-rows: auto minmax(0, 1fr) 23dvh; }
.app[data-step="fete"] { grid-template-rows: auto minmax(0, 1fr) 13dvh; }

/* En-tête */
.top {
  grid-area: top;
  display: flex; align-items: center; gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 16px 8px;
}
.brand { font: 400 24px/1 var(--brush); color: var(--ember-2); }
.demo {
  font-size: 12px; font-weight: 800; color: var(--coal);
  background: var(--gold); border-radius: 4px 10px 4px 10px; padding: 2px 8px;
}
.icon-btn {
  width: 40px; height: 40px; flex: none; margin: -4px;
  display: grid; place-items: center; border-radius: 50%;
}
.icon-btn[hidden] { display: none; }
.icon-btn svg { width: 24px; height: 24px; }
#mute[aria-pressed="true"] .waves { display: none; }

.meter { flex: 1; display: flex; justify-content: center; gap: 3px; min-width: 0; }
.meter svg { width: 14px; height: 18px; display: block; }
@media (max-width: 430px) {
  #back:not([hidden]) + .brand { display: none; }
}
.meter path { fill: var(--line); transition: fill .35s; }
.meter .on path { fill: var(--ember); }
.meter .now path { fill: var(--gold); }

/* Panneau */
.panel {
  grid-area: panel;
  display: flex; flex-direction: column;
  min-height: 0;
  padding: 4px 16px 0;
}
.scene { display: flex; flex-direction: column; min-height: 0; flex: 1; animation: in .28s ease-out; }
@keyframes in { from { opacity: 0; transform: translateX(22px); } }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 2px 2px 10px; margin: 0 -2px; }
.foot { padding: 8px 0 10px; display: grid; gap: 4px; }

h1 {
  font: 400 clamp(34px, 10.4vw, 46px)/1.04 var(--display);
  text-transform: uppercase;
  letter-spacing: .005em;
  margin: 4px 0 6px;
  text-wrap: balance;
}
h1:focus { outline: none; }
.lead { margin: 0 0 14px; color: #d9d3c8; max-width: 44ch; }
.hint { font: 400 21px/1.2 var(--brush); color: var(--gold); margin: 0; }

/* Boutons */
.cta {
  width: 100%; min-height: 56px; padding: 12px 18px;
  font-weight: 800; font-size: 18px; color: var(--coal);
  background: var(--ember-2);
  border-radius: 14px 26px 14px 26px;
  box-shadow: 0 5px 0 #a8430f;
  transition: transform .08s, box-shadow .08s, background .2s;
}
.cta:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #a8430f; }
.cta:disabled { background: var(--coal-3); color: var(--mute); box-shadow: 0 5px 0 #151412; cursor: not-allowed; }
.link {
  min-height: 44px; font-weight: 600; font-size: 15px; color: var(--cream);
  text-shadow: 0 1px 2px #000, 0 0 10px #000, 0 0 18px #000;
  text-decoration: underline; text-underline-offset: 3px;
}

/* Intro */
.app[data-step="intro"] h1 { font-size: clamp(66px, 22vw, 104px); line-height: .96; margin-top: 2vh; }
.fan-gauge { height: 14px; border-radius: 8px; background: var(--coal-3); overflow: hidden; margin-bottom: 10px; }
.fan-gauge i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--gold), var(--ember)); transition: width .15s; }

.fan {
  position: absolute; width: min(136px, 17dvh); left: calc(50% + 10px); top: 0;
  transform-origin: 50% 96%; transform: rotate(14deg);
  display: none; pointer-events: none;
  filter: drop-shadow(0 6px 8px rgba(0,0,0,.5));
}
.app[data-step="intro"] .fan { display: block; }
.fan.go { animation: fan .24s ease-in-out; }
@keyframes fan { 50% { transform: rotate(-30deg); } }
.stage { grid-area: stage; position: relative; pointer-events: none; overflow-x: clip; }

/* Choix du feu : trois scènes éteintes, celle qu'on touche s'allume */
.feux { display: grid; gap: 8px; }
.feu-card {
  position: relative; display: block; width: 100%; overflow: hidden;
  min-height: clamp(84px, 14.5dvh, 124px); padding: 10px 14px;
  text-align: left;
  border-radius: 8px 26px 8px 26px;
  background: var(--coal-2);
  box-shadow: inset 0 0 0 1px var(--line);
  transition: min-height .3s ease, box-shadow .25s;
}
.feu-scene { position: absolute; inset: 0; transition: filter .45s ease; filter: grayscale(.5) brightness(.6); }
.feu-scene svg { width: 100%; height: 100%; display: block; }
.feu-card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(20,15,14,.88) 0%, rgba(20,15,14,.62) 42%, rgba(20,15,14,0) 72%);
}
.feu-text { position: relative; z-index: 1; display: block; max-width: 66%; }
.feu-name { display: block; font: 400 31px/1.1 var(--display); text-transform: uppercase; }
.feu-vibe { display: block; font: 400 20px/1.2 var(--brush); color: var(--gold); }
.feu-more { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.feu-more > span { overflow: hidden; min-height: 0; }
.feu-line { display: block; font-size: 14px; line-height: 1.35; font-weight: 600; }
.feu-line:first-child { margin-top: 6px; }
.feu-open { color: var(--gold); }
.feu-flame { position: absolute; z-index: 1; right: 10px; top: 8px; }
.feu-flame svg { width: 24px; height: 30px; display: block; filter: drop-shadow(0 1px 2px #000); transition: transform .25s; }
.feu-flame path { fill: var(--cream); opacity: .55; transition: fill .25s, opacity .25s; }

@media (hover: hover) {
  .feu-card:hover .feu-scene { filter: grayscale(.2) brightness(.8); }
}
.feux.chosen .feu-card[aria-pressed="false"] { min-height: clamp(70px, 10dvh, 88px); }
.feu-card[aria-pressed="true"] { box-shadow: inset 0 0 0 3px var(--gold), 0 0 26px rgba(236,101,38,.5); }
.feu-card[aria-pressed="true"] .feu-scene { filter: none; }
.feu-card[aria-pressed="true"] .feu-more { grid-template-rows: 1fr; }
.feu-card[aria-pressed="true"] .feu-flame svg { transform: scale(1.3); animation: flick .5s ease-in-out infinite alternate; }
.feu-card[aria-pressed="true"] .feu-flame path { fill: var(--ember-2); opacity: 1; }
.feu-card[aria-pressed="true"] .bulb { animation: twinkle 1.1s ease-in-out infinite alternate; }
.feu-card[aria-pressed="true"] .bulb.b2 { animation-delay: .55s; }
.feu-card[aria-pressed="true"] .lick { transform-box: fill-box; transform-origin: 50% 100%; animation: flick .35s ease-in-out infinite alternate; }
.feu-card[aria-pressed="true"] .wave { animation: wave 2.6s linear infinite; }
.feu-card[aria-pressed="true"] .wave.w2 { animation-duration: 3.8s; }
.feu-card[aria-pressed="true"] .palm { transform-origin: 322px 46px; animation: sway 3s ease-in-out infinite alternate; }
.feu-card[aria-pressed="true"] .sun { transform-origin: 270px 96px; animation: glow 2.2s ease-in-out infinite alternate; }
.feu-card[aria-pressed="true"] .glint { animation: twinkle 1.5s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .45; } to { opacity: 1; } }
@keyframes flick { from { transform: scale(1.22, 1.3) rotate(-3deg); } to { transform: scale(1.34, 1.2) rotate(3deg); } }
@keyframes wave { to { transform: translateX(60px); } }
@keyframes sway { from { transform: rotate(-3deg); } to { transform: rotate(4deg); } }
@keyframes glow { from { transform: scale(1); } to { transform: scale(1.09); } }

/* À table ou à la maison */
.feux.two .feu-card { min-height: clamp(116px, 23dvh, 200px); }
.feux.two .feu-text { max-width: 58%; }
.feu-card[aria-pressed="true"] .ride { animation: ride .22s ease-in-out infinite alternate; }
@keyframes ride { to { transform: translateY(-2px); } }

/* Livraison */
.zones { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.zones .chip { font-size: 15px; min-height: 50px; }
.zone-info { margin-top: 12px; min-height: 80px; }
.zone-info strong { display: block; font: 400 22px/1.25 var(--brush); color: var(--gold); }
.zone-info span { display: block; }
.zone-info small { color: var(--mute); font-size: 13px; }
.cart { display: grid; gap: 6px; }
.cart-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center;
  padding: 8px 10px 8px 12px;
  background: var(--coal-2); border: 1px solid var(--line); border-radius: 10px;
}
.cart-row.star { border-color: var(--gold); }
.cart-row b { font-weight: 800; }
.cart-row > div:first-child > span { display: block; font-size: 14px; line-height: 1.3; color: #c8c1b6; }
.cart-row .tag { font: 400 17px/1 var(--brush); color: var(--gold); }
.cart-row .price { color: var(--gold); font-weight: 800; }
.stepper { display: grid; grid-template-columns: 44px 22px 44px; align-items: center; justify-items: center; }
.mini { width: 44px; height: 44px; border-radius: 50%; font: 800 24px/1 var(--body); background: var(--coal-3); }
.mini.plus { background: var(--ember-2); color: var(--coal); }
.mini:disabled { opacity: .35; cursor: not-allowed; }
.track { margin: 0 0 12px; padding: 10px 12px; background: var(--coal-2); border: 1px solid var(--line); border-radius: 10px; }
.road { position: relative; height: 6px; margin: 30px 22px 6px; border-radius: 3px; background: var(--coal-3); }
.road i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 3px; background: var(--ember-2); transition: width 1.2s ease-in-out; }
.moto { position: absolute; left: 0; bottom: 2px; width: 44px; margin-left: -22px; transition: left 1.2s ease-in-out; }
.moto svg { display: block; width: 100%; }
.track ol { list-style: none; margin: 6px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); text-align: center; font-size: 13px; font-weight: 600; color: var(--mute); }
.track li.done { color: var(--cream); }
.track li.now { color: var(--gold); font-weight: 800; }
.ticket.home { -webkit-mask: none; mask: none; }

/* Jours */
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day {
  padding: 8px 0 6px; border-radius: 10px; min-height: 60px;
  background: var(--coal-2); border: 1px solid var(--line);
  display: grid; justify-items: center; line-height: 1.15;
  font-size: 13px; font-weight: 600; color: #d9d3c8;
}
.day b { font: 400 21px/1.15 var(--display); color: var(--cream); }
.day[aria-pressed="true"] { background: var(--ember-2); border-color: var(--ember-2); color: var(--coal); }
.day[aria-pressed="true"] b { color: var(--coal); }
.special { margin-top: 14px; display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: center; }
.special svg { width: 84px; }
.special .hint { font-size: 18px; }
.special h2 { font: 400 27px/1.1 var(--display); text-transform: uppercase; margin: 2px 0; }
.special p { margin: 0; color: #d9d3c8; font-size: 15px; }
.price { font-weight: 800; color: var(--gold); white-space: nowrap; }

/* Heures */
.group { margin-bottom: 14px; }
.group h2 { font: 400 22px/1.2 var(--brush); color: var(--gold); margin: 0 0 6px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.chip {
  min-height: 48px; border-radius: 10px;
  background: var(--coal-2); border: 1px solid var(--line);
  font-weight: 800; font-size: 16px;
}
.chip[aria-pressed="true"] { background: var(--ember-2); border-color: var(--ember-2); color: var(--coal); }
.empty { color: #d9d3c8; margin: 0; }

/* Convives */
.guests { display: grid; grid-template-columns: 72px 1fr 72px; align-items: center; justify-items: center; margin-top: 2dvh; }
.round {
  width: 68px; height: 68px; border-radius: 50%;
  font: 800 34px/1 var(--body);
  background: var(--coal-3); border: 2px solid var(--line);
}
.round.plus { background: var(--ember-2); color: var(--coal); border-color: var(--ember-2); box-shadow: 0 5px 0 #a8430f; }
.round.plus:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 #a8430f; }
.round:disabled { opacity: .35; cursor: not-allowed; }
.count { font: 400 clamp(84px, 26vw, 116px)/1 var(--display); color: var(--cream); }
.count.pop { animation: pop .25s; }
@keyframes pop { 40% { transform: scale(1.22); color: var(--ember-2); } }
.quip { text-align: center; min-height: 54px; margin: 8px 0 0; font: 400 23px/1.2 var(--brush); color: var(--gold); }
.quip a { color: inherit; }

/* Plats */
.dishes { display: grid; gap: 6px; }
.dish {
  display: grid; grid-template-columns: 1fr auto; gap: 0 10px; align-items: baseline;
  text-align: left; padding: 9px 12px; min-height: 58px;
  background: var(--coal-2); border: 1px solid var(--line); border-radius: 10px;
}
.dish b { font-weight: 800; }
.dish span:not(.price) { grid-column: 1 / -1; font-size: 14px; color: #c8c1b6; }
.dish.star { border-color: var(--gold); }
.dish .tag { font: 400 17px/1 var(--brush); color: var(--gold); }

/* Grill */
.gauge { position: relative; height: 34px; border-radius: 17px; overflow: hidden; margin: 8px 0 6px;
  background: linear-gradient(90deg, #8e9a96 0%, #cfa35a 40%, #e7a53e 60%, #bd5a1f 76%, #2a1c14 100%); }
.gauge .zone { position: absolute; top: 0; bottom: 0; left: 56%; width: 15%; border: 3px solid var(--cream); border-radius: 8px; }
.gauge .needle { position: absolute; top: 0; bottom: 0; width: 6px; margin-left: -3px; background: var(--cream); box-shadow: 0 0 0 2px var(--coal); }
.verdict { min-height: 32px; margin: 0; font: 400 24px/1.3 var(--brush); color: var(--gold); text-align: center; }

/* Formulaire */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-weight: 600; margin-bottom: 4px; }
.field input {
  width: 100%; min-height: 52px; padding: 10px 12px;
  font: 600 18px var(--body); color: var(--cream);
  background: var(--coal-2); border: 2px solid var(--line); border-radius: 10px;
}
.field input:focus { outline: none; border-color: var(--gold); }
.field input[aria-invalid="true"] { border-color: var(--ember-2); }
.tel { display: flex; align-items: stretch; gap: 6px; }
.tel b { display: grid; place-items: center; padding: 0 10px; background: var(--coal-3); border-radius: 10px; }
.err { color: var(--ember-2); font-size: 14px; font-weight: 600; min-height: 21px; display: block; margin-top: 2px; }

/* Fête */
.wheel-wrap { position: relative; width: min(66vw, 30dvh, 250px); aspect-ratio: 1; margin: 2px auto 10px; }
.wheel-wrap > svg.wheel { width: 100%; height: 100%; transition: transform 4.6s cubic-bezier(.13,.72,.12,1); }
.wheel-wrap .pointer { position: absolute; left: 50%; top: -7px; width: 28px; margin-left: -14px; z-index: 1; filter: drop-shadow(0 2px 2px #000); }
.prize { text-align: center; margin: 0 0 8px; min-height: 30px; }
.prize strong { font: 400 26px/1.15 var(--brush); color: var(--gold); display: block; }
.prize small { color: var(--mute); font-size: 13px; }
.ticket {
  position: relative; margin-top: 4px; padding: 12px 16px;
  background: var(--cream); color: var(--coal);
  border-radius: 6px;
  -webkit-mask: radial-gradient(circle 9px at 0 62%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 9px at 100% 62%, #0000 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 9px at 0 62%, #0000 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 9px at 100% 62%, #0000 98%, #000) right / 51% 100% no-repeat;
}
.ticket h2 { font: 400 24px/1.1 var(--display); text-transform: uppercase; margin: 0 0 2px; }
.ticket p { margin: 0; font-size: 15px; line-height: 1.4; }
.ticket .code { margin-top: 8px; padding-top: 8px; border-top: 2px dashed #b9b0a1; display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 14px; }
.ticket .code b { font: 400 22px/1 var(--display); letter-spacing: .04em; }
.app[data-step="fete"] .scroll {
  -webkit-mask: linear-gradient(#000 calc(100% - 28px), #0000);
          mask: linear-gradient(#000 calc(100% - 28px), #0000);
  padding-bottom: 28px;
}
.note { color: var(--mute); font-size: 13px; text-align: center; margin: 10px 0 2px; }
.actions { display: grid; gap: 4px; margin-top: 10px; }
a.cta { display: grid; place-items: center; text-decoration: none; text-align: center; }

/* Écran large : le feu à gauche, le parcours à droite */
@media (min-width: 900px) {
  .app, .app[data-step], .app[data-step].grilling {
    max-width: 1120px;
    grid-template-columns: minmax(0, 1fr) 460px;
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas: "top top" "stage panel";
    column-gap: 40px;
    padding: 0 24px;
  }
  .app .panel { padding-bottom: 20px; }
  .stage { overflow-x: visible; }
  .fan { top: auto; bottom: 190px; left: calc(50% + 50px); width: 190px; }
  .app[data-step="intro"] h1 { font-size: 92px; }
  .wheel-wrap { width: min(250px, 30dvh); }
}

@media (max-height: 640px) and (max-width: 899px) {
  .app[data-step], .app[data-step].grilling { grid-template-rows: auto minmax(0, 1fr) 20dvh; }
  .app[data-step="intro"] h1 { font-size: 58px; margin-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .scene, .count.pop, .fan.go { animation: none; }
  .road i, .moto { transition: none; }
  .feu-card[aria-pressed="true"] * { animation: none !important; }
  .wheel-wrap > svg.wheel { transition-duration: .6s; }
}
