/* Paleta de colores primaveral */
:root {
    --primary-spring: #2ecc71; /* Verde esmeralda */
    --secondary-spring: #3498db; /* Azul cielo */
    --accent-spring: #f1c40f; /* Amarillo sol */
    --dark-text: #2c3e50; /* Azul oscuro para texto */
    --light-bg: #ecf0f1; /* Gris claro de fondo */
    --text-light: #f8f9fa; /* Color de texto claro */
}

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    color: var(--dark-text);
    text-align: center;
    background-color: var(--light-bg);
}

.main-container {
    position: relative;
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
    background-position: center center;
    background-size: cover;
    background-attachment: fixed;
}

/* Nuevas imágenes de fondo */
.main-page-bg {
    background-image: url('https://images.unsplash.com/photo-1615594411603-c3f2081c7475?q=80&w=2070&auto=format&fit=crop');
}

.table-page-bg {
    background-image: url('https://images.unsplash.com/photo-1614761405030-244a0b27b409?q=80&w=2070&auto=format&fit=crop');
}

/* Fondo translúcido para que la imagen se vea, pero sin perder legibilidad */
.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.5);
}

.content {
    position: relative;
    z-index: 10;
    max-width: 900px;
    min-height: 90vh;
    padding: 30px;
    
    /* QUITAMOS TODO EL CÓDIGO DE TRANSPARENCIA Y IMAGEN DIRECTA DE AQUÍ */
    background-color: rgba(255, 255, 255, 0.5); /* Restauramos el fondo semitransparente */
    
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    animation: fadeIn 1.5s ease-in-out;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
}

/* NUEVA SECCIÓN: IMAGEN DE FONDO CON OPACIDAD SIN AFECTAR EL CONTENIDO */
.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    
    background-image: url('jugando.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Aquí se controla la transparencia de la imagen */
    opacity: 0.2;
    
    z-index: -1; /* Envía esta capa detrás del contenido de texto */
    border-radius: 15px;
}

/* Restauramos los estilos originales para que no se hayan modificado */
h1, .subtitle, h2, .info-card p, #result-container p, #result-container h3 {
    color: var(--dark-text);
}

h1 {
    font-size: 3.8em;
    font-weight: 800;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    margin-bottom: 15px;
    line-height: 1.1;
}

p.subtitle {
    font-size: 1.6em;
    font-style: normal;
    margin-bottom: 30px;
    font-weight: 300;
}

.info-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 35px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

h2 {
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 30px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.range-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 20px;
    max-width: 650px;
    margin: 0 auto;
}

.range-button {
    padding: 18px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background-color: var(--primary-spring);
    color: white;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.range-button:hover {
    background-color: #27ae60;
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

/* Estilos de la tabla - Fondo blanco y bordes coloridos */
.table-container {
    overflow-x: auto;
    max-width: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    margin-bottom: 25px;
}

table {
    border-collapse: collapse;
    margin: 0 auto;
    background-color: transparent;
    width: 100%;
}

td {
    width: 45px;
    height: 45px;
    text-align: center;
    vertical-align: middle;
    border: 1px solid rgba(0, 0, 0, 0.2);
    cursor: pointer;
    font-size: 15px;
    transition: background-color 0.3s ease, transform 0.1s ease;
    background-color: #ffffff;
    color: var(--dark-text);
    font-weight: 500;
}

td:hover {
    background-color: #f0f0f0;
}

td.selected {
    background-color: var(--secondary-spring);
    color: white;
    cursor: not-allowed;
    transform: scale(0.95);
    font-weight: bold;
    border-color: #2980b9;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.table-container td.taken {
    background-color: var(--secondary-spring);
    color: white;
    pointer-events: none; /* Esto evita que se pueda hacer clic en ellos de nuevo */
    opacity: 0.5; /* Para que se vean un poco desvanecidos */
    cursor: not-allowed;
}

#finish-button {
    padding: 15px 30px;
    font-size: 1.2em;
    cursor: pointer;
    background-color: var(--primary-spring);
    color: white;
    border: none;
    border-radius: 8px;
    margin-top: 25px;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

#finish-button:hover {
    background-color: #27ae60;
    transform: translateY(-3px);
    box-shadow: 6px 15px rgba(0, 0, 0, 0.4);
}

#result-container {
    margin-top: 35px;
    padding: 25px;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#result-container h3 {
    color: var(--dark-text);
    text-shadow: none;
    font-size: 1.8em;
}

#result-container p {
    font-size: 1.2em;
    line-height: 1.6;
    color: var(--dark-text);
}

#thank-you-message strong {
    color: var(--secondary-spring);
    font-weight: bold;
}

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

/* Diseño adaptable */
@media (max-width: 992px) {
    .content {
        max-width: 90%;
        min-height: 70vh;
    }
    h1 {
        font-size: 3em;
    }
    .subtitle {
        font-size: 1.4em;
    }
    h2 {
        font-size: 2em;
    }
    .info-card p {
        font-size: 1.1em;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 20px;
        margin: 0 15px;
        min-height: 60vh;
    }
    h1 {
        font-size: 2.5em;
    }
    .subtitle {
        font-size: 1.2em;
    }
    h2 {
        font-size: 1.8em;
    }
    .range-options {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    .range-button {
        padding: 12px;
        font-size: 0.9em;
    }
    td {
        width: 35px;
        height: 35px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .content {
        min-height: 50vh;
    }
    h1 {
        font-size: 2em;
    }
    .subtitle {
        font-size: 1em;
    }
    h2 {
        font-size: 1.5em;
    }
    .info-card p {
        font-size: 1em;
    }
    .range-options {
        grid-template-columns: 1fr;
    }
    td {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }
    #finish-button {
        padding: 10px 20px;
        font-size: 1em;
    }
}