.game-media-gallery {
    width: 100%;
    position: relative;
}

.media-main-viewer {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    margin-bottom: 16px;
}

.media-main-viewer img,
.media-main-viewer iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.media-main-viewer .video-thumbnail {
    position: relative;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.media-main-viewer .video-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.media-main-viewer .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
}

.media-main-viewer .play-button::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 25px solid #fff;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    margin-left: 5px;
}

.media-main-viewer .video-thumbnail:hover .play-button {
    background: rgba(255, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.1);
}

.image-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    z-index: 999;
    border-radius: 4px;
    display: none;
    align-items: center;
    justify-content: center;
}

.image-fullscreen-btn:hover {
    background: rgba(0, 0, 0, 0.85);
}

.media-main-viewer:has(img:not(.video-thumbnail img)) .image-fullscreen-btn {
    display: flex;
}

.media-thumbnails-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: 0;
}

.media-thumbnails-wrapper.centered {
    display: flex;
    justify-content: center;
}

.media-thumbnails-wrapper.centered .thumb-nav-arrow {
    display: none;
}

.media-thumbnails {
    display: flex;
    gap: 8px;
    transition: transform 0.3s ease-out;
    width: fit-content;
}

.media-thumbnail-item {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.3s;
    opacity: 0.6;
    position: relative;
}

.media-thumbnail-item:hover {
    opacity: 1;
    border-color: #ddd;
}

.media-thumbnail-item.active {
    opacity: 1;
    border-color: #435ebe;
}

.media-thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.media-thumbnail-item.video::after {
    content: '▶';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 8px;
    border-radius: 2px;
}

.thumb-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    border-radius: 4px;
}

.thumb-nav-arrow:hover:not(:disabled) {
    background: rgba(0, 0, 0, 0.85);
}

.thumb-nav-arrow.prev {
    left: 0;
}

.thumb-nav-arrow.next {
    right: 0;
}

.thumb-nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .media-thumbnails-wrapper {
        padding: 0 38px;
    }
    
    .media-thumbnail-item {
        width: 60px;
        height: 60px;
    }

    .thumb-nav-arrow {
        width: 32px;
        height: 32px;
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .media-thumbnails-wrapper {
        padding: 0 34px;
    }
    
    .media-thumbnail-item {
        width: 50px;
        height: 50px;
    }

    .thumb-nav-arrow {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}