/* ---- Neon Arena — global styles ---- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0a0e17;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: #e8f4ff;
  /* Block browser gestures (scroll / pinch) so touches reach the game */
  touch-action: none;
  overscroll-behavior: none;
  position: fixed;
}

.hidden { display: none !important; }

#game {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none;
}

/* ---------------- Join screen ---------------- */

#join-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #070b14;
  z-index: 100;
  overflow: hidden;
}

/* Animated backdrop: drifting neon grid + slow breathing glows */
#join-bg {
  position: absolute;
  inset: -60px;
  background:
    radial-gradient(ellipse at 22% 18%, rgba(0, 245, 255, 0.13), transparent 50%),
    radial-gradient(ellipse at 78% 82%, rgba(255, 92, 225, 0.11), transparent 50%),
    radial-gradient(ellipse at 60% 30%, rgba(139, 47, 255, 0.08), transparent 55%),
    repeating-linear-gradient(0deg, rgba(0, 245, 255, 0.045) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(0, 245, 255, 0.045) 0 1px, transparent 1px 64px);
  animation: bgDrift 24s linear infinite;
  pointer-events: none;
}

@keyframes bgDrift {
  from { transform: translate(0, 0); }
  to   { transform: translate(64px, 64px); }
}

#join-card {
  position: relative;
  text-align: center;
  padding: 16px 24px 14px;
  border: 1px solid rgba(0, 245, 255, 0.28);
  border-radius: 18px;
  background: linear-gradient(160deg, rgba(14, 21, 38, 0.92), rgba(9, 13, 26, 0.94));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 24px 60px rgba(0, 0, 0, 0.6),
    0 0 46px rgba(0, 245, 255, 0.10);
  max-width: 350px;
  width: 92%;
  max-height: 96vh;
  overflow-y: auto;
  animation: cardIn 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.2) backwards;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.over-title {
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.42em;
  color: #5d6a85;
  margin-bottom: 2px;
}

#join-card h1 {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #eafcff;
  line-height: 1.05;
  text-shadow:
    0 0 8px rgba(0, 245, 255, 0.9),
    0 0 26px rgba(0, 245, 255, 0.55),
    0 0 60px rgba(0, 245, 255, 0.25);
  animation: logoPulse 3.2s ease-in-out infinite;
}

#join-card h1 span {
  color: #ffe9fb;
  text-shadow:
    0 0 8px rgba(255, 92, 225, 0.9),
    0 0 26px rgba(255, 92, 225, 0.55),
    0 0 60px rgba(255, 92, 225, 0.25);
}

@keyframes logoPulse {
  0%, 100% { filter: brightness(1); }
  50%      { filter: brightness(1.18); }
}

.tagline {
  margin: 5px 0 12px;
  color: #7d8aa5;
  letter-spacing: 0.14em;
  font-size: 0.64rem;
  text-transform: uppercase;
}

/* Avatar capture on the join screen */
#avatar-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  text-align: left;
}

#avatar-frame {
  width: 50px;
  height: 50px;
  flex: none;
  border-radius: 50%;
  border: 2px solid rgba(0, 245, 255, 0.5);
  box-shadow: 0 0 14px rgba(0, 245, 255, 0.25);
  background: #0d1424;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#avatar-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#avatar-placeholder {
  font-size: 1.5rem;
  color: #2a3a52;
  font-weight: 800;
}

#avatar-btns { flex: 1; }
#avatar-btns .hint { margin-top: 4px; }

#avatar-btn {
  width: 100%;
  padding: 8px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #9feaff;
  background: rgba(0, 245, 255, 0.07);
  border: 1px solid rgba(0, 245, 255, 0.35);
  border-radius: 8px;
  cursor: pointer;
}

#avatar-btn:active { background: rgba(0, 245, 255, 0.2); }

#nickname {
  width: 100%;
  padding: 11px 14px;
  font-size: 1.05rem;
  text-align: center;
  color: #e8f4ff;
  background: rgba(8, 13, 25, 0.9);
  border: 1px solid #24344e;
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

#nickname:focus {
  border-color: #00f5ff;
  box-shadow: 0 0 14px rgba(0, 245, 255, 0.25);
}

/* Game mode cards */
#mode-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 11px;
}

.mode {
  --accent: #00f5ff;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  color: #e8f4ff;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.15s, background 0.15s;
}

.mode:hover { background: rgba(255, 255, 255, 0.06); }

.mode:active {
  transform: scale(0.975);
  box-shadow: 0 0 18px color-mix(in srgb, var(--accent) 45%, transparent);
}

.mode .mode-icon {
  flex: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 25%, transparent);
}

