/* =====================================================================
   Party Cuisines Action — design
   Esprit « salle de montre » : graphite mat, blanc chaud, accent laiton,
   typographie large et carrée (comme le logo Armoires Cuisines Action).
   ===================================================================== */
@font-face {
  font-family: 'Archivo';
  src: url('/fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --bg: #111111;
  --bg-elev: #171717;
  --surface: #1c1c1c;
  --surface-2: #252525;
  --line: #2f2f2f;
  --line-soft: #242424;
  --text: #f2efe9;
  --muted: #9c978e;
  --faint: #67635c;
  --brass: #c8a46a;
  --brass-hi: #dcbb83;
  --on-brass: #1b150b;
  --ok: #5db37e;
  --bad: #d9624c;
  /* couleurs des 4 choix : terre cuite, ardoise, laiton foncé, sauge */
  --a0: #b5523b;
  --a1: #3f6a93;
  --a2: #9c7a35;
  --a3: #4f7d5e;
  --radius: 14px;
  --display: 'Archivo', system-ui, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: var(--bg);
  background-image: radial-gradient(120% 60% at 50% -10%, rgba(200,164,106,.10), transparent 60%);
  background-attachment: fixed;
  color: var(--text);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-stretch: 100%;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; background: none; }
a { color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.center { text-align: center; }
.err { color: #ff9a87; min-height: 1.3em; margin: 6px 0 0; font-size: 15px; }

/* ---------------- typographie */
h1, h2, .display, .title {
  font-family: var(--display);
  font-stretch: 125%;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .01em;
  line-height: 1.05;
}
h1 { font-size: 28px; margin: 6px 0; }
h2 { font-size: 17px; margin: 4px 0; letter-spacing: .03em; }
.eyebrow {
  font-family: var(--display); font-stretch: 125%; font-weight: 700; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--brass);
}

/* ---------------- logo (fichier foncé sur blanc → inversé et fondu dans le fond sombre) */
.logo { height: 30px; width: auto; display: block; filter: invert(1) grayscale(1) contrast(1.15); mix-blend-mode: screen; }
.logo-lg { height: 64px; }

/* ---------------- composants */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 52px; padding: 12px 18px; border-radius: 12px;
  background: var(--brass); color: var(--on-brass);
  font-family: var(--display); font-stretch: 112%; font-weight: 750; font-size: 15px; letter-spacing: .04em; text-transform: uppercase;
  text-decoration: none; transition: transform .08s, background .15s, opacity .15s;
}
.btn:active { transform: scale(.98); }
.btn:hover { background: var(--brass-hi); }
.btn.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.secondary:hover { border-color: var(--faint); background: var(--surface); }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: 12px; width: auto; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }

input, select {
  font: inherit; font-size: 17px; color: var(--text); width: 100%;
  background: var(--bg-elev); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px;
}
input::placeholder { color: var(--faint); }
input:focus, select:focus { outline: none; border-color: var(--brass); box-shadow: 0 0 0 3px rgba(200,164,106,.18); }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.pill {
  display: inline-block; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--line);
  font-family: var(--display); font-stretch: 112%; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.pill.practice { color: var(--brass); border-color: rgba(200,164,106,.45); background: rgba(200,164,106,.08); }
.tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.tag.ok { color: var(--ok); border-color: rgba(93,179,126,.4); }
.tag.bad { color: var(--bad); border-color: rgba(217,98,76,.4); }
.progress { height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; background: var(--brass); transition: width .3s; }
.rules { margin: 0; padding-left: 0; list-style: none; counter-reset: r; display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 1.4; }
.rules li { counter-increment: r; display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.rules li::before { content: counter(r); font-family: var(--display); font-stretch: 125%; font-weight: 800; color: var(--brass); }
.blanks { color: var(--brass); letter-spacing: .1em; }
.c0 { background: var(--a0); } .c1 { background: var(--a1); } .c2 { background: var(--a2); } .c3 { background: var(--a3); }

/* =====================================================================
   JOUEUR
   ===================================================================== */
.player { max-width: 520px; margin: 0 auto; padding: max(14px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)); display: flex; flex-direction: column; min-height: 100dvh; }
.player header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 1px solid var(--line-soft); }
.player header .team { text-align: right; font-size: 13px; line-height: 1.3; }
.player header .team b { font-family: var(--display); font-stretch: 112%; font-weight: 700; }
.player main { flex: 1; display: flex; flex-direction: column; }

.big-msg { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 14px; padding: 24px 8px; }
.big-msg .title { font-size: 26px; }
.big-msg .muted { line-height: 1.5; }

