/* ==========================================================================
   CS2D DELTA ARENA - MOBILE TOUCH CONTROLS SUITE
   Virtual Joystick, Sprint Lock, Context Action & Weapon Buttons
   ========================================================================== */

/* --- CALL OF DUTY MOBILE TACTICAL CONTROLS SUITE --- */
.hud-top-left-zone {
  position: absolute;
  top: calc(14px + var(--safe-top));
  left: calc(16px + var(--safe-left));
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 55;
  pointer-events: none;
}

.hud-top-left-zone .hud-radar-box {
  pointer-events: auto;
  /* The zone is already an absolutely positioned flex column at the top-left;
     the radar must stay in flow so the BGM capsule sits *below* it instead of
     being painted on top of it. */
  position: relative;
  top: 0;
  left: 0;
}

/* Call of Duty Mobile Left-Hand Hipfire Button (Claw Grip) */
.cod-left-fire-zone {
  position: absolute;
  top: 48%;
  left: calc(16px + var(--safe-left));
  transform: translateY(-50%);
  z-index: 55;
  pointer-events: auto;
}

.cod-ctrl-btn {
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(38, 54, 82, 0.94) 0%, rgba(12, 18, 30, 0.96) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 2px solid rgba(255, 255, 255, 0.42);
  color: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.75), inset 0 1px 1px rgba(255, 255, 255, 0.35);
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  pointer-events: auto !important;
  touch-action: none !important;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  will-change: transform;
}

.cod-ctrl-btn:active {
  transform: scale(0.92);
}

.cod-left-fire {
  width: 56px;
  height: 56px;
  border: 2px solid rgba(255, 75, 75, 0.8);
  background: radial-gradient(circle at 36% 36%, rgba(255, 75, 75, 0.32) 0%, rgba(25, 12, 18, 0.95) 100%);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65), inset 0 0 12px rgba(255, 75, 75, 0.3);
}

.cod-left-fire.is-firing,
.cod-left-fire:active {
  background: radial-gradient(circle, rgba(255, 75, 75, 0.75) 0%, rgba(40, 12, 18, 0.98) 100%);
  border-color: #ff4444;
  box-shadow: 0 0 25px rgba(255, 60, 60, 0.9), inset 0 0 16px rgba(255, 120, 120, 0.8);
}

/* Bottom Right: Authentic Call of Duty Mobile Combat Cluster */
.hud-bottom-right.cod-mobile-cluster {
  position: absolute;
  bottom: calc(14px + var(--safe-bottom));
  right: calc(14px + var(--safe-right));
  display: flex;
  align-items: flex-end;
  gap: 12px;
  pointer-events: none;
  z-index: 60;
}

.cod-controls-layout {
  position: relative;
  width: 250px;
  height: 240px;
  pointer-events: none;
}

/* Primary Fire Trigger (Big COD Mobile Style 78px with Aim Drag & Recoil Control) */
.cod-primary-fire {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 78px;
  height: 78px;
  border: 2.5px solid #ff3b3b;
  background: radial-gradient(circle at 38% 38%, rgba(255, 65, 65, 0.42) 0%, rgba(32, 10, 16, 0.96) 75%);
  box-shadow: 0 0 24px rgba(255, 45, 45, 0.65), inset 0 0 14px rgba(255, 65, 65, 0.35);
}

.cod-primary-fire.is-firing,
.cod-primary-fire:active {
  transform: scale(0.94);
  background: radial-gradient(circle at 50% 50%, rgba(255, 80, 80, 0.88) 0%, rgba(65, 12, 24, 0.98) 75%);
  border-color: #ff5555;
  box-shadow: 0 0 35px rgba(255, 45, 45, 0.95), inset 0 0 24px rgba(255, 120, 120, 0.9);
  animation: cod-fire-muzzle 0.12s infinite alternate ease-in-out;
}

@keyframes cod-fire-muzzle {
  0% {
    box-shadow: 0 0 26px rgba(255, 45, 45, 0.85), inset 0 0 16px rgba(255, 100, 100, 0.8);
  }
  100% {
    box-shadow: 0 0 42px rgba(255, 75, 75, 1), inset 0 0 28px rgba(255, 160, 160, 0.95);
  }
}

.cod-fire-svg {
  width: 34px;
  height: 34px;
}

/* Tactical Crouch Button */
.cod-btn-crouch {
  position: absolute;
  right: 104px;
  bottom: 6px;
  width: 54px;
  height: 54px;
  border-color: rgba(241, 196, 15, 0.55);
}

.cod-btn-crouch.active-crouch {
  background: radial-gradient(circle, rgba(241, 196, 15, 0.42) 0%, rgba(30, 25, 12, 0.96) 80%) !important;
  border-color: #f1c40f !important;
  color: #f1c40f !important;
  box-shadow: 0 0 22px rgba(241, 196, 15, 0.8) !important;
}

/* Tactical Jump Button */
.cod-btn-jump {
  position: absolute;
  right: 144px;
  bottom: 74px;
  width: 54px;
  height: 54px;
  border-color: rgba(0, 229, 255, 0.55);
}

