/* ============================================================
   DEXON PLAYER - Stylesheet Netflix-style (responsivo)
   ============================================================ */

:root {
    --bg-0: #000000;
    --bg-1: #0a0a0e;
    --bg-2: #141420;
    --bg-3: #1f1f30;
    --text-0: #ffffff;
    --text-1: #e5e5e5;
    --text-2: #b3b3b3;
    --text-3: #6b6b80;
    --primary: #e10600;
    --primary-d: #c01395;
    --primary-l: #0b8fcc;
    --line: rgba(255, 255, 255, 0.10);
    --line-2: rgba(255, 255, 255, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* font-size responsivo: 0.833vw = 16px em 1920px, escala proporcional em 1280px (FHD) */
html {
    font-size: 0.833vw;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: 'Netflix Sans', 'Helvetica Neue', 'Segoe UI', 'Arial', sans-serif;
    -webkit-font-smoothing: antialiased;
}

img {
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
}

button,
input {
    font-family: inherit;
    color: inherit;
}

.screen {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    overflow: hidden;
}

.screen.active {
    display: block;
}

.hidden {
    display: none !important;
}

/* ===== SPLASH ===== */
#splashScreen {
    background: #000;
}

#splashScreen.active {
    display: flex;
}

.splash-container {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.splash-logo {
    width: 30%;
    max-width: 480px;
    height: auto;
    margin-bottom: 5%;
    -webkit-filter: drop-shadow(0 0 30px rgba(225, 6, 0, 0.4));
}

.splash-spinner {
    width: 5%;
    min-width: 60px;
    max-width: 80px;
    height: 0;
    padding-bottom: 5%;
    min-height: 60px;
    max-height: 80px;
    border: 5px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    -webkit-animation: spin 1s linear infinite;
    animation: spin 1s linear infinite;
}

@-webkit-keyframes spin {
    to {
        -webkit-transform: rotate(360deg);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.splash-status {
    margin-top: 3%;
    font-size: 1.6em;
    color: var(--text-2);
    letter-spacing: 1px;
}

/* ===== PROFILES ===== */
#profilesScreen {
    background: #000;
}

.profiles-bg {
    position: absolute;
    inset: 0;
    background: #000 center/cover no-repeat;
    -webkit-filter: brightness(0.4);
    filter: brightness(0.4);
    z-index: 0;
}

.profiles-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.85));
    z-index: 1;
}

.profiles-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 2% 4%;
    z-index: 5;
}

.profiles-logo {
    width: 10%;
    min-width: 120px;
    max-width: 180px;
    height: auto;
}

.profiles-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 6% 4%;
}

.profiles-title {
    font-size: 3em;
    font-weight: 300;
    color: #fff;
    margin-bottom: 5%;
    letter-spacing: 1px;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
}

.profiles-grid {
    display: flex;
    gap: 3%;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90%;
}

.profile-card {
    width: 13vw;
    min-width: 160px;
    max-width: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s;
    padding: 1%;
}

.profile-avatar {
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5em;
    font-weight: 700;
    color: #fff;
    border: 4px solid transparent;
    overflow: hidden;
    position: relative;
}

.profile-avatar {
    line-height: 0;
}

.profile-card.focused .profile-avatar {
    border-color: #fff;
    transform: scale(1.08);
    box-shadow: 0 14px 30px rgba(255, 255, 255, 0.15);
}

.profile-name {
    margin-top: 14px;
    font-size: 1.4em;
    color: var(--text-2);
    text-align: center;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-card.focused .profile-name {
    color: #fff;
}

.profile-sub {
    margin-top: 4px;
    font-size: 1em;
    color: var(--text-3);
}

.profile-avatar-add,
.profile-avatar-edit {
    background: rgba(255, 255, 255, 0.04) !important;
    color: var(--text-3);
    font-size: 4em;
    font-weight: 300;
    border: 2px dashed rgba(255, 255, 255, 0.2);
}

.profile-card.focused .profile-avatar-add,
.profile-card.focused .profile-avatar-edit {
    color: #fff;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.08) !important;
}

.profile-del {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(225, 6, 0, 0.95);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profiles-hint {
    margin-top: 4%;
}

/* ===== LOGIN ===== */
#loginScreen {
    background: #000;
}

.login-bg {
    position: absolute;
    inset: 0;
    background: #000 center/cover no-repeat;
    z-index: 0;
}

.login-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.5) 50%, rgba(0, 0, 0, 0.85));
    z-index: 1;
}

.login-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 2% 4%;
    z-index: 5;
}

.login-logo {
    width: 14%;
    min-width: 160px;
    max-width: 240px;
    height: auto;
}

