body {
    font-family: "Montserrat", sans-serif;
}

button {
    all: unset;
}

header {
    padding: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    box-shadow: 0px 4px 7px 0px #00000008;
}

    header .header-wrapper {
        padding: 0 16px;
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    header .logo {
        width: 24px;
        height: 24px;
    }

    header .icon-search {
        all: unset;
        width: 24px;
        height: 24px;
    }

    header .leaderboard-cta {
        width: 26px;
        height: 26px;
    }

.btn-open-search {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.input-search-desktop {
    display: none;
}

/* Search Bar Styles */
.search-bar {
    transform: translateY(-100%);
    transition: transform 0.3s ease-in-out;
    position: relative;
    z-index: 10;
}

.search-bar-visible {
    transform: translateY(80px);
}

.search-bar-wrapper {
    padding: 12px 16px;
    max-width: 100%;
    margin: 0 auto;
}

.search-input-group {
    display: flex;
    align-items: center;
    border-radius: 100px;
    padding: 6px 24px;
    border: solid 1px;
    transition: border-color 0.2s ease-in-out;
}

    .search-input-group:focus-within {
        box-shadow: 0 0 0 2px rgba(47, 128, 237, 0.1);
    }

.search-input {
    flex: 1;
    border: none;
    background: transparent;
    font-family: Montserrat;
    font-weight: 600;
    font-size: 14px;
    line-height: 28px;
    letter-spacing: 0;
    vertical-align: middle;
    color: #33313B;
    outline: none;
    padding: 4px 0;
}

    .search-input::placeholder {
        color: #999999;
        font-weight: 400;
    }

.search-submit-btn {
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .search-submit-btn:active {
        transform: translateY(0);
    }

    .search-submit-btn i {
        font-size: 14px;
    }

/* Responsive adjustments */
@media (min-width: 768px) {
    .search-bar-wrapper {
        padding: 16px 24px;
    }

    .search-input-group {
        padding: 12px 16px;
    }

    .search-input {
        font-size: 16px;
    }

    .search-submit-btn {
        min-width: 48px;
        height: 40px;
    }

        .search-submit-btn i {
            font-size: 16px;
        }
}

@media (min-width: 1024px) {
    .search-bar {
        display: none;
    }

    .btn-open-search {
        display: none;
    }

    .input-search-desktop {
        border-radius: 100px;
        padding: 6px 24px;
        display: flex;
        background-color: #E8E8E8;
        gap: 17px;
    }
}

footer {
    all: unset;
    background: #FCFCFC;
    opacity: 1;
    padding: 12px 16px;
    gap: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

    footer .cta-group-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        width: 100%;
        max-width: 1024px;
        justify-content: space-between;
    }

    footer .cta-group-item {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }

        footer .cta-group-item h3 {
            font-family: Montserrat;
            font-weight: 700;
            font-size: 14px;
            line-height: 28px;
            letter-spacing: 0px;
            color: #33313B;
            margin-bottom: 8px;
        }

        footer .cta-group-item a {
            all: unset;
            font-family: Montserrat;
            font-weight: 500;
            font-size: 14px;
            line-height: 100%;
            letter-spacing: 0px;
            color: #33313B;
            text-decoration: none;
            cursor: pointer;
        }

    footer .logo {
        all: unset;
    }

    footer span {
        font-weight: 400;
        font-size: 14px;
        line-height: 26px;
        letter-spacing: 0px;
        text-align: center;
        color: #33313B;
    }

    footer .logo-wrapper {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        max-width: 1024px;
    }

    footer .cta-social {
        all: unset;
        height: 20px;
        cursor: pointer;
    }

        footer .cta-social img {
            height: 100%;
        }

@media (min-width: 768px) {
    footer .cta-group-wrapper {
        grid-template-columns: unset;
        grid-template-rows: repeat(1, 1fr);
        grid-auto-flow: column;
        justify-content: space-around;
    }

    footer .logo-wrapper {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
}

section {
    padding: 0 16px;
}

#page-content {
    background-color: #E8E8E8;
}

.page-content {
    all: unset;
}

#page-content .main-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 75px;
    padding-top: 16px;
}

.container {
    all: unset;
    width: 100vw;
}

.theme-banner {
    all: unset;
    padding: 0 16px;
}

#theme-banner a {
    width: 100%;
}

#theme-banner img {
    border-radius: 13px;
    aspect-ratio: 16/9;
    width: 100%;
    object-fit: cover;
}

