/* NexusTV on phones. The Android app is this site in a WebView, so this IS the phone app:
   one-thumb navigation (5 tabs + a "Mai mult" sheet), 44 px touch targets, nothing wider
   than the screen, three posters per row instead of two, and a top bar that steps aside
   while you scroll down. Desktop and TV are untouched (everything is inside max-width: 768px,
   except the sheet, which only phones open). */

/* ---------------------------------------------------------------- "Mai mult" sheet */
.nx-more { position: fixed; inset: 0; z-index: 100040; display: flex; align-items: flex-end; justify-content: center;
           background: rgba(5, 7, 12, .62); opacity: 0; pointer-events: none; transition: opacity .25s; }
.nx-more[hidden] { display: none; }
.nx-more.open { opacity: 1; pointer-events: auto; }
.nx-more-sheet { position: relative; width: min(540px, 100%); max-height: 90vh; max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
                 background: #151A23; border: 1px solid rgba(168, 85, 247, .26); border-bottom: 0; border-radius: 26px 26px 0 0;
                 padding: 6px 14px calc(16px + env(safe-area-inset-bottom)); transform: translateY(105%);
                 transition: transform .34s cubic-bezier(.2, .9, .25, 1); box-shadow: 0 -24px 70px rgba(0, 0, 0, .6); }
