:root {
    --bg: #050505;
    --bg-soft: #0f0f12;
    --panel: rgba(20, 20, 23, 0.92);
    --panel-strong: rgba(13, 13, 16, 0.96);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f4f5;
    --muted: #a6a6ad;
    --accent: #e50914;
    --accent-soft: #ff5f57;
    --success: #23c16b;
    --warning: #ffb347;
    --radius: 22px;
    --shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.esmflix-body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(229, 9, 20, 0.18), transparent 26%),
        radial-gradient(circle at top right, rgba(255, 95, 87, 0.12), transparent 20%),
        linear-gradient(180deg, #080808 0%, #050505 46%, #0b0b0d 100%);
    min-height: 100vh;
}

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

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

.site-shell {
    position: relative;
    overflow: hidden;
}

.container {
    position: relative;
    z-index: 2;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(18px);
    background: rgba(5, 5, 5, 0.72);
    border-bottom: 1px solid var(--line);
}

.site-header__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.2rem;
    padding: 1rem 0;
}

.site-brand {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 170px;
}

.site-brand__mark,
.site-footer__brand {
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.12em;
    font-size: clamp(2rem, 2.2vw, 2.5rem);
    color: var(--accent);
}

.site-brand__tag,
.site-footer__copy,
.muted {
    color: var(--muted);
    font-size: 0.9rem;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.35rem;
}

.site-nav__link {
    padding: 0.7rem 1rem;
    border-radius: 999px;
    color: var(--muted);
    transition: 0.25s ease;
}

.site-nav__link:hover,
.site-nav__link.is-active {
    background: rgba(229, 9, 20, 0.14);
    color: var(--text);
}

.site-search,
.search-panel__form {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
}

.site-search input,
.search-panel__form input {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 999px;
    padding: 0.95rem 1.1rem;
}

.site-search input::placeholder,
.search-panel__form input::placeholder {
    color: #8a8a92;
}

.site-search button,
.button {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.site-search button {
    width: 48px;
    height: 48px;
    background: var(--accent);
    color: #fff;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 0.95rem 1.35rem;
    font-weight: 800;
}

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

.button--primary {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
    color: #fff;
}

.button--ghost {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    border: 1px solid var(--line);
}

.scroll-top-button {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 90;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-soft) 100%);
    color: #fff;
    box-shadow: 0 18px 32px rgba(0, 0, 0, 0.4);
    display: grid;
    place-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.scroll-top-button.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-button:hover {
    transform: translateY(-2px);
}

.flash-stack {
    padding-top: 1rem;
}

.flash {
    padding: 1rem 1.2rem;
    border-radius: 18px;
    margin-bottom: 0.75rem;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.06);
}

.flash--success {
    border-color: rgba(35, 193, 107, 0.28);
    background: rgba(35, 193, 107, 0.12);
}

.flash--error {
    border-color: rgba(229, 9, 20, 0.34);
    background: rgba(229, 9, 20, 0.14);
}

.flash--warning {
    border-color: rgba(255, 179, 71, 0.3);
    background: rgba(255, 179, 71, 0.12);
}

.hero {
    position: relative;
    padding: 6rem 0 4rem;
}

.hero__backdrop {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.28;
    transform: scale(1.04);
}

.hero__backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 5, 5, 0.28) 0%, rgba(5, 5, 5, 0.82) 50%, #050505 100%);
}

.hero__content {
    position: relative;
    z-index: 2;
    max-width: 720px;
}

.hero__content--compact {
    max-width: 860px;
}

.hero__eyebrow,
.section-heading__eyebrow,
.detail-cast__label {
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-soft);
}

.hero__title,
.section-heading__title {
    margin: 0.4rem 0 0;
    line-height: 0.95;
    font-family: "Bebas Neue", sans-serif;
    letter-spacing: 0.03em;
}

.hero__title {
    font-size: clamp(3rem, 8vw, 6.8rem);
}

.section-heading__title {
    font-size: clamp(2rem, 4vw, 3.2rem);
}

.hero__copy,
.section-heading__copy,
.media-card__copy,
.info-card p,
.prose-block p,
.detail-cast p,
.torbox-card__sub {
    color: var(--muted);
    line-height: 1.75;
}

