* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0d0f0c;
  --bg2: #15170f;
  --panel: rgba(19, 22, 16, .94);
  --line: #3a4032;
  --text: #ebefe4;
  --hp: #57c25f;
  --shield: #5c93a8;
  --gold: #d4a13d;
  --accent: #e5484d;
  --accent-dim: #7a2a2a;
  --accent2: #d4a13d;
  --mono: "Consolas", "SF Mono", "Cascadia Mono", ui-monospace, monospace;
}
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg);
  color: var(--text); font-family: "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none; touch-action: none; }
#game { position: fixed; inset: 0; display: block; background: var(--bg); cursor: crosshair; }
.hidden { display: none !important; }
.muted { opacity: .6; }
.small { font-size: 12px; }
kbd { background: #1c2016; border: 1px solid var(--line); border-radius: 3px;
  padding: 0 6px; font-size: 11px; font-family: var(--mono); color: var(--accent2); }

/* ---------- menu ---------- */
#menu { position: fixed; inset: 0; z-index: 30; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; overflow-y: auto; padding: 40px 16px;
  background:
    linear-gradient(rgba(13,15,12,.86), rgba(9,10,8,.94)),
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 42px),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 42px),
    radial-gradient(circle at 50% 30%, var(--bg2), #080906 72%);
  background-position: 0 0, 0 0, 0 0, 50% 30%;
  animation: gridDrift 16s linear infinite; }
@keyframes gridDrift {
  from { background-position: 0 0, 0 0, 0 0, 50% 30%; }
  to   { background-position: 0 0, 0 84px, 84px 0, 50% 30%; }
}

#lobbyTicker { font-family: var(--mono); letter-spacing: .5px; }
#lobbyTicker b { color: var(--accent2); font-weight: 700; }

#menuGrid { display: flex; flex-wrap: wrap; gap: 22px; justify-content: center;
  align-items: flex-start; max-width: 1140px; width: 100%; }
