
/* =========================================================
   ALL GAMES PAGE - INFINITE GAME
   Premium Clear Glassmorphism Design
   ========================================================= */



/* =========================================================
   SECTION 01 - PAGE BASE & DESIGN VARIABLES
   ========================================================= */

.all-games-page {
    --ag-glass: rgba(255, 255, 255, 0.075);
    --ag-glass-hover: rgba(255, 255, 255, 0.13);
    --ag-glass-border: rgba(255, 255, 255, 0.16);

    --ag-purple: #8667ff;
    --ag-blue: #43a5ff;

    --ag-text: #ffffff;
    --ag-muted: rgba(230, 232, 255, 0.88);

    --ag-transition: 0.28s ease;

    min-height: 100vh;
    margin: 0;
    padding: 0;

    font-family: var(--font-body, "Inter"), sans-serif;
    color: var(--ag-text);

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.all-games-page *,
.all-games-page *::before,
.all-games-page *::after {
    box-sizing: border-box;
}

.all-games-page button,
.all-games-page input {
    font-family: var(--font-body, "Inter"), sans-serif;
}

.all-games-page h1,
.all-games-page h2,
.all-games-page h3 {
    font-family: var(--font-heading, "Outfit"), sans-serif;
}

.all-games-page [hidden] {
    display: none !important;
}

.all-games-wrapper {
    width: 100%;
    max-width: 1800px;
    min-height: 100vh;

    margin: 0 auto;
    padding: 24px 32px 50px;
}



/* =========================================================
   SECTION 02 - TOP BAR LAYOUT
   ========================================================= */

.all-games-topbar {
    position: relative;
    z-index: 20;

    display: flex;
    align-items: center;
    gap: 14px;

    width: 100%;
    margin-bottom: 25px;
}


/* =========================================================
   SECTION 03 - BACK ARROW + HOME BUTTON
   ========================================================= */

.all-games-home-btn {
    flex: 0 0 auto;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;

    min-width: 105px;
    height: 48px;
    padding: 0 16px;

    border: 1px solid var(--ag-glass-border);
    border-radius: 14px;

    background: var(--ag-glass);

    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 5px 18px rgba(0, 0, 0, 0.10);

    color: #ffffff;
    text-decoration: none;

    font-size: 14px;
    font-weight: 650;

    transition: all var(--ag-transition);
}

.home-back-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    font-size: 22px;
    line-height: 1;
    font-weight: 500;

    transition: transform var(--ag-transition);
}

.all-games-home-btn:hover {
    background: var(--ag-glass-hover);

    border-color: rgba(190, 170, 255, 0.48);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        0 0 22px rgba(134, 103, 255, 0.18);

    transform: translateY(-2px);
}

.all-games-home-btn:hover .home-back-arrow {
    transform: translateX(-3px);
}


/* =========================================================
   SECTION 04 - MAIN SEARCH BAR
   ========================================================= */

.all-games-search {
    position: relative;

    display: flex;
    align-items: center;
    gap: 12px;

    flex: 1;
    min-width: 0;
    height: 48px;

    padding: 0 17px;

    border: 1px solid var(--ag-glass-border);
    border-radius: 15px;

    background: var(--ag-glass);

    backdrop-filter: blur(25px) saturate(155%);
    -webkit-backdrop-filter: blur(25px) saturate(155%);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 5px 22px rgba(0, 0, 0, 0.10);

    transition: all var(--ag-transition);
}

.all-games-search:hover {
    background: var(--ag-glass-hover);

    border-color: rgba(180, 160, 255, 0.42);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 0 20px rgba(134, 103, 255, 0.13);
}

.all-games-search:focus-within {
    background: rgba(255, 255, 255, 0.12);

    border-color: rgba(177, 157, 255, 0.72);

    box-shadow:
        0 0 0 3px rgba(134, 103, 255, 0.13),
        0 0 26px rgba(134, 103, 255, 0.20);
}

.all-games-search .search-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 21px;
    height: 21px;
    flex: 0 0 21px;

    color: #b5a5ff;
}

.all-games-search .search-icon svg {
    width: 100%;
    height: 100%;
}

