:root {
    --bg: #090b10;
    --bg-soft: #0e1118;
    --surface: #141821;
    --surface-2: #1a1f2a;
    --surface-3: #222936;
    --border: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);
    --text: #f5f7fb;
    --muted: #959dad;
    --muted-2: #6f7787;
    --accent: #ff4d68;
    --accent-dark: #db304e;
    --accent-soft: rgba(255, 77, 104, 0.14);
    --gold: #ffcc66;
    --blue: #5ea8ff;
    --green: #55d6a5;
    --radius-sm: 10px;
    --radius: 16px;
    --radius-lg: 24px;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
    --max-width: 1440px;
    --header-height: 76px;
    --header-bg: rgba(9, 11, 16, 0.86);
    --panel-bg: rgba(20, 24, 33, 0.75);
    --panel-bg-strong: rgba(20, 24, 33, 0.86);
    --input-bg: #0e1118;
    --nav-bg: #0d1016;
    --footer-bg: rgba(8, 10, 14, 0.72);
    --grid-line: rgba(255, 255, 255, 0.013);
    --description: #bcc2ce;
    --description-long: #b4bac6;
    --backdrop-fade: rgba(9, 11, 16, 0.2);
    --backdrop-side: rgba(9, 11, 16, 0.45);
    color-scheme: dark;
}

html[data-theme="light"] {
    --bg: #f4f6fa;
    --bg-soft: #eef1f6;
    --surface: #ffffff;
    --surface-2: #f7f8fb;
    --surface-3: #e8ebf1;
    --border: rgba(24, 31, 45, 0.11);
    --border-strong: rgba(24, 31, 45, 0.2);
    --text: #171b24;
    --muted: #60697a;
    --muted-2: #858d9c;
    --accent-dark: #dd314e;
    --accent-soft: rgba(224, 49, 78, 0.11);
    --gold: #a86c00;
    --blue: #176dcc;
    --green: #12855f;
    --shadow: 0 24px 70px rgba(37, 46, 64, 0.15);
    --header-bg: rgba(255, 255, 255, 0.88);
    --panel-bg: rgba(255, 255, 255, 0.8);
    --panel-bg-strong: rgba(255, 255, 255, 0.94);
    --input-bg: #ffffff;
    --nav-bg: #ffffff;
    --footer-bg: rgba(255, 255, 255, 0.78);
    --grid-line: rgba(24, 31, 45, 0.025);
    --description: #50596a;
    --description-long: #555e6e;
    --backdrop-fade: rgba(244, 246, 250, 0.36);
    --backdrop-side: rgba(244, 246, 250, 0.48);
    color-scheme: light;
}

html[data-theme="light"] .hero-panel {
    background: linear-gradient(150deg, rgba(255, 255, 255, 0.98), rgba(236, 239, 245, 0.98));
}

html[data-theme="light"] .button-secondary {
    background: rgba(24, 31, 45, 0.035);
}

html[data-theme="light"] .button-secondary:hover,
html[data-theme="light"] .button-quiet:hover {
    border-color: rgba(24, 31, 45, 0.25);
    background: rgba(24, 31, 45, 0.075);
}

html[data-theme="light"] .status-pill {
    color: #087452;
}

html[data-theme="light"] .badge-language {
    color: #145f9f;
}

html[data-theme="light"] .genre-cloud strong {
    background: rgba(24, 31, 45, 0.055);
}

html[data-theme="light"] .toast {
    background: #ffffff;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--header-height) + 24px);
}

body {
    margin: 0;
    min-width: 320px;
    min-height: 100vh;
    background:
        radial-gradient(circle at 80% -20%, rgba(255, 77, 104, 0.11), transparent 35rem),
        var(--bg);
    color: var(--text);
    font-family: Inter, "Open Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
    text-rendering: optimizeLegibility;
}

body::before {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: linear-gradient(var(--grid-line) 1px, transparent 1px),
                      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 44px 44px;
    content: "";
    pointer-events: none;
    mask-image: linear-gradient(to bottom, black, transparent 68%);
}

body.nav-open {
    overflow: hidden;
}

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

button,
input,
select {
    color: inherit;
    font: inherit;
}

button,
select {
    cursor: pointer;
}

img {
    display: block;
    max-width: 100%;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.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;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1000;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--text);
    color: var(--bg);
    transform: translateY(-150%);
}

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

.section-shell,
.header-inner,
.footer-inner {
    width: min(100% - 48px, var(--max-width));
    margin-inline: auto;
}

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-height);
    border-bottom: 1px solid var(--border);
    background: var(--header-bg);
    backdrop-filter: blur(18px) saturate(150%);
}

