/* =======================================
   MOBILE NAV FIX
   ======================================= */

.custom-scrollbar {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.custom-scrollbar::-webkit-scrollbar {
    display: none;
}

@media (max-width:768px) {

    nav .max-w-6xl {
        flex-wrap: wrap;
        gap: 12px;
    }

    nav .space-x-8,
    nav .gap-4 {
        gap: 10px !important;
    }

    nav .text-2xl {
        font-size: 1.3rem !important;
    }

    nav button {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

    .steam-nav-links {
        overflow-x: auto;
    }

    .bg-\[\#171a21\]::-webkit-scrollbar {
        display: none;
    }

    .w-56 {
        width: 180px !important;
    }
}

/* =====================================
   STEAM NAV MOBILE FIX
   ===================================== */

@media (max-width:768px) {

    /* search gets smaller */
    .steam-search {
        width: 120px !important;
        min-width: 120px !important;
    }

    /* menu can scroll */
    .custom-scrollbar {
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    .custom-scrollbar::-webkit-scrollbar {
        display: none;
    }

    /* menu items never shrink */
    .custom-scrollbar>* {
        flex-shrink: 0;
    }

    /* reduce nav padding */
    .bg-\[\#171a21\] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}

@media (max-width:480px) {

    .steam-search {
        width: 90px !important;
        min-width: 90px !important;
    }

    .steam-search input {
        font-size: 10px !important;
    }
}

/* Hide Steam search bar on phones */

@media (max-width:768px) {

    .flex.items-center.h-full.pr-1.flex-shrink-0 {
        display: none !important;
    }

}

/* =====================================
   GLOBAL RESPONSIVE SCALING
   ===================================== */

/* Desktop stays untouched */
@media (max-width:1200px) {

    html {
        font-size: 15px;
    }

    .max-w-6xl {
        max-width: 95% !important;
    }
}

/* Tablet */
@media (max-width:992px) {

    html {
        font-size: 14px;
    }

    .max-w-6xl {
        max-width: 98% !important;
    }
}

/* Mobile */
@media (max-width:768px) {

    html {
        font-size: 13px;
    }

    .max-w-6xl {
        width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Headings scale */
    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.2rem !important;
    }

}

/* Small phones */
@media (max-width:480px) {

    html {
        font-size: 12px;
    }

    .max-w-6xl {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

}


@media (max-width:768px) {

    .add-channel-wrapper button {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

}

@media (max-width:480px) {

    .add-channel-wrapper button {
        padding: 5px 8px !important;
        font-size: 9px !important;
    }

}

@media (max-width:768px) {

    .primary-sticky-nav .max-w-6xl {
        display: flex;
        justify-content: space-between;
        align-items: center;
        flex-wrap: nowrap;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 10px;
        flex-wrap: nowrap;
        min-width: 0;
    }

    .header-left .text-2xl {
        font-size: 1rem !important;
        flex-shrink: 0;
    }

    .nav-links {
        display: flex;
        gap: 8px !important;
        flex-wrap: nowrap !important;
        font-size: 10px !important;
    }

    .btn-full-text {
        display: none;
    }

    .btn-mobile-text {
        display: inline;
    }

    .add-channel-btn {
        padding: 4px 8px !important;
        min-width: auto !important;
    }
}

@media (max-width:768px) {

    .nav-links {
        gap: 8px !important;
        font-size: 11px !important;
    }

    .add-channel-wrapper button {
        padding: 4px 8px !important;
        font-size: 9px !important;
    }
}

.btn-mobile-text {
    display: none;
}

@media (max-width:768px) {

    .btn-full-text {
        display: none;
    }

    .btn-mobile-text {
        display: inline;
    }

    .add-channel-btn {
        padding: 4px 8px !important;
        min-width: auto !important;
    }
}

@media (max-width:768px) {

    #carouselTrack {
        flex-direction: column !important;
    }

    #carouselTrack .lg\:w-2\/3,
    #carouselTrack .lg\:w-1\/3 {
        width: 100% !important;
    }

    #creatorsRealContent {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    #creatorsRealContent a {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        font-size: 11px !important;
    }

    #calendarPage1,
    #calendarPage2 {
        grid-template-columns: 1fr !important;
    }
}


/* Featured Recommended */
#carouselTrack h3 {
    font-size: 1rem !important;
}

#carouselTrack {
    font-size: .85rem !important;
}

/* Daily Highlights */
#calendarPage1>div,
#calendarPage2>div {
    max-width: 420px;
    margin: auto;
}