.mode .mode-copy { flex: 1; min-width: 0; }

.mode .mode-copy b {
  display: block;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
}

.mode .mode-copy small {
  display: block;
  margin-top: 1px;
  font-size: 0.64rem;
  color: #7d8aa5;
  letter-spacing: 0.04em;
}

.mode .mode-go {
  flex: none;
  color: var(--accent);
  font-size: 0.8rem;
  text-shadow: 0 0 8px var(--accent);
}

#join-btn { --accent: #00f5ff; }
#bots-btn { --accent: #c86bff; }
#survival-btn { --accent: #ff4a3c; }
#blind-btn { --accent: #8f9dff; }

/* Bot difficulty segmented control */
#diff-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}

.diff-label {
  font-size: 0.55rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #5d6a85;
  margin-right: 2px;
}

.diff {
  flex: 1;
  padding: 6px 0;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #7d8aa5;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  cursor: pointer;
}

.diff.sel {
  color: #051018;
  background: linear-gradient(135deg, #00f5ff, #22a7ff);
  border-color: transparent;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.4);
}

#join-footer {
  position: relative;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.28em;
  color: #46536e;
  text-align: center;
  padding: 0 14px;
}

/* The card scrolls if it must (body blocks gestures, the card allows them) */
#join-card { touch-action: pan-y; }

/* Build stamp: if the phone doesn't show the current build, restart the server */
#build-tag {
  margin-top: 8px;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #33415c;
}

/* Short landscape phones: trim the chrome so all three modes fit */
@media (max-height: 430px) {
  #join-card { padding: 10px 18px 8px; }
  #join-card h1 { font-size: 1.55rem; }
  .over-title, #avatar-btns .hint, #join-footer { display: none; }
  .tagline { margin: 3px 0 8px; }
  #avatar-row { margin-bottom: 8px; }
  #avatar-frame { width: 40px; height: 40px; }
  #nickname { padding: 8px 12px; font-size: 0.95rem; }
  #mode-list { margin-top: 8px; gap: 6px; }
  .mode { padding: 6px 10px; }
  .mode .mode-icon { width: 30px; height: 30px; font-size: 1rem; }
}

/* Win-screen subtitle (survival: waves survived / new record) */
#win-sub {
  margin: 4px 0 6px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffd23f;
  text-shadow: 0 0 12px rgba(255, 210, 63, 0.7);
}

.hint {
  margin-top: 16px;
  font-size: 0.72rem;
  color: #5d6a85;
  line-height: 1.5;
}

.error { margin-top: 12px; color: #ff3860; font-size: 0.8rem; }

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

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none; /* touches fall through to the canvas… */
  z-index: 50;
}

#hud button { pointer-events: auto; } /* …except the buttons */

#hp-wrap {
  position: absolute;
  top: calc(10px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 8px;
}

#hp-bar {
  width: 150px;
  height: 14px;
  border: 1px solid rgba(0, 245, 255, 0.5);
  border-radius: 7px;
  background: rgba(5, 10, 20, 0.7);
  overflow: hidden;
}

#hp-fill {
  height: 100%;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, #39ff6a, #00f5ff);
  transition: width 0.15s ease-out;
}

#hp-fill.low { background: linear-gradient(90deg, #ff3860, #ff8c1a); }

#hp-text {
  font-size: 0.85rem;
  font-weight: 700;
  text-shadow: 0 0 6px rgba(0, 245, 255, 0.8);
}

.badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ffd23f;
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.9);
  animation: pulse 0.5s infinite alternate;
}

.badge.speed { color: #22a7ff; text-shadow: 0 0 8px rgba(34, 167, 255, 0.9); }
.badge.weapon { color: #ff8c1a; text-shadow: 0 0 8px rgba(255, 140, 26, 0.9); animation: none; }

@keyframes pulse { from { opacity: 1; } to { opacity: 0.4; } }

/* ---------------- Turbo button (hold to sprint) ---------------- */

#turbo-btn {
  --p: 100; /* energy 0-100, drives the ring via conic-gradient */
  position: absolute;
  bottom: calc(22px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 86px;
  height: 86px;
  padding: 5px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: conic-gradient(
    #00f5ff calc(var(--p) * 1%),
    rgba(255, 255, 255, 0.12) 0
  );
  box-shadow: 0 0 22px rgba(0, 245, 255, 0.45), inset 0 0 8px rgba(0, 0, 0, 0.6);
  transition: box-shadow 0.15s;
  touch-action: none;
}

#turbo-btn .turbo-core {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #1b2b45, #0b1322 70%);
  color: #9feaff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-shadow: 0 0 8px rgba(0, 245, 255, 0.8);
}

#turbo-btn .turbo-icon {
  font-size: 1.25rem;
  line-height: 1;
  filter: drop-shadow(0 0 6px rgba(0, 245, 255, 0.9));
}

