/* =========================================================================
   host.css — l'écran de l'hôte (télé, vidéoprojecteur, partage d'écran)
   -------------------------------------------------------------------------
   Tout est dimensionné en vw/vmin : le même écran doit rester lisible sur
   un 24 pouces à 50 cm et sur une télé de salon à 4 mètres.
   ========================================================================= */

body { overflow: hidden; height: 100vh; }

#host {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 0;
}

/* ---------------- bandeau du haut ---------------- */

.hbar {
  display: flex; align-items: center; gap: 18px;
  padding: 14px 26px;
  border-bottom: 1px solid var(--line);
  background: #0e0820cc; backdrop-filter: blur(6px);
}
.hbar .brand { font-size: 22px; font-weight: 800; letter-spacing: .18em; }
.hbar .brand b { color: var(--croco); }

.room-code {
  font-family: var(--mono); font-size: 30px; font-weight: 700;
  letter-spacing: .3em; color: var(--gold);
  text-shadow: 0 0 20px #ffb02066;
}

.hbar .round-pill { font-size: 15px; }

/* ---------------- scène centrale ---------------- */

.stage {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.2vh; padding: 2vh 4vw; overflow: hidden;
}

.stage h2.mini-name {
  font-size: clamp(38px, 6.5vw, 108px);
  font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  text-align: center;
  text-shadow: 0 0 30px var(--neon), 0 0 90px #ff4dcd44;
}
.stage .mini-icon   { font-size: clamp(50px, 9vh, 120px); line-height: 1; }
.stage .mini-rule   { font-size: clamp(17px, 2.1vw, 30px); color: var(--muted); max-width: 26ch; text-align: center; line-height: 1.5; }
.stage .mini-quote  { font-size: clamp(15px, 1.6vw, 22px); font-style: italic; color: var(--cyan); }

.big-number {
  font-family: var(--mono);
  font-size: clamp(60px, 16vh, 190px); font-weight: 700; line-height: 1;
}

/* ---------------- salon ---------------- */

.lobby {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 3vw;
  width: 100%; max-width: 1500px; align-items: center;
}
.lobby-left  { display: flex; flex-direction: column; gap: 2vh; }
.join-big {
  font-size: clamp(16px, 1.6vw, 24px); color: var(--muted); line-height: 1.7;
}
.join-big b { color: var(--text); }
.join-url {
  font-family: var(--mono); font-size: clamp(20px, 2.4vw, 38px);
  color: var(--cyan); word-break: break-all;
}
.code-huge {
  font-family: var(--mono);
  font-size: clamp(70px, 13vw, 200px); font-weight: 700;
  letter-spacing: .12em; color: var(--gold);
  text-shadow: 0 0 40px #ffb02055;
  line-height: 1;
}

.players-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px; max-height: 62vh; overflow: auto; padding: 4px;
}
.pcard {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  animation: pop .3s ease;
}
.pcard .nm  { font-weight: 700; font-size: 16px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .sub { font-size: 12px; color: var(--muted); }
.pcard.off  { opacity: .4; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } }

/* ---------------- pendant le jeu ---------------- */