.all-games-search input {
    flex: 1;
    min-width: 0;
    height: 100%;

    padding: 0;

    border: none;
    outline: none;

    background: transparent;
    color: #ffffff;

    font-size: 15px;
    font-weight: 500;
}

.all-games-search input::placeholder {
    color: rgba(230, 231, 255, 0.68);
    opacity: 1;
}

.all-games-search input::-webkit-search-cancel-button {
    display: none;
}


/* =========================================================
   SECTION 05 - CLEAR SEARCH BUTTON
   ========================================================= */

.clear-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 28px;
    height: 28px;
    flex: 0 0 28px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;

    font-size: 21px;
    cursor: pointer;

    transition: all var(--ag-transition);
}

.clear-search-btn:hover {
    background: rgba(134, 103, 255, 0.30);
    transform: rotate(90deg);
}


/* =========================================================
   SECTION 06 - MAIN CONTENT LAYOUT
   ========================================================= */

.all-games-layout {
    display: grid;

    grid-template-columns: 245px minmax(0, 1fr);

    align-items: start;
    gap: 24px;

    width: 100%;
}


/* =========================================================
   SECTION 07 - LEFT GLASS SIDEBAR
   ========================================================= */

.all-games-sidebar {
    position: sticky;
    top: 20px;

    display: flex;
    flex-direction: column;

    height: calc(100vh - 120px);
    min-height: 350px;
    max-height: 850px;

    overflow: hidden;

    border: 1px solid var(--ag-glass-border);
    border-radius: 20px;

    background: rgba(25, 25, 58, 0.42);

    backdrop-filter: blur(28px) saturate(150%);
    -webkit-backdrop-filter: blur(28px) saturate(150%);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 12px 35px rgba(0, 0, 0, 0.18);

    transition: border-color var(--ag-transition);
}

.all-games-sidebar:hover {
    border-color: rgba(180, 160, 255, 0.30);
}


/* =========================================================
   SECTION 08 - FIXED ALL GAMES AREA
   ========================================================= */

.sidebar-fixed {
    position: relative;
    z-index: 2;

    flex: 0 0 auto;

    padding: 14px 12px 12px;

    border-bottom: 1px solid rgba(255, 255, 255, 0.13);

    background: rgba(255, 255, 255, 0.045);

    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
}


/* =========================================================
   SECTION 09 - CATEGORY BUTTON DESIGN
   ========================================================= */

.sidebar-category {
    position: relative;

    display: flex;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 45px;

    padding: 10px 13px;

    border: 1px solid transparent;
    border-radius: 12px;

    background: rgba(255, 255, 255, 0.018);

    color: #e0e2f5;

    text-align: left;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;

    transition: all var(--ag-transition);
}

.sidebar-category:hover {
    background: rgba(255, 255, 255, 0.095);

    border-color: rgba(255, 255, 255, 0.16);

    color: #ffffff;

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 4px 15px rgba(0, 0, 0, 0.10);

    transform: translateX(3px);
}

.sidebar-category:active {
    transform: scale(0.98);
}

.sidebar-category.active {
    background:
        linear-gradient(
            110deg,
            rgba(134, 103, 255, 0.32),
            rgba(67, 165, 255, 0.16)
        );

    border-color: rgba(175, 153, 255, 0.42);

    color: #ffffff;

    box-shadow:
        inset 3px 0 0 #967aff,
        inset 0 1px 0 rgba(255, 255, 255, 0.10),
        0 4px 18px rgba(134, 103, 255, 0.10);
}

.sidebar-category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 23px;
    height: 23px;
    flex: 0 0 23px;

    overflow: hidden;

    font-size: 17px;
}

.sidebar-category-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sidebar-category span:last-child {
    overflow: hidden;

    text-overflow: ellipsis;
    white-space: nowrap;
}


/* =========================================================
   SECTION 10 - SCROLLABLE CATEGORY AREA
   ========================================================= */

.sidebar-scroll-area {
    flex: 1 1 auto;
    min-height: 0;

    overflow-x: hidden;
    overflow-y: auto;

    padding: 10px 12px 14px;

    scrollbar-width: thin;
    scrollbar-color: rgba(134, 103, 255, 0.55) transparent;
}