#turbo-btn:active .turbo-core { transform: scale(0.94); }

/* While sprinting: hot yellow ring */
#turbo-btn.active {
  background: conic-gradient(#ffd23f calc(var(--p) * 1%), rgba(255, 255, 255, 0.12) 0);
  box-shadow: 0 0 30px rgba(255, 210, 63, 0.65), inset 0 0 8px rgba(0, 0, 0, 0.6);
}
#turbo-btn.active .turbo-core { color: #ffe9a0; text-shadow: 0 0 8px rgba(255, 210, 63, 0.9); }

/* Empty tank: greyed out while it refills */
#turbo-btn.locked {
  background: conic-gradient(#5d6a85 calc(var(--p) * 1%), rgba(255, 255, 255, 0.08) 0);
  box-shadow: none;
}
#turbo-btn.locked .turbo-core { color: #5d6a85; text-shadow: none; }
#turbo-btn.locked .turbo-icon { filter: none; opacity: 0.5; }

/* Toggled on (even before you start moving): white halo */
#turbo-btn.on { outline: 3px solid rgba(255, 255, 255, 0.55); outline-offset: 2px; }

/* ---------------- Bomb button ---------------- */

#bomb-btn {
  position: absolute;
  bottom: calc(120px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid #ff5ce1;
  background: radial-gradient(circle at 35% 28%, #2a1b35, #140a1c 70%);
  box-shadow: 0 0 20px rgba(255, 92, 225, 0.55);
  font-size: 1.6rem;
  cursor: pointer;
  touch-action: none;
  animation: bombPulse 0.9s infinite alternate;
}

#bomb-btn:active { transform: translateX(-50%) scale(0.9); }

@keyframes bombPulse {
  from { box-shadow: 0 0 14px rgba(255, 92, 225, 0.4); }
  to   { box-shadow: 0 0 28px rgba(255, 92, 225, 0.8); }
}

/* How many bombs you're carrying, pinned to the bomb button's corner */
#bomb-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  background: #ff5ce1;
  color: #140a1c;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
}

/* Red remote-detonators on the right edge while bombs/mines are armed */
#mine-det-btn {
  position: absolute;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(45% + 84px + env(safe-area-inset-bottom));
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid #ff3020;
  background: radial-gradient(circle at 35% 28%, #3a1010, #1c0606 70%);
  color: #ff5a4a;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.1;
  cursor: pointer;
  touch-action: none;
  animation: detPulse 0.5s infinite alternate;
}

#mine-det-btn:active { transform: scale(0.92); }
#mine-det-btn .det-boom { display: block; font-size: 1.5rem; }
#mine-det-btn .det-label { display: block; font-size: 0.5rem; margin-top: 1px; }

#det-btn {
  position: absolute;
  right: calc(14px + env(safe-area-inset-right));
  bottom: calc(45% + env(safe-area-inset-bottom));
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid #ff3020;
  background: radial-gradient(circle at 35% 28%, #3a1010, #1c0606 70%);
  color: #ff5a4a;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.1;
  cursor: pointer;
  touch-action: none;
  animation: detPulse 0.5s infinite alternate;
}

#det-btn:active { transform: scale(0.92); }

#det-btn .det-boom { display: block; font-size: 1.5rem; }
#det-btn .det-label { display: block; font-size: 0.5rem; margin-top: 1px; }

@keyframes detPulse {
  from { box-shadow: 0 0 12px rgba(255, 48, 32, 0.5); }
  to   { box-shadow: 0 0 30px rgba(255, 48, 32, 0.95); border-color: #ff6a50; }
}

/* Enemy in the blast zone: hammer the button! */
#det-btn.alert,
#mine-det-btn.alert {
  animation: detAlert 0.16s infinite alternate;
}

@keyframes detAlert {
  from {
    transform: scale(1);
    border-color: #ff3020;
    box-shadow: 0 0 16px rgba(255, 48, 32, 0.8);
  }
  to {
    transform: scale(1.14);
    border-color: #ffe650;
    color: #fff3b0;
    box-shadow: 0 0 44px rgba(255, 230, 80, 1);
  }
}

/* ---------------- Round timer ---------------- */

