/*
  KINOWATCH TV COMPATIBILITY v2
  Load AFTER style.css.
  Activated by html.kinowatch-tv from tv-detect.js.
*/

/* =========================================================
   BASE — NO CSS VARIABLES REQUIRED
   ========================================================= */

html.kinowatch-tv,
html.kinowatch-tv body{
    margin:0 !important;
    background:#1f1613 !important;
    color:#f5f7fb !important;
}

html.kinowatch-tv .page{
    min-height:100vh !important;
    background:#1f1613 !important;
}

html.kinowatch-tv *{
    box-sizing:border-box !important;
    -webkit-backdrop-filter:none !important;
    backdrop-filter:none !important;
}

html.kinowatch-tv a{
    color:inherit;
    text-decoration:none;
}

html.kinowatch-tv a:focus,
html.kinowatch-tv button:focus,
html.kinowatch-tv input:focus,
html.kinowatch-tv select:focus,
html.kinowatch-tv textarea:focus,
html.kinowatch-tv [tabindex]:focus{
    outline:3px solid #ff783e !important;
    outline-offset:3px !important;
}


/* =========================================================
   HEADER
   ========================================================= */

html.kinowatch-tv .site-header{
    position:absolute !important;
    top:0 !important;
    right:0 !important;
    left:0 !important;

    height:66px !important;
    min-height:66px !important;

    padding:0 5% !important;

    display:flex !important;
    align-items:center !important;

    background:rgba(20,11,8,.90) !important;
    z-index:100 !important;
}

html.kinowatch-tv .nav-wrap{
    width:100% !important;
    display:flex !important;
    align-items:center !important;
}

html.kinowatch-tv .main-nav{
    display:flex !important;
    align-items:center !important;
    position:static !important;
    background:transparent !important;
}

html.kinowatch-tv .nav-link{
    height:66px !important;
    font-size:15px !important;
}

html.kinowatch-tv .kinowatch-header-search{
    background:#231a17 !important;
}


/* =========================================================
   HERO — OLD TV SAFE
   ========================================================= */

html.kinowatch-tv .hero{
    position:relative !important;
    display:block !important;

    width:100% !important;
    height:560px !important;
    min-height:560px !important;

    padding:0 !important;
    overflow:hidden !important;

    background:#1f1613 !important;
}

html.kinowatch-tv .hero-slider{
    position:relative !important;

    width:100% !important;
    height:560px !important;
    min-height:560px !important;

    overflow:hidden !important;
    background:#1f1613 !important;
}

html.kinowatch-tv .hero-slide{
    position:absolute !important;
    top:0 !important;
    right:0 !important;
    bottom:auto !important;
    left:0 !important;

    width:100% !important;
    height:560px !important;

    display:none !important;

    padding:0 5% 68px !important;

    overflow:hidden !important;
    background:#1f1613 !important;
}

html.kinowatch-tv .hero-slide.active{
    display:flex !important;
    align-items:flex-end !important;

    opacity:1 !important;
    visibility:visible !important;
    pointer-events:auto !important;

    z-index:5 !important;
}

html.kinowatch-tv .hero-slide .hero-bg{
    position:absolute !important;
    top:0 !important;
    left:0 !important;

    width:100% !important;
    height:100% !important;

    display:block !important;

    object-fit:cover !important;
    object-position:center center !important;

    opacity:1 !important;
    visibility:visible !important;

    z-index:0 !important;
}

html.kinowatch-tv .hero-slide:before{
    content:"" !important;
    position:absolute !important;
    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    background:
        linear-gradient(
            90deg,
            rgba(25,16,13,.60) 0%,
            rgba(25,16,13,.26) 35%,
            rgba(25,16,13,.06) 70%,
            rgba(25,16,13,.04) 100%
        ) !important;

    z-index:1 !important;
}

html.kinowatch-tv .hero-slide:after{
    content:"" !important;
    position:absolute !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    height:48% !important;

    background:
        linear-gradient(
            0deg,
            #1f1613 0%,
            rgba(31,22,19,.75) 15%,
            rgba(31,22,19,.18) 60%,
            rgba(31,22,19,0) 100%
        ) !important;

    z-index:2 !important;
}

html.kinowatch-tv .hero-content{
    position:relative !important;
    z-index:3 !important;

    width:520px !important;
    max-width:520px !important;

    padding:0 !important;

    color:#fff !important;
}

html.kinowatch-tv .hero-switch{
    display:block !important;
    opacity:1 !important;
    visibility:visible !important;

    width:46px !important;
    height:74px !important;

    z-index:30 !important;

    background:rgba(21,12,9,.78) !important;
}

html.kinowatch-tv .hero-switch.prev{
    left:18px !important;
}

html.kinowatch-tv .hero-switch.next{
    right:18px !important;
}

html.kinowatch-tv .hero-pagination{
    z-index:30 !important;
}


/* =========================================================
   CONTENT
   ========================================================= */

html.kinowatch-tv .content{
    position:relative !important;
    z-index:10 !important;

    margin-top:-23px !important;
    padding-bottom:46px !important;

    background:#1f1613 !important;
}

html.kinowatch-tv .media-section{
    padding-left:5% !important;
    padding-right:5% !important;
}


