:root {
  --accent: #f2a33a; --danger: #e5533d; --ok: #8fd16a;
  --panel: rgba(16, 18, 22, 0.66); --line: rgba(255, 255, 255, 0.14);
  --font: "Barlow Condensed", "Roboto Condensed", "Oswald", "Arial Narrow", "Segoe UI", system-ui, sans-serif;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.75);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0f12; color: #f3f4f2; font-family: var(--font); font-stretch: condensed; user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; text-transform: uppercase; letter-spacing: 0.04em; }
.panel { position: absolute; bottom: 26px; padding: 10px 16px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; backdrop-filter: blur(3px); }
.label { font-size: 12px; opacity: 0.7; letter-spacing: 0.14em; }
.bar { height: 4px; background: rgba(255, 255, 255, 0.16); margin-top: 6px; border-radius: 2px; overflow: hidden; }
.bar > div { height: 100%; width: 100%; background: #f3f4f2; transition: width 0.15s; }

#health { left: 26px; width: 190px; border-left: 3px solid #f3f4f2; }
#health .value { font-size: 50px; font-weight: 700; line-height: 1; }
#health .value::before { content: "+"; color: var(--ok); margin-right: 6px; font-weight: 400; }
#health.low { border-left-color: var(--danger); }
#health.low .value, #health.low .value::before { color: var(--danger); }
#health.low .bar > div { background: var(--danger); }
#weapon { right: 26px; width: max-content; min-width: 240px; max-width: 380px; text-align: right; border-right: 3px solid var(--accent); }
#weapon .wname { font-size: 28px; font-weight: 700; color: var(--accent); line-height: 1.1; white-space: nowrap; }
#weapon .ammo { font-size: 50px; font-weight: 700; line-height: 1; }
#weapon .ammo small { font-size: 20px; opacity: 0.6; margin-left: 6px; font-weight: 500; }
#weapon .ammo.low span { color: var(--danger); }
#weapon .progress { display: flex; gap: 4px; justify-content: flex-end; margin-top: 6px; }
#weapon .progress i { width: 26px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.2); }
#weapon .progress i.on { background: var(--accent); }

#objective { font-size: 15px; font-weight: 600; margin-bottom: 4px; text-shadow: var(--shadow); display: none; }
#hud.frag #objective { display: block; }
/* Mode bombe : ligne d'état sous l'objectif, barre de pose ou de désamorçage */
#bombline { font-size: 13px; font-weight: 600; margin-bottom: 4px; text-shadow: var(--shadow); display: none; }
#hud.bomb #bombline { display: block; }
#bombline b { color: var(--accent); }
#bombline .hot { color: #ff5a3c; }
/* Roi de la colline : état de la zone et chrono du déplacement ; marqueur de la zone (et du point suivant) à l'écran */
#hillline { font-size: 13px; font-weight: 600; margin-bottom: 4px; text-shadow: var(--shadow); display: none; }
#hud.hill #hillline { display: block; }
#hillline b { color: var(--hc, #dfe5ec); }
#hillline .warn { color: #ffd23c; }
.hillmark { position: absolute; left: 0; top: 0; width: 0; height: 0; color: var(--c, #dfe5ec); text-shadow: 0 1px 2px #000a; pointer-events: none; display: none; }
.hillmark.on { display: block; }
.hillmark i { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border: 2px solid currentColor; border-radius: 50%; background: rgba(0, 0, 0, 0.45); box-shadow: 0 0 6px #000a; }
.hillmark i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: currentColor; }
.hillmark.out i::after { width: 0; height: 0; margin: -6px -3px; border-radius: 0; background: none; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; transform: rotate(var(--a, 0rad)); transform-origin: 3px 6px; }
.hillmark b, .hillmark span { position: absolute; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 700; }
.hillmark b { top: -32px; text-transform: uppercase; letter-spacing: 0.06em; }
.hillmark span { top: 14px; font-size: 11px; color: #fff; }
.hillmark.next { opacity: 0.8; }
.hillmark.next i { border-style: dashed; }
#usebar { position: absolute; left: 50%; bottom: 205px; transform: translateX(-50%); width: 300px; padding: 7px 12px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; text-align: center; font-size: 14px; font-weight: 600; display: none; }
#usebar.on { display: block; }
#usebar .bar { height: 6px; margin-top: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.16); overflow: hidden; }
#usefill { height: 100%; width: 0; background: var(--accent); }
#death.wait .bar { display: none; }
#hud.frag #ladder { display: none; }
/* Arme au choix : ni grenades ni argent dans le menu */
#hud.pick #shop .sh-sub, #hud.pick #nadelist, #hud.pick #shop .sh-foot { display: none; }
/* Mode équipes : bandeau des scores, la mienne soulignée */
#teams { display: none; align-items: stretch; gap: 10px; margin-bottom: 6px; }
#hud.teams #teams { display: flex; justify-content: center; }
#teams .tm { display: flex; align-items: baseline; gap: 10px; padding: 4px 14px; background: var(--panel); border: 1px solid var(--line); border-bottom: 3px solid var(--tc); border-radius: 4px; opacity: 0.8; }
#teams .tm i { font-style: normal; font-size: 13px; font-weight: 600; color: var(--tc); }
#teams .tm b { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
#teams .tm.mine { opacity: 1; background: color-mix(in srgb, var(--tc) 22%, rgba(16, 18, 22, 0.8)); border-color: var(--tc); }
#teams .tm:last-child { flex-direction: row-reverse; }
#teams .vs { align-self: center; opacity: 0.6; }
table.sb tr.team td { padding-top: 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tc); border-bottom: 2px solid var(--tc); }
#teamswitch { width: 100%; margin-top: 8px; padding: 9px; font: inherit; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; background: rgba(255, 255, 255, 0.08); border: 1px solid var(--line); border-radius: 3px; cursor: pointer; }
#teamswitch:hover { border-color: var(--accent); }
#weapon .money { display: none; margin-top: 6px; font-size: 22px; font-weight: 700; color: var(--ok); }
#hud.ffa #weapon .money { display: block; }
#weapon .money small { margin-left: 8px; font-size: 15px; color: #fff; animation: gain 1.6s ease-out forwards; }
@keyframes gain { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: none; } 70% { opacity: 1; } 100% { opacity: 0; } }
/* Parties de nuit : état de la lampe torche */
#torch { position: absolute; left: 26px; bottom: 132px; padding: 4px 10px; font-size: 13px; font-weight: 600; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; display: none; }
#hud.night #torch { display: block; }
#torch.on { border-color: var(--accent); }
#torch kbd { font-size: 11px; }
/* Qualité basse : les effets d'écran (dégâts, éclair, fumée) sont de simples calques, sans passe de rendu */
#fxlow { position: fixed; inset: 0; pointer-events: none; }
#diag { position: fixed; left: 8px; top: 30px; margin: 0; padding: 6px 10px; z-index: 50; display: none; pointer-events: none; font: 12px/1.5 Consolas, monospace; color: #dfe6ee; background: rgba(8, 10, 13, 0.82); border-left: 3px solid #f2a33a; white-space: pre; }
#diag.on { display: block; }
#buyhint { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); padding: 5px 14px; font-size: 16px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; display: none; white-space: nowrap; }
#buyhint.on { display: block; }
#buyhint kbd { font-size: 14px; color: var(--accent); border-color: var(--accent); }
/* Arme au sol à portée : même cartouche, un peu plus haut */
#pickhint { position: absolute; left: 50%; bottom: 162px; transform: translateX(-50%); padding: 5px 14px; font-size: 16px; font-weight: 600;
  background: var(--panel); border: 1px solid var(--line); border-radius: 4px; display: none; white-space: nowrap; }
#pickhint.on { display: block; }
#pickhint kbd { font-size: 14px; color: var(--accent); border-color: var(--accent); }
#shop { position: absolute; left: 26px; top: 50%; transform: translateY(-50%); width: 390px; padding: 12px 14px; background: rgba(16, 18, 22, 0.88);
  border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 4px; text-transform: none; letter-spacing: 0.02em; }