.login-card {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    max-width: 90%;
    background: rgba(0, 0, 0, 0.78);
    border-radius: 6px;
    padding: 48px 60px;
    z-index: 5;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.welcome-text {
    font-size: 2.2em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
    text-align: left;
}

.login-sub {
    color: var(--text-2);
    font-size: 1em;
    margin-bottom: 24px;
}

.login-row {
    margin-bottom: 16px;
}

.login-label {
    display: block;
    font-size: 0.9em;
    color: var(--text-2);
    margin-bottom: 6px;
}

.input-wrap {
    position: relative;
    width: 100%;
    height: 54px;
    background: #333;
    border: 2px solid transparent;
    border-radius: 4px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    transition: all 0.2s;
}

.input-wrap.focused {
    background: #454545;
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.input-wrap input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 1.1em;
    letter-spacing: 0.5px;
}

.input-wrap input::placeholder {
    color: #8c8c8c;
}

.btn-primary,
.btn-secondary {
    display: block;
    width: 100%;
    height: 54px;
    margin-top: 18px;
    border: 2px solid transparent;
    border-radius: 4px;
    font-size: 1.1em;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary.focused {
    background: var(--primary-l);
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(225, 6, 0, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.10);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-secondary.focused {
    background: rgba(255, 255, 255, 0.22);
    border-color: #fff;
    transform: scale(1.02);
}

.big-btn {
    width: auto !important;
    min-width: 240px;
    padding: 0 30px;
    height: 60px;
    font-size: 1.05em;
    display: inline-block;
}

.login-error {
    margin-top: 14px;
    color: #ff7970;
    font-size: 0.95em;
    text-align: center;
    min-height: 20px;
}

.footer-text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 2%;
    text-align: center;
    color: var(--text-3);
    font-size: 0.9em;
    letter-spacing: 2px;
    z-index: 3;
}

/* ===== MENU PRINCIPAL (hero transparente) ===== */
#mainMenu {
    background: #000;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: #000 center/cover no-repeat;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0.18) 38%, rgba(0, 0, 0, 0.55) 76%, rgba(0, 0, 0, 0.82) 100%);
    z-index: 1;
}

.menu-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.6% 3%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 10;
}

.menu-logo-top {
    width: 9%;
    min-width: 120px;
    max-width: 200px;
    height: auto;
    max-height: 60px;
    object-fit: contain;
}

.menu-user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.menu-user-name {
    font-size: 1em;
    font-weight: 600;
}

.menu-clock {
    font-size: 0.9em;
    color: var(--text-2);
    font-family: 'Courier New', monospace;
}

.hero-content {
    position: absolute;
    top: 16%;
    left: 3%;
    right: 3%;
    z-index: 5;
    max-width: 62%;
}

.hero-title {
    font-size: 4em;
    font-weight: 900;
    letter-spacing: 1px;
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.95);
    margin-bottom: 1%;
}

.hero-tag {
    font-size: 1.3em;
    color: var(--text-1);
    max-width: 80%;
    line-height: 1.4;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95);
}

.menu-content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 5%;
    padding: 0 3%;
    z-index: 5;
}

.menu-section {
    font-size: 1.5em;
    font-weight: 700;
    color: #fff;
    margin-bottom: 1.4%;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 14px rgba(0, 0, 0, 0.95);
}

.menu-tiles {
    display: flex;
    gap: 1.4%;
    overflow: visible;
}

.menu-tile {
    flex: 1 1 0;
    min-width: 0;
    height: 20vh;
    min-height: 180px;
    max-height: 240px;
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid rgba(255, 255, 255, 0.14);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5%;
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.menu-tile.focused {
    background: linear-gradient(135deg, rgba(225, 0, 206, 0.92), rgba(3, 9, 26, 0.92));
    border-color: #fff;
    transform: scale(1.07) translateY(-6px);
    z-index: 3;
    box-shadow: 0 18px 44px rgba(112, 41, 0, 0.788);
}

.menu-tile.tile-exit.focused {
    background: linear-gradient(135deg, rgba(60, 60, 60, 0.95), rgba(26, 26, 26, 0.95));
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.7);
}

.tile-icon {
    color: var(--primary-l);
    margin-bottom: 8%;
    opacity: 1;
    transition: color 0.2s, transform 0.2s;
}

.menu-tile.focused .tile-icon {
    color: #fff;
    transform: scale(1.12);
}

.menu-tile.tile-exit .tile-icon {
    color: var(--text-2);
}

.tile-icon svg {
    width: 54px;
    height: 54px;
}

.tile-title {
    font-size: 1.15em;
    font-weight: 800;
    color: #fff;
    letter-spacing: 1px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.menu-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
}

/* ===== SECTION HEADER / FOOTER ===== */
#liveScreen,
#moviesScreen,
#seriesScreen,
#episodesScreen,
#searchScreen,
#favoritesScreen,
#accountScreen {
    background: #0a0a10;
}

.section-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    padding: 0 3%;
    display: flex;
    align-items: center;
    gap: 24px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0));
    z-index: 10;
}

.header-logo {
    width: 7%;
    min-width: 90px;
    max-width: 140px;
    height: auto;
    max-height: 50px;
    object-fit: contain;
}

.section-title {
    font-size: 1.6em;
    font-weight: 700;
    color: #fff;
    letter-spacing: 2px;
}

.header-spacer {
    flex: 1;
}

