/* Animaciones y utilidades personalizadas */
@keyframes popIn {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes slideUp {
    0% { transform: translateY(100%); }
    100% { transform: translateY(0); }
}

@keyframes slideDown {
    0% { transform: translateY(0); }
    100% { transform: translateY(100%); }
}

@keyframes fadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes packShake {
    0%, 100% { transform: translate(-50%, -50%) rotate(0deg); }
    25% { transform: translate(-50%, -50%) rotate(-5deg); }
    50% { transform: translate(-50%, -50%) rotate(5deg); }
    75% { transform: translate(-50%, -50%) rotate(-5deg); }
}

@keyframes packOpenFade {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
}

@keyframes cardPopSequential {
    0% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.animate-pop {
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out forwards;
}

.animate-slide-down {
    animation: slideDown 0.4s ease-in forwards;
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

.animate-pack-intro {
    animation: packShake 0.4s ease-in-out 3;
}

.animate-pack-open {
    animation: packOpenFade 0.4s ease-out forwards;
}

.card-hidden {
    opacity: 0;
    transform: scale(0);
}

.card-pop-seq {
    animation: cardPopSequential 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* PREMIUM ANIMATIONS */
/* Fondo Animado */
@keyframes bgDrift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Efecto Flotante */
.animate-float {
    animation: float 4s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Efecto de Posicionamiento 3D (Al pegar carta) */
.animate-place-3d {
    animation: placeCard3D 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards, flashGlow 1.2s ease-out forwards;
    transform-style: preserve-3d;
}
@keyframes placeCard3D {
    0% { transform: scale(1.8) translateZ(100px) rotateY(90deg) translateY(-50px); opacity: 0; box-shadow: 0 20px 40px rgba(0,0,0,0.5); }
    50% { transform: scale(1.1) translateZ(50px) rotateY(-10deg) translateY(0); opacity: 1; box-shadow: 0 10px 20px rgba(0,0,0,0.4); }
    70% { transform: scale(0.95); }
    100% { transform: scale(1) translateZ(0) rotateY(0deg); box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
}

/* Resplandor épico al colocar */
@keyframes flashGlow {
    0% { box-shadow: 0 0 0 rgba(255,102,0, 0); }
    30% { box-shadow: 0 0 50px rgba(255,102,0, 1), 0 0 80px rgba(64,196,196, 0.8); z-index: 50; }
    100% { box-shadow: 0 5px 15px rgba(0,0,0,0.4); z-index: 10; }
}

/* Brillo pasando por la carta */
.sticker-shine {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 20;
}
.sticker-shine::after {
    content: '';
    position: absolute;
    top: 0; left: -150%; width: 100%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-30deg);
    animation: shineSwipe 4s infinite ease-in-out;
}
@keyframes shineSwipe {
    0%, 20% { transform: translateX(-100%) skewX(-30deg); }
    80%, 100% { transform: translateX(250%) skewX(-30deg); }
}

/* Explosión del sobre final (FIFA Style) */
.animate-pack-fifa-open {
    animation: fifaShake 1.8s ease-in-out forwards, fifaExplode 0.5s ease-out 1.8s forwards;
}

@keyframes fifaShake {
    0% { transform: scale(1) translate(-50%, -50%); filter: drop-shadow(0 0 20px #ff6600); }
    20% { transform: scale(1.05) translate(-48%, -50%) rotate(2deg); filter: drop-shadow(0 0 40px #ffd700) brightness(1.2); }
    40% { transform: scale(1.05) translate(-52%, -50%) rotate(-2deg); filter: drop-shadow(0 0 60px #ffd700) brightness(1.4); }
    60% { transform: scale(1.1) translate(-49%, -50%) rotate(1deg); filter: drop-shadow(0 0 80px #ffffff) brightness(1.6); }
    80% { transform: scale(1.1) translate(-51%, -50%) rotate(-1deg); filter: drop-shadow(0 0 120px #ffffff) brightness(1.8); }
    100% { transform: scale(1.2) translate(-50%, -50%); filter: drop-shadow(0 0 150px #ffffff) brightness(2); }
}

@keyframes fifaExplode {
    0% { transform: scale(1.2) translate(-50%, -50%); filter: brightness(2); opacity: 1; }
    50% { transform: scale(1.5) translate(-50%, -50%); filter: brightness(5) blur(10px); opacity: 0; }
    100% { transform: scale(0) translate(-50%, -50%); opacity: 0; display: none; }
}

/* FIFA Pack Opening Light Burst */
.fifa-flash {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, #ffffff 0%, rgba(255,215,0,0.8) 40%, transparent 80%);
    opacity: 0;
    pointer-events: none;
    z-index: 45;
}
.animate-fifa-flash {
    animation: fifaFlash 2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes fifaFlash {
    0% { opacity: 0; transform: scale(0.5); }
    10% { opacity: 1; transform: scale(1.5); filter: brightness(2); }
    30% { opacity: 1; transform: scale(2.5); filter: brightness(3); }
    100% { opacity: 0; transform: scale(4); filter: blur(20px); display: none; }
}

/* Light beams rotating */
.light-beams {
    position: absolute;
    top: 50%; left: 50%;
    width: 250vw; height: 250vw;
    background: repeating-conic-gradient(
        from 0deg,
        rgba(255, 102, 0, 0) 0deg 15deg,
        rgba(255, 215, 0, 0.15) 15deg 30deg
    );
    transform: translate(-50%, -50%);
    animation: spinSlow 15s linear infinite;
    z-index: 35;
    opacity: 0;
    transition: opacity 2s ease-in;
    pointer-events: none;
}
@keyframes spinSlow {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}
.show-beams {
    opacity: 1;
}

/* Animación de cartas volando en la secuencia final (Inspirado en Paper Pirouette) */
.card-fountain-seq {
    opacity: 0;
    transform-style: preserve-3d;
    animation: tumblingCard 1.2s cubic-bezier(.36,.07,.25,1) forwards;
}
@keyframes tumblingCard {
    0% { 
        transform: translateZ(500px) translateY(-150vh) rotateX(3turn) rotateY(1turn) rotateZ(-30deg); 
        opacity: 0; 
        box-shadow: 0 50px 100px rgba(0,0,0,0.8);
    }
    30% { 
        opacity: 1; 
    }
    70% { 
        transform: translateZ(100px) translateY(5vh) rotateX(0.1turn) rotateY(0.05turn) rotateZ(5deg); 
        box-shadow: 0 20px 50px rgba(255,102,0,0.6);
    }
    100% { 
        transform: translateZ(0) translateY(0) rotateX(0deg) rotateY(0deg) rotateZ(0deg); 
        opacity: 1; 
        box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    }
}

/* Glassmorphism premium */
.glass-panel {
    background: rgba(30, 30, 30, 0.6);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Estilos de la cancha usando el fondo completo de la app */
.pitch-bg {
    background: transparent;
    position: relative;
}

/* Ocultar scrollbar pero permitir scroll */
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Animación de giro lento para fondo */
.animate-spin-slow {
    animation: spinSlowBg 12s linear infinite;
}
@keyframes spinSlowBg {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* PANINI PACK ANIMATIONS */

.contenedor-sobre {
  perspective: 1000px;
}

.sobre {
  transform-style: preserve-3d;
  filter: drop-shadow(0 20px 30px rgba(255, 102, 0, 0.5));
}

.animate-panini-shake {
  animation: paniniShakeIntro 1.2s ease-in-out forwards;
}

.sobre.animate-panini-open .sobre-parte-superior {
  animation: paniniTearTop 0.8s ease-out forwards;
}

.sobre.animate-panini-open .sobre-parte-inferior {
  animation: paniniTearBottom 0.8s ease-out forwards;
}

.sobre.animate-panini-open .contenido-oculto {
  animation: paniniContentReveal 0.8s ease-out forwards;
}

.sobre-parte-superior {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 15%;
  background-image: url('sobre.png');
  background-size: 100% 100%;
  background-position: top;
  transform-origin: bottom;
  z-index: 3;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 0 85%);
  will-change: transform;
}

.sobre-parte-inferior {
  position: absolute;
  top: 15%;
  left: 0;
  width: 100%;
  height: 85%;
  background-image: url('sobre.png');
  background-size: 100% 100%;
  background-position: bottom;
  z-index: 2;
  will-change: transform;
  clip-path: polygon(0 0, 100% 17.6%, 100% 100%, 0 100%);
  margin-top: -15%;
  padding-top: 15%;
}

.contenido-oculto {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle, #fff 0%, rgba(255,255,255,0) 80%);
  opacity: 0;
}

@keyframes paniniShakeIntro {
    0%, 100% { transform: scale(1) rotate(0deg); }
    10%, 30%, 50%, 70%, 90% { transform: scale(1.05) rotate(-3deg); filter: drop-shadow(0 20px 40px rgba(255, 102, 0, 0.8)); }
    20%, 40%, 60%, 80% { transform: scale(1.05) rotate(3deg); filter: drop-shadow(0 20px 40px rgba(255, 102, 0, 0.8)); }
}

@keyframes paniniTearTop {
    0% { transform: translateY(0) rotateX(0); opacity: 1; }
    100% { transform: translateY(-100px) rotateX(70deg) rotateZ(10deg); opacity: 0; }
}

@keyframes paniniTearBottom {
    0% { transform: translateY(0) rotateX(0); opacity: 1; }
    100% { transform: translateY(200px) rotateX(-45deg) scale(0.9); opacity: 0; }
}

@keyframes paniniContentReveal {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 100px 50px white; }
    100% { opacity: 0; transform: scale(2); display: none; }
}

/* Indicador Bounce Horizontal */
.animate-bounce-horizontal {
    animation: bounceHorizontal 1.5s infinite;
}

@keyframes bounceHorizontal {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(25%); }
}
