/* ═════════════════════════════════════════════════════════
   ویدورا (Vidora) — استایل سایت
   تم تیتانیومی مشکی و طلایی · راست‌چین · فونت وزیرمتن · واکنش‌گرا
   ═════════════════════════════════════════════════════════ */

@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/Vazirmatn-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/Vazirmatn-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/Vazirmatn-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Vazirmatn';
    src: url('/assets/fonts/Vazirmatn-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ─────────────── توکن‌های طراحی ─────────────── */

:root {
    --bg: #0a0a0c;
    --bg-soft: #101012;
    --surface: #17171a;
    --surface-2: #1f1f24;
    --surface-3: #2a2a31;
    --line: rgba(255, 244, 214, 0.07);
    --line-2: rgba(255, 244, 214, 0.14);

    --text: #f7f5f0;
    --text-2: #c6c2b8;
    --text-3: #8c8880;

    --brand: #c9962f;
    --brand-2: #f7e7ae;
    --brand-3: #e8c96a;
    --brand-soft: rgba(201, 150, 47, 0.15);

    --ok: #34d399;
    --radius: 16px;
    --radius-s: 11px;

    --topbar-h: 60px;

    --ease: cubic-bezier(0.25, 0.7, 0.3, 1);
    --tr: 170ms var(--ease);

    --shadow-1: 0 2px 10px rgba(0, 0, 0, 0.4);
    --shadow-2: 0 14px 44px rgba(0, 0, 0, 0.6);

    --content-w: 1360px;
}

/* ─────────────── پایه ─────────────── */

*, *::before, *::after { box-sizing: border-box; }

html {
    overflow-x: clip;
    scrollbar-color: #3a3a40 transparent;
}

body {
    margin: 0;
    overflow-x: clip;
    min-height: 100dvh;
    background:
        radial-gradient(1100px 480px at 88% -12%, rgba(201, 150, 47, 0.075), transparent 62%),
        radial-gradient(900px 420px at 6% -8%, rgba(247, 231, 174, 0.045), transparent 58%),
        radial-gradient(700px 500px at 50% 118%, rgba(184, 134, 11, 0.05), transparent 65%),
        var(--bg);
    color: var(--text);
    font-family: 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
    font-size: 15px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; -webkit-user-drag: none; }
.card-media img { user-select: none; }
button { font-family: inherit; cursor: pointer; }
input { font-family: inherit; }
h1, h2, h3 { line-height: 1.6; }
::selection { background: var(--brand-soft); }

::-webkit-scrollbar { width: 10px; height: 8px; }
::-webkit-scrollbar-thumb { background: #30303a; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #3d3d49; }
::-webkit-scrollbar-track { background: transparent; }

.dot { color: var(--text-3); }
.letter-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: hsl(var(--hue, 260) 42% 36%);
    color: #fff;
    font-weight: 700;
}

/* ─────────────── نوار بالا ─────────────── */

.topbar {
    position: fixed;
    inset-inline: 0;
    top: 0;
    z-index: 120;
    background: rgba(10, 10, 12, 0.82);
    backdrop-filter: blur(16px) saturate(1.3);
    -webkit-backdrop-filter: blur(16px) saturate(1.3);
    border-bottom: 1px solid var(--line);
}

.topbar-inner {
    display: flex;
    align-items: center;
    gap: clamp(8px, 2vw, 20px);
    height: var(--topbar-h);
    max-width: var(--content-w);
    margin: 0 auto;
    padding: 0 clamp(10px, 2.5vw, 22px);
}

.topbar-start { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--text-2);
    transition: background var(--tr), color var(--tr);
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.logo { display: inline-flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 12px; }
.logo:hover { background: var(--surface); }

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 25px;
    border-radius: 9px 9px 9px 3px;
    background: linear-gradient(135deg, var(--brand) 10%, var(--brand-3) 55%, var(--brand-2) 100%);
    color: #1a1405;
    box-shadow: 0 4px 18px rgba(201, 150, 47, 0.4);
}

