/* styles/siete.css */

/* RESET BÁSICO */
* {
    box-sizing: border-box;
}

/* FONDO PRINCIPAL CON DEGRADADO SUTIL */
.w7-main {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 10px;

    /* Degradado suave para dar profundidad (si las variables fallan, usa los colores fallback) */
    background: linear-gradient(135deg, var(--bg-main, #f8f9fa) 0%, #e6e9ef 100%);

    min-height: calc(100vh - 120px);
    font-family: 'Inter', sans-serif;
}

/* CONTENEDOR TIPO "TARJETA" (Aquí está el cambio visual importante) */
.w7-container {
    width: 100%;
    max-width: 480px;
    /* Un poco más ancho para el padding */
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    position: relative;

    /* Estilo Tarjeta */
    background-color: var(--bg-secondary, #ffffff);
    padding: 30px 20px;
    /* Espacio interior */
    border-radius: 20px;
    /* Bordes redondeados modernos */
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    /* Sombra suave para que flote */
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* En móviles, quitamos el efecto tarjeta para aprovechar el espacio */
@media (max-width: 500px) {
    .w7-container {
        box-shadow: none;
        background: transparent;
        padding: 0;
        border: none;
    }
}

/* MENSAJES FLOTANTES */
.w7-message {
    position: absolute;
    top: 5%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    z-index: 200;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* WRAPPER TABLERO */
.w7-board-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 5px 0;
}

/* TABLERO ESTILO CRUCIGRAMA */
.w7-board.crossword-style {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-template-rows: repeat(7, 1fr);
    gap: 0;

    width: 100%;
    aspect-ratio: 1;
    max-width: 360px;
    /* Ajustado para que quepa bien en la tarjeta */

    border: 3px solid #1a1a1a;
    background: #1a1a1a;
    box-shadow: 0 4px 0px rgba(0, 0, 0, 0.15);
    /* Sombra sólida abajo */
    border-radius: 4px;
    /* Ligero redondeo exterior */
}

.w7-cell {
    width: 100%;
    height: 100%;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 1.5rem;
    font-weight: 800;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    user-select: none;
    color: #000;
    border: 1px solid #dcdcdc;
}

/* Colores de estado más vibrantes */
.w7-cell.correct {
    background-color: #6aaa64;
    color: white;
    border-color: #6aaa64;
}

.w7-cell.present {
    background-color: #c9b458;
    color: white;
    border-color: #c9b458;
}

.w7-cell.absent {
    background-color: #787c7e;
    color: white;
    border-color: #787c7e;
}

/* Borde activo */
.w7-cell.filled {
    border: 2px solid #000;
    z-index: 10;
}

/* Animación Flip */
.w7-cell.flip {
    animation: flip 0.6s ease forwards;
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }

    50% {
        transform: rotateX(90deg);
    }

    100% {
        transform: rotateX(0);
    }
}

/* TECLADO */
.w7-keyboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 10px;
}

.w7-row {
    display: flex;
    justify-content: center;
    gap: 4px;
    width: 100%;
}

.w7-key {
    background-color: #e3e6ea;
    /* Un gris un pelín más azulado */
    border: 1px solid #c8d0e0;
    border-radius: 4px;
    height: 48px;
    flex: 1;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 1rem;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
    touch-action: manipulation;
    transition: transform 0.1s, background-color 0.2s;
    box-shadow: 0 2px 0 #bdc3c7;
    /* Efecto tecla 3D sutil */
}

.w7-key:active {
    transform: translateY(2px);
    box-shadow: none;
}

.w7-key.big {
    flex: 1.5;
    font-size: 0.9rem;
}

.w7-key.correct {
    background-color: #6aaa64;
    color: white;
    border: none;
    box-shadow: 0 2px 0 #4f8a4a;
}

.w7-key.present {
    background-color: #c9b458;
    color: white;
    border: none;
    box-shadow: 0 2px 0 #a39043;
}

.w7-key.absent {
    background-color: #787c7e;
    color: white;
    border: none;
    box-shadow: 0 2px 0 #5a5d5e;
}

/* MODAL */
.w7-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    /* Fondo más oscuro */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 300;
    backdrop-filter: blur(4px);
    /* Efecto desenfoque */
}

.w7-modal-content {
    background: white;
    padding: 35px;
    border-radius: 16px;
    text-align: center;
    width: 85%;
    max-width: 320px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
    color: #333;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.w7-btn-primary {
    background: var(--primary, #333);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: filter 0.2s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.w7-btn-primary:hover {
    filter: brightness(1.1);
}

/* styles/siete.css */

/* Si tu contenedor principal tiene una clase, úsala. Si es la etiqueta main: */
.w7-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    /* Cambiar 'center' por 'flex-start' */
    padding-top: 40px;
    /* Espacio para que no se pegue al menú */
    padding-bottom: 40px;
    min-height: 100vh;
    gap: 30px;
    /* Espacio entre el juego y el texto SEO */
}

/* Para Chrome, Safari y Opera */
.w7-main::-webkit-scrollbar {
    display: none;
}

/* Para Firefox, IE y Edge */
.w7-main {
    -ms-overflow-style: none;
    /* IE y Edge */
    scrollbar-width: none;
    /* Firefox */
}