:root {
  --hud: #e9d9a6; --hud2: #f3e7bf; --bg: rgba(10, 10, 6, 0.55); --t: #e8a838; --ct: #5fa8ff; --red: #ff4a3a;
  --font: 'Trebuchet MS', 'Segoe UI', Tahoma, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; font-family: var(--font); color: #fff; user-select: none; }
canvas#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- HUD ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0,0,0,.6); }
#topbar { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 6px; }
#topbar .tm { background: var(--bg); padding: 4px 12px; border-radius: 4px; font-size: 22px; font-weight: bold; display: flex; gap: 6px; align-items: baseline; min-width: 70px; justify-content: center; }
#topbar .tm small { font-size: 11px; opacity: .8; }
#topbar .ct { color: var(--ct); } #topbar .t { color: var(--t); }
#scorebox { background: var(--bg); padding: 2px 10px; border-radius: 4px; display: flex; align-items: center; gap: 12px; font-weight: bold; font-size: 24px; }
#scorebox .sct { color: var(--ct); } #scorebox .st { color: var(--t); }
#timer { font-size: 26px; min-width: 72px; text-align: center; color: var(--hud2); font-variant-numeric: tabular-nums; }
#timer.bomb { color: var(--red); animation: blink .6s infinite; }
#roundNo { position: absolute; top: 44px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 12px; color: var(--hud); opacity: .8; }
#radar { position: absolute; top: 10px; left: 10px; width: 200px; height: 200px; }
#killfeed { position: absolute; top: 10px; right: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.kf { background: rgba(0,0,0,.55); padding: 3px 9px; border-radius: 3px; font-size: 14px; font-weight: bold; animation: slideIn .2s; }
.kf.me { border: 1px solid #c33; }
.kf .kw { color: #ddd; font-weight: normal; } .kf .hs { color: #ff5b5b; }
#chat { position: absolute; left: 12px; bottom: 170px; width: 460px; font-size: 14px; display: flex; flex-direction: column; gap: 2px; }
#chat div { transition: opacity 1s; } #chat div.fade { opacity: 0; }
#center { position: absolute; top: 24%; width: 100%; text-align: center; font-size: 40px; font-weight: 900; letter-spacing: 2px; transition: opacity .4s; opacity: 0; }
#sub { position: absolute; top: calc(24% + 56px); width: 100%; text-align: center; font-size: 18px; color: var(--hud2); transition: opacity .4s; opacity: 0; }
#hint { position: absolute; top: 62%; width: 100%; text-align: center; font-size: 16px; color: #fff59a; }
#namelabel { position: absolute; top: 54%; width: 100%; text-align: center; font-size: 15px; font-weight: bold; transition: opacity .15s; opacity: 0; }

#crosshair { --gap: 5px; --len: 9px; position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; background: #35ff5a; box-shadow: 0 0 1px #000, 0 0 2px #000; }
#crosshair .l, #crosshair .r { height: 2px; width: var(--len); top: -1px; }
#crosshair .t, #crosshair .b { width: 2px; height: var(--len); left: -1px; }
#crosshair .l { right: var(--gap); } #crosshair .r { left: var(--gap); }
#crosshair .t { bottom: var(--gap); } #crosshair .b { top: var(--gap); }
#dot { position: absolute; left: 50%; top: 50%; width: 3px; height: 3px; margin: -1px 0 0 -1px; background: #35ff5a; display: none; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0; transition: opacity .1s; }
#hitmarker i { position: absolute; width: 10px; height: 2px; background: #fff; box-shadow: 0 0 2px #000; }
#hitmarker i:nth-child(1) { transform: translate(-16px, -10px) rotate(45deg); } #hitmarker i:nth-child(2) { transform: translate(6px, -10px) rotate(-45deg); }
#hitmarker i:nth-child(3) { transform: translate(-16px, 9px) rotate(-45deg); } #hitmarker i:nth-child(4) { transform: translate(6px, 9px) rotate(45deg); }
#hitmarker.hs i { background: #ff4a3a; }
#dmgdir { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; opacity: 0; transform: translate(-50%,-50%); }
#dmgdir div { position: absolute; left: 50%; top: 0; width: 0; height: 0; margin-left: -18px; border-left: 18px solid transparent; border-right: 18px solid transparent; border-bottom: 22px solid rgba(255,30,20,.85); filter: drop-shadow(0 0 4px #f00); }

#progress { position: absolute; top: 66%; left: 50%; transform: translateX(-50%); width: 320px; display: none; text-align: center; }
#progressText { font-weight: bold; margin-bottom: 4px; color: #fff59a; }
#progress .bar { height: 10px; background: rgba(0,0,0,.6); border: 1px solid #b9a774; }
#progressFill { height: 100%; width: 0; background: linear-gradient(90deg, #d6b44a, #ffe27a); }

#bl { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 22px; }
.stat { font-size: 40px; font-weight: bold; color: var(--hud); display: flex; align-items: center; gap: 6px; background: var(--bg); padding: 2px 14px; border-radius: 4px; font-variant-numeric: tabular-nums; }
.stat .ico { font-size: 28px; opacity: .9; }
#hpbox.low { color: var(--red); animation: blink .8s infinite; }
#helm { font-size: 22px; }
#money { position: absolute; left: 14px; bottom: 76px; font-size: 32px; font-weight: bold; color: #8fe37a; background: var(--bg); padding: 0 12px; border-radius: 4px; }
#money .ico { margin-right: 4px; }
#moneyDelta { position: absolute; left: 100%; top: 0; margin-left: 10px; font-size: 22px; transition: opacity .6s; opacity: 0; }
#moneyDelta.pos { color: #8fe37a; } #moneyDelta.neg { color: var(--red); }
#icons { position: absolute; left: 14px; bottom: 124px; display: flex; gap: 6px; }
#icons span { display: none; font-weight: bold; padding: 2px 8px; border-radius: 3px; font-size: 13px; background: var(--bg); }
#buyIcon { color: #8fe37a; border: 1px solid #8fe37a; } #bombIcon { color: #ff8a40; border: 1px solid #ff8a40; } #kitIcon { color: #9fd0ff; border: 1px solid #9fd0ff; }
#bombIcon.blink { animation: blink .5s infinite; }
#ammo { position: absolute; right: 16px; bottom: 12px; text-align: right; background: var(--bg); padding: 4px 16px; border-radius: 4px; }
#weaponName { font-size: 14px; color: var(--hud); }
#ammo .nums { font-size: 42px; font-weight: bold; color: var(--hud); font-variant-numeric: tabular-nums; }
#ammo small { font-size: 22px; opacity: .85; }
#ammo.empty .nums #mag { color: var(--red); }
#ammo.noammo .nums { font-size: 28px; opacity: .7; }
#slots { position: absolute; right: 16px; bottom: 100px; display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.slot { font-size: 13px; color: rgba(233,217,166,.6); background: rgba(0,0,0,.35); padding: 2px 8px; border-radius: 3px; }
.slot b { color: #fff; margin-right: 4px; } .slot.on { color: #fff59a; background: rgba(0,0,0,.6); border-right: 3px solid #fff59a; }
#spec { position: absolute; bottom: 60px; width: 100%; text-align: center; font-size: 20px; display: none; }
#spec small { font-size: 13px; opacity: .7; }

#scope { position: fixed; inset: 0; pointer-events: none; }
#scope .ring { position: absolute; left: 50%; top: 50%; width: 92vh; height: 92vh; transform: translate(-50%,-50%); border-radius: 50%; box-shadow: 0 0 0 200vmax #000, inset 0 0 40px 10px rgba(0,0,0,.9); }
#scope .h { position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: #000; }
#scope .v { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: #000; }
#flash { position: fixed; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
#hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255,0,0,0) 45%, rgba(190,0,0,.75) 100%); }

/* ---------- COMPRAS ---------- */
#buymenu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.25); }
.buybox { width: min(880px, 94vw); background: rgba(18, 16, 10, .93); border: 1px solid #6d6036; box-shadow: 0 10px 40px #000; }
.buytitle { padding: 10px 16px; font-size: 22px; font-weight: bold; color: var(--hud2); border-bottom: 1px solid #6d6036; display: flex; gap: 20px; align-items: center; }
.buytitle span { color: #8fe37a; } .buytitle .bt { margin-left: auto; color: var(--hud); font-size: 16px; }
.buycols { display: flex; min-height: 360px; }
.cats { width: 230px; border-right: 1px solid #3d3520; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.items { flex: 1; padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; align-content: start; }
#buymenu button { font-family: var(--font); background: rgba(70, 62, 35, .55); color: var(--hud2); border: 1px solid #5a4f2c; padding: 9px 12px; text-align: left; font-size: 15px; cursor: pointer; }
#buymenu button:hover, #buymenu button.on { background: rgba(140, 120, 50, .6); border-color: #c8b060; }
#buymenu button b { color: #fff59a; margin-right: 6px; }
.item { display: flex; flex-wrap: wrap; align-items: center; }
.item .nm { flex: 1; } .item .pr { color: #8fe37a; font-weight: bold; }
.item.poor { opacity: .45; } .item.poor .pr { color: var(--red); }
.item .st { width: 100%; font-size: 11px; color: #b9ad86; display: flex; gap: 10px; margin-top: 3px; }
.buyhelp { grid-column: 1 / -1; color: #9d916b; font-size: 13px; padding: 6px; }

/* ---------- PLACAR ---------- */
#scoreboard { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); width: min(820px, 95vw); background: rgba(10,10,8,.88); border: 1px solid #555; padding: 12px 16px; pointer-events: none; }
.sbhead { text-align: center; color: var(--hud); margin-bottom: 8px; font-size: 13px; }
.sbteam h3 { margin: 8px 0 4px; color: var(--tc); display: flex; justify-content: space-between; border-bottom: 2px solid var(--tc); }
.sbteam table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sbteam th { text-align: left; color: #999; font-weight: normal; font-size: 12px; }
.sbteam td { padding: 3px 4px; color: var(--tc); }
.sbteam tr.dead td { opacity: .45; } .sbteam tr.me td { background: rgba(255,255,255,.08); font-weight: bold; }
.sbteam small { color: #888; font-size: 10px; }

/* ---------- MENUS ---------- */
.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.8)); overflow: auto; padding: 16px; }
.menubox { width: min(760px, 100%); background: rgba(16, 14, 9, .9); border: 1px solid #6d6036; padding: 24px 28px; box-shadow: 0 20px 60px #000; }
.menubox.small { width: min(480px, 100%); text-align: center; }
.menubox h2 { margin: 0 0 14px; color: var(--hud2); letter-spacing: 4px; }
.logo { text-align: center; font-weight: 900; line-height: 1; letter-spacing: 3px; }
.logo span { display: block; font-size: 22px; color: var(--hud); letter-spacing: 12px; }
.logo b { font-size: 64px; color: #f0c050; text-shadow: 0 3px 0 #7a5410, 0 0 30px rgba(240,180,60,.35); }
.logo em { font-size: 22px; color: #fff; font-style: normal; vertical-align: top; margin-left: 6px; }
.tag { text-align: center; color: #b9ad86; margin: 8px 0 18px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 18px; }
.grid.one { grid-template-columns: 1fr; text-align: left; margin-top: 14px; }
.grid label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--hud); }
.grid label b { color: #fff; font-weight: normal; }
.grid label.chk { flex-direction: row; align-items: center; gap: 8px; }
.grid input, .grid select { font-family: var(--font); background: #221e14; color: #fff; border: 1px solid #5a4f2c; padding: 7px 8px; font-size: 14px; }
.grid input[type=range] { padding: 0; accent-color: #f0c050; }
.overlay button { font-family: var(--font); display: block; width: 100%; padding: 14px; font-size: 22px; font-weight: 900; letter-spacing: 4px; color: #1a1408; background: linear-gradient(#f5cf63, #c99a2c); border: none; cursor: pointer; box-shadow: 0 4px 0 #7a5410; }
.overlay button:hover { filter: brightness(1.1); }
.overlay button.sec { font-size: 15px; letter-spacing: 2px; padding: 10px; background: #3d3520; color: var(--hud2); box-shadow: none; border: 1px solid #6d6036; }
.btns { display: flex; gap: 10px; margin-top: 14px; }
.controls { margin-top: 16px; color: #b9ad86; }
.controls summary { cursor: pointer; color: var(--hud); }
.ctl { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-top: 10px; font-size: 13px; }
kbd { background: #2c271a; border: 1px solid #6d6036; border-radius: 3px; padding: 1px 6px; color: #fff; font-family: inherit; }
.obj { font-size: 13px; line-height: 1.5; }
.foot { text-align: center; font-size: 12px; color: #776d50; margin: 14px 0 0; }
.endbox { width: min(640px, 100%); background: rgba(16,14,9,.92); border: 1px solid #6d6036; padding: 28px; text-align: center; }
.endbox h1 { margin: 0; font-size: 30px; } .endbox h2 { font-size: 44px; margin: 10px 0; color: #fff; }
.final { font-size: 28px; font-weight: bold; margin: 10px 0 16px; }
#mobileWarn { display: none; }
@media (max-width: 700px) {
  .grid, .ctl { grid-template-columns: 1fr; }
  .logo b { font-size: 46px; }
  #mobileWarn { display: block; position: fixed; bottom: 0; left: 0; right: 0; background: #7a2010; color: #fff; text-align: center; padding: 8px 16px; font-size: 13px; z-index: 10; }
}
@keyframes blink { 50% { opacity: .35; } }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }

/* camadas */
#scope { z-index: 1; } #hurt { z-index: 2; } #hud { z-index: 3; } #flash { z-index: 4; }
#buymenu { z-index: 5; } #scoreboard { z-index: 6; } .overlay { z-index: 10; }