.logo-text {
    font-size: 19px;
    font-weight: 800;
    background: linear-gradient(92deg, #fff 35%, #f4e3ae 70%, var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ــ جستجو ــ */

.searchbar {
    position: relative;
    flex: 1 1 480px;
    max-width: 640px;
    margin-inline-start: auto;
}

.searchbar-box {
    position: relative;
    display: flex;
    align-items: center;
    height: 46px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    transition: border-color var(--tr), box-shadow var(--tr);
}
.searchbar-box:focus-within {
    border-color: rgba(201, 150, 47, 0.6);
    box-shadow: 0 0 0 4px var(--brand-soft);
}

.searchbar-box input {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    outline: 0;
    color: var(--text);
    font-size: 14.5px;
    padding: 0 18px;
}
.searchbar-box input::placeholder { color: var(--text-3); }
.searchbar-box input::-webkit-search-cancel-button { -webkit-appearance: none; }

.searchbar-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 100%;
    border: 0;
    border-inline-start: 1px solid var(--line);
    border-start-start-radius: 0;
    border-end-start-radius: 0;
    border-start-end-radius: 999px;
    border-end-end-radius: 999px;
    background: var(--surface-2);
    color: var(--text-3);
    transition: background var(--tr), color var(--tr);
}
.searchbar-btn:hover { background: var(--surface-3); color: var(--text); }

/* ــ پیشنهادهای جستجو ــ */

.suggest {
    position: absolute;
    top: calc(100% + 8px);
    inset-inline: 0;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 14px;
    box-shadow: var(--shadow-2);
    padding: 6px;
    z-index: 130;
}

.suggest-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 13px;
    border-radius: 9px;
    color: var(--text-2);
    font-size: 14px;
    cursor: pointer;
    /* جهت متن هر آیتم خودکار است (dir=auto در JS) */
}
.suggest-item svg { flex: 0 0 auto; opacity: 0.55; }
.suggest-item:hover, .suggest-item.is-active { background: var(--surface-3); color: var(--text); }

/* ─────────────── بدنه‌ی محتوا ─────────────── */

.main {
    max-width: var(--content-w);
    margin: 0 auto;
    padding: calc(var(--topbar-h) + clamp(14px, 2.5vw, 28px)) clamp(12px, 3vw, 26px) 80px;
    min-height: 100dvh;
}

.page-home .main {
    display: flex;
    align-items: center;
    justify-content: center;
}
.page-notfound .main,
.page-error .main {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ─────────────── صفحه‌ی خانه ─────────────── */

.home { width: min(640px, 92vw); text-align: center; padding: 20px 0; }

.home-logo { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 38px; }

.home-logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 58px;
    border-radius: 22px 22px 22px 6px;
    background: linear-gradient(135deg, var(--brand) 10%, var(--brand-3) 55%, var(--brand-2) 100%);
    color: #1a1405;
    box-shadow: 0 18px 60px rgba(201, 150, 47, 0.38), 0 6px 24px rgba(247, 231, 174, 0.14);
    animation: float 5s ease-in-out infinite;
}
@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-7px) rotate(-1.5deg); }
}

.home-logo-text {
    font-size: clamp(38px, 8vw, 58px);
    font-weight: 800;
    background: linear-gradient(94deg, #fff 30%, #f4e3ae 60%, var(--brand-3) 80%, var(--brand-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    filter: drop-shadow(0 0 26px rgba(201, 150, 47, 0.4));
}

.home-search-box, .nf-search .home-search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    height: 62px;
    padding-inline: 0 10px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    color: var(--text-3);
    box-shadow: var(--shadow-1);
    transition: border-color var(--tr), box-shadow var(--tr);
}
.home-search-box:focus-within {
    border-color: rgba(201, 150, 47, 0.6);
    box-shadow: 0 0 0 5px var(--brand-soft), var(--shadow-1);
}
.home-search-box svg { flex: 0 0 auto; margin-inline-start: 18px; }

.home-search-box input {
    flex: 1;
    min-width: 0;
    background: none;
    border: 0;
    outline: 0;
    color: var(--text);
    font-size: 16px;
}
.home-search-box input::placeholder { color: var(--text-3); }

