/* 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; }


/* ---------- 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;
  top: 14px;
  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; }
