/* Arena — identidade da Firma (design system oficial): fundo preto, superfícies #0b0b0b/#141414/#212121,
   borda #323131, azul Firma #009DE0 + brilho, CTA #0000ee, NHD nos títulos, Mono nos números,
   Poppins no texto. Grade de 5px; cantos 6px (botões/cartões), 14px (painéis), 100px (pílulas).
   Sem backdrop-blur (proibido no DS — e mais leve no jogo). Fontes servidas localmente (o site não manda CORS). */
@font-face { font-family: 'NHD'; src: url('fonts/NeueHaasDisplayRoman.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'NHD'; src: url('fonts/NeueHaasDisplayMedium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'NHD'; src: url('fonts/NeueHaasDisplayBold.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'NHD'; src: url('fonts/NeueHaasDisplayBlack.woff2') format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Mono'; src: url('fonts/PPSupplyMono-Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
    --bg: #000000;
    --s1: #0b0b0b;
    --s2: #141414;
    --s3: #212121;
    --line: #323131;
    --text: #ffffff;
    --text-2: #bababa;
    --text-3: #888888;
    --blue: #009DE0;
    --blue-d: #0082af;
    --blue-l: #7fa8ff;
    --blue-v: #1b5ef7;
    --cta: #0000ee;
    --ok: #00ffc2;
    --danger: #ff5050;
    --offwhite: #e8e7e1;
    --glow: 0 0 8px rgba(0, 157, 224, 0.75);
    --r: 6px;
    --r-lg: 14px;
    --r-pill: 100px;
    --f-title: 'NHD', 'Helvetica Neue', Arial, sans-serif;
    --f-mono: 'Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;
    --f-text: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--f-text); font-size: 14px; -webkit-font-smoothing: antialiased; }
#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; }
[hidden] { display: none !important; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue-v); outline-offset: 2px; }
@keyframes pulse-glow { 0%, 100% { box-shadow: 0 0 6px rgba(0,157,224,0.45); } 50% { box-shadow: 0 0 14px rgba(0,157,224,0.9); } }

.panel { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.hud-box { background: rgba(11,11,11,0.86); border: 1px solid var(--line); border-radius: var(--r); color: var(--text); }
.mono { font-family: var(--f-mono); }

.screen { position: fixed; inset: 0; display: grid; place-items: center; padding: 15px; z-index: 20; }

/* ---------------- LOBBY ---------------- */
#lobby { background: linear-gradient(180deg, rgba(0,0,0,0.55), rgba(0,0,0,0.85)); }
.lobby-card { width: min(860px, 100%); padding: 35px 35px 25px; }
.brand { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.brand-logo { height: 30px; display: block; margin-bottom: 15px; }
h1 { margin: 0; font-family: var(--f-title); font-weight: 700; font-size: 45px; line-height: 1; letter-spacing: -0.01em; text-transform: uppercase; }
h1 span { color: var(--blue); }
.sub { margin: 10px 0 0; font-family: var(--f-mono); font-size: 12px; color: var(--text-2); letter-spacing: 0.08em; text-transform: uppercase; }
.brand-mark { width: 50px; height: 47px; opacity: 0.9; }
.me-row { display: flex; align-items: center; gap: 10px; padding: 10px 15px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); color: var(--text-2); }
.me-row strong { color: var(--text); font-weight: 600; }
.me-row .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); box-shadow: var(--glow); }
.pill { margin-left: auto; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; padding: 5px 10px; border-radius: var(--r-pill); background: var(--s3); color: var(--text-2); border: 1px solid var(--line); }
.pill.ok { color: var(--ok); border-color: rgba(0,255,194,0.35); }
.pill.bad { color: var(--danger); border-color: rgba(255,80,80,0.4); }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; margin-top: 25px; }
h2 { font-family: var(--f-mono); font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); margin: 0 0 10px; }
h2.mt { margin-top: 25px; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 15px; font-size: 13px; color: var(--text-2); }
.field.row { flex-direction: row; align-items: center; gap: 10px; margin-bottom: 10px; }
.field.row span { flex: 1; }
.field small { color: var(--text-3); }
.field.row output { width: 45px; text-align: right; font-family: var(--f-mono); font-size: 12px; color: var(--text); }
select, #join-code { appearance: none; font-family: var(--f-text); font-size: 15px; font-weight: 500; color: var(--text); background: var(--s2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 15px; outline: none; transition: border-color .15s, box-shadow .15s; }
select:hover, #join-code:hover { border-color: #4a4848; }
select:focus, #join-code:focus { border-color: var(--blue); box-shadow: var(--glow); }
select { background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
select option { background: var(--s2); color: var(--text); }
.join-row { display: flex; gap: 10px; }
#join-code { flex: 1; min-width: 0; text-transform: uppercase; letter-spacing: 0.35em; font-family: var(--f-mono); font-size: 20px; text-align: center; }
#join-code::placeholder { color: #4a4848; }
.btn { border: 1px solid var(--line); background: var(--s2); color: var(--text); font-family: var(--f-text); font-weight: 600; font-size: 14px; padding: 10px 20px; border-radius: var(--r); transition: background .15s, border-color .15s, box-shadow .15s, transform .1s; }
.btn:hover { background: var(--s3); border-color: var(--blue); box-shadow: var(--glow); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--cta); border-color: var(--cta); color: #fff; width: 100%; }
.btn.primary:hover { background: #1414ff; border-color: var(--blue); box-shadow: var(--glow); }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; }
.btn.big { font-family: var(--f-title); font-weight: 700; font-size: 20px; letter-spacing: 0.02em; text-transform: uppercase; padding: 15px; animation: pulse-glow 2.4s ease-in-out infinite; }
.btn:disabled { opacity: 0.5; cursor: default; }
.room-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; max-height: 180px; overflow: auto; }
.room-list li { display: flex; align-items: center; gap: 10px; padding: 10px 15px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); font-size: 13px; }
.room-list li.empty { color: var(--text-3); justify-content: center; }
.room-list .code { font-family: var(--f-mono); letter-spacing: 0.15em; font-size: 15px; color: var(--blue); }
.room-list .who { color: var(--text-2); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-list .pill { margin-left: 0; }
.lobby-foot { margin-top: 25px; padding-top: 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.load { display: flex; align-items: center; gap: 15px; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-2); }
.load-bar { flex: 0 0 180px; height: 5px; border-radius: var(--r-pill); background: var(--s3); overflow: hidden; }
.load-bar i { display: block; height: 100%; width: 0; background: var(--blue); box-shadow: var(--glow); transition: width .2s; }
.keys { margin: 0; font-size: 12px; color: var(--text-3); line-height: 2; }
kbd { font-family: var(--f-mono); font-size: 11px; padding: 2px 5px; border-radius: 4px; background: var(--s3); border: 1px solid var(--line); color: var(--text); }
.err { margin: 15px 0 0; padding: 10px 15px; border-radius: var(--r); background: rgba(255,80,80,0.1); border: 1px solid rgba(255,80,80,0.4); color: var(--danger); font-size: 13px; }

/* ---------------- HUD ---------------- */
#hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; color: var(--text); }
#hud .screen, #hud button, #hud input { pointer-events: auto; }
/* mira estilo Valorant */
#crosshair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#crosshair i, #crosshair b { position: absolute; background: var(--ok); box-shadow: 0 0 0 1px rgba(0,0,0,0.85); }
#crosshair .t, #crosshair .b { width: 2px; height: 6px; left: -1px; }
#crosshair .t { top: -10px; } #crosshair .b { top: 4px; }
#crosshair .l, #crosshair .r { height: 2px; width: 6px; top: -1px; }
#crosshair .l { left: -10px; } #crosshair .r { left: 4px; }
#crosshair b { width: 2px; height: 2px; left: -1px; top: -1px; }
#crosshair i { transition: top .08s, left .08s; }
#crosshair.spread .t { top: -15px; } #crosshair.spread .b { top: 9px; } #crosshair.spread .l { left: -15px; } #crosshair.spread .r { left: 9px; }
#hitmarker { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hitmarker i { position: absolute; width: 2px; height: 9px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,0.6); }
#hitmarker i:nth-child(1) { transform: translate(-9px,-12px) rotate(-45deg); }
#hitmarker i:nth-child(2) { transform: translate(7px,-12px) rotate(45deg); }
#hitmarker i:nth-child(3) { transform: translate(-9px,3px) rotate(45deg); }
#hitmarker i:nth-child(4) { transform: translate(7px,3px) rotate(-45deg); }
#hitmarker.show { animation: hm .22s ease-out; }
#hitmarker.head i { background: var(--danger); }
@keyframes hm { 0% { opacity: 1; transform: scale(1.3); } 100% { opacity: 0; transform: scale(1); } }
#dmg-nums { position: absolute; left: 50%; top: 50%; }
.dmg { position: absolute; left: 20px; top: -30px; font-family: var(--f-mono); font-size: 16px; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.9); animation: dmg .7s ease-out forwards; }
.dmg.head { color: var(--danger); font-size: 20px; }
@keyframes dmg { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(-30px); } }
#vignette { position: absolute; inset: 0; box-shadow: inset 0 0 160px 40px rgba(255, 80, 80, 0); transition: box-shadow .35s; }
#vignette.hurt { box-shadow: inset 0 0 160px 40px rgba(255, 80, 80, 0.5); transition: none; }