.header-clock {
    color: var(--text-2);
    font-size: 1.1em;
    font-family: 'Courier New', monospace;
}

.header-search-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.header-search-btn.focused {
    background: var(--primary);
    border-color: #fff;
    transform: scale(1.1);
    box-shadow: 0 0 25px rgba(225, 6, 0, 0.6);
}

.section-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    padding: 0 3%;
    display: flex;
    align-items: center;
    gap: 30px;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.95), rgba(0, 0, 0, 0));
    z-index: 10;
}

.hint,
.player-hint {
    color: var(--text-2);
    font-size: 1em;
    letter-spacing: 0.5px;
}

/* ===== LISTAS (TV ao vivo / Episodios) ===== */
.three-cols {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 60px;
    display: flex;
}

.cat-col {
    width: 22%;
    min-width: 280px;
    background: rgba(15, 15, 22, 0.95);
    border-right: 1px solid var(--line);
    overflow: hidden;
}

.items-col {
    flex: 1;
    background: rgba(8, 8, 14, 0.95);
    overflow: hidden;
}

.preview-col {
    width: 24%;
    min-width: 340px;
    background: linear-gradient(180deg, #101018, #050508);
    border-left: 1px solid var(--line);
    padding: 24px;
    text-align: center;
    overflow: hidden;
}

.panel-title {
    font-size: 1em;
    color: var(--text-2);
    letter-spacing: 1.5px;
    padding: 14px 22px 10px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--line-2);
    font-weight: 600;
}

.categories-list,
.channels-list {
    list-style: none;
    height: calc(100% - 50px);
    overflow-y: hidden;
    padding: 6px 0;
}

.list-item {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    margin: 2px 10px;
    border-radius: 5px;
    font-size: 1em;
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.list-item .num {
    color: var(--text-3);
    font-size: 0.85em;
    margin-right: 12px;
    min-width: 45px;
    font-family: 'Courier New', monospace;
}

.list-item .label {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item .item-stack {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.list-item .epg-hint {
    font-size: 0.78em;
    color: var(--text-3);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-item .fav-mark {
    color: #00fff2;
    font-size: 1.2em;
    padding-left: 8px;
}

.list-item.focused {
    background: linear-gradient(90deg, var(--primary), var(--primary-d));
    color: #fff;
    transform: scale(1.01);
}

.list-item.focused .num {
    color: rgba(255, 255, 255, 0.85);
}

.list-item.focused .epg-hint {
    color: rgba(255, 255, 255, 0.85);
}

.list-item.selected {
    background: rgba(225, 6, 0, 0.18);
    color: #fff;
}

.channels-list-epg .list-item {
    padding-top: 8px;
    padding-bottom: 8px;
}

.preview-poster {
    width: 90%;
    max-width: 340px;
    height: 0;
    padding-bottom: 50%;
    margin: 18px auto 14px;
    background: #111;
    border: 1px solid var(--line);
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

.preview-poster.poster-large {
    padding-bottom: 140%;
    max-width: 240px;
    margin-top: 10px;
}

.preview-poster img {
    position: absolute;
    inset: 0;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.preview-title {
    font-size: 1.2em;
    color: #fff;
    margin-bottom: 8px;
    word-wrap: break-word;
}

.preview-meta {
    font-size: 0.85em;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.preview-info {
    font-size: 0.85em;
    color: var(--text-3);
    line-height: 1.4;
    max-height: 80px;
    overflow: hidden;
}

.preview-epg {
    margin-top: 14px;
    text-align: left;
    padding: 0 6px;
}

.epg-section-title {
    color: var(--primary);
    font-size: 0.75em;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-top: 10px;
    margin-bottom: 5px;
    font-weight: 700;
}

.epg-row {
    display: flex;
    gap: 8px;
    font-size: 0.9em;
    color: var(--text-1);
    align-items: flex-start;
}

.epg-time {
    color: var(--text-3);
    font-family: 'Courier New', monospace;
    min-width: 50px;
    font-size: 0.85em;
}

.epg-title {
    flex: 1;
    word-wrap: break-word;
    line-height: 1.3;
}

/* ===== GRADE DE CAPAS ===== */
.grid-layout {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 60px;
    display: flex;
}

.grid-cat-col {
    width: 18%;
    min-width: 260px;
    background: rgba(15, 15, 22, 0.95);
    border-right: 1px solid var(--line);
    overflow: hidden;
}

.grid-main {
    flex: 1;
    background: rgba(8, 8, 14, 0.95);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.poster-grid {
    flex: 1;
    overflow: hidden;
    padding: 14px 2%;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 30vh;
    gap: 1.2%;
    align-content: start;
}

.poster-card {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
    background: #1a1a26;
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.poster-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.poster-card .poster-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a26, #2a2a40);
    color: var(--text-3);
    font-size: 0.85em;
    text-align: center;
    padding: 8px;
}

.poster-card .poster-name {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 8px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.9));
    color: #fff;
    font-size: 0.85em;
    line-height: 1.15;
    max-height: 42px;
    overflow: hidden;
    font-weight: 600;
}

.poster-card.focused {
    border-color: #fff;
    transform: scale(1.08);
    z-index: 5;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.85);
}

.poster-empty {
    grid-column: 1/-1;
    text-align: center;
    color: var(--text-3);
    padding: 60px 20px;
    font-size: 1.1em;
}

/* ===== DETALHES ===== */
#movieDetailsScreen {
    background: #000;
}

.details-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    -webkit-filter: blur(6px) brightness(0.4);
    filter: blur(6px) brightness(0.4);
    z-index: 0;
}

.details-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.5));
    z-index: 1;
}

