/* Build Squad : complète le style de Build Duel */

/* Joueurs encore debout de chaque équipe, à côté du score */
.alive { display: flex; gap: 4px; max-width: none !important; }
.alive i { width: 10px; height: 16px; background: currentColor; }
.alive i.down { background: transparent; box-shadow: inset 0 0 0 2px currentColor; opacity: .5; }

/* Barre des emplacements : 1, 2, 3, blocs, grenade */
.slots { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; gap: 4px; }
.slots div { min-width: 64px; padding: 6px 10px 7px; background: rgba(18, 15, 46, .72); color: var(--lilac); font: 500 14px/1.15 var(--display); text-align: center; }
.slots div kbd { display: block; margin: 0 auto 3px; width: max-content; font: 600 13px var(--display); background: var(--haze); padding: 0 6px; color: var(--chalk); }
.slots div.on { background: rgba(255, 138, 61, .9); color: #2a1100; }
.slots div.on kbd { background: #2a1100; color: var(--orange); }
.slots div.off { opacity: .4; }
@media (max-width: 900px) { .slots { display: none; } }

/* Lunette du sniper : tout est masqué sauf un disque */
.scope { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at center, transparent 0, transparent 32vmin, #05040f 32.3vmin); }
.scope::before, .scope::after { content: ""; position: absolute; background: #05040f; }
.scope::before { left: 50%; top: 18vh; bottom: 18vh; width: 2px; transform: translateX(-50%); }
.scope::after { top: 50%; left: 18vw; right: 18vw; height: 2px; transform: translateY(-50%); }
.scope[hidden] { display: none; }
body.scoped .crosshair { display: none; }

/* Mort : on regarde un coéquipier en attendant la manche suivante */
.dead-box { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); background: rgba(18, 15, 46, .85); padding: 10px 18px; font: 600 18px var(--display); color: var(--chalk); text-align: center; }
.dead-box[hidden] { display: none; }

/* Éclair blanc d'une explosion toute proche */
.flash-overlay { position: absolute; inset: 0; background: #fff6d8; opacity: 0; pointer-events: none; }
.flash-overlay.on { opacity: .55; transition: none; }
.flash-overlay.off { transition: opacity .35s steps(4, end); opacity: 0; }

/* Choix des armes */
.panel.wide { width: min(640px, 100%); }
.panel .small { font-size: 14px; margin: 0; text-align: center; }
.loadout .panel > p { margin: 4px 0 0; font: 500 16px var(--display); }
.picks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pick { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; border: 0; background: var(--night); color: var(--chalk); cursor: pointer; text-align: left; box-shadow: inset 0 0 0 2px var(--haze); }
.pick b { font: 700 18px var(--display); }
.pick span { font: 14px/1.35 var(--body); color: var(--lilac); }
.pick:hover { background: #1c1840; }
.pick.on { box-shadow: inset 0 0 0 3px var(--orange); background: #2a1f3f; }
.pick:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
@media (max-width: 560px) { .picks { grid-template-columns: 1fr; } }

/* Équipes dans le tableau des scores */
.board tr.team-head td, .end-board tr.team-head td { color: var(--team); font-weight: 700; text-align: left; padding-top: 14px; border-bottom-color: var(--team); }
.board tr.dead td.who, .end-board tr.dead td.who { opacity: .55; }

/* Jauges des armes : libellé, 10 segments, valeur exacte */
.gauge { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 8px; width: 100%; font: 500 13px var(--display); color: var(--lilac); }
.gauge i { display: flex; gap: 2px; }
.gauge i b, .gauge i u { flex: 1; height: 8px; background: var(--signal); }
.gauge i u { background: rgba(243, 239, 255, .12); }
.gauge em { font-style: normal; color: var(--chalk); min-width: 4.5ch; text-align: right; }
.pick { gap: 6px; }
.pick span { margin-bottom: 4px; }
.picks.two { grid-template-columns: repeat(2, 1fr); }

/* Réarmement des armes lentes : petite barre sous le viseur */
.cooldown { position: absolute; left: 50%; top: calc(50% + 24px); transform: translateX(-50%); width: 64px; height: 6px; background: rgba(0,0,0,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.6); }
.cooldown[hidden] { display: none; }
.cooldown i { display: block; height: 100%; width: 0; background: var(--signal); }
.crosshair.cooling i { opacity: .35; }

/* Éblouissement de la grenade flash */
.blind-overlay { position: absolute; inset: 0; background: #ffffff; opacity: 0; pointer-events: none; }

/* Danse : vue à la troisième personne, sans viseur */
body.dancing .crosshair, body.dancing .cooldown { display: none; }

/* Choix des armes, version compacte : tout tient à l'écran sans défiler */
.loadout .panel.wide { width: min(780px, 100%); gap: 8px; padding: 18px 20px; }
.loadout .panel h2 { font-size: 28px; }
.loadout .panel > p { margin: 2px 0 0; font-size: 14px; }
.loadout .picks { gap: 6px; }
.loadout .pick { gap: 3px; padding: 9px 10px; }
.loadout .pick b { font-size: 16px; display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.loadout .pick b small { font: 600 11px var(--display); padding: 1px 5px; background: var(--haze); color: var(--chalk); }
.loadout .gauge { grid-template-columns: 58px 1fr 5.2em; gap: 6px; font-size: 12px; }
.loadout .gauge i b, .loadout .gauge i u { height: 6px; }
.loadout .picks.two .pick { flex-direction: row; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.loadout .picks.two .pick span { font-size: 13px; margin: 0; }
.loadout .btn.primary { min-height: 44px; }
.loadout .panel .small { font-size: 13px; }
.board tr.team-head .team-score, .end-board tr.team-head .team-score { margin-left: 12px; padding: 0 7px; background: var(--team); color: #120f2e; }

/* Vote de la carte */
.vote .panel.wide { width: min(720px, 100%); gap: 12px; }
.vote .panel h2 { font-size: 28px; }
.maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.map-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 10px; border: 0; background: var(--night); color: var(--chalk); cursor: pointer; text-align: left; box-shadow: inset 0 0 0 2px var(--haze); }
.map-card img { width: 100%; height: auto; image-rendering: pixelated; display: block; }
.map-card b { font: 700 18px var(--display); }
.map-card span { font: 14px/1.35 var(--body); color: var(--lilac); }
.map-card:hover { background: #1c1840; }
.map-card.on { box-shadow: inset 0 0 0 3px var(--orange); background: #2a1f3f; }
.map-card:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.voters { display: flex; align-items: center; gap: 4px; min-height: 16px; font-style: normal; }
.voters u { width: 10px; height: 14px; background: var(--team); }
.voters em { font: 600 14px var(--display); font-style: normal; color: var(--chalk); margin-left: 4px; }

/* Icônes en pixels : toujours nettes, quelle que soit leur taille */
.px-icon { image-rendering: pixelated; shape-rendering: crispEdges; display: block; }

/* Build Duel : carte de classe = portrait, nom, emplacements 1 / 2 / E, blocs */
.class-card { align-items: center; gap: 8px; padding: 14px 10px 12px; }
.class-card > b { font: 700 19px var(--display); }
.cls-slots { display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 6px; width: 100%; }
.cls-slot { position: relative; height: 56px; display: grid; place-items: center; background: rgba(243, 239, 255, .06); box-shadow: inset 0 0 0 2px var(--haze); }
.cls-slot .px-icon { height: 28px; width: auto; max-width: 86%; }
.cls-slot.wide .px-icon { height: 32px; }
.cls-slot kbd { position: absolute; top: 3px; left: 3px; font: 600 11px/15px var(--display); background: var(--haze); color: var(--chalk); padding: 0 4px; }
.cls-slot .count { position: absolute; bottom: 1px; right: 4px; font: 600 13px var(--display); color: var(--signal); }
.cls-slot.empty { opacity: .35; }
.cls-blocks { display: flex; align-items: center; gap: 6px; font: 600 15px var(--display); color: var(--lilac); }
.cls-blocks .px-icon { height: 16px; width: auto; }

/* Build Squad : cartes d'armes avec leur icône */
.weapon-card .weapon-icon { height: 34px; display: flex; align-items: center; margin: 2px 0 4px; }
.weapon-card .weapon-icon .px-icon { height: 30px; width: auto; max-width: 100%; }
.nade-card { flex-direction: row !important; align-items: center !important; gap: 12px !important; }
.nade-card .px-icon { height: 30px; width: auto; }

/* Barre des emplacements : une icône par touche */
.slots div { display: grid; justify-items: center; align-content: start; gap: 3px; min-width: 58px; position: relative; }
.slots div .px-icon { height: 20px; width: auto; max-width: 70px; }
.slots div em { position: absolute; right: 4px; bottom: 2px; font: 600 12px var(--display); font-style: normal; color: var(--signal); }
.slots div i.none { display: block; height: 18px; }

/* Fil des éliminations : l'icône de l'arme entre les deux noms */
.feed .feed-weapon { display: inline-block; vertical-align: middle; margin: 0 4px; }
.feed .feed-weapon .px-icon { height: 14px; width: auto; }

/* Vote à 5 cartes (Build Duel) : vignettes plus petites, tout tient à l'écran */
body[data-mode="duel"] .vote .panel.wide { width: min(980px, 100%); }
body[data-mode="duel"] .maps { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
body[data-mode="duel"] .map-card span { font-size: 13px; }

/* Pixel Fall : pas de points de vie ni d'armes ; en haut, mes points à gauche et les joueurs encore debout à droite */
body[data-mode="fall"] .vitals, body[data-mode="fall"] .slots { display: none; }
body[data-mode="fall"] .scoreboard .side.s0 b { color: var(--team, var(--orange)); }
body[data-mode="fall"] .tool b .px-icon { height: 26px; width: auto; display: inline-block; }
body[data-mode="fall"] .alive i { width: 8px; }

/* Pixel Fall : emplacement du bonus, en bas au centre */
body[data-mode="fall"] .tool { display: none; }
.power { display: none; }
body[data-mode="fall"] .power { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; justify-items: center; gap: 6px; }
.power-box { position: relative; width: 76px; height: 76px; display: grid; place-items: center; background: rgba(18, 15, 46, .78);
  box-shadow: inset 0 0 0 2px var(--haze); outline: 2px dashed rgba(169, 163, 220, .35); outline-offset: -8px; }
.power.full .power-box { outline: 0; box-shadow: inset 0 0 0 3px var(--power), 0 0 18px -6px var(--power); }
.power-box .px-icon { height: 44px; width: auto; }
.power-box kbd { position: absolute; top: 4px; left: 4px; font: 600 12px/16px var(--display); background: var(--haze); color: var(--chalk); padding: 0 5px; }
.power > span { font: 600 15px var(--display); color: var(--lilac); background: rgba(18, 15, 46, .78); padding: 2px 8px; }
.power.full > span { color: var(--chalk); }
.power-time { display: none; width: 76px; height: 5px; background: rgba(0, 0, 0, .55); }
.power-time b { display: block; height: 100%; width: 0; background: #f3efff; }
.power.timed .power-time { display: block; }
.power.safe .power-time b { background: var(--signal); }
.power.pop .power-box { animation: power-pop .35s steps(4, end); }
@keyframes power-pop { 0% { transform: scale(1.35); } 100% { transform: none; } }
body[data-mode="fall"] .wait { bottom: 150px; }

/* Les menus ne défilent jamais : trop hauts, ils rétrécissent (voir fitPanels dans game.js) */
.overlay > .panel { max-height: none; overflow: visible; }
/* Cartes d'armes plus compactes : icône et nom sur une ligne, libellés sur une seule ligne */
.loadout .weapon-card { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 10px; row-gap: 3px; }
.loadout .weapon-card .weapon-icon { margin: 0; height: 28px; }
.loadout .weapon-card .weapon-icon .px-icon { height: 26px; }
.loadout .weapon-card > b { margin: 0; }
.loadout .weapon-card .gauge { grid-column: 1 / -1; }
.loadout .gauge { grid-template-columns: 6.2em 1fr 4.8em; }
.loadout .gauge span { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.loadout .gauge em { white-space: nowrap; }

/* ---------- Écran tactile ---------- */
body.touch { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch .btn, body.touch .pick, body.touch .map-card { touch-action: manipulation; }
.touch-ui { position: fixed; inset: 0; z-index: 8; display: none; touch-action: none; }
body.touch.playing .touch-ui { display: block; }
body.touch.playing .crosshair { display: block; }
.t-look { position: absolute; inset: 0; }
.t-stick { position: absolute; width: 132px; height: 132px; margin: -66px 0 0 -66px; border-radius: 50%; background: rgba(18, 15, 46, .35); box-shadow: inset 0 0 0 3px rgba(243, 239, 255, .35); pointer-events: none; }
.t-stick[hidden] { display: none; }
.t-stick i { position: absolute; left: 50%; top: 50%; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%; background: rgba(243, 239, 255, .55); }
.t-btn { position: absolute; display: grid; place-items: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: rgba(18, 15, 46, .55); color: var(--chalk); font: 600 12px/1.1 var(--display); text-align: center; box-shadow: inset 0 0 0 2px rgba(243, 239, 255, .35); touch-action: none; }
.t-btn[hidden] { display: none; }
.t-btn.on { background: rgba(255, 138, 61, .75); color: #2a1100; }
.t-btn.lit { box-shadow: inset 0 0 0 3px var(--orange); color: var(--orange); }
/* Bouton de tir : grand, sous le pouce droit ; les autres en arc autour */
.t-fire { right: max(22px, env(safe-area-inset-right)); bottom: 26px; width: 92px; height: 92px; font-size: 15px; background: rgba(255, 138, 61, .35); }
.t-jump { right: calc(max(22px, env(safe-area-inset-right)) + 104px); bottom: 20px; }
.t-crouch { right: calc(max(22px, env(safe-area-inset-right)) + 172px); bottom: 14px; width: 52px; height: 52px; }
.t-reload { right: calc(max(22px, env(safe-area-inset-right)) + 100px); bottom: 92px; width: 52px; height: 52px; }
.t-scope { right: calc(max(22px, env(safe-area-inset-right)) + 14px); bottom: 132px; width: 56px; height: 56px; }
.t-remove { right: calc(max(22px, env(safe-area-inset-right)) + 14px); bottom: 132px; width: 56px; height: 56px; }
.t-nade { right: calc(max(22px, env(safe-area-inset-right)) + 160px); bottom: 80px; width: 52px; height: 52px; }
.t-pause { left: max(14px, env(safe-area-inset-left)); top: 12px; width: 44px; height: 44px; border-radius: 8px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.t-pause i { width: 5px; height: 16px; background: currentColor; }
.t-board { left: calc(max(14px, env(safe-area-inset-left)) + 54px); top: 12px; width: 44px; height: 44px; border-radius: 8px; font-size: 11px; }
.t-loadout { left: calc(max(14px, env(safe-area-inset-left)) + 108px); top: 12px; width: 64px; height: 44px; border-radius: 8px; font-size: 11px; }
/* HUD plus petit, et la barre d'armes reste visible (on la touche pour changer d'arme) */
body.touch .slots { display: flex; left: 38%; bottom: 6px; transform: translateX(-50%) scale(.72); transform-origin: bottom center; }
/* Vie en haut à gauche sous les boutons, munitions en haut à droite : le bas de l'écran est aux pouces */
body.touch .vitals { left: max(14px, env(safe-area-inset-left)); bottom: auto; top: 64px; transform: scale(.66); transform-origin: top left; }
body.touch .tool { right: max(14px, env(safe-area-inset-right)); bottom: auto; top: 10px; transform: scale(.66); transform-origin: top right; }
body.touch .feed { top: 72px; font-size: 13px; }
@media (pointer: coarse) and (max-height: 500px) {
  body.touch .scoreboard { transform: translateX(-50%) scale(.8); transform-origin: top center; top: 6px; }
  body.touch .banner { font-size: 30px; top: 18%; }
}
/* Tenir le téléphone en largeur */
.rotate-hint { display: none; position: fixed; inset: 0; z-index: 40; place-items: center; padding: 24px; background: var(--night); color: var(--chalk); font: 600 22px/1.3 var(--display); text-align: center; }
@media (orientation: portrait) { body.touch.playing .rotate-hint { display: grid; } }
/* Écran peu haut (téléphone en largeur) : menu d'accueil sous la barre du haut */
@media (max-height: 520px) { .menu { justify-content: flex-end; padding-top: 64px; padding-bottom: 12px; } .menu-top { top: 10px; } }

/* Pixel Fall n'a pas d'armes : pas de barre d'emplacements, même sur écran tactile */
body.touch[data-mode="fall"] .slots { display: none; }

/* ---------- Attente : entraînement, recherche, compte à rebours, salon ---------- */
.wait { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 20px 16px; box-shadow: inset 0 -4px 0 var(--haze); }
.wait p { margin: 0; }
.wait-tag { font: 600 13px var(--display); letter-spacing: .08em; text-transform: uppercase; color: #2a1100; background: var(--orange); padding: 2px 8px; }
.wait.private .wait-tag { background: var(--cyan); color: #04202a; }
.wait.counting .wait-tag { background: var(--signal); color: #2a1f00; }
.wait-title { font: 600 20px/1.3 var(--display); color: var(--chalk); min-height: 1.3em; }
.wait.counting .wait-title { font-size: 26px; color: var(--signal); text-shadow: -2px 2px 0 var(--orange-deep); }
.wait-row { display: flex; gap: 18px; justify-content: center; font: 500 16px var(--display); color: var(--lilac); }
.wait-row span:empty { display: none; }
.wait-row span:first-child:not(:empty) { color: var(--chalk); font-variant-numeric: tabular-nums; }
.wait-bar { display: block; width: 100%; height: 6px; background: rgba(243, 239, 255, .12); }
.wait-bar[hidden] { display: none; }
.wait-bar b { display: block; height: 100%; width: 0; background: var(--orange); transition: width .2s steps(4, end); }
.wait.counting .wait-bar b { background: var(--signal); }
.wait .muted { font-size: 14px; margin: 0; }
.debug-tag { font: 600 11px var(--display); color: #2a1f00; background: var(--signal); padding: 1px 5px; margin-left: 6px; vertical-align: middle; }

/* Salon d'une salle privée (menu Échap) */
.lobby { display: flex; flex-direction: column; gap: 10px; padding: 12px; background: var(--night); box-shadow: inset 0 0 0 2px var(--haze); }
.lobby[hidden] { display: none; }
.lobby h3 { margin: 0; font: 600 16px var(--display); color: var(--lilac); text-transform: uppercase; letter-spacing: .06em; }
.lobby-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lobby-teams.ffa { grid-template-columns: 1fr; }
.lobby-team { box-shadow: inset 0 3px 0 var(--team); padding-top: 6px; }
.lobby-team h4 { margin: 0 0 6px; font: 600 15px var(--display); color: var(--team); display: flex; justify-content: space-between; }
.lobby-team h4 small { color: var(--lilac); font-size: 13px; }
.lobby ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.lobby li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(243, 239, 255, .05); font: 500 15px var(--display); color: var(--chalk); min-height: 34px; }
.lobby li > i { width: 8px; height: 14px; background: var(--team); flex: none; }
.lobby li > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lobby li em { color: var(--lilac); font-style: normal; }
.lobby .crown { display: inline-flex; width: 18px; color: var(--signal); }
.lobby .crown svg { width: 18px; height: auto; fill: currentColor; shape-rendering: crispEdges; }
.lobby .move { border: 0; background: var(--haze); color: var(--chalk); font: 600 14px var(--display); width: 28px; height: 24px; cursor: pointer; padding: 0; }
.lobby .move:hover { background: var(--orange); color: #2a1100; }
.lobby .bot-tag { border: 0; background: rgba(243, 239, 255, .1); color: var(--lilac); font: 600 12px var(--display); letter-spacing: .04em; padding: 3px 6px; white-space: nowrap; flex: none; }
.lobby button.bot-tag { cursor: pointer; }
.lobby button.bot-tag:hover { background: var(--haze); color: var(--chalk); }
.lobby .add-bot { margin-top: 4px; width: 100%; border: 2px dashed var(--haze); background: transparent; color: var(--lilac); font: 600 14px var(--display); padding: 6px; cursor: pointer; }
.lobby .add-bot:hover { border-color: var(--team, var(--orange)); color: var(--chalk); }
.lobby .small:empty { display: none; }
.wait .muted:empty { display: none; }
/* Souris pas encore capturée : un clic sur le jeu suffit */
.click-hint { position: absolute; left: 50%; top: 56%; transform: translateX(-50%); padding: 8px 16px; background: rgba(18, 15, 46, .85); color: var(--chalk); font: 600 18px var(--display); box-shadow: inset 0 -3px 0 var(--orange); pointer-events: none; animation: pulse 1.2s steps(2) infinite; }
.click-hint[hidden] { display: none; }
/* Vote pendant qu'on joue : touches 1 et 2, le jeu reste visible derrière */
.vote-key { position: absolute; top: 8px; left: 8px; font: 700 15px var(--display); background: var(--orange); color: #2a1100; padding: 1px 7px; }
.map-card { position: relative; }

/* Mort : qui on regarde, sur trois lignes */
.dead-box { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 20px 12px; font: 500 15px var(--display); box-shadow: inset 0 -3px 0 var(--danger); }
.dead-box .dead-tag { font: 600 12px var(--display); letter-spacing: .08em; text-transform: uppercase; color: #2a0b10; background: var(--danger); padding: 2px 8px; }
.dead-box b { font: 600 20px var(--display); }
.dead-box small { font: 500 13px var(--display); color: var(--lilac); }
/* Barre de vie du joueur regardé */
.vitals.watching { box-shadow: inset 4px 0 0 var(--watch, var(--lilac)); }
.vitals.watching .fill { background: var(--watch, var(--lilac)); }

/* ----- Chat textuel (en bas à gauche, au-dessus de la vie) ----- */
.chat { position: fixed; left: 18px; bottom: 96px; z-index: 12; width: max(230px, min(360px, calc(50vw - 250px))); display: flex; flex-direction: column; gap: 6px; pointer-events: none; font: 500 15px/1.35 var(--display); }
.chat[hidden] { display: none; }
body[data-mode="fall"] .chat { bottom: 24px; }
.chat-log { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow: hidden; scrollbar-width: thin; }
.chat-line { align-self: flex-start; max-width: 100%; padding: 3px 8px; background: rgba(18, 15, 46, .72); color: var(--chalk); overflow-wrap: anywhere; transition: opacity .8s; }
.chat-line.old { opacity: 0; }
.chat-line b { font-weight: 600; }
.chat-tag, .chat-sys { color: var(--lilac); font-style: normal; }
.chat-form { display: none; pointer-events: auto; background: rgba(18, 15, 46, .92); box-shadow: inset 0 0 0 2px var(--haze); }
body.chat-open .chat-form, body:not(.playing) .chat-form { display: flex; }
body.chat-open .chat-line.old, body:not(.playing) .chat-line.old { opacity: 1; }
body.chat-open .chat-log, body:not(.playing) .chat-log { overflow-y: auto; pointer-events: auto; }
body.chat-open .chat-form { box-shadow: inset 0 0 0 2px var(--orange); }
.chat-to { flex: none; border: 0; background: var(--haze); color: var(--chalk); font: 600 12px var(--display); letter-spacing: .05em; text-transform: uppercase; padding: 0 10px; cursor: pointer; }
.chat-to.team { background: var(--team); color: #120f2e; }
#chatInput { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--chalk); font: 500 15px var(--display); padding: 8px 10px; outline: none; }
#chatInput::placeholder { color: rgba(243, 239, 255, .45); }
.t-chat { left: calc(max(14px, env(safe-area-inset-left)) + 182px); top: 12px; width: 52px; height: 44px; border-radius: 8px; font-size: 11px; }
/* Téléphone : sous la vie, à gauche ; le champ n'apparaît que quand on touche « Chat » (pas par-dessus les menus) */
body.touch .chat { top: 104px; bottom: auto; left: max(14px, env(safe-area-inset-left)); width: min(320px, 42vw); font-size: 13px; }
body.touch .chat-log { max-height: 120px; }
body.touch:not(.chat-open) .chat-form { display: none; }
body.touch:not(.chat-open):not(.playing) .chat { display: none; }
body.touch.chat-open .chat { top: 12px; width: min(460px, 60vw); z-index: 30; }
