*{
    box-sizing:border-box;
}

body{
    margin:0;
    font-family:Arial, Helvetica, sans-serif;
    background:#f5f5f5;
    color:#222;
}

.contenedor{
    width:min(1100px, calc(100% - 32px));
    margin:32px auto;
}

h1{
    margin:0 0 12px;
    font-size:clamp(1.8rem, 4vw, 2.4rem);
}

.info-sorteo{
    background:#ffffff;
    border:1px solid #dddddd;
    border-radius:12px;
    padding:16px;
    margin-bottom:24px;
}

.info-sorteo p{
    margin:8px 0;
}

.grid-numeros{
    list-style:none;
    padding:0;
    margin:0;
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(72px, 1fr));
    gap:10px;
}

.numero-item{
    border-radius:12px;
    padding:14px 8px;
    text-align:center;
    font-weight:700;
    font-size:1.1rem;
    border:1px solid transparent;
}

.estado-libre{
    background:#e8f7e8;
    border-color:#9bd39b;
    color:#176117;
}

.estado-reservado{
    background:#fff6d8;
    border-color:#e4c96a;
    color:#7a5a00;
}

.estado-pagado{
    background:#fde7e7;
    border-color:#e19a9a;
    color:#8a1f1f;
}

.leyenda{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin:0 0 18px;
}

.leyenda span{
    display:inline-flex;
    align-items:center;
    gap:8px;
    background:#fff;
    border:1px solid #ddd;
    border-radius:999px;
    padding:8px 12px;
    font-size:.95rem;
}

.leyenda i{
    width:14px;
    height:14px;
    border-radius:50%;
    display:inline-block;
}

.leyenda .libre{
    background:#2e9d2e;
}

.leyenda .reservado{
    background:#d1a300;
}

.leyenda .pagado{
    background:#c93a3a;
}



.numero-enlace{
    display:block;
    text-decoration:none;
    color:inherit;
}

.numero-texto{
    display:block;
}

.formulario-reserva{
    margin-top:28px;
    background:#ffffff;
    border:1px solid #dddddd;
    border-radius:12px;
    padding:18px;
}

.formulario-reserva h2{
    margin:0 0 16px;
    font-size:1.2rem;
}

.campo-form{
    margin-bottom:14px;
}

.campo-form label{
    display:block;
    margin-bottom:6px;
    font-weight:700;
}

.campo-form input{
    width:100%;
    padding:10px 12px;
    border:1px solid #cccccc;
    border-radius:8px;
    font-size:1rem;
}

.formulario-reserva button{
    padding:12px 16px;
    border:0;
    border-radius:8px;
    background:#222;
    color:#fff;
    font-weight:700;
    cursor:not-allowed;
    opacity:.65;
}



.mensaje-ok{
    margin-bottom:18px;
    background:#e8f7e8;
    border:1px solid #9bd39b;
    color:#176117;
    border-radius:12px;
    padding:14px 16px;
    font-weight:700;
}

.mensaje-error{
    margin-bottom:18px;
    background:#fde7e7;
    border:1px solid #e19a9a;
    color:#8a1f1f;
    border-radius:12px;
    padding:14px 16px;
    font-weight:700;
}

.formulario-reserva button{
    padding:12px 16px;
    border:0;
    border-radius:8px;
    background:#222;
    color:#fff;
    font-weight:700;
    cursor:pointer;
    opacity:1;
}



.modal-overlay{
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.55);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:16px;
    z-index:9999;
}

.modal-reserva{
    position:relative;
    width:min(520px, 100%);
    max-height:90vh;
    overflow:auto;
    background:#ffffff;
    border:1px solid #dddddd;
    border-radius:16px;
    padding:22px 18px 18px;
    box-shadow:0 20px 50px rgba(0,0,0,.18);
}

.modal-reserva h2{
    margin:0 32px 16px 0;
    font-size:1.3rem;
}

.modal-cerrar{
    position:absolute;
    top:10px;
    right:12px;
    width:34px;
    height:34px;
    display:flex;
    align-items:center;
    justify-content:center;
    border-radius:999px;
    text-decoration:none;
    font-size:1.6rem;
    line-height:1;
    color:#222;
    background:#f2f2f2;
}

.modal-cerrar:hover{
    background:#e8e8e8;
}

@media (max-width: 640px){
    .modal-reserva{
        padding:20px 14px 16px;
        border-radius:14px;
    }

    .modal-reserva h2{
        font-size:1.15rem;
    }
}


.btn-modal-link{
    display:inline-block;
    padding:12px 16px;
    border:0;
    border-radius:8px;
    background:#222;
    color:#fff;
    font-weight:700;
    text-decoration:none;
}