/* ==========================================================================
   Single anime / chinese page — "Sidebar" layout (design 3)
   One accent (amber) for primary actions and rating only; everything else neutral.
   Markup: partials/single/anime/{main,side-panel,title-block,episodes}.php
   ========================================================================== */

.atv-s3 {
    --s3-bg: #16181f;
    --s3-surface: #1c1f27;
    --s3-surface-2: #252934;
    --s3-sunken: #181a21;
    --s3-line: #2e333e;
    --s3-line-soft: #252932;
    --s3-text: #eef0f4;
    --s3-text-2: #b4bac6;
    --s3-muted: #8b92a1;
    --s3-star-off: #3b404c;
    --s3-accent: #f5b942;
    --s3-accent-hover: #ffc75e;
    --s3-accent-ink: #1c1503;
    --s3-accent-text: #f5b942;
    --s3-live: #3fc380;
    --s3-stop: #ef7070;
    --s3-radius: 14px;
    --s3-radius-sm: 10px;

    width: 100%;
    max-width: 1360px;
    margin: 0 auto;
    padding: 22px clamp(16px, 2.6vw, 36px) 48px;
    box-sizing: border-box;
    direction: rtl;
    color: var(--s3-text);
    font-size: 14px;
    line-height: 1.75;
}

#animetvApp.day .atv-s3 {
    --s3-bg: #f4f6fb;
    --s3-surface: #ffffff;
    --s3-surface-2: #eef1f6;
    --s3-sunken: #f8f9fc;
    --s3-line: #dfe3eb;
    --s3-line-soft: #e7eaf0;
    --s3-text: #0f172a;
    --s3-text-2: #475569;
    --s3-muted: #64748b;
    --s3-star-off: #d5dae3;
    --s3-accent: #f5b942;
    --s3-accent-hover: #f0ab22;
    --s3-accent-ink: #1c1503;
    --s3-accent-text: #9a6200;
    --s3-live: #16a34a;
    --s3-stop: #dc2626;
}

.atv-s3 [class*="atv-s3-"] {
    box-sizing: border-box;
}

/* ---------- Breadcrumb ---------- */
.atv-s3-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 9px;
    margin: 0 0 20px;
    font-size: 12.5px;
    color: var(--s3-muted);
}
.atv-s3-crumbs a {
    color: var(--s3-muted);
    text-decoration: none;
    transition: color 0.15s;
}
.atv-s3-crumbs a:hover {
    color: var(--s3-text);
}
.atv-s3-crumb-sep {
    font-size: 8px;
    opacity: 0.7;
}
.atv-s3-crumb-current {
    color: var(--s3-text);
    font-weight: 600;
    max-width: 340px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- Two-column layout ---------- */
.atv-s3-layout {
    display: flex;
    align-items: flex-start;
    gap: 32px;
}
.atv-s3-side {
    flex: 0 0 280px;
    width: 280px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.atv-s3-main {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.atv-s3-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    margin-top: 8px;
}

/* ---------- Buttons ---------- */
.atv-s3 .atv-s3-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    margin: 0;
    padding: 0 16px;
    border-radius: var(--s3-radius-sm);
    border: 1px solid var(--s3-line);
    background: var(--s3-surface);
    color: var(--s3-text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}
.atv-s3 .atv-s3-btn:hover {
    background: var(--s3-surface-2);
    color: var(--s3-text);
}
.atv-s3 .atv-s3-btn:focus-visible,
.atv-s3 .atv-s3-icon-btn:focus-visible,
.atv-s3 .atv-s3-admin-btn:focus-visible,
.atv-s3 .atv-s3-chip:focus-visible,
.atv-s3 .atv-s3-poster:focus-visible {
    outline: 2px solid var(--s3-accent);
    outline-offset: 2px;
}
.atv-s3 .atv-s3-btn i {
    font-size: 14px;
}
.atv-s3 .atv-s3-btn--primary {
    background: var(--s3-accent);
    border-color: var(--s3-accent);
    color: var(--s3-accent-ink);
    font-weight: 800;
}
.atv-s3 .atv-s3-btn--primary:hover {
    background: var(--s3-accent-hover);
    border-color: var(--s3-accent-hover);
    color: var(--s3-accent-ink);
}
.atv-s3 .atv-s3-btn--ghost {
    background: transparent;
}
.atv-s3 .atv-s3-btn--soft {
    background: var(--s3-surface-2);
    border-color: transparent;
}
.atv-s3 .atv-s3-btn--soft:hover {
    border-color: var(--s3-line);
}
.atv-s3 .atv-s3-btn--outline {
    background: transparent;
    border-color: var(--s3-accent);
    color: var(--s3-accent-text);
}
.atv-s3 .atv-s3-btn--outline:hover {
    background: var(--s3-accent);
    color: var(--s3-accent-ink);
}
.atv-s3 .atv-s3-btn--icon {
    flex: 0 0 44px;
    width: 44px;
    padding: 0;
    color: var(--s3-text-2);
}
.atv-s3 .atv-s3-btn--block {
    width: 100%;
}
.atv-s3 .atv-s3-btn--sm {
    height: 38px;
    padding: 0 13px;
    font-size: 13px;
}
.atv-s3 .atv-s3-btn--sm i {
    font-size: 12px;
}

.atv-s3 .atv-s3-icon-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    display: inline-grid;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--s3-muted);
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s, color 0.15s;
}
.atv-s3 .atv-s3-icon-btn:hover {
    background: var(--s3-surface-2);
    color: var(--s3-text);
}
.atv-s3 .atv-s3-icon-btn.is-del:hover {
    color: var(--s3-stop);
}