#topbar { position: absolute; top: 15px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: var(--r); background: rgba(11,11,11,0.86); border: 1px solid var(--line); }
.tb-chip { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; padding: 5px 10px; border-radius: 4px; background: var(--s3); color: var(--text-2); }
.tb-chip.valendo { background: var(--blue); color: #fff; box-shadow: var(--glow); }
.tb-chip.fim { background: var(--offwhite); color: #000; }
.tb-time { font-family: var(--f-mono); font-size: 20px; min-width: 70px; text-align: center; }
.tb-score { font-family: var(--f-mono); font-size: 15px; }
.tb-score #tb-me { color: var(--blue); }
.tb-score em { color: var(--text-3); font-style: normal; margin: 0 2px; }
.tb-score small { margin-left: 10px; font-family: var(--f-text); font-size: 11px; color: var(--text-2); }

#killfeed { position: absolute; top: 15px; right: 15px; list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; align-items: flex-end; }
#killfeed li { display: flex; align-items: center; gap: 10px; padding: 5px 10px; border-radius: var(--r); background: rgba(11,11,11,0.86); border: 1px solid var(--line); font-size: 13px; font-weight: 600; animation: kf-in .2s ease-out; transition: opacity .4s; }
#killfeed li.mine { border-color: var(--blue); box-shadow: var(--glow); }
#killfeed li.fade { opacity: 0; }
#killfeed .k-ico { width: 20px; height: 13px; fill: var(--text-2); }
#killfeed .hs { width: 14px; height: 14px; fill: none; stroke: var(--danger); stroke-width: 2.4; }
#killfeed .c { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
@keyframes kf-in { from { opacity: 0; transform: translateX(15px); } to { opacity: 1; transform: none; } }

#center-msg { position: absolute; left: 50%; top: 64%; transform: translateX(-50%); text-align: center; white-space: nowrap; }
#center-msg .kill { display: inline-flex; gap: 10px; align-items: center; padding: 10px 20px; border-radius: var(--r); background: rgba(11,11,11,0.86); border: 1px solid var(--blue); box-shadow: var(--glow); font-family: var(--f-title); font-weight: 700; font-size: 16px; letter-spacing: 0.06em; text-transform: uppercase; animation: pop .25s ease-out; }
#center-msg .kill b { color: var(--blue); font-weight: 900; }
@keyframes pop { from { transform: scale(1.2); opacity: 0; } to { transform: none; opacity: 1; } }

#hp-box { position: absolute; left: 15px; bottom: 15px; display: flex; align-items: center; gap: 10px; padding: 10px 15px 15px; min-width: 190px; }
#hp-box svg { width: 20px; height: 20px; fill: var(--ok); }
#hp { font-family: var(--f-mono); font-size: 35px; line-height: 1; }
.hp-bar { position: absolute; left: 15px; right: 15px; bottom: 5px; height: 3px; background: var(--s3); border-radius: var(--r-pill); overflow: hidden; }
.hp-bar i { display: block; height: 100%; width: 100%; background: var(--ok); transition: width .15s; }
#hp-box.low #hp { color: var(--danger); } #hp-box.low svg { fill: var(--danger); } #hp-box.low .hp-bar i { background: var(--danger); }
#ammo-box { position: absolute; right: 15px; bottom: 15px; display: flex; align-items: baseline; gap: 5px; padding: 10px 15px; }
.wname { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; color: var(--text-3); margin-right: 10px; }
#ammo { font-family: var(--f-mono); font-size: 35px; line-height: 1; }
#ammo.low { color: var(--danger); }
#ammo-box em { font-family: var(--f-mono); font-style: normal; color: var(--text-3); }
#reload-ring { position: absolute; left: 0; right: 0; top: -25px; text-align: center; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--blue); text-shadow: 0 1px 4px #000; }
.net { position: absolute; left: 15px; top: 15px; font-family: var(--f-mono); font-size: 11px; color: var(--text-2); text-shadow: 0 1px 3px #000; }

#scoreboard { position: absolute; inset: 0; display: grid; place-items: center; }
.sb-card { width: min(560px, 92vw); padding: 20px; background: rgba(11,11,11,0.94); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sb-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; font-family: var(--f-title); font-weight: 700; font-size: 18px; text-transform: uppercase; }
.sb-head #sb-room { font-family: var(--f-mono); font-weight: 400; font-size: 13px; color: var(--blue); letter-spacing: 0.15em; }
.sb-card table { width: 100%; border-collapse: collapse; font-size: 14px; }
.sb-card th { text-align: left; font-family: var(--f-mono); font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); padding: 5px 10px; }
.sb-card td { padding: 10px; border-top: 1px solid var(--line); font-weight: 500; }
.sb-card td:nth-child(n+3), .sb-card th:nth-child(n+3) { text-align: right; width: 60px; font-family: var(--f-mono); }
.sb-card tr.me td { background: rgba(0,157,224,0.1); }
.sb-card tr.me td:first-child { box-shadow: inset 3px 0 0 var(--blue); }
.sb-card .c { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

#death { position: absolute; inset: 0; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(0,0,0,0.1), rgba(0,0,0,0.7)); }
.death-card { text-align: center; padding: 25px 35px; background: rgba(11,11,11,0.9); border: 1px solid var(--line); border-radius: var(--r-lg); min-width: 300px; }
.death-card small { display: block; font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); }
.death-card strong { display: block; font-family: var(--f-title); font-weight: 900; font-size: 40px; margin: 10px 0 5px; text-transform: uppercase; }
#death-head { display: inline-block; padding: 3px 10px; border-radius: var(--r-pill); background: var(--danger); color: #000; font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; }
.death-card p { font-size: 14px; color: var(--text-2); margin: 15px 0 0; }
.death-card p b { font-family: var(--f-mono); color: var(--blue); font-size: 18px; font-weight: 400; }

#endscreen { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,0.6); pointer-events: auto; }
.end-card { text-align: center; padding: 30px 35px; width: min(460px, 92vw); background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); }
.end-card small { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--text-2); }
.end-card h2 { font-family: var(--f-title); font-weight: 900; font-size: 45px; line-height: 1.05; text-transform: uppercase; letter-spacing: 0; color: var(--text); margin: 10px 0 5px; }
.end-card #end-sub { margin: 0 0 20px; color: var(--blue); font-family: var(--f-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; }
.end-card ol { text-align: left; margin: 0 0 15px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 5px; }
.end-card ol li { display: flex; gap: 10px; align-items: center; padding: 10px 15px; border-radius: var(--r); background: var(--s2); border: 1px solid var(--line); font-weight: 500; font-size: 14px; }
.end-card ol li:first-child { border-color: var(--blue); box-shadow: var(--glow); }
.end-card ol li b { margin-left: auto; font-family: var(--f-mono); font-weight: 400; }
.end-card ol .c { width: 10px; height: 10px; border-radius: 50%; }
.muted { color: var(--text-3); font-size: 13px; }
.muted b { font-family: var(--f-mono); color: var(--text); font-weight: 400; }

