/* ============================================================
   VALORIS — style tactical shooter (sombre, anguleux, rouge/teal)
   ============================================================ */
@font-face { font-family: 'Rajdhani'; src: url('../vendor/Rajdhani-500.woff2') format('woff2'); font-weight: 500; }
@font-face { font-family: 'Rajdhani'; src: url('../vendor/Rajdhani-600.woff2') format('woff2'); font-weight: 600; }
@font-face { font-family: 'Rajdhani'; src: url('../vendor/Rajdhani-700.woff2') format('woff2'); font-weight: 700; }
@font-face { font-family: 'Teko'; src: url('../vendor/Teko-500.woff2') format('woff2'); font-weight: 500; }
@font-face { font-family: 'Teko'; src: url('../vendor/Teko-600.woff2') format('woff2'); font-weight: 600; }

:root {
  --bg: #0f1923;
  --bg2: #16232f;
  --panel: rgba(22, 35, 47, 0.85);
  --line: rgba(140, 165, 180, 0.18);
  --red: #ff4655;
  --teal: #0ac8b9;
  --blue: #3ee6c4;
  --text: #ece8e1;
  --dim: #8b9baa;
  --gold: #e8c15a;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Rajdhani', 'Segoe UI', sans-serif;
  font-weight: 500;
  user-select: none;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
kbd {
  background: #223140; border: 1px solid var(--line); border-bottom-width: 3px;
  padding: 2px 9px; border-radius: 4px; font-family: inherit; font-weight: 700;
  font-size: 13px; letter-spacing: 1px; white-space: nowrap;
}

/* ==================== LOBBY ==================== */
#lobby { position: fixed; inset: 0; display: flex; flex-direction: column; }
.lobby-bg {
  position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(1100px 500px at 70% -10%, rgba(10, 200, 185, 0.10), transparent 60%),
    radial-gradient(900px 600px at 15% 110%, rgba(255, 70, 85, 0.10), transparent 60%),
    linear-gradient(160deg, #101c28 0%, #0f1923 55%, #0c141d 100%);
}
.lobby-bg::after {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(140,165,180,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140,165,180,0.05) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(800px 600px at 50% 40%, black, transparent 80%);
}

.topbar {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 26px; border-bottom: 1px solid var(--line);
  background: rgba(12, 20, 29, 0.7); backdrop-filter: blur(6px);
}
.logo {
  font-family: 'Teko'; font-size: 34px; letter-spacing: 3px; line-height: 0.9;
  display: flex; align-items: baseline; gap: 2px;
}
.logo span { color: var(--red); }
.logo small {
  font-family: 'Rajdhani'; font-size: 10px; letter-spacing: 4px; color: var(--dim);
  margin-left: 12px; font-weight: 600;
}
.topnav { display: flex; gap: 4px; flex: 1; }
.navbtn {
  background: none; border: none; color: var(--dim); font-weight: 700;
  font-size: 15px; letter-spacing: 2px; padding: 10px 18px; position: relative;
}
.navbtn:hover { color: var(--text); }
.navbtn.active { color: var(--text); }
.navbtn.active::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px;
  background: var(--red); clip-path: polygon(0 0, 100% 0, calc(100% - 4px) 100%, 4px 100%);
}
.profile { display: flex; align-items: center; gap: 12px; }
.level-hex {
  width: 46px; height: 46px; display: grid; place-items: center;
  background: linear-gradient(160deg, #22384a, #16232f);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  border: 1px solid var(--line); font-family: 'Teko'; font-size: 24px; color: var(--gold);
}
.profile-mid { width: 170px; }
#profile-name {
  background: none; border: none; color: var(--text); font-family: inherit;
  font-weight: 700; font-size: 16px; letter-spacing: 1.5px; width: 100%;
  border-bottom: 1px dashed transparent; outline: none;
}
#profile-name:hover, #profile-name:focus { border-bottom-color: var(--dim); }
.xpbar { height: 5px; background: #223140; margin-top: 4px; overflow: hidden; }
.xpbar > div { height: 100%; width: 0%; background: linear-gradient(90deg, var(--teal), var(--blue)); transition: width 0.6s ease; }
.xpbar.big { height: 10px; }
.xptext { font-size: 11px; color: var(--dim); letter-spacing: 1px; margin-top: 2px; }
.credits {
  font-weight: 700; font-size: 18px; color: var(--gold);
  background: rgba(232, 193, 90, 0.08); border: 1px solid rgba(232, 193, 90, 0.3);
  padding: 8px 14px; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
}

.lobby-main { flex: 1; display: grid; grid-template-columns: 250px 1fr 340px; gap: 18px; padding: 18px 26px; min-height: 0; }
.side-title {
  font-size: 13px; letter-spacing: 3px; color: var(--dim); font-weight: 700;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px;
}
.side-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }
#roster-count { color: var(--teal); }
.rpg-tag {
  background: var(--red); color: white; font-size: 10px; padding: 1px 7px; letter-spacing: 2px;
  clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
}

.roster { display: flex; flex-direction: column; min-height: 0; }
#agent-list { display: flex; flex-direction: column; gap: 10px; overflow-y: auto; }
.agent-card {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--panel); border: 1px solid var(--line); cursor: pointer;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
  transition: transform 0.12s ease, border-color 0.12s;
  position: relative;
}
.agent-card:hover { transform: translateX(4px); border-color: rgba(140,165,180,0.45); }
.agent-card.selected { border-color: var(--ac, var(--teal)); background: linear-gradient(90deg, rgba(255,255,255,0.06), var(--panel)); }
.agent-card.selected::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--ac, var(--teal));
}
.agent-portrait {
  width: 52px; height: 52px; display: grid; place-items: center; flex: none;
  font-family: 'Teko'; font-size: 30px; color: white;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
}
.agent-card-info { flex: 1; min-width: 0; }
.agent-card-info b { display: block; font-size: 17px; letter-spacing: 2px; }
.agent-card-info span { font-size: 12px; color: var(--dim); letter-spacing: 1px; }
.agent-mastery {
  font-size: 11px; color: var(--gold); border: 1px solid rgba(232,193,90,0.35);
  padding: 2px 6px; white-space: nowrap;
}
.roster-foot { margin-top: 12px; font-size: 12px; color: var(--dim); line-height: 1.4; }