.hero__meta,
.torbox-card__facts,
.media-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin: 1rem 0 0;
}

.hero__meta span,
.torbox-card__facts span,
.media-card__meta span {
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    font-size: 0.88rem;
    color: #d5d5da;
}

.hero__actions,
.media-card__actions,
.torbox-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1.35rem;
}

.panel,
.content-section {
    padding: 0 0 4rem;
}

.content-section--alt {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.015) 0%, rgba(255, 255, 255, 0) 100%);
}

.search-panel,
.detail-hero,
.player-shell,
.info-card,
.prose-block {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.search-panel {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 1.5rem;
    padding: 1.7rem;
}

.search-panel__form--wide {
    max-width: 760px;
}

.section-heading {
    margin-bottom: 1.6rem;
}

.media-grid,
.torbox-grid,
.info-grid {
    display: grid;
    gap: 1.25rem;
}

.media-grid {
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    align-items: stretch;
}

.torbox-grid,
.info-grid {
    grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
}

.media-card,
.torbox-card {
    background: var(--panel-strong);
    border: 1px solid var(--line);
    border-radius: 20px;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.media-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 14px;
    overflow: hidden;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.media-card:hover,
.torbox-card:hover {
    transform: translateY(-4px);
    border-color: rgba(229, 9, 20, 0.28);
}

.media-card__image {
    position: relative;
    aspect-ratio: 2 / 3;
    background: linear-gradient(140deg, rgba(229, 9, 20, 0.22), rgba(255, 95, 87, 0.12));
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 20px 36px rgba(0, 0, 0, 0.26);
}

.media-card__image::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 34%;
    background: linear-gradient(180deg, transparent 0%, rgba(3, 3, 4, 0.85) 100%);
    pointer-events: none;
}

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

.media-card__fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-family: "Bebas Neue", sans-serif;
    font-size: 5rem;
    color: rgba(255, 255, 255, 0.7);
}

.media-card__body,
.torbox-card,
.info-card,
.prose-block {
    padding: 1.25rem;
}

.media-card__body {
    padding: 1rem 0.15rem 0.2rem;
    display: flex;
    flex: 1;
    flex-direction: column;
}

.media-card__title,
.torbox-card__title,
.info-card h2,
.prose-block h2 {
    margin: 0.75rem 0 0;
    font-size: 1.3rem;
}

.media-card__title {
    line-height: 1.2;
    min-height: 3.15rem;
}

