/* Mobile cinema direction: full-bleed artwork, clear metadata and confident
   touch targets. Kept separate from desktop styling and scoped to public pages. */
@media (max-width: 720px) {
  body:has(.cinema-nav) {
    --mobile-gutter: 16px;
    background:
      radial-gradient(90% 32% at 50% 0%, rgba(229, 9, 20, .085), transparent 76%),
      #050505;
  }

  body:has(.cinema-nav) .nav.cinema-nav {
    top: max(8px, env(safe-area-inset-top));
    left: 12px;
    right: 12px;
    height: 54px;
    min-height: 54px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    background: rgba(10, 10, 12, .78);
    box-shadow: 0 14px 38px rgba(0, 0, 0, .42), inset 0 1px rgba(255, 255, 255, .04);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
  }

  body:has(.cinema-nav) .nav.cinema-nav .brand-name {
    font-size: 1.08rem;
    letter-spacing: -.065em;
  }

  body:has(.cinema-nav) .nav.cinema-nav .nav-tools > .btn-primary {
    width: 38px;
    min-width: 38px;
    height: 38px;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid rgba(255, 94, 102, .58);
    border-radius: 50%;
    background: linear-gradient(135deg, #ff2834, #d9000b 76%);
    box-shadow: 0 5px 18px rgba(229, 9, 20, .3), inset 0 1px rgba(255, 255, 255, .22);
    font-size: 0;
  }

  body:has(.cinema-nav) .nav.cinema-nav .nav-tools > .btn-primary::before {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
  }

  body:has(.cinema-nav) .nav.cinema-nav .burger {
    border-radius: 50%;
    background: rgba(255, 255, 255, .07);
  }

  /* Home hero: let the key art lead, with the title and action hierarchy
     anchored clearly at the bottom of the frame. */
  body:has(.cinema-nav) #trending-hero {
    position: relative;
    height: min(78svh, 730px);
    min-height: 540px;
    max-height: 730px;
    margin-top: -70px;
    padding-top: 70px;
    overflow: clip;
    background: #050505;
  }

  body:has(.cinema-nav) #trending-hero .hero-slide {
    align-items: flex-end;
    padding: 0 0 70px;
  }

  body:has(.cinema-nav) #trending-hero .hero-slide-bg {
    inset: 0;
    background-position: 58% 25%;
    background-size: cover;
    filter: saturate(.94) brightness(.84);
    transform: scale(1.025);
  }

  body:has(.cinema-nav) #trending-hero .hero-slide-bg::after {
    background:
      linear-gradient(180deg, rgba(5, 5, 5, .35) 0%, rgba(5, 5, 5, .06) 25%, rgba(5, 5, 5, .15) 45%, rgba(5, 5, 5, .78) 67%, #050505 100%),
      linear-gradient(90deg, rgba(5, 5, 5, .2), transparent 75%);
  }

  body:has(.cinema-nav) #trending-hero .hero-slide-content {
    width: 100%;
    max-width: 540px;
    align-items: center;
    padding: 0 20px 4px;
    text-align: center;
  }

  body:has(.cinema-nav) #trending-hero .hero-eyebrow {
    margin-bottom: 8px;
    color: #ff656d;
    font-size: 9px;
    letter-spacing: .2em;
  }

  body:has(.cinema-nav) #trending-hero .hero-title {
    max-width: 100%;
    margin-bottom: 10px;
    font-size: clamp(29px, 8.2vw, 39px);
    line-height: 1.05;
    letter-spacing: -.055em;
    text-wrap: balance;
  }

  body:has(.cinema-nav) #trending-hero .hero-desc {
    max-width: 430px;
    margin-bottom: 13px;
    color: rgba(255, 255, 255, .78);
    font-size: 12px;
    line-height: 1.55;
    -webkit-line-clamp: 2;
  }

  body:has(.cinema-nav) #trending-hero .hero-meta {
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
    font-size: 10px;
  }

  body:has(.cinema-nav) #trending-hero .hero-meta > span,
  body:has(.cinema-nav) #trending-hero .hero-meta .tag {
    min-height: 27px;
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: rgba(18, 18, 21, .62);
    color: #f5f5f7;
    -webkit-backdrop-filter: blur(9px);
    backdrop-filter: blur(9px);
  }

  body:has(.cinema-nav) #trending-hero .hero-meta .hero-rating {
    border-color: rgba(255, 202, 86, .36);
    color: #ffd46e;
  }

  body:has(.cinema-nav) #trending-hero .hero-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  body:has(.cinema-nav) #trending-hero .hero-actions .btn,
  body:has(.cinema-nav) #trending-hero .hero-actions .hero-watchlist {
    width: 100%;
    min-height: 48px;
    height: auto;
    justify-content: center;
    border-radius: 999px;
    font-size: 13px;
  }

  body:has(.cinema-nav) #trending-hero .hero-actions .btn-primary {
    border: 1px solid #ff3842;
    background: linear-gradient(135deg, #ff3039, #ed0009 70%, #d90008);
    box-shadow: 0 10px 25px -9px rgba(239, 0, 9, .78), inset 0 1px rgba(255, 255, 255, .2);
  }

  body:has(.cinema-nav) #trending-hero .hero-actions .btn-outline,
  body:has(.cinema-nav) #trending-hero .hero-actions .hero-watchlist {
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .085);
    color: #f6f6f8;
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
  }

  body:has(.cinema-nav) #trending-hero .hero-dots {
    right: 20px;
    bottom: 19px;
  }

  body:has(.cinema-nav) .rows.container {
    padding: 14px 16px calc(48px + env(safe-area-inset-bottom));
  }

  body:has(.cinema-nav) .row-block {
    margin-bottom: 34px;
  }

  body:has(.cinema-nav) .row-head {
    align-items: center;
    margin-bottom: 12px;
  }

  body:has(.cinema-nav) .row-title {
    font-size: 18px;
    letter-spacing: -.04em;
  }

  body:has(.cinema-nav) .row-title .dash {
    width: 3px;
    height: 19px;
    border-radius: 4px;
    box-shadow: 0 0 13px rgba(229, 9, 20, .45);
  }

  body:has(.cinema-nav) .row-link {
    min-height: 38px;
    color: #d7d7dc;
    font-size: 11px;
  }

  body:has(.cinema-nav) .row-scroll {
    gap: 12px;
    margin-right: -16px;
    padding: 3px 16px 14px 2px;
    scroll-padding-inline: 2px 16px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  body:has(.cinema-nav) .row-scroll::-webkit-scrollbar { display: none; }

  body:has(.cinema-nav) .card {
    width: clamp(138px, 39vw, 162px);
    scroll-snap-align: start;
  }

  body:has(.cinema-nav) .card-poster,
  body:has(.cinema-nav) .public-poster,
  body:has(.cinema-nav) .member-poster {
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 11px;
    background: linear-gradient(145deg, #21191b, #0d0d10 72%);
    box-shadow: 0 10px 25px rgba(0, 0, 0, .36), inset 0 1px rgba(255, 255, 255, .05);
  }

  body:has(.cinema-nav) .card-info { padding: 9px 1px 0; }

  body:has(.cinema-nav) .card-info h4,
  body:has(.cinema-nav) .public-card h3 {
    display: -webkit-box;
    min-height: 2.55em;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 12px;
    line-height: 1.28;
    letter-spacing: -.015em;
  }

  body:has(.cinema-nav) .card-info p,
  body:has(.cinema-nav) .public-card p {
    margin-top: 4px;
    color: rgba(255, 255, 255, .58);
    font-size: 10px;
    line-height: 1.4;
  }

  body:has(.cinema-nav) .card-badge,
  body:has(.cinema-nav) .public-rating,
  body:has(.cinema-nav) .content-rating {
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 999px;
    background: rgba(8, 8, 10, .78);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  body:has(.cinema-nav) .card-save {
    top: 7px;
    right: 7px;
    border-radius: 50%;
    background: rgba(8, 8, 10, .76);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }

  body:has(.cinema-nav) .top-card { width: clamp(160px, 44vw, 184px); }

  body:has(.cinema-nav) .cta-band {
    width: 100%;
    gap: 16px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 18px;
    background: radial-gradient(120% 120% at 0 0, rgba(229, 9, 20, .13), transparent 62%), linear-gradient(145deg, #151315, #0a0a0c);
  }

  body:has(.cinema-nav) .cta-band .btn { width: 100%; min-height: 48px; justify-content: center; border-radius: 999px; }

  /* Catalogue: large search, compact filters, confident two-column poster grid. */
  body:has(.cinema-nav) .public-wrap {
    padding: 108px 16px calc(48px + env(safe-area-inset-bottom));
  }

  body:has(.cinema-nav) .public-heading {
    margin: 9px 0 8px;
    font-size: clamp(30px, 9vw, 38px);
    line-height: 1.04;
    letter-spacing: -.06em;
  }

  body:has(.cinema-nav) .public-lead { font-size: 12px; line-height: 1.65; }

  body:has(.cinema-nav) .public-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 17px 0 12px;
    padding: 13px 0;
  }

  body:has(.cinema-nav) .catalogue-search-field { grid-column: 1 / -1; min-height: 49px; border-radius: 999px; }

  body:has(.cinema-nav) .public-toolbar select {
    width: 100%;
    max-width: none;
    min-width: 0;
    min-height: 44px;
    padding: 0 30px 0 13px;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 999px;
    background-color: #121214;
    font-size: 11px;
  }

  body:has(.cinema-nav) .public-catalogue {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }

  body:has(.cinema-nav) .public-card { min-width: 0; }

  body:has(.cinema-nav) .public-poster {
    border-radius: 12px;
    aspect-ratio: 2 / 3;
  }

  body:has(.cinema-nav) .public-pages { gap: 9px; margin-top: 26px; }
  body:has(.cinema-nav) .public-pages .btn { min-height: 42px; padding: 0 13px; border-radius: 999px; font-size: 11px; }

  /* Keep every mobile action pill-shaped and easy to reach. */
  body:has(.cinema-nav) .btn { border-radius: 999px; }

  body:has(.cinema-nav) .cinema-footer {
    padding: 34px 18px calc(30px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(255, 255, 255, .08);
  }
}

@media (max-width: 390px) {
  body:has(.cinema-nav) .hero-slide-content { padding-inline: 16px; }
  body:has(.cinema-nav) #trending-hero .hero-title { font-size: 29px; }
  body:has(.cinema-nav) #trending-hero .hero-desc { max-width: 340px; }
  body:has(.cinema-nav) .card { width: 138px; }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.cinema-nav) .card,
  body:has(.cinema-nav) .card-poster,
  body:has(.cinema-nav) .public-poster { transition: none !important; }
}

/* A quieter mobile navigation drawer: preserve the shortcuts while letting
   the page and brand remain the visual focus. */
@media (max-width: 1100px) {
  .nav.cinema-nav .nav-links {
    width: min(84vw, 320px);
    row-gap: 4px;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
    border-color: rgba(255, 255, 255, .085);
    border-radius: 0 20px 20px 0;
    background: rgba(13, 14, 17, .975);
    box-shadow: 12px 0 38px rgba(0, 0, 0, .38);
    -webkit-backdrop-filter: blur(22px) saturate(1.08);
    backdrop-filter: blur(22px) saturate(1.08);
    transition: transform .26s cubic-bezier(.2, .72, .25, 1), visibility .26s ease;
  }

  .nav.cinema-nav .nav-links.is-open > * { animation: none; }

  .nav.cinema-nav .drawer-head {
    gap: 8px;
    padding: 1px 1px 10px;
    margin-bottom: 6px;
    border-color: rgba(255, 255, 255, .075);
  }
  .nav.cinema-nav .drawer-head .brand-name { font-size: 1.12rem; }
  .nav.cinema-nav .drawer-close {
    width: 36px;
    height: 36px;
    border-color: rgba(255, 255, 255, .09);
    border-radius: 11px;
    background: rgba(255, 255, 255, .035);
    color: #c8c7ce;
  }

  .nav.cinema-nav .nav-links > a {
    min-height: 42px;
    gap: 10px;
    padding: 6px 9px;
    border: 1px solid transparent;
    border-radius: 11px;
    color: #b9b8c1;
    font-size: 12.5px;
    font-weight: 600;
  }
  .nav.cinema-nav .nav-links > a:hover {
    background: rgba(255, 255, 255, .035);
    color: #f5f4f7;
  }
  .nav.cinema-nav .nav-links > a.is-active {
    border-color: rgba(255, 255, 255, .055);
    background: rgba(229, 9, 20, .075);
    color: #fff;
    box-shadow: inset 2px 0 rgba(255, 54, 65, .9);
  }
  .nav.cinema-nav .nav-links > a .drawer-ico {
    width: 30px;
    height: 30px;
    border-color: rgba(255, 255, 255, .055);
    border-radius: 9px;
    background: rgba(255, 255, 255, .035);
    color: #a7a5af;
  }
  .nav.cinema-nav .nav-links > a .drawer-ico .ns-ico { width: 16px; height: 16px; }
  .nav.cinema-nav .nav-links > a.is-active .drawer-ico {
    border-color: rgba(255, 255, 255, .08);
    background: linear-gradient(145deg, #df2430, #b61620);
    box-shadow: 0 3px 9px rgba(229, 9, 20, .16);
  }

  .nav.cinema-nav .nav-links > .drawer-label {
    margin: 9px 4px 3px;
    font-size: 9px;
    letter-spacing: .13em;
    color: #777681;
  }
  .nav.cinema-nav .nav-links > .drawer-label::after {
    background: rgba(255, 255, 255, .055);
  }

  .nav.cinema-nav .nav-links > .drawer-user,
  .nav.cinema-nav .nav-links > .drawer-login {
    min-height: 54px;
    gap: 10px;
    margin-top: 3px;
    padding: 8px 10px;
    border-color: rgba(255, 255, 255, .075);
    border-radius: 12px;
    background: rgba(255, 255, 255, .025);
  }
  .nav.cinema-nav .nav-links > .drawer-user:hover,
  .nav.cinema-nav .nav-links > .drawer-login:hover {
    background: rgba(255, 255, 255, .05);
  }
  .nav.cinema-nav .nav-links > .drawer-login {
    border-color: rgba(229, 9, 20, .19);
    background: rgba(229, 9, 20, .055);
  }
  .drawer-user .du-avatar,
  .drawer-login .du-avatar {
    width: 34px;
    height: 34px;
    font-size: 14px;
    box-shadow: inset 0 1px rgba(255, 255, 255, .18);
  }

  .nav.cinema-nav .nav-links > .drawer-logout {
    min-height: 36px;
    margin-top: 2px;
    padding: 6px 10px;
    color: #8f8e97;
  }

  .nav.cinema-nav .nav-links > a.drawer-admin,
  .nav.cinema-nav .nav-links > a.drawer-telegram {
    min-height: 48px;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 12px;
  }
  .nav.cinema-nav .nav-links > a.drawer-admin {
    border-color: rgba(229, 9, 20, .2);
    background: rgba(229, 9, 20, .055);
    color: #e7b9bc;
  }
  .nav.cinema-nav .nav-links > a.drawer-admin .ns-ico { width: 17px; height: 17px; color: #ed6269; }
  .nav.cinema-nav .nav-links > a.drawer-admin > span small { color: #a98285; }
  .nav.cinema-nav .nav-links > a.drawer-telegram {
    border-color: rgba(41, 171, 226, .18);
    background: rgba(41, 171, 226, .045);
    color: #c2d9e5;
  }
  .nav.cinema-nav .nav-links > a.drawer-telegram .dt-logo { width: 18px; height: 18px; }
  .nav.cinema-nav .nav-links > a.drawer-telegram .dt-body strong { font-size: 12px; }
  .nav.cinema-nav .nav-links > a.drawer-telegram .dt-body small { color: #82aabd; font-size: 9.5px; }
}

/* Keep search out of the navigation drawer; reveal its existing input from
   a compact header button so suggestions and keyboard behavior stay shared. */
@media (max-width: 1100px) {
  .nav.cinema-nav .nav-tools > .nav-search-trigger {
    display: grid;
    place-items: center;
    flex: none;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 50%;
    background: rgba(255, 255, 255, .035);
    color: #d2d0d8;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
  }
  .nav.cinema-nav .nav-tools > .nav-search-trigger:hover,
  .nav.cinema-nav .nav-tools > .nav-search-trigger[aria-expanded="true"] {
    border-color: rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .09);
    color: #fff;
  }
  .nav.cinema-nav .nav-tools > .nav-search-trigger:active { transform: scale(.95); }
  .nav.cinema-nav .nav-tools > .nav-search-trigger svg { width: 17px; height: 17px; }

  .nav.cinema-nav .nav-search-wrap.mobile-search-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 120;
    display: none;
    width: auto;
    min-width: 0;
    max-width: none;
    flex: none;
    margin: 0;
    padding: 8px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 15px;
    background: rgba(13, 14, 17, .97);
    box-shadow: 0 16px 38px rgba(0, 0, 0, .42);
    opacity: 0;
    transform: translateY(-5px);
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease;
  }
  .nav.cinema-nav.search-open .nav-search-wrap.mobile-search-panel {
    display: block;
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
  .nav.cinema-nav .nav-search-wrap.mobile-search-panel .search-field {
    width: 100%;
    height: 44px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .035);
  }
  .nav.cinema-nav .nav-search-wrap.mobile-search-panel .search-field input { min-width: 0; font-size: 16px; }
  .nav.cinema-nav .nav-search-wrap.mobile-search-panel .search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    max-width: none;
    max-height: min(48vh, 420px);
    margin: 0;
    overflow-y: auto;
    border-radius: 15px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .46);
  }
}
@media (min-width: 1101px) {
  .nav.cinema-nav .nav-search-trigger { display: none !important; }
}

/* Top 10 on desktop: keep the ranking secondary to the poster artwork. */
@media (min-width: 721px) {
  body:has(.cinema-nav) .top-card .card-media { padding-left: 30px; }
  body:has(.cinema-nav) .top-card.is-two .card-media { padding-left: 46px; }
  body:has(.cinema-nav) .top-card .card-info { padding-left: 30px; }
  body:has(.cinema-nav) .top-card.is-two .card-info { padding-left: 46px; }
  body:has(.cinema-nav) .top-card .card-rank {
    font-size: clamp(62px, 5.2vw, 88px);
    -webkit-text-stroke-width: 2px;
    text-shadow: 0 5px 14px rgba(0, 0, 0, .74);
  }
  body:has(.cinema-nav) .top-card.is-two .card-rank {
    font-size: clamp(44px, 3.6vw, 60px);
    letter-spacing: -.12em;
  }
  body:has(.cinema-nav) .top-card.is-two .card-media,
  body:has(.cinema-nav) .top-card.is-two .card-info { padding-left: 30px; }
}