.header-inner {
    display: grid;
    grid-template-columns: auto auto minmax(210px, 390px) auto;
    align-items: center;
    height: 100%;
    gap: clamp(14px, 2.5vw, 40px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    min-width: max-content;
}

.brand-mark {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #ff7955);
    box-shadow: 0 9px 25px rgba(255, 77, 104, 0.26);
}

.brand-mark svg {
    width: 21px;
    fill: none;
    stroke: white;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.brand > span:last-child {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 18px;
    letter-spacing: -0.03em;
}

.brand strong {
    font-weight: 800;
}

.brand small {
    color: var(--muted);
    font-size: inherit;
    font-weight: 500;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 11px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
    transition: color 160ms ease, background 160ms ease;
}

.nav-link:hover,
.nav-link.active {
    background: var(--surface-2);
    color: var(--text);
}

.nav-link.active span {
    color: var(--accent);
}

.header-search {
    position: relative;
    display: flex;
    justify-self: end;
    width: 100%;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface-2);
    transition: border-color 160ms ease, background 160ms ease;
}

.header-search:focus-within {
    border-color: rgba(255, 77, 104, 0.7);
    background: var(--surface);
}

.header-search input {
    min-width: 0;
    flex: 1;
    padding: 0 10px 0 39px;
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 14px;
}

.header-search input::placeholder {
    color: var(--muted-2);
}

.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    color: var(--muted);
    font-size: 20px;
    transform: translateY(-53%);
}

.header-search button {
    margin: 4px;
    padding: 0 14px;
    border: 0;
    border-radius: 9px;
    background: var(--surface-3);
    font-size: 12px;
    font-weight: 700;
}

.nav-toggle {
    display: none;
}

.theme-toggle {
    display: grid;
    place-items: center;
    justify-self: end;
    color: var(--muted);
    font-size: 20px;
}

.theme-toggle:hover {
    border-color: rgba(255, 77, 104, 0.45);
    color: var(--text);
}

.icon-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
}

.menu-icon,
.menu-icon::before,
.menu-icon::after,
.menu-icon i {
    position: absolute;
    left: 50%;
    width: 18px;
    height: 2px;
    border-radius: 99px;
    background: var(--text);
    content: "";
    transform: translateX(-50%);
}

.menu-icon {
    position: relative;
    left: auto;
    display: block;
    height: 2px;
    transform: none;
}

.menu-icon::before { top: -6px; }
.menu-icon::after { top: 6px; }
.menu-icon i { display: none; }

/* Shared */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.eyebrow i,
.status-pill i,
.source-label i {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 12px rgba(255, 77, 104, 0.72);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 750;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button-primary {
    background: linear-gradient(135deg, var(--accent), #f15a45);
    color: white;
    box-shadow: 0 12px 28px rgba(255, 77, 104, 0.2);
}

.button-primary:hover {
    background: linear-gradient(135deg, #ff6179, #ff705a);
}

.button-secondary {
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.045);
}

.button-secondary:hover,
.button-quiet:hover {
    border-color: rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.08);
}

.button-quiet {
    border-color: var(--border);
    background: transparent;
    color: var(--muted);
}

.button-large {
    min-height: 51px;
    padding-inline: 23px;
    border-radius: 14px;
    font-size: 14px;
}

.full-width {
    width: 100%;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid rgba(85, 214, 165, 0.16);
    border-radius: 99px;
    background: rgba(85, 214, 165, 0.08);
    color: #8be7c4;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.status-pill i {
    width: 6px;
    height: 6px;
    background: var(--green);
    box-shadow: 0 0 11px rgba(85, 214, 165, 0.7);
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 0 9px;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 8px;
    background: rgba(12, 14, 20, 0.78);
    color: #dde1ea;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
}

.badge-accent {
    border-color: transparent;
    background: var(--accent);
    color: white;
}

.badge-language {
    border-color: rgba(94, 168, 255, 0.35);
    background: rgba(94, 168, 255, 0.14);
    color: #9bcbff;
}

/* Overview */
.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(360px, 0.8fr);
    align-items: center;
    min-height: 540px;
    gap: clamp(50px, 9vw, 140px);
    padding-block: 70px 55px;
}

.hero h1,
.page-intro h1,
.detail-copy h1,
.error-page h1 {
    margin: 0;
    font-size: clamp(42px, 6vw, 78px);
    line-height: 0.98;
    letter-spacing: -0.055em;
}

.hero h1 em {
    color: var(--accent);
    font-style: normal;
}

.hero-copy > p {
    max-width: 650px;
    margin: 25px 0 0;
    color: var(--muted);
    font-size: clamp(15px, 1.4vw, 18px);
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 11px;
    margin-top: 31px;
}

.hero-panel {
    position: relative;
    overflow: hidden;
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(150deg, rgba(30, 35, 46, 0.94), rgba(15, 18, 25, 0.96));
    box-shadow: var(--shadow);
}

.hero-panel::after {
    position: absolute;
    right: -90px;
    top: -100px;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 77, 104, 0.12);
    filter: blur(4px);
    content: "";
}

.hero-panel-head,
.meter-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.hero-panel-head > span:first-child,
.meter-label span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.library-total {
    display: flex;
    flex-direction: column;
    margin: 35px 0 30px;
}

.library-total strong {
    font-size: clamp(56px, 6vw, 76px);
    line-height: 1;
    letter-spacing: -0.055em;
}

.library-total span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 13px;
}

.meter-label strong {
    font-size: 12px;
}

