@layer reset, base, layout, components, pages, utilities;

/* ============================================================
   01. RESET
   ============================================================ */
@layer reset {
    *, *::before, *::after { box-sizing: border-box; }
    html, body, h1, h2, h3, h4, h5, p, ol, ul, dl, dt, dd, figure, blockquote, pre, fieldset, legend { margin: 0; padding: 0; }
    ol, ul { list-style: none; }
    img, picture, svg, video { display: block; max-width: 100%; }
    button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
    a { color: inherit; text-decoration: none; }
    input, select, textarea { font: inherit; color: inherit; }
}

/* ============================================================
   02. TOKENS
   ============================================================ */
@layer base {
    :root {
        /* Surface palette — drawn around a navy + cyan duotone */
        --c-deep: #0c1120;
        --c-shell: #13192b;
        --c-shell-2: #1c2538;
        --c-shell-3: #232c44;
        --c-line: #2a3450;
        --c-line-soft: #3a456a;
        --c-paper: #eef0f1;
        --c-paper-2: #ffffff;
        --c-paper-line: #d9dde2;

        /* Brand accent — cyan family */
        --c-accent: #2bb6c4;
        --c-accent-bright: #3ed4e3;
        --c-accent-dim: #1f8e99;
        --c-accent-soft: rgba(62, 212, 227, 0.16);
        --c-accent-glow: rgba(62, 212, 227, 0.45);

        /* Text */
        --c-text: #e9edf5;
        --c-text-muted: #aab2c5;
        --c-text-fade: #6f7a93;
        --c-text-on-paper: #1d2335;
        --c-text-on-paper-soft: #5b6177;

        /* Status */
        --c-warm: #f6c244;
        --c-bad: #ef5b5b;
        --c-good: #5ed1a4;

        /* Shape */
        --r-xs: 4px;
        --r-sm: 8px;
        --r-md: 12px;
        --r-lg: 18px;
        --r-pill: 999px;

        /* Elevation */
        --shadow-card: 0 8px 30px -10px rgba(0, 0, 0, 0.45);
        --shadow-pop: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
        --shadow-button: 0 4px 14px -4px rgba(43, 182, 196, 0.55);

        /* Layout */
        --gap-xs: 4px;
        --gap-sm: 8px;
        --gap-md: 14px;
        --gap-lg: 22px;
        --gap-xl: 36px;
        --gap-xxl: 56px;
        --shell-x: clamp(14px, 3vw, 36px);
        --shell-max: 1320px;

        /* Transition */
        --ease: cubic-bezier(0.4, 0, 0.2, 1);
        --t-fast: 140ms;
        --t-base: 240ms;
    }

    @media (prefers-color-scheme: light) {
        :root { color-scheme: dark; }
    }
}

/* ============================================================
   03. BASE
   ============================================================ */
@layer base {
    html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
    body {
        font-family: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
        font-size: 15px;
        line-height: 1.6;
        background: var(--c-shell);
        color: var(--c-text);
        min-height: 100vh;
        overflow-x: hidden;
    }
    @media (width >= 768px) { body { font-size: 16px; } }

    a { color: var(--c-accent-bright); transition: color var(--t-fast) var(--ease); }
    a:hover { color: var(--c-accent); }
    a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
        outline: 2px solid var(--c-accent-bright);
        outline-offset: 2px;
        border-radius: var(--r-xs);
    }

    h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; letter-spacing: -0.01em; }

    .ftt-skip {
        position: absolute;
        top: -100px; left: 0;
        background: var(--c-accent-bright);
        color: var(--c-text-on-paper);
        padding: 12px 20px;
        font-weight: 700;
        z-index: 9999;
    }
    .ftt-skip:focus { top: 0; }
}

/* ============================================================
   04. LAYOUT SHELL
   ============================================================ */
