* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background-color: #121213;
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    max-width: 500px;
    width: 100%;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #ffffff;
    border-bottom: 1px solid #3a3a3c;
    padding-bottom: 10px;
}

#game-board {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    margin-bottom: 30px;
    padding: 10px;
}

.row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.tile {
    width: 62px;
    height: 62px;
    border: 2px solid #3a3a3c;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    color: #ffffff;
    background-color: #121213;
    transition: all 0.3s ease;
}

.tile.filled {
    border-color: #565758;
    background-color: #1a1a1b;
}

.tile.correct {
    background-color: #6aaa64;
    border-color: #6aaa64;
    color: #ffffff;
}

.tile.present {
    background-color: #c9b458;
    border-color: #c9b458;
    color: #ffffff;
}

.tile.absent {
    background-color: #787c7e;
    border-color: #787c7e;
    color: #ffffff;
}

.tile.flip {
    animation: flip 0.6s ease forwards;
}

@keyframes flip {
    0% {
        transform: rotateX(0);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0);
    }
}

#keyboard {
    display: grid;
    grid-template-rows: repeat(3, 1fr);
    gap: 8px;
    max-width: 500px;
    margin: 0 auto;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.key {
    background-color: #818384;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    height: 58px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    user-select: none;
    min-width: 43px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key:hover {
    background-color: #9ca3a3;
}

.key.wide {
    min-width: 65px;
    font-size: 12px;
}

.key.correct {
    background-color: #6aaa64;
}

.key.present {
    background-color: #c9b458;
}

.key.absent {
    background-color: #3a3a3c;
}

.message {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    color: #000000;
    padding: 16px 24px;
    border-radius: 4px;
    font-weight: bold;
    z-index: 1000;
    transition: opacity 0.3s ease;
}

.message.hidden {
    opacity: 0;
    pointer-events: none;
}

.message.show {
    opacity: 1;
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .tile {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .key {
        height: 50px;
        min-width: 35px;
        font-size: 12px;
    }
    
    .key.wide {
        min-width: 55px;
        font-size: 10px;
    }
}
