* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0d0d0d;
    --bg-secondary: #141414;
    --bg-card: #191919;
    --bg-hover: #202020;
    --text-primary: #ffffff;
    --text-secondary: #cfcfcf;
    --text-muted: #9a9a9a;
    --accent: #ff7a00;
    --accent-hover: #ffa24a;
    --border: #2a2a2a;
    --shadow: rgba(0, 0, 0, 0.35);
    --shadow-hover: rgba(0, 0, 0, 0.5);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
    /* Оптимизация для мобильных */
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

body::before {
    content: none;
}

/* Отключение анимации на слабых устройствах */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    body::before {
        animation: none;
    }
}

@keyframes cinematicGlow {
    0% {
        opacity: 0.5;
        transform: scale(1);
    }
    100% {
        opacity: 1;
        transform: scale(1.1);
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    /* Поддержка safe-area для iPhone */
    padding-left: max(2rem, env(safe-area-inset-left));
    padding-right: max(2rem, env(safe-area-inset-right));
}

/* Header */
header {
    padding: 1.5rem 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 16px var(--shadow);
    transition: background 0.2s ease;
    /* Поддержка safe-area для iPhone */
    padding-top: max(2rem, env(safe-area-inset-top));
}

header::after {
    content: none;
}

header .container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* History Button */
.history-btn {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(251, 191, 36, 0.1) inset;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.history-btn:hover {
    background: rgba(0, 0, 0, 0.55);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.02);
    box-shadow: 0 8px 20px var(--shadow-hover);
}

.history-btn:active {
    transform: translateY(-50%) scale(0.98);
}

.history-icon {
    font-size: 1.2rem;
    line-height: 1;
    filter: none;
}

.history-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--accent);
    color: #000;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    box-shadow: 0 2px 8px var(--shadow);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

/* History Modal */
.history-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10002;
    animation: fadeIn 0.3s ease;
}

.history-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(0, 0, 0, 0.8) 0%, 
        rgba(0, 0, 0, 0.95) 100%);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
}

.history-modal-content {
    position: relative;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    background: linear-gradient(135deg, 
        rgba(17, 17, 17, 0.95) 0%, 
        rgba(10, 10, 10, 0.9) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 32px;
    overflow: hidden;
    z-index: 10003;
    animation: slideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 30px 100px rgba(0, 0, 0, 0.9),
        0 0 0 2px rgba(251, 191, 36, 0.2) inset,
        0 0 60px rgba(251, 191, 36, 0.3),
        0 0 100px rgba(251, 191, 36, 0.1);
    border: 2px solid rgba(251, 191, 36, 0.3);
    display: flex;
    flex-direction: column;
}

.history-modal-header {
    padding: 2rem;
    background: linear-gradient(180deg, 
        rgba(31, 31, 31, 0.6) 0%, 
        rgba(26, 26, 26, 0.5) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-modal-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.history-modal-close {
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10004;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.history-modal-close:hover {
    background: var(--gradient-gold);
    border-color: rgba(251, 191, 36, 0.6);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 
        0 0 40px rgba(251, 191, 36, 0.8),
        0 0 60px rgba(251, 191, 36, 0.5),
        0 0 0 2px rgba(217, 119, 6, 0.3) inset;
    color: #000000;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    max-height: calc(80vh - 180px);
}

.history-list::-webkit-scrollbar {
    width: 8px;
}

.history-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(251, 191, 36, 0.4);
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(251, 191, 36, 0.6);
}

.history-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    padding: 3rem 1rem;
    opacity: 0.7;
}

.history-item {
    background: linear-gradient(135deg, 
        rgba(17, 17, 17, 0.6) 0%, 
        rgba(10, 10, 10, 0.5) 100%);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border-radius: 20px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    border: 2px solid rgba(251, 191, 36, 0.15);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.history-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-cinema);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.history-item:hover {
    transform: translateX(4px);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.6),
        0 0 0 2px rgba(251, 191, 36, 0.2) inset,
        0 0 30px rgba(251, 191, 36, 0.2);
}

.history-item:hover::before {
    opacity: 1;
}

.history-item-content {
    position: relative;
    z-index: 1;
}

.history-item-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 0%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.history-item-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
}

.history-item-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.history-item-progress {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: 0.75rem;
    overflow: hidden;
    position: relative;
}

.history-item-progress-bar {
    height: 100%;
    background: var(--gradient-gold);
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.5);
}

.history-item-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg, 
        rgba(31, 31, 31, 0.3) 0%, 
        rgba(26, 26, 26, 0.2) 100%);
}

.history-clear-btn {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, 
        rgba(220, 38, 38, 0.3) 0%, 
        rgba(220, 38, 38, 0.2) 100%);
    border: 2px solid rgba(220, 38, 38, 0.3);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.history-clear-btn:hover {
    background: linear-gradient(135deg, 
        rgba(220, 38, 38, 0.5) 0%, 
        rgba(220, 38, 38, 0.4) 100%);
    border-color: rgba(220, 38, 38, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.4);
}

.main-nav {
    margin-top: 0.75rem;
    display: flex;
    gap: 1rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    transition: color 0.2s ease, background-color 0.2s ease;
    /* Минимальный размер touch-цели для мобильных */
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(251, 191, 36, 0.2);
}

.nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.12);
}