.menu-col { flex: 1 1 300px; max-width: 360px; }
@media (max-width: 940px) { #colPlay { order: -1; } }

.panel { width: 100%; background: var(--panel); border: 1px solid var(--line);
  clip-path: polygon(0 18px, 18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
  padding: 36px 32px 28px; text-align: center;
  box-shadow: 0 30px 90px rgba(0,0,0,.65), inset 0 0 0 1px rgba(255,255,255,.03);
  position: relative; }
.panel::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.panel h1 { font-size: 38px; letter-spacing: 2px; font-weight: 800; font-family: var(--mono); }
.panel h1 span { color: var(--accent); }
.panel .tag { margin: 8px 0 22px; opacity: .65; font-size: 13px; letter-spacing: 1px;
  text-transform: uppercase; font-family: var(--mono); }
#accountHello, #playHello { font-family: var(--mono); }
#playHello { margin: 12px 0 4px; }

.field { width: 100%; margin-top: 12px; padding: 15px 16px; font-size: 17px; border-radius: 4px;
  border: 1px solid #384033; background: #0a0c08; color: var(--text); outline: none;
  font-family: var(--mono); }
.field::placeholder { color: #6b7566; font-family: "Segoe UI", system-ui, sans-serif; }
.field:focus { border-color: var(--accent2); }
.btn { width: 100%; margin-top: 14px; padding: 15px; font-size: 18px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  border: none; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  cursor: pointer; color: #1a0a0a;
  background: linear-gradient(180deg, #ef5b58, var(--accent)); transition: filter .15s, transform .08s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: default; }
.btn-ghost { background: #171a12; border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { filter: brightness(1.3); }
.small-btn { width: auto; margin-top: 0; padding: 8px 16px; font-size: 12px; }
.tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px;
  margin-bottom: 14px; }
.tab { flex: 1; padding: 10px; font-size: 13px; font-weight: 700; text-align: center;
  letter-spacing: .5px; text-transform: uppercase;
  background: #12150e; border: 1px solid var(--line); cursor: pointer;
  color: var(--text); opacity: .55; }
.tab.on { opacity: 1; border-color: var(--accent); color: var(--accent); background: #1a1310; }
.err { margin-top: 12px; font-size: 12.5px; color: var(--accent); font-family: var(--mono); }
.sep { margin: 18px 0 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 2px;
  opacity: .35; text-align: center; font-family: var(--mono); }
.sep::before, .sep::after { content: "//"; opacity: .5; margin: 0 8px; }
.build { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
  font-family: var(--mono); letter-spacing: .5px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
#hud > * { pointer-events: none; }

/* ---------- profil / classement / boutique / réglages ---------- */
.extra-pane { text-align: left; margin-top: 4px; min-height: 160px; }
.stats-grid { display: grid; grid-template-columns: repeat(2, auto); gap: 10px 28px; }
.stats-grid div { font-size: 13px; }
.stats-grid b { font-size: 20px; display: block; font-family: var(--mono); color: var(--accent2); }
.stats-grid span { opacity: .6; font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; }

.sub-tabs { margin-bottom: 10px; grid-template-columns: repeat(auto-fit, minmax(78px, 1fr)); }
.sub-tabs .tab { padding: 7px; font-size: 11px; }

.lb-row { display: flex; align-items: center; padding: 9px 0; gap: 10px;
  border-bottom: 1px solid var(--line); font-size: 14px; }
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-family: var(--mono); color: var(--accent2); width: 26px; flex: none; }
.lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-wins { font-family: var(--mono); font-size: 13px; opacity: .85; flex: none; }
.lb-row.you { margin-top: 6px; border-top: 1px dashed var(--accent2); border-bottom: none;
  padding-top: 12px; }
.lb-row.you .lb-name { color: var(--accent2); font-weight: 700; }

.controls-list { display: flex; flex-direction: column; gap: 11px; font-size: 13.5px; }
.controls-list kbd { margin-right: 4px; }

/* ---------- profil ---------- */
.profil-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; flex: none;
  border: 2px solid rgba(255,255,255,.25); box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.profil-name { font-family: var(--mono); font-weight: 700; font-size: 16px; }
.profil-sub { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.sub-title { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; opacity: .55;
  margin-bottom: 10px; font-family: var(--mono); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.badge { font-size: 11.5px; padding: 6px 10px; background: #1a1310; border: 1px solid var(--accent2);
  color: var(--accent2); border-radius: 3px; }
.badge.locked { background: #12150e; border-color: var(--line); color: var(--text); opacity: .35; }

.hist-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px;
  border-bottom: 1px solid var(--line); }
.hist-row:last-child { border-bottom: none; }
.hist-result { font-family: var(--mono); font-weight: 700; width: 64px; flex: none; opacity: .7; }
.hist-result.won { color: var(--accent2); opacity: 1; }
.hist-row span:nth-child(2) { flex: 1; opacity: .8; }

#pwdMsg { color: var(--accent); }

/* ---------- chargement (loadout) ---------- */
.loadout-row { display: flex; align-items: center; gap: 10px; padding: 8px 0;
  border-bottom: 1px solid var(--line); font-size: 13.5px; cursor: default; }
.loadout-row:last-child { border-bottom: none; }
.loadout-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent2);
  flex: none; cursor: pointer; }
.loadout-row .lb-name { flex: 1; }
.loadout-row .lb-wins { flex: none; opacity: .55; font-family: var(--mono); font-size: 12px; }
.stepper { display: flex; align-items: center; gap: 6px; flex: none; }
.stepper button { width: 22px; height: 22px; border: 1px solid var(--line); background: #12150e;
  color: var(--text); font-family: var(--mono); font-size: 13px; cursor: pointer; padding: 0; }
.stepper button:hover { border-color: var(--accent2); }
.stepper-val { font-family: var(--mono); font-size: 13px; min-width: 22px; text-align: center; }
#loadoutSummary { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line);
  font-size: 11.5px; opacity: .55; }

/* ---------- boutique ---------- */
.currency-row { display: flex; gap: 20px; font-family: var(--mono); font-size: 14px;
  margin-bottom: 16px; }
.currency-row b { color: var(--accent2); }
.shop-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.shop-card { background: #12150e; border: 1px solid var(--line); padding: 16px 10px;
  text-align: center; font-size: 12.5px; opacity: .5; position: relative; }
.shop-icon { font-size: 22px; margin-bottom: 6px; }
.lock-tag { display: block; margin-top: 6px; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--accent2); font-family: var(--mono); }

#topbar { position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 16px; align-items: center; }
#survbox { background: var(--panel); border: 1px solid var(--line); border-radius: 0;
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% 100%, 0 100%);
  padding: 8px 20px; text-align: center; }
#survbox b { font-size: 24px; font-family: var(--mono); color: var(--accent2); }
#survbox span { font-size: 10px; text-transform: uppercase; letter-spacing: 1px; opacity: .6;
  display: block; }
#stormbox { background: var(--panel); border: 1px solid var(--line);
  clip-path: polygon(0 8px, 8px 0, 100% 0, 100% 100%, 0 100%);
  padding: 10px 20px; font-size: 14px; font-weight: 600; font-family: var(--mono); }
#stormbox.warn { color: #ffb15c; border-color: #6a4a26; }
#stormbox.active { color: var(--accent); border-color: var(--accent-dim); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

