/* TINY ARENA — arcade-brutal neon HUD */

:root {
  --void: #06070f;
  --panel: rgba(10, 12, 26, 0.82);
  --ink: #e8eaff;
  --dim: #6b70a3;
  --indigo: #5b6cff;
  --cyan: #27e0ff;
  --magenta: #ff3df0;
  --hot: #ff4b2e;
  --amber: #ffb43d;
  --lime: #7dff3d;
  --display: 'Russo One', sans-serif;
  --mono: 'Chakra Petch', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--void);
  font-family: var(--mono);
  color: var(--ink);
  user-select: none;
}

#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

.hidden { display: none !important; }

/* ------------------------------------------------ join screen */

.join {
  position: fixed; inset: 0; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(91, 108, 255, 0.22), transparent 60%),
    radial-gradient(ellipse 60% 40% at 80% -10%, rgba(255, 61, 240, 0.13), transparent 60%),
    var(--void);
}

.join-noise {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image: repeating-linear-gradient(0deg, rgba(255,255,255,0.025) 0 1px, transparent 1px 3px);
  animation: scan 9s linear infinite;
}

@keyframes scan { to { background-position: 0 100px; } }

.join-inner {
  position: relative; text-align: center;
  animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.25, 1) both;
}

@keyframes rise { from { opacity: 0; transform: translateY(26px); } }

.join-logo {
  font-family: var(--display);
  font-size: clamp(56px, 11vw, 128px);
  line-height: 0.9;
  letter-spacing: 0.02em;
  display: flex; flex-direction: column; align-items: center;
}

.join-logo-tiny {
  color: transparent;
  -webkit-text-stroke: 2px var(--cyan);
  text-shadow: 0 0 34px rgba(39, 224, 255, 0.35);
}

.join-logo-arena {
  color: var(--indigo);
  text-shadow:
    0 0 18px rgba(91, 108, 255, 0.9),
    0 0 70px rgba(91, 108, 255, 0.5);
  transform: skewX(-4deg);
}

.join-sub {
  margin-top: 18px;
  color: var(--dim);
  letter-spacing: 0.32em;
  font-size: 12px;
  font-weight: 600;
}

#join-form { margin-top: 42px; display: flex; gap: 0; justify-content: center; }

#join-name {
  width: 250px; padding: 16px 18px;
  background: rgba(12, 14, 30, 0.9);
  border: 1px solid rgba(91, 108, 255, 0.45);
  border-right: none;
  color: var(--ink);
  font-family: var(--mono); font-size: 17px; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase;
  outline: none;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
}

#join-name::placeholder { color: var(--dim); }
#join-name:focus { border-color: var(--cyan); box-shadow: 0 0 24px rgba(39, 224, 255, 0.2); }

#join-btn {
  padding: 16px 30px;
  background: var(--indigo);
  border: none; cursor: pointer;
  color: #fff;
  font-family: var(--display); font-size: 16px; letter-spacing: 0.1em;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%);
  box-shadow: 0 0 30px rgba(91, 108, 255, 0.55);
  transition: background 0.15s, transform 0.15s;
}

#join-btn:hover { background: var(--cyan); color: var(--void); transform: translateY(-1px); }

.join-keys {
  margin-top: 34px;
  display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
  color: var(--dim); font-size: 12px; letter-spacing: 0.08em;
}

.join-keys b { color: var(--cyan); font-weight: 700; margin-right: 5px; }

.join-status { margin-top: 20px; min-height: 18px; color: var(--hot); font-size: 13px; letter-spacing: 0.1em; }

/* ------------------------------------------------ crosshair + hitmarker */

.crosshair {
  position: fixed; left: 50%; top: 50%; width: 0; height: 0; z-index: 20;
  pointer-events: none;
}

.crosshair i {
  position: absolute; background: var(--cyan);
  box-shadow: 0 0 6px rgba(39, 224, 255, 0.9);
}