/* Vignettes « qui a répondu » */
.answered {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center;
}
.answered .a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  opacity: .35; transition: opacity .25s ease, transform .25s ease;
  font-size: 13px; width: 74px; text-align: center;
}
.answered .a.done { opacity: 1; transform: translateY(-4px); }
.answered .a.done .avatar { border-color: var(--croco); box-shadow: 0 0 18px #5ce1a066; }

/* QCM affiché sur la télé */
.opts {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  width: 100%; max-width: 1200px;
}
.opt {
  padding: 18px 22px; border-radius: 14px;
  background: var(--panel); border: 2px solid var(--line);
  font-size: clamp(17px, 1.8vw, 28px); font-weight: 700;
  display: flex; align-items: center; gap: 14px;
}
.opt .k {
  width: 1.9em; height: 1.9em; flex: none; border-radius: 10px;
  display: grid; place-items: center; font-family: var(--mono);
  background: #ffffff14;
}
.opt.k0 .k { background: #ff4d5e33; color: #ff8f99; }
.opt.k1 .k { background: #4de3ff33; color: #9becff; }
.opt.k2 .k { background: #5ce1a033; color: #a5f2d0; }
.opt.k3 .k { background: #ffb02033; color: #ffd48a; }
.opt.good  { border-color: var(--croco); box-shadow: 0 0 0 3px #5ce1a033, 0 0 40px #5ce1a033; }
.opt.bad   { opacity: .35; }

/* Séquence de KSUSHI DIT */
.simon {
  display: grid; grid-template-columns: 1fr 1fr; gap: 18px;
  width: min(60vh, 90vw); aspect-ratio: 1;
}
.simon .s {
  border-radius: 22px; border: 3px solid #ffffff1a;
  opacity: .28; transition: opacity .12s ease, transform .12s ease, box-shadow .12s ease;
}
.simon .s.on { opacity: 1; transform: scale(1.04); }
.simon .s0 { background: var(--danger); } .simon .s0.on { box-shadow: 0 0 60px var(--danger); }
.simon .s1 { background: var(--cyan);   } .simon .s1.on { box-shadow: 0 0 60px var(--cyan); }
.simon .s2 { background: var(--croco);  } .simon .s2.on { box-shadow: 0 0 60px var(--croco); }
.simon .s3 { background: var(--gold);   } .simon .s3.on { box-shadow: 0 0 60px var(--gold); }

/* L'ESQUIVE : plein écran rouge puis vert */
.signal {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-size: clamp(44px, 9vw, 140px); font-weight: 800; letter-spacing: .1em;
  background: #3a0d14; color: #ff8f99;
  transition: background .06s linear;
}
.signal.go { background: #0d3a24; color: #9ff2cc; text-shadow: 0 0 60px var(--croco); }

/* ---------------- résultats & classement ---------------- */

.results {
  width: 100%; max-width: 1100px;
  display: flex; flex-direction: column; gap: 10px;
  max-height: 74vh; overflow: auto;
}
.rline {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px; border-radius: 14px;
  background: var(--panel); border: 1px solid var(--line);
  animation: slide .35s ease backwards;
}
.rline .rk    { font-family: var(--mono); font-size: 26px; width: 2ch; color: var(--muted); }
.rline .nm    { font-weight: 700; font-size: clamp(18px, 1.7vw, 26px); }
.rline .main  { color: var(--muted); font-size: clamp(15px, 1.4vw, 21px); }
.rline .pts   { margin-left: auto; font-family: var(--mono); font-weight: 700; font-size: clamp(18px, 1.8vw, 30px); color: var(--croco); }
.rline.win    { border-color: var(--gold); box-shadow: 0 0 0 2px #ffb02033; }
.rline.win .rk { color: var(--gold); }
@keyframes slide { from { opacity: 0; transform: translateX(-24px); } }

/* Podium de fin */
.podium { display: flex; align-items: flex-end; gap: 3vw; justify-content: center; }
.pod { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pod .bar {
  width: 16vw; max-width: 220px; border-radius: 16px 16px 0 0;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line); border-bottom: none;
  display: grid; place-items: center;
  font-family: var(--mono); font-size: clamp(24px, 3vw, 52px); font-weight: 700;
}
.pod.p1 .bar { height: 34vh; border-color: var(--gold);  box-shadow: 0 0 60px #ffb02033; color: var(--gold); }
.pod.p2 .bar { height: 24vh; }
.pod.p3 .bar { height: 18vh; }
.pod .nm { font-size: clamp(17px, 1.7vw, 28px); font-weight: 700; }

/* ---------------- bandeau du bas ---------------- */

.hfoot {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 26px;
  border-top: 1px solid var(--line);
  background: #0e0820cc;
}
.hfoot .timer { flex: 1; }

/* Jauges du chat Twitch */
.gauges { display: flex; gap: 18px; align-items: center; font-size: 13px; }
.gauge { width: 150px; }
.gauge .lab { display: flex; justify-content: space-between; color: var(--muted); font-weight: 700; letter-spacing: .06em; }
.gauge .bar { height: 7px; border-radius: 999px; background: #ffffff14; overflow: hidden; margin-top: 4px; }
.gauge .bar > i { display: block; height: 100%; background: var(--danger); transition: width .3s ease; }
.gauge.hype .bar > i { background: var(--croco); }

/* Bandeau de sabotage annoncé */
.sabotage-banner {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 24px; border-radius: 16px;
  background: linear-gradient(90deg, #ff4d5e22, #ff4dcd22);
  border: 2px solid var(--danger);
  font-size: clamp(16px, 1.7vw, 26px); font-weight: 700;
  animation: pulse 1.2s ease-in-out infinite;
}
@keyframes pulse { 50% { box-shadow: 0 0 40px #ff4d5e55; } }

/* Derniers messages du chat, discrets, en bas à droite */
.chatfeed {
  position: absolute; right: 18px; bottom: 18px; width: 300px;
  display: flex; flex-direction: column; gap: 5px;
  font-size: 13px; pointer-events: none; opacity: .8;
}
.chatfeed div { background: #0e0820cc; border-radius: 8px; padding: 5px 9px; }
.chatfeed b { color: var(--neon); }

/* Sur petit écran (l'hôte teste souvent sur son laptop), on empile. */
@media (max-width: 900px) {
  .lobby { grid-template-columns: 1fr; }
  .opts  { grid-template-columns: 1fr; }
  .chatfeed { display: none; }
}