.meter-track {
    display: block;
    width: 100%;
    height: 6px;
    margin-top: 10px;
    overflow: hidden;
    border: 0;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.07);
    appearance: none;
}

.meter-track::-webkit-progress-bar {
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.07);
}

.meter-track::-webkit-progress-value,
.meter-track::-moz-progress-bar {
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent), #ff8a57);
}

.hero-mini-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border);
}

.hero-mini-stats div {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding-inline: 16px;
    border-right: 1px solid var(--border);
}

.hero-mini-stats div:first-child {
    padding-left: 0;
}

.hero-mini-stats div:last-child {
    border: 0;
}

.hero-mini-stats strong {
    font-size: 20px;
}

.hero-mini-stats span {
    color: var(--muted-2);
    font-size: 10px;
}

.stats-section {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding-bottom: 36px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg);
}

.stat-icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 12px;
    font-weight: 800;
}

.stat-icon-red { background: var(--accent-soft); color: var(--accent); }
.stat-icon-gold { background: rgba(255, 204, 102, 0.11); color: var(--gold); }
.stat-icon-blue { background: rgba(94, 168, 255, 0.11); color: var(--blue); }
.stat-icon-green { background: rgba(85, 214, 165, 0.11); color: var(--green); }

.stat-card div {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.stat-card strong {
    font-size: 20px;
    letter-spacing: -0.02em;
}

.stat-card span:last-child {
    overflow: hidden;
    color: var(--muted);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.content-section {
    padding-block: 50px;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 23px;
}

.section-heading.compact {
    align-items: center;
    margin-bottom: 20px;
}

.section-heading .eyebrow {
    margin-bottom: 6px;
}

.section-heading h2,
.status-card h2,
.command-card h2,
.info-panel h2,
.technical-panel h2 {
    margin: 0;
    font-size: clamp(23px, 2.7vw, 32px);
    line-height: 1.1;
    letter-spacing: -0.035em;
}

.section-heading.compact h2,
.status-card h2,
.command-card h2,
.technical-panel h2 {
    font-size: 21px;
}

.section-link,
.text-action {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
    transition: color 160ms ease;
}

.section-link:hover,
.text-action:hover {
    color: var(--text);
}

.section-link span,
.text-action span {
    margin-left: 6px;
    color: var(--accent);
}

/* Media cards */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(195px, 1fr));
    gap: 22px 16px;
}

.media-grid-featured {
    grid-template-columns: repeat(8, minmax(0, 1fr));
}

.media-grid-related {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.media-card {
    position: relative;
    min-width: 0;
    border-radius: var(--radius);
    transition: transform 190ms ease;
}

.media-card:hover,
.media-card:focus-within {
    z-index: 2;
    transform: translateY(-4px);
}

.poster-link {
    display: block;
    border-radius: var(--radius);
}

.poster-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 2 / 3;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background:
        radial-gradient(circle at 70% 18%, rgba(255, 77, 104, 0.28), transparent 30%),
        linear-gradient(145deg, #282e3d, #10131a 68%);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18);
}

.poster-frame > img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 300ms ease, opacity 200ms ease;
}

.media-card:hover .poster-frame > img {
    transform: scale(1.035);
}

.poster-frame > img.image-failed {
    display: none;
}

.poster-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}

.poster-fallback span {
    font-size: clamp(60px, 8vw, 100px);
    font-weight: 900;
    line-height: 0.9;
    letter-spacing: -0.08em;
}

.poster-fallback small {
    margin-top: 9px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.35em;
}

.poster-shade {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.05) 45%, rgba(5, 6, 9, 0.68));
    opacity: 0.75;
    transition: opacity 200ms ease;
}

.poster-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 3;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.poster-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 4;
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.42);
    border-radius: 50%;
    background: rgba(9, 11, 16, 0.68);
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transform: translate(-50%, -45%) scale(0.9);
    transition: opacity 190ms ease, transform 190ms ease, background 190ms ease;
    backdrop-filter: blur(8px);
}

.poster-play::before,
.player-launch > span::before {
    width: 0;
    height: 0;
    margin-left: 3px;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-left: 11px solid white;
    content: "";
}

.media-card:hover .poster-play,
.media-card:focus-within .poster-play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.media-card:hover .poster-play {
    background: var(--accent);
}

.media-card-body {
    padding: 13px 3px 3px;
}

.media-card-title {
    display: block;
    overflow: hidden;
    font-size: 14px;
    font-weight: 750;
    letter-spacing: -0.015em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card-title:hover {
    color: #ff8295;
}

.original-title {
    overflow: hidden;
    margin: 3px 0 0;
    color: var(--muted-2);
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-card-meta {
    display: flex;
    align-items: center;
    min-height: 18px;
    gap: 7px;
    margin-top: 7px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    white-space: nowrap;
}

.media-card-meta span + span::before {
    margin-right: 7px;
    color: var(--muted-2);
    content: "·";
}

.media-card-meta .rating {
    color: var(--gold);
}

.media-card-description {
    display: -webkit-box;
    min-height: 42px;
    margin: 9px 0 0;
    overflow: hidden;
    color: var(--muted-2);
    font-size: 10px;
    line-height: 1.45;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.media-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 11px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
}

.source-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted-2);
    font-size: 9px;
}