/* Weekly Podium */
#creatorsRealContent a {
    max-width: 420px;
    margin: auto;
}


@media (max-width:768px) {

    .hero-btn {
        padding: 8px 14px !important;
        font-size: 11px !important;
        min-width: 130px !important;
    }

}

@media (max-width:480px) {

    .hero-btn {
        padding: 7px 12px !important;
        font-size: 10px !important;
        min-width: 110px !important;
    }

}

@media (max-width:768px) {

    .hero-buttons button {
        padding: 8px 14px !important;
        font-size: 11px !important;
        min-width: 120px !important;
    }

}

@media (max-width:480px) {

    .hero-buttons button {
        padding: 6px 10px !important;
        font-size: 10px !important;
        min-width: 100px !important;
    }

}

@media (max-width:768px) {

    /* Reduce overall carousel height */
    #carouselTrack {
        min-height: 240px !important;
    }

    /* Make right panel more compact */
    #carouselTrack .lg\:w-1\/3 {
        padding: 10px !important;
    }

    /* Smaller creator name */
    #creatorLabelName,
    #creatorGameHeader {
        font-size: 0.8rem !important;
        line-height: 1.1 !important;
    }

    /* Smaller recommendation text */
    .recommendation-text,
    .carousel-description {
        font-size: 0.65rem !important;
        line-height: 1.2 !important;
    }

    /* Smaller tags */
    #carouselTagsContainer span {
        font-size: 0.6rem !important;
        padding: 3px 6px !important;
    }

    /* Hide the bottom status text on phones */
    .carousel-footer,
    .now-playing-text {
        display: none !important;
    }
}

@media (max-width:768px) {

    #thumbnailsContainer {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
    }

    #thumbnailsContainer div {
        aspect-ratio: 16/9 !important;
    }

}

@media (max-width:768px) {

    #creatorGameHeader {
        font-size: .8rem !important;
    }

    #creatorLabelName {
        font-size: .7rem !important;
    }

    #mainVideoTitle {
        font-size: .75rem !important;
        line-height: 1.1 !important;
    }

}

@media (max-width:768px) {

    #thumbnailsContainer {
        display: none !important;
    }

}


@media (max-width:480px) {

    #mainVideoTitle {
        font-size: 12px !important;
    }

    #creatorGameHeader {
        font-size: 12px !important;
    }

    #carouselTrack p {
        font-size: 9px !important;
    }

    .carousel-sidebar {
        padding: 8px !important;
    }

}

/* Ensure uniformity across both pages */
#creatorsGridContainer {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* --- Tablet & Mobile Grid Layout Configurations --- */
@media (max-width: 767px) {

    #registryRealContent,
    #creatorsRealContent,
    #creatorsGridContainer {
        /* Enforces exactly 2 columns side-by-side on all phone screens */
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
        padding: 0 4px !important;
    }

    #creatorsGridContainer {
        display: grid !important;
    }

    /* Force real cards to stretch seamlessly into the 2-column tracks */
    #creatorsRealContent a,
    #registryRealContent a {
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        font-size: 11px !important;
        height: auto !important;
    }

    #registrySkeleton {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        padding: 0 8px !important;
    }

    #registrySkeleton .creator-grid-card {
        height: auto !important;
        min-height: 0 !important;
        min-width: 0 !important;
        margin: 0 !important;
        width: 100% !important;
    }

    #registrySkeleton .creator-grid-card>div:first-child {
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        min-height: 0 !important;
        width: 100% !important;
    }

    #registrySkeleton .info-text-area {
        flex-grow: 0 !important;
        padding: 10px !important;
    }

    #registrySkeleton .info-text-area .mb-4 {
        margin-bottom: 10px !important;
    }
}

/* Restore creator card sizing from the original creator page/responsive rules. */
#registryRealContent {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

#registryRealContent .creator-grid-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    height: auto !important;
    font-size: inherit !important;
}

#registryRealContent .creator-grid-card>div:first-child {
    height: 260px !important;
    min-height: 260px !important;
}

#registryRealContent .creator-grid-card img {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
}

