body {
    font-family: "Poppins", "Segoe UI", sans-serif;
    color: #2c3e50;
    padding-bottom: 80px;
}

.form-select {
    border-radius: 10px;
    border: 1px solid #bcd9f5;
    padding: 10px 12px;
    background-color: #f5f9ff;
    color: #1f2d3d;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.form-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 0.2rem rgba(52, 152, 219, 0.2);
}

.form-select option {
    color: #1f2d3d;
    background: #ffffff;
}


#tableros {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    margin-top: 20px;
}

.tablero {
    width: min(100%, 420px);
    aspect-ratio: 2 / 3;
    height: auto;
    border: 1px solid #111;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px;
    background-color: #fff;
    border-radius: 12px;
    align-content: space-around;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}

.tablero.tablero-3 {
    grid-template-columns: repeat(3, 1fr);
}

.tablero.tablero-4 {
    grid-template-columns: repeat(4, 1fr);
}

.tablero.tablero-12 {
    gap: 12px;
    padding: 14px;
}

.tablero.tablero-16 {
    gap: 8px;
    padding: 10px;
}

.carta {
    width: 100%;
    aspect-ratio: 1/1;
    border: 1px solid #e3e7ee;
    border-radius: 8px;
    object-fit: cover;
}

.tablero {
    break-inside: avoid;
    page-break-inside: avoid;
}

.carta {
    position: relative;
    background: white;
    transition: transform 0.2s;
}

.carta img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.carta-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media print {
    @page {
        size: letter portrait;
        margin: 1.2cm;
    }

    body * {
        visibility: hidden;
    }

    .tablero-container, .tablero, .carta, .titulo-loteria {
        visibility: visible;
    }

    .tablero-container {
        width: 100%;
        justify-content: center;
    }
    
    .tablero {
        width: 18cm;
        height: 22cm;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .carta {
        aspect-ratio: 1/1;
        border: 1px solid #000;
    }
}

footer.footer.bg-light.mt-4.py-3 {
    display: block;
    width: 100%;
    bottom: 0;
}

.floating-buttons {
    position: fixed;
    bottom: 90px;
    right: 20px;
    top: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    z-index: 1000;
}

.floating-buttons button {
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.2s, box-shadow 0.2s;
    width: 220px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
}

.floating-buttons button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* Para dispositivos móviles */
@media (max-width: 768px) {
    body {
        padding-bottom: 120px;
    }

    .card {
        border-radius: 16px;
    }

    .card-body {
        padding: 16px;
    }

    .lead {
        font-size: 1rem;
        margin-bottom: 16px;
    }

    h1 {
        font-size: 1.6rem;
    }

    .mt-5 {
        margin-top: 1.5rem !important;
    }

    .mb-4 {
        margin-bottom: 1rem !important;
    }

    .tablero {
        width: 100%;
        max-width: 360px;
        gap: 6px;
        padding: 10px;
    }

    .floating-buttons {
        left: 12px;
        right: 12px;
        bottom: 50px;
        top: auto;
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .floating-buttons button {
        padding: 10px 12px;
        border-radius: 14px;
        flex: 1 1 0;
        font-size: 0.85rem;
        min-width: 100px;
        height: 56px;
        white-space: normal;
        line-height: 1.2;
        width: auto;
        justify-content: center;
    }

    .footer {
        padding: 10px 0;
    }
}

.footer {
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 0;
    position: fixed;
    bottom: 0;
    width: 100%;
    box-shadow: 0 -5px 15px rgba(0,0,0,0.1);
    z-index: 900;
}

.footer p {
    margin: 0;
    color: #2c3e50;
    font-weight: 500;
}

.footer i.fa-heart {
    color: #e74c3c;
    animation: heartBeat 1.5s infinite;
}

.footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: #2980b9;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s;
}

.modal-contenido {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    animation: slideUp 0.3s;
}

.modal-icono {
    font-size: 48px;
    margin-bottom: 20px;
}

.modal-mensaje {
    font-size: 18px;
    margin-bottom: 25px;
    color: #333;
    font-family: Arial, sans-serif;
}

.modal-cerrar {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.modal-cerrar:hover {
    background: #0056b3;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

button.btn.btn-primary.btn-lg.btn-block,
button.btn.btn-success.btn-lg.btn-block,
button.btn.btn-info.btn-lg {
    width: 100%;
}