.stage { position: relative; min-height: 0; border: 1px solid var(--line); background: radial-gradient(600px 420px at 50% 68%, rgba(10,200,185,0.07), transparent 70%), rgba(10, 17, 24, 0.5); overflow: hidden; }
#preview-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; }
#preview-canvas:active { cursor: grabbing; }
.stage-glow { position: absolute; left: 50%; bottom: 8%; width: 420px; height: 60px; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(10,200,185,0.22), transparent); pointer-events: none; }
.agent-title { position: absolute; left: 26px; top: 22px; pointer-events: none; }
.role-chip {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 3px;
  color: var(--ac, var(--teal)); border: 1px solid currentColor; padding: 3px 10px; margin-bottom: 8px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
#agent-name { font-family: 'Teko'; font-size: 76px; line-height: 0.9; letter-spacing: 4px; text-shadow: 0 4px 30px rgba(0,0,0,0.6); }
#agent-tagline { color: var(--dim); font-size: 15px; letter-spacing: 1px; margin-top: 4px; }
.drag-hint { position: absolute; right: 16px; bottom: 12px; font-size: 12px; color: var(--dim); letter-spacing: 1px; pointer-events: none; }

.details { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; min-height: 0; }
.panel { background: var(--panel); border: 1px solid var(--line); padding: 16px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%); }
.ability { display: flex; gap: 12px; margin-bottom: 12px; }
.ab-key {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  font-family: 'Teko'; font-size: 26px; color: var(--text);
  background: #223140; border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 9px), calc(100% - 9px) 100%, 0 100%);
}
.ab-key.ultkey { background: linear-gradient(160deg, #4a3a12, #2c2410); color: var(--gold); border-color: rgba(232,193,90,0.4); }
.ab-body b { font-size: 16px; letter-spacing: 1px; }
.ab-body p { font-size: 13px; color: var(--dim); line-height: 1.35; margin: 2px 0; }
.ab-meta { font-size: 11px; letter-spacing: 1.5px; color: var(--teal); font-weight: 700; }
.ability.ult .ab-meta { color: var(--gold); }
.agent-desc { font-size: 13px; color: var(--dim); line-height: 1.45; border-top: 1px solid var(--line); padding-top: 10px; margin-top: 4px; }
.statbars { margin-top: 10px; display: flex; flex-direction: column; gap: 5px; }
.statrow { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 1.5px; color: var(--dim); }
.statrow label { width: 84px; }
.statdots { display: flex; gap: 4px; }
.statdots i { width: 16px; height: 6px; background: #223140; }
.statdots i.on { background: var(--ac, var(--teal)); }

#upgrade-list { display: flex; flex-direction: column; gap: 10px; }
.upg { display: flex; align-items: center; gap: 10px; }
.upg-icon { font-size: 20px; width: 30px; text-align: center; color: var(--teal); }
.upg-info { flex: 1; min-width: 0; }
.upg-info b { font-size: 14px; letter-spacing: 0.5px; display: block; }
.upg-info span { font-size: 11.5px; color: var(--dim); }
.upg-pips { display: flex; gap: 3px; margin-top: 3px; }
.upg-pips i { width: 14px; height: 5px; background: #223140; }
.upg-pips i.on { background: var(--gold); }
.upg-buy {
  background: rgba(232,193,90,0.1); border: 1px solid rgba(232,193,90,0.4); color: var(--gold);
  font-weight: 700; font-size: 12px; padding: 6px 9px; letter-spacing: 0.5px; white-space: nowrap;
}
.upg-buy:hover:not(:disabled) { background: rgba(232,193,90,0.25); }
.upg-buy:disabled { opacity: 0.35; cursor: not-allowed; }
.upg-buy.maxed { border-color: var(--teal); color: var(--teal); opacity: 0.8; }
.career { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--dim); letter-spacing: 1px; }

.playbar {
  display: flex; align-items: center; gap: 22px; padding: 14px 26px;
  border-top: 1px solid var(--line); background: rgba(12, 20, 29, 0.8);
}
.mode-card { display: flex; align-items: center; gap: 14px; }
.mode-badge {
  background: var(--red); color: white; font-size: 11px; font-weight: 700; letter-spacing: 2px;
  padding: 5px 10px; clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
}
.mode-info b { font-family: 'Teko'; font-size: 28px; letter-spacing: 2px; display: block; line-height: 1; }
.mode-info span { font-size: 12.5px; color: var(--dim); letter-spacing: 1px; }
.mode-desc { flex: 1; font-size: 12.5px; color: var(--dim); line-height: 1.35; max-width: 460px; }
#btn-play {
  margin-left: auto; border: none; background: var(--red); color: white;
  font-family: 'Teko'; font-size: 26px; letter-spacing: 3px; padding: 12px 34px 8px;
  clip-path: polygon(14px 0, 100% 0, calc(100% - 14px) 100%, 0 100%);
  display: flex; align-items: center; gap: 14px; transition: filter 0.12s, transform 0.12s;
  box-shadow: 0 0 34px rgba(255, 70, 85, 0.35);
}
#btn-play:hover { filter: brightness(1.15); transform: translateY(-1px); }
#btn-play i { font-style: normal; font-size: 22px; }

/* ==================== JEU / HUD ==================== */
#game-screen { position: fixed; inset: 0; background: #000; }
#game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#hud { position: absolute; inset: 0; pointer-events: none; font-weight: 600; }

#score-pill {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 0; background: rgba(10, 16, 22, 0.72);
  border: 1px solid var(--line); clip-path: polygon(12px 0, calc(100% - 12px) 0, 100% 100%, 0 100%);
}
.sc { font-family: 'Teko'; font-size: 34px; padding: 2px 20px 0; line-height: 1.15; }
.sc.blue { color: var(--blue); }
.sc.red { color: var(--red); }
.timer { font-family: 'Teko'; font-size: 26px; padding: 6px 16px 2px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); color: var(--text); }
.timer.urgent { color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.5; } }

