/* ============================================================
   DRAGON PATH — mobile/dp-mobile.css  v20260817-m01
   ------------------------------------------------------------
   Versión MÓVIL del juego. TODAS las reglas viven bajo el scope
   `html.dp-mobile` (lo añade mobile/dp-mobile.js cuando detecta
   pantalla pequeña). No se modifica ningún archivo de escritorio:
   esto es una capa de presentación puramente aditiva.

   Objetivos:
     - Barra de control (BALANCE/APUESTA/RETIRAR) a todo el ancho.
     - Panel izquierdo (MÚSICA/DIFICULTAD) compacto en esquina.
     - Panel de multiplicadores convertido en hoja colapsable.
     - Botones táctiles >= 44px (Apple HIG / WCAG 2.5.5).
     - Overlays (victoria, ruleta, video) a pantalla completa segura.
     - Respeta notch / barras del sistema (safe-area-inset).
   ============================================================ */

/* ---------- Base: nunca scroll horizontal ni zoom no deseado --- */
html.dp-mobile,
html.dp-mobile body {
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: manipulation;            /* sin doble-tap-zoom accidental */
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}

/* Safe areas (notch iPhone / barra gestual Android) */
html.dp-mobile {
  --dp-safe-t: env(safe-area-inset-top, 0px);
  --dp-safe-b: env(safe-area-inset-bottom, 0px);
  --dp-safe-l: env(safe-area-inset-left, 0px);
  --dp-safe-r: env(safe-area-inset-right, 0px);
}

/* ---------- Barra de navegación superior (compacta) ---------- */
html.dp-mobile nav.fixed.top-0 {
  height: 48px !important;
  padding-left: calc(10px + var(--dp-safe-l)) !important;
  padding-right: calc(10px + var(--dp-safe-r)) !important;
  padding-top: var(--dp-safe-t) !important;
}
html.dp-mobile nav .font-cinzel-decorative { font-size: 13px !important; letter-spacing: 1px !important; }
html.dp-mobile nav .flex.items-center.gap-8 { gap: 10px !important; }
html.dp-mobile nav button.font-cinzel.text-xs {
  font-size: 9px !important;
  letter-spacing: 1px !important;
  min-height: 32px;                      /* táctil */
  padding: 4px 2px !important;
}
html.dp-mobile nav .flex.items-center.gap-4 { gap: 10px !important; }
html.dp-mobile nav .flex.items-center.gap-4 button {
  min-width: 34px; min-height: 34px;     /* iconos sonido/info táctiles */
}

/* ---------- HUD izquierdo: MÚSICA + DIFICULTAD (compacto) ------ */
html.dp-mobile .absolute.left-4.top-20.w-44 {
  top: calc(52px + var(--dp-safe-t)) !important;
  left: calc(8px + var(--dp-safe-l)) !important;
  width: 118px !important;
  transform: scale(.82);
  transform-origin: top left;
}
html.dp-mobile .absolute.left-4.top-20.w-44 button { min-height: 34px; }
html.dp-mobile .absolute.left-4.top-20.w-44 .text-xs { font-size: 9px !important; }

/* ---------- HUD derecho: tabla de MULTIPLICADORES ---------------
   En móvil el panel de 192×442 taparía el tablero. Lo convertimos
   en una "hoja" colapsada que muestra solo la cabecera + nivel
   actual; al tocarla se despliega (clase .dp-mm-open, la añade el
   listener de más abajo inyectado vía dp-mobile.js). -------------- */
html.dp-mobile .absolute.right-4.top-20.w-48 {
  top: calc(52px + var(--dp-safe-t)) !important;
  right: calc(8px + var(--dp-safe-r)) !important;
  width: 128px !important;
  height: 118px !important;              /* colapsado por defecto */
  max-height: 118px !important;
  overflow: hidden !important;
  border-radius: 12px !important;
  transition: height .28s ease, max-height .28s ease;
  cursor: pointer;
}
html.dp-mobile .absolute.right-4.top-20.w-48.dp-mm-open {
  height: auto !important;
  max-height: 62vh !important;           /* desplegado */
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
}
html.dp-mobile .absolute.right-4.top-20.w-48::after {
  content: '▾';
  position: absolute; right: 8px; top: 6px;
  font-size: 11px; color: #ffd700; opacity: .9;
  pointer-events: none;
}
html.dp-mobile .absolute.right-4.top-20.w-48.dp-mm-open::after { content: '▴'; }

