/* Duck Hunt: Paintball Assault — Global Stylesheet */

:root {
  --bg-dark: #080c14;
  --bg-card: #101520;
  --accent: #22ff66;
  --accent-cyan: #00e5ff;
  --accent-pink: #ff1493;
  --accent-orange: #ff6600;
  --text-main: #f0f4fc;
  --text-dim: #7e8b9b;
  --line: rgba(255, 255, 255, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(8, 12, 20, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}

.brand {
  font-size: 1.05rem;
  font-weight: 900;
  letter-spacing: 1.5px;
  color: #fff;
}

.brand-sub {
  color: var(--accent);
  font-size: 0.8rem;
  margin-left: 6px;
}

/* Top Distance Progress Tracker */
.top-progress-container {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tp-label {
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.top-progress-track {
  width: 220px;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.top-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent));
  border-radius: 5px;
  transition: width 0.15s;
  box-shadow: 0 0 10px rgba(34, 255, 102, 0.5);
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 1.1rem;
  cursor: pointer;
  color: #fff;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Screen Switcher */
.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.show {
  display: flex;
}

/* Menu Screen */
#screen-menu {
  align-items: center;
  justify-content: center;
  padding: 74px 20px 48px;
  background: radial-gradient(circle at 50% 40%, #152030, #060910 80%);
  overflow-y: auto;
}

#screen-lobby {
  align-items: center;
  justify-content: center;
  padding: 74px 20px 48px;
  overflow-y: auto;
}

#screen-game {
  overflow: hidden;
}

.menu-card {
  max-width: 860px;
  width: 100%;
  background: rgba(16, 21, 32, 0.92);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 36px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  margin: auto;
  animation: welcomePop 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes welcomePop {
  0% { transform: scale(0.93) translateY(24px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

.topbar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  background-size: cover;
  background-position: center;
  background-color: rgba(255, 255, 255, 0.08);
  display: inline-block;
  image-rendering: pixelated;
  box-shadow: 0 0 10px rgba(34, 255, 102, 0.35);
  transition: transform 0.2s, box-shadow 0.2s;
}
.topbar-avatar:hover {
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(34, 255, 102, 0.6);
}

.menu-badge {
  display: inline-block;
  padding: 4px 14px;
  background: rgba(34, 255, 102, 0.15);
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 0.75rem;
  font-weight: 900;
  border-radius: 20px;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}

.menu-title {
  font-size: 2.4rem;
  font-weight: 900;
  letter-spacing: 2px;
}

.accent {
  color: var(--accent);
}

.menu-sub {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 4px 0 14px;
  line-height: 1.4;
}

/* Map & Gear Selection Boxes */
.map-selection-box, .gear-selection-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.map-sel-label {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.map-chips, .gear-chips {
  display: flex;
  gap: 8px;
}

.map-chip, .gear-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.15s;
}

.map-chip:hover, .gear-chip:hover {
  background: rgba(255, 255, 255, 0.12);
}

.map-chip.selected {
  background: rgba(34, 255, 102, 0.18);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(34, 255, 102, 0.3);
}

.gear-chip.selected {
  border-color: var(--c);
  color: var(--c);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 12px var(--c);
}

/* Multiplayer Matchmaking Box */
.multiplayer-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
}

.mp-col {
  flex: 1;
}

.mp-divider {
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.join-row {
  display: flex;
  gap: 10px;
}

.join-row input {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 900;
  text-align: center;
  letter-spacing: 3px;
  text-transform: uppercase;
  outline: none;
}

.join-row input:focus {
  border-color: var(--accent-cyan);
}

.solo-divider {
  position: relative;
  text-align: center;
  margin: 12px 0 14px;
}

.solo-divider::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--line);
  z-index: 1;
}

.solo-divider span {
  position: relative;
  background: #101520;
  padding: 0 16px;
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  z-index: 2;
}

/* Role Grid */
.role-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}

.role-card {
  background: var(--bg-dark);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.role-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px rgba(34, 255, 102, 0.2);
}

.rc-icon {
  font-size: 2.2rem;
  margin-bottom: 4px;
}

.rc-title {
  font-size: 1.0rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 4px;
}

.rc-desc {
  font-size: 0.76rem;
  color: var(--text-dim);
  line-height: 1.35;
  margin-bottom: 12px;
  flex: 1;
}

/* Controls Guide */
.controls-guide {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: rgba(0, 0, 0, 0.35);
  padding: 12px 16px;
  border-radius: 12px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.cg-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.73rem;
  color: var(--text-dim);
}

.cg-col strong {
  color: #fff;
  margin-bottom: 2px;
  font-size: 0.76rem;
}

/* Buttons */
.btn {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 900;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: var(--accent);
  color: #041407;
  box-shadow: 0 4px 16px rgba(34, 255, 102, 0.4);
}

.btn-primary:hover {
  background: #39ff77;
  box-shadow: 0 6px 24px rgba(34, 255, 102, 0.6);
}

.btn-secondary {
  background: var(--accent-cyan);
  color: #021a22;
  box-shadow: 0 4px 16px rgba(0, 229, 255, 0.4);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  color: #fff;
  border-color: #fff;
}

.btn-large {
  width: 100%;
  padding: 12px 20px;
  font-size: 0.95rem;
}

.btn-full {
  width: 100%;
}

/* Multiplayer Lobby Screen */
/* Fortnite / Zombies-style menu: the diorama is the screen, and the UI is a
   panel docked to one side of it. Previously the card sat dead-centre on top
   of the 3D scene, so the scene was technically running and effectively
   invisible. */
#screen-lobby {
  align-items: center;
  justify-content: flex-start;
  padding: 24px clamp(16px, 3vw, 48px);
  background: #05070a;
  position: relative;
  overflow: hidden;
}

