/* ==========================================================================
   Home "release rail" rows — latest dunghua & Chinese drama episodes (rows design 3)
   A glowing timeline; each poster hangs from a node with its release time, newest on the right.
   Markup: partials/home/release-rail.php · arrows: initReleaseRails() in public/js/animetv-home.js
   ========================================================================== */

.atv-rail {
    --rl-ac: #b79cff;
    --rl-line: rgba(139, 92, 246, 0.5);
    --rl-glow: rgba(139, 92, 246, 0.75);
    --rl-soft: rgba(139, 92, 246, 0.14);
    --rl-tint: rgba(139, 92, 246, 0.15);
    --rl-surface: rgba(255, 255, 255, 0.02);
    --rl-border: rgba(255, 255, 255, 0.07);
    --rl-text: #eef0f4;
    --rl-text-2: #c3c8d2;
    --rl-muted: #8b92a1;
    --rl-chip: rgba(255, 255, 255, 0.05);
    --rl-chip-line: rgba(255, 255, 255, 0.1);
    --rl-ring: #1b1d24; /* the section's own surface, so nodes "cut" the rail line cleanly */
    --rl-on-ac: #0f1015;
    --rl-w: 200px;
    --rl-gap: 24px;
    --rl-pad: 28px;

    position: relative;
    width: calc(100% - 48px);
    max-width: 1320px; /* same column as the hero slider content */
    margin: 34px auto 0;
    padding: var(--rl-pad);
    border-radius: 30px;
    overflow: hidden;
    direction: rtl;
    color: var(--rl-text);
    border: 1px solid var(--rl-border);
    background: radial-gradient(760px 320px at 100% 0%, var(--rl-tint), transparent 70%), var(--rl-surface);
}
.atv-rail.is-chinese {
    --rl-ac: #5fe0a6;
    --rl-line: rgba(52, 211, 153, 0.45);
    --rl-glow: rgba(52, 211, 153, 0.6);
    --rl-soft: rgba(52, 211, 153, 0.12);
    --rl-tint: rgba(52, 211, 153, 0.12);
}
#animetvApp.day .atv-rail {
    --rl-ac: #6d28d9;
    --rl-line: rgba(109, 40, 217, 0.35);
    --rl-glow: rgba(124, 58, 237, 0.4);
    --rl-soft: rgba(124, 58, 237, 0.09);
    --rl-tint: rgba(124, 58, 237, 0.08);
    --rl-surface: #ffffff;
    --rl-border: rgba(15, 23, 42, 0.08);
    --rl-text: #0f172a;
    --rl-text-2: #334155;
    --rl-muted: #64748b;
    --rl-chip: #f3f5f9;
    --rl-chip-line: rgba(15, 23, 42, 0.1);
    --rl-ring: #ffffff; /* matches the white day surface */
    --rl-on-ac: #ffffff;
}
#animetvApp.day .atv-rail.is-chinese {
    --rl-ac: #047857;
    --rl-line: rgba(4, 120, 87, 0.35);
    --rl-glow: rgba(16, 185, 129, 0.4);
    --rl-soft: rgba(16, 185, 129, 0.09);
    --rl-tint: rgba(16, 185, 129, 0.08);
}
.atv-rail *,
.atv-rail *::before,
.atv-rail *::after {
    box-sizing: border-box;
}

/* ---------- Head ---------- */
.atv-rail__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 22px;
}
.atv-rail__bar {
    flex-shrink: 0;
    width: 12px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(180deg, var(--rl-ac), var(--rl-soft));
    box-shadow: 0 0 22px var(--rl-glow);
}
.atv-rail__titles {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}
/* Title style kept from the previous home rows (home-row-heading.css): small grey kicker,
   large gradient title in the row colour. */
