/* ==========================================
   GAMES GALLERY - Matches Gallery Styling
   ========================================== */

.games-container {
    padding: 0 10px;
    max-width: 100%;
    margin: 0 auto;
    display: none;
    position: relative;
}

.games-container.active {
    display: block;
}

.no-games {
    text-align: center;
    color: var(--secondary-text);
    font-size: 18px;
    padding: 60px 20px;
}

/* ==========================================
   VIEW TRANSITIONS
   ========================================== */

.games-grid-view {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.games-grid-view.hidden {
    opacity: 0;
    transform: translateY(-20px);
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    visibility: hidden;
}

/* Detail view - HIDDEN by default */
.games-detail-view {
    display: none !important;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Only show when .active class is added */
.games-detail-view.active {
    display: block !important;
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================
   BACK BUTTON
   ========================================== */

.games-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    margin-bottom: 24px;
    background: var(--card-bg);
    border: 1px solid var(--accent-subtle);
    border-radius: var(--border-radius-pill);
    color: var(--text-color);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.games-back-btn:hover {
    background: var(--accent-color);
    color: #fff;
    transform: translateX(-4px);
    box-shadow: var(--shadow);
}

.games-back-btn i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.games-back-btn:hover i {
    transform: translateX(-4px);
}

/* ==========================================
   GAMES SECTIONS
   ========================================== */

.games-section {
    margin-bottom: 40px;
}

.games-section:last-child {
    margin-bottom: 0;
}

.games-section-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 20px 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 16px;
}

.games-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--accent-subtle), transparent 80%);
}

/* ==========================================
   GAMES GRID - Matches Gallery Items
   ========================================== */

.games-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    padding: 0;
}

.game-card {
    position: relative;
    aspect-ratio: 2/3;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--card-bg);
    border: 1px solid var(--accent-subtle);
    box-shadow: var(--shadow);
    transition: all 0.4s var(--animation-smooth);
    transform-origin: center;
}

.game-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--animation-smooth);
}

.game-card:hover {
    transform: scale(1.06) translateY(-8px);
    z-index: 10;
    box-shadow:
        0 20px 40px -10px rgba(99, 97, 160, 0.4),
        0 0 30px rgba(166, 156, 210, 0.3);
    border-color: var(--accent-color);
}

.game-card:hover img {
    transform: scale(1.08);
}

.game-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 50px 12px 12px;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.6) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.game-card:hover .game-card-overlay {
    opacity: 1;
}

.game-card-title {
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* ==========================================
   GAME TAGS
   ========================================== */

.game-tag {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--border-radius-pill);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tag-ntr {
    background: linear-gradient(135deg, #ff4757, #ff6b81);
    color: #fff;
}

.tag-completed {
    background: linear-gradient(135deg, #2ed573, #7bed9f);
    color: #1a1a2e;
}

.tag-ongoing {
    background: linear-gradient(135deg, var(--accent-color), var(--main-color));
    color: #fff;
}

/* ==========================================
   GAME DETAIL VIEW
   ========================================== */

.game-detail-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    padding: 20px 0;
}

/* Media Section */
.game-media-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
    overflow: hidden;
}

.game-media-viewer {
    position: relative;
    width: 100%;
    max-height: 500px;
    aspect-ratio: 16/9;
    border-radius: var(--border-radius);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--accent-subtle);
}

.game-trailer,
.game-viewer-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.game-viewer-image {
    cursor: pointer;
}

.game-trailer-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s ease;
}

.game-trailer-play-overlay:hover {
    background: rgba(0, 0, 0, 0.3);
}

.game-trailer-play-overlay i {
    font-size: 60px;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.game-trailer-play-overlay:hover i {
    transform: scale(1.15);
}

/* Media Carousel (Trailer + Screenshots) */
.game-media-carousel {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 0;
    flex-shrink: 0;
}

.media-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 0;
    flex: 1;
    min-width: 0;
}

.media-track::-webkit-scrollbar {
    display: none;
}

.media-item {
    position: relative;
    flex: 0 0 auto;
    width: 140px;
    aspect-ratio: 16/9;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.media-item:hover {
    transform: scale(1.03);
    border-color: var(--accent-color);
}

.media-item.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

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

/* Video indicator on carousel thumbnail */
.media-item.is-video .video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 20px;
    color: #fff;
    background: rgba(0, 0, 0, 0.6);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.carousel-nav {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--card-bg-light);
    color: var(--text-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.carousel-nav:hover {
    background: var(--accent-color);
    color: #fff;
}

/* Info Section */
.game-info-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.game-detail-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}

.game-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.game-languages {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--secondary-text);
    font-size: 14px;
}