#minimap {
  position: absolute; top: 14px; left: 14px;
  background: rgba(10, 16, 22, 0.72); border: 1px solid var(--line);
}
#killfeed { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
.kf {
  background: rgba(10, 16, 22, 0.75); border: 1px solid var(--line); padding: 4px 12px;
  font-size: 14px; letter-spacing: 0.5px; display: flex; gap: 8px; align-items: center;
  animation: kfin 0.18s ease; clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%);
}
@keyframes kfin { from { transform: translateX(30px); opacity: 0; } }
.kf .k { font-weight: 700; }
.kf .k.blue { color: var(--blue); } .kf .k.red { color: var(--red); }
.kf .w { color: var(--dim); font-size: 12px; }
.kf.mine { border-color: var(--gold); box-shadow: 0 0 12px rgba(232,193,90,0.25); }
.kf .hs { color: var(--gold); }

#health-block { position: absolute; left: 22px; bottom: 20px; }
.hp-row { display: flex; align-items: flex-end; gap: 12px; }
#hp-num { font-family: 'Teko'; font-size: 58px; line-height: 0.85; min-width: 76px; text-shadow: 0 2px 12px rgba(0,0,0,0.8); }
#hp-num.low { color: var(--red); animation: pulse 0.9s infinite; }
.bars { display: flex; flex-direction: column; gap: 4px; padding-bottom: 6px; }
.bar { width: 190px; height: 9px; background: rgba(10,16,22,0.75); border: 1px solid var(--line); }
.bar > div { height: 100%; transition: width 0.15s ease; }
.bar.hp > div { background: linear-gradient(90deg, #d8e6df, #ffffff); width: 100%; }
.bar.hp.low > div { background: var(--red); }
.bar.sh { height: 6px; }
.bar.sh > div { background: var(--blue); width: 0%; }
.hp-agent { font-size: 12px; letter-spacing: 3px; color: var(--dim); margin-top: 5px; }

#abilities-hud { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; gap: 14px; }
.hud-ab {
  width: 62px; height: 62px; position: relative; display: grid; place-items: center;
  background: rgba(10, 16, 22, 0.75); border: 1px solid var(--line);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}
.hud-ab-icon { font-size: 24px; color: var(--teal); position: relative; z-index: 2; }
.hud-ab.ult .hud-ab-icon { color: var(--gold); }
.hud-ab.ready { border-color: var(--teal); box-shadow: 0 0 14px rgba(10,200,185,0.3); }
.hud-ab.ult.ready { border-color: var(--gold); box-shadow: 0 0 18px rgba(232,193,90,0.45); animation: pulse 1.4s infinite; }
.cd-sweep { position: absolute; inset: 0; z-index: 1; }
.ult-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 0%; background: rgba(232,193,90,0.22); z-index: 1; transition: height 0.3s; }
.hud-ab-cd { position: absolute; z-index: 3; font-family: 'Teko'; font-size: 22px; color: white; text-shadow: 0 1px 4px black; }
.hud-key {
  position: absolute; bottom: -1px; right: -1px; z-index: 4; background: #223140;
  font-size: 11px; font-weight: 700; padding: 1px 6px; color: var(--dim);
}
.hud-ab.active-ab { border-color: white; }

#ammo-block { position: absolute; right: 22px; bottom: 20px; text-align: right; }
.ammo-row { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; }
#ammo-num { font-family: 'Teko'; font-size: 58px; line-height: 0.85; text-shadow: 0 2px 12px rgba(0,0,0,0.8); }
#ammo-num.low { color: var(--red); }
.ammo-res { font-family: 'Teko'; font-size: 26px; color: var(--dim); }
.weapon-name { font-size: 12px; letter-spacing: 3px; color: var(--dim); margin-top: 5px; }
#reload-ind { color: var(--gold); font-size: 13px; letter-spacing: 2px; margin-top: 3px; animation: pulse 0.7s infinite; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; --gap: 7px; --len: 9px; }
#crosshair i { position: absolute; background: #eafff5; box-shadow: 0 0 3px rgba(0,0,0,0.9); }
#crosshair .c-t { width: 2px; height: var(--len); left: -1px; bottom: var(--gap); }
#crosshair .c-b { width: 2px; height: var(--len); left: -1px; top: var(--gap); }
#crosshair .c-l { height: 2px; width: var(--len); top: -1px; right: var(--gap); }
#crosshair .c-r { height: 2px; width: var(--len); top: -1px; left: var(--gap); }
#crosshair .c-dot { width: 2px; height: 2px; left: -1px; top: -1px; }
#hitmarker { position: absolute; left: 50%; top: 50%; }
#hitmarker i { position: absolute; width: 3px; height: 10px; background: white; box-shadow: 0 0 4px black; }
#hitmarker i:nth-child(1) { transform: translate(-9px, -13px) rotate(-45deg); }
#hitmarker i:nth-child(2) { transform: translate(6px, -13px) rotate(45deg); }
#hitmarker i:nth-child(3) { transform: translate(-9px, 3px) rotate(45deg); }
#hitmarker i:nth-child(4) { transform: translate(6px, 3px) rotate(-45deg); }
#hitmarker.head i { background: var(--gold); }
#hitmarker.kill i { background: var(--red); }

#kill-banner {
  position: absolute; left: 50%; bottom: 108px; transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; background: rgba(10,16,22,0.8);
  border: 1px solid rgba(255,70,85,0.5); padding: 6px 20px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%);
  animation: kfin 0.15s ease;
}
#kill-banner .skull { color: var(--red); font-size: 20px; }
#kill-banner-text { font-weight: 700; letter-spacing: 3px; font-size: 15px; }
#streak-banner {
  position: absolute; left: 50%; top: 22%; transform: translateX(-50%);
  font-family: 'Teko'; font-size: 44px; letter-spacing: 6px; color: var(--gold);
  text-shadow: 0 0 24px rgba(232,193,90,0.6), 0 2px 6px black; animation: kfin 0.2s ease;
}
#hint-bar {
  position: absolute; bottom: 2px; left: 50%; transform: translateX(-50%);
  font-size: 11px; color: rgba(139,155,170,0.65); letter-spacing: 1px;
}

