/* /assets/css/psicowordle.css */
:root {
    --color-correct: #538d4e;
    --color-present: #b59f3b;
    --color-absent: #3a3a3c;
    --key-bg: #818384;
    --tile-border-color: #3a3a3c;
    --tile-text-color: #ffffff;
    --background-color: #121213;
}

.psicowordle-root {
    display: flex;
    justify-content: center;
    font-family: Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--tile-text-color);
    padding: 10px;
    box-sizing: border-box;
}

.psicowordle-game {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--tile-border-color);
    padding-bottom: 10px;
}

header h1 {
    font-size: 2rem;
    margin: 0;
}

#stats-button {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--tile-text-color);
}

#game-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
}

.tile-row {
    display: flex;
    gap: 5px;
    direction: ltr;
}

.tile {
    width: 60px;
    height: 60px;
    border: 2px solid var(--tile-border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Estilos de fuente devueltos aquí para corregir la tipografía */
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    /* Transición suave para el cambio de color */
    transition: background-color 0.2s linear, border-color 0.2s linear;
}

.tile.filled {
    border-color: #565758;
}

/* NUEVA CLASE PARA ACTIVAR LA ANIMACIÓN SENCILLA */
.tile.reveal {
    animation: pop 0.4s ease-in-out;
}

.tile.correct, .tile.present, .tile.absent {
    border: none;
}

.tile.correct {
    background-color: var(--color-correct);
}

.tile.present {
    background-color: var(--color-present);
}

.tile.absent {
    background-color: var(--color-absent);
}

/* NUEVA ANIMACIÓN "POP" */
@keyframes pop {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

.shake {
    animation: shake 0.5s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

#keyboard-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

#keyboard-container button {
    font-family: inherit;
    font-weight: bold;
    border: 0;
    padding: 0;
    height: 58px;
    cursor: pointer;
    background-color: var(--key-bg);
    color: var(--tile-text-color);
    flex-grow: 1;
    text-transform: uppercase;
    border-radius: 4px;
    user-select: none;
    min-width: 40px;
}

#keyboard-container button.wide-key {
    flex-grow: 1.5;
}

#keyboard-container button.correct {
    background-color: var(--color-correct);
}

#keyboard-container button.present {
    background-color: var(--color-present);
}

#keyboard-container button.absent {
    background-color: var(--color-absent);
}

#message-container {
    position: fixed;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(255,255,255,0.9);
    color: #000;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 1000;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0s 0.5s, opacity 0.5s linear;
}

#message-container.show {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s linear;
}

.modal {
    display: none;
    position: fixed;
    z-index: 1001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
}

.modal-content {
    background-color: #1a1a1b;
    margin: 15% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 450px;
    border-radius: 8px;
    color: #fff;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.stats-grid {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin: 20px 0;
}

.stat-value {
    font-size: 2em;
    font-weight: bold;
}

.stat-label {
    font-size: 0.9em;
}

.guess-distribution {
    margin-top: 20px;
}

.dist-row {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.dist-label {
    flex-basis: 20px;
}

.dist-bar {
    background-color: var(--color-correct);
    color: #fff;
    padding: 2px 5px;
    text-align: right;
    font-weight: bold;
    border-radius: 2px;
}

@media (max-width: 500px) {
    .tile {
        width: 15vw;
        height: 15vw;
        font-size: 1.5rem;
    }
    #keyboard-container button {
        height: 50px;
        min-width: 8vw;
    }
}