.logo {
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 0.3rem;
    margin-left: 56px; /* компактнее под кнопку истории */
    color: var(--text-primary);
    position: relative;
    display: inline-block;
    transition: all 0.3s ease;
}

.logo::after {
    content: none;
}

.logo:hover::after {
    width: 100%;
}

.logo a {
    text-decoration: none;
    color: inherit;
    display: inline-block;
}

.tagline {
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 300;
}

/* Hero Section */
.hero {
    padding: 6rem 0 4.5rem;
    text-align: center;
    background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
    min-height: 50vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero::before {
    content: none;
}

.hero::after {
    content: none;
}

@keyframes heroPulse {
    0% { opacity: 1; }
    100% { opacity: 1; }
}

.hero-title {
    font-size: 3.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out 0.1s both;
    color: var(--text-primary);
    line-height: 1.15;
}

.hero-subtitle {
    font-size: 1.1rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 0.01em;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out 0.2s both;
    opacity: 0.9;
}

/* Series Showcase Section (Main Page) */
.series-showcase {
    padding: 4rem 0 5rem;
    background: var(--bg-secondary);
    position: relative;
}

.series-showcase::before {
    content: none;
}

/* CUTS */
.cuts-section {
    background: #000;
}

.cuts-page header {
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(8px) saturate(120%);
    -webkit-backdrop-filter: blur(8px) saturate(120%);
}

.cuts-viewport {
    height: 100svh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    background: #000;
}

.cuts-feed {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cut-card {
    position: relative;
    width: min(100%, 560px);
    height: 100svh;
    scroll-snap-align: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.cut-card.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.cut-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.cut-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 9 / 16;
    display: block;
}

.cut-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    pointer-events: none;
    padding: 1rem;
    background: linear-gradient(to top, rgba(0,0,0,0.35), rgba(0,0,0,0.0) 40%);
}

.cut-controls {
    display: flex;
    gap: 0.5rem;
    pointer-events: auto;
}

.cut-btn {
    color: #fff;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 999px;
    padding: 0.35rem 0.65rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cut-btn:hover {
    background: rgba(255,255,255,0.25);
    transform: translateY(-1px);
}

/* Global CUTS controls (fullscreen + nav) */
.cuts-global-controls {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 1001;
    pointer-events: none;
}
.cuts-global-btn {
    pointer-events: auto;
    color: #fff;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 0.6rem 0.8rem;
    font-size: 1.1rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06) inset;
    opacity: 0.95;
}
.cuts-global-btn:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}
.cuts-global-btn:active {
    transform: translateY(0);
}

/* Fullscreen adjustments */
.cuts-viewport:fullscreen,
.cuts-viewport:-webkit-full-screen {
    height: 100svh;
    width: 100vw;
    background: #000;
}
.cuts-viewport:fullscreen .cut-card,
.cuts-viewport:-webkit-full-screen .cut-card {
    width: 100vw;
    height: 100svh;
}
.cuts-viewport:fullscreen .cut-video,
.cuts-viewport:-webkit-full-screen .cut-video {
    object-fit: contain;
    background: #000;
}
.cuts-viewport:fullscreen .cuts-global-controls,
.cuts-viewport:-webkit-full-screen .cuts-global-controls {
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
}

.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

@media (max-width: 768px) {
    .cut-card {
        width: 100%;
    }
}

.series-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
    margin-top: 3rem;
}

.series-card {
    background: var(--bg-card);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    will-change: transform, box-shadow;
    contain: layout style paint;
    box-shadow: 0 8px 24px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-decoration: none;
    color: inherit;
    display: block;
}

.series-card::before {
    content: none;
}

.series-card.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

.series-card:hover {
    transform: translate3d(0, -6px, 0) scale(1.01);
    box-shadow: 0 16px 40px var(--shadow-hover);
    border-color: rgba(255, 255, 255, 0.12);
    background: var(--bg-hover);
}

.series-card:hover::before { opacity: 0; }

.series-card-image {
    width: 100%;
    height: 280px;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.series-card-image::before { content: none; }

.series-card:hover .series-card-image::before { opacity: 0; }

.series-card-title-large {
    position: absolute;
    z-index: 3;
    font-family: 'Oswald', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-primary);
    text-align: center;
    padding: 0 2rem;
    line-height: 1.2;
    word-wrap: break-word;
    max-width: 90%;
    transition: transform 0.25s ease;
}

.series-card:hover .series-card-title-large {
    transform: scale(1.01);
}

.series-abbr-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    color: var(--text-primary);
    background: linear-gradient(135deg, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.75) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.4rem 0.75rem;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.05) inset;
    text-transform: uppercase;
}

.series-house-overlay {
    position: absolute;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.series-house-overlay .house {
    position: relative;
    width: 260px;
    height: 180px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.65) 100%);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 12px 32px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.05) inset;
    padding: 16px 18px 20px;
}

.series-house-overlay .house::before {
    content: '';
    position: absolute;
    top: -42px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 70px solid transparent;
    border-right: 70px solid transparent;
    border-bottom: 42px solid rgba(0,0,0,0.55);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.35));
}

.series-house-overlay .people {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 12px;
    justify-items: center;
    align-items: center;
    margin-top: 8px;
    margin-bottom: 14px;
}

.series-house-overlay .person {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0.55) 60%, rgba(255,255,255,0.3));
    box-shadow: 0 2px 8px rgba(0,0,0,0.35);
    position: relative;
}