.nx-more.open .nx-more-sheet { transform: none; }
.nx-more.drag .nx-more-sheet { transition: none; }
.nx-more-grab { display: block; width: 100%; height: 26px; border: 0; background: none; cursor: pointer; padding: 0; }
.nx-more-grab::before { content: ""; display: block; width: 44px; height: 5px; margin: 0 auto; border-radius: 3px; background: rgba(255, 255, 255, .22); }
.nx-more-me { display: flex; align-items: center; gap: 12px; padding: 2px 4px 14px; }
.nx-more-av { width: 50px; height: 50px; border-radius: 15px; overflow: hidden; flex: none; display: grid; place-items: center;
              background: var(--bg-elevated, #1B2230); color: #C4B5FD; font-weight: 800; font-size: 1.25rem; border: 2px solid rgba(168, 85, 247, .45); }
.nx-more-av img { width: 100%; height: 100%; object-fit: cover; }
.nx-more-who { min-width: 0; }
.nx-more-name { color: #fff; font-weight: 800; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-more-sub { color: var(--text-muted, #8a97ab); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nx-more-switch { margin-left: auto; flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 12px;
                  background: rgba(255, 255, 255, .07); color: #fff; font-weight: 700; font-size: .84rem; text-decoration: none; }
.nx-more-promo { display: flex; align-items: center; gap: 10px; min-height: 48px; margin: 0 0 12px; padding: 0 14px; border-radius: 14px; text-decoration: none;
                 color: #fff; font-weight: 800; background: linear-gradient(90deg, rgba(124, 58, 237, .5), rgba(168, 85, 247, .25)); }
.nx-more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0 0 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.nx-more-tile { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; min-height: 86px;
                border-radius: 18px; background: #1B2230; border: 1px solid rgba(255, 255, 255, .06); color: #E2E8F0; text-decoration: none;
                font-weight: 700; font-size: .8rem; text-align: center; padding: 8px 4px; -webkit-tap-highlight-color: transparent; }
.nx-more-tile .i { font-size: 1.6rem; line-height: 1; }
.nx-more-tile.on { border-color: rgba(168, 85, 247, .65); background: rgba(124, 58, 237, .2); color: #fff; }
.nx-more-tile em { position: absolute; top: 8px; right: 8px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font: 800 .68rem/20px Inter, system-ui, sans-serif;
                   font-style: normal; color: #fff; background: #7C3AED; }
.nx-more-list { display: grid; gap: 2px; padding-top: 8px; }
.nx-more-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 52px; padding: 0 10px; border: 0; border-radius: 14px; background: none;
               color: #E2E8F0; text-decoration: none; font: 600 .95rem Inter, system-ui, sans-serif; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.nx-more-row::after { content: "›"; margin-left: auto; color: var(--text-muted, #8a97ab); font-size: 1.35rem; line-height: 1; }
.nx-more-row .i { width: 26px; flex: none; text-align: center; font-size: 1.15rem; }
.nx-more-row img { width: 22px; height: 15px; border-radius: 3px; object-fit: cover; }
.nx-more-row.on { background: rgba(124, 58, 237, .16); color: #fff; }
.nx-more-tile:active, .nx-more-row:active, .nx-more-switch:active { background: rgba(124, 58, 237, .28); }
@media (min-width: 769px) { .nx-more { align-items: center; } .nx-more-sheet { border-radius: 26px; border-bottom: 1px solid rgba(168, 85, 247, .26); } }
@media (prefers-reduced-motion: reduce) { .nx-more, .nx-more-sheet { transition: none; } }

.top-bar-logo { display: none; }
.top-bar-search svg { flex: none; width: 17px; height: 17px; color: #C4B5FD; }
.nx-bell svg { display: block; width: 20px; height: 20px; margin: auto; color: #E2E8F0; }
/* row headings: the icon and the title sit together (both had the heading's 24 px side padding) */
.row-title .rt-icon, .row-title .rt-icon + a { padding: 0; }
/* the microphone sat below the middle of the search field (the field's bottom margin) */
.nx-search-bar { margin-bottom: 24px; }
.nx-search-bar .search-overlay-input { margin-bottom: 0; }

/* ---------------------------------------------------------------- phones */
@media (max-width: 768px) {
    /* nothing may make the page pan sideways (the app then zooms the whole page out) */
    html, body { overflow-x: clip; }
    :root { --nx-gut: 16px; --nx-card: calc((100vw - 52px) / 3.15); }

    /* ---- top bar: logo, a real search field, bell, you ---- */
    .top-bar { height: 58px; padding: 0 12px; gap: 10px; justify-content: flex-start; transition: transform .28s cubic-bezier(.2, .8, .3, 1); }
    .top-bar.nx-away { transform: translateY(-110%); }
    .top-bar-logo { display: block; flex: none; width: 36px; height: 36px; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 14px rgba(124, 58, 237, .35); }
    .top-bar-logo img { display: block; width: 100%; height: 100%; }
    .top-bar-search { flex: 1 1 auto; min-width: 0; width: auto; height: 42px; margin: 0; padding: 0 14px; border-radius: 21px; justify-content: flex-start; gap: 9px; }
    .top-bar-search .search-text { display: block; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .9rem; color: #94A3B8; }
    .top-bar-search svg { flex: none; width: 18px; height: 18px; color: #C4B5FD; }
    .top-bar-search .search-icon { display: none; }
    .top-bar .nx-bell { width: 42px; height: 42px; flex: none; }
    .top-bar-avatar { width: 40px; height: 40px; flex: none; border-radius: 12px; }
    .top-bar > .hero-btn-primary { display: none; }              /* Free Trial: in the "Mai mult" sheet */
    .profile-dropdown { display: none !important; }              /* the sheet replaces it */
    .nx-bell-panel { top: 62px; }

    /* ---- bottom tabs ---- */
    .bottom-tabs { height: calc(var(--bottomtab-height) + env(safe-area-inset-bottom)); padding: 0 4px env(safe-area-inset-bottom);
                   justify-content: space-between; background: rgba(12, 15, 22, .97); border-top: 1px solid rgba(255, 255, 255, .07); }
    .bottom-tab { flex: 1 1 0; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
                  padding: 0; border: 0; background: none; color: #8a97ab; font: 700 .7rem Inter, system-ui, sans-serif; cursor: pointer;
                  -webkit-tap-highlight-color: transparent; text-decoration: none; }
    .bottom-tab .tab-pill { display: grid; place-items: center; width: 58px; height: 32px; border-radius: 16px; transition: background .2s, color .2s; }
    .bottom-tab svg { width: 24px; height: 24px; }
    .bottom-tab.active { color: #fff; }
    .bottom-tab.active .tab-pill { background: rgba(124, 58, 237, .34); color: #E9D5FF; }
    .bottom-tab:active .tab-pill { background: rgba(124, 58, 237, .22); }
    .main-content { padding-bottom: calc(var(--bottomtab-height) + env(safe-area-inset-bottom)); }

    /* ---- search: a big field, a close button you can hit, results fill the screen ---- */
    .search-overlay { padding: 72px 14px 12px; }
    .search-overlay-close { top: 12px; right: 10px; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%;
                            background: rgba(255, 255, 255, .07); color: #E2E8F0; font-size: 1.25rem; }
    .search-overlay-input { font-size: 1.05rem; padding: 15px 64px 15px 18px; border-radius: 16px; }
    .nx-search-bar { margin-bottom: 14px; }
    #searchResults { max-height: none; flex: 1 1 auto; min-height: 0; margin-top: 0; overscroll-behavior: contain; }
    .nx-search { grid-template-columns: minmax(0, 1fr); gap: 8px; }

    /* the report button floated over every page; it is in the sheet now */
    body .nxr-fab { display: none !important; }
    .discord-popup { bottom: calc(var(--bottomtab-height) + 12px); }

    /* ---- hero: two buttons side by side, dots you can hit ---- */
    .hero { min-height: 0; height: min(66vh, 470px); padding: 0 var(--nx-gut) 46px; }
    .hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .hero-btn-primary, .hero-btn-secondary { width: 100%; min-height: 48px; padding: 0 10px; justify-content: center; font-size: .95rem; border-radius: 14px; }
    .hero-actions .nx-surprise-btn { grid-column: 1 / -1; min-height: 40px; font-size: .88rem; background: rgba(255, 255, 255, .06); }
    .hc .hc-dots { bottom: 10px; gap: 2px; }
    .hc .hc-dot { position: relative; width: 30px; height: 26px; background: none; overflow: visible; }
    .hc .hc-dot::before, .hc .hc-dot i { position: absolute; left: 4px; top: 50%; height: 5px; margin-top: -2.5px; border-radius: 5px; }
    .hc .hc-dot::before { content: ""; right: 4px; background: rgba(255, 255, 255, .25); }
    .hc .hc-dot i { max-width: calc(100% - 8px); }

    /* ---- rows: three posters on screen, the fourth peeks in ---- */
    .row-title { padding: 0 var(--nx-gut) 10px; font-size: 1.12rem; gap: 8px; }
    .row-wrapper { padding: 0; }
    .row-slider { gap: 10px; padding: 0 var(--nx-gut) 6px; scroll-padding-left: var(--nx-gut); }
    .row-arrow { display: none; }
    .card { flex: 0 0 var(--nx-card); min-width: var(--nx-card); }
    .card:hover, .card:hover .card-poster img { transform: none; }
    .card-info { padding: 7px 2px 2px; }
    .card-info-title { font-size: .8rem; }
    .card-info-year { font-size: .7rem; }
    .badge-rating { top: 6px; left: 6px; padding: 2px 6px; font-size: .64rem; }
    .content-section { padding: 0 var(--nx-gut); margin-bottom: 26px; }
    .content-row { gap: 10px; margin: 0 calc(-1 * var(--nx-gut)); padding: 0 var(--nx-gut) 6px; scroll-padding-left: var(--nx-gut); }
    .content-card { width: var(--nx-card); border-radius: 12px; }
    .content-card-poster, .content-card-overlay { border-radius: 12px; }
    .content-card:hover { transform: none; box-shadow: none; }
    .content-card:hover .content-card-poster { filter: none; }
    .section-header { margin-bottom: 12px; }
    .section-see-all { display: inline-flex; align-items: center; min-height: 40px; padding: 0 0 0 12px; font-size: .85rem; font-weight: 700; color: #C4B5FD; }
    .media-grid, .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 10px; padding-left: var(--nx-gut); padding-right: var(--nx-gut); }
    .media-grid .content-card, .category-grid .content-card, .media-grid .card, .category-grid .card { width: auto; min-width: 0; }

    /* ---- sports: the channel list fits the screen ---- */
    .channels-grid { grid-template-columns: minmax(0, 1fr); }
    .channel-card { min-width: 0; }
    .channel-card > * { min-width: 0; }

    /* ---- footer: one compact block above the tabs ---- */
    .nexus-footer { margin-top: 24px; padding: 18px var(--nx-gut); border-radius: 18px 18px 0 0; }
}

/* Continue watching: on a touch screen the episode is always written on the card */
@media (hover: none) {
    .content-card:has(.content-card-progress) .content-card-overlay { opacity: 1; padding: 8px 8px 10px; background: linear-gradient(to top, rgba(0, 0, 0, .88) 0%, transparent 55%); }
    .content-card:has(.content-card-progress) .card-play { display: none; }
    .content-card:has(.content-card-progress) .card-title { font-size: .74rem; margin-bottom: 1px; }
    .content-card:has(.content-card-progress) .card-rating { font-size: .7rem; }
}

@media (min-width: 560px) and (max-width: 768px) {
    :root { --nx-card: calc((100vw - 62px) / 4.2); }
    .media-grid, .category-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
