:root {
    --channels-panel: #fff;
    --channels-text: #201e19;
    --channels-muted: #5c564a;
    --channels-line: #e6e0d3;
    --channels-gold: #775215;
    --channels-selected: #f3e9d0;
}
[data-theme="dark"] {
    --channels-panel: var(--brand-surface);
    --channels-text: var(--brand-text);
    --channels-muted: var(--brand-muted);
    --channels-line: var(--brand-edge);
    --channels-gold: var(--brand-gold);
    --channels-selected: var(--brand-raised);
}
.channels-page { max-width: 1520px; margin-inline: auto; padding: 22px clamp(20px, 3.1vw, 54px) 48px; color: var(--channels-text); }
.channels-page [hidden] { display: none !important; }
.channels-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.channels-heading h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); line-height: 1.1; letter-spacing: -.05em; }
.channels-heading h2 { font-size: clamp(1.24rem, 2.5vw, 1.6rem); letter-spacing: -.035em; }
.channels-outline, .channels-watch, .channels-categories button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: .875rem;
    font-weight: 700;
    color: var(--channels-text);
    cursor: pointer;
    text-decoration: none;
    background: var(--channels-panel);
    border: 1px solid var(--channels-line);
    border-radius: 8px;
    padding: 0 12px;
    min-height: 40px;
}
.channels-outline:hover, .channels-categories button:hover { border-color: var(--channels-gold); }
.channels-page :focus-visible { outline: 2px solid var(--channels-gold); outline-offset: 3px; }
.channels-categories { display: flex; overflow-x: auto; gap: 7px; padding: 4px 4px 11px; margin: 15px -4px 8px; scrollbar-width: thin; }
.channels-categories button { flex: none; border-radius: 999px; white-space: nowrap; }
.channels-categories button[aria-pressed="true"] { background: var(--channels-selected); color: var(--channels-gold); border-color: var(--channels-gold); }
.channels-showcase { display: grid; grid-template-columns: minmax(0, 2.4fr) minmax(290px, 1fr); align-items: start; gap: 16px; }
.channels-showcase:has(.channels-recommended[hidden]) { grid-template-columns: minmax(0, 1fr); }
.channels-spotlight {
    position: relative;
    display: grid;
    align-items: end;
    min-height: clamp(365px, 34vw, 520px);
    isolation: isolate;
    overflow: hidden;
    border-radius: 14px;
    background: #1c1a13;
    color: #fff7e9;
    border: 1px solid #3d3726;
}
.channels-feature-cover, .channels-card-cover { position: relative; display: grid; place-items: center; background: radial-gradient(ellipse at 68% 35%, #544328, var(--brand-ink) 74%); overflow: hidden; }
.channels-feature-cover { position: absolute; inset: 0; z-index: -1; }
.channels-feature-cover::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, color-mix(in srgb, var(--brand-ink) 85%, transparent), color-mix(in srgb, var(--brand-ink) 45%, transparent) 27%, transparent 61%);
}
.channels-feature-cover img, .channels-card-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.channels-feature-cover img { object-position: center 40%; }
.channels-feature-cover img.is-portrait { object-fit: contain; background: var(--brand-ink); }
.channels-feature-cover span, .channels-card-cover > span:first-child { color: #edd29b; font-size: 2.3rem; font-weight: 800; }
.channels-feature-cover span { font-size: clamp(2.5rem, 8vw, 6rem); }
.channels-feature-cover:has(img:not([hidden])) > span { visibility: hidden; }
.channels-feature-content { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap; gap: 18px; padding: clamp(17px, 3vw, 38px); }
.channels-feature-copy { display: grid; justify-items: start; gap: 10px; max-width: 34rem; text-shadow: 0 1px 8px color-mix(in srgb, var(--brand-ink) 73%, transparent); }
.channels-feature-copy h2 { font-size: clamp(1.65rem, 4.3vw, 4rem); line-height: 1.02; letter-spacing: -.055em; overflow-wrap: anywhere; }
.channels-feature-copy p { color: var(--brand-text); font-size: .875rem; line-height: 1.5; overflow-wrap: anywhere; }
.channels-watch { background: var(--brand-gold); border-color: var(--brand-gold); color: var(--brand-ink); text-shadow: none; }
.channels-watch:hover { background: #ffda8e; }
.channels-live-label { display: inline-block; color: #fff; background: #b92440; font-size: .75rem; font-weight: 800; padding: 4px 6px; border-radius: 5px; }
.channels-feature-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.channels-feature-dots { display: flex; align-items: center; margin-inline-start: -8px; }
.channels-feature-dots button, .channels-feature-step, .channels-rotation {
    display: grid;
    place-items: center;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.channels-feature-dots button { width: 25px; height: 30px; border-radius: 50%; }
.channels-feature-dots button::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ffffff73;
}
.channels-feature-dots button:hover::before { background: #ffffffbf; }
.channels-feature-dots button[aria-current="true"]::before { background: #fff; width: 11px; height: 11px; }
.channels-feature-steps { display: flex; gap: 8px; }
.channels-feature-step, .channels-rotation {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: #ffffff24;
}
.channels-feature-step:hover, .channels-rotation:hover { background: #ffffff40; }
.channels-feature-step span {
    width: 8px;
    height: 8px;
    border-top: 1.5px solid currentColor;
    border-right: 1.5px solid currentColor;
    transform: translateX(-2px) rotate(45deg);
}
.channels-feature-step:first-child span { transform: translateX(2px) rotate(-135deg); }
.channels-rotation { position: absolute; top: 13px; right: 13px; font-size: .8125rem; background: color-mix(in srgb, var(--brand-ink) 22%, transparent); }
.channels-total, .channels-card small { color: var(--channels-muted); font-size: .8125rem; }
.channels-message { padding: 16px; border-radius: 10px; border: 1px solid var(--channels-line); background: var(--channels-panel); color: var(--channels-muted); }
.channels-showcase:has(.channels-spotlight:not([hidden])) + .channels-message { margin-top: 14px; }
.channels-list { margin-top: 22px; border-top: 1px solid var(--channels-line); padding-top: 19px; }
.channels-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.channels-card { display: grid; align-content: start; gap: 7px; min-width: 0; color: inherit; text-decoration: none; border-radius: 9px; }
.channels-card:hover .channels-card-cover { outline: 1px solid var(--channels-gold); }
.channels-card strong, .channels-card small { overflow-wrap: anywhere; }
.channels-card-cover { aspect-ratio: 16 / 9; border: 1px solid var(--channels-line); border-radius: 9px; }
.channels-card-cover .channels-live-label { position: absolute; inset: 8px auto auto 8px; }
.channels-recommended { min-width: 0; padding: 13px; border: 1px solid var(--channels-line); border-radius: 14px; background: var(--channels-panel); }
.channels-recommended h2 { font-size: 1rem; margin-bottom: 10px; }
.channels-recommended-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.channels-recommended .channels-card strong { font-size: .875rem; }
.channels-recommended .channels-card-cover { aspect-ratio: 16 / 10; }
.channels-recommended .channels-card-cover .channels-live-label { inset: 5px auto auto 5px; font-size: .6875rem; }
@media (max-width: 900px) {
    .channels-showcase { grid-template-columns: minmax(0, 1fr); }
    .channels-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .channels-page { padding: 14px 14px 30px; }
    .channels-spotlight { min-height: 350px; }
    .channels-feature-cover::after { background: linear-gradient(0deg, color-mix(in srgb, var(--brand-ink) 85%, transparent), color-mix(in srgb, var(--brand-ink) 43%, transparent) 37%, transparent 73%); }
    .channels-feature-content { gap: 12px; }
    .channels-feature-copy { gap: 7px; }
    .channels-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
}

.channels-mobile-overlay, .channels-mobile-feed { display: none; }

@media (max-width: 700px), (max-width: 1000px) and (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
    body:has(#channelDiscovery:not([hidden])) #footerAd,
    body:has(#channelDiscovery:not([hidden])) #mrsukanPopupAd,
    body:has(#channelDiscovery:not([hidden])) .explore-footer { display: none; }

    body:has(#channelDiscovery:not([hidden])) .explore-nav {
        position: absolute;
        inset: 0 0 auto;
        padding-top: calc(var(--video-header-top-padding, 8px) + env(safe-area-inset-top, 0px));
        border: 0;
    }
    body:has(#channelDiscovery:not([hidden])) .explore-search-label {
        background: #1718159c;
        border-color: #ffffff36;
    }
    body:has(#channelDiscovery:not([hidden])) .explore-search input::placeholder {
        color: #f4ead7d9;
    }

    #channelDiscovery {
        position: relative;
        display: flex;
        flex-direction: column;
        height: 100dvh;
        padding: 0;
        background: #000;
    }
    #channelDiscoveryTitle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
    #channelGoLive { display: none; }
    .channels-categories { flex-wrap: nowrap; margin: 5px 0 4px; padding: 2px; scrollbar-width: none; touch-action: pan-x; }
    .channels-categories button { min-height: 36px; }
    .channels-showcase, .channels-list { display: none; }
    .channels-mobile-overlay {
        display: block;
        position: absolute;
        z-index: 2;
        top: var(--channels-mobile-nav, 59px);
        inset-inline: 0;
        padding: 2px 10px 0;
        pointer-events: none;
    }
    #channelDiscovery:has(.channels-mobile-discover[open], .channels-mobile-feed[hidden]) .channels-mobile-overlay {
        position: relative;
        inset: auto;
        flex: 0 0 auto;
        margin-top: var(--channels-mobile-nav, 59px);
        margin-bottom: 7px;
    }
    #channelDiscovery:has(.channels-mobile-discover[open]) .channels-mobile-feed {
        border-radius: 14px 14px 0 0;
    }
    .channels-mobile-discover {
        position: relative;
        margin: 0 6px 5px;
        text-align: center;
    }
    .channels-mobile-discover summary {
        display: inline-flex;
        min-height: 44px;
        align-items: center;
        list-style: none;
        cursor: pointer;
        padding-inline: 6px;
        pointer-events: auto;
    }
    .channels-mobile-discover-pill {
        display: inline-flex;
        align-items: center;
        min-height: 26px;
        gap: 5px;
        padding-inline: 8px;
        border-radius: 999px;
        color: #fff9ed;
        background: #171815a6;
        font-size: .75rem;
        font-weight: 650;
    }
    .channels-mobile-discover summary::-webkit-details-marker { display: none; }
    .channels-mobile-discover-pill::after {
        content: "";
        width: 5px;
        height: 5px;
        transform: rotate(45deg);
        border-bottom: 1px solid currentColor;
        border-right: 1px solid currentColor;
    }
    .channels-mobile-discover[open] summary { display: none; }
    .channels-mobile-panel {
        pointer-events: auto;
        margin-top: 4px;
        max-height: min(42dvh, 330px);
        overflow-y: auto;
        overscroll-behavior-y: contain;
        padding: 9px 0 0;
    }
    .channels-mobile-following { margin-bottom: 7px; text-align: start; }
    .channels-mobile-following h2 { margin: 3px 2px 6px; font-size: .875rem; }
    .channels-mobile-avatars {
        display: flex;
        gap: 11px;
        overflow-x: auto;
        padding: 4px 3px 7px;
        scrollbar-width: none;
        touch-action: pan-x;
    }
    .channels-mobile-avatar {
        display: grid;
        flex: 0 0 66px;
        justify-items: center;
        align-content: start;
        gap: 5px;
        min-width: 0;
        color: var(--channels-muted);
        font-size: .75rem;
        text-decoration: none;
    }
    .channels-mobile-avatar.is-live { color: var(--channels-text); }
    .channels-mobile-avatar-photo {
        position: relative;
        width: 58px;
        height: 58px;
        display: grid;
        place-items: center;
        border: 2px solid var(--channels-line);
        border-radius: 50%;
        background: var(--channels-selected);
        color: var(--channels-gold);
        font-size: 1.05rem;
        font-weight: 750;
    }
    .channels-mobile-avatar.is-live .channels-mobile-avatar-photo { border-color: #d8495f; margin-bottom: 5px; }
    .channels-mobile-avatar-photo img { position: absolute; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
    .channels-mobile-avatar-photo small {
        position: absolute;
        bottom: -6px;
        inset-inline: 4px;
        border-radius: 5px;
        padding: 2px 1px;
        background: #b92440;
        color: #fff;
        font-size: .625rem;
        text-align: center;
        white-space: nowrap;
    }
    .channels-mobile-avatar-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .channels-mobile-follow-message {
        font: inherit;
        font-size: .8125rem;
        text-align: start;
        color: var(--channels-muted);
        background: transparent;
        border: 0;
    }
    button.channels-mobile-follow-message { cursor: pointer; color: var(--channels-gold); min-height: 38px; }
    .channels-mobile-feed {
        display: block;
        flex: 1;
        min-height: 0;
        overflow: hidden;
        touch-action: none;
        touch-action: pinch-zoom;
        background: #171813;
    }
    .channels-mobile-slide {
        height: 100%;
        position: relative;
        isolation: isolate;
        display: flex;
        align-items: end;
        overflow: hidden;
        color: #fff8eb;
        background: #000;
    }
    .channels-mobile-media { pointer-events: none; position: absolute; inset: 0; z-index: -1; display: grid; place-items: center; }
    .channels-mobile-media > span { font-size: 4rem; color: #e9c87d; }
    .channels-mobile-media img, .channels-mobile-media video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .channels-mobile-media video { opacity: 0; }
    .channels-mobile-media video.is-playing { opacity: 1; }
    .channels-mobile-media:has(video.is-playing) img, .channels-mobile-media:has(img) > span { visibility: hidden; }
    .channels-mobile-media::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(0deg, #000b, #0005 14%, transparent 38%);
    }
    .channels-mobile-details { position: relative; padding: 13px 14px calc(14px + env(safe-area-inset-bottom)); width: 100%; }
    .channels-mobile-details h2 { margin: 5px 0; font-size: clamp(1.25rem, 6vw, 1.75rem); line-height: 1.12; overflow-wrap: anywhere; }
    .channels-mobile-details p { font-size: .875rem; line-height: 1.35; color: var(--brand-text); }
    .channels-mobile-entry { margin-bottom: clamp(14px, 3dvh, 26px); }
    .channels-mobile-actions { display: flex; justify-content: center; gap: 10px; }
    .channels-mobile-details .channels-watch, .channels-mobile-rotate {
        min-height: 44px;
        border: 1px solid #ffffff57;
        border-radius: 999px;
        background: #25252599;
        color: #fff;
    }
    .channels-mobile-details .channels-watch { gap: 9px; padding-inline: 17px; }
    .channels-mobile-details .channels-watch:hover, .channels-mobile-rotate:hover { background: #3b3b3b; }
    .channels-enter-icon {
        width: 14px;
        height: 15px;
        background: linear-gradient(var(--brand-gold),var(--brand-gold)) left bottom / 3px 45%,
                    linear-gradient(var(--brand-gold),var(--brand-gold)) center bottom / 3px 100%,
                    linear-gradient(var(--brand-gold),var(--brand-gold)) right bottom / 3px 68%;
        background-repeat: no-repeat;
    }
    @media (prefers-reduced-motion: no-preference) {
        .channels-enter-icon { animation: channels-live-bars 1.2s ease-in-out infinite; }
    }
    @keyframes channels-live-bars {
        0%, 100% { background-size: 3px 45%, 3px 100%, 3px 68%; }
        25% { background-size: 3px 82%, 3px 62%, 3px 38%; }
        50% { background-size: 3px 62%, 3px 36%, 3px 96%; }
        75% { background-size: 3px 32%, 3px 76%, 3px 55%; }
    }
    .channels-mobile-rotate {
        display: none;
        place-items: center;
        width: 44px;
        flex: 0 0 44px;
        position: relative;
        cursor: pointer;
    }
    .channels-mobile-details .channels-mobile-rotate-hint,
    .channels-mobile-swipe { display: block; text-align: center; margin: 6px 0 0; color: #eee; font-size: .75rem; }
    @media (orientation: portrait) {
        .channels-mobile-slide[data-orientation="landscape"] .channels-mobile-media :is(img, video) {
            object-fit: contain;
            object-position: center max(0px, calc(50% - var(--live-video-lift)));
        }
        .channels-mobile-slide[data-orientation="landscape"] .channels-mobile-rotate { display: grid; }
    }
    @media (orientation: landscape) {
        .channels-mobile-slide .channels-mobile-media :is(img, video) { object-fit: contain; object-position: center; }
        .channels-mobile-slide[data-orientation="portrait"] .channels-mobile-rotate { display: grid; }
    }
    .channels-showcase:has(.channels-spotlight:not([hidden])) + .channels-message { margin-top: 0; }
    #channelStatus { order: 1; }
}

#mobileSearchToggle { display: none; }

@media (max-width: 700px), (max-width: 1000px) and (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
    .explore-nav {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        gap: 2px;
        padding-inline: 6px;
        color: #fff9ed;
        background: #000;
    }
    .explore-nav .explore-brand, .explore-nav .explore-account { display: none; }
    .explore-nav .explore-menu, #mobileSearchToggle {
        display: grid;
        place-items: center;
        min-height: 44px;
        padding: 0;
        grid-row: 1;
        border: 0;
        background: transparent;
        color: inherit;
        cursor: pointer;
    }
    .explore-nav .explore-menu { grid-column: 1; font-size: 22px; }
    #mobileSearchToggle { grid-column: 3; }
    #mobileSearchToggle .explore-search-icon { width: 18px; height: 18px; border: 2px solid currentColor; }
    #mobileSearchToggle .explore-search-icon::after { width: 8px; height: 2px; right: -6px; bottom: -3px; background: currentColor; }
    .explore-nav .explore-nav-links { grid-area: 1 / 2; min-width: 0; }
    .explore-nav-links .explore-nav-icon { display: none; }
    .explore-nav .explore-nav-links a {
        position: relative;
        min-height: 44px;
        background: transparent;
        color: inherit;
        opacity: .75;
    }
    .explore-nav .explore-nav-links a[aria-current="page"] { opacity: 1; }
    .explore-nav-links a[aria-current="page"]::after {
        content: "";
        position: absolute;
        bottom: 2px;
        left: calc(50% - 9px);
        width: 18px;
        height: 2px;
        border-radius: 2px;
        background: currentColor;
    }
    .explore-nav .explore-search {
        display: none;
        position: absolute;
        inset: 100% 8px auto;
        background: var(--explore-surface);
        color: var(--explore-text);
        border-radius: 12px;
        box-shadow: 0 4px 14px #0003;
    }
    .explore-nav.search-open .explore-search { display: block; }
    .explore-search .search-results { width: 100%; }
    body:has(#channelDiscovery:not([hidden])) .explore-search-label { background: var(--explore-surface); }
    body:has(#channelDiscovery:not([hidden])) .explore-search input::placeholder { color: var(--explore-muted); }
    #sidebarDrawer { left: auto; right: 0; max-width: 100vw; height: 100dvh; transform: translateX(100%); transition: transform .25s ease; }
    #sidebarDrawer.open { transform: translateX(0); }
}

.explore-nav-links .nav-short { display: none; }
@media (max-width: 700px), (max-width: 1000px) and (max-height: 550px) and (orientation: landscape) and (pointer: coarse) {
    .explore-nav-links .nav-long { display: none; }
    .explore-nav-links .nav-short { display: inline; }
    .explore-nav .explore-nav-links { justify-content: safe space-evenly; }
    .explore-nav .explore-nav-links a { font-size: 1rem; padding-inline: 7px; }
    .explore-menu span {
        display: block;
        width: 20px;
        height: 15px;
        font-size: 0;
        background: linear-gradient(currentColor,currentColor) left top / 100% 2px,
                    linear-gradient(currentColor,currentColor) left center / 80% 2px,
                    linear-gradient(currentColor,currentColor) left bottom / 60% 2px;
        background-repeat: no-repeat;
    }
}