/* The live diorama sits behind everything; the card floats over it. */
.lobby-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}
/* Shade only where the panel sits, plus a light top/bottom falloff. The old
   full radial darkened the very middle of the frame — exactly where the
   face-off is — which is most of why you could not see it. */
.lobby-vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(3, 6, 10, 0.94) 0%, rgba(3, 6, 10, 0.7) 26%, rgba(3, 6, 10, 0) 46%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0) 22%, rgba(0, 0, 0, 0) 74%, rgba(0, 0, 0, 0.55));
}

.lobby-card {
  position: relative;
  z-index: 2;
  width: min(520px, 44vw);
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  /* Docked left over the shaded band, so the lane stays on show. */
  background: linear-gradient(180deg, rgba(10, 15, 23, 0.9), rgba(8, 12, 19, 0.82));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
}

.lobby-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
}

.lobby-title {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 1.5px;
}

.lobby-code-box {
  background: rgba(0, 0, 0, 0.5);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.code-label {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--text-dim);
}

.code-val {
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 3px;
}

.lobby-slots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.slot-card {
  background: var(--bg-dark);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.slot-card.selected {
  border-color: var(--accent);
  background: rgba(34, 255, 102, 0.08);
  box-shadow: 0 0 30px rgba(34, 255, 102, 0.25);
}

.slot-header {
  font-size: 1.15rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.slot-desc {
  font-size: 0.82rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 16px;
}

.slot-status {
  font-size: 0.75rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 1px;
}

.lobby-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-count {
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--text-dim);
}

/* 3D Game Canvas */
#screen-game {
  width: 100%;
  height: 100%;
  position: relative;
}

#gameCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* Runner HUD */
.runner-hud {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  padding: 16px 28px;
  border-radius: 20px;
  border: 1px solid var(--line);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
  align-items: center;
  z-index: 20;
}

.hud-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-label {
  font-size: 0.7rem;
  font-weight: 900;
  color: var(--text-dim);
  letter-spacing: 1px;
}

.bar-track {
  width: 140px;
  height: 12px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 6px;
  transition: width 0.15s;
}

.bar-fill.health {
  background: linear-gradient(90deg, #ff3344, var(--accent-pink));
}

.hud-val {
  font-size: 1.1rem;
  font-weight: 900;
  color: #fff;
  font-family: monospace;
}

.slow-badge {
  background: #ff3344;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 900;
  padding: 6px 12px;
  border-radius: 8px;
  letter-spacing: 1px;
  animation: pulse-badge 0.6s infinite alternate;
}

@keyframes pulse-badge {
  0% { transform: scale(1); }
  100% { transform: scale(1.08); }
}

/* Sniper HUD */
.sniper-hud {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: flex;
  gap: 16px;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(12px);
  padding: 16px 24px;
  border-radius: 16px;
  border: 1px solid var(--line);
  z-index: 20;
}

/* Sniper ADS Scope Overlay */
.scope-overlay {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

.scope-overlay.active {
  display: block;
}

.scope-vignette {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80vh;
  height: 80vh;
  border-radius: 50%;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.96);
  border: 4px solid #1a2230;
}

.reticle-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff0044;
  box-shadow: 0 0 8px #ff0044;
}

.reticle-line-h {
  position: absolute;
  top: 50%;
  left: calc(50% - 40vh);
  width: 80vh;
  height: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.reticle-line-v {
  position: absolute;
  left: 50%;
  top: calc(50% - 40vh);
  height: 80vh;
  width: 1px;
  background: rgba(255, 255, 255, 0.4);
}

.rangefinder-text {
  position: absolute;
  bottom: calc(50% - 32vh);
  left: 50%;
  transform: translateX(-50%);
  font-family: monospace;
  font-size: 0.85rem;
  font-weight: 800;
  color: #22ff66;
  letter-spacing: 2px;
}

/* Hitmarker Overlay */
.hitmarker-overlay {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  pointer-events: none;
  z-index: 60;
}

.hitmarker-overlay.active {
  display: block;
  animation: fade-hitmarker 0.22s forwards;
}

.hm-line {
  position: absolute;
  width: 10px;
  height: 2.5px;
  background: #fff;
  box-shadow: 0 0 4px #fff;
}

.hitmarker-overlay.headshot .hm-line {
  background: #ff0044;
  box-shadow: 0 0 8px #ff0044;
}

.hm-line.tl { top: 2px; left: 2px; transform: rotate(45deg); }
.hm-line.tr { top: 2px; right: 2px; transform: rotate(-45deg); }
.hm-line.bl { bottom: 2px; left: 2px; transform: rotate(-45deg); }
.hm-line.br { bottom: 2px; right: 2px; transform: rotate(45deg); }

@keyframes fade-hitmarker {
  0% { transform: translate(-50%, -50%) scale(1.3); opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(0.9); opacity: 0; }
}

/* Paint Damage Flash Overlay */
.paint-damage-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 20, 147, 0) 40%, rgba(255, 20, 147, 0.7) 100%);
  transition: opacity 0.35s;
  z-index: 30;
}