@media (min-width: 1024px) {
    #theme-banner img {
        aspect-ratio: 267 / 80;
    }
}

.banner-item {
    display: flex;
    width: 100%;
    justify-content: center;
}

.categories-wrapper {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    width: 100%;
}

.category-2-wrapper {
    display: none;
}

/* Custom Select Styling */
.custom-select {
    position: relative;
    width: 100%;
    cursor: pointer;
}

    .custom-select.category-1 .select-trigger {
        justify-content: space-between;
        display: flex;
        align-items: center;
        opacity: 1;
        padding-top: 6px;
        padding-right: 8px;
        padding-bottom: 6px;
        padding-left: 10px;
        border-radius: 8px;
        width: 100%;
        background: linear-gradient(180deg, #2F80ED 0%, #0E63D5 100%);
        background-color: #0E63D5;
        font-family: Montserrat;
        font-weight: 600;
        font-size: 12px;
        line-height: 100%;
        color: #F3F3F3;
        box-sizing: border-box;
    }

    @media (min-width: 1024px) {
        .custom-select.category-1 .select-trigger {
            min-width: 150px
        }
    }

    .custom-select.category-2 .select-trigger {
        justify-content: space-between;
        display: flex;
        align-items: center;
        opacity: 1;
        padding-top: 6px;
        padding-right: 8px;
        padding-bottom: 6px;
        padding-left: 10px;
        border-radius: 8px;
        width: 100%;
        background-color: #33313B;
        font-family: Montserrat;
        font-weight: 600;
        font-size: 12px;
        line-height: 100%;
        color: #F3F3F3;
        box-sizing: border-box;
    }

.select-arrow {
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='23' height='22' viewBox='0 0 23 22' fill='none'%3E%3Cpath d='M8.48368 10.7342L10.8579 13.1084C11.2154 13.4659 11.7929 13.4659 12.1504 13.1084L14.5245 10.7342C15.102 10.1567 14.6895 9.16675 13.8737 9.16675H9.12535C8.30952 9.16675 7.90618 10.1567 8.48368 10.7342Z' fill='white'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.select-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    margin-top: 4px;
}

.custom-select.open .select-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.select-option {
    padding: 8px 12px;
    cursor: pointer;
    font-family: Montserrat;
    font-weight: 500;
    font-size: 12px;
    color: #333;
    transition: background-color 0.15s ease;
}

    .select-option:hover {
        background-color: #f5f5f5;
    }

    .select-option:first-child {
        border-radius: 8px 8px 0 0;
    }

    .select-option:last-child {
        border-radius: 0 0 8px 8px;
    }

    .select-option:only-child {
        border-radius: 8px;
    }

    .select-option.selected {
        background-color: #e3f2fd;
        color: #1976d2;
        font-weight: 600;
    }

/* Scrollbar styling for dropdown */
.select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.select-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.select-dropdown::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

    .select-dropdown::-webkit-scrollbar-thumb:hover {
        background: #a8a8a8;
    }

.custom-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

/* Accessibility improvements */
.custom-select:focus-within .select-trigger {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

.select-option:focus {
    background-color: #e3f2fd;
    outline: none;
}

.games-list-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.grid-games-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .grid-games-container h2 {
        all: unset;
        font-family: Montserrat;
        font-weight: 700;
        font-size: 16px;
        line-height: 170%;
        letter-spacing: 0;
        color: #33313B;
    }

/* Grid Games Styling - Mobile First */
.grid-games {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    width: 100%;
}

.game-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    padding-bottom: 32px;
}

.game-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    position: relative;
    transition: transform 0.2s ease-in-out;
}

    .game-link:hover {
        transform: scale(1.02);
    }

    .game-link:active {
        transform: scale(0.98);
    }

