:root { --red: #e0241b; --red2: #ff3b30; --acc: #8b5cf6; --acc2: #a78bfa; --ink: #0a0a0b; --line: #1f1f22; --mute: #6b6b72; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #000; color: #f2f2f2; font: 14px/1.4 "Space Grotesk", ui-sans-serif, system-ui, -apple-system, sans-serif; user-select: none; -webkit-font-smoothing: antialiased; }
canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }

/* ---------- slide-in drawers ---------- */
.screen { position: fixed; inset: 0; z-index: 10; background: linear-gradient(90deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,.35) 45%, rgba(0,0,0,0) 75%); }
.drawer { position: absolute; left: 0; top: 0; bottom: 0; width: 340px; max-width: 92vw; padding: 48px 28px 28px; background: rgba(8,8,9,.92); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 22px; transform: translateX(-102%); transition: transform .32s cubic-bezier(.2,.8,.2,1); box-shadow: 30px 0 80px rgba(0,0,0,.6); backdrop-filter: blur(16px); }
.drawer::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: var(--acc); }
.screen.open .drawer { transform: none; }
.brand { font-weight: 700; font-size: 20px; letter-spacing: .28em; display: flex; align-items: center; position: relative; padding-left: 16px; margin-bottom: 4px; }
.brand i { position: absolute; left: 0; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--acc); box-shadow: 0 0 10px var(--acc); }
nav { display: flex; flex-direction: column; gap: 8px; }
.item { position: relative; display: flex; align-items: center; justify-content: space-between; text-align: left; width: 100%; padding: 15px 16px; background: #111113; border: 1px solid var(--line); color: #f2f2f2; font: inherit; cursor: pointer; transition: background .12s, border-color .12s; }
.item b { font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.item em { font-style: normal; font-size: 16px; color: #555; transition: color .12s, transform .12s; }
.item:hover, .item:focus-visible { background: #17171a; border-color: #333; outline: none; }
.item:hover em, .item:focus-visible em { color: var(--acc2); transform: translateX(3px); }
.item::before { content: ''; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: var(--acc); transform: scaleY(0); transition: transform .15s; }
.item:hover::before, .item:focus-visible::before { transform: scaleY(1); }
.item.primary { background: var(--acc); border-color: var(--acc); }
.item.primary small { color: rgba(255,255,255,.75); }
.item.primary em { color: #fff; }
.item.primary:hover { background: var(--acc2); border-color: var(--acc2); }
.item.primary::before { display: none; }
.item.danger:hover b { color: var(--acc2); }
.joinrow { cursor: default; grid-template-columns: 1fr; gap: 10px; }
.row { display: flex; gap: 8px; }
.row input { flex: 1; }
.row button { width: 92px; background: #1c1c1f; border: 1px solid #2c2c30; color: #fff; font: 700 13px/1 inherit; letter-spacing: .08em; cursor: pointer; }
.row button:hover { background: var(--acc); border-color: var(--acc); }
input { background: #000; border: 1px solid #232326; color: #fff; padding: 11px 12px; font: inherit; outline: none; width: 100%; }
input::placeholder { color: #45454a; }
input:focus { border-color: var(--acc); }
#code { text-transform: uppercase; letter-spacing: .4em; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span, .slider span { font-size: 11px; letter-spacing: .18em; color: var(--mute); text-transform: uppercase; display: flex; justify-content: space-between; }
.slider { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: #111113; border: 1px solid var(--line); }
.slider b { color: #fff; font-weight: 700; letter-spacing: 0; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 3px; padding: 0; border: 0; background: #2a2a2e; accent-color: var(--acc); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; background: var(--acc); border: 0; cursor: pointer; }
#err { color: var(--red2); margin: 0; min-height: 1em; font-size: 12px; }
footer { margin-top: auto; color: #4a4a50; font-size: 11px; line-height: 2; }
footer span { color: #aaa; border: 1px solid #2a2a2e; padding: 1px 5px; font-size: 10px; font-weight: 700; }
.codebox { padding: 18px; background: #111113; border: 1px solid var(--line); border-left: 3px solid var(--acc); }
.codebox small { display: block; font-size: 11px; letter-spacing: .2em; color: var(--mute); text-transform: uppercase; }
.codebox b { font-size: 54px; letter-spacing: .28em; font-weight: 800; }
.wait { color: var(--mute); font-size: 12px; letter-spacing: .15em; text-transform: uppercase; margin-top: auto; }
.dots::after { content: ''; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ''; } 25% { content: '.'; } 50% { content: '..'; } 75% { content: '...'; } }
#fade { position: fixed; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 4; }
#clickToPlay { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(ellipse at center, rgba(0,0,0,.25), rgba(0,0,0,.6)); z-index: 8; cursor: pointer; animation: ctpIn .25s ease-out; }
#clickToPlay .ctp { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 34px 18px; background: rgba(8,8,9,.82); border: 1px solid rgba(167,139,250,.4); border-top: 2px solid var(--acc); box-shadow: 0 10px 40px rgba(0,0,0,.6); transition: transform .15s, border-color .15s; }
#clickToPlay:hover .ctp { transform: scale(1.03); border-color: var(--acc2); }
#clickToPlay svg { width: 28px; height: 28px; fill: none; stroke: var(--acc2); stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 0 4px rgba(167,139,250,.7)); animation: ctpPulse 1.6s ease-in-out infinite; }
#clickToPlay b { color: #fff; font-size: 14px; font-weight: 800; letter-spacing: .3em; text-transform: uppercase; padding-left: .3em; }
#clickToPlay small { color: var(--mute); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; }
@keyframes ctpIn { from { opacity: 0; } }
@keyframes ctpPulse { 50% { transform: scale(.86); opacity: .75; } }
#endScreen { position: fixed; inset: 0; display: grid; place-items: center; z-index: 9; background: radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.75)); animation: ctpIn .35s ease-out; }
.endCard { width: min(88vw, 340px); display: flex; flex-direction: column; gap: 10px; padding: 24px 22px 20px; background: rgba(8,8,9,.9); border: 1px solid var(--line); border-top: 2px solid var(--acc); box-shadow: 0 14px 50px rgba(0,0,0,.7); text-align: center; }
#endTitle { font-size: 34px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; padding-left: .2em; }
#endTitle.win { color: #fff; text-shadow: 0 0 18px rgba(167,139,250,.6); } #endTitle.loss { color: var(--red2); }
#endScore { font-size: 15px; font-weight: 700; letter-spacing: .14em; color: #c8c8ce; margin-bottom: 2px; font-variant-numeric: tabular-nums; }
#endSub { margin: 0 0 8px; color: #8d8d96; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.endPlayers { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ep { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; background: #111113; border: 1px solid var(--line); font-size: 12px; letter-spacing: .1em; }
.ep span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60%; color: #f2f2f2; font-weight: 700; }
.ep em { font-style: normal; color: var(--mute); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; transition: color .2s; }
.ep.ready { border-color: rgba(52,199,89,.5); } .ep.ready em { color: #34c759; }
#readyBtn.on { background: #1c1c1f; border-color: #34c759; } #readyBtn.on b { color: #34c759; }

/* ---------- HUD: no boxes, just type and bars ---------- */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 5; font-variant-numeric: tabular-nums; text-shadow: 0 1px 8px rgba(0,0,0,.85), 0 0 2px rgba(0,0,0,.9); }
#dmg { position: absolute; inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(170,10,5,.5) 100%); opacity: 0; }
#heal { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(90, 255, 150, .16) 0%, rgba(40, 220, 110, .22) 38%, rgba(30, 230, 110, .78) 100%); box-shadow: inset 0 0 160px rgba(80, 255, 150, .85); opacity: 0; mix-blend-mode: screen; }
#hp.healed { animation: healPop .7s cubic-bezier(.2,1.6,.4,1); }
#hp.healed #hpFill { animation: healFill .9s ease-out; }
@keyframes healPop { 0% { transform: scale(1.12); box-shadow: 0 0 0 2px #3dff8a, 0 0 34px rgba(61,255,138,.9); } 100% { transform: none; box-shadow: none; } }
@keyframes healFill { 0% { background: #3dff8a; box-shadow: 0 0 16px #3dff8a; } 100% { background: #fff; box-shadow: none; } }
#xhair { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
#xhair { transform: scale(var(--xs, 1)); }
#xhair i { position: absolute; background: var(--xc, #fff); box-shadow: 0 0 0 1px rgba(0,0,0,.55); }
#xhair .t, #xhair .b { width: 2px; height: 6px; left: -1px; }
#xhair .l, #xhair .r { height: 2px; width: 6px; top: -1px; }
#xhair b { position: absolute; width: 2px; height: 2px; left: -1px; top: -1px; background: var(--red2); }

/* hitmarkers: body = small white X, headshot = big red X + expanding ring, kill = red X with glow */
#hitmark { position: absolute; left: 50%; top: 50%; opacity: 0; }
#hitmark i { position: absolute; width: 2px; height: 8px; background: #fff; left: -1px; top: -4px; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
#hitmark i:nth-child(1) { transform: rotate(45deg) translateY(-11px); }
#hitmark i:nth-child(2) { transform: rotate(135deg) translateY(-11px); }
#hitmark i:nth-child(3) { transform: rotate(225deg) translateY(-11px); }
#hitmark i:nth-child(4) { transform: rotate(315deg) translateY(-11px); }
#hitmark .ring { position: absolute; left: -18px; top: -18px; width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--red2); opacity: 0; }
#hitmark.head i, #hitmark.kill i { background: var(--red2); height: 13px; width: 3px; left: -1.5px; top: -6.5px; box-shadow: 0 0 8px rgba(255,59,48,.9); }
#hitmark.head i:nth-child(1), #hitmark.kill i:nth-child(1) { transform: rotate(45deg) translateY(-17px); }
#hitmark.head i:nth-child(2), #hitmark.kill i:nth-child(2) { transform: rotate(135deg) translateY(-17px); }
#hitmark.head i:nth-child(3), #hitmark.kill i:nth-child(3) { transform: rotate(225deg) translateY(-17px); }
#hitmark.head i:nth-child(4), #hitmark.kill i:nth-child(4) { transform: rotate(315deg) translateY(-17px); }
#hitmark.head .ring { animation: ring .45s ease-out forwards; }
#hitmark.kill i { box-shadow: 0 0 12px rgba(255,59,48,.95); }
/* the kill X frames the crosshair skull (about 15px out at its corners) instead of crossing it */
#hitmark.kill i:nth-child(1) { transform: rotate(45deg) translateY(-25px); }
#hitmark.kill i:nth-child(2) { transform: rotate(135deg) translateY(-25px); }
#hitmark.kill i:nth-child(3) { transform: rotate(225deg) translateY(-25px); }
#hitmark.kill i:nth-child(4) { transform: rotate(315deg) translateY(-25px); }
/* stunned the enemy: a larger blue-white X that glows */
#hitmark.stun { transform: scale(var(--fs, 1)); }
#hitmark.stun i { background: #e6f2ff; width: 3px; height: 11px; left: -1.5px; top: -5.5px; box-shadow: 0 0 10px rgba(120,190,255,1), 0 0 2px rgba(0,0,0,.6); }
#hitmark.stun i:nth-child(1) { transform: rotate(45deg) translateY(-14px); }
#hitmark.stun i:nth-child(2) { transform: rotate(135deg) translateY(-14px); }
#hitmark.stun i:nth-child(3) { transform: rotate(225deg) translateY(-14px); }
#hitmark.stun i:nth-child(4) { transform: rotate(315deg) translateY(-14px); }
#hitmark.pop { animation: hmpop .22s cubic-bezier(.2,1.6,.4,1); }
#hitmark.head.pop, #hitmark.kill.pop { animation: hmpopBig .34s cubic-bezier(.2,1.8,.4,1); }
@keyframes hmpop { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
@keyframes hmpopBig { 0% { transform: scale(2.4) rotate(14deg); } 60% { transform: scale(.92); } 100% { transform: scale(1) rotate(0); } }
@keyframes ring { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }

/* enemy health: always over their head while visible */
#ehp { position: absolute; left: 50%; top: 40%; display: flex; align-items: center; gap: 6px; opacity: 0; transform-origin: 50% 100%; }
#ehpBar { position: relative; width: 104px; height: 16px; padding: 2px; background: rgba(0,0,0,.78); border: 2px solid #0b0b0c; box-shadow: 0 0 0 1px rgba(255,59,48,.75), 0 2px 10px rgba(0,0,0,.6); }
#ehpFill { height: 100%; width: 100%; background: linear-gradient(#ff6a5e, var(--red2) 45%, #c41d14); box-shadow: 0 0 8px rgba(255,59,48,.6); transition: width .15s ease-out; }
/* 6 segments of 25 HP: one body shot each */
#ehpBar::after, #hpBar::after { content: ''; position: absolute; inset: 2px; pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 2px), rgba(0,0,0,.9) calc(100% / 6 - 2px) calc(100% / 6)); }
/* kill: a skull flashes white/red where the crosshair was, then the crosshair returns */
#xskull { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; opacity: 0; pointer-events: none; }
#xskull svg { width: 100%; height: 100%; fill: #fff; filter: drop-shadow(0 0 2px #000) drop-shadow(0 0 6px rgba(255,59,48,.8)); }
#xskull.on { animation: xskullLife 1.1s ease-out forwards; }
#xskull.on svg { animation: xskullFlash .14s steps(1) infinite; }
@keyframes xskullLife { 0% { opacity: 0; transform: scale(2.2); } 14% { opacity: 1; transform: scale(.92); } 24% { transform: scale(1.05); } 32% { transform: scale(1); } 78% { opacity: 1; } 100% { opacity: 0; transform: scale(1); } }
@keyframes xskullFlash { 0% { fill: #fff; } 50% { fill: #ff2a1f; } }

#ehp.flash #ehpFill { background: #fff; }
#ehp.dead #ehpBar { opacity: .35; }

/* score */
#score { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); display: flex; align-items: stretch; text-shadow: none;
  background: rgba(8,8,10,.62); border: 1px solid rgba(255,255,255,.08); backdrop-filter: blur(10px); }
#score .side { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 92px; padding: 8px 16px 7px; gap: 2px; }
#score .side b { font-size: 26px; font-weight: 700; line-height: 1; }
#score .side span { font-size: 10px; letter-spacing: .14em; color: #9a9aa2; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#score .opp b { color: var(--red2); }
#score .goal { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px 18px; border-left: 1px solid rgba(255,255,255,.08); border-right: 1px solid rgba(255,255,255,.08); }
#score .goal span { font-size: 9px; letter-spacing: .2em; text-transform: uppercase; color: #8d8d96; }
#score .goal b { font-size: 20px; font-weight: 700; line-height: 1; letter-spacing: .04em; }

#mmap { position: absolute; top: 18px; left: 18px; width: 156px; height: 156px; border-radius: 50%; border: 1px solid rgba(255,255,255,.22); background: #10141c; box-shadow: 0 10px 28px rgba(0,0,0,.45); }
#feed { position: absolute; top: 18px; right: 22px; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; font-size: 12px; font-weight: 600; }
#feed div { animation: fade 4s forwards; }
#feed .dim, #center .dim { color: var(--mute); }
@keyframes fade { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }

/* health + ammo */
#hp { position: absolute; left: 22px; bottom: 22px; width: 220px; padding: 10px 14px 12px; background: rgba(8,8,10,.5); border: 1px solid rgba(255,255,255,.06); backdrop-filter: blur(10px); text-shadow: none; }
#hp .row, #ammo .row { display: flex; align-items: baseline; gap: 6px; }
#hpNum { font-size: 34px; font-weight: 800; line-height: 1; }
#hp small { font-size: 10px; letter-spacing: .25em; color: #9a9aa2; }
#hpBar { position: relative; margin-top: 8px; height: 18px; padding: 2px; background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.55); box-shadow: 0 0 0 1px rgba(0,0,0,.7), 0 2px 8px rgba(0,0,0,.5); }
#hpFill { height: 100%; width: 100%; background: linear-gradient(#fff, #dcdce2); transition: width .15s; }
#hp.low #hpNum { color: var(--red2); }
#hp.low #hpFill { background: var(--red2); box-shadow: 0 0 10px rgba(255,59,48,.6); }
#hp.low #hpBar { border-color: rgba(255,59,48,.8); }
#ammo { position: absolute; right: 22px; bottom: 22px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding: 10px 14px 12px; background: rgba(8,8,10,.5); border: 1px solid rgba(255,255,255,.06); backdrop-filter: blur(10px); text-shadow: none; }
#ammoMag { font-size: 34px; font-weight: 800; line-height: 1; }
/* grenades: counts above the ammo */
#nades { display: flex; gap: 10px; margin-bottom: 2px; }
#nades .nd { display: flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700; color: #e8e8ec; transition: opacity .2s; }
#nades .nd svg { width: 16px; height: 16px; fill: #d8dadf; stroke: #d8dadf; stroke-width: 1.4; }
#nades .nd svg .ln { fill: none; }
#nades .nd i { font-style: normal; font-size: 8.5px; color: #77777f; border: 1px solid #3a3a40; padding: 0 3px; margin-left: 1px; }
#nades .nd.empty { opacity: .3; }
/* cook meter: a hairline under the crosshair that fills over the fuse */
#cook { position: absolute; left: 50%; top: 50%; width: 54px; height: 3px; margin: 30px 0 0 -27px; background: rgba(0,0,0,.45); opacity: 0; transition: opacity .12s; }
#cook i { display: block; height: 100%; width: 0; background: rgba(255,255,255,.85); }
#throwTip { position: absolute; left: 50%; top: 50%; margin-top: 40px; transform: translateX(-50%); display: flex; gap: 10px; font: 600 10px/1 'Space Grotesk', sans-serif; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.4); opacity: 0; transition: opacity .12s; white-space: nowrap; text-shadow: 0 1px 3px rgba(0,0,0,.9); pointer-events: none; }
#throwTip span { transition: color .1s; }
#throwTip kbd { font: inherit; padding: 1px 3px; border: 1px solid currentColor; border-radius: 2px; margin-right: 3px; }
#throwTip .o, #throwTip.lob .u { color: #fff; }
#throwTip.lob .o { color: rgba(255,255,255,.4); }
#cook.hot i { background: var(--red2); box-shadow: 0 0 6px rgba(255,59,48,.8); }
/* live frag nearby: grenade glyph circling the crosshair toward it */
#nadeInd { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; opacity: 0; pointer-events: none; }
#nadeInd svg { width: 100%; height: 100%; fill: #fff; stroke: #fff; stroke-width: 1.3; filter: drop-shadow(0 0 4px rgba(0,0,0,.9)) drop-shadow(0 0 8px rgba(255,190,60,.7)); }
#nadeInd svg .ln { fill: none; }
#nadeInd.kill svg { fill: var(--red2); stroke: var(--red2); filter: drop-shadow(0 0 4px rgba(0,0,0,.9)) drop-shadow(0 0 10px rgba(255,59,48,1)); }
/* stunned: cold electric edges that pulse, and the world drains of colour behind them */
#stunfx { position: absolute; inset: 0; opacity: 0; pointer-events: none; z-index: 3; background: radial-gradient(ellipse at center, rgba(40,70,200,.05) 30%, rgba(20,45,170,.36) 72%, rgba(8,20,110,.78) 100%); box-shadow: inset 0 0 140px rgba(30,70,220,.65); }
#nades .nd svg .bolt { stroke: #8fc8ff; }
#ammoMag.low { color: var(--red2); }
#ammoRes { font-size: 14px; color: #9a9aa2; font-weight: 600; min-width: 1em; }
#ammoRes.inf { font-size: 20px; line-height: 14px; }
/* rifle silhouette beside the magazine count */
#gunIcon { width: 58px; height: 20px; fill: #d8dadf; align-self: center; margin-right: 6px; opacity: .85; filter: drop-shadow(0 1px 2px rgba(0,0,0,.6)); }
#mode { font-size: 9px; letter-spacing: .3em; color: #9a9aa2; }

/* countdown + center messages */
#count { position: absolute; top: 42%; left: 50%; transform: translate(-50%, -50%); width: min(86vw, 480px); text-align: center; font-weight: 700; text-shadow: 0 2px 16px rgba(0,0,0,.8); }
#count .n { display: block; font-size: 76px; line-height: 1; font-weight: 700; animation: countIn .35s ease-out both; }
#count .n.go { color: var(--red2); font-size: 42px; letter-spacing: .28em; padding-left: .28em; }
#count small { display: block; font-size: 12px; letter-spacing: .22em; color: #c8c8ce; margin-bottom: 18px; text-transform: uppercase; font-weight: 600; }
@keyframes countIn { 0% { transform: scale(1.12); opacity: 0; } 100% { transform: none; opacity: 1; } }
#center { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); width: min(86vw, 520px); text-align: center; font-size: 22px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; text-shadow: 0 2px 16px rgba(0,0,0,.85); }
#center small { display: block; font-size: 12px; letter-spacing: .12em; color: #c8c8ce; margin-top: 10px; font-weight: 600; text-transform: none; }
#hint { position: absolute; top: 58%; left: 50%; transform: translateX(-50%); letter-spacing: .3em; font-size: 11px; font-weight: 700; color: var(--red2); text-transform: uppercase; }
#arrows { position: absolute; left: 50%; top: 50%; }
#arrows i { position: absolute; width: 120px; height: 120px; left: -60px; top: -60px; border-radius: 50%; border-top: 3px solid var(--red2); animation: fade 1.2s forwards; }
#board { position: fixed; left: 50%; top: 22%; transform: translateX(-50%); background: rgba(8,8,9,.94); border-top: 3px solid var(--acc); padding: 18px 24px; min-width: 360px; z-index: 6; pointer-events: none; }
#board table { width: 100%; border-collapse: collapse; }
#board th { text-align: left; font-size: 10px; color: var(--mute); letter-spacing: .2em; font-weight: 600; padding-bottom: 8px; }
#board td { padding: 7px 0; font-size: 15px; font-weight: 700; border-top: 1px solid var(--line); }
#board td + td, #board th + th { text-align: right; }

/* ---------- badges: compact, uniform, slammed in ---------- */
#badges { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.badge { width: 200px; height: 30px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px 0 9px; background: rgba(8,8,9,.9); border: 1px solid rgba(255,59,48,.35); border-left: 3px solid var(--red);
  box-shadow: 0 0 18px rgba(224,36,27,.22); animation: badgeIn .34s cubic-bezier(.15,1.9,.35,1); transition: opacity .6s cubic-bezier(.4,0,.2,1), transform .6s cubic-bezier(.4,0,.2,1), filter .6s ease-out, height .5s cubic-bezier(.4,0,.2,1) .15s, margin .5s cubic-bezier(.4,0,.2,1) .15s, border-color .3s; overflow: hidden; position: relative; }
.badge::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,80,60,.55), transparent 70%); animation: badgeFlash .32s ease-out forwards; pointer-events: none; }
.badge svg { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--red2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px rgba(255,59,48,.8)); }
.badge svg .f { fill: var(--red2); }
.badge b { font-size: 11.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; white-space: nowrap; }
.badge small { margin-left: auto; font-size: 9.5px; color: var(--mute); letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.badge.out { opacity: 0; transform: translateY(-8px) scale(.97); filter: blur(1.5px); height: 0; margin-top: -4px; border-color: transparent; box-shadow: none; } /* collapses so the stack glides up instead of jumping */
@keyframes badgeIn { 0% { opacity: 0; transform: scale(2.1) translateY(-4px); filter: blur(3px); } 55% { opacity: 1; transform: scale(.92); filter: none; } 80% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes badgeFlash { from { opacity: 1; } to { opacity: 0; } }

/* spawn protection: a cool rim on the screen edge + a small label */
#prot { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); font-size: 10px; letter-spacing: .35em; text-transform: uppercase; color: #a9d4ff; opacity: 0; transition: opacity .25s; display: flex; align-items: center; gap: 8px; }
#prot i { width: 8px; height: 8px; border-radius: 50%; background: #8fc8ff; box-shadow: 0 0 10px #8fc8ff; animation: protPulse .6s ease-in-out infinite alternate; }
#prot::before { content: ''; position: fixed; inset: 0; box-shadow: inset 0 0 120px rgba(120, 180, 255, .28); pointer-events: none; }
@keyframes protPulse { from { opacity: .4; } to { opacity: 1; } }

/* asset loading: menu items stay disabled until the arena is built */
#loadBar { display: none; font-size: 10px; letter-spacing: .25em; text-transform: uppercase; color: var(--mute); }
#loadBar div { margin-top: 8px; height: 3px; background: #1d1d20; }
#loadBar i { display: block; height: 100%; width: 0; background: var(--acc); transition: width .2s; }
body.loading #loadBar { display: block; }
body.loading #menu nav { opacity: .35; pointer-events: none; }

footer .credit { display: block; margin-top: 8px; font-style: normal; font-size: 9.5px; color: #3c3c42; letter-spacing: .02em; line-height: 1.4; }

/* settings: segmented picker + colour swatches */
.drawer { overflow-y: auto; }
.seg { display: flex; gap: 6px; }
.seg button { flex: 1; padding: 8px 0; background: #1c1c1f; border: 1px solid #2c2c30; color: #bbb; font: 600 11px/1 inherit; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.seg button:hover { border-color: var(--acc); color: #fff; }
.seg button.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.swatches { display: flex; gap: 10px; }
.swatches button { width: 22px; height: 22px; border-radius: 50%; background: var(--c); border: 2px solid transparent; outline: 1px solid #333; cursor: pointer; padding: 0; }
.swatches button.on { border-color: #0a0a0b; outline: 2px solid var(--acc2); }

/* =====================================================================================
   Sodium brand: sodium-lamp amber for the brand, cyan for you, coral-red for everyone else.
   Angled panels, Chakra Petch for numbers and labels.
   Overrides the base styles above; IDs and structure are unchanged.
   ===================================================================================== */
:root {
  --acc: #ffa53a; --acc2: #ffc36e; --ink-amber: #1a0f02; --cy: #38e1ff; --cy2: #8ff0ff; --foe: #ff3b5c; --foe2: #ff7d92; --red: #ff2e5a; --red2: #ff3b5c;
  --panel: rgba(9, 8, 18, .66); --edge: rgba(255, 255, 255, .08); --mute: #7c7a90; --line: #24223a;
  --disp: 'Chakra Petch', 'Space Grotesk', ui-sans-serif, sans-serif;
  --cut: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  --cut-s: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
}

/* ---------- menus ---------- */
.screen { background: linear-gradient(90deg, rgba(6,4,14,.82) 0%, rgba(6,4,14,.4) 40%, rgba(6,4,14,0) 70%), radial-gradient(ellipse at 80% 120%, rgba(255,165,58,.12), transparent 60%); }
.drawer { width: 380px; padding: 56px 34px 30px; gap: 20px; background: linear-gradient(180deg, rgba(14,11,28,.94), rgba(7,6,14,.96)); border-right: 1px solid rgba(255,255,255,.06); }
.drawer::before { width: 2px; background: linear-gradient(180deg, var(--acc), rgba(255,165,58,.2) 70%, transparent); box-shadow: 0 0 14px rgba(255,165,58,.5); }
.logo { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.logo .tile { position: relative; width: 66px; height: 66px; flex: none; background: var(--acc); color: var(--ink-amber); clip-path: var(--cut-s); box-shadow: 0 0 30px rgba(255,165,58,.45); }
.logo .tile small { position: absolute; left: 7px; top: 5px; font: 700 11px/1 var(--disp); }
.logo .tile b { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font: 700 30px/1 var(--disp); letter-spacing: -.02em; }
.logo .word b { display: block; font: 700 40px/.9 var(--disp); letter-spacing: .12em; color: #fff; text-shadow: 0 0 22px rgba(255,165,58,.35); }
.logo .word small { display: block; margin-top: 8px; font: 600 10.5px/1 'Space Grotesk', sans-serif; letter-spacing: .16em; white-space: nowrap; text-transform: uppercase; color: var(--mute); }
@keyframes neonFlicker { 0%, 91%, 93%, 96%, 100% { opacity: 1; } 92%, 95% { opacity: .55; } }
.brand { font-family: var(--disp); font-size: 22px; letter-spacing: .22em; }
.brand i { background: var(--acc); box-shadow: 0 0 10px var(--acc); transform: rotate(45deg); }
.item { padding: 16px 18px; background: rgba(255,255,255,.035); border: 0; clip-path: var(--cut-s); transition: background .15s, transform .15s; }
.item b { font-family: var(--disp); font-size: 15px; letter-spacing: .2em; }
.item em { color: #5a5870; }
.item::before { width: 3px; left: 0; top: 0; bottom: 0; background: var(--cy); box-shadow: 0 0 10px var(--cy); }
.item:hover, .item:focus-visible { background: rgba(56,225,255,.09); transform: translateX(4px); }
.item:hover em, .item:focus-visible em { color: var(--cy2); }
.item.primary { background: linear-gradient(100deg, #ffb14d, #f08a1c); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.item.primary b, .item.primary em { color: var(--ink-amber); }
.item.primary:hover { background: linear-gradient(100deg, #ffc06a, #f8962a); filter: drop-shadow(0 0 14px rgba(255,165,58,.5)); }
.item.danger:hover b { color: var(--red2); }
input { background: rgba(0,0,0,.45); border: 1px solid #2a2840; clip-path: var(--cut-s); }
input:focus { border-color: var(--cy); }
.slider { background: rgba(255,255,255,.03); border: 0; clip-path: var(--cut-s); }
input[type=range] { clip-path: none; background: #2c2a44; accent-color: var(--acc); }
input[type=range]::-webkit-slider-thumb { background: var(--acc); box-shadow: 0 0 8px rgba(255,165,58,.7); }
.seg button { background: rgba(255,255,255,.04); border: 1px solid #2c2a44; font-family: var(--disp); }
.seg button.on { background: var(--acc); border-color: var(--acc); color: var(--ink-amber); box-shadow: 0 0 12px rgba(255,165,58,.4); }
.swatches button.on { outline-color: var(--cy); }
#loadBar i { background: var(--acc); box-shadow: 0 0 8px rgba(255,165,58,.7); }
footer span { border-color: #2e2c44; color: #c8c6d8; }
#clickToPlay .ctp { clip-path: var(--cut); border: 0; background: rgba(10,8,20,.88); box-shadow: inset 0 2px 0 var(--acc); }
#clickToPlay svg { stroke: var(--acc2); filter: drop-shadow(0 0 5px rgba(255,165,58,.8)); }
#clickToPlay b { font-family: var(--disp); }

/* ---------- end of match ---------- */
.endCard { clip-path: var(--cut); background: linear-gradient(180deg, rgba(16,12,32,.95), rgba(8,6,16,.96)); border: 0; box-shadow: inset 0 2px 0 var(--acc); width: min(88vw, 380px); padding: 28px 24px 22px; }
#endTitle { font-family: var(--disp); font-size: 46px; letter-spacing: .14em; }
#endTitle.win { color: #fff; text-shadow: 0 0 12px rgba(56,225,255,.8), 0 0 40px rgba(56,225,255,.4); }
#endTitle.loss { color: #fff; }
#endTitle.win { color: var(--acc); text-shadow: 0 0 14px rgba(255,165,58,.7), 0 0 40px rgba(255,165,58,.35); }
#endScore { font-family: var(--disp); font-size: 24px; color: #fff; }
.ep { clip-path: var(--cut-s); background: rgba(255,255,255,.04); border: 0; }

/* ---------- HUD ---------- */
#hud { text-shadow: 0 1px 6px rgba(0,0,0,.8); }
#hp, #ammo { background: linear-gradient(100deg, rgba(56,225,255,.12), var(--panel) 45%); border: 0; clip-path: var(--cut); backdrop-filter: blur(8px); }
#hp { left: 26px; bottom: 24px; width: 250px; padding: 12px 18px 14px; box-shadow: inset 3px 0 0 var(--cy); }
#ammo { right: 26px; bottom: 24px; padding: 12px 18px 12px; background: linear-gradient(260deg, rgba(255,165,58,.12), var(--panel) 45%); box-shadow: inset -3px 0 0 var(--acc); }
#hpNum, #ammoMag { font-family: var(--disp); font-weight: 700; font-size: 42px; letter-spacing: .01em; }
#hp small, #mode { font-family: var(--disp); letter-spacing: .3em; color: var(--mute); }
#hpBar { height: 10px; margin-top: 10px; padding: 0; border: 0; background: rgba(255,255,255,.08); transform: skewX(-18deg); box-shadow: none; }
#hpFill { background: linear-gradient(90deg, var(--cy), #e6fbff); box-shadow: 0 0 10px rgba(56,225,255,.55); }
#hpBar::after, #ehpBar::after { inset: 0; background: repeating-linear-gradient(90deg, transparent 0 calc(100% / 6 - 3px), rgba(9,8,18,.95) calc(100% / 6 - 3px) calc(100% / 6)); }
#hp.low #hpNum { color: var(--foe); text-shadow: 0 0 12px rgba(255,59,92,.6); }
#hp.low #hpFill { background: linear-gradient(90deg, var(--foe), var(--foe2)); box-shadow: 0 0 12px rgba(255,59,92,.7); }
#ammoRes { font-family: var(--disp); color: var(--mute); }
#ammoMag.low { color: var(--foe); }
#gunIcon { fill: #e8e6f2; }
#nades .nd { font-family: var(--disp); }
#nades .nd svg .bolt { stroke: var(--cy); }

#score { top: 16px; background: none; border: 0; backdrop-filter: none; gap: 4px; }
#score .side { min-width: 118px; padding: 8px 18px 8px; clip-path: var(--cut); backdrop-filter: blur(8px); }
#score .you { background: linear-gradient(180deg, rgba(56,225,255,.16), var(--panel)); box-shadow: inset 0 -2px 0 var(--cy); }
#score .opp { background: linear-gradient(180deg, rgba(255,59,92,.14), var(--panel)); box-shadow: inset 0 -2px 0 var(--foe); }
#score .side b { font-family: var(--disp); font-size: 32px; }
#score .you b { color: #fff; text-shadow: 0 0 12px rgba(56,225,255,.6); }
#score .opp b { color: #fff; text-shadow: 0 0 12px rgba(255,59,92,.6); }
#score .side span { font-family: var(--disp); letter-spacing: .2em; }
#score .goal { background: var(--panel); clip-path: var(--cut-s); border: 0; padding: 6px 14px; backdrop-filter: blur(8px); }
#score .goal b { font-family: var(--disp); font-size: 22px; }
.pips { display: flex; gap: 2px; margin-top: 5px; }
.pips i { width: 7px; height: 3px; background: rgba(255,255,255,.14); transform: skewX(-20deg); transition: background .2s, box-shadow .2s; }
.you .pips i.on { background: var(--cy); box-shadow: 0 0 6px var(--cy); }
.opp .pips i.on { background: var(--foe); box-shadow: 0 0 6px var(--foe); }

#mmap { border: 1px solid rgba(56,225,255,.35); box-shadow: 0 0 0 4px rgba(9,8,18,.5), 0 0 22px rgba(56,225,255,.18), 0 10px 28px rgba(0,0,0,.5); }
#feed { top: 20px; right: 24px; gap: 5px; font-family: var(--disp); font-size: 13px; }
#feed div { padding: 5px 12px 5px 10px; background: var(--panel); clip-path: var(--cut-s); box-shadow: inset 2px 0 0 rgba(255,255,255,.18); backdrop-filter: blur(6px); }
#feed div.hsrow { box-shadow: inset 2px 0 0 var(--acc); background: linear-gradient(90deg, rgba(255,165,58,.16), var(--panel) 60%); }

#count .n { font-family: var(--disp); font-size: 96px; text-shadow: 0 0 24px rgba(56,225,255,.45), 0 2px 16px rgba(0,0,0,.8); }
#count .n.go { color: var(--acc); font-size: 54px; text-shadow: 0 0 16px rgba(255,165,58,.9), 0 0 50px rgba(255,165,58,.45); }
#count small { font-family: var(--disp); letter-spacing: .32em; color: var(--cy2); }
#center { font-family: var(--disp); }
#hint { font-family: var(--disp); color: var(--acc); }
#board { clip-path: var(--cut); border: 0; background: linear-gradient(180deg, rgba(16,12,32,.95), rgba(8,6,16,.96)); box-shadow: inset 0 2px 0 var(--acc); font-family: var(--disp); }
#board td { border-top-color: #24223a; }

.badge { clip-path: var(--cut-s); border: 0; background: linear-gradient(90deg, rgba(255,165,58,.2), rgba(9,8,18,.9) 60%); box-shadow: inset 3px 0 0 var(--acc); }
.badge b { font-family: var(--disp); letter-spacing: .18em; }
.badge svg { stroke: var(--acc2); filter: drop-shadow(0 0 3px rgba(255,165,58,.8)); }
.badge svg .f { fill: var(--acc2); }
.badge::after { background: linear-gradient(90deg, rgba(255,195,110,.5), transparent 70%); }

#ehpBar { border: 0; padding: 0; height: 8px; width: 96px; transform: skewX(-18deg); background: rgba(9,8,18,.8); box-shadow: 0 0 0 1px rgba(255,59,92,.6), 0 2px 10px rgba(0,0,0,.6); }
#ehpFill { background: linear-gradient(90deg, var(--foe), var(--foe2)); box-shadow: 0 0 8px rgba(255,59,92,.6); }
#prot { font-family: var(--disp); color: var(--cy2); }
#prot i { background: var(--cy); box-shadow: 0 0 10px var(--cy); }
#throwTip { font-family: var(--disp); }

/* free-for-all: match clock, phase line, standings */
#score .goal small { font: 600 11px/1 var(--disp); color: var(--acc2); margin-top: 3px; letter-spacing: .06em; min-height: 11px; }
#phase { position: absolute; top: 102px; left: 50%; transform: translateX(-50%); font: 600 11px/1 var(--disp); letter-spacing: .28em; text-transform: uppercase; color: var(--acc2); white-space: nowrap; }
#endList { list-style: none; margin: 4px 0 10px; padding: 0; display: flex; flex-direction: column; gap: 4px; font-family: var(--disp); }
#endList li { display: grid; grid-template-columns: 22px 1fr 34px 34px; align-items: center; padding: 8px 12px; background: rgba(255,255,255,.04); clip-path: var(--cut-s); font-size: 14px; text-align: left; }
#endList li i { font-style: normal; color: var(--mute); }
#endList li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
#endList li b { text-align: right; font-weight: 700; }
#endList li em { text-align: right; font-style: normal; color: var(--mute); }
#endList li:first-child { background: linear-gradient(90deg, rgba(255,165,58,.2), rgba(255,255,255,.04)); }
#endList li.me { box-shadow: inset 3px 0 0 var(--cy); }
#board th:first-child, #board td:first-child { width: 28px; color: var(--mute); }
#board tr.me td { color: var(--cy2); }
#board p { margin: 12px 0 0; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }
