/* =========================================================================
 * PIXEL QUIZ ARENA - Manette joueur (mobile first)
 * ========================================================================= */
html, body.play { height: 100%; overscroll-behavior: none; }
body.play { display: flex; flex-direction: column; min-height: 100dvh; font-size: 24px; user-select: none; -webkit-user-select: none; touch-action: manipulation;
  background: radial-gradient(circle at 50% 0, #2a1f4a, var(--ink) 70%) var(--ink); }
body.play.shake { animation: pshake .35s; }
@keyframes pshake { 25% { transform: translateX(-8px); } 50% { transform: translateX(8px); } 75% { transform: translateX(-4px); } }

#netbar { display: none; background: var(--orange); color: var(--ink); text-align: center; padding: 6px; font-size: 20px; }
#netbar.on { display: block; }
#netbar span { animation: blink 1.4s infinite; }
.mini-btn { background: var(--ink); color: var(--white); border: 3px solid #000; padding: 6px 14px; font-size: 20px; margin-top: 10px; }
#netbar .mini-btn { margin: 6px auto 0; display: block; font-size: 17px; padding: 3px 10px; }
#netbar small { display: block; font-size: 15px; opacity: .85; }

#me { display: flex; align-items: center; gap: 10px; padding: 8px 12px calc(8px); padding-top: max(8px, env(safe-area-inset-top)); background: rgba(0,0,0,.35); border-bottom: 4px solid var(--me, var(--g3)); }
#me:empty { display: none; }
#me .av { width: 48px; height: 48px; }
.me-info { flex: 1; display: flex; flex-direction: column; line-height: 1; gap: 2px; }
.me-info b { font-size: 26px; }
.me-info small { color: var(--g1); font-size: 20px; }
.me-score { font-family: var(--font-title); font-size: 18px; color: var(--yellow); text-align: right; }
.me-score small { display: block; font-family: var(--font-text); font-size: 16px; color: var(--g1); }
.team { font-size: 16px; padding: 0 6px; color: var(--ink); align-self: flex-start; }
.team.big { font-size: 26px; padding: 4px 12px; border: 3px solid #000; align-self: center; }

#screen { flex: 1; display: flex; flex-direction: column; padding: 12px; overflow-y: auto; }
#cards { display: flex; gap: 8px; padding: 8px 12px; padding-bottom: max(8px, env(safe-area-inset-bottom)); }
#cards:empty { display: none; }
.card-btn { flex: 1; background: var(--pink); border: 3px solid #000; padding: 6px; font-size: 24px; display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: inset -3px -3px 0 rgba(0,0,0,.3), 0 4px 0 #000; animation: popIn .4s; }
.card-btn span { font-size: 20px; }
.card-btn:disabled { opacity: .35; filter: grayscale(1); animation: none; }

/* Connexion */
.join { display: flex; flex-direction: column; gap: 8px; max-width: 460px; width: 100%; margin: 0 auto; }
.logo.small { font-size: 13px; margin: 6px 0 12px; }
.join label { font-family: var(--font-title); font-size: 11px; color: var(--yellow); margin-top: 6px; }
.join input { font-family: var(--font-text); font-size: 30px; padding: 8px 12px; background: var(--white); color: var(--ink); border: 4px solid #000; width: 100%; user-select: text; -webkit-user-select: text; }
.join input.code { font-family: var(--font-title); font-size: 28px; letter-spacing: 10px; text-transform: uppercase; text-align: center; }
.join .big-btn { margin-top: 14px; font-size: 15px; }
.err { background: var(--red2); border: 3px solid #000; padding: 8px; }
.av-edit { display: flex; gap: 12px; align-items: center; }
.av-prev { width: 130px; height: 130px; background: var(--g3); border: 4px solid #000; }
.av-parts { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.av-row { display: flex; align-items: center; justify-content: space-between; background: var(--g3); }
.av-row span { font-size: 20px; }
.av-row button, .av-rand, .small-btn { background: var(--blue); border: 3px solid #000; font-size: 20px; padding: 2px 12px; }
.av-rand { margin-top: 4px; }
.small-btn { padding: 8px 14px; margin-top: 14px; background: var(--g3); }

/* Attente */
.wait { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px; }
.wtitle { font-family: var(--font-title); font-size: 18px; color: var(--yellow); line-height: 1.4; text-shadow: 3px 3px 0 #000; }
.wmsg { font-size: 28px; color: var(--white); }
.tv { font-size: 70px; animation: bob 1.6s infinite; }
.av-big { width: 160px; height: 160px; animation: bob 1.2s infinite; }
.spinner { width: 48px; height: 48px; border: 6px solid var(--g3); border-top-color: var(--yellow); animation: spin 1s steps(8) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.lock-icon, .mic { font-size: 80px; animation: popIn .4s; }
.picked-txt { font-size: 30px; padding: 8px 16px; border: 3px solid #000; background: var(--g3); }
.picked-txt.c0 { background: var(--red); } .picked-txt.c1 { background: var(--blue); } .picked-txt.c2 { background: #b8860b; } .picked-txt.c3 { background: var(--teal); }

/* Chrono */
.ptimer { height: 12px; background: var(--g3); border: 3px solid #000; margin-bottom: 10px; flex-shrink: 0; }
#ptimer-fill { height: 100%; background: var(--lime); width: 100%; }
#ptimer-fill.hurry { background: var(--red2); }

/* Questions */
.pq { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pq-text { font-size: 28px; line-height: 1.05; background: rgba(0,0,0,.4); padding: 10px; border: 3px solid #000; }
.pq-cat { font-family: var(--font-title); font-size: 13px; color: var(--cyan); text-align: center; line-height: 1.4; }
.pq-sub { display: block; margin-top: 4px; font-family: var(--font-text); font-size: 28px; line-height: 1; color: var(--yellow); }
.pchoices { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.pchoice { flex: 1; min-height: 66px; display: flex; align-items: center; gap: 10px; border: 4px solid #000; font-size: 28px; text-align: left; padding: 6px 12px; line-height: 1;
  box-shadow: inset -4px -4px 0 rgba(0,0,0,.3), inset 4px 4px 0 rgba(255,255,255,.15), 0 5px 0 #000; }
.pchoice:active { transform: translateY(3px); box-shadow: 0 2px 0 #000; }
.pchoice.c0 { background: var(--red); } .pchoice.c1 { background: var(--blue); } .pchoice.c2 { background: #b8860b; } .pchoice.c3 { background: var(--teal); }
.pchoices.n2 .pchoice.c0 { background: var(--green); } .pchoices.n2 .pchoice.c1 { background: var(--red); }
.pchoice.picked { outline: 5px solid var(--yellow); }
.pchoice.hidden { visibility: hidden; }
.pchoices.done .pchoice:not(.picked) { opacity: .4; }
.pchoices.readonly .pchoice { pointer-events: none; }
.you-buzzed { font-family: var(--font-title); font-size: 15px; background: var(--me); padding: 12px; text-align: center; border: 3px solid #000; text-shadow: 2px 2px 0 #000; animation: pulse .5s infinite; }
.ptext { display: flex; flex-direction: column; gap: 12px; }
.ptext input { font-family: var(--font-text); font-size: 34px; padding: 10px; border: 4px solid #000; background: var(--white); color: var(--ink); user-select: text; -webkit-user-select: text; }
.hint { font-size: 20px; color: var(--g1); text-align: center; }
.hint.big { font-size: 28px; color: var(--yellow); }

/* Buzzer */
.buzz-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; }
.buzzer { width: min(78vw, 360px); height: min(78vw, 360px); border-radius: 50%; border: 8px solid #000; background: radial-gradient(circle at 35% 30%, #ff8a8a, var(--red2) 45%, #8a1f35);
  box-shadow: 0 14px 0 #5a1020, 0 18px 0 #000, 0 0 60px rgba(228, 59, 68, .6); font-family: var(--font-title); font-size: 34px; color: var(--white); text-shadow: 4px 4px 0 #000; transition: transform .05s; animation: pulse 1.2s infinite; }
.buzzer.pressed, .buzzer:active { transform: translateY(12px); box-shadow: 0 2px 0 #5a1020, 0 6px 0 #000; animation: none; }
.buzzer:disabled { animation: none; background: radial-gradient(circle at 35% 30%, #94b0c2, #566c86 45%, #333c57); box-shadow: 0 14px 0 #222, 0 18px 0 #000; }
.buzzer.early { animation: none; background: radial-gradient(circle at 35% 30%, #ffe9a8, #c9a040 45%, #6b5420); box-shadow: 0 14px 0 #3d3010, 0 18px 0 #000; }
.buzzer.blocked { background: radial-gradient(circle at 35% 30%, #5a1020, #2a0810 60%); }
.buzzer.frozen { background: radial-gradient(circle at 35% 30%, #fff, #73eff7 45%, #41a6f6); }
.buzz-wrap.other { background: var(--oc); margin: -12px; padding: 12px; }
.buzz-sub { font-size: 26px; text-align: center; min-height: 2.2em; }
body[data-screen="choices"] .you-buzzed ~ * {}

/* Table / listes */
.pboard { display: grid; grid-template-columns: repeat(var(--cols), 1fr); gap: 6px; }
.pboard button { aspect-ratio: 1; background: var(--blue); border: 3px solid #000; font-size: 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.pboard button small { font-size: 13px; }
.pboard button:disabled { background: var(--ink); color: var(--g3); }
.plist { display: flex; flex-direction: column; gap: 8px; }
.plist button { background: var(--ink); border: 4px solid var(--oc); font-size: 30px; padding: 12px; }
.pthemes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; flex: 1; overflow-y: auto; }
.pthemes button { background: var(--blue); border: 4px solid #000; font-size: 34px; padding: 6px 2px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pthemes button span { font-size: 19px; }
.pthemes button small { font-size: 14px; color: var(--g1); }
.pthemes button:disabled { background: var(--ink); opacity: .5; }
.pthemes button.mystery { background: var(--plum); }

/* Fourchette */
.prange { display: flex; flex-direction: column; gap: 10px; }
.pr-vis { position: relative; height: 22px; background: var(--g3); border: 3px solid #000; }
#pr-band { position: absolute; top: 0; bottom: 0; background: var(--me, var(--sky)); }
.pr-row { display: flex; align-items: center; gap: 8px; }
.pr-big { display: flex; align-items: baseline; justify-content: center; gap: 8px; font-size: 26px; }
.pr-big input { width: 70%; font-family: var(--font-text); font-size: 44px; text-align: center; padding: 4px; border: 3px solid #000; background: var(--white); color: var(--ink); user-select: text; -webkit-user-select: text; }
.pr-row label { font-family: var(--font-title); font-size: 10px; width: 46px; }
.pr-row input:not([type]) , .pr-row input[inputmode] { width: 110px; font-family: var(--font-text); font-size: 24px; padding: 4px; border: 3px solid #000; background: var(--white); color: var(--ink); user-select: text; -webkit-user-select: text; }
.pr-sum { font-size: 28px; text-align: center; }
.pr-sum b { color: var(--yellow); }

/* Résultat */
.result.good { background: radial-gradient(circle, rgba(56,183,100,.35), transparent 70%); }
.result.bad { background: radial-gradient(circle, rgba(228,59,68,.3), transparent 70%); }
.res-ok { font-family: var(--font-title); font-size: 30px; color: var(--lime); text-shadow: 4px 4px 0 #000; animation: popIn .4s; }
.res-ko { font-family: var(--font-title); font-size: 28px; color: var(--red2); text-shadow: 4px 4px 0 #000; animation: popIn .4s; }
.res-pts { font-family: var(--font-title); font-size: 26px; color: var(--yellow); }
.res-answer { font-size: 32px; background: var(--g3); border: 3px solid #000; padding: 6px 14px; }
.res-anec { font-size: 22px; color: var(--g1); max-width: 520px; }
.end-rank { font-family: var(--font-title); font-size: 34px; color: var(--yellow); }

/* Fenêtre modale, flashs */
#modal { position: fixed; inset: 0; background: rgba(0,0,0,.7); display: none; align-items: center; justify-content: center; z-index: 20; padding: 16px; }
#modal.on { display: flex; }
.m-box { background: var(--g3); border: 4px solid #000; padding: 16px; width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 10px; animation: popIn .3s; }
.m-box .pthemes { max-height: 55vh; flex: none; }
.m-box .pthemes button { font-size: 26px; }
.m-box .pthemes button span { font-size: 16px; }
.friend-btn { margin-top: 10px; align-self: center; background: var(--yellow); color: var(--ink); }
.m-title { font-family: var(--font-title); font-size: 16px; color: var(--yellow); }
.m-desc { font-size: 24px; }
#flash { position: fixed; inset: 0; pointer-events: none; opacity: 0; z-index: 30; }
#flash.on { animation: pflash .6s; }
@keyframes pflash { 0% { opacity: .85; } 100% { opacity: 0; } }
#ice { position: fixed; inset: 0; pointer-events: none; z-index: 25; display: none; background: rgba(115, 239, 247, .35); box-shadow: inset 0 0 80px #fff; }
#ice.on { display: block; animation: blink 1s infinite; }
.ptoast { position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); background: var(--ink); border: 3px solid var(--yellow); padding: 10px 16px; z-index: 40; font-size: 24px; animation: slideUp .3s; white-space: nowrap; }
.local-pad [data-act="leave"] { display: none; }

/* Manette intégrée au plateau (mode Solo) : version compacte, la question est déjà sur la TV */
body.local-pad { font-size: 20px; min-height: 100vh; }
.local-pad #me { padding: 4px 8px; gap: 6px; border-bottom-width: 3px; }
.local-pad #me .av { width: 30px; height: 30px; }
.local-pad .me-info b { font-size: 20px; }
.local-pad .me-info small { font-size: 15px; }
.local-pad .me-score { font-size: 13px; }
.local-pad #screen { padding: 8px; }
.local-pad .pq-text, .local-pad .tv, .local-pad .res-anec, .local-pad .av-big, .local-pad #btn-edit, .local-pad .pq-cat { display: none; }
.local-pad .pq { gap: 6px; }
.local-pad .wait { gap: 6px; }
.local-pad .wtitle { font-size: 12px; }
.local-pad .wmsg { font-size: 19px; }
.local-pad .lock-icon, .local-pad .mic { font-size: 44px; }
.local-pad .picked-txt, .local-pad .res-answer { font-size: 20px; padding: 4px 10px; }
.local-pad .res-ok, .local-pad .res-ko { font-size: 18px; }
.local-pad .res-pts { font-size: 18px; }
.local-pad .buzz-wrap { gap: 8px; }
.local-pad .buzzer { width: min(80vw, 190px); height: min(80vw, 190px); border-width: 6px; }
.local-pad .buzz-sub { font-size: 15px; }
.local-pad .pchoice { min-height: 46px; font-size: 21px; border-width: 3px; padding: 4px 8px; }
.local-pad .pchoices { gap: 6px; }
.local-pad .you-buzzed { font-size: 16px; }
.local-pad .ptext input { font-size: 24px; padding: 6px; }
.local-pad .big-btn { font-size: 13px; padding: 12px; }
.local-pad .pthemes button { font-size: 26px; }
.local-pad .pthemes button span { font-size: 16px; }
.local-pad .hint { font-size: 15px; }
.local-pad .join .logo.small { display: none; }
.local-pad .av-prev { width: 90px; height: 90px; }
.local-pad .join input { font-size: 22px; padding: 4px 8px; }
.local-pad .card-btn { font-size: 18px; padding: 3px; }
.local-pad .card-btn span { font-size: 15px; }

/* ======================= Mode « Jouer sur téléphones » ======================= */
#scores { display: flex; gap: 6px; overflow-x: auto; padding: 4px 8px; background: rgba(0,0,0,.45); scrollbar-width: none; }
#scores:empty { display: none; }
#scores span { flex: none; font-size: 18px; padding: 0 8px; border-left: 5px solid var(--pc); background: var(--g3); white-space: nowrap; }
#scores span.me { background: var(--navy); outline: 2px solid var(--yellow); }
#scores b { color: var(--yellow); }
#pixou-say { display: flex; gap: 8px; align-items: center; padding: 4px 10px; background: var(--plum); border-bottom: 3px solid #000; font-size: 19px; line-height: 1.05; }
#pixou-say:empty { display: none; }
#pixou-say img { width: 30px; height: 40px; flex: none; }
#pixou-say.pop { animation: popIn .35s; }
.tvq { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.tvq-cat { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; font-size: 20px; color: var(--cyan); background: var(--plum); border: 3px solid #000; padding: 6px 10px; }
.tvq-sub { font-size: 28px; line-height: 1; color: var(--yellow); }
.tvq-text { font-size: 25px; line-height: 1.1; background: rgba(0,0,0,.35); border: 3px solid #000; padding: 8px 10px; }
.tvq-text.small { font-size: 20px; }
.tvq-clues { margin: 0; padding-left: 26px; font-size: 26px; color: var(--white); }
.tvq-clues li:last-child { color: var(--yellow); }
.tvq-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tvq-choices span { font-size: 20px; line-height: 1.05; padding: 5px 8px; border: 3px solid #000; background: var(--g3); }
.tvq-choices span b { margin-right: 6px; color: var(--yellow); }
.tvq-choices .good { background: var(--green); }
.tvq-choices .bad { opacity: .45; }
.tvwait { justify-content: flex-start; width: 100%; }
.tvwait .tvq { width: 100%; text-align: left; }
.tv-rules { text-align: left; font-size: 21px; margin: 0; padding-left: 22px; }
.tv-rank { width: 100%; display: flex; flex-direction: column; gap: 4px; }
.tv-rank div { display: flex; align-items: center; gap: 8px; padding: 3px 8px; background: var(--g3); border-left: 7px solid var(--pc); font-size: 22px; }
.tv-rank div.me { outline: 3px solid var(--yellow); }
.tv-rank i { font-style: normal; font-family: var(--font-title); font-size: 12px; color: var(--yellow); width: 22px; }
.tv-rank span { flex: 1; text-align: left; }
.tv-rank b { font-family: var(--font-title); font-size: 13px; color: var(--yellow); }
.tv-rank.teams { margin-bottom: 6px; }
.tv-res { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; }
.tv-res span { font-size: 18px; padding: 1px 8px; border-left: 5px solid var(--pc); background: var(--g3); }
.tv-res .ok { background: #1d4d32; } .tv-res .ko { background: #5a1e24; }
.tv-who { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.tv-who span { font-size: 21px; padding: 2px 10px; border-left: 6px solid var(--pc); background: var(--g3); }

/* Manette de l'hôte (mode téléphones) */
body.owner [data-act="leave"] { display: none; }
.opanel { display: flex; flex-direction: column; gap: 10px; max-width: 560px; width: 100%; margin: 0 auto; padding-bottom: 70px; }
.obox { background: rgba(0,0,0,.35); border: 3px solid #000; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.olbl, .orow > label { font-family: var(--font-title); font-size: 11px; color: var(--yellow); }
.ocode { font-family: var(--font-title); font-size: 34px; letter-spacing: 8px; text-align: center; color: var(--white); text-shadow: 3px 3px 0 #000; }
.ohint { font-size: 19px; color: var(--g1); text-align: center; }
.oshare { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.oshare button, .oshare a { background: var(--blue); color: var(--white); border: 3px solid #000; font-size: 20px; padding: 6px; text-align: center; text-decoration: none; font-family: var(--font-text); }
.oshare a { background: #25a35a; }
.oqr { display: flex; justify-content: center; }
.oqr img { image-rendering: pixelated; border: 4px solid #000; max-width: 70vw; }
.oplayers { display: flex; flex-direction: column; gap: 4px; }
.oplayer { display: flex; align-items: center; gap: 8px; background: var(--g3); border-left: 7px solid var(--pc); padding: 2px 8px; font-size: 22px; }
.oplayer span { flex: 1; }
.oteam { width: 26px; height: 26px; border: 3px solid #000; }
.ox { background: var(--red2); border: 3px solid #000; color: var(--white); font-size: 16px; padding: 0 8px; }
.orow { display: flex; flex-direction: column; gap: 4px; }
.oseg, .ochips { display: flex; flex-wrap: wrap; gap: 5px; }
.oseg button, .ochips button, .oadd { background: var(--navy); border: 3px solid #000; color: var(--white); font-size: 19px; padding: 4px 10px; font-family: var(--font-text); }
.oseg button.on, .ochips button.on { background: var(--blue); border-color: var(--yellow); }
.oseg button:disabled { opacity: .4; }
.oadd { align-self: flex-start; }
.obots { display: flex; flex-direction: column; gap: 5px; }
.obot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; border-left: 6px solid var(--pc); padding-left: 6px; }
.obot b { font-size: 20px; min-width: 110px; }
.opanel .big-btn.disabled { opacity: .5; }
#ownerbar { display: flex; gap: 6px; padding: 4px 8px; background: rgba(0,0,0,.45); }
#ownerbar:empty { display: none; }
#ownerbar button { flex: 1; background: var(--g3); border: 3px solid #000; color: var(--white); font-size: 18px; padding: 4px; font-family: var(--font-text); }

/* ======================= Chat ======================= */
/* Une petite bulle en haut à droite, accrochée sous le bouton 💬 du bandeau : les derniers messages et une ligne
 * pour écrire. ⤢ l'agrandit pour lire tout l'historique. Rien ne s'affiche plus en bas de l'écran. */
body.local-pad #chat, body.local-pad #chat-peek { display: none !important; }
.hud-btn.on { background: var(--pink); outline: 2px solid var(--yellow); }
#chat { position: fixed; z-index: 60; top: calc(var(--chat-top, 56px) + 12px); right: 8px; width: min(270px, calc(100vw - 16px)); display: flex; flex-direction: column;
  background: rgba(20,18,42,.97); border: 3px solid #000; border-top: 4px solid var(--pink); box-shadow: 4px 6px 0 rgba(0,0,0,.55);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.97); transform-origin: top right; transition: opacity .15s, transform .15s, visibility 0s .15s; }
#chat::before { content: ''; position: absolute; top: -15px; right: calc(var(--chat-tip, 24px) - 8px - 3px - 7px); border: 7px solid transparent; border-bottom: 10px solid var(--pink); border-top: 0; }
body.chat-open #chat { opacity: 1; visibility: visible; transform: none; transition: opacity .15s, transform .15s; }
.chat-head { display: flex; align-items: center; gap: 4px; padding: 3px 4px 1px 8px; }
.chat-head b { flex: 1; font-family: var(--font-title); font-size: 8px; color: var(--pink); font-weight: normal; }
.chat-head button { background: none; border: 0; color: var(--g1); font-size: 17px; line-height: 1; padding: 3px 6px; }
#chat-list { max-height: 3.6em; overflow-y: auto; padding: 2px 8px 6px; display: flex; flex-direction: column; gap: 4px; font-size: 18px; user-select: text; -webkit-user-select: text; scrollbar-width: none; }
.cmsg { display: flex; gap: 6px; align-items: flex-start; font-size: 21px; line-height: 1.1; }
.cmsg > div { background: var(--g3); border-left: 5px solid var(--pc); padding: 3px 8px; max-width: 85%; word-wrap: break-word; }
.cmsg b { display: block; font-size: 16px; color: var(--pc); }
.cmsg.mine { justify-content: flex-end; }
.cmsg.mine > div { background: var(--navy); border-left: 0; border-right: 5px solid var(--pc); }
.cmsg.pixou > div { background: var(--plum); border-left-color: var(--yellow); }
.cmsg.pixou b { color: var(--yellow); }
.cmsg img { width: 26px; height: 35px; flex: none; }
.cempty { color: var(--g1); font-size: 19px; text-align: center; margin-top: 20px; }
/* En petit : une ligne par message, « Nom texte », comme un fil de discussion. */
#chat-list .cmsg { font-size: 18px; line-height: .95; }
#chat-list .cmsg img { display: none; }
#chat-list .cmsg > div { background: none; border: 0; padding: 0; max-width: 100%; }
#chat-list .cmsg b { display: inline; font-size: inherit; font-weight: normal; margin-right: .3em; }
#chat-list .cmsg.mine { justify-content: flex-start; }
#chat-list .cmsg.mine > div span { color: var(--yellow); }
#chat-list .cmsg.pixou > div { background: var(--white); color: var(--ink); border: 2px solid #000; padding: 2px 5px; }
#chat-list .cmsg.pixou b { color: var(--plum); }
#chat-list .cempty { font-size: 17px; margin: 4px 0; }
.chat-emojis { display: none; gap: 4px; padding: 0 8px 6px; overflow-x: auto; scrollbar-width: none; }
.chat-emojis button, #chat-form [data-emo] { flex: none; font-size: 16px; background: var(--g3); border: 2px solid #000; padding: 1px 4px; }
#chat-form { display: flex; gap: 5px; padding: 0 8px 8px; }
#chat-in { flex: 1; font-family: var(--font-text); font-size: 18px; padding: 1px 6px; border: 2px solid #000; background: var(--white); color: var(--ink); user-select: text; -webkit-user-select: text; min-width: 0; }
#chat-form .ok { font-family: var(--font-title); font-size: 8px; background: var(--green); border: 2px solid #000; color: var(--white); padding: 0 6px; }
/* Agrandi (⤢) : plus large et plus haut, tout l'historique défile, tous les émojis. */
body.chat-big #chat { width: min(380px, calc(100vw - 16px)); }
body.chat-big #chat-list { max-height: min(46dvh, 420px); min-height: 8em; gap: 6px; }
body.chat-big #chat-list .cmsg img { display: block; width: 18px; height: 24px; }
body.chat-big .chat-emojis { display: flex; }
body.chat-big #chat-form [data-emo] { display: none; }
body.chat-big #chat-in { font-size: 21px; padding: 4px 8px; }
body.chat-big #chat-form .ok { font-size: 10px; padding: 0 10px; }
#chat-peek { position: fixed; right: 8px; top: calc(var(--chat-top, 56px) + 8px); max-width: min(300px, calc(100vw - 16px)); z-index: 55; pointer-events: none; opacity: 0; transform: translateY(-20px); transition: opacity .25s, transform .25s; }
#chat-peek.on { opacity: 1; transform: none; pointer-events: auto; }
#chat-peek .cmsg > div { box-shadow: 0 4px 0 #000; border: 2px solid #000; }

/* =========================================================================
 * Écran de jeu à distance (mode téléphones, une fois la partie lancée)
 * Tout tient sur un écran : #screen prend la hauteur restante et ses tailles
 * sont en em, calées sur --k que play.js réduit tant que ça déborde.
 * ========================================================================= */
body.remote { height: 100dvh; min-height: 0; overflow: hidden; }
body.remote #screen { font-size: calc(21px * var(--k, 1)); padding: .45em .6em .6em; min-height: 0; overflow-y: auto; scrollbar-width: none; }
body.remote #ownerbar { display: none !important; }
.local-pad [data-hud="chat"] { display: none; }

/* Bandeau du haut : moi, mon score, mes cartes, le chat et le menu de l'hôte */
body.remote #me { padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); gap: 8px; border-bottom-width: 3px; }
body.remote #me .av { width: 36px; height: 36px; }
body.remote .me-info b { font-size: 22px; }
body.remote .me-info small { font-size: 16px; }
body.remote .me-score { font-size: 15px; }
body.remote .me-score small { font-size: 14px; }
.hud-tools { display: flex; gap: 5px; margin-left: 2px; }
.hud-btn { position: relative; width: 40px; height: 40px; display: grid; place-items: center; font-size: 20px; background: var(--g3); border: 2px solid #000; box-shadow: 0 3px 0 #000; padding: 0; }
.hud-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #000; }
.hud-card:disabled { opacity: .35; filter: grayscale(1); box-shadow: none; }
.hud-card.on { background: var(--pink); animation: pulse 1s infinite; }
.hud-badge { position: absolute; top: -7px; right: -7px; background: var(--red2); color: var(--white); font-style: normal; font-size: 14px; line-height: 1; padding: 2px 4px; border: 2px solid #000; display: none; }
.hud-badge.on { display: block; }

/* Scores : chaque joueur avec son état sur la question en cours */
body.remote #scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); overflow: hidden; gap: 3px; padding: 4px 6px; }
body.remote #scores span { display: flex; align-items: center; gap: 3px; min-width: 0; font-size: 16px; line-height: 1.15; padding: 0 5px; transition: background .25s; }
#scores span i { font-style: normal; flex: none; min-width: 1em; text-align: center; color: var(--g1); }
#scores span em { font-style: normal; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.hud.gel-on #screen { padding-bottom: 84px; }
#scores .st-think i { animation: blink 1.2s steps(2) infinite; }
#scores [class*='st-'] i { color: inherit; }
#scores .st-done { background: #234a5a; }
#scores .st-turn { background: var(--navy); outline: 2px solid var(--pc); }
#scores .st-buzz { background: var(--orange); color: var(--ink); animation: pulse .6s infinite; }
#scores .st-buzz b { color: var(--ink); }
#scores .st-ice { background: #2b6c8a; }
#scores .st-good { background: #1d4d32; }
#scores .st-bad { background: #5a1e24; }
#scores .off { opacity: .45; }
#scores .team-chip { background: var(--pc); color: var(--ink); font-weight: bold; }
#scores .team-chip b { color: var(--ink); }

/* Pixou passe par-dessus mon bandeau, puis s'efface (rien ne bouge en dessous) */
body.remote #pixou-say { position: fixed; left: 0; right: 0; z-index: 45; min-height: 55px; border-bottom: 3px solid var(--yellow); box-shadow: 0 4px 0 rgba(0,0,0,.5); font-size: 18px; transition: opacity .3s, transform .3s; max-height: 64px; overflow: hidden; padding-top: max(4px, env(safe-area-inset-top)); }
body.remote #pixou-say.gone { opacity: 0; transform: translateY(-8px); pointer-events: none; }

/* Gel : une seule grosse pastille, au moment où il peut servir */
body.hud #cards { position: fixed; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40; padding: 0; }
.card-btn.gel-now { background: var(--sky); color: var(--ink); padding: 8px 16px; font-size: 22px; box-shadow: 0 4px 0 #000, 0 0 24px rgba(115,239,247,.7); animation: pulse .8s infinite; white-space: nowrap; }
.card-btn.gel-now span { font-size: 22px; }

/* Pause */
#pause:empty { display: none; }
.r-pause { position: fixed; inset: 0; z-index: 70; background: rgba(10,10,20,.82); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 20px; }
.r-pause b { font-family: var(--font-title); font-size: 26px; color: var(--yellow); text-shadow: 3px 3px 0 #000; animation: blink 1.6s steps(2) infinite; }
.r-pause span { font-size: 24px; color: var(--g1); }
.m-menu { display: grid; gap: 8px; }
.m-menu .small-btn { margin: 0; font-size: 22px; padding: 10px; background: var(--navy); }

/* Mise en page commune des écrans de jeu */
body.remote .ptimer { height: .5em; margin-bottom: .4em; border-width: 2px; }
#ptimer-fill { transition: background .3s; }
.r-wrap { display: flex; flex-direction: column; gap: .4em; flex: 1; min-height: 0; animation: rIn .25s ease-out; }
/* Fondus sans déplacement : un décalage compterait dans la hauteur mesurée par fit(). */
@keyframes rIn { from { opacity: 0; } to { opacity: 1; } }
.r-head { display: flex; justify-content: space-between; align-items: center; gap: .5em; font-size: .85em; line-height: 1; }
.r-cat { color: var(--cyan); background: var(--plum); border: 2px solid #000; padding: .15em .45em; }
.r-cat i { font-style: normal; color: var(--yellow); }
.r-round { color: var(--g1); white-space: nowrap; }
.r-tag { font-size: .85em; color: var(--yellow); background: rgba(255,205,117,.12); border-left: 4px solid var(--yellow); padding: .1em .5em; }
.r-text { font-size: 1.3em; line-height: 1.08; background: rgba(0,0,0,.38); border: 3px solid #000; padding: .35em .5em; }
.r-text.m { font-size: 1.18em; } .r-text.l { font-size: 1.06em; } .r-text.xl { font-size: .95em; }
.r-text.small { font-size: .95em; color: var(--g1); padding: .25em .45em; }
/* Indices du Duel : gros et contrastés, le dernier tombé en jaune */
.r-clues { margin: 0; padding-left: 1.4em; font-size: 1.15em; color: var(--white); line-height: 1.05; display: flex; flex-direction: column; gap: .15em; }
.r-clues li:last-child { font-size: 1.15em; color: var(--ink); background: var(--yellow); padding: .1em .3em; margin-left: -.3em; }
.r-q4 { display: flex; align-items: center; gap: .5em; font-size: .95em; border-left: 6px solid var(--pc); background: var(--g3); padding: .15em .5em; }
.r-q4 b { color: var(--pc); }
.r-q4 small { margin-left: auto; color: var(--g1); font-size: .8em; }
.r-meter { display: flex; gap: .2em; }
.r-meter i { font-style: normal; font-family: var(--font-title); font-size: .55em; width: 2em; height: 2em; display: grid; place-items: center; background: var(--ink); border: 2px solid #000; color: var(--g2); }
.r-meter i.on { background: var(--yellow); color: var(--ink); animation: popIn .3s; }

/* Choix : grands boutons, ma réponse encadrée, la bonne en vert, qui a répondu quoi */
.r-choices { display: flex; flex-direction: column; gap: .4em; flex: 1; min-height: 0; max-height: 17em; }
.r-choices.grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
.rc { position: relative; flex: 1; min-height: 2.3em; display: flex; align-items: center; gap: .45em; border: 3px solid #000; color: var(--white); font-size: 1.12em; text-align: left; padding: .25em .5em; line-height: 1;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.28), inset 3px 3px 0 rgba(255,255,255,.14), 0 4px 0 #000; transition: transform .08s, opacity .25s, filter .25s, background .25s; }
.rc:active { transform: translateY(3px); box-shadow: 0 1px 0 #000; }
.r-choices.grid .rc { flex-direction: column; justify-content: center; text-align: center; gap: .2em; }
.rc.c0 { background: var(--red); } .rc.c1 { background: var(--blue); } .rc.c2 { background: #b8860b; } .rc.c3 { background: var(--teal); }
.r-choices.n2 .rc.c0 { background: var(--green); } .r-choices.n2 .rc.c1 { background: var(--red); }
.rc .letter { font-family: var(--font-title); font-size: .55em; flex: none; width: 2.2em; height: 2.2em; display: grid; place-items: center; background: rgba(0,0,0,.35); border: 2px solid rgba(0,0,0,.6); }
.rc .ctext { overflow-wrap: anywhere; }
.rc.picked { outline: 4px solid var(--yellow); outline-offset: -4px; }
.r-choices.ro .rc { pointer-events: none; box-shadow: inset -3px -3px 0 rgba(0,0,0,.28), 0 2px 0 #000; }
.r-choices.live-done .rc:not(.picked) { opacity: .45; }
.r-choices.shown .rc.bad { opacity: .38; filter: saturate(.4); }
.r-choices.shown .rc.bad.picked { opacity: .8; }
.r-choices.shown .rc.good { background: var(--green); opacity: 1; animation: popIn .35s; }
.r-choices.shown .rc.good::after { content: '✔'; position: absolute; right: .35em; top: .2em; font-size: .9em; }
.rc .who { display: flex; flex-wrap: wrap; gap: .2em; margin-left: auto; justify-content: flex-end; }
.r-choices.grid .rc .who { margin: 0; justify-content: center; }
.rc .who i { font-style: normal; font-size: .62em; line-height: 1.1; background: rgba(0,0,0,.55); border-left: 4px solid var(--pc); padding: 0 .3em; }

/* Ce que font les autres */
.r-status { display: flex; flex-wrap: wrap; gap: .3em; justify-content: center; }
.r-status:empty { display: none; }
.r-st { font-size: .85em; padding: .05em .5em; background: var(--g3); border-left: 5px solid var(--pc, var(--g2)); animation: rIn .25s; }
.r-st.bad { background: #5a1e24; }
.r-st.buzz { background: var(--orange); color: var(--ink); animation: pulse .7s infinite; }
.r-lock { text-align: center; font-size: 1em; color: var(--yellow); }

/* Révélation */
.r-me { font-family: var(--font-title); font-size: .9em; line-height: 1.3; text-align: center; padding: .45em; border: 3px solid #000; text-shadow: 2px 2px 0 #000; animation: popIn .35s; }
.r-me.good { background: var(--green); } .r-me.bad { background: var(--red2); }
.r-me b { color: var(--yellow); }
.r-answer { font-size: 1.3em; text-align: center; background: var(--green); border: 3px solid #000; padding: .15em .5em; animation: popIn .35s; }
.r-guess { text-align: center; font-size: 1em; }
.r-guess b { color: var(--yellow); }
.r-res { display: flex; flex-wrap: wrap; gap: .3em; justify-content: center; }
.r-res span { font-size: .88em; padding: .05em .5em; border-left: 5px solid var(--pc); background: var(--g3); }
.r-res .ok { background: #1d4d32; } .r-res .ko { background: #5a1e24; }
.r-res .me, .r-ranks .me { outline: 2px solid var(--yellow); }
.r-res q { color: var(--yellow); }
.r-res b { color: var(--yellow); }
.r-ranks { display: flex; flex-direction: column; gap: .2em; }
.r-ranks div { display: flex; align-items: center; gap: .5em; font-size: .95em; padding: .05em .5em; background: var(--g3); border-left: 6px solid var(--pc); animation: rIn .3s backwards; }
.r-ranks div.ok { background: #1d4d32; }
.r-ranks i { font-style: normal; font-family: var(--font-title); font-size: .55em; color: var(--yellow); width: 1.6em; }
.r-ranks span { flex: 1; }
.r-ranks em { font-style: normal; color: var(--g1); }
.r-ranks b { font-family: var(--font-title); font-size: .6em; color: var(--yellow); min-width: 4.5em; text-align: right; }
.r-anec { font-size: .85em; line-height: 1.15; color: var(--g1); text-align: center; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.r-wrap.result.good { background: radial-gradient(circle at 50% 0, rgba(56,183,100,.25), transparent 60%); }
.r-wrap.result.bad { background: radial-gradient(circle at 50% 0, rgba(228,59,68,.22), transparent 60%); }

/* Écrans d'attente, intro de manche, classement, fin */
.r-waitwrap, .r-intro, .r-end { justify-content: center; align-items: stretch; text-align: center; }
.r-num { font-family: var(--font-title); font-size: .55em; color: var(--g1); }
.r-icon { font-size: 2.6em; line-height: 1; animation: bob 1.6s infinite; }
.r-title { font-family: var(--font-title); font-size: .85em; line-height: 1.4; color: var(--yellow); text-shadow: 2px 2px 0 #000; }
.r-msg { font-size: 1.15em; }
.r-rules { text-align: left; margin: 0; padding: .5em .6em .5em 1.6em; font-size: .98em; line-height: 1.1; background: rgba(0,0,0,.3); border: 3px solid #000; display: flex; flex-direction: column; gap: .3em; }
.r-skip { align-self: center; margin-top: .2em; font-size: .95em; }
.r-rank .tv-rank div { font-size: 1em; }
.r-rank .tv-rank i, .r-rank .tv-rank b { font-size: .55em; }
.r-end .end-rank { font-size: 1.4em; }
.r-end .wtitle { font-size: .75em; }
.r-end .wmsg { font-size: 1em; }
.r-board { max-width: 22em; width: 100%; margin: 0 auto; }
.r-board button { font-size: 1.3em; }
.r-board button.cur { background: var(--yellow); color: var(--ink); animation: popIn .4s; }
.pthemes.ro { flex: none; overflow: visible; }
.pthemes.ro button { pointer-events: none; font-size: 1.3em; }
.pthemes.ro button span { font-size: .6em; }
body.remote .pthemes button small { font-size: .55em; }

/* Mes écrans de choix et de saisie, à l'échelle de l'écran */
body.remote .pq { gap: .45em; }
body.remote .pq-text { font-size: 1.2em; padding: .35em .5em; }
body.remote .pq-cat { font-size: .6em; }
body.remote .you-buzzed { font-size: .7em; padding: .5em; }
body.remote .pboard button { font-size: 1.3em; }
body.remote .pthemes { flex: 1; overflow: visible; }
body.remote .pthemes button { font-size: 1.4em; }
body.remote .pthemes button span { font-size: .55em; }
body.remote .plist button { font-size: 1.3em; padding: .4em; }
body.remote .ptext { gap: .4em; }
body.remote .ptext input, body.remote .pr-big input { font-size: 1.5em; padding: .25em .4em; }
body.remote .ptext .big-btn, body.remote .prange .big-btn { font-size: .7em; padding: .8em; }
body.remote .hint { font-size: .85em; }
body.remote .picked-txt { font-size: 1.2em; align-self: center; }
body.remote .buzz-wrap { gap: .4em; min-height: 0; }
body.remote .buzzer { width: min(58vw, 30vh, 13em); height: min(58vw, 30vh, 13em); font-size: 1.35em; border-width: 6px; }
body.remote .buzz-sub { font-size: .9em; min-height: 0; }
body.remote .buzz-wrap.other { margin: 0; padding: .3em; }

/* Ordinateur ou tablette : une colonne centrée, plus confortable à lire */
@media (min-width: 820px) {
  body.remote { align-items: center; }
  body.remote > #me, body.remote > #scores, body.remote > #screen { width: min(100%, 780px); }
  body.remote #scores { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  body.remote #scores span { font-size: 19px; }
  body.remote #me .av { width: 44px; height: 44px; }
  body.remote .me-info b { font-size: 26px; }
  body.remote .me-score { font-size: 18px; }
  body.remote .hud-btn { width: 46px; height: 46px; font-size: 22px; }
  body.remote #pixou-say { left: 50%; right: auto; width: min(96vw, 760px); transform: translateX(-50%); }
  body.remote #pixou-say.gone { transform: translate(-50%, -8px); }
}
@media (prefers-reduced-motion: reduce) {
  .r-wrap, .rc, .r-st, .r-me, .r-answer, .hud-card.on, .card-btn.gel-now, .r-icon { animation: none !important; transition: none !important; }
}

/* Salon de l'hôte : l'essentiel d'abord, les réglages repliés, « Lancer » toujours à portée de pouce */
.omore summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; list-style: none; }
.omore summary::-webkit-details-marker { display: none; }
.omore summary::after { content: '▾'; color: var(--yellow); font-size: 22px; transition: transform .2s; }
.omore[open] summary::after { transform: rotate(180deg); }
.omore summary small { flex: 1; text-align: right; color: var(--g1); font-size: 18px; }
.omore[open] summary { margin-bottom: 4px; }
.omore .small-btn { margin-top: 4px; align-self: center; }
.ostart { position: sticky; bottom: 0; margin: 0 -12px -12px; padding: 10px 12px max(12px, env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--ink) 70%, rgba(26,28,44,0)); display: flex; flex-direction: column; align-items: stretch; gap: 4px; z-index: 5; }
.ostart .big-btn { font-size: 16px; padding: 16px; }
.ostart small { text-align: center; color: var(--g1); font-size: 18px; }
body.owner .opanel { padding-bottom: 0; }

/* Barème sous le buzzer : 3 valeurs colorées */
.bz-pts { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; color: var(--white); }
.bz-pts > span { white-space: nowrap; }
.buzz-wrap .bz-pts { margin-top: 24px; } /* sous l'ombre et la pulsation du buzzer */
body.remote .buzz-wrap .bz-pts { margin-top: .9em; }
.bz-pts b { font-family: var(--font-title); font-size: .85em; font-weight: normal; margin-right: .25em; }
.bz-pts .plus { color: var(--lime, #a7f070); } .bz-pts .minus { color: #f4b0b8; } .bz-pts .sec { color: var(--sky); }

/* =========================================================================
 * Écran à distance : le mini-plateau (barre du haut, studio, podiums, projecteur)
 * ========================================================================= */
#studio:empty { display: none; }
body.remote #pixou-say { display: none; }
body.remote #me { padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); border-bottom: 3px solid #000; background: var(--ink); }
.r-top { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-family: var(--font-title); font-size: 9px; white-space: nowrap; overflow: hidden; }
.r-mode { color: var(--sky); overflow: hidden; text-overflow: ellipsis; }
.r-man { color: var(--g1); flex: none; }
.r-qn { color: var(--white); margin-left: auto; flex: none; }
.r-segs { display: flex; gap: 3px; margin-left: auto; flex: none; }
.r-segs i { width: 8px; height: 6px; background: var(--g3); }
.r-segs i.on { background: var(--g1); } .r-segs i.cur { background: var(--yellow); }
body.remote .hud-btn { width: 34px; height: 32px; font-size: 16px; }

#studio { position: relative; flex: none; height: clamp(190px, 32vh, 290px); overflow: hidden; border-bottom: 3px solid #000;
  background: linear-gradient(to bottom, #20163a 0, #2a1f4a 55%, #14102a 100%); }
#studio .st-bg { position: absolute; inset: 0 0 30% 0; opacity: .25;
  background-image: linear-gradient(45deg, #3b2a63 25%, transparent 25%, transparent 75%, #3b2a63 75%), linear-gradient(45deg, #3b2a63 25%, transparent 25%, transparent 75%, #3b2a63 75%);
  background-size: 24px 24px; background-position: 0 0, 12px 12px; }
#studio .curtain { position: absolute; top: 0; bottom: 0; width: 22px; z-index: 1; background: repeating-linear-gradient(to right, #8a1f35 0 8px, #b13e53 8px 13px, #6d1a2c 13px 18px); box-shadow: inset -4px 0 0 rgba(0,0,0,.3); }
#studio .curtain.l { left: 0; } #studio .curtain.r { right: 0; transform: scaleX(-1); }
#studio .floor { position: absolute; left: 0; right: 0; bottom: 0; height: 34%; background: repeating-linear-gradient(90deg, #1d2b53 0 40px, #24346a 40px 80px); }
#studio .spot { position: absolute; top: -10px; bottom: 0; width: 120px; background: linear-gradient(to bottom, rgba(255,236,170,.2), rgba(255,236,170,0) 85%); clip-path: polygon(45% 0, 55% 0, 100% 100%, 0 100%); mix-blend-mode: screen; animation: sweep 8s ease-in-out infinite; transform-origin: top center; }
#studio .spot.s1 { left: 8%; } #studio .spot.s2 { right: 8%; animation-direction: reverse; animation-duration: 10s; }
@keyframes sweep { 0%, 100% { transform: rotate(-12deg); } 50% { transform: rotate(12deg); } }
#studio .shade { position: absolute; inset: 0; z-index: 4; background: rgba(8,6,18,.55); animation: fadeIn .2s; }
#studio .beam { position: absolute; z-index: 5; top: 0; bottom: 0; width: 120px; transform: translateX(-50%); pointer-events: none; transition: left .2s;
  background: linear-gradient(to bottom, rgba(255,236,170,.08), rgba(255,236,170,.42)); clip-path: polygon(42% 0, 58% 0, 100% 100%, 0 100%); }
@keyframes fadeIn { from { opacity: 0; } }
#studio .disc { display: none; }
/* Bombe : le plateau s'éteint, un seul faisceau franc sur celui qui la tient. */
#studio.bomb .shade { background: rgba(4,3,10,.84); }
#studio.bomb .beam { z-index: 5; width: 150px; background: linear-gradient(to bottom, rgba(255,240,190,.18), rgba(255,240,190,.62)); clip-path: polygon(44% 0, 56% 0, 100% 100%, 0 100%); }
#studio.bomb .disc { display: block; position: absolute; z-index: 5; bottom: 0; width: 130px; height: 26px; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(rgba(255,240,190,.7), rgba(255,240,190,0) 70%); pointer-events: none; transition: left .2s; }
#studio.bomb .host { filter: brightness(.28) saturate(.3); z-index: 3; }
#studio.bomb .curtain { filter: brightness(.35); }
#studio.bomb .bubble { z-index: 6; filter: brightness(.8); }
#studio.bomb .pod.off { filter: brightness(.16) saturate(0); }
#studio.bomb .pod.lit { z-index: 1; filter: drop-shadow(0 0 6px rgba(255,240,190,.75)); }
#studio.bomb .pod.lit img { transform: scale(1.25); transform-origin: bottom center; }
#studio.bomb .pod.lit .st.ko { animation: pulse .6s infinite; }
#studio .host { position: absolute; z-index: 6; left: 26px; bottom: calc(34% + 2px); height: min(102px, 38%); width: auto; }
#studio .bubble { position: absolute; z-index: 6; left: calc(26px + min(102px, 38%) * .77 + 10px); right: 30px; top: 10px; max-height: 50%; overflow: hidden;
  background: var(--white); color: var(--ink); border: 3px solid var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.45); padding: 6px 10px; font-size: 21px; line-height: 1; animation: popIn .3s; }
#studio .bubble b { display: block; font-family: var(--font-title); font-size: 8px; color: var(--plum); font-weight: normal; margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#studio .pods { position: absolute; z-index: 5; left: 24px; right: 24px; bottom: 4px; display: flex; gap: 2px; align-items: flex-end; }
#studio .pod { position: relative; flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; transition: filter .2s; }
#studio .pod img { width: 36px; height: 36px; margin-bottom: -2px; }
#studio .pods.many .pod img { width: 27px; height: 27px; }
#studio .pod .base { width: 100%; max-width: 64px; background: #262b44; border: 3px solid var(--ink); border-top: 4px solid var(--c); text-align: center; padding: 2px 1px 3px; }
#studio .pod .n { font-size: 15px; line-height: 1; color: var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#studio .pod .s.stars { font-family: system-ui, sans-serif; font-size: 15px; line-height: 1; margin-top: 1px; color: #3a4466; }
#studio .pod .s.stars i { font-style: normal; text-shadow: 1px 1px 0 #000; }
#studio .pod .s.stars i.on { color: var(--yellow); animation: popIn .3s; }
#studio .pod .s { font-family: var(--font-title); font-size: 7px; color: var(--white); margin-top: 2px; white-space: nowrap; }
#studio .pod .st { position: absolute; top: -6px; right: 0; z-index: 2; font-family: var(--font-title); font-size: 8px; line-height: 1; padding: 3px; background: var(--g3); border: 2px solid var(--ink); color: var(--white); }
#studio .pod .st.ok { background: var(--green); } #studio .pod .st.ko { background: var(--red2); } #studio .pod .st.bz { background: var(--orange); color: var(--ink); animation: pulse .6s infinite; } #studio .pod .st.gel { background: var(--sky); color: var(--ink); }
#studio .pod.me .base { outline: 3px solid var(--yellow); }
#studio .pod.me .n { color: var(--yellow); }
#studio .pod.off { filter: brightness(.32) saturate(.3); }
#studio .pod.lit .base { background: #3b3550; }
#studio .pod.away { opacity: .45; }
#studio .pod .gain { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); z-index: 2; font-family: var(--font-title); font-size: 8px; color: var(--lime); text-shadow: 2px 2px 0 #000; white-space: nowrap; }
#studio .pod .gain.neg { color: var(--red2); }
#studio .pmsg { position: absolute; z-index: 7; bottom: 100%; left: 0; margin-bottom: 6px; max-width: 160px; background: var(--white); color: var(--ink); border: 2px solid #000; font-size: 16px; line-height: .95; padding: 3px 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 3px 0 rgba(0,0,0,.5); animation: popIn .25s; }
#studio .pmsg.r { left: auto; right: 0; }

/* La manette sous le studio */
body.remote .r-text { background: var(--white); color: var(--ink); border-color: var(--ink); box-shadow: 0 4px 0 rgba(0,0,0,.5); }
body.remote .r-text.small { color: var(--g3); }
.r-turn { font-family: var(--font-title); font-size: .62em; text-align: center; padding: .7em .5em; border: 3px solid var(--ink); background: var(--pc); color: #fff; text-shadow: 2px 2px 0 #000; box-shadow: 0 4px 0 #000; display: flex; align-items: center; justify-content: center; gap: .8em; flex: none; }
.r-turn.me { background: var(--yellow); color: var(--ink); text-shadow: none; }
.r-turn .r-meter { display: flex; gap: 3px; }
.r-turn .r-meter i { width: .9em; height: .9em; background: rgba(0,0,0,.35); border: 2px solid rgba(0,0,0,.6); }
.r-turn .r-meter i.on { background: var(--lime); }
.r-bomb { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4em; }
.r-bomb img { width: min(6.5em, 26vh); height: auto; animation: pulse 1s infinite; }
.r-bomb.boom img { animation: none; }
.r-plate { font-family: var(--font-title); font-size: .7em; line-height: 1.5; text-align: center; color: #fff; background: var(--pc); border: 4px solid #000; padding: .5em .8em; text-shadow: 2px 2px 0 #000; box-shadow: 0 5px 0 #000; }
.r-boom { font-family: var(--font-title); font-size: 1.4em; color: var(--yellow); text-shadow: 4px 4px 0 var(--red2), 7px 7px 0 #000; }
/* Quelqu'un a buzzé : son nom reste écrit sur le buzzer */
.buzzer.other span { display: flex; flex-direction: column; align-items: center; gap: .4em; font-family: var(--font-title); }
.buzzer.other small { font-size: .45em; color: var(--white); text-shadow: 2px 2px 0 #000; }
.buzzer.other b { font-weight: normal; font-size: .5em; line-height: 1.5; color: #fff; background: var(--oc); border: 3px solid #000; padding: .4em .6em; text-shadow: 2px 2px 0 #000; }
.buzz-wrap.other .buzzer { box-shadow: 0 14px 0 #222, 0 18px 0 #000, 0 0 0 8px var(--oc); }
body.remote .buzz-wrap.other { background: none; }

/* Le chat : bulles sur les podiums quand il est fermé. Ouvert, ses messages sont dans la bulle du chat,
 * et Pixou descend sa bulle juste au-dessus des podiums pour ne pas passer dessous. */
body.remote #chat-peek { display: none; }
body.chat-open #studio .pmsg { display: none; }
body.chat-open #studio .bubble { top: auto; bottom: 76px; font-size: 18px; padding: 3px 8px; max-height: calc(2em + 10px); animation: none; }
body.chat-open #studio .bubble b { display: none; }
@media (min-width: 820px) {
  body.remote > #studio { width: min(100%, 780px); }
}
@media (prefers-reduced-motion: reduce) {
  #studio .spot, #studio .bubble, #studio .pmsg, #studio .gain, .r-bomb img, #studio .pod .st.bz { animation: none !important; }
}
body.remote .buzz-wrap.other .buzz-sub { display: none; }
#studio .bubble { max-height: 64%; }
body.remote .hud-tools { gap: 3px; }
body.remote .hud-btn { width: 30px; height: 30px; font-size: 15px; box-shadow: 0 2px 0 #000; }
/* Buzzer : texte bien au centre du bouton */
.buzzer { display: grid; place-items: center; padding: 0; text-align: center; line-height: 1; }
.buzzer > span { display: block; }

/* Catégorie : étiquette prune collée au-dessus de la carte de la question */
.r-qcat { align-self: flex-start; max-width: 100%; display: flex; align-items: baseline; gap: .4em; margin-bottom: -.4em; position: relative; z-index: 1;
  background: var(--plum); color: var(--white); border: 3px solid var(--ink); border-bottom: 0; padding: .15em .6em .2em; font-size: .95em; line-height: 1; }
.r-qcat span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-qcat i { font-style: normal; color: var(--yellow); font-size: .85em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Écran à distance : la page occupe tout l'écran, sans pouvoir glisser (iPhone en écran d'accueil),
   et rien ne passe sous la barre d'état ni sous la barre d'accueil. */
body.remote { position: fixed; inset: 0; height: auto; }
.m-diag { margin-top: 8px; font-size: 14px; color: var(--g2, #94b0c2); text-align: center; opacity: .7; }
body.remote #me { padding-top: calc(env(safe-area-inset-top) + 8px); }
body.remote #screen { padding-bottom: max(.6em, env(safe-area-inset-bottom)); }