.source-label i {
    width: 5px;
    height: 5px;
    background: var(--green);
    box-shadow: none;
}

.media-card-compact .media-card-footer {
    display: none;
}

.badge-link:hover,
.inline-link:hover {
    color: var(--accent);
}

/* Collections */
.collection-shell,
.seasons-shell {
    padding-bottom: 85px;
}

.collection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 28px 17px;
}

.collection-grid-featured {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

.collection-card {
    min-width: 0;
    transition: transform 190ms ease;
}

.collection-card:hover,
.collection-card:focus-within {
    transform: translateY(-4px);
}

.collection-cover {
    display: block;
}

.collection-card-body {
    padding: 13px 3px 0;
}

.collection-card-body h2 {
    overflow: hidden;
    margin: 0;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.collection-card-body p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.collection-card-body p span {
    margin-inline: 4px;
    color: var(--muted-2);
}

.collection-detail-hero {
    padding-block: 30px 62px;
}

.collection-hero-grid {
    display: grid;
    grid-template-columns: minmax(190px, 250px) minmax(0, 760px);
    align-items: center;
    gap: clamp(32px, 6vw, 75px);
}

.collection-poster {
    box-shadow: var(--shadow);
}

.collection-hero-grid h1 {
    font-size: clamp(42px, 6vw, 76px);
}

.collection-hero-grid .button {
    margin-top: 25px;
}

.season-section + .season-section {
    margin-top: 55px;
}

.episode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.episode-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg);
    transition: border-color 170ms ease, transform 170ms ease, box-shadow 170ms ease;
}

.episode-card:hover,
.episode-card:focus-visible {
    border-color: rgba(255, 77, 104, 0.45);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.episode-art {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: linear-gradient(145deg, #262d3b, #0c0f15);
}

.episode-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.episode-art::after {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(6, 8, 12, 0.68), transparent 65%);
    content: "";
}

.episode-art .badge {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 2;
}

.episode-play {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 2;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 77, 104, 0.92);
    color: white;
    opacity: 0;
    transform: translate(-50%, -40%);
    transition: opacity 170ms ease, transform 170ms ease;
}

.episode-card:hover .episode-play,
.episode-card:focus-visible .episode-play {
    opacity: 1;
    transform: translate(-50%, -50%);
}

.episode-copy {
    padding: 15px;
}

.episode-copy h3 {
    overflow: hidden;
    margin: 0;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.episode-copy p {
    display: -webkit-box;
    min-height: 34px;
    margin: 7px 0 12px;
    overflow: hidden;
    color: var(--muted);
    font-size: 10px;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.episode-copy > span {
    color: var(--muted-2);
    font-size: 9px;
    font-weight: 700;
}

.episode-copy > span i {
    margin-left: 5px;
    color: var(--accent);
    font-style: normal;
}

.genre-cloud {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.genre-cloud a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 17px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel-bg);
    font-size: 13px;
    font-weight: 650;
    transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.genre-cloud a:hover {
    border-color: rgba(255, 77, 104, 0.35);
    background: var(--accent-soft);
    transform: translateY(-2px);
}

.genre-cloud strong {
    display: grid;
    min-width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.055);
    color: var(--muted);
    font-size: 10px;
}

.dashboard-row {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 16px;
}

.status-card,
.command-card,
.info-panel,
.technical-panel,
.player-section {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--panel-bg);
}

.status-card,
.command-card {
    padding: 25px;
}

.status-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0;
    border-top: 1px solid var(--border);
}

.status-list div {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 19px 15px 0;
    border-right: 1px solid var(--border);
}

.status-list div:first-child { padding-left: 0; }
.status-list div:last-child { border: 0; }
.status-list dt { color: var(--muted-2); font-size: 9px; text-transform: uppercase; }
.status-list dd { margin: 0; font-size: 13px; font-weight: 700; }

.command-card > p {
    margin: 12px 0 19px;
    color: var(--muted);
    font-size: 12px;
}

.code-row {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 5px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #090b10;
}

.code-row + .code-row {
    margin-top: 8px;
}

.command-card .tmdb-progress {
    margin: 12px 2px 0;
    color: var(--muted-2);
    font-size: 9px;
}

.code-row code {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    padding: 0 9px;
    color: #d5dae4;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.code-row button {
    min-height: 32px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px;
    background: var(--surface-3);
    font-size: 9px;
    font-weight: 750;
}

/* Catalog */
.page-intro {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    padding-block: 58px 34px;
}

.page-intro h1 {
    font-size: clamp(42px, 5vw, 64px);
}

.page-intro p {
    max-width: 650px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 14px;
}

.page-count {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    flex: 0 0 auto;
}

.page-count strong {
    font-size: 34px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.page-count span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 10px;
}

.catalog-shell {
    padding-bottom: 80px;
}

.filter-panel {
    display: grid;
    grid-template-columns: minmax(230px, 1.5fr) repeat(6, minmax(112px, 0.65fr)) auto;
    align-items: end;
    gap: 10px;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg-strong);
}