.details-content {
    position: absolute;
    inset: 6% 5%;
    display: flex;
    gap: 4%;
    z-index: 2;
}

.details-poster {
    width: 22%;
    min-width: 280px;
    max-width: 380px;
    height: auto;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.85);
    align-self: center;
}

.details-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.details-title {
    font-size: 3em;
    font-weight: 900;
    color: #fff;
    margin-bottom: 14px;
    line-height: 1.1;
}

.details-meta {
    font-size: 1.1em;
    color: var(--primary);
    letter-spacing: 1px;
    margin-bottom: 18px;
}

.details-plot {
    font-size: 1em;
    color: var(--text-1);
    line-height: 1.5;
    max-height: 30%;
    overflow: hidden;
    margin-bottom: 24px;
}

.details-actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* ===== BUSCA ===== */
.search-layout {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 60px;
    display: flex;
    flex-direction: column;
}

.search-bar-wrap {
    padding: 20px 3%;
}

.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    height: 60px;
    background: #1a1a22;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 0 18px;
    transition: all 0.2s;
}

.search-input-wrap.focused {
    border-color: var(--primary);
    background: #221518;
    box-shadow: 0 0 0 3px rgba(225, 6, 0, 0.25);
}

.search-icon-inline {
    color: var(--text-3);
    flex: 0 0 auto;
}

.search-input-wrap.focused .search-icon-inline {
    color: var(--primary);
}

#searchInput {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: #fff;
    font-size: 1.1em;
}

#searchInput::placeholder {
    color: var(--text-3);
}

.search-tabs {
    display: flex;
    gap: 10px;
    margin-top: 14px;
}

.search-tab {
    height: 38px;
    padding: 0 18px;
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    color: var(--text-2);
    font-size: 0.9em;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.search-tab.active {
    background: rgba(225, 221, 0, 0.25);
    color: #fff;
}

.search-tab.focused {
    border-color: var(--primary);
    transform: scale(1.04);
}

.search-results {
    flex: 1;
    overflow: hidden;
    padding: 6px 0 0;
    display: flex;
    flex-direction: column;
}

.search-status {
    padding: 24px 3%;
    color: var(--text-3);
    font-size: 1.05em;
    text-align: center;
}

/* ===== FAVORITES ===== */
.favorites-tabs {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    padding: 18px 3% 8px;
    display: flex;
    gap: 10px;
    z-index: 5;
}

.fav-tab {
    height: 38px;
    padding: 0 22px;
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    color: var(--text-2);
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
}

.fav-tab.active {
    background: rgba(225, 210, 0, 0.25);
    color: #fff;
}

.fav-tab.focused {
    border-color: var(--primary);
    transform: scale(1.04);
}

.favorites-content {
    position: absolute;
    top: 140px;
    left: 0;
    right: 0;
    bottom: 60px;
    overflow: hidden;
}

.favorites-status {
    padding: 60px 3%;
    color: var(--text-3);
    font-size: 1.1em;
    text-align: center;
}

.fav-list,
.fav-grid {
    padding: 14px 3%;
}

.fav-list {
    list-style: none;
    height: 100%;
    overflow-y: hidden;
}

.fav-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-auto-rows: 30vh;
    gap: 1.2%;
    align-content: start;
}

/* ===== ACCOUNT ===== */
.account-content {
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.account-box {
    width: 60%;
    min-width: 700px;
    max-width: 1100px;
    background: rgba(15, 15, 22, 0.92);
    border: 2px solid rgba(225, 6, 0, 0.3);
    border-radius: 14px;
    padding: 36px 50px;
}

.account-section-title {
    font-size: 1.1em;
    color: var(--primary);
    letter-spacing: 1px;
    margin: 20px 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(225, 6, 0, 0.2);
    font-weight: 700;
}

.account-section-title:first-child {
    margin-top: 0;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 4px;
    font-size: 1em;
    border-bottom: 1px solid var(--line-2);
}

.account-row:last-child {
    border-bottom: none;
}

.account-row span {
    color: var(--text-2);
}

.account-row b {
    color: #fff;
    font-weight: 600;
    max-width: 60%;
    text-align: right;
    word-break: break-all;
}

.account-actions {
    margin-top: 30px;
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== PLAYER ===== */
#playerScreen {
    background: #000;
}

#videoPlayer {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: #000;
}

.player-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s;
    z-index: 5;
}