.home-search-box button {
    flex: 0 0 auto;
    height: 46px;
    padding: 0 30px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    transition: filter var(--tr), transform var(--tr);
}
.home-search-box button:hover { filter: brightness(1.12); }
.home-search-box button:active { transform: scale(0.96); }

.home-tag { margin: 26px 0 0; color: var(--text-3); font-size: 13.5px; }

/* ─────────────── نتایج جستجو ─────────────── */

.results-head { margin-bottom: 22px; }
.results-title { margin: 0 0 14px; font-size: 16.5px; font-weight: 600; color: var(--text-2); }
.accent { color: var(--text); font-weight: 700; }

.type-tabs {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
    border-bottom: 1px solid var(--line);
}
.type-tabs::-webkit-scrollbar { display: none; }

.type-tab {
    flex: 0 0 auto;
    padding: 9px 17px;
    color: var(--text-3);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px;
    transition: color var(--tr);
}
.type-tab:hover { color: var(--text); }
.type-tab.is-active { color: var(--text); border-color: var(--brand); font-weight: 700; }

.results-list { display: flex; flex-direction: column; gap: 22px; }

/* حالت لیستی نتایج جستجو */
.results-list .card {
    display: grid;
    grid-template-columns: minmax(240px, 380px) minmax(0, 1fr);
    gap: 4px 18px;
}
.results-list .card-media { align-self: start; }
.results-list .card-title { font-size: 16.5px; }
.results-list .card-channel { font-size: 13.5px; }
.results-list .card-meta { font-size: 13px; }

/* ─────────────── کارت‌ها ─────────────── */

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
    gap: 26px 18px;
}
.card-grid--pl { grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }

.card { display: flex; flex-direction: column; min-width: 0; }

.card-media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    outline-offset: 3px;
}
.card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 340ms var(--ease);
}
.card:hover .card-media img { transform: scale(1.05); }

.badge-dur {
    position: absolute;
    bottom: 9px;
    inset-inline-end: 9px;
    padding: 2px 8px;
    border-radius: 7px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    direction: ltr;
    unicode-bidi: isolate;
}
.badge-dur--live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--brand);
}
.badge-dur--live::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    animation: blink 1.3s infinite;
}
@keyframes blink { 50% { opacity: 0.3; } }

.badge-mix {
    position: absolute;
    top: 9px;
    inset-inline-start: 9px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.82);
    color: #ffd9a8;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.card--mix .card-title a { color: #ffd9a8; }
.card--mix .card-title a:hover { color: #ffe9cd; }

.badge-stack {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 30px 13px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: #fff;
    font-size: 13px;
    font-weight: 600;
}

.card-body { padding: 11px 2px 0; }
.card-title {
    margin: 0;
    font-size: 14.5px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card-title a:hover { color: #fff; }
.card-channel { margin-top: 3px; color: var(--text-3); font-size: 13px; }
.card-channel a:hover { color: var(--text-2); }
.card-meta { margin-top: 1px; color: var(--text-3); font-size: 12.5px; }
.card-desc {
    margin-top: 7px;
    color: var(--text-3);
    font-size: 12.5px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ــ کارت کانال ــ */

.card--channel {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 18px 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    transition: background var(--tr), border-color var(--tr);
}
.card--channel:hover { background: var(--surface-2); border-color: var(--line-2); }

.chc-avatar {
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--surface-2);
}
.chc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chc-avatar .letter-avatar { width: 100%; height: 100%; font-size: 36px; }
.chc-text { min-width: 0; text-align: right; }
.chc-text .card-title { font-size: 16px; -webkit-line-clamp: 1; }
.chc-text .card-desc { margin-top: 6px; }

/* ─────────────── کارت فیلم کوتاه ─────────────── */

.scard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(168px, 100%), 1fr));
    gap: 20px 14px;
}

/* گرید شورت‌ها داخل نتایج جستجو (بارگذاری بیشتر صفحه «همه») */
.scard-grid--search {
    grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr));
    gap: 18px 12px;
}

.scard { min-width: 0; }

