/* Major ! — téléphone d'abord, et un mode « animateur » lisible au vidéoprojecteur. */
@font-face {
  font-family: "Display";
  src: url("lilita-one.ttf") format("truetype");
  font-weight: 900; font-style: normal; font-display: swap;
}
:root {
  --night: #14213d; --night-2: #1d2f57; --ink: #0d1529; --paper: #fdf6e3; --muted: #b9c3d9;
  --yellow: #ffd23f; --coral: #ff6b6b; --green: #3ddc97; --blue: #5fa8ff; --line: #2c4170;
  --radius: 20px; --display: "Display", "Arial Black", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; color: var(--paper); background: radial-gradient(1200px 600px at 50% -10%, #23386a, var(--night)); font: 16px/1.5 system-ui, "Segoe UI", Arial, sans-serif; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; opacity: .45; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--display); font-weight: 900; line-height: 1.1; letter-spacing: .01em; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 10; background: var(--yellow); color: var(--ink); padding: 8px 12px; border-radius: 8px; }

/* En-tête */
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--yellow); color: var(--ink); font: 900 22px/1 var(--display); }
.brand-name { font: 900 18px/1 var(--display); }
.help-button { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 12px; }
main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 16px 32px; display: flex; flex-direction: column; gap: 16px; }
.app-footer { display: flex; justify-content: center; padding: 8px 16px 16px; }