.filter-search,
.filter-control {
    min-width: 0;
}

.filter-panel label {
    display: block;
    margin: 0 0 6px 2px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.filter-panel input,
.filter-panel select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 10px;
    outline: 0;
    background: var(--input-bg);
    font-size: 11px;
}

.filter-panel select {
    padding-right: 29px;
}

.filter-panel input:focus,
.filter-panel select:focus {
    border-color: rgba(255, 77, 104, 0.72);
}

.input-with-icon {
    position: relative;
}

.input-with-icon span {
    position: absolute;
    left: 12px;
    top: 50%;
    color: var(--muted);
    font-size: 18px;
    transform: translateY(-52%);
}

.input-with-icon input {
    padding-left: 36px;
}

.filter-submit {
    min-height: 42px;
    padding-inline: 15px;
    white-space: nowrap;
}

.filter-reset {
    grid-column: 1 / -1;
    justify-self: end;
    min-height: 32px;
    margin: -2px 2px 0;
    padding: 0 9px;
    border: 0;
    font-size: 10px;
}

.active-filters {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 13px;
    color: var(--muted-2);
    font-size: 10px;
}

.filter-chip {
    padding: 5px 9px;
    border: 1px solid rgba(255, 77, 104, 0.22);
    border-radius: 99px;
    background: var(--accent-soft);
    color: #ff9caa;
}

.catalog-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
}

.catalog-toolbar p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.view-switch {
    display: flex;
    padding: 3px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
}

.view-switch button {
    display: grid;
    width: 31px;
    height: 28px;
    place-items: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--muted-2);
}

.view-switch button.active {
    background: var(--surface-3);
    color: var(--text);
}

.media-grid.list-view {
    grid-template-columns: 1fr;
    gap: 9px;
}

.media-grid.list-view .media-card {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 15px;
    padding: 9px;
    border: 1px solid var(--border);
    background: var(--panel-bg);
}

.media-grid.list-view .poster-frame {
    border-radius: 11px;
}

.media-grid.list-view .media-card-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 4px 9px 4px 0;
}

.media-grid.list-view .media-card-title {
    font-size: 15px;
}

.media-grid.list-view .media-card-description {
    min-height: auto;
    max-width: 750px;
    -webkit-line-clamp: 2;
}

.media-grid.list-view .media-card-footer {
    margin-top: auto;
}

.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 50px;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 9px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}

.page-link:hover,
.page-link.active {
    border-color: transparent;
    background: var(--accent);
    color: white;
}

.page-link.disabled {
    opacity: 0.35;
    pointer-events: none;
}

.page-direction {
    gap: 7px;
    min-width: 90px;
}

.page-gap {
    padding: 0 3px;
    color: var(--muted-2);
}

.empty-state {
    display: flex;
    min-height: 360px;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 60px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
}

.empty-icon {
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    margin-bottom: 18px;
    border-radius: 20px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 30px;
}

.empty-state h2 {
    margin: 0;
    font-size: 25px;
}

.empty-state p {
    max-width: 470px;
    margin: 10px 0 23px;
    color: var(--muted);
    font-size: 13px;
}

/* Detail */
.detail-backdrop {
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    height: min(620px, 70vh);
    z-index: -1;
    overflow: hidden;
    opacity: 0.24;
}

.detail-backdrop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(35px) saturate(120%);
    transform: scale(1.15);
}

.detail-backdrop div {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--backdrop-fade), var(--bg) 90%),
                linear-gradient(90deg, var(--backdrop-side), transparent);
}

.detail-shell {
    padding-block: 30px 54px;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 35px;
    overflow: hidden;
    color: var(--muted-2);
    font-size: 10px;
    white-space: nowrap;
}

.breadcrumbs a:hover {
    color: var(--text);
}

.breadcrumbs span:last-child {
    overflow: hidden;
    color: var(--muted);
    text-overflow: ellipsis;
}

.detail-hero {
    display: grid;
    grid-template-columns: minmax(210px, 285px) minmax(0, 780px);
    align-items: center;
    gap: clamp(34px, 6vw, 80px);
}

.detail-poster {
    width: 100%;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.43);
}

.detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 17px;
}

.detail-copy h1 {
    max-width: 920px;
    font-size: clamp(40px, 5.5vw, 72px);
}

.detail-original {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 15px;
}

.detail-facts {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 17px;
    margin-top: 24px;
    color: var(--muted);
    font-size: 12px;
}

.rating-large {
    color: var(--gold);
    font-size: 16px;
    font-weight: 800;
}

.detail-description {
    display: -webkit-box;
    max-width: 760px;
    margin: 22px 0 0;
    overflow: hidden;
    color: var(--description);
    font-size: 14px;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.detail-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 29px;
}

.favorite-button.is-favorite {
    border-color: rgba(255, 77, 104, 0.45);
    background: var(--accent-soft);
    color: var(--accent);
}

.detail-content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
    align-items: start;
    gap: 18px;
}

.detail-main {
    display: grid;
    gap: 18px;
}

.player-section,
.info-panel,
.technical-panel {
    padding: 24px;
}

