:root {
  --t: #e0a040;
  --ct: #5b9bf0;
  --panel: rgba(12, 14, 18, 0.55);
  --panel-strong: rgba(12, 14, 18, 0.86);
  --text: #f1ede4;
  --muted: #a9a59c;
  --good: #8fd16a;
  --bad: #ff5a4a;
  --money: #8fd16a;
  --font: 'Rajdhani', 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; color: var(--text); font-family: var(--font); user-select: none; }
#game { position: fixed; inset: 0; }
#game canvas { display: block; width: 100%; height: 100%; }
.hidden { display: none !important; }
kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid rgba(255,255,255,0.25); border-bottom-width: 3px; border-radius: 4px; font: 600 13px var(--font); text-align: center; background: rgba(255,255,255,0.06); }

/* ---------- ekranlar ---------- */
.screen { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 30;
  background: radial-gradient(ellipse at center, rgba(20,22,28,0.72), rgba(8,9,12,0.94)); }
#login { background: radial-gradient(ellipse at 50% 40%, rgba(40,32,20,0.55) 0%, rgba(12,10,8,0.85) 75%); }
.logo { font-size: 84px; line-height: 1; letter-spacing: 6px; display: flex; gap: 14px; font-weight: 700; }
.logo span { color: var(--text); }
.logo b { color: var(--t); text-shadow: 0 0 30px rgba(224,160,64,0.35); }
.tag { margin: -6px 0 6px; color: var(--muted); font-size: 18px; letter-spacing: 1px; }
#login-form { display: flex; gap: 10px; }
#name { width: 260px; padding: 12px 16px; font: 600 20px var(--font); color: var(--text); background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.18); border-radius: 6px; outline: none; }
#name:focus { border-color: var(--t); }
.btn { padding: 12px 28px; font: 700 19px var(--font); letter-spacing: 1px; color: #1a1408; background: var(--t); border: 0; border-radius: 6px; cursor: pointer; text-transform: uppercase; }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: rgba(255,255,255,0.08); color: var(--text); border: 1px solid rgba(255,255,255,0.18); }
.help { display: grid; grid-template-columns: repeat(3, 170px); gap: 8px 18px; margin-top: 28px; color: var(--muted); font-size: 16px; }
.screen h2 { margin: 0; font-size: 40px; letter-spacing: 2px; text-transform: uppercase; }
.screen .sub { margin: -10px 0 6px; color: var(--muted); }
.teams { display: flex; gap: 24px; }
.team-card { position: relative; width: 300px; height: 330px; padding: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; cursor: pointer;
  border-radius: 10px; border: 2px solid transparent; color: var(--text); font-family: var(--font); text-align: left; transition: transform .12s, border-color .12s; }
.team-card.t { background: linear-gradient(160deg, rgba(224,160,64,0.35), rgba(60,40,15,0.6)); }
.team-card.ct { background: linear-gradient(160deg, rgba(91,155,240,0.35), rgba(15,30,60,0.6)); }
.team-card:hover { transform: translateY(-4px); }
.team-card.t:hover { border-color: var(--t); }
.team-card.ct:hover { border-color: var(--ct); }
.team-card .tn { font-size: 30px; font-weight: 700; }
.team-card .cnt { color: var(--muted); font-size: 17px; }
.team-card .list { font-size: 18px; line-height: 1.5; white-space: pre-line; }
.team-card .key { position: absolute; right: 16px; bottom: 12px; font-size: 42px; font-weight: 700; opacity: 0.25; }
.row { display: flex; gap: 12px; }
.settings { display: grid; gap: 14px; margin-top: 16px; width: 360px; }
.settings label { display: grid; grid-template-columns: 1fr auto; gap: 4px; font-size: 17px; color: var(--muted); }
.settings input { grid-column: 1 / -1; accent-color: var(--t); }
.settings output { color: var(--text); font-weight: 700; }
#pause .btn { width: 280px; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; text-shadow: 0 1px 2px rgba(0,0,0,0.7); }
#vignette { position: absolute; inset: 0; opacity: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(170,0,0,0.6) 100%); transition: opacity .25s; }
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; background: #6dff6d; box-shadow: 0 0 0 1px rgba(0,0,0,0.6); }
#crosshair .t, #crosshair .b { width: 2px; height: 7px; left: -1px; }
#crosshair .l, #crosshair .r { width: 7px; height: 2px; top: -1px; }
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hitmarker i { position: absolute; width: 10px; height: 2px; background: #fff; box-shadow: 0 0 2px #000; }
#hitmarker i:nth-child(1) { transform: translate(-16px,-12px) rotate(45deg); }
#hitmarker i:nth-child(2) { transform: translate(6px,-12px) rotate(-45deg); }
#hitmarker i:nth-child(3) { transform: translate(-16px,10px) rotate(-45deg); }
#hitmarker i:nth-child(4) { transform: translate(6px,10px) rotate(45deg); }
#hitmarker.kill i { background: var(--bad); }
#dmg-dirs { position: absolute; left: 50%; top: 50%; }
.dmg-dir { position: absolute; left: -60px; top: -170px; width: 120px; height: 40px; transform-origin: 60px 170px;
  background: radial-gradient(ellipse at 50% 100%, rgba(255,40,30,0.85), rgba(255,40,30,0) 70%); border-radius: 50% 50% 0 0; transition: opacity .8s; }
#scope { position: absolute; inset: 0; background: radial-gradient(circle at center, transparent 0, transparent 38vh, #000 38.2vh); }
#scope::before, #scope::after { content: ''; position: absolute; background: #000; }
#scope::before { left: 0; right: 0; top: 50%; height: 1px; }
#scope::after { top: 0; bottom: 0; left: 50%; width: 1px; }

#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 4px; }
#topbar .side { display: flex; align-items: center; gap: 8px; padding: 0 10px; background: var(--panel); min-width: 150px; }
#topbar .side.t { justify-content: flex-end; border-bottom: 3px solid var(--t); }
#topbar .side.ct { border-bottom: 3px solid var(--ct); }
#topbar .score { font-size: 34px; font-weight: 700; min-width: 30px; text-align: center; }
#topbar .t .score { color: var(--t); }
#topbar .ct .score { color: var(--ct); }
#topbar .mid { background: var(--panel-strong); padding: 4px 18px; text-align: center; min-width: 110px; }
#timer { font-size: 30px; font-weight: 700; line-height: 1; }
#timer.urgent { color: var(--bad); }
#phase { font-size: 13px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.alive { display: flex; gap: 3px; }
.alive i { width: 9px; height: 22px; border-radius: 2px; }
.t .alive i { background: var(--t); }
.ct .alive i { background: var(--ct); }
.alive i.dead { background: rgba(255,255,255,0.15) !important; }

#radar-wrap { position: absolute; left: 14px; top: 14px; }
#radar { display: block; border-radius: 50%; background: rgba(10,12,14,0.55); box-shadow: 0 0 0 2px rgba(255,255,255,0.12); }
#location { margin-top: 6px; text-align: center; font-size: 17px; font-weight: 600; color: var(--text); }
#money { position: absolute; left: 16px; top: 270px; font-size: 30px; font-weight: 700; color: var(--money); }
#money .cur { font-size: 22px; margin-right: 2px; }
#money-delta { position: absolute; left: calc(100% + 10px); top: 8px; font-size: 18px; white-space: nowrap; transition: opacity .6s; }
#buy-hint { position: absolute; left: 16px; top: 314px; font-size: 16px; color: var(--muted); }
#buy-hint b { color: var(--text); }

#killfeed { position: absolute; right: 14px; top: 22px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kf { padding: 4px 10px; background: var(--panel); font-size: 18px; font-weight: 600; display: flex; gap: 8px; align-items: center; transition: opacity .4s; }
.kf.me { box-shadow: inset 0 0 0 2px var(--bad); }
.kf .w { color: var(--muted); font-size: 15px; }
.kf .hs { color: var(--bad); font-size: 14px; }
.tT { color: var(--t); } .tCT { color: var(--ct); }

#center { position: absolute; top: 22%; left: 50%; transform: translateX(-50%); text-align: center; font-size: 42px; font-weight: 700; letter-spacing: 1px; opacity: 0; transition: opacity .3s; white-space: nowrap; }
#center.show { opacity: 1; }
#center .banner { padding: 10px 40px; background: var(--panel-strong); }
#notice { position: absolute; top: 34%; left: 50%; transform: translateX(-50%); font-size: 20px; color: var(--text); opacity: 0; transition: opacity .3s; }
#notice.show { opacity: 1; }

#bl { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 6px; }
.stat { display: flex; align-items: center; gap: 8px; padding: 6px 14px; background: var(--panel); font-size: 36px; font-weight: 700; min-width: 120px; }
.stat svg { width: 24px; height: 24px; fill: currentColor; opacity: 0.85; }
.stat.low { color: var(--bad); }
#helmet { font-size: 14px; color: var(--muted); }

#br { position: absolute; right: 16px; bottom: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#slots { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.slot { padding: 2px 10px; font-size: 16px; color: var(--muted); background: rgba(12,14,18,0.35); }
.slot.on { color: var(--text); background: var(--panel); border-right: 3px solid var(--t); }
.slot .n { opacity: 0.5; margin-right: 6px; }
#ammo { padding: 4px 16px; background: var(--panel); font-weight: 700; }
#mag { font-size: 42px; }
#mag.low { color: var(--bad); }
#reserve { font-size: 22px; color: var(--muted); margin-left: 6px; }
#reload-bar { width: 160px; height: 4px; background: rgba(255,255,255,0.15); opacity: 0; }
#reload-bar i { display: block; height: 100%; width: 0; background: var(--text); }

#death { position: absolute; bottom: 120px; left: 50%; transform: translateX(-50%); padding: 10px 24px; background: var(--panel-strong); font-size: 22px; text-align: center; }
#death small { display: block; color: var(--muted); font-size: 16px; }
#spec { position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%); padding: 6px 20px; background: var(--panel); font-size: 20px; }

#chat { position: absolute; left: 16px; bottom: 100px; width: 420px; }
#chat-log { display: flex; flex-direction: column; gap: 2px; font-size: 17px; }
#chat-log div { transition: opacity .5s; }
#chat-log .who { font-weight: 700; }
#chat-box { display: flex; gap: 6px; align-items: center; margin-top: 4px; background: var(--panel-strong); padding: 4px 8px; pointer-events: auto; }
#chat-mode { color: var(--muted); }
#chat-input { flex: 1; background: transparent; border: 0; outline: none; color: var(--text); font: 600 17px var(--font); }
#netstat { position: absolute; right: 14px; top: 2px; font-size: 13px; color: var(--muted); }

/* ---------- skor tablosu ---------- */
#scoreboard { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; width: min(820px, 92vw); background: var(--panel-strong); padding: 18px 22px; pointer-events: none; }
#scoreboard .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-size: 18px; color: var(--muted); }
#scoreboard .head b { color: var(--text); font-size: 24px; }
#scoreboard table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: 19px; }
#scoreboard th { text-align: left; font-size: 14px; color: var(--muted); font-weight: 600; padding: 4px 8px; }
#scoreboard td { padding: 5px 8px; border-top: 1px solid rgba(255,255,255,0.07); }
#scoreboard td.n, #scoreboard th.n { text-align: right; width: 60px; }
#scoreboard tr.dead td { opacity: 0.45; }
#scoreboard tr.me td { background: rgba(255,255,255,0.06); }
#scoreboard .tt { font-size: 22px; font-weight: 700; padding: 4px 8px; }
#scoreboard .tt span { float: right; }

/* ---------- satın alma ---------- */
#buymenu { position: fixed; inset: 0; z-index: 25; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.35); }
.buy-panel { width: min(1100px, 96vw); background: var(--panel-strong); padding: 20px 24px; border-top: 3px solid var(--t); }
.buy-panel.ct { border-top-color: var(--ct); }
.buy-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.buy-top h3 { margin: 0; font-size: 28px; letter-spacing: 1px; text-transform: uppercase; }
.buy-top .m { color: var(--money); font-size: 28px; font-weight: 700; }
.buy-top .tl { color: var(--muted); font-size: 16px; }
.buy-cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.buy-col.sel h4 { color: var(--text); }
.buy-col.sel .buy-item:not(.no) { border-color: rgba(255,255,255,0.35); }
.buy-col .cn { display: inline-block; min-width: 18px; margin-right: 6px; padding: 0 4px; border: 1px solid rgba(255,255,255,0.25); border-radius: 3px; text-align: center; }
.buy-col h4 { margin: 0 0 8px; font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.buy-item { display: block; width: 100%; margin-bottom: 8px; padding: 10px 12px; text-align: left; cursor: pointer; font-family: var(--font); color: var(--text);
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.1); border-radius: 4px; }
.buy-item:hover { background: rgba(255,255,255,0.14); border-color: rgba(255,255,255,0.3); }
.buy-item .nm { display: block; font-size: 19px; font-weight: 700; }
.buy-item .pr { font-size: 16px; color: var(--money); }
.buy-item .k { float: right; color: var(--muted); font-size: 14px; }
.buy-item.no { opacity: 0.35; cursor: not-allowed; }
.buy-item.own { border-color: var(--good); }
.buy-item.ref .pr { color: var(--text); }
.buy-item.ref .pr b { color: var(--t); font-weight: 700; }
.buy-foot { margin-top: 10px; color: var(--muted); font-size: 15px; }

#conn { position: fixed; top: 0; left: 0; right: 0; padding: 10px; text-align: center; background: #8a1f1f; color: #fff; z-index: 50; font-size: 18px; }
