﻿* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #111; font-family: system-ui, "Segoe UI", sans-serif; color: #fff; }
canvas { display: block; width: 100vw; height: 100vh; outline: none; }
[hidden] { display: none !important; }

#hud { position: fixed; inset: 0; pointer-events: none; user-select: none; }

#crosshair { position: absolute; left: 50%; top: 50%; width: 22px; height: 22px; transform: translate(-50%, -50%); }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: rgba(255,255,255,.9); box-shadow: 0 0 2px #000; }
#crosshair::before { left: 10px; top: 0; width: 2px; height: 22px; }
#crosshair::after { left: 0; top: 10px; width: 22px; height: 2px; }

#hitmarker { position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; transition: opacity .15s; }
#hitmarker::before, #hitmarker::after { content: ""; position: absolute; background: #fff; }
#hitmarker::before { left: 16px; top: 0; width: 2px; height: 34px; }
#hitmarker::after { left: 0; top: 16px; width: 34px; height: 2px; }
#hitmarker.show { opacity: 1; transition: none; }
#hitmarker.kill::before, #hitmarker.kill::after { background: #ff3b3b; }

#hurt { position: absolute; inset: 0; box-shadow: inset 0 0 160px rgba(220, 0, 0, .85); opacity: 0; transition: opacity .4s; }
#hurt.show { opacity: 1; transition: none; }

#health { position: absolute; left: 24px; bottom: 24px; display: flex; align-items: center; gap: 12px; font-size: 32px; font-weight: 700; text-shadow: 0 2px 4px #000; }
#hpBar { width: 200px; height: 12px; background: rgba(0,0,0,.5); border-radius: 6px; overflow: hidden; }
#hpFill { height: 100%; width: 100%; background: #4cd964; transition: width .15s; }
#hpFill.low { background: #ff3b3b; }

#ammo { position: absolute; right: 24px; bottom: 24px; text-align: right; text-shadow: 0 2px 4px #000; }
#weaponName { display: block; font-size: 13px; text-transform: uppercase; letter-spacing: .12em; opacity: .75; }
#ammo strong { font-size: 44px; font-weight: 700; font-variant-numeric: tabular-nums; }
#ammo small { font-size: 20px; opacity: .7; margin-left: 6px; }
#ammo.low strong { color: #ff5a4a; }
#reloadBar { height: 6px; margin-top: 4px; background: rgba(0,0,0,.5); border-radius: 3px; overflow: hidden; opacity: 0; }
#reloadBar.on { opacity: 1; }
#reloadFill { height: 100%; width: 0; background: #2ad4ff; }
#ammoHint { display: block; min-height: 18px; margin-top: 4px; font-size: 13px; font-style: normal; opacity: .85; }

#room { position: absolute; left: 16px; top: 12px; text-shadow: 0 1px 3px #000; }
#room b { display: block; font-size: 20px; letter-spacing: .2em; }
#room small { font-size: 11px; opacity: .7; }

#info { position: absolute; right: 16px; top: 12px; font-size: 13px; opacity: .8; text-shadow: 0 1px 2px #000; }

#round { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); text-align: center; text-shadow: 0 2px 4px #000; }
#round strong { display: block; font-size: 34px; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
#round strong.low { color: #ff5a4a; }
#round small { font-size: 12px; opacity: .75; }

#roundEnd { position: absolute; left: 50%; top: 14%; transform: translateX(-50%); text-align: center; background: rgba(0,0,0,.65); padding: 14px 40px; border-radius: 8px; }
#roundEnd strong { display: block; font-size: 38px; color: #ffcc00; }
#roundEnd.win strong { color: #4cd964; }
#roundEnd span { opacity: .8; }

#debug { position: absolute; left: 16px; bottom: 72px; margin: 0; padding: 8px 10px; font: 12px/1.45 ui-monospace, Consolas, monospace; background: rgba(0,0,0,.6); border-radius: 4px; color: #9fe8a8; white-space: pre; }

#feed { position: absolute; right: 16px; top: 40px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
#feed div { background: rgba(0,0,0,.55); padding: 4px 10px; border-radius: 4px; font-size: 14px; }
#feed .hs { color: #ffcc00; }

#dead { position: absolute; left: 50%; top: 35%; transform: translateX(-50%); text-align: center; background: rgba(0,0,0,.6); padding: 16px 32px; border-radius: 8px; }
#dead strong { display: block; font-size: 32px; color: #ff3b3b; }

#scoreboard { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: rgba(10,12,16,.85); border-radius: 8px; padding: 16px 24px; min-width: 360px; }
#scoreboard table { width: 100%; border-collapse: collapse; }
#scoreboard th, #scoreboard td { padding: 6px 10px; text-align: left; }
#scoreboard th { font-size: 12px; text-transform: uppercase; opacity: .6; }
#scoreboard td + td, #scoreboard th + th { text-align: right; }
#scoreboard tr.me td { color: #ffcc00; }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8,10,14,.7); cursor: pointer; }
.panel { background: #1b1f27; border: 1px solid #2c323d; border-radius: 10px; padding: 28px 32px; width: min(380px, calc(100vw - 32px)); cursor: default; }
#paused .panel { text-align: center; cursor: pointer; }
#paused .panel { width: min(460px, calc(100vw - 32px)); }
.settings { margin-top: 18px; padding-top: 14px; border-top: 1px solid #2c323d; text-align: left; cursor: default; }
.settings h3 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; opacity: .65; font-weight: 600; }
.settings .mix { display: grid; grid-template-columns: 150px 1fr 48px; align-items: center; gap: 10px; margin: 6px 0; font-size: 14px; }
.settings .mix output { text-align: right; font-variant-numeric: tabular-nums; opacity: .85; }
.settings input[type=range] { width: 100%; accent-color: #ff7a1a; cursor: pointer; }
.settings .tests { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.settings .tests button, .settings .reset { width: auto; margin: 0; padding: 6px 10px; font-size: 12px; font-weight: 600; border: 1px solid #3a414e; border-radius: 5px; background: #232832; color: #fff; cursor: pointer; }
.settings .tests button:hover, .settings .reset:hover { background: #2f3644; }
.settings .summary { margin: 12px 0 6px; font-size: 12px; opacity: .6; }
.settings .reset { margin-top: 4px; }
.panel h1 { margin: 0; font-size: 40px; letter-spacing: .02em; }
.panel .sub { margin: 4px 0 20px; opacity: .6; }
.panel input { width: 100%; padding: 12px; font-size: 16px; border-radius: 6px; border: 1px solid #3a414e; background: #11141a; color: #fff; }
.panel button { width: 100%; margin-top: 10px; padding: 12px; font-size: 18px; font-weight: 700; border: 0; border-radius: 6px; background: #ff7a1a; color: #111; cursor: pointer; }
.panel button.secondary { background: #2c323d; color: #fff; font-size: 15px; font-weight: 600; }
.panel button.secondary:hover:not(:disabled) { background: #3a4250; }
.panel .or { margin: 16px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .1em; opacity: .5; text-align: center; }
.panel .row { display: flex; gap: 8px; }
.panel .row input { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: .25em; text-align: center; }
.panel .row button { width: auto; margin-top: 0; padding: 12px 18px; }
.panel button:disabled { opacity: .5; cursor: wait; }
.keys { list-style: none; padding: 0; margin: 20px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; font-size: 13px; opacity: .75; }
.keys b { display: inline-block; min-width: 44px; }
#error { color: #ff6b6b; margin: 14px 0 0; }