/* Éléments communs */
.card { background: var(--night-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.card.narrow { max-width: 520px; width: 100%; margin: 0 auto; }
.card.center { text-align: center; align-items: center; }
.card h1 { font-size: 28px; }
.button { border: 0; border-radius: 14px; padding: 12px 20px; font-weight: 800; background: var(--line); }
.button.primary { background: var(--yellow); color: var(--ink); }
.button.secondary { background: transparent; border: 2px solid var(--muted); }
.button.dark { background: var(--ink); }
.button.wide { width: 100%; }
.button.big { padding: 16px 26px; font-size: 18px; }
.text-button { border: 0; background: none; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; padding: 6px; }
.stack { display: flex; flex-direction: column; gap: 10px; align-items: stretch; }
.row { display: flex; gap: 10px; }
.label { font-weight: 700; font-size: 14px; color: var(--muted); }
.input { width: 100%; border: 2px solid var(--line); border-radius: 12px; background: var(--ink); padding: 12px 14px; font-size: 18px; }
.input.code { font: 900 26px/1 var(--display); letter-spacing: .15em; text-align: center; }
.muted { color: var(--muted); font-size: 14px; }
.alert { background: #5a1f2b; border: 1px solid var(--coral); border-radius: 12px; padding: 10px 14px; }
.alert.soft { background: #2b3550; border-color: var(--muted); }
.back-link { align-self: flex-start; border: 0; background: none; color: var(--muted); padding: 0; }
#readyForm, .code-form { display: flex; flex-direction: column; gap: 10px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--ink); border: 1px solid var(--line); padding: 10px 16px; border-radius: 12px; z-index: 20; }

/* Accueil */
.welcome { text-align: center; display: flex; flex-direction: column; gap: 16px; padding-top: 12px; }
.kicker { color: var(--yellow); font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: 13px; }
.title { font-size: clamp(38px, 9vw, 64px); }
.subtitle { font: 900 clamp(18px, 4vw, 24px)/1.2 var(--display); color: var(--yellow); margin-top: -6px; }
.host-subtitle { font: 900 clamp(20px, 2vw, 30px)/1.2 var(--display); color: var(--yellow); margin-top: -10px; }
.pitch { color: var(--muted); font-size: 17px; }
.facts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 0; list-style: none; }
.facts li { border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-top: 8px; }
.choice { text-align: left; border: 2px solid var(--line); background: var(--night-2); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; }
.choice strong { font: 900 24px/1.1 var(--display); }
.choice span { color: var(--muted); }
.choice.primary { border-color: var(--yellow); }
.choice.primary strong { color: var(--yellow); }

/* Joueur : question */
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 14px; font-weight: 700; }
.pill { align-self: flex-start; border-radius: 999px; padding: 3px 12px; font-size: 13px; font-weight: 800; }
.pill.alive { background: #1c4d3b; color: var(--green); }
.pill.out { background: #4a2430; color: #ffb3b3; }
.affirmation { font: 900 24px/1.25 var(--display); }
.affirmation.small { font: 600 16px/1.4 system-ui, sans-serif; color: var(--muted); }
.timebar { height: 12px; border-radius: 999px; background: var(--ink); overflow: hidden; }
.timebar span { display: block; height: 100%; width: 100%; background: var(--yellow); transition: width .1s linear; }
.timebar span.low { background: var(--coral); }
.answers { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer { min-height: 110px; border-radius: 18px; border: 4px solid transparent; font: 900 30px/1 var(--display); letter-spacing: .05em; }
.answer.vrai { background: #1c4d3b; color: var(--green); }
.answer.faux { background: #4a2430; color: #ffb3b3; }
.answer.selected { border-color: var(--yellow); transform: scale(1.03); box-shadow: 0 0 0 4px #ffd23f44; }
.answer.vrai.selected { background: var(--green); color: var(--ink); }
.answer.faux.selected { background: var(--coral); color: var(--ink); }

/* Joueur : révélation */
.banner { text-align: center; font: 900 34px/1.1 var(--display); border-radius: 16px; padding: 16px; }
.banner.in { background: var(--green); color: var(--ink); }
.banner.out { background: var(--coral); color: var(--ink); animation: shake .5s; }
.banner.saved { background: var(--blue); color: var(--ink); font-size: 22px; }
.banner.neutral { background: var(--line); font-size: 24px; }
.solution { font: 900 30px/1 var(--display); }
.solution.is-true { color: var(--green); }
.solution.is-false { color: var(--coral); }
.explanation { font-size: 16px; line-height: 1.55; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

/* Fin de partie */
.finished { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; }
.podium { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.podium li { background: var(--yellow); color: var(--ink); border-radius: 14px; padding: 10px 18px; font: 900 24px/1 var(--display); }
.ranking { margin: 0; padding-left: 28px; text-align: left; width: 100%; max-width: 520px; }
.ranking li { padding: 4px 0; }
.ranking li span { font-weight: 700; }
.ranking li small { color: var(--muted); margin-left: 8px; }
.personal { font: 900 22px/1.2 var(--display); }
.personal.win { color: var(--yellow); }

/* Dialogues */
.dialog { border: 1px solid var(--line); border-radius: var(--radius); background: var(--night-2); color: var(--paper); padding: 22px; max-width: min(540px, calc(100vw - 32px)); }
.dialog::backdrop { background: #0009; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.close-dialog { border: 0; background: none; font-size: 28px; line-height: 1; color: var(--muted); }
.dialog p { margin: 10px 0; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.rules-list { padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }
.rules-note { color: var(--muted); }

/* ── Mode animateur (ordinateur projeté) ─────────────────────────── */
body.host-mode main { max-width: 1400px; padding: 8px 32px 32px; }
.host-top { display: flex; align-items: center; gap: 24px; color: var(--muted); font-weight: 700; font-size: 18px; flex-wrap: wrap; }
.host-top .host-alive { margin-left: auto; }
.host-top .host-alive strong { color: var(--yellow); font-size: 26px; }
.host-progress { color: var(--paper); }
.host-title { font-size: clamp(40px, 5vw, 72px); }
.host-sub { color: var(--muted); font-size: 20px; }
.host-lobby { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 40px; align-items: start; }
.invite { background: var(--paper); color: var(--ink); border-radius: 24px; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.invite .text-button { color: #4b5875; }
.qr { width: 100%; max-width: 340px; aspect-ratio: 1; }
.qr svg { width: 100%; height: 100%; display: block; }
.invite-text { font-size: 18px; line-height: 1.4; }
.big-code { font: 900 54px/1 var(--display); letter-spacing: .12em; }
.lobby-side { display: flex; flex-direction: column; gap: 18px; }
.host-actions { display: flex; gap: 14px; justify-content: flex-end; flex-wrap: wrap; margin-top: 8px; }
.host-stage { display: flex; flex-direction: column; gap: 22px; }
.stage-label { color: var(--yellow); font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.host-stage .affirmation { font-size: clamp(32px, 3.6vw, 58px); }
.host-stage .affirmation.small { font-size: 22px; }
.host-stage .timebar { height: 22px; }
.answered { font-size: 22px; color: var(--muted); }
.host-stage .solution { font-size: clamp(56px, 7vw, 110px); }
.verdict { font: 900 clamp(26px, 2.6vw, 40px)/1.2 var(--display); color: var(--yellow); }
.host-stage .explanation { font-size: clamp(20px, 1.7vw, 28px); max-width: 1100px; }
.counts { color: var(--muted); font-size: 20px; }

/* Pastilles des joueurs */
.seats { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.seat { position: relative; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px; background: var(--night-2); border: 2px solid var(--line); font-weight: 800; transition: opacity .6s, filter .6s, background .6s; }
.seat-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--green); box-shadow: 0 0 14px var(--green); flex-shrink: 0; }
.seat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat.waiting .seat-dot { background: #5d6a88; box-shadow: none; }
.seat.waiting { color: var(--muted); }
.seat.out { opacity: .35; filter: grayscale(1); }
.seat.out .seat-dot { background: #5d6a88; box-shadow: none; }
.seat.just-out { opacity: 1; filter: none; border-color: var(--coral); animation: lightsOut 2.4s forwards; }
.seat.just-out .seat-dot { background: var(--coral); box-shadow: 0 0 18px var(--coral); }
@keyframes lightsOut { 0%, 15%, 30% { background: #5a1f2b; } 8%, 23% { background: var(--night-2); } 60% { opacity: 1; filter: none; } 100% { opacity: .35; filter: grayscale(1); } }
.seat-remove { position: absolute; right: 6px; border: 0; background: none; color: var(--muted); font-size: 20px; line-height: 1; opacity: 0; }
.seat:hover .seat-remove, .seat-remove:focus-visible { opacity: 1; }
.empty-seats { color: var(--muted); font-size: 18px; }
body.host-mode .seats { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
body.host-mode .seat { font-size: 20px; }

@media (max-width: 860px) {
  .host-lobby { grid-template-columns: 1fr; }
  body.host-mode main { padding: 8px 16px 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .banner.out, .seat.just-out { animation: none; }
}
body.host-mode .app-footer { display: none; }
.join-main { margin-top: 8px; }
.host-entry { text-align: center; margin-top: 28px; }
.host-entry .text-button { font-size: 13px; opacity: .7; }