.game-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: opacity 0.2s ease-in-out;
    aspect-ratio: 2 / 1;
}

.game-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 16px 8px 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    border-radius: 0 0 8px 8px;
    padding-bottom: 10px;
}

.game-label {
    position: absolute;
    bottom: -10px;
    border-radius: 11px;
    padding: 2px 8px;
    font-family: Montserrat;
    font-weight: 600;
    font-size: 8px;
    line-height: 170%;
    letter-spacing: 0;
    width: fit-content;
    height: fit-content;
    left: 50%;
    -webkit-transform: translateX(-50%);
    transform: translateX(-50%)
}

    .game-label.download {
        background: linear-gradient(109.54deg, #FFC107 0%, #C5921D 100%);
        color: #FFFFFF;
        white-space: nowrap;
    }

    .game-label.play {
        background: linear-gradient(109.54deg, #8000FF 0%, #5D00BB 100%);
        color: #FFFFFF;
        white-space: nowrap;
    }

.game-link:hover .game-title {
    opacity: 1;
}

/* Loading state */
.game-image[src=""] {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .game-image[src=""]:before {
        content: "Loading...";
        color: #999;
        font-size: 12px;
    }

/* Shimmer loading effect for images */
.game-image.shimmer-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    position: relative;
    overflow: hidden;
}

    .game-image.shimmer-loading::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.4) 50%, transparent 100%);
        animation: shimmer-overlay 1.5s infinite;
    }

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes shimmer-overlay {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
    .grid-games {
        gap: 12px;
    }

    .game-title {
        font-size: 14px;
        padding: 20px 12px 12px;
    }

    .game-label {
        position: absolute;
        bottom: -10px;
        border-radius: 11px;
        padding: 2px 12px;
        font-family: Montserrat;
        font-weight: 700;
        font-size: 12px;
        line-height: 170%;
        letter-spacing: 0;
        width: fit-content;
        height: fit-content;
        left: 50%;
        -webkit-transform: translateX(-50%);
        transform: translateX(-50%);
    }
}

@media (min-width: 1024px) {
    .grid-games {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        grid-auto-flow: column;
        gap: 16px;
        overflow-x: auto;
        overflow-y: hidden;
        width: 100%;
        scroll-behavior: smooth;
        cursor: grab;
        user-select: none;
        -webkit-overflow-scrolling: touch;
    }

        .grid-games::-webkit-scrollbar {
            display: none;
        }

        .grid-games.dragging {
            cursor: grabbing;
            scroll-behavior: auto;
        }

            .grid-games.dragging .game-item {
                pointer-events: none;
            }

            .grid-games.dragging .game-link {
                user-select: none;
                pointer-events: none;
            }

    .game-item {
        width: 200px;
        min-width: 200px;
    }

    .game-title {
        font-size: 16px;
        padding: 24px 16px 16px;
    }
}

/* Template Variations */
/* Featured Game Template */
.game-featured {
    grid-column: span 2; /* Takes 2 columns for featured items */
}

    .game-featured .game-image {
        aspect-ratio: 16/9; /* Banner ratio for featured games */
    }

/* Detailed Game Template */
.game-detailed .game-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px 12px 12px;
    border-radius: 0 0 8px 8px;
}

.game-detailed .game-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 4px;
    opacity: 1; /* Always visible for detailed template */
    position: static;
    background: none;
    padding: 0;
}

.game-detailed .game-category {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 400;
}

/* Clean template - no additional styles needed, just hides title */

/* Categories Grid Styling - Mobile First */
.categories-list-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0;
}

.grid-categories-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .grid-categories-container h2 {
        all: unset;
        font-family: Montserrat;
        font-weight: 700;
        font-size: 16px;
        line-height: 170%;
        letter-spacing: 0;
        color: #33313B;
    }

