/* ============================================================
   BLOCK OPS - STYLESHEET (Krunker.io Style)
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Teko:wght@500;700&family=Rajdhani:wght@600;700&display=swap');

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

body, html {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: #0b0e14;
  font-family: 'Rajdhani', sans-serif;
  color: #ffffff;
}

#game-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

#game-container canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
}

/* ================= HUD ================= */
#hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  pointer-events: none;
}

/* Damage Vignette */
#damage-vignette {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  box-shadow: inset 0 0 100px rgba(255, 0, 0, 0);
  transition: box-shadow 0.1s ease-out;
  pointer-events: none;
}

#damage-vignette.hit {
  box-shadow: inset 0 0 140px rgba(255, 0, 0, 0.75);
}

/* Directional Damage Tactical Chevron Indicator */
#damage-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 260px;
  height: 260px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: opacity 0.1s ease-out;
  opacity: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

#damage-arrow.flash {
  opacity: 1;
}

.damage-chevron {
  width: 52px;
  height: 28px;
  position: relative;
  filter: drop-shadow(0 0 12px #ff0033) drop-shadow(0 0 24px #ff0000);
}

/* Sharp outer tactical chevron pointing UP */
.damage-chevron::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 26px solid transparent;
  border-right: 26px solid transparent;
  border-bottom: 28px solid #ff1133;
}

/* Dark inner cutout creating the sharp tactical chevron arrowhead */
.damage-chevron::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 17px solid transparent;
  border-right: 17px solid transparent;
  border-bottom: 19px solid rgba(12, 16, 22, 0.95);
}

/* Crosshair */
#crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 28px;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.ch-dot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: #00ffaa;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 4px #00ffaa;
}

.ch-line {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.8);
}

.ch-top {
  width: 2px;
  height: 8px;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

.ch-bottom {
  width: 2px;
  height: 8px;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}

.ch-left {
  height: 2px;
  width: 8px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

.ch-right {
  height: 2px;
  width: 8px;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* Hitmarker */
#hitmarker {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.05s linear;
}

#hitmarker.active {
  opacity: 1;
}

#hitmarker.headshot .hm-line {
  background: #ffcc00;
  box-shadow: 0 0 6px #ffcc00;
}

.hm-line {
  position: absolute;
  width: 7px;
  height: 2px;
  background: #ff2222;
}

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

/* Top Bar Stats */
#top-bar {
  position: absolute;
  top: 18px;
  left: 24px;
  right: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.top-left-stats {
  display: flex;
  gap: 12px;
}

