/*
 * © 2026 EsReal — Propiedad Intelectual y Desarrollo Exclusivo.
 * Hoja de estilos modular · v7.1 (Pinche Charm 3D Flotante + Vestidor Multi-Capas + Tamagotchi)
 */

@keyframes pinche-bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.pinche-mini-bob {
  animation: pinche-bob 2.2s ease-in-out infinite;
}

@keyframes pinche-gift-glow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.55), 0 0 14px rgba(250, 204, 21, 0.28);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.9), 0 0 24px rgba(250, 204, 21, 0.55);
  }
}

.pinche-gift-ready {
  animation: pinche-gift-glow 1.5s ease-in-out infinite;
}

@keyframes pinche-super-glow {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.8), 0 0 22px rgba(52, 211, 153, 0.45), 0 0 34px rgba(168, 85, 247, 0.35);
  }
  50% {
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.9), 0 0 28px rgba(250, 204, 21, 0.65), 0 0 42px rgba(244, 114, 182, 0.42);
  }
}

.pinche-super-glow {
  animation: pinche-super-glow 2s ease-in-out infinite;
}

.pinche-canvas-frame {
  background: radial-gradient(circle at 50% 25%, #1E1C2A 0%, #090A10 100%);
  box-shadow: inset 0 0 28px rgba(0, 0, 0, 0.72), 0 12px 28px rgba(0, 0, 0, 0.55);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.pinche-guide-canvas-wrap {
  background: radial-gradient(circle at 50% 30%, #1F1B2C 0%, #0A0B11 100%);
  box-shadow: inset 0 0 22px rgba(0, 0, 0, 0.65);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}

.pinche-speech-bubble {
  position: relative;
}
.pinche-speech-bubble::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: inherit;
  border-right: 1px solid rgba(201, 164, 92, 0.4);
  border-bottom: 1px solid rgba(201, 164, 92, 0.4);
  transform: translateX(-50%) rotate(45deg);
}

.guide-answer-card {
  background: linear-gradient(155deg, rgba(24, 24, 34, 0.96) 0%, rgba(12, 13, 19, 0.98) 100%);
  border: 1px solid rgba(201, 164, 92, 0.38);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.guide-chip-btn {
  transition: transform 0.14s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.guide-chip-btn:active {
  transform: scale(0.95);
}

/* Compañero Flotante Vivo (Abajo a la derecha) */
.pinche-float-dock {
  position: fixed;
  bottom: 76px;
  right: max(10px, calc(50% - 205px));
  z-index: 42;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.pinche-float-dock > * {
  pointer-events: auto;
}

.pinche-float-orb {
  width: 68px;
  height: 68px;
  border-radius: 9999px;
  background: radial-gradient(circle at 35% 25%, rgba(45, 36, 62, 0.96), rgba(11, 12, 18, 0.96));
  border: 2px solid rgba(231, 203, 139, 0.78);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.65), 0 0 18px rgba(201, 164, 92, 0.28);
  overflow: hidden;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.pinche-float-orb:active {
  transform: scale(0.92);
}

.pinche-float-tucked {
  position: fixed;
  bottom: 84px;
  right: max(0px, calc(50% - 215px));
  z-index: 42;
}

.pinche-drag-snack-ghost {
  position: fixed;
  z-index: 98;
  pointer-events: none;
  font-size: 34px;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.75));
  transform: translate(-50%, -50%) scale(1.18);
}

.pinche-snack-chip {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

/* ==================== FASE 5 (v7.2): 🃏 ÁLBUM GOURMET BARRA (SOBRES & CARTAS HOLO 3D) ==================== */
@keyframes album-pack-float {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

.album-pack-sealed {
  animation: album-pack-float 2.4s ease-in-out infinite;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.72), 0 0 26px rgba(231, 203, 139, 0.35);
}

.album-pack-vip {
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.78), 0 0 32px rgba(168, 85, 247, 0.55), 0 0 18px rgba(250, 204, 21, 0.45);
}

@keyframes album-pack-shake {
  0%, 100% { transform: translateX(0) rotate(0deg) scale(1); }
  20% { transform: translateX(-6px) rotate(-4deg) scale(1.04); }
  40% { transform: translateX(6px) rotate(4deg) scale(1.06); }
  60% { transform: translateX(-5px) rotate(-3deg) scale(1.08); }
  80% { transform: translateX(5px) rotate(3deg) scale(1.1); }
}

.album-pack-tearing {
  animation: album-pack-shake 0.42s ease-in-out;
}

@keyframes album-holo-sweep {
  0% { background-position: -180% 0; }
  100% { background-position: 180% 0; }
}

.album-card-mythic {
  position: relative;
  overflow: hidden;
  border-color: #FDE047 !important;
  box-shadow: 0 0 18px rgba(250, 204, 21, 0.52), inset 0 0 12px rgba(253, 224, 71, 0.25);
}

.album-card-mythic::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 22%, rgba(254, 240, 138, 0.36) 44%, rgba(56, 189, 248, 0.28) 54%, rgba(244, 114, 182, 0.26) 62%, transparent 78%);
  background-size: 240% 100%;
  animation: album-holo-sweep 2.8s linear infinite;
}

.album-card-epic {
  border-color: #C084FC !important;
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.42);
}

.album-card-rare {
  border-color: #38BDF8 !important;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.28);
}

@keyframes album-card-flip-reveal {
  0% { transform: perspective(600px) rotateY(90deg) scale(0.86); opacity: 0.4; }
  60% { transform: perspective(600px) rotateY(-8deg) scale(1.05); opacity: 1; }
  100% { transform: perspective(600px) rotateY(0deg) scale(1); opacity: 1; }
}

.album-card-revealed {
  animation: album-card-flip-reveal 0.42s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ==================== FASE 6 (v7.3): PLANO REAL ARAVACA · SUPERVIVIENTES & DEFIENDE LA BARRA ==================== */
.floorplan-canvas-wrap {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.72), 0 12px 26px rgba(0, 0, 0, 0.6);
}