.crosshair i:nth-child(1) { left: -1px; top: -11px; width: 2px; height: 6px; }
.crosshair i:nth-child(2) { left: -1px; top: 5px;   width: 2px; height: 6px; }
.crosshair i:nth-child(3) { left: -11px; top: -1px; width: 6px; height: 2px; }
.crosshair i:nth-child(4) { left: 5px;   top: -1px; width: 6px; height: 2px; }
.crosshair b { position: absolute; left: -1px; top: -1px; width: 2px; height: 2px; background: #fff; }

.hitmarker {
  position: fixed; left: 50%; top: 50%; width: 0; height: 0; z-index: 21;
  pointer-events: none; opacity: 0;
}

.hitmarker i {
  position: absolute; width: 2px; height: 9px; background: var(--hot);
  box-shadow: 0 0 8px var(--hot);
}

.hitmarker i:nth-child(1) { transform: translate(-8px, -14px) rotate(45deg); }
.hitmarker i:nth-child(2) { transform: translate(6px, -14px) rotate(-45deg); }
.hitmarker i:nth-child(3) { transform: translate(-8px, 5px) rotate(-45deg); }
.hitmarker i:nth-child(4) { transform: translate(6px, 5px) rotate(45deg); }

.hitmarker.pop { animation: hit 0.22s ease-out; }
@keyframes hit { 0% { opacity: 1; transform: scale(1.5); } 100% { opacity: 0; transform: scale(0.9); } }

/* ------------------------------------------------ damage vignette */

.dmg-vignette {
  position: fixed; inset: 0; z-index: 15; pointer-events: none; opacity: 0;
  background: radial-gradient(ellipse at center, transparent 46%, rgba(255, 40, 20, 0.55) 100%);
  transition: opacity 0.35s;
}

/* ------------------------------------------------ HUD chrome */

.hud { position: fixed; inset: 0; z-index: 10; pointer-events: none; }

.hud-bottom {
  position: absolute; left: 0; right: 0; bottom: 26px;
  display: flex; align-items: flex-end; justify-content: center; gap: 18px;
}

.stat {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 22px 10px 16px;
  background: var(--panel);
  border: 1px solid rgba(91, 108, 255, 0.28);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  transform: skewX(-6deg);
  backdrop-filter: blur(6px);
}

.stat > * { transform: skewX(6deg); }

.stat-icon { font-size: 22px; opacity: 0.9; }

.stat-val {
  font-family: var(--display); font-size: 44px; line-height: 1;
  min-width: 84px; text-align: right;
  font-variant-numeric: tabular-nums;
}

.stat-hp .stat-icon, .stat-hp .stat-val { color: var(--amber); text-shadow: 0 0 16px rgba(255, 180, 61, 0.6); }
.stat-hp.low .stat-icon, .stat-hp.low .stat-val { color: var(--hot); text-shadow: 0 0 18px rgba(255, 75, 46, 0.9); animation: blink 0.8s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.55; } }

.stat-armor .stat-icon, .stat-armor .stat-val { color: var(--lime); text-shadow: 0 0 16px rgba(125, 255, 61, 0.5); }

.stat-ammo { flex-direction: row-reverse; }
.stat-ammo .stat-val { color: var(--cyan); text-shadow: 0 0 16px rgba(39, 224, 255, 0.6); }
.stat-label { color: var(--dim); font-size: 11px; letter-spacing: 0.22em; font-weight: 700; }

.weapon-slots {
  position: absolute; right: 26px; bottom: 26px;
  display: flex; flex-direction: column; gap: 6px;
}

.wslot {
  padding: 7px 14px;
  background: var(--panel);
  border: 1px solid rgba(91, 108, 255, 0.2);
  color: var(--dim); font-size: 13px; font-weight: 700; letter-spacing: 0.12em;
  clip-path: polygon(8px 0, 100% 0, 100% 100%, 0 100%, 0 8px);
}

.wslot b { color: var(--indigo); margin-right: 8px; }

.wslot.active {
  border-color: var(--cyan); color: var(--ink);
  box-shadow: 0 0 18px rgba(39, 224, 255, 0.25), inset 0 0 12px rgba(39, 224, 255, 0.08);
}

.wslot.active b { color: var(--cyan); }
.wslot.empty { opacity: 0.4; }

.hud-meta {
  position: absolute; left: 26px; bottom: 26px;
  color: var(--dim); font-size: 11px; letter-spacing: 0.14em;
}