#feed { position: absolute; top: 78px; right: 18px; text-align: right; font-size: 14px;
  line-height: 1.8; font-family: var(--mono); }
#feed div { background: rgba(10,13,8,.6); border-left: 2px solid var(--accent2); border-radius: 2px;
  padding: 2px 9px; display: inline-block; margin-bottom: 4px; }

#vitals { position: absolute; left: 22px; bottom: 22px; width: 340px; display: flex;
  flex-direction: column; gap: 6px; }
.bar { position: relative; height: 24px; background: #0e1109; border: 1px solid var(--line);
  overflow: hidden; }
.bar i { position: absolute; inset: 0; width: 0%; display: block; }
.bar.hp i { background: linear-gradient(180deg, #63d06b, var(--hp)); }
.bar.shield i { background: linear-gradient(180deg, #6fa8bd, var(--shield)); }
.bar span { position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  font-size: 13px; font-weight: 700; text-shadow: 0 1px 2px #000; font-family: var(--mono); }
.bar.shield { height: 16px; }

#weaponbox { position: absolute; right: 20px; bottom: 20px; width: 290px; text-align: right; }
#ammo { font-weight: 800; font-family: var(--mono); }
#ammo b { font-size: 34px; color: var(--accent2); }
#ammo span { font-size: 16px; opacity: .55; }
#wname { font-size: 14px; opacity: .8; margin-bottom: 8px; text-transform: uppercase;
  letter-spacing: .5px; }
#slots { display: flex; gap: 6px; justify-content: flex-end; pointer-events: auto; touch-action: none; }
.slot { width: 60px; height: 46px; background: #0e1109; border: 1px solid var(--line);
  position: relative; font-size: 10.5px; text-align: center;
  display: flex; align-items: center; justify-content: center; padding: 2px; overflow: hidden;
  cursor: grab; user-select: none; transition: transform .1s; font-family: var(--mono); }
.slot.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.slot .key { position: absolute; top: 1px; left: 3px; opacity: .5; font-size: 9px; }
.slot.empty { opacity: .35; cursor: default; }
.slot.dragging { opacity: .3; transform: scale(.9); }
.slot.r-rare { border-color: #4a8fc9; } .slot.r-epic { border-color: #9a5fd4; }
.slot.r-legendary { border-color: var(--gold); }
#slothint { font-size: 10px; opacity: .35; margin-top: 5px; }
#cons { display: flex; gap: 7px; justify-content: flex-end; margin-top: 7px; font-size: 13px;
  font-family: var(--mono); }
#cons span { background: #0e1109; border: 1px solid var(--line); padding: 3px 8px; }
#reloadtag { margin-top: 6px; font-size: 13px; color: var(--accent2); font-weight: 700;
  font-family: var(--mono); letter-spacing: .5px; }

#dragGhost { position: fixed; z-index: 40; transform: translate(-50%,-50%);
  background: #171a12; border: 1px solid var(--accent2); border-radius: 3px;
  padding: 7px 14px; font-size: 13px; font-weight: 700; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); font-family: var(--mono); }
#dragGhost.bad { border-color: var(--accent); color: #ffb0a8; }
#discardHint { position: fixed; left: 50%; bottom: 130px; transform: translateX(-50%);
  z-index: 39; background: rgba(229,72,77,.14); border: 1px dashed var(--accent);
  color: #ffb0a8; border-radius: 4px; padding: 9px 20px; font-size: 14px;
  font-weight: 700; pointer-events: none; }

#usebar { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%);
  width: 250px; height: 12px; background: #0e1109; border: 1px solid var(--line);
  overflow: hidden; }
#usebar i { display: block; height: 100%; width: 0%; background: var(--shield); }
#usebar span { position: absolute; top: -21px; left: 0; width: 100%; text-align: center;
  font-size: 12px; font-family: var(--mono); }

#exfilbar { position: absolute; left: 50%; top: 30%; transform: translateX(-50%);
  width: 280px; height: 14px; background: #0e1109; border: 1px solid var(--hp);
  overflow: hidden; }
#exfilbar i { display: block; height: 100%; width: 0%; background: var(--hp); }
#exfilbar span { position: absolute; top: -22px; left: 0; width: 100%; text-align: center;
  font-size: 13px; font-family: var(--mono); color: var(--hp); font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; }

#prompt { position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line);
  clip-path: polygon(0 6px, 6px 0, 100% 0, 100% 100%, 0 100%);
  padding: 9px 16px; font-size: 14px; }
#prompt b { color: var(--accent2); }

#mini { position: absolute; top: 18px; left: 18px; background: rgba(9,11,7,.86);
  border: 1px solid var(--line); }

#dropctrl { position: absolute; left: 50%; top: 40%; transform: translate(-50%,-50%);
  text-align: center; }
