:root {
    color-scheme: dark;
    --bg-main: #333f66;
    --bg-header: #45577e;
    --bg-medium: #45577e;
    --bg-dark: #1e2848;
    --yellow: #f9f298;
    --yellow-strong: #f9f298;
    --yellow-deep: #e1da74;
    --white: #ffffff;
    --ink: #ffffff;
    --ink-soft: #e3e9f5;
    --muted: rgba(255, 255, 255, 0.78);
    --line: rgba(255, 255, 255, 0.12);
    --line-strong: rgba(255, 255, 255, 0.22);
    --content: 1180px;
    --display-font: "Oswald", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --text-font: "Lato", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--text-font);
    background: var(--bg-main);
    color: var(--ink);
    letter-spacing: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

body.menu-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid rgba(255, 212, 0, .86);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    left: 12px;
    top: 12px;
    z-index: 50;
    transform: translateY(-140%);
    background: var(--yellow);
    color: var(--blue-950);
    padding: 8px 10px;
    border-radius: 6px;
    font-weight: 800;
}

.skip-link:focus {
    transform: translateY(0);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-shell {
    position: sticky;
    top: 0;
    z-index: 20;
    color: var(--white);
    background: var(--bg-header);
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.date-bar {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 14px 5px;
    background: var(--bg-dark);
    color: var(--yellow);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.brand-bar {
    max-width: var(--content);
    min-height: 104px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 14px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
    flex: 1 1 auto;
}

.brand-mark img {
    width: 94px;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
}

.brand-divider {
    width: 1px;
    height: 78px;
    flex: 0 0 1px;
    background: rgba(255, 255, 255, .9);
}

.brand-claim {
    display: grid;
    min-width: 0;
    max-width: 190px;
    color: var(--yellow);
    font-family: var(--display-font);
    font-size: 28px;
    line-height: .92;
    letter-spacing: 0;
    font-weight: 900;
    text-transform: uppercase;
}

.menu-button {
    width: 40px;
    height: 40px;
    display: grid;
    place-content: center;
    gap: 5px;
    border: 1px solid rgba(255,255,255,.28);
    border-radius: 6px;
    background: var(--bg-medium);
    color: var(--white);
    cursor: pointer;
}

.menu-button span:not(.sr-only) {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
}

.drawer-menu {
    max-width: var(--content);
    margin: 0 auto;
    display: none;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 0 16px 12px;
}

.drawer-menu.is-open {
    display: grid;
}

.drawer-menu a {
    padding: 12px 10px;
    border-radius: 6px;
    background: rgba(255,255,255,.10);
    font-weight: 800;
}

.page-wrap {
    max-width: var(--content);
    margin: 0 auto;
    padding: 12px 10px 60px;
}

.nav-stack {
    display: grid;
    gap: 8px;
    margin: 0 -10px 10px;
    padding: 12px 10px 11px;
    background: var(--bg-medium);
}

.time-tabs,
.genre-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.time-tabs::-webkit-scrollbar,
.genre-tabs::-webkit-scrollbar {
    display: none;
}

.time-tab,
.genre-tab {
    flex: 0 0 auto;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.time-tab {
    padding: 9px 12px;
    background: var(--bg-dark);
    color: var(--white);
}

.time-tab.is-active {
    background: var(--yellow);
    color: var(--bg-dark);
}

.genre-tab {
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.28);
    background: rgba(255,255,255,.10);
    color: var(--white);
}

.genre-tab.is-active {
    background: var(--yellow);
    border-color: var(--yellow);
    color: var(--bg-dark);
}

.cache-status {
    margin: 10px 0 12px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 12px;
    text-align: center;
}

.cache-status.is-warning {
    color: #915d00;
}

.movie-list {
    display: grid;
    gap: 0;
    margin-inline: -10px;
    width: calc(100% + 20px);
    max-width: none;
    overflow: hidden;
    border: 0;
    border-radius: 0;
}

.movie-card {
    position: relative;
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 9px;
    align-items: stretch;
    padding: 9px;
    border: 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.30);
    border-radius: 0;
    background: var(--bg-header);
    color: var(--white);
    overflow: hidden;
    animation: fade-slide .22s ease both;
}

.movie-card:nth-child(even) {
    background: var(--bg-main);
}

.movie-card:last-child {
    border-bottom: 0;
}

.poster-frame {
    width: 86px;
    min-height: 129px;
    display: block;
}

.movie-poster,
.poster-placeholder {
    width: 86px;
    height: 129px;
    display: grid;
    place-items: center;
    object-fit: cover;
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--yellow);
    font-size: 11px;
    font-weight: 900;
    line-height: 1.1;
    text-align: center;
}

.movie-copy {
    min-width: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.broadcast-row {
    min-width: 0;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.air-time {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 5px 9px;
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--yellow);
    font-weight: 900;
    font-size: 15px;
}

.station {
    position: relative;
    grid-area: station;
    justify-self: end;
    align-self: end;
    min-width: 60px;
    width: auto;
    max-width: 78px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 4px 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--bg-dark);
}

.station span:last-child {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.station-logo {
    max-width: 100%;
    max-height: 36px;
    width: auto;
    height: auto;
    object-fit: contain;
    flex: 0 0 auto;
    display: block;
}

.station-placeholder {
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--bg-dark);
}

.movie-card h2 {
    margin: 0;
    font-family: var(--display-font);
    font-size: 22px;
    line-height: 1.05;
    letter-spacing: 0;
    color: var(--white);
    font-weight: 900;
    text-transform: uppercase;
    overflow-wrap: anywhere;
    white-space: normal;
}

.movie-card h2 a {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.movie-meta,
.movie-cast {
    margin: 0;
    color: rgba(255, 255, 255, 0.85);
    font-size: 14px;
    line-height: 1.3;
}

.movie-cast {
    color: rgba(255,255,255,.9);
    font-weight: 800;
}

.movie-actions {
    margin-top: auto;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
        "plot plot plot"
        "cta . station";
    align-items: end;
    justify-content: flex-start;
    gap: 8px;
}

.plot-button {
    grid-area: plot;
    min-width: 0;
    min-height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--yellow);
    font: inherit;
    font-size: 13.5px;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    text-align: left;
}

.watch-button {
    grid-area: cta;
    justify-self: start;
    max-width: 100%;
    min-height: 31px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 11px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.10);
    color: var(--white);
    font-size: 11px;
    font-weight: 950;
    line-height: 1;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease;
}