.stat-badge {
  background: rgba(15, 20, 28, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 6px 14px;
  font-family: 'Teko', sans-serif;
  font-size: 24px;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.level-badge {
  color: #00ffaa;
  font-size: 26px;
  font-weight: 700;
  border-color: rgba(0, 255, 170, 0.45);
  box-shadow: 0 0 12px rgba(0, 255, 170, 0.2);
}

.level-badge span {
  color: #ffffff;
  font-size: 20px;
}

.timer-badge {
  color: #ffcc00;
  font-size: 28px;
  border-color: rgba(255, 204, 0, 0.4);
}

.score-badge span {
  color: #00e5ff;
}

.streak-badge span {
  color: #ff3366;
}

/* Killfeed */
#killfeed {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.kill-entry {
  background: rgba(12, 16, 22, 0.88);
  border-left: 4px solid #00ffaa;
  padding: 4px 12px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  border-radius: 2px;
  animation: slideInFeed 0.2s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.kill-entry.headshot {
  border-left-color: #ffcc00;
}

.kill-entry .k-killer { color: #00ffaa; }
.kill-entry .k-weapon { color: #aaaaaa; margin: 0 4px; font-weight: 600; font-size: 13px; }
.kill-entry .k-victim { color: #ff4466; }

@keyframes slideInFeed {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Announcement Banner */
#announcement-banner {
  position: absolute;
  top: 22%;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
}

#announce-main {
  font-family: 'Teko', sans-serif;
  font-size: 54px;
  font-weight: 700;
  color: #ffcc00;
  text-shadow: 0 0 20px rgba(255, 204, 0, 0.6), 0 4px 10px rgba(0,0,0,0.9);
  letter-spacing: 2px;
  opacity: 0;
  transform: scale(0.7);
  transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

#announce-main.pop {
  opacity: 1;
  transform: scale(1);
}

#announce-sub {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
  letter-spacing: 1px;
}

/* Bottom Left Vitals */
#bottom-left {
  position: absolute;
  bottom: 24px;
  left: 24px;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.player-avatar-box {
  background: rgba(15, 20, 28, 0.88);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 6px 10px;
  text-align: center;
}

.avatar-icon {
  font-size: 28px;
}

.player-name-tag {
  font-family: 'Teko', sans-serif;
  font-size: 16px;
  color: #00ffaa;
  letter-spacing: 1px;
}

.vitals-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 220px;
}

.health-bar-wrapper, .shield-bar-wrapper {
  background: rgba(10, 14, 20, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  height: 28px;
  position: relative;
  overflow: hidden;
}

.bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #00c853, #69f0ae);
  transition: width 0.15s ease-out;
}

.shield-fill {
  background: linear-gradient(90deg, #0091ea, #40c4ff);
}

.bar-text {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: 'Teko', sans-serif;
  font-size: 22px;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  letter-spacing: 1px;
  z-index: 2;
}

/* Bottom Center Weapon Selector */
#bottom-center {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.weapon-slot {
  background: rgba(15, 20, 28, 0.8);
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  padding: 4px 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Teko', sans-serif;
  font-size: 20px;
  letter-spacing: 1px;
  color: #888888;
  transition: all 0.15s ease;
}

.weapon-slot.active {
  border-color: #00ffaa;
  background: rgba(0, 255, 170, 0.15);
  color: #00ffaa;
  transform: scale(1.05);
}

.slot-num {
  background: rgba(255, 255, 255, 0.1);
  padding: 0 6px;
  border-radius: 2px;
  font-size: 16px;
}

#reload-prompt {
  background: rgba(255, 51, 85, 0.85);
  color: #ffffff;
  padding: 4px 14px;
  border-radius: 3px;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1px;
  animation: blinkPrompt 0.8s infinite alternate;
}

@keyframes blinkPrompt {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* Bottom Right Ammo */
#bottom-right {
  position: absolute;
  bottom: 24px;
  right: 24px;
  text-align: right;
  background: rgba(15, 20, 28, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 6px 18px;
}

.ammo-display {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
  font-family: 'Teko', sans-serif;
  line-height: 1;
}

.ammo-cur {
  font-size: 64px;
  color: #00ffaa;
  text-shadow: 0 0 12px rgba(0, 255, 170, 0.4);
}

.ammo-cur.low {
  color: #ff3366;
  text-shadow: 0 0 12px rgba(255, 51, 102, 0.6);
}

.ammo-divider {
  font-size: 32px;
  color: rgba(255, 255, 255, 0.3);
}

.ammo-max {
  font-size: 36px;
  color: #bbbbbb;
}

.weapon-icon {
  font-size: 15px;
  font-weight: 700;
  color: #aaaaaa;
  letter-spacing: 1px;
}

/* Controls Hint */
#controls-hint {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 14, 20, 0.6);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.5px;
}

/* Scoreboard */
#scoreboard {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(12, 16, 24, 0.95);
  border: 2px solid rgba(0, 255, 170, 0.4);
  border-radius: 6px;
  padding: 24px;
  width: 700px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.8);
  pointer-events: auto;
}

.sb-header {
  text-align: center;
  margin-bottom: 16px;
}

.sb-header h2 {
  font-family: 'Teko', sans-serif;
  font-size: 38px;
  color: #00ffaa;
  letter-spacing: 2px;
}

.sb-sub {
  font-size: 14px;
  color: #888888;
  letter-spacing: 1px;
}

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

