* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #111; font-family: "Segoe UI", Tahoma, sans-serif; color: #fff; user-select: none; }
#game canvas { display: block; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 1px 3px rgba(0,0,0,.9); }
#crosshair { position: absolute; left: 50%; top: 50%; }
#crosshair i { position: absolute; background: #5dff7a; box-shadow: 0 0 2px #000; }
#crosshair .t, #crosshair .b { width: 2px; height: 8px; left: -1px; }
#crosshair .l, #crosshair .r { width: 8px; height: 2px; top: -1px; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; opacity: 0;
  background:
    linear-gradient(45deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, #fff 46%, #fff 54%, transparent 54%);
  -webkit-mask: radial-gradient(circle, transparent 5px, #000 6px); mask: radial-gradient(circle, transparent 5px, #000 6px); }
#hitmarker.kill { filter: hue-rotate(0deg) drop-shadow(0 0 2px red);
  background:
    linear-gradient(45deg, transparent 44%, #ff3b3b 44%, #ff3b3b 56%, transparent 56%),
    linear-gradient(-45deg, transparent 44%, #ff3b3b 44%, #ff3b3b 56%, transparent 56%); }

#scope { position: absolute; inset: 0; }
#scope .lens { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0, transparent 38vh, #000 38.3vh); }
#scope .hl { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000; }
#scope .vl { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #000; }

#damage-flash { position: absolute; inset: 0; opacity: 0; background: radial-gradient(circle, transparent 40%, rgba(200,0,0,.65) 100%); }
#dmg-dir { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; }
#dmg-dir .arrow { position: absolute; left: -40px; top: -150px; width: 80px; height: 26px;
  background: radial-gradient(ellipse at bottom, rgba(255,40,40,.9), transparent 70%); border-radius: 50% 50% 0 0; }

#top-bar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 4px; }
#top-bar > div { background: rgba(0,0,0,.55); padding: 4px 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 4px; }
#top-bar .score { font-size: 26px; font-weight: 700; min-width: 50px; }
#top-bar .score.ct { color: #6fb6ff; } #top-bar .score.t { color: #ffb35c; }
#top-bar .team span { font-size: 18px; font-weight: 700; } #top-bar .team small { font-size: 10px; opacity: .7; }
#top-bar .team.ct span { color: #6fb6ff; } #top-bar .team.t span { color: #ffb35c; }
#timer { font-size: 24px; font-weight: 700; min-width: 80px; font-variant-numeric: tabular-nums; }
#timer.low { color: #ff5050; }

#killfeed { position: absolute; top: 12px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#killfeed div { background: rgba(0,0,0,.6); padding: 4px 10px; border-radius: 3px; font-size: 14px; animation: kf .2s; }
#killfeed div.me { border: 1px solid #e33; }
#killfeed .ct { color: #6fb6ff; font-weight: 600; } #killfeed .t { color: #ffb35c; font-weight: 600; }
#killfeed .w { color: #ddd; margin: 0 6px; font-size: 12px; } #killfeed .hs { color: #ff4a4a; margin-right: 6px; }
@keyframes kf { from { transform: translateX(30px); opacity: 0; } }

#radar { position: absolute; top: 12px; left: 12px; width: 200px; height: 200px; }
#center-msg { position: absolute; top: 24%; left: 0; right: 0; text-align: center; font-size: 34px; font-weight: 800; letter-spacing: 1px; transition: opacity .3s; }
#center-msg small { display: block; font-size: 17px; font-weight: 400; opacity: .85; margin-top: 4px; }
#buy-hint { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); font-size: 15px; color: #ffe27a; }
#spectate { position: absolute; bottom: 90px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.6); padding: 8px 18px; border-radius: 4px; font-size: 16px; }

#bottom-left { position: absolute; left: 20px; bottom: 18px; display: flex; gap: 22px; align-items: flex-end; }
#bottom-left .stat { font-size: 36px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
#bottom-left .ico { font-size: 26px; color: #ffe27a; }
#money { font-size: 26px; font-weight: 700; color: #7dff8a; padding-bottom: 4px; }
#bottom-right { position: absolute; right: 24px; bottom: 18px; text-align: right; }
#weapon-name { font-size: 16px; opacity: .85; }
#ammo-line { font-size: 42px; font-weight: 700; font-variant-numeric: tabular-nums; }
#ammo-line small { font-size: 22px; opacity: .75; }
#slots { font-size: 13px; opacity: .8; margin-top: 2px; }
#slots span { margin-left: 10px; } #slots span.on { color: #ffe27a; font-weight: 700; }

#buy-menu { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(10,14,20,.88); border: 1px solid #ffe27a55; border-radius: 8px; padding: 18px 22px; min-width: 380px; }
#buy-menu h3 { margin-bottom: 10px; color: #ffe27a; display: flex; justify-content: space-between; }
#buy-menu .it { display: flex; justify-content: space-between; padding: 7px 10px; margin: 3px 0; background: rgba(255,255,255,.06); border-radius: 4px; font-size: 16px; }
#buy-menu .it b { color: #ffe27a; margin-right: 10px; }
#buy-menu .it.no { opacity: .35; }
#buy-menu .tip { font-size: 12px; opacity: .6; margin-top: 8px; }

#scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(8,10,14,.9); border-radius: 8px; padding: 18px 24px; min-width: 560px; }
.sb-team { margin-bottom: 14px; }
.sb-team h4 { font-size: 18px; margin-bottom: 6px; display: flex; justify-content: space-between; }
.sb-team.ct h4 { color: #6fb6ff; } .sb-team.t h4 { color: #ffb35c; }
.sb-team table { width: 100%; border-collapse: collapse; font-size: 15px; }
.sb-team td, .sb-team th { padding: 4px 8px; text-align: left; }
.sb-team th { font-size: 12px; opacity: .6; font-weight: 400; }
.sb-team tr.dead td { opacity: .4; } .sb-team tr.me td { color: #ffe27a; }

/* ---------- Меню ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, rgba(30,30,25,.75), rgba(0,0,0,.92)); z-index: 10; }
.panel { background: rgba(20,22,26,.92); border: 1px solid #ffffff1a; border-radius: 12px; padding: 30px 40px; width: 560px; max-width: calc(100vw - 32px); text-align: center; box-shadow: 0 20px 60px #000a; }
.panel.small { width: 340px; }
h1 { font-size: 54px; letter-spacing: 6px; font-weight: 900; }
h1 span { color: #ffb35c; margin-left: 10px; }
h2 { font-size: 34px; margin-bottom: 18px; letter-spacing: 3px; }
.sub { opacity: .65; margin-bottom: 22px; }
.row { margin: 12px 0; text-align: left; }
.row label { display: block; font-size: 13px; opacity: .75; margin-bottom: 6px; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 9px; background: #2a2e35; border: 1px solid #3a3f48; color: #ddd; border-radius: 6px; cursor: pointer; font-size: 14px; }
.seg button.on { background: #ffb35c; color: #1a1a1a; border-color: #ffb35c; font-weight: 700; }
input[type=range] { width: 100%; accent-color: #ffb35c; }
button.big { margin-top: 18px; width: 100%; padding: 14px; font-size: 20px; font-weight: 800; letter-spacing: 3px; background: #ffb35c; color: #1a1a1a; border: none; border-radius: 8px; cursor: pointer; }
button.big:hover { background: #ffc47e; }
#quit-btn { margin-top: 10px; width: 100%; padding: 10px; background: transparent; color: #ccc; border: 1px solid #555; border-radius: 8px; cursor: pointer; }
.controls { margin-top: 18px; font-size: 12.5px; line-height: 1.8; opacity: .7; }
.controls b { color: #ffe27a; font-weight: 600; }
#mo-score { font-size: 40px; font-weight: 800; margin-bottom: 14px; }
#mo-table { text-align: left; }

/* ---------- Сетевая игра ---------- */
input[type=text] { width: 100%; padding: 9px 12px; background: #2a2e35; border: 1px solid #3a3f48; color: #fff; border-radius: 6px; font-size: 15px; outline: none; }
input[type=text]:focus { border-color: #ffb35c; }
.join-row { display: flex; gap: 8px; margin-top: 10px; }
.join-row input { flex: 1; text-transform: uppercase; letter-spacing: 6px; font-size: 20px; font-weight: 700; text-align: center; }
.join-row button { padding: 0 22px; font-size: 16px; font-weight: 800; background: #3a4150; color: #fff; border: none; border-radius: 8px; cursor: pointer; }
.join-row button:hover { background: #4a5263; }
#net-status { min-height: 20px; margin-top: 10px; font-size: 14px; color: #ffb35c; }
#net-status.err { color: #ff6060; }
.code { color: #ffb35c; letter-spacing: 6px; user-select: text; }
#lobby-teams { display: flex; gap: 12px; margin: 10px 0 6px; text-align: left; }
#lobby-teams > div { flex: 1; background: rgba(255,255,255,.05); border-radius: 8px; padding: 10px 14px; min-height: 90px; }
#lobby-teams h4 { font-size: 15px; margin-bottom: 6px; }
#lobby-teams .ct h4 { color: #6fb6ff; } #lobby-teams .t h4 { color: #ffb35c; }
#lobby-teams .p { font-size: 15px; padding: 2px 0; } #lobby-teams .p.me { color: #ffe27a; }
#lobby-teams .p small { opacity: .55; margin-left: 6px; }
#lobby-settings { font-size: 13px; margin: 8px 0 0; }
button.ghost { margin-top: 10px; width: 100%; padding: 10px; background: transparent; color: #ccc; border: 1px solid #555; border-radius: 8px; cursor: pointer; }
button.big:disabled { background: #555; color: #999; cursor: default; }