#pause { background: rgba(0,0,0,0.55); color: var(--text); }
.pause-card { width: min(440px, 100%); padding: 25px; display: flex; flex-direction: column; gap: 15px; }
.room-code { display: flex; align-items: center; gap: 10px; }
.room-code small { font-family: var(--f-mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); }
.room-code strong { font-family: var(--f-mono); font-weight: 400; font-size: 30px; letter-spacing: 0.25em; color: var(--blue); flex: 1; text-shadow: 0 0 8px rgba(0,157,224,0.6); }
.state-line { margin: 0; font-size: 13px; color: var(--text-2); }
.players { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.players li { display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px; border-radius: var(--r-pill); background: var(--s2); border: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.players li.me { border-color: var(--blue); box-shadow: var(--glow); }
.players .c { width: 10px; height: 10px; border-radius: 50%; }
.settings { border-top: 1px solid var(--line); padding-top: 15px; }
input[type=range] { accent-color: var(--blue); width: 150px; }
input[type=checkbox] { accent-color: var(--blue); width: 18px; height: 18px; margin: 0 45px 0 0; }

.loading-card { padding: 20px 30px; display: flex; gap: 15px; align-items: center; font-family: var(--f-mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-2); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--s3); border-top-color: var(--blue); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
    .cols { grid-template-columns: 1fr; }
    .lobby-card { padding: 25px 15px; }
    h1 { font-size: 35px; }
    .brand-mark { display: none; }
}
