/* ============================================================================
   SPACE MINER - MOBILE HUD STYLES
   Barra superior unificada (38px), panel inferior desplegable (Bottom Sheet)
   ergonómico para pulgares y cero elementos estorbando el centro del cosmos.
   ============================================================================ */

/* Contenedor mobile exclusivo */
#hud-mobile {
  display: block;
}

/* 1. BARRA SUPERIOR UNIFICADA SLIM (TOP BAR MÓVIL) */
#mobile-top-bar {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  z-index: var(--z-hud-nav); /* Por encima del canvas, fondo y loading */
  background: linear-gradient(180deg, rgba(3, 7, 18, 0.95) 0%, rgba(3, 7, 18, 0.4) 85%, transparent 100%);
  pointer-events: none;
  box-sizing: border-box;
}

#mobile-top-bar > * {
  pointer-events: auto;
}

/* Pastilla de Bodega (Izquierda) */
.mobile-pill-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  cursor: pointer;
  box-shadow: var(--glass-glow);
  transition: all 0.2s ease;
}

.mobile-pill-btn:active {
  transform: scale(0.95);
  background: rgba(0, 245, 255, 0.2);
}

.mobile-pill-icon {
  font-size: 13px;
  line-height: 1;
}

.mobile-pill-val {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* Indicador de bodega llena */
.mobile-pill-btn.full {
  border-color: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.6);
  animation: pulse 1s infinite alternate;
}

/* Pastilla de Combustible Móvil */
.fuel-pill {
  border-color: rgba(255, 170, 0, 0.4);
}

.fuel-pill.low {
  border-color: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.8);
  animation: pulse 0.8s infinite alternate;
}

.fuel-pill.low .mobile-pill-val {
  color: var(--neon-pink);
}

.mobile-pill-btn.full .mobile-pill-val {
  color: var(--neon-pink);
}

/* Brújula Central Compacta (Centro) */
#mobile-compass {
  background: rgba(6, 18, 32, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  height: 32px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.2);
}

#mobile-compass-arrow {
  font-size: 14px;
  color: var(--neon-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  line-height: 1;
  transform-origin: center center;
  will-change: transform;
}

#mobile-compass-dist {
  font-family: 'Orbitron', monospace;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
  min-width: 34px;
}

/* Controles Derecha (Base Depósito + Sonido + Fullscreen) */
.mobile-top-right {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mobile-btn-mini {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--neon-cyan);
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--glass-glow);
  padding: 0;
}

.mobile-btn-mini:active {
  transform: scale(0.94);
}

.mobile-btn-mini svg {
  width: 15px;
  height: 15px;
}

/* 2. DRAWER HOLOGRÁFICO INFERIOR (BOTTOM SHEET MODAL) */
.mobile-drawer-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(3, 7, 18, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: var(--z-modals); /* Máxima prioridad visual */
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer-container {
  width: 100%;
  max-height: 72vh;
  background: rgba(6, 18, 32, 0.94);
  border-top: 1px solid var(--neon-cyan);
  box-shadow: 0 -5px 25px rgba(0, 245, 255, 0.35);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.15);
  padding: 12px 14px 20px 14px;
  box-sizing: border-box;
}

.mobile-drawer-overlay.active .mobile-drawer-container {
  transform: translateY(0);
}

/* Tirador superior del drawer */
.mobile-drawer-handle {
  width: 40px;
  height: 4px;
  background: rgba(0, 245, 255, 0.4);
  border-radius: 2px;
  align-self: center;
  margin-bottom: 10px;
}

/* Header con pestañas */
.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 245, 255, 0.15);
  padding-bottom: 8px;
}

.mobile-drawer-tabs {
  display: flex;
  gap: 8px;
}

.mobile-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  font-family: 'Orbitron', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-tab-btn.active {
  background: rgba(0, 245, 255, 0.15);
  border-color: var(--neon-cyan);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 245, 255, 0.3);
}

.mobile-drawer-close {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  cursor: pointer;
}

.mobile-drawer-body {
  overflow-y: auto;
  max-height: 50vh;
  padding-right: 4px;
}

/* Barra de carga de la bodega dentro del drawer */
.mobile-cargo-bar-wrapper {
  margin-bottom: 12px;
}

.mobile-cargo-bar-container {
  width: 100%;
  height: 18px;
  background: rgba(1, 10, 20, 0.85);
  border: 1px solid rgba(0, 245, 255, 0.3);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Barra de Combustible dentro del Drawer Móvil */
.mobile-fuel-bar-container {
  width: 100%;
  height: 16px;
  background: rgba(1, 10, 20, 0.85);
  border: 1px solid rgba(255, 170, 0, 0.35);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
}

.mobile-fuel-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff0055 0%, #ffaa00 35%, #00f5ff 100%);
  transition: width 0.25s ease-out;
}

.mobile-fuel-bar-fill.low {
  background: #ff0055 !important;
  box-shadow: 0 0 10px #ff0055;
  animation: pulse 0.8s infinite alternate;
}

.mobile-fuel-bar-text {
  position: relative;
  z-index: 2;
  font-family: 'Orbitron', monospace;
  font-size: 9px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.mobile-cargo-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #00f5ff 0%, #39ff14 70%, #ffaa00 95%, #ff007f 100%);
  transition: width 0.25s ease-out;
}

.mobile-cargo-bar-text {
  position: relative;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 4px #000;
  z-index: 2;
}

/* Grilla de minerales del drawer móvil */
.mobile-minerals-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 8px;
}

.mobile-mineral-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  border-left: 3px solid var(--neon-cyan);
}

.mobile-mineral-card .name {
  font-size: 10px;
  color: var(--text-dim);
  font-weight: bold;
}

.mobile-mineral-card .amount {
  font-size: 13px;
  font-weight: bold;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

/* 3. LEYENDA TÁCTIL AUTO-HIDE EN MÓVIL */
#hud-hints-mobile {
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 9px;
  color: var(--text-dim);
  letter-spacing: 0.8px;
  z-index: var(--z-hud-panels);
  pointer-events: none;
  opacity: 0.8;
  white-space: nowrap;
  animation: fadeOutHint 8s forwards;
}

@keyframes fadeOutHint {
  0% { opacity: 0.85; }
  70% { opacity: 0.85; }
  100% { opacity: 0.2; }
}