.atv-rail__titles {
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
}
.atv-rail__kicker {
    display: block;
    color: #c4c4d0;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.8;
}
.atv-rail .atv-rail__titles h2 {
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    color: #b797ff;
    background: linear-gradient(110deg, #b797ff 25%, #e4d5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: inherit;
    font-size: 25px;
    font-weight: 900;
    line-height: 1.4;
}
.atv-rail.is-chinese .atv-rail__titles h2 {
    color: #4cdeb2;
    background-image: linear-gradient(110deg, #4cdeb2 25%, #b5ffec);
}
#animetvApp.day .atv-rail__kicker {
    color: #596174;
}
#animetvApp.day .atv-rail .atv-rail__titles h2 {
    color: #7149ba;
    background-image: linear-gradient(110deg, #7149ba, #5e43a1);
}
#animetvApp.day .atv-rail.is-chinese .atv-rail__titles h2 {
    color: #087d61;
    background-image: linear-gradient(110deg, #087d61, #046348);
}
.atv-rail__desc {
    margin-top: 2px;
    font-family: 'Vazirmatn', sans-serif;
    font-size: 12.5px;
    font-weight: 400;
    color: var(--rl-muted);
    white-space: nowrap;
}

/* Live stats beside the title */
.atv-rail__stats {
    list-style: none;
    margin: 0 8px 0 0;
    padding: 0;
    display: flex;
    gap: 10px;
    min-width: 0;
}
.atv-rail__stat {
    height: 62px;
    padding: 0 16px 0 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    border-radius: 18px;
    background: var(--rl-chip);
    border: 1px solid var(--rl-chip-line);
}
.atv-rail__stat-ico {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--rl-soft);
    color: var(--rl-ac);
    font-size: 15px;
}
.atv-rail__stat-txt {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}
.atv-rail__stat-txt b {
    font-size: 20px;
    font-weight: 900;
    color: var(--rl-text);
}
.atv-rail__stat-txt small {
    font-size: 11.5px;
    color: var(--rl-muted);
    white-space: nowrap;
}
.atv-rail__stat.is-hot {
    border-color: var(--rl-line);
    background: linear-gradient(135deg, var(--rl-soft), rgba(255, 255, 255, 0.02));
    box-shadow: 0 0 30px -14px var(--rl-glow);
}
.atv-rail__stat.is-hot .atv-rail__stat-ico {
    background: var(--rl-ac);
    color: var(--rl-on-ac);
    box-shadow: 0 0 16px var(--rl-glow);
}
.atv-rail__stat-covers {
    display: flex;
    padding-left: 10px;
}
.atv-rail__stat-covers img {
    width: 30px;
    height: 42px;
    margin-left: -10px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid var(--rl-ring);
    box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.8);
}
#animetvApp.day .atv-rail__stat.is-hot {
    background: linear-gradient(135deg, var(--rl-soft), #ffffff);
}

.atv-rail__tools {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}
.atv-rail .atv-rail__all {
    height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid var(--rl-line);
    background: var(--rl-soft);
    color: var(--rl-ac);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    transition: box-shadow 0.2s;
}
.atv-rail .atv-rail__all i {
    font-size: 12px;
}
.atv-rail .atv-rail__nav {
    width: 44px;
    height: 44px;
    margin: 0;
    padding: 0;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px solid var(--rl-chip-line);
    background: var(--rl-chip);
    color: var(--rl-text);
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, opacity 0.2s;
}
.atv-rail .atv-rail__nav:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ---------- Scroller ---------- */
.atv-rail__viewport {
    margin: 0 calc(var(--rl-pad) * -1);
    padding: 0 var(--rl-pad) 26px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: var(--rl-pad);
    scrollbar-width: none;
}
.atv-rail__viewport::-webkit-scrollbar {
    display: none;
}
/* Fade the edge that still has more episodes behind it (RTL: "next" is on the left). */
.atv-rail__viewport.can-next {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 72px);
    mask-image: linear-gradient(to right, transparent 0, #000 72px);
}
.atv-rail__viewport.can-prev {
    -webkit-mask-image: linear-gradient(to left, transparent 0, #000 72px);
    mask-image: linear-gradient(to left, transparent 0, #000 72px);
}
.atv-rail__viewport.can-prev.can-next {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 72px, #000 calc(100% - 72px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 72px, #000 calc(100% - 72px), transparent 100%);
}
.atv-rail__track {
    position: relative;
    display: flex;
    gap: var(--rl-gap);
    width: max-content;
    padding-top: 4px;
}
/* 4px track padding + 28px time chip + 10px gap + half of the 16px node */
.atv-rail__line {
    position: absolute;
    top: 49px;
    right: 0;
    left: 0;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(270deg, var(--rl-ac), var(--rl-line) 30%, transparent);
}

/* ---------- Episode column ---------- */
.atv-rail .atv-rail__item {
    position: relative;
    flex: 0 0 var(--rl-w);
    width: var(--rl-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--rl-text);
    text-decoration: none;
    scroll-snap-align: start;
}
.atv-rail .atv-rail__item:focus-visible {
    outline: 2px solid #f5b942;
    outline-offset: 4px;
    border-radius: 18px;
}
.atv-rail__when {
    height: 28px;
    padding: 0 11px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--rl-chip);
    border: 1px solid var(--rl-chip-line);
    color: var(--rl-text-2);
    font-size: 11.5px;
    white-space: nowrap;
    transition: color 0.25s, border-color 0.25s;
}
.atv-rail__node {
    position: relative;
    z-index: 1;
    margin-top: 10px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--rl-ring);
    border: 3px solid var(--rl-ac);
    box-shadow: 0 0 0 4px var(--rl-ring);
    transition: transform 0.3s, box-shadow 0.3s;
}
.atv-rail__stem {
    width: 2px;
    height: 18px;
    background: linear-gradient(180deg, var(--rl-ac), var(--rl-chip-line));
}
/* The ring is a box-shadow (not a border) so the poster's inner box is exactly --rl-w × --rl-h,
   which the glass copies below rely on to line up with the cover pixel for pixel. */
