* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #000; font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif; color: #fff; user-select: none; }
#game canvas { display: block; position: fixed; inset: 0; transition: filter 0.4s; }
#game.dead canvas { filter: grayscale(0.85) brightness(0.8) contrast(1.1); }
.hidden { display: none !important; }

#vignette { position: fixed; inset: 0; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 55%, rgba(0,0,0,0.45) 100%); }
#hurt { position: fixed; inset: 0; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(160,0,0,0) 40%, rgba(170,0,0,0.75) 100%); transition: opacity 0.15s; }
#flashbang { position: fixed; inset: 0; pointer-events: none; background: #fff; opacity: 0; }

#hud { position: fixed; inset: 0; pointer-events: none; }
#topbar { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; gap: 0; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6)); }
#topbar .team { display: flex; align-items: center; gap: 12px; padding: 4px 18px; font-weight: 800; font-size: 28px; min-width: 150px; }
#topbar .team .tname { font-size: 14px; letter-spacing: 2px; opacity: 0.9; }
#topbar .gr { background: linear-gradient(90deg, rgba(20,60,130,0) 0%, rgba(30,90,190,0.85) 100%); justify-content: flex-end; }
#topbar .bl { background: linear-gradient(270deg, rgba(130,20,20,0) 0%, rgba(190,35,30,0.85) 100%); }
#timer-box { background: rgba(10,12,16,0.8); padding: 4px 18px; text-align: center; border-left: 1px solid #555; border-right: 1px solid #555; }
#timer { font-size: 22px; font-weight: 700; font-family: Consolas, monospace; }
#goal { font-size: 11px; opacity: 0.7; }

#minimap { position: absolute; top: 12px; left: 12px; width: 200px; height: 200px; border-radius: 6px; border: 2px solid rgba(255,255,255,0.25); background: rgba(10,20,25,0.55); }