.series-house-overlay .person::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 12px;
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(255,255,255,0.65), rgba(255,255,255,0.35));
    box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.series-house-overlay .house-title {
    text-align: center;
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: 0 3px 10px rgba(0,0,0,0.45);
}

.series-card-title-overlay {
    position: absolute;
    z-index: 2;
    color: var(--text-primary);
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: none;
    text-align: center;
    padding: 0.75rem 1.25rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(0,0,0,0.45) 0%, rgba(0,0,0,0.65) 100%);
    backdrop-filter: blur(10px) saturate(140%);
    -webkit-backdrop-filter: blur(10px) saturate(140%);
    border: 1px solid rgba(255,255,255,0.15);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 1px rgba(255,255,255,0.05) inset;
}

.series-card-title-overlay.dual {
    font-size: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
}

.series-card-title-overlay .label-green {
    color: #28c76f;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(40,199,111,0.35);
}

.series-card-title-overlay .label-red {
    color: #ff4d4f;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(255,77,79,0.35);
}

.series-card-title-overlay .label-sep,
.series-card-title-overlay .label-rest {
    color: var(--text-primary);
    opacity: 0.9;
    font-weight: 700;
}

.series-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.3) 0%, 
        rgba(0, 0, 0, 0.6) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.series-card:hover .series-card-overlay {
    opacity: 1;
}

.series-play-icon {
    font-size: 5rem;
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 
        0 0 30px var(--glow-gold),
        0 0 60px var(--glow-gold-strong),
        0 4px 20px rgba(0, 0, 0, 0.9);
    transform: scale(0.7) translateY(10px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 20px rgba(251, 191, 36, 0.6));
    z-index: 3;
    position: relative;
}

.series-card:hover .series-play-icon {
    transform: scale(1.1) translateY(0);
    filter: drop-shadow(0 0 40px rgba(251, 191, 36, 0.9));
}

.series-card-content {
    padding: 2rem;
    position: relative;
    z-index: 2;
    background: var(--bg-card);
}

.series-card-title {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.series-card-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.series-card-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.series-card-episodes,
.series-card-actors {
    font-weight: 500;
}

.series-card-separator {
    color: var(--text-muted);
    opacity: 0.5;
}

/* Seasons Section */
.seasons {
    padding: 6rem 0 8rem;
    background: linear-gradient(180deg, 
        var(--bg-primary) 0%, 
        var(--bg-secondary) 50%,
        var(--bg-primary) 100%);
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
    position: relative;
}

.seasons::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 50% 30%, rgba(251, 191, 36, 0.04) 0%, transparent 60%);
    pointer-events: none;
    opacity: 0.6;
}

.season {
    margin-bottom: 6rem;
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: transform, opacity;
}

.season.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

.season:last-child {
    margin-bottom: 0;
}

.season-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    position: relative;
    padding-bottom: 0.75rem;
}

.season-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 64px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

@keyframes titleGlow {}

.season-episodes {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-weight: 500;
}

/* Episodes Grid */
.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.episode-card {
    background: var(--bg-card);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
    opacity: 0;
    transform: translate3d(0, 16px, 0);
    will-change: transform, box-shadow;
    contain: layout style paint;
    box-shadow: 0 8px 24px var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.episode-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-cinema);
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
    pointer-events: none;
    border-radius: 24px;
}

.episode-card.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

.episode-card:hover {
    transform: translate3d(0, -6px, 0) scale(1.01);
    box-shadow: 0 16px 40px var(--shadow-hover);
    border-color: rgba(255, 255, 255, 0.12);
    background: var(--bg-hover);
}

.episode-card:hover::before { opacity: 0; }

.episode-thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.episode-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1), filter 0.5s ease, opacity 0.5s ease;
    filter: brightness(0.85);
    opacity: 1;
    background-color: var(--bg-secondary);
    display: block;
}

.episode-card:hover .episode-thumbnail {
    transform: scale3d(1.1, 1.1, 1);
    filter: brightness(1);
    will-change: transform;
}

.episode-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.95;
    transition: transform 0.25s ease, opacity 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    color: var(--text-primary);
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 6px 16px var(--shadow);
}

.episode-card:hover .episode-play-icon {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
    background: rgba(0, 0, 0, 0.45);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 24px var(--shadow-hover);
}

.episode-number {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 3rem;
    font-weight: 700;
    opacity: 0.15;
    color: var(--text-primary);
    line-height: 1;
    transition: all 0.4s ease;
    font-variant-numeric: tabular-nums;
    z-index: 1;
}

.episode-card:hover .episode-number {
    opacity: 0.08;
    transform: scale(1.1);
}