.grid-categories {
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-auto-flow: column;
    gap: 16px;
    width: 100%;
    padding: 0 16px;
    overflow-x: auto;
}

    .grid-categories::-webkit-scrollbar {
        display: none;
    }

.category-item {
    width: 41vw;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #FFFFFF;
    box-shadow: 0px 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

    .category-item:hover {
        transform: translateY(-2px);
        box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.12);
    }

    .category-item:active {
        transform: translateY(0);
    }

.category-link {
    display: flex;
    flex-direction: column;
    align-items: start;
    text-decoration: none;
    padding: 14px 18px;
    height: 100%;
    color: inherit;
}

.category-image {
    width: 30px;
    height: 30px;
    overflow: hidden;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .category-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.category-name {
    font-family: Montserrat;
    font-weight: 600;
    font-size: 14px;
    line-height: 170%;
    letter-spacing: 0%;
    color: #33313B;
    word-break: break-word;
    hyphens: auto;
}

/* Loading state for category images */
.category-image img[src=""] {
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .category-image img[src=""]:before {
        content: "🎮";
        font-size: 24px;
    }

/* Error state fallback */
.category-image img[onerror] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* Image Error Placeholder Styles */
.game-image.image-error-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 24px !important;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

    .game-image.image-error-placeholder::before {
        content: '🎮';
        font-size: 32px;
        opacity: 0.8;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
    }

.image-error-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 32px;
    opacity: 0.8;
    pointer-events: none;
    z-index: 1;
}

/* Enhanced error state for game images */
.game-item .game-image.image-error-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

    .game-item .game-image.image-error-placeholder::after {
        content: 'Image not available';
        position: absolute;
        bottom: 8px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 10px;
        color: rgba(255, 255, 255, 0.8);
        font-weight: 500;
        text-align: center;
        line-height: 1.2;
    }

/* Responsive adjustments for larger screens */
@media (min-width: 768px) {
    .category-item {
        width: 25vw;
    }

    .category-link {
        padding: 20px 16px;
    }

    .category-image {
        width: 56px;
        height: 56px;
        margin-bottom: 12px;
    }

    .category-name {
        font-size: 14px;
    }
}

@media (min-width: 1024px) {
    .categories-wrapper {
        width: fit-content;
    }

    .custom-select.category-2 {
        display: none;
    }

    .category-2-wrapper {
        display: flex;
        flex-direction: row;
        gap: 16px;
        align-items: center;
    }

    .btn-category-2 {
        white-space: nowrap;
        opacity: 1;
        border-radius: 8px;
        padding-top: 10px;
        padding-right: 12px;
        padding-bottom: 10px;
        padding-left: 12px;
        background-color: #33313B;
        font-family: Montserrat;
        font-weight: 600;
        font-size: 13px;
        line-height: 100%;
        letter-spacing: 0;
        color: #F3F3F3;
        text-align: center;
        cursor: pointer;
    }

    .grid-categories {
        display: grid;
        grid-template-rows: repeat(2, 1fr);
        grid-auto-flow: column;
        gap: 24px;
        overflow-x: auto;
        overflow-y: hidden;
        width: calc(100% - 32px);
        scroll-behavior: smooth;
        cursor: grab;
        user-select: none;
        -webkit-overflow-scrolling: touch;
    }

        .grid-categories::-webkit-scrollbar {
            height: 8px;
        }

        .grid-categories::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }

        .grid-categories::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
            transition: background 0.2s ease;
        }

            .grid-categories::-webkit-scrollbar-thumb:hover {
                background: #a8a8a8;
            }

        .grid-categories.dragging {
            cursor: grabbing;
            scroll-behavior: auto;
        }

            .grid-categories.dragging .category-item {
                pointer-events: none;
            }

            .grid-categories.dragging .category-link {
                user-select: none;
                pointer-events: none;
            }

    .category-item {
        width: 200px;
        min-width: 200px;
    }

    .category-link {
        padding: 24px 20px;
    }

    .category-image {
        width: 64px;
        height: 64px;
        margin-bottom: 16px;
    }

    .category-name {
        font-size: 14px;
        font-weight: 600;
    }
}