.team-list { display: flex; flex-direction: column; gap: 8px; max-height: 42dvh; overflow: auto; }
.team-item { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: var(--bg-elev); border: 1px solid var(--line-soft); padding: 14px; border-radius: 12px; }
.team-item:active { border-color: var(--brass); }
.team-item .tbl { font-family: var(--display); font-stretch: 125%; font-weight: 800; color: var(--brass); min-width: 78px; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }

.choices { flex: 1; display: grid; grid-template-rows: repeat(4, 1fr); gap: 10px; }
.choice {
  border-radius: var(--radius); padding: 14px 16px; color: #fff; min-height: 70px;
  display: flex; align-items: center; gap: 14px; text-align: left;
  font-size: 20px; font-weight: 700; line-height: 1.2;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.06), 0 1px 0 rgba(0,0,0,.4);
  transition: transform .08s, opacity .2s, filter .2s;
}
.choice:active { transform: scale(.98); }
.choice .letter {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px;
  background: rgba(0,0,0,.22); font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 18px;
}
.choice.dim { opacity: .28; filter: saturate(.6); }
.choice.picked { box-shadow: 0 0 0 3px var(--text); }
.choice.correct { box-shadow: 0 0 0 4px var(--ok); opacity: 1; filter: none; }
.lyric { font-size: 18px; font-style: italic; margin: 10px 0 2px; color: var(--text); }

.score-big { font-family: var(--display); font-stretch: 125%; font-size: 92px; font-weight: 900; font-variant-numeric: tabular-nums; line-height: 1; color: var(--brass); }