/* =========================================================
   HORIZONTAL ROWS — FLEX FALLBACK
   ========================================================= */

html.kinowatch-tv .media-row{
    display:flex !important;

    width:100% !important;

    overflow-x:auto !important;
    overflow-y:hidden !important;

    padding:2px 0 9px !important;

    white-space:normal !important;
    scroll-behavior:auto !important;
}

html.kinowatch-tv .media-row > .card{
    display:block !important;

    flex:0 0 19% !important;
    width:19% !important;
    min-width:19% !important;

    margin-right:1.2% !important;
}

html.kinowatch-tv .poster-row > .card{
    flex-basis:15.7% !important;
    width:15.7% !important;
    min-width:15.7% !important;
}


/* =========================================================
   CARD RATIOS — NO aspect-ratio
   ========================================================= */

html.kinowatch-tv .card{
    position:relative !important;
    overflow:visible !important;
    background:transparent !important;
}

html.kinowatch-tv .card-media{
    position:relative !important;
    width:100% !important;
    height:0 !important;

    overflow:hidden !important;

    background:#342b28 !important;
}

html.kinowatch-tv .landscape-card .card-media{
    padding-bottom:56.25% !important;
}

html.kinowatch-tv .poster-card .card-media{
    padding-bottom:150% !important;
}

html.kinowatch-tv .card-media > img{
    position:absolute !important;
    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    width:100% !important;
    height:100% !important;

    max-width:none !important;
    max-height:none !important;

    display:block !important;
    object-fit:cover !important;
}


/* TV has no dependable hover. */
html.kinowatch-tv .card:hover,
html.kinowatch-tv .card:hover .card-media img{
    transform:none !important;
}


/* =========================================================
   ROW ARROWS
   ========================================================= */

html.kinowatch-tv .row-arrow,
html.kinowatch-tv .similar-arrow{
    display:block !important;
    opacity:1 !important;
    visibility:visible !important;
}


/* =========================================================
   SIMILAR
   ========================================================= */

html.kinowatch-tv .similar-row{
    display:flex !important;

    width:100% !important;

    overflow-x:auto !important;
    overflow-y:hidden !important;
}

html.kinowatch-tv .similar-card{
    display:block !important;

    flex:0 0 15.7% !important;
    width:15.7% !important;
    min-width:15.7% !important;

    margin-right:1.2% !important;
}

html.kinowatch-tv .similar-poster{
    position:relative !important;

    width:100% !important;
    height:0 !important;
    padding-bottom:150% !important;

    overflow:hidden !important;
}

html.kinowatch-tv .similar-poster > img{
    position:absolute !important;
    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    width:100% !important;
    height:100% !important;

    object-fit:cover !important;
}


/* =========================================================
   ACTORS
   ========================================================= */

html.kinowatch-tv .actors-row{
    display:flex !important;

    width:100% !important;

    overflow-x:auto !important;
    overflow-y:hidden !important;
}

html.kinowatch-tv .actors-row > *{
    flex:0 0 116px !important;
    width:116px !important;
    min-width:116px !important;

    margin-right:12px !important;
}


/* =========================================================
   CATALOG / FAVORITES / USERINFO
   ========================================================= */

html.kinowatch-tv .catalog-grid,
html.kinowatch-tv .userinfo-page-content{
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:flex-start !important;

    width:100% !important;
}

html.kinowatch-tv .catalog-grid > .card,
html.kinowatch-tv .userinfo-page-content > .card{
    flex:0 0 15.7% !important;
    width:15.7% !important;
    min-width:15.7% !important;

    margin:0 1.2% 26px 0 !important;
}

html.kinowatch-tv .catalog-grid > *:not(.card),
html.kinowatch-tv .userinfo-page-content > *:not(.card){
    flex:0 0 100% !important;
    width:100% !important;
}


/* =========================================================
   FULL STORY
   ========================================================= */

html.kinowatch-tv .fullstory-page{
    padding:92px 5% 20px !important;
    background:#1f1613 !important;
}

html.kinowatch-tv .fullstory-visual-grid{
    display:flex !important;
    align-items:flex-start !important;

    width:100% !important;
}

html.kinowatch-tv .fullstory-poster-column{
    flex:0 0 320px !important;
    width:320px !important;

    margin-right:22px !important;
}

html.kinowatch-tv .fullstory-poster{
    width:320px !important;
    height:480px !important;

    min-height:0 !important;

    overflow:hidden !important;
}

html.kinowatch-tv .fullstory-poster img{
    width:100% !important;
    height:100% !important;

    object-fit:cover !important;
}

html.kinowatch-tv .fullstory-player{
    flex:1 1 auto !important;

    width:auto !important;
    min-width:0 !important;

    aspect-ratio:auto !important;
}

html.kinowatch-tv .movie-meta-grid{
    display:flex !important;
    flex-wrap:wrap !important;
}

html.kinowatch-tv .movie-meta-item{
    flex:1 1 22% !important;
    margin:0 10px 10px 0 !important;
}


/* =========================================================
   POPUPS / FORMS
   ========================================================= */

html.kinowatch-tv .ui-dialog{
    max-width:90% !important;
}


/* =========================================================
   FOCUS
   ========================================================= */