/* Loading Skeleton Styles */
.loading-skeleton {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    padding-bottom: 0;
    background: #f8f9fa;
    min-height: 100px; /* Ensure skeleton has visible height */
    display: block; /* Make sure it's visible */
}

.skeleton-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
    display: block; /* Make sure it's visible */
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* Error State Styles */
.error-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.7;
}

.error-message {
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    line-height: 1.4;
}

.retry-button {
    background: linear-gradient(109.54deg, #FFC107 0%, #C5921D 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
}

    .retry-button:hover {
        transform: scale(1.05);
    }

    .retry-button:active {
        transform: scale(0.95);
    }

/* Loading State for Container */
.grid-games.loading .game-item:not(.loading-skeleton) {
    display: none;
}

.grid-games.error .game-item:not(.error-state) {
    display: none;
}

/* Desktop Sidebar Styles */
.desktop-sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    height: calc(100vh - 75px);
    width: 280px;
    background: #ffffff;
    z-index: 100;
    transition: all 0.3s ease-in-out;
    display: none; /* Hidden by default, shown only on desktop */
    flex-direction: column;
}

    .desktop-sidebar span {
        display: block;
    }

.sidebar-toggle {
    position: absolute;
    bottom: 20px;
    right: 0;
    width: 40px;
    height: 40px;
    background: #2F80ED;
    border-radius: 8px 0 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    z-index: 101;
}

    .sidebar-toggle:hover {
        background: #0E63D5;
        transform: translateX(2px);
    }

    .sidebar-toggle i {
        color: white;
        font-size: 16px;
        transition: transform 0.3s ease-in-out;
    }

.sidebar-content {
    padding: 20px 0;
    height: 100%;
    overflow-y: auto;
}

.sidebar-header {
    padding: 0 20px 20px;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 20px;
}

    .sidebar-header h3 {
        font-family: Montserrat;
        font-weight: 700;
        font-size: 18px;
        color: #33313B;
        margin: 0;
    }

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: #33313B;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    font-family: Montserrat;
    font-weight: 500;
    font-size: 14px;
}

    .sidebar-nav-item:hover {
        background: #f5f5f5;
        color: #2F80ED;
        transform: translateX(4px);
    }

    .sidebar-nav-item i {
        width: 20px;
        text-align: center;
        font-size: 16px;
        transition: color 0.2s ease-in-out;
    }

    .sidebar-nav-item span {
        transition: opacity 0.3s ease-in-out;
    }

/* Collapsed state */
.desktop-sidebar.collapsed {
    width: 60px;
}

    .desktop-sidebar.collapsed .sidebar-header h3 {
        opacity: 0;
        pointer-events: none;
    }

    .desktop-sidebar.collapsed .sidebar-nav-item span {
        opacity: 0;
        pointer-events: none;
    }

    .desktop-sidebar.collapsed .sidebar-nav-item {
        justify-content: center;
        padding: 12px;
    }

        .desktop-sidebar.collapsed .sidebar-nav-item:hover {
            transform: none;
        }

    .desktop-sidebar.collapsed .sidebar-toggle i {
        transform: rotate(180deg);
    }

    .desktop-sidebar.collapsed span {
        display: none;
    }

/* Page content adjustment when sidebar is present */
.main-wrapper {
    transition: margin-left 0.3s ease-in-out;
}

    .main-wrapper.sidebar-collapsed {
        margin-left: 60px;
    }

footer.sidebar-collapsed {
    margin-left: 60px;
}
/* Show sidebar only on desktop */
@media (min-width: 1024px) {
    .desktop-sidebar {
        display: flex;
    }

    .main-wrapper {
        margin-left: 280px;
    }

    footer {
        margin-left: 280px;
    }
}

/* Mobile Sidebar Styles */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 280px;
    background: #ffffff;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.mobile-sidebar.open {
    transform: translateX(0);
}

.mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.mobile-sidebar-overlay.open {
    opacity: 1;
    visibility: visible;
}

.mobile-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.mobile-sidebar-header h3 {
    font-family: Montserrat;
    font-weight: 700;
    font-size: 18px;
    color: #33313B;
    margin: 0;
    padding: 0;
}

.mobile-sidebar-close {
    width: 32px;
    height: 32px;
    background: #e8e8e8;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease-in-out;
}

.mobile-sidebar-close:hover {
    background: #d0d0d0;
}

.mobile-sidebar-close i {
    color: #666;
    font-size: 14px;
}

.mobile-sidebar-content {
    padding: 20px 0;
    height: 100%;
    overflow-y: auto;
    flex: 1;
}

.mobile-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 0 12px;
}

.mobile-sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    text-decoration: none;
    color: #33313B;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    font-family: Montserrat;
    font-weight: 500;
    font-size: 16px;
}

.mobile-sidebar-nav-item:hover {
    background: #f5f5f5;
    color: #2F80ED;
    transform: translateX(4px);
}

.mobile-sidebar-nav-item i {
    width: 24px;
    text-align: center;
    font-size: 18px;
    transition: color 0.2s ease-in-out;
}

/* Mobile hamburger menu button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s ease-in-out;
}

.mobile-menu-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

.mobile-menu-toggle i {
    font-size: 20px;
    color: #33313B;
}

/* Hide sidebar on mobile and tablet */
@media (max-width: 1023px) {
    .desktop-sidebar {
        display: none !important;
    }

    .main-wrapper {
        margin-left: 0 !important;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 1023px) {
    #new-games-grid .game-item:nth-child(n+4) { 
        display: none;
    }
    #hot-games-grid .game-item:nth-child(n+7) {
        display: none;
    }
    #top-games-grid .game-item:nth-child(n+7) {
        display: none;
    }
    #play-win-games-grid .game-item:nth-child(n+7) {
        display: none;
    }
}

@media (min-width: 1024px) {
    .mobile-sidebar{
        display: none;
    }
    #mobile-sidebar-overlay {
        display: none;
    }
}

.sidebar-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.desktop-sidebar.collapsed .sidebar-nav-item {
    padding: 12px 0;
}

.section-title-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.section-title-container a {
    font-weight: 700;
}

.hide-scrollbar {
    /* Mengaktifkan scroll */
    overflow: auto; /* atau overflow-y: scroll */
    /* Untuk Firefox */
    scrollbar-width: none;
    /* Untuk Internet Explorer dan Edge lama */
    -ms-overflow-style: none;
}

    /* Untuk Chrome, Safari, dan Opera */
    .hide-scrollbar::-webkit-scrollbar {
        display: none;
    }


#loading-overlay {
    position: fixed;
    inset: 0; /* top, right, bottom, left = 0 */
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

/* Spinner */
.spinner {
    width: 60px;
    height: 60px;
    border: 8px solid #e0e0e0;
    border-top: 8px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Lock page while loading */
body.loading {
    overflow: hidden;
}

    /* Disable interaction */
    body.loading * {
        pointer-events: none;
    }

    /* Allow spinner to work */
    body.loading #loading-overlay,
    body.loading #loading-overlay * {
        pointer-events: auto;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal-icon-overlapped .modal-info-content {
    position: relative;
    overflow: visible;
    padding-top: 50px;
}

.modal-icon-overlapped .modal-info-icon {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.modal-icon-overlapped .modal-info-icon img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    display: block;
}

/* Modal close button styling */
.modal-content .modal-close-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: #2F80ED;
    z-index: 100;
    transition: all 0.2s ease;
    padding: 0;
    font-family: Arial, sans-serif;
}

.modal-content .modal-close-btn:hover {
    color: #0E63D5 ;
    transform: scale(1.1);
}

.modal-content .modal-close-btn:active {
    transform: scale(0.95);
}

.modal-content .modal-close-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}