/* ==========================================================================
   Site header — "Cinema" model
   Transparent at the top of the page, frosted glass once the page scrolls,
   nav links with a glowing active dot, Spotlight search and a phone tab bar.
   Markup: partials/header/main-header.php · JS: public/js/animetv-core.js
   ========================================================================== */

.atv-hdr,
.atv-spot,
.atv-tabbar {
    --h-text: #ffffff;
    --h-text-2: #d3d7df;
    --h-muted: #9aa1ae;
    --h-glass: rgba(15, 16, 21, 0.8);
    --h-line: rgba(255, 255, 255, 0.07);
    --h-chip: rgba(255, 255, 255, 0.07);
    --h-chip-border: rgba(255, 255, 255, 0.13);
    --h-panel: rgba(24, 26, 33, 0.97);
    --h-accent: #f5b942;
    --h-accent-ink: #1c1503;
    --h-shadow: 0 20px 40px -18px rgba(0, 0, 0, 0.85);
    --h-text-shadow: 0 1px 12px rgba(0, 0, 0, 0.45);
}

#animetvApp.day .atv-hdr,
#animetvApp.day .atv-spot,
#animetvApp.day .atv-tabbar {
    --h-text: #0f172a;
    --h-text-2: #334155;
    --h-muted: #64748b;
    --h-glass: rgba(255, 255, 255, 0.84);
    --h-line: rgba(15, 23, 42, 0.08);
    --h-chip: rgba(15, 23, 42, 0.04);
    --h-chip-border: rgba(15, 23, 42, 0.12);
    --h-panel: rgba(255, 255, 255, 0.98);
    --h-shadow: 0 14px 34px -16px rgba(15, 23, 42, 0.28);
    --h-text-shadow: none;
}

/* ---------- Bar ----------
   Fixed (not sticky): the theme makes <body> its own scroll container, which breaks position:sticky.
   .atv-hdr-spacer reserves the header's height in the page flow. */
body.animetv-native-body header.atv-hdr {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 900;
    display: block;
    height: 84px;
    margin: 0;
    padding: 0;
    direction: rtl;
    font-family: "IRANYekanX", "Vazirmatn", system-ui, sans-serif;
    -webkit-app-region: no-drag;
    transition: height 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}
body.animetv-native-body header.atv-hdr.is-scrolled {
    height: 66px;
}
.atv-hdr-spacer {
    height: 94px;
}
/* Lift the header (and the account sheet inside it) above the music player while the sheet is open. */
body.animetv-native-body.atv-acct-open header.atv-hdr {
    z-index: 10060;
}
/* The frosted layer is a separate element so fixed descendants (account sheet) keep the viewport as their box. */
.atv-hdr__bg {
    position: absolute;
    inset: 0;
    background: transparent;
    border-bottom: 1px solid transparent;
    transition: background-color 0.35s, border-color 0.35s, box-shadow 0.35s;
    pointer-events: none;
}
.atv-hdr.is-scrolled .atv-hdr__bg {
    background: var(--h-glass);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    backdrop-filter: blur(20px) saturate(1.3);
    border-bottom-color: var(--h-line);
    box-shadow: var(--h-shadow);
}
body.animetv-native-body header.atv-hdr > .atv-hdr__in {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 40px;
    width: auto;
    height: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 clamp(16px, 3vw, 40px);
    box-sizing: border-box;
    -webkit-app-region: no-drag;
}

/* Brand: the site wordmark + TV icon inside a glass capsule (header logo model 3). Markup: partials/header/brand-logo.php (.atv-brand-tv / .atv-brand-wm, also used by the footer).
   Shrinks with the bar on scroll; white capsule in day mode. */