.sidebar-scroll-area::-webkit-scrollbar {
    width: 5px;
}

.sidebar-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-scroll-area::-webkit-scrollbar-thumb {
    background: rgba(134, 103, 255, 0.42);
    border-radius: 10px;
}

.sidebar-scroll-area::-webkit-scrollbar-thumb:hover {
    background: rgba(134, 103, 255, 0.75);
}

.sidebar-category-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-empty-message {
    padding: 15px 8px;

    color: var(--ag-muted);
    text-align: center;
    font-size: 13px;
}


/* =========================================================
   SECTION 11 - RIGHT GAMES CONTENT
   ========================================================= */

.all-games-content {
    min-width: 0;
    width: 100%;
}



/* =========================================================
   SECTION 12 - GAMES HEADING
   ========================================================= */

.all-games-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;

    margin-bottom: 20px;
    padding: 4px 2px;
}

.all-games-heading h1 {
    margin: 0 0 7px;

    color: #ffffff;
    font-family: var(--font-heading, "Outfit"), sans-serif;

    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.4px;
    line-height: 1.25;
}

.all-games-heading p {
    margin: 0;

    color: rgba(240, 238, 255, 0.90);
    font-family: var(--font-body, "Inter"), sans-serif;

    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
}

.games-result-count {
    flex: 0 0 auto;

    padding: 8px 13px;

    border: 1px solid rgba(255, 255, 255, 0.17);
    border-radius: 20px;

    background: rgba(255, 255, 255, 0.08);

    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);

    color: #ffffff;
    font-family: var(--font-body, "Inter"), sans-serif;

    font-size: 12px;
    font-weight: 700;
}




/* =========================================================
   SECTION 13 - GAMES GRID
   ========================================================= */

.all-games-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));

    gap: 14px;
    width: 100%;
}



/* =========================================================
   SECTION 14 - GAME CARD GLASS DESIGN
   ========================================================= */

.all-games-grid .game-card {
    position: relative;

    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;
    max-width: none;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;

    background: rgba(255, 255, 255, 0.065);

    backdrop-filter: blur(20px) saturate(145%);
    -webkit-backdrop-filter: blur(20px) saturate(145%);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 7px 22px rgba(0, 0, 0, 0.12);

    cursor: pointer;

    transition: all 0.3s ease;
}

.all-games-grid .game-card:hover {
    transform: translateY(-5px);

    background: rgba(255, 255, 255, 0.105);

    border-color: rgba(175, 155, 255, 0.48);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.14),
        0 12px 30px rgba(0, 0, 0, 0.20),
        0 0 20px rgba(134, 103, 255, 0.15);
}


/* =========================================================
   SECTION 15 - GAME THUMBNAIL
   ========================================================= */

.all-games-grid .game-art {
    position: relative;

    width: 100%;
    aspect-ratio: 1 / 1;

    overflow: hidden;

    background: rgba(255, 255, 255, 0.035);
}

.all-games-grid .game-art img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: contain;

    transition: transform 0.35s ease;
}

.all-games-grid .game-card:hover .game-art img {
    transform: scale(1.05);
}



/* =========================================================
   SECTION 16 - GAME INFORMATION
   ========================================================= */

.all-games-grid .game-info {
    display: flex;
    flex-direction: column;
    gap: 7px;

    min-width: 0;
    padding: 9px 10px 11px;
}

.all-games-grid .game-info h3 {
    display: -webkit-box;

    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;

    overflow: hidden;
    margin: 0;

    color: #ffffff;
    font-family: var(--font-heading, "Outfit"), sans-serif;

    font-size: 14px;
    font-weight: 700;
    line-height: 1.4;
}



/* =========================================================
   SECTION 17 - CATEGORY BADGE & FAVORITE BUTTON
   ========================================================= */

.all-games-grid .game-category-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.all-games-grid .game-category-badge {
    display: inline-flex;
    align-items: center;

    max-width: calc(100% - 35px);
    overflow: hidden;

    padding: 5px 9px;

    border: 1px solid rgba(185, 165, 255, 0.28);
    border-radius: 20px;

    background: rgba(134, 103, 255, 0.17);

    color: #e0d8ff;

    font-size: 10px;
    font-weight: 650;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.all-games-grid .favorite-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 30px;
    height: 30px;
    flex: 0 0 30px;

    padding: 0;

    border: none;
    border-radius: 50%;

    background: transparent;

    color: #d4d7ed;

    cursor: pointer;

    transition: all var(--ag-transition);
}

