/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
}

#game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 320px;
}

/* Game grid setup */
.game-grid {
    display: grid;
    grid-template-rows: repeat(6, 60px);
    grid-gap: 5px;
    margin-bottom: 20px;
}

.grid-row {
    display: flex;
    justify-content: center;
    gap: 5px;
}

/* Default tile styles */
.tile {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e1e1e1;
    font-size: 1.5rem;
    font-weight: bold;
    border-radius: 5px;
    border: 2px solid #ccc;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

/* Tile color feedback */
.tile.green {
    background-color: #6aaa64; /* Green for correct spot */
    color: white;
    border-color: #3a6d3a;
}

.tile.yellow {
    background-color: #c9b458; /* Yellow for wrong spot */
    color: white;
    border-color: #a68d3b;
}

.tile.gray {
    background-color: #787c7e; /* Gray for not in word */
    color: white;
    border-color: #5a5d5e;
}

/* Keyboard styles */
#keyboard-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

/* Keyboard rows */
.keyboard-row {
    display: flex;
    justify-content: center;
    margin: 5px 0;
}

/* Default keyboard key */
.key {
    width: 65px;
    height: 40px;
    margin: 3px;
    text-align: center;
    line-height: 40px;
    background-color: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

/* Key interactions */
.key:hover {
    background-color: #bbb;
}

.key:active {
    background-color: #ddd;
}

/* Key color feedback */
.key.green {
    background-color: #6aaa64;
    color: white;
}

.key.yellow {
    background-color: #c9b458;
    color: white;
}

.key.gray {
    background-color: #787c7e;
    color: white;
}

/* Animation for flipping effect when revealing colors */
@keyframes flip {
    0% { transform: rotateX(0); }
    50% { transform: rotateX(90deg); }
    100% { transform: rotateX(0); }
}

.tile.flip {
    animation: flip 0.5s ease;
}