.atv-hdr a.atv-hdr__brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 5px 6px 5px 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.13);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.11), rgba(255, 255, 255, 0.03));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 14px 30px -16px rgba(0, 0, 0, 0.95);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    color: #ffffff;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.3, 1.4, 0.5, 1), padding 0.35s, gap 0.35s;
}
.atv-hdr a.atv-hdr__brand:hover {
    transform: translateY(-1px);
    color: #ffffff;
}
.atv-hdr a.atv-hdr__brand:focus-visible {
    outline: 2px solid var(--h-accent);
    outline-offset: 3px;
}
.atv-hdr .atv-brand-tv {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, rgba(253, 143, 0, 0.45), rgba(253, 143, 0, 0.12) 70%);
    box-shadow: inset 0 0 0 1px rgba(253, 143, 0, 0.5), 0 0 22px -4px rgba(253, 143, 0, 0.7);
    transition: width 0.35s, height 0.35s;
}
.atv-hdr .atv-brand-tv svg {
    display: block;
    width: 24.1px;
    height: 28px;
    transition: width 0.35s, height 0.35s;
}
.atv-hdr .atv-brand-wm {
    display: block;
    flex-shrink: 0;
    width: 106.4px;
    height: 26px;
    transition: width 0.35s, height 0.35s;
}
.atv-hdr.is-scrolled a.atv-hdr__brand {
    gap: 9px;
    padding: 4px 5px 4px 16px;
}
.atv-hdr.is-scrolled .atv-brand-tv {
    width: 40px;
    height: 40px;
}
.atv-hdr.is-scrolled .atv-brand-tv svg {
    width: 20.7px;
    height: 24px;
}
.atv-hdr.is-scrolled .atv-brand-wm {
    width: 90px;
    height: 22px;
}
#animetvApp.day .atv-hdr a.atv-hdr__brand,
#animetvApp.day .atv-hdr a.atv-hdr__brand:hover {
    border-color: #dfe3eb;
    background: linear-gradient(180deg, #ffffff, #f1f3f8);
    box-shadow: inset 0 1px 0 #ffffff, 0 10px 24px -16px rgba(15, 23, 42, 0.4);
    color: #0f172a;
}
#animetvApp.day .atv-hdr .atv-brand-tv {
    background: radial-gradient(circle at 50% 40%, #ffb347, #fd8f00);
    box-shadow: 0 6px 16px -6px rgba(253, 143, 0, 0.9);
}

/* ---------- Nav ---------- */
.atv-hdr__nav {
    display: flex;
    align-items: center;
    gap: 30px;
    padding-top: 8px;
}
.atv-hdr a.atv-hdr__link {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 15px;
    font-weight: 600;
    color: var(--h-text-2);
    text-decoration: none;
    white-space: nowrap;
    text-shadow: var(--h-text-shadow);
    transition: color 0.2s, text-shadow 0.2s;
}
.atv-hdr a.atv-hdr__link:hover {
    color: var(--h-text);
    text-shadow: 0 0 18px rgba(245, 185, 66, 0.45);
}
.atv-hdr__dot {
    display: block;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: transparent;
    transition: background-color 0.2s, box-shadow 0.2s;
}
.atv-hdr__link:hover .atv-hdr__dot {
    background: rgba(245, 185, 66, 0.6);
}
.atv-hdr a.atv-hdr__link.is-active {
    color: var(--h-text);
}
.atv-hdr__link.is-active .atv-hdr__dot {
    background: var(--h-accent);
    box-shadow: 0 0 10px rgba(245, 185, 66, 0.95);
}