.cod-btn-jump:active {
  background: rgba(0, 229, 255, 0.4);
  border-color: #00e5ff;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.7);
}

/* Aim Down Sights (ADS / Scope) */
.cod-btn-ads {
  position: absolute;
  right: 84px;
  bottom: 98px;
  width: 54px;
  height: 54px;
}

.cod-btn-ads.active-ads {
  background: radial-gradient(circle, rgba(0, 229, 255, 0.38) 0%, rgba(18, 25, 38, 0.94) 80%) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.75) !important;
}

/* Quick Reload Button */
.cod-btn-reload {
  position: absolute;
  right: 14px;
  bottom: 108px;
  width: 52px;
  height: 52px;
}

.cod-btn-reload:active {
  background: rgba(241, 196, 15, 0.35);
  border-color: #f1c40f;
  box-shadow: 0 0 16px rgba(241, 196, 15, 0.5);
}

/* Quick Weapon Switch */
.cod-btn-switch {
  position: absolute;
  right: 92px;
  bottom: 176px;
  width: 48px;
  height: 48px;
}

.cod-btn-switch:active {
  background: rgba(52, 152, 219, 0.4);
  border-color: #3498db;
}

/* Tactical Grenade Button */
.cod-btn-grenade {
  position: absolute;
  right: 160px;
  bottom: 150px;
  width: 48px;
  height: 48px;
}

.cod-btn-grenade.btn-cooling {
  opacity: 0.6;
  border-color: rgba(255, 255, 255, 0.15);
  pointer-events: none !important;
}

/* Tactical Radio Comms Button */
.cod-btn-radio {
  position: absolute;
  right: 28px;
  bottom: 180px;
  width: 48px;
  height: 48px;
  border-color: rgba(0, 229, 255, 0.45);
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  z-index: 80;
}

.cod-btn-radio:active,
.cod-btn-radio.active-radio {
  background: radial-gradient(circle, rgba(0, 229, 255, 0.45) 0%, rgba(10, 30, 45, 0.96) 80%) !important;
  border-color: #00e5ff !important;
  color: #00e5ff !important;
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.75) !important;
}


.svg-icon {
  width: 22px;
  height: 22px;
}

.btn-subtext {
  font-size: 0.52rem;
  font-family: var(--font-tactical);
  font-weight: 800;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Weapon & Ammo Card */
.cod-ammo-card {
  background: var(--color-hud-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 8px 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
  min-width: 125px;
  text-align: right;
  pointer-events: auto;
  align-self: flex-end;
  margin-bottom: 8px;
}

.weapon-name {
  font-family: var(--font-tactical);
  font-size: 0.82rem;
  font-weight: 700;
  color: #8899a6;
  letter-spacing: 1px;
}

.ammo-numbers {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 4px;
}

.clip-text {
  font-family: var(--font-tactical);
  font-size: 2.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.ammo-slash {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.4);
}

.reserve-text {
  font-family: var(--font-tactical);
  font-size: 1.15rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.6);
}

.reload-progress {
  font-family: var(--font-tactical);
  font-size: 0.72rem;
  font-weight: 700;
  color: #f1c40f;
  margin-top: 3px;
  animation: pulse 1s infinite;
}

/* --- VIRTUAL JOYSTICK & SPRINT LOCK (AUTHENTIC COD MOBILE TACTICAL STYLE) --- */
.stick-base {
  position: absolute;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 2px solid rgba(0, 229, 255, 0.55);
  background: radial-gradient(circle, rgba(0, 229, 255, 0.12) 0%, rgba(12, 28, 48, 0.45) 65%, transparent 100%);
  box-shadow: 0 0 24px rgba(0, 229, 255, 0.25), inset 0 0 28px rgba(0, 229, 255, 0.15);
  transform: translate(-50%, -50%);
  display: none;
  pointer-events: none;
}

/* Subtle crosshair guide ticks on joystick base */
.stick-base::before,
.stick-base::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  background: rgba(0, 229, 255, 0.35);
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.stick-base::before {
  width: 100%;
  height: 1px;
}
.stick-base::after {
  width: 1px;
  height: 100%;
}

/* Deadzone Ring - Visual feedback for movement threshold */
.stick-deadzone {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px dashed rgba(0, 229, 255, 0.4);
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.15s ease;
  background: radial-gradient(circle, rgba(0, 229, 255, 0.08) 0%, transparent 70%);
}

.stick-sprint-indicator {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-tactical);
  font-size: 0.68rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 1.5px;
  transition: all 0.15s ease;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.stick-sprint-indicator.sprint-locked {
  color: #00e5ff;
  text-shadow: 0 0 12px rgba(0, 229, 255, 0.95);
  transform: translateX(-50%) scale(1.15);
}

.stick-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 2.5px solid #ffffff;
  background: radial-gradient(circle at 35% 35%, #00e5ff 0%, #0088cc 45%, #0d2238 90%);
  box-shadow: 0 0 20px rgba(0, 229, 255, 0.85), inset 0 0 8px rgba(255, 255, 255, 0.9);
  transform: translate(-50%, -50%);
  transition: transform 0.03s linear;
  display: flex;
  align-items: center;
  justify-content: center;
}

.knob-inner {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.knob-direction-indicator {
  width: 4px;
  height: 20px;
  background: linear-gradient(180deg, #ffffff 0%, rgba(255,255,255,0.3) 100%);
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.9);
  animation: knobPulse 1.5s infinite ease-in-out;
}

@keyframes knobPulse {
  0%, 100% { opacity: 0.6; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.1); }
}

/* Right Aim Indicator - Visual feedback when aiming on right side */
.right-aim-indicator {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(0, 229, 255, 0.6);
  background: radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.15) 0%, transparent 70%);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 50;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 16px rgba(0, 229, 255, 0.4);
  animation: aimPulse 1s infinite ease-in-out;
  transition: transform 0.02s linear;
}