.player-overlay.hidden-overlay {
    opacity: 0;
}

.player-top {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 3% 4%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}

.player-channel {
    font-size: 2.4em;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.player-category {
    display: block;
    color: var(--primary);
    font-size: 1.1em;
    margin-top: 4px;
    letter-spacing: 1.5px;
}

.player-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 3% 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}

.player-clock {
    color: #fff;
    font-size: 1.6em;
    font-family: 'Courier New', monospace;
}

.player-loading,
.player-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    z-index: 8;
}

.player-loading p,
.player-error p {
    margin-top: 20px;
    font-size: 1.4em;
    color: #fff;
}

.player-error button {
    width: auto;
    min-width: 280px;
    margin-top: 20px;
}

/* ===== DIALOG + TOAST ===== */
.dialog {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.dialog.hidden {
    display: none;
}

.dialog-box {
    width: 600px;
    max-width: 90%;
    background: #15151c;
    border: 2px solid rgba(225, 6, 0, 0.4);
    border-radius: 10px;
    padding: 40px;
    text-align: center;
}

.dialog-box h3 {
    font-size: 1.8em;
    margin-bottom: 14px;
    color: #fff;
}

.dialog-box p {
    font-size: 1.15em;
    color: var(--text-1);
    margin-bottom: 24px;
}

.dialog-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
}

.dialog-buttons button {
    width: 220px;
}

.toast {
    position: fixed;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.92);
    border: 1px solid rgba(225, 6, 0, 0.4);
    color: #fff;
    padding: 14px 28px;
    border-radius: 30px;
    font-size: 1em;
    font-weight: 600;
    z-index: 200;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.toast.hidden {
    display: none;
}

/* ===== PIN MODAL + SETTINGS ===== */
.pin-dots {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin: 24px 0 10px;
}

.pin-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    background: transparent;
    transition: all 0.15s;
}

.pin-dot.filled {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(225, 6, 0, 0.6);
}

.pin-hint {
    color: var(--text-3);
    font-size: 0.85em;
    margin-top: 8px;
}

.settings-hint {
    color: var(--text-3);
    font-size: 0.85em;
    margin: 4px 0 12px;
    padding: 0 4px;
}

.settings-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 12px 0 6px;
}

.settings-actions .big-btn {
    min-width: auto;
    flex: 1;
}

/* ============================================================
   LG WebOS - Otimizacoes de fluidez (navegacao por D-pad em TV)
   ============================================================ */

/* Esconde o cursor do Magic Remote: a navegacao e 100% por controle */
html,
body,
.screen,
button,
.menu-tile,
.poster-card,
.list-item,
.profile-card,
.search-tab,
.fav-tab,
.header-search-btn {
    cursor: none;
}

/* Composicao por GPU: foco fluido mesmo em TVs antigas.
   O backdrop-filter foi reduzido (blur 14->6) para evitar travadas. */
