/* ── PvP de la Liga Pokémon ──────────────────────────────────────────────── */

/* Overlay general (ventanas de desafío / selección / resultado) */
.pvp-overlay {
  position: fixed;
  inset: 0;
  z-index: 9400;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 15, 0.72);
  backdrop-filter: blur(3px);
}
.pvp-card {
  width: min(560px, 92vw);
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(160deg, #141c30, #0d1322);
  border: 1px solid #c9a227;
  border-radius: 14px;
  padding: 20px 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(201, 162, 39, 0.25), 0 0 60px rgba(248, 113, 113, 0.12);
  text-align: center;
  animation: pvp-card-in 0.25s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes pvp-card-in {
  from { transform: scale(0.9) translateY(10px); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.pvp-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 1.25rem;
  letter-spacing: 2px;
  color: #fbbf24;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.45);
  margin-bottom: 8px;
}
.pvp-sub {
  color: #e2e8f0;
  font-size: 0.92rem;
  margin: 4px 0;
  line-height: 1.4;
}
.pvp-section-label {
  margin: 14px 0 8px;
  font-size: 0.78rem;
  color: #94a3b8;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-weight: 700;
}
.pvp-meta {
  color: #94a3b8;
  font-size: 0.82rem;
  margin: 4px 0;
}
.pvp-timer {
  font-family: 'VT323', monospace;
  font-size: 1.4rem;
  color: #f87171;
  margin: 8px 0;
}

/* Formato */
.pvp-formats {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
}
.pvp-fmt-btn {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #fecaca;
  font-family: 'VT323', monospace;
  font-size: 1.05rem;
  padding: 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}
.pvp-fmt-btn:hover {
  background: rgba(248, 113, 113, 0.2);
  border-color: #f87171;
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.35);
  transform: scale(1.02);
}

/* Botones */
.pvp-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}
.pvp-btn {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 1px;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.pvp-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pvp-btn-green {
  background: linear-gradient(135deg, #22c55e, #15803d);
  color: #fff;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.4);
}
.pvp-btn-green:not(:disabled):hover { filter: brightness(1.15); transform: scale(1.04); }
.pvp-btn-red {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  color: #fff;
  box-shadow: 0 0 16px rgba(239, 68, 68, 0.4);
}
.pvp-btn-red:hover { filter: brightness(1.15); transform: scale(1.04); }
.pvp-btn-cancel {
  background: rgba(100, 116, 139, 0.2);
  color: #cbd5e1;
  border-color: rgba(148, 163, 184, 0.4);
  width: 100%;
  margin-top: 8px;
}
.pvp-btn-cancel:hover { background: rgba(100, 116, 139, 0.35); }

/* Grilla de selección de Pokémon */
.pvp-pk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin: 10px 0 4px;
}
.pvp-pk-card {
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(100, 116, 139, 0.35);
  border-radius: 10px;
  padding: 8px 6px;
  cursor: pointer;
  transition: all 0.12s;
  text-align: center;
}
.pvp-pk-card:hover { border-color: #60a5fa; box-shadow: 0 0 12px rgba(96, 165, 250, 0.25); transform: translateY(-2px); }
.pvp-pk-card.selected {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  box-shadow: 0 0 14px rgba(251, 191, 36, 0.35);
}
.pvp-pk-card.shiny .pvp-pk-name { color: #fbbf24; }
.pvp-pk-sprite {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pvp-pk-img {
  background-repeat: no-repeat;
  /* Sprite sheet overworld 4×4 (128×128): mostramos SOLO el frame 1
     (caminar hacia abajo, 32×32) ampliado al tamaño del contenedor. */
  background-size: 400% 400%;
  background-position: 0% 0%;
  image-rendering: pixelated;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.5));
}
.pvp-pk-img.pvp-pk-img-fallback {
  /* Fallback (showdown): imagen estática de una sola celda */
  background-size: cover;
  background-position: center;
}
.pvp-pk-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pvp-pk-meta { font-size: 0.62rem; color: #94a3b8; margin-top: 2px; }
.pvp-pk-type { font-size: 0.6rem; color: #60a5fa; margin-top: 2px; }

/* Banners (intro de combate, espera, desconexión, resultado pendiente) */
.pvp-banner {
  position: fixed;
  inset: 0;
  z-index: 9300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 8, 15, 0.85);
  backdrop-filter: blur(4px);
  pointer-events: none;
  animation: pvp-banner-in 0.3s ease;
}
@keyframes pvp-banner-in { from { opacity: 0; } to { opacity: 1; } }
.pvp-vs-intro { text-align: center; }
.pvp-vs-title {
  font-family: 'Cinzel', serif;
  font-weight: 900;
  font-size: 2.1rem;
  letter-spacing: 3px;
  color: #f87171;
  text-shadow: 0 0 30px rgba(248, 113, 113, 0.6);
  animation: pvp-blink 1.2s infinite;
}
@keyframes pvp-blink { 50% { opacity: 0.55; } }
.pvp-vs-names {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  margin: 18px 0;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #e2e8f0;
}
.pvp-vs-vs {
  font-family: 'VT323', monospace;
  font-size: 2rem;
  color: #fbbf24;
  text-shadow: 0 0 20px rgba(251, 191, 36, 0.7);
}
.pvp-vs-fmt {
  font-family: 'VT323', monospace;
  font-size: 1.3rem;
  color: #93c5fd;
  letter-spacing: 2px;
}
.pvp-vs-prep {
  margin-top: 12px;
  font-size: 0.85rem;
  color: #94a3b8;
  animation: pvp-blink 1.4s infinite;
}
.pvp-result-pending {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.35rem;
  color: #fbbf24;
  text-align: center;
}
.pvp-result-pending span {
  display: block;
  margin-top: 8px;
  font-size: 0.85rem;
  color: #94a3b8;
  font-family: 'Barlow', sans-serif;
  font-weight: 400;
}
.pvp-banner-win .pvp-result-pending { color: #4ade80; text-shadow: 0 0 24px rgba(74, 222, 128, 0.6); }
.pvp-banner-lose .pvp-result-pending { color: #f87171; text-shadow: 0 0 24px rgba(248, 113, 113, 0.6); }
.pvp-banner-warn .pvp-result-pending { color: #fbbf24; text-shadow: 0 0 24px rgba(251, 191, 36, 0.6); }

/* Barra de boss del PvP (reutiliza estilos de .gym-boss-bar) */
.pvp-boss-bar .gym-boss-bar-title { border-color: rgba(248, 113, 113, 0.4); }
.pvp-boss-bar .gym-boss-bar-fill {
  background: linear-gradient(90deg, #ef4444, #f87171) !important;
  box-shadow: 0 0 14px rgba(248, 113, 113, 0.7);
}


/* ══════════════════════════════════════════════════
   MOBILE RESPONSIVE (.device-mobile)
   ══════════════════════════════════════════════════ */
.device-mobile .pvp-card {
  padding: 14px 12px !important;
  max-height: 80vh !important;
}
.device-mobile .pvp-title {
  font-size: 1rem !important;
}
.device-mobile .pvp-sub {
  font-size: 0.78rem !important;
}
.device-mobile .pvp-pk-grid {
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)) !important;
  gap: 6px !important;
}
.device-mobile .pvp-pk-sprite {
  height: 60px !important;
}
.device-mobile .pvp-pk-name {
  font-size: 0.62rem !important;
}
.device-mobile .pvp-pk-meta {
  font-size: 0.55rem !important;
}
.device-mobile .pvp-pk-card {
  padding: 6px 4px !important;
}
.device-mobile .pvp-btn {
  min-height: 44px !important;
  padding: 10px 16px !important;
  font-size: 0.78rem !important;
}
.device-mobile .pvp-fmt-btn {
  min-height: 44px !important;
  font-size: 0.88rem !important;
}
.device-mobile .pvp-actions {
  flex-wrap: wrap !important;
  gap: 8px !important;
}
.device-mobile .pvp-vs-title {
  font-size: 1.5rem !important;
}
.device-mobile .pvp-vs-names {
  gap: 12px !important;
  font-size: 1rem !important;
}
.device-mobile .pvp-vs-vs {
  font-size: 1.4rem !important;
}
.device-mobile .pvp-vs-fmt {
  font-size: 1rem !important;
}
.device-mobile .pvp-section-label {
  font-size: 0.68rem !important;
}