.episode-content {
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.4s ease;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.episode-card:hover .episode-content {
    background: rgba(255, 255, 255, 0.04);
}

.episode-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.episode-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.episode-card[data-video=""] {
    cursor: default;
    opacity: 0.7;
}

.episode-card[data-video=""]:hover {
    transform: none;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    border-color: rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, 
        rgba(31, 31, 31, 0.6) 0%, 
        rgba(26, 26, 26, 0.5) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
}

.episode-card[data-video=""] .episode-play-icon {
    opacity: 0.3;
}

.episode-card[data-video=""] .episode-thumbnail-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

.coming-soon-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 4.5rem;
    font-weight: 800;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    opacity: 0.9;
    z-index: 2;
    text-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.9),
        0 0 40px rgba(255, 107, 53, 0.5);
    background: linear-gradient(135deg, 
        rgba(255, 107, 53, 0.25) 0%, 
        rgba(255, 107, 53, 0.15) 100%);
    padding: 2.5rem 4rem;
    border-radius: 20px;
    border: 3px solid rgba(255, 107, 53, 0.4);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset,
        0 0 60px rgba(255, 107, 53, 0.3);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coming-soon .episode-thumbnail-wrapper {
    background: linear-gradient(135deg, 
        rgba(31, 31, 31, 0.8) 0%, 
        rgba(26, 26, 26, 0.7) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.coming-soon .episode-play-icon {
    display: none;
}

.final-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gradient-gold);
    color: #000000;
    font-size: 0.95rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    padding: 0.6rem 1.2rem;
    border-radius: 24px;
    z-index: 4;
    box-shadow: 
        0 8px 24px rgba(251, 191, 36, 0.6),
        0 0 0 2px rgba(217, 119, 6, 0.3) inset,
        0 0 40px rgba(251, 191, 36, 0.5),
        0 0 60px rgba(251, 191, 36, 0.3);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border: 2px solid rgba(217, 119, 6, 0.4);
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% {
        box-shadow: 
            0 8px 24px rgba(251, 191, 36, 0.6),
            0 0 0 2px rgba(217, 119, 6, 0.3) inset,
            0 0 40px rgba(251, 191, 36, 0.5),
            0 0 60px rgba(251, 191, 36, 0.3);
    }
    50% {
        box-shadow: 
            0 8px 24px rgba(251, 191, 36, 0.8),
            0 0 0 2px rgba(217, 119, 6, 0.4) inset,
            0 0 60px rgba(251, 191, 36, 0.7),
            0 0 80px rgba(251, 191, 36, 0.5);
    }
}

/* Footer */
footer {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
    background: var(--bg-primary);
    position: relative;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

footer::before {
    content: none;
}

footer p {
    font-size: 0.9rem;
    color: var(--text-muted);
    letter-spacing: 0.03em;
}

/* Actors Section */
.actors {
    padding: 6rem 0;
    background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
}

.actors::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(255, 107, 53, 0.03) 0%, transparent 70%);
    pointer-events: none;
}

.actors-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

.actors-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 64px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

.actors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 2rem;
    position: relative;
    z-index: 1;
}

.actor-card {
    background: linear-gradient(135deg, 
        rgba(31, 31, 31, 0.6) 0%, 
        rgba(26, 26, 26, 0.5) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border-radius: 20px;
    overflow: hidden;
    text-align: center;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.4s ease;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    position: relative;
    opacity: 0;
    transform: translate3d(0, 30px, 0) scale(0.95);
    will-change: transform, box-shadow;
    contain: layout style paint;
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.actor-card.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    will-change: auto;
}

.actor-image-wrapper {
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    position: relative;
}

.actor-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    filter: grayscale(100%) brightness(0.8);
    opacity: 0;
    position: relative;
    z-index: 1;
}

.actor-image-placeholder {
    z-index: 0;
    font-size: 3rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
}

.actor-card:hover .actor-image {
    transform: scale3d(1.1, 1.1, 1);
    filter: grayscale(0%) brightness(1);
    will-change: transform;
}

.actor-info {
    padding: 1.8rem 1.5rem;
    background: linear-gradient(180deg, 
        rgba(31, 31, 31, 0.2) 0%, 
        rgba(26, 26, 26, 0.15) 50%,
        rgba(31, 31, 31, 0.2) 100%);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    transition: all 0.5s ease;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.actor-card:hover {
    transform: translate3d(0, -10px, 0) scale(1.03);
    box-shadow: 
        0 30px 80px rgba(0, 0, 0, 0.8),
        0 0 0 2px rgba(251, 191, 36, 0.4) inset,
        0 0 50px rgba(251, 191, 36, 0.4),
        0 0 80px rgba(251, 191, 36, 0.2);
    border-color: rgba(251, 191, 36, 0.6);
    background: linear-gradient(135deg, 
        rgba(17, 17, 17, 0.95) 0%, 
        rgba(251, 191, 36, 0.08) 50%,
        rgba(17, 17, 17, 0.95) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    filter: brightness(1.15);
}

.actor-card:hover .actor-info {
    background: linear-gradient(180deg, 
        rgba(42, 42, 42, 0.3) 0%, 
        rgba(255, 107, 53, 0.05) 50%,
        rgba(31, 31, 31, 0.3) 100%);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
}

.actor-name {
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-primary);
    transition: color 0.3s ease;
    margin-bottom: 0.5rem;
}

.actor-card:hover .actor-name {
    background: var(--gradient-gold);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 20px var(--glow-gold);
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.6));
}

.actor-age {
    font-size: 0.95rem;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    transition: color 0.3s ease;
}

.actor-card:hover .actor-age {
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translate3d(0, 20px, 0);
    transition: opacity 0.6s ease, transform 0.6s ease;
    will-change: transform, opacity;
}

.fade-in.visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
    will-change: auto;
}

/* Video Modal */
.video-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.video-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(0, 0, 0, 0.9) 100%);
    backdrop-filter: blur(20px) saturate(120%);
    -webkit-backdrop-filter: blur(20px) saturate(120%);
}

