/* Mobile direct weapon selection and tactical-map return control. */

.mobile-action.weapon-cycle.mobile-quick-slots-replaced {
  display: none !important;
}

.mobile-quick-slots {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 34;
  width: 52px;
  height: 52px;
  pointer-events: auto;
}

.mobile-quick-slots[hidden],
.mobile-quick-slots-panel[hidden] {
  display: none !important;
}

.mobile-quick-slots-trigger {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 5px;
  border: 2px solid rgba(237, 244, 239, 0.48);
  border-radius: 12px;
  background: rgba(10, 16, 14, 0.66);
  color: #edf4ef;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  touch-action: manipulation;
}

.mobile-quick-slots-trigger::after {
  content: "⌃";
  position: absolute;
  right: 3px;
  bottom: 0;
  color: rgba(237, 244, 239, 0.92);
  font-size: 15px;
  font-weight: 950;
  line-height: 1;
}

.mobile-quick-slots-trigger.is-open {
  border-color: rgba(255, 209, 102, 0.9);
  background: rgba(34, 45, 34, 0.92);
}

.mobile-quick-trigger-art,
.mobile-quick-slot-art {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  pointer-events: none;
}

.mobile-quick-trigger-art img {
  width: 38px;
  height: 34px;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.7));
}

.mobile-quick-slots-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  display: grid;
  grid-template-columns: repeat(6, 48px);
  gap: 5px;
  width: max-content;
  padding: 7px;
  border: 1px solid rgba(237, 244, 239, 0.28);
  border-radius: 11px;
  background: rgba(7, 13, 12, 0.94);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.48);
  transform-origin: right bottom;
  animation: mobile-quick-slots-open 120ms ease-out;
}

@keyframes mobile-quick-slots-open {
  from { opacity: 0; transform: translateY(8px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.mobile-quick-slot {
  position: relative;
  display: grid;
  grid-template-rows: 12px 1fr 12px;
  place-items: center;
  width: 48px;
  height: 58px;
  padding: 2px 3px;
  border: 1px solid rgba(237, 244, 239, 0.22);
  border-radius: 8px;
  background: rgba(28, 37, 30, 0.9);
  color: rgba(237, 244, 239, 0.9);
  touch-action: manipulation;
}

.mobile-quick-slot b {
  justify-self: start;
  color: rgba(255, 209, 102, 0.96);
  font-size: 11px;
  line-height: 1;
}

.mobile-quick-slot-art img {
  width: 39px;
  height: 29px;
  object-fit: contain;
}

.mobile-quick-slot-ammo {
  justify-self: end;
  min-height: 12px;
  color: rgba(237, 244, 239, 0.88);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.mobile-quick-slot.is-selected {
  border-color: rgba(255, 209, 102, 0.98);
  background: rgba(78, 91, 54, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 209, 102, 0.34);
}

.mobile-quick-slot.is-dry {
  opacity: 0.58;
}

.mobile-quick-slot.is-empty {
  opacity: 0.28;
}

.mobile-tactical-map-return {
  display: none;
  position: fixed;
  left: max(16px, env(safe-area-inset-left));
  top: max(14px, env(safe-area-inset-top));
  z-index: 80;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 82px;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid rgba(255, 209, 102, 0.72);
  border-radius: 9px;
  background: rgba(7, 13, 12, 0.9);
  color: rgba(255, 239, 193, 0.98);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
  font: inherit;
  font-size: 13px;
  font-weight: 950;
  touch-action: manipulation;
}

.mobile-tactical-map-return span {
  font-size: 21px;
  line-height: 1;
}

body.mobile-controls-active.tactical-map-open .mobile-tactical-map-return {
  display: flex;
}

body.tactical-map-open .mobile-quick-slots,
body.mobile-inventory-open .mobile-quick-slots {
  display: none !important;
}

@media (max-width: 720px) {
  .mobile-quick-slots-panel {
    grid-template-columns: repeat(6, 45px);
    gap: 4px;
    padding: 6px;
  }

  .mobile-quick-slot {
    width: 45px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-quick-slots-panel { animation: none; }
}