@layer layout {
    .ftt-app { display: flex; flex-direction: column; min-height: 100vh; }
    .ftt-main { flex: 1; }

    /* topbar */
    .ftt-topbar {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 60;
        background: rgba(0, 0, 0, 0.55);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        border-bottom: none;
    }
    .ftt-topbar.ftt-topbar--floating {
        background: rgba(0, 0, 0, 0.55);
    }
    .ftt-topbar-row {
        max-width: var(--shell-max);
        margin: 0 auto;
        padding: 8px var(--shell-x);
        display: flex;
        align-items: center;
        gap: var(--gap-md);
    }

    /* Push main content below fixed header */
    .ftt-app { padding-top: 44px; }

    .ftt-brand { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
    .ftt-brand-mark { filter: drop-shadow(0 2px 6px rgba(62, 212, 227, 0.35)); }
    .ftt-brand-word {
        font-weight: 800;
        font-size: 16px;
        letter-spacing: -0.02em;
        color: var(--c-text);
    }
    .ftt-brand:hover .ftt-brand-word { color: var(--c-accent-bright); }

    .ftt-nav {
        display: none;
        align-items: center;
        gap: 4px;
        flex: 1;
    }
    @media (width >= 880px) { .ftt-nav { display: flex; } }

    .ftt-nav-link {
        padding: 6px 10px;
        border-radius: var(--r-pill);
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
        font-size: 16px;
        font-weight: 400;
        line-height: 24px;
        letter-spacing: normal;
        color: #fff;
        transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
    }
    .ftt-nav-link:hover { color: var(--c-text); background: rgba(255, 255, 255, 0.05); }
    .ftt-nav-link.ftt-current { color: var(--c-accent-bright); background: var(--c-accent-soft); }
    .ftt-nav-link--vip {
        color: var(--c-warm) !important;
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }
    .ftt-nav-link--vip:hover { color: #ffd866 !important; background: rgba(246, 194, 68, 0.08); }

    .ftt-topbar-tools { display: flex; align-items: center; gap: 10px; margin-left: auto; }

    .ftt-quick-search {
        display: none;
        align-items: center;
        gap: 8px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid rgba(255, 255, 255, 0.08);
        border-radius: var(--r-pill);
        padding: 6px 6px 6px 14px;
        transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
    }
    @media (width >= 980px) { .ftt-quick-search { display: flex; } }
    .ftt-quick-search:focus-within {
        border-color: var(--c-accent-bright);
        background: rgba(62, 212, 227, 0.08);
    }
    .ftt-quick-search input {
        background: transparent;
        border: 0;
        outline: 0;
        width: 180px;
        font-size: 13px;
        color: var(--c-text);
    }
    .ftt-quick-search input::placeholder { color: var(--c-text-fade); }
    .ftt-quick-search button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 6px 12px;
        border-radius: var(--r-pill);
        background: var(--c-accent);
        color: #04161a;
        font-size: 13px;
        font-weight: 600;
        transition: background var(--t-fast) var(--ease);
    }
    .ftt-quick-search button:hover { background: var(--c-accent-bright); }
    .ftt-quick-search button span { display: none; }
    @media (width >= 1100px) { .ftt-quick-search button span { display: inline; } }

    .ftt-topbar-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: var(--r-pill);
        background: rgba(255, 255, 255, 0.04);
        color: var(--c-text);
        transition: background var(--t-fast) var(--ease);
    }
    .ftt-topbar-toggle:hover { background: rgba(255, 255, 255, 0.1); }
    @media (width >= 880px) { .ftt-topbar-toggle { display: none; } }

    /* mobile drawer */
    .ftt-mobile-drawer {
        position: fixed;
        inset-block: 0;
        inset-inline-end: 0;
        width: min(320px, 88vw);
        background: var(--c-shell-2);
        border-inline-start: 1px solid var(--c-line);
        z-index: 90;
        transform: translateX(100%);
        transition: transform var(--t-base) var(--ease);
        padding: 18px;
        display: flex;
        flex-direction: column;
        gap: var(--gap-md);
        overflow-y: auto;
    }
    .ftt-mobile-drawer.ftt-open { transform: translateX(0); }
    .ftt-mobile-head { display: flex; align-items: center; justify-content: space-between; }
    .ftt-mobile-brand { font-weight: 800; font-size: 18px; }
    .ftt-mobile-close {
        width: 36px; height: 36px;
        border-radius: var(--r-pill);
        background: rgba(255, 255, 255, 0.06);
        display: inline-flex; align-items: center; justify-content: center;
    }

    .ftt-mobile-search {
        display: flex; gap: 6px;
        background: rgba(255, 255, 255, 0.04);
        border: 1px solid var(--c-line);
        border-radius: var(--r-pill);
        padding: 4px 4px 4px 14px;
    }
    .ftt-mobile-search input {
        flex: 1; background: transparent; border: 0; outline: 0; font-size: 14px;
    }
    .ftt-mobile-search button {
        width: 36px; height: 36px;
        border-radius: var(--r-pill);
        background: var(--c-accent);
        color: #04161a;
        display: inline-flex; align-items: center; justify-content: center;
    }

    .ftt-mobile-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
    .ftt-mobile-nav a {
        padding: 12px 14px;
        border-radius: var(--r-md);
        color: var(--c-text);
        font-weight: 500;
        font-size: 15px;
    }
    .ftt-mobile-nav a:hover { background: rgba(255, 255, 255, 0.06); }

    body.ftt-drawer-open { overflow: hidden; }
    body.ftt-drawer-open::after {
        content: "";
        position: fixed; inset: 0; z-index: 80;
        background: rgba(0, 0, 0, 0.55);
    }

    /* footer */
    .ftt-foot {
        margin-top: var(--gap-xxl);
        background: var(--c-deep);
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        padding: var(--gap-xl) var(--shell-x) var(--gap-lg);
    }
    .ftt-foot-grid {
        max-width: var(--shell-max);
        margin: 0 auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: var(--gap-md);
        text-align: center;
    }

    .ftt-foot-nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 18px;
    }
    .ftt-foot-nav a { color: var(--c-text-muted); font-size: 13px; }
    .ftt-foot-nav a:hover { color: var(--c-accent-bright); }

    .ftt-foot-disclaimer {
        font-size: 12px;
        color: var(--c-text-fade);
        max-width: 600px;
        line-height: 1.6;
    }
    .ftt-foot-copy { color: var(--c-text-fade); font-size: 12px; }

    /* breadcrumbs */
    .ftt-crumbs {
        max-width: var(--shell-max);
        margin: 12px auto 0;
        padding: 0 var(--shell-x);
    }
    .ftt-crumbs-track { display: flex; flex-wrap: nowrap; align-items: center; gap: 6px; font-size: 12.5px; color: var(--c-text-muted); overflow: hidden; }
    .ftt-crumbs-link { color: var(--c-text-muted); white-space: nowrap; }
    .ftt-crumbs-link:hover { color: var(--c-accent-bright); }
    .ftt-crumbs-here { color: var(--c-text); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ftt-crumbs-sep { color: var(--c-text-fade); }
    .ftt-page-detail .ftt-crumbs { display: none; }

    /* notification bar */
    .ftt-notice { background: linear-gradient(90deg, var(--c-accent-dim), var(--c-accent)); color: #04161a; }
    .ftt-notice-inner {
        max-width: var(--shell-max);
        margin: 0 auto;
        padding: 8px var(--shell-x);
        display: flex; align-items: center; gap: 12px; font-size: 13px;
    }
    .ftt-notice-flag { display: inline-flex; }
    .ftt-notice-msg { flex: 1; font-weight: 500; }
    .ftt-notice-cta {
        display: inline-flex; align-items: center; gap: 6px;
        background: rgba(0, 0, 0, 0.18);
        color: #04161a;
        padding: 4px 10px;
        border-radius: var(--r-pill);
        font-weight: 600; font-size: 12px;
    }
    .ftt-notice-cta:hover { background: rgba(0, 0, 0, 0.28); color: #04161a; }
    .ftt-notice-x { width: 24px; height: 24px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; }
    .ftt-notice-x:hover { background: rgba(0, 0, 0, 0.18); }
    .ftt-notice.ftt-loaded[hidden] { display: none; }

    .ftt-notice-dialog {
        border: 1px solid var(--c-line);
        background: var(--c-shell-2);
        color: var(--c-text);
        border-radius: var(--r-lg);
        padding: 0;
        max-width: 480px;
        width: 90vw;
    }
    .ftt-notice-dialog::backdrop { background: rgba(0, 0, 0, 0.7); }
    .ftt-notice-dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--c-line); }
    .ftt-notice-dialog-head h3 { font-size: 15px; font-weight: 600; }
    .ftt-notice-dialog-x { width: 28px; height: 28px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center; }
    .ftt-notice-dialog-x:hover { background: rgba(255, 255, 255, 0.08); }
    .ftt-notice-dialog-body { padding: 18px; font-size: 14px; }
    .ftt-notice-dialog-body p { margin-bottom: 14px; }
    .ftt-notice-dialog-link { color: var(--c-accent-bright); font-weight: 600; }
}

/* ============================================================
   05. COMPONENTS
   ============================================================ */