@keyframes f6-card-pop {
  0% { opacity: 0; transform: translateY(10px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.f6-upgrade-card {
  animation: f6-card-pop 0.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ==================== FASE 6.5 (v7.4): CONSOLA FIJA 100dvh + PLANO REAL PIXEL-NEÓN ARAVACA ==================== */
body.arena-locked {
  overflow: hidden !important;
  height: 100dvh !important;
  overscroll-behavior: none !important;
}

#gameArenaModal.arena-console-locked {
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

#gameArenaModal.arena-console-locked #arenaBodyScroll {
  padding: 6px 8px !important;
  overscroll-behavior: none !important;
}

/* Juegos con Canvas a Pantalla Completa (Supervivientes, Defiende la Barra, Golf, Pool, TetriPintxos) */
#gameArenaModal.arena-fullscreen-canvas #arenaBodyScroll {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  touch-action: none !important;
}

#gameArenaModal.arena-fullscreen-canvas #arenaBodyScroll > div:not(.hidden):not(#arenaWaitingRoomOverlay):not(#arenaStartCountdownModal):not(#blocksDragFloatingPiece):not(#arcadeActiveChallengeBanner) {
  flex: 1 1 auto;
  min-height: 0;
  display: flex !important;
  flex-direction: column !important;
}

.f6-full-stage-card {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.f6-canvas-flex-slot {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.f6-canvas-flex-slot canvas {
  max-width: 100% !important;
  max-height: 100% !important;
  width: auto !important;
  height: 100% !important;
  object-fit: contain;
}

/* Juegos de tablero compacto sin rebote táctil */
#gameArenaModal.arena-console-compact #arenaBodyScroll {
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

/* Fondo ambiental del Lobby del Salón Arcade con el Plano Real */
.lobby-floorplan-ambient {
  background-image:
    linear-gradient(155deg, rgba(11, 13, 22, 0.84) 0%, rgba(15, 17, 26, 0.90) 65%, rgba(11, 11, 16, 0.96) 100%),
    url('../assets/plano-barra-aravaca.webp?v=10.5');
  background-size: cover;
  background-position: center 42%;
}

/* Fondo radar táctico con el Plano Real para ¡Hundir la Comanda! */
.bs-floorplan-radar {
  background-image:
    linear-gradient(180deg, rgba(6, 18, 32, 0.72) 0%, rgba(5, 11, 22, 0.78) 100%),
    url('../assets/plano-barra-aravaca.webp?v=10.5') !important;
  background-size: cover !important;
  background-position: center center !important;
}

/* Mini-mapa indicador de mesa activa en ¡Oído Cocina! y Memoria de Comanda */
.oc-minimap-box {
  position: relative;
  width: 44px;
  height: 56px;
  border-radius: 10px;
  overflow: hidden;
  border: 1.5px solid rgba(231, 203, 139, 0.65);
  background-image: url('../assets/plano-barra-aravaca.webp?v=10.5');
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
  flex-shrink: 0;
}

@keyframes oc-ping-dot {
  0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.9); }
  50% { transform: translate(-50%, -50%) scale(1.35); box-shadow: 0 0 0 6px rgba(52, 211, 153, 0); }
}

.oc-minimap-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #34D399;
  border: 1.5px solid #FFFFFF;
  animation: oc-ping-dot 1s infinite ease-in-out;
  pointer-events: none;
}

/* Recortes reales del Plano en las cartas Leyendas del Álbum Gourmet */
.album-card-map-bg {
  position: relative;
  overflow: hidden;
}
.album-card-map-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/plano-barra-aravaca.webp?v=10.5');
  background-size: 240% auto;
  background-position: var(--map-pos, 50% 35%);
  opacity: 0.28;
  pointer-events: none;
}
.album-card-map-bg > * {
  position: relative;
  z-index: 1;
}

/* ==================== FASE 7.7-p1a: 🎭 MOTOR GLOBAL DE PERSONAJES 4×4 ==================== */
.hero-sprite-thumb {
  image-rendering: auto;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.55));
}

.hero-lobby-pill {
  background: linear-gradient(135deg, rgba(16, 20, 34, 0.92) 0%, rgba(11, 13, 22, 0.96) 100%);
  border: 1px solid rgba(231, 203, 139, 0.45);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

/* ==================== FASE 7.8-ULTRA: PANTALLA COMPLETA VERTICAL + HORIZONTAL + CARTAS NEÓN ==================== */
#gameArenaModal.arena-wide-viewport {
  max-width: 100vw !important;
  width: 100vw !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  background: #060810 !important;
}
/* Fase 7.9-ULTRA: 100% pantalla completa real (Vertical + Horizontal) sin barra modal superior */
#gameArenaModal.arena-wide-viewport > div:first-child {
  display: none !important;
}
#gameArenaModal.arena-wide-viewport #arenaBodyScroll {
  height: 100% !important;
  width: 100% !important;
}
#gameArenaModal.arena-wide-viewport #arenaStage-survivors:not(.hidden),
#gameArenaModal.arena-wide-viewport #arenaStage-towerdefense:not(.hidden) {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}
#gameArenaModal.arena-wide-viewport #arenaBodyScroll {
  padding: 0 !important;
  overflow: hidden !important;
}
#gameArenaModal.arena-wide-viewport .f6-full-stage-card {
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
  gap: 0 !important;
  border-radius: 0 !important;
  border-width: 0 !important;
  background: #060810 !important;
}
#gameArenaModal.arena-wide-viewport .f6-canvas-flex-slot {
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  border-width: 0 !important;
}
#gameArenaModal.arena-wide-viewport .f6-canvas-flex-slot canvas {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  display: block;
}

/* Modo Horizontal Forzado (Respaldo CSS para iOS Safari / escritorio cuando orientation.lock no aplica) */
#gameArenaModal.arena-wide-viewport.arena-force-landscape {
  position: fixed !important;
  width: 100dvh !important;
  height: 100vw !important;
  max-width: 100dvh !important;
  max-height: 100vw !important;
  top: 50% !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translate(-50%, -50%) rotate(90deg) !important;
  transform-origin: center center !important;
}