#dropbig { font-size: 30px; font-weight: 800; text-shadow: 0 2px 12px #000;
  font-family: var(--mono); letter-spacing: 1px; }
#dropsmall { margin-top: 8px; font-size: 15px; opacity: .8; }
#dropsmall b { color: var(--accent2); font-size: 20px; font-family: var(--mono); }

#deadcard, #endcard, #exfilcard { position: absolute; left: 50%; top: 26%; transform: translateX(-50%);
  background: var(--panel); border: 1px solid var(--line);
  clip-path: polygon(0 16px, 16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  padding: 26px 38px; text-align: center; min-width: 360px; position: relative; }
#deadcard::before, #endcard::before, #exfilcard::before { content: ""; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
#deadcard h2, #endcard h2, #exfilcard h2 { font-size: 30px; margin-bottom: 8px; font-family: var(--mono);
  letter-spacing: 1px; text-transform: uppercase; }
#deadcard h2 { color: var(--accent); }
#endcard h2 { color: var(--accent2); }
#exfilcard h2 { color: var(--hp); }
#deadcard p, #endcard p, #exfilcard p { font-size: 15px; margin-bottom: 5px; }

#help { position: absolute; left: 50%; bottom: 6px; transform: translateX(-50%);
  font-size: 11.5px; opacity: .38; white-space: nowrap; font-family: var(--mono); }
#help b { color: var(--accent2); }
@media (max-width: 720px) { #help { display: none; } #weaponbox { width: 210px; } #vitals { width: 240px; } }

/* ---------- admin ---------- */
#godtag { position: absolute; left: 22px; bottom: 72px; font-family: var(--mono);
  font-weight: 800; font-size: 12px; letter-spacing: 1px; color: #7fd0ff;
  text-shadow: 0 1px 4px #000; }
#adminToggle { position: absolute; left: 22px; bottom: 92px; pointer-events: auto;
  padding: 7px 14px; font-size: 11.5px; font-weight: 800; letter-spacing: .5px;
  text-transform: uppercase; font-family: var(--mono); cursor: pointer;
  background: #10161c; border: 1px solid #7fd0ff; color: #7fd0ff; }
#adminToggle:hover { background: #16202a; }
#adminToggle.on { background: #7fd0ff; color: #08222e; }
#adminPanel { position: absolute; left: 22px; bottom: 132px; width: 320px; max-height: 60vh;
  display: flex; flex-direction: column; pointer-events: auto;
  background: var(--panel); border: 1px solid #7fd0ff;
  clip-path: polygon(0 14px, 14px 0, 100% 0, 100% 100%, 0 100%);
  padding: 14px 16px; font-size: 12.5px; }
.admin-head { font-family: var(--mono); font-weight: 800; letter-spacing: .5px;
  color: #7fd0ff; margin-bottom: 10px; text-transform: uppercase; font-size: 12px; }
.admin-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-bottom: 4px; }
.admin-actions button { padding: 8px 6px; font-size: 11px; font-weight: 700;
  background: #12150e; border: 1px solid var(--line); color: var(--text); cursor: pointer;
  font-family: var(--mono); }
.admin-actions button:hover { border-color: #7fd0ff; color: #7fd0ff; }
.admin-actions button.on { background: #7fd0ff; border-color: #7fd0ff; color: #08222e; }
#adminPlayers { overflow-y: auto; margin-top: 4px; }
.admin-row { display: flex; align-items: center; gap: 6px; padding: 6px 0;
  border-bottom: 1px solid var(--line); font-size: 12px; }
.admin-row:last-child { border-bottom: none; }
.admin-row .lb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .arow-hp { font-family: var(--mono); opacity: .7; flex: none; width: 34px; }
.admin-row.dead .lb-name, .admin-row.dead .arow-hp { opacity: .35; text-decoration: line-through; }
.admin-row button { flex: none; padding: 4px 8px; font-size: 10.5px; font-weight: 700;
  background: #12150e; border: 1px solid var(--accent-dim); color: #ffb0a8; cursor: pointer;
  font-family: var(--mono); }
.admin-row button:hover { border-color: var(--accent); }
.admin-row button:disabled { opacity: .3; cursor: default; }

#extraAdmin .field { margin-top: 0; margin-bottom: 12px; }
.admin-row select { flex: none; background: #0a0c08; color: var(--text); border: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px; padding: 5px 4px; }
.admin-row select:focus { border-color: #7fd0ff; outline: none; }
.tag-banned { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .5px;
  border: 1px solid var(--accent-dim); padding: 1px 5px; margin-left: 6px; }
.tag-role { color: #7fd0ff; font-size: 9.5px; opacity: .8; }