#shop .sh-title { font-size: 20px; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 8px; }
#shop .sh-title small { float: right; font-size: 12px; font-weight: 500; letter-spacing: 0.04em; opacity: 0.6; margin-top: 7px; text-transform: none; }
#shop .it { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 3px; font-size: 16px; }
#shop #nadelist .it { grid-template-columns: 26px 1fr auto 62px; }
#shop .it .n i { display: inline-block; width: 8px; height: 12px; margin-right: 7px; border-radius: 2px; vertical-align: -1px; }
#shop .it .c { font-size: 12px; opacity: 0.7; font-variant-numeric: tabular-nums; }
#shop #nadelist .p { text-align: right; }
#shop .sh-sub { margin: 8px 0 4px; padding-top: 7px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.6; }
/* Stock de grenades, au-dessus du panneau d'arme */
#nades { display: none; position: absolute; right: -3px; bottom: 100%; margin-bottom: 10px; gap: 6px; white-space: nowrap; text-align: left; }
#hud.ffa #nades.on { display: flex; }
#nades .nd { display: flex; align-items: center; gap: 6px; padding: 4px 9px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; font-size: 14px; font-weight: 600; }
#nades .nd i { width: 8px; height: 13px; border-radius: 2px; }
#nades .nd b { font-size: 16px; font-variant-numeric: tabular-nums; }
#nades .nd.none { opacity: 0.38; }
#nades .nd.sel { border-color: var(--accent); background: rgba(242, 163, 58, 0.24); }
#nades .nk { position: absolute; right: 0; bottom: 100%; margin-bottom: 5px; font-size: 12px; text-shadow: 0 1px 3px #000; }
#shop .it kbd { margin: 0; }
#shop .it .n { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#shop .it .n small { margin-left: 8px; font-weight: 400; font-size: 12px; opacity: 0.65; }
#shop .it .p { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ok); }
#shop .it.cant { opacity: 0.42; }
#shop .it.cant .p { color: var(--danger); }
#shop .it.own { background: rgba(242, 163, 58, 0.2); }
#shop .it.back { margin-top: 4px; opacity: 0.75; }
#shop .it.back .n { font-weight: 500; }
#shop .it.own .p { color: var(--accent); }
#shop .it.no { animation: deny 0.35s; }
@keyframes deny { 30% { background: rgba(229, 83, 61, 0.45); } }
#shop .sh-foot { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 15px; }
#shop .sh-foot b { color: var(--ok); }