@media (max-width: 374px) {
    .page-wrap {
        padding-inline: 8px;
    }

    .movie-card {
        grid-template-columns: 82px minmax(0, 1fr);
        gap: 9px;
        padding: 8px;
    }

    .poster-frame,
    .movie-poster,
    .poster-placeholder {
        width: 82px;
        height: 123px;
    }

    .movie-card h2 {
        font-size: 16px;
    }

    .watch-button {
        min-height: 31px;
        padding: 8px 11px;
    }
}

.watch-button:hover,
.watch-button:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
}

.empty-state {
    margin: 12px 0;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: var(--bg-medium);
    color: rgba(255, 255, 255, 0.85);
}

.plot-dialog {
    width: min(92vw, 520px);
    border: 0;
    border-radius: 8px;
    padding: 22px;
    color: var(--bg-dark);
    background: var(--white);
}

.plot-dialog::backdrop {
    background: rgba(11, 18, 46, 0.78);
}

.dialog-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 6px;
    background: var(--bg-medium);
    color: var(--white);
    font-size: 22px;
    cursor: pointer;
}

.dialog-kicker {
    margin: 0 0 4px;
    color: var(--bg-header);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.plot-dialog h2 {
    margin: 0 34px 10px 0;
    font-family: var(--display-font);
    font-size: 32px;
    line-height: 1;
    text-transform: uppercase;
}

.plot-dialog p:not(.dialog-kicker) {
    line-height: 1.55;
}

.dialog-link {
    display: inline-flex;
    margin-top: 8px;
    color: var(--bg-header);
    font-weight: 900;
}

.back-to-top {
    position: fixed;
    right: 14px;
    bottom: 14px;
    z-index: 18;
    width: 44px;
    height: 44px;
    display: none;
    border: 0;
    border-radius: 50%;
    background: var(--yellow);
    color: var(--bg-dark);
    font-size: 22px;
    font-weight: 900;
    cursor: pointer;
}

.back-to-top.is-visible {
    display: block;
}

.back-link {
    display: inline-flex;
    margin: 4px 0 14px;
    color: var(--yellow);
    font-weight: 900;
}

.detail-hero,
.detail-section {
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 8px;
    background: var(--bg-header);
    color: var(--white);
}

.detail-hero {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 14px;
    padding: 12px;
}

.detail-poster {
    width: 112px;
    aspect-ratio: 2 / 3;
    object-fit: cover;
    border-radius: 6px;
}

.detail-kicker {
    margin: 0 0 5px;
    color: var(--blue-700);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.detail-copy h1 {
    margin: 0;
    font-family: var(--display-font);
    font-size: 34px;
    line-height: .96;
    text-transform: uppercase;
}

.detail-original,
.detail-caption {
    margin: 7px 0 0;
    color: var(--muted);
}

.detail-caption {
    color: var(--ink);
    font-weight: 800;
}

.detail-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 13px;
}

.detail-meta span {
    display: block;
    padding: 9px;
    border-radius: 6px;
    background: var(--blue-100);
    font-size: 13px;
}

.detail-meta strong {
    display: block;
    color: var(--blue-700);
    font-size: 11px;
    text-transform: uppercase;
}

.detail-section {
    margin-top: 12px;
    padding: 14px;
}

.detail-section h2 {
    margin: 0 0 8px;
    font-family: var(--display-font);
    font-size: 28px;
    text-transform: uppercase;
}

.detail-section p {
    line-height: 1.58;
}

.detail-airings {
    list-style: none;
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.detail-airings li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px;
    border-radius: 6px;
    background: var(--blue-100);
}

.cast-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.actor-card {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 9px;
    border: 1px solid var(--line);
    border-radius: 6px;
}

.actor-photo {
    width: 64px;
    height: 84px;
    object-fit: cover;
    border-radius: 5px;
    background: var(--blue-100);
}

.actor-card h2 {
    margin: 0;
    font-size: 16px;
}

.actor-card p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
}