.languages-label {
    font-weight: 600;
}

.language-pill {
    display: inline-block;
    padding: 4px 12px;
    background: var(--card-bg-light);
    border-radius: var(--border-radius-pill);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color);
}

.game-description {
    color: var(--secondary-text);
    font-size: 15px;
    line-height: 1.8;
    margin: 0;
}

.game-stores {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--accent-subtle);
}

.store-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--main-color), var(--accent-color));
    color: #fff;
    text-decoration: none;
    border-radius: var(--border-radius-pill);
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.store-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.store-btn i {
    font-size: 18px;
}

/* ==========================================
   GAME CHARACTERS SECTION
   ========================================== */

.game-characters {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--accent-subtle);
}

.characters-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2.5px;
    color: var(--accent-color);
    margin: 0 0 14px 0;
}

.characters-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.character-icon-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.character-icon-card:hover {
    transform: translateY(-4px);
}

.character-icon-card img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-subtle);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
}

.character-icon-card:hover img {
    border-color: var(--accent-color);
    box-shadow: 0 4px 16px var(--accent-glow);
}

.character-icon-name {
    font-size: 11px;
    color: var(--secondary-text);
    text-align: center;
    max-width: 70px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ==========================================
   RESPONSIVE - Tablet
   ========================================== */

@media (max-width: 1024px) {
    .games-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
    }

    .game-detail-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .game-detail-title {
        font-size: 28px;
    }
}

/* ==========================================
   RESPONSIVE - Mobile
   ========================================== */

@media (max-width: 768px) {
    .games-container {
        padding: 0 8px;
    }

    .games-section {
        margin-bottom: 32px;
    }

    .games-section-title {
        font-size: 12px;
        letter-spacing: 1px;
        margin-bottom: 16px;
        gap: 12px;
    }

    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .game-card:hover {
        transform: scale(1.02);
    }

    .game-card-overlay {
        opacity: 1;
        padding: 30px 8px 8px;
    }

    .game-card-title {
        font-size: 12px;
    }

    .games-back-btn {
        padding: 10px 18px;
        font-size: 14px;
    }

    .game-detail-title {
        font-size: 24px;
    }

    .media-item {
        width: 120px;
    }

    .store-btn {
        padding: 10px 18px;
        font-size: 13px;
    }
}

/* ==========================================
   RESPONSIVE - Small Mobile
   ========================================== */

@media (max-width: 480px) {
    .games-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .game-trailer-play-overlay i {
        font-size: 40px;
    }

    .media-item {
        width: 100px;
    }

    .media-item.is-video .video-indicator {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .carousel-nav {
        width: 32px;
        height: 32px;
    }

    .game-detail-title {
        font-size: 20px;
    }
}

/* ==========================================
   LIGHTBOX
   ========================================== */

.games-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.games-lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--border-radius);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 40px;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
    opacity: 0.8;
}

.lightbox-close:hover {
    transform: scale(1.1);
    opacity: 1;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 24px;
    width: 50px;
    height: 50px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-nav:hover {
    background: var(--accent-color);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }

    .lightbox-close {
        top: 10px;
        right: 15px;
        font-size: 32px;
    }
}

/* ==========================================
   NTR LEVEL METER
   ========================================== */

.ntr-level-meter {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    background: linear-gradient(135deg, rgba(255,100,50,0.15), rgba(255,50,50,0.1));
    border: 1px solid rgba(255,100,50,0.3);
    border-radius: 20px;
    margin: 10px 0;
    width: fit-content;
}

.ntr-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ff6b35;
}

.ntr-flames {
    display: flex;
    gap: 2px;
}

.ntr-flame {
    font-size: 18px;
    filter: grayscale(100%) opacity(0.3);
    transition: all 0.3s ease;
}

.ntr-flame.active {
    filter: none;
    animation: flameGlow 1.5s ease-in-out infinite alternate;
}

@keyframes flameGlow {
    0% { filter: drop-shadow(0 0 3px #ff6b35); transform: scale(1); }
    100% { filter: drop-shadow(0 0 8px #ff4500); transform: scale(1.1); }
}