#top { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); text-align: center; }
#leader { font-size: 15px; margin-bottom: 6px; text-shadow: var(--shadow); }
#leader b { color: var(--accent); }
#ladder { display: flex; gap: 2px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; max-width: 96vw; }
#ladder .lv { position: relative; width: 62px; flex: 0 1 62px; min-width: 0; height: 22px; display: flex; align-items: center; justify-content: center;
  font-size: 10.5px; font-weight: 600; color: rgba(255, 255, 255, 0.5); background: rgba(255, 255, 255, 0.06); border-radius: 2px; overflow: hidden; letter-spacing: 0; }
#ladder .lv.done { color: rgba(255, 255, 255, 0.75); background: rgba(143, 209, 106, 0.28); }
#ladder .lv.cur { color: #17130a; background: var(--accent); font-weight: 700; }
#ladder .lv .pips { position: absolute; top: -1px; right: 2px; font-size: 7px; color: #17130a; letter-spacing: 0; }

#killfeed { position: absolute; top: 84px; right: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kf { padding: 4px 10px; background: var(--panel); border: 1px solid transparent; border-radius: 3px; font-size: 15px; font-weight: 600; animation: kfin 0.2s ease-out; white-space: nowrap; }
.kf.me { border-color: var(--danger); background: rgba(40, 14, 10, 0.72); }
.kf .w { opacity: 0.75; margin: 0 8px; font-size: 12px; font-weight: 500; padding: 1px 6px; background: rgba(255, 255, 255, 0.12); border-radius: 2px; }
.kf .hs { color: var(--accent); margin-left: 6px; font-size: 13px; }
.kf.out { opacity: 0; transition: opacity 0.5s; }
@keyframes kfin { from { transform: translateX(30px); opacity: 0; } }

#announce { position: absolute; top: 22%; left: 0; right: 0; padding: 0 16px; text-align: center; opacity: 0; }
#announce.show { animation: ann 2.2s ease-out forwards; }
#announce .big { font-size: clamp(22px, 3.4vw, 46px); line-height: 1.15; font-weight: 800; letter-spacing: 0.1em; color: var(--ac, #fff); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
#announce .sub { font-size: clamp(13px, 1.5vw, 19px); letter-spacing: 0.2em; text-shadow: var(--shadow); }
@keyframes ann { 0% { opacity: 0; transform: translateY(10px); } 8% { opacity: 1; transform: none; } 78% { opacity: 1; } 100% { opacity: 0; } }