.player-frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    background: #050607;
    color: #f5f7fb;
}

.player-frame video {
    width: 100%;
    height: 100%;
    background: black;
}

.player-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at center, rgba(255, 77, 104, 0.13), transparent 32%),
        linear-gradient(145deg, #161a23, #080a0e);
}

.player-placeholder[hidden],
.player-frame.is-active .player-placeholder {
    display: none !important;
}

.player-frame.is-active video {
    display: block !important;
}

.next-episode-overlay,
.resume-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    padding: 22px;
    place-items: center;
    background:
        radial-gradient(circle at 50% 35%, rgba(255, 77, 104, 0.25), transparent 42%),
        rgba(5, 6, 9, 0.9);
    backdrop-filter: blur(10px);
}

.next-episode-overlay[hidden],
.resume-overlay[hidden] {
    display: none !important;
}

.next-episode-card {
    width: min(100%, 480px);
    padding: clamp(18px, 4vw, 30px);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius);
    background: rgba(16, 19, 27, 0.92);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
    text-align: center;
}

.next-episode-card > strong {
    display: block;
    margin-top: 9px;
    color: #f5f7fb;
    font-size: clamp(16px, 3vw, 24px);
    line-height: 1.25;
}

.next-episode-card > small {
    display: block;
    margin-top: 7px;
    color: #8dbfec;
    font-size: 10px;
    font-weight: 700;
}

.next-episode-card p {
    margin: 10px 0 17px;
    color: #aeb5c2;
    font-size: 12px;
}

.next-episode-card > div {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.player-launch {
    display: flex;
    align-items: center;
    flex-direction: column;
    border: 0;
    background: transparent;
}

.player-launch > span {
    display: grid;
    width: 70px;
    height: 70px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 15px 45px rgba(255, 77, 104, 0.28);
    color: transparent;
    font-size: 0;
    transition: transform 180ms ease;
}

.player-launch:hover > span {
    transform: scale(1.06);
}

.player-launch strong {
    margin-top: 15px;
    font-size: 14px;
}

.player-launch small {
    margin-top: 4px;
    color: #959dad;
    font-size: 10px;
}

.player-help {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 13px;
    color: var(--muted-2);
    font-size: 10px;
}

.player-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.player-actions .button {
    min-height: 38px;
    padding-inline: 13px;
    font-size: 10px;
}

.player-actions .button-quiet {
    margin-left: auto;
}

.autoplay-next-toggle {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    gap: 7px;
    padding: 0 11px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 700;
}

.autoplay-next-toggle input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--accent);
}

.episode-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 12px;
}

.episode-steps a {
    display: flex;
    align-items: center;
    min-width: 120px;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    color: var(--muted);
    font-size: 10px;
}

.episode-steps a.next {
    margin-left: auto;
}

.episode-steps a:hover {
    border-color: var(--border-strong);
    color: var(--text);
}

.episode-steps strong {
    color: var(--text);
    font-size: 11px;
}

/* Historie a oblíbené */
.saved-media-shell {
    padding-bottom: 80px;
}

.saved-media-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.saved-media-card {
    display: grid;
    grid-template-columns: 135px minmax(0, 1fr);
    min-height: 205px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--panel-bg);
}

.saved-media-poster {
    min-height: 100%;
    border-radius: 0;
}

.saved-media-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.saved-media-copy {
    display: flex;
    min-width: 0;
    justify-content: space-between;
    flex-direction: column;
    gap: 13px;
    padding: 18px;
}

.saved-media-copy h2 {
    margin: 5px 0 0;
    font-size: clamp(17px, 2vw, 23px);
    line-height: 1.15;
}

.saved-media-copy a:hover h2 {
    color: var(--accent);
}

.saved-media-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.saved-media-description {
    display: -webkit-box;
    overflow: hidden;
    margin: 0;
    color: var(--description);
    font-size: 11px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.watch-progress > div {
    height: 5px;
    overflow: hidden;
    border-radius: 99px;
    background: var(--surface-3);
}

.watch-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--accent);
}

.watch-progress > span {
    display: block;
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
}

.saved-media-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.saved-media-actions .button {
    min-height: 36px;
    padding-inline: 12px;
    font-size: 10px;
}

.saved-unavailable-note {
    color: var(--muted-2);
    font-size: 10px;
}

.badge-unavailable {
    border-color: rgba(255, 121, 85, 0.3);
    color: #ffb19b;
}

.player-help a {
    flex: 0 0 auto;
    color: var(--muted);
    font-weight: 700;
}

.player-help a:hover {
    color: var(--text);
}

.film-info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border-top: 1px solid var(--border);
}

.film-info-grid div {
    display: grid;
    grid-template-columns: minmax(100px, 0.4fr) minmax(0, 1fr);
    gap: 13px;
    padding: 15px 10px;
    border-bottom: 1px solid var(--border);
}

.film-info-grid div:nth-child(odd) {
    border-right: 1px solid var(--border);
    padding-left: 0;
}

.film-info-grid div.wide {
    grid-column: 1 / -1;
    border-right: 0;
    padding-left: 0;
}

