/* Color variables - use these in your CSS */
:root {
    --correct: #538d4e;      /* Green - letter is correct */
    --misplaced: #b59f3b;    /* Yellow - letter is in word but wrong spot */
    --wrong: #3a3a3c;        /* Dark gray - letter not in word */
    --empty: #021809;        /* Background color */
    --border: #3a3a3c;       /* Tile border color */
    --text: #ffffff;         /* Text color */
    --key-bg: #818384;       /* Keyboard key background */
}

/* Base styles - provided */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--empty);
    color: var(--text);
    font-family: 'Arial', sans-serif;
    min-height: 100vh;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 60px 20px;
    text-align: center;
}

h1 {
    margin-bottom: 20px;
    font-size: 2rem;
    letter-spacing: 0.2rem;
}

#new-word-button {
    margin-bottom: 20px;
    padding: 10px 18px;
    border: none;
    border-radius: 999px;
    background-color: var(--correct);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
}

#new-word-button:hover {
    opacity: 0.9;
}

#message {
    height: 25px;
    margin: 20px 0;
    font-size: 1.2rem;
    font-weight: bold;
}

/* ===========================================
   BOARD STYLES - SOLUTION
   =========================================== */

.board {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.row {
    display: flex;
    gap: 5px;
    perspective: 1000px;
}

/* Tile base styles - provided */
.tile {
    width: 62px;
    height: 62px;
    border: 2px solid var(--border);
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;

    /* Center the letter in the tile */
    display: flex;
    justify-content: center;
    align-items: center;
    backface-visibility: hidden;
    transform-style: preserve-3d;
}

/* ===========================================
   TILE STATE CLASSES - SOLUTION
   =========================================== */

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

.correct {
    background-color: var(--correct);
    border-color: var(--correct);
    animation: flip 0.6s ease forwards;
}

.misplaced {
    background-color: var(--misplaced);
    border-color: var(--misplaced);
    animation: flip 0.6s ease forwards;
}

.wrong {
    background-color: var(--wrong);
    border-color: var(--wrong);
    animation: flip 0.6s ease forwards;
}

@keyframes flip {
    0% {
        transform: rotateX(0);
        background-color: var(--empty);
        border-color: #565758;
    }
    45% {
        transform: rotateX(90deg);
        background-color: var(--empty);
        border-color: #565758;
    }
    55% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

/* ===========================================
   KEYBOARD STYLES - SOLUTION
   =========================================== */

.keyboard {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.keyboard-row {
    display: flex;
    gap: 6px;
}

/* Key base styles - provided */
.key {
    min-width: 43px;
    height: 58px;
    border: none;
    border-radius: 4px;
    background-color: var(--key-bg);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;

    /* Center the letter */
    display: flex;
    justify-content: center;
    align-items: center;
}

.key:hover {
    opacity: 0.8;
}

.key.wide {
    min-width: 65px;
    font-size: 0.75rem;
}

/* Keyboard keys also get colored after guesses */
.key.correct {
    background-color: var(--correct);
}

.key.misplaced {
    background-color: var(--misplaced);
}

.key.wrong {
    background-color: var(--wrong);
}

/* ===========================================
   LOGO & FOOTER STYLES
   =========================================== */

.logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 15px;
}

footer {
    margin: 0 0 18px;
    font-size: 0.85rem;
    color: #c0c2c4;
    line-height: 1.6;
}

footer a {
    color: var(--correct);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

@media (max-width: 520px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }

    .keyboard {
        gap: 6px;
    }

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

    .key {
        min-width: 0;
        width: 8.5vw;
        max-width: 36px;
        height: 52px;
        font-size: 0.75rem;
        padding: 0;
    }

    .key.wide {
        width: 14vw;
        max-width: 54px;
        font-size: 0.65rem;
    }
}