/* HUD Flotante Translúcido sobre el Canvas */
.f8-hud-glass {
  background: rgba(8, 11, 20, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.f8-action-orb {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.f8-action-orb:active {
  transform: scale(0.90);
}
.f8-action-orb-sm {
  width: 46px;
  height: 46px;
}

/* Cartas Tácticas Neón de Mejora (Level-Up & Cofre Dorado) */
@keyframes f8-card-enter {
  0% { opacity: 0; transform: translateY(16px) scale(0.94); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.f8-upgrade-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 10px 12px;
  text-align: left;
  animation: f8-card-enter 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}
.f8-upgrade-card:active {
  transform: scale(0.97);
}
.f8-rarity-common {
  background: linear-gradient(135deg, rgba(16, 26, 44, 0.96), rgba(10, 14, 24, 0.98));
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.18);
}
.f8-rarity-rare {
  background: linear-gradient(135deg, rgba(12, 36, 30, 0.96), rgba(9, 16, 22, 0.98));
  border: 1.5px solid rgba(52, 211, 153, 0.72);
  box-shadow: 0 0 20px rgba(52, 211, 153, 0.22);
}
.f8-rarity-epic {
  background: linear-gradient(135deg, rgba(38, 16, 56, 0.96), rgba(13, 12, 26, 0.98));
  border: 1.5px solid rgba(192, 132, 252, 0.78);
  box-shadow: 0 0 22px rgba(192, 132, 252, 0.26);
}
.f8-rarity-evo {
  background: linear-gradient(135deg, rgba(66, 42, 8, 0.96), rgba(34, 14, 48, 0.98));
  border: 2px solid #FDE047;
  box-shadow: 0 0 26px rgba(250, 204, 21, 0.45);
}

/* Ajuste automático en modo Paisaje (nativo o forzado) para cartas en fila horizontal */
@media (orientation: landscape) {
  #survUpgradeChoicesList {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  #survUpgradeChoicesList > * + * {
    margin-top: 0 !important;
  }
}
#gameArenaModal.arena-force-landscape #survUpgradeChoicesList {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
#gameArenaModal.arena-force-landscape #survUpgradeChoicesList > * + * {
  margin-top: 0 !important;
}

@keyframes f6-countdown-pulse {
  0% { transform: scale(1.65); opacity: 0.15; }
  45% { transform: scale(1.0); opacity: 1; }
  100% { transform: scale(0.92); opacity: 0.95; }
}
.f6-countdown-num {
  animation: f6-countdown-pulse 0.62s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ==================== FASE 7.9-ULTRA: MICRO-HUD ESQUINA SUPERIOR + PANTALLA 100% ==================== */
.f9-stats-corner {
  position: absolute;
  top: max(6px, env(safe-area-inset-top));
  left: max(6px, env(safe-area-inset-left));
  z-index: 20;
  width: 168px;
  padding: 5px 7px;
  border-radius: 12px;
  background: rgba(7, 10, 19, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(231, 203, 139, 0.28);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  pointer-events: none;
}
.f9-controls-corner {
  position: absolute;
  top: max(6px, env(safe-area-inset-top));
  right: max(6px, env(safe-area-inset-right));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 4px;
}
.f9-ctrl-btn {
  height: 30px;
  min-width: 30px;
  padding: 0 7px;
  border-radius: 10px;
  background: rgba(7, 10, 19, 0.74);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #F4F4F5;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.42);
}
.f9-ctrl-btn:active {
  transform: scale(0.92);
}
.f9-skill-orb {
  width: 60px;
  height: 60px;
  border-radius: 9999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s ease, opacity 0.15s ease;
}
.f9-skill-orb:active {
  transform: scale(0.9);
}

/* En Horizontal (nativo o forzado), micro-HUD aún más estilizado arriba a la izquierda */
@media (orientation: landscape) {
  .f9-stats-corner {
    width: 190px;
    padding: 4px 8px;
  }
}
#gameArenaModal.arena-force-landscape .f9-stats-corner {
  width: 190px;
  padding: 4px 8px;
}

/* ==================== FASE 8.0-A: BOTONES BRAWL-STARS MULTITÁCTILES + EDITOR DE CONTROLES ==================== */
.bs-hud-btn {
  position: absolute;
  border-radius: 9999px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.68), inset 0 2px 1px rgba(255, 255, 255, 0.48), inset 0 -3px 6px rgba(0, 0, 0, 0.45);
  transition: transform 0.08s ease, box-shadow 0.14s ease, filter 0.14s ease;
  overflow: hidden;
  z-index: 32;
}
.bs-hud-btn:active,
.bs-hud-btn.is-pressed {
  transform: scale(0.89);
}
.bs-hud-btn .bs-cd-sweep {
  position: absolute;
  inset: 0;
  border-radius: 9999px;
  pointer-events: none;
}
.bs-hud-btn.is-ready-ult {
  animation: bs-ult-pulse 1.35s infinite ease-in-out;
}
@keyframes bs-ult-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.85), 0 0 22px rgba(250, 204, 21, 0.65), inset 0 2px 1px rgba(255,255,255,0.5); }
  50% { box-shadow: 0 0 0 5px rgba(253, 224, 71, 0.25), 0 0 32px rgba(250, 204, 21, 0.92), inset 0 2px 1px rgba(255,255,255,0.65); }
}

/* Modo Editor Drag & Drop de Controles */
.bs-hud-btn.is-editing {
  outline: 2.5px dashed #38BDF8;
  outline-offset: 3px;
  cursor: grab;
  z-index: 48;
}
.bs-hud-btn.is-editing-selected {
  outline: 3px solid #FACC15;
  outline-offset: 4px;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.85);
}
.bs-radar-movable.is-editing {
  outline: 2.5px dashed #38BDF8;
  outline-offset: 2px;
  cursor: grab;
}

/* ==================== FASE 8.0-B: APUNTADO TÁCTIL BRAWL-STARS (DASH / ULTIMATE) ==================== */
.bs-hud-btn.is-aiming {
  transform: scale(1.10) !important;
  box-shadow: 0 0 0 3px #FDE047, 0 0 28px rgba(250, 204, 21, 0.92), inset 0 2px 2px rgba(255,255,255,0.7) !important;
  z-index: 44;
}
.bs-hud-btn.is-aim-cancel {
  transform: scale(0.95) !important;
  box-shadow: 0 0 0 3px #FB7185, 0 0 24px rgba(244, 63, 94, 0.90) !important;
  filter: saturate(1.3) !important;
}

/* ==================== FASE 8.1: INTEGRACIÓN GLOBAL PERSONAJES 3D ==================== */
@keyframes hero-react-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.16) translateY(-2px); }
  100% { transform: scale(1); }
}
.hero-react-pop {
  animation: hero-react-pop 0.34s cubic-bezier(0.22, 1, 0.36, 1);
}
.hero-fever-ring {
  box-shadow: 0 0 0 2px #FACC15, 0 0 14px rgba(250, 204, 21, 0.72) !important;
  border-color: #FDE047 !important;
}


/* ==================== FASE 2 (v9.1): 🎨 DECORACIÓN ESTACIONAL EN TIEMPO REAL + AMULETOS 3D HD ==================== */
.seasonal-particles-canvas {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  pointer-events: none;
  z-index: 26;
}

.seasonal-garland-wire {
  display: flex;
  align-items: center;
  justify-content: space-around;
  width: 100%;
  padding: 2px 10px 3px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35), transparent);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

@keyframes seasonal-bulb-twinkle {
  0%, 100% { opacity: 0.45; transform: scale(0.88); }
  50% { opacity: 1; transform: scale(1.18); }
}

.seasonal-bulb {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: var(--bulb-col, #FDE047);
  box-shadow: 0 0 8px var(--bulb-col, #FDE047), 0 0 14px var(--bulb-col, #FDE047);
  animation: seasonal-bulb-twinkle 2.1s ease-in-out infinite;
}

/* Paletas y marcos temáticos sutiles por campaña */
[data-season="navidad"] #appShell > #mainApp > header {
  border-bottom-color: rgba(239, 68, 68, 0.48);
  background: linear-gradient(180deg, rgba(38, 12, 16, 0.94), rgba(11, 11, 14, 0.92));
}
[data-season="navidad"] #mainStampCardBox {
  box-shadow: 0 0 26px rgba(239, 68, 68, 0.16), 0 0 18px rgba(250, 204, 21, 0.14);
}
.seasonal-greeting-navidad {
  background: linear-gradient(135deg, rgba(127, 29, 29, 0.45), rgba(20, 48, 30, 0.42), rgba(20, 20, 24, 0.96));
  border-color: rgba(253, 224, 71, 0.55);
}