/* ---------- Barra de control inferior (BALANCE/APUESTA/RETIRAR)
   De 678px fijos a full-width apilada en 2 filas. ---------------- */
html.dp-mobile .absolute.bottom-6.left-1\/2.-translate-x-1\/2 {
  left: calc(8px + var(--dp-safe-l)) !important;
  right: calc(8px + var(--dp-safe-r)) !important;
  bottom: calc(8px + var(--dp-safe-b)) !important;
  transform: none !important;
  width: auto !important;
  max-width: none !important;
  padding: 10px 12px !important;
  border-radius: 14px !important;
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}
/* Fila de cifras (balance / apuesta / premio) ocupa todo el ancho */
html.dp-mobile .absolute.bottom-6 .flex.items-center.gap-6,
html.dp-mobile .absolute.bottom-6 .flex.items-center.gap-4 {
  gap: 12px !important;
  flex: 1 1 100%;
  justify-content: space-between;
}
html.dp-mobile .absolute.bottom-6 .text-xs { font-size: 9px !important; letter-spacing: 1px !important; }
html.dp-mobile .absolute.bottom-6 .text-lg,
html.dp-mobile .absolute.bottom-6 .text-xl { font-size: 15px !important; }
/* Botones de apuesta (+/-) y RETIRAR táctiles */
html.dp-mobile .absolute.bottom-6 button {
  min-height: 46px !important;
  min-width: 46px !important;
  font-size: 12px !important;
}
html.dp-mobile .absolute.bottom-6 button.relative.ml-2 {
  margin-left: 0 !important;
  flex: 1 1 100%;
  padding: 12px !important;
  font-size: 14px !important;
  letter-spacing: 2px !important;
}

/* ---------- Elementos flotantes del tablero -------------------- */
/* Orbe de compra (posición % viene de dp-patch DEF_POS) */
html.dp-mobile #dp-buy-orb { transform: scale(.8); transform-origin: bottom left; }
/* Medallón BONUS */
html.dp-mobile #dp-bonus-medallion { width: 64px !important; height: 64px !important; font-size: 10px !important; }

/* ---------- Overlays a pantalla completa segura ----------------- */
html.dp-mobile #dp-win-celebration .dp-win-title   { font-size: 34px !important; }
html.dp-mobile #dp-win-celebration .dp-win-amount  { font-size: 42px !important; }
html.dp-mobile #dp-win-celebration .dp-win-mult    { font-size: 13px !important; padding: 0 16px; text-align: center; }
html.dp-mobile #dp-win-celebration .dp-win-continue {
  width: min(84vw, 340px) !important;
  min-height: 52px !important;
  font-size: 15px !important;
}
html.dp-mobile #dp-bonus-video-overlay video { object-fit: cover; }
html.dp-mobile #dp-roulette-overlay .dp-roulette-wrap,
html.dp-mobile #dp-roulette-overlay canvas { max-width: 92vw !important; }
html.dp-mobile #dp-wallet-error {
  font-size: 12px !important;
  top: calc(52px + var(--dp-safe-t)) !important;
  border-radius: 10px;
}

/* ---------- Home: tipografía y CTA escalados ------------------- */
html.dp-mobile h1.font-cinzel-decorative { font-size: 34px !important; line-height: 1.1 !important; padding: 0 18px; text-align: center; }
html.dp-mobile p.font-cinzel.text-base   { font-size: 12px !important; padding: 0 22px; text-align: center; }
html.dp-mobile p.font-cormorant          { font-size: 13px !important; padding: 0 26px; text-align: center; }
html.dp-mobile button.btn-gold {
  min-height: 50px !important;
  padding: 12px 30px !important;
  font-size: 15px !important;
}

/* ---------- Pantalla de carga ----------------------------------- */
html.dp-mobile #dp-loading .dp-pct { font-size: 15px !important; }
html.dp-mobile #dp-loading-fill    { width: 72vw !important; }

/* ---------- Landscape muy bajo (móvil tumbado): HUD en línea ---- */
html.dp-mobile @media (max-height: 480px) { }
@media (max-height: 480px) {
  html.dp-mobile .absolute.left-4.top-20.w-44 { transform: scale(.7); }
  html.dp-mobile .absolute.right-4.top-20.w-48 { max-height: 90px; }
  html.dp-mobile .absolute.bottom-6 .flex.items-center.gap-6 { flex: 1 1 auto; }
  html.dp-mobile .absolute.bottom-6 button.relative.ml-2 { flex: 0 0 auto; min-width: 130px; }
}