html.kinowatch-tv .card:focus,
html.kinowatch-tv .similar-card:focus,
html.kinowatch-tv .actor-card:focus,
html.kinowatch-tv .kinowatch-cast-item:focus{
    outline:3px solid #ff783e !important;
    outline-offset:4px !important;
}


/* =========================================================
   LARGE / 4K
   ========================================================= */

@media screen and (min-width:1600px){
    html.kinowatch-tv .hero,
    html.kinowatch-tv .hero-slider,
    html.kinowatch-tv .hero-slide{
        height:620px !important;
        min-height:620px !important;
    }
}

@media screen and (min-width:2500px){
    html.kinowatch-tv .hero,
    html.kinowatch-tv .hero-slider,
    html.kinowatch-tv .hero-slide{
        height:800px !important;
        min-height:800px !important;
    }
}


/* =========================================================
   TV V3 FIX — SHORTSTORY POSTERS WITH .card-media-link
   ========================================================= */

/*
  Current shortstory structure is:
  .card-media
    > a.card-media-link
        > img
        > quality/meta

  The previous TV fallback only targeted a direct child IMG.
  Because .card-media uses the classic height:0 + padding ratio,
  the nested link/image must also fill that generated box.
*/

html.kinowatch-tv .card-media-link{
    position:absolute !important;

    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    display:block !important;

    width:100% !important;
    height:100% !important;

    overflow:hidden !important;
}

html.kinowatch-tv .card-media-link > img,
html.kinowatch-tv .card-media img{
    position:absolute !important;

    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    display:block !important;

    width:100% !important;
    height:100% !important;

    min-width:100% !important;
    min-height:100% !important;
    max-width:none !important;
    max-height:none !important;

    object-fit:cover !important;
}

/*
  TV has no reliable hover/pointer model.
  Keep the poster itself fully clickable and avoid a hover layer
  sitting above it permanently on some TV engines.
*/
html.kinowatch-tv .card-hover-ui{
    display:none !important;
}


/* =========================================================
   TV V3 FIX — FULLSTORY PLAYER / LANGUAGE PANELS
   ========================================================= */

/*
  Give the player a real pixel height before JW/iframe code initializes.
  Old TV engines may ignore aspect-ratio completely.
  tv-compat.js recalculates the final 16:9 height after DOM ready.
*/
html.kinowatch-tv .fullstory-player{
    position:relative !important;

    width:auto !important;
    min-width:0 !important;

    height:600px !important;
    min-height:360px !important;

    overflow:hidden !important;

    background:#000 !important;
    aspect-ratio:auto !important;
}

html.kinowatch-tv .language-player{
    position:relative !important;

    width:100% !important;
    height:100% !important;

    min-height:100% !important;

    overflow:hidden !important;

    background:#000 !important;
}

html.kinowatch-tv .language-player-panel{
    position:absolute !important;

    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    display:none !important;

    width:100% !important;
    height:100% !important;

    background:#000 !important;

    z-index:1 !important;
}

html.kinowatch-tv .language-player-panel.active{
    display:block !important;
    visibility:visible !important;
    opacity:1 !important;
}

html.kinowatch-tv .language-player-panel iframe,
html.kinowatch-tv .language-player-panel .jwplayer,
html.kinowatch-tv .language-player-panel video{
    display:block !important;

    width:100% !important;
    height:100% !important;

    min-width:100% !important;
    min-height:100% !important;

    border:0 !important;
}

html.kinowatch-tv .player-language-control{
    z-index:50 !important;
}


/* Common TV viewport tuning */

@media screen and (max-width:1400px){
    html.kinowatch-tv .fullstory-player{
        height:520px !important;
    }
}

@media screen and (min-width:1800px){
    html.kinowatch-tv .fullstory-player{
        height:700px !important;
    }
}


/* =========================================================
   TV V4 — VISUAL REFINEMENT
   ========================================================= */

/* ---------- home rows / cards ---------- */

html.kinowatch-tv .media-row{
    gap:0 !important;
}

html.kinowatch-tv .media-row > .card{
    margin-right:11px !important;
}

html.kinowatch-tv .media-row > .card:last-child{
    margin-right:0 !important;
}

html.kinowatch-tv .card-info{
    padding:8px 2px 1px !important;
}

html.kinowatch-tv .card-primary-title{
    font-size:15px !important;
    line-height:1.3 !important;
}

html.kinowatch-tv .card-secondary-title{
    margin-top:3px !important;
    font-size:12px !important;
    line-height:1.3 !important;
    color:#b3a094 !important;
}

/* season / episode stays clean and separate */
html.kinowatch-tv .card-episode-badge{
    top:8px !important;
    left:8px !important;

    max-width:68% !important;

    min-height:22px !important;
    padding:4px 7px !important;

    overflow:hidden !important;
    text-overflow:ellipsis !important;
    white-space:nowrap !important;

    border:1px solid rgba(255,255,255,.18) !important;
    border-radius:4px !important;

    background:rgba(20,11,8,.72) !important;
    color:#fff !important;

    font-size:11px !important;
    line-height:1 !important;
}