#killfeed { position: absolute; top: 70px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.kf { background: rgba(0,0,0,0.55); padding: 3px 10px; font-size: 14px; display: flex; align-items: center; gap: 8px; border-radius: 2px; animation: kfin 0.2s ease-out; transition: opacity 0.5s; }
.kf.me { border: 1px solid rgba(255,210,80,0.9); background: rgba(60,40,0,0.55); }
.kf .gr { color: #6fb6ff; font-weight: 700; }
.kf .bl { color: #ff6b6b; font-weight: 700; }
.kf .w { color: #ddd; font-size: 12px; padding: 1px 6px; border: 1px solid rgba(255,255,255,0.35); border-radius: 2px; }
.kf .hs { width: 18px; height: 18px; }
@keyframes kfin { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i { position: absolute; background: #3f3; box-shadow: 0 0 1px #000, 0 0 2px rgba(0,0,0,0.8); }
#crosshair .l, #crosshair .r { width: 10px; height: 2px; top: -1px; }
#crosshair .t, #crosshair .b { width: 2px; height: 10px; left: -1px; }
#crosshair .dot { width: 2px; height: 2px; left: -1px; top: -1px; display: none; }
#crosshair.knife i:not(.dot) { display: none; }
#crosshair.knife .dot { display: block; }

#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(5px, 5px) rotate(45deg); }
#hitmarker i:nth-child(2) { transform: translate(-15px, 5px) rotate(-45deg); }
#hitmarker i:nth-child(3) { transform: translate(5px, -7px) rotate(-45deg); }
#hitmarker i:nth-child(4) { transform: translate(-15px, -7px) rotate(45deg); }
#hitmarker.kill i { background: #f33; }

#target-name { position: absolute; left: 50%; top: calc(50% + 34px); transform: translateX(-50%); font-size: 14px; font-weight: 700; text-shadow: 0 0 3px #000, 0 0 2px #000; }
#target-name.bl { color: #ff6b6b; } #target-name.gr { color: #6fb6ff; }

#dmg-ind { position: absolute; left: 50%; top: 50%; }
.di { position: absolute; left: -60px; top: -140px; width: 120px; height: 40px; transform-origin: 60px 140px; opacity: 0.9; transition: opacity 1s; }
.di::before { content: ""; position: absolute; inset: 0; border-top: 6px solid rgba(255,30,20,0.85); border-radius: 50% 50% 0 0 / 100% 100% 0 0; filter: blur(0.5px) drop-shadow(0 0 6px rgba(255,0,0,0.8)); }

#kill-note { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); text-align: center; font-size: 18px; font-weight: 700; text-shadow: 0 0 4px #000; }
#kill-note .n { animation: pop 0.25s ease-out; }
#kill-note .hsb { display: inline-block; margin-left: 8px; padding: 1px 8px; background: #c00; font-size: 14px; border-radius: 2px; }
#multi { position: absolute; left: 50%; top: 24%; transform: translateX(-50%); font-size: 54px; font-weight: 900; font-style: italic; letter-spacing: 3px; color: #ffd24a; text-shadow: 0 0 12px rgba(255,120,0,0.9), 0 3px 0 #7a3a00; opacity: 0; white-space: nowrap; }
#multi.show { animation: multi 1.6s ease-out forwards; }
@keyframes multi { 0% { opacity: 0; transform: translateX(-50%) scale(2.4); } 12% { opacity: 1; transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) scale(1.05); } }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
#center-msg { position: absolute; left: 50%; top: 58%; transform: translateX(-50%); font-size: 15px; color: #ffcf5a; text-shadow: 0 0 3px #000; }
#protect { position: absolute; left: 50%; top: 18%; transform: translateX(-50%); padding: 3px 14px; background: rgba(0,120,255,0.35); border: 1px solid rgba(120,190,255,0.8); font-size: 14px; display: none; }

#hp-panel { position: absolute; left: 20px; bottom: 20px; width: 230px; padding: 10px 14px; background: linear-gradient(90deg, rgba(0,0,0,0.65), rgba(0,0,0,0)); }
#hp-panel .stat { display: flex; align-items: center; gap: 8px; font-size: 40px; font-weight: 800; font-family: Impact, "Arial Black", sans-serif; line-height: 1; }
#hp-panel .stat.small { font-size: 22px; margin-top: 6px; }
#hp-panel svg { width: 26px; height: 26px; fill: #fff; }
#hp-panel .stat.small svg { width: 18px; height: 18px; fill: #9cf; }
#hp-panel .bar { height: 5px; background: rgba(255,255,255,0.15); margin-top: 4px; }
#hp-bar { height: 100%; width: 100%; background: linear-gradient(90deg, #e33, #fd3 40%, #4e4); transition: width 0.15s; }
#ap-bar { height: 100%; width: 100%; background: #5af; transition: width 0.15s; }
#hp-panel.low .stat:first-child { color: #f44; animation: blink 0.8s infinite; }
@keyframes blink { 50% { opacity: 0.4; } }

#ammo-panel { position: absolute; right: 20px; bottom: 20px; text-align: right; padding: 10px 14px; background: linear-gradient(270deg, rgba(0,0,0,0.65), rgba(0,0,0,0)); min-width: 230px; }
#weapon-name { font-size: 15px; letter-spacing: 1px; opacity: 0.85; }
#ammo { font-size: 48px; font-weight: 800; font-family: Impact, "Arial Black", sans-serif; }
#ammo.low { color: #f44; }
#reserve { font-size: 22px; opacity: 0.8; margin-left: 6px; font-family: Impact, "Arial Black", sans-serif; }
#slots { display: flex; justify-content: flex-end; gap: 6px; margin-top: 4px; }
#slots span { width: 26px; height: 20px; font-size: 12px; line-height: 18px; text-align: center; border: 1px solid rgba(255,255,255,0.3); opacity: 0.5; position: relative; }
#slots span.on { opacity: 1; border-color: #fd3; color: #fd3; }
#slots b { position: absolute; right: -4px; top: -8px; font-size: 10px; background: #c00; border-radius: 6px; padding: 0 3px; line-height: 12px; }
#reload-bar { height: 3px; background: rgba(255,255,255,0.15); margin-top: 6px; visibility: hidden; }
#reload-bar div { height: 100%; width: 0; background: #fd3; }
#kd { position: absolute; right: 24px; bottom: 150px; font-size: 13px; opacity: 0.8; }
#fps { position: absolute; left: 14px; top: 218px; font-size: 11px; opacity: 0.5; font-family: monospace; }

#scope { position: fixed; inset: 0; pointer-events: none; }
#scope .ring { position: absolute; left: 50%; top: 50%; width: 96vh; height: 96vh; transform: translate(-50%, -50%); border-radius: 50%; box-shadow: 0 0 0 200vmax #000, inset 0 0 40px 14px rgba(0,0,0,0.9); }
#scope .h { position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #000; }
#scope .v { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: #000; }

#death { position: fixed; left: 50%; bottom: 22%; transform: translateX(-50%); text-align: center; pointer-events: none; text-shadow: 0 0 4px #000; }
#death .killed-by { font-size: 22px; background: rgba(0,0,0,0.5); padding: 8px 24px; }
#death .killed-by b { color: #ff6b6b; }
#death .respawn { margin-top: 10px; font-size: 16px; opacity: 0.9; }
#killer-hs { color: #f55; margin-left: 8px; }

#scoreboard { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; gap: 12px; pointer-events: none; }
.sb-col { width: 380px; background: rgba(8,10,14,0.85); border-top: 4px solid; }
.sb-col.gr { border-color: #2f7de0; } .sb-col.bl { border-color: #d22; }
.sb-col h3 { padding: 8px 12px; font-size: 18px; display: flex; justify-content: space-between; }
.sb-col table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sb-col th { text-align: left; font-weight: 400; opacity: 0.6; padding: 4px 12px; font-size: 12px; }
.sb-col td { padding: 5px 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.sb-col tr.me td { background: rgba(255,210,80,0.18); color: #ffd24a; }
.sb-col tr.dead td { opacity: 0.45; }

#loading, #menu, #pause, #result { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; flex-direction: column; background: radial-gradient(ellipse at 50% 30%, rgba(30,40,55,0.55), rgba(0,0,0,0.92)); z-index: 10; }
#menu, #result { background: linear-gradient(180deg, rgba(0,0,0,0.3), rgba(0,0,0,0.85)); }
.logo { font-size: 44px; font-weight: 900; letter-spacing: 6px; font-style: italic; font-family: Impact, "Arial Black", sans-serif; text-shadow: 0 4px 12px rgba(0,0,0,0.7); }
.logo span { color: #e8261e; }
.logo.big { font-size: 78px; }
.subtitle { margin: 6px 0 26px; font-size: 22px; letter-spacing: 6px; color: #ffcf5a; text-align: center; }
.subtitle small { display: block; font-size: 11px; letter-spacing: 3px; color: #aaa; margin-top: 4px; }
#loading-text { margin-top: 20px; opacity: 0.8; }
.lbar { width: 320px; height: 4px; background: rgba(255,255,255,0.1); margin-top: 12px; }
#lbar { height: 100%; width: 0; background: #e8261e; transition: width 0.2s; }
.menu-inner { display: flex; flex-direction: column; align-items: center; padding: 30px 50px; background: rgba(10,12,16,0.72); border: 1px solid rgba(255,255,255,0.1); border-top: 3px solid #e8261e; backdrop-filter: blur(6px); max-width: 94vw; }
.menu-inner.small { gap: 14px; }
.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 30px; margin-bottom: 22px; }
.opts label, .menu-inner label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #bbb; }
.seg { display: flex; gap: 0; }
.seg button { flex: 1; padding: 7px 14px; background: rgba(255,255,255,0.06); color: #ddd; border: 1px solid rgba(255,255,255,0.15); cursor: pointer; font-size: 14px; font-family: inherit; }
.seg button.on { background: #e8261e; border-color: #ff5a4a; color: #fff; }
.seg button:hover:not(.on) { background: rgba(255,255,255,0.14); }
input[type=range] { width: 100%; accent-color: #e8261e; }
#start, #resume, #again, #quit { padding: 12px 70px; font-size: 20px; font-weight: 800; letter-spacing: 6px; background: linear-gradient(180deg, #ff4a3a, #b8150e); color: #fff; border: none; cursor: pointer; font-family: inherit; box-shadow: 0 4px 18px rgba(232,38,30,0.45); }
#start:hover, #resume:hover, #again:hover { filter: brightness(1.15); }
#quit.ghost { background: transparent; border: 1px solid rgba(255,255,255,0.3); box-shadow: none; font-size: 15px; padding: 8px 40px; }
.keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; margin-top: 20px; font-size: 12px; color: #999; max-width: 640px; }
.keys b { color: #ddd; border: 1px solid rgba(255,255,255,0.25); padding: 0 5px; border-radius: 3px; font-weight: 400; margin-right: 3px; }
#result-score { font-size: 40px; font-weight: 900; margin: 16px 0; font-family: Impact, sans-serif; }
#result-mvp { margin-bottom: 20px; color: #ffcf5a; }