.film-info-grid dt,
.technical-panel dt {
    color: var(--muted-2);
    font-size: 10px;
}

.film-info-grid dd,
.technical-panel dd {
    margin: 0;
    font-size: 11px;
    font-weight: 650;
}

.long-description {
    margin: 22px 0 0;
    color: var(--description-long);
    font-size: 12px;
    line-height: 1.75;
}

.technical-panel {
    position: sticky;
    top: calc(var(--header-height) + 18px);
}

.technical-panel > dl {
    margin: 22px 0;
}

.technical-panel > dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}

.technical-panel dd {
    max-width: 58%;
    overflow: hidden;
    text-align: right;
    text-overflow: ellipsis;
}

.related-section {
    padding-bottom: 85px;
}

/* Footer, toast, errors */
.site-footer {
    border-top: 1px solid var(--border);
    background: var(--footer-bg);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    min-height: 120px;
}

.footer-inner strong {
    font-size: 14px;
}

.footer-inner p {
    margin: 4px 0 0;
    color: var(--muted-2);
    font-size: 10px;
}

.tmdb-attribution {
    display: block;
    margin-top: 6px;
    color: var(--muted-2);
    font-size: 8px;
}

.footer-links {
    display: flex;
    gap: 20px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.footer-links a:hover {
    color: var(--text);
}

.toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: 500;
    max-width: min(90vw, 430px);
    padding: 11px 16px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: #202632;
    box-shadow: var(--shadow);
    font-size: 11px;
    font-weight: 700;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 18px);
    transition: opacity 180ms ease, transform 180ms ease;
}

.toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.error-page {
    display: flex;
    min-height: calc(100vh - var(--header-height) - 120px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    text-align: center;
}

.error-code {
    color: var(--accent);
    font-size: clamp(70px, 16vw, 160px);
    font-weight: 900;
    line-height: 0.8;
    letter-spacing: -0.08em;
    opacity: 0.2;
}

.error-page h1 {
    margin-top: -10px;
    font-size: clamp(30px, 5vw, 50px);
}

.error-page p {
    margin: 14px 0 0;
    color: var(--muted);
}

/* Responsive */
@media (max-width: 1250px) {
    .media-grid-featured { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .media-grid-featured .media-card:nth-child(n + 7) { display: none; }
    .filter-panel { grid-template-columns: minmax(220px, 1.3fr) repeat(2, 0.8fr); }
    .filter-submit { align-self: end; }
    .filter-reset { grid-column: auto; align-self: end; min-height: 42px; }
    .collection-grid-featured { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .collection-grid-featured .collection-card:nth-child(n + 5) { display: none; }
}

@media (max-width: 1000px) {
    :root { --header-height: 70px; }
    .header-inner { grid-template-columns: auto 1fr auto auto; gap: 14px; }
    .main-nav { justify-self: center; }
    .header-search { width: 42px; justify-self: end; border: 0; background: transparent; }
    .header-search input, .header-search button { display: none; }
    .header-search .search-icon { left: 50%; transform: translate(-50%, -53%); }
    .hero { grid-template-columns: 1fr 360px; gap: 45px; min-height: 500px; }
    .hero h1 { font-size: clamp(44px, 6vw, 64px); }
    .stats-section { grid-template-columns: repeat(2, 1fr); }
    .media-grid-featured { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .media-grid-featured .media-card:nth-child(n + 5) { display: none; }
    .genre-cloud { grid-template-columns: repeat(3, 1fr); }
    .detail-content { grid-template-columns: 1fr; }
    .technical-panel { position: static; }
    .media-grid-related { grid-template-columns: repeat(4, 1fr); }
    .media-grid-related .media-card:nth-child(n + 5) { display: none; }
    .episode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    :root { --header-height: 64px; }
    .section-shell, .header-inner, .footer-inner { width: min(100% - 28px, var(--max-width)); }
    .site-header { height: var(--header-height); }
    .header-inner { grid-template-columns: 1fr auto auto; gap: 9px; }
    .brand-mark { width: 34px; height: 34px; border-radius: 10px; }
    .brand > span:last-child { font-size: 16px; }
    .theme-toggle { grid-column: 2; grid-row: 1; }
    .nav-toggle { display: grid; grid-column: 3; grid-row: 1; place-items: center; }
    .header-search { display: none; }
    .main-nav {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        display: grid;
        padding: 13px 14px 18px;
        border-bottom: 1px solid var(--border);
        background: var(--nav-bg);
        box-shadow: 0 25px 50px rgba(0, 0, 0, 0.45);
        opacity: 0;
        pointer-events: none;
        transform: translateY(-10px);
        transition: opacity 170ms ease, transform 170ms ease;
    }
    .main-nav.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
    .nav-link { min-height: 48px; }
    .hero { display: block; min-height: auto; padding-block: 58px 36px; }
    .hero h1 { font-size: clamp(41px, 13vw, 58px); }
    .hero-copy > p { font-size: 14px; line-height: 1.65; }
    .hero-panel { margin-top: 42px; }
    .stats-section { gap: 8px; }
    .stat-card { padding: 13px; }
    .stat-icon { width: 38px; height: 38px; }
    .stat-card strong { font-size: 17px; }
    .content-section { padding-block: 38px; }
    .section-heading { align-items: center; }
    .media-grid, .media-grid-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; }
    .media-grid-featured .media-card:nth-child(n) { display: block; }
    .collection-grid, .collection-grid-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 10px; }
    .collection-grid-featured .collection-card:nth-child(n) { display: block; }
    .media-card-title { font-size: 13px; }
    .media-card-description, .media-card-footer { display: none; }
    .genre-cloud { grid-template-columns: repeat(2, 1fr); }
    .dashboard-row { grid-template-columns: 1fr; }
    .status-list { grid-template-columns: 1fr; }
    .status-list div { padding: 13px 0; border-right: 0; border-bottom: 1px solid var(--border); }
    .page-intro { align-items: start; padding-block: 43px 27px; }
    .page-count { display: none; }
    .filter-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 13px; }
    .filter-search { grid-column: 1 / -1; }
    .filter-submit { grid-column: 1 / -1; }
    .filter-reset { grid-column: 1 / -1; justify-self: stretch; }
    .catalog-toolbar { min-height: 60px; }
    .media-grid.list-view .media-card { grid-template-columns: 75px minmax(0, 1fr); }
    .media-grid.list-view .media-card-footer { display: flex; }
    .detail-shell { padding-block: 20px 38px; }
    .breadcrumbs { margin-bottom: 23px; }
    .detail-hero { grid-template-columns: 125px minmax(0, 1fr); align-items: start; gap: 20px; }
    .detail-copy h1 { font-size: clamp(28px, 8vw, 42px); }
    .detail-description { display: none; }
    .detail-badges { margin-bottom: 11px; }
    .detail-badges .badge:nth-child(n + 3) { display: none; }
    .detail-facts { gap: 7px 11px; margin-top: 15px; font-size: 10px; }
    .detail-actions { margin-top: 19px; }
    .detail-actions .button { width: 100%; }
    .detail-content { width: 100%; }
    .player-section, .info-panel, .technical-panel { padding: 17px 14px; border-radius: 0; border-inline: 0; }
    .player-frame { border-radius: 12px; }
    .player-actions .button { flex: 1 1 calc(50% - 8px); }
    .player-actions .button-quiet { margin-left: 0; }
    .autoplay-next-toggle { flex: 1 1 100%; justify-content: center; }
    .film-info-grid { grid-template-columns: 1fr; }
    .film-info-grid div, .film-info-grid div:nth-child(odd) { grid-column: auto; border-right: 0; padding-inline: 0; }
    .media-grid-related { grid-template-columns: repeat(2, 1fr); }
    .media-grid-related .media-card:nth-child(n + 5) { display: none; }
    .collection-detail-hero { padding-block: 20px 40px; }
    .collection-hero-grid { grid-template-columns: 110px minmax(0, 1fr); align-items: start; gap: 18px; }
    .collection-hero-grid h1 { font-size: clamp(28px, 8vw, 42px); }
    .collection-hero-grid .detail-description { display: none; }
    .collection-hero-grid .button { width: 100%; margin-top: 18px; }
    .episode-grid { grid-template-columns: 1fr; }
    .saved-media-grid { grid-template-columns: 1fr; }
    .footer-inner { align-items: flex-start; flex-direction: column; justify-content: center; }
    .footer-links { flex-wrap: wrap; }
}

@media (max-width: 430px) {
    .hero-panel { padding: 20px; }
    .hero-mini-stats div { padding-inline: 9px; }
    .stats-section { grid-template-columns: 1fr; }
    .stat-card span:last-child { white-space: normal; }
    .section-heading h2 { font-size: 23px; }
    .section-link { max-width: 95px; text-align: right; }
    .genre-cloud { grid-template-columns: 1fr; }
    .filter-panel { grid-template-columns: 1fr; }
    .filter-search, .filter-submit, .filter-reset { grid-column: auto; }
    .view-switch { display: none; }
    .page-direction { min-width: 38px; }
    .direction-label { display: none; }
    .detail-hero { grid-template-columns: 100px minmax(0, 1fr); gap: 15px; }
    .detail-facts span:nth-child(n + 3) { display: none; }
    .detail-actions .button-secondary { display: none; }
    .player-launch > span { width: 58px; height: 58px; }
    .player-help { align-items: flex-start; flex-direction: column; gap: 7px; }
    .player-actions .button { flex-basis: 100%; }
    .next-episode-overlay, .resume-overlay { padding: 10px; }
    .next-episode-card { padding: 16px 12px; }
    .next-episode-card > div { flex-wrap: wrap; }
    .next-episode-card .button { flex: 1 1 120px; }
    .episode-steps a { min-width: 0; gap: 8px; }
    .saved-media-card { grid-template-columns: 105px minmax(0, 1fr); min-height: 175px; }
    .saved-media-copy { padding: 13px; }
    .saved-media-description { display: none; }
    .saved-media-actions { align-items: flex-start; flex-direction: column; }
}

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