/* ---------- Tools ---------- */
.atv-hdr__tools {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.atv-hdr .atv-hdr__search {
    width: 250px;
    height: 44px;
    margin: 0;
    padding: 0 14px 0 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid var(--h-chip-border);
    background: var(--h-chip);
    color: var(--h-text-2);
    font: inherit;
    font-size: 13.5px;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: border-color 0.25s, box-shadow 0.25s, background-color 0.25s;
}
.atv-hdr .atv-hdr__search:hover {
    border-color: rgba(245, 185, 66, 0.5);
    box-shadow: 0 0 24px rgba(245, 185, 66, 0.2);
}
.atv-hdr__search > i {
    width: 28px;
    font-size: 15px;
}
.atv-hdr__search-txt {
    flex: 1;
    text-align: right;
    white-space: nowrap;
}
.atv-hdr kbd,
.atv-spot kbd {
    font-family: inherit;
    font-size: 10.5px;
    line-height: 20px;
    padding: 0 6px;
    border-radius: 6px;
    border: 1px solid var(--h-chip-border);
    border-bottom-width: 2px;
    background: var(--h-chip);
    color: var(--h-muted);
}
.atv-hdr .atv-hdr__icon {
    position: relative;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--h-chip-border);
    background: var(--h-chip);
    color: var(--h-text);
    font-size: 16px;
    text-decoration: none;
    cursor: pointer;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    transition: background-color 0.2s, box-shadow 0.2s;
}
.atv-hdr .atv-hdr__icon:hover {
    box-shadow: 0 0 20px rgba(245, 185, 66, 0.3);
}
.atv-hdr .atv-hdr__theme {
    color: var(--h-accent);
}
.atv-hdr__ping {
    position: absolute;
    top: 10px;
    left: 11px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--h-accent);
    box-shadow: 0 0 10px rgba(245, 185, 66, 0.9);
}
.atv-hdr .atv-hdr__avatar {
    display: block;
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 2px;
    border: 0;
    border-radius: 50%;
    background: conic-gradient(from 210deg, #f5b942, #8b5cf6, #f5b942);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.4);
    cursor: pointer;
    transition: box-shadow 0.2s;
}
.atv-hdr .atv-hdr__avatar[aria-expanded="true"] {
    box-shadow: 0 0 0 3px rgba(245, 185, 66, 0.25), 0 0 26px rgba(139, 92, 246, 0.55);
}
.atv-hdr__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #14151b;
}
#animetvApp.day .atv-hdr__avatar img {
    border-color: #ffffff;
}
/* Guest sign-in — "split capsule" (canvas page "loginbtn", LbSplit): one quiet capsule holding a plain «ورود»
   (auth modal, login tab) and an amber «ثبت‌نام» (register tab). Phones: icon-only «ورود» + short «عضویت». */
.atv-hdr .atv-hdr__auth {
    --auth-hover: rgba(255, 255, 255, 0.09);
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    height: 48px;
    padding: 4px;
    border-radius: 999px;
    background: var(--h-chip);
    box-shadow: inset 0 0 0 1px var(--h-chip-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}
#animetvApp.day .atv-hdr .atv-hdr__auth {
    --auth-hover: rgba(15, 23, 42, 0.06);
}
.atv-hdr .atv-hdr__auth button {
    height: 40px;
    margin: 0;
    border: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-size: 13.5px;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
}
.atv-hdr .atv-hdr__auth-in {
    gap: 7px;
    padding: 0 15px;
    background: transparent;
    color: var(--h-text);
    font-weight: 700;
    transition: background-color 0.2s;
}
.atv-hdr .atv-hdr__auth-in svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.atv-hdr .atv-hdr__auth-in:hover {
    background: var(--auth-hover);
}
.atv-hdr .atv-hdr__auth-up {
    padding: 0 17px;
    background: linear-gradient(180deg, #ffc964, #f0ab22);
    color: var(--h-accent-ink);
    font-weight: 800;
    box-shadow: 0 8px 20px -10px rgba(245, 185, 66, 0.95);
    transition: filter 0.2s, transform 0.2s;
}
.atv-hdr .atv-hdr__auth-up:hover {
    filter: brightness(1.07);
    transform: translateY(-1px);
}
.atv-hdr .atv-hdr__auth-up:active {
    filter: brightness(0.96);
    transform: none;
}
.atv-hdr__auth-sm {
    display: none;
}
.atv-hdr a:focus-visible,
.atv-hdr button:focus-visible,
.atv-spot a:focus-visible,
.atv-spot button:focus-visible,
.atv-tabbar a:focus-visible {
    outline: 2px solid var(--h-accent);
    outline-offset: 2px;
}

/* ---------- Spotlight search ---------- */
.atv-spot {
    position: fixed;
    inset: 0;
    z-index: 10040;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 12vh 16px 16px;
    direction: rtl;
    font-family: "IRANYekanX", "Vazirmatn", system-ui, sans-serif;
}
.atv-spot[hidden] {
    display: none;
}
.atv-spot__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 7, 10, 0.6);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    animation: atvSpotFade 0.2s ease;
}
.atv-spot__panel {
    position: relative;
    width: 100%;
    max-width: 680px;
    max-height: 76vh;
    display: flex;
    flex-direction: column;
    border-radius: 22px;
    overflow: hidden;
    background: var(--h-panel);
    border: 1px solid var(--h-chip-border);
    box-shadow: 0 40px 90px -20px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(245, 185, 66, 0.14), 0 0 70px -10px rgba(245, 185, 66, 0.28);
    color: var(--h-text);
    animation: atvSpotPop 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes atvSpotFade {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes atvSpotPop {
    from { opacity: 0; transform: translateY(-12px) scale(0.98); }
    to { opacity: 1; transform: none; }
}
.atv-spot .atv-spot__form {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    margin: 0;
}
.atv-spot__row {
    height: 64px;
    flex-shrink: 0;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--h-line);
}
.atv-spot__ico {
    color: var(--h-accent);
    font-size: 18px;
}
.atv-spot .atv-spot__input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--h-text);
    font: inherit;
    font-size: 17px;
}
.atv-spot .atv-spot__input::placeholder {
    color: var(--h-muted);
}
.atv-spot .atv-spot__input::-webkit-search-cancel-button {
    display: none;
}
.atv-spot .atv-spot__clear,
.atv-spot .atv-spot__esc {
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--h-muted);
    cursor: pointer;
}
.atv-spot .atv-spot__clear {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}
.atv-spot__filters {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 12px 18px 6px;
}
.atv-spot__chip {
    position: relative;
    margin: 0;
    cursor: pointer;
}
.atv-spot__chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.atv-spot__chip span {
    height: 32px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    border: 1px solid var(--h-chip-border);
    color: var(--h-text-2);
    font-size: 12.5px;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}
