* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

.tv-body {
    --background: #0a111b;
    --control: #ffffff0e;
    --text: #f8f5f7;
    --muted: #bac1ce;
    --edge: #ffffff29;
    --accent: #f46b91;
    --selection: #a8294b36;
    --shine: #63223f58;
    --haze: #0e5f7559;
    --header-surface: #0b111de8;
    --panel-edge: #ffffff3d;
    --player-surface:
        radial-gradient(ellipse at 78% 20%, #9f315354, transparent 54%),
        radial-gradient(ellipse at 7% 100%, #0e5f7570, transparent 56%),
        linear-gradient(125deg, #182231, #261928 70%, #171c2b);
    --list-surface: linear-gradient(145deg, #1b2636e8, #151c29ee 72%);
    --panel-shadow: 0 16px 40px #0005, inset 0 1px #ffffff14;
    --art-surface: #0b1426a8;
    --action: linear-gradient(140deg, #c43c61, #8e2446);
    --action-edge: #ff9bb57d;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(ellipse at 90% 14%, var(--shine), transparent 60%),
        radial-gradient(ellipse at 0 45%, var(--haze), transparent 68%),
        var(--background);
    background-size: 100% min(58rem, 100vh);
    background-repeat: no-repeat;
    color: var(--text);
    color-scheme: dark;
    font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

html[data-theme="light"] .tv-body {
    --background: #f6f2f3;
    --control: #fffafce8;
    --text: #271b27;
    --muted: #685d68;
    --edge: #572b3e39;
    --accent: #a51e4a;
    --selection: #f7dce5;
    --shine: #efc5d2;
    --haze: #cde5ee;
    --header-surface: #fffafce8;
    --panel-edge: #572b3e31;
    --player-surface:
        radial-gradient(ellipse at 78% 20%, #ed99b265, transparent 54%),
        radial-gradient(ellipse at 6% 100%, #89c6d875, transparent 58%),
        linear-gradient(125deg, #fffafb, #f5e8ed 70%, #f4f3f6);
    --list-surface: linear-gradient(145deg, #ffffffeb, #f9edf2e8 85%);
    --panel-shadow: 0 14px 36px #4c35401b, inset 0 1px #fff;
    --art-surface: #fffafcd9;
    --action-edge: #a51e4a;
    color-scheme: light;
}

.tv-body a {
    color: inherit;
    text-decoration: none;
}

.tv-body :is(a, button, input):focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.tv-header {
    border-bottom: 1px solid var(--edge);
    background: var(--header-surface);
}

.tv-header-inner,
.tv-main {
    width: min(1160px, calc(100% - 64px));
    margin-inline: auto;
}

.tv-header-inner {
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 24px);
}

.tv-brand {
    display: inline-flex;
    align-items: center;
}

.tv-navigation {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 20px);
    margin-inline-start: auto;
    font-size: .9rem;
    font-weight: 630;
}

.tv-navigation a,
.tv-news-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    white-space: nowrap;
}

.tv-navigation a[aria-current] {
    color: var(--accent);
}

.tv-radio-link,
.tv-news-link,
.tv-theme {
    border: 1px solid var(--edge);
    border-radius: 999px;
    background: var(--control);
    color: var(--text);
}

.tv-radio-link {
    padding-inline: 11px;
}

.tv-news-link {
    padding-inline: 13px;
    background: var(--selection);
    font-size: .83rem;
    font-weight: 650;
}

.tv-theme {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    padding: 0;
    cursor: pointer;
}

.tv-theme svg {
    display: block;
    width: 20px;
    height: 20px;
}

.tv-theme .tv-theme-moon,
html[data-theme="light"] .tv-theme .tv-theme-sun {
    display: none;
}

html[data-theme="light"] .tv-theme .tv-theme-moon {
    display: block;
}

.tv-main {
    padding-block: clamp(18px, 3vw, 32px) 46px;
}

.tv-heading h1 {
    margin: 0 0 14px;
    font-size: clamp(1.66rem, 4.5vw, 2.6rem);
    line-height: 1.12;
    letter-spacing: -.045em;
    text-wrap: balance;
}

.tv-collections {
    display: flex;
    flex-wrap: wrap;
    width: fit-content;
    max-width: 100%;
    gap: 4px;
    padding: 4px;
    margin-bottom: 16px;
    border: 1px solid var(--edge);
    border-radius: 999px;
    background: var(--header-surface);
}

.tv-collection {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
    padding-inline: clamp(10px, 2.3vw, 17px);
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: .87rem;
    font-weight: 670;
    white-space: nowrap;
}

.tv-collection[aria-current] {
    border-color: var(--action-edge);
    background: var(--action);
    color: #fff;
}

:is(.tv-radio-link, .tv-news-link, .tv-theme, .tv-collection:not([aria-current])):hover {
    border-color: var(--accent);
    background: var(--selection);
}

.tv-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(312px, 356px);
    align-items: start;
    gap: clamp(14px, 2vw, 22px);
}

.tv-watch,
.tv-channels {
    min-width: 0;
    padding: clamp(12px, 1.7vw, 20px);
    border: 1px solid var(--panel-edge);
    border-radius: clamp(22px, 3vw, 30px);
    box-shadow: var(--panel-shadow);
}

.tv-watch {
    background: var(--player-surface);
}

.tv-player {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid var(--edge);
    border-radius: clamp(13px, 2vw, 20px);
    background: #090c12;
}

.tv-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.tv-player[data-provider="twitch"] {
    min-height: 300px;
    overflow: auto;
}

.tv-player[data-provider="twitch"] iframe {
    min-width: 400px;
    min-height: 300px;
}

.tv-player-message {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: radial-gradient(ellipse at 50% 42%, #4e2d44, #171b27 75%);
    color: #fbf4f7;
    text-align: center;
}

.tv-player-message span {
    color: #d6c8d3;
    font-size: .92rem;
}

.tv-feature-player {
    overflow: visible;
    aspect-ratio: auto;
    border: 0;
    background: transparent;
}

.tv-feature {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-radius: clamp(13px, 2vw, 20px);
}

.tv-feature-art {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: clamp(110px, 18vw, 170px);
    overflow: hidden;
    border: 1px solid var(--edge);
    border-radius: inherit;
    background: radial-gradient(ellipse at center, var(--selection), transparent 70%), var(--art-surface);
}

.tv-feature-art img {
    display: block;
    width: clamp(58px, 11vw, 90px);
    height: auto;
    aspect-ratio: 1;
    border-radius: 14px;
    object-fit: cover;
}

.tv-feature-media .tv-feature-art {
    min-height: 0;
    background: #101723;
}

.tv-feature-media .tv-feature-art img {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0;
}

.tv-feature-name {
    font-size: clamp(1.08rem, 2.4vw, 1.6rem);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -.025em;
    overflow-wrap: anywhere;
}

.tv-feature-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    font-size: .82rem;
    font-weight: 730;
}

.tv-feature-play {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--action-edge);
    border-radius: 50%;
    background: var(--action);
    box-shadow: 0 0 18px #d72c674d;
}

.tv-feature-play::before {
    width: 15px;
    height: 17px;
    margin-inline-start: 3px;
    background: #fff;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
    content: '';
}

.tv-description {
    max-width: 62ch;
    margin: 11px 2px 1px;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.55;
}

.tv-channels {
    background: var(--list-surface);
}

.tv-channels h2 {
    margin: 0 0 12px;
    font-size: 1.125rem;
    font-weight: 730;
}

.tv-search {
    width: 100%;
    min-height: 46px;
    margin-bottom: 10px;
    padding: 7px 13px;
    border: 1px solid var(--edge);
    border-radius: 14px;
    background: var(--control);
    color: var(--text);
    font: inherit;
    font-size: max(1rem, 16px);
}

.tv-search::placeholder {
    color: var(--muted);
}

.tv-channel-list {
    display: grid;
    gap: 6px;
    max-height: 435px;
    margin: 0;
    padding: 0 3px 0 0;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--edge) transparent;
    list-style: none;
}

.tv-channel {
    display: flex;
    align-items: center;
    min-height: 56px;
    gap: 10px;
    padding: 6px;
    border: 1px solid var(--edge);
    border-radius: 13px;
    background: var(--control);
}

.tv-channel:is(:hover, [aria-current]) {
    border-color: var(--accent);
    background: var(--selection);
}

.tv-channel:focus-visible {
    outline-offset: -2px;
}

.tv-channel img,
.tv-channel-placeholder {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 8px;
    object-fit: cover;
}

.tv-channels:is([data-section="films"], [data-section="music"]) .tv-channel img {
    width: 64px;
    flex-basis: 64px;
}

.tv-channel-placeholder {
    display: grid;
    place-items: center;
    background: var(--selection);
    color: var(--accent);
    font-size: .8rem;
    font-weight: 730;
    text-transform: uppercase;
}

.tv-channel-copy {
    display: grid;
    min-width: 0;
    gap: 2px;
    overflow-wrap: anywhere;
}

.tv-channel-copy strong {
    font-size: .9rem;
    line-height: 1.17;
}

.tv-channel-copy small {
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.2;
}

.tv-empty {
    margin: 4px 0;
    color: var(--muted);
    font-size: .85rem;
}

@media (max-width: 820px) {
    .tv-header-inner,
    .tv-main {
        width: calc(100% - 24px);
    }

    .tv-layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .tv-channel-list {
        max-height: none;
        padding: 0;
        overflow: visible;
    }
}

@media (max-width: 720px) {
    .tv-navigation {
        font-size: .83rem;
    }

    .tv-channels[data-section="tv"] .tv-channel-list {
        display: flex;
        padding-bottom: 6px;
        overflow: auto;
        scroll-snap-type: x proximity;
    }

    .tv-channels[data-section="tv"] .tv-channel-list li {
        flex: 0 0 min(154px, 43vw);
        scroll-snap-align: start;
    }

    .tv-channels[data-section="tv"] .tv-channel {
        height: 100%;
    }
}

@media (max-width: 400px) {
    .tv-navigation a[aria-current] {
        display: none;
    }
}

@media (max-width: 380px) {
    .tv-radio-link {
        padding-inline: 0;
        border-color: transparent;
        background: transparent;
    }
}

@media (max-width: 350px) {
    .tv-header-inner {
        gap: 6px;
    }

    .tv-news-link {
        padding-inline: 9px;
    }
}