/* ------------------------------------------------ kill feed + messages */

.killfeed {
  position: absolute; top: 22px; left: 24px;
  display: flex; flex-direction: column; gap: 6px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
}

.kf-row {
  padding: 6px 12px;
  background: var(--panel);
  border-left: 3px solid var(--indigo);
  animation: kfIn 0.25s ease-out both;
}

.kf-row.me { border-left-color: var(--hot); }
.kf-row .k { color: var(--cyan); }
.kf-row .v { color: var(--magenta); }
.kf-row .w { color: var(--dim); margin: 0 7px; }

@keyframes kfIn { from { opacity: 0; transform: translateX(-14px); } }

.center-msg {
  position: absolute; left: 50%; top: 26%; transform: translateX(-50%);
  font-family: var(--display); font-size: 34px; letter-spacing: 0.06em;
  color: var(--ink); text-shadow: 0 0 26px rgba(91, 108, 255, 0.9);
  opacity: 0; white-space: nowrap;
}

.center-msg.show { animation: cmsg 2.2s ease-out both; }
@keyframes cmsg {
  0% { opacity: 0; transform: translateX(-50%) scale(1.35); }
  12% { opacity: 1; transform: translateX(-50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; }
}

.pickup-msg {
  position: absolute; left: 50%; bottom: 34%; transform: translateX(-50%);
  font-size: 15px; font-weight: 700; letter-spacing: 0.2em; color: var(--lime);
  text-shadow: 0 0 14px rgba(125, 255, 61, 0.7);
  opacity: 0;
}

.pickup-msg.show { animation: pmsg 1.4s ease-out both; }
@keyframes pmsg { 0% { opacity: 0; transform: translate(-50%, 10px); } 15% { opacity: 1; transform: translate(-50%, 0); } 75% { opacity: 1; } 100% { opacity: 0; } }

/* ------------------------------------------------ scoreboard */

.scoreboard {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  min-width: 460px;
  background: rgba(8, 10, 22, 0.92);
  border: 1px solid rgba(91, 108, 255, 0.4);
  box-shadow: 0 0 60px rgba(91, 108, 255, 0.25);
  padding: 22px 28px 16px;
  clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px);
}

.sb-title {
  font-family: var(--display); font-size: 15px; letter-spacing: 0.14em;
  color: var(--indigo); margin-bottom: 14px; text-align: center;
}

.scoreboard table { width: 100%; border-collapse: collapse; }

.scoreboard th {
  text-align: left; font-size: 10px; letter-spacing: 0.24em; color: var(--dim);
  padding: 4px 10px; border-bottom: 1px solid rgba(91, 108, 255, 0.25);
}

.scoreboard td { padding: 8px 10px; font-size: 15px; font-weight: 600; }
.scoreboard td.num { font-family: var(--display); text-align: left; }
.scoreboard tr.me td { background: rgba(91, 108, 255, 0.13); }
.scoreboard .dot { width: 10px; height: 10px; display: inline-block; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.scoreboard .bot-tag { color: var(--dim); font-size: 10px; letter-spacing: 0.14em; margin-left: 7px; }

/* ------------------------------------------------ death + win overlays */

.death-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(ellipse at center, transparent 36%, rgba(6, 7, 15, 0.82)); /* clear middle — watch the death cam */
}

.death-msg {
  font-family: var(--display); font-size: 30px; letter-spacing: 0.08em;
  color: var(--hot); text-shadow: 0 0 30px rgba(255, 75, 46, 0.8);
}

.death-count { font-family: var(--display); font-size: 90px; color: var(--ink); opacity: 0.9; }

.win-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px;
  padding-top: 13vh; /* leaves the center free for the end-of-round scoreboard */
  background: rgba(6, 7, 15, 0.82);
}

.win-msg {
  font-family: var(--display); font-size: 54px; letter-spacing: 0.06em;
  color: var(--cyan); text-shadow: 0 0 40px rgba(39, 224, 255, 0.8);
  animation: winPulse 1.2s ease-in-out infinite alternate;
}

@keyframes winPulse { to { text-shadow: 0 0 80px rgba(39, 224, 255, 1); } }

