/* ==================== FONTS ==================== */
@font-face{font-family:"Montserrat";src:url("../assets/fonts/_Montserrat-Regular.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap}
@font-face{font-family:"Montserrat";src:url("../assets/fonts/_Montserrat-Medium.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap}
@font-face{font-family:"Montserrat";src:url("../assets/fonts/_Montserrat-Bold.woff2") format("woff2");font-weight:700;font-style:normal;font-display:swap}

/* ==================== RESET ==================== */
*{box-sizing:border-box}
html,body{height:100%;overflow-x:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior:none}
body{margin:0;font:400 14px/1.4 "Montserrat",system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--fg);touch-action:pan-y}
img{display:block;max-width:100%}
a{color:inherit;text-decoration:none}
button{font:inherit;color:inherit;background:none;border:none;cursor:pointer}
html{scroll-behavior:smooth}

/* ==================== CSS VARIABLES ==================== */
:root{
--bg:#0b0711;
--fg:#eceaf4;
--muted:#a9a5b5;
--brand:#6c7bff;
--accent:#ff4ddb;
--blue:#2ea8ff;
--surface:#1b1426;
--card:#1f172c;
--radius:14px;
--w:clamp(300px,92vw,1100px);
--border:1px solid rgba(255,255,255,.08);
--transition:.2s ease;
--shadow:0 8px 25px rgba(0,0,0,.35);
--hover-shadow:0 10px 30px rgba(0,0,0,.3)
}

/* ==================== THEME ==================== */
.theme--dark{background:radial-gradient(1000px 1000px at 30% -10%,#1a1225 0%,#0b0711 45%),var(--bg);color:var(--fg)}

/* Light theme */
@media (prefers-color-scheme:light){
:root{
--bg:#f7f7fb;
--bg-elev:#ffffff;
--text:#16141f;
--text-muted:#5f5b73;
--accent:#d81b60;
--accent-2:#5c3aff;
--card:#ffffff;
--chip-bg:#f1f0f6;
--tabbar-bg:rgba(255,255,255,.9);
--tabbar-active:#d81b60;
--border:rgba(0,0,0,.08);
color-scheme:light
}
}

body.theme--light{
--bg:#f8fafc;
--bg-elev:#ffffff;
--text:#1a1d2e;
--text-muted:#6b7280;
--accent:#ec4899;
--accent-2:#8b5cf6;
--card:#ffffff;
--chip-bg:#f1f5f9;
--tabbar-bg:rgba(255,255,255,.95);
--tabbar-active:#ec4899;
--border:rgba(0,0,0,.08);
--surface:#f1f5f9;
--shadow:0 3px 15px rgba(0,0,0,.08);
--hover-shadow:0 10px 25px rgba(0,0,0,.12);
background:radial-gradient(1000px 1000px at 30% -10%,#f0f4ff 0%,#f8fafc 45%),var(--bg);
color:var(--text);
color-scheme:light
}

/* ==================== ANIMATIONS ==================== */
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes fadeInUp{from{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}
@keyframes fadeInDown{from{opacity:0;transform:translateY(-20px)}to{opacity:1;transform:translateY(0)}}
@keyframes fadeInLeft{from{opacity:0;transform:translateX(-20px)}to{opacity:1;transform:translateX(0)}}
@keyframes fadeInRight{from{opacity:0;transform:translateX(20px)}to{opacity:1;transform:translateX(0)}}
@keyframes scaleIn{from{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}
@keyframes pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.03)}}
@keyframes bounce{0%,20%,53%,80%,100%{transform:translateY(0)}40%,43%{transform:translateY(-10px)}70%{transform:translateY(-5px)}}
@keyframes shake{0%,100%{transform:translateX(0)}25%{transform:translateX(-3px)}75%{transform:translateX(3px)}}
@keyframes rotate{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
@keyframes slideInUp{from{transform:translateY(100%)}to{transform:translateY(0)}}
@keyframes slideInDown{from{transform:translateY(-100%)}to{transform:translateY(0)}}
@keyframes glowPulse{0%,100%{box-shadow:0 0 3px rgba(255,77,219,.3)}50%{box-shadow:0 0 12px rgba(255,77,219,.7)}}
@keyframes heartBeat{0%,100%{transform:scale(1)}25%{transform:scale(1.2)}50%{transform:scale(1)}75%{transform:scale(1.1)}}

/* Animation classes */
.animate-fadeIn{animation:fadeIn .5s ease-out}
.animate-fadeInUp{animation:fadeInUp .5s ease-out}
.animate-fadeInDown{animation:fadeInDown .5s ease-out}
.animate-fadeInLeft{animation:fadeInLeft .5s ease-out}
.animate-fadeInRight{animation:fadeInRight .5s ease-out}
.animate-scaleIn{animation:scaleIn .4s ease-out}
.animate-pulse{animation:pulse 1.5s infinite}
.animate-bounce{animation:bounce .8s ease-in-out}
.animate-shake{animation:shake .4s ease-in-out}
.animate-rotate{animation:rotate 1.5s linear infinite}
.animate-slideInUp{animation:slideInUp .3s ease-out}
.animate-slideInDown{animation:slideInDown .3s ease-out}
.animate-heartBeat{animation:heartBeat .5s ease-in-out}
.animate-glowPulse{animation:glowPulse 1.5s infinite}

/* Delays */
.delay-100{animation-delay:.1s}
.delay-200{animation-delay:.15s}
.delay-300{animation-delay:.2s}
.delay-400{animation-delay:.25s}
.delay-500{animation-delay:.3s}

/* ==================== LAYOUT ==================== */
.container{width:var(--w);margin-inline:auto;padding-inline:12px}
.main{padding:10px 0 60px;min-height:calc(100vh - 120px);animation:fadeIn .6s ease-out}

/* ==================== HEADER ==================== */
.header{position:sticky;top:0;z-index:10;backdrop-filter:blur(6px);background:rgba(11,7,17,.6);border-bottom:var(--border);animation:fadeIn .4s ease-out}
.header__inner{height:56px;display:flex;align-items:center;justify-content:space-between;animation:fadeIn .6s ease-out}
.header__actions{display:flex;gap:10px;animation:fadeInRight .5s ease-out}
.logo{display:inline-flex;align-items:center;gap:6px;font-weight:700;letter-spacing:.3px;transition:var(--transition);animation:scaleIn .5s ease-out}
.logo:hover{transform:scale(1.03);filter:drop-shadow(0 0 8px rgba(255,77,219,.5))}
.logo__icon{width:16px;height:auto;filter:brightness(0) invert(1);transition:var(--transition)}
.logo__text{font-size:16px;font-weight:700;letter-spacing:.3px}

/* ==================== BUTTONS ==================== */
.btn{display:inline-flex;align-items:center;gap:6px;padding:10px 14px;border-radius:12px;border:1px solid transparent;font-weight:600;transition:var(--transition)}
.btn:hover{filter:brightness(1.05);transform:translateY(-1px)}
.btn .i{width:16px;height:16px}
.btn--ghost{background:transparent;border:1px solid rgba(255,255,255,.2);color:#e8defb}
.btn--ghost:hover{transform:translateY(-1px);border-color:var(--accent)}
.search-filter-control{
  background:#fff !important;
  color:#111 !important;
  border:1px solid rgba(0,0,0,.18) !important;
}
.search-filter-control::placeholder{color:#666 !important}
.search-cards-collection .collection-movie-card{
  width:auto;
  min-width:0;
  background:transparent !important;
  border:none !important;
  border-radius:0;
  padding:0;
  box-shadow:none !important;
}
.search-cards-collection .movie-poster{
  margin-bottom:8px;
  border-radius:0;
}
.search-cards-collection .movie-title,
.search-cards-collection .movie-year,
.search-cards-collection .movie-genre{
  background:transparent !important;
}
/* Унифицируем новый вид карточек во всех grid-контейнерах .cards */
.cards .collection-movie-card{
  width:auto;
  min-width:0;
  background:transparent !important;
  border:none !important;
  border-radius:0;
  padding:0;
  box-shadow:none !important;
}
.cards .movie-poster{
  margin-bottom:8px;
  border-radius:0;
}
.cards .movie-title,
.cards .movie-year,
.cards .movie-genre{
  background:transparent !important;
}
.btn--apply{background:linear-gradient(135deg,var(--accent),#a65bff);color:#140a1a}
.btn--apply:hover{transform:translateY(-1px);animation:pulse .8s infinite}
.pill{display:inline-flex;align-items:center;gap:6px;padding:8px 12px;border-radius:12px;background:#2a2036;border:var(--border);color:#e8defb;transition:var(--transition)}
.pill:hover{transform:translateY(-1px);background:#3a2a52}
.pill--ghost{background:transparent;border-color:rgba(255,255,255,.14)}
.pill .i{width:16px;height:16px}

/* ==================== HERO ROW / BANNERS ==================== */
.hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 0 16px;
}

.hero-row {
    overflow-x: scroll;
    overflow-y: hidden;
    padding: 16px 0 14px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y pinch-zoom;
    overscroll-behavior: contain;
    white-space: nowrap;
    width: 100%;
}

/* ДЕСКТОП - максимально увеличиваем высоту */
@media screen and (min-width: 1024px) {
    .hero-row {
        max-height: 65vh; /* Сильно увеличили */
    }
    
    .hero-row .hero-card,
    .hero-row .banner-card {
        flex: 0 0 calc((100% - 40px)/2.2); /* Еще шире */
        scroll-snap-align: start;
        animation: fadeInUp .5s ease-out;
        border-radius: 24px;
    }
    
    .hero-row .hero-card__img,
    .hero-row .banner-card__img {
        width: 100%;
        height: 58vh; /* Значительно увеличили */
        max-height: 550px; /* Сильно увеличили */
        min-height: 450px; /* Увеличили минимальную высоту */
        object-fit: cover;
        display: block;
        transition: var(--transition);
    }
}

/* ПЛАНШЕТЫ - увеличиваем высоту */
@media screen and (min-width: 768px) and (max-width: 1023px) {
    .hero-row {
        max-height: 52vh;
    }
    
    .hero-row .hero-card,
    .hero-row .banner-card {
        flex: 0 0 calc((100% - 32px)/2.4);
        border-radius: 22px;
    }
    
    .hero-row .hero-card__img,
    .hero-row .banner-card__img {
        width: 100%;
        height: 45vh;
        max-height: 420px;
        min-height: 350px;
        object-fit: cover;
    }
}

/* ТЕЛЕФОНЫ - значительно увеличиваем высоту */
@media screen and (max-width: 767px) {
    .hero-row {
        max-height: 48vh; /* Увеличили */
        padding: 14px 0 12px;
    }
    
    .hero-row .hero-card,
    .hero-row .banner-card {
        flex: 0 0 calc((100% - 20px)/1.9); /* Еще шире */
        border-radius: 20px;
    }
    
    .hero-row .hero-card__img,
    .hero-row .banner-card__img {
        width: 100%;
        height: 42vh; /* Увеличили */
        max-height: 380px; /* Увеличили */
        min-height: 300px; /* Увеличили минимальную высоту */
        object-fit: cover;
        display: block;
        transition: var(--transition);
    }
}

/* ОЧЕНЬ МАЛЕНЬКИЕ ТЕЛЕФОНЫ */
@media screen and (max-width: 480px) {
    .hero-row {
        max-height: 45vh;
    }
    
    .hero-row .hero-card,
    .hero-row .banner-card {
        flex: 0 0 calc((100% - 16px)/1.6); /* Максимально широкие */
        border-radius: 18px;
    }
    
    .hero-row .hero-card__img,
    .hero-row .banner-card__img {
        width: 100%;
        height: 40vh;
        max-height: 340px;
        min-height: 280px;
    }
}

/* БОЛЬШИЕ ДЕСКТОПЫ */
@media screen and (min-width: 1440px) {
    .hero-row {
        max-height: 70vh;
    }
    
    .hero-row .hero-card,
    .hero-row .banner-card {
        flex: 0 0 calc((100% - 48px)/2.1);
    }
    
    .hero-row .hero-card__img,
    .hero-row .banner-card__img {
        height: 62vh;
        max-height: 650px;
        min-height: 550px;
    }
}

/* ОЧЕНЬ БОЛЬШИЕ ЭКРАНЫ */
@media screen and (min-width: 1920px) {
    .hero-row {
        max-height: 75vh;
    }
    
    .hero-row .hero-card,
    .hero-row .banner-card {
        flex: 0 0 calc((100% - 56px)/2);
    }
    
    .hero-row .hero-card__img,
    .hero-row .banner-card__img {
        height: 68vh;
        max-height: 750px;
        min-height: 650px;
    }
}

/* Общие стили для всех устройств */
.hero-row .hero-card,
.hero-row .banner-card {
    position: relative;
    overflow: hidden;
    background: var(--card);
    border: 1px solid transparent;
    transition: all 0.3s ease;
    scroll-snap-align: start;
    animation: fadeInUp .5s ease-out;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.hero-row .hero-card:hover,
.hero-row .banner-card:hover {
    border-color: rgba(255, 77, 219, 0.7);
    transform: translateY(-6px) scale(1.03);
    box-shadow: 0 12px 32px rgba(255, 77, 219, 0.2);
}

.hero-row .hero-card:hover .hero-card__img,
.hero-row .banner-card:hover .banner-card__img {
    transform: scale(1.1);
}

/* Стилизация скроллбара */
.hero-row::-webkit-scrollbar {
    height: 6px;
}

.hero-row::-webkit-scrollbar-thumb {
    background: rgba(255, 77, 219, 0.5);
    border-radius: 12px;
    transition: var(--transition);
}

.hero-row::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 77, 219, 0.9);
}

.hero-row::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
}

/* Контейнер для контента внутри банера */
.hero-card__content,
.banner-card__content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    color: white;
    border-bottom-left-radius: 24px;
    border-bottom-right-radius: 24px;
    font-size: 1.1rem;
}

/* Заголовки внутри банеров */
.hero-card__title,
.banner-card__title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.hero-card__subtitle,
.banner-card__subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* ==================== CHIPS ==================== */
.chips{display:flex;gap:10px;overflow:auto;padding:10px 0 4px;touch-action:pan-y;animation:fadeInUp .5s ease-out}
.chip{padding:10px 14px;border-radius:12px;background:#2a2036;border:var(--border);color:#d7d3e3;white-space:nowrap;transition:var(--transition)}
.chip:hover{transform:translateY(-1px);background:#3a2a52}
.chip--active{background:#3a2a52;border-color:rgba(255,255,255,.12);animation:glowPulse 1.5s infinite}

/* ==================== CARDS ==================== */
.section{padding:12px 0 2px;animation:fadeInUp .5s ease-out}
.h2,.h3{margin:6px 0 10px;font-size:18px;animation:fadeInLeft .5s ease-out}
.cards{display:grid;grid-template-columns:repeat(2,1fr);gap:12px;touch-action:pan-y}
.card{background:var(--card);border:var(--border);border-radius:14px;padding:8px;transition:var(--transition);box-shadow:var(--shadow);animation:scaleIn .4s ease-out}
.card:hover{transform:translateY(-3px);box-shadow:var(--hover-shadow);border-color:rgba(255,255,255,.25);animation:glowPulse 1.5s infinite}
.card__img{height:70px;border-radius:10px;background:linear-gradient(180deg,rgba(255,255,255,.06),rgba(255,255,255,0)),url("../assets/images/home/hero-left.jpg") center/cover no-repeat;transition:var(--transition)}
.card:hover .card__img{transform:scale(1.03)}
.badge-online{
  position:absolute;
  top:6px;
  left:6px;
  background:linear-gradient(135deg,#667eea,#764ba2);
  color:#fff;
  font-size:10px;
  padding:2px 8px;
  border-radius:10px;
  font-weight:600;
  letter-spacing:.2px;
}
.card__row{display:flex;align-items:center;justify-content:space-between;gap:6px;margin-top:8px;animation:fadeInUp .3s ease-out}
.card__title{margin:0;font-size:10px;font-weight:600}

/* Hidden badge */
.badge{color:transparent!important;background:transparent!important;border-color:transparent!important;animation:none!important;box-shadow:none!important}

/* ==================== TABBAR ==================== */
.tabbar{position:fixed;left:0;right:0;bottom:0;display:flex;justify-content:space-around;align-items:center;padding:8px 4px;background:#0b0711f2;border-top:1px solid #201734;backdrop-filter:blur(6px) saturate(130%);z-index:1000;touch-action:none;pointer-events:auto;animation:slideInUp .4s ease-out}
.tabbar__item{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;color:#e9d7ff;text-decoration:none;font-size:11px;transition:var(--transition)}
.tabbar__item:hover{transform:translateY(-2px)}
.tabbar__item img{width:18px;height:18px;transition:var(--transition)}
.tabbar__item:active img{transform:translateY(1px) scale(.96)}
.tabbar__ink{position:absolute;bottom:3px;left:50%;transform:translateX(-50%);width:24px;height:4px;border-radius:6px;filter:blur(4px);opacity:.85;background:linear-gradient(90deg,#ff7bf5,#8b3dff);transition:var(--transition)}
.tabbar__item--active .tabbar__ink{animation:glowPulse 1.5s infinite}
.tabbar__item--active{animation:bounce .4s ease-in-out}

/* ==================== MODAL/DIALOG ==================== */
.filters{border:none;padding:0;background:transparent;animation:scaleIn .2s ease-out}
.filters::backdrop{background:rgba(0,0,0,.6);animation:fadeIn .2s ease-out}
.filters__panel{width:min(90vw,320px);background:#1f172c;color:var(--fg);border:var(--border);border-radius:14px;padding:14px;animation:slideInUp .3s ease-out}
.filters__title{margin:0 0 10px;font-size:16px;font-weight:700;animation:fadeInDown .3s ease-out}
.filters__row{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:6px 0;animation:fadeInUp .3s ease-out}
.filters__row select{background:#2a2036;border:1px solid rgba(255,255,255,.12);color:var(--fg);padding:6px 8px;border-radius:8px;transition:var(--transition)}
.filters__row select:focus{transform:scale(1.01);border-color:var(--accent)}
.filters__buttons{display:flex;gap:8px;justify-content:flex-end;margin-top:10px;animation:fadeInUp .4s ease-out}

/* ==================== RESPONSIVE ==================== */
@media (min-width:768px){
.hero{grid-template-columns:1fr 1fr}
.cards{grid-template-columns:repeat(3,1fr)}
.card__img{height:140px}
.hero-row .hero-card,.hero-row .banner-card{flex:0 0 calc((100% - 16px)/4)}
.hero-row .hero-card__img,.hero-row .banner-card__img{height:12vh;max-height:100px}
}

@media (min-width:1024px){
.cards{grid-template-columns:repeat(4,1fr)}
.card__img{height:160px}
.hero-row .hero-card,.hero-row .banner-card{flex:0 0 calc((100% - 24px)/5)}
.hero-row .hero-card__img,.hero-row .banner-card__img{height:10vh;max-height:90px}
}

@media (max-width:520px){
.hero-row .hero-card,.hero-row .banner-card{flex:0 0 calc((100% - 16px)/2)}
.hero-row .hero-card__img,.hero-row .banner-card__img{height:18vh;max-height:140px}
}

/* ==================== LIGHT THEME OVERRIDES ==================== */
.theme--light .logo__icon{filter:brightness(0) invert(0)}
.theme--light .pill{background:var(--chip-bg);border:var(--border);color:var(--text)}
.theme--light .pill--ghost{background:transparent;border-color:rgba(0,0,0,.12)}
.theme--light .btn--ghost{border:1px solid rgba(0,0,0,.15);color:var(--text)}
.theme--light .btn--apply{background:linear-gradient(135deg,var(--accent),var(--accent-2));color:#fff}
.theme--light .card{box-shadow:var(--shadow);border:var(--border)}
.theme--light .card:hover{box-shadow:var(--hover-shadow);border-color:rgba(0,0,0,.15)}
.theme--light .hero-card,.theme--light .banner-card{border:var(--border)}
.theme--light .tabbar{border-top:var(--border)}
.theme--light .tabbar__item{color:var(--text-muted)}
.theme--light .tabbar__item--active{color:var(--tabbar-active)}
.theme--light .tabbar__ink{background:linear-gradient(90deg,var(--accent),var(--accent-2))}
.theme--light .filters__panel{background:var(--card);border:var(--border)}
.theme--light .filters__row select{background:var(--chip-bg);border:var(--border);color:var(--text)}
.theme--light .header{background:rgba(248,250,252,.8);border-bottom:var(--border)}
.theme--light .chip{background:var(--chip-bg);border:var(--border);color:var(--text)}
.theme--light .chip:hover{background:#e2e8f0}
.theme--light .chip--active{background:var(--accent);color:#fff;border-color:var(--accent)}
.theme--light .hero-row::-webkit-scrollbar-thumb{background:rgba(0,0,0,.2)}
.theme--light .hero-row::-webkit-scrollbar-thumb:hover{background:rgba(0,0,0,.4)}

/* ==================== UTILITIES ==================== */
.scroll-animate{opacity:0;transform:translateY(20px);transition:all .5s ease}
.scroll-animate.visible{opacity:1;transform:translateY(0)}

/* ==================== DESKTOP / MAC OPTIMIZATIONS ==================== */
@media screen and (min-width: 1024px) {
    /* Wider max content width on desktop */
    :root { --w: clamp(800px, 96vw, 1400px); }

    /* More card columns */
    .cards { grid-template-columns: repeat(5, 1fr); gap: 16px; }
    .card__img { height: 200px; }
    .card { padding: 10px; }

    /* Bigger section titles */
    .h2, .h3 { font-size: 22px; }
    .main { padding: 16px 0 80px; }

    /* Desktop tabbar - centered and more spacious */
    .tabbar {
        justify-content: center;
        gap: 0;
        height: 64px;
        padding: 0 40px;
    }
    .tabbar__item {
        padding: 10px 24px;
        font-size: 13px;
        gap: 6px;
    }
    .tabbar__item img { width: 20px; height: 20px; }

    /* Banners taller on desktop */
    .banners-track { height: 260px !important; }

    /* Chips row more compact */
    .chips { padding: 12px 0 8px; gap: 12px; }
    .chip { padding: 10px 18px; font-size: 14px; }

    /* Wider hero row */
    .hero-row { padding: 20px 0 16px; }
}

@media screen and (min-width: 1440px) {
    .cards { grid-template-columns: repeat(6, 1fr); }
    .card__img { height: 220px; }
    .tabbar { gap: 0; padding: 0 80px; }
    .tabbar__item { padding: 10px 32px; }
}

@media screen and (min-width: 1920px) {
    :root { --w: clamp(1000px, 90vw, 1800px); }
    .cards { grid-template-columns: repeat(7, 1fr); }
    .card__img { height: 240px; }
}

/* Mouse-based hover improvements (desktop) */
@media (hover: hover) and (pointer: fine) {
    .card:hover { transform: translateY(-6px); }
    .chip:hover { transform: translateY(-2px); }
    .tabbar__item:hover { transform: translateY(-3px); }
    /* Show scrollbar on hover for hero-row */
    .hero-row::-webkit-scrollbar { height: 8px; }
}

/* Prevent overflow on desktop */
@media screen and (min-width: 1024px) {
    html, body { overflow-x: hidden; }
}

/* ==================== APPLE-STYLE GLASS UPGRADE ==================== */
.header,
.tabbar,
.chip,
.card,
.filters__panel,
.modal-content {
    backdrop-filter: blur(18px) saturate(135%);
    -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.header {
    background: linear-gradient(180deg, rgba(13, 10, 20, 0.76), rgba(13, 10, 20, 0.54));
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-scrolled .header {
    background: linear-gradient(180deg, rgba(13, 10, 20, 0.9), rgba(13, 10, 20, 0.72));
    box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
}

.hero-row {
    position: relative;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 10px 0 20px;
    overflow: hidden;
}

#heroTrack {
    will-change: transform;
}

.banner-slide {
    position: relative;
    min-height: clamp(300px, 52vh, 620px);
    border-radius: 26px;
    overflow: hidden;
    margin: 0 14px;
    background-color: rgba(255, 255, 255, 0.04);
    background-repeat: no-repeat;
    background-position: center center;
    background-size: contain;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

@media (min-width: 768px) {
    .banner-slide {
        background-size: cover;
    }
}

.banner-slide::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.08) 15%, rgba(0, 0, 0, 0.55) 72%, rgba(0, 0, 0, 0.78) 100%);
}

.banner-slide__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    opacity: var(--banner-veil-opacity, 0.56);
    transition: opacity 0.3s ease;
    background: radial-gradient(120% 90% at 50% 100%, rgba(0, 0, 0, 0.76) 0%, rgba(0, 0, 0, 0.22) 58%, rgba(0, 0, 0, 0.04) 100%);
}

.banner-slide__glass {
    position: absolute;
    left: 20px;
    right: 20px;
    bottom: 20px;
    z-index: 2;
    padding: 14px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.06));
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(12px);
}

.banner-slide__eyebrow {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.82);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.banner-slide__title {
    margin: 0;
    font-size: clamp(20px, 4.2vw, 38px);
    line-height: 1.1;
    color: #fff;
}

.banner-slide__subtitle {
    margin: 6px 0 0;
    font-size: clamp(12px, 2.6vw, 16px);
    color: rgba(255, 255, 255, 0.88);
}

.banner-nav-prev,
.banner-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(20, 17, 30, 0.42);
    backdrop-filter: blur(8px);
}

.banner-nav-prev { left: 22px; }
.banner-nav-next { right: 22px; }

.banner-dots {
    position: absolute;
    bottom: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 8px;
}

.banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    transition: all 0.2s ease;
}

.banner-dot.active {
    width: 22px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
}

/* Чутка меньше карточки категорий */
.cards { gap: 10px; }
.card { padding: 7px; border-radius: 13px; }
.card__img { height: 148px; border-radius: 10px; }

@media (min-width: 768px) {
    .card__img { height: 180px; }
}

@media (min-width: 1024px) {
    .card__img { height: 190px; }
}

@media (max-width: 767px) {
    .hero-row { padding: 0 0 16px; }
    .banner-slide {
        margin: 0 8px;
        min-height: clamp(280px, 52vh, 460px);
        border-radius: 18px;
    }
    .banner-slide__glass {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 10px 12px;
    }
    .banner-nav-prev, .banner-nav-next {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
    .banner-nav-prev { left: 10px; }
    .banner-nav-next { right: 10px; }
}

/* ==================== PREMIUM PROFILE + UX ==================== */
.skeleton-grid { opacity: 0.95; }
.skeleton-card { overflow: hidden; }
.skeleton-block, .skeleton-line {
    position: relative;
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
    overflow: hidden;
}
.skeleton-line { height: 10px; }
.skeleton-block::after, .skeleton-line::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer { 100% { transform: translateX(100%); } }

.profile-parallax-header { overflow: visible; }
.profile-hero-card {
    background: linear-gradient(135deg, rgba(255,255,255,0.16), rgba(255,255,255,0.06));
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 22px;
    padding: 16px;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    transition: transform .2s ease;
}
.profile-hero-card__top { display:flex; align-items:center; gap:12px; }
.profile-avatar {
    width: 56px; height: 56px; border-radius: 50%;
    display:flex; align-items:center; justify-content:center;
    background: linear-gradient(135deg,#7c86ff,#b46fff);
    color:#fff; font-weight:700; font-size:22px;
}
.profile-name { margin:0; font-size:20px; }
.profile-id { margin:2px 0 0; color:var(--muted); font-size:12px; }
.plan-badge { margin-left:auto; padding:6px 10px; border-radius:999px; background:rgba(255,255,255,0.14); font-size:12px; }
.profile-sub-status { margin-top:12px; font-size:14px; }
.profile-sub-status.active { color:#8ef0b3; }
.profile-sub-status.inactive { color:#ff9ca8; }
.subscription-progress { margin-top:10px; height:8px; border-radius:999px; background:rgba(255,255,255,0.1); overflow:hidden; }
.subscription-progress span { display:block; height:100%; background:linear-gradient(90deg,#9b7bff,#49d0ff); }
.profile-hero-actions { margin-top:14px; display:flex; gap:8px; flex-wrap:wrap; }

.wallet-card {
    background: linear-gradient(135deg, rgba(84,78,126,0.35), rgba(43,54,90,0.28));
    border: 1px solid rgba(255,255,255,0.14);
    border-radius: 20px;
    padding: 14px;
}
.wallet-head { display:flex; justify-content:space-between; align-items:center; gap:8px; }
.wallet-values { margin-top:12px; display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.wallet-label { color:var(--muted); font-size:12px; }
.wallet-amount { font-size:24px; font-weight:700; }
.wallet-amount--sub { font-size:18px; color:#d6c9ff; }
.wallet-history { margin-top:10px; color:var(--muted); font-size:12px; display:grid; gap:4px; }

.continue-rail {
    display:flex; gap:10px; overflow-x:auto; padding-bottom:4px;
    scroll-snap-type:x mandatory;
}
.continue-card {
    min-width: 140px; max-width: 140px;
    border:1px solid rgba(255,255,255,0.14);
    border-radius:14px; overflow:hidden; background:rgba(255,255,255,0.04);
    scroll-snap-align:start;
}
.continue-card img { width:100%; height:180px; object-fit:cover; }
.continue-card__meta { padding:8px; }
.continue-card__title { font-size:12px; color:#eceaf4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.continue-card__progress { margin-top:6px; height:4px; border-radius:999px; background:rgba(255,255,255,0.14); overflow:hidden; }
.continue-card__progress span { display:block; height:100%; background:linear-gradient(90deg,#7f7bff,#59d3ff); }

.profile-empty-state { text-align:center; padding:16px; }

/* Apple-like modal sheet on mobile */
@media (max-width: 767px) {
    .modal { align-items: flex-end; }
    .modal.modal--center { align-items: center; justify-content: center; padding: 16px; }
    .modal .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        border-radius: 18px 18px 0 0;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
        animation: sheetUp .35s cubic-bezier(.22,1,.36,1);
    }
    .modal.modal--center .modal-content {
        max-width: 500px;
        width: min(500px, calc(100% - 24px));
        margin: 0 auto;
        border-radius: 16px;
        padding-bottom: 20px;
        animation: fadeInDown .25s ease;
    }
    @keyframes sheetUp {
        from { transform: translateY(100%); opacity: .9; }
        to { transform: translateY(0); opacity: 1; }
    }
}

/* Mobile Apple-TV-like banner without blocking chips/cards */
@media (max-width: 767px) {
    .hero-row {
        position: relative;
        z-index: 1;
        overflow: hidden;
        padding: 0 0 18px;
    }
    .hero-row::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        height: 150px;
        pointer-events: none;
        z-index: 3;
        /* Start fade near 80% banner height into app black */
        background: linear-gradient(180deg, rgba(10, 12, 20, 0) 0%, rgba(10, 12, 20, 0) 76%, rgba(10, 12, 20, 0.58) 86%, rgba(10, 12, 20, 0.88) 94%, rgba(10, 12, 20, 1) 100%);
    }
    .banner-slide {
        margin: 0;
        border-radius: 0;
        min-height: clamp(300px, 58vh, 460px);
        box-shadow: none;
    }
    .banner-slide__glass {
        left: 14px;
        right: 14px;
        bottom: 16px;
        z-index: 4;
    }
    .chips {
        position: relative;
        z-index: 6;
        margin-top: -26px;
        padding-top: 0;
    }

    /* Вернуть сетку карточек как раньше в "Все фильмы" */
    #contentSection .cards {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    #contentSection .card {
        padding: 8px;
    }
    #contentSection .card__img {
        height: 160px;
    }
}