.scard-media {
    position: relative;
    display: block;
    aspect-ratio: 9 / 16;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface);
    outline-offset: 3px;
}
.scard-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 340ms var(--ease); }
.scard:hover .scard-media img { transform: scale(1.06); }

.scard-views {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 26px 11px 9px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    color: #fff;
    font-size: 12.5px;
    font-weight: 600;
}

.scard-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: 9px;
    font-size: 13.5px;
    font-weight: 500;
    line-height: 1.6;
    color: var(--text-2);
}
.scard:hover .scard-title { color: var(--text); }

.shelf-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 18px;
    font-size: 18px;
    font-weight: 700;
    color: var(--brand);
}

/* ─────────────── صفحه تماشا ─────────────── */

.watch {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(320px, 30%, 412px);
    gap: clamp(16px, 2.4vw, 28px);
    align-items: start;
}

.watch-main { min-width: 0; }

.player-frame {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
}
#player { width: 100%; aspect-ratio: 16 / 9; }

.player-boot {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-2);
    font-size: 14px;
    background: radial-gradient(420px 240px at 50% 42%, #17171c, #0a0a0c);
    transition: opacity 320ms;
}
.player-boot.is-hidden { opacity: 0; pointer-events: none; }
.player-boot p { margin: 0; }
.player-boot .boot-error { color: #ff949c; }

.watch-title { margin: 16px 0 8px; font-size: clamp(17px, 2vw, 20px); font-weight: 700; }

.watch-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 4px 0 6px;
    min-width: 0;
}

.watch-chip {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    flex: 0 1 auto;
    min-width: 0;
    max-width: min(480px, 100%);
    padding: 10px 22px 10px 10px;
    border-radius: var(--radius-s);
    background: var(--surface);
    border: 1px solid var(--line-2);
    box-shadow: var(--shadow-1);
    transition: background var(--tr), border-color var(--tr);
}
.watch-chip:hover { background: var(--surface-2); border-color: rgba(255, 61, 78, 0.45); }

.watch-chip-avatar {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--surface-3);
}
span.watch-chip-avatar { display: inline-flex; font-size: 20px; }