/* préparation du téléphone */
.step { display: flex; flex-direction: column; gap: 10px; }
.step p { margin: 0; line-height: 1.45; }
.step-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.step-head b { font-family: var(--display); font-stretch: 112%; font-weight: 750; text-transform: uppercase; letter-spacing: .03em; font-size: 14px; }
.step.ok { border-color: rgba(93,179,126,.35); }
.step.warn { border-color: rgba(217,98,76,.35); }
.meter { height: 10px; background: var(--bg-elev); border-radius: 999px; overflow: hidden; }
.meter > div { height: 100%; width: 0; background: var(--ok); transition: width .1s; }
.touchpad {
  width: 100%; min-height: 124px; border-radius: 12px; background: var(--bg-elev); border: 1px dashed var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  font-family: var(--display); font-stretch: 112%; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; font-size: 14px;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.touchpad small { font-family: 'Archivo', sans-serif; font-stretch: 100%; text-transform: none; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.touchpad.wait { background: var(--surface-2); color: var(--muted); border-style: solid; }
.touchpad.go { background: #2fbf6a; color: #06210f; border-color: transparent; font-size: 22px; }
.touchpad.early { background: rgba(217,98,76,.18); border-color: rgba(217,98,76,.5); }

/* feu vert / feu rouge */
.light-overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 50; user-select: none; -webkit-user-select: none; touch-action: none;
  font-family: var(--display); font-stretch: 125%; font-weight: 900; text-transform: uppercase; font-size: 40px; text-align: center; padding: 24px; }
.light-overlay.idle { background: #050505; color: var(--faint); font-size: 18px; font-weight: 700; line-height: 1.6; }
.light-overlay.idle b { color: #2fbf6a; }
.light-overlay.green { background: #2fbf6a; color: #06210f; }
.light-overlay.red { background: #d9483a; color: #2a0804; }
.light-overlay.fb { background: #0b0b0b; color: var(--text); font-size: 30px; }

/* =====================================================================
   ÉCRAN GÉANT
   ===================================================================== */
.screen { height: 100dvh; display: flex; flex-direction: column; padding: 3.5vh 4.5vw; overflow: hidden; }
.screen .top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 2vh; padding-bottom: 2vh; border-bottom: 1px solid var(--line-soft); }
.screen .stage { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.screen h1 { font-size: 6.4vh; margin: 0 0 2.5vh; text-align: center; }
.screen .sub { font-size: 2.6vh; color: var(--muted); text-align: center; margin-bottom: 1.5vh; font-family: var(--display); font-stretch: 112%; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.logo-screen { height: 5vh; }
.logo-hero { height: 13vh; margin-bottom: 4vh; }
.lobby { display: grid; grid-template-columns: auto 1fr; gap: 6vw; align-items: center; }
.lobby .qr { background: #fff; padding: 2.2vh; border-radius: 2.4vh; width: 50vh; height: 50vh; box-shadow: 0 0 0 1px rgba(200,164,106,.5), 0 30px 80px rgba(0,0,0,.6); }
.lobby .qr img { width: 100%; height: 100%; display: block; }
.lobby h1 { text-align: left; font-size: 7vh; }
.lobby .steps { font-size: 2.8vh; line-height: 1.7; color: var(--muted); text-align: left; }
.lobby .url { font-family: var(--display); font-stretch: 112%; font-size: 3vh; font-weight: 700; color: var(--brass); word-break: break-all; margin-top: 3vh; }

.screen .choices-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2vh; margin-top: 2vh; }
.screen .choice { font-size: 4vh; min-height: 15vh; padding: 2vh 3vh; border-radius: 2vh; gap: 2.4vh; }
.screen .choice .letter { width: 7.5vh; height: 7.5vh; font-size: 3.6vh; border-radius: 1.4vh; }
.screen .progress { height: 1vh; margin-top: 3vh; }
.screen .lyric { font-style: italic; font-size: 4vh; color: var(--text); text-transform: none; letter-spacing: 0; font-family: 'Archivo', sans-serif; font-stretch: 100%; }

.rank { display: flex; flex-direction: column; gap: 1.2vh; max-width: 1400px; margin: 0 auto; width: 100%; }
.rank .row { display: grid; grid-template-columns: 7vh 1fr 18vh; align-items: center; gap: 2vh; font-size: 3.2vh; font-weight: 700; }
.rank .row .pos { font-family: var(--display); font-stretch: 125%; font-weight: 900; color: var(--brass); text-align: center; font-size: 4vh; }
.rank .row .barwrap { position: relative; background: var(--surface); border: 1px solid var(--line-soft); border-radius: 1.2vh; height: 6.4vh; overflow: hidden; }
.rank .row .bar { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(200,164,106,.55), rgba(200,164,106,.25)); transition: width .7s cubic-bezier(.2,.8,.2,1); }
.rank .row:first-child .bar { background: linear-gradient(90deg, var(--brass), rgba(200,164,106,.45)); }
.rank .row .lbl { position: absolute; inset: 0; display: flex; align-items: center; padding: 0 2.2vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank .row .val { text-align: right; font-family: var(--display); font-stretch: 112%; font-variant-numeric: tabular-nums; }

.eq { display: flex; gap: 1.4vh; justify-content: center; align-items: flex-end; height: 16vh; margin: 4vh 0; }
.eq span { width: 2.4vh; background: var(--brass); border-radius: .6vh; animation: eq 1.1s ease-in-out infinite; }
.eq span:nth-child(2) { animation-delay: .2s } .eq span:nth-child(3) { animation-delay: .4s } .eq span:nth-child(4) { animation-delay: .1s } .eq span:nth-child(5) { animation-delay: .3s }
@keyframes eq { 0%,100% { height: 18%; } 50% { height: 100%; } }
.flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; transition: opacity .15s; }
.flash.green { background: #2fbf6a; opacity: .8; } .flash.red { background: #d9483a; opacity: .8; }
.countdown { font-family: var(--display); font-stretch: 125%; font-size: 13vh; font-weight: 900; text-align: center; font-variant-numeric: tabular-nums; color: var(--brass); }

.mini-qr { display: flex; align-items: center; gap: 1.4vh; font-size: 1.7vh; text-align: right; line-height: 1.4; }
.mini-qr b { color: var(--brass); }
.mini-qr img { width: 8.5vh; height: 8.5vh; background: #fff; padding: .5vh; border-radius: .8vh; order: 2; }
.steps3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2vh; margin: 1vh 0 3vh; }
.steps3 > div { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 1.8vh; padding: 2.6vh; font-size: 2.5vh; line-height: 1.4; }
.steps3 b { display: block; font-family: var(--display); font-stretch: 125%; font-size: 5vh; font-weight: 900; color: var(--brass); margin-bottom: 1vh; }
.bigstats { display: flex; justify-content: center; gap: 7vw; margin: 1vh 0 3vh; }
.bigstats div { text-align: center; color: var(--muted); font-size: 2vh; letter-spacing: .14em; text-transform: uppercase; font-family: var(--display); font-stretch: 112%; font-weight: 600; }
.bigstats span { display: block; font-size: 8vh; font-weight: 900; font-stretch: 125%; color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(28vh, 1fr)); gap: 1vh; font-size: 1.9vh; }
.table-grid div { background: var(--surface); border: 1px solid var(--line-soft); border-radius: 1vh; padding: 1.1vh 1.5vh; display: flex; justify-content: space-between; gap: 1vh; white-space: nowrap; overflow: hidden; }
.table-grid div.ok { border-color: rgba(93,179,126,.6); }
.table-grid span { color: var(--muted); font-variant-numeric: tabular-nums; }
.rules.big { font-size: 3.6vh; gap: 2.6vh; max-width: 1300px; margin: 2vh auto 0; }
.rules.big li { grid-template-columns: 6vh 1fr; }
.pill.big { font-size: 2vh; padding: .7vh 2vh; }

/* =====================================================================
   TÉLÉCOMMANDE DJ (pensée pour le cellulaire, à une main)
   ===================================================================== */
.login { max-width: 380px; margin: 14vh auto; padding: 16px; }
.djapp { max-width: 720px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; }
.djhead { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; padding: max(10px, env(safe-area-inset-top)) 16px 10px; background: rgba(17,17,17,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-soft); }
.djhead .logo { height: 26px; }
.djstats { flex: 1; display: flex; gap: 12px; justify-content: flex-end; font-size: 12px; color: var(--muted); white-space: nowrap; }
.djstats b { color: var(--text); font-variant-numeric: tabular-nums; }
.spdot { font-size: 11px; padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.spdot::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.spdot.ok::before { background: var(--ok); } .spdot.bad::before { background: var(--bad); }
.tabs { position: sticky; top: 52px; z-index: 19; display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 12px; background: rgba(17,17,17,.92); backdrop-filter: blur(10px); }
.tabs button { padding: 10px 4px; border-radius: 10px; font-size: 12px; font-weight: 650; color: var(--muted); letter-spacing: .02em; }
.tabs button.active { background: var(--surface-2); color: var(--text); }
.djmain { flex: 1; padding: 6px 12px 200px; }
.djmain .card + .card { margin-top: 12px; }
.djfoot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; padding: 12px 12px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(to top, rgba(17,17,17,1) 70%, rgba(17,17,17,0)); }
.djfoot > * { max-width: 696px; margin-left: auto; margin-right: auto; }
.primary-next { min-height: 68px; font-size: 16px; border-radius: 16px; box-shadow: 0 8px 30px rgba(200,164,106,.18); text-align: center; line-height: 1.2; }
.primary-next.danger { background: var(--bad); color: #fff; box-shadow: 0 8px 30px rgba(217,98,76,.25); }
.djfoot-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; margin-top: 8px; }
.djfoot-row .btn { min-height: 44px; font-size: 12px; }

.nowcard { padding: 18px; }
.nowhead { display: flex; gap: 8px; align-items: center; margin-bottom: 14px; }
.status { font-family: var(--display); font-stretch: 112%; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--faint); }
.status.live { color: var(--ok); }
.status.live::before { background: var(--ok); animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.nowsong { font-family: var(--display); font-stretch: 112%; font-weight: 750; font-size: 22px; line-height: 1.2; margin: 6px 0 4px; }
.nowanswer { color: var(--muted); font-size: 15px; }
.nowanswer b { color: var(--ok); margin-left: 4px; }
.bigcount { margin-top: 16px; display: flex; align-items: baseline; gap: 8px; }
.bigcount span { font-family: var(--display); font-stretch: 125%; font-weight: 900; font-size: 48px; font-variant-numeric: tabular-nums; line-height: 1; }
.bigcount small { color: var(--muted); font-size: 14px; }
.countdown.sm { font-size: 56px; margin-top: 12px; }
.dist { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.distrow { display: grid; grid-template-columns: 30px 1fr 36px; align-items: center; gap: 10px; }
.distrow .lt { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 13px; color: #fff; }
.distbar { position: relative; height: 30px; background: var(--bg-elev); border-radius: 8px; overflow: hidden; }
.distbar .fill { position: absolute; inset: 0 auto 0 0; opacity: .55; transition: width .3s; }
.distbar em { position: relative; font-style: normal; font-size: 13px; line-height: 30px; padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.distrow b { text-align: right; font-variant-numeric: tabular-nums; }
.distrow.is-correct .distbar { box-shadow: inset 0 0 0 2px var(--ok); }
.toplist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.toplist li { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; font-size: 14px; }
.toplist span { color: var(--brass); font-weight: 800; }

.runsec { font-family: var(--display); font-stretch: 125%; font-weight: 800; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--brass); padding: 18px 4px 8px; }
.runrow { width: 100%; display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line-soft); margin-bottom: 6px; }
.runrow.done { opacity: .5; }
.runrow.current { border-color: var(--brass); background: rgba(200,164,106,.08); opacity: 1; }
.runlabel { flex: 1; min-width: 0; font-size: 14px; }
.runlabel small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.runstate { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }
.runrow.current .runstate { color: var(--brass); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { padding: 12px 10px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; font-weight: 600; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions .btn { margin-left: 4px; }
.pts { display: inline-block; margin-top: 6px; font-family: var(--display); font-stretch: 125%; font-size: 34px; font-weight: 900; color: var(--brass); }
.lscore { font-family: var(--display); font-stretch: 125%; font-size: 52px; color: var(--faint); }
.lobby .steps b { color: var(--text); }