@keyframes aimPulse {
  0%, 100% { box-shadow: 0 0 12px rgba(0, 229, 255, 0.3); border-color: rgba(0, 229, 255, 0.5); }
  50% { box-shadow: 0 0 24px rgba(0, 229, 255, 0.8); border-color: rgba(0, 229, 255, 0.9); }
}

.right-aim-indicator svg {
  width: 20px;
  height: 20px;
  stroke: #00e5ff;
  filter: drop-shadow(0 0 4px rgba(0, 229, 255, 0.8));
}

/* --- TACTICAL HE GRENADE BUTTON --- */
.grenade-btn {
  background: rgba(35, 55, 30, 0.88) !important;
  border-color: rgba(90, 160, 70, 0.5) !important;
}

.grenade-btn:active {
  background: rgba(60, 120, 50, 0.75) !important;
}

.btn-cooling {
  opacity: 0.45;
  filter: grayscale(0.7);
  pointer-events: none !important;
}

/* --- C4 BOMB PLANT / DEFUSE CONTEXT PROMPT --- */
.bomb-action-container {
  position: absolute;
  bottom: 120px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 150;
  pointer-events: auto;
}

.bomb-prompt-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, #e67e22 0%, #d35400 100%);
  color: #fff;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 28px;
  padding: 10px 24px;
  font-family: var(--font-tactical);
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(230, 126, 34, 0.6);
  touch-action: manipulation !important;
  transition: transform 0.1s, box-shadow 0.2s;
}

.bomb-prompt-btn:active {
  transform: scale(0.95);
}

.defuse-mode-btn {
  background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
  box-shadow: 0 6px 20px rgba(52, 152, 219, 0.6) !important;
}

.bomb-progress-bar {
  width: 180px;
  height: 10px;
  background: rgba(0, 0, 0, 0.75);
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  overflow: hidden;
}

.bomb-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #f1c40f, #e67e22);
  transition: width 0.08s linear;
}

/* --- FIRE BUTTON (Mobile Right Thumb) --- */
.fire-btn {
  width: 68px !important;
  height: 68px !important;
  background: linear-gradient(135deg, rgba(231, 76, 60, 0.9) 0%, rgba(192, 57, 43, 0.95) 100%) !important;
  border: 2px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 0 20px rgba(231, 76, 60, 0.6) !important;
  will-change: transform;
}

.fire-btn:active {
  transform: scale(0.92) !important;
  background: rgba(255, 71, 87, 1) !important;
}

/* Mobile touch: Bigger fire button, fixed position */
@media (hover: none) and (pointer: coarse) {
  .fire-btn {
    width: 82px !important;
    height: 82px !important;
    position: fixed !important;
    right: 18px !important;
    bottom: 28px !important;
    z-index: 70 !important;
    box-shadow: 0 0 28px rgba(231, 76, 60, 0.7), 0 0 60px rgba(231, 76, 60, 0.25) !important;
    border: 2.5px solid rgba(255, 255, 255, 0.6) !important;
    animation: fire-btn-ready 2.5s infinite ease-in-out;
  }

  .fire-btn .svg-icon {
    width: 28px;
    height: 28px;
  }

  .fire-btn .btn-subtext {
    font-size: 0.65rem;
    letter-spacing: 1px;
  }

  .fire-btn:active {
    transform: scale(0.88) !important;
    box-shadow: 0 0 35px rgba(255, 71, 87, 0.9) !important;
    animation: none !important;
  }
}

@keyframes fire-btn-ready {
  0% { box-shadow: 0 0 24px rgba(231, 76, 60, 0.5), 0 0 50px rgba(231, 76, 60, 0.15); }
  50% { box-shadow: 0 0 32px rgba(231, 76, 60, 0.8), 0 0 65px rgba(231, 76, 60, 0.3); }
  100% { box-shadow: 0 0 24px rgba(231, 76, 60, 0.5), 0 0 50px rgba(231, 76, 60, 0.15); }
}