.menu-tile {
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    background: rgba(18, 18, 28, 0.55);
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transition: -webkit-transform 0.18s ease, transform 0.18s ease,
        background 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.menu-tile.focused {
    transform: translateZ(0) scale(1.07) translateY(-6px);
}

/* Aceleracao de hardware nos elementos que recebem foco */
.poster-card,
.list-item,
.profile-card,
.search-tab,
.fav-tab,
.input-wrap,
.btn-primary,
.btn-secondary,
.header-search-btn,
.profile-avatar {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.poster-card {
    transition: -webkit-transform 0.18s ease, transform 0.18s ease,
        border-color 0.18s ease, box-shadow 0.18s ease;
}

/* Evita flash branco na troca de telas e listas mais leves */
.screen {
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

.categories-list,
.channels-list,
.fav-list,
.poster-grid,
.fav-grid {
    will-change: transform;
}

/* Imagens decodificadas de forma assincrona (nao trava o foco) */
img {
    image-rendering: auto;
}

/* ============================================================
   TV AO VIVO  -  preview redesenhado + guia EPG completo
   ============================================================ */

/* --- coluna de preview: novo card de canal + EPG --- */
.preview-channel-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px 16px;
    border-bottom: 1px solid var(--line);
}

.preview-logo-wrap {
    flex: 0 0 auto;
    width: 96px;
    height: 96px;
    background: #0c0c14;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.preview-channel-logo {
    max-width: 86%;
    max-height: 86%;
    object-fit: contain;
}

.preview-channel-meta {
    flex: 1 1 auto;
    min-width: 0;
}

.preview-channel-name {
    font-size: 1.4em;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.preview-channel-cat {
    margin: 6px 0 0;
    color: var(--primary);
    font-size: 0.85em;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.preview-epg-card {
    margin: 12px 14px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border-left: 3px solid var(--primary);
    border-radius: 6px;
}

.preview-epg-next {
    border-left-color: #5b6acc;
    background: rgba(91, 106, 204, 0.07);
}

.epg-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.epg-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.68em;
    font-weight: 800;
    letter-spacing: 1.6px;
    text-transform: uppercase;
}

.epg-badge-live {
    background: var(--primary);
    color: #fff;
}

.epg-badge-next {
    background: #2b3674;
    color: #fff;
}

.epg-card-time {
    font-size: 0.82em;
    color: var(--text-2);
    font-family: 'Courier New', monospace;
}

.epg-card-title {
    margin: 0;
    font-size: 1em;
    line-height: 1.3;
    color: #fff;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.epg-progress-track {
    margin-top: 10px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.epg-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary), var(--primary-l));
    transition: width 0.6s ease;
}

.preview-cta {
    margin: 14px 14px 0;
    padding: 10px 12px;
    background: rgba(0, 180, 80, 0.10);
    border: 1px solid rgba(0, 200, 90, 0.25);
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cta-chip {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.68em;
    font-weight: 800;
    letter-spacing: 1.4px;
    background: #1f9d4c;
    color: #fff;
}

.cta-text {
    color: var(--text-1);
    font-size: 0.85em;
}

/* --- guia EPG completo (modal) --- */
#epgGuide.dialog {
    z-index: 200;
}

.epg-modal {
    width: 1280px;
    max-width: 90%;
    max-height: 84%;
    background: linear-gradient(180deg, #16161e, #0d0d14);
    border: 2px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.epg-modal-head {
    padding: 18px 22px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    gap: 18px;
}

.epg-modal-channel {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

.epg-modal-logo {
    width: 64px;
    height: 64px;
    flex: 0 0 auto;
    object-fit: contain;
    background: #0c0c14;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 6px;
}

.epg-modal-titles h2 {
    margin: 0;
    font-size: 1.5em;
    color: #fff;
    font-weight: 700;
}

.epg-modal-sub {
    margin: 4px 0 0;
    color: var(--primary);
    font-size: 0.78em;
    letter-spacing: 1.4px;
    text-transform: uppercase;
}

.epg-modal-title {
    margin: 0;
    color: var(--text-3);
    font-size: 0.78em;
    letter-spacing: 2.5px;
    text-transform: uppercase;
}

.epg-modal-status {
    padding: 24px;
    text-align: center;
    color: var(--text-2);
    font-size: 1em;
}

.epg-modal-list {
    list-style: none;
    padding: 8px 12px;
    margin: 0;
    overflow: hidden;
    flex: 1 1 auto;
}

.epg-row-item {
    padding: 11px 16px;
    margin: 3px 0;
    border-radius: 6px;
    background: transparent;
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 18px;
    align-items: start;
    transition: background 0.15s, color 0.15s, transform 0.15s;
    color: var(--text-2);
}

.epg-row-item .epg-row-time {
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    color: var(--text-2);
    white-space: nowrap;
}

.epg-row-item .epg-row-body {
    min-width: 0;
}

.epg-row-item .epg-row-title {
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    margin: 0;
    line-height: 1.25;
}

.epg-row-item .epg-row-desc {
    margin: 4px 0 0;
    color: var(--text-3);
    font-size: 0.82em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.epg-row-item.past {
    opacity: 0.45;
}

.epg-row-item.live {
    background: linear-gradient(90deg, rgba(225, 6, 0, 0.22), rgba(225, 6, 0, 0.04));
    border-left: 3px solid var(--primary);
    padding-left: 13px;
}

.epg-row-item.live .epg-row-time::after {
    content: 'AO VIVO';
    display: inline-block;
    margin-left: 8px;
    background: var(--primary);
    color: #fff;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 1.2px;
    font-family: 'Helvetica Neue', 'Arial', sans-serif;
    vertical-align: middle;
}

.epg-row-item.focused {
    background: linear-gradient(90deg, var(--primary), var(--primary-d));
    color: #fff;
    transform: translateX(3px);
}

.epg-row-item.focused .epg-row-time,
.epg-row-item.focused .epg-row-title,
.epg-row-item.focused .epg-row-desc {
    color: #fff;
}

.epg-row-item.focused .epg-row-desc {
    color: rgba(255, 255, 255, 0.85);
}

.epg-day-header {
    list-style: none;
    padding: 10px 16px 4px;
    color: var(--text-3);
    font-size: 0.78em;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    margin-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.epg-modal-foot {
    padding: 12px 22px;
    background: rgba(0, 0, 0, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-2);
    font-size: 0.85em;
}


/* ============================================================
   POSTER RAIN  -  chuva de capas (TMDB) no login com parallax
   ============================================================ */
.poster-rain {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    overflow: hidden;
}

.poster-rain.hidden {
    display: none;
}

.poster-rain-item {
    --rot: 0deg;
    --dur: 14s;
    --op: 0.55;
    --blur: 0px;
    position: absolute;
    top: -32vh;
    opacity: 0;
    filter: blur(var(--blur)) drop-shadow(0 18px 32px rgba(0, 0, 0, 0.55));
    animation: poster-fall linear forwards;
    animation-duration: var(--dur);
    will-change: transform, opacity;
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.poster-rain-item img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.04);
}

@keyframes poster-fall {
    0% {
        transform: translate3d(0, 0, 0) rotate(var(--rot));
        opacity: 0;
    }

    8% {
        opacity: var(--op);
    }

    92% {
        opacity: var(--op);
    }

    100% {
        transform: translate3d(0, 135vh, 0) rotate(var(--rot));
        opacity: 0;
    }
}


/* ============================================================
   MENU - cabecalho redesenhado (avatar + saudacao + data)
   ============================================================ */
.menu-status {
    display: flex;
    align-items: center;
    gap: 14px;
}

.menu-user-card,
.menu-clock-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: rgba(15, 15, 22, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 30px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.35);
}

.menu-user-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-d));
    color: #fff;
    font-size: 1.2em;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    box-shadow: 0 4px 14px rgba(225, 6, 0, 0.35), inset 0 0 0 2px rgba(255, 255, 255, 0.15);
}

.menu-user-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.15;
    min-width: 0;
}