[data-season="sanvalentin"] #appShell > #mainApp > header {
  border-bottom-color: rgba(244, 63, 94, 0.50);
  background: linear-gradient(180deg, rgba(44, 12, 24, 0.94), rgba(11, 11, 14, 0.92));
}
[data-season="sanvalentin"] #mainStampCardBox {
  box-shadow: 0 0 28px rgba(244, 63, 94, 0.22);
  border-color: rgba(251, 113, 133, 0.60) !important;
}
.seasonal-greeting-sanvalentin {
  background: linear-gradient(135deg, rgba(136, 19, 55, 0.48), rgba(28, 14, 24, 0.95));
  border-color: rgba(251, 113, 133, 0.55);
}

[data-season="sanisidro"] #appShell > #mainApp > header {
  border-bottom-color: rgba(236, 72, 153, 0.45);
  background: linear-gradient(180deg, rgba(40, 14, 28, 0.93), rgba(11, 11, 14, 0.92));
}
[data-season="sanisidro"] #mainStampCardBox {
  box-shadow: 0 0 24px rgba(244, 114, 182, 0.18);
}
.seasonal-greeting-sanisidro {
  background: linear-gradient(135deg, rgba(131, 24, 67, 0.42), rgba(20, 38, 28, 0.42), rgba(20, 20, 24, 0.95));
  border-color: rgba(244, 114, 182, 0.55);
}

[data-season="verano"] #appShell > #mainApp > header {
  border-bottom-color: rgba(56, 189, 248, 0.48);
  background: linear-gradient(180deg, rgba(12, 34, 48, 0.93), rgba(11, 11, 14, 0.92));
}
[data-season="verano"] #mainStampCardBox {
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.18), 0 0 18px rgba(251, 146, 60, 0.14);
}
.seasonal-greeting-verano {
  background: linear-gradient(135deg, rgba(14, 116, 144, 0.40), rgba(154, 52, 18, 0.35), rgba(20, 20, 24, 0.95));
  border-color: rgba(56, 189, 248, 0.52);
}

[data-season="halloween"] #appShell > #mainApp > header {
  border-bottom-color: rgba(249, 115, 22, 0.52);
  background: linear-gradient(180deg, rgba(44, 18, 56, 0.94), rgba(11, 11, 14, 0.92));
}
[data-season="halloween"] #mainStampCardBox {
  box-shadow: 0 0 28px rgba(249, 115, 22, 0.20), 0 0 20px rgba(168, 85, 247, 0.18);
  border-color: rgba(251, 146, 60, 0.55) !important;
}
.seasonal-greeting-halloween {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.48), rgba(154, 52, 18, 0.42), rgba(18, 15, 24, 0.96));
  border-color: rgba(249, 115, 22, 0.60);
}

@media (prefers-reduced-motion: reduce) {
  .seasonal-bulb {
    animation: none !important;
    opacity: 0.85 !important;
  }
}

/* ==================== FASE v9.2: ASISTENTE FLOTANTE ARRASTRABLE + EMOTES AMULETOS ==================== */
.pinche-float-dock {
  transition: left 0.26s cubic-bezier(0.22, 1, 0.36, 1), right 0.26s cubic-bezier(0.22, 1, 0.36, 1), bottom 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
  contain: layout style;
}
.pinche-float-dock.pinche-dock-dragging {
  transition: none !important;
}
.pinche-float-orb {
  will-change: transform;
}
.pinche-float-dock.pinche-dock-left {
  align-items: flex-start;
}
.pinche-float-orb {
  touch-action: none;
  cursor: grab;
}
.pinche-dock-dragging .pinche-float-orb {
  cursor: grabbing;
  transform: scale(1.08);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.78), 0 0 24px rgba(250, 204, 21, 0.55);
}
.pinche-float-tucked.pinche-tucked-left {
  border-radius: 0 1rem 1rem 0 !important;
  border-left-width: 0 !important;
  border-right-width: 1px !important;
  padding-left: 0.375rem !important;
  padding-right: 0.625rem !important;
}


/* ==================== FASE 5 (v9.5): COMIDA 3D GLOSSY + ARRASTRE ELÁSTICO + EMOTES + CONCIERGE ==================== */
.pinche-drag-snack-ghost {
  position: fixed;
  z-index: 98;
  pointer-events: none;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: radial-gradient(circle at 30% 25%, rgba(254, 240, 138, 0.34), rgba(15, 23, 42, 0.16) 70%, transparent 100%);
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.72));
  transform: translate(-50%, -50%) scale(1.18);
  transition: transform 0.08s cubic-bezier(0.22, 1, 0.36, 1), filter 0.12s ease;
  will-change: left, top, transform;
}
.pinche-drag-snack-ghost.over-target {
  filter: drop-shadow(0 0 18px rgba(250, 204, 21, 0.92));
}
.pinche-snack-chip {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  position: relative;
  overflow: hidden;
}
.pinche-snack-chip.is-favorite {
  border-color: rgba(250, 204, 21, 0.78) !important;
  background: linear-gradient(160deg, rgba(250, 204, 21, 0.16), rgba(16, 18, 28, 0.95)) !important;
  box-shadow: 0 0 14px rgba(250, 204, 21, 0.22);
}
.pinche-snack-chip.dragging-src {
  opacity: 0.42;
  transform: scale(0.92);
}
.pinche-food-svg-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.55));
}
.pinche-canvas-frame.snack-hover-target {
  border-color: #FDE047 !important;
  box-shadow: 0 0 0 2px rgba(250, 204, 21, 0.55), 0 0 28px rgba(250, 204, 21, 0.42), inset 0 0 28px rgba(250, 204, 21, 0.18) !important;
}
.pinche-emote-drawer {
  background: linear-gradient(180deg, rgba(16, 18, 28, 0.98), rgba(10, 11, 18, 0.98));
  border: 1px solid rgba(201, 164, 92, 0.42);
}

