:root { --hud: #e8eef7; --accent: #ffb347; --red: #ff4a4a; --blue: #4ab3ff; --green: #7bff8a; --yellow: #ffd23a;
  --num: "Bahnschrift", "Arial Narrow", "Roboto Condensed", Impact, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #000; overflow: hidden; font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--hud); }
#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
#hud { position: fixed; inset: 0; pointer-events: none; user-select: none; }
/* crosshair */
#crosshair { position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; transform: translate(-50%, -50%); }
.ch-dot { position: absolute; left: 50%; top: 50%; width: 4px; height: 4px; background: #fff; border-radius: 50%; transform: translate(-50%, -50%); box-shadow: 0 0 2px #000, 0 0 2px #000; }
#crosshair.large .ch-dot { width: 6px; height: 6px; }
/* four identical arms (30% long each side, gap in the middle) drawn with gradients: symmetric, no clip-path artefacts */
#crosshair::before, #crosshair::after { content: ""; position: absolute; filter: drop-shadow(0 0 1px #000) drop-shadow(0 0 1px #000); }
#crosshair::before { left: 50%; top: 0; width: 2px; height: 100%; transform: translateX(-50%); background: linear-gradient(to bottom, rgba(255,255,255,0.85) 0 30%, transparent 30% 70%, rgba(255,255,255,0.85) 70% 100%); }
#crosshair::after { top: 50%; left: 0; height: 2px; width: 100%; transform: translateY(-50%); background: linear-gradient(to right, rgba(255,255,255,0.85) 0 30%, transparent 30% 70%, rgba(255,255,255,0.85) 70% 100%); }
#crosshair.hit .ch-dot { background: var(--accent); }
#hitmarker { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; transform: translate(-50%,-50%) rotate(45deg); opacity: 0; border: 2px solid var(--accent); border-radius: 2px; }
#hitmarker.show { animation: hm 220ms ease-out; }
@keyframes hm { 0% { opacity: 1; transform: translate(-50%,-50%) rotate(45deg) scale(0.7);} 100% { opacity: 0; transform: translate(-50%,-50%) rotate(45deg) scale(1.3);} }
/* screen flashes */
#damage-flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(255,0,0,0) 35%, rgba(255,24,24,0.6) 100%); opacity: 0; transition: opacity 140ms; }
#pickup-flash { position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.22) 100%); opacity: 0; transition: opacity 260ms; }
/* damage direction arcs: rotate around the screen centre, arc sits above the crosshair */
#dmg-dirs { position: absolute; left: 50%; top: 50%; width: 0; height: 0; }
.dmg-dir { position: absolute; left: -90px; top: -90px; width: 180px; height: 180px; border-radius: 50%; border: 10px solid transparent; border-top-color: rgba(255,40,40,0.9); opacity: 0; transform: rotate(0deg); filter: drop-shadow(0 0 6px rgba(255,0,0,0.7)); }
.dmg-dir.show { animation: dd 700ms ease-out forwards; }
@keyframes dd { 0% { opacity: 1; } 70% { opacity: 0.9; } 100% { opacity: 0; } }
/* bottom status: ammo | health | armor, Q3 style big numbers */
#hud-bottom { position: absolute; left: 0; right: 0; bottom: 22px; display: flex; justify-content: center; align-items: flex-end; gap: 56px; }
.stat { display: flex; align-items: center; gap: 10px; min-width: 150px; text-shadow: 0 0 8px #000, 0 2px 2px #000; }
.stat .icon { width: 34px; height: 34px; filter: drop-shadow(0 2px 2px #000); }
.stat .col { display: flex; flex-direction: column; align-items: flex-start; line-height: 1; }
.stat .label { font-size: 11px; letter-spacing: 3px; opacity: 0.7; margin-top: 2px; font-weight: 600; }
.stat .value { font-family: var(--num); font-stretch: condensed; font-size: 62px; font-weight: 700; line-height: 0.9; font-variant-numeric: tabular-nums; letter-spacing: -1px; }
.stat.health { color: #fff; } .stat.health .icon { color: var(--green); } .stat.health .value { color: #fff; }
.stat.health.low .value, .stat.health.low .icon { color: var(--red); animation: pulse 0.6s infinite; }
.stat.health.mega .value { color: var(--blue); }
.stat.armor .icon { color: var(--yellow); } .stat.armor .value { color: var(--yellow); }
.stat.armor.red .icon, .stat.armor.red .value { color: var(--red); }
.stat.ammo .value { color: #cfe4ff; } .stat.ammo .icon { color: #cfe4ff; }
.stat.ammo.low .value { color: var(--accent); }
@keyframes pulse { 50% { opacity: 0.45; } }
/* weapon bar (right) */
#weapons { position: absolute; right: 22px; bottom: 150px; display: flex; flex-direction: column; gap: 3px; align-items: flex-end; }
#weapons .w { display: flex; align-items: center; gap: 8px; font-family: var(--num); font-stretch: condensed; font-size: 15px; letter-spacing: 1px; padding: 3px 8px 3px 6px; background: rgba(0,0,0,0.5); border-right: 4px solid transparent; opacity: 0.55; font-variant-numeric: tabular-nums; min-width: 150px; }
#weapons .w .sw { width: 10px; height: 10px; border-radius: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); }
#weapons .w .k { opacity: 0.6; width: 10px; }
#weapons .w .n { flex: 1; font-weight: 600; }
#weapons .w .a { font-weight: 700; font-size: 16px; }
#weapons .w.have { opacity: 0.9; } #weapons .w.active { border-right-color: var(--c); background: rgba(0,0,0,0.75); opacity: 1; transform: translateX(-6px); }
#weapons .w.empty .a { color: var(--red); }
/* top: frag counters + timer */
#hud-top { position: absolute; top: 14px; left: 0; right: 0; display: flex; flex-direction: column; align-items: center; text-shadow: 0 0 8px #000, 0 2px 2px #000; }
#scores { display: flex; gap: 14px; align-items: stretch; }
.scorebox { display: flex; flex-direction: column; align-items: center; min-width: 84px; padding: 4px 10px 6px; background: rgba(0,0,0,0.5); border-radius: 3px; border-bottom: 3px solid; }
.scorebox.me { border-color: var(--blue); } .scorebox.them { border-color: var(--red); }
.scorebox .score { font-family: var(--num); font-stretch: condensed; font-size: 40px; font-weight: 700; line-height: 0.95; font-variant-numeric: tabular-nums; }
.scorebox.me .score { color: var(--blue); } .scorebox.them .score { color: var(--red); }
.scorebox .pname { font-size: 11px; letter-spacing: 2px; opacity: 0.85; margin-top: 3px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#timer-box { display: flex; flex-direction: column; align-items: center; min-width: 120px; padding: 4px 8px; background: rgba(0,0,0,0.5); border-radius: 3px; }
#timer { font-family: var(--num); font-stretch: condensed; font-size: 40px; font-weight: 700; letter-spacing: 1px; font-variant-numeric: tabular-nums; text-align: center; line-height: 1.2; }
#timer.late { color: var(--accent); }
#timer-sub { font-size: 11px; letter-spacing: 2px; opacity: 0.85; margin-top: -2px; min-height: 13px; white-space: nowrap; }
#timer-sub:empty { display: none; }
/* arena: no pickups, so no item timers */
#hud.arena #item-timers { display: none; }
/* messages */
#pickup-msg { position: absolute; top: 19%; width: 100%; text-align: center; font-family: var(--num); font-stretch: condensed; font-size: 26px; font-weight: 600; letter-spacing: 3px; color: #fff; opacity: 0; text-shadow: 0 0 8px #000, 0 0 18px rgba(255,255,255,0.4); transition: opacity 150ms; }
#center-msg { position: absolute; top: 33%; width: 100%; text-align: center; font-family: var(--num); font-stretch: condensed; font-size: 60px; font-weight: 700; letter-spacing: 8px; color: #fff; text-shadow: 0 0 14px #000, 0 0 30px var(--accent); opacity: 0; transition: opacity 200ms; }
#click-to-play { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(0,0,0,0.35); pointer-events: auto; cursor: pointer; font-family: var(--num); font-size: 44px; letter-spacing: 8px; font-weight: 700; color: #fff; text-shadow: 0 0 14px #000, 0 0 30px var(--accent); }
#click-to-play small { font-size: 14px; letter-spacing: 3px; opacity: 0.8; font-family: inherit; }
#center-msg .sub { display: block; font-size: 20px; letter-spacing: 3px; opacity: 0.8; margin-top: 4px; }
#obituary { position: absolute; left: 20px; top: 20px; font-size: 14px; text-shadow: 0 0 4px #000; display: flex; flex-direction: column; gap: 4px; }
#obituary div { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.5); padding: 3px 10px 3px 8px; border-left: 3px solid var(--c, var(--red)); animation: fadein 150ms ease-out; }
#obituary .wi { display: inline-block; width: 12px; height: 12px; border-radius: 2px; background: var(--c); box-shadow: 0 0 6px var(--c); }
#obituary .me { color: var(--blue); font-weight: 700; } #obituary .them { color: var(--red); font-weight: 700; }
/* net graph */
#netgraph { position: absolute; right: 18px; top: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; opacity: 0.9; }
#ng-canvas { width: 180px; height: 44px; background: rgba(0,0,0,0.45); border-radius: 2px; }
#ng-text { font-size: 11px; font-family: Consolas, monospace; text-shadow: 0 0 4px #000; display: flex; gap: 10px; }
#speedometer { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); font-family: var(--num); font-stretch: condensed; font-size: 16px; opacity: 0.7; text-shadow: 0 0 4px #000; font-variant-numeric: tabular-nums; }
/* item timers (right, mid) */
#item-timers { position: absolute; right: 22px; top: 50%; transform: translateY(-50%); font-family: var(--num); font-stretch: condensed; font-size: 15px; display: flex; flex-direction: column; gap: 3px; text-shadow: 0 0 4px #000; font-variant-numeric: tabular-nums; }
#item-timers div { display: flex; align-items: center; gap: 8px; background: rgba(0,0,0,0.5); padding: 3px 8px; min-width: 140px; border-right: 3px solid var(--c); }
#item-timers .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 6px var(--c); }
#item-timers .n { flex: 1; letter-spacing: 1px; opacity: 0.9; } #item-timers .t { font-weight: 700; min-width: 32px; text-align: right; }
#item-timers .up .t { color: var(--green); } #item-timers .soon .t { color: var(--accent); }
/* scoreboard */
#scoreboard { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%); min-width: 560px; background: rgba(10,12,20,0.92); border: 1px solid #3a4560; border-radius: 6px; padding: 18px 26px; font-size: 16px; }
#scoreboard table { width: 100%; border-collapse: collapse; } #scoreboard th { text-align: left; font-size: 11px; letter-spacing: 2px; opacity: 0.6; padding: 4px 8px; } #scoreboard td { padding: 8px; border-top: 1px solid #2a3040; font-variant-numeric: tabular-nums; font-family: var(--num); font-stretch: condensed; font-size: 18px; }
#scoreboard h2 { margin: 0 0 8px; letter-spacing: 4px; font-size: 20px; font-family: var(--num); font-stretch: condensed; }
/* end of match screen (over the HUD, needs the mouse: pointer lock is released while it is up) */
#endscreen { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(3,5,10,0.55); z-index: 5; }
.es-panel { width: 720px; max-width: 96vw; max-height: 94vh; overflow: auto; background: rgba(10,12,20,0.94); border: 1px solid #3a4560; border-radius: 8px; padding: 20px 28px 22px; box-shadow: 0 30px 80px rgba(0,0,0,0.7); animation: fadein 250ms ease-out; }
#es-banner { font-family: var(--num); font-stretch: condensed; font-size: 54px; font-weight: 900; letter-spacing: 8px; text-align: center; line-height: 1; color: #fff; text-shadow: 0 0 24px var(--accent); }
#es-banner.win { color: var(--green); text-shadow: 0 0 24px rgba(123,255,138,0.6); } #es-banner.lose { color: var(--red); text-shadow: 0 0 24px rgba(255,74,74,0.6); }
#es-sub { text-align: center; font-size: 12px; letter-spacing: 3px; opacity: 0.7; margin: 8px 0 14px; }
.es-tablewrap { overflow-x: auto; }
#es-table { width: 100%; border-collapse: collapse; font-family: var(--num); font-stretch: condensed; font-variant-numeric: tabular-nums; }
#es-table th { text-align: right; font-size: 10px; letter-spacing: 2px; opacity: 0.6; padding: 4px 8px; font-family: "Segoe UI", Roboto, sans-serif; white-space: nowrap; }
#es-table td { text-align: right; padding: 7px 8px; border-top: 1px solid #2a3040; font-size: 18px; white-space: nowrap; }
#es-table th:first-child, #es-table td:first-child { text-align: left; }
#es-table td.w { font-size: 14px; opacity: 0.85; } #es-table td.w small { opacity: 0.6; font-size: 11px; margin-left: 3px; }
#es-table tr.winner td:first-child { color: var(--accent); } #es-table tr.me td:first-child { font-weight: 700; }
#es-table tr.winner td:first-child::before { content: "\2605  "; font-size: 13px; }
.es-next { margin-top: 16px; border-top: 1px solid #2a3040; padding-top: 12px; }
.es-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.es-row label { display: flex; align-items: center; gap: 8px; font-size: 12px; letter-spacing: 1px; }
.es-row select { background: #0a0d14; border: 1px solid #2c3648; color: #fff; padding: 7px 8px; border-radius: 4px; font-size: 13px; letter-spacing: 1px; }
.es-row button { flex: 0 0 auto; padding: 9px 18px; }
#es-rematch.ready { background: var(--green); border-color: #b8ffc0; color: #06200a; }
#es-votes { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; font-size: 13px; }
#es-votes .v { display: flex; gap: 10px; align-items: center; background: rgba(0,0,0,0.35); padding: 5px 10px; border-radius: 3px; border-left: 3px solid #3a4560; }
#es-votes .v.ready { border-left-color: var(--green); } #es-votes .v .n { min-width: 140px; font-weight: 700; letter-spacing: 1px; } #es-votes .v .p { flex: 1; opacity: 0.85; } #es-votes .v .r { font-size: 11px; letter-spacing: 2px; opacity: 0.6; } #es-votes .v.ready .r { color: var(--green); opacity: 1; }
#es-votes .next { margin-top: 4px; font-size: 12px; letter-spacing: 2px; color: var(--accent); }
#es-auto { margin-top: 8px; font-size: 11px; letter-spacing: 2px; opacity: 0.6; text-align: right; }
/* menu */
#menu { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at 50% 30%, #1b2233 0%, #05070c 70%); }
.panel { width: 460px; background: rgba(12,16,26,0.96); border: 1px solid #2c3648; border-radius: 8px; padding: 26px 30px; box-shadow: 0 30px 80px rgba(0,0,0,0.7); }
.panel h1 { margin: 0; font-size: 36px; letter-spacing: 8px; font-weight: 900; color: #fff; text-shadow: 0 0 20px rgba(255,179,71,0.6); font-family: var(--num); font-stretch: condensed; }
.panel .sub { margin: 4px 0 18px; font-size: 12px; opacity: 0.6; letter-spacing: 1px; }
.panel label { display: flex; align-items: center; gap: 10px; margin: 8px 0; font-size: 13px; letter-spacing: 1px; }
.panel input[type=text], .panel input:not([type]) { flex: 1; background: #0a0d14; border: 1px solid #2c3648; color: #fff; padding: 8px 10px; border-radius: 4px; font-size: 14px; }
.panel input[type=range] { flex: 1; }
.panel textarea { width: 100%; background: #0a0d14; border: 1px solid #2c3648; color: #cfe4ff; font-family: Consolas, monospace; font-size: 11px; margin-top: 8px; }
.row { display: flex; gap: 10px; margin: 12px 0; }
button { flex: 1; background: #1b2233; border: 1px solid #3a4560; color: #fff; padding: 10px 12px; border-radius: 4px; cursor: pointer; letter-spacing: 2px; font-weight: 700; font-size: 13px; }
button:hover { background: #26304a; } button.primary { background: var(--accent); color: #1a1000; border-color: #ffd28a; } button.primary:hover { background: #ffc46a; }
details { margin: 8px 0; font-size: 13px; } summary { cursor: pointer; opacity: 0.8; letter-spacing: 1px; }
.help { font-size: 11px; opacity: 0.55; margin: 14px 0 0; letter-spacing: 0.5px; }
.panel select { flex: 0 0 160px; background: #0a0d14; border: 1px solid #2c3648; color: #fff; padding: 7px 8px; border-radius: 4px; font-size: 13px; letter-spacing: 1px; }
.panel .blurb { flex: 1; font-size: 11px; opacity: 0.55; letter-spacing: 0.5px; }
#room { flex: 1; min-width: 0; background: #0a0d14; border: 1px solid #2c3648; color: #fff; padding: 8px 10px; border-radius: 4px; font-family: Consolas, monospace; font-size: 15px; letter-spacing: 3px; text-transform: uppercase; text-align: center; }
#room-box { display: flex; align-items: center; gap: 10px; margin: 10px 0; font-size: 12px; letter-spacing: 2px; }
#room-box b { font-family: Consolas, monospace; font-size: 26px; letter-spacing: 5px; color: var(--accent); }
#room-box button { flex: 0 0 auto; padding: 6px 10px; font-size: 11px; }
#menu-status, #p2p-status { font-size: 12px; color: var(--accent); min-height: 16px; margin-top: 8px; }
/* identity: skin + colour picker with a canvas preview of the model */
.ident { display: flex; gap: 14px; align-items: center; margin: 8px 0 4px; }
.ident-col { flex: 1; min-width: 0; }
#skin-preview { flex: 0 0 96px; width: 96px; height: 128px; background: radial-gradient(ellipse at 50% 40%, #1b2233 0%, #0a0d14 80%); border: 1px solid #2c3648; border-radius: 4px; }
.palette { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.palette .sw { width: 20px; height: 20px; border-radius: 3px; border: 2px solid transparent; cursor: pointer; background: var(--c); box-shadow: 0 0 6px var(--c); opacity: 0.8; }
.palette .sw:hover { opacity: 1; } .palette .sw.on { border-color: #fff; opacity: 1; transform: scale(1.12); }
/* keys panel */
#keys { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 12px; }
#keys td { padding: 3px 6px; border-top: 1px solid #1c2334; }
#keys td.a { letter-spacing: 1px; opacity: 0.85; }
#keys td.b { text-align: right; width: 46%; }
#keys .kb { flex: none; padding: 4px 10px; font-family: Consolas, monospace; font-size: 12px; letter-spacing: 1px; min-width: 120px; background: #0a0d14; border-color: #2c3648; }
#keys .kb.listening { background: var(--accent); color: #1a1000; border-color: #ffd28a; animation: pulse 0.8s infinite; }
#keys-hint { margin-top: 6px; }
#keys-panel .row { margin: 8px 0 0; } #keys-reset { flex: none; padding: 6px 12px; font-size: 11px; }
.fade-in { animation: fadein 250ms ease-out forwards; } @keyframes fadein { from { opacity: 0 } to { opacity: 1 } }