.win-sub { color: var(--dim); letter-spacing: 0.3em; font-size: 12px; }

/* fullscreen frag flash */
.frag-flash { animation: fragFlash 0.35s ease-out; }
@keyframes fragFlash { 0% { filter: brightness(1.7) saturate(1.5); } 100% { filter: none; } }

/* ------------------------------------------------ streak announcer */

.streak-banner {
  position: absolute; left: 50%; top: 38%; transform: translateX(-50%);
  font-family: var(--display); font-size: 58px; letter-spacing: 0.1em;
  white-space: nowrap; opacity: 0; pointer-events: none;
  color: var(--cyan);
  text-shadow: 0 0 18px currentColor, 0 0 70px currentColor;
}

.streak-banner[data-tier="3"] { color: var(--amber); }
.streak-banner[data-tier="4"] { color: var(--hot); }
.streak-banner[data-tier="5"] { color: var(--magenta); }

.streak-banner.show { animation: streakIn 1.7s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes streakIn {
  0% { opacity: 0; transform: translateX(-50%) scale(2.4); letter-spacing: 0.45em; filter: blur(6px); }
  14% { opacity: 1; transform: translateX(-50%) scale(1); letter-spacing: 0.1em; filter: blur(0); }
  78% { opacity: 1; }
  100% { opacity: 0; transform: translateX(-50%) scale(0.94); }
}

/* ------------------------------------------------ quad damage */

.quad-hud {
  position: absolute; left: 50%; bottom: 21%; transform: translateX(-50%);
  padding: 9px 22px;
  font-family: var(--display); font-size: 17px; letter-spacing: 0.18em;
  color: #bfe0ff;
  background: rgba(20, 34, 70, 0.75);
  border: 1px solid rgba(107, 168, 255, 0.7);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  text-shadow: 0 0 16px rgba(107, 168, 255, 0.9);
  animation: quadPulse 0.9s ease-in-out infinite alternate;
}

@keyframes quadPulse {
  from { box-shadow: 0 0 18px rgba(107, 168, 255, 0.35); }
  to { box-shadow: 0 0 44px rgba(107, 168, 255, 0.8); }
}

.quad-vignette {
  position: absolute; inset: 0; pointer-events: none;
  box-shadow: inset 0 0 140px rgba(91, 155, 255, 0.55);
  opacity: 0; transition: opacity 0.4s;
}

body.quad-active .quad-vignette { opacity: 1; }

/* ------------------------------------------------ model picker + hud name */

.model-pick {
  margin-top: 24px;
  display: flex; align-items: center; justify-content: center; gap: 20px;
}

.mp-btn {
  width: 46px; height: 46px; cursor: pointer;
  background: rgba(12, 14, 30, 0.9);
  border: 1px solid rgba(91, 108, 255, 0.45);
  color: var(--cyan); font-size: 15px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.mp-btn:hover { border-color: var(--cyan); box-shadow: 0 0 18px rgba(39, 224, 255, 0.25); }

.mp-stage { text-align: center; }

#model-preview {
  width: 150px; height: 150px; display: block; margin: 0 auto;
  filter: drop-shadow(0 0 22px rgba(39, 224, 255, 0.18));
}

.model-name {
  margin-top: 2px;
  font-family: var(--display); font-size: 13px; letter-spacing: 0.2em;
  color: var(--cyan); text-shadow: 0 0 14px rgba(39, 224, 255, 0.5);
}

.hud-name {
  position: absolute; left: 26px; bottom: 44px;
  font-family: var(--display); font-size: 15px; letter-spacing: 0.12em;
  text-shadow: 0 0 14px currentColor;
}

/* ------------------------------------------------ match clock */

.match-clock {
  position: absolute; left: 50%; top: 20px; transform: translateX(-50%);
  padding: 6px 18px;
  font-family: var(--display); font-size: 20px; letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid rgba(91, 108, 255, 0.28);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  font-variant-numeric: tabular-nums;
}

.match-clock.low {
  color: var(--hot); border-color: rgba(255, 75, 46, 0.6);
  animation: blink 1s steps(2) infinite;
}