.atv-spot__chip input:checked + span {
    background: var(--h-text);
    border-color: var(--h-text);
    color: var(--h-glass);
    font-weight: 800;
}
#animetvApp.day .atv-spot__chip input:checked + span {
    color: #ffffff;
}
.atv-spot__chip input:focus-visible + span {
    outline: 2px solid var(--h-accent);
    outline-offset: 2px;
}

/* Live results reuse the existing AJAX markup, shown inline in the panel */
.atv-spot .cmd-live-search-panel {
    position: relative;
    inset: auto;
    display: none;
    min-width: 0;
    min-height: 0;
    flex: 1 1 auto;
    overflow-y: auto;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    border: 0;
    border-radius: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
}
.atv-spot .cmd-live-search-panel.is-open {
    display: block;
}
.atv-spot .cmd-live-list {
    max-height: none;
}
.atv-spot__panel:has(.cmd-live-search-panel.is-open) .atv-spot__quick {
    display: none;
}
.atv-spot__quick {
    flex-shrink: 0;
    padding: 10px 18px 16px;
}
.atv-spot__quick-title {
    display: block;
    margin-bottom: 8px;
    font-size: 11.5px;
    color: var(--h-muted);
}
.atv-spot__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.atv-spot .atv-spot__links a {
    height: 36px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 999px;
    border: 1px solid var(--h-chip-border);
    color: var(--h-text-2);
    font-size: 12.5px;
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.atv-spot .atv-spot__links a:hover {
    border-color: rgba(245, 185, 66, 0.5);
    color: var(--h-text);
}
.atv-spot__foot {
    flex-shrink: 0;
    height: 44px;
    padding: 0 18px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-top: 1px solid var(--h-line);
    font-size: 12px;
    color: var(--h-muted);
}
.atv-spot__foot span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
body.animetv-native-body.atv-spot-open {
    overflow: hidden !important;
}

/* ---------- Phone tab bar ---------- */
.atv-tabbar {
    display: none;
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
    body.animetv-native-body header.atv-hdr > .atv-hdr__in {
        gap: 24px;
    }
    .atv-hdr__nav {
        gap: 20px;
    }
    .atv-hdr .atv-hdr__search {
        width: 200px;
    }
}
/* Just above the nav cut-off the row (logo + nav + search + guest capsule) runs out of room: shorter search, no kbd. */
@media (max-width: 1080px) {
    .atv-hdr .atv-hdr__search {
        width: 150px;
    }
    .atv-hdr__search kbd {
        display: none;
    }
}
@media (max-width: 980px) {
    .atv-hdr__nav {
        display: none;
    }
    .atv-hdr .atv-hdr__search {
        width: 44px;
        padding: 0;
        justify-content: center;
    }
    .atv-hdr__search > i {
        width: auto;
    }
    .atv-hdr__search-txt,
    .atv-hdr__search kbd {
        display: none;
    }
}
@media (max-width: 820px) {
    body.animetv-native-body header.atv-hdr {
        height: 62px;
    }
    .atv-hdr-spacer {
        height: 68px;
    }
    body.animetv-native-body header.atv-hdr.is-scrolled {
        height: 58px;
    }
    .atv-hdr a.atv-hdr__brand,
    .atv-hdr.is-scrolled a.atv-hdr__brand {
        gap: 8px;
        padding: 4px 5px 4px 14px;
    }
    .atv-hdr .atv-brand-tv,
    .atv-hdr.is-scrolled .atv-brand-tv {
        width: 34px;
        height: 34px;
    }
    .atv-hdr .atv-brand-tv svg,
    .atv-hdr.is-scrolled .atv-brand-tv svg {
        width: 18.1px;
        height: 21px;
    }
    .atv-hdr .atv-brand-wm,
    .atv-hdr.is-scrolled .atv-brand-wm {
        width: 73.6px;
        height: 18px;
    }
    .atv-hdr__tools {
        gap: 8px;
    }
    .atv-hdr .atv-hdr__icon,
    .atv-hdr .atv-hdr__search,
    .atv-hdr .atv-hdr__avatar {
        width: 40px;
        height: 40px;
    }
    .atv-hdr .atv-hdr__auth {
        height: 40px;
        padding: 3px;
    }
    .atv-hdr .atv-hdr__auth button {
        height: 34px;
        font-size: 12.5px;
    }
    .atv-hdr .atv-hdr__auth-in {
        width: 34px;
        padding: 0;
    }
    .atv-hdr .atv-hdr__auth-in span,
    .atv-hdr__auth-lg {
        display: none;
    }
    .atv-hdr .atv-hdr__auth-up {
        padding: 0 12px;
    }
    .atv-hdr__auth-sm {
        display: inline;
    }

    /* Phone tab bar — "islands" (canvas page "tabbar", TbIsland): glass capsule for the four sections + a round VIP
       button. The active item widens into a lighter glass pill with its name; .is-mini (scrolling down) keeps only
       the active item and VIP. Markup: partials/header/main-header.php · scroll: animetv-core.js 2b. */
    .atv-tabbar {
        --tb-glass: linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)), rgba(22, 23, 30, 0.5);
        --tb-rim: inset 1.2px 1.4px 0 -0.2px rgba(255, 255, 255, 0.55), inset -1px -1px 0 -0.2px rgba(255, 255, 255, 0.18);
        --tb-drop: 0 16px 34px -14px rgba(0, 0, 0, 0.75);
        --tb-ico: rgba(255, 255, 255, 0.82);
        --tb-on-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.07));
        --tb-on-rim: inset 1px 1.2px 0 -0.2px rgba(255, 255, 255, 0.6), inset -0.8px -0.8px 0 -0.2px rgba(255, 255, 255, 0.2), 0 6px 14px -8px rgba(0, 0, 0, 0.6);
        --tb-on-ico: #ffd47e;
        --tb-on-tx: #ffffff;
        --tb-vip: #ffd47e;
        position: fixed;
        right: 12px;
        left: 12px;
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        z-index: 890;
        height: 64px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        direction: rtl;
        font-family: "IRANYekanX", "Vazirmatn", system-ui, sans-serif;
        pointer-events: none;
        transition: bottom 0.3s;
    }
    #animetvApp.day .atv-tabbar {
        --tb-glass: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.5));
        --tb-rim: inset 1.2px 1.4px 0 -0.2px #ffffff, inset 0 0 0 1px rgba(15, 23, 42, 0.06);
        --tb-drop: 0 16px 32px -16px rgba(15, 23, 42, 0.42);
        --tb-ico: #3b4150;
        --tb-on-bg: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, 0.78));
        --tb-on-rim: 0 6px 14px -8px rgba(15, 23, 42, 0.35), inset 0 0 0 1px rgba(15, 23, 42, 0.05);
        --tb-on-ico: #b06f00;
        --tb-on-tx: #141722;
        --tb-vip: #a66800;
    }
    .atv-tabbar__cap,
    .atv-tabbar__vip {
        position: relative;
        height: 64px;
        border-radius: 32px;
        isolation: isolate;
        pointer-events: auto;
        background: var(--tb-glass);
        -webkit-backdrop-filter: blur(18px) saturate(190%) brightness(1.05);
        backdrop-filter: blur(18px) saturate(190%) brightness(1.05);
        box-shadow: var(--tb-rim), var(--tb-drop);
    }
    .atv-tabbar__cap {
        flex: 1 1 auto;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 2px;
        padding: 6px;
        transition: flex-grow 0.45s cubic-bezier(0.3, 1.2, 0.45, 1);
        background: rgb(92 92 92 / 25%);
        /* border-radius: 16px; */
        box-shadow: 0 4px 30px rgb(0 0 0 / 38%);
        backdrop-filter: blur(10.2px);
        -webkit-backdrop-filter: blur(10.2px);
        border: 1px solid rgb(255 255 255 / 11%);
    }
    .atv-tabbar a {
        text-decoration: none;
        -webkit-tap-highlight-color: transparent;
    }
    .atv-tabbar__item {
        position: relative;
        height: 52px;
        flex: 1 1 0;
        min-width: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        border-radius: 26px;
        color: var(--tb-ico);
        transition: flex-grow 0.5s cubic-bezier(0.3, 1.3, 0.45, 1), min-width 0.4s, max-width 0.4s, opacity 0.3s, background 0.35s, color 0.3s, box-shadow 0.35s;
    }
    .atv-tabbar__item i.fa-regular,
    .atv-tabbar__vip i.fa-regular {
        font-size: 19px;
        transition: transform 0.45s cubic-bezier(0.3, 1.5, 0.5, 1);
    }
    .atv-tabbar__item:active i.fa-regular,
    .atv-tabbar__vip:active i.fa-regular {
        transform: scale(0.86);
    }
    .atv-tabbar__lb {
        max-width: 0;
        overflow: hidden;
        white-space: nowrap;
        opacity: 0;
        font-size: 13px;
        font-weight: 800;
        line-height: 1;
        color: var(--tb-on-tx);
        transition: max-width 0.5s cubic-bezier(0.3, 1.2, 0.45, 1), opacity 0.3s, margin 0.4s;
    }
    .atv-tabbar__item.is-active {
        flex-grow: 2.4;
        background: #9b9b9b1a;
    }
    .atv-tabbar__item.is-active i.fa-regular {
        font-weight: 900;
    }
    .atv-tabbar__item.is-active .atv-tabbar__lb {
        max-width: 76px;
        opacity: 1;
        margin-right: 7px;
    }
    .atv-tabbar__vip {
        flex: 0 0 64px;
        width: 64px;
        display: grid;
        place-items: center;
        overflow: hidden;
        color: var(--tb-vip);
    }
    .atv-tabbar__vip::before {
        content: "";
        position: absolute;
        inset: 3px;
        border-radius: 50%;
        box-shadow: inset 0 0 0 1.5px rgba(245, 185, 66, 0.55);
        pointer-events: none;
    }
    .atv-tabbar__vip i.fa-regular {
        position: relative;
        z-index: 2;
        font-size: 21px;
        filter: drop-shadow(0 0 8px rgba(245, 185, 66, 0.6));
    }
    .atv-tabbar__shine {
        position: absolute;
        inset: 0;
        background: linear-gradient(115deg, transparent 30%, rgba(255, 230, 170, 0.45) 48%, transparent 62%);
        transform: translateX(-120%);
        animation: atvTbShine 3.6s ease-in-out infinite;
        pointer-events: none;
    }
    .atv-tabbar__vip.is-active {
        color: #2a1a00;
        background: radial-gradient(circle at 35% 28%, #fff1c4 0%, #ffd06a 32%, #f2a51f 75%, #c27c0e 100%);
        box-shadow: 0 0 0 4px rgba(245, 185, 66, 0.16), 0 14px 30px -8px rgba(245, 170, 40, 0.95), inset 0 2px 4px rgba(255, 255, 255, 0.7);
    }
    .atv-tabbar__vip.is-active::before {
        display: none;
    }
    .atv-tabbar__vip.is-active i.fa-regular {
        font-weight: 900;
        filter: none;
    }
    @keyframes atvTbShine {
        0%,
        55% {
            transform: translateX(-120%);
        }
        85%,
        100% {
            transform: translateX(120%);
        }
    }

    /* Scrolling down: only the active item (or «خانه» when none is active) and VIP stay. */
    .atv-tabbar.is-mini .atv-tabbar__cap {
        flex: 0 1 auto;
        cursor: pointer;
    }
    .atv-tabbar.is-mini .atv-tabbar__item {
        flex: 0 0 auto;
        min-width: 0;
        max-width: 0;
        padding: 0;
        opacity: 0;
        pointer-events: none;
    }
    .atv-tabbar.is-mini .atv-tabbar__item.is-active,
    .atv-tabbar.is-mini .atv-tabbar__cap:not(:has(.is-active)) .atv-tabbar__item:first-child {
        max-width: 140px;
        min-width: 52px;
        padding: 0 16px;
        opacity: 1;
    }
    .atv-tabbar.is-mini .atv-tabbar__cap:not(:has(.is-active)) .atv-tabbar__item:first-child {
        padding: 0;
    }
    .atv-tabbar:not(.is-mini) .atv-tabbar__item {
        max-width: 200px;
    }

    #animetvApp .main-content {
        padding-bottom: 104px;
    }
    body.has-music-player .atv-tabbar {
        bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    }
    body.has-music-player #animetvApp .main-content {
        padding-bottom: 180px;
    }
}
@media (max-width: 640px) {
    .atv-spot {
        padding: 0;
    }
    .atv-spot__panel {
        max-width: none;
        max-height: none;
        height: 100%;
        border-radius: 0;
        border-width: 0;
    }
    .atv-spot__foot {
        display: none;
    }
}
/* Narrow phones: the logo capsule steps down so the header row (logo + four round buttons) still fits. */
@media (max-width: 400px) {
    .atv-hdr a.atv-hdr__brand,
    .atv-hdr.is-scrolled a.atv-hdr__brand {
        gap: 7px;
        padding: 4px 4px 4px 12px;
    }
    .atv-hdr .atv-brand-tv,
    .atv-hdr.is-scrolled .atv-brand-tv {
        width: 32px;
        height: 32px;
    }
    .atv-hdr .atv-brand-wm,
    .atv-hdr.is-scrolled .atv-brand-wm {
        width: 65.5px;
        height: 16px;
    }
}
@media (max-width: 380px) {
    .atv-hdr a.atv-hdr__brand,
    .atv-hdr.is-scrolled a.atv-hdr__brand {
        gap: 6px;
        padding: 3px 3px 3px 10px;
    }
    .atv-hdr .atv-brand-tv,
    .atv-hdr.is-scrolled .atv-brand-tv {
        width: 30px;
        height: 30px;
    }
    .atv-hdr .atv-brand-tv svg,
    .atv-hdr.is-scrolled .atv-brand-tv svg {
        width: 16.4px;
        height: 19px;
    }
    .atv-hdr .atv-brand-wm,
    .atv-hdr.is-scrolled .atv-brand-wm {
        width: 57.3px;
        height: 14px;
    }
}
@media (max-width: 340px) {
    .atv-hdr .atv-brand-wm,
    .atv-hdr.is-scrolled .atv-brand-wm {
        display: none;
    }
    .atv-hdr a.atv-hdr__brand,
    .atv-hdr.is-scrolled a.atv-hdr__brand {
        padding: 4px;
    }
}

@media (max-width: 360px) {
    .atv-tabbar {
        gap: 8px;
    }
    .atv-tabbar__vip {
        flex-basis: 58px;
        width: 58px;
    }
    .atv-tabbar__item {
        min-width: 40px;
    }
    .atv-tabbar__lb {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atv-tabbar *,
    .atv-hdr,
    .atv-hdr *,
    .atv-spot__panel,
    .atv-spot__backdrop {
        transition: none !important;
        animation: none !important;
    }
}
