/* assets/css/wordle.css */

/* --- LAYOUT GENERAL --- */
.container-wordle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 80vh;
    width: 100%;
    margin-top: 0;
    padding: 0;
    position: relative;
    z-index: 5;
}

main {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- CONTENEDOR DEL JUEGO (La Carta Gigante) --- */
.game-container {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;

    /* Estilos de Carta */
    background-image: url('../img/card.png');
    background-repeat: no-repeat;
    background-size: 100% 100%;
    padding: 35px 25px 40px 25px;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.7));
}

/* --- TABLERO (BOARD) --- */
.wordle-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 20px;
}

.wordle-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.cell {
    width: 60px;
    height: 60px;
    border: 3px solid #8d6e63;
    background-color: #fff8e1;
    font-family: 'Pirata One', cursive;
    font-size: 2rem;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    text-transform: uppercase;
    color: var(--text-dark);
    user-select: none;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

/* Estados de las celdas */
.cell.filled {
    border-color: var(--text-dark);
    transform: scale(1.02);
}

.cell.correct {
    background-color: #2e7d32 !important;
    color: #fff !important;
    border-color: #1b5e20 !important;
}

.cell.present {
    background-color: var(--gold-treasure) !important;
    color: #fff !important;
    border-color: #ff8f00 !important;
    text-shadow: 1px 1px 0 #3e2723;
}

.cell.absent {
    background-color: #795548 !important;
    color: #d7ccc8 !important;
    border-color: #5d4037 !important;
    opacity: 0.9;
}

/* --- TECLADO --- */
.keyboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 0 2px;
}

.key-row {
    display: flex;
    justify-content: center;
    gap: 4px;
}

.key {
    font-family: 'Roboto', sans-serif;
    font-weight: bold;
    font-size: 0.85rem;
    height: 45px;
    padding: 0 10px;
    border: 2px solid #8d6e63;
    border-radius: 4px;
    background: #d7ccc8;
    color: #3e2723;
    cursor: pointer;
    text-transform: uppercase;
    min-width: 32px;
    box-shadow: 0 3px 0 #6d4c41;
    transition: all 0.1s ease;
    flex: 1;
}

.key:active {
    transform: translateY(3px);
    box-shadow: none;
    border-color: #5d4037;
}

.key-action {
    /* Hacemos que ocupen 1.5 veces lo que ocupa una letra normal */
    background: #a1887f;
    border-color: #795548;
    font-size: 1rem;
    flex: 1.5;
}

.key-action svg {
    /* Asegurar que el icono se vea bien */
    width: 24px;
    height: 24px;
    stroke: #3e2723;
}

/* Estados del teclado */
.key.correct {
    background-color: #2e7d32;
    color: white;
    border-color: #1b5e20;
    box-shadow: 0 3px 0 #1b5e20;
}

.key.present {
    background-color: var(--gold-treasure);
    color: white;
    border-color: #e65100;
    box-shadow: 0 3px 0 #e65100;
}

.key.absent {
    background-color: #4e342e;
    color: #bdbdbd;
    border-color: #212121;
    box-shadow: 0 3px 0 #212121;
}

/* --- MENSAJES FLOTANTES --- */
#winMsg,
#looseMsg {
    width: 100%;
    background-size: 100% 100%;
    padding: 30px 25px;
    border: none;
    border-radius: 8px;
    text-align: center;
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.loose-content {
    background: linear-gradient(135deg, #c62828, #b71c1c);
    border: 3px solid #ffb300;
    border-radius: 10px;
    padding: 20px;
    align-items: center;
    gap: 20px;
    color: white;
    box-shadow: 0 0 20px rgba(198, 40, 40, 0.4);
}

.hidden {
    display: none !important;
}

.win-content h2,
.loose-content h2 {
    font-family: 'Pirata One', cursive;
    font-size: 2.2rem;
    color: var(--gold-treasure);
    margin: 0;
    text-shadow: 2px 2px 0px #3e2723;
}

.win-content p,
.loose-content p {
    color: var(--gold-treasure);
}

.jolly-roger {
    font-size: 3rem;
    margin-bottom: 5px;
}

.win-character-img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid var(--gold-treasure);
}


/* --- RESPONSIVE MOBILE --- */
@media (max-width: 500px) {
    /* Ajustamos el padding de la carta en móvil */
    .game-container {
        padding: 25px 15px 30px 15px;
        margin-left: 5px;
        margin-right: 5px;
        width: calc(100% - 10px);
    }

    .container-wordle {
        padding: 0;
        margin-top: 0;
    }

    .cell {
        width: 55px;
        height: 55px;
        font-size: 1.8rem;
        border-width: 2px;
    }

    .wordle-board {
        gap: 4px;
        margin-bottom: 15px;
    }

    .key {
        padding: 0 2px;
        font-size: 0.75rem;
        min-width: 26px;
        height: 42px;
        border-width: 1px;
    }
}