.atv-rail__poster {
    --rl-h: calc(var(--rl-w) * 1.45);
    position: relative;
    display: block;
    width: var(--rl-w);
    height: var(--rl-h);
    border-radius: 24px;
    overflow: hidden;
    background: #16181f;
    box-shadow: 0 24px 40px -26px rgba(0, 0, 0, 0.95), 0 0 0 1px var(--rl-chip-line);
    transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s;
}
.atv-rail__poster > img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ---------- Recessed "liquid glass" on the cover ----------
   Each glass holds two copies of the cover placed exactly over the poster behind it:
   __b = body (lightly blurred and dimmed), __e = edge band (shrunk toward the centre and masked to the rim),
   so the image near the edges bends INTO the glass like a concave lens. Light comes from above:
   the upper inner wall sits in shadow and only the lower lip catches a faint highlight. */
.atv-lq {
    --lq-in: 8px;
    position: absolute;
    z-index: 1;
    overflow: hidden;
    isolation: isolate;
    color: #ffffff;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12), 0 -1px 0 rgba(0, 0, 0, 0.28);
}
.atv-lq__b,
.atv-lq__e,
.atv-lq__rim {
    position: absolute;
    inset: 0;
    border-radius: inherit;
}
.atv-lq__b,
.atv-lq__e {
    overflow: hidden;
}
.atv-lq__b {
    filter: blur(4px) saturate(1.55) brightness(0.86) contrast(1.05);
}
.atv-lq__e {
    filter: blur(1.5px) saturate(1.6) brightness(0.72);
    -webkit-mask-image: linear-gradient(90deg, #000 0, rgba(0, 0, 0, 0) 16px, rgba(0, 0, 0, 0) calc(100% - 16px), #000 100%), linear-gradient(180deg, #000 0, rgba(0, 0, 0, 0) 14px, rgba(0, 0, 0, 0) calc(100% - 14px), #000 100%);
    -webkit-mask-composite: source-over;
    mask-image: linear-gradient(90deg, #000 0, rgba(0, 0, 0, 0) 16px, rgba(0, 0, 0, 0) calc(100% - 16px), #000 100%), linear-gradient(180deg, #000 0, rgba(0, 0, 0, 0) 14px, rgba(0, 0, 0, 0) calc(100% - 14px), #000 100%);
    mask-composite: add;
}
.atv-lq img {
    position: absolute;
    width: var(--rl-w);
    height: var(--rl-h);
    max-width: none;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.atv-lq__rim {
    z-index: 3;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.3) 0%, rgba(0, 0, 0, 0.08) 38%, rgba(255, 255, 255, 0.04) 70%, rgba(255, 255, 255, 0.1) 100%);
}
.atv-lq__ct {
    position: relative;
    z-index: 4;
    height: 100%;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}
/* bottom capsule: title, genres, rating */
.atv-lq--pan {
    --lq-h: 68px;
    right: var(--lq-in);
    left: var(--lq-in);
    bottom: var(--lq-in);
    height: var(--lq-h);
    border-radius: 20px;
}
.atv-lq--pan img {
    right: calc(var(--lq-in) * -1);
    bottom: calc(var(--lq-in) * -1);
    transform-origin: calc(var(--rl-w) / 2) calc(var(--rl-h) - var(--lq-in) - var(--lq-h) / 2);
}
.atv-lq--pan .atv-lq__b img {
    transform: scale(0.99);
}
.atv-lq--pan .atv-lq__e img {
    transform: scale(0.84);
}
.atv-lq--pan .atv-lq__ct {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px 0 10px;
}
.atv-lq__tx {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.4;
}
.atv-lq__t {
    font-size: 18px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    direction: ltr;
}
.atv-lq__t.is-latin {
    font-family: 'AtvKalameh', 'Vazirmatn', sans-serif;
}
.atv-lq__g {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.86);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 300;
}
.atv-lq__rate {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
}
.atv-lq__rate i {
    font-style: normal;
    color: #ffd96b;
}
/* top-left tile: episode number */
.atv-lq--tile {
    --lq-t: 10px;
    --lq-s: 54px;
    top: var(--lq-t);
    left: var(--lq-t);
    width: var(--lq-s);
    height: var(--lq-s);
    border-radius: 17px;
}
.atv-lq--tile img {
    top: calc(var(--lq-t) * -1);
    left: calc(var(--lq-t) * -1);
    transform-origin: calc(var(--lq-t) + var(--lq-s) / 2) calc(var(--lq-t) + var(--lq-s) / 2);
}
.atv-lq--tile .atv-lq__b img {
    transform: scale(0.99);
}
.atv-lq--tile .atv-lq__e img {
    transform: scale(0.8);
}
.atv-lq--tile .atv-lq__ct {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.05;
}
.atv-lq--tile .atv-lq__ct b {
    font-size: 21px;
    font-weight: 900;
}
.atv-lq--tile .atv-lq__ct small {
    font-size: 10px;
    opacity: 0.9;
}