.watch-chip-text { display: flex; flex-direction: column; min-width: 0; max-width: 100%; }
.watch-chip-name {
    font-weight: 700;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.watch-chip-subs {
    color: var(--text-3);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.watch-stats {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-inline-start: auto;
    color: var(--text-2);
    font-size: 13.5px;
    flex-wrap: wrap;
}

/* ــ توضیحات ــ */

.watch-desc {
    margin-top: 12px;
    padding: 13px 17px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    font-size: 13.8px;
}
.watch-desc-inner {
    max-height: 88px;
    overflow: hidden;
    white-space: pre-line;
    word-break: break-word;
    transition: max-height 300ms var(--ease);
}
.watch-desc.is-open .watch-desc-inner { max-height: none; }
.watch-desc-inner a { color: #8ab8ff; }

/* دکمه‌ی پرش تایم‌استمپ در توضیحات */
.watch-desc-inner .ts {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line-2);
    border-radius: 7px;
    background: var(--surface-3);
    color: var(--text-2);
    padding: 0 7px;
    margin: 0 2px;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.3px;
    direction: ltr;
    unicode-bidi: isolate;
    line-height: 1.9;
    cursor: pointer;
    transition: color var(--tr), border-color var(--tr), background var(--tr);
}
.watch-desc-inner .ts:hover {
    color: var(--brand);
    border-color: var(--brand);
    background: var(--brand-soft);
}
.watch-desc-toggle {
    display: block;
    margin-top: 7px;
    padding: 0;
    background: none;
    border: 0;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 700;
}
.watch-desc-toggle:hover { color: var(--text); }

/* ــ ستون کناری تماشا ــ */

.watch-side { min-width: 0; }
.related-title { margin: 0 0 13px; font-size: 15.5px; font-weight: 700; }
.related-list { display: flex; flex-direction: column; gap: 11px; }

.related-list .card {
    display: grid;
    grid-template-columns: minmax(140px, 172px) minmax(0, 1fr);
    gap: 0 11px;
}
.related-list .card-media { border-radius: var(--radius-s); }
.related-list .card-body { padding: 0; align-self: center; }
.related-list .card-title { font-size: 13.5px; }
.related-list .card-channel { font-size: 12px; margin-top: 2px; }
.related-list .card-meta { font-size: 11.5px; }

/* ــ پنل پلی‌لیست داخل تماشا ــ */

.plpanel {
    margin-bottom: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}
.plpanel-head { padding: 13px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.plpanel-head h2 { margin: 0 0 3px; font-size: 14.5px; font-weight: 700; }
.plpanel-link { color: var(--text-3); font-size: 12.5px; }
.plpanel-link:hover { color: var(--brand); }

.plpanel-list { list-style: none; margin: 0; padding: 6px; max-height: 430px; overflow-y: auto; }
.plpanel-item a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
    border-radius: var(--radius-s);
    transition: background var(--tr);
}
.plpanel-item a:hover { background: var(--surface-2); }
.plpanel-item.is-current a { background: var(--brand-soft); }
.plpanel-item.is-current .plpanel-title { color: var(--brand); }

.plpanel-index {
    flex: 0 0 24px;
    display: inline-flex;
    justify-content: center;
    color: var(--text-3);
    font-size: 12px;
    direction: ltr;
}
.plpanel-thumb {
    flex: 0 0 94px;
    width: 94px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    background: var(--surface-3);
}
.plpanel-text { min-width: 0; display: flex; flex-direction: column; }
.plpanel-title {
    font-size: 12.8px;
    font-weight: 500;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.plpanel-dur { color: var(--text-3); font-size: 11px; direction: ltr; text-align: end; }

/* ─────────────── نمایشگر فیلم کوتاه ─────────────── */

.shortview {
    display: grid;
    grid-template-columns: minmax(0, 420px) minmax(0, 1fr);
    gap: clamp(18px, 3vw, 40px);
    justify-content: center;
    align-items: start;
}

.shortview-stage {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin-inline: auto;
}

.shortview-player {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background: #000;
    border: 1px solid var(--line);
    box-shadow: var(--shadow-2);
}
.shortview-player #player {
    aspect-ratio: 9 / 16;
    max-height: calc(100dvh - var(--topbar-h) - 40px);
    margin-inline: auto;
}

.shortview-nav {
    position: absolute;
    inset-inline-end: calc(100% + 14px);
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shortview-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--text-2);
    box-shadow: var(--shadow-1);
    transition: background var(--tr), color var(--tr), transform var(--tr);
}
.shortview-nav-btn:hover { background: var(--surface-3); color: var(--text); transform: scale(1.06); }
.shortview-nav-btn.is-disabled { opacity: 0.3; pointer-events: none; }

.shortview-info { min-width: 0; }
.shortview-title { margin: 0 0 12px; font-size: 17px; font-weight: 700; }
.shortview-meta .watch-stats { margin: 12px 0 0; }
.shortview-meta .watch-chip { max-width: 100%; }

.shortview-rail { margin-top: 30px; }
.shortview-rail h2 { margin: 0 0 15px; font-size: 15.5px; font-weight: 700; }

/* ─────────────── صفحه کانال ─────────────── */

.chhead { margin-bottom: 26px; }

.chhead-banner {
    aspect-ratio: 6.2 / 1;
    min-height: 80px;
    max-height: 180px;
    margin-bottom: 18px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
}
.chhead-banner img { width: 100%; height: 100%; object-fit: cover; }

.chhead-row { display: flex; align-items: center; gap: clamp(14px, 2.5vw, 24px); flex-wrap: wrap; }

.chhead-avatar {
    flex: 0 0 auto;
    width: clamp(84px, 10vw, 120px);
    height: clamp(84px, 10vw, 120px);
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--surface-3);
}
span.chhead-avatar { display: inline-flex; font-size: 42px; }

.chhead-meta { flex: 1; min-width: min(100%, 260px); text-align: right; }
.chhead-name { margin: 0 0 4px; font-size: clamp(20px, 3vw, 26px); font-weight: 800; }
.chhead-stats { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--text-3); font-size: 13.5px; }
.chhead-desc { margin: 7px 0 0; color: var(--text-3); font-size: 13px; max-width: 700px; }

