/* =====================================================================
   Blind test — Le Moulin Blanc
   Une seule famille (Archivo), utilisée en largeur normale pour lire
   et en largeur étendue pour les grands chiffres et les titres d'écran.
   ===================================================================== */
:root {
  --ink: #121A2C;
  --ink-2: #1A2440;
  --ink-3: #253154;
  --line: rgba(255, 255, 255, 0.13);
  --text: #F4F6FB;
  --muted: #9AA6C0;
  --accent: #C9A55A;
  --on-accent: #0E1424;
  --c0: #E5484D;
  --c1: #3E63DD;
  --c2: #2A9D68;
  --c3: #DB8F12;
  --ok: #34D399;
  --ko: #FF6B6B;
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--ink);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }

.wide { font-stretch: 125%; }
.num { font-stretch: 125%; font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: -0.01em; }

/* Boutons ------------------------------------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: .7em 1.3em; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: var(--on-accent); font-weight: 700; text-decoration: none;
  transition: transform .08s ease, filter .15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn.quiet { background: transparent; color: inherit; border-color: transparent; text-decoration: underline; text-underline-offset: 3px; }
.btn.danger { background: transparent; color: var(--ko); border-color: var(--ko); }
.btn.big { min-height: 60px; font-size: 1.15rem; padding: .8em 1.8em; }

/* Champs ------------------------------------------------------------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: .9rem; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; min-height: 52px; padding: .7em 1em; border-radius: 12px;
  background: var(--ink-2); border: 1px solid var(--line); color: var(--text); font-size: 1.05rem;
}
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%);
  background: #fff; color: #121A2C; padding: 12px 18px; border-radius: 12px; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0,0,0,.3); transition: transform .25s ease; z-index: 99; max-width: calc(100vw - 32px);
}
#toast.show { transform: translate(-50%, 0); }
#toast.error { background: var(--ko); color: #fff; }

.demo-banner {
  position: relative; z-index: 50; text-align: center;
  background: #FDE68A; color: #3B2F05; font-size: .82rem; font-weight: 600; padding: 4px 12px;
}

/* Réponses : couleurs + formes ---------------------------------------- */
.c0 { --c: var(--c0); } .c1 { --c: var(--c1); } .c2 { --c: var(--c2); } .c3 { --c: var(--c3); }
.shape { width: 1em; height: 1em; fill: currentColor; flex: none; }

/* =====================================================================
   TÉLÉPHONE JOUEUR
   ===================================================================== */
.phone {
  min-height: 100dvh; display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}
.p-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.p-head .who { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-head .who small { display: block; font-weight: 500; color: var(--muted); font-size: .8rem; }
.p-head .score { text-align: right; }
.p-head .score .num { font-size: 1.35rem; color: var(--accent); }
.p-head .score small { display: block; color: var(--muted); font-size: .75rem; }
.p-body { flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 22px; padding: 18px 0; }

.p-brand { display: flex; align-items: center; gap: 14px; }
.p-brand img { max-height: 54px; max-width: 140px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px; }
.p-title { font-size: clamp(1.7rem, 7vw, 2.4rem); font-weight: 800; font-stretch: 125%; line-height: 1.05; margin: 0; letter-spacing: -0.015em; }
.p-sub { color: var(--muted); margin: 0; }

.p-card { background: var(--ink-2); border: 1px solid var(--line); border-radius: 20px; padding: 22px; }
.p-center { text-align: center; }
.p-big { font-size: clamp(2.6rem, 14vw, 4.5rem); line-height: 1; }

.p-qhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.p-qhead .prompt { font-weight: 700; font-size: 1.15rem; }
.p-qhead .count { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.p-timer { height: 6px; border-radius: 3px; background: var(--ink-3); overflow: hidden; }
.p-timer > i { display: block; height: 100%; background: var(--accent); transform-origin: left; }

.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; max-height: 520px; }
.ans {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  border: 0; border-radius: 18px; padding: 14px; min-height: 120px; text-align: left;
  background: var(--c); color: #fff; font-weight: 700; font-size: clamp(1rem, 4.6vw, 1.3rem); line-height: 1.15;
  box-shadow: inset 0 -5px 0 rgba(0,0,0,.18);
  transition: transform .08s ease, opacity .2s ease, filter .2s ease;
}
.ans .shape { font-size: 1.6rem; opacity: .95; }
.ans:active { transform: scale(.97); }
.answers.locked .ans { opacity: .28; filter: grayscale(.4); }
.answers.locked .ans.picked { opacity: 1; filter: none; outline: 4px solid #fff; outline-offset: -4px; }
.answers.locked .ans { pointer-events: none; }

.verdict { border-radius: 22px; padding: 28px 22px; text-align: center; }
.verdict.good { background: color-mix(in srgb, var(--ok) 18%, var(--ink-2)); border: 2px solid var(--ok); }
.verdict.bad { background: color-mix(in srgb, var(--ko) 15%, var(--ink-2)); border: 2px solid var(--ko); }
.verdict.none { background: var(--ink-2); border: 2px solid var(--line); }
.verdict h2 { margin: 0 0 6px; font-size: 1.9rem; font-stretch: 125%; }
.verdict .gain { font-size: 2.6rem; color: var(--ok); }
.verdict .right { margin-top: 14px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); }
.rankline { display: flex; justify-content: center; gap: 28px; margin-top: 6px; }
.rankline div { text-align: center; }
.rankline small { display: block; color: var(--muted); font-size: .8rem; }
.rankline .num { font-size: 1.8rem; }

.pulse { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(.7); opacity: .55; } 50% { transform: scale(1.1); opacity: 1; } }