/* ---------- Side: poster & actions ---------- */
.atv-s3-poster-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
/* "Edit post" under the cover, administrators only: a glass capsule with a gold icon tile, gold→violet rim and a shine on hover. */
@keyframes atvS3EditShine {
    from { left: -40%; }
    to { left: 120%; }
}
.atv-s3 .atv-s3-edit-post {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    min-height: 60px;
    padding: 9px 12px 9px 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 18px;
    text-decoration: none;
    color: var(--s3-text);
    background: radial-gradient(140px 70px at 100% 0, rgba(245, 185, 66, 0.16), transparent 70%), radial-gradient(140px 70px at 0 100%, rgba(139, 92, 246, 0.16), transparent 70%), var(--s3-surface);
    box-shadow: 0 14px 30px -20px rgba(0, 0, 0, 0.9);
    transition: transform 0.25s, box-shadow 0.25s;
}
.atv-s3 .atv-s3-edit-post::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(120deg, rgba(255, 217, 138, 0.85), rgba(255, 255, 255, 0.08) 45%, rgba(167, 139, 250, 0.75));
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}
.atv-s3 .atv-s3-edit-post::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -40%;
    width: 30%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.16), transparent);
    transform: skewX(-20deg);
    opacity: 0;
}
.atv-s3 .atv-s3-edit-post:hover {
    color: var(--s3-text);
    transform: translateY(-2px);
    box-shadow: 0 18px 36px -18px rgba(245, 185, 66, 0.65), 0 0 0 3px rgba(245, 185, 66, 0.1);
}
.atv-s3 .atv-s3-edit-post:hover::after {
    opacity: 1;
    animation: atvS3EditShine 0.8s ease;
}
.atv-s3 .atv-s3-edit-post:focus-visible {
    outline: 2px solid var(--s3-accent);
    outline-offset: 3px;
}
.atv-s3 .atv-s3-edit-post__ic {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 13px;
    font-size: 16px;
    color: #1c1503;
    background: linear-gradient(180deg, #ffd98a, #f0ab22);
    box-shadow: 0 10px 22px -10px rgba(245, 185, 66, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.3s;
}
.atv-s3 .atv-s3-edit-post:hover .atv-s3-edit-post__ic {
    transform: rotate(-8deg) scale(1.05);
}
.atv-s3 .atv-s3-edit-post__tx {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.45;
}
.atv-s3 .atv-s3-edit-post__tx b {
    font-size: 14px;
    font-weight: 800;
    color: var(--s3-text);
}
.atv-s3 .atv-s3-edit-post__tx small {
    font-size: 11.5px;
    color: var(--s3-muted);
}
.atv-s3 .atv-s3-edit-post__tag {
    height: 26px;
    padding: 0 9px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    color: #c4b5fd;
    background: rgba(139, 92, 246, 0.14);
    box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.3);
}
.atv-s3 .atv-s3-edit-post__tag i {
    font-size: 10px;
}
#animetvApp.day .atv-s3 .atv-s3-edit-post {
    box-shadow: 0 12px 26px -18px rgba(15, 23, 42, 0.35);
}
#animetvApp.day .atv-s3 .atv-s3-edit-post__tag {
    color: #6d28d9;
    background: rgba(139, 92, 246, 0.1);
}
@media (prefers-reduced-motion: reduce) {
    .atv-s3 .atv-s3-edit-post:hover::after {
        animation: none;
    }
}
.atv-s3 .atv-s3-poster {
    display: block;
    width: 100%;
    aspect-ratio: 5 / 7;
    border-radius: var(--s3-radius);
    overflow: hidden;
    background: var(--s3-surface);
    border: 1px solid var(--s3-line-soft);
}
.atv-s3 .atv-s3-poster img {
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.atv-s3 .atv-s3-poster:hover img {
    transform: scale(1.03);
}
.atv-s3-poster-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.atv-s3-row {
    display: flex;
    gap: 8px;
}
.atv-s3 .atv-s3-bm {
    flex: 1;
    min-width: 0;
}
.atv-s3 .atv-s3-bm.is-bookmarked {
    background: var(--s3-surface);
    border-color: var(--s3-line);
    color: var(--s3-text);
    font-weight: 600;
}
.atv-s3 .atv-s3-bm.is-bookmarked i {
    color: var(--s3-accent-text);
}
.atv-s3 .atv-s3-bm.is-bookmarked:hover {
    background: var(--s3-surface-2);
}
.atv-s3-react {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.atv-s3 .atv-s3-react-btn {
    height: 42px;
    padding: 0 10px;
    font-weight: 500;
    color: var(--s3-text-2);
}
.atv-s3-react-count {
    color: var(--s3-text);
    font-weight: 700;
}
.atv-s3 .atv-s3-react-btn.is-active {
    background: var(--s3-surface-2);
    border-color: var(--s3-text-2);
    color: var(--s3-text);
}
.atv-s3 .atv-s3-react-btn.is-active i {
    font-weight: 900;
}

/* ---------- Cards ---------- */
.atv-s3-card {
    background: var(--s3-surface);
    border: 1px solid var(--s3-line-soft);
    border-radius: var(--s3-radius);
    padding: 18px;
}
.atv-s3 .atv-s3-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--s3-text-2);
}
.atv-s3-card-count {
    font-size: 12px;
    font-weight: 500;
    color: var(--s3-muted);
}