.video-modal-content {
    position: relative;
    width: 85%;
    max-width: 900px;
    background: linear-gradient(135deg, 
        rgba(17, 17, 17, 0.95) 0%, 
        rgba(10, 10, 10, 0.9) 100%);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border-radius: 32px;
    overflow: hidden;
    z-index: 10001;
    animation: slideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 30px 100px rgba(0, 0, 0, 0.9),
        0 0 0 2px rgba(251, 191, 36, 0.2) inset,
        0 0 60px rgba(251, 191, 36, 0.3),
        0 0 100px rgba(251, 191, 36, 0.1);
    border: 2px solid rgba(251, 191, 36, 0.3);
}

.video-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(0, 0, 0, 0.6) 100%);
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10002;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.video-modal-close:hover {
    background: var(--gradient-gold);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);
    border-color: rgba(251, 191, 36, 0.6);
    transform: rotate(90deg) scale(1.15);
    box-shadow: 
        0 0 40px rgba(251, 191, 36, 0.8),
        0 0 60px rgba(251, 191, 36, 0.5),
        0 0 0 2px rgba(217, 119, 6, 0.3) inset;
    color: #000000;
}

.video-modal-header {
    padding: 2rem;
    background: linear-gradient(180deg, 
        rgba(31, 31, 31, 0.6) 0%, 
        rgba(26, 26, 26, 0.5) 100%);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.video-modal-header h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin: 0;
}

.video-modal-player {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-color: var(--bg-primary);
}

.video-modal-player video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    outline: none;
    object-fit: contain;
    cursor: pointer;
}

.video-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10003;
    background: linear-gradient(135deg, 
        rgba(0, 0, 0, 0.7) 0%, 
        rgba(0, 0, 0, 0.6) 100%);
    padding: 10px 20px;
    border-radius: 50px;
    backdrop-filter: blur(10px) saturate(120%);
    -webkit-backdrop-filter: blur(10px) saturate(120%);
    opacity: 1;
    transition: opacity 0.3s ease, transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.video-controls.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

.video-controls.hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
    pointer-events: none;
}

.video-modal-player:hover .video-controls.visible {
    opacity: 1;
}

.video-control-btn {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.15) 0%, 
        rgba(255, 255, 255, 0.1) 100%);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-size: 1.1rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
}

.video-control-btn:hover {
    background: var(--gradient-gold);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border-color: rgba(251, 191, 36, 0.6);
    transform: scale(1.15);
    box-shadow: 
        0 0 30px rgba(251, 191, 36, 0.7),
        0 0 50px rgba(251, 191, 36, 0.4),
        0 0 0 2px rgba(217, 119, 6, 0.3) inset,
        0 2px 8px rgba(251, 191, 36, 0.4);
    color: #000000;
}

.video-control-btn:active {
    transform: scale(0.95);
}

#aiRecognitionBtn.active {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.5), rgba(217, 119, 6, 0.5));
    border-color: rgba(251, 191, 36, 0.8);
    box-shadow: 0 0 20px rgba(251, 191, 36, 0.6);
    animation: pulse-ai 2s ease-in-out infinite;
}

@keyframes pulse-ai {
    0%, 100% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.6); }
    50% { box-shadow: 0 0 30px rgba(251, 191, 36, 0.9); }
}

.ai-recognition-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.ai-recognition-info {
    position: absolute;
    background: linear-gradient(135deg, 
        rgba(17, 17, 17, 0.95) 0%, 
        rgba(251, 191, 36, 0.15) 100%);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border: 2px solid rgba(251, 191, 36, 0.5);
    border-radius: 12px;
    padding: 12px 16px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(251, 191, 36, 0.4);
    animation: fadeInActor 0.3s ease-out;
    max-width: 200px;
    text-align: center;
    line-height: 1.4;
}

@keyframes fadeInActor {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.ai-recognition-info::before {
    content: '🤖';
    display: inline-block;
    margin-right: 6px;
    font-size: 1.1rem;
}

.ai-recognition-info .actor-name {
    color: var(--accent-gold);
    font-weight: 700;
    text-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

#playPauseBtn {
    font-size: 1.2rem;
    background: rgba(251, 191, 36, 0.3);
    border-color: rgba(251, 191, 36, 0.4);
}

#playPauseBtn:hover {
    background: var(--gradient-gold);
    color: #000000;
}

#exitBtn {
    background: rgba(255, 0, 0, 0.4);
    border-color: rgba(255, 0, 0, 0.3);
}