#crosshair { position: absolute; left: 50%; top: 50%; --gap: 6px; }
#crosshair i { position: absolute; background: #d9ff9c; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55); }
#crosshair .t, #crosshair .b { width: 2px; height: 8px; left: -1px; }
#crosshair .l, #crosshair .r { height: 2px; width: 8px; top: -1px; }
#crosshair .t { bottom: var(--gap); } #crosshair .b { top: var(--gap); }
#crosshair .l { right: var(--gap); } #crosshair .r { left: var(--gap); }
#crosshair b { position: absolute; width: 2px; height: 2px; left: -1px; top: -1px; background: #d9ff9c; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45); }
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; transform: rotate(45deg); }
#hitmarker i { position: absolute; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4); }
#hitmarker i:nth-child(1) { width: 2px; height: 9px; left: -1px; bottom: 7px; }
#hitmarker i:nth-child(2) { width: 2px; height: 9px; left: -1px; top: 7px; }
#hitmarker i:nth-child(3) { height: 2px; width: 9px; top: -1px; right: 7px; }
#hitmarker i:nth-child(4) { height: 2px; width: 9px; top: -1px; left: 7px; }
#hitmarker.hit { animation: hm 0.2s ease-out; }
#hitmarker.head i { background: var(--accent); }
#hitmarker.kill i { background: var(--danger); }
#hitmarker.kill.hit { animation: hm 0.4s ease-out; }
@keyframes hm { 0% { opacity: 1; transform: rotate(45deg) scale(1.5); } 100% { opacity: 0; transform: rotate(45deg) scale(1); } }