/* Rating */
.atv-s3-rate {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.atv-s3-rate-top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.atv-s3-rate-score {
    font-size: 38px;
    line-height: 1;
    font-weight: 800;
    color: var(--s3-text);
    font-variant-numeric: tabular-nums;
}
.atv-s3-rate-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.atv-s3-stars {
    display: inline-flex;
    gap: 3px;
    font-size: 14px;
    color: var(--s3-star-off);
}
.atv-s3-stars .is-filled {
    color: var(--s3-accent);
}
.atv-s3-rate-votes {
    font-size: 12px;
    color: var(--s3-muted);
}
.atv-s3-rate-votes strong {
    color: var(--s3-text-2);
    font-weight: 700;
}
.atv-s3-bars {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.atv-s3-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--s3-muted);
}
.atv-s3-bar-lvl {
    width: 12px;
    text-align: center;
}
.atv-s3-bar-track {
    flex: 1;
    height: 4px;
    border-radius: 4px;
    background: var(--s3-surface-2);
    overflow: hidden;
}
.atv-s3-bar-fill {
    display: block;
    height: 100%;
    border-radius: 4px;
    background: var(--s3-text-2);
    transition: width 0.3s ease;
}
.atv-s3-bar-pct {
    width: 34px;
    text-align: left;
    font-variant-numeric: tabular-nums;
}
.atv-s3 #jsOpenRateDrawerBtn.is-rated {
    color: var(--s3-text-2);
    border-style: dashed;
}
.atv-s3-rate-drawer-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--s3-radius-sm);
    border: 1px solid var(--s3-line);
    background: var(--s3-sunken);
}
.atv-s3-rate-drawer-lbl {
    font-size: 12.5px;
    color: var(--s3-text-2);
    white-space: nowrap;
}
.atv-s3-rate-pick {
    display: inline-flex;
    gap: 2px;
    margin-left: auto;
}
.atv-s3 .atv-s3-star-btn {
    width: 32px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--s3-star-off);
    font-size: 17px;
    cursor: pointer;
    transition: color 0.12s, transform 0.12s;
}
.atv-s3 .atv-s3-star-btn:hover,
.atv-s3 .atv-s3-star-btn:hover ~ .atv-s3-star-btn,
.atv-s3 .atv-s3-star-btn.is-filled {
    color: var(--s3-accent);
}
.atv-s3 .atv-s3-star-btn:hover {
    transform: scale(1.12);
}

/* Facts */
.atv-s3-facts {
    padding: 4px 18px;
}
.atv-s3-facts dl {
    margin: 0;
}
.atv-s3-fact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 0;
    border-bottom: 1px solid var(--s3-line-soft);
}
.atv-s3-fact:last-child {
    border-bottom: 0;
}
.atv-s3-fact dt {
    margin: 0;
    font-size: 12.5px;
    font-weight: 500;
    color: var(--s3-muted);
    white-space: nowrap;
}
.atv-s3-fact dd {
    margin: 0;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--s3-text);
    text-align: left;
}
.atv-s3-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--s3-muted);
    flex-shrink: 0;
}
.atv-s3-dot.is-live {
    background: var(--s3-live);
}
.atv-s3-dot.is-stopped {
    background: var(--s3-stop);
}

/* Trailer */
.atv-s3 .atv-s3-trailer i {
    font-size: 11px;
}