#exitBtn:hover {
    background: rgba(255, 0, 0, 0.7);
    border-color: rgba(255, 0, 0, 0.6);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translate3d(0, 50px, 0);
    }
    to {
        opacity: 1;
        transform: translate3d(0, 0, 0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .series-grid {
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        gap: 2rem;
    }

    .series-card-image {
        height: 250px;
    }

    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1.5rem;
    }


    .actors-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }

    .video-modal-content {
        width: 90%;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    /* Оптимизация фона для мобильных */
    body {
        background-attachment: scroll;
    }
    
    body::before {
        animation-duration: 30s;
        opacity: 0.7;
    }

    .container {
        padding: 0 1.5rem;
        padding-left: max(1.5rem, env(safe-area-inset-left));
        padding-right: max(1.5rem, env(safe-area-inset-right));
    }

    header {
        padding: 1.5rem 0;
        padding-top: max(1.5rem, env(safe-area-inset-top));
        backdrop-filter: blur(15px) saturate(150%);
        -webkit-backdrop-filter: blur(15px) saturate(150%);
    }

    .history-btn {
        left: 1.5rem;
        width: 44px;
        height: 44px;
    }

    .history-icon {
        font-size: 1.3rem;
    }

    .history-badge {
        font-size: 0.65rem;
        min-width: 18px;
        height: 18px;
        top: -3px;
        right: -3px;
    }

    .history-modal-content {
        width: 95%;
        max-height: 90vh;
        border-radius: 24px;
    }

    .history-modal-header {
        padding: 1.5rem;
    }

    .history-modal-header h2 {
        font-size: 1.5rem;
    }

    .history-list {
        padding: 1rem;
        max-height: calc(90vh - 160px);
    }

    .history-item {
        padding: 1rem;
    }

    .history-item-title {
        font-size: 1rem;
    }

    .history-modal-footer {
        padding: 1.25rem 1.5rem;
    }

    .logo {
        font-size: 2rem;
        letter-spacing: 0.06em;
        margin-left: 60px; /* Отступ для кнопки истории на планшетах */
    }

    .tagline {
        font-size: 0.8rem;
    }

    .main-nav {
        margin-top: 1rem;
        gap: 0.75rem;
        flex-wrap: wrap;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
    }

    .hero {
        padding: 6rem 0 5rem;
        min-height: 50vh;
    }

    .hero::before {
        animation-duration: 12s;
    }

    .hero-title {
        font-size: 2.8rem;
        line-height: 1.15;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .series-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .series-showcase {
        padding: 4rem 0 5rem;
    }

    .series-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        margin-top: 2rem;
    }

    .series-card {
        border-radius: 24px;
        backdrop-filter: blur(15px) saturate(140%);
        -webkit-backdrop-filter: blur(15px) saturate(140%);
    }

    .series-card-image {
        height: 220px;
    }

    .series-card-title-large {
        font-size: 2rem;
        padding: 0 1.5rem;
        letter-spacing: 0.05em;
    }

    .series-card-content {
        padding: 2rem 1.5rem;
    }

    .series-card-title {
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .series-card-description {
        font-size: 0.95rem;
        margin-bottom: 1.2rem;
    }

    .series-play-icon {
        font-size: 3.5rem;
        width: 70px;
        height: 70px;
    }

    .seasons {
        padding: 4rem 0 5rem;
    }

    .season {
        margin-bottom: 4rem;
    }

    .season-title {
        font-size: 2rem;
        padding-bottom: 1.2rem;
        margin-bottom: 1.2rem;
    }

    .season-title::after {
        width: 80px;
        height: 3px;
    }

    .season-episodes {
        font-size: 0.9rem;
        margin-bottom: 2rem;
    }

    .episodes-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.25rem;
    }

    .episode-card {
        border-radius: 20px;
        backdrop-filter: blur(15px) saturate(140%);
        -webkit-backdrop-filter: blur(15px) saturate(140%);
    }

    .episode-thumbnail-wrapper {
        height: 180px;
    }

    .episode-content {
        padding: 1.25rem;
    }

    .episode-title {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }

    .episode-description {
        font-size: 0.85rem;
    }

    .coming-soon-text {
        font-size: 2.5rem;
        padding: 1.5rem 2rem;
        letter-spacing: 0.1em;
    }

    .final-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
        top: 0.5rem;
        right: 0.5rem;
    }

    .episode-play-icon {
        font-size: 3rem;
        width: 60px;
        height: 60px;
    }


    .actors-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1.5rem;
    }

    .actor-card {
        min-height: 280px;
    }

    .actor-image-wrapper {
        height: 200px;
    }

    .video-modal-content {
        width: 95%;
        max-width: 100%;
        border-radius: 12px;
    }

    .video-modal-close {
        top: 0.5rem;
        right: 0.5rem;
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
    }

    .video-modal-header {
        padding: 1.5rem;
    }

    .video-modal-header h3 {
        font-size: 1.2rem;
    }

    .video-controls {
        bottom: 10px;
        padding: 8px 12px;
        gap: 6px;
        opacity: 1; /* Always visible on mobile */
    }

    .video-control-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }

    #playPauseBtn {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    /* Дополнительная оптимизация для маленьких экранов */
    body::before {
        display: none; /* Отключаем анимацию фона на маленьких экранах */
    }

    .container {
        padding: 0 1rem;
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }

    header {
        padding: 1.25rem 0;
        padding-top: max(1.25rem, env(safe-area-inset-top));
        backdrop-filter: blur(12px) saturate(130%);
        -webkit-backdrop-filter: blur(12px) saturate(130%);
    }

    .history-btn {
        left: 1rem;
        width: 40px;
        height: 40px;
    }

    .history-icon {
        font-size: 1.2rem;
    }

    .history-badge {
        font-size: 0.6rem;
        min-width: 16px;
        height: 16px;
        top: -2px;
        right: -2px;
    }

    .history-modal-content {
        width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .history-modal-header {
        padding: 1.25rem 1rem;
        padding-top: max(1.25rem, env(safe-area-inset-top));
    }

    .history-modal-header h2 {
        font-size: 1.3rem;
    }

    .history-list {
        padding: 0.75rem;
        max-height: calc(100vh - 140px);
    }

    .history-item {
        padding: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .history-item-title {
        font-size: 0.95rem;
    }

    .history-item-info {
        font-size: 0.85rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .history-modal-footer {
        padding: 1rem;
        padding-bottom: max(1rem, env(safe-area-inset-bottom));
    }

    .logo {
        font-size: 1.75rem;
        letter-spacing: 0.05em;
        margin-left: 50px; /* Отступ для кнопки истории на мобильных */
    }

    .tagline {
        font-size: 0.75rem;
    }

    .main-nav {
        gap: 0.5rem;
    }

    .nav-link {
        font-size: 0.85rem;
        padding: 0.4rem 0.8rem;
        min-height: 40px;
        min-width: 40px;
    }

    .hero {
        padding: 4rem 0 3rem;
        min-height: 40vh;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
        padding: 0 1rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        padding: 0 1rem;
    }

    .series-showcase {
        padding: 3rem 0 4rem;
    }

    .series-grid {
        gap: 1.5rem;
        margin-top: 1.5rem;
    }

    .series-card {
        border-radius: 20px;
    }

    .series-card-image {
        height: 180px;
    }

    .series-card-title-large {
        font-size: 1.5rem;
        padding: 0 1rem;
        letter-spacing: 0.03em;
    }

    .series-card-content {
        padding: 1.5rem 1.25rem;
    }

    .series-card-title {
        font-size: 1.4rem;
        margin-bottom: 0.8rem;
    }

    .series-card-description {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    .series-play-icon {
        font-size: 3rem;
        width: 60px;
        height: 60px;
    }

    .seasons {
        padding: 3rem 0 4rem;
    }

    .season {
        margin-bottom: 3.5rem;
    }

    .season-title {
        font-size: 1.6rem;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
    }

    .season-title::after {
        width: 60px;
        height: 2px;
    }

    .season-episodes {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    .episodes-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .episode-card {
        border-radius: 18px;
    }

    .episode-thumbnail-wrapper {
        height: 160px;
    }

    .episode-number {
        font-size: 2.5rem;
        top: 0.75rem;
        right: 0.75rem;
    }

    .episode-content {
        padding: 1.25rem 1rem;
    }

    .episode-title {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .episode-description {
        font-size: 0.8rem;
    }

    .episode-play-icon {
        font-size: 3rem;
        width: 60px;
        height: 60px;
        padding-left: 4px;
    }

    .coming-soon-text {
        font-size: 2rem;
        padding: 1.5rem 1.5rem;
        letter-spacing: 0.08em;
    }

    .final-badge {
        font-size: 0.7rem;
        padding: 0.35rem 0.7rem;
        top: 0.5rem;
        right: 0.5rem;
        border-radius: 18px;
    }

    .actors {
        padding: 3rem 0 4rem;
    }

    .actors-title {
        font-size: 1.8rem;
        margin-bottom: 3rem;
    }

    .actors-title::after {
        width: 80px;
        height: 3px;
        bottom: -15px;
    }

    .actors-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .actor-card {
        min-height: 240px;
        border-radius: 18px;
        backdrop-filter: blur(12px) saturate(130%);
        -webkit-backdrop-filter: blur(12px) saturate(130%);
    }

    .actor-image-wrapper {
        height: 160px;
    }

    .actor-info {
        padding: 1.25rem 1rem;
    }

    .actor-name {
        font-size: 1rem;
        margin-bottom: 0.4rem;
    }

    .actor-age {
        font-size: 0.85rem;
    }

    footer {
        padding: 3rem 0;
        padding-bottom: max(3rem, env(safe-area-inset-bottom));
    }

    footer p {
        font-size: 0.85rem;
    }

    .video-modal-content {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        margin: 0;
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .video-modal-close {
        top: max(0.5rem, env(safe-area-inset-top));
        right: max(0.5rem, env(safe-area-inset-right));
        width: 44px;
        height: 44px;
        font-size: 1.8rem;
    }

    .video-modal-header {
        padding: 1.25rem 1rem;
        padding-top: max(1.25rem, env(safe-area-inset-top));
    }

    .video-modal-header h3 {
        font-size: 1.1rem;
    }

    .video-modal-player {
        flex: 1;
        padding-bottom: 0;
        height: calc(100vh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }

    .video-controls {
        opacity: 1;
        bottom: max(10px, env(safe-area-inset-bottom));
        padding: 8px 12px;
        gap: 6px;
        flex-wrap: wrap;
        justify-content: center;
        max-width: calc(100% - 2rem);
    }

    .video-control-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
        min-width: 44px;
        min-height: 44px;
    }

    #playPauseBtn {
        font-size: 1.1rem;
    }

    .custom-pip-window {
        width: 200px;
        height: 140px;
    }

    /* CUTS оптимизация */
    .cuts-global-controls {
        right: max(0.75rem, env(safe-area-inset-right));
        bottom: max(0.75rem, env(safe-area-inset-bottom));
        gap: 0.4rem;
    }

    .cuts-global-btn {
        width: 44px;
        height: 44px;
        padding: 0.5rem;
        font-size: 1rem;
        min-width: 44px;
        min-height: 44px;
    }
}

/* Fullscreen mode styles */
.video-modal-player:fullscreen,
.video-modal-player:-webkit-full-screen,
.video-modal-player:-moz-full-screen,
.video-modal-player:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
    padding-bottom: 0;
    background-color: #000;
}

.video-modal-player:fullscreen video,
.video-modal-player:-webkit-full-screen video,
.video-modal-player:-moz-full-screen video,
.video-modal-player:-ms-fullscreen video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.video-modal-player:fullscreen .video-controls,
.video-modal-player:-webkit-full-screen .video-controls,
.video-modal-player:-moz-full-screen .video-controls,
.video-modal-player:-ms-fullscreen .video-controls {
    opacity: 1;
}

/* Custom PiP window styles */
.custom-pip-window {
    position: fixed;
    width: 300px;
    height: 200px;
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    z-index: 10004;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border: 2px solid var(--accent);
    cursor: move;
    user-select: none;
}

.custom-pip-header {
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    padding: 8px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    cursor: move;
}

.custom-pip-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.custom-pip-close {
    background: rgba(255, 0, 0, 0.4);
    border: 1px solid rgba(255, 0, 0, 0.3);
    color: var(--text-primary);
    font-size: 1rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.custom-pip-close:hover {
    background: rgba(255, 0, 0, 0.7);
    transform: scale(1.1);
}

.custom-pip-video-wrapper {
    width: 100%;
    height: calc(100% - 40px);
    background-color: #000;
    position: relative;
}

.custom-pip-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --- Minimal video progress + settings --- */
.video-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 56px;
    height: 16px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
}
.video-progress-bar {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 8px;
    height: 4px;
    background: rgba(255,255,255,0.12);
    border-radius: 2px;
    overflow: hidden;
    pointer-events: none;
}
.video-progress-bar::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--buffered, 0%);
    background: rgba(255,255,255,0.24);
}
.seek-bar {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    background: transparent;
    height: 16px;
    cursor: pointer;
}
.seek-bar:focus { outline: none; }
.seek-bar::-webkit-slider-runnable-track {
    height: 4px;
    background: linear-gradient(90deg, var(--accent) calc(var(--value, 0%) ), rgba(255,255,255,0.12) 0);
    border-radius: 2px;
}
.seek-bar::-moz-range-track {
    height: 4px;
    background: linear-gradient(90deg, var(--accent) calc(var(--value, 0%) ), rgba(255,255,255,0.12) 0);
    border-radius: 2px;
}
.seek-bar::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid rgba(0,0,0,0.4);
    margin-top: -4px;
    box-shadow: 0 2px 6px var(--shadow);
}
.seek-bar::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid rgba(0,0,0,0.4);
    box-shadow: 0 2px 6px var(--shadow);
}
.video-time {
    position: absolute;
    left: 12px;
    bottom: 28px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    user-select: none;
    text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.video-settings {
    position: absolute;
    right: 12px;
    bottom: 80px;
    min-width: 220px;
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 10px 12px;
    box-shadow: 0 8px 24px var(--shadow);
    color: var(--text-primary);
    z-index: 10005;
}
.video-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}
.video-setting-row label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}
.video-setting-row select {
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 6px 8px;
}
.volume-control-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 200px;
}
.volume-slider {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}
.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}
.volume-slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.6);
}
.volume-value {
    font-size: 0.9rem;
    color: var(--text-secondary);
    min-width: 45px;
    text-align: right;
}
.video-quality-note {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Trailer button (minimal style) */
.trailer-btn {
    margin-top: 0.75rem;
    background: rgba(255,255,255,0.06);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}
.trailer-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
}
.trailer-btn:active {
    transform: scale(0.98);
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Отключаем hover-эффекты на touch-устройствах */
    .episode-card:hover,
    .actor-card:hover,
    .series-card:hover {
        transform: none;
        filter: none;
    }

    .episode-card:active,
    .actor-card:active,
    .series-card:active {
        transform: scale(0.98);
        opacity: 0.9;
    }
    
    /* Улучшаем touch-цели */
    .episode-card,
    .actor-card,
    .series-card,
    .nav-link,
    .video-control-btn,
    .cut-btn {
        -webkit-tap-highlight-color: rgba(251, 191, 36, 0.2);
        cursor: pointer;
    }
    
    /* Reduce backdrop-filter on mobile for better performance */
    .episode-card,
    .actor-card,
    .series-card,
    .video-modal-content,
    header {
        backdrop-filter: blur(10px) saturate(120%);
        -webkit-backdrop-filter: blur(10px) saturate(120%);
    }

    /* Упрощаем анимации */
    .hero::before {
        animation: none;
        opacity: 0.8;
    }

    body::before {
        animation: none;
        opacity: 0.6;
    }

    /* Всегда показываем контролы видео */
    .video-controls {
        opacity: 1 !important;
    }

    /* Улучшаем скролл */
    .cuts-viewport {
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
    }
}

/* Оптимизация для landscape на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 4rem 0 3rem;
        min-height: auto;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .video-modal-player {
        height: calc(100vh - 60px);
    }
}

/* Оптимизация для очень маленьких экранов */
@media (max-width: 360px) {
    .container {
        padding: 0 0.75rem;
    }

    .logo {
        font-size: 1.5rem;
        margin-left: 45px; /* Отступ для кнопки истории на маленьких экранах */
    }

    .hero-title {
        font-size: 1.75rem;
    }

    .series-card-title-large {
        font-size: 1.25rem;
    }

    .season-title {
        font-size: 1.4rem;
    }

    .actors-grid {
        grid-template-columns: 1fr;
    }
}