#scope { position: absolute; inset: 0; opacity: 0; transition: opacity 0.08s;
  background:
    linear-gradient(#000, #000) 50% 50% / 100% 1.5px no-repeat,
    linear-gradient(#000, #000) 50% 50% / 1.5px 100% no-repeat,
    radial-gradient(circle at 50% 50%, transparent 0, transparent 38vh, rgba(0, 0, 0, 0.7) 38.6vh, #000 39.4vh); }
#scope.on { opacity: 1; }
#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 55%, rgba(170, 14, 14, 0.5) 100%); }
#dmgdir { position: absolute; left: 50%; top: 50%; }
#dmgdir .arc { position: absolute; width: 150px; height: 20px; left: -75px; top: -10px; transform-origin: 50% 50%; animation: arc 1.1s ease-out forwards; }
#dmgdir .arc::before { content: ""; position: absolute; inset: 0; transform: translateY(-140px); background: radial-gradient(ellipse at 50% 100%, rgba(229, 60, 45, 0.95), transparent 70%); }
@keyframes arc { from { opacity: 1; } to { opacity: 0; } }
#numbers { position: absolute; inset: 0; overflow: hidden; }
#numbers span { position: absolute; font-size: 22px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; will-change: transform, opacity; }
#numbers span.head { color: var(--accent); font-size: 28px; }

/* Spectateur : qui l'on suit, et comment changer */
#spec { position: absolute; left: 50%; bottom: 150px; transform: translateX(-50%); padding: 7px 16px; background: var(--panel); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: 4px; font-size: 14px; text-align: center; white-space: nowrap; display: none; }
#spec.on { display: block; }
#spec b { font-size: 16px; }
#spec small { display: block; margin-top: 2px; opacity: 0.7; font-size: 12px; }
#spec kbd { font-size: 11px; }
#death { position: absolute; left: 0; right: 0; top: 34%; text-align: center; display: none; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7); }
#death.on { display: block; }
#death .d1 { font-size: 58px; font-weight: 800; letter-spacing: 0.2em; color: var(--danger); }
#death .d2 { font-size: 21px; margin: 2px 0 14px; }
#death .bar { width: 260px; margin: 0 auto; }
#death .bar > div { transition: none; }

#scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); min-width: 560px; display: none;
  background: rgba(14, 16, 20, 0.95); border: 1px solid var(--line); border-radius: 6px; padding: 14px 18px; z-index: 5; }
#scoreboard.on { display: block; }
table.sb { width: 100%; border-collapse: collapse; font-size: 17px; }
table.sb th { text-align: left; font-size: 11px; opacity: 0.6; letter-spacing: 0.16em; padding: 4px 8px; font-weight: 500; }
table.sb td { padding: 5px 8px; border-top: 1px solid rgba(255, 255, 255, 0.08); }
table.sb tr.me td { background: rgba(242, 163, 58, 0.16); }
table.sb .dot { display: inline-block; width: 10px; height: 10px; margin-right: 8px; border-radius: 2px; background: currentColor; }
table.sb .num { text-align: right; font-variant-numeric: tabular-nums; }
table.sb .bot { font-size: 10px; opacity: 0.5; margin-left: 6px; border: 1px solid; border-radius: 2px; padding: 0 4px; }
/* Insigne du niveau d'un bot : chevrons pour Recrue à Vétéran, étoile dorée pour Élite */
table.sb .bot i { font-style: normal; margin-left: 4px; letter-spacing: -1px; }
table.sb .bot i.bl3 { color: #f2c94c; letter-spacing: 0; }
table.sb .wp { font-size: 14px; opacity: 0.85; }
#stats { position: absolute; left: 10px; top: 8px; font-size: 11px; opacity: 0.7; letter-spacing: 0.08em; text-shadow: var(--shadow); }

/* Écran de fin : centré quand il tient, sinon il défile (marges auto du premier et du dernier bloc) */
#win { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; overflow-y: auto; overscroll-behavior: contain;
  padding: 16px 16px 20px; box-sizing: border-box; background: rgba(10, 12, 15, 0.72); text-transform: uppercase; }
#win > :first-child { margin-top: auto; }
#win > :last-child { margin-bottom: auto; }
#win .wtitle { font-size: 84px; font-weight: 800; letter-spacing: 0.16em; color: var(--accent); text-shadow: 0 3px 14px rgba(0, 0, 0, 0.6); }
#win.lose .wtitle { color: #f3f4f2; }
#win .wname { font-size: 26px; letter-spacing: 0.12em; }
#winboard { min-width: 560px; max-width: 100%; box-sizing: border-box; margin-top: 6px; background: rgba(14, 16, 20, 0.9); border: 1px solid var(--line); border-radius: 6px; padding: 12px 16px; }
#win .wnext { opacity: 0.7; letter-spacing: 0.16em; margin-top: 2px; text-align: center; }
/* Statistiques de fin de partie : le tableau défile de côté s'il est trop large, sans faire défiler la page */
#winboard .sbwrap { overflow-x: auto; }
table.sb.st { font-size: 15px; text-transform: none; }
table.sb.st th { text-transform: uppercase; white-space: nowrap; }
table.sb.st .who { white-space: nowrap; }
/* Récompenses : une carte par titre */
#winawards { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; max-width: 980px; }
#winawards:empty, #winvote:empty { display: none; }
#winawards .aw { display: grid; grid-template-columns: 26px auto; column-gap: 8px; align-items: center; padding: 7px 12px 7px 10px; min-width: 150px;
  background: rgba(14, 16, 20, 0.9); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: 5px; text-transform: none; }
#winawards .aw.me { background: rgba(242, 163, 58, 0.16); }
#winawards .aw svg { grid-row: span 3; width: 24px; height: 24px; color: var(--accent); }
#winawards .aw b { font-size: 12px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
#winawards .aw span { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
#winawards .aw em { font-style: normal; font-size: 13px; opacity: 0.7; }
/* Vote pour la partie suivante */
#winvote { width: min(860px, 100%); margin-top: 6px; }
#winvote .vhead { text-align: center; font-size: 14px; letter-spacing: 0.14em; margin-bottom: 6px; }
#winvote .vhead small { opacity: 0.6; text-transform: none; letter-spacing: 0.04em; }
#winvote kbd { font-size: 12px; }
#winvote .vopts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
#winvote .vopt { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 9px 12px 8px;
  font: inherit; color: inherit; text-align: left; cursor: pointer; background: rgba(14, 16, 20, 0.92); border: 1px solid var(--line); border-radius: 5px; }