.sb-table th {
  font-family: 'Teko', sans-serif;
  font-size: 20px;
  color: #ffcc00;
  text-align: left;
  padding: 8px 12px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.sb-table td {
  padding: 8px 12px;
  font-size: 16px;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sb-table tr.is-you {
  background: rgba(0, 255, 170, 0.12);
  color: #00ffaa;
}

/* ================= OVERLAYS ================= */
#start-overlay, #death-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(7, 10, 15, 0.88);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.menu-modal, .death-modal {
  background: rgba(14, 18, 26, 0.96);
  border: 2px solid rgba(0, 255, 170, 0.4);
  border-radius: 8px;
  padding: 36px 44px;
  max-width: 780px;
  width: 92%;
  box-shadow: 0 16px 50px rgba(0,0,0,0.8);
}

.game-logo h1 {
  font-family: 'Teko', sans-serif;
  font-size: 76px;
  line-height: 0.9;
  letter-spacing: 3px;
  color: #ffffff;
}

.game-logo h1 span {
  color: #00ffaa;
}

.logo-sub {
  font-size: 16px;
  font-weight: 700;
  color: #ffcc00;
  letter-spacing: 3px;
  margin-bottom: 20px;
}

.menu-desc {
  font-size: 17px;
  color: #bbbbbb;
  margin-bottom: 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}

.feat-card {
  background: rgba(22, 28, 40, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 14px 10px;
  text-align: center;
}

.feat-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 6px;
}

.feat-card strong {
  display: block;
  font-size: 16px;
  color: #00ffaa;
  margin-bottom: 4px;
}

.feat-card p {
  font-size: 12px;
  color: #888888;
  line-height: 1.3;
}

.btn-action {
  background: #00ffaa;
  color: #0b0e14;
  font-family: 'Teko', sans-serif;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 2px;
  border: none;
  border-radius: 4px;
  padding: 8px 36px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0, 255, 170, 0.4);
  transition: all 0.15s ease;
  width: 100%;
}

.btn-action:hover {
  background: #33ffbb;
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(0, 255, 170, 0.6);
}

.controls-legend {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 20px;
  font-size: 13px;
  color: #888888;
}

.controls-legend span b {
  color: #ffffff;
}

/* ================= CINEMATIC DEATH & REINCARNATION ================= */
#game-container {
  transition: filter 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#game-container.death-grayscale {
  filter: grayscale(100%) contrast(150%) brightness(75%) !important;
}

/* Cinematic Letterbox Bars */
.cinema-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 0;
  background: #000000;
  z-index: 90;
  transition: height 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}

#cinema-bar-top {
  top: 0;
}

#cinema-bar-bottom {
  bottom: 0;
}

body.cinematic-active #cinema-bar-top,
body.cinematic-active #cinema-bar-bottom {
  height: 12vh;
}

/* Fade to Black Overlay */
#fade-black-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  z-index: 150;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease-in-out;
}

#fade-black-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Cinematic Death HUD */
#cinematic-death-hud {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
  animation: fadeInDeath 0.4s ease-out forwards;
}