.chhead-tabs {
    display: flex;
    gap: 4px;
    margin-top: 20px;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    scrollbar-width: none;
}
.chhead-tabs::-webkit-scrollbar { display: none; }

.chtab {
    flex: 0 0 auto;
    padding: 10px 18px;
    color: var(--text-3);
    font-size: 14.5px;
    font-weight: 500;
    border-bottom: 2.5px solid transparent;
    margin-bottom: -1px;
    transition: color var(--tr);
}
.chtab:hover { color: var(--text); }
.chtab.is-active { color: var(--text); border-color: var(--brand); font-weight: 700; }

.channel-shorts { margin-top: 6px; }

/* ─────────────── صفحه پلی‌لیست ─────────────── */

.plview {
    display: grid;
    grid-template-columns: clamp(280px, 30%, 356px) minmax(0, 1fr);
    gap: clamp(18px, 2.6vw, 30px);
    align-items: start;
}

.plview-info { text-align: right;
    position: sticky;
    top: calc(var(--topbar-h) + 16px);
    padding: 20px;
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.plview-cover {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-s);
    overflow: hidden;
    border: 1px solid var(--line);
    margin-bottom: 15px;
}
.plview-cover img { width: 100%; height: 100%; object-fit: cover; }

.plview-title { margin: 0 0 10px; font-size: 18.5px; font-weight: 800; text-align: right; }

.plview-owner { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); }
.plview-owner a:hover { color: var(--text); }
.plview-owner-avatar { width: 27px; height: 27px; border-radius: 50%; object-fit: cover; }

.plview-stats { display: flex; gap: 8px; flex-wrap: wrap; color: var(--text-3); font-size: 13px; margin-top: 7px; }

.btn-play {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 17px;
    padding: 11px 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(255, 61, 78, 0.3);
    transition: filter var(--tr), transform var(--tr);
}
.btn-play:hover { filter: brightness(1.1); color: #fff; }
.btn-play:active { transform: scale(0.97); }

.plview-desc { margin: 16px 0 0; color: var(--text-3); font-size: 13px; line-height: 1.95; }

.plrow + .plrow { border-top: 1px solid var(--line); }
.plrow-link {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 9px 7px;
    border-radius: var(--radius-s);
    transition: background var(--tr);
}
.plrow-link:hover { background: var(--surface); }

.plrow-index {
    flex: 0 0 26px;
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
    direction: ltr;
}

.plrow-thumb {
    position: relative;
    flex: 0 0 clamp(120px, 14vw, 158px);
    aspect-ratio: 16 / 9;
    border-radius: 9px;
    overflow: hidden;
    background: var(--surface-2);
    border: 1px solid var(--line);
}
.plrow-thumb img { width: 100%; height: 100%; object-fit: cover; }
.plrow-dur {
    position: absolute;
    bottom: 5px;
    inset-inline-end: 5px;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    direction: ltr;
}

.plrow-text { min-width: 0; display: flex; flex-direction: column; }
.plrow-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.plrow-channel { margin-top: 2px; color: var(--text-3); font-size: 12.5px; }

/* ─────────────── ۴۰۴ و خطا ─────────────── */

.nf { width: min(620px, 92vw); text-align: center; padding: 30px 0; }
.nf-art { display: flex; justify-content: center; margin-bottom: 6px; }
.nf-code {
    font-size: clamp(70px, 14vw, 110px);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: 2px;
    color: transparent;
    -webkit-text-stroke: 2px #3a3a46;
}
.nf-code--err {
    width: 92px;
    height: 92px;
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    -webkit-text-stroke: 0;
    font-size: 46px;
}
.nf-title { margin: 6px 0 8px; font-size: clamp(20px, 4vw, 26px); font-weight: 800; }
.nf-text { margin: 0 0 26px; color: var(--text-2); font-size: 15px; }

.nf-search { margin-bottom: 24px; }
.nf-search .home-search-box { height: 56px; }

.nf-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

.btn-solid {
    display: inline-flex;
    align-items: center;
    padding: 11px 30px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    transition: filter var(--tr), transform var(--tr);
}
.btn-solid:hover { filter: brightness(1.1); color: #fff; }
.btn-solid:active { transform: scale(0.97); }

.btn-ghost {
    display: inline-flex;
    align-items: center;
    padding: 11px 28px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line-2);
    color: var(--text);
    font-size: 14.5px;
    font-weight: 600;
    transition: background var(--tr), border-color var(--tr);
}
.btn-ghost:hover { background: var(--surface-2); border-color: var(--brand); color: var(--brand); }

/* ─────────────── حالت خالی / لودر / توست ─────────────── */

.empty { text-align: center; padding: 70px 16px; color: var(--text-3); font-size: 15px; }

.loadmore { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 30px 0 6px; }

.loader { display: flex; justify-content: center; padding: 14px; }

.spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--surface-3);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
    position: fixed;
    bottom: 26px;
    inset-inline-start: 50%;
    transform: translate(50%, 18px);
    z-index: 300;
    max-width: min(90vw, 460px);
    padding: 12px 26px;
    background: var(--surface-3);
    border: 1px solid var(--line-2);
    border-radius: 999px;
    box-shadow: var(--shadow-2);
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms, transform 240ms;
}
.toast.is-visible { opacity: 1; transform: translate(50%, 0); }