/* Relations */
.atv-s3-rel {
    padding: 14px;
}
.atv-s3-rel-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.atv-s3 .atv-s3-rel-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: var(--s3-radius-sm);
    color: var(--s3-text);
    text-decoration: none;
    transition: background-color 0.15s;
}
.atv-s3 .atv-s3-rel-item:hover {
    background: var(--s3-surface-2);
}
.atv-s3 .atv-s3-rel-item img {
    width: 40px;
    height: 56px;
    border-radius: 7px;
    object-fit: cover;
    flex-shrink: 0;
}
.atv-s3-rel-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.55;
}
.atv-s3-rel-badge {
    font-size: 11px;
    color: var(--s3-muted);
}
.atv-s3-rel-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.atv-s3-rel-item > i {
    font-size: 12px;
    color: var(--s3-muted);
}

/* ---------- Main: title, genres, synopsis ---------- */
.atv-s3-head {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.atv-s3 .atv-s3-title {
    margin: 0;
    font-size: clamp(24px, 2.5vw, 36px);
    line-height: 1.3;
    font-weight: 700;
    color: var(--s3-text);
    text-wrap: balance;
    font-family: 'Kalame';
}
.atv-s3 .atv-s3-title.is-latin {
    text-align: right;
}
.atv-s3-genres {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.atv-s3 .atv-s3-chip {
    padding: 3px 14px;
    border-radius: 999px;
    background: var(--s3-surface);
    border: 1px solid var(--s3-line-soft);
    color: var(--s3-text-2);
    font-size: 12.5px;
    line-height: 1.9;
    text-decoration: none;
    transition: color 0.15s, border-color 0.15s;
}
.atv-s3 .atv-s3-chip:hover {
    color: var(--s3-text);
    border-color: var(--s3-line);
}
.atv-s3-alert {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 14px;
    border-radius: var(--s3-radius-sm);
    border: 1px solid var(--s3-line);
    background: var(--s3-surface);
    font-size: 13px;
    color: var(--s3-text-2);
}
.atv-s3-alert i {
    color: var(--s3-stop);
}

.atv-s3-synopsis {
    max-width: 820px;
}
.atv-s3-synopsis-text {
    --s3-syn-line: 2.05em;
    max-height: calc(var(--s3-syn-line) * 3);
    overflow: hidden;
    color: var(--s3-text-2);
    font-size: 14.5px;
    line-height: var(--s3-syn-line);
    -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent);
    mask-image: linear-gradient(to bottom, #000 50%, transparent);
}
.atv-s3-synopsis-text p {
    margin: 0;
}
.atv-s3-synopsis.is-expanded .atv-s3-synopsis-text,
.atv-s3-synopsis.is-short-synopsis .atv-s3-synopsis-text {
    max-height: none;
    -webkit-mask-image: none;
    mask-image: none;
}
.atv-s3-synopsis.is-short-synopsis .atv-s3-synopsis-toggle {
    display: none;
}
.atv-s3 .atv-s3-synopsis-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 0;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--s3-text);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.atv-s3-synopsis-toggle i {
    font-size: 12px;
    transition: transform 0.2s;
}
.atv-s3-synopsis.is-expanded .atv-s3-synopsis-toggle i {
    transform: rotate(180deg);
}

/* ---------- Admin "action tiles" (admin bar design 2) ----------
   Video tools amber, subtitle tools violet. The tiles carry the upload-* / telegram-* hooks of the modals. */
.atv-s3-adm {
    padding: 14px;
    border-radius: 20px;
    border: 1px dashed var(--s3-line);
    background: radial-gradient(500px 160px at 100% 0%, rgba(245, 185, 66, 0.07), transparent 70%), var(--s3-sunken);
}
.atv-s3-adm-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0 4px 12px;
}
.atv-s3-adm-head-ico {
    font-size: 14px;
    color: var(--s3-accent);
}
.atv-s3-adm-head strong {
    font-size: 14px;
    color: var(--s3-text);
}
.atv-s3-adm-lock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--s3-muted);
}
.atv-s3-adm-lock i {
    font-size: 10.5px;
}
.atv-s3-adm-up {
    margin-right: auto;
    height: 28px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--s3-text-2);
    background: var(--s3-surface);
    border: 1px solid var(--s3-line-soft);
}
.atv-s3-adm-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: 10px;
}
.atv-s3 .atv-s3-adm-tile {
    --c: #f5b942;
    --s: rgba(245, 185, 66, 0.12);
    --l: rgba(245, 185, 66, 0.35);
    --g: rgba(245, 185, 66, 0.7);
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 80px;
    padding: 12px 14px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--s3-line-soft);
    background: var(--s3-surface);
    color: var(--s3-text);
    text-decoration: none;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s, box-shadow 0.25s;
}
.atv-s3 .atv-s3-adm-tile.is-sub {
    --c: #b79cff;
    --s: rgba(139, 92, 246, 0.14);
    --l: rgba(167, 139, 250, 0.38);
    --g: rgba(139, 92, 246, 0.75);
}
#animetvApp.day .atv-s3 .atv-s3-adm-tile {
    --c: #a16207;
    --s: rgba(217, 119, 6, 0.1);
    --l: rgba(217, 119, 6, 0.35);
    --g: rgba(217, 119, 6, 0.35);
}
#animetvApp.day .atv-s3 .atv-s3-adm-tile.is-sub {
    --c: #6d28d9;
    --s: rgba(124, 58, 237, 0.09);
    --l: rgba(124, 58, 237, 0.32);
    --g: rgba(124, 58, 237, 0.35);
}
.atv-s3 .atv-s3-adm-tile::after {
    content: "";
    position: absolute;
    left: -40px;
    bottom: -60px;
    width: 170px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(closest-side, var(--g), transparent);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.atv-s3-adm-ic {
    position: relative;
    z-index: 1;
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 18px;
    color: var(--c);
    background: var(--s);
    box-shadow: inset 0 0 0 1px var(--l);
}
.atv-s3-adm-tx {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.55;
}
.atv-s3-adm-tx b {
    font-size: 14px;
    font-weight: 800;
}
.atv-s3-adm-tx small {
    font-size: 12px;
    color: var(--s3-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.atv-s3-adm-tile.has-warn .atv-s3-adm-tx small {
    color: var(--s3-stop);
}
.atv-s3-adm-ar {
    position: relative;
    z-index: 1;
    font-size: 12px;
    color: var(--s3-muted);
    transition: color 0.25s, transform 0.25s;
}
.atv-s3 .atv-s3-adm-tile:focus-visible {
    outline: 2px solid var(--c);
    outline-offset: 2px;
}
@media (hover: hover) {
    .atv-s3 .atv-s3-adm-tile:hover {
        color: var(--s3-text);
        transform: translateY(-3px);
        border-color: var(--l);
        box-shadow: 0 18px 34px -22px rgba(0, 0, 0, 0.9), 0 0 30px -14px var(--g);
    }
    .atv-s3 .atv-s3-adm-tile:hover::after {
        opacity: 0.6;
    }
    .atv-s3 .atv-s3-adm-tile:hover .atv-s3-adm-ar {
        color: var(--c);
        transform: translateX(-3px);
    }
}
@media (max-width: 640px) {
    .atv-s3-adm {
        padding: 12px;
    }
    .atv-s3-adm-lock,
    .atv-s3-adm-ar {
        display: none;
    }
    .atv-s3-adm-up {
        margin-right: 0;
    }
    .atv-s3-adm-tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .atv-s3 .atv-s3-adm-tile {
        min-height: 68px;
        gap: 10px;
        padding: 10px;
    }
    .atv-s3-adm-ic {
        width: 38px;
        height: 38px;
        font-size: 15px;
        border-radius: 12px;
    }
}

/* ---------- Episodes ---------- */
.atv-s3-episodes {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.atv-s3-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
}
.atv-s3 .atv-s3-h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
    color: var(--s3-text);
}
.atv-s3-count {
    font-size: 13px;
    color: var(--s3-muted);
}
.atv-s3-tools {
    margin-right: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.atv-s3 .atv-s3-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 200px;
    max-width: 100%;
    height: 38px;
    margin: 0;
    padding: 0 12px;
    border-radius: var(--s3-radius-sm);
    border: 1px solid var(--s3-line);
    background: var(--s3-surface);
    color: var(--s3-muted);
    font-weight: 400;
    cursor: text;
    transition: border-color 0.15s;
}
.atv-s3 .atv-s3-search:focus-within {
    border-color: var(--s3-text-2);
}
.atv-s3 .atv-s3-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    box-shadow: none;
    color: var(--s3-text);
    font: inherit;
    font-size: 13px;
}
.atv-s3 .atv-s3-search input::placeholder {
    color: var(--s3-muted);
}

/* ---------- VIP box "lock map" (VIP box design 2) ----------
   One cell per episode: green free, grey open for this user, gold locked. "با اشتراک ویژه" turns the locked
   cells gold one by one (.is-preview, toggled by .js-vipmap-mode in animetv-single.js). Stays dark in day mode. */
.atv-s3-vipmap {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px 28px;
    padding: 20px 22px;
    border-radius: 22px;
    overflow: hidden;
    color: #eef0f4;
    border: 1px solid rgba(245, 196, 81, 0.28);
    background: radial-gradient(520px 200px at 100% 0%, rgba(245, 185, 66, 0.14), transparent 70%), linear-gradient(180deg, #1b1a17, #15161c);
    box-shadow: 0 20px 44px -28px rgba(245, 185, 66, 0.55), inset 0 1px 0 rgba(255, 217, 138, 0.12);
}
.atv-s3-vipmap::before {
    content: "";
    position: absolute;
    top: 0;
    right: 40px;
    left: 40%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 217, 138, 0.75), transparent);
}
.atv-s3-vipmap-head {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
.atv-s3-vipmap-ico {
    width: 46px;
    height: 46px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 19px;
    color: #f5c451;
    background: linear-gradient(180deg, rgba(245, 196, 81, 0.22), rgba(245, 196, 81, 0.06));
    box-shadow: inset 0 1px 0 rgba(255, 217, 138, 0.3), inset 0 0 0 1px rgba(245, 196, 81, 0.3), 0 0 26px -8px rgba(245, 185, 66, 0.8);
}
.atv-s3-vipmap-text {
    min-width: 0;
}
.atv-s3 .atv-s3-vipmap-text h3 {
    margin: 0;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    font-size: 17px;
    font-weight: 900;
    line-height: 1.6;
    color: #ffffff;
}
.atv-s3-vipmap-text h3 b {
    color: #ffd98a;
}
.atv-s3-vipmap-text p {
    margin: 2px 0 0;
    font-size: 13px;
    line-height: 1.85;
    color: #aab0bd;
}
.atv-s3-vipmap .is-vip,
.atv-s3-vipmap.is-preview .is-now {
    display: none;
}
.atv-s3-vipmap.is-preview .is-vip {
    display: inline;
}
.atv-s3-vipmap-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.atv-s3-vipmap-seg {
    display: inline-flex;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.atv-s3 .atv-s3-vipmap-seg button {
    height: 34px;
    margin: 0;
    padding: 0 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #aab0bd;
    font: inherit;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s, color 0.25s;
}
.atv-s3 .atv-s3-vipmap-seg button.is-on {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
}
.atv-s3 .atv-s3-vipmap-seg button.is-on[data-mode="vip"] {
    background: linear-gradient(180deg, #ffd98a, #f0ab22);
    color: #1c1503;
}
.atv-s3 .atv-s3-vipmap-seg button:focus-visible,
.atv-s3 .atv-s3-vipmap-buy:focus-visible {
    outline: 2px solid #f5c451;
    outline-offset: 2px;
}
.atv-s3 .atv-s3-vipmap-buy {
    height: 48px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 900;
    color: #1c1503;
    text-decoration: none;
    white-space: nowrap;
    background: linear-gradient(180deg, #ffd98a, #f0ab22);
    box-shadow: 0 16px 34px -14px rgba(245, 185, 66, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.5);
    transition: transform 0.2s;
}
.atv-s3 .atv-s3-vipmap-buy:hover {
    color: #1c1503;
    transform: translateY(-2px);
}
.atv-s3-vipmap-price {
    display: flex;
    flex-direction: column;
    line-height: 1.4;
    font-size: 12px;
    color: #8b92a1;
}
.atv-s3-vipmap-price b {
    font-size: 15px;
    color: #ffd98a;
}
.atv-s3-vipmap-cells {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
    gap: 4px;
}
.atv-s3-vipmap-c {
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 7px;
    font-size: 9px;
    transition: background 0.35s, border-color 0.35s, box-shadow 0.35s, color 0.35s;
}
.atv-s3-vipmap-c.is-free {
    background: rgba(63, 195, 128, 0.16);
    border: 1px solid rgba(63, 195, 128, 0.4);
}
.atv-s3-vipmap-c.is-open {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.atv-s3-vipmap-c.is-lock {
    color: rgba(245, 196, 81, 0.85);
    background: linear-gradient(180deg, rgba(245, 196, 81, 0.16), rgba(245, 196, 81, 0.05));
    border: 1px solid rgba(245, 196, 81, 0.4);
}
.atv-s3-vipmap.is-preview .atv-s3-vipmap-c.is-lock {
    color: #1c1503;
    background: linear-gradient(180deg, #ffd98a, #f0ab22);
    border-color: rgba(255, 230, 170, 0.8);
    box-shadow: 0 0 14px -3px rgba(245, 185, 66, 0.9);
    animation: atvVipPop 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0ms) both;
}
@keyframes atvVipPop {
    0% {
        transform: scale(0.6);
        opacity: 0.3;
    }
    60% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}
.atv-s3-vipmap-leg {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 18px;
    font-size: 12.5px;
    color: #aab0bd;
}
.atv-s3-vipmap-leg span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}
.atv-s3-vipmap-leg i {
    width: 12px;
    height: 12px;
    display: inline-block;
    border-radius: 4px;
}
.atv-s3-vipmap-leg i.is-free {
    background: rgba(63, 195, 128, 0.5);
}
.atv-s3-vipmap-leg i.is-open {
    background: rgba(255, 255, 255, 0.25);
}
.atv-s3-vipmap-leg i.is-lock {
    background: linear-gradient(180deg, #ffd98a, #f0ab22);
}
.atv-s3-vipmap-leg b {
    color: #ffffff;
}
.atv-s3-vipmap-leg .atv-s3-vipmap-range {
    margin-right: auto;
    color: #8b92a1;
}
@media (max-width: 860px) {
    .atv-s3-vipmap {
        grid-template-columns: minmax(0, 1fr);
    }
    .atv-s3-vipmap-cells {
        grid-template-columns: repeat(var(--cols-m), minmax(0, 1fr));
    }
}
@media (max-width: 640px) {
    .atv-s3-vipmap {
        padding: 16px;
        gap: 14px;
    }
    .atv-s3-vipmap-c {
        height: 22px;
    }
    .atv-s3-vipmap-leg .atv-s3-vipmap-range {
        display: none;
    }
}
@media (prefers-reduced-motion: reduce) {
    .atv-s3-vipmap.is-preview .atv-s3-vipmap-c.is-lock {
        animation: none;
    }
}

.atv-s3-ep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr));
    align-items: start;
    gap: 10px;
}
.atv-s3-ep {
    min-width: 0;
    border-radius: var(--s3-radius);
    border: 1px solid var(--s3-line-soft);
    background: var(--s3-surface);
    overflow: hidden;
    transition: border-color 0.15s;
}
.atv-s3-ep:hover,
.atv-s3-ep.is-open {
    border-color: var(--s3-line);
}
.atv-s3-ep-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    cursor: pointer;
    user-select: none;
}
.atv-s3-ep-head:focus-visible {
    outline: 2px solid var(--s3-accent);
    outline-offset: -2px;
    border-radius: var(--s3-radius);
}
.atv-s3-ep-num {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--s3-surface-2);
    color: var(--s3-text);
    font-size: 16px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    transition: background-color 0.15s, color 0.15s;
}
.atv-s3-ep.is-open .atv-s3-ep-num {
    background: var(--s3-text);
    color: var(--s3-bg);
}
.atv-s3-ep-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.5;
}
.atv-s3-ep-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--s3-text);
}
.atv-s3-ep-sub {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    font-size: 12px;
    color: var(--s3-muted);
    white-space: nowrap;
    overflow: hidden;
}
.atv-s3-ep-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--s3-text-2);
}
.atv-s3-ep-status::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--s3-live);
}
.atv-s3-ep-status.is-locked {
    color: var(--s3-muted);
}
.atv-s3-ep-status.is-locked::before {
    display: none;
}
.atv-s3-ep-status.is-locked i {
    font-size: 10px;
}
.atv-s3-ep-date {
    overflow: hidden;
    text-overflow: ellipsis;
}
.atv-s3-ep-date::before {
    content: "·";
    margin-left: 6px;
}
.atv-s3-ep-tools {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 2px;
}
.atv-s3-ep-chevron {
    margin-right: 6px;
    font-size: 14px;
    color: var(--s3-muted);
    transition: transform 0.2s, color 0.15s;
}
.atv-s3-ep.is-open .atv-s3-ep-chevron {
    transform: rotate(180deg);
    color: var(--s3-text);
}
.atv-s3-ep-body {
    border-top: 1px solid var(--s3-line-soft);
}
.atv-s3-ep-body-inner {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
}
.atv-s3-ep-body-inner:empty {
    display: none;
}