/* force landscape metadata to the bottom; avoids badge collision */
html.kinowatch-tv .landscape-card .card-overlay{
    position:absolute !important;

    top:auto !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    min-height:48px !important;

    padding:18px 9px 7px !important;

    display:flex !important;
    flex-direction:column !important;
    justify-content:flex-end !important;

    background:
        linear-gradient(
            0deg,
            rgba(4,6,10,.90) 0%,
            rgba(4,6,10,.52) 58%,
            rgba(4,6,10,0) 100%
        ) !important;

    opacity:1 !important;
}

html.kinowatch-tv .landscape-card .card-meta{
    width:100% !important;

    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;

    color:#fff !important;
    font-size:11px !important;
}

html.kinowatch-tv .card-quality{
    top:8px !important;
    right:8px !important;

    min-height:21px !important;
    padding:4px 7px !important;

    background:rgba(20,11,8,.72) !important;

    font-size:11px !important;
}

html.kinowatch-tv .card-language{
    top:8px !important;
    left:8px !important;
}

html.kinowatch-tv .card-language span{
    min-height:21px !important;
    padding:4px 7px !important;

    background:rgba(20,11,8,.72) !important;

    font-size:11px !important;
}


/* ---------- row arrows ---------- */

html.kinowatch-tv .row-arrow,
html.kinowatch-tv .similar-arrow{
    width:34px !important;
    height:64px !important;

    background:rgba(21,12,9,.82) !important;

    opacity:.92 !important;
}

html.kinowatch-tv .row-arrow.left,
html.kinowatch-tv .similar-arrow.left{
    left:-8px !important;
}

html.kinowatch-tv .row-arrow.right,
html.kinowatch-tv .similar-arrow.right{
    right:-8px !important;
}


/* ---------- fullstory top layout ---------- */

html.kinowatch-tv .fullstory-visual-grid{
    display:flex !important;
    align-items:stretch !important;
}

html.kinowatch-tv .fullstory-poster-column{
    flex:0 0 285px !important;
    width:285px !important;

    margin-right:22px !important;

    display:flex !important;
    flex-direction:column !important;
}

html.kinowatch-tv .fullstory-poster{
    width:285px !important;
    height:427px !important;

    flex:none !important;

    border-radius:8px !important;
}

html.kinowatch-tv .trailer-button{
    width:100% !important;
    height:42px !important;

    margin-top:10px !important;

    flex:none !important;
}

html.kinowatch-tv .fullstory-player{
    flex:1 1 auto !important;
    min-width:0 !important;

    border-radius:8px !important;
}

/* force every relevant player layer to cover the full player box */
html.kinowatch-tv .fullstory-player > .language-player,
html.kinowatch-tv .language-player-panel,
html.kinowatch-tv .language-player-panel > div,
html.kinowatch-tv .language-player-panel > iframe,
html.kinowatch-tv .language-player-panel .jwplayer,
html.kinowatch-tv .language-player-panel video{
    width:100% !important;
    height:100% !important;
    max-width:none !important;
    max-height:none !important;
}

/* JW wrappers frequently have their own inline dimensions */
html.kinowatch-tv .language-player-panel .jwplayer,
html.kinowatch-tv .language-player-panel .jw-wrapper,
html.kinowatch-tv .language-player-panel .jw-media,
html.kinowatch-tv .language-player-panel .jw-video{
    position:absolute !important;
    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;
}


/* ---------- fullstory title/actions ---------- */

html.kinowatch-tv .fullstory-details{
    margin-top:18px !important;
    padding-top:18px !important;
}

html.kinowatch-tv .fullstory-title{
    font-size:27px !important;
    line-height:1.2 !important;
}

html.kinowatch-tv .fullstory-title-en{
    margin-top:4px !important;
    font-size:14px !important;
}

html.kinowatch-tv .fullstory-actions{
    gap:8px !important;
}

html.kinowatch-tv .fullstory-action{
    min-height:38px !important;

    padding:0 12px !important;

    font-size:12px !important;
}


/* ---------- fullstory metadata: same clean unified idea as desktop ---------- */

html.kinowatch-tv .movie-meta-grid{
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:center !important;

    width:100% !important;

    margin-top:16px !important;
    padding:15px 17px 13px !important;

    border:1px solid rgba(255,255,255,.09) !important;
    border-bottom:0 !important;
    border-radius:9px 9px 0 0 !important;

    background:transparent !important;
}

html.kinowatch-tv .movie-meta-item{
    min-width:0 !important;

    display:flex !important;
    align-items:baseline !important;

    padding:0 !important;
    margin:0 !important;

    border:0 !important;
    background:transparent !important;
}

/* top compact row */
html.kinowatch-tv .movie-meta-imdb-item,
html.kinowatch-tv .movie-meta-year-item,
html.kinowatch-tv .movie-meta-pg-item{
    flex:0 0 auto !important;
    width:auto !important;

    margin-right:44px !important;
    margin-bottom:3px !important;
}

html.kinowatch-tv .movie-meta-imdb-item .movie-meta-label{
    min-height:22px !important;
    padding:0 6px !important;

    display:inline-flex !important;
    align-items:center !important;

    margin-right:6px !important;

    border-radius:3px !important;

    background:#e5bd20 !important;
    color:#111 !important;

    font-size:12px !important;
    line-height:1 !important;
}