.media-card__title a,
.media-card__copy {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.media-card__title a {
    -webkit-line-clamp: 2;
}

.media-card__copy {
    -webkit-line-clamp: 3;
    min-height: 4.8rem;
}

.media-card__actions {
    margin-top: auto;
    padding-top: 1rem;
}

.search-suggestions {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 0.75rem);
    background: rgba(11, 11, 13, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.search-suggestion {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 0.9rem;
    align-items: center;
    width: 100%;
    padding: 0.9rem 1rem;
    background: transparent;
    color: var(--text);
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    text-align: left;
    cursor: pointer;
}

.search-suggestion:last-child {
    border-bottom: 0;
}

.search-suggestion:hover,
.search-suggestion:focus-visible {
    background: rgba(229, 9, 20, 0.12);
    outline: none;
}

.search-suggestion__thumb {
    width: 48px;
    height: 64px;
    border-radius: 12px;
    background: linear-gradient(140deg, rgba(229, 9, 20, 0.22), rgba(255, 95, 87, 0.12));
    overflow: hidden;
    flex-shrink: 0;
}

.search-suggestion__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-suggestion__fallback {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.6rem;
    color: rgba(255, 255, 255, 0.8);
}

.search-suggestion__label {
    display: block;
    font-weight: 800;
    line-height: 1.2;
}

.search-suggestion__content {
    min-width: 0;
}

.search-suggestion__meta {
    display: block;
    margin-top: 0.25rem;
    color: var(--muted);
    font-size: 0.88rem;
}

.site-search.has-suggestions,
.search-panel__form.has-suggestions {
    z-index: 55;
}

.empty-state {
    padding: 1.4rem;
    border: 1px dashed rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}

.detail-hero {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 1.7rem;
    padding: 1.5rem;
}

.detail-hero__poster img {
    width: 100%;
    border-radius: 18px;
}

.detail-hero__genres {
    color: #d9d9de;
    margin: 1rem 0 0;
}

.detail-cast {
    margin-top: 1.3rem;
}

.torbox-card__top,
.site-footer__grid {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.torbox-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: flex-start;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.08);
}

.status-pill--good {
    background: rgba(35, 193, 107, 0.16);
    color: #78f2aa;
}

.status-pill--warning {
    background: rgba(255, 179, 71, 0.16);
    color: #ffd089;
}

.status-pill--accent {
    background: rgba(229, 9, 20, 0.16);
    color: #ff8c92;
}

.inline-form,
.stack-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.torbox-card__hint {
    color: var(--muted);
    font-size: 0.9rem;
}

.player-shell {
    display: grid;
    grid-template-columns: 2fr minmax(260px, 360px);
    gap: 1.4rem;
    padding: 1.4rem;
}

.player-shell__main {
    min-width: 0;
}

.player-shell__sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.player-shell__video {
    width: 100%;
    min-height: 440px;
    border-radius: 18px;
    background: #000;
}

.neo-player {
    position: relative;
    border-radius: 26px;
    padding: 1rem;
    background:
        radial-gradient(circle at top left, rgba(8, 247, 254, 0.2), transparent 24%),
        radial-gradient(circle at top right, rgba(254, 83, 187, 0.18), transparent 28%),
        linear-gradient(180deg, rgba(7, 10, 16, 0.94) 0%, rgba(3, 5, 10, 0.98) 100%);
    border: 1px solid rgba(8, 247, 254, 0.2);
    box-shadow:
        0 32px 80px rgba(0, 0, 0, 0.45),
        inset 0 0 0 1px rgba(255, 255, 255, 0.04),
        0 0 30px rgba(8, 247, 254, 0.08);
    overflow: hidden;
}

.neo-player__screen {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(4, 8, 14, 0.86) 0%, rgba(2, 4, 8, 0.98) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.neo-player__video {
    border-radius: 22px;
    display: block;
}

.neo-player__video::-webkit-media-controls {
    display: none !important;
}

.neo-player__overlay-play {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 3;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    border: 0;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(6, 14, 24, 0.58);
    color: #fff;
    backdrop-filter: blur(18px);
    box-shadow: 0 0 0 1px rgba(8, 247, 254, 0.18), 0 0 40px rgba(8, 247, 254, 0.2);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.neo-player__overlay-play i {
    font-size: 1.5rem;
}

.neo-player.is-playing .neo-player__overlay-play {
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(0.94);
}

.neo-player__topbar,
.neo-player__controls {
    position: absolute;
    left: 18px;
    right: 18px;
    z-index: 4;
}

.neo-player__topbar {
    top: 18px;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.neo-player__titlewrap,
.neo-player__controls {
    padding: 0.9rem 1rem;
    border-radius: 20px;
    background: rgba(4, 10, 18, 0.38);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
}

.neo-player__eyebrow {
    display: block;
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #08f7fe;
}

.neo-player__title {
    margin: 0.4rem 0 0;
    font-size: 1.15rem;
    color: #fff;
}

.neo-player__meta {
    margin: 0.4rem 0 0;
    color: rgba(236, 248, 255, 0.72);
    font-size: 0.88rem;
}

.neo-player__controls {
    bottom: 18px;
}

.neo-player__timeline,
.neo-player__control-row,
.neo-player__group {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.neo-player__timeline {
    margin-bottom: 0.85rem;
}

.neo-player__group {
    flex-wrap: wrap;
}

.neo-player__control-row {
    justify-content: space-between;
    gap: 1rem;
}

.neo-player__group--right {
    justify-content: flex-end;
}

.neo-control {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    padding: 0.7rem 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #ecf8ff;
    font-weight: 800;
}

.neo-control--primary {
    background: linear-gradient(135deg, rgba(8, 247, 254, 0.2) 0%, rgba(8, 247, 254, 0.08) 100%);
    border-color: rgba(8, 247, 254, 0.32);
    box-shadow: 0 0 30px rgba(8, 247, 254, 0.12);
}

.neo-control--accent {
    background: linear-gradient(135deg, rgba(254, 83, 187, 0.2) 0%, rgba(101, 45, 255, 0.12) 100%);
    border-color: rgba(254, 83, 187, 0.28);
}

.neo-player__time {
    min-width: 48px;
    font-size: 0.84rem;
    color: #cce6f4;
}

.neo-player__range {
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(8, 247, 254, 0.92) 0%, rgba(8, 247, 254, 0.92) var(--player-progress, 0%), rgba(255, 255, 255, 0.16) var(--player-progress, 0%), rgba(255, 255, 255, 0.16) 100%);
    outline: none;
}

.neo-player__progress {
    flex: 1;
}

.neo-player__volume {
    width: 110px;
}

.neo-player__range::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8, 247, 254, 0.22);
    cursor: pointer;
}

.neo-player__range::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(8, 247, 254, 0.22);
    cursor: pointer;
}

.neo-player:fullscreen {
    width: 100vw;
    height: 100vh;
    padding: 1.1rem;
    border-radius: 0;
    background:
        radial-gradient(circle at top left, rgba(8, 247, 254, 0.26), transparent 24%),
        radial-gradient(circle at top right, rgba(254, 83, 187, 0.18), transparent 28%),
        #020408;
}

.neo-player:fullscreen .neo-player__video {
    min-height: calc(100vh - 2.2rem);
}

.stack-links a {
    padding: 0.8rem 0.95rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    color: var(--text);
}

.stack-links a:hover {
    background: rgba(229, 9, 20, 0.15);
}

.stack-links a.is-active {
    background: rgba(8, 247, 254, 0.16);
    border-color: rgba(8, 247, 254, 0.3);
    color: #fff;
}

.info-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.info-card__lead {
    margin: 0 0 1rem;
    color: var(--muted);
    line-height: 1.7;
}

.fact-list {
    display: grid;
    gap: 0.75rem;
}

.fact-list__row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.fact-list__row:first-child {
    padding-top: 0;
    border-top: 0;
}

.fact-list__key {
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.fact-list__value {
    color: var(--text);
    font-weight: 700;
    text-align: right;
}

.prose-block code {
    padding: 0.15rem 0.4rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
}

.site-footer {
    padding: 2rem 0 3rem;
    border-top: 1px solid var(--line);
    margin-top: 2rem;
}

.site-footer__links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.site-footer__links a {
    color: var(--muted);
}

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

@media (max-width: 1100px) {
    .site-header__row,
    .search-panel,
    .detail-hero,
    .player-shell,
    .site-footer__grid {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .site-search {
        width: 100%;
    }

    .neo-player__control-row {
        flex-direction: column;
        align-items: stretch;
    }

    .neo-player__group--right {
        justify-content: flex-start;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-top: 4.5rem;
    }

    .media-grid,
    .torbox-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    .site-search,
    .search-panel__form,
    .hero__actions,
    .media-card__actions,
    .torbox-card__actions {
        flex-direction: column;
    }

    .button,
    .site-search button {
        width: 100%;
    }

    .search-suggestions {
        top: calc(100% + 0.6rem);
    }

    .player-shell__video {
        min-height: 240px;
    }

    .neo-player {
        padding: 0.7rem;
    }

    .neo-player__topbar,
    .neo-player__controls {
        left: 10px;
        right: 10px;
    }

    .neo-player__topbar {
        top: 10px;
        flex-direction: column;
    }

    .neo-player__controls {
        bottom: 10px;
    }

    .neo-player__timeline {
        gap: 0.5rem;
    }

    .neo-player__time {
        min-width: 40px;
        font-size: 0.78rem;
    }

    .info-card__head,
    .fact-list__row {
        flex-direction: column;
    }

    .fact-list__value {
        text-align: left;
    }

    .neo-player__volume {
        width: 100%;
    }

    .neo-control {
        justify-content: center;
        width: 100%;
    }

    .neo-player__overlay-play {
        width: 70px;
        height: 70px;
    }
}
