
:root {
    --bg-dark: #090a0f;
    --card-bg: #11131a;
    --text-light: #ffffff;
    --text-gray: #8892b0;
    --accent-red: #e50914;
    --accent-gold: #f1c40f;
    --transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', sans-serif; }
body { background-color: var(--bg-dark); color: var(--text-light); line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

.animated-bg {
    background: linear-gradient(-45deg, #090a0f, #150d1c, #090a0f, #1c0811);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
}
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

.rgb-text {
    background: linear-gradient(to right, var(--accent-red), var(--accent-gold), var(--accent-red));
    background-size: 200% auto;
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
    animation: shine 3s linear infinite;
    font-weight: 900;
}
@keyframes shine { to { background-position: 200% center; } }

/* الترويسة */
.main-header {
    display: flex; justify-content: space-between; align-items: center; width: 100%;
    box-sizing: border-box; padding: 15px 5%; background-color: #151a22;
    border-bottom: 1px solid #252e3b; position: relative; z-index: 1000;
}
.logo { font-size: 24px; font-weight: bold; letter-spacing: 1px; white-space: nowrap; }
nav { display: flex; gap: 20px; }
nav a { color: var(--text-light); text-decoration: none; font-size: 16px; font-weight: 700; transition: all 0.3s ease; }
nav a:hover, nav a.active { color: var(--accent-gold); text-shadow: 0 0 10px rgba(241, 196, 15, 0.5); }
.close-btn { display: none; font-size: 35px; cursor: pointer; color: var(--accent-red); align-self: flex-start; margin-bottom: 20px; user-select: none; }
.menu-icon { display: none; font-size: 30px; cursor: pointer; color: #ffffff; padding: 5px 10px; user-select: none; z-index: 1001; }

.section-padding { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 50px; font-size: 2.2rem; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }

.video-card { background: var(--card-bg); padding: 15px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.05); text-align: center; transition: var(--transition); }
.video-card:hover { transform: translateY(-5px); border-color: rgba(229, 9, 20, 0.5); box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 15px rgba(229, 9, 20, 0.2); }
.video-card h3 { margin: 15px 0; font-size: 1.1rem; color: #e2e8f0; }

.download-buttons-holder { display: flex; flex-direction: column; gap: 10px; margin-top: 15px; }
.download-btn { display: block; padding: 12px; text-decoration: none; border-radius: 4px; font-weight: 700; font-size: 13px; transition: all 0.3s ease; position: relative; overflow: hidden; letter-spacing: 0.5px; text-align: center; }
.download-btn.btn-subs { background: #161b22; color: #c9d1d9; border: 1px solid rgba(255,255,255,0.1); }
.download-btn.btn-no-subs { background: #0d1117; color: var(--text-gray); border: 1px solid rgba(255,255,255,0.05); }
.comp-btn { background: rgba(241, 196, 15, 0.1); border: 1px solid var(--accent-gold); color: var(--accent-gold); }
.download-btn:hover { color: #fff; border-color: transparent; box-shadow: 0 0 15px rgba(229, 9, 20, 0.4), 0 0 15px rgba(241, 196, 15, 0.2); }

.smart-thumbnail { width: 100%; height: 180px; border-radius: 4px; position: relative; overflow: hidden; cursor: pointer; background: #000; }
.smart-thumbnail img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; transition: var(--transition); }
.smart-thumbnail:hover img { opacity: 0.3; transform: scale(1.1); }

.play-overlay { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); background: rgba(10, 10, 15, 0.7); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.1); color: var(--text-light); padding: 10px 25px; border-radius: 4px; font-weight: 800; opacity: 0; transition: var(--transition); }
.smart-thumbnail:hover .play-overlay { opacity: 1; border-color: var(--accent-red); box-shadow: 0 0 20px rgba(229, 9, 20, 0.6); }

.video-wrapper { position: relative; width: 100%; padding-top: 56.25%; background: #000; border-radius: 4px; overflow: hidden; border: 1px solid rgba(255,255,255,0.05); }
.video-wrapper iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.server-tabs-container { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 20px; padding: 10px; background: rgba(0, 0, 0, 0.4); border-radius: 4px; border: 1px solid rgba(255,255,255,0.05); }
.server-btn { background: #161b22; color: #c9d1d9; border: 1px solid rgba(255,255,255,0.1); padding: 8px 18px; border-radius: 4px; cursor: pointer; font-weight: 700; font-size: 13px; transition: all 0.3s ease; }
.server-btn:hover { border-color: var(--accent-gold); color: #fff; box-shadow: 0 0 10px rgba(241, 196, 15, 0.2); }
.server-btn.active { background: rgba(229, 9, 20, 0.1); border-color: var(--accent-red); color: #fff; }

.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(5px); }
.modal-content { background: var(--card-bg); border-radius: 6px; padding: 30px; text-align: center; width: 90%; max-width: 450px; border: 1px solid rgba(255,255,255,0.1); box-shadow: 0 20px 50px rgba(0,0,0,0.9); box-sizing: border-box; }
.video-modal-content { max-width: 900px; padding: 25px; }
.close-video { background: transparent; border: none; color: var(--text-gray); cursor: pointer; font-size: 14px; font-weight: 700; float: left; margin-bottom: 15px; transition: all 0.3s ease; padding: 5px 10px; }
.close-video:hover { color: var(--accent-red); background: rgba(229, 9, 20, 0.1); }
.close-ad { background: var(--accent-red); color: white; border: none; padding: 12px; border-radius: 4px; cursor: pointer; font-weight: bold; width: 100%; margin-top: 15px; transition: all 0.3s; }

footer { text-align: center; padding: 30px; margin-top: 50px; border-top: 1px solid rgba(255,255,255,0.05); color: var(--text-gray); font-size: 0.9rem; }
footer a { color: var(--text-gray); text-decoration: none; margin: 0 10px; transition: all 0.3s; }

.course-hero { display: flex; flex-direction: column; justify-content: flex-end; height: 350px; background: linear-gradient(to top, var(--bg-dark) 10%, rgba(9,10,15,0.2)), url('https://images.unsplash.com/photo-1598751337485-0639d6ec3400?q=80&w=1200&auto=format&fit=crop') center/cover; border-radius: 12px; padding: 30px; margin-bottom: 30px; border: 1px solid rgba(255,255,255,0.05); }
.course-hero h1 { font-size: 2.5rem; color: #fff; margin-bottom: 10px; }
.course-hero p { color: #d1d5db; max-width: 600px; font-size: 1.1rem; }

.app-tabs { display: flex; gap: 20px; border-bottom: 2px solid rgba(255,255,255,0.05); margin-bottom: 25px; padding-bottom: 10px; }
.app-tabs span { font-size: 1.1rem; color: var(--text-gray); font-weight: bold; cursor: pointer; padding: 5px 10px; }
.app-tabs span.active { color: #fff; border-bottom: 3px solid var(--accent-red); }

/* ==========================================
   إصلاحات شاملة للهواتف المحمولة 100%
========================================== */
.hero-container { text-align: center; min-height: 75vh; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.hero-title { font-size: 3.5rem; margin-bottom: 20px; }
.hero-desc { color: var(--text-gray); font-size: 1.2rem; margin-bottom: 40px; max-width: 650px; }
.hero-buttons { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; }
.hero-buttons a { padding: 15px 40px; font-size: 15px; }

.legal-box { max-width: 800px; background: var(--card-bg); margin: 50px auto; border-radius: 12px; padding: 40px; border: 1px solid rgba(255,255,255,0.05); }

@media (max-width: 768px) {
    /* إصلاح الهيدر واللوجو */
    .menu-icon { display: block !important; }
    nav {
        display: flex !important; flex-direction: column !important; position: fixed !important;
        top: 0 !important; left: -300px !important; right: auto !important; width: 260px !important;
        height: 100vh !important; background-color: #151a22 !important; box-shadow: 5px 0 15px rgba(217, 255, 0, 0.5) !important;
        padding: 30px 20px !important; transition: left 0.3s ease-in-out !important; z-index: 9999 !important;
    }
    nav.active { left: 0 !important; }
    nav a { font-size: 18px; padding: 15px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.05); text-align: right; }
    .close-btn { display: block !important; align-self: flex-end !important; }
    .main-header { padding: 15px !important; }
    .main-header h1 { font-size: 18px !important; white-space: normal !important; }
    .logo { font-size: 20px !important; }
    
    /* إصلاح الشاشة الرئيسية */
    .hero-container { min-height: auto; padding: 40px 15px; }
    .hero-title { font-size: 2.2rem !important; }
    .hero-desc { font-size: 1rem !important; margin-bottom: 25px; }
    .hero-buttons { flex-direction: column; width: 100%; gap: 12px; }
    .hero-buttons a { width: 100%; padding: 15px !important; box-sizing: border-box; }

    /* إصلاح المسافات (Padding) للبطاقات والمحتوى */
    .section-padding { padding: 40px 15px !important; }
    .section-title { font-size: 1.8rem !important; margin-bottom: 30px !important; line-height: 1.4; }
    
    /* إصلاح شبكة الفيديوهات (Grid) */
    .video-grid { grid-template-columns: 1fr !important; gap: 15px !important; }
    
    /* إصلاح النوافذ المنبثقة (Modals) ومشغل الفيديو */
    .modal-content { width: 95% !important; padding: 15px !important; margin: 10px !important; box-sizing: border-box; max-width: 100% !important; }
    .video-modal-content { padding: 10px !important; }
    
    /* أزرار السيرفرات المتعددة لتلائم الشاشات الصغيرة */
    .server-tabs-container { flex-direction: column; gap: 8px; }
    .server-btn { width: 100%; text-align: center; padding: 12px; }
    
    /* إصلاح صفحة الكورسات */
    .course-hero { height: auto !important; min-height: 250px; padding: 25px 15px !important; }
    .course-hero h1 { font-size: 1.8rem !important; }
    .course-hero p { font-size: 0.95rem !important; }
    .app-tabs { overflow-x: auto; white-space: nowrap; }
    
    /* أزرار الإغلاق في الجوال لتكون بارزة وسهلة النقر */
    .close-video, .close-ad { width: 100%; margin-bottom: 12px; text-align: center; float: none; padding: 12px; background: var(--accent-red); color: #fff; border-radius: 4px; box-sizing: border-box;}
    
    /* إصلاح صفحة السياسات (Legal) */
    .legal-box { padding: 20px !important; margin: 20px 0 !important; }
    .legal-box h1 { font-size: 1.6rem !important; margin-bottom: 20px !important; }
}
.search-container {
    position: relative !important;
    width: 250px;
    display: inline-block;
}

#search-input {
    width: 100%;
    padding: 8px 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    border-radius: 4px;
    outline: none;
    font-size: 14px;
}

#search-input:focus {
    border-color: var(--accent-red, #e50914);
}

.search-dropdown {
    position: absolute !important;
    top: 100% !important;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    max-height: 250px;
    overflow-y: auto;
    z-index: 9999 !important; /* لضمان ظهورها فوق كل عناصر الصفحة */
    display: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.7);
}

.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    border-bottom: 1px solid #222;
    transition: background 0.2s;
}

.search-item:hover {
    background: var(--accent-red, #e50914);
}

.search-item img {
    width: 30px;
    height: 42px;
    object-fit: cover;
    border-radius: 3px;
    flex-shrink: 0; /* منع الصورة من الانكماش أو التأثير على تخطيط السطر */
}
/* توحيد جميع أزرار الـ Hero باللون الذهبي الشفاف */
/* 🟢 زر الأنيميات المدبلجة - أخضر */
.btn-browse {
    background: rgba(46, 204, 113, 0.1) !important;
    border: 1px solid #2ecc71 !important;
    color: #2ecc71 !important;
}
.btn-browse:hover {
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.5) !important;
}

/* 🔴 زر مكتبة الشباب - أحمر */
.btn-men {
    background: rgba(229, 9, 20, 0.1) !important;
    border: 1px solid #e50914 !important;
    color: #e50914 !important;
}
.btn-men:hover {
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.5) !important;
}

/* 🌸 زر مكتبة الفتيات - وردي */
.btn-women {
    background: rgba(255, 105, 180, 0.1) !important;
    border: 1px solid #ff69b4 !important;
    color: #ff69b4 !important;
}
.btn-women:hover {
    box-shadow: 0 0 15px rgba(255, 105, 180, 0.5) !important;
}

/* 🟡 زر ساحة المنافسة - ذهبي */
.btn-comp {
    background: rgba(241, 196, 15, 0.1) !important;
    border: 1px solid #f1c40f !important;
    color: #f1c40f !important;
}
.btn-comp:hover {
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.5) !important;
}
/* ترتيب الأيقونة مع النص جنبًا إلى جنب بشكل متناسق */
.hero-buttons .download-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important; /* مسافة بين النص والأيقونة */
}

/* تنسيق حجم ومرحلة الانتقال للأيقونة */
.hero-buttons .download-btn i {
    font-size: 1.2rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* حركة تفاعلية احترافية: تكبير وبروز الأيقونة عند التمرير بالماوس */
.hero-buttons .download-btn:hover i {
    transform: scale(1.25) rotate(-8deg);
}
#loader-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #1a1a1a; /* لون خلفية مناسب لموقعك */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    color: #ffffff;
    font-family: sans-serif;
    transition: opacity 0.5s ease;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #333;
    border-top: 5px solid #ff4757; /* لون مميز للشريط المتحرك */
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* صنف لإخفاء شريط التحميل بعد اكتمال التحميل */
.loaded {
    opacity: 0;
    pointer-events: none;
}


/* ============================================================
   Black Echo Design System v2 — طبقة الهوية الموحدة
   جميع المكونات الجديدة تعتمد على متغيرات --he-* فقط.
   ============================================================ */
:root {
    --he-bg: #07080c;
    --he-surface: #12141c;
    --he-surface-2: #181a24;
    --he-border: #262838;
    --he-red: #e50914;
    --he-red-2: #ff3b3b;
    --he-gold: #ffb800;
    --he-blue: #3d7bff;
    --he-pink: #ff4fa0;
    --he-green: #2ea043;
    --he-text: #f2f2f5;
    --he-muted: #93939f;
    --he-shadow: 0 18px 44px -20px rgba(0, 0, 0, .78);
    --he-glass: rgba(12, 14, 22, .68);
    --bg-dark: var(--he-bg);
    --card-bg: var(--he-surface);
    --text-light: var(--he-text);
    --text-gray: var(--he-muted);
    --accent-red: var(--he-red);
    --accent-gold: var(--he-gold);
    --accent-grey: var(--he-muted);
    --transition: all .3s cubic-bezier(.2, .75, .25, 1);
}

html { background: var(--he-bg); }
body {
    background: var(--he-bg);
    color: var(--he-text);
    min-width: 320px;
}
body.animated-bg {
    background:
        radial-gradient(circle at 100% 0%, rgba(229, 9, 20, .10), transparent 28rem),
        radial-gradient(circle at 0% 100%, rgba(61, 123, 255, .07), transparent 26rem),
        var(--he-bg);
    animation: none;
}

/* Header / navigation */
.main-header {
    position: sticky;
    top: 0;
    min-height: 72px;
    padding: 12px clamp(16px, 4vw, 64px);
    background: rgba(7, 8, 12, .58);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    -webkit-backdrop-filter: blur(14px) saturate(135%);
    backdrop-filter: blur(14px) saturate(135%);
    transition: background .35s ease, border-color .35s ease, box-shadow .35s ease, min-height .35s ease;
    z-index: 1000;
}
.main-header.is-scrolled {
    background: rgba(7, 8, 12, .78);
    border-bottom-color: rgba(255, 255, 255, .13);
    box-shadow: 0 14px 32px -24px rgba(0, 0, 0, .95);
}
.main-header .logo { position: relative; z-index: 1; }
.main-header nav { align-items: center; gap: clamp(12px, 2vw, 25px); }
.main-header nav a { color: var(--he-text); }
.main-header nav a:hover, .main-header nav a.active { color: var(--he-gold); }
.main-header .menu-icon {
    display: none;
    border: 0;
    background: transparent;
    color: var(--he-text);
    font-size: 1.35rem;
    line-height: 1;
    padding: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform .25s ease, color .25s ease, background .25s ease;
}
.main-header .menu-icon:hover, .main-header .menu-icon:focus-visible {
    color: var(--he-red-2);
    background: rgba(255,255,255,.07);
    transform: scale(1.06);
    outline: none;
}
.close-btn {
    border: 0;
    background: transparent;
    color: var(--he-red-2);
    transition: transform .25s ease, color .25s ease;
}
.close-btn:hover { transform: rotate(90deg); color: var(--he-text); }
.nav-backdrop {
    position: fixed;
    inset: 0;
    display: block;
    visibility: hidden;
    opacity: 0;
    border: 0;
    background: rgba(0, 0, 0, .56);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    transition: opacity .3s ease, visibility .3s ease;
    z-index: 998;
}
.nav-backdrop.is-visible { visibility: visible; opacity: 1; }
body.menu-open { overflow: hidden; }

/* Header search and favorite shortcut */
.header-favorites-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--he-muted);
    text-decoration: none;
    font-size: .82rem;
    font-weight: 700;
    white-space: nowrap;
    transition: color .25s ease, transform .25s ease;
}
.header-favorites-link:hover { color: var(--he-red-2); transform: translateY(-1px); }
.header-favorites-link i { color: var(--he-red-2); }
.header-favorites-link b {
    display: inline-flex;
    min-width: 19px;
    height: 19px;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border-radius: 999px;
    background: rgba(229, 9, 20, .15);
    color: var(--he-red-2);
    font-size: .7rem;
}
.search-container { position: relative; width: min(230px, 22vw); min-width: 150px; }
.search-icon {
    position: absolute;
    top: 50%;
    right: 13px;
    transform: translateY(-50%);
    color: var(--he-muted);
    pointer-events: none;
    z-index: 1;
}
#search-input {
    width: 100%;
    height: 42px;
    padding: 8px 38px 8px 14px;
    color: var(--he-text);
    background: rgba(255, 255, 255, .055);
    border: 1px solid var(--he-border);
    border-radius: 12px;
    outline: 0;
    font: inherit;
    font-size: .8rem;
    transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
#search-input::placeholder { color: var(--he-muted); }
#search-input:focus {
    background: rgba(255,255,255,.09);
    border-color: var(--he-red-2);
    box-shadow: 0 0 0 4px rgba(229, 9, 20, .1);
}
.search-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-start: 0;
    width: min(330px, 82vw);
    max-height: min(390px, 60vh);
    overflow-y: auto;
    padding: 6px;
    background: rgba(18, 20, 28, .96);
    border: 1px solid var(--he-border);
    border-radius: 14px;
    box-shadow: var(--he-shadow);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    z-index: 1100;
}
.search-item {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
    padding: 9px;
    color: var(--he-text);
    background: transparent;
    border: 0;
    border-radius: 9px;
    text-align: start;
    font: inherit;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
}
.search-item:hover, .search-item:focus-visible { background: rgba(229, 9, 20, .12); transform: translateX(-2px); outline: 0; }
.search-item img { width: 38px; height: 54px; flex: 0 0 38px; object-fit: cover; border-radius: 6px; background: var(--he-surface-2); }
.search-item span:not(.search-item-icon) { color: var(--he-text); font-size: .82rem; line-height: 1.5; }
.search-item-icon { display: grid; place-items: center; width: 38px; height: 54px; flex: 0 0 38px; color: var(--he-red-2); background: var(--he-surface-2); border-radius: 6px; }
.search-empty { padding: 20px 12px; color: var(--he-muted); text-align: center; font-size: .82rem; }

/* Shared cards */
.anime-card, .he-card, .video-card {
    background: var(--he-surface);
    border: 1px solid var(--he-border);
    box-shadow: 0 6px 20px -16px rgba(0,0,0,.8);
}
.anime-card, .he-card { border-radius: 14px; overflow: hidden; }
.anime-card:hover, .he-card:hover, .video-card:hover {
    transform: translateY(-6px) scale(1.012);
    border-color: rgba(229, 9, 20, .48);
    box-shadow: var(--he-shadow), 0 0 0 1px rgba(229, 9, 20, .06);
}
.anime-card-image, .he-card-img-wrap, .card-poster, .be-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 3;
    height: auto !important;
    overflow: hidden;
    background: var(--he-surface-2);
}
.anime-card-image img, .he-card-img-wrap img, .card-poster img, .be-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s ease, filter .5s ease;
}
.anime-card:hover img, .he-card:hover img { transform: scale(1.06); }
.anime-card .card-info, .he-card .he-card-body, .he-card .card-info, .be-card-body { padding: 12px; width: 100%; box-sizing: border-box; }
.anime-card h3, .he-card h3, .be-card-body h3 {
    color: var(--he-text);
    display: block;
    width: 100%;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.status-badge, .he-card-badge, .episodes-badge {
    border: 1px solid rgba(255,255,255,.18);
    box-shadow: 0 8px 18px -10px rgba(0,0,0,.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.status-badge { top: 10px; right: 10px; background: rgba(46,160,67,.88); }
.status-badge.completed { background: rgba(229,9,20,.88); }
.episodes-badge { bottom: 10px; right: 10px; background: rgba(7,8,12,.78); }
.be-favorite-button {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    color: #fff;
    background: rgba(7,8,12,.64);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: 50%;
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: color .25s ease, background .25s ease, transform .25s ease, border-color .25s ease;
}
.be-favorite-button:hover, .be-favorite-button:focus-visible { color: var(--he-red-2); border-color: var(--he-red-2); transform: scale(1.1); outline: none; }
.be-favorite-button.is-active { color: #fff; background: var(--he-red); border-color: var(--he-red-2); }
.be-rating { display: flex; align-items: center; gap: 1px; direction: ltr; margin-top: 7px; }
.be-star {
    padding: 0 2px;
    color: var(--he-muted);
    background: transparent;
    border: 0;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    transition: color .2s ease, transform .2s ease;
}
.be-star:hover, .be-star:focus-visible, .be-star.is-selected { color: var(--he-gold); transform: scale(1.12); outline: none; }
.be-detail-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 14px; }
.be-detail-favorite {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 14px;
    color: var(--he-text);
    background: rgba(255,255,255,.06);
    border: 1px solid var(--he-border);
    border-radius: 10px;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}
.be-detail-favorite:hover, .be-detail-favorite.is-active { color: #fff; background: rgba(229,9,20,.82); border-color: var(--he-red-2); }
.be-detail-favorite i { color: var(--he-red-2); }
.be-detail-favorite.is-active i { color: #fff; }
.be-detail-rating { display: inline-flex; align-items: center; gap: 8px; color: var(--he-muted); font-size: .8rem; }

/* Images, empty states, and responsive polish */
img { max-width: 100%; }
.anime-grid, .he-latest-grid { align-items: start; }
@media (max-width: 900px) {
    .main-header { gap: 10px; }
    .main-header nav { gap: 12px; }
    .search-container { width: min(190px, 24vw); }
    .header-favorites-link span { display: none; }
}
@media (max-width: 768px) {
    .main-header { min-height: 64px; padding: 9px 14px; gap: 8px; }
    .main-header .logo { font-size: 1.15rem; }
    .main-header .menu-icon { display: inline-grid; place-items: center; order: 5; }
    .main-header nav {
        position: fixed !important;
        inset-block: 0;
        inset-inline-start: 0 !important;
        width: min(310px, 86vw) !important;
        height: 100dvh !important;
        display: flex !important;
        align-items: stretch;
        flex-direction: column !important;
        gap: 0;
        padding: 24px 18px;
        background: rgba(18, 20, 28, .97) !important;
        border-inline-end: 1px solid var(--he-border);
        box-shadow: 18px 0 45px -24px #000 !important;
        transform: translateX(110%);
        visibility: hidden;
        opacity: 0;
        transition: transform .38s cubic-bezier(.2,.8,.2,1), opacity .3s ease, visibility .38s ease !important;
        z-index: 1001 !important;
    }
    html[dir="rtl"] .main-header nav { transform: translateX(110%); }
    html[dir="ltr"] .main-header nav { transform: translateX(-110%); }
    .main-header nav.active { left: auto !important; transform: translateX(0) !important; visibility: visible; opacity: 1; }
    .main-header nav a { display: flex; align-items: center; min-height: 52px; padding: 12px 10px; border-bottom: 1px solid rgba(255,255,255,.07); font-size: 1rem; }
    .main-header nav .close-btn { display: block !important; align-self: flex-end !important; margin: 0 0 18px; padding: 4px 10px; font-size: 2rem; }
    .main-header .search-container { flex: 1; min-width: 0; width: auto; max-width: 220px; }
    #search-input { height: 39px; font-size: .74rem; }
    .header-favorites-link { font-size: 1rem; }
    .header-favorites-link b { min-width: 17px; height: 17px; font-size: .62rem; }
    .anime-grid.video-grid, .anime-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 12px !important; }
    .he-latest-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .he-section { padding-inline: 14px; }
    .be-detail-actions { gap: 10px; }
}
@media (max-width: 390px) {
    .main-header .logo { font-size: .98rem; }
    .header-favorites-link { display: none; }
    .search-container { max-width: 210px !important; }
    .anime-grid.video-grid, .anime-grid, .he-latest-grid { gap: 10px !important; }
    .anime-card .card-info, .he-card .he-card-body { padding: 9px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