/* ==================== FASE 5.1 (v9.5): ESTUDIO PANTALLA COMPLETA 50/50 + MODO 82% + FONDO INTERACTIVO ==================== */
#gameArenaModal.arena-pinche-fixed {
  height: 100dvh !important;
  max-height: 100dvh !important;
  width: 100vw !important;
  max-width: 100vw !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #07080D !important;
}
/* En el Estudio de Amuletos ocultamos la cabecera global de Arena para aprovechar el 100% de la pantalla */
#gameArenaModal.arena-pinche-fixed > div:first-child {
  display: none !important;
}
#gameArenaModal.arena-pinche-fixed #arenaGearDrawer,
#gameArenaModal.arena-pinche-fixed #arenaModeSetupBar,
#gameArenaModal.arena-pinche-fixed #arenaCasinoSharedBar,
#gameArenaModal.arena-pinche-fixed #arenaUniversalVsBar,
#gameArenaModal.arena-pinche-fixed #arenaMultiScoreStrip {
  display: none !important;
}
#gameArenaModal.arena-pinche-fixed #arenaBodyScroll {
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  padding: 0 !important;
  margin: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overscroll-behavior: none !important;
}
#gameArenaModal.arena-pinche-fixed #arenaStage-pinche:not(.hidden) {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}
.pinche-studio-shell {
  --pinche-stage-pct: 50%;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #08090F;
}
.pinche-studio-shell.layout-split50 { --pinche-stage-pct: 50%; }
.pinche-studio-shell.layout-stage60 { --pinche-stage-pct: 58%; }
.pinche-studio-shell.layout-compact { --pinche-stage-pct: 42%; }
.pinche-studio-shell.layout-ultracompact { --pinche-stage-pct: 38%; }
.pinche-studio-shell.sheet-collapsed { --pinche-stage-pct: 83%; }

/* MITAD SUPERIOR: ESCENARIO 3D INTERACTIVO DE BORDE A BORDE */
.pinche-stage-hero {
  position: relative;
  flex: 0 0 var(--pinche-stage-pct);
  height: var(--pinche-stage-pct);
  min-height: 190px;
  width: 100%;
  overflow: hidden;
  background: #090A12;
  transition: flex-basis 0.28s cubic-bezier(0.22, 1, 0.36, 1), height 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
#pincheCanvasFrameBox.pinche-hero-canvas-box {
  position: relative;
  width: 100%;
  height: 100%;
  border: none !important;
  border-radius: 0 !important;
  overflow: hidden;
}
#pincheCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  touch-action: none;
}
.pinche-stage-top-hud {
  position: absolute;
  top: max(8px, env(safe-area-inset-top));
  left: 8px;
  right: 8px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}
.pinche-stage-top-hud > * {
  pointer-events: auto;
}
.pinche-glass-pill {
  background: rgba(9, 10, 18, 0.66);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}
.pinche-stage-speech-float {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 34px;
  z-index: 16;
  pointer-events: none;
  display: flex;
  justify-content: center;
}
.pinche-stage-speech-float > div {
  max-width: 94%;
  background: rgba(9, 11, 18, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 164, 92, 0.48);
  pointer-events: auto;
}
.pinche-stage-bottom-hud {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 7px;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  pointer-events: none;
}
.pinche-stage-bottom-hud button {
  pointer-events: auto;
}

/* MITAD INFERIOR: PANEL DE AJUSTES (SKINS / COMIDA / OBJETOS / ASISTENTE) */
.pinche-bottom-sheet {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: linear-gradient(180deg, #131521 0%, #0C0D14 100%);
  border-top: 1.5px solid rgba(201, 164, 92, 0.45);
  border-top-left-radius: 22px;
  border-top-right-radius: 22px;
  margin-top: -10px;
  z-index: 25;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.55);
  padding-bottom: env(safe-area-inset-bottom);
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.pinche-bottom-sheet.pinche-feeding-dim {
  opacity: 0.42;
}
.pinche-sheet-handle-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px 4px;
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.pinche-sheet-pill {
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: rgba(231, 203, 139, 0.55);
}
.pinche-sheet-tabs {
  flex: 0 0 auto;
  padding: 2px 10px 6px;
}
.pinche-sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0 10px 8px;
}
.pinche-studio-shell.sheet-collapsed .pinche-sheet-body {
  display: none !important;
}
.pinche-studio-scroll-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(201, 164, 92, 0.45) transparent;
}
#pincheWardrobeCats {
  touch-action: pan-x pan-y;
  -webkit-overflow-scrolling: touch;
}
#pincheWardrobeGrid {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  align-content: start;
}
.pinche-look-slot-btn.is-filled {
  border-color: rgba(201, 164, 92, 0.65);
  background: linear-gradient(135deg, rgba(201, 164, 92, 0.18), rgba(14, 16, 26, 0.92));
}
.pinche-toy-btn.is-active {
  border-color: #34D399 !important;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.28), rgba(6, 78, 59, 0.45)) !important;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.28);
}
@media (min-width: 640px) {
  .pinche-bottom-sheet {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
  }
}


/* ==================== v9.7 · FLUIDEZ 60 FPS, ADMIN TOTAL VISIBLE Y SCROLL PRO ==================== */
html {
  -webkit-overflow-scrolling: touch;
}
body.admin-fullscreen-open {
  overflow: hidden !important;
  overscroll-behavior: none;
}

/* Scroll táctil ultra-fluido en todos los paneles desplazables */
.barra-smooth-scroll,
#adminScrollBody,
#arenaBodyScroll,
.pinche-studio-scroll-pane,
#pincheWardrobeGrid {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}

/* Admin a pantalla completa real (100vw x 100dvh en móvil, workspace amplio en tablet/PC) */
#adminPanelModal.admin-fullscreen-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  background: #08080B;
  padding: 0;
  z-index: 86;
}
#adminPanelModal.admin-fullscreen-modal .admin-fs-shell {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100dvh;
  border-radius: 0;
  border: 0;
  background: #09090D;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

/* Barra de pestañas Admin: nunca se aplasta, autodesplazamiento suave en móvil, 10 visibles a la vez en tablet/PC */
.admin-tabs-wrap {
  position: relative;
  flex: 0 0 auto;
  background: #111116;
  border-bottom: 1px solid #272730;
}
#adminTabsBar {
  flex: 0 0 auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  scroll-snap-type: x proximity;
}
#adminTabsBar > button {
  scroll-snap-align: center;
  flex-shrink: 0;
}
.admin-tabs-fade-r {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 26px;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(17, 17, 22, 0), rgba(17, 17, 22, 0.96));
}
@media (min-width: 768px) {
  #adminTabsBar {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: flex-start;
  }
  .admin-tabs-fade-r {
    display: none;
  }
}

/* Franja KPI rápida en vivo en cabecera Admin */
.admin-kpi-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 12px;
  background: linear-gradient(90deg, rgba(20, 21, 30, 0.96), rgba(13, 14, 20, 0.98));
  border-bottom: 1px solid rgba(201, 164, 92, 0.22);
  -webkit-overflow-scrolling: touch;
}
.admin-kpi-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #E4E4E7;
  transition: transform 0.12s ease, border-color 0.15s ease;
}
.admin-kpi-pill:active {
  transform: scale(0.94);
}

