:root {
  --bg: #11151c;
  --card: rgba(20, 25, 34, 0.92);
  --text: #e8edf3;
  --muted: #8d99a8;
  --accent: #f5a623;
  --danger: #e74c3c;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font: 15px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif; }
#game, #game canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }

#menu, #paused, #settings, #loadout, #statsPanel, #reportPanel { position: fixed; inset: 0; display: grid; place-items: safe center; overflow-y: auto; background: rgba(8, 10, 14, 0.55); padding: 16px; z-index: 20; }
#settings, #loadout, #statsPanel, #reportPanel { z-index: 30; }
#paused { cursor: pointer; }
body.pad-playing { cursor: none; } /* controller play has no pointer lock, so hide the idle cursor */
.card { background: var(--card); border: 1px solid #2a3240; border-radius: 12px; padding: 28px; width: min(420px, 100%); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5); }
#paused .card, #settings .card, #loadout .card, #statsPanel .card, #reportPanel .card { cursor: default; }
h1 { margin: 0; font-size: 40px; letter-spacing: 6px; color: var(--accent); }
h2 { margin: 0 0 6px; }
.sub { color: var(--muted); margin: 6px 0 20px; }
form { display: flex; gap: 8px; }
input[type="text"], input:not([type]) { flex: 1; min-width: 0; padding: 12px; font-size: 16px; border-radius: 8px; border: 1px solid #334; background: #0c0f14; color: var(--text); }
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
button { padding: 12px 22px; font-size: 16px; font-weight: 700; border: 0; border-radius: 8px; background: var(--accent); color: #1a1205; cursor: pointer; }
button:disabled { opacity: 0.5; cursor: default; }
button.ghost { background: transparent; color: var(--text); border: 1px solid #3a4454; margin-top: 10px; width: 100%; }
button.ghost:hover { border-color: var(--accent); color: var(--accent); }

.setting-row { display: grid; grid-template-columns: 1fr 2fr auto; align-items: center; gap: 10px; margin: 16px 0; text-align: left; }
.setting-row label { color: var(--muted); font-size: 14px; }
.setting-row input[type="range"] { width: 100%; accent-color: var(--accent); }
.setting-val { font: 700 13px ui-monospace, monospace; color: var(--text); min-width: 3.5em; text-align: right; }
.checkbox-row { grid-template-columns: 1fr auto; }
.checkbox-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); }
.setting-row select { padding: 8px 10px; font-size: 14px; border-radius: 6px; border: 1px solid #334; background: #0c0f14; color: var(--text); }
#settings .note { margin: 14px 0; font-size: 12px; }
#settingsClose { margin-top: 8px; }

.loadout-row { display: flex; gap: 10px; margin-top: 12px; text-align: left; }
.loadout-row label { flex: 1; color: var(--muted); font-size: 13px; display: flex; flex-direction: column; gap: 4px; }
.loadout-row select { padding: 9px 10px; font-size: 14px; border-radius: 8px; border: 1px solid #334; background: #0c0f14; color: var(--text); }
.loadout-hint { margin: 4px 0 0; }

#fps { position: fixed; top: 10px; left: 10px; z-index: 15; background: rgba(0, 0, 0, 0.45); color: #9be89b; padding: 3px 8px; border-radius: 4px; font: 700 12px ui-monospace, monospace; pointer-events: none; }
#status { color: var(--muted); margin: 14px 0 0; min-height: 1.4em; }
#error { color: var(--danger); margin: 4px 0 0; min-height: 1.4em; }
.keys { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; text-align: left; margin-top: 14px; color: var(--muted); font-size: 13px; }
kbd { background: #222a36; border: 1px solid #3a4454; border-bottom-width: 2px; border-radius: 4px; padding: 1px 5px; color: var(--text); font: 12px ui-monospace, monospace; }
.note { color: var(--muted); font-size: 12px; margin: 16px 0 0; }

#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%); transition: opacity 0.12s, transform 0.12s; }
#crosshair.ads { opacity: 0.25; transform: translate(-50%, -50%) scale(0.45); }
#crosshair::before, #crosshair::after { content: ""; position: absolute; background: rgba(255, 255, 255, 0.9); box-shadow: 0 0 2px #000; }
#crosshair::before { left: 10px; top: 0; width: 2px; height: 22px; }
#crosshair::after { top: 10px; left: 0; height: 2px; width: 22px; }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; transform: translate(-50%, -50%) rotate(45deg); opacity: 0; transition: opacity 0.15s; }
#hitmarker::before, #hitmarker::after { content: ""; position: absolute; background: #fff; }
#hitmarker::before { left: 14px; top: 0; width: 2px; height: 30px; }
#hitmarker::after { top: 14px; left: 0; height: 2px; width: 30px; }
#hitmarker.show { opacity: 1; transition: none; }
#hitmarker.head::before, #hitmarker.head::after { background: var(--danger); }
#damage { position: absolute; inset: 0; box-shadow: inset 0 0 120px rgba(231, 76, 60, 0.9); opacity: 0; transition: opacity 0.4s; }
#damage.show { opacity: 1; transition: none; }

#bottom { position: absolute; left: 20px; right: 20px; bottom: 18px; display: flex; justify-content: space-between; align-items: flex-end; }
#left { display: flex; flex-direction: column; gap: 6px; }
#hpbox { display: flex; align-items: center; gap: 10px; font: 700 28px ui-monospace, monospace; text-shadow: 0 2px 4px #000; }
#hpbar { width: 180px; height: 10px; background: rgba(0, 0, 0, 0.5); border-radius: 5px; overflow: hidden; }
#hpfill { height: 100%; width: 100%; background: #2ecc71; transition: width 0.15s; }
#stabar { width: 180px; height: 6px; margin-left: 46px; background: rgba(0, 0, 0, 0.5); border-radius: 3px; overflow: hidden; }
#stafill { height: 100%; width: 100%; background: #3daedb; transition: width 0.1s; }
#stabar.empty #stafill { background: #5a6a75; }
#weapons { display: flex; gap: 6px; }
#weapons span { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; align-items: center; gap: 0 6px; background: rgba(0, 0, 0, 0.45); padding: 4px 10px 5px; border-radius: 6px; color: var(--muted); border: 1px solid transparent; opacity: 0.7; transition: opacity 0.12s; }
#weapons span img { grid-column: 1 / -1; height: 30px; width: 84px; object-fit: contain; filter: brightness(0.8); }
#weapons span img:not([src]) { display: none; }
#weapons span i { font: 700 11px ui-monospace, monospace; font-style: normal; color: var(--muted); }
#weapons span b { font-size: 12px; font-weight: 600; }
#weapons span.on { color: var(--text); border-color: var(--accent); opacity: 1; }
#weapons span.on img { filter: none; }

#score { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: rgba(0, 0, 0, 0.45); padding: 6px 14px; border-radius: 6px; font-size: 14px; }
#killfeed { position: absolute; top: 14px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#killfeed div { background: rgba(0, 0, 0, 0.5); padding: 4px 10px; border-radius: 4px; font-size: 13px; }
#center { position: absolute; top: 26%; left: 0; right: 0; text-align: center; font-size: 26px; font-weight: 700; text-shadow: 0 2px 6px #000; white-space: pre-line; }
#board { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: var(--card); border-radius: 10px; padding: 16px 20px; min-width: 300px; }
#board table { width: 100%; border-collapse: collapse; }
#board th, #board td { padding: 6px 10px; text-align: left; }
#board th:not(:first-child), #board td:not(:first-child) { text-align: right; }
#board tr.me td { color: var(--accent); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; }

@media (max-width: 600px) {
  #hpbar { width: 90px; }
  #stabar { width: 90px; margin-left: 0; }
  #weapons span { padding: 4px 8px; font-size: 12px; }
}
#killfeed .weap { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin: 0 6px; }

#right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
#ammobox { font: 700 28px ui-monospace, monospace; text-shadow: 0 2px 4px #000; }
#ammobox #res { font-size: 16px; color: var(--muted); margin-left: 6px; }
#ammobox.low #mag { color: var(--danger); }
#reloadbar { width: 140px; height: 4px; background: rgba(0, 0, 0, 0.5); border-radius: 2px; overflow: hidden; visibility: hidden; }
#reloadbar.on { visibility: visible; }
#reloadfill { height: 100%; width: 0; background: var(--accent); }
.ammoicon { display: inline-block; width: 11px; height: 11px; background: #3ddc84; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }

/* map vote (intermission) + new-map banner */
#vote { position: absolute; bottom: 92px; left: 50%; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); pointer-events: auto; }
.vote-title { text-align: center; font-weight: 700; margin-bottom: 10px; text-shadow: 0 2px 4px #000; }
.vote-hint { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 8px; }
#voteOptions { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.vote-opt { display: grid; grid-template-columns: auto 1fr; gap: 4px 8px; align-items: center; text-align: left; padding: 12px 14px; background: var(--card); color: var(--text); border: 1px solid #2a3240; border-radius: 10px; font-weight: 400; font-size: 14px; }
.vote-opt:hover { border-color: #4a5566; }
.vote-opt.mine { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.vote-opt kbd { grid-row: span 2; font-size: 14px; padding: 3px 8px; }
.vote-name { font-weight: 700; font-size: 16px; }
.vote-meta { color: var(--muted); font-size: 12px; }
.vote-bar { grid-column: 1 / -1; height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.vote-bar span { display: block; height: 100%; background: var(--accent); transition: width 0.2s; }
.vote-count { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
#mapBanner { position: absolute; top: 22%; left: 0; right: 0; text-align: center; font-size: 34px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; color: #fff; text-shadow: 0 3px 12px rgba(0, 0, 0, 0.8); opacity: 0; }
#mapBanner.show { animation: banner 3.4s ease forwards; }
@keyframes banner { 0% { opacity: 0; transform: translateY(8px); } 12% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }

/* sniper scope overlay: clear lens with a darkened rim, black surround, a reticle that shows on
   dark and light backgrounds (black posts + fine lines with a light edge, red centre dot); it fades
   in from black as you scope in */
#scope { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at center, transparent 0, transparent 33.2vmin, rgba(0,0,0,0.45) 34.8vmin, rgba(0,0,0,0.94) 35.7vmin, #000 36.3vmin); }
#scope:not([hidden]) { animation: scopeIn 0.16s ease-out; }
@keyframes scopeIn { from { background-color: #000; } to { background-color: transparent; } }
#scope::before, #scope::after { content: ""; position: absolute; left: 50%; top: 50%; width: 72vmin; height: 72vmin; transform: translate(-50%, -50%); border-radius: 50%; }
#scope::before { background: radial-gradient(circle, rgba(150, 190, 255, 0.04) 0, transparent 60%, rgba(0, 0, 0, 0.28) 100%); box-shadow: inset 0 0 2.5vmin rgba(0, 0, 0, 0.55); }
#scope::after { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cg fill='none' stroke='%23fff' stroke-opacity='0.3' stroke-width='1.8'%3E%3Cpath d='M100 70V130M70 100H130'/%3E%3C/g%3E%3Cg fill='none' stroke='%23000'%3E%3Cpath stroke-width='0.6' d='M100 70V130M70 100H130'/%3E%3Cpath stroke-width='3.4' d='M100 0V70M100 130V200M0 100H70M130 100H200'/%3E%3Cpath stroke-width='0.6' d='M97.5 90h5M97.5 80h5M97.5 110h5M97.5 120h5M90 97.5v5M80 97.5v5M110 97.5v5M120 97.5v5'/%3E%3C/g%3E%3Ccircle cx='100' cy='100' r='2.4' fill='%23ff3b30' fill-opacity='0.3'/%3E%3Ccircle cx='100' cy='100' r='1' fill='%23ff3b30'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
body.scoped #crosshair { display: none; }

/* menu v2: account bar, loadout tiles, buttons */
.menu-card { width: min(480px, 100%); }
.account { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: rgba(255, 255, 255, 0.04); border: 1px solid #2a3240; border-radius: 8px; padding: 8px 12px; margin: 0 0 12px; font-size: 13px; color: var(--muted); text-align: left; }
.account b { color: var(--text); }
.account .verified { color: #5fd38d; }
.linkbtn { background: none; border: 0; padding: 0 0 0 10px; color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: underline; cursor: pointer; }
#joinform input:disabled { opacity: 0.75; }
.loadout-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 12px; cursor: pointer; }
.loadout-tile { display: flex; align-items: center; gap: 10px; background: #0c0f14; border: 1px solid #2a3240; border-radius: 8px; padding: 8px 10px; text-align: left; }
.loadout-tile:hover { border-color: var(--accent); }
.loadout-tile { flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 8px; }
.loadout-tile img { width: 100%; height: 30px; object-fit: contain; }
.loadout-tile span { font-size: 13px; }
.loadout-tile small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; }
.loadout-tile span { font-weight: 600; font-size: 12.5px; }
.menu-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.menu-buttons .ghost { margin-top: 0; font-size: 14px; padding: 10px; }
a.btnlike { display: flex; align-items: center; justify-content: center; text-decoration: none; border-radius: 8px; font-weight: 700; color: var(--text); border: 1px solid #3a4454; }
a.btnlike:hover { border-color: var(--accent); color: var(--accent); }
.controls { margin-top: 14px; text-align: left; color: var(--muted); font-size: 13px; }
.controls summary { cursor: pointer; }
.card.wide { width: min(880px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; }
.slot-title { text-align: left; margin: 18px 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.slot-title span { font-weight: 400; margin-left: 6px; opacity: 0.7; text-transform: none; letter-spacing: 0; }

/* loadout cards */
.weapon-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.wcard { text-align: left; background: #0c0f14; border: 1px solid #2a3240; border-radius: 10px; padding: 10px 12px 12px; cursor: pointer; color: var(--text); font: inherit; font-weight: 400; display: block; width: 100%; }
.wcard:hover { border-color: #4a5566; }
.wcard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.wcard img { display: block; width: 100%; height: 64px; object-fit: contain; margin-bottom: 6px; }
.wcard .wname { font-weight: 700; font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; }
.wcard .wname em { font-style: normal; font-weight: 400; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.wcard .wdesc { color: var(--muted); font-size: 12px; margin: 2px 0 8px; min-height: 2.6em; }
.stat { display: grid; grid-template-columns: 74px 1fr 42px; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.stat .bar { height: 5px; background: rgba(255, 255, 255, 0.08); border-radius: 3px; overflow: hidden; }
.stat .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.stat b { font: 600 11px ui-monospace, monospace; color: var(--text); text-align: right; }
.wcard .wkills { margin-top: 8px; font-size: 11.5px; color: #5fd38d; }

/* stats + leaderboard */
.mystats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 10px; }
.mystats div { background: #0c0f14; border: 1px solid #2a3240; border-radius: 8px; padding: 8px 10px; text-align: left; }
.mystats small { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; }
.mystats b { font-size: 20px; }
.board-wrap { overflow-x: auto; }
table.lb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.lb th, table.lb td { padding: 6px 8px; text-align: right; border-bottom: 1px solid #222a36; white-space: nowrap; }
table.lb th:nth-child(2), table.lb td:nth-child(2) { text-align: left; }
table.lb th { color: var(--muted); font-weight: 600; font-size: 12px; }
table.lb tr.me td { color: var(--accent); }
.muted { color: var(--muted); }
#board .vbadge, .vbadge { color: #5fd38d; font-size: 11px; margin-left: 4px; }

/* weapon-switch popup */
#weaponPop { position: absolute; bottom: 120px; right: 24px; font: 700 16px system-ui, sans-serif; letter-spacing: 1px; text-transform: uppercase; color: #fff; text-shadow: 0 2px 6px #000; opacity: 0; transition: opacity 0.35s; }
#weaponPop.show { opacity: 1; transition: none; }

/* grenade / molotov counts next to the ammo */
#throwables { display: flex; gap: 8px; justify-content: flex-end; }
#throwables span { display: flex; align-items: center; gap: 5px; background: rgba(0, 0, 0, 0.45); padding: 3px 8px; border-radius: 6px; font: 700 14px ui-monospace, monospace; text-shadow: 0 1px 3px #000; }
#throwables span.empty { opacity: 0.4; }
#throwables kbd { font-size: 10px; padding: 0 4px; }
.ic { display: inline-block; width: 12px; height: 14px; }
.ic.frag { background: radial-gradient(circle at 40% 55%, #6d7c4a, #2f3820 70%); border-radius: 45% 45% 50% 50%; box-shadow: 3px -3px 0 -1px #9aa0a6; }
.ic.molotov { width: 8px; background: linear-gradient(#f5a623 0 22%, #cbb994 22% 34%, #6b4a22 34%); border-radius: 2px 2px 3px 3px; }

/* single equipment slot + aiming hint + flashbang whiteout */
#throwables small { font: 600 11px system-ui, sans-serif; color: var(--muted); }
#throwHint { text-align: right; font-size: 12px; color: #fff; text-shadow: 0 1px 3px #000; min-height: 1em; }
.ic.smoke { width: 9px; background: linear-gradient(#9aa0a6 0 20%, #55606a 20% 60%, #d9d9d9 60% 75%, #55606a 75%); border-radius: 2px; }
.ic.flash { width: 9px; background: linear-gradient(#9aa0a6 0 20%, #2b3036 20% 45%, #c8ccd0 45% 55%, #2b3036 55% 75%, #c8ccd0 75% 85%, #2b3036 85%); border-radius: 2px; }
.ic.tknife { width: 5px; height: 16px; background: linear-gradient(#d7dee6 0 62%, #1b1c1e 62%); clip-path: polygon(50% 0, 100% 18%, 100% 100%, 0 100%, 0 18%); }
#flashOverlay { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
/* frozen / stunned / poisoned (special weapons): a tinted vignette + a label above the crosshair */
#statusFx { position: absolute; inset: 0; pointer-events: none; display: flex; justify-content: center; align-items: flex-start; padding-top: 30vh;
  font: 800 15px/1 system-ui, sans-serif; letter-spacing: 0.18em; text-shadow: 0 1px 4px #000; color: #fff; }
#statusFx.freeze { box-shadow: inset 0 0 160px 40px rgba(110, 200, 255, 0.55); color: #bfe8ff; }
#statusFx.stun, #statusFx.freeze.stun { box-shadow: inset 0 0 160px 50px rgba(120, 150, 255, 0.6); color: #d6dcff; animation: stunFlicker 0.12s steps(2) infinite; }
#statusFx.poison { box-shadow: inset 0 0 160px 40px rgba(90, 220, 60, 0.45); color: #b9ff9a; animation: poisonPulse 1s ease-in-out infinite; }
#statusFx.freeze.poison { box-shadow: inset 0 0 160px 40px rgba(110, 200, 255, 0.45), inset 0 0 60px 10px rgba(90, 220, 60, 0.4); }
@keyframes stunFlicker { 50% { opacity: 0.55; } }
@keyframes poisonPulse { 50% { opacity: 0.6; } }
.stat.eqstat { grid-template-columns: 1fr auto; }

#equipOthers { display: flex; gap: 6px; justify-content: flex-end; font: 700 12px ui-monospace, monospace; text-shadow: 0 1px 3px #000; }
#equipOthers span { display: flex; align-items: center; gap: 3px; background: rgba(0, 0, 0, 0.35); padding: 2px 6px; border-radius: 5px; }
#equipOthers span.empty { opacity: 0.4; }
#equipOthers kbd { font-size: 10px; padding: 0 4px; align-self: center; }

#equipmentCards.disabled { opacity: 0.45; filter: grayscale(1); }

/* ---------- chat ---------- */
#chat { position: absolute; left: 20px; bottom: 100px; width: min(440px, calc(100% - 40px)); font-size: 14px; }
#chatLines { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; max-height: 200px; overflow: hidden; }
#chatLines .cl:not(:nth-last-child(-n+7)) { display: none; }
.cl { background: rgba(0, 0, 0, 0.45); padding: 3px 9px; border-radius: 4px; text-shadow: 0 1px 2px #000; word-break: break-word; transition: opacity 0.8s; max-width: 100%; }
.cl.old { opacity: 0; }
.cl.sys { color: #b8c2cf; font-style: italic; }
.cl.announce { color: var(--accent); font-weight: 600; }
.cl .tag.mod, .tag.mod { background: #5ab0ff; }
.cl .tag, .tag { display: inline-block; background: var(--accent); color: #1a1205; font-size: 10px; font-weight: 800; letter-spacing: 0.5px; padding: 0 4px; border-radius: 3px; margin-right: 6px; font-style: normal; vertical-align: 1px; }
#chat.open #chatLines { overflow-y: auto; pointer-events: auto; background: rgba(0, 0, 0, 0.3); border-radius: 6px; padding: 4px; }
#chat.open #chatLines .cl { display: block; opacity: 1; }
#chatForm { display: flex; align-items: center; gap: 8px; margin-top: 5px; pointer-events: auto; background: rgba(0, 0, 0, 0.7); border: 1px solid var(--accent); border-radius: 6px; padding: 5px 9px; }
#chatForm span { color: var(--accent); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
#chatForm input { flex: 1; min-width: 0; background: transparent; border: 0; color: #fff; font: inherit; outline: none; padding: 2px 0; }
#chatNote { margin-top: 4px; font-size: 13px; color: #ffd28a; text-shadow: 0 1px 3px #000; min-height: 1px; }
#announce { position: absolute; top: 64px; left: 50%; transform: translateX(-50%); max-width: min(720px, calc(100% - 40px)); text-align: center; background: rgba(12, 14, 20, 0.82); border: 1px solid var(--accent); color: #fff; font-size: 20px; font-weight: 700; padding: 12px 22px; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
#announce::before { content: 'ANNOUNCEMENT'; display: block; color: var(--accent); font-size: 11px; letter-spacing: 3px; margin-bottom: 4px; }
#announce.show { animation: announceIn 0.35s ease; }
@keyframes announceIn { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- admin panel (admins only) ---------- */
#adminPanel { position: fixed; inset: 0; display: grid; place-items: safe center; overflow-y: auto; background: rgba(8, 10, 14, 0.55); padding: 16px; z-index: 30; }
.admin-card { text-align: left; background: #151a23; }
.admin-card h2 { margin-top: 0; }
.admin-card h3 { font-size: 14px; margin: 18px 0 8px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.admin-card .muted, .adm-table .muted { color: var(--muted); font-weight: 400; }
.admin-card button.small { padding: 5px 10px; font-size: 13px; margin: 0; width: auto; }
.admin-card button.danger { background: #3a1d1d; color: #ffb4a8; border: 1px solid #6b2a24; }
.admin-card .bad { color: #ff8a7a; }
.adm-tabs { display: flex; gap: 6px; margin: 4px 0 16px; flex-wrap: wrap; }
.adm-tabs button { padding: 8px 14px; font-size: 14px; background: transparent; color: var(--text); border: 1px solid #3a4454; }
.adm-tabs button.on { background: var(--accent); color: #1a1205; border-color: var(--accent); }
.adm-line { display: block; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.admin-card input, .admin-card select, .admin-card textarea { display: block; width: 100%; margin-top: 5px; padding: 8px 10px; background: #0f131a; color: var(--text); border: 1px solid #3a4454; border-radius: 6px; font: inherit; font-size: 14px; box-sizing: border-box; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid #2a3240; }
.adm-table td { padding: 7px 8px; border-bottom: 1px solid #1e2530; vertical-align: middle; }
.adm-table td.acts { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.adm-table td.acts select { width: auto; margin: 0; padding: 5px 6px; font-size: 13px; }
.adm-mute { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid #1e2530; font-size: 14px; }
.adm-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.adm-btns button { font-size: 14px; padding: 10px 16px; margin: 0; width: auto; }
.adm-maps { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; }
.adm-maps button { margin: 0; }
.adm-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.adm-stats label { font-size: 12px; color: var(--muted); font-weight: 600; }
.adm-stats label.changed { color: var(--accent); }
.adm-stats label.changed input { border-color: var(--accent); }
.adm-changed { font-size: 13px; margin: 12px 0 0; }
.adm-msg { min-height: 18px; font-size: 14px; margin: 14px 0 4px; }
.adm-msg.ok { color: #7ee2a0; } .adm-msg.err { color: #ff8a7a; }

/* railgun charge ring around the crosshair: fills up, turns white when fully charged */
#charge { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); border-radius: 50%;
  background: conic-gradient(rgba(64, 210, 255, 0.95) calc(var(--k, 0) * 360deg), rgba(255, 255, 255, 0.12) 0);
  -webkit-mask: radial-gradient(circle, transparent 17px, #000 18px); mask: radial-gradient(circle, transparent 17px, #000 18px); filter: drop-shadow(0 0 3px rgba(0, 0, 0, 0.6)); }
#charge.ready { background: rgba(230, 250, 255, 1); filter: drop-shadow(0 0 6px rgba(64, 210, 255, 0.9)); }

.wcard.off { opacity: 0.4; cursor: not-allowed; filter: grayscale(1); position: relative; }
.wcard.off::after { content: 'Disabled'; position: absolute; top: 8px; right: 10px; font-size: 11px; font-weight: 700; color: #ff8a7a; text-transform: uppercase; letter-spacing: 1px; }
.admin-card .adm-onoff { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; }
.admin-card .adm-onoff input { width: auto; margin: 0; }

/* ---------- tournaments ---------- */
.tag.bot { background: #8d99a8; color: #10141a; }
#board tr.team-red td:first-child { box-shadow: inset 3px 0 0 #e74c3c; }
#board tr.team-blue td:first-child { box-shadow: inset 3px 0 0 #3498db; }
#tourneyResult { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(6, 8, 12, 0.55); pointer-events: none; z-index: 5; }
#tourneyResult .tr-card { background: rgba(18, 22, 30, 0.96); border: 1px solid var(--accent); border-radius: 14px; padding: 22px 28px; min-width: min(460px, calc(100% - 32px)); text-align: center; box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6); }
#tourneyResult h2 { margin: 8px 0 4px; color: var(--accent); }
#tourneyResult .muted { color: var(--muted); font-size: 13px; }
#tourneyResult table { width: 100%; border-collapse: collapse; margin: 14px 0 6px; font-size: 14px; }
#tourneyResult th { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 600; padding: 4px 8px; }
#tourneyResult td { padding: 5px 8px; border-top: 1px solid #232a36; }
#tourneyResult td:nth-child(2) { text-align: left; }
.admin-card .tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; margin-top: 8px; }
.admin-card .tgrid label { font-size: 12px; color: var(--muted); font-weight: 600; }
.admin-card .tteams { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.admin-card .tteam { border: 1px solid #2a3240; border-radius: 8px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.admin-card .tteam h4 { margin: 0 0 2px; font-size: 13px; }
.admin-card .tteam.red { border-color: #7a2a22; } .admin-card .tteam.red h4 { color: #ff8a7a; }
.admin-card .tteam.blue { border-color: #1f4e7a; } .admin-card .tteam.blue h4 { color: #7cc0ff; }
.admin-card #tTeams h3 button { margin-left: 8px; vertical-align: 1px; }
#tourneyResult .tr-cup { color: var(--accent); display: block; margin: 0 auto; }
#hud.spectating #bottom, #hud.spectating #crosshair { display: none; }

/* Settings → Keys */
.set-h { margin: 20px 0 4px; font-size: 15px; text-align: left; }
.bind-list { display: flex; flex-direction: column; gap: 4px; text-align: left; margin-top: 6px; }
.bind-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13px; }
.bind-key { min-width: 104px; padding: 5px 10px; font-size: 13px; font-weight: 600; background: #0f131a; color: var(--text); border: 1px solid #3a4454; border-radius: 6px; }
.bind-key:hover { border-color: var(--accent); }
.bind-key.waiting { border-color: var(--accent); color: var(--accent); animation: bindPulse 1s ease-in-out infinite; }
@keyframes bindPulse { 50% { opacity: 0.55; } }

.vote-mode { display: inline-block; font-size: 10px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; padding: 1px 6px; border-radius: 4px; vertical-align: 2px; background: #2e3644; color: #cfd6df; }
.vote-mode.tdm { background: linear-gradient(90deg, #b8392d 50%, #2b7bbf 50%); color: #fff; }
.vote-mode.gg { background: var(--accent); color: #1a1205; }
.vote-mode.special { background: linear-gradient(90deg, #7a3cff, #26b5ff); color: #fff; }

/* killcam: letterbox bars over the replay; the crosshair and hit feedback are ours, not the killer's */
#killcam { position: absolute; inset: 0; pointer-events: none; }
#killcam .kc-top, #killcam .kc-bottom { position: absolute; left: 0; right: 0; height: 11vh; display: flex; align-items: center; justify-content: center; gap: 14px; color: #fff; text-shadow: 0 1px 3px #000; }
#killcam .kc-top { top: 0; background: linear-gradient(#000d, #0000); font-size: 20px; font-weight: 600; }
#killcam .kc-top b { background: #dc2626; color: #fff; text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px; padding: 4px 10px; border-radius: 4px; text-shadow: none; }
#killcam .kc-bottom { bottom: 0; background: linear-gradient(#0000, #000d); font-size: 15px; color: #e2e8f0; }
body.killcam #crosshair, body.killcam #hitmarker, body.killcam #charge, body.killcam #bottom, body.killcam #score, body.killcam #damage { display: none; } /* #scope: shown when the killer is scoped in */

/* report a player */
#reportPanel .card { max-width: 440px; text-align: left; }
#reportForm { display: grid; gap: 6px; margin: 12px 0 4px; }
#reportForm label { font-size: 13px; color: #cbd5e1; margin-top: 6px; }
#reportForm select, #reportForm input { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid #334155; background: #0f172a; color: #e2e8f0; font: inherit; }
#repStatus { min-height: 18px; }

/* Stats screen: public profile link + hide switch */
.profile-row { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; margin-top: 12px; font-size: 13.5px; text-align: left; }
.profile-row a, #statsPanel .note a { color: var(--accent); }
.hide-profile { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--text); }
.hide-profile input { width: 16px; height: 16px; accent-color: var(--accent); }
.lb td a { color: inherit; text-decoration: none; }
.lb td a:hover { color: var(--accent); text-decoration: underline; }


/* "You died": a quick beat before the killcam */
#kcIntro { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(ellipse at center, rgba(90, 0, 0, 0.15) 0%, rgba(60, 0, 0, 0.55) 70%, rgba(20, 0, 0, 0.8) 100%); animation: kcIn 0.35s ease-out; }
#kcIntro .kc-died { font-size: clamp(38px, 7vw, 72px); font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase; color: #fecaca; text-shadow: 0 3px 18px #000, 0 0 30px rgba(220, 38, 38, 0.6); }
#kcIntro .kc-by { font-size: 20px; color: #fff; text-shadow: 0 2px 6px #000; }
#kcIntro .kc-by b { color: #fca5a5; }
#kcIntro .kc-next { font-size: 13px; color: #cbd5e1; text-shadow: 0 1px 3px #000; margin-top: 6px; }
@keyframes kcIn { from { opacity: 0; transform: scale(1.06); } to { opacity: 1; transform: none; } }
body:has(#kcIntro:not([hidden])) #crosshair, body:has(#kcIntro:not([hidden])) #center { display: none; }

/* the killer's health during the killcam */
#killcam .kc-hp { position: absolute; left: 22px; bottom: calc(11vh + 10px); min-width: 230px; background: rgba(8, 10, 14, 0.6); border: 1px solid #2a3240; border-radius: 10px; padding: 8px 12px; }
#killcam .kc-hp small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: #cbd5e1; margin-bottom: 3px; }
#killcam .kc-hprow { display: flex; align-items: center; gap: 10px; }
#killcam .kc-hprow b { font: 700 24px ui-monospace, monospace; min-width: 46px; text-shadow: 0 2px 4px #000; }
#killcam .kc-hpbar { flex: 1; height: 9px; background: rgba(0, 0, 0, 0.5); border-radius: 5px; overflow: hidden; }
#killcam .kc-hpbar i { display: block; height: 100%; width: 100%; background: #2ecc71; transition: width 0.15s, background 0.3s; }

/* Gun Game progress under the score line */
#ggBar { position: absolute; top: 50px; left: 50%; transform: translateX(-50%); min-width: 300px; background: rgba(0, 0, 0, 0.5); border-radius: 8px; padding: 6px 14px 9px; font-size: 13px; text-align: center; overflow: hidden; }
#ggBar b { color: var(--accent); text-transform: uppercase; letter-spacing: 0.1em; font-size: 11px; margin-right: 8px; }
#ggBar em { font-style: normal; font-weight: 700; }
#ggBar i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--accent); transition: width 0.3s; }
#board .tag.gl { background: #2a2210; color: var(--accent); }
/* minimap */
#minimap { position: absolute; top: 40px; left: 14px; width: 168px; height: 168px; border-radius: 50%; pointer-events: none; }
body.killcam #minimap, body.killcam #ggBar { display: none; }
/* callouts */
#callouts { position: absolute; top: 19%; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.co { display: flex; flex-direction: column; align-items: center; gap: 2px; animation: coIn 0.22s ease-out; transition: opacity 0.45s, transform 0.45s; }
.co.out { opacity: 0; transform: translateY(-8px); }
.co-item { font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; text-shadow: 0 2px 8px #000; font-size: 18px; color: #fff; }
.co-main { font-size: 30px; }
.co-gold { color: #fcd34d; }
.co-warn { color: #fb923c; }
.co-bad { color: #fca5a5; }
.co-feed .co-item { font-size: 14px; font-weight: 700; letter-spacing: 0.04em; text-transform: none; color: #e2e8f0; background: rgba(0, 0, 0, 0.45); padding: 3px 12px; border-radius: 6px; }
@keyframes coIn { from { opacity: 0; transform: scale(1.25); } to { opacity: 1; transform: none; } }
body.killcam #callouts { display: none; }
/* achievement toasts + the grid on the Stats screen */
#achToasts { position: absolute; top: 222px; left: 14px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; z-index: 5; }
.ach-toast { display: flex; gap: 12px; align-items: center; background: rgba(15, 20, 28, 0.92); border: 1px solid #3a3120; border-left: 4px solid var(--accent); border-radius: 10px; padding: 10px 14px; min-width: 260px; animation: achIn 0.35s ease-out; transition: opacity 0.5s, transform 0.5s; }
.ach-toast.out { opacity: 0; transform: translateX(-20px); }
.ach-toast i { font-style: normal; font-size: 24px; color: var(--accent); }
.ach-toast small { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.ach-toast b { display: block; font-size: 16px; }
.ach-toast span { font-size: 12.5px; color: #cbd5e1; }
@keyframes achIn { from { opacity: 0; transform: translateX(-30px); } to { opacity: 1; transform: none; } }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 10px; text-align: left; }
.ach { background: #0c0f14; border: 1px solid #2a3240; border-radius: 8px; padding: 8px 10px; opacity: 0.55; position: relative; }
.ach.got { opacity: 1; border-color: #6b5520; background: linear-gradient(160deg, #1d1a10, #0c0f14 60%); }
.ach i { font-style: normal; color: #475569; font-size: 16px; float: right; }
.ach.got i { color: var(--accent); }
.ach.got.tier3 i, .ach.got.tier4 i { color: #fde68a; text-shadow: 0 0 8px rgba(245, 166, 35, 0.8); }
.ach b { display: block; font-size: 13px; }
.ach span { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.3; margin-top: 2px; }
.ach small { display: block; font-size: 11px; color: #cbd5e1; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- settings panel: tabs, a scrolling body, the Done button always in view ---------- */
#settings { background: rgba(6, 8, 12, 0.82); backdrop-filter: blur(3px); }
#settings .settings-card { width: min(720px, 100%); max-height: calc(100vh - 32px); padding: 0; display: flex; flex-direction: column; text-align: left; overflow: hidden; }
.set-head { padding: 22px 26px 0; border-bottom: 1px solid #2a3240; }
.set-head h2 { margin: 0 0 14px; }
.set-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.set-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--muted); padding: 9px 14px; font-size: 14px; font-weight: 700; white-space: nowrap; }
.set-tabs button:hover { color: var(--text); }
.set-tabs button.on { color: var(--text); border-bottom-color: var(--accent); }
.set-body { overflow-y: auto; padding: 6px 26px 12px; flex: 1; }
.set-pane[hidden] { display: none; }
.set-pane .set-h { margin: 18px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.srow { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 18px; align-items: center; padding: 13px 0; border-bottom: 1px solid #1e2632; }
.srow:last-child { border-bottom: 0; }
.srow.tog { grid-template-columns: minmax(0, 1fr) auto; }
.srow label { cursor: pointer; }
.srow label b { display: block; font-size: 14.5px; font-weight: 600; color: var(--text); }
.srow label small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
.sctl { display: flex; align-items: center; gap: 12px; min-width: 0; }
.sctl input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.sctl .setting-val { min-width: 48px; text-align: right; font: 700 13px ui-monospace, monospace; color: var(--text); }
.sctl select { width: 100%; padding: 8px 10px; font-size: 14px; border-radius: 8px; border: 1px solid #334; background: #0c0f14; color: var(--text); }
/* on/off switches */
input.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: #2a3240; position: relative; cursor: pointer; margin: 0; transition: background 0.15s; flex: 0 0 auto; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #cbd5e1; transition: transform 0.15s, background 0.15s; }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(18px); background: #1a1205; }
input.switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.set-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 26px; border-top: 1px solid #2a3240; background: rgba(12, 15, 20, 0.6); }
.set-foot .note { margin: 0; font-size: 12px; }
#settingsClose { margin: 0; padding: 10px 26px; }
#settings .set-pane .note { margin: 14px 0 8px; font-size: 12.5px; }
#settings .bind-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 6px 22px; }
#settings .bind-row { padding: 4px 0; border-bottom: 1px solid #1e2632; }
#bindReset { margin-top: 10px; width: auto; padding: 8px 16px; font-size: 13px; }
@media (max-width: 640px) {
  .set-head, .set-body, .set-foot { padding-left: 16px; padding-right: 16px; }
  .srow { grid-template-columns: 1fr; gap: 8px; }
  .srow.tog { grid-template-columns: minmax(0, 1fr) auto; }
  .set-foot .note { display: none; }
  .set-tabs button { padding: 9px 9px; font-size: 13.5px; }
  #settingsClose { width: 100%; }
}

/* ---- loadout screen: tabs (your four picks), presets, a filterable grid + a detail panel ---- */
.lo-card { width: min(1180px, 100%); text-align: left; padding: 20px 22px; }
.lo-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.lo-head .sub { margin: 2px 0 10px; font-size: 13px; }
.lo-head button { padding: 10px 26px; }
.lo-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.lotab { padding: 0; background: none; border: 0; font: inherit; color: inherit; text-align: left; }
.lotab .loadout-tile { height: 100%; }
.lotab.on .loadout-tile { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; background: #15110a; }
.lotab kbd { font: 600 10px ui-monospace, monospace; border: 1px solid #3a4454; border-radius: 3px; padding: 0 4px; opacity: 0.8; }
.lotab .loadout-tile img { height: 36px; }
.lo-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px; font-size: 13px; }
.lo-presets .plabel { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; margin-right: 2px; }
.preset { display: inline-flex; border: 1px solid #3a4454; border-radius: 999px; overflow: hidden; }
.preset.on { border-color: var(--accent); }
.preset button { background: none; color: var(--text); font-size: 13px; font-weight: 600; padding: 4px 4px 4px 12px; border-radius: 0; }
.preset button.x { padding: 4px 10px 4px 6px; color: var(--muted); font-weight: 400; }
.preset button:hover { color: var(--accent); }
.preset-save { display: inline-flex; gap: 4px; }
.preset-save input { flex: none; width: 150px; padding: 5px 9px; font-size: 13px; border-radius: 999px; }
.preset-save button { padding: 5px 12px; font-size: 12.5px; border-radius: 999px; }
.lo-presets .pmsg { color: var(--muted); font-size: 12px; }
.lo-body { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-top: 10px; align-items: start; }
.lo-tools { display: flex; gap: 8px; }
.lo-tools input { padding: 9px 11px; font-size: 14px; }
.lo-tools select { padding: 8px 10px; font-size: 14px; border-radius: 8px; border: 1px solid #334; background: #0c0f14; color: var(--text); }
.lo-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; }
.chip { padding: 4px 11px; font-size: 12.5px; font-weight: 600; border-radius: 999px; background: #0c0f14; color: var(--muted); border: 1px solid #2a3240; }
.chip:hover { color: var(--text); border-color: #4a5566; }
.chip.on { background: var(--accent); color: #1a1205; border-color: var(--accent); }
.lo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; max-height: min(56vh, 560px); overflow-y: auto; padding: 2px 4px 2px 2px; align-content: start; }
.lo-grid.disabled { opacity: 0.55; }
.lo-grid .wcard { position: relative; padding: 8px 10px 9px; }
.lo-grid .wcard img { height: 52px; margin-bottom: 4px; }
.lo-grid .wcard .wname { font-size: 14px; padding-right: 18px; }
.lo-grid .wcard:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wcard .star { position: absolute; top: 4px; right: 4px; padding: 2px 6px; background: none; color: #6b7686; font-size: 16px; line-height: 1; border-radius: 6px; }
.wcard .star:hover { color: var(--accent); }
.wcard .star.on { color: var(--accent); }
.wtags { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 3px; min-height: 17px; }
.wtags span { font-size: 10.5px; font-weight: 700; letter-spacing: 0.03em; padding: 1px 6px; border-radius: 4px; background: #1d2633; color: #9fc4ff; }
.wtags span.custom { background: #2b1d38; color: #d6a8ff; }
.wtags span.eq { background: #3a2a0c; color: var(--accent); }
.wquick { font: 600 11px ui-monospace, monospace; color: var(--muted); }
.lo-detail { position: sticky; top: 0; background: #0c0f14; border: 1px solid #2a3240; border-radius: 10px; padding: 10px 12px 12px; }
#loPreview { display: block; width: 100%; height: 170px; cursor: grab; border-radius: 8px; background: radial-gradient(ellipse at 50% 40%, #222b38, #0c0f14 70%); touch-action: none; }
#loPreview:active { cursor: grabbing; }
.dhead { display: flex; justify-content: space-between; align-items: baseline; margin-top: 8px; }
.dhead b { font-size: 17px; }
.dhead em { font-style: normal; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.ddesc { color: var(--muted); font-size: 12.5px; margin: 2px 0 8px; }
.dcmp { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.dcmp .sw { display: inline-block; width: 10px; height: 6px; border-radius: 2px; vertical-align: middle; margin: 0 2px 0 6px; }
.dcmp .sw.a { background: var(--accent); margin-left: 0; }
.dcmp .sw.b { width: 2px; height: 10px; background: #fff; }
.lo-detail .stat { grid-template-columns: 74px 1fr 64px; }
.lo-detail .stat .bar { position: relative; overflow: visible; }
.lo-detail .stat .bar u { position: absolute; top: -3px; width: 2px; height: 11px; margin-left: -1px; background: #fff; border-radius: 1px; }
.lo-detail .stat b.up { color: #5fd38d; }
.lo-detail .stat b.down { color: #ff8a7a; }
.dttk { font-size: 12px; margin: 8px 0 0; color: var(--text); }
.dfx { list-style: none; margin: 8px 0 0; padding: 0; font-size: 12px; color: var(--muted); }
.dfx li { margin: 3px 0; }
.dfx b { color: #9fc4ff; }
.dacts { display: flex; gap: 8px; align-items: center; margin-top: 12px; }
.dacts button { padding: 9px 10px; font-size: 13px; flex: 1; white-space: nowrap; }
.dacts button.ghost { margin-top: 0; }
.dacts .eqd { flex: 1; color: var(--accent); font-weight: 700; font-size: 14px; }
@media (max-width: 820px) {
  .lo-card { padding: 16px; }
  .lo-body { grid-template-columns: minmax(0, 1fr); }
  .lo-detail { min-width: 0; }
  .lo-detail { position: static; order: -1; }
  .lo-tabs { grid-template-columns: repeat(2, 1fr); }
  .lo-grid { max-height: none; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  #loPreview { height: 130px; }
}

/* loadout: which loadout (normal modes / Special Weapons mode) */
.lo-modes { display: inline-flex; border: 1px solid #2a3240; border-radius: 9px; overflow: hidden; margin: 0 0 10px; }
.lo-modes button { background: #0c0f14; color: var(--muted); font-size: 13.5px; padding: 7px 16px; border-radius: 0; }
.lo-modes button.on { background: var(--accent); color: #1a1205; }
.lo-modes button[data-v="special"].on { background: linear-gradient(90deg, #7a3cff, #26b5ff); color: #fff; }

/* the owner's test range: pause-menu panel, floating damage numbers, last-hit readout */
#rangePanel { margin-top: 16px; padding-top: 14px; border-top: 1px solid #2a3240; text-align: left; }
#rangePanel h3 { margin: 0 0 4px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
#rangePanel .note { font-size: 12px; margin: 0 0 10px; }
.rg-row { display: grid; grid-template-columns: 70px 1fr; gap: 8px; align-items: center; margin: 6px 0; }
.rg-row label { color: var(--muted); font-size: 13px; }
.rg-row select { padding: 7px 9px; font-size: 13.5px; border-radius: 6px; border: 1px solid #334; background: #0c0f14; color: var(--text); }
.rg-check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; margin: 10px 0 4px; }
.rg-check input { width: 16px; height: 16px; accent-color: var(--accent); }
#paused .card:has(#rangePanel:not([hidden])) { width: min(460px, 100%); }
#dmgNums { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
#dmgNums span { position: absolute; transform: translate(-50%, -50%); font: 800 18px/1 system-ui, sans-serif; color: #fff; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0, 0, 0, 0.6); white-space: nowrap; }
#dmgNums span.head { color: #ffb341; font-size: 21px; }
#dmgNums span.kill { color: #ff5a4a; font-size: 22px; }
#rangeHud { position: absolute; left: 50%; bottom: 120px; transform: translateX(-50%); background: rgba(10, 13, 18, 0.72); border: 1px solid #2a3240; border-radius: 8px; padding: 6px 12px; font: 600 13px system-ui, sans-serif; color: var(--text); white-space: nowrap; }
#rangeHud b { color: var(--accent); }