#damage-vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 52%, rgba(200, 20, 30, 0.55) 100%); transition: opacity 0.25s; }
#heal-vignette { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, transparent 60%, rgba(10, 200, 150, 0.30) 100%); transition: opacity 0.4s; }
#flash-overlay { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: white; }

/* overlays */
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(8, 13, 19, 0.72); backdrop-filter: blur(4px); z-index: 20; }
#countdown-overlay { background: rgba(8,13,19,0.35); backdrop-filter: none; }
#countdown-num { font-family: 'Teko'; font-size: 150px; color: var(--text); text-shadow: 0 0 50px rgba(10,200,185,0.5); line-height: 1; }
#countdown-label { position: absolute; bottom: 30%; letter-spacing: 6px; color: var(--dim); font-weight: 700; }
#respawn-overlay { background: rgba(30, 8, 12, 0.55); }
.respawn-box { text-align: center; }
.respawn-title { font-family: 'Teko'; font-size: 54px; letter-spacing: 5px; color: var(--red); }
.respawn-killer { font-size: 19px; letter-spacing: 2px; margin-bottom: 12px; }
.respawn-count { font-family: 'Teko'; font-size: 90px; line-height: 1; color: var(--text); }
.respawn-tip { color: var(--dim); margin-top: 14px; font-size: 14px; letter-spacing: 1px; }

.ctp-box { text-align: center; cursor: pointer; }
.ctp-title { font-family: 'Teko'; font-size: 42px; letter-spacing: 4px; animation: pulse 1.6s infinite; }
.ctp-sub { color: var(--dim); letter-spacing: 1px; margin-top: 6px; }

.menu-box {
  background: var(--panel); border: 1px solid var(--line); padding: 34px 44px;
  display: flex; flex-direction: column; gap: 12px; min-width: 340px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%);
}
.menu-box h2 { font-family: 'Teko'; font-size: 42px; letter-spacing: 4px; margin-bottom: 8px; }
.menubtn {
  background: #223140; border: 1px solid var(--line); color: var(--text);
  font-weight: 700; font-size: 16px; letter-spacing: 2.5px; padding: 12px 22px;
  clip-path: polygon(9px 0, 100% 0, calc(100% - 9px) 100%, 0 100%);
}
.menubtn:hover { background: #2c3f52; }
.menubtn.primary { background: var(--red); border-color: var(--red); }
.menubtn.primary:hover { filter: brightness(1.15); background: var(--red); }
.menubtn.danger { color: var(--red); border-color: rgba(255,70,85,0.4); background: rgba(255,70,85,0.07); }
.pause-sens { margin-top: 10px; }
.pause-sens label { font-size: 13px; color: var(--dim); letter-spacing: 1px; display: block; margin-bottom: 4px; }
input[type=range] { width: 100%; accent-color: var(--red); }

#scoreboard { background: rgba(8,13,19,0.6); }
.sb-box { width: min(860px, 92vw); background: var(--panel); border: 1px solid var(--line); padding: 22px 26px; }
.sb-head { display: flex; justify-content: space-between; letter-spacing: 3px; font-weight: 700; color: var(--dim); margin-bottom: 14px; }
#sb-score { font-family: 'Teko'; font-size: 26px; color: var(--text); letter-spacing: 2px; }
.sb-teams { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.sb-team h4 { letter-spacing: 2px; font-size: 13px; margin-bottom: 8px; padding-bottom: 6px; border-bottom: 2px solid; }
.sb-team.blue h4 { color: var(--blue); border-color: var(--blue); }
.sb-team.red h4 { color: var(--red); border-color: var(--red); }
.sb-team table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sb-team td, .sb-team th { padding: 5px 8px; text-align: left; }
.sb-team th { color: var(--dim); font-size: 11px; letter-spacing: 2px; }
.sb-team td.num, .sb-team th.num { text-align: right; font-family: 'Teko'; font-size: 17px; }
.sb-team tr.me td { background: rgba(232,193,90,0.10); color: var(--gold); font-weight: 700; }
.sb-team tr.dead td { opacity: 0.45; }

#end-overlay { background: rgba(8,13,19,0.88); }
.end-box { width: min(620px, 92vw); text-align: center; }
#end-title { font-family: 'Teko'; font-size: 96px; letter-spacing: 10px; line-height: 1; }
#end-title.win { color: var(--blue); text-shadow: 0 0 60px rgba(62,230,196,0.4); }
#end-title.lose { color: var(--red); text-shadow: 0 0 60px rgba(255,70,85,0.4); }
#end-title.draw { color: var(--gold); }
#end-score { font-family: 'Teko'; font-size: 34px; color: var(--dim); letter-spacing: 4px; margin-bottom: 18px; }
.end-stats { display: flex; justify-content: center; gap: 34px; margin-bottom: 16px; }
.end-stat b { font-family: 'Teko'; font-size: 40px; display: block; line-height: 1; }
.end-stat span { font-size: 12px; letter-spacing: 2px; color: var(--dim); }
.end-rewards { display: flex; justify-content: center; gap: 22px; margin-bottom: 18px; font-weight: 700; letter-spacing: 1px; }
.end-rewards .rxp { color: var(--teal); } .end-rewards .rcred { color: var(--gold); } .end-rewards .rmast { color: #b48cff; }
.end-xp { margin: 0 auto 22px; max-width: 440px; }
.end-xp-label { display: flex; justify-content: space-between; font-size: 13px; letter-spacing: 1.5px; color: var(--dim); margin-bottom: 5px; }
#end-level { color: var(--gold); font-weight: 700; }
.end-btns { display: flex; justify-content: center; gap: 14px; }

#loading-overlay { position: fixed; z-index: 50; background: linear-gradient(160deg, #101c28, #0c141d); }
.load-box { text-align: center; width: min(560px, 90vw); }
.load-mode { letter-spacing: 5px; color: var(--red); font-weight: 700; margin-bottom: 6px; }
.load-map { font-family: 'Teko'; font-size: 92px; letter-spacing: 8px; line-height: 1; margin-bottom: 22px; }
.load-bar { height: 6px; background: #223140; overflow: hidden; }
#load-fill { height: 100%; width: 0%; background: var(--red); transition: width 0.25s ease; }
.load-tip { margin-top: 16px; color: var(--dim); font-size: 14px; letter-spacing: 0.5px; }

/* modales */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(8,13,19,0.7); backdrop-filter: blur(5px); }
.modal-box {
  background: #141f2a; border: 1px solid var(--line); padding: 30px 36px; width: min(430px, 92vw);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
  display: flex; flex-direction: column; gap: 16px; max-height: 88vh; overflow-y: auto;
}
.modal-box.wide { width: min(720px, 94vw); }
.modal-box h2 { font-family: 'Teko'; font-size: 38px; letter-spacing: 4px; }
.setting label { display: flex; justify-content: space-between; font-size: 14px; letter-spacing: 1.5px; color: var(--dim); font-weight: 700; margin-bottom: 6px; }
.setting label span { color: var(--text); }
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; background: #223140; color: var(--dim); border: 1px solid var(--line);
  padding: 9px 4px; font-weight: 700; letter-spacing: 1px; font-size: 13.5px;
}
.seg button.on { background: rgba(255,70,85,0.15); color: var(--text); border-color: var(--red); }
.help-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.help-col h4 { color: var(--teal); letter-spacing: 2px; font-size: 13px; margin-bottom: 10px; }
.krow { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; color: var(--dim); }
.help-note { font-size: 13.5px; color: var(--dim); line-height: 1.5; border-top: 1px solid var(--line); padding-top: 14px; }

#toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%); z-index: 70;
  background: #141f2a; border: 1px solid var(--teal); color: var(--text);
  padding: 10px 24px; font-weight: 700; letter-spacing: 1px; font-size: 14.5px;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 100%, 0 100%);
  animation: kfin 0.2s ease;
}
#webgl-error { position: fixed; z-index: 100; }

@media (max-width: 1100px) {
  .lobby-main { grid-template-columns: 210px 1fr 300px; gap: 12px; padding: 12px 16px; }
  #agent-name { font-size: 56px; }
  .mode-desc { display: none; }
}
@media (max-width: 860px) {
  .lobby-main { grid-template-columns: 1fr; grid-template-rows: auto 320px auto; overflow-y: auto; }
  .roster #agent-list { flex-direction: row; }
  .agent-card { flex: 1; }
  .details { flex-direction: row; }
  .details .panel { flex: 1; }
  .topnav { display: none; }
}