/* long rows */
html.kinowatch-tv .movie-meta-director-item,
html.kinowatch-tv .movie-meta-country-item,
html.kinowatch-tv .movie-meta-genre-item,
html.kinowatch-tv .movie-meta-duration-item{
    flex:0 0 100% !important;
    width:100% !important;

    margin-top:10px !important;
    padding-top:10px !important;

    border-top:1px solid rgba(255,255,255,.055) !important;
}

html.kinowatch-tv .movie-meta-label{
    flex:0 0 115px !important;

    margin:0 !important;

    color:#978478 !important;

    font-size:13px !important;
    line-height:1.5 !important;
}

html.kinowatch-tv .movie-meta-value{
    flex:1 1 auto !important;

    overflow:visible !important;

    color:#edf1f6 !important;

    font-size:12px !important;
    line-height:1.55 !important;

    white-space:normal !important;
    text-overflow:clip !important;
}

/* description visually continues metadata */
html.kinowatch-tv .fullstory-description{
    margin-top:0 !important;
    padding:15px 17px 17px !important;

    border:1px solid rgba(255,255,255,.09) !important;
    border-top:1px solid rgba(255,255,255,.06) !important;
    border-radius:0 0 9px 9px !important;

    background:transparent !important;
}

html.kinowatch-tv .fullstory-description-title{
    font-size:14px !important;
}

html.kinowatch-tv .fullstory-description p{
    font-size:12px !important;
    line-height:1.7 !important;
}


/* ---------- TV focus ---------- */

html.kinowatch-tv .card:focus,
html.kinowatch-tv .card-media-link:focus,
html.kinowatch-tv .similar-card:focus,
html.kinowatch-tv .actor-card:focus,
html.kinowatch-tv .kinowatch-cast-item:focus{
    outline:3px solid #ff783e !important;
    outline-offset:3px !important;
}


/* ---------- compact TV viewport ---------- */

@media screen and (max-width:1300px){

    html.kinowatch-tv .fullstory-poster-column{
        flex-basis:250px !important;
        width:250px !important;
    }

    html.kinowatch-tv .fullstory-poster{
        width:250px !important;
        height:375px !important;
    }

    html.kinowatch-tv .card-primary-title{
        font-size:14px !important;
    }

    html.kinowatch-tv .card-secondary-title{
        font-size:11px !important;
    }
}


/* =========================================================
   TV V5 — FULLSTORY ONLY
   Homepage/rows are intentionally untouched.
   ========================================================= */

/* ---------------------------------------------------------
   POSTER COLUMN
   V4 matched poster height to the fixed TV player height.
   The width was too small, making the poster look very narrow.
   365px is close to a natural 2:3 poster when player height is 600px:
   600 - 42 trailer - 10 gap = 548px poster height.
   --------------------------------------------------------- */

html.kinowatch-tv .fullstory-poster-column{
    flex:0 0 365px !important;
    width:365px !important;
    min-width:365px !important;

    margin-right:24px !important;
}

html.kinowatch-tv .fullstory-poster{
    width:365px !important;
    min-width:365px !important;

    border-radius:9px !important;
}

html.kinowatch-tv .fullstory-poster img{
    width:100% !important;
    height:100% !important;

    display:block !important;

    object-fit:cover !important;
    object-position:center top !important;
}


/* ---------------------------------------------------------
   METADATA — CLEAN 3-COLUMN TOP ROW
   IMDb / Year / PG
   --------------------------------------------------------- */

html.kinowatch-tv .movie-meta-grid{
    display:flex !important;
    flex-wrap:wrap !important;
    align-items:stretch !important;

    width:100% !important;

    margin-top:16px !important;
    padding:0 !important;

    border:1px solid rgba(255,255,255,.09) !important;
    border-radius:9px 9px 0 0 !important;

    background:transparent !important;

    overflow:hidden !important;
}


/* reset all metadata items first */

html.kinowatch-tv .movie-meta-item{
    box-sizing:border-box !important;

    min-width:0 !important;

    margin:0 !important;
    padding:11px 14px !important;

    border:0 !important;
    border-radius:0 !important;

    background:transparent !important;
}


/* IMDb / Year / PG: exactly one top row */

html.kinowatch-tv .movie-meta-imdb-item,
html.kinowatch-tv .movie-meta-year-item,
html.kinowatch-tv .movie-meta-pg-item{
    flex:0 0 33.3333% !important;
    width:33.3333% !important;

    min-height:48px !important;

    display:flex !important;
    align-items:center !important;

    border-bottom:1px solid rgba(255,255,255,.06) !important;
}


/* vertical separators between the 3 top cells */

html.kinowatch-tv .movie-meta-year-item,
html.kinowatch-tv .movie-meta-pg-item{
    border-left:1px solid rgba(255,255,255,.055) !important;
}


/* top-row labels must NOT inherit the 115px long-row label width */

html.kinowatch-tv .movie-meta-imdb-item .movie-meta-label,
html.kinowatch-tv .movie-meta-year-item .movie-meta-label,
html.kinowatch-tv .movie-meta-pg-item .movie-meta-label{
    flex:0 0 auto !important;
    width:auto !important;

    margin:0 8px 0 0 !important;

    font-size:12px !important;
    line-height:1 !important;

    white-space:nowrap !important;
}