#adminPanelModal.admin-fullscreen-modal #adminScrollBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  contain: layout style;
}
#adminPanelModal.admin-fullscreen-modal .admin-fs-inner {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 14px 92px 14px;
}
#adminPanelModal .admin-view-pane {
  contain: layout style;
}

/* Índice sticky de salto rápido en 9. Ajustes + barra sticky de guardado en vivo */
.admin-settings-jumpbar {
  position: sticky;
  top: 0;
  z-index: 15;
  margin: -6px -4px 6px -4px;
  padding: 7px 6px;
  background: rgba(9, 9, 13, 0.94);
  border-bottom: 1px solid rgba(201, 164, 92, 0.26);
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.admin-sticky-savebar {
  position: sticky;
  bottom: 8px;
  z-index: 16;
  padding: 8px 10px;
  border-radius: 16px;
  background: rgba(14, 15, 22, 0.96);
  border: 1.5px solid rgba(201, 164, 92, 0.55);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* Optimización de listas largas en Admin (cero lag con muchos socios / artículos) */
#adminMembersList > div,
#adminShopItemsList > div {
  content-visibility: auto;
  contain-intrinsic-size: auto 180px;
}

@media (min-width: 768px) {
  #adminPanelModal.admin-fullscreen-modal .admin-fs-inner {
    padding: 18px 26px 92px 26px;
  }
  #adminPanelModal.admin-fullscreen-modal #adminMembersList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: start;
  }
  #adminPanelModal.admin-fullscreen-modal #adminMembersList > * + * {
    margin-top: 0 !important;
  }
  #adminPanelModal.admin-fullscreen-modal #adminShopItemsList {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    align-items: start;
  }
  #adminPanelModal.admin-fullscreen-modal #adminShopItemsList > * + * {
    margin-top: 0 !important;
  }
}

#mainApp > main > section {
  contain: layout style;
}


/* ==================== FASE v9.8: ASISTENTE INFERIOR VIVO · ASOMADO INTELIGENTE · CELEBRACIÓN ==================== */
@keyframes pinche-tucked-peek-right {
  0%, 100% { transform: translateX(0); box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 0 10px rgba(250,204,21,0.35); }
  50% { transform: translateX(-7px); box-shadow: 0 8px 24px rgba(0,0,0,0.65), 0 0 22px rgba(250,204,21,0.75); }
}
@keyframes pinche-tucked-peek-left {
  0%, 100% { transform: translateX(0); box-shadow: 0 6px 18px rgba(0,0,0,0.55), 0 0 10px rgba(250,204,21,0.35); }
  50% { transform: translateX(7px); box-shadow: 0 8px 24px rgba(0,0,0,0.65), 0 0 22px rgba(250,204,21,0.75); }
}
.pinche-float-tucked.pinche-tucked-peek {
  border-color: rgba(253, 224, 71, 0.92) !important;
  animation: pinche-tucked-peek-right 2.4s ease-in-out infinite;
}
.pinche-float-tucked.pinche-tucked-left.pinche-tucked-peek {
  animation: pinche-tucked-peek-left 2.4s ease-in-out infinite;
}
@keyframes pinche-orb-celebrate-ring {
  0% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0.95), 0 10px 26px rgba(0,0,0,0.65); }
  60% { box-shadow: 0 0 0 14px rgba(52, 211, 153, 0.0), 0 12px 30px rgba(250,204,21,0.55); }
  100% { box-shadow: 0 0 0 0 rgba(250, 204, 21, 0), 0 10px 26px rgba(0,0,0,0.65); }
}
.pinche-float-orb.pinche-orb-celebrate {
  animation: pinche-orb-celebrate-ring 0.95s ease-out 2;
}


/* ==================== FASE v9.9: ADMIN PRO ORDENADO + FASE 3 FIDELIZACIÓN + AMULETO FLUIDO ==================== */
/* Capa GPU dedicada para el amuleto flotante (fluido sin pausas durante el scroll) */
.pinche-float-dock,
.pinche-float-orb {
  will-change: transform;
}

@keyframes p3-chest-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(250, 204, 21, 0.5), 0 0 18px rgba(250, 204, 21, 0.25); }
  50% { box-shadow: 0 0 0 2px rgba(253, 224, 71, 0.9), 0 0 26px rgba(52, 211, 153, 0.35); }
}
.p3-chest-glow {
  animation: p3-chest-pulse 1.9s ease-in-out infinite;
}

/* Admin Pro v9.9: Layout limpio con barra lateral en PC/tablet y 4 grupos claros en móvil */
.admin-pro-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.admin-pro-sidebar {
  display: none;
}
.admin-pro-mobile-nav {
  flex: 0 0 auto;
  background: #101118;
  border-bottom: 1px solid #272730;
  padding: 7px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}
.admin-cat-btn {
  padding: 6px 4px;
  border-radius: 11px;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  border: 1px solid #272730;
  background: #161720;
  color: #A1A1AA;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-cat-btn:active {
  transform: scale(0.96);
}
.admin-cat-btn.is-active {
  background: rgba(201, 164, 92, 0.20);
  border-color: rgba(231, 203, 139, 0.72);
  color: #FDE68A;
}
.admin-subtabs-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1px;
}
.admin-subtab-btn {
  flex-shrink: 0;
  padding: 6px 11px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  background: #171822;
  border: 1px solid #272730;
  color: #D4D4D8;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.admin-subtab-btn.is-active {
  background: #C9A45C;
  border-color: #E7CB8B;
  color: #09090D;
  box-shadow: 0 3px 12px rgba(201, 164, 92, 0.28);
}

@media (min-width: 768px) {
  .admin-pro-workspace {
    flex-direction: row;
  }
  .admin-pro-mobile-nav {
    display: none !important;
  }
  .admin-pro-sidebar {
    display: flex;
    flex-direction: column;
    flex: 0 0 228px;
    width: 228px;
    background: #0E0F15;
    border-right: 1px solid #272730;
    overflow-y: auto;
    padding: 12px 10px 24px;
    gap: 12px;
  }
  .admin-side-group-title {
    font-size: 9.5px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #71717A;
    padding: 0 8px 4px;
  }
  .admin-side-btn {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 11px;
    font-size: 12px;
    font-weight: 700;
    color: #D4D4D8;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid transparent;
    transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
  }
  .admin-side-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #FFFFFF;
  }
  .admin-side-btn.is-active {
    background: linear-gradient(90deg, rgba(201, 164, 92, 0.24), rgba(201, 164, 92, 0.10));
    border-color: rgba(231, 203, 139, 0.55);
    color: #FDE68A;
    font-weight: 800;
  }
}