.menu-user-greet {
    color: var(--text-2);
    font-size: 0.7em;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    font-weight: 600;
}

.menu-user-name {
    color: #fff;
    font-size: 1em;
    font-weight: 700;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.menu-clock-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(225, 6, 0, 0.18);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.menu-clock-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.1;
}

.menu-clock {
    color: #fff;
    font-size: 1.3em;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 1.4px;
}

.menu-date {
    color: var(--text-2);
    font-size: 0.7em;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    font-weight: 600;
}

/* ============================================================
   HERO SLIDE  -  card flutuante TMDB no menu (em alta)
   ============================================================ */
.hero-slide {
    position: absolute;

    top: 32%;
    left: 3%;

    width: 94%;
    max-width: none;

    background: linear-gradient(135deg,
            rgba(20, 20, 32, .94),
            rgba(10, 10, 16, .94));

    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 14px;

    padding: 20px;

    box-shadow: 0 18px 50px rgba(0, 0, 0, .6);

    z-index: 4;
}

.hero-slide.hidden {
    display: none;
}

.hero-slide.hero-slide-fading {
    opacity: 0;
}

.hero-slide-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.62em;
    font-weight: 800;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    background: var(--primary);
    color: #fff;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.35);
}

.hero-slide-body {
    display: flex;
    align-items: center;
    gap: 25px;
    width: 100%;
}

.hero-slide-poster-wrap {
    flex: 0 0 auto;
    width: 110px;
    height: 165px;
    border-radius: 8px;
    overflow: hidden;
    background: #0c0c14;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.55);
}

.hero-slide-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hero-slide-info {
    flex: 1 1 auto;
    min-width: 0;
}

.hero-slide-title {
    margin: 0;
    color: #fff;
    font-size: 1.2em;
    font-weight: 800;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hero-slide-meta-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 10px 0;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-slide-meta {
    color: var(--primary);
    font-size: 0.72em;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    font-weight: 700;
}

.hero-slide-rating-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
}

.hero-slide-stars {
    color: #3a3a4a;
    font-size: 0.95em;
    letter-spacing: 1px;
}

.hero-slide-star.on {
    color: #FFD700;
}

.hero-slide-rating {
    color: #fff;
    font-size: 0.85em;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 9px;
    border-radius: 5px;
    margin-left: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-slide-overview {
    margin: 0;
    color: var(--text-1);
    font-size: 0.78em;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
}

/* ============================================================
   POSTER CARDS  -  filmes e series mais bonitos e intuitivos
   ============================================================ */
.poster-card {
    position: relative;
    transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.24s ease,
        border-color 0.2s ease;
}

.poster-card.focused {
    border-color: #fff;
    transform: scale(1.10);
    z-index: 6;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.85),
        0 0 0 1px rgba(255, 255, 255, 0.45);
}

.poster-card.focused img {
    filter: brightness(1.07);
}

.poster-rating {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 3px 8px 3px 6px;
    font-size: 0.78em;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.4px;
    z-index: 3;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    gap: 4px;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.poster-rating-star {
    color: #FFC83D;
    font-size: 0.9em;
    line-height: 1;
    text-shadow: 0 0 6px rgba(255, 200, 60, 0.5);
}

.poster-fav {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-d));
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    color: #fff;
    font-size: 15px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.55),
        inset 0 0 0 1px rgba(255, 255, 255, 0.10);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.poster-name {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.85) 60%, rgba(0, 0, 0, 0.95) 100%);
    padding: 22px 9px 9px;
    transition: background 0.2s ease;
}

.poster-card.focused .poster-name {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.9) 50%, rgba(0, 0, 0, 1) 100%);
    color: #fff;
    font-weight: 700;
}

/* Loading state na grade */
.poster-loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-2);
}

.poster-loading-spin {
    width: 56px;
    height: 56px;
    border: 5px solid rgba(255, 255, 255, 0.10);
    border-top-color: var(--primary);
    border-radius: 50%;
    margin-bottom: 18px;
    animation: spin 1s linear infinite;
}

.poster-loading p {
    margin: 0;
    font-size: 1.05em;
    color: var(--text-2);
    letter-spacing: 0.5px;
}