/* compact yellow IMDb badge */

html.kinowatch-tv .movie-meta-imdb-item .movie-meta-label{
    min-width:0 !important;
    min-height:22px !important;

    padding:0 6px !important;

    display:inline-flex !important;
    align-items:center !important;
    justify-content:center !important;

    border-radius:3px !important;

    background:#e5bd20 !important;
    color:#111 !important;
}


/* top row values */

html.kinowatch-tv .movie-meta-imdb-item .movie-meta-value,
html.kinowatch-tv .movie-meta-year-item .movie-meta-value,
html.kinowatch-tv .movie-meta-pg-item .movie-meta-value{
    flex:0 1 auto !important;

    width:auto !important;

    overflow:visible !important;

    color:#edf1f6 !important;

    font-size:12px !important;
    line-height:1.35 !important;

    white-space:nowrap !important;
}


/* IMDb numeric value should be normal text, not yellow */

html.kinowatch-tv .movie-meta-imdb-item .movie-meta-value.imdb{
    color:#edf1f6 !important;
}


/* ---------------------------------------------------------
   LONG METADATA ROWS
   Director / Country / Genre / Duration
   --------------------------------------------------------- */

html.kinowatch-tv .movie-meta-director-item,
html.kinowatch-tv .movie-meta-country-item,
html.kinowatch-tv .movie-meta-genre-item,
html.kinowatch-tv .movie-meta-duration-item{
    flex:0 0 100% !important;
    width:100% !important;

    min-height:45px !important;

    display:flex !important;
    align-items:flex-start !important;

    padding:11px 14px !important;

    border-bottom:1px solid rgba(255,255,255,.055) !important;
}


/* last metadata row should not add an extra bottom divider */

html.kinowatch-tv .movie-meta-duration-item{
    border-bottom:0 !important;
}


/* only long rows get a fixed label column */

html.kinowatch-tv .movie-meta-director-item .movie-meta-label,
html.kinowatch-tv .movie-meta-country-item .movie-meta-label,
html.kinowatch-tv .movie-meta-genre-item .movie-meta-label,
html.kinowatch-tv .movie-meta-duration-item .movie-meta-label{
    flex:0 0 135px !important;
    width:135px !important;

    margin:0 !important;

    color:#978478 !important;

    font-size:12px !important;
    line-height:1.5 !important;

    white-space:nowrap !important;
}


html.kinowatch-tv .movie-meta-director-item .movie-meta-value,
html.kinowatch-tv .movie-meta-country-item .movie-meta-value,
html.kinowatch-tv .movie-meta-genre-item .movie-meta-value,
html.kinowatch-tv .movie-meta-duration-item .movie-meta-value{
    flex:1 1 auto !important;
    width:auto !important;
    min-width:0 !important;

    overflow:visible !important;

    color:#edf1f6 !important;

    font-size:12px !important;
    line-height:1.55 !important;

    white-space:normal !important;
    word-break:normal !important;
    text-overflow:clip !important;
}


/* ---------------------------------------------------------
   DESCRIPTION CONTINUES THE SAME PANEL
   --------------------------------------------------------- */

html.kinowatch-tv .fullstory-description{
    margin-top:0 !important;

    padding:14px 15px 16px !important;

    border:1px solid rgba(255,255,255,.09) !important;
    border-top:1px solid rgba(255,255,255,.06) !important;
    border-radius:0 0 9px 9px !important;

    background:transparent !important;
}


/* ---------------------------------------------------------
   Smaller TV CSS viewports
   Player is 520px high there, so poster height becomes about 468px.
   312px width restores the natural 2:3 proportion.
   --------------------------------------------------------- */

@media screen and (max-width:1400px){

    html.kinowatch-tv .fullstory-poster-column{
        flex-basis:312px !important;
        width:312px !important;
        min-width:312px !important;

        margin-right:20px !important;
    }

    html.kinowatch-tv .fullstory-poster{
        width:312px !important;
        min-width:312px !important;
    }

    html.kinowatch-tv .movie-meta-director-item .movie-meta-label,
    html.kinowatch-tv .movie-meta-country-item .movie-meta-label,
    html.kinowatch-tv .movie-meta-genre-item .movie-meta-label,
    html.kinowatch-tv .movie-meta-duration-item .movie-meta-label{
        flex-basis:120px !important;
        width:120px !important;
    }
}

/* =========================================================
   TV V6 — MKLAND2 SERIES SLIDER
   ---------------------------------------------------------
   Old Smart TV engines may not support CSS Grid / aspect-ratio
   reliably. This block affects ONLY the new homepage series
   slider (.mkland2-list--slider).
   ========================================================= */

html.kinowatch-tv .mkland2-home-section{
    width:100% !important;
    min-width:0 !important;
}

html.kinowatch-tv .mkland2-slider-shell{
    position:relative !important;

    width:100% !important;
    min-width:0 !important;
}