/* Acordeones y Cajones Limpios en Admin Pro v9.9 */
details.adm-acc,
details.adm-add-drawer {
  border-radius: 16px;
  background: #141418;
  border: 1px solid #272730;
  overflow: hidden;
  transition: border-color 0.18s ease;
}
details.adm-acc[open],
details.adm-add-drawer[open] {
  border-color: rgba(201, 164, 92, 0.45);
}
details.adm-acc > summary,
details.adm-add-drawer > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  user-select: none;
  font-size: 12px;
  font-weight: 800;
  color: #F4F4F6;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent);
}
details.adm-acc > summary::-webkit-details-marker,
details.adm-add-drawer > summary::-webkit-details-marker {
  display: none;
}
details.adm-acc > summary::after,
details.adm-add-drawer > summary::after {
  content: '▾';
  color: #C9A45C;
  font-size: 13px;
  font-weight: 900;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}
details.adm-acc[open] > summary::after,
details.adm-add-drawer[open] > summary::after {
  transform: rotate(180deg);
}
.adm-acc-body {
  padding: 0 14px 14px;
  border-top: 1px solid rgba(39, 39, 48, 0.7);
  padding-top: 12px;
}
.adm-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(39, 39, 48, 0.85);
}


/* ==================== FASE v10.1: SCROLL NATIVO 60–120 FPS (CERO FLECHAS) + FASE 4 CURACIÓN ==================== */
/* Cabecera y navegación inferior sobre capa GPU fija sin parpadeo de backdrop-filter */
.barra-gpu-bar {
  transform: translateZ(0);
  contain: paint;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
header.barra-gpu-bar {
  background-color: rgba(11, 11, 14, 0.96) !important;
}
nav.barra-gpu-bar {
  background-color: rgba(14, 14, 19, 0.97) !important;
}

/* Bloqueo limpio del fondo cuando hay un modal / arena / vestidor abierto */
body.modal-scroll-lock {
  overflow: hidden !important;
  overscroll-behavior: none;
}
[id$="Modal"],
[id$="Overlay"] {
  overscroll-behavior: contain;
}

/* Fase v10.5: sin content-visibility en listas medias para eliminar saltos de altura */
#gameCenterCatalogGrid .gc-card,
#groupMenusContainer > *,
#eventsList > *,
.p4-curation-row {
  content-visibility: visible;
  contain: layout style;
}

/* Barras horizontales con scroll-snap táctil fluido */
.barra-hscroll-snap {
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
}
.barra-hscroll-snap > * {
  scroll-snap-align: start;
}

/* Degradado lateral discreto en franjas horizontales de filtros */
.barra-hscroll-fade {
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 90%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 90%, transparent 100%);
  padding-right: 18px;
}

/* Fase 4: Carrusel superior Recomendados BaRRa + Cajón «Ver más juegos» */
.p4-featured-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 6px;
}
.p4-featured-card {
  flex: 0 0 144px;
  width: 144px;
}
details.p4-more-games-drawer > summary {
  list-style: none;
}
details.p4-more-games-drawer > summary::-webkit-details-marker {
  display: none;
}
details.p4-more-games-drawer[open] .p4-drawer-chevron {
  background: rgba(201, 164, 92, 0.28);
}

/* ==================== FASE v10.1: FAVORITOS, JUEGO SEMANA, SORPRÉNDEME Y ETIQUETAS ==================== */
.p4-fav-card {
  flex: 0 0 132px;
  width: 132px;
}
.p4-heart-btn {
  background: rgba(12, 13, 18, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.p4-heart-btn.is-fav {
  background: rgba(244, 63, 94, 0.22);
  border-color: rgba(251, 113, 133, 0.65);
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.25);
}
@keyframes p4HeartPop {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.26); }
  100% { transform: scale(1); }
}
.p4-heart-pop {
  animation: p4HeartPop 0.28s ease-out;
}
.p4-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #d4d4d8;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.4;
}
.p4-gow-card {
  box-shadow: 0 10px 28px rgba(201, 164, 92, 0.16);
}

/* ==================== FASE v10.5: FLUIDEZ GLOBAL + AMULETO CIRCULAR SIEMPRE VIVO ==================== */
/* Sin contain: paint para no recortar en cuadrado el brillo ni el flotado del amuleto */
.pinche-float-dock {
  contain: layout style;
  overflow: visible;
}
.pinche-float-orb {
  border-radius: 9999px !important;
  aspect-ratio: 1 / 1;
  padding: 0 !important;
  overflow: hidden;
  isolation: isolate;
}
#pincheFloatCanvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  border-radius: 9999px !important;
  clip-path: circle(50% at 50% 50%);
}
#gameCenterCatalogGrid .gc-card {
  box-shadow: 0 4px 12px -4px rgba(0, 0, 0, 0.48);
}
#gameCenterCatalogGrid .gc-card::after {
  display: none;
}
#notificationsModal,
#qrModal,
#prizeModal,
#pwaModal,
#editProfileModal,
#staffPinModal,
#quickScanModal,
#smartReviewModal,
#privacyModal,
#whatsappShareModal,
#duelAcceptModal,
#giftFriendModal,
#pincheGuideModal,
#albumCardInspectModal,
#esrealModal,
#heroSelectorModal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: rgba(5, 6, 10, 0.88) !important;
}

/* ==================== FASE v10.5: CABECERA INSTAGRAM GPU + SCROLL NATIVO FLUIDO ==================== */
html,
body {
  height: 100%;
}
body.barra-main-viewport-lock {
  overflow: hidden;
  overscroll-behavior: none;
}
#appShell.barra-main-viewport-lock {
  height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0 !important;
  overflow: hidden;
}
#mainApp.barra-main-shell {
  position: relative;
  flex: 1 1 0%;
  min-height: 0;
  overflow: hidden;
  padding-bottom: 0 !important;
  --barra-hdr-h: 68px;
}
#appMainScroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  scroll-behavior: auto !important;
  padding-top: calc(var(--barra-hdr-h, 68px) + 14px) !important;
  padding-bottom: calc(34px + env(safe-area-inset-bottom, 0px));
}

/* Cabecera estilo Instagram / YouTube: 100% GPU (transform), 0 reflows y CERO recortes de insignias */
#appMainHeader {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 32;
  transform: translate3d(0, 0, 0);
  transition: transform 230ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 200ms ease;
  will-change: transform;
}
#appMainHeader.is-elevated {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.48);
}
#appMainHeader.is-hidden-ig {
  transform: translate3d(0, calc(-100% - 4px), 0);
  box-shadow: none;
  pointer-events: none;
}
#appMainHeader .barra-hdr-subrow {
  max-height: none;
  overflow: visible;
}