/* =====================================================================
   ÉCRAN GÉANT (16:9)
   ===================================================================== */
.stage {
  height: 100vh; width: 100vw; overflow: hidden; display: grid; grid-template-rows: auto 1fr auto;
  padding: 3.2vh 4vw; gap: 2.4vh; font-size: 1.6vh;
  background:
    radial-gradient(120vh 80vh at 100% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--ink);
}
.is-demo .stage { height: calc(100vh - 26px); }
.s-top { display: flex; align-items: center; gap: 2vw; min-height: 7vh; }
.s-top .logo { height: 7vh; max-width: 18vw; object-fit: contain; background: #fff; border-radius: 1vh; padding: .7vh 1vh; }
.s-top .titles { flex: 1; min-width: 0; }
.s-top .event { font-size: 3.2vh; font-weight: 800; font-stretch: 125%; line-height: 1.05; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-top .client { font-size: 2vh; color: var(--muted); }
.s-top .step { font-size: 2.2vh; color: var(--muted); text-align: right; }
.s-top .step b { color: var(--text); font-size: 3vh; }

.s-main { min-height: 0; display: flex; flex-direction: column; justify-content: center; }
.s-foot { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 2vh; gap: 2vw; }
.s-foot .join b { color: var(--text); font-size: 2.6vh; letter-spacing: .08em; }
.s-foot .venue { font-weight: 700; font-stretch: 125%; color: var(--text); opacity: .8; }

/* Accueil (QR) */
.lobby { display: grid; grid-template-columns: auto 1fr; gap: 5vw; align-items: center; }
.lobby .qr { width: 46vh; height: 46vh; background: #fff; border-radius: 2.4vh; padding: 1.6vh; box-shadow: 0 2vh 6vh rgba(0,0,0,.35); }
.lobby .qr svg { width: 100%; height: 100%; display: block; }
.lobby h1 { font-size: 7.2vh; line-height: 1; margin: 0 0 2.4vh; font-stretch: 125%; font-weight: 800; letter-spacing: -0.02em; }
.lobby .how { font-size: 2.6vh; color: var(--muted); margin: 0 0 3vh; max-width: 60ch; }
.lobby .codebox { display: flex; align-items: baseline; gap: 2vw; margin-bottom: 3.5vh; }
.lobby .code { font-size: 13vh; line-height: .9; color: var(--accent); letter-spacing: .06em; }
.lobby .url { font-size: 2.4vh; color: var(--text); word-break: break-all; }
.lobby .count { font-size: 2.6vh; }
.lobby .count .num { font-size: 6vh; color: var(--text); margin-right: .6vw; }
.names { display: flex; flex-wrap: wrap; gap: 1vh; margin-top: 2.4vh; max-height: 14vh; overflow: hidden; }
.names span { background: var(--ink-3); border-radius: 999px; padding: .5vh 1.4vh; font-size: 2vh; animation: pop .35s ease both; }
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* Question */
.q-wrap { display: grid; grid-template-columns: 1fr auto; gap: 3vw; align-items: end; margin-bottom: 4vh; }
.q-label { font-size: 2.4vh; color: var(--muted); margin-bottom: 1vh; }
.q-prompt { font-size: 6.6vh; line-height: 1.05; font-weight: 800; font-stretch: 125%; margin: 0; letter-spacing: -0.015em; }
.q-hint { margin-top: 2vh; display: inline-flex; gap: 1.2vw; align-items: baseline; font-size: 3vh; background: var(--ink-2); border: 1px solid var(--accent); border-radius: 1.4vh; padding: 1vh 2vh; animation: pop .4s ease both; }
.q-hint b { color: var(--accent); }
.clock { text-align: right; }
.clock .num { font-size: 19vh; line-height: .82; display: block; }
.clock.low .num { color: var(--ko); }
.clock small { font-size: 2.2vh; color: var(--muted); display: block; }
.reveal-count .num { color: var(--ok); }

.grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 2vh 1.6vw; }
.opt {
  position: relative; display: flex; align-items: center; gap: 2vw; min-height: 13vh; padding: 2vh 2.4vw;
  border-radius: 2vh; background: var(--c); color: #fff; font-size: 4.4vh; font-weight: 750; line-height: 1.1;
  box-shadow: inset 0 -.8vh 0 rgba(0,0,0,.18); overflow: hidden; transition: opacity .4s ease, filter .4s ease;
}
.opt .shape { font-size: 5vh; }
.opt .txt { flex: 1; min-width: 0; }
.opt .bar { position: absolute; left: 0; bottom: 0; height: .9vh; background: rgba(255,255,255,.85); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.opt .votes { font-size: 3.4vh; font-stretch: 125%; font-weight: 800; opacity: 0; transition: opacity .4s; }
.reveal .opt .votes { opacity: 1; }
.reveal .opt.wrong { opacity: .3; filter: grayscale(.6); }
.reveal .opt.right { outline: .7vh solid #fff; outline-offset: -.7vh; animation: win .7s ease both; }
@keyframes win { 0% { transform: scale(1); } 40% { transform: scale(1.035); } 100% { transform: scale(1); } }

.track { margin-top: 3vh; height: 1.1vh; border-radius: 1vh; background: var(--ink-3); overflow: hidden; }
.track > i { display: block; height: 100%; background: var(--accent); transform-origin: left; }
.answered { margin-top: 1.4vh; font-size: 2.4vh; color: var(--muted); display: flex; justify-content: space-between; }
.answered b { color: var(--text); }

/* Classement */
.board { display: grid; grid-template-columns: 1.6fr 1fr; gap: 4vw; align-items: start; }
.board.solo { grid-template-columns: 1fr; max-width: 120vh; margin: 0 auto; width: 100%; }
.board h2 { font-size: 4.4vh; margin: 0 0 2.4vh; font-stretch: 125%; }
.rows { display: grid; gap: 1.1vh; }
.row { display: grid; grid-template-columns: 7vh 1fr auto; align-items: center; gap: 1.6vw; padding: 1.25vh 2vh; border-radius: 1.4vh; background: var(--ink-2); font-size: 3vh; animation: slidein .45s ease both; }
.row .pos { font-size: 3.4vh; color: var(--muted); }
.row .nm { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .nm small { color: var(--muted); font-weight: 500; margin-left: 1vw; font-size: 2.2vh; }
.row .sc { font-size: 3.2vh; }
.row.top1 { background: var(--accent); color: var(--on-accent); }
.row.top1 .pos, .row.top1 small { color: inherit; opacity: .8; }
@keyframes slidein { from { transform: translateX(-3vw); opacity: 0; } to { transform: none; opacity: 1; } }

/* Podium */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 2vw; max-width: 130vh; margin: 0 auto; width: 100%; }
.pod { text-align: center; }
.pod .nm { font-size: 3.8vh; font-weight: 800; margin-bottom: .6vh; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pod .tm { font-size: 2.2vh; color: var(--muted); margin-bottom: 1.4vh; }
.pod .block { border-radius: 2vh 2vh 0 0; background: var(--ink-3); display: flex; flex-direction: column; justify-content: flex-start; padding-top: 2.4vh; }
.pod .block .num { font-size: 9vh; line-height: 1; }
.pod .block .sc { font-size: 2.8vh; margin-top: 1vh; }
.pod.p1 .block { height: 36vh; background: var(--accent); color: var(--on-accent); }
.pod.p2 .block { height: 27vh; }
.pod.p3 .block { height: 21vh; }
.podium-title { text-align: center; font-size: 7vh; font-stretch: 125%; font-weight: 800; margin: 0 0 4vh; letter-spacing: -0.02em; }
.team-win { text-align: center; margin-top: 3vh; font-size: 3vh; color: var(--muted); }
.team-win b { color: var(--text); }

/* Barre de pilotage sur l'écran (apparaît au survol) */
.s-ctrl {
  position: fixed; left: 50%; bottom: 1.6vh; transform: translate(-50%, 0); z-index: 20;
  display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 999px;
  background: rgba(10, 14, 26, .88); border: 1px solid var(--line); backdrop-filter: blur(8px);
  opacity: 0; transition: opacity .25s ease; font-size: 15px;
}
.s-ctrl:hover, .s-ctrl:focus-within, body.show-ctrl .s-ctrl { opacity: 1; }
.s-ctrl .btn { min-height: 40px; padding: .45em 1.1em; }
.s-ctrl .kbd { color: var(--muted); font-size: 13px; padding: 0 8px; }

/* =====================================================================
   RÉGIE ANIMATEUR (thème clair, outil de travail)
   ===================================================================== */
body.admin {
  --text: #121A2C; --muted: #5B6680; --line: #DCE1EA; --ink-2: #FFFFFF; --ink-3: #EEF1F6;
  background: #F3F5F9; color: var(--text);
}
.admin .input { background: #fff; color: var(--text); border-color: var(--line); min-height: 46px; font-size: 1rem; }
.admin .btn.ghost { color: var(--text); }
.wrap { max-width: 1120px; margin: 0 auto; padding: 28px 22px 80px; }
.a-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.a-top h1 { margin: 0; font-size: 1.7rem; font-stretch: 125%; font-weight: 800; letter-spacing: -0.015em; }
.a-top .sub { color: var(--muted); font-size: .95rem; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 24px; margin-bottom: 20px; }
.panel h2 { margin: 0 0 4px; font-size: 1.2rem; }
.panel > p.hint { margin: 0 0 18px; color: var(--muted); font-size: .93rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.games { display: grid; gap: 10px; }
.game-row { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.game-row .code { font-size: 1.5rem; color: #121A2C; min-width: 4.2ch; }
.game-row .meta { color: var(--muted); font-size: .88rem; }
.game-row .acts { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.game-row .acts .btn { min-height: 40px; padding: .4em 1em; font-size: .92rem; }

.logo-drop { display: flex; align-items: center; gap: 14px; }
.logo-drop .prev { width: 120px; height: 64px; border: 1px dashed var(--line); border-radius: 10px; display: grid; place-items: center; color: var(--muted); font-size: .8rem; background: #fff; }
.logo-drop .prev img { max-width: 110px; max-height: 56px; object-fit: contain; }
.swatch { display: flex; align-items: center; gap: 10px; }
.swatch input[type=color] { width: 52px; height: 46px; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: #fff; }

.qlist { display: grid; gap: 12px; counter-reset: q; }
.qitem { border: 1px solid var(--line); border-radius: 14px; padding: 16px; background: #FBFCFE; display: grid; gap: 12px; }
.qitem .qtop { display: grid; grid-template-columns: auto 1.4fr 110px auto; gap: 10px; align-items: center; }
.qitem .qn { font-weight: 800; font-stretch: 125%; color: var(--muted); min-width: 2.2ch; }
.qitem .opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.qitem .opts .input { min-height: 42px; }
.qitem .opts .ok { border-color: var(--ok); background: #F0FDF7; }
.qitem .more { display: grid; grid-template-columns: 1fr 2fr; gap: 8px; }
.qitem .more .input { min-height: 40px; font-size: .92rem; }
.qitem .lbl { font-size: .78rem; color: var(--muted); margin-bottom: 3px; }
.qitem .x { border: 0; background: transparent; color: var(--muted); font-size: 1.3rem; width: 40px; height: 40px; border-radius: 10px; }
.qitem .x:hover { background: var(--ink-3); color: var(--ko); }
@media (max-width: 760px) { .qitem .opts { grid-template-columns: 1fr 1fr; } .qitem .qtop { grid-template-columns: auto 1fr auto; } .qitem .qtop .dur { grid-column: 2; } .qitem .more { grid-template-columns: 1fr; } }

.bar-actions { position: sticky; bottom: 0; background: rgba(243,245,249,.92); backdrop-filter: blur(6px); padding: 14px 0; display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; border-top: 1px solid var(--line); margin-top: 10px; }
textarea.input { min-height: 140px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: .9rem; line-height: 1.5; }
details.import summary { cursor: pointer; font-weight: 600; color: var(--muted); }
details.import[open] summary { margin-bottom: 12px; }

/* Régie en direct */
.live { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; }
@media (max-width: 860px) { .live { grid-template-columns: 1fr; } }
.live .now { font-size: 1.05rem; }
.live .now .st { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--ink-3); font-weight: 700; font-size: .85rem; }
.live .note { margin-top: 10px; padding: 12px 14px; border-left: 4px solid var(--accent); background: #FFFBEF; border-radius: 0 10px 10px 0; }
.live .ctrl { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.live .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.live .stat { padding: 14px; border-radius: 12px; background: var(--ink-3); }
.live .stat .num { font-size: 1.8rem; display: block; }
.live .stat small { color: var(--muted); }
.links { display: grid; gap: 8px; }
.links a { color: inherit; font-weight: 600; }
.copy { display: flex; gap: 8px; }
.copy .input { font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