.all-games-grid .favorite-btn:hover {
    color: #ff668c;
    transform: scale(1.12);
}

.all-games-grid .favorite-btn.active {
    color: #ff668c;
}


/* =========================================================
   SECTION 18 - GAME PLAY COUNT
   ========================================================= */

.all-games-grid .game-meta {
    display: flex;
    align-items: center;
    gap: 6px;

    color: rgba(230, 232, 255, 0.78);

    font-size: 12px;
    font-weight: 500;
}

.all-games-grid .game-meta .all-games-play-icon {
    display: block;
    width: 15px;
    height: 15px;
    flex: 0 0 15px;
    object-fit: contain;
}


/* =========================================================
   SECTION 19 - LOADING STATE
   ========================================================= */

.all-games-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 13px;

    min-height: 250px;

    color: var(--ag-muted);
    font-size: 14px;
}

.games-loader {
    width: 35px;
    height: 35px;

    border: 3px solid rgba(255, 255, 255, 0.12);

    border-top-color: var(--ag-purple);
    border-right-color: var(--ag-blue);

    border-radius: 50%;

    animation: allGamesSpin 0.8s linear infinite;
}

@keyframes allGamesSpin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   SECTION 20 - NO GAMES FOUND
   ========================================================= */

.all-games-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    min-height: 280px;
    padding: 30px 15px;

    border: 1px dashed rgba(255, 255, 255, 0.18);
    border-radius: 18px;

    background: rgba(255, 255, 255, 0.045);

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    text-align: center;
}

.empty-games-icon {
    margin-bottom: 13px;

    font-size: 40px;
    opacity: 0.8;
}

.all-games-empty h2 {
    margin: 0 0 8px;

    color: #ffffff;
    font-size: 20px;
    font-weight: 700;
}

.all-games-empty p {
    margin: 0;

    color: var(--ag-muted);
    font-size: 14px;
}


/* =========================================================
   SECTION 21 - LOAD MORE BUTTON
   ========================================================= */

.load-more-container {
    display: flex;
    justify-content: center;

    width: 100%;
    margin-top: 32px;
}

.load-more-btn {
    min-width: 185px;
    min-height: 44px;

    padding: 0 24px;

    border: 1px solid rgba(190, 174, 255, 0.40);
    border-radius: 12px;

    background:
        linear-gradient(
            110deg,
            rgba(134, 103, 255, 0.34),
            rgba(67, 165, 255, 0.19)
        );

    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        0 5px 20px rgba(0, 0, 0, 0.12);

    color: #ffffff;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;

    transition: all var(--ag-transition);
}

.load-more-btn:hover {
    transform: translateY(-2px);

    background:
        linear-gradient(
            110deg,
            rgba(134, 103, 255, 0.48),
            rgba(67, 165, 255, 0.30)
        );

    border-color: rgba(205, 190, 255, 0.60);

    box-shadow:
        0 8px 25px rgba(134, 103, 255, 0.20);
}

.load-more-btn:active {
    transform: scale(0.98);
}



/* =========================================================
   SECTION 22 - KEYBOARD ACCESSIBILITY
   ========================================================= */

.all-games-page button:focus-visible,
.all-games-page a:focus-visible {
    outline: 2px solid #a38aff;
    outline-offset: 3px;
}

/* Remove square outline from search input */

.all-games-search input:focus,
.all-games-search input:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}



/* =========================================================
   SECTION 23 - LAPTOP RESPONSIVE
   ========================================================= */

@media (max-width: 1100px) {
    .all-games-wrapper {
        padding-left: 24px;
        padding-right: 24px;
    }

    .all-games-layout {
        grid-template-columns: 225px minmax(0, 1fr);
        gap: 18px;
    }

    .all-games-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 13px;
    }
}


/* =========================================================
   SECTION 24 - TABLET RESPONSIVE
   ========================================================= */