@keyframes fadeInDeath {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.death-cinematic-content {
  text-align: center;
}

.death-kanji {
  font-family: 'Teko', sans-serif;
  font-size: 26px;
  color: #ff3344;
  letter-spacing: 6px;
  margin-bottom: 2px;
  text-shadow: 0 0 12px rgba(255, 51, 68, 0.8);
}

.death-hero-title {
  font-family: 'Teko', sans-serif;
  font-size: 110px;
  font-weight: 700;
  line-height: 0.85;
  letter-spacing: 6px;
  color: #ffffff;
  text-shadow: 0 0 30px rgba(255, 30, 60, 0.9), 0 0 60px rgba(0,0,0,0.9);
  animation: pulseEliminated 1.2s infinite alternate;
}

@keyframes pulseEliminated {
  from { transform: scale(0.98); text-shadow: 0 0 20px rgba(255, 30, 60, 0.7); }
  to { transform: scale(1.03); text-shadow: 0 0 40px rgba(255, 50, 80, 1.0); }
}

.death-hero-killer {
  font-size: 22px;
  font-weight: 700;
  color: #dddddd;
  letter-spacing: 3px;
  margin-top: 8px;
  text-transform: uppercase;
}

.reincarnation-timer-box {
  margin-top: 24px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 24px;
  border-radius: 30px;
  backdrop-filter: blur(8px);
}

.reincarnate-label {
  font-size: 15px;
  font-weight: 700;
  color: #888888;
  letter-spacing: 2px;
}

.reincarnate-countdown {
  font-family: 'Teko', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #00ffaa;
  text-shadow: 0 0 10px rgba(0, 255, 170, 0.8);
}

/* Pause Modal Overlay */
#pause-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(8, 12, 18, 0.82);
  backdrop-filter: blur(8px);
  z-index: 999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pause-box {
  border-color: #00ffaa !important;
  box-shadow: 0 0 35px rgba(0, 255, 170, 0.3) !important;
}

.loot-pickup-notification {
  position: absolute;
  bottom: 140px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(12, 22, 28, 0.9);
  border: 2px solid #00ffaa;
  color: #ffffff;
  padding: 8px 24px;
  border-radius: 30px;
  font-family: 'Teko', sans-serif;
  font-size: 26px;
  letter-spacing: 2px;
  text-shadow: 0 0 12px rgba(0, 255, 170, 0.9);
  pointer-events: none;
  animation: popIn 0.2s ease-out;
  z-index: 100;
}

/* Mission Briefing Card on Start Screen */
.mission-briefing-box {
  background: rgba(12, 18, 25, 0.9);
  border: 2px solid rgba(0, 255, 170, 0.4);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 12px 0 18px 0;
  text-align: left;
  box-shadow: 0 0 20px rgba(0, 255, 170, 0.15);
}

.brief-tag {
  font-family: 'Teko', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #00ffaa;
  letter-spacing: 2px;
  text-shadow: 0 0 8px rgba(0, 255, 170, 0.6);
}

.brief-title {
  font-family: 'Teko', sans-serif;
  font-size: 36px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 2px;
  margin: 2px 0 6px 0;
  line-height: 1.0;
}

.brief-desc {
  font-size: 14px;
  color: #a0b2c6;
  line-height: 1.4;
  margin-bottom: 12px;
}

.campaign-level-pills {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.level-pill-card {
  background: rgba(10, 15, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 2px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.level-pill-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 255, 170, 0.6);
  background: rgba(0, 255, 170, 0.08);
}

.level-pill-card.active {
  border-color: #00ffaa;
  background: rgba(0, 255, 170, 0.16);
  box-shadow: 0 0 16px rgba(0, 255, 170, 0.35);
  transform: scale(1.03);
}

.level-pill-card.boss-card {
  border-color: rgba(255, 51, 68, 0.45);
}

.level-pill-card.boss-card:hover {
  border-color: #ff3344;
  background: rgba(255, 51, 68, 0.12);
}

.level-pill-card.boss-card.active {
  border-color: #ff3344;
  background: rgba(255, 51, 68, 0.22);
  box-shadow: 0 0 20px rgba(255, 51, 68, 0.5);
  transform: scale(1.03);
}

.level-pill-card.locked {
  opacity: 0.38 !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  background: rgba(8, 12, 18, 0.6) !important;
  cursor: not-allowed !important;
  filter: grayscale(0.9) !important;
  box-shadow: none !important;
  transform: none !important;
}

.level-pill-card.locked:hover {
  border-color: rgba(255, 51, 68, 0.45) !important;
  background: rgba(255, 51, 68, 0.1) !important;
  transform: none !important;
}

.level-pill-card.locked .lp-tag {
  color: #667788 !important;
}

.level-pill-card.locked .lp-title {
  color: #778899 !important;
}

.level-pill-card.locked .lp-meta {
  color: #ff4455 !important;
}

.lp-tag {
  font-family: 'Teko', sans-serif;
  font-size: 15px;
  font-weight: 700;
  color: #00ffaa;
  letter-spacing: 1px;
  line-height: 1.0;
  white-space: nowrap;
}

.lp-title {
  font-family: 'Teko', sans-serif;
  font-size: 19px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
  line-height: 1.1;
  white-space: nowrap;
}

.lp-meta {
  font-size: 11px;
  color: #ffcc00;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

/* Match End (Victory / Defeat) Screen */
#match-end-modal {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(6, 10, 15, 0.88);
  backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.match-end-box {
  width: 480px;
  text-align: center;
  border-color: #00ffaa !important;
  box-shadow: 0 0 45px rgba(0, 255, 170, 0.35) !important;
  animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.match-end-box.defeat {
  border-color: #ff3344 !important;
  box-shadow: 0 0 45px rgba(255, 51, 68, 0.35) !important;
}

.match-end-badge {
  display: inline-block;
  font-family: 'Teko', sans-serif;
  font-size: 24px;
  font-weight: 800;
  padding: 4px 20px;
  border-radius: 20px;
  background: #00ffaa;
  color: #0c1219;
  letter-spacing: 3px;
  margin-bottom: 8px;
}

.defeat .match-end-badge {
  background: #ff3344;
  color: #ffffff;
}

.match-end-title {
  font-family: 'Teko', sans-serif;
  font-size: 52px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 3px;
  margin: 0;
  line-height: 1.0;
}

.match-end-sub {
  font-size: 15px;
  color: #8899aa;
  margin: 6px 0 20px 0;
}

.match-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}

.stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 10px 4px;
}

.sc-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #8899aa;
  letter-spacing: 1px;
}

.sc-val {
  font-family: 'Teko', sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #00ffaa;
  line-height: 1.0;
}

.defeat .sc-val {
  color: #ff3344;
}

.hidden {
  display: none !important;
}

/* PC vs Mobile Visibility */
.pc-only {
  display: block;
}
.mobile-only {
  display: none !important;
}

#mobile-controls {
  display: none;
}