#winvote .vopt:hover { border-color: rgba(255, 255, 255, 0.4); }
#winvote .vopt.lead { border-color: rgba(242, 163, 58, 0.55); }
#winvote .vopt.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
#winvote .vopt > * { position: relative; }
#winvote .vopt .vbar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(242, 163, 58, 0.16); transition: width 0.25s; }
#winvote .vopt kbd { position: absolute; right: 10px; top: 9px; }
#winvote .vopt.mine kbd { color: var(--accent); border-color: var(--accent); }
#winvote .vopt b { font-size: 21px; letter-spacing: 0.06em; padding-right: 30px; }
#winvote .vopt span { font-size: 13px; opacity: 0.8; letter-spacing: 0.08em; }
#winvote .vopt em { font-style: normal; font-size: 13px; color: var(--accent); margin-top: 2px; }
#winvote .vopt small { font-size: 12px; opacity: 0.65; text-transform: none; min-height: 1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* Petit écran : titres réduits, colonnes secondaires masquées, propositions empilées */
@media (max-width: 760px), (max-height: 700px) {
  #win .wtitle { font-size: 46px; text-align: center; letter-spacing: 0.1em; }
  #winvote .vopt { padding: 6px 10px; }
  #win .wname { font-size: 17px; text-align: center; }
  #winboard { min-width: 0; padding: 8px 10px; }
  table.sb.st { font-size: 13px; }
  table.sb.st td, table.sb.st th { padding: 4px 5px; }
  #winawards .aw { min-width: 0; padding: 5px 9px 5px 7px; }
  #winawards .aw span { font-size: 15px; }
}
@media (max-width: 760px) {
  table.sb.st .opt { display: none; }
  #winvote .vopts { grid-template-columns: 1fr; }
  #winvote .vhead small { display: none; }
}

#menu { position: fixed; inset: 0; display: flex; justify-content: center; overflow-y: auto; overscroll-behavior: contain; padding: 16px 0;   /* écran trop bas : le menu défile (marges auto : centré quand il tient) */ background: rgba(10, 12, 15, 0.5); backdrop-filter: blur(3px); }
#menu .card { margin: auto 0; width: min(500px, 92vw); padding: 28px 32px; background: rgba(18, 20, 25, 0.93); border: 1px solid var(--line); border-top: 4px solid var(--accent);
  border-radius: 6px; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
#menu h1 { margin: 0; font-size: 72px; line-height: 0.9; letter-spacing: 0.04em; font-weight: 800; color: #fff; }
#menu h1 span { color: var(--accent); }
#menu h2 { margin: 6px 0 20px; font-size: 15px; font-weight: 500; letter-spacing: 0.22em; opacity: 0.75; }
.row { display: flex; align-items: center; gap: 12px; margin: 10px 0; font-size: 15px; letter-spacing: 0.1em; text-transform: uppercase; }
.row input[type="range"] { flex: 1; accent-color: var(--accent); }
.row input:not([type="range"]), .row select { flex: 1; padding: 8px 12px; font: inherit; font-size: 18px; letter-spacing: 0.03em; color: #fff;
  background: rgba(255, 255, 255, 0.07); border: 1px solid var(--line); border-radius: 3px; outline: none; user-select: text; }