.atv-s3-q,
.atv-s3-subrow,
.atv-s3-locked {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 10px;
    padding: 7px 12px 7px 7px;
    border-radius: var(--s3-radius-sm);
}
.atv-s3-q {
    background: var(--s3-sunken);
    border: 1px solid var(--s3-line-soft);
}
.atv-s3-q-label {
    min-width: 50px;
    font-size: 13px;
    font-weight: 800;
    color: var(--s3-text);
    text-align: right;
}
.atv-s3-q-size {
    font-size: 12px;
    color: var(--s3-muted);
}
.atv-s3-q-actions,
.atv-s3-subrow-actions {
    margin-right: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}
.atv-s3-subrow,
.atv-s3-locked {
    border: 1px dashed var(--s3-line);
}
.atv-s3-subrow > i,
.atv-s3-locked > i {
    color: var(--s3-muted);
}
.atv-s3-subrow-text {
    flex: 1 1 180px;
    min-width: 0;
    font-size: 12.5px;
    color: var(--s3-text-2);
}
.atv-s3-subrow-text strong {
    color: var(--s3-text);
    font-weight: 700;
}
.atv-s3-subrow-text em {
    margin-right: 6px;
    font-size: 11.5px;
    font-style: normal;
    color: var(--s3-muted);
}
.atv-s3-locked {
    padding: 10px 12px;
}
.atv-s3-locked p {
    flex: 1 1 220px;
    margin: 0;
    font-size: 12.5px;
    line-height: 1.9;
    color: var(--s3-text-2);
}
/* free episode, guest: sign-in prompt instead of the play / download buttons (2026-11-29) */
.atv-s3-locked.is-login {
    border-style: solid;
    border-color: rgba(95, 224, 166, 0.35);
    background: rgba(95, 224, 166, 0.06);
}
.atv-s3-locked.is-login > i {
    color: #5fe0a6;
}

