/* Wordle Container */
.wordle-container {
    position: relative;
    background-color: #f0f0f0;
    background-size: cover;
    background-position: center;
    text-align: center;
    background-image: url('../img/preview.webp');
    overflow: hidden;
    min-height: 300px;
    transition: background-image 0.3s ease-in-out;
}

.wordle-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1;
}

.wordle-container * {
    position: relative;
    z-index: 2;
}


/* Wordle Grid */
.wordle-grid {
    display: grid;
    grid-template-rows: repeat(6, 1fr);
    gap: 5px;
    margin: 0 auto;
    justify-content: center;
    padding: 30px;
}

/* Wordle Rows */
.wordle-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

/* Wordle Tiles */
.wordle-tile {
    width: 75px;
    height: 75px;
    border: 2px solid #555;
    font-size: 30px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.4);
    background-color: #333333aa;
    color: #EAEAEA;
}

@media (max-width: 768px) {
    .wordle-tile {
        width: 65px;
        height: 65px;
    }
}

/* Tile Colors for Correct, Present, and Absent States */
.wordle-tile.correct {
    background-color: #5BC0BE;
    color: #181818;
}

.wordle-tile.present {
    background-color: #F05454;
    color: #181818;
}

.wordle-tile.absent {
    background-color: #555555;
    color: #EAEAEA;
}

.wordle-tile.flip {
    animation: flip 0.6s;
}

@keyframes flip {
    0% {
        transform: rotateX(0deg);
    }
    50% {
        transform: rotateX(90deg);
    }
    100% {
        transform: rotateX(0deg);
    }
}

/* Game Popup */
#game-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.popup-content {
    background: #2E2E2E;
    color: #EAEAEA;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    width: 80%;
}

.popup-content p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Popup Button */
#popup-ok-btn {
    padding: 10px 20px;
    background-color: #5BC0BE;
    color: #181818;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

#popup-ok-btn:hover {
    background-color: #3A3A3A;
    color: #EAEAEA;
}

/* Virtual Keyboard */
.virtual-keyboard {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 20px;
}

/* Hide Virtual Keyboard on Larger Screens */
@media (min-width: 768px) {
    .virtual-keyboard {
        display: none;
    }
}

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

/* Virtual Keyboard Keys */
.virtual-key {
    padding: 10px;
    font-size: 20px;
    font-weight: bold;
    background-color: #333333;
    color: #EAEAEA;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.virtual-key:active {
    background-color: #5BC0BE;
    color: #181818;
}