/* ================= MOBILE & TOUCH CONTROLS ================= */
@media (hover: none) and (pointer: coarse), (max-width: 960px) {
  .pc-only {
    display: none !important;
  }
  .mobile-only {
    display: block !important;
  }

  #mobile-controls {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 45;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
  }

  /* Left Virtual Joystick Area */
  #mobile-joystick-zone {
    position: absolute;
    bottom: 24px;
    left: 24px;
    width: 140px;
    height: 140px;
    pointer-events: auto;
    touch-action: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #joystick-base {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0, 255, 170, 0.12) 0%, rgba(12, 18, 26, 0.75) 70%);
    border: 2px solid rgba(0, 255, 170, 0.45);
    box-shadow: 0 0 16px rgba(0, 255, 170, 0.25);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #joystick-knob {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle, #33ffbb 0%, #00aa70 100%);
    border: 2px solid #ffffff;
    box-shadow: 0 0 14px #00ffaa;
    position: absolute;
    pointer-events: none;
    transform: translate(0px, 0px);
    transition: transform 0.05s ease-out;
  }

  /* Right Touch Look & Aim Surface */
  #mobile-look-zone {
    position: absolute;
    top: 0;
    right: 0;
    width: 60%;
    height: 70%;
    pointer-events: auto;
    touch-action: none;
    z-index: 10;
  }

  /* Right Thumb Action Buttons */
  #mobile-action-buttons {
    position: absolute;
    bottom: 24px;
    right: 24px;
    display: flex;
    align-items: flex-end;
    gap: 12px;
    pointer-events: auto;
    z-index: 20;
  }

  .mobile-btn {
    border: none;
    outline: none;
    border-radius: 50%;
    font-family: 'Teko', sans-serif;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    transition: transform 0.1s ease, filter 0.1s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  }

  .mobile-btn:active {
    transform: scale(0.92);
    filter: brightness(1.25);
  }

  /* Primary Fire Button (Large Red Glowing Action Button) */
  .btn-fire {
    width: 78px;
    height: 78px;
    background: radial-gradient(circle, #ff3344 0%, #aa1122 100%);
    border: 3px solid #ff6677;
    box-shadow: 0 0 20px rgba(255, 51, 68, 0.55);
  }

  .btn-fire .m-icon {
    font-size: 26px;
    line-height: 1;
  }

  .btn-fire .m-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
  }

  /* Jump Button */
  .btn-jump {
    width: 58px;
    height: 58px;
    background: radial-gradient(circle, rgba(0, 255, 170, 0.3) 0%, rgba(10, 24, 20, 0.85) 100%);
    border: 2px solid #00ffaa;
    box-shadow: 0 0 12px rgba(0, 255, 170, 0.3);
  }

  .btn-jump .m-icon {
    font-size: 20px;
    line-height: 1;
  }

  .btn-jump .m-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
  }

  /* Reload Button */
  .btn-reload {
    width: 54px;
    height: 54px;
    background: radial-gradient(circle, rgba(255, 204, 0, 0.25) 0%, rgba(24, 20, 8, 0.85) 100%);
    border: 2px solid #ffcc00;
    box-shadow: 0 0 10px rgba(255, 204, 0, 0.3);
  }

  .btn-reload .m-icon {
    font-size: 18px;
    line-height: 1;
  }

  .btn-reload .m-label {
    font-size: 11px;
    font-weight: 700;
  }

  /* Swap Weapon Button */
  .btn-swap {
    width: 54px;
    height: 54px;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.25) 0%, rgba(8, 20, 28, 0.85) 100%);
    border: 2px solid #00d4ff;
    box-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
  }

  .btn-swap .m-icon {
    font-size: 18px;
    line-height: 1;
  }

  .btn-swap .m-label {
    font-size: 11px;
    font-weight: 700;
  }

  /* Top Right Pause Button */
  .btn-pause-top {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 44px;
    height: 44px;
    background: rgba(14, 20, 28, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 18px;
    pointer-events: auto;
    z-index: 50;
  }

  /* Mobile Responsive Modals & HUD */
  .menu-modal, .death-modal {
    width: 94vw !important;
    max-width: 460px !important;
    padding: 20px 14px !important;
    margin: 10px auto !important;
    box-sizing: border-box !important;
  }

  .game-logo h1 {
    font-size: 48px !important;
    line-height: 0.9 !important;
  }

  .logo-sub {
    font-size: 13px !important;
    letter-spacing: 2px !important;
    margin-bottom: 12px !important;
  }

  .mission-briefing-box {
    padding: 12px 10px !important;
    margin: 8px 0 14px 0 !important;
  }

  .brief-tag {
    font-size: 15px !important;
  }

  .campaign-level-pills {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 6px !important;
  }

  .level-pill-card {
    padding: 8px 3px !important;
  }

  .lp-tag {
    font-size: 13px !important;
  }

  .lp-title {
    font-size: 16px !important;
  }

  .lp-meta {
    font-size: 10px !important;
  }

  .btn-action {
    font-size: 22px !important;
    padding: 12px !important;
  }

  .controls-legend {
    font-size: 12px !important;
    margin-top: 10px !important;
  }

  /* HUD Layout on Mobile */
  #top-bar {
    top: 8px;
    left: 8px;
    right: 64px; /* leave room for mobile pause button */
  }

  .stat-badge {
    padding: 3px 8px;
    font-size: 16px;
  }

  #bottom-left {
    bottom: 175px; /* Above virtual joystick */
    left: 14px;
    transform: scale(0.88);
    transform-origin: bottom left;
  }

  #bottom-center {
    display: none !important; /* Replaced by mobile swap button & quick HUD */
  }

  #bottom-right {
    bottom: 110px; /* Above mobile action buttons */
    right: 14px;
    transform: scale(0.88);
    transform-origin: bottom right;
  }
}