/* Title & genres under the poster are only used by the phone layout (the cover carries them on larger screens). */
.atv-rail__info {
    width: 100%;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}
.atv-rail .atv-rail__title {
    font-size: 18px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--rl-text);
    direction: ltr;
    font-family: 'AtvKalameh';
    text-align: left;
}
.atv-rail__genres {
    font-size: 12px;
    color: var(--rl-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.atv-rail__when-m,
.atv-rail__ep-m {
    display: none;
}
@media (min-width: 641px) {
    .atv-rail__info {
        display: none;
    }
}

/* Newest episode: filled time chip and a pulsing node */
.atv-rail__item.is-new .atv-rail__when {
    background: var(--rl-ac);
    border-color: transparent;
    color: var(--rl-on-ac);
    font-weight: 800;
}
.atv-rail__item.is-new .atv-rail__node {
    background: var(--rl-ac);
    animation: atvRailRing 2s ease-out infinite;
}
@keyframes atvRailRing {
    0% {
        box-shadow: 0 0 0 4px var(--rl-ring), 0 0 0 4px var(--rl-glow);
    }
    100% {
        box-shadow: 0 0 0 4px var(--rl-ring), 0 0 0 16px rgba(0, 0, 0, 0);
    }
}

/* "See all" node at the end of the rail */
.atv-rail .atv-rail__end {
    flex: 0 0 130px;
    padding-top: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--rl-ac);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.7;
    text-align: center;
    text-decoration: none;
}
.atv-rail__end-dot {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 1px dashed var(--rl-line);
    background: var(--rl-ring);
    box-shadow: inset 0 0 0 60px var(--rl-soft);
    transition: box-shadow 0.25s;
}

@media (hover: hover) {
    .atv-rail .atv-rail__all:hover {
        color: var(--rl-ac);
        box-shadow: 0 0 26px -6px var(--rl-glow);
    }
    .atv-rail .atv-rail__nav:not(:disabled):hover {
        border-color: var(--rl-line);
        box-shadow: 0 0 22px -4px var(--rl-glow);
    }
    .atv-rail .atv-rail__item:hover .atv-rail__poster {
        transform: translateY(-6px);
        box-shadow: 0 30px 50px -26px rgba(0, 0, 0, 0.95), 0 0 0 1px var(--rl-line), 0 0 46px -14px var(--rl-glow);
    }
    /* the cover itself does not zoom (the glass copies must stay aligned with it); the glass sinks a little deeper instead */
    .atv-rail .atv-rail__item:hover .atv-lq--pan .atv-lq__e img {
        transform: scale(0.78);
    }
    .atv-rail .atv-rail__item:hover .atv-lq--tile .atv-lq__e img {
        transform: scale(0.74);
    }
    .atv-rail .atv-rail__item:hover .atv-rail__node {
        transform: scale(1.25);
        box-shadow: 0 0 0 4px var(--rl-ring), 0 0 18px 2px var(--rl-glow);
    }
    .atv-rail .atv-rail__item:not(.is-new):hover .atv-rail__when {
        color: var(--rl-text);
        border-color: var(--rl-line);
    }
    .atv-rail .atv-rail__end:hover {
        color: var(--rl-ac);
    }
    .atv-rail .atv-rail__end:hover .atv-rail__end-dot {
        box-shadow: inset 0 0 0 60px var(--rl-soft), 0 0 28px -4px var(--rl-glow);
    }
}
.atv-rail .atv-rail__item:focus-visible .atv-rail__poster {
    box-shadow: 0 0 0 1px var(--rl-line), 0 0 46px -14px var(--rl-glow);
}
#animetvApp.day .atv-rail__poster {
    box-shadow: 0 22px 36px -26px rgba(15, 23, 42, 0.55), 0 0 0 1px var(--rl-chip-line);
}