@media (max-width: 767px) {
    #registryRealContent {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        padding: 0 8px !important;
        min-width: 0 !important;
    }

    #registryRealContent .creator-grid-card>div:first-child {
        aspect-ratio: 1 / 1 !important;
        height: auto !important;
        min-height: 0 !important;
        width: 100% !important;
    }

    #registryRealContent .creator-grid-card img {
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
        object-fit: contain !important;
        padding: 10px !important;
    }

    #registryRealContent .info-text-area {
        padding: 10px !important;
        min-width: 0 !important;
    }

    #registryRealContent .info-text-area h4 {
        font-size: 12px !important;
        line-height: 1.15 !important;
    }

    #registryRealContent .info-text-area p {
        font-size: 9px !important;
        line-height: 1.25 !important;
    }

    #registryRealContent .info-text-area .flex.text-xs.font-bold {
        align-self: flex-start !important;
        width: auto !important;
        max-width: max-content !important;
        font-size: 9px !important;
        line-height: 1 !important;
    }

    #registryRealContent .steam-green-tag,
    #registryRealContent .steam-dark-tag,
    #registryRealContent .info-text-area .bg-\[\#26262b\] {
        padding-left: 7px !important;
        padding-right: 7px !important;
        white-space: nowrap !important;
    }

    #registryRealContent .steam-dark-tag {
        flex: 0 0 auto !important;
        min-width: auto !important;
    }
}

@media (max-width: 300px) {
    #registryRealContent .creator-grid-card img,
    #registrySkeleton .creator-grid-card>div:first-child .skeleton-pulse {
        padding: 8px !important;
    }

    #registryRealContent .info-text-area,
    #registrySkeleton .info-text-area {
        padding: 8px !important;
    }

    #registryRealContent .info-text-area h4 {
        font-size: 11px !important;
    }

    #registryRealContent .info-text-area p {
        font-size: 8px !important;
    }

    #registryRealContent .info-text-area .flex.text-xs.font-bold {
        font-size: 8px !important;
    }

    #registryRealContent .steam-green-tag,
    #registryRealContent .steam-dark-tag,
    #registryRealContent .info-text-area .bg-\[\#26262b\] {
        padding-left: 5px !important;
        padding-right: 5px !important;
    }
}

@media (min-width: 768px) {
    #registryRealContent {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 16px !important;
        padding: 0 !important;
    }
}

/* Header specific tweaks */
@media (max-width: 640px) {
    .flex-wrap {
        justify-content: center !important;
        text-align: center;
    }
}

/* Desktop Widescreen Layout Fixes (Untouched at 4 Columns) */
#registryRealContent:not(.hidden),
#creatorsRealContent:not(.hidden) {
    display: grid !important;
}

@media (min-width: 768px) {

    #registryRealContent,
    #creatorsRealContent {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 768px) {

    /* Prevent the logo container in the navbar from restricting layout bounds */
    .header-left img {
        flex-shrink: 0 !important;
        max-width: 100px !important;
        height: 32px !important;
        width: auto !important;
    }

    .header-left {
        gap: 12px !important;
    }
}

/* --- Mobile Utility Resizing Overrides --- */
@media (max-width: 767px) {

    /* Collapse metrics standalone grid rows into a stack on mobile */
    .grid-cols-1.md\:grid-cols-4 {
        grid-template-columns: 1fr !important;
    }

    .big-number {
        font-size: 2.5rem !important;
    }

    .glass-card {
        padding: 1rem !important;
    }

    h1 {
        font-size: 1.5rem !important;
        padding-left: 0.75rem !important;
    }
}

@media (max-width: 640px) {
    #addChannelModal>div {
        width: 90% !important;
        margin: 0 1rem;
        padding: 1.5rem !important;
    }
}

@media (max-width: 480px) {
    .btn-full-text {
        display: none;
    }

    .btn-mobile-text {
        display: inline !important;
    }
}

@media (min-width: 481px) {
    .btn-mobile-text {
        display: none !important;
    }
}

.glass-card {
    height: auto !important;
    min-height: 80px;
}

@media (max-width:768px) {
    #sponsorBackground {
        background-size: 150% auto !important;
        background-repeat: no-repeat !important;
        background-position: center center !important;
        background-color: #0d0d11;
    }

    #sponsorBanner {
        height: 220px !important;
        min-height: 220px !important;
    }

    #sponsorTitle {
        font-size: 2.8rem !important;
        line-height: 0.9 !important;
    }

    #sponsorSubtitle {
        font-size: 0.9rem !important;
        line-height: 1.4 !important;
        max-width: 90% !important;
    }
}

@media (max-width:480px) {
    #sponsorBanner {
        height: 200px !important;
        min-height: 180px !important;
    }

    #sponsorTitle {
        font-size: 2.2rem !important;
    }

    #sponsorSubtitle {
        font-size: 0.8rem !important;
    }
}