.atv-s3-more {
    display: flex;
    justify-content: center;
    margin-top: 2px;
}
.atv-s3 .atv-s3-more-btn {
    border-radius: 999px;
    padding: 0 22px;
}
.atv-s3-more-badge {
    font-size: 12px;
    font-weight: 600;
    color: var(--s3-muted);
}
.atv-s3-more-btn .js-ep-more-ico {
    font-size: 12px;
    transition: transform 0.2s;
}
.atv-s3-more-btn.is-expanded .js-ep-more-ico {
    transform: rotate(180deg);
}

.atv-s3-empty {
    padding: 40px 20px;
    border: 1px dashed var(--s3-line);
    border-radius: var(--s3-radius);
    text-align: center;
    color: var(--s3-muted);
}
.atv-s3-empty i {
    display: block;
    margin-bottom: 10px;
    font-size: 28px;
}
.atv-s3 .atv-s3-empty h3 {
    margin: 0 0 4px;
    font-size: 15px;
    color: var(--s3-text);
}
.atv-s3-empty p {
    margin: 0;
    font-size: 13px;
}

/* ---------- Team / translation panels & comments ---------- */
.atv-s3 .atv-s3-back {
    align-self: flex-start;
}
.atv-s3-panel {
    min-width: 0;
    overflow-x: auto;
}
.atv-s3-comments {
    margin-top: 16px;
}