/* Anillo dorado de progreso al mantener pulsado 0.5 s sobre Tarjeta (QR rápido) */
.barra-lp-ring {
  position: absolute;
  inset: -6px;
  border-radius: 9999px;
  border: 2px solid transparent;
  pointer-events: none;
  opacity: 0;
  transform: scale(0.72);
}
#nav-card.is-longpressing .barra-lp-ring {
  border-color: rgba(231, 203, 139, 0.92);
  box-shadow: 0 0 12px rgba(231, 203, 139, 0.55);
  animation: barraLpRingGrow 480ms cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}
@keyframes barraLpRingGrow {
  0%   { opacity: 0.25; transform: scale(0.75); }
  75%  { opacity: 1; transform: scale(1.16); }
  100% { opacity: 1; transform: scale(1.24); }
}

/* Barra inferior nativa fuera del contenedor de scroll (1 toque siempre, incluso en inercia) */
#appBottomNav {
  position: relative;
  flex-shrink: 0;
  z-index: 35;
  width: 100%;
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(16, 16, 22, 0.98), rgba(10, 10, 14, 0.99)) !important;
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.5);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.barra-nav-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
}
.barra-nav-pill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(231, 203, 139, 0.22), rgba(201, 164, 92, 0.08));
  border: 1px solid rgba(231, 203, 139, 0.4);
  box-shadow: 0 4px 16px rgba(201, 164, 92, 0.16), inset 0 1px 0 rgba(255, 240, 200, 0.2);
  pointer-events: none;
  transform: translate3d(0, 0, 0);
  transition: transform 230ms cubic-bezier(0.22, 1, 0.36, 1), width 230ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.barra-nav-btn {
  position: relative;
  z-index: 1;
  min-height: 54px;
  padding: 6px 2px;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #8b8b99;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 140ms ease, transform 100ms cubic-bezier(0.22, 1, 0.36, 1);
  cursor: pointer;
}
.barra-nav-btn:active,
.barra-nav-btn.is-pressing {
  transform: scale(0.91);
}
@media (hover: hover) {
  .barra-nav-btn:not(.is-active):hover {
    color: #e4e4e7;
  }
}
.barra-nav-btn.is-active {
  color: #E7CB8B;
}
.barra-nav-ico {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  transition: transform 240ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.barra-nav-btn.is-active .barra-nav-ico {
  transform: translateY(-1px) scale(1.14);
  filter: drop-shadow(0 0 8px rgba(231, 203, 139, 0.38));
}
.barra-nav-lbl {
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.01em;
}
.barra-nav-btn.is-active .barra-nav-lbl {
  font-weight: 800;
}
.barra-nav-dot {
  position: absolute;
  top: -2px;
  right: -7px;
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background: #F59E0B;
  border: 1.5px solid #0E0E13;
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.85);
  pointer-events: none;
}
.barra-nav-dot.dot-emerald {
  background: #34D399;
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.85);
}
.barra-nav-dot.dot-rose {
  background: #FB7185;
  box-shadow: 0 0 8px rgba(251, 113, 133, 0.9);
}

/* Sub-pestañas segmentadas con píldora deslizante (Menús y Club) */
.barra-seg-bar {
  position: relative;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
}
.barra-seg-pill {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #C9A45C, #E7CB8B);
  box-shadow: 0 3px 12px rgba(201, 164, 92, 0.34);
  pointer-events: none;
  transform: translate3d(4px, 0, 0);
  transition: transform 210ms cubic-bezier(0.22, 1, 0.36, 1), width 210ms cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.barra-seg-btn {
  position: relative;
  z-index: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: color 140ms ease, transform 100ms ease;
}
.barra-seg-btn:active {
  transform: scale(0.95);
}
.barra-seg-btn.is-active {
  color: #09090B !important;
  font-weight: 800 !important;
}
@media (hover: hover) {
  .barra-seg-btn:not(.is-active):hover {
    color: #ffffff;
  }
}

/* Fundido ultrarrápido 115ms (cero desplazamiento pesado de capa en móviles) */
@keyframes barraTabFadeIn {
  0% { opacity: 0.25; }
  100% { opacity: 1; }
}
.barra-tab-fade-in {
  animation: barraTabFadeIn 115ms ease-out both;
}
#eventCalendarModal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: rgba(5, 6, 10, 0.88) !important;
}
@media (prefers-reduced-motion: reduce) {
  .barra-tab-fade-in {
    animation: none !important;
  }
  .barra-nav-pill,
  .barra-seg-pill {
    transition: none !important;
  }
}

/* Respeto de área segura para el Amuleto flotante sobre la nueva barra inferior */
.pinche-float-dock {
  bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
}
.pinche-float-tucked {
  bottom: calc(88px + env(safe-area-inset-bottom, 0px)) !important;
}


/* ==================== CENTRO DE NOTIFICACIONES PRO (v10.8) ==================== */
.barra-notif-sheet {
  height: 78vh;
  height: 78dvh;
  max-height: 680px;
  min-height: 460px;
  transform: translate3d(0, 0, 0);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
  will-change: transform;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 640px) {
  .barra-notif-sheet {
    height: min(640px, 84vh);
    height: min(640px, 84dvh);
    max-height: 680px;
    min-height: 480px;
    padding-bottom: 0;
  }
}
.barra-notif-sheet.is-dragging {
  transition: none !important;
}
.barra-notif-drag-zone {
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: grab;
}
.barra-notif-drag-zone:active {
  cursor: grabbing;
}
.barra-notif-handle-pill {
  width: 40px;
  height: 4px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.22);
  transition: background-color 150ms ease, width 150ms ease;
}
.barra-notif-drag-zone:active .barra-notif-handle-pill {
  width: 52px;
  background: rgba(201, 164, 92, 0.72);
}
.barra-notif-tab-btn {
  height: 40px;
  min-height: 40px;
  line-height: 1;
  white-space: nowrap;
}
.barra-notif-feed {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
}
@keyframes barraNotifSlideLeft {
  0% { opacity: 0.35; transform: translate3d(14px, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
@keyframes barraNotifSlideRight {
  0% { opacity: 0.35; transform: translate3d(-14px, 0, 0); }
  100% { opacity: 1; transform: translate3d(0, 0, 0); }
}
.barra-notif-anim-left {
  animation: barraNotifSlideLeft 160ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.barra-notif-anim-right {
  animation: barraNotifSlideRight 160ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.barra-notif-date-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
}
.barra-notif-date-sep::before,
.barra-notif-date-sep::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}
.barra-notif-date-sep span {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a1a1aa;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
}
.barra-notif-chip {
  height: 28px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 10px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0D0D11;
  color: #a1a1aa;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}
.barra-notif-chip.is-active {
  background: rgba(201, 164, 92, 0.18);
  border-color: rgba(201, 164, 92, 0.55);
  color: #E7CB8B;
}
@media (prefers-reduced-motion: reduce) {
  .barra-notif-sheet,
  .barra-notif-anim-left,
  .barra-notif-anim-right {
    animation: none !important;
    transition: none !important;
  }
}