.row select option { background: #16181d; }
.row input:focus, .row select:focus { border-color: var(--accent); }
.row select { min-width: 0; }                 /* options longues : la liste se resserre au lieu de déborder */
.row output { width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
#play { width: 100%; margin-top: 14px; padding: 12px; font: inherit; font-size: 26px; font-weight: 800; letter-spacing: 0.2em; color: #17130a;
  background: var(--accent); border: 0; border-radius: 3px; cursor: pointer; transition: filter 0.15s, transform 0.1s; }
#play:hover { filter: brightness(1.12); } #play:active { transform: scale(0.985); }
#play:disabled { opacity: 0.6; cursor: default; }
#resinfo { margin: -4px 0 4px; font-size: 12px; text-align: right; opacity: 0.6; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
/* Avant de rejoindre : y a-t-il de vrais joueurs en partie ? */
#lobby { margin: 14px 0 0; padding: 9px 12px; border: 1px solid var(--line); border-left: 3px solid #6b7280; border-radius: 3px; background: rgba(255, 255, 255, 0.05); font-size: 15px; line-height: 1.35; user-select: text; }
#lobby b { display: block; font-weight: 700; letter-spacing: 0.04em; }
#lobby b::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: #6b7280; }
#lobby span { display: block; }
#lobby small { display: block; font-size: 13px; opacity: 0.7; }
#lobby.live { border-left-color: var(--ok); }
#lobby.live b { color: var(--ok); }
#lobby.live b::before { background: var(--ok); box-shadow: 0 0 8px var(--ok); }
#lobby.full { border-left-color: var(--danger); }
#lobby.full b { color: var(--danger); }
#lobby.full b::before { background: var(--danger); }
#status { min-height: 20px; margin-top: 8px; font-size: 14px; color: var(--accent); text-align: center; letter-spacing: 0.06em; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; opacity: 0.85; }
kbd { display: inline-block; min-width: 20px; padding: 1px 5px; margin-right: 3px; text-align: center; font: inherit; font-size: 12px;
  border: 1px solid var(--line); border-radius: 3px; background: rgba(255, 255, 255, 0.08); }
.rules { font-size: 14px; opacity: 0.72; line-height: 1.45; margin: 14px 0 0; }
.rules b { color: var(--accent); }
.credits { font-size: 11.5px; opacity: 0.5; line-height: 1.4; margin: 10px 0 0; }

/* Signal à l'équipe : losange, nom, distance (position donnée par transform, centrée sur le point) */
.ping { position: absolute; left: 0; top: 0; width: 0; height: 0; color: var(--c, #f2b33a); text-shadow: 0 1px 2px #000a; pointer-events: none; }
.ping i { position: absolute; left: -9px; top: -9px; width: 14px; height: 14px; border: 2px solid currentColor; background: color-mix(in srgb, currentColor 35%, transparent); transform: rotate(45deg); box-shadow: 0 0 6px #000a; }
.ping b, .ping span { position: absolute; left: 0; transform: translateX(-50%); white-space: nowrap; font-size: 12px; font-weight: 700; }
.ping b { top: -30px; }
.ping span { top: 12px; font-size: 11px; color: #fff; }
.ping.out i { border-radius: 50%; transform: none; }
.ping.new i { animation: pingpop 0.6s ease-out; }
@keyframes pingpop { 0% { box-shadow: 0 0 0 0 currentColor; } 100% { box-shadow: 0 0 0 22px transparent; } }
.ping.typed i { left: -12px; top: -12px; width: 20px; height: 20px; border-radius: 50%; transform: none; background: rgba(0, 0, 0, 0.5); }
.ping svg, #sigwheel svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ping.typed svg { width: 14px; height: 14px; margin: 1px; }
.ping.typed b { top: -34px; }
/* Roue des signaux (V maintenu) */
#sigwheel { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
#sigwheel::before { content: ''; position: absolute; left: -128px; top: -128px; width: 256px; height: 256px; border-radius: 50%; background: radial-gradient(circle, rgba(10, 14, 20, 0.55) 30%, rgba(10, 14, 20, 0.25) 70%, transparent 72%); }
#sigwheel .hub, #sigwheel .opt { position: absolute; transform: translate(-50%, -50%); text-align: center; color: #fff; text-shadow: 0 1px 2px #000; }
#sigwheel .hub { left: 0; top: 0; font-size: 11px; opacity: 0.55; padding: 14px 6px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); }
#sigwheel .hub.on { opacity: 0.95; border-color: #fff; }
#sigwheel .opt { width: 86px; padding: 6px 2px; border-radius: 6px; font-size: 11px; font-weight: 700; opacity: 0.7; color: var(--c); }
#sigwheel .opt svg { width: 22px; height: 22px; margin: 0 auto 3px; }
#sigwheel .opt span { color: #fff; }
#sigwheel .opt.on { opacity: 1; background: rgba(0, 0, 0, 0.55); box-shadow: inset 0 0 0 2px var(--c); transform: translate(-50%, -50%) scale(1.12); }
.kf.sig { font-size: 12px; font-weight: 500; padding: 2px 8px; opacity: 0.85; }
/* Mini-carte (touche M : petite, grande, masquée), sous les infos du coin ; descend sous le panneau F3, s'efface
   derrière la boutique */
#minimap { position: absolute; left: 14px; top: 84px; border-radius: 50%; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); }
#diag.on ~ #hud #minimap { top: 172px; }
#shop:not(.hidden) ~ #minimap { display: none; }
