/* ============================================
   SECCIONES DE SORTEO (Headers por horario)
   ============================================ */
.sorteo-section {
    margin-bottom: 2rem;
}

.sorteo-header {
    font-size: 1.125rem;
    font-weight: 700;
    color: #4c1d95;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.75rem 1rem;
    background: linear-gradient(90deg, #ede9fe, #f3e8ff, transparent);
    border-left: 4px solid #7c3aed;
    border-radius: 0 0.5rem 0.5rem 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sorteo-header i {
    color: #7c3aed;
    flex-shrink: 0;
}

/* ============================================
   GRID DE CARDS - OPTIMIZADO CLS
   ============================================ */
.sorteo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    min-height: 320px; /* ← NUEVO: Reserva espacio para evitar layout shift */
}

/* ============================================
   CARD DE JUEGO - OPTIMIZADO CLS
   ============================================ */
.game-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
    padding: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #ede9fe;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 280px; /* ← NUEVO: Altura mínima fija para evitar shifts */
    will-change: transform; /* ← NUEVO: Optimiza animaciones */
}

.game-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2);
}

/* ============================================
   SKELETON LOADER - NUEVO PARA CLS
   ============================================ */
.game-card.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite ease-in-out;
    pointer-events: none;
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton-line {
    height: 20px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-bottom: 10px;
}

.skeleton-circle {
    width: 48px;
    height: 48px;
    background: #e0e0e0;
    border-radius: 50%;
}

/* ============================================
   HEADER DE LA CARD
   ============================================ */
.game-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.game-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 52px; /* ← NUEVO: Reserva espacio para logo */
}

.game-name {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e1b4b;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.game-logo {
    height: 52px;
    width: 52px; /* ← NUEVO: Width fijo */
    object-fit: contain;
    flex-shrink: 0; /* ← NUEVO: No se encoge */
}

/* ============================================
   META (fecha / hora)
   ============================================ */
.game-meta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    min-height: 20px; /* ← NUEVO: Altura mínima */
}

.game-date,
.game-time {
    font-size: 0.8rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.game-date i,
.game-time i {
    color: #a78bfa;
    width: 16px; /* ← NUEVO: Width fijo para iconos */
    height: 16px; /* ← NUEVO: Height fijo para iconos */
}

/* ============================================
   BOLAS DE NÚMEROS - OPTIMIZADO
   ============================================ */
.numeros-container {
    text-align: center;
    padding: 0.5rem 0;
    min-height: 120px; /* ← NUEVO: Altura mínima */
}

.numeros-titulo {
    font-size: 0.7rem;
    font-weight: 700;
    color: #6d28d9;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
    height: 16px; /* ← NUEVO: Altura fija */
}

.numeros-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    min-height: 60px; /* ← NUEVO: Altura mínima */
}

.juga3-numero {
    text-align: center;
    padding: 0.5rem 0;
    min-height: 120px; /* ← NUEVO: Altura mínima */
}

.juga3-numero .numeros-individuales {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

/* La bola base */
.bola {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 8px rgba(124, 58, 237, 0.35);
    animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
    flex-shrink: 0; /* ← NUEVO: No se encoge */
}

.bola.texto {
    width: auto;
    min-width: 48px;
    padding: 0 0.75rem;
    font-size: 0.85rem;
    background: linear-gradient(135deg, #6d28d9, #9333ea);
    border-radius: 24px;
}

/* ============================================
   ANIMACIONES - OPTIMIZADO RENDIMIENTO
   ============================================ */
@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.4);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* ← NUEVO: Reduce animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
    .bola,
    .game-card,
    .skeleton {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   ESTADO "PENDIENTE" / "PRÓXIMAMENTE"
   ============================================ */
.pendiente {
    text-align: center;
    color: #9ca3af;
    font-style: italic;
    padding: 1rem 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    min-height: 60px; /* ← NUEVO: Altura mínima */
}

.estado-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #f3e8ff;
    color: #7c3aed;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.75rem;
    border-radius: 999px;
    height: 28px; /* ← NUEVO: Altura fija */
}

/* ============================================
   MENSAJES DE ERROR / INFO
   ============================================ */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
    font-size: 1rem;
    min-height: 80px; /* ← NUEVO: Altura mínima */
}

.error-message i {
    color: #dc2626;
    width: 24px; /* ← NUEVO: Width fijo */
    height: 24px; /* ← NUEVO: Height fijo */
}

/* ============================================
   RESPONSIVE: pantallas pequeñas
   ============================================ */
@media (max-width: 480px) {
    .sorteo-grid {
        grid-template-columns: 1fr;
        min-height: 300px; /* ← Ajustado para móvil */
    }

    .bola {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .game-card {
        padding: 1rem;
        min-height: 260px; /* ← Ajustado para móvil */
    }

    .sorteo-header {
        font-size: 0.95rem;
    }
    
    .game-title-row {
        min-height: 48px; /* ← Ajustado para móvil */
    }
}

/* ============================================
   OPTIMIZACIÓN GPU - NUEVO
   ============================================ */
.game-card,
.bola {
    transform: translateZ(0); /* ← Activa aceleración GPU */
    backface-visibility: hidden;
}