@media (max-width: 900px) {
    .all-games-wrapper {
        padding: 20px;
    }

    .all-games-layout {
        grid-template-columns: 190px minmax(0, 1fr);
        gap: 16px;
    }

    .all-games-sidebar {
        height: calc(100vh - 105px);
    }

    .all-games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .all-games-heading h1 {
        font-size: 26px;
    }
}


/* =========================================================
   SECTION 25 - MOBILE TOP BAR
   ========================================================= */

@media (max-width: 650px) {

    .all-games-wrapper {
        padding: 14px 13px 35px;
    }

    .all-games-topbar {
        gap: 9px;
        margin-bottom: 17px;
    }

    .all-games-home-btn {
        min-width: 84px;
        height: 44px;

        padding: 0 11px;
        gap: 6px;

        font-size: 12px;
    }

    .home-back-arrow {
        font-size: 19px;
    }

    .all-games-search {
        height: 44px;
        padding: 0 11px;
        gap: 8px;
    }

    .all-games-search input {
        font-size: 12px;
    }

}


/* =========================================================
   SECTION 26 - MOBILE SIDEBAR & CATEGORY SCROLL
   ========================================================= */

@media (max-width: 650px) {

    .all-games-layout {
        display: flex;
        flex-direction: column;
        gap: 17px;
    }

    .all-games-sidebar {
        position: relative;
        top: auto;

        width: 100%;
        height: auto;
        min-height: 0;
        max-height: none;

        border-radius: 15px;
    }

    .sidebar-fixed {
        padding: 9px 10px;
    }

    .sidebar-fixed .sidebar-category {
        width: 100%;
        min-height: 40px;
    }

    .sidebar-scroll-area {
        flex: 0 0 auto;

        width: 100%;
        max-height: 115px;

        overflow-x: hidden;
        overflow-y: auto;

        padding: 8px 10px;
    }

    .sidebar-category-list {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 8px;
    }

    .sidebar-category {
        min-height: 39px;
        padding: 8px 9px;

        font-size: 12px;
    }

    .sidebar-category-icon {
        width: 20px;
        height: 20px;
        flex-basis: 20px;

        font-size: 15px;
    }

}


/* =========================================================
   SECTION 27 - MOBILE GAMES GRID
   ========================================================= */

@media (max-width: 650px) {

    .all-games-content {
        width: 100%;
    }

    .all-games-heading {
        margin-bottom: 15px;
    }

    .all-games-heading h1 {
        font-size: 22px;
    }

    .all-games-heading p {
        font-size: 12px;
    }

    .games-result-count {
        padding: 6px 9px;
        font-size: 10px;
    }

    .all-games-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 11px;
    }

    .all-games-grid .game-card {
        border-radius: 13px;
    }

    .all-games-grid .game-info {
        padding: 9px 9px 11px;
    }

    .all-games-grid .game-info h3 {
        font-size: 13px;
        font-weight: 700;
    }

    .all-games-grid .game-category-badge {
        padding: 4px 7px;
        font-size: 9px;
    }

    .all-games-grid .favorite-btn {
        width: 26px;
        height: 26px;
        flex-basis: 26px;
    }

    .all-games-grid .game-meta {
        font-size: 11px;
        font-weight: 500;
    }

}


/* =========================================================
   SECTION 28 - SMALL MOBILE RESPONSIVE
   ========================================================= */

@media (max-width: 380px) {

    .all-games-wrapper {
        padding-left: 10px;
        padding-right: 10px;
    }

    .all-games-topbar {
        gap: 7px;
    }

    .all-games-home-btn {
        min-width: 76px;
        padding: 0 8px;
        font-size: 11px;
    }

    .all-games-search {
        padding: 0 9px;
    }

    .all-games-search input {
        font-size: 11px;
    }

    .all-games-grid {
        gap: 9px;
    }

    .all-games-grid .game-info {
        padding: 8px;
    }

}


/* =========================================================
   SECTION 29 - REDUCED MOTION ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .all-games-page *,
    .all-games-page *::before,
    .all-games-page *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

}


/* =========================================================
   END OF ALL GAMES CSS
   ========================================================= */