/* ---------- Header stats on narrower desktops ---------- */
@media (max-width: 1240px) {
    .atv-rail__stat.is-airing {
        display: none;
    }
}
@media (max-width: 1100px) {
    .atv-rail__stat.is-week,
    .atv-rail__desc {
        display: none;
    }
}

/* ---------- Tablet ---------- */
@media (max-width: 980px) {
    .atv-rail {
        --rl-w: 168px;
        --rl-gap: 18px;
        --rl-pad: 22px;
        border-radius: 26px;
    }
    .atv-rail__stat-covers {
        display: none;
    }
    .atv-lq--pan {
        --lq-h: 60px;
        border-radius: 18px;
    }
    .atv-lq--pan .atv-lq__ct {
        padding: 0 11px 0 8px;
    }
    .atv-lq__t {
        font-size: 13.5px;
    }
    .atv-lq--tile {
        --lq-s: 46px;
        border-radius: 15px;
    }
    .atv-lq--tile .atv-lq__ct b {
        font-size: 18px;
    }
}

/* ---------- Phone (canvas "mrail" MrShelf + "mrail2" MiNumber, 2026-11-29) ----------
   A horizontal shelf of equal posters (150 × 225, snap), the stats as one line of chips, and under each poster a big
   episode number riding on the poster's bottom edge with the title and release time beside it. No glass on phones. */
