.games-container {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #1a1a1a;
}

.games-grid {
    position: absolute;
    top: 90px;
    margin-left: auto;
    margin-right: auto;
}

.game-item {
    text-align: center;
    color: #eaeaea;
    cursor: pointer;
    width: 200px;
    padding-top: 15px;
    opacity: 0;
    z-index: top;
    transition: all 0.3s ease !important;
}

.game-item.show {
    animation: fadeIn 0.5s forwards;
    animation-delay: calc((var(--i) * 0.01s) + 0.25s);
}

.game-item:hover {
    background-color: #34a8ebc1;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.85);
        filter: blur(15px);
        pointer-events: none;
    }
    100% {
        opacity: 1;
        filter: blur(0px);
        pointer-events: auto;
    }
}

.game-item p {
    text-decoration: none;
    color: inherit;
}

.game-item img {
    max-width: 150px;
    height: 150px;
    border-radius: 8px;
}

.game-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 150px;
    width: 150px;
    margin: 0 auto;
    border-radius: 8px;
}

.game-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    pointer-events: auto;
    background-color: rgba(0, 0, 0, 0.8);
    transition: all 0.2s ease;
    opacity: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(40px);
}

.game-modal.closed {
    opacity: 0;
    pointer-events: none;
}

.game-modal-content {
    overflow: hidden;
    border-radius: 20px;
    background-color: #0a0a0a;
    margin: 15% auto;
    width: 100%;
    height: fit-content;
    max-width: 1000px;
    color: #333;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(100, 100, 100, 0.5);
}

.modal-frame iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border: none;
    border-bottom: 2px solid #333;
}

.game-modal-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
}

.game-modal-controls h2 {
    color: #eaeaea;
    text-shadow: #34a8eb50 0px 0px 10px;
    font-size: 16px;
    margin: 0;
}

.controls span {
    background-color: #34a8eb;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    user-select: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.controls span:hover {
    background-color: #34a8eb50;
}

/* Search */

.search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
}

.search {
    opacity: 0;
    width: 0;
    transition: all 0.4s ease;
    padding: 0px;
    pointer-events: none;
    outline: none;
    border: none;
}

.search:focus,
.search:active,
.search[placeholder]:not(:placeholder-shown) {
    opacity: 1;
    width: 200px;
    padding: 10px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    border-radius: 5px;
    pointer-events: auto;
    outline: none;
}

.search:focus ~ .close-search,
.search:active ~ .close-search,
.search[placeholder]:not(:placeholder-shown) ~ .close-search {
    display: block;
}

.close-search {
    display: none;
}