/* Empty state */
.poster-empty {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-3);
    text-align: center;
}

.poster-empty-icon {
    color: rgba(255, 255, 255, 0.18);
    margin-bottom: 16px;
}

.poster-empty h3 {
    margin: 0 0 8px;
    font-size: 1.3em;
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.6px;
}

.poster-empty-sub {
    margin: 0;
    font-size: 0.9em;
    color: var(--text-3);
    line-height: 1.5;
    max-width: 520px;
}

/* Categorias - foco mais visivel */
.grid-cat-col .list-item.selected,
.cat-col .list-item.selected {
    background: rgba(225, 6, 0, 0.18);
    color: #fff;
    border-left: 3px solid var(--primary);
    padding-left: 17px;
}

/* Painel titulo mais elegante */
.grid-main .panel-title,
.items-col .panel-title {
    color: #fff;
    background: linear-gradient(90deg, rgba(225, 6, 0, 0.10), transparent 60%);
}

/* ============================================================
   EPISODIOS  -  lista com thumbnails 16:9 + progresso + preview
   ============================================================ */

/* Preview da direita - thumbnail 16:9 maior */
.preview-poster.poster-wide {
    width: 92%;
    max-width: 360px;
    padding-bottom: 51.75%;
    margin: 10px auto 14px;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.preview-poster.poster-wide img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ep-preview-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7em;
    font-weight: 800;
    letter-spacing: 1.3px;
    padding: 4px 10px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(225, 6, 0, 0.5);
    text-transform: uppercase;
}

.ep-preview-badge.ep-preview-badge-done {
    background: #1f9d4c;
    box-shadow: 0 4px 12px rgba(31, 157, 76, 0.5);
}

.ep-preview-badge.hidden {
    display: none;
}

.ep-preview-season-tag {
    margin: 0 6px 6px;
    color: var(--primary);
    font-size: 0.78em;
    font-weight: 800;
    letter-spacing: 2px;
    text-align: center;
}

/* Lista de episodios com thumbs */
.channels-list.episodes-thumbs {
    height: calc(100% - 50px);
    overflow: hidden;
    padding: 4px 6px;
}

.channels-list.episodes-thumbs .list-item.ep-row {
    display: grid;
    grid-template-columns: 54px 156px 1fr;
    gap: 12px;
    align-items: center;
    margin: 4px 8px;
    padding: 8px 10px;
    height: 92px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.02);
    transition: background 0.15s ease, transform 0.15s ease;
}

.channels-list.episodes-thumbs .list-item.ep-row.focused {
    background: linear-gradient(90deg, var(--primary), var(--primary-d));
    color: #fff;
    transform: scale(1.005);
}

.ep-row-num {
    color: var(--text-3);
    font-family: 'Courier New', monospace;
    font-size: 1.1em;
    font-weight: 800;
    text-align: center;
    letter-spacing: 1px;
}

.ep-row.focused .ep-row-num {
    color: rgba(255, 255, 255, 0.95);
}

.ep-row-thumb {
    position: relative;
    width: 156px;
    height: 88px;
    background: #0c0c14;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex: 0 0 auto;
}

.ep-row-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ep-row-thumb-fb {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, #1a1a26, #2a2a40);
}

.ep-row-play {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.40);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ep-row.focused .ep-row-play {
    opacity: 1;
}

.ep-row-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    background: var(--primary);
    box-shadow: 0 -1px 4px rgba(225, 6, 0, 0.5);
    pointer-events: none;
}

.ep-row-watched {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 22px;
    height: 22px;
    background: #1f9d4c;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
}

.ep-row-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.ep-row-title {
    color: #fff;
    font-size: 1em;
    font-weight: 600;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

.ep-row-snippet {
    color: var(--text-3);
    font-size: 0.78em;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.ep-row.focused .ep-row-title {
    color: #fff;
}

.ep-row.focused .ep-row-snippet {
    color: rgba(255, 255, 255, 0.85);
}


/* ============================================================
   LG QA - foco universal: garantir que TODO elemento focavel
   tenha indicador visivel (requisito de aprovacao webOS)
   ============================================================ */
*:focus,
*:focus-visible {
    outline: none;
}

[tabindex]:focus,
button:focus,
a:focus,
input:focus {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px rgba(225, 6, 0, 0.45) !important;
}

.focused {
    /* Glow extra para reforcar */
    box-shadow: 0 0 0 3px #ffffff, 0 0 0 8px rgba(225, 6, 0, 0.55), 0 16px 36px rgba(0, 0, 0, 0.6) !important;
}

/* Cursor pointer em qualquer elemento clicavel (magic remote) */
[tabindex],
button,
a,
.focused,
.menu-tile,
.poster-card,
.list-item,
.profile-card {
    cursor: pointer;
}

/* Texto de privacy/terms legivel */
#privacyText p,
#termsText p {
    color: #cfcfcf;
    font-size: 1.05em;
    line-height: 1.6;
    margin: 10px 0;
}