/* Grid -> flex fallback for old TV browsers. */
html.kinowatch-tv .mkland2-list--slider{
    display:flex !important;
    align-items:flex-start !important;

    width:100% !important;
    min-width:0 !important;

    gap:0 !important;

    overflow-x:auto !important;
    overflow-y:hidden !important;

    padding:2px 0 8px !important;

    scroll-behavior:auto !important;
    scroll-snap-type:none !important;

    white-space:normal !important;
}


/*
   Default CSS fallback: 4 landscape cards visible.
   tv-compat.js replaces this with exact pixel widths from
   the real TV viewport, so old engines do not miscalculate %.
*/
html.kinowatch-tv .mkland2-list--slider > .mkland2-card{
    display:block !important;

    flex:0 0 24.1% !important;

    width:24.1% !important;
    min-width:24.1% !important;

    margin-right:11px !important;

    color:inherit !important;
    text-decoration:none !important;
}

html.kinowatch-tv .mkland2-list--slider > .mkland2-card:last-child{
    margin-right:0 !important;
}


/* No aspect-ratio dependency on TV. */
html.kinowatch-tv .mkland2-media{
    position:relative !important;

    width:100% !important;
    height:0 !important;

    padding-bottom:56.25% !important;

    overflow:hidden !important;

    border-radius:7px !important;
    background:#281f1c !important;
}

html.kinowatch-tv .mkland2-image{
    position:absolute !important;

    top:0 !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    display:block !important;

    width:100% !important;
    height:100% !important;

    min-width:100% !important;
    min-height:100% !important;

    max-width:none !important;
    max-height:none !important;

    object-fit:cover !important;

    transform:none !important;
}


/* Keep metadata layers pinned to the picture. */
html.kinowatch-tv .mkland2-badge-year{
    top:8px !important;
    right:8px !important;

    min-height:24px !important;

    padding:0 8px !important;

    font-size:12px !important;
}

html.kinowatch-tv .mkland2-overlay{
    position:absolute !important;

    top:auto !important;
    right:0 !important;
    bottom:0 !important;
    left:0 !important;

    padding:38px 10px 9px !important;

    opacity:1 !important;
}

html.kinowatch-tv .mkland2-meta{
    width:100% !important;

    display:flex !important;
    align-items:center !important;
    justify-content:space-between !important;

    gap:10px !important;
}

html.kinowatch-tv .mkland2-episode,
html.kinowatch-tv .mkland2-rating{
    font-size:12px !important;
}

html.kinowatch-tv .mkland2-info{
    padding:8px 2px 1px !important;
}

html.kinowatch-tv .mkland2-title{
    font-size:15px !important;
    line-height:1.3 !important;
}

html.kinowatch-tv .mkland2-title-en{
    margin-top:3px !important;

    font-size:12px !important;
    line-height:1.3 !important;

    color:#b3a094 !important;
}


/* TV needs permanently visible navigation arrows. */
html.kinowatch-tv .mkland2-arrow{
    display:block !important;

    width:34px !important;
    height:64px !important;

    opacity:.94 !important;
    visibility:visible !important;

    background:rgba(21,12,9,.84) !important;

    z-index:30 !important;
}

html.kinowatch-tv .mkland2-arrow--left{
    left:-8px !important;
}

html.kinowatch-tv .mkland2-arrow--right{
    right:-8px !important;
}


/* Remote-control focus. */
html.kinowatch-tv .mkland2-card:focus{
    outline:3px solid #ff783e !important;
    outline-offset:3px !important;
}


/* Slightly smaller TV CSS viewports still keep four cards. */
@media screen and (max-width:1300px){

    html.kinowatch-tv .mkland2-title{
        font-size:14px !important;
    }

    html.kinowatch-tv .mkland2-title-en{
        font-size:11px !important;
    }
}

/* =========================================================
   TV V7 — FULL STORY V4 LAYOUT
   ---------------------------------------------------------
   Current Full Story uses .fullstory-layout-v4 CSS Grid.
   Older Smart TV engines may not place those grid items correctly.
   tv-compat.js builds two small TV-only flex wrappers:
     1) poster/trailer + player
     2) title + actions
   Everything else keeps the current Full Story design.
   ========================================================= */

/* Disable the modern grid only in TV mode. */
html.kinowatch-tv .fullstory-layout-v4{
    display:block !important;

    width:100% !important;
    min-width:0 !important;

    column-gap:0 !important;
    row-gap:0 !important;
}

html.kinowatch-tv .fullstory-layout-v4 > *{
    min-width:0 !important;
}


/* ---------- top banner ---------- */

html.kinowatch-tv .fullstory-layout-v4 > .fullstory-banner-top-v4{
    display:flex !important;
    align-items:center !important;
    justify-content:center !important;

    width:100% !important;
    max-width:100% !important;

    margin:0 0 11px !important;
}

html.kinowatch-tv .fullstory-banner-v4 img,
html.kinowatch-tv .fullstory-banner-v4 iframe{
    display:block !important;
    max-width:100% !important;
    height:auto !important;
}


/* =========================================================
   POSTER + PLAYER ROW
   ========================================================= */

html.kinowatch-tv .fullstory-tv-top-v4{
    display:flex !important;
    align-items:stretch !important;

    width:100% !important;
    min-width:0 !important;

    margin:0 !important;
    padding:0 !important;
}