@layer components {
    /* buttons */
    .ftt-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 18px;
        border-radius: var(--r-pill);
        font-size: 14px;
        font-weight: 600;
        line-height: 1;
        transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
        white-space: nowrap;
    }
    .ftt-btn:hover { transform: translateY(-1px); }
    .ftt-btn--play, .ftt-btn--solid {
        background: var(--c-accent);
        color: #04161a;
        box-shadow: var(--shadow-button);
    }
    .ftt-btn--play:hover, .ftt-btn--solid:hover { background: var(--c-accent-bright); color: #04161a; }
    .ftt-btn--ghost {
        background: rgba(255, 255, 255, 0.06);
        color: var(--c-text);
        border: 1px solid rgba(255, 255, 255, 0.12);
    }
    .ftt-btn--ghost:hover { background: rgba(255, 255, 255, 0.12); color: var(--c-text); border-color: rgba(255, 255, 255, 0.22); }
    .ftt-btn--lg { padding: 12px 24px; font-size: 15px; }

    /* card */
    .ftt-card {
        position: relative;
        flex: 0 0 calc(50% - 8px);
        scroll-snap-align: start;
        background: transparent;
        border-radius: 0;
        overflow: visible;
        transition: transform var(--t-base) var(--ease);
    }
    @media (width >= 480px) { .ftt-card { flex-basis: calc(33.333% - 11px); } }
    @media (width >= 720px) { .ftt-card { flex-basis: calc(25% - 12px); } }
    @media (width >= 1024px) { .ftt-card { flex-basis: calc(16.666% - 14px); } }
    @media (width >= 1280px) { .ftt-card { flex-basis: calc(14.285% - 14px); } }

    .ftt-card-link { display: block; color: #333; }
    .ftt-card-art {
        position: relative;
        display: block;
        aspect-ratio: 2 / 3;
        overflow: hidden;
        background: #e0e8ec;
        border-radius: var(--r-sm);
        border: 3px solid #d0dce2;
    }
    .ftt-card-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        transition: transform var(--t-base) var(--ease);
    }
    .ftt-card:hover { transform: translateY(-3px); }
    .ftt-card:hover .ftt-card-img { transform: scale(1.03); }

    /* Year / Episode badge — top left */
    .ftt-card-year {
        position: absolute;
        top: 6px; inset-inline-start: 6px;
        background: var(--c-accent);
        color: #fff;
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 700;
    }

    /* Icons — top right */
    .ftt-card-icons {
        position: absolute;
        top: 6px; inset-inline-end: 6px;
        display: flex;
        gap: 3px;
    }
    .ftt-card-icon {
        background: var(--c-accent);
        color: #fff;
        width: 22px;
        height: 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 4px;
    }

    /* Rating badge — bottom left */
    .ftt-card-rating {
        position: absolute;
        bottom: 6px; inset-inline-start: 6px;
        background: var(--c-accent);
        color: #fff;
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 700;
        display: inline-flex;
        align-items: center;
        gap: 3px;
    }

    /* Title below poster — no card background */
    .ftt-card-name {
        display: block;
        padding: 6px 2px 0;
        font-size: 12px;
        font-weight: 400;
        color: #333;
        text-align: left;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .ftt-card-link:hover .ftt-card-name { color: var(--c-accent); }

    /* Legacy classes hidden */
    .ftt-card-corner { display: none; }
    .ftt-card-kind { display: none; }
    .ftt-card-veil { display: none; }

    /* rail (slider) */
    .ftt-rail { position: relative; padding: 0 var(--shell-x); }
    .ftt-rail-track {
        display: flex;
        flex-wrap: nowrap;
        gap: var(--gap-md);
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: var(--shell-x);
        padding-block: 4px;
        scrollbar-width: none;
    }
    .ftt-rail-track::-webkit-scrollbar { display: none; }

    .ftt-rail-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 4;
        width: 38px; height: 38px;
        border-radius: var(--r-pill);
        background: rgba(13, 18, 32, 0.85);
        color: #fff;
        display: none;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(8px);
        box-shadow: var(--shadow-pop);
        transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
    }
    @media (width >= 768px) { .ftt-rail-arrow { display: inline-flex; } }
    .ftt-rail-arrow:hover { background: var(--c-accent); color: #04161a; }
    .ftt-rail-arrow--prev { inset-inline-start: 8px; }
    .ftt-rail-arrow--next { inset-inline-end: 8px; }

    /* rail head */
    .ftt-rail-head {
        max-width: var(--shell-max);
        margin: 0 auto var(--gap-md);
        padding: 0 var(--shell-x);
        display: flex; align-items: baseline; justify-content: space-between; gap: var(--gap-md); flex-wrap: wrap;
    }
    .ftt-rail-h2 {
        font-size: clamp(18px, 2.6vw, 24px);
        color: var(--c-text);
        display: inline-flex;
        align-items: center;
        gap: 10px;
    }
    .ftt-rail-flag {
        background: var(--c-accent);
        color: #04161a;
        padding: 2px 9px;
        border-radius: var(--r-sm);
        font-size: 12px;
        font-weight: 800;
        letter-spacing: 0.05em;
    }
    .ftt-rail-cap { font-size: 13px; color: var(--c-text-fade); margin: 0; }
    .ftt-rail-cta { font-size: 13px; color: var(--c-accent-bright); font-weight: 500; }
    .ftt-rail-cta:hover { color: var(--c-accent); }

    /* trailer dialog */
    .ftt-trailer {
        border: 0;
        background: rgba(0, 0, 0, 0.92);
        padding: 0;
        width: min(94vw, 1024px);
        max-height: 90vh;
        border-radius: var(--r-md);
        overflow: visible;
    }
    .ftt-trailer::backdrop { background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(10px); }
    .ftt-trailer-x {
        position: absolute;
        top: -42px; inset-inline-end: 0;
        background: rgba(255, 255, 255, 0.1);
        color: #fff;
        width: 36px; height: 36px;
        border-radius: var(--r-pill);
        display: inline-flex; align-items: center; justify-content: center;
    }
    .ftt-trailer-x:hover { background: rgba(255, 255, 255, 0.2); }
    .ftt-trailer-frame {
        position: relative;
        aspect-ratio: 16 / 9;
        background: #000;
        border-radius: var(--r-md);
        overflow: hidden;
    }
    .ftt-trailer-frame iframe {
        position: absolute; inset: 0;
        width: 100%; height: 100%;
        border: 0;
    }

    /* sharethis cta */
    .ftt-share {
        max-width: 720px;
        margin: var(--gap-xl) auto;
        padding: var(--gap-md) var(--shell-x);
        text-align: center;
    }
    .ftt-share-title { font-weight: 700; color: var(--c-text); margin-bottom: 4px; }
    .ftt-share-desc { font-size: 13px; color: var(--c-text-muted); margin-bottom: 12px; }
    .ftt-share-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }

    /* telegram popup */
    .ftt-tg-pop {
        position: fixed;
        bottom: 18px;
        inset-inline-end: 18px;
        z-index: 70;
        max-width: 320px;
        display: flex;
        gap: 12px;
        align-items: flex-start;
        background: var(--c-shell-2);
        border: 1px solid var(--c-accent);
        border-radius: var(--r-md);
        padding: 14px;
        box-shadow: var(--shadow-pop);
    }
    .ftt-tg-x {
        position: absolute;
        top: 6px; inset-inline-end: 6px;
        width: 22px; height: 22px;
        border-radius: var(--r-pill);
        color: var(--c-text-muted);
    }
    .ftt-tg-x:hover { color: var(--c-text); background: rgba(255, 255, 255, 0.06); }
    .ftt-tg-icon {
        background: linear-gradient(180deg, var(--c-accent-bright), var(--c-accent-dim));
        color: #04161a;
        width: 38px; height: 38px;
        border-radius: var(--r-pill);
        display: inline-flex; align-items: center; justify-content: center;
        flex-shrink: 0;
    }
    .ftt-tg-title { font-weight: 700; font-size: 14px; margin-bottom: 2px; }
    .ftt-tg-desc { font-size: 12px; color: var(--c-text-muted); margin-bottom: 8px; line-height: 1.5; }
    .ftt-tg-go {
        display: inline-flex; align-items: center; gap: 5px;
        background: var(--c-accent);
        color: #04161a;
        padding: 6px 12px;
        border-radius: var(--r-pill);
        font-size: 12px; font-weight: 600;
    }
    .ftt-tg-go:hover { background: var(--c-accent-bright); color: #04161a; }
    @media (width <= 480px) {
        .ftt-tg-pop { bottom: 12px; inset-inline-end: 12px; inset-inline-start: 12px; max-width: none; }
    }

    /* ad banner wrap */
    .ftt-ad--banner {
        max-width: var(--shell-max);
        margin: var(--gap-lg) auto;
        padding: 0 var(--shell-x);
        text-align: center;
    }
}

/* ============================================================
   06. PAGES — INDEX (Gate / Landing)
   ============================================================ */
@layer pages {
    /* Override body background to white for the index/gate page */
    .ftt-page-index {
        background: #ffffff;
        color: #333;
    }
    .ftt-page-index .ftt-main {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding-bottom: 0;
    }

    /* Hide breadcrumbs on index */
    .ftt-page-index .ftt-crumbs { display: none; }

    /* Gate section — centered message */
    .ftt-gate {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: clamp(60px, 12vw, 140px) var(--shell-x);
        text-align: center;
    }
    .ftt-gate-inner {
        max-width: 600px;
        margin: 0 auto;
        width: 100%;
    }

    .ftt-gate-h1 {
        font-size: clamp(20px, 3.2vw, 32px);
        font-weight: 700;
        color: #333;
        margin-bottom: 32px;
        line-height: 1.3;
    }

    /* Search bar */
    .ftt-gate-search {
        display: flex;
        align-items: center;
        gap: 8px;
        background: #fff;
        border: 2px solid #e0e0e0;
        border-radius: var(--r-pill);
        padding: 6px 18px;
        max-width: 480px;
        margin: 0 auto 24px;
        transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
    }
    .ftt-gate-search:focus-within {
        border-color: var(--c-accent);
        box-shadow: 0 0 0 4px rgba(43, 182, 196, 0.15);
    }
    .ftt-gate-search-icon { color: #aaa; flex-shrink: 0; }
    .ftt-gate-search input {
        flex: 1;
        background: transparent;
        border: 0;
        outline: 0;
        font-size: 15px;
        padding: 12px 4px;
        color: #333;
    }
    .ftt-gate-search input::placeholder { color: #aaa; }

    /* CTA button */
    .ftt-gate-cta {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 12px 32px;
        background: var(--c-accent);
        color: #fff;
        border-radius: var(--r-pill);
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 40px;
        transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
        box-shadow: 0 4px 14px -4px rgba(43, 182, 196, 0.5);
    }
    .ftt-gate-cta:hover {
        background: var(--c-accent-bright);
        color: #fff;
        transform: translateY(-2px);
        box-shadow: 0 6px 20px -4px rgba(43, 182, 196, 0.6);
    }

    .ftt-gate-badge {
        display: inline-block;
        padding: 8px 22px;
        background: var(--c-accent);
        color: #fff;
        border-radius: var(--r-sm);
        font-size: 15px;
        font-weight: 700;
        margin-bottom: 24px;
    }

    .ftt-gate-lead {
        font-size: 16px;
        color: #333;
        margin-bottom: 20px;
        line-height: 1.6;
    }

    .ftt-gate-highlight {
        font-size: 15px;
        color: var(--c-accent);
        margin-bottom: 20px;
        line-height: 1.6;
    }

    .ftt-gate-text {
        font-size: 15px;
        color: #333;
        margin-bottom: 8px;
        line-height: 1.6;
    }

    .ftt-gate-note {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        font-size: 13px;
        color: #666;
        margin-top: 28px;
        line-height: 1.5;
    }
    .ftt-gate-note svg {
        flex-shrink: 0;
        color: #999;
    }

    .ftt-gate-domain {
        margin-top: 24px;
        font-size: 13px;
        color: #666;
        line-height: 1.6;
    }
    .ftt-gate-domain p {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        margin-bottom: 4px;
    }
    .ftt-gate-domain p:last-child {
        margin-bottom: 0;
    }
    .ftt-gate-domain svg {
        flex-shrink: 0;
        color: #999;
    }
    .ftt-gate-domain a {
        color: var(--c-accent);
        text-decoration: underline;
    }
    .ftt-gate-domain a:hover {
        color: var(--c-accent-dim);
    }

    /* Override topbar for white page */
    .ftt-page-index .ftt-topbar {
        background: rgba(0, 0, 0, 0.55);
        border-bottom: none;
    }
    .ftt-page-index .ftt-topbar.ftt-topbar--floating {
        background: rgba(0, 0, 0, 0.55);
    }
    .ftt-page-index .ftt-brand-word { color: #fff; }
    .ftt-page-index .ftt-nav-link { color: rgba(255, 255, 255, 0.85); }
    .ftt-page-index .ftt-nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.1); }
    .ftt-page-index .ftt-quick-search { border-color: rgba(255, 255, 255, 0.2); background: rgba(255, 255, 255, 0.08); }
    .ftt-page-index .ftt-quick-search input { color: #fff; }
    .ftt-page-index .ftt-quick-search input::placeholder { color: rgba(255, 255, 255, 0.5); }

    /* Override footer for white page */
    .ftt-page-index .ftt-foot {
        background: #2c2c2c;
        border-top: none;
        margin-top: auto;
    }
    .ftt-page-index .ftt-foot-cell { color: rgba(255, 255, 255, 0.7); }
    .ftt-page-index .ftt-foot-brand { color: #fff; }
    .ftt-page-index .ftt-foot-headline { color: #fff; }
    .ftt-page-index .ftt-foot-nav a { color: rgba(255, 255, 255, 0.7); }
    .ftt-page-index .ftt-foot-nav a:hover { color: var(--c-accent-bright); }
    .ftt-page-index .ftt-foot-copy { color: rgba(255, 255, 255, 0.5); }
    .ftt-page-index .ftt-foot-disclaimer { color: rgba(255, 255, 255, 0.5); }

    /* Section head (reused on other pages too) */
    .ftt-section-head {
        max-width: var(--shell-max);
        margin: 0 auto var(--gap-lg);
        padding: 0 var(--shell-x);
        text-align: center;
    }
    .ftt-section-h2 {
        font-size: clamp(22px, 3.4vw, 30px);
        color: var(--c-text);
        margin-bottom: 8px;
    }
    .ftt-section-sub { color: var(--c-text-muted); font-size: 14px; max-width: 540px; margin: 0 auto; }
}

/* ============================================================
   07. PAGES — HOME
   ============================================================ */
@layer pages {
    /* White background for home page */
    .ftt-page-home {
        background: #f0f6f8;
        color: #333;
    }
    .ftt-page-home .ftt-topbar {
        background: rgba(0, 0, 0, 0.55);
        border-bottom: none;
    }
    .ftt-page-home .ftt-topbar.ftt-topbar--floating {
        background: rgba(0, 0, 0, 0.55);
    }
    /* Hero bleeds under the fixed header on home */
    .ftt-page-home.ftt-app { padding-top: 0; }
    .ftt-hero { margin-top: -44px; padding-top: 44px; }
    .ftt-page-home .ftt-foot {
        background: #2c2c2c;
        border-top: none;
    }
    .ftt-page-home .ftt-crumbs { display: none; }

    /* Hero slider */
    .ftt-hero {
        position: relative;
        width: 100%;
        aspect-ratio: 2.5 / 1;
        min-height: 450px;
        max-height: 580px;
        overflow: hidden;
    }
    @media (width <= 700px) {
        .ftt-hero { aspect-ratio: 16 / 9; min-height: 300px; max-height: none; }
    }
    .ftt-hero-frames { position: relative; width: 100%; height: 100%; }
    .ftt-hero-slide {
        position: absolute;
        inset: 0;
        opacity: 0;
        transition: opacity 700ms var(--ease);
        pointer-events: none;
    }
    .ftt-hero-slide.ftt-current { opacity: 1; pointer-events: auto; }
    .ftt-hero-bg {
        width: 100%; height: 100%;
        object-fit: cover;
    }
    .ftt-hero-overlay {
        position: absolute; inset: 0;
        background: linear-gradient(180deg, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%),
                    linear-gradient(90deg, rgba(0,0,0,0.6) 0%, transparent 60%);
    }
    .ftt-hero-content {
        position: absolute;
        bottom: 12%;
        inset-inline-start: 0;
        padding: 0 clamp(20px, 4vw, 60px);
        max-width: 600px;
        color: #fff;
    }
    .ftt-hero-title {
        font-size: clamp(20px, 3.5vw, 34px);
        font-weight: 700;
        margin-bottom: 8px;
        text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    }
    .ftt-hero-desc {
        font-size: clamp(12px, 1.3vw, 14px);
        color: rgba(255,255,255,0.9);
        line-height: 1.5;
        margin-bottom: 10px;
    }
    .ftt-hero-meta {
        display: flex; gap: 12px; align-items: center;
        font-size: 12px; color: rgba(255,255,255,0.85);
        margin-bottom: 14px;
    }
    .ftt-hero-meta-item { display: inline-flex; align-items: center; gap: 4px; }
    .ftt-hero-btn {
        display: inline-flex; align-items: center; gap: 8px;
        padding: 10px 22px;
        background: var(--c-accent);
        color: #fff;
        border-radius: var(--r-sm);
        font-size: 14px;
        font-weight: 700;
        transition: background var(--t-fast) var(--ease);
    }
    .ftt-hero-btn:hover { background: var(--c-accent-bright); color: #fff; }
    .ftt-hero-fav {
        position: absolute;
        top: 50%;
        inset-inline-end: clamp(20px, 4vw, 60px);
        transform: translateY(-50%);
        color: rgba(255,255,255,0.7);
        transition: color var(--t-fast) var(--ease);
    }
    .ftt-hero-fav:hover { color: #fff; }

    .ftt-hero-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        width: 40px; height: 40px;
        border-radius: var(--r-pill);
        background: rgba(0,0,0,0.4);
        color: #fff;
        display: inline-flex; align-items: center; justify-content: center;
        transition: background var(--t-fast) var(--ease);
    }
    .ftt-hero-arrow:hover { background: rgba(0,0,0,0.7); }
    .ftt-hero-arrow--prev { inset-inline-start: 12px; }
    .ftt-hero-arrow--next { inset-inline-end: 12px; }
    .ftt-hero-dots {
        position: absolute;
        bottom: 14px;
        left: 50%;
        transform: translateX(-50%);
        display: flex; gap: 6px; z-index: 5;
    }
    .ftt-hero-dot {
        width: 10px; height: 10px;
        border-radius: var(--r-pill);
        background: rgba(255,255,255,0.4);
        transition: background var(--t-fast) var(--ease);
    }
    .ftt-hero-dot.ftt-current { background: #fff; }
    .ftt-hero-dot:hover { background: rgba(255,255,255,0.8); }

    /* Home body — white area below hero */
    .ftt-home-body {
        max-width: var(--shell-max);
        margin: 0 auto;
        padding: var(--gap-xl) var(--shell-x) var(--gap-xxl);
    }

    .ftt-home-headline {
        text-align: center;
        font-size: clamp(16px, 2.4vw, 22px);
        font-weight: 600;
        color: var(--c-accent);
        margin-bottom: var(--gap-xl);
    }

    /* Section head with badge */
    .ftt-home-section {
        margin-bottom: var(--gap-xxl);
    }
    .ftt-home-section-head {
        text-align: center;
        margin-bottom: 14px;
    }
    .ftt-home-badge {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 18px;
        background: var(--c-accent);
        color: #fff;
        border-radius: var(--r-pill);
        font-size: 14px;
        font-weight: 700;
    }

    /* Filter tabs */
    .ftt-home-tabs {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
        gap: 8px;
        margin-bottom: 22px;
    }
    .ftt-home-tab {
        padding: 6px 14px;
        border: 1px solid var(--c-accent);
        border-radius: var(--r-sm);
        font-size: 13px;
        font-weight: 500;
        color: var(--c-accent);
        cursor: pointer;
        transition: all var(--t-fast) var(--ease);
    }
    .ftt-home-tab:hover {
        background: rgba(43, 182, 196, 0.1);
    }
    .ftt-home-tab--active {
        background: var(--c-accent);
        color: #fff;
    }
    .ftt-home-tab--active:hover {
        background: var(--c-accent-bright);
    }

    /* Poster grid — small cards */
    .ftt-home-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 20px 14px;
        align-items: start;
    }
    @media (width >= 600px) { .ftt-home-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
    @media (width >= 900px) { .ftt-home-grid { grid-template-columns: repeat(7, 1fr); } }

    .ftt-home-poster {
        display: block;
        background: transparent;
        border-radius: 0;
        overflow: visible;
        transition: transform var(--t-fast) var(--ease);
        min-width: 0;
    }
    .ftt-home-poster:hover { transform: translateY(-3px); }

    .ftt-home-poster-art {
        position: relative;
        display: block;
        aspect-ratio: 2 / 3;
        overflow: hidden;
        background: #e0e8ec;
        border-radius: var(--r-sm);
        border: 3px solid #d0dce2;
        width: 100%;
    }
    .ftt-home-poster-art img {
        width: 100%; height: 100%;
        object-fit: cover;
        display: block;
        transition: transform var(--t-base) var(--ease);
    }
    .ftt-home-poster:hover .ftt-home-poster-art img { transform: scale(1.03); }

    .ftt-home-poster-year {
        position: absolute;
        top: 6px; inset-inline-start: 6px;
        background: var(--c-accent);
        color: #fff;
        padding: 3px 8px;
        border-radius: 4px;
        font-size: 11px;
        font-weight: 700;
    }
    .ftt-home-poster-badge {
        position: absolute;
        top: 6px; inset-inline-start: 52px;
        background: var(--c-warm);
        color: #2a2200;
        padding: 3px 5px;
        border-radius: 4px;
        font-size: 9px;
        font-weight: 800;
    }
    .ftt-home-poster-type {
        position: absolute;
        top: 6px; inset-inline-end: 6px;
        background: var(--c-accent);
        color: #fff;
        width: 22px; height: 20px;
        display: inline-flex; align-items: center; justify-content: center;
        border-radius: 4px;
    }

    .ftt-home-poster-name {
        display: block;
        padding: 6px 2px 0;
        font-size: 12px;
        font-weight: 400;
        color: #333;
        text-align: left;
        line-height: 1.3;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100%;
    }
    .ftt-home-poster:hover .ftt-home-poster-name { color: var(--c-accent); }
}

/* ============================================================
   07b. HOME — Legacy stage (kept for backward compat)
   ============================================================ */
@layer pages {
    .ftt-stage { display: none; }
    .ftt-home-greeting { display: none; }
    .ftt-home-rail { display: none; }
    .ftt-top10-rail { display: none; }
}

/* ============================================================
   08. PAGES — DETAIL
   ============================================================ */
@layer pages {
    .ftt-page-detail .ftt-main { padding-bottom: 0; }
    .ftt-page-detail.ftt-app { padding-top: 0; }
    .ftt-page-detail .ftt-crumbs { display: none; }

    /* Backdrop area with player */
    .ftt-dt-backdrop {
        position: relative;
        min-height: 50vh;
        padding-top: 44px;
    }
    .ftt-dt-backdrop-img {
        position: absolute; inset: 0; z-index: 0; overflow: hidden;
    }
    .ftt-dt-backdrop-img img {
        width: 100%; height: 100%; object-fit: cover;
    }
    .ftt-dt-backdrop-overlay {
        position: absolute; inset: 0; z-index: 1;
        background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.7) 100%);
    }

    .ftt-dt-player {
        position: relative; z-index: 2;
        max-width: 900px;
        margin: 0 auto;
        padding: var(--gap-xl) var(--shell-x) var(--gap-lg);
    }
    .ftt-dt-player .player-container {
        position: relative;
        aspect-ratio: 16 / 9;
        background: #000;
        border-radius: var(--r-md);
        overflow: hidden;
        box-shadow: 0 12px 40px rgba(0,0,0,0.5);
    }
    .ftt-dt-player .player-iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
    .ftt-dt-player .player-backdrop { position: absolute; inset: 0; cursor: pointer; }
    .ftt-dt-player .player-backdrop img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.5); }
    .ftt-dt-player .player-play-btn {
        position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
        width: 80px; height: 80px; border-radius: var(--r-pill);
        background: var(--c-accent); color: #fff;
        display: inline-flex; align-items: center; justify-content: center;
        box-shadow: 0 8px 30px rgba(43, 182, 196, 0.5);
        transition: transform var(--t-base) var(--ease);
    }
    .ftt-dt-player .player-play-btn:hover { transform: translate(-50%, -50%) scale(1.1); }

    .ftt-dt-loading {
        position: relative; z-index: 2;
        text-align: center; padding: 8px;
        color: rgba(255,255,255,0.7); font-size: 13px;
        display: flex; align-items: center; justify-content: center; gap: 6px;
    }
    .ftt-dt-spin { animation: ftt-spin 1s linear infinite; }
    @keyframes ftt-spin { to { transform: rotate(360deg); } }

    .ftt-dt-servers {
        position: relative; z-index: 2;
        max-width: 900px; margin: 0 auto;
        padding: 10px var(--shell-x) 0;
    }
    .ftt-dt-server-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }

    /* Episode nav */
    .ftt-epnav {
        position: relative; z-index: 2;
        max-width: 900px; margin: 0 auto;
        display: flex; align-items: center; gap: var(--gap-md);
        padding: 10px var(--shell-x) 0; flex-wrap: wrap;
    }
    .ftt-epnav-btn {
        padding: 8px 16px;
        background: rgba(255,255,255,0.08);
        border-radius: var(--r-md);
        font-size: 13px; font-weight: 500; color: #fff;
        transition: all var(--t-fast) var(--ease);
    }
    .ftt-epnav-btn:hover:not(:disabled) { background: var(--c-accent); color: #04161a; }
    .ftt-epnav-btn:disabled { opacity: 0.4; cursor: not-allowed; }
    .ftt-epnav-current { flex: 1; text-align: center; font-size: 13px; color: rgba(255,255,255,0.7); }

    /* Episodes inside player area */
    .ftt-dt-episodes {
        position: relative; z-index: 2;
        max-width: 900px; margin: 0 auto;
        padding: var(--gap-lg) var(--shell-x) 0;
    }
    .ftt-dt-eps-head {
        display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
        margin-bottom: 12px;
    }
    .ftt-dt-eps-title {
        font-size: 18px; font-weight: 700; color: #fff; margin-right: auto;
    }
    .ftt-dt-eps-season {
        padding: 10px 18px;
        background: rgba(0,0,0,0.6);
        border: 2px solid var(--c-accent);
        border-radius: var(--r-pill);
        color: #fff;
        font-size: 14px;
        font-weight: 500;
        appearance: none;
        -webkit-appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 14px center;
        padding-right: 38px;
        cursor: pointer;
        min-width: 160px;
    }
    .ftt-dt-eps-season:focus {
        outline: none;
        box-shadow: 0 0 0 3px rgba(43, 182, 196, 0.4);
    }
    .ftt-dt-eps-season option {
        background: #1a1a2e;
        color: #fff;
        padding: 8px;
    }
    .ftt-dt-eps-search {
        display: inline-flex; align-items: center; gap: 6px;
        background: rgba(255,255,255,0.08);
        border: 1px solid rgba(255,255,255,0.15);
        border-radius: var(--r-md);
        padding: 0 10px; color: rgba(255,255,255,0.7);
    }
    .ftt-dt-eps-search input {
        background: transparent; border: 0; outline: 0;
        padding: 7px 0; font-size: 13px; color: #fff; width: 140px;
    }
    .ftt-dt-eps-search input::placeholder { color: rgba(255,255,255,0.4); }

    .ftt-dt-eps-list {
        display: grid;
        grid-template-columns: 1fr;
        gap: 4px;
        max-height: 360px;
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(255,255,255,0.2) transparent;
    }
    @media (width >= 600px) { .ftt-dt-eps-list { grid-template-columns: 1fr 1fr; } }

    .ftt-dt-ep {
        display: flex; align-items: center; gap: 10px;
        padding: 10px 14px;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: var(--r-sm);
        width: 100%; text-align: left;
        transition: all var(--t-fast) var(--ease);
        color: #fff;
    }
    .ftt-dt-ep:hover:not(.ftt-dt-ep--soon) {
        background: rgba(43, 182, 196, 0.15);
        border-color: var(--c-accent);
    }
    .ftt-dt-ep.episode-active {
        background: rgba(43, 182, 196, 0.2);
        border-color: var(--c-accent);
    }
    .ftt-dt-ep--soon { opacity: 0.5; cursor: default; }

    .ftt-dt-ep-num {
        flex-shrink: 0; width: 28px; text-align: center;
        font-weight: 700; font-size: 13px; color: var(--c-accent-bright);
    }
    .ftt-dt-ep-name {
        flex: 1; font-size: 13px; font-weight: 500;
        overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    .ftt-dt-ep-date {
        font-size: 11px; color: rgba(255,255,255,0.5); flex-shrink: 0;
    }
    .ftt-dt-ep-play {
        flex-shrink: 0; color: var(--c-accent-bright); opacity: 0.6;
    }
    .ftt-dt-ep:hover:not(.ftt-dt-ep--soon) .ftt-dt-ep-play { opacity: 1; }

    .ftt-dt-eps-empty { color: rgba(255,255,255,0.5); padding: 16px; text-align: center; font-size: 13px; }

    /* Info section below backdrop */
    .ftt-dt-info {
        background: linear-gradient(180deg, rgba(19, 25, 43, 0.95) 0%, var(--c-deep) 100%);
        padding: var(--gap-xl) var(--shell-x);
        color: var(--c-text);
    }
    .ftt-dt-info-inner {
        max-width: var(--shell-max);
        margin: 0 auto;
        display: flex;
        gap: var(--gap-lg);
        align-items: flex-start;
        position: relative;
    }
    @media (width <= 600px) {
        .ftt-dt-info-inner { flex-direction: column; align-items: center; text-align: center; }
    }

    .ftt-dt-poster { flex-shrink: 0; }
    .ftt-dt-poster img {
        width: 120px; height: auto;
        border-radius: var(--r-sm);
        box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    }
    @media (width >= 720px) { .ftt-dt-poster img { width: 150px; } }

    .ftt-dt-meta { flex: 1; min-width: 0; }
    .ftt-dt-title {
        font-size: clamp(18px, 2.8vw, 26px);
        font-weight: 700;
        margin-bottom: 4px;
        color: #fff;
    }
    .ftt-dt-year { font-weight: 400; color: var(--c-text-muted); font-size: 0.85em; }
    .ftt-dt-rating {
        font-size: 13px; color: var(--c-text-muted); margin-bottom: 10px;
        display: flex; align-items: center; gap: 4px;
    }
    .ftt-dt-desc {
        font-size: 14px; line-height: 1.7; color: var(--c-text-muted); margin-bottom: 14px;
    }

    /* Colored tag pills */
    .ftt-dt-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
    .ftt-dt-tag {
        display: inline-flex; align-items: center; gap: 4px;
        padding: 4px 10px;
        border-radius: var(--r-pill);
        font-size: 11px; font-weight: 600;
        transition: opacity var(--t-fast) var(--ease);
    }
    .ftt-dt-tag:hover { opacity: 0.8; }
    .ftt-dt-tag--rating { background: var(--c-accent); color: #fff; }
    .ftt-dt-tag--runtime { background: #6c5ce7; color: #fff; }
    .ftt-dt-tag--country { background: #00b894; color: #fff; }
    .ftt-dt-tag--lang { background: #fdcb6e; color: #2d3436; }
    .ftt-dt-tag--trailer { background: #d63031; color: #fff; cursor: pointer; border: none; }

    .ftt-dt-more {
        font-size: 12px; color: var(--c-accent-bright); font-weight: 500;
        display: inline-flex; align-items: center; gap: 4px;
        margin-bottom: 10px;
    }
    .ftt-dt-more:hover { color: var(--c-accent); }

    .ftt-dt-extra { margin-top: 10px; font-size: 13px; color: var(--c-text-muted); line-height: 1.7; }
    .ftt-dt-extra-row { margin-bottom: 6px; }
    .ftt-dt-extra-row a { color: var(--c-accent-bright); }
    .ftt-dt-extra-row a:hover { text-decoration: underline; }

    .ftt-dt-fav {
        position: absolute; top: 0; inset-inline-end: 0;
        color: var(--c-text-muted);
        transition: color var(--t-fast) var(--ease);
    }
    .ftt-dt-fav:hover { color: #e74c3c; }
    @media (width <= 600px) { .ftt-dt-fav { position: static; margin-top: 10px; } }

    .ftt-dt-report {
        max-width: var(--shell-max); margin: var(--gap-md) auto 0;
        padding-top: var(--gap-md);
        border-top: 1px solid rgba(255,255,255,0.08);
    }

    /* Related section */
    .ftt-dt-related {
        background: #f0f6f8;
        padding: var(--gap-xl) var(--shell-x) var(--gap-xxl);
    }
    .ftt-dt-related-h2 {
        text-align: center;
        font-size: clamp(16px, 2.2vw, 20px);
        color: #333;
        margin-bottom: var(--gap-lg);
    }
    .ftt-dt-related .ftt-home-grid {
        max-width: var(--shell-max);
        margin: 0 auto;
    }

    /* Server tabs (shared) */
    .server-tab {
        display: inline-flex; align-items: center; gap: 6px;
        padding: 7px 13px;
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid rgba(255,255,255,0.15);
        color: rgba(255,255,255,0.7);
        border-radius: var(--r-md);
        font-size: 13px; font-weight: 500;
        transition: all var(--t-fast) var(--ease);
    }
    .server-tab:hover { background: rgba(255,255,255,0.12); color: #fff; }
    .server-tab.active, .server-tab.ftt-current {
        background: var(--c-accent); border-color: var(--c-accent); color: #04161a;
    }
    .ftt-server-tab-dot {
        width: 6px; height: 6px; border-radius: var(--r-pill);
        background: currentColor; opacity: 0.6;
    }
    .server-tab.active .ftt-server-tab-dot { opacity: 1; }

    /* Report */
    .ftt-report-toggle {
        display: inline-flex; align-items: center; gap: 5px;
        font-size: 12px; color: var(--c-text-fade);
        padding: 4px 10px; border-radius: var(--r-pill);
    }
    .ftt-report-toggle:hover { color: var(--c-bad); }
    .ftt-report-form {
        display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px;
    }
    .ftt-report-form select, .ftt-report-form textarea {
        flex: 1; min-width: 200px; padding: 8px 12px;
        background: var(--c-shell); border: 1px solid var(--c-line);
        border-radius: var(--r-md); color: var(--c-text); font-size: 13px;
    }
    .ftt-report-form select:focus, .ftt-report-form textarea:focus {
        border-color: var(--c-accent); outline: none;
    }

    /* Utility */
    .d-none { display: none !important; }
}

/* ============================================================
   08b. LIGHT PAGE VARIANT (movies, tv, category pages)
   ============================================================ */
@layer pages {
    .ftt-page-light {
        background: #f0f6f8;
        color: #333;
    }
    .ftt-page-light .ftt-topbar {
        background: rgba(0, 0, 0, 0.55);
        border-bottom: none;
    }
    .ftt-page-light .ftt-foot {
        background: #2c2c2c;
        border-top: none;
        margin-top: 0;
    }
    .ftt-page-light .ftt-crumbs { display: none; }

    .ftt-light-body {
        max-width: var(--shell-max);
        margin: 0 auto;
        padding: var(--gap-xl) var(--shell-x) var(--gap-xxl);
    }
    .ftt-light-headline {
        text-align: center;
        font-size: clamp(16px, 2.4vw, 22px);
        font-weight: 600;
        color: var(--c-accent);
        margin-bottom: var(--gap-xl);
    }

    /* Pagination on light pages */
    .ftt-light-body .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: var(--gap-lg) 0;
        list-style: none;
    }
    .ftt-light-body .pagination a,
    .ftt-light-body .pagination span {
        padding: 7px 13px;
        background: #fff;
        border: 1px solid #ddd;
        border-radius: var(--r-md);
        font-size: 13px;
        color: #555;
        transition: all var(--t-fast) var(--ease);
    }
    .ftt-light-body .pagination a:hover {
        background: var(--c-accent);
        color: #fff;
        border-color: var(--c-accent);
    }
    .ftt-light-body .pagination .active,
    .ftt-light-body .pagination .current,
    .ftt-light-body .pagination [aria-current="page"] {
        background: var(--c-accent);
        color: #fff;
        border-color: var(--c-accent);
        font-weight: 600;
    }

    .ftt-page-light .ftt-empty {
        text-align: center;
        padding: 60px var(--shell-x);
        color: #666;
    }
    .ftt-page-light .ftt-empty p { margin-bottom: 14px; }
}

/* ============================================================
   09. PAGES — LIST / FILTER
   ============================================================ */
@layer pages {
    .ftt-page-list .ftt-main, .ftt-page-category .ftt-main, .ftt-page-country .ftt-main, .ftt-page-person .ftt-main {
        padding-bottom: var(--gap-xxl);
    }

    .ftt-list {
        max-width: var(--shell-max);
        margin: 0 auto;
        padding: var(--gap-lg) var(--shell-x);
    }
    .ftt-list-head { margin: var(--gap-lg) 0 var(--gap-md); }
    .ftt-list-eyebrow {
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        color: var(--c-accent-bright);
        font-weight: 600;
        display: inline-block;
        margin-bottom: 4px;
    }
    .ftt-list-h1 {
        font-size: clamp(22px, 3vw, 30px);
        color: var(--c-text);
    }
    .ftt-list-count, .ftt-list-sub {
        margin-top: 6px;
        font-size: 14px;
        color: var(--c-text-muted);
    }

    /* tabs / filter dropdowns */
    .ftt-filter {
        margin-bottom: var(--gap-lg);
    }
    .ftt-filter-row {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
        gap: 12px;
    }

    .ftt-filter-drop {
        position: relative;
        display: inline-block;
    }
    .ftt-filter-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 16px;
        font-size: 14px;
        font-weight: 400;
        color: #555;
        cursor: pointer;
        border: none;
        background: none;
        transition: color var(--t-fast) var(--ease);
        list-style: none;
    }
    .ftt-filter-btn::-webkit-details-marker { display: none; }
    .ftt-filter-btn:hover { color: var(--c-accent); }
    .ftt-filter-btn svg { color: #888; }

    .ftt-filter-btn--clear {
        color: #333;
        font-weight: 500;
        text-decoration: none;
    }
    .ftt-filter-btn--clear:hover { color: var(--c-accent); }

    .ftt-filter-drop[open] .ftt-filter-btn {
        color: var(--c-accent);
    }

    .ftt-filter-menu {
        position: absolute;
        top: calc(100% + 6px);
        inset-inline-start: 50%;
        transform: translateX(-50%);
        background: #fff;
        border: 1px solid #e0e0e0;
        border-radius: var(--r-md);
        padding: 6px;
        min-width: 150px;
        max-height: 280px;
        overflow-y: auto;
        z-index: 40;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .ftt-filter-menu--tall {
        max-height: 340px;
        min-width: 180px;
    }

    .ftt-filter-opt {
        padding: 7px 12px;
        font-size: 13px;
        color: #555;
        border-radius: var(--r-sm);
        transition: all var(--t-fast) var(--ease);
        white-space: nowrap;
    }
    .ftt-filter-opt:hover {
        background: #f0f6f8;
        color: var(--c-accent);
    }
    .ftt-filter-opt.ftt-current {
        background: var(--c-accent);
        color: #fff;
    }

    .ftt-tabs { margin-bottom: var(--gap-md); }
    .ftt-tabs-row {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 8px;
        align-items: center;
    }
    .ftt-tabs-row--years { padding-top: 4px; border-top: 1px dashed var(--c-line); }
    .ftt-tabs-divider { width: 1px; height: 24px; background: var(--c-line); margin-inline: 4px; }

    .ftt-chip {
        padding: 6px 12px;
        background: var(--c-shell-2);
        border: 1px solid var(--c-line);
        color: var(--c-text-muted);
        border-radius: var(--r-pill);
        font-size: 12.5px;
        font-weight: 500;
        transition: all var(--t-fast) var(--ease);
        cursor: pointer;
        display: inline-flex; align-items: center; gap: 4px;
    }
    .ftt-chip:hover { background: var(--c-shell-3); color: var(--c-text); }
    .ftt-chip.ftt-current {
        background: var(--c-accent);
        color: #04161a;
        border-color: var(--c-accent);
    }
    .ftt-chip--year { font-variant-numeric: tabular-nums; }
    .ftt-chip--more { list-style: none; }
    .ftt-chip--more::-webkit-details-marker { display: none; }

    .ftt-pop { position: relative; display: inline-block; }
    .ftt-pop[open] .ftt-chip--more { background: var(--c-accent-soft); color: var(--c-accent-bright); border-color: var(--c-accent); }
    .ftt-pop-menu {
        position: absolute;
        top: calc(100% + 6px);
        inset-inline-start: 0;
        background: var(--c-shell-3);
        border: 1px solid var(--c-line);
        border-radius: var(--r-md);
        padding: 6px;
        min-width: 160px;
        max-height: 300px;
        overflow-y: auto;
        z-index: 30;
        box-shadow: var(--shadow-pop);
        display: flex;
        flex-direction: column;
        gap: 2px;
    }
    .ftt-pop-item {
        padding: 6px 10px;
        font-size: 13px;
        color: var(--c-text-muted);
        border-radius: var(--r-sm);
    }
    .ftt-pop-item:hover { background: var(--c-shell-2); color: var(--c-text); }
    .ftt-pop-item.ftt-current { background: var(--c-accent); color: #04161a; }

    /* grid */
    .ftt-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px 14px;
        align-items: start;
    }
    @media (width >= 480px) { .ftt-grid { grid-template-columns: repeat(3, 1fr); } }
    @media (width >= 720px) { .ftt-grid { grid-template-columns: repeat(4, 1fr); } }
    @media (width >= 1024px) { .ftt-grid { grid-template-columns: repeat(6, 1fr); } }
    @media (width >= 1280px) { .ftt-grid { grid-template-columns: repeat(7, 1fr); } }

    /* override card flex-basis when in grid */
    .ftt-grid .ftt-card { flex: 1 1 auto; }

    .ftt-empty {
        text-align: center;
        padding: 60px var(--shell-x);
        color: var(--c-text-muted);
    }
    .ftt-empty p { margin-bottom: 14px; }

    .ftt-person-head { text-align: center; padding: var(--gap-lg) 0; }

    /* pagination — engine outputs raw HTML, style the wrapper */
    .pagination, .ftt-list .pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        padding: var(--gap-lg) 0;
        list-style: none;
    }
    .pagination a, .pagination span, .pagination .page, .pagination .pagination-link {
        padding: 7px 13px;
        background: var(--c-shell-2);
        border: 1px solid var(--c-line);
        border-radius: var(--r-md);
        font-size: 13px;
        color: var(--c-text-muted);
        transition: all var(--t-fast) var(--ease);
    }
    .pagination a:hover {
        background: var(--c-accent);
        color: #04161a;
        border-color: var(--c-accent);
    }
    .pagination .active, .pagination .current, .pagination [aria-current="page"] {
        background: var(--c-accent);
        color: #04161a;
        border-color: var(--c-accent);
        font-weight: 600;
    }
    .pagination .disabled, .pagination [aria-disabled="true"] { opacity: 0.4; cursor: not-allowed; }
}

/* ============================================================
   10. PAGES — SEARCH / REQUEST / 404
   ============================================================ */
@layer pages {
    .ftt-search {
        max-width: var(--shell-max);
        margin: 0 auto;
        padding: var(--gap-xl) var(--shell-x);
    }
    .ftt-search-empty {
        max-width: 600px;
        margin: 60px auto;
        text-align: center;
    }
    .ftt-search-emblem {
        display: inline-flex;
        margin-bottom: 14px;
        color: var(--c-accent-bright);
        opacity: 0.6;
    }
    .ftt-search-h1 { font-size: clamp(24px, 3.4vw, 32px); margin-bottom: 8px; }
    .ftt-search-sub { color: var(--c-text-muted); margin-bottom: 24px; }

    .ftt-search-form {
        display: flex;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: center;
        align-items: center;
    }
    .ftt-search-form--inline { margin-bottom: var(--gap-md); }
    .ftt-search-input-wrap {
        flex: 1;
        min-width: 240px;
        position: relative;
        display: flex;
        align-items: center;
    }
    .ftt-search-input-icon {
        position: absolute;
        inset-inline-start: 16px;
        color: var(--c-text-fade);
        pointer-events: none;
    }
    .ftt-search-input-wrap input {
        width: 100%;
        padding: 12px 16px 12px 44px;
        background: var(--c-shell-2);
        border: 1px solid var(--c-line);
        border-radius: var(--r-pill);
        font-size: 15px;
        color: var(--c-text);
    }
    .ftt-search-input-wrap input:focus {
        outline: 0;
        border-color: var(--c-accent);
        box-shadow: 0 0 0 4px var(--c-accent-soft);
    }
    .ftt-search-type { display: flex; gap: 4px; background: var(--c-shell-2); border: 1px solid var(--c-line); padding: 3px; border-radius: var(--r-pill); }
    .ftt-search-type-opt {
        padding: 7px 14px;
        font-size: 13px;
        font-weight: 500;
        border-radius: var(--r-pill);
        color: var(--c-text-muted);
        cursor: pointer;
        transition: all var(--t-fast) var(--ease);
    }
    .ftt-search-type-opt input { display: none; }
    .ftt-search-type-opt:hover { color: var(--c-text); }
    .ftt-search-type-opt.ftt-current { background: var(--c-accent); color: #04161a; }

    .ftt-search-hint { margin-top: 18px; font-size: 13px; color: var(--c-text-fade); }
    .ftt-search-head { margin-bottom: var(--gap-lg); }
    .ftt-search-count { color: var(--c-text-muted); font-size: 14px; }
    .ftt-search-count strong { color: var(--c-accent-bright); }

    .ftt-search-no {
        text-align: center;
        padding: 60px 20px;
        color: var(--c-text-muted);
    }
    .ftt-search-no p { margin-bottom: 8px; }
    .ftt-search-no strong { color: var(--c-text); }
    .ftt-search-no-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

    /* request */
    .ftt-request {
        max-width: 1080px;
        margin: 0 auto;
        padding: var(--gap-xl) var(--shell-x);
    }
    .ftt-request-grid {
        display: grid;
        gap: var(--gap-xl);
        grid-template-columns: 1fr;
    }
    @media (width >= 880px) { .ftt-request-grid { grid-template-columns: 360px 1fr; } }

    .ftt-request-side {
        background: linear-gradient(180deg, var(--c-shell-2), var(--c-shell-3));
        border: 1px solid var(--c-line);
        border-radius: var(--r-lg);
        padding: var(--gap-lg);
    }
    .ftt-request-emblem {
        display: inline-flex;
        width: 56px; height: 56px;
        background: var(--c-accent-soft);
        color: var(--c-accent-bright);
        border-radius: var(--r-pill);
        align-items: center;
        justify-content: center;
        margin-bottom: 14px;
    }
    .ftt-request-h1 { font-size: 22px; margin-bottom: 8px; }
    .ftt-request-sub { color: var(--c-text-muted); font-size: 14px; line-height: 1.7; margin-bottom: var(--gap-md); }

    .ftt-request-steps { display: flex; flex-direction: column; gap: 10px; }
    .ftt-request-steps li {
        display: flex; gap: 10px;
        font-size: 13px;
        color: var(--c-text-muted);
        line-height: 1.5;
    }
    .ftt-request-steps span {
        color: var(--c-accent-bright);
        font-weight: 700;
        flex-shrink: 0;
    }

    .ftt-request-card {
        background: var(--c-shell-2);
        border: 1px solid var(--c-line);
        border-radius: var(--r-lg);
        padding: var(--gap-lg);
    }
    .ftt-request-form { display: flex; flex-direction: column; gap: var(--gap-md); }
    .ftt-request-row--two { display: grid; grid-template-columns: 1fr; gap: var(--gap-md); }
    @media (width >= 600px) { .ftt-request-row--two { grid-template-columns: 1fr 1fr; } }

    .ftt-field { display: flex; flex-direction: column; gap: 6px; }
    .ftt-field-label { font-size: 13px; font-weight: 600; color: var(--c-text); }
    .ftt-field-label em { color: var(--c-bad); font-style: normal; }
    .ftt-field-opt { color: var(--c-text-fade); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 500; }
    .ftt-field-input {
        width: 100%;
        padding: 11px 14px;
        background: var(--c-shell);
        border: 1px solid var(--c-line);
        border-radius: var(--r-md);
        color: var(--c-text);
        font-size: 14px;
        font-family: inherit;
        resize: vertical;
    }
    .ftt-field-input:focus {
        outline: 0;
        border-color: var(--c-accent);
        box-shadow: 0 0 0 3px var(--c-accent-soft);
    }
    .ftt-field-help { font-size: 12px; color: var(--c-text-fade); }
    .ftt-field-help a { color: var(--c-accent-bright); }

    .ftt-alert {
        display: flex; align-items: flex-start; gap: 10px;
        padding: 12px 14px;
        border-radius: var(--r-md);
        font-size: 14px;
        margin-bottom: var(--gap-md);
    }
    .ftt-alert--ok { background: rgba(94, 209, 164, 0.12); border: 1px solid rgba(94, 209, 164, 0.4); color: var(--c-good); }
    .ftt-alert--err { background: rgba(239, 91, 91, 0.12); border: 1px solid rgba(239, 91, 91, 0.4); color: var(--c-bad); }

    /* 404 */
    .ftt-404 {
        max-width: 640px;
        margin: 0 auto;
        padding: clamp(40px, 8vw, 80px) var(--shell-x);
        text-align: center;
    }
    .ftt-404-pulse {
        font-size: clamp(80px, 15vw, 140px);
        font-weight: 800;
        line-height: 1;
        background: linear-gradient(180deg, var(--c-accent-bright) 0%, var(--c-accent-dim) 100%);
        -webkit-background-clip: text;
        background-clip: text;
        color: transparent;
        margin-bottom: 8px;
        letter-spacing: -0.04em;
    }
    .ftt-404-h1 { font-size: clamp(20px, 2.6vw, 28px); margin-bottom: 8px; }
    .ftt-404-sub { color: var(--c-text-muted); margin-bottom: 24px; line-height: 1.7; }
    .ftt-404-search { display: flex; gap: 6px; max-width: 440px; margin: 0 auto var(--gap-lg); }
    .ftt-404-search input {
        flex: 1;
        padding: 11px 16px;
        background: var(--c-shell-2);
        border: 1px solid var(--c-line);
        border-radius: var(--r-md);
        color: var(--c-text);
        font-size: 14px;
    }
    .ftt-404-paths { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
}

/* ============================================================
   11. UTILITIES
   ============================================================ */
@layer utilities {
    .d-none { display: none !important; }
    .ftt-sr, .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;
    }
    .content-lazy { content-visibility: auto; contain-intrinsic-size: 0 600px; }

    /* reduced motion */
    @media (prefers-reduced-motion: reduce) {
        *, *::before, *::after {
            animation-duration: 0.01ms !important;
            animation-iteration-count: 1 !important;
            transition-duration: 0.01ms !important;
            scroll-behavior: auto !important;
        }
    }
}

/* ---------- Notification bar offset ----------
   The header is fixed at top:0, so it painted over the notification bar. The theme JS publishes
   --nbar-h (the header's top, when the bar is the first thing on the page) and --nbar-push (the
   bar's top margin, when the page reserves less room than the header needs); both are 0 without a
   bar. The universal margin reset also strips the UA's `margin:auto` that centres a modal <dialog>. */
@layer layout {
    .ftt-topbar { top: var(--nbar-h, 0px); }
    #fttNotice { margin-top: var(--nbar-push, 0px); }
    .ftt-notice-dialog { margin: auto; }
}
/* The home hero is pulled up 44px to bleed under the header, which drags it over the bar;
   paint the bar above page content (the header, z-index 60, stays above both). */
.ftt-notice { position: relative; z-index: 1; }