.paint-damage-overlay.active {
  opacity: 1;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal.show {
  display: flex;
}

.modal-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 36px;
  text-align: center;
  max-width: 440px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9);
}

.modal-card.win {
  border-color: var(--accent);
}

.modal-icon {
  font-size: 3.5rem;
  margin-bottom: 12px;
}

.modal-card h1 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.modal-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 24px;
  line-height: 1.4;
}

.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}


/* Stamina bar — slides cost 20 and it regenerates while running/idle. */
.bar-fill.stamina {
  background: linear-gradient(90deg, #2fd4ff, #7ce8ff);
  box-shadow: 0 0 10px rgba(47, 212, 255, 0.55);
  transition: width 0.12s linear;
}
.bar-fill.stamina.low {
  background: linear-gradient(90deg, #ff8c1a, #ffd166);
  box-shadow: 0 0 10px rgba(255, 140, 26, 0.6);
}


/* ---------- Mystery Box Power-ups ---------- */
.powerup-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 26px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(18, 22, 30, 0.96), rgba(8, 10, 14, 0.96));
  border: 2px solid var(--pb-color, #ffb300);
  box-shadow: 0 0 46px var(--pb-color, #ffb300), 0 14px 40px rgba(0, 0, 0, 0.75);
  opacity: 0;
  pointer-events: none;
  z-index: 40;
}
.powerup-banner.show { animation: pb-pop 2.2s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes pb-pop {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.6); }
  12%  { opacity: 1; transform: translate(-50%, -50%) scale(1.07); }
  24%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  76%  { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -66%) scale(0.95); }
}
.pb-icon { font-size: 2.2rem; filter: drop-shadow(0 0 12px var(--pb-color, #ffb300)); }
.pb-text { display: flex; flex-direction: column; text-align: left; }
.pb-name {
  font-weight: 900; letter-spacing: 1.5px; font-size: 1.05rem;
  color: var(--pb-color, #ffb300);
}
.pb-blurb { font-size: 0.8rem; color: #b9c0cc; margin-top: 2px; }

/* Active effect pips, bottom-left above the HUD */
.active-effects {
  position: absolute;
  left: 18px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 30;
  pointer-events: none;
}
.effect-pip {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(10, 13, 18, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 0.76rem; font-weight: 800; letter-spacing: 0.6px;
  color: #e8ecf4;
}
.effect-pip .ep-dot { width: 8px; height: 8px; border-radius: 50%; }

@media (max-width: 600px) {
  .powerup-banner { padding: 10px 16px; gap: 10px; }
  .pb-name { font-size: 0.9rem; }
  .pb-blurb { font-size: 0.7rem; }
  .active-effects { bottom: 150px; left: 10px; }
}


/* ---------- Match Start Countdown ---------- */
.countdown-overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 45;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0,0,0,0.35) 30%, rgba(0,0,0,0.72) 100%);
}
.countdown-overlay.show { display: flex; }
.cd-num {
  font-size: clamp(5rem, 18vw, 11rem);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0 40px rgba(61, 220, 132, 0.9), 0 8px 30px rgba(0,0,0,0.85);
  line-height: 1;
}
.cd-num.pop { animation: cd-pop 0.85s cubic-bezier(0.16, 1, 0.3, 1); }
@keyframes cd-pop {
  0%   { transform: scale(0.4); opacity: 0; }
  25%  { transform: scale(1.12); opacity: 1; }
  60%  { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.94); opacity: 0.25; }
}
.cd-hint {
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 4px;
  color: #9fe8bd;
}


/* ---------- Runner Gadget Bar ---------- */
.gadget-bar {
  position: absolute;
  right: 18px;
  bottom: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 30;
  pointer-events: none;
}
.gadget-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px; border-radius: 12px;
  background: rgba(10, 13, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-weight: 800; font-size: 0.78rem; letter-spacing: 0.5px;
  color: #e8ecf4; min-width: 108px;
}
.gadget-chip.ready { border-color: #3ddc84; box-shadow: 0 0 14px rgba(61, 220, 132, 0.35); }
.gadget-chip.spent { opacity: 0.45; }
.gc-key {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 6px;
  background: rgba(255, 255, 255, 0.14); font-size: 0.7rem;
}
.gc-icon { font-size: 1.05rem; }
.gc-count { margin-left: auto; color: #9fb2c6; }

@media (max-width: 600px) {
  .gadget-bar { bottom: 150px; right: 10px; }
  .gadget-chip { min-width: 92px; padding: 5px 9px; font-size: 0.7rem; }
}


/* ---------- Slow-Mo Killcam ---------- */
.killcam-banner {
  position: absolute;
  inset: 0;
  z-index: 44;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.killcam-banner.show { opacity: 1; }
/* Letterbox bars sell the "this is a replay" beat. */
.kc-bar {
  position: absolute;
  left: 0; right: 0;
  height: 11%;
  background: #000;
}
.kc-top { top: 0; }
.kc-bottom { bottom: 0; }
.kc-label {
  position: absolute;
  top: calc(11% + 16px);
  left: 24px;
  font-weight: 900;
  font-size: 0.82rem;
  letter-spacing: 3px;
  color: #ff4d5e;
  text-shadow: 0 0 14px rgba(255, 77, 94, 0.8);
  animation: kc-blink 1s steps(2, start) infinite;
}
@keyframes kc-blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }


/* ---------- Thermal Optic ---------- */
.thermal-overlay {
  position: absolute;
  inset: 0;
  z-index: 26;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(0, 30, 60, 0.25) 30%, rgba(0, 10, 30, 0.75) 100%),
    linear-gradient(0deg, rgba(0, 80, 140, 0.18), rgba(0, 80, 140, 0.18));
  mix-blend-mode: screen;
}
.thermal-overlay.show { opacity: 1; }

/* Decoy burst: orange paint over the scope glass. --blind-a is driven from
   the game loop so it thins out as the 3s clears, rather than snapping off. */
.blind-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;              /* above the scope and thermal, this is ON the lens */
  pointer-events: none;
  opacity: 0;
  --blind-a: 1;
  transition: opacity 0.12s ease;
  background:
    radial-gradient(circle at 38% 42%, rgba(255, 179, 0, calc(0.96 * var(--blind-a))) 0 16%, rgba(255, 179, 0, 0) 34%),
    radial-gradient(circle at 66% 33%, rgba(255, 150, 0, calc(0.92 * var(--blind-a))) 0 13%, rgba(255, 150, 0, 0) 30%),
    radial-gradient(circle at 54% 68%, rgba(255, 200, 40, calc(0.90 * var(--blind-a))) 0 18%, rgba(255, 200, 40, 0) 36%),
    radial-gradient(circle at 26% 74%, rgba(255, 160, 10, calc(0.85 * var(--blind-a))) 0 11%, rgba(255, 160, 10, 0) 27%),
    radial-gradient(circle at 78% 62%, rgba(255, 190, 30, calc(0.85 * var(--blind-a))) 0 10%, rgba(255, 190, 30, 0) 25%),
    linear-gradient(0deg, rgba(120, 60, 0, calc(0.55 * var(--blind-a))), rgba(120, 60, 0, calc(0.55 * var(--blind-a))));
}
.blind-overlay.show { opacity: 1; }


/* ---------- Tournament ---------- */
.tournament-row { margin: 14px 0 6px; text-align: center; }
.tournament-hint { color: #8b93a5; font-size: 0.8rem; margin-top: 8px; line-height: 1.5; }

.tr-title { font-weight: 900; font-size: 1.6rem; letter-spacing: 2px; margin-bottom: 6px; }
.tr-title.win { color: #3ddc84; text-shadow: 0 0 22px rgba(61,220,132,0.55); }
.tr-title.lose { color: #ff4d5e; text-shadow: 0 0 22px rgba(255,77,94,0.5); }
.tr-score { font-size: 2.6rem; font-weight: 900; letter-spacing: 4px; margin: 6px 0; }
.tr-round { color: #8b93a5; font-size: 0.85rem; letter-spacing: 1px; }
.tr-swap {
  margin-top: 14px; padding: 10px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.14);
  font-weight: 800; font-size: 0.9rem;
}

.tp-awards { margin: 16px 0 10px; display: flex; flex-direction: column; gap: 8px; }
.tp-award {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-radius: 12px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.12);
  font-size: 0.82rem;
}
.tpa-icon { font-size: 1.1rem; }
.tpa-name { font-weight: 800; letter-spacing: 0.6px; color: #cdd5e2; }
.tpa-val { margin-left: auto; font-weight: 900; color: #ffd166; }

.tp-rounds { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }
.tp-round {
  display: grid; grid-template-columns: 2.2rem 1.6rem 1fr auto;
  gap: 8px; align-items: center;
  padding: 5px 12px; border-radius: 9px; font-size: 0.76rem; font-weight: 700;
  background: rgba(255,255,255,0.04);
}
.tp-round.won { border-left: 3px solid #3ddc84; }
.tp-round.lost { border-left: 3px solid #ff4d5e; }


/* ---------- Lobby settings & notices ---------- */
.lobby-settings {
  margin: 14px 0 6px; padding: 14px 16px;
  border: 1px solid rgba(255,255,255,0.12); border-radius: 14px;
  background: rgba(255,255,255,0.03);
}
.ls-title { font-size: 0.72rem; font-weight: 900; letter-spacing: 1.5px; color: #9fb2c6; margin-bottom: 10px; }
.ls-hostonly { color: #6d7b8d; font-weight: 700; letter-spacing: 0.5px; }
.ls-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.ls-row + .ls-row { margin-top: 10px; }
.ls-row label { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: #c6cfdb; }
.ls-row input {
  width: 68px; padding: 5px 8px; border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.16); background: rgba(0,0,0,0.35); color: #eef3f9;
  font-size: 0.8rem;
}
.ls-row input:disabled { opacity: 0.45; cursor: not-allowed; }
.ls-seedrow { justify-content: space-between; }
.ls-seed { font-size: 0.78rem; color: #9fb2c6; }
.ls-seed strong { color: #3ddc84; font-family: monospace; }
.ls-note { margin-top: 8px; font-size: 0.72rem; color: #6d7b8d; }
.lobby-note {
  margin: 8px 0 0; font-size: 0.82rem; font-weight: 700; color: #ffd166;
  opacity: 0; transition: opacity 0.2s;
}
.lobby-note.show { opacity: 1; }

/* ===========================================================================
   ENVIRONMENTAL MODIFIERS — match condition banner
   =========================================================================== */
.env-badge {
  position: absolute;
  /* Clear of the 54px topbar. At 14px this sat UNDER it (topbar is z-index 100
     against this badge's 30), so two thirds of the conditions text — the bit
     telling you the floor is slick and you will slide through turns — was
     hidden behind the header for the whole match. */
  top: 66px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(440px, 76vw);
  padding: 9px 16px;
  border-radius: 14px;
  border: 1px solid rgba(120, 200, 255, 0.35);
  background: rgba(8, 14, 20, 0.82);
  backdrop-filter: blur(6px);
  pointer-events: none;
}
.env-badge[hidden] { display: none; }
.env-badge .env-icon { font-size: 1.5rem; line-height: 1; }
.env-badge .env-text { display: flex; flex-direction: column; line-height: 1.25; }
.env-badge .env-text strong {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #8fd8ff;
}
.env-badge .env-text em {
  font-style: normal;
  font-size: 0.72rem;
  color: rgba(226, 240, 250, 0.72);
}
.env-badge.announce { animation: envAnnounce 2.6s ease forwards; }
@keyframes envAnnounce {
  0%   { transform: translateX(-50%) scale(0.9); opacity: 0; }
  12%  { transform: translateX(-50%) scale(1.04); opacity: 1; }
  20%  { transform: translateX(-50%) scale(1); opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0.42; }
}
.lobby-settings select {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #e8f4ff;
  border-radius: 8px;
  padding: 5px 8px;
  font: inherit;
}

/* Arena picker inside the lobby settings panel. The chips only existed on the
   menu, so once you were in a lobby the host could not change the map at all. */
.ls-maps { display: flex; align-items: center; gap: 8px; }
.lobby-maps { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.lobby-maps .map-chip {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.lobby-maps .map-chip.selected {
  border-color: #3ddc84;
  background: rgba(61, 220, 132, 0.16);
  color: #a8f0c6;
}

/* Own-connection-lost curtain. Previously a dead socket produced no UI at all
   and the game simply appeared to freeze. */
.conn-lost {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(4, 8, 12, 0.86);
  backdrop-filter: blur(6px);
}
.conn-lost[hidden] { display: none; }
.conn-card {
  text-align: center;
  padding: 32px 40px;
  border-radius: 20px;
  border: 2px solid rgba(255, 90, 90, 0.5);
  background: rgba(18, 12, 16, 0.96);
  box-shadow: 0 20px 70px rgba(0, 0, 0, 0.8);
  max-width: 90vw;
}
.conn-card h2 { margin: 10px 0 6px; letter-spacing: 2px; color: #ff8f8f; }
.conn-card .conn-icon { font-size: 2.6rem; }
.conn-card .conn-reason { color: rgba(255, 255, 255, 0.7); margin-bottom: 20px; font-size: 0.9rem; }
.conn-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Below tablet width there is no room to dock beside the scene, so the panel
   returns to the centre and the diorama becomes a backdrop again. */
@media (max-width: 900px) {
  #screen-lobby { justify-content: center; }
  .lobby-card { width: 100%; max-width: 780px; }
  .lobby-vignette {
    background:
      radial-gradient(ellipse at 50% 42%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0.68) 100%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.08) 28%, rgba(0, 0, 0, 0.6));
  }
}

/* ===========================================================================
   OPTIONAL ARCADE ACCOUNT
   =========================================================================== */
.arcade-acct { margin: 10px 0 4px; text-align: center; }
.acct-signed-in { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; }
.acct-signed-in[hidden], .acct-signed-out[hidden] { display: none; }
.acct-who { font-size: 0.85rem; color: #cfe3ef; }
.acct-who strong { color: #3ddc84; }
.acct-opt { opacity: 0.6; font-size: 0.78em; }
.link-btn {
  background: none; border: none; cursor: pointer;
  color: #8fd8ff; font: inherit; font-size: 0.85rem; text-decoration: underline;
}

.acct-modal {
  position: fixed; inset: 0; z-index: 210;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 12, 0.86); backdrop-filter: blur(6px);
}
.acct-modal[hidden] { display: none; }
.acct-card {
  position: relative; width: min(440px, 92vw); text-align: left;
  padding: 28px 30px; border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(14, 20, 28, 0.98);
  box-shadow: 0 24px 70px rgba(0,0,0,0.8);
}
.acct-close {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; color: rgba(255,255,255,0.6);
  font-size: 1.1rem; cursor: pointer;
}
.acct-title { margin: 0 0 8px; letter-spacing: 1px; font-size: 1.05rem; }
.acct-blurb { font-size: 0.84rem; color: rgba(255,255,255,0.7); line-height: 1.45; margin: 0 0 10px; }
.acct-warn {
  font-size: 0.78rem; color: #ffca7a;
  background: rgba(255,190,90,0.1); border: 1px solid rgba(255,190,90,0.3);
  border-radius: 10px; padding: 8px 11px; margin: 0 0 16px; line-height: 1.4;
}
.acct-field { display: block; margin-bottom: 12px; }
.acct-field span { display: block; font-size: 0.74rem; letter-spacing: 0.6px; color: rgba(255,255,255,0.6); margin-bottom: 4px; }
.acct-field input {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05); color: #eaf4ff; font-size: 0.92rem;
}
.acct-actions { display: flex; gap: 10px; margin-top: 6px; }
.acct-actions .btn { flex: 1; }
.acct-error { color: #ff8f8f; font-size: 0.8rem; min-height: 1em; margin: 10px 0 0; }

/* --- Sniper scope readout ------------------------------------------------ */
.breath-wrap {
  position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%);
  width: 190px; height: 5px; border-radius: 3px;
  background: rgba(255, 255, 255, 0.14); overflow: hidden;
}
.breath-fill {
  height: 100%; width: 100%; border-radius: 3px;
  background: linear-gradient(90deg, #7cf6ff, #00e5ff);
}
.breath-fill.low { background: linear-gradient(90deg, #ff8a4d, #ff4d5e); }


/* ---------- Lobby handicaps ---------- */
.handicap-block {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 10px 12px 12px;
  border: 1px solid rgba(124, 246, 255, 0.18);
  border-radius: 10px;
  background: rgba(10, 18, 28, 0.5);
}
.handicap-title {
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 1px;
  color: #cfe9ff;
  margin-bottom: 8px;
}
.handicap-hint {
  font-weight: 500;
  letter-spacing: 0;
  color: #7b8798;
  margin-left: 6px;
}
.ls-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.76rem;
  color: #b9c6d6;
  margin: 6px 0;
}
.ls-slider input[type="range"] {
  flex: 1;
  min-width: 90px;
  accent-color: #3ddc84;
}
.ls-sub { color: #7b8798; font-size: 0.7rem; }
.handicap-summary {
  margin-top: 8px;
  font-size: 0.72rem;
  color: #7cf6ff;
  letter-spacing: 0.3px;
}

.ls-check {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: #cfe9ff;
  margin-top: 8px;
}
.ls-check input { accent-color: #3ddc84; }

/* Round clock. Goes amber under 30s and red under 10s, because a number you
   have to read precisely is useless to someone sprinting or holding a scope. */
.hud-clock .hud-val { font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.hud-clock.warn .hud-val { color: #ffb300; }
.hud-clock.critical .hud-val { color: #ff4d5e; animation: clockPulse 1s ease-in-out infinite; }
@keyframes clockPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }

.solo-opt{
  display:flex; align-items:center; gap:10px; justify-content:center;
  font-size:0.82rem; color:#b9c6d6; margin:8px 0;
}
.solo-opt input[type="number"]{ width:74px; }
.solo-opt input[type="range"]{ width:150px; accent-color:#3ddc84; }
.solo-opt input[type="checkbox"]{ accent-color:#3ddc84; }

.invite-btn{
  margin-left:10px; font-family:inherit; font-weight:800; font-size:0.7rem; letter-spacing:1px;
  color:#06120c; background:#3ddc84; border:0; border-radius:8px; padding:8px 12px; cursor:pointer;
}
.invite-btn:hover{ filter:brightness(1.08); }
.invite-btn.copied{ background:#7cf6ff; }

/* HUD boxes must never wrap. The row is fixed-width and adding the round clock
   squeezed the distance readout to ~100px, where its label and value both broke
   onto three lines and the whole bar grew to twice its height mid-match. */
.hud-box { flex: 0 0 auto; }
.hud-label, .hud-val { white-space: nowrap; }
/* No wrapping on desktop. These panels are absolutely positioned, so they
   shrink-to-fit, and flex-wrap made them break to a second row even with room
   to spare — the smoke counter ended up alone underneath. Wrapping is only a
   safety net for phones. */
.runner-hud, .sniper-hud { max-width: calc(100vw - 32px); flex-wrap: nowrap; }
/* Visibility via class, so layout rules (including the phone grid) still win. */
.hud-off { display: none !important; }
/* ---------- Phones ----------
   The wrap-to-one-column HUD was worse than the overflow it fixed: every box
   is its own row, so the panel grew to 257px — a third of a phone screen —
   with the gadget chips sitting on top of it. A 3-column grid keeps it to two
   compact rows, and the bars stop demanding 140px each. */
@media (max-width: 720px) {
  .runner-hud, .sniper-hud {
    display: grid;
    grid-template-columns: repeat(3, auto);
    justify-content: center;
    align-items: center;
    column-gap: 14px;
    row-gap: 6px;
    padding: 8px 12px;
    bottom: 10px;
    border-radius: 14px;
  }
  .runner-hud .bar-track, .sniper-hud .bar-track { width: 74px; }
  .hud-label { font-size: 0.58rem; letter-spacing: 0.4px; }
  .hud-val { font-size: 0.95rem; }
  .runner-hud .slow-badge { grid-column: 1 / -1; }

  /* The brand ate three lines and shoved the progress bar off screen. */
  .topbar { height: 46px; padding: 0 12px; gap: 8px; }
  .brand { font-size: 0.82rem; white-space: nowrap; }
  .brand-sub { display: none; }
  /* The progress row sat between the brand and the Hub/audio buttons with no
     shrink, so its "TOWER TUNNEL [0m]" label ran straight underneath them.
     On a phone the bar itself carries the information; the words do not. */
  .top-progress-container { min-width: 0; flex: 1 1 auto; gap: 6px; overflow: hidden; }
  /* Both labels go. "START [126m]" just repeats the HUD's TO TUNNEL readout,
     and keeping it left the bar itself only ~30px of the row. */
  .top-progress-container .tp-label,
  .top-progress-container #tpStartLabel { display: none; }
  .top-progress-track { flex: 1 1 auto; min-width: 40px; }

  .env-badge { top: 54px; max-width: min(320px, 88vw); padding: 7px 12px; }
  .env-badge .env-text em { font-size: 0.68rem; }

  /* Keep the gadget chips clear of the HUD panel. */
  #gadgetBar { bottom: 108px; }
}

/* ---------- Public-lobby pill (shared style across the arcade) ---------- */
.pub-pill{
  display:inline-flex; align-items:center; gap:10px;
  margin:0 auto 12px; padding:8px 14px;
  border:1px solid rgba(255,255,255,0.14); border-radius:999px;
  background:rgba(255,255,255,0.04); cursor:pointer; user-select:none;
  font-size:0.78rem; color:#cbd5e1; white-space:nowrap; transition:border-color .15s, background .15s;
}
.pub-pill:hover{ border-color:rgba(124,246,255,0.5); }
.pub-pill input{ position:absolute; opacity:0; pointer-events:none; }
.pub-pill-dot{
  width:34px; height:19px; border-radius:999px; background:rgba(255,255,255,0.16);
  position:relative; flex:none; transition:background .15s;
}
.pub-pill-dot::after{
  content:""; position:absolute; top:2px; left:2px; width:15px; height:15px;
  border-radius:50%; background:#fff; transition:transform .15s;
}
.pub-pill input:checked ~ .pub-pill-dot{ background:#3ddc84; }
.pub-pill input:checked ~ .pub-pill-dot::after{ transform:translateX(15px); }
.pub-pill input:checked ~ .pub-pill-text{ color:#fff; }
.pub-pill-text em{ font-style:normal; color:#8b93a5; }
.pub-pill:has(input:disabled){ opacity:.55; cursor:default; }


.adv-block{
  grid-column:1 / -1; margin-top:10px; padding:8px 12px 10px;
  border:1px solid rgba(255,255,255,0.12); border-radius:10px; background:rgba(0,0,0,0.22);
}
.adv-block > summary{
  cursor:pointer; font-size:0.78rem; font-weight:800; letter-spacing:0.5px; color:#cfe9ff;
  list-style:none;
}
.adv-block > summary::-webkit-details-marker{ display:none; }
.adv-block > summary::before{ content:"\25B8 "; color:#7cf6ff; }
.adv-block[open] > summary::before{ content:"\25BE "; }

/* ---------- Public match browser (shared across the arcade) ---------- */
.pm-panel{
  margin:14px auto; padding:12px 14px; max-width:520px;
  border:1px solid rgba(255,255,255,0.13); border-radius:12px;
  background:rgba(0,0,0,0.28); text-align:left;
}
.pm-head{ font-size:0.78rem; font-weight:800; letter-spacing:0.8px; color:#dfe8ff; margin-bottom:9px; }
.pm-count{ font-weight:600; color:#8b95a6; margin-left:6px; letter-spacing:0; }
.pm-list{ display:flex; flex-direction:column; gap:7px; }
.pm-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:9px 11px; border:1px solid rgba(255,255,255,0.10); border-radius:9px;
  background:rgba(255,255,255,0.03); text-decoration:none; color:inherit;
}
.pm-row:hover{ border-color:rgba(124,246,255,0.45); }
.pm-game{ font-weight:800; font-size:0.78rem; letter-spacing:0.4px; color:#eaf4ff; }
.pm-info{ color:#8b95a6; font-size:0.68rem; margin-top:2px; }
.pm-join{
  flex:none; font-weight:800; font-size:0.66rem; letter-spacing:1px;
  color:#06120c; background:#3ddc84; border-radius:7px; padding:6px 11px;
}
.pm-empty{ color:#8b95a6; font-size:0.74rem; line-height:1.5; margin-top:6px; }
.pm-empty strong{ color:#cfe9ff; }

/* The menu screen is a flex row, so on a narrow window the panel gets crushed
   in beside the card instead of moving below it. Let it wrap, and go
   full-width once it does. */
@media (max-width: 1080px) {
  #screen-menu, #screen-home { flex-wrap: wrap; }
  .pm-panel { flex: 1 1 100%; max-width: 560px; order: 99; }
}
@media (max-width: 620px) {
  .pm-panel { margin: 12px 8px; padding: 10px; }
  .pm-game { font-size: 0.72rem; }
  .pm-info { font-size: 0.63rem; }
}

/* ---------- Kill feed ----------
   Top-right, under the topbar and clear of the minimap slot. Entries fade on
   their own so the list can never grow past a few lines. */
.kill-feed{
  position:absolute; top:64px; right:14px; z-index:24;
  display:flex; flex-direction:column; align-items:flex-end; gap:5px;
  pointer-events:none; max-width:min(330px, 52vw);
}
.kf-row{
  display:flex; align-items:center; gap:7px;
  padding:5px 10px; border-radius:8px;
  background:rgba(8,12,20,0.82); border:1px solid rgba(255,255,255,0.10);
  font-size:0.7rem; font-weight:700; letter-spacing:0.3px; color:#dfe8ff;
  white-space:nowrap; backdrop-filter:blur(6px);
  animation: kfIn 0.28s cubic-bezier(0.16,1,0.3,1);
}
.kf-row.out   { border-color:rgba(255,77,94,0.45); }
.kf-row.escape{ border-color:rgba(61,220,132,0.5); }
.kf-row.you   { background:rgba(30,16,22,0.9); }
.kf-icon{ font-size:0.85rem; }
.kf-name{ color:#fff; }
.kf-verb{ color:#8b95a6; font-weight:600; }
.kf-row.fading{ opacity:0; transform:translateX(8px); transition:opacity .5s ease, transform .5s ease; }
@keyframes kfIn{ from{ opacity:0; transform:translateX(14px);} to{ opacity:1; transform:none;} }
@media (max-width: 720px){
  .kill-feed{ top:56px; right:8px; max-width:60vw; }
  .kf-row{ font-size:0.62rem; padding:4px 8px; }
}


/* Blend In disables the gear locker — see index.html. */
.gear-locked-note {
  font-size: .72rem;
  line-height: 1.45;
  color: #ffd166;
  background: rgba(255, 209, 102, .09);
  border: 1px solid rgba(255, 209, 102, .32);
  border-radius: 10px;
  padding: 8px 10px;
  margin-bottom: 8px;
}
.gear-locked-note[hidden] { display: none; }
.gear-selection-box.locked .gear-chips {
  opacity: .35;
  pointer-events: none;
  filter: grayscale(.8);
}


/* Solo difficulty presets — see index.html. */
.map-sel-label.sub { margin-top: 10px; opacity: .8; }
.diff-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.diff-chip {
  flex: 1 1 auto;
  text-align: center;
  padding: 7px 10px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .04);
  font-size: .76rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.diff-chip:hover { background: rgba(255, 255, 255, .1); }
.diff-chip.selected {
  border-color: #22ff66;
  background: rgba(34, 255, 102, .16);
  color: #d8ffe6;
}
.diff-note { font-size: .7rem; line-height: 1.4; opacity: .72; margin-bottom: 8px; }


/* ---- Red Light / Green Light ------------------------------------------- */
.rlgl-banner {
  position: absolute;
  /* Clear of the environment card, which also sits under the top bar and was
     landing on top of the light. */
  top: 132px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 24;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 14px;
  background: rgba(6, 8, 14, .72);
  border: 2px solid var(--rlgl, #22ff66);
  box-shadow: 0 0 26px -6px var(--rlgl, #22ff66);
  pointer-events: none;
  transition: border-color .18s, box-shadow .18s;
}
.rlgl-banner[hidden] { display: none; }
.rlgl-banner[data-state="green"] { --rlgl: #22ff66; }
.rlgl-banner[data-state="amber"] { --rlgl: #ffb300; }
.rlgl-banner[data-state="red"]   { --rlgl: #ff2d4b; }
.rlgl-lamp {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--rlgl);
  box-shadow: 0 0 16px var(--rlgl);
}
.rlgl-banner[data-state="red"] .rlgl-lamp { animation: rlglPulse .7s ease-in-out infinite; }
.rlgl-banner[data-state="amber"] .rlgl-lamp { animation: rlglPulse .28s ease-in-out infinite; }
@keyframes rlglPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .45; transform: scale(.82); }
}
.rlgl-text {
  font-weight: 900;
  letter-spacing: 2.4px;
  font-size: .95rem;
  color: var(--rlgl);
  text-shadow: 0 0 14px var(--rlgl);
}
/* How far you have drifted, out of what the light will tolerate. Being
   eliminated should never be a surprise. */
.rlgl-drift-track {
  width: 168px; height: 4px; border-radius: 2px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
}
.rlgl-drift {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ffb300, #ff2d4b);
  transition: width .1s linear;
}
.rlgl-drift[hidden] { display: none; }
@media (max-width: 600px) {
  .rlgl-banner { top: 112px; padding: 8px 16px; }
  .rlgl-text { font-size: .8rem; letter-spacing: 1.6px; }
}
