/* ThoFlix — experiência tipo app em telemóvel (apenas horizontal) */

#orientation-warning {
    display: none;
    position: fixed;
    inset: 0;
    background: #12131c;
    z-index: 2147483646;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 24px;
}

#orientation-warning .warning-content i {
    font-size: 52px;
    color: var(--accent-color);
    margin-bottom: 16px;
    animation: rotatePhone 2s ease-in-out infinite;
}

#orientation-warning .warning-content h2 {
    font-size: 20px;
    margin-bottom: 8px;
}

#orientation-warning .warning-content p {
    color: var(--text-secondary);
    font-size: 14px;
    max-width: 280px;
    margin: 0 auto;
}

/* Retrato: obrigar rotação */
@media (max-width: 900px) and (orientation: portrait) {
    html.thoflix-mobile #orientation-warning {
        display: flex !important;
        z-index: 2147483646;
    }

    html.thoflix-mobile body {
        overflow: hidden !important;
        position: fixed;
        width: 100%;
        height: 100%;
    }

    html.thoflix-mobile #main-app,
    html.thoflix-mobile #login-screen,
    html.thoflix-mobile #loading-screen {
        pointer-events: none;
    }
}

/* Paisagem: layout app (altura ≤520px = telemóvel deitado, mesmo se largura >900px) */
@media (orientation: landscape) and (max-height: 520px) {
    html.thoflix-mobile,
    html.thoflix-mobile body {
        width: 100%;
        height: 100%;
        height: 100dvh;
        overflow: hidden;
        position: fixed;
        overscroll-behavior: none;
    }

    html.thoflix-mobile #orientation-warning {
        display: none !important;
    }

    html.thoflix-mobile #main-app.screen.active {
        display: flex !important;
        flex-direction: row;
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        position: fixed;
        inset: 0;
    }

    /* Menu lateral — ícones, scroll se não couber */
    html.thoflix-mobile .sidebar {
        width: 56px !important;
        min-width: 56px !important;
        max-width: 56px !important;
        height: 100dvh !important;
        flex-direction: column !important;
        top: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        right: auto !important;
        padding: max(6px, env(safe-area-inset-top, 0)) 0 max(6px, env(safe-area-inset-bottom, 0)) 0 !important;
        border-top: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
        z-index: 200;
        overflow: hidden;
    }

    html.thoflix-mobile .sidebar-logo {
        display: block !important;
        padding: 4px 2px 6px !important;
        flex-shrink: 0;
    }

    html.thoflix-mobile .sidebar-logo img {
        width: 36px !important;
    }

    html.thoflix-mobile .sidebar nav {
        flex: 1;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    html.thoflix-mobile .sidebar nav ul {
        flex-direction: column !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start !important;
        padding: 0 2px 8px !important;
        gap: 2px;
    }

    html.thoflix-mobile .sidebar nav li {
        min-width: 0 !important;
        width: 100%;
        padding: 7px 2px !important;
        border-bottom: none !important;
        border-left: 2px solid transparent !important;
        gap: 2px !important;
    }

    html.thoflix-mobile .sidebar nav li.active {
        border-left-color: var(--accent-color) !important;
        border-bottom-color: transparent !important;
    }

    html.thoflix-mobile .sidebar nav li i {
        font-size: 16px !important;
    }

    html.thoflix-mobile .sidebar nav li span {
        display: block !important;
        font-size: 6px !important;
        line-height: 1.05;
        max-width: 48px;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    html.thoflix-mobile .sidebar .nav-auxiliary {
        display: none !important;
    }

    html.thoflix-mobile .sidebar-footer {
        display: none !important;
    }

    /* Área principal */
    html.thoflix-mobile .content-area {
        flex: 1;
        min-width: 0;
        margin-left: 56px !important;
        width: calc(100vw - 56px) !important;
        max-width: calc(100vw - 56px) !important;
        height: 100dvh !important;
        min-height: 0 !important;
        padding: 0 !important;
        overflow: hidden;
        display: flex !important;
        flex-direction: column;
    }

    html.thoflix-mobile .content-area:not(:has(.category-container)) {
        overflow-x: clip;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    html.thoflix-mobile .content-area:has(.category-container) {
        overflow: hidden;
    }

    html.thoflix-mobile .top-bar {
        position: fixed !important;
        top: 0;
        right: 0;
        left: auto !important;
        width: auto !important;
        height: auto;
        padding: max(4px, env(safe-area-inset-top, 0)) max(6px, env(safe-area-inset-right, 0)) 0 !important;
        z-index: 180;
        background: none !important;
        backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        pointer-events: none;
    }

    html.thoflix-mobile .user-info {
        pointer-events: auto;
        padding: 3px 8px !important;
        gap: 2px 5px !important;
        max-width: min(46vw, 200px);
        flex-wrap: nowrap !important;
        align-items: center !important;
        line-height: 1.1;
        background: rgba(8, 9, 14, 0.78) !important;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 50px !important;
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    }

    html.thoflix-mobile #user-display-name {
        font-size: 9px !important;
        font-weight: 600 !important;
        letter-spacing: 0.02em;
        max-width: 52px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html.thoflix-mobile .user-display-server {
        font-size: 8px !important;
        font-weight: 600 !important;
        flex-basis: auto !important;
        max-width: 64px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html.thoflix-mobile .user-display-server::before {
        display: inline !important;
        margin: 0 3px !important;
        font-size: 7px;
    }

    html.thoflix-mobile .status-indicator {
        font-size: 7px !important;
        font-weight: 700 !important;
        gap: 3px !important;
        letter-spacing: 0.04em;
        white-space: nowrap;
        flex-shrink: 0;
    }

    html.thoflix-mobile .status-dot {
        width: 5px !important;
        height: 5px !important;
        box-shadow: 0 0 6px #2ecc71;
    }

    html.thoflix-mobile #view-container {
        flex: none;
        min-height: auto;
        overflow: visible;
        padding: max(6px, env(safe-area-inset-top, 0)) 6px 8px !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* Categorias / grelha — altura fixa, scroll só na lista e na grelha */
    html.thoflix-mobile .content-area:has(.category-container) #view-container {
        flex: 1 1 auto;
        min-height: 0;
        padding: 0 !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* Hero compacto */
    html.thoflix-mobile .hero-section {
        height: 108px !important;
        min-height: 108px !important;
        max-height: 108px !important;
        margin: 0 0 6px 0 !important;
        border-radius: 8px !important;
    }

    html.thoflix-mobile .hero-content {
        padding: 8px 12px !important;
        justify-content: flex-end !important;
        background: linear-gradient(to right, rgba(12, 13, 18, 0.95) 45%, transparent) !important;
    }

    html.thoflix-mobile .hero-content h1 {
        font-size: 15px !important;
        margin-bottom: 4px !important;
        line-height: 1.15;
    }

    html.thoflix-mobile .hero-content .badge {
        padding: 2px 6px !important;
        font-size: 8px !important;
        margin-bottom: 4px !important;
    }

    html.thoflix-mobile .hero-content .meta {
        margin-bottom: 4px !important;
        gap: 8px !important;
        font-size: 10px !important;
    }

    html.thoflix-mobile .hero-content p {
        display: none !important;
    }

    html.thoflix-mobile .hero-btns {
        gap: 6px !important;
        transform: none !important;
    }

    html.thoflix-mobile .hero-btns .btn-primary,
    html.thoflix-mobile .hero-btns .btn-secondary {
        padding: 5px 10px !important;
        font-size: 10px !important;
        min-width: 0 !important;
        border-radius: 6px !important;
    }

    html.thoflix-mobile .hero-img {
        width: 55% !important;
    }

    html.thoflix-mobile .hero-indicators {
        display: none !important;
    }

    /* Home */
    html.thoflix-mobile .streaming-hub {
        margin: 6px 0 4px !important;
    }

    html.thoflix-mobile .streaming-hub-header {
        margin-bottom: 8px !important;
        gap: 8px !important;
    }

    html.thoflix-mobile .streaming-hub-header h3 {
        font-size: 13px !important;
    }

    html.thoflix-mobile .streaming-hub-header i {
        font-size: 16px !important;
    }

    html.thoflix-mobile .streaming-pill {
        padding: 6px 10px !important;
        font-size: 10px !important;
    }

    html.thoflix-mobile .home-continue-section {
        margin: 0 !important;
        padding-top: 8px !important;
    }

    html.thoflix-mobile .home-continue-section .section-title.section-title--continue {
        font-size: 13px !important;
        margin-bottom: 8px !important;
        padding-left: 0 !important;
    }

    html.thoflix-mobile .home-section-container {
        padding: 6px 0 !important;
        margin-bottom: 10px !important;
    }

    html.thoflix-mobile .section-header h2 {
        font-size: 13px !important;
    }

    html.thoflix-mobile .section-header i {
        font-size: 14px !important;
    }

    html.thoflix-mobile .home-card {
        flex: 0 0 76px !important;
    }

    html.thoflix-mobile .home-card-poster {
        height: 100px !important;
    }

    html.thoflix-mobile .home-card-info {
        padding: 4px !important;
    }

    html.thoflix-mobile .home-card-info h4 {
        font-size: 9px !important;
    }

    html.thoflix-mobile .home-card-info span {
        font-size: 8px !important;
    }

    html.thoflix-mobile .continue-watching-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        margin-bottom: 0 !important;
        padding: 2px 0 6px !important;
        -webkit-overflow-scrolling: touch;
        scroll-snap-type: x proximity;
    }

    html.thoflix-mobile .continue-watching-list .scroll-content,
    html.thoflix-mobile .horizontal-scroller .scroll-content.continue-watching-list {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 10px !important;
    }

    html.thoflix-mobile .continue-card {
        flex: 0 0 210px !important;
        min-width: 210px !important;
        max-width: 240px !important;
        width: 210px !important;
        padding: 8px !important;
        align-items: center !important;
        gap: 10px !important;
        scroll-snap-align: start;
    }

    html.thoflix-mobile .continue-poster {
        width: 56px !important;
        height: 76px !important;
        flex-shrink: 0 !important;
    }

    html.thoflix-mobile .continue-info {
        min-width: 0 !important;
        flex: 1 !important;
    }

    html.thoflix-mobile .continue-info h4 {
        font-size: 11px !important;
        white-space: normal !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.25;
    }

    html.thoflix-mobile .continue-info span {
        font-size: 9px !important;
    }

    html.thoflix-mobile .home-continue-section--page {
        margin: 0 !important;
        padding-top: 4px !important;
    }

    /* Carrosséis — setas ao lado do conteúdo (flex, nunca cortadas) */
    html.thoflix-mobile .horizontal-scroller,
    html.thoflix-mobile .horizontal-scroller .scroll-row {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 0 !important;
        overflow: visible !important;
        box-sizing: border-box !important;
    }

    html.thoflix-mobile .horizontal-scroller .scroll-content {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    html.thoflix-mobile .scroll-btn {
        display: flex !important;
        position: relative !important;
        flex: 0 0 34px !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        opacity: 1 !important;
        font-size: 12px !important;
        z-index: 15 !important;
        background: rgba(0, 0, 0, 0.78) !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35) !important;
        color: #fff !important;
        pointer-events: auto;
        -webkit-tap-highlight-color: transparent;
    }

    html.thoflix-mobile .scroll-btn:hover {
        transform: none !important;
        background: rgba(0, 0, 0, 0.78) !important;
    }

    html.thoflix-mobile .scroll-btn.is-lit,
    html.thoflix-mobile .scroll-btn:active {
        background: var(--accent-color) !important;
        border-color: var(--accent-color) !important;
        color: #fff !important;
        transform: scale(1.05) !important;
    }

    html.thoflix-mobile .scroll-progress-bar {
        height: 3px !important;
        margin-top: 6px !important;
        margin-bottom: 4px !important;
        background: rgba(255, 255, 255, 0.08) !important;
    }

    html.thoflix-mobile .scroll-progress-bar .progress-fill {
        background: var(--accent-color) !important;
    }

    /* Categorias + grelha — até ao topo */
    html.thoflix-mobile .category-container {
        flex-direction: row !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    html.thoflix-mobile .category-list {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        height: 100% !important;
        flex-direction: column !important;
        display: flex !important;
        overflow: hidden !important;
        position: relative !important;
        top: 0 !important;
        border-bottom: none !important;
        border-right: 1px solid rgba(255, 255, 255, 0.06) !important;
        padding: 0 !important;
        background: #12131c !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    html.thoflix-mobile #category-items-wrapper {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    html.thoflix-mobile .category-header-label {
        position: sticky !important;
        top: 0 !important;
        display: block !important;
        flex-shrink: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 8px !important;
        font-weight: 800 !important;
        padding: max(6px, env(safe-area-inset-top, 0)) 8px 8px !important;
        margin: 0 !important;
        letter-spacing: 0.06em !important;
        text-transform: uppercase;
        color: var(--accent-color) !important;
        background: #12131c !important;
        background-color: #12131c !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        z-index: 25 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
        box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
    }

    html.thoflix-mobile .category-item {
        padding: 6px 8px !important;
        margin: 0 4px 2px !important;
        font-size: 10px !important;
        min-height: 0 !important;
    }

    html.thoflix-mobile .category-item span {
        font-size: 10px !important;
        line-height: 1.2;
        white-space: normal !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.thoflix-mobile .category-item i {
        display: none;
    }

    html.thoflix-mobile .category-content {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        padding: max(4px, env(safe-area-inset-top, 0)) 4px 4px !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        box-sizing: border-box;
        position: relative !important;
    }

    html.thoflix-mobile #items-grid:has(.category-loading-center),
    html.thoflix-mobile #items-grid:has(.category-empty-msg) {
        display: block !important;
        min-height: 100% !important;
        height: 100% !important;
        padding: 0 !important;
        position: static !important;
    }

    html.thoflix-mobile .category-loading-center,
    html.thoflix-mobile .category-empty-msg {
        position: absolute !important;
        inset: 0 !important;
        min-height: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        font-size: 11px !important;
        grid-column: unset !important;
        z-index: 8;
        pointer-events: none;
    }

    html.thoflix-mobile .category-loading-spinner {
        width: 26px !important;
        height: 26px !important;
        border-width: 2px !important;
        flex-shrink: 0;
    }

    html.thoflix-mobile .category-loading-center p {
        margin: 0 !important;
        font-size: 11px !important;
        font-weight: 600;
        letter-spacing: 0.03em;
        color: rgba(255, 255, 255, 0.75);
    }

    html.thoflix-mobile .category-empty-msg i {
        font-size: 22px !important;
    }

    html.thoflix-mobile .category-empty-msg p {
        font-size: 11px !important;
        max-width: 90%;
        text-align: center;
        line-height: 1.35;
    }

    html.thoflix-mobile .content-grid,
    html.thoflix-mobile #items-grid.content-grid {
        grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)) !important;
        gap: 6px !important;
        padding-bottom: 12px !important;
    }

    html.thoflix-mobile .content-grid--live,
    html.thoflix-mobile #items-grid.content-grid--live {
        grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)) !important;
        gap: 5px !important;
    }

    html.thoflix-mobile .content-grid--live .card-poster {
        aspect-ratio: 1 / 1 !important;
    }

    html.thoflix-mobile .content-grid--live .card-info {
        padding: 3px 4px !important;
    }

    html.thoflix-mobile .content-grid--live .card-info h4 {
        font-size: 8px !important;
        -webkit-line-clamp: 2;
    }

    html.thoflix-mobile .content-grid--live .card-info p {
        display: none !important;
    }

    html.thoflix-mobile .content-grid--live .live-badge {
        font-size: 7px !important;
        padding: 2px 4px !important;
        top: 4px !important;
        left: 4px !important;
    }

    html.thoflix-mobile .item-card:hover {
        transform: none;
    }

    html.thoflix-mobile .card-info {
        padding: 4px 5px !important;
    }

    html.thoflix-mobile .card-info h3,
    html.thoflix-mobile .card-info h4 {
        font-size: 9px !important;
        font-weight: 600 !important;
        line-height: 1.25 !important;
        margin: 0 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal !important;
        text-overflow: ellipsis;
        word-break: break-word;
    }

    html.thoflix-mobile .card-info p {
        font-size: 8px !important;
        margin-top: 2px !important;
    }

    /* VOD detalhes — filmes e séries (layout app) */
    html.thoflix-mobile #vod-details {
        z-index: 4000 !important;
        overflow: hidden !important;
        width: 100vw !important;
        height: 100dvh !important;
    }

    html.thoflix-mobile #vod-details .vod-backdrop::after {
        background:
            linear-gradient(to right, rgba(12, 13, 18, 0.9) 0%, rgba(12, 13, 18, 0.55) 42%, rgba(12, 13, 18, 0.25) 100%),
            linear-gradient(to top, rgba(12, 13, 18, 0.85) 0%, rgba(12, 13, 18, 0.2) 45%, transparent 70%) !important;
    }

    html.thoflix-mobile #vod-details .status-badge {
        display: none !important;
    }

    html.thoflix-mobile .vod-details-container {
        padding: max(6px, env(safe-area-inset-top, 0)) max(10px, env(safe-area-inset-right, 0)) max(6px, env(safe-area-inset-bottom, 0)) max(8px, env(safe-area-inset-left, 0)) !important;
        min-height: 0 !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        box-sizing: border-box !important;
        background: transparent !important;
    }

    /* Capa à esquerda | info à direita | botão na largura total (alinhado à capa) */
    html.thoflix-mobile .vod-details-content {
        display: grid !important;
        grid-template-columns: minmax(112px, 34vw) minmax(0, 1fr) !important;
        grid-template-rows: auto minmax(0, 1fr) auto !important;
        gap: 6px 10px !important;
        width: min(96vw, 700px) !important;
        max-width: min(96vw, 700px) !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        max-height: calc(100dvh - 10px) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        align-items: start !important;
        text-align: left !important;
        box-sizing: border-box !important;
        background: transparent !important;
    }

    html.thoflix-mobile .vod-right {
        display: contents !important;
    }

    html.thoflix-mobile .vod-left {
        grid-column: 1 !important;
        grid-row: 1 / 3 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
        position: static !important;
        display: flex !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        margin: 0 !important;
        padding: 0 !important;
        align-self: start !important;
    }

    html.thoflix-mobile .vod-left img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: min(62dvh, 300px) !important;
        aspect-ratio: 2 / 3 !important;
        object-fit: cover !important;
        border-radius: 10px !important;
        box-shadow: 0 10px 32px rgba(0, 0, 0, 0.55) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
    }

    html.thoflix-mobile .vod-top {
        grid-column: 2 !important;
        grid-row: 1 !important;
        width: 100% !important;
        min-width: 0 !important;
        flex-shrink: 0;
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
    }

    html.thoflix-mobile .vod-body-scroll {
        grid-column: 2 !important;
        grid-row: 2 !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 0 2px 4px 0 !important;
        text-align: left !important;
    }

    html.thoflix-mobile .vod-actions {
        grid-column: 1 / -1 !important;
        grid-row: 3 !important;
        flex-shrink: 0 !important;
        flex-direction: row !important;
        gap: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding-top: 4px !important;
        background: transparent !important;
        box-sizing: border-box !important;
    }

    html.thoflix-mobile .back-btn-orange {
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 5px 11px !important;
        margin: 0 0 6px !important;
        font-size: 10px !important;
        border-radius: 50px !important;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
        align-self: flex-start !important;
    }

    html.thoflix-mobile .vod-right h1,
    html.thoflix-mobile .vod-genre,
    html.thoflix-mobile .vod-plot,
    html.thoflix-mobile .vod-credits p {
        text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
    }

    html.thoflix-mobile .back-btn-label {
        font-size: 10px;
    }

    html.thoflix-mobile .vod-right h1 {
        font-size: 14px !important;
        line-height: 1.2 !important;
        margin: 0 0 6px !important;
        width: 100% !important;
        text-align: left !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.thoflix-mobile .vod-meta {
        gap: 5px !important;
        margin-bottom: 0 !important;
        flex-wrap: wrap;
        justify-content: flex-start !important;
        width: 100% !important;
    }

    html.thoflix-mobile .vod-meta .meta-item {
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    html.thoflix-mobile .vod-meta .meta-item--rating {
        font-size: 9px !important;
        padding: 2px 6px !important;
        min-height: 0 !important;
    }

    html.thoflix-mobile .vod-meta .meta-item--rating i {
        font-size: 8px !important;
    }

    html.thoflix-mobile .vod-genre {
        font-size: 10px !important;
        margin-bottom: 5px !important;
        line-height: 1.3;
        text-align: left !important;
    }

    html.thoflix-mobile .vod-plot {
        font-size: 10px !important;
        line-height: 1.4 !important;
        max-height: none !important;
        overflow: visible !important;
        display: block !important;
        -webkit-line-clamp: unset !important;
        margin-bottom: 6px !important;
        color: rgba(255, 255, 255, 0.88) !important;
        text-align: left !important;
    }

    html.thoflix-mobile .vod-credits {
        margin-bottom: 6px !important;
        width: 100% !important;
        text-align: left !important;
    }

    html.thoflix-mobile .vod-credits p {
        font-size: 9px !important;
        line-height: 1.3 !important;
        margin-bottom: 3px !important;
        text-align: left !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.thoflix-mobile .btn-play-large {
        flex: 1 1 auto !important;
        width: auto !important;
        max-width: none !important;
        padding: 10px 12px !important;
        font-size: 11px !important;
        border-radius: 10px !important;
        min-height: 40px;
        box-sizing: border-box !important;
    }

    html.thoflix-mobile .btn-fav-large {
        flex: 0 0 40px !important;
        width: 40px !important;
        min-width: 40px !important;
        padding: 0 !important;
        min-height: 40px !important;
        border-radius: 10px !important;
    }

    html.thoflix-mobile .btn-fav-large::after {
        display: none !important;
    }

    html.thoflix-mobile .series-seasons-container:not(.hidden) {
        display: block !important;
        margin-top: 4px !important;
        padding: 6px !important;
        border-radius: 8px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        text-align: left !important;
        background: rgba(0, 0, 0, 0.4) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
    }

    html.thoflix-mobile .series-seasons-container .seasons-tabs {
        padding-bottom: 6px !important;
        margin-bottom: 6px !important;
        gap: 5px !important;
    }

    html.thoflix-mobile .season-tab {
        padding: 5px 9px !important;
        font-size: 9px !important;
    }

    html.thoflix-mobile .series-seasons-container .episodes-list {
        display: flex !important;
        flex-direction: column !important;
        flex-wrap: nowrap !important;
        gap: 5px !important;
        max-height: min(32dvh, 200px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding-right: 2px !important;
    }

    html.thoflix-mobile .episode-item {
        flex: 0 0 auto !important;
        max-width: 100% !important;
        min-width: 0 !important;
        width: 100% !important;
        padding: 7px 9px !important;
    }

    html.thoflix-mobile .episode-num {
        width: 26px !important;
        height: 26px !important;
        font-size: 11px !important;
    }

    html.thoflix-mobile .episode-info h4 {
        font-size: 10px !important;
        margin-bottom: 2px !important;
    }

    html.thoflix-mobile .episode-info p {
        font-size: 8px !important;
    }

    /* Ranking / nota nas capas da grelha */
    html.thoflix-mobile .rating-badge {
        top: 3px !important;
        right: 3px !important;
        font-size: 7px !important;
        font-weight: 700 !important;
        padding: 2px 4px !important;
        gap: 2px !important;
        border-radius: 3px !important;
        line-height: 1 !important;
    }

    html.thoflix-mobile .rating-badge i {
        font-size: 6px !important;
    }

    /* Configurações + Controle dos Pais */
    html.thoflix-mobile .settings-page {
        padding: 8px 6px 20px !important;
        max-width: 100% !important;
    }

    html.thoflix-mobile .settings-header h2 {
        font-size: 18px !important;
    }

    html.thoflix-mobile .settings-row,
    html.thoflix-mobile .parental-settings-row {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        padding: 12px 14px !important;
    }

    html.thoflix-mobile .row-info {
        flex: 1;
        min-width: 0;
    }

    html.thoflix-mobile .row-desc {
        font-size: 10px !important;
        line-height: 1.35 !important;
    }

    html.thoflix-mobile .parental-row-actions {
        flex-direction: column;
        align-items: flex-end !important;
        gap: 6px !important;
    }

    html.thoflix-mobile .parental-status {
        font-size: 10px !important;
    }

    html.thoflix-mobile .settings-toggle {
        width: 44px !important;
        height: 24px !important;
    }

    html.thoflix-mobile .parental-pin-card {
        width: min(100%, 340px) !important;
        max-height: 92dvh !important;
    }

    html.thoflix-mobile .pin-box {
        width: 40px !important;
        height: 46px !important;
        font-size: 22px !important;
    }

    html.thoflix-mobile .pin-key {
        min-height: 42px !important;
        font-size: 18px !important;
    }

    html.thoflix-mobile .parental-pin-header h3 {
        font-size: 17px !important;
    }

    html.thoflix-mobile .parental-pin-actions {
        flex-direction: column !important;
    }

    html.thoflix-mobile .parental-pin-btn {
        width: 100% !important;
    }

    /* Login — layout app em paisagem */
    html.thoflix-mobile #login-screen {
        height: 100dvh !important;
        min-height: 100dvh !important;
        align-items: center !important;
        justify-content: center !important;
        padding: max(6px, env(safe-area-inset-top, 0)) max(10px, env(safe-area-inset-right, 0)) max(6px, env(safe-area-inset-bottom, 0)) max(10px, env(safe-area-inset-left, 0)) !important;
        overflow: hidden !important;
    }

    html.thoflix-mobile #login-screen.active {
        display: flex !important;
    }

    html.thoflix-mobile .login-bg {
        transform: scale(1.04);
        filter: brightness(0.45) saturate(1.05);
    }

    html.thoflix-mobile .login-card {
        width: min(92vw, 520px) !important;
        max-width: min(92vw, 520px) !important;
        max-height: calc(100dvh - 20px) !important;
        padding: 14px 16px !important;
        margin: 0 auto !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        border-radius: 14px !important;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6) !important;
    }

    html.thoflix-mobile .login-layout {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 16px !important;
    }

    html.thoflix-mobile .login-brand {
        flex: 0 0 38% !important;
        max-width: 38% !important;
        text-align: center !important;
        padding-right: 4px;
    }

    html.thoflix-mobile .login-brand .logo {
        margin-bottom: 8px !important;
    }

    html.thoflix-mobile .login-brand .logo img {
        height: 44px !important;
        width: auto;
    }

    html.thoflix-mobile .login-brand h1 {
        font-size: 14px !important;
        margin-bottom: 4px !important;
        line-height: 1.2;
    }

    html.thoflix-mobile .login-tagline {
        font-size: 10px !important;
        margin-bottom: 0 !important;
        line-height: 1.35;
        opacity: 0.75;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.thoflix-mobile .login-main {
        flex: 1 1 auto !important;
        min-width: 0 !important;
    }

    html.thoflix-mobile #login-form .input-group {
        margin-bottom: 8px !important;
    }

    html.thoflix-mobile #login-form .input-group i {
        font-size: 14px !important;
        left: 12px !important;
    }

    html.thoflix-mobile #login-form .input-group input {
        padding: 10px 12px 10px 38px !important;
        font-size: 16px !important;
        border-radius: 10px !important;
    }

    html.thoflix-mobile #login-form .btn-login-submit {
        width: 100% !important;
        min-width: 0 !important;
        padding: 11px 16px !important;
        font-size: 12px !important;
        margin-top: 2px;
        border-radius: 10px !important;
        letter-spacing: 0.06em;
    }

    html.thoflix-mobile #login-screen .error-msg {
        margin-top: 8px !important;
        font-size: 11px !important;
        min-height: 14px;
        line-height: 1.3;
    }

    html.thoflix-mobile #login-screen .login-host-banner {
        margin-top: 8px !important;
        padding: 8px 10px !important;
        font-size: 10px !important;
        line-height: 1.35;
    }

    /* Modal canais ao vivo — layout app (horizontal compacto) */
    html.thoflix-mobile #details-modal.modal-overlay {
        z-index: 5000 !important;
        align-items: center !important;
        justify-content: center !important;
        padding: max(6px, env(safe-area-inset-top, 0)) 8px max(6px, env(safe-area-inset-bottom, 0)) !important;
        background: rgba(0, 0, 0, 0.94) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }

    html.thoflix-mobile #details-modal .modal-content {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;
        width: min(96vw, 640px) !important;
        max-width: min(96vw, 640px) !important;
        max-height: min(88dvh, 320px) !important;
        border-radius: 14px !important;
        overflow: hidden !important;
        box-shadow: 0 20px 50px rgba(0, 0, 0, 0.65);
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        animation: modalSlideIn 0.25s ease-out;
    }

    @keyframes modalSlideIn {
        from {
            opacity: 0;
            transform: scale(0.96) translateY(8px);
        }
        to {
            opacity: 1;
            transform: scale(1) translateY(0);
        }
    }

    html.thoflix-mobile #details-modal .modal-preview {
        flex: 0 0 34% !important;
        width: 34% !important;
        min-width: 120px !important;
        max-width: 200px !important;
        height: auto !important;
        min-height: 100% !important;
        max-height: none !important;
        position: relative;
        background: #0a0a0c;
    }

    html.thoflix-mobile #details-modal .modal-preview img#modal-img,
    html.thoflix-mobile #details-modal .modal-preview video#modal-preview-video {
        object-fit: contain !important;
    }

    html.thoflix-mobile #details-modal .live-tag {
        top: 8px !important;
        left: 8px !important;
        padding: 3px 8px !important;
        font-size: 8px !important;
    }

    html.thoflix-mobile #details-modal .modal-logo {
        top: 8px !important;
        right: 8px !important;
        width: 32px !important;
        height: 32px !important;
        padding: 3px !important;
        border-radius: 6px !important;
    }

    html.thoflix-mobile #details-modal .modal-body {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        padding: 10px 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        background: #161725;
    }

    html.thoflix-mobile #details-modal .modal-header-info {
        margin-bottom: 2px !important;
        gap: 8px;
        align-items: flex-start !important;
    }

    html.thoflix-mobile #details-modal .modal-header-info h2 {
        font-size: 15px !important;
        line-height: 1.2;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    html.thoflix-mobile #details-modal .quality-badge {
        flex-shrink: 0;
        font-size: 9px !important;
        padding: 2px 6px !important;
    }

    html.thoflix-mobile #details-modal .modal-subtitle {
        margin-bottom: 8px !important;
        font-size: 10px !important;
    }

    html.thoflix-mobile #details-modal .epg-info {
        flex-direction: row !important;
        gap: 6px !important;
        margin-bottom: 10px !important;
    }

    html.thoflix-mobile #details-modal .epg-now,
    html.thoflix-mobile #details-modal .epg-next {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        padding: 8px 8px !important;
        border-radius: 8px !important;
    }

    html.thoflix-mobile #details-modal .epg-label {
        font-size: 8px !important;
        margin-bottom: 3px !important;
    }

    html.thoflix-mobile #details-modal .epg-now p,
    html.thoflix-mobile #details-modal .epg-next p {
        font-size: 9px !important;
        line-height: 1.35 !important;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    html.thoflix-mobile #details-modal .modal-actions {
        flex-direction: row !important;
        gap: 8px !important;
        margin-top: auto;
    }

    html.thoflix-mobile #details-modal .btn-play {
        flex: 1 1 auto !important;
        width: auto !important;
        min-height: 40px !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
        gap: 8px !important;
        border-radius: 10px !important;
    }

    html.thoflix-mobile #details-modal .btn-play i {
        font-size: 11px;
    }

    html.thoflix-mobile #details-modal .btn-close {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 72px !important;
        min-height: 40px !important;
        padding: 8px 14px !important;
        font-size: 11px !important;
        border-radius: 10px !important;
        white-space: nowrap;
    }
}

/* Modal em retrato (antes de rodar) — escondido com o resto da app */
@media (max-width: 900px) and (orientation: portrait) {
    html.thoflix-mobile #details-modal.modal-overlay:not(.hidden) {
        pointer-events: none;
        opacity: 0;
    }
}

/* Remove as barras de rolagem no layout mobile para uma navegação limpa (apenas deslizar) */
html.thoflix-mobile .sidebar nav ul::-webkit-scrollbar,
html.thoflix-mobile #category-items-wrapper::-webkit-scrollbar,
html.thoflix-mobile .category-list::-webkit-scrollbar,
html.thoflix-mobile .scroll-content::-webkit-scrollbar,
html.thoflix-mobile .continue-watching-list::-webkit-scrollbar,
html.thoflix-mobile .seasons-tabs::-webkit-scrollbar,
html.thoflix-mobile .category-content::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}

html.thoflix-mobile .sidebar nav ul,
html.thoflix-mobile #category-items-wrapper,
html.thoflix-mobile .category-list,
html.thoflix-mobile .scroll-content,
html.thoflix-mobile .continue-watching-list,
html.thoflix-mobile .seasons-tabs,
html.thoflix-mobile .category-content {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