/* ---------- Tablet & phone: one ordered column ---------- */
@media (max-width: 980px) {
    .atv-s3-layout {
        display: grid;
        grid-template-columns: clamp(108px, 24vw, 170px) minmax(0, 1fr);
        column-gap: 16px;
        row-gap: 14px;
        align-items: start;
    }
    .atv-s3-side,
    .atv-s3-main,
    .atv-s3-poster-block {
        display: contents;
    }
    .atv-s3 .atv-s3-poster {
        order: 1;
        grid-column: 1;
    }
    .atv-s3-head {
        order: 2;
        grid-column: 2;
        align-self: center;
    }
    .atv-s3-synopsis {
        order: 3;
    }
    .atv-s3-poster-actions {
        order: 4;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .atv-s3-rate {
        order: 5;
    }
    .atv-s3-facts {
        order: 6;
    }
    .atv-s3 .atv-s3-trailer {
        order: 7;
    }
    .atv-s3-rel {
        order: 8;
    }
    .atv-s3-body {
        order: 9;
        margin-top: 10px;
    }
    .atv-s3-synopsis,
    .atv-s3-poster-actions,
    .atv-s3-rate,
    .atv-s3-facts,
    .atv-s3 .atv-s3-trailer,
    .atv-s3-rel,
    .atv-s3-body {
        grid-column: 1 / -1;
    }
    .atv-s3-rate {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 14px 24px;
    }
    .atv-s3-rate > .atv-s3-rate-top {
        flex: 0 0 auto;
    }
    .atv-s3-rate > .atv-s3-bars {
        flex: 1 1 220px;
    }
    .atv-s3-rate > .atv-s3-rate-cta,
    .atv-s3-rate > .atv-s3-rate-drawer {
        flex: 1 1 100%;
    }
    .atv-s3-facts dl {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 24px;
    }
    .atv-s3-fact:nth-last-child(2) {
        border-bottom: 0;
    }
}

@media (max-width: 640px) {
    .atv-s3 {
        padding-top: 16px;
    }
    .atv-s3-crumbs {
        margin-bottom: 14px;
    }
    .atv-s3-poster-actions {
        grid-template-columns: minmax(0, 1fr);
    }
    .atv-s3-fact {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        gap: 2px;
        padding: 10px 0;
    }
    .atv-s3-fact dd {
        text-align: right;
    }
    .atv-s3-tools {
        width: 100%;
        margin-right: 0;
    }
    .atv-s3 .atv-s3-search {
        flex: 1 1 100%;
        width: auto;
    }
    .atv-s3-tools .atv-s3-btn {
        flex: 1 1 0;
    }
    .atv-s3-q-actions,
    .atv-s3-subrow-actions {
        margin-right: 0;
        width: 100%;
    }
    .atv-s3-q-actions .atv-s3-btn {
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .atv-s3 *,
    .atv-s3 *::before {
        transition: none !important;
    }
}
