* {
    box-sizing: border-box;
}

body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    margin: 0;
    background-color: #121213;
    color: white;
    min-height: 100vh;
}

h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

#game-board {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
    margin-bottom: 1rem;
}

.tile {
    width: 60px;
    height: 60px;
    border: 2px solid #3a3a3c;
    font-size: 2rem;
    font-weight: bold;
    text-transform: uppercase;
    display: flex;
    justify-content: center;
    align-items: center;
}

#keyboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

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

.key {
    background-color: #818384;
    color: white;
    border: none;
    padding: 15px 10px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
    width: 40px;
}

.correct {
    background-color: #538d4e;
    border-color: #538d4e;
}

.present {
    background-color: #b59f3b;
    border-color: #b59f3b;
}

.absent {
    background-color: #3a3a3c;
    border-color: #3a3a3c;
}

.animated {
    animation: flip 0.5s ease;
}

@keyframes flip {
    0% {
        transform: scaleY(1);
    }
    50% {
        transform: scaleY(0);
    }
    100% {
        transform: scaleY(1);
    }
}

#modal-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
}

#modal {
    background-color: #121213;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

#modal-message {
    margin-bottom: 20px;
    font-size: 1.2rem;
}

#play-again-button {
    background-color: #538d4e;
    color: white;
    border: none;
    padding: 10px 20px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 4px;
}

.main-container {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    width: 100%;
    padding: 20px;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-self: center;
}

#sidebar {
    width: 350px;
    background-color: #121213;
    padding: 20px;
    border-radius: 10px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

.stat-item {
    text-align: center;
}

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

.stat-label {
    font-size: 0.9rem;
    color: #818384;
}

.histogram-container {
    margin-top: 10px;
}

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

.histogram-label {
    width: 40px;
}

.histogram-bar-container {
    flex-grow: 1;
    background-color: #3a3a3c;
    border-radius: 4px;
}

.histogram-bar {
    background-color: #538d4e;
    color: white;
    padding: 2px 5px;
    text-align: right;
    border-radius: 4px;
    transition: width 0.5s ease-in-out;
}

#recent-games-content {
}

#recent-games-content .game {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #3a3a3c;
}

#recent-games-content .game-grid {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 10px;
}

#recent-games-content .guess-row {
    display: flex;
    gap: 5px;
}

#recent-games-content .tile {
    width: 30px;
    height: 30px;
    font-size: 1rem;
}

#pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

#pagination-controls button {
    background-color: #818384;
    color: white;
    border: none;
    padding: 5px 10px;
    font-size: 0.9rem;
    cursor: pointer;
    border-radius: 4px;
}

#pagination-controls button:disabled {
    background-color: #3a3a3c;
    cursor: not-allowed;
}