/* ─────────────── واکنش‌گرایی ─────────────── */

@media (max-width: 1250px) {
    .watch { grid-template-columns: minmax(0, 1fr); }
    .watch-side { max-width: 760px; }
    .shortview { grid-template-columns: minmax(0, 1fr); }
    .shortview-stage { max-width: min(420px, 86vw); }
    .shortview-nav {
        inset-inline: auto calc(50% - 270px);
        inset-inline-end: auto;
        inset-inline-start: calc(50% + 230px);
    }
}

@media (max-width: 700px) {
    :root { --topbar-h: 62px; }

    .topbar-inner { height: var(--topbar-h); gap: 10px; }
    .logo-text { display: none; }
    .searchbar { flex: 1 1 auto; max-width: none; margin-inline-start: 0; }
    .searchbar-box { height: 42px; }
    .searchbar-box input { padding: 0 13px; font-size: 13.5px; }
    .searchbar-btn { width: 46px; }

    .results-list .card {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
    .results-list .card-title { font-size: 14.5px; }

    .card-grid { grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); gap: 18px 10px; }
    .card-title { font-size: 13px; }

    .scard-grid { grid-template-columns: repeat(auto-fill, minmax(min(130px, 100%), 1fr)); gap: 14px 9px; }

    .watch-title { font-size: 16px; }
    .watch-stats { margin-inline-start: 0; width: 100%; }

    .related-list .card { grid-template-columns: minmax(120px, 150px) minmax(0, 1fr); gap: 0 9px; }
    .related-list .card-title { font-size: 12.8px; }

    .shortview-nav {
        inset-inline: auto;
        inset-inline-start: calc(50% + 200px);
        top: auto;
        bottom: 18px;
        transform: none;
    }

    .chhead-row { gap: 12px; }
    .plrow-index { display: none; }

    .logo-text { font-size: 19px; }
    .home-logo { gap: 11px; margin-bottom: 28px; }
    .home-logo-mark { width: 58px; height: 46px; border-radius: 17px 17px 17px 5px; }
    .home-search-box { height: 54px; }
    .home-search-box button { padding: 0 20px; height: 40px; font-size: 14px; }
}

@media (max-width: 400px) {
    .shortview-nav { inset-inline-start: auto; inset-inline-end: 12px; bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* نشان کانال تأییدشده / هنرمند رسمی */
.vbadge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-inline-start: 5px;
    color: #a8adb8;
    vertical-align: -2px;
    flex: 0 0 auto;
}
.vbadge--artist { color: #e6c07b; }
.vbadge svg { width: 14px; height: 14px; }
.chhead-name .vbadge svg { width: 20px; height: 20px; }
.watch-chip-name .vbadge svg { width: 15px; height: 15px; }
.card-channel .vbadge svg { width: 12.5px; height: 12.5px; }
