body {
    background-color: var(--color-fondo);
    font-family: 'Poppins', sans-serif;
    padding-bottom: 100px;
}

.main-container { max-width: 800px; margin-top: 30px; }

/* Efecto Cristal */
.glass-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    border: 1px solid rgba(255,255,255,0.5);
}

.hero-img { width: 100%; max-height: 350px; object-fit: cover; border-radius: 10px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.logo-loteria-img { height: 40px; width: auto; object-fit: contain; border-radius: 5px; }

.premio-box {
    background-color: rgba(255,255,255,0.7);
    border-left: 4px solid #ffc107;
    padding: 8px;
    margin-bottom: 5px;
    border-radius: 4px;
}

/* PRECIO EN LINEA */
.precio-badge-inline {
    color: #2e7d32;
    background-color: #e8f5e9;
    border: 2px solid #2e7d32;
    font-size: 0.95rem;
    font-weight: 800;
    padding: 6px 15px;
    border-radius: 50px;
    white-space: nowrap;
    display: inline-block;
}

/* --- GRILLA DE NÚMEROS (MODIFICADO) --- */
.grid-numeros {
    display: flex;        /* Flex para respetar tamaño fijo */
    flex-wrap: wrap;      /* Permite que bajen de línea */
    justify-content: center; /* Centra el bloque de números */
    gap: 4px;             /* Espacio pequeño entre números */
    padding: 10px;
}

.ticket {
    width: 32px !important;   /* ANCHO FIJO */
    height: 32px !important;  /* ALTO FIJO */
    
    display: flex;
    justify-content: center;
    align-items: center;
    
    font-weight: 700; 
    font-size: 0.8rem; /* Letra ajustada al tamaño 32px */
    border-radius: 4px; /* Bordes ligeramente redondeados */
    cursor: pointer;
    
    background-color: var(--color-libre);
    border: 1px solid #ccc;
    
    /* SOMBRA ELIMINADA */
    box-shadow: none !important; 
    
    transition: transform 0.1s, background 0.2s;
    position: relative;
    overflow: hidden;
    color: #444;
}

.ticket:hover { transform: scale(1.1); z-index: 2; border-color: #999; }

/* Estados */
.ticket.seleccionado, .ticket.seleccionado:hover, .ticket.seleccionado:active {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
    /* Sin sombra tampoco aquí para mantener estilo plano, o una muy sutil interna */
}

.ticket.reservado, .ticket.pagado { 
    background-color: var(--color-ocupado) !important; 
    cursor: not-allowed; 
    color: transparent; 
    border-color: var(--color-ocupado);
}

/* Marca de Agua (Texto AM, etc) */
.ticket.reservado::after, .ticket.pagado::after {
    position: absolute;
    color: var(--marca-agua-color);
    font-size: 0.85rem; /* Ajustado para que quepa en 32px */
    font-weight: 900;
    opacity: 0.9;
    /* El contenido se inyecta desde el HTML/PHP */
}

/* Botón Flotante Compra */
.fab-container {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    z-index: 1000; display: none; width: 90%; max-width: 400px;
}
.btn-fab {
    width: 100%; background: #25D366; color: white; padding: 15px;
    border-radius: 50px; border: none; font-size: 1.2rem; font-weight: bold;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    display: flex; align-items: center; justify-content: center; gap: 10px;
}

/* Botón Soporte Esquina */
.btn-soporte-flotante {
    position: fixed; bottom: 20px; right: 20px;
    background: #128C7E; color: white; padding: 10px 20px;
    border-radius: 50px; font-weight: bold; text-decoration: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3); z-index: 999;
    transition: transform 0.2s;
}
.btn-soporte-flotante:hover { transform: scale(1.1); color: white; }

/* Leyenda */
.dot { height: 12px; width: 12px; display: inline-block; border-radius: 50%; margin-right: 5px; }
.dot.libre { background: #fff; border: 1px solid #ccc; }
.dot.reservado { background: var(--color-ocupado); }
.dot.seleccionado { background: #0d6efd; }

/* ── Panel TODAS VENDIDAS (Sorteo Completo) ── */
.sold-out-panel {
    animation: soldOutFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 10px 0 25px 0;
}

@keyframes soldOutFadeIn {
    0% { opacity: 0; transform: translateY(20px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.sold-out-card {
    background: linear-gradient(135deg, #0a4d2e 0%, #15803d 50%, #064e3b 100%);
    border-radius: var(--card-radius, 24px);
    padding: 40px 24px;
    text-align: center;
    color: #ffffff;
    box-shadow: 0 20px 45px rgba(10, 77, 46, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sold-out-card::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sold-out-card::after {
    content: '';
    position: absolute;
    bottom: -60px;
    left: -60px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(37, 211, 102, 0.25) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}

.sold-out-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 215, 0, 0.4);
    color: #fef08a;
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 7px 18px;
    border-radius: 50px;
    margin-bottom: 18px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 2;
}

.sold-out-title-wrap {
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.sold-out-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 900;
    font-size: clamp(2rem, 6vw, 2.8rem);
    letter-spacing: -0.5px;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.1;
    background: linear-gradient(180deg, #ffffff 0%, #d1fae5 70%, #86efac 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.35));
}

.sold-out-subtitle {
    font-size: 0.95rem;
    color: #e2e8f0;
    max-width: 480px;
    margin: 0 auto 20px;
    line-height: 1.5;
    font-weight: 400;
    opacity: 0.95;
    position: relative;
    z-index: 2;
}

.sold-out-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
    position: relative;
    z-index: 2;
}

.sold-out-chip {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #ffffff;
}

.btn-sold-out-ws {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #25D366;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 10px 22px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    transition: all 0.2s ease;
    position: relative;
    z-index: 2;
}

.btn-sold-out-ws:hover {
    background: #20ba59;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
}

.btn-sold-out-search {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: #0a4d2e;
    font-weight: 800;
    font-size: 0.95rem;
    padding: 12px 28px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25), 0 0 15px rgba(255, 255, 255, 0.4);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 2;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn-sold-out-search:hover {
    background: #f8fafc;
    color: #064e3b;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35), 0 0 20px rgba(255, 255, 255, 0.6);
}

.btn-sold-out-search i {
    color: #15803d;
    font-size: 1rem;
}

/* ==========================================================================
   AJUSTE DE MODALES EN DISPOSITIVOS MÓVILES (EVITAR QUE EL TECLADO LOS TAPE)
   ========================================================================== */
@media (max-width: 768px) {
    .modal.fade .modal-dialog,
    .modal-dialog.modal-dialog-centered,
    #modalCompra .modal-dialog,
    #modalStatus .modal-dialog,
    #modalError .modal-dialog {
        display: flex !important;
        align-items: flex-start !important;
        margin: 20px auto !important;
        margin-top: 25px !important;
        min-height: auto !important;
        max-width: 92% !important;
    }
}

/* ==========================================================================
   BARRA DE PROGRESO FOMO ULTRA PREMIUM
   ========================================================================== */
.fomo-progress-box {
    background: linear-gradient(145deg, #ffffff, #f8fafc);
    border: 1px solid #e2e8f0;
    border-radius: 18px;
    padding: 14px 18px;
    margin: 16px 0 10px 0;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05), 0 2px 6px -2px rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.fomo-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.fomo-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fef2f2;
    border: 1px solid #fee2e2;
    color: #b91c1c;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.live-dot {
    width: 7px;
    height: 7px;
    background-color: #ef4444;
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: livePulse 1.6s infinite;
}

@keyframes livePulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.fomo-pct-badge {
    font-size: 0.82rem;
    font-weight: 800;
    color: #0f172a;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.3px;
}

.fomo-pct-badge span {
    color: #ea580c;
    font-size: 0.95rem;
}

.fomo-track {
    width: 100%;
    height: 16px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.12);
}

.fomo-fill {
    height: 100%;
    border-radius: 50px;
    background: linear-gradient(90deg, #f59e0b 0%, #ea580c 50%, #dc2626 100%);
    background-size: 200% 100%;
    position: relative;
    transition: width 1.2s cubic-bezier(0.34, 1.3, 0.64, 1);
    box-shadow: 0 0 12px rgba(234, 88, 12, 0.5);
    animation: gradientMove 3s ease infinite;
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.fomo-fill::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.25) 25%,
        transparent 25%,
        transparent 50%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0.25) 75%,
        transparent 75%,
        transparent
    );
    background-size: 20px 20px;
    animation: progressStripes 1s linear infinite;
}

@keyframes progressStripes {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.fomo-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; bottom: 0; width: 40px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.85), transparent);
    animation: lightSheen 2.2s infinite;
}

@keyframes lightSheen {
    0% { left: -40px; }
    100% { left: 100%; }
}

.fomo-progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    font-size: 0.8rem;
    color: #64748b;
    flex-wrap: wrap;
    gap: 4px;
}

.fomo-stat-sold {
    font-weight: 600;
    display: flex;
    align-items: center;
    color: #334155;
    font-size: 0.82rem;
}

.fomo-stat-sold span {
    color: #0f172a;
    font-weight: 800;
    margin-right: 3px;
}

.fomo-stat-remaining {
    font-weight: 700;
    color: #ea580c;
    display: flex;
    align-items: center;
    text-align: right;
    font-size: 0.78rem;
}