html.kinowatch-tv .fullstory-tv-top-v4 > .fullstory-side-v4{
    display:flex !important;
    flex-direction:column !important;

    flex:0 0 25% !important;

    width:25% !important;
    min-width:0 !important;
    height:auto !important;

    margin:0 22px 0 0 !important;
    padding:0 !important;
}

/* Override old .fullstory-poster fixed widths from TV V4/V5. */
html.kinowatch-tv .fullstory-tv-top-v4 .fullstory-side-v4 .fullstory-poster{
    display:block !important;

    flex:1 1 auto !important;

    width:100% !important;
    min-width:0 !important;
    max-width:none !important;

    height:auto !important;
    min-height:0 !important;

    margin:0 !important;

    overflow:hidden !important;
    border-radius:9px !important;
}

html.kinowatch-tv .fullstory-tv-top-v4 .fullstory-side-v4 .fullstory-poster img{
    display:block !important;

    width:100% !important;
    height:100% !important;

    max-width:none !important;
    max-height:none !important;

    object-fit:cover !important;
    object-position:center top !important;
}

html.kinowatch-tv .fullstory-tv-top-v4 .fullstory-side-v4 .trailer-button{
    flex:0 0 42px !important;

    width:100% !important;
    height:42px !important;

    margin:11px 0 0 !important;
}

html.kinowatch-tv .fullstory-tv-top-v4 > .fullstory-player{
    position:relative !important;

    flex:1 1 auto !important;

    width:auto !important;
    min-width:0 !important;
    max-width:none !important;

    margin:0 !important;

    overflow:hidden !important;
    border-radius:8px !important;
    background:#000 !important;

    aspect-ratio:auto !important;
}

/* Every active player layer must cover the calculated TV player box. */
html.kinowatch-tv .fullstory-tv-top-v4 .fullstory-player > .language-player,
html.kinowatch-tv .fullstory-tv-top-v4 .language-player-panel,
html.kinowatch-tv .fullstory-tv-top-v4 .language-player-panel > div,
html.kinowatch-tv .fullstory-tv-top-v4 .language-player-panel > iframe,
html.kinowatch-tv .fullstory-tv-top-v4 .language-player-panel .jwplayer,
html.kinowatch-tv .fullstory-tv-top-v4 .language-player-panel .jw-wrapper,
html.kinowatch-tv .fullstory-tv-top-v4 .language-player-panel .jw-media,
html.kinowatch-tv .fullstory-tv-top-v4 .language-player-panel .jw-video,
html.kinowatch-tv .fullstory-tv-top-v4 .language-player-panel video{
    width:100% !important;
    height:100% !important;

    min-width:100% !important;
    min-height:100% !important;

    max-width:none !important;
    max-height:none !important;
}


/* ---------- free row / lower banner ---------- */

html.kinowatch-tv .fullstory-layout-v4 > .fullstory-free-row-v4{
    display:block !important;

    width:100% !important;
    max-width:100% !important;

    margin:11px 0 0 !important;
    padding:0 !important;

    text-align:center !important;
}

html.kinowatch-tv .fullstory-layout-v4 > .fullstory-free-row-v4 > *{
    max-width:100% !important;
    margin-left:auto !important;
    margin-right:auto !important;
}


/* =========================================================
   TITLE + ACTIONS ROW
   ========================================================= */

html.kinowatch-tv .fullstory-tv-title-row-v4{
    display:flex !important;
    align-items:flex-start !important;
    justify-content:space-between !important;

    width:100% !important;
    min-width:0 !important;

    margin:9px 0 0 !important;
    padding:0 !important;
}

html.kinowatch-tv .fullstory-tv-title-row-v4 > .fullstory-title-block-v4{
    flex:1 1 auto !important;

    width:auto !important;
    min-width:0 !important;

    margin:0 !important;
    padding:0 22px 0 0 !important;
}

html.kinowatch-tv .fullstory-tv-title-row-v4 > .fullstory-actions{
    flex:0 0 auto !important;

    width:auto !important;
    min-width:0 !important;

    display:flex !important;
    align-items:center !important;
    justify-content:flex-end !important;
    flex-wrap:wrap !important;

    gap:8px !important;

    margin:0 !important;
}


/* ---------- following fullstory blocks ---------- */

html.kinowatch-tv .fullstory-layout-v4 > .movie-meta-grid,
html.kinowatch-tv .fullstory-layout-v4 > .fullstory-description,
html.kinowatch-tv .fullstory-layout-v4 > .actors-section,
html.kinowatch-tv .fullstory-layout-v4 > .similar-section{
    width:100% !important;
    min-width:0 !important;
}

/* Desktop TV must not show the duplicate compact phone poster/about block. */
html.kinowatch-tv .fullstory-layout-v4 > .fullstory-mobile-about{
    display:none !important;
}


/* ---------- smaller TV CSS viewport ---------- */

@media screen and (max-width:1400px){

    html.kinowatch-tv .fullstory-tv-top-v4 > .fullstory-side-v4{
        margin-right:18px !important;
    }

    html.kinowatch-tv .fullstory-title{
        font-size:24px !important;
    }

    html.kinowatch-tv .fullstory-tv-title-row-v4 > .fullstory-title-block-v4{
        padding-right:16px !important;
    }
}