@keyframes fade-slide {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (min-width: 768px) {
    .brand-mark {
        gap: 18px;
    }

    .brand-mark img {
        width: 132px;
    }

    .brand-divider {
        height: 108px;
    }

    .brand-claim {
        max-width: 260px;
        font-size: 42px;
    }

    .brand-bar {
        min-height: 136px;
        padding-inline: 24px;
    }

    .drawer-menu {
        grid-template-columns: repeat(4, auto);
        justify-content: end;
        padding-inline: 24px;
    }

    .page-wrap {
        padding: 18px 24px 76px;
    }

    .nav-stack {
        margin-inline: 0;
        border-radius: 0 0 8px 8px;
        padding: 10px;
    }

    .movie-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-inline: 0;
        width: auto;
        max-width: 100%;
    }

    .movie-actions {
        grid-template-columns: auto minmax(0, 1fr) 58px;
    }

    .watch-button {
        justify-self: end;
    }
}

@media (min-width: 1024px) {
    .movie-card h2 {
        font-size: 27px;
    }

    .detail-copy h1 {
        font-size: 54px;
    }

    .movie-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .movie-card {
        grid-template-columns: 106px minmax(0, 1fr);
        gap: 12px;
        padding: 11px;
    }

    .poster-frame,
    .movie-poster,
    .poster-placeholder {
        width: 106px;
        height: 159px;
    }

    .detail-hero {
        grid-template-columns: 220px minmax(0, 1fr);
        padding: 18px;
    }

    .detail-poster {
        width: 220px;
    }
}

@media (min-width: 1440px) {
    .movie-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}