#round-timer {
  position: absolute;
  top: calc(104px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #9feaff;
  text-shadow: 0 0 10px rgba(0, 245, 255, 0.7), 0 1px 3px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

#round-timer.urgent {
  color: #ff3860;
  text-shadow: 0 0 12px rgba(255, 56, 96, 0.9);
  animation: pulse 0.5s infinite alternate;
}

/* ---------------- Win screen / podium ---------------- */

#win-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background: rgba(6, 9, 16, 0.82);
  text-align: center;
  z-index: 10;
}

#win-screen h2 {
  font-size: 1.9rem;
  letter-spacing: 0.35em;
  color: #ffd23f;
  text-shadow: 0 0 24px rgba(255, 210, 63, 0.8);
}

#podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 22px;
}

.pod {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  animation: podIn 0.5s ease-out backwards;
}

.pod.rank1 { animation-delay: 0.15s; }
.pod.rank2 { animation-delay: 0.3s; }
.pod.rank3 { animation-delay: 0.45s; }

@keyframes podIn {
  from { transform: translateY(30px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.pod-medal { font-size: 1.5rem; }
.pod.rank1 .pod-medal { font-size: 2rem; }

.pod-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #0d1424;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(0, 245, 255, 0.25);
}

.pod.rank1 .pod-avatar {
  width: 88px;
  height: 88px;
  box-shadow: 0 0 28px rgba(255, 210, 63, 0.5);
}

.pod-avatar img { width: 100%; height: 100%; object-fit: cover; }

.pod-letter { font-size: 1.7rem; font-weight: 800; color: #7d8aa5; }

.pod-name { font-weight: 800; font-size: 0.95rem; max-width: 110px;
            overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pod-score { font-size: 0.72rem; color: #aab6cc; }

.next-round { color: #7d8aa5; letter-spacing: 0.1em; font-size: 0.85rem; }
#next-round { color: #00f5ff; font-weight: 800; font-size: 1rem; }

/* ---------------- Player roster (always visible, transparent) ---------- */

#roster {
  position: absolute;
  top: 50%;
  right: calc(8px + env(safe-area-inset-right));
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 6px 8px;
  background: rgba(10, 14, 24, 0.30);
  border: 1px solid rgba(0, 245, 255, 0.15);
  border-radius: 8px;
  backdrop-filter: none;         /* keep the map fully visible behind it */
  pointer-events: none;
  max-height: 60vh;
  overflow: hidden;
}

.r-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.66rem;
  line-height: 1.25;
}

.r-row.me { text-shadow: 0 0 6px rgba(255, 255, 255, 0.5); }

.r-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
  box-shadow: 0 0 5px currentColor;
}

.r-face {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
}

.r-name {
  width: 74px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.r-hp {
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.55);
  overflow: hidden;
  flex: none;
}

.r-hp i {
  display: block;
  height: 100%;
  background: #39ff6a;
  border-radius: 3px;
}

.r-hp.low i { background: #ff3860; }
.r-hp.dead i { background: transparent; }

.r-k {
  color: #aab6cc;
  font-weight: 700;
  min-width: 24px;
  text-align: right;
}

/* Queued spectators shown dimmed at the bottom of the roster */
.r-row.queued { opacity: 0.5; }

.r-queue-head {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  color: #7d8aa5;
  text-align: right;
  margin-top: 6px;
}

/* ---------------- Kill banner ---------------- */

#kill-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  color: #ffd23f;
  text-shadow: 0 0 20px rgba(255, 210, 63, 0.9), 0 2px 4px rgba(0, 0, 0, 0.8);
  white-space: nowrap;
  pointer-events: none;
}

#kill-banner.pop { animation: bannerPop 1.6s ease-out; }

@keyframes bannerPop {
  0%   { transform: translateX(-50%) scale(0.4); opacity: 0; }
  12%  { transform: translateX(-50%) scale(1.15); opacity: 1; }
  20%  { transform: translateX(-50%) scale(1); }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

/* ---------------- Music volume panel ---------------- */

#vol-panel {
  position: absolute;
  top: calc(58px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(10, 16, 28, 0.92);
  border: 1px solid rgba(0, 245, 255, 0.35);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  touch-action: none;
}

#vol-panel .vol-icon { font-size: 1rem; }

#vol-value {
  min-width: 26px;
  text-align: right;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9feaff;
}

#vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 150px;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, #00f5ff var(--fill, 30%), rgba(255, 255, 255, 0.15) 0);
  outline: none;
  cursor: pointer;
}

#vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #bffaff, #00d5e8 65%);
  border: 2px solid #063a44;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.8);
}

#vol-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #bffaff, #00d5e8 65%);
  border: 2px solid #063a44;
  box-shadow: 0 0 12px rgba(0, 245, 255, 0.8);
}