.atv-rail__foot {
    display: none;
}
@media (max-width: 640px) {
    .atv-rail {
        --rl-pad: 14px;
        --rl-w: 150px;
        width: calc(100% - 32px);
        margin-top: 24px;
        padding: 18px 14px 16px;
        border-radius: 24px;
    }
    .atv-rail__head {
        flex-wrap: wrap;
        gap: 10px;
        margin-bottom: 12px;
    }
    .atv-rail__bar {
        width: 10px;
        height: 32px;
    }
    .atv-rail__kicker {
        font-size: 11.5px;
        line-height: 1.6;
    }
    .atv-rail .atv-rail__titles h2 {
        font-size: 21px;
    }
    .atv-rail .atv-rail__nav {
        display: none;
    }
    .atv-rail .atv-rail__all {
        height: 38px;
        padding: 0 14px;
        font-size: 12.5px;
    }

    /* stats: one scrollable line of chips under the title */
    .atv-rail__stats {
        order: 5;
        flex-basis: calc(100% + 28px);
        margin: 2px -14px 0;
        padding: 0 14px;
        gap: 6px;
        overflow-x: auto;
        scrollbar-width: none;
    }
    .atv-rail__stats::-webkit-scrollbar {
        display: none;
    }
    .atv-rail__stat,
    .atv-rail__stat.is-hot {
        height: 32px;
        padding: 0 11px;
        gap: 6px;
        border-radius: 999px;
        box-shadow: none;
    }
    .atv-rail__stat-ico,
    .atv-rail__stat.is-hot .atv-rail__stat-ico {
        width: auto;
        height: auto;
        background: none;
        box-shadow: none;
        color: var(--rl-ac);
        font-size: 12px;
    }
    .atv-rail__stat-txt {
        flex-direction: row;
        align-items: baseline;
        gap: 5px;
    }
    .atv-rail__stat-txt b {
        font-size: 13.5px;
    }
    .atv-rail__stat-txt small {
        font-size: 11.5px;
    }
    .atv-rail__stat-covers {
        display: none;
    }
    /* all three stats side by side (narrower desktops hide the week / airing tiles) */
    .atv-rail__stat.is-week,
    .atv-rail__stat.is-airing {
        display: flex;
    }

    /* the shelf */
    .atv-lq,
    .atv-rail__line,
    .atv-rail__when,
    .atv-rail__node,
    .atv-rail__stem,
    .atv-rail__genres,
    .atv-rail__ep-m {
        display: none;
    }
    .atv-rail__viewport,
    .atv-rail__viewport.can-next,
    .atv-rail__viewport.can-prev,
    .atv-rail__viewport.can-prev.can-next {
        margin: 2px -14px 0;
        padding: 4px 14px 10px;
        scroll-snap-type: x mandatory;
        scroll-padding-inline: 14px;
        -webkit-mask-image: none;
        mask-image: none;
    }
    .atv-rail__track {
        gap: 12px;
        padding: 0;
        align-items: flex-start;
    }
    .atv-rail .atv-rail__item {
        flex: 0 0 var(--rl-w);
        width: var(--rl-w);
        align-items: stretch;
    }
    /* twelve episodes on phones; the end tile leads to the rest */
    .atv-rail .atv-rail__item:nth-child(n + 14) {
        display: none;
    }
    .atv-rail__poster {
        width: var(--rl-w);
        height: 225px;
        border-radius: 18px;
        box-shadow: 0 16px 28px -18px rgba(0, 0, 0, 0.85), 0 0 0 1px var(--rl-chip-line);
    }
    #animetvApp.day .atv-rail__poster {
        box-shadow: 0 14px 26px -16px rgba(15, 23, 42, 0.45), 0 0 0 1px var(--rl-chip-line);
    }
    .atv-rail__poster::after {
        display: none;
    }

    /* big episode number on the poster's bottom edge, title + time beside it */
    .atv-rail__info {
        position: relative;
        z-index: 1;
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
        margin-top: -26px;
        padding: 0 2px;
    }
    .atv-rail__num {
        order: 2;
        flex-shrink: 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        line-height: 0.9;
    }
    .atv-rail__num small {
        margin: 0 0 2px 4px;
        font-size: 9px;
        font-weight: 800;
        color: #ffffff;
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
    }
    .atv-rail__num b {
        font-family: "IRANYekanX", "Vazirmatn", sans-serif;
        font-size: 44px;
        font-weight: 900;
        letter-spacing: -0.5px;
        color: var(--rl-ac);
        -webkit-text-stroke: 5px var(--rl-ring);
        paint-order: stroke fill;
        text-shadow: 0 4px 14px var(--rl-glow);
    }
    .atv-rail__txt {
        order: 1;
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 3px;
        padding-top: 32px;
    }
    .atv-rail .atv-rail__title {
        display: block;
        font-size: 13px;
        line-height: 1.45;
        text-align: right;
    }
    .atv-rail__when-m {
        display: flex;
        align-items: center;
        gap: 5px;
        font-size: 10.5px;
        font-weight: 700;
        color: var(--rl-muted);
        white-space: nowrap;
    }
    .atv-rail__when-m::before {
        content: "";
        width: 6px;
        height: 6px;
        flex-shrink: 0;
        border-radius: 50%;
        background: var(--rl-ac);
    }
    .atv-rail__item.is-new .atv-rail__when-m::before {
        box-shadow: 0 0 0 3px var(--rl-soft);
    }

    /* "see all" tile at the end of the shelf */
    .atv-rail .atv-rail__end {
        flex: 0 0 112px;
        height: 225px;
        padding: 0 10px;
        justify-content: center;
        gap: 10px;
        border-radius: 18px;
        border: 1px dashed var(--rl-line);
        background: var(--rl-soft);
        font-size: 12.5px;
        scroll-snap-align: start;
    }
    .atv-rail__end-dot {
        width: 46px;
        height: 46px;
        font-size: 14px;
        border-style: solid;
    }

    /* progress line under the shelf */
    .atv-rail__foot {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-top: 2px;
    }
    .atv-rail__prog {
        flex: 1;
        height: 4px;
        border-radius: 4px;
        background: var(--rl-chip-line);
        overflow: hidden;
    }
    .atv-rail__prog i {
        display: block;
        width: 30%;
        height: 100%;
        border-radius: inherit;
        background: var(--rl-ac);
        box-shadow: 0 0 8px var(--rl-glow);
        transition: width 0.25s;
    }
    .atv-rail__swipe {
        font-size: 11px;
        color: var(--rl-muted);
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atv-rail__poster,
    .atv-rail__poster img,
    .atv-rail__node {
        transition: none;
    }
    .atv-rail__item.is-new .atv-rail__node {
        animation: none;
    }
}