/* ---------------- Warm-up countdown ---------------- */

#warmup-banner {
  position: absolute;
  top: 26%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

#warmup-banner .warmup-label {
  font-size: 0.9rem;
  font-weight: 800;
  letter-spacing: 0.4em;
  color: #7df2ff;
  text-shadow: 0 0 16px rgba(0, 245, 255, 0.8);
}

#warmup-count {
  font-size: 4rem;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 0 30px rgba(0, 245, 255, 0.9), 0 2px 6px rgba(0, 0, 0, 0.8);
  animation: pulse 0.5s ease-in-out infinite alternate;
}

/* ---------------- Spectator queue banner ---------------- */

#queue-banner {
  position: absolute;
  top: calc(56px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(10, 16, 28, 0.85);
  border: 1px solid rgba(0, 245, 255, 0.4);
  color: #7df2ff;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  white-space: nowrap;
  pointer-events: none;
  animation: pulse 1.2s ease-in-out infinite alternate;
}

/* ---------------- End-of-round awards ---------------- */

#awards {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 14px;
  max-width: 90vw;
}

.award {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 10px;
  background: rgba(10, 16, 28, 0.8);
  border: 1px solid rgba(255, 210, 63, 0.35);
  animation: podIn 0.4s ease-out backwards;
}

.award .a-emoji { font-size: 1.3rem; }
.award .a-title { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; color: #ffd23f; }
.award .a-who { font-size: 0.8rem; font-weight: 700; }
.award .a-stat { font-size: 0.68rem; color: #aab6cc; }

#top-buttons {
  position: absolute;
  top: calc(8px + env(safe-area-inset-top));
  right: calc(10px + env(safe-area-inset-right));
  display: flex;
  gap: 8px;
}

.hud-btn {
  width: 42px;
  height: 42px;
  font-size: 1.15rem;
  color: #e8f4ff;
  background: rgba(12, 18, 32, 0.75);
  border: 1px solid rgba(0, 245, 255, 0.4);
  border-radius: 10px;
  cursor: pointer;
}

.hud-btn:active { background: rgba(0, 245, 255, 0.25); }

/* ---------------- Kill feed ---------------- */

#killfeed {
  position: absolute;
  top: calc(44px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  max-width: 60vw;
}

.feed-msg {
  padding: 4px 10px;
  font-size: 0.72rem;
  background: rgba(12, 18, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  white-space: nowrap;
  animation: feedIn 0.2s ease-out;
}

.feed-msg .k { color: #39ff6a; font-weight: 700; }
.feed-msg .v { color: #ff3860; font-weight: 700; }

.feed-msg.streak {
  color: #ffd23f;
  border-color: rgba(255, 210, 63, 0.5);
  text-shadow: 0 0 8px rgba(255, 210, 63, 0.6);
}

@keyframes feedIn {
  from { transform: translateX(-20px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

/* ---------------- Death overlay ---------------- */

#death-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(10, 5, 10, 0.55);
  text-align: center;
}

#death-overlay h2 {
  font-size: 2.2rem;
  letter-spacing: 0.3em;
  color: #ff3860;
  text-shadow: 0 0 24px rgba(255, 56, 96, 0.8);
}

#death-overlay p { margin-top: 10px; color: #aab6cc; }

#killer-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

#killer-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 3px solid #ff8c1a;
  background: #0d1424;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(255, 56, 96, 0.4);
}

#killer-avatar img { width: 100%; height: 100%; object-fit: cover; }

.killer-letter { font-size: 1.5rem; font-weight: 800; color: #aab6cc; }

#killer-label { font-size: 1rem; color: #e8f4ff; }
#killer-label b { font-size: 1.15rem; }

#respawn-timer {
  color: #00f5ff;
  font-weight: 700;
  font-size: 1.2rem;
}

/* ---------------- Scoreboard ---------------- */

#scoreboard {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 260px;
  max-width: 86vw;
  padding: 18px 22px;
  background: rgba(10, 14, 24, 0.92);
  border: 1px solid rgba(0, 245, 255, 0.4);
  border-radius: 14px;
  box-shadow: 0 0 40px rgba(0, 245, 255, 0.15);
  text-align: center;
}

#scoreboard h3 {
  letter-spacing: 0.25em;
  color: #00f5ff;
  margin-bottom: 12px;
}

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

#scoreboard th {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #5d6a85;
  padding: 4px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#scoreboard td {
  padding: 6px 10px;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

#scoreboard td:first-child { text-align: left; font-weight: 600; }
#scoreboard tr.me td { background: rgba(0, 245, 255, 0.08); }
