*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
    --bg: #0a0a0a;
    --bg-elevated: #141414;
    --bg-card: #181818;
    --bg-input: #2a2a2a;
    --bg-hover: #252525;
    --border: #2a2a2a;
    --border-strong: #3a3a3a;
    --text: #fff;
    --text-dim: #b3b3b3;
    --muted: #777;
    --accent: #00eae5;
    --accent-hover: #00d2ce;
    --accent-dark: #00908c;
    --success: #46d369;
    --error: #ff7043;
    --warning: #ffa726;
    --radius: 6px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    line-height: 1.5;
    overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }

/* === Topbar === */
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 14px 48px;
    background: linear-gradient(180deg, rgba(0,0,0,0.95), rgba(0,0,0,0.75));
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.logo-img {
    height: 38px;
    width: auto;
    display: block;
}

.topnav {
    display: flex;
    gap: 4px;
    flex: 1;
}
.topnav a {
    padding: 8px 14px;
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}
.topnav a:hover { background: var(--bg-hover); color: var(--text); }
.topnav a.active { color: var(--text); background: var(--bg-hover); }
.topnav .nav-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.topnav .nav-disabled:hover { background: transparent; color: var(--text-dim); }

.user-menu {
    display: flex;
    align-items: center;
    gap: 12px;
}
.user-name { color: var(--text-dim); font-size: 14px; }

.inline { display: inline; }

/* === Main === */
.app-main {
    padding: 32px 48px 80px;
    max-width: 1600px;
    margin: 0 auto;
}

.page-header { margin-bottom: 28px; }
.page-header h1 { font-size: 32px; font-weight: 700; margin-bottom: 4px; }
.page-header.with-action {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
}

.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12px; }
.link { color: var(--accent); }
.link:hover { text-decoration: underline; }

/* === Buttons === */
.btn-primary {
    display: block;
    width: 100%;
    padding: 13px;
    background: var(--accent);
    color: #0a0a0a;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }

.inline-btn { display: inline-block; width: auto; padding: 10px 20px; }

.btn-secondary, .btn-danger {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    display: inline-block;
    transition: background 0.15s, border-color 0.15s;
}
.btn-secondary:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-secondary:disabled { opacity: 0.5; cursor: wait; }
.btn-danger {
    color: #ff8a70;
    border-color: rgba(255, 112, 67, 0.3);
}
.btn-danger:hover { background: rgba(255, 112, 67, 0.1); border-color: var(--error); }

.btn-link {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
    padding: 8px 14px;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}
.btn-link:hover { color: var(--text); background: var(--bg-hover); }

/* === Forms === */
form label {
    display: block;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="url"],
select {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid transparent;
    border-radius: var(--radius);
    color: var(--text);
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.15s, background 0.15s;
}
input:focus, select:focus {
    outline: none;
    border-color: var(--border-strong);
    background: var(--bg-hover);
}

label.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    cursor: pointer;
    margin: 8px 0 16px;
}
label.checkbox input { margin: 0; width: auto; }

.form-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

/* Garantir que botões dentro de .form-actions tenham mesmo tamanho/alinhamento */
.form-actions .btn-primary,
.form-actions .btn-secondary,
.form-actions .btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    font-size: 14px;
    line-height: 1.4;
    height: 40px;
    width: auto;
    margin-top: 0;
    border: 1px solid transparent;
    box-sizing: border-box;
}
.form-actions .btn-primary  { border-color: var(--accent); }
.form-actions .btn-secondary { border-color: var(--border); }
.form-actions .btn-danger    { border-color: rgba(255, 112, 67, 0.3); }

.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    max-width: 720px;
}

/* === Login (split-screen) === */
.login-stage {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.1fr 1fr;
}

.login-side {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    overflow: hidden;
    background: var(--bg);
}
.login-side-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 800px 700px at 30% 20%, rgba(0, 234, 229, 0.22), transparent 60%),
        radial-gradient(ellipse 700px 500px at 70% 90%, rgba(0, 234, 229, 0.1), transparent 60%),
        linear-gradient(135deg, #0a0a0a 0%, #141414 100%);
    z-index: 0;
}
.login-side-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.6;
}
.login-side-content {
    position: relative;
    z-index: 1;
    max-width: 520px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-side-logo {
    height: 130px;
    width: auto;
    display: block;
    filter: drop-shadow(0 12px 40px rgba(0, 234, 229, 0.45));
}
.login-tagline {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #fff, #b3b3b3);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.login-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.login-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-dim);
    font-size: 15px;
}
.login-features .feat-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 234, 229, 0.12);
    border: 1px solid rgba(0, 234, 229, 0.25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.login-main {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px;
    background: var(--bg-elevated);
    border-left: 1px solid var(--border);
}

.login-card {
    width: 100%;
    max-width: 420px;
}
.login-card h1 { font-size: 32px; font-weight: 700; margin-bottom: 6px; }
.login-card > p.muted { margin-bottom: 28px; font-size: 15px; }

.login-form .field {
    display: block;
    margin-bottom: 18px;
}
.login-form .field span {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
    margin-bottom: 8px;
    font-weight: 600;
}
.login-form input[type="text"],
.login-form input[type="password"],
.login-form select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 14px 16px;
    font-size: 15px;
    border-radius: 10px;
    margin-top: 0;
    width: 100%;
}
.login-form input:focus,
.login-form select:focus {
    background: var(--bg-input);
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(0, 234, 229, 0.1);
}

.remember-checkbox {
    margin: 8px 0 28px;
    color: var(--text-dim);
    font-size: 13px;
}

.login-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 234, 229, 0.25);
}

@media (max-width: 900px) {
    .login-stage {
        grid-template-columns: 1fr;
    }
    .login-side {
        padding: 40px 24px;
        min-height: auto;
    }
    .login-side-logo { height: 64px; margin-bottom: 20px; }
    .login-tagline { font-size: 24px; margin-bottom: 20px; }
    .login-features { display: none; }
    .login-main {
        padding: 32px 24px 56px;
        border-left: none;
        border-top: 1px solid var(--border);
    }
    .login-card { max-width: 480px; margin: 0 auto; }
}

/* === Auth (legado, mantém pra setup admin) === */
.auth-body {
    background:
        radial-gradient(ellipse at top, rgba(0, 234, 229, 0.18), transparent 60%),
        radial-gradient(ellipse at bottom, rgba(0, 0, 0, 0.5), transparent),
        var(--bg);
}

.auth-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.auth-card {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.auth-brand {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
    margin-bottom: 32px;
    letter-spacing: 0.5px;
}
.auth-brand span { color: var(--text-dim); margin: 0 4px; }

.auth-card h1 { font-size: 26px; margin-bottom: 6px; font-weight: 700; }
.auth-card > p.muted { margin-bottom: 24px; }

.auth-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

/* === Alerts === */
.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert.error {
    background: rgba(255, 112, 67, 0.1);
    border-color: rgba(255, 112, 67, 0.4);
    color: #ffb088;
}
.alert.success {
    background: rgba(70, 211, 105, 0.1);
    border-color: rgba(70, 211, 105, 0.4);
    color: #88e8a0;
}

/* === Badges === */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-success { background: rgba(70, 211, 105, 0.15); color: var(--success); }
.badge-error   { background: rgba(255, 112, 67, 0.15); color: var(--error); }
.badge-warn    { background: rgba(255, 167, 38, 0.15); color: var(--warning); }
.badge-muted   { background: var(--bg-input); color: var(--muted); }

/* === Hero (Home) === */
.hero {
    position: relative;
    margin: -32px -48px 32px;
    padding: 60px 48px 56px;
    overflow: hidden;
    min-height: 460px;
    display: flex;
    align-items: flex-end;
}

.hero-featured .hero-bg {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(180deg, rgba(10,10,10,0.3) 0%, rgba(10,10,10,1) 100%),
        linear-gradient(90deg, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.55) 50%, rgba(10,10,10,0.2) 100%),
        var(--hero-bg, none);
    background-size: cover;
    background-position: center;
    filter: saturate(1.1);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}
.hero h1 { font-size: 40px; font-weight: 700; margin-bottom: 8px; }
.hero-sub { font-size: 16px; color: var(--text-dim); margin-bottom: 16px; }
.hero-meta { margin-bottom: 24px; }

.hero-feature-info { margin-top: 8px; }
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
/* Botões do hero com mesma altura e proporção */
.hero-actions .btn-primary,
.hero-actions .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 22px;
    font-size: 14px;
    font-weight: 600;
    height: 44px;
    line-height: 1;
    width: auto;
    margin-top: 0;
    border: 1px solid transparent;
    box-sizing: border-box;
}
.hero-actions .btn-primary  { border-color: var(--accent); }
.hero-actions .btn-secondary { border-color: var(--border); background: rgba(255,255,255,0.08); }
.hero-actions .btn-secondary:hover { background: rgba(255,255,255,0.15); border-color: var(--border-strong); }
.hero-tag {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(0, 234, 229, 0.2);
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 12px;
    margin-bottom: 10px;
}
.hero-feature-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 18px;
    text-shadow: 0 2px 16px rgba(0,0,0,0.8);
    line-height: 1.15;
}

@media (max-width: 720px) {
    .hero { padding: 32px 16px 32px; min-height: 380px; }
    .hero h1 { font-size: 28px; }
    .hero-feature-title { font-size: 22px; }

    /* Mobile: "Assistir agora" sozinho na primeira linha,
       TV ao Vivo + Filmes + Séries dividindo a segunda linha. */
    .hero-actions { gap: 6px; }
    .hero-actions .btn-primary {
        flex: 1 1 100%;
        height: 48px;
        font-size: 15px;
    }
    .hero-actions .btn-secondary {
        flex: 1 1 0;
        min-width: 0;
        padding: 0 8px;
        font-size: 12px;
        height: 40px;
    }
}

/* === Home rows === */
.home-section { margin-bottom: 44px; }
.section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    color: var(--text);
}

.scroll-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 8px;
}
.scroll-row::-webkit-scrollbar { height: 8px; }
.scroll-row::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.row-card {
    flex: 0 0 240px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: transform 0.15s, border-color 0.15s;
}
.row-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }

.playlist-tile { display: flex; gap: 12px; align-items: flex-start; }
.tile-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius);
    background: linear-gradient(135deg, rgba(0,234,229,0.2), rgba(0,234,229,0.05));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}
.tile-body { flex: 1; min-width: 0; }
.tile-body strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tile-meta { margin-top: 8px; display: flex; gap: 8px; align-items: center; }

.add-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-dim);
    border: 1px dashed var(--border-strong);
    background: transparent;
}
.add-tile:hover { border-color: var(--accent); color: var(--text); }
.add-tile .tile-icon { font-size: 32px; background: transparent; margin-bottom: 8px; }

.row-empty {
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* === Playlists === */
.playlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
    gap: 16px;
}
.playlist-card { padding: 24px; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.playlist-header h2 { font-size: 18px; font-weight: 600; }
.playlist-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 16px;
    font-size: 14px;
}
.playlist-info > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.playlist-info dt { color: var(--muted); font-size: 13px; }
.playlist-info dd { color: var(--text); text-align: right; }
.playlist-info code {
    background: var(--bg-input);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-family: 'SF Mono', Consolas, Monaco, monospace;
}
.playlist-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

/* === Empty state === */
.empty-state {
    background: var(--bg-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    padding: 56px 24px;
    text-align: center;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h2 { font-size: 18px; margin-bottom: 6px; }

/* === Profile selection === */
.profile-stage {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}
.profile-title {
    font-size: 42px;
    font-weight: 600;
    margin-bottom: 48px;
    text-align: center;
    color: var(--text);
}
.profile-grid {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 900px;
}
.profile-form { margin: 0; padding: 0; }

.profile-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: var(--text-dim);
    font-family: inherit;
    transition: color 0.15s, transform 0.2s;
    text-decoration: none;
}
.profile-card:hover { color: var(--text); transform: translateY(-4px); }
.profile-card:hover .profile-avatar {
    border-color: var(--text);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
}

.profile-avatar {
    position: relative;
    width: 132px;
    height: 132px;
    border-radius: 12px;
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 72px;
    line-height: 1;
    color: white;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    overflow: hidden;
}

.profile-avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 18px;
    border-width: 2px;
    border-radius: 6px;
}

/* Avatar gradients (cada bichinho com sua cor) */
.avatar-fox     { background: linear-gradient(135deg, #ff7043, #c93c1a); }
.avatar-wolf    { background: linear-gradient(135deg, #7d8a9c, #3a4658); }
.avatar-dragon  { background: linear-gradient(135deg, #9d4edd, #5a1ea0); }
.avatar-lion    { background: linear-gradient(135deg, #ffc855, #d49000); }
.avatar-tiger   { background: linear-gradient(135deg, #ff8c42, #d04a00); }
.avatar-cat     { background: linear-gradient(135deg, #ff69b4, #c71585); }
.avatar-bunny   { background: linear-gradient(135deg, #ffb6d9, #ff7eb1); }
.avatar-dolphin { background: linear-gradient(135deg, #4fc3f7, #0277bd); }
.avatar-panda   { background: linear-gradient(135deg, #757575, #2a2a2a); }
.avatar-owl     { background: linear-gradient(135deg, #a47148, #5d3d1f); }
.avatar-unicorn { background: linear-gradient(135deg, #c084fc, #d946ef); }
.avatar-penguin { background: linear-gradient(135deg, #1e88e5, #0d47a1); }

.avatar-add    {
    background: transparent;
    border: 3px dashed var(--border-strong);
    color: var(--muted);
    font-weight: 300;
    font-size: 56px;
}
.add-card:hover .avatar-add { border-color: var(--text); color: var(--text); }

/* Edit overlay (manage screen) */
.edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s;
    border-radius: 9px;
}
.profile-edit-card:hover .edit-overlay { opacity: 1; }
.edit-pencil {
    font-size: 48px;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.6));
}

.profile-name {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}
.profile-lock { font-size: 12px; }
.profile-kids {
    font-size: 9px;
    background: var(--warning);
    color: #1a1a1a;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.profile-actions {
    display: flex;
    gap: 16px;
    margin-top: 56px;
}
.manage-btn {
    border: 1px solid var(--border-strong);
    color: var(--text-dim);
}
.manage-btn:hover { color: var(--text); }

/* === Profile form === */
.profile-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 32px;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin: 12px 0 20px;
}
.avatar-option { cursor: pointer; }
.avatar-option input { display: none; }
.avatar-option .profile-avatar {
    width: 64px;
    height: 64px;
    font-size: 36px;
    border-radius: 8px;
    margin: 0 auto;
    opacity: 0.55;
    transition: opacity 0.15s, transform 0.15s, border-color 0.15s;
}
.avatar-option:hover .profile-avatar { opacity: 0.9; transform: scale(1.04); }
.avatar-option input:checked + .profile-avatar {
    opacity: 1;
    border-color: var(--text);
    transform: scale(1.08);
}

/* Delete zone (form de edição) */
.profile-delete-zone {
    margin-top: 16px;
    text-align: center;
    border-color: rgba(255, 112, 67, 0.3);
}

/* === PIN entry === */
.pin-card {
    background: rgba(0,0,0,0.7);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 40px 32px;
    width: 100%;
    max-width: 380px;
}
.pin-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}
.pin-form input {
    text-align: center;
    font-size: 28px;
    letter-spacing: 12px;
    padding: 16px;
    max-width: 220px;
}
.pin-form .btn-primary { width: 100%; max-width: 220px; }

/* === Profile manage === */
.profile-manage-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
.profile-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
}
.profile-row .profile-avatar {
    width: 56px;
    height: 56px;
    font-size: 24px;
    border-radius: 6px;
    flex-shrink: 0;
}
.profile-row-info { flex: 1; }
.profile-row-info strong { font-size: 16px; display: block; margin-bottom: 4px; }
.profile-row-meta { display: flex; gap: 6px; }
.profile-row-actions { display: flex; gap: 8px; }

/* === Profile dropdown menu === */
.profile-menu {
    position: relative;
}
.profile-menu summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: var(--radius);
    cursor: pointer;
    list-style: none;
    transition: background 0.15s;
}
.profile-menu summary::-webkit-details-marker { display: none; }
.profile-menu summary:hover { background: var(--bg-hover); }
.profile-menu .caret { color: var(--muted); font-size: 10px; }
.profile-menu[open] .caret { transform: rotate(180deg); }

.profile-menu-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    z-index: 100;
}

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    background: none;
    border: none;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}
.dropdown-item:hover { background: var(--bg-hover); }

.dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* === Live TV layout === */
.live-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    margin: -16px -8px 0;
    min-height: calc(100vh - 140px);
}
.live-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 0;
    height: fit-content;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
}
.sidebar-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 8px;
}
.cat-list { display: flex; flex-direction: column; }
.cat-item {
    padding: 10px 16px;
    color: var(--text-dim);
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
}
.cat-item:hover { background: var(--bg-hover); color: var(--text); }
.cat-item.active {
    background: var(--bg-hover);
    color: var(--text);
    border-left-color: var(--accent);
    font-weight: 500;
}

.live-main { min-width: 0; }
.live-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    margin-bottom: 20px;
}
.live-header h1 { font-size: 26px; font-weight: 700; }

.channel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.channel-card {
    display: flex;
    gap: 14px;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
    cursor: pointer;
    color: inherit;
    text-decoration: none;
}
.channel-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    background: var(--bg-hover);
}
.ch-logo {
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}
.ch-logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ch-logo-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: var(--muted);
    font-size: 16px;
    text-transform: uppercase;
}
.ch-body { flex: 1; min-width: 0; }
.ch-name {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.ch-epg .epg-now {
    font-size: 12px;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}
.ch-epg .epg-tag {
    background: var(--accent);
    color: white;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}
.ch-epg .epg-next {
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Recent channel tile na home */
.recent-channel-tile { display: flex; gap: 12px; align-items: center; flex: 0 0 240px; }
.recent-channel-tile .ch-logo { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 6px; }

/* === Player === */
.player-page {
    display: grid;
    grid-template-columns: 1fr 320px;
    grid-template-rows: auto 1fr;
    gap: 16px;
    margin: -32px -48px;
    height: calc(100vh - 64px);
}
.player-topbar {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 24px;
    background: rgba(0,0,0,0.5);
    border-bottom: 1px solid var(--border);
}
.player-back {
    color: var(--text-dim);
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: color 0.15s, background 0.15s;
}
.player-back:hover { color: var(--text); background: var(--bg-hover); }
.player-channel { display: flex; align-items: center; gap: 10px; }
.player-channel img { max-width: 32px; max-height: 32px; border-radius: 4px; }
.player-channel-name { font-size: 16px; font-weight: 500; }

.player-stage {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}
.player-stage video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.player-loading, .player-error {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dim);
    background: rgba(0,0,0,0.7);
}

/* "Toque pra reproduzir" — fallback quando autoplay (mesmo mudo) é bloqueado */
.player-tap-to-play {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    background: rgba(0,0,0,0.55);
    border: none;
    color: white;
    cursor: pointer;
    font-family: inherit;
    z-index: 5;
}
.player-tap-to-play .tap-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    padding-left: 6px;
    transition: transform 0.15s, background 0.15s;
    box-shadow: 0 12px 32px rgba(0, 234, 229, 0.5);
}
.player-tap-to-play:hover .tap-icon { transform: scale(1.08); background: var(--accent-hover); }
.player-tap-to-play .tap-text { font-size: 16px; font-weight: 500; }

/* "Toque pra ativar som" — overlay sutil quando autoplay arrancou mudo */
.player-unmute {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    z-index: 4;
    backdrop-filter: blur(8px);
    transition: background 0.15s, transform 0.15s;
    animation: unmute-pulse 2s ease-in-out infinite;
}
.player-unmute:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: translateX(-50%) scale(1.05);
    animation: none;
}
.player-unmute .mute-icon { font-size: 18px; }
@keyframes unmute-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(0, 234, 229, 0.5); }
    50% { box-shadow: 0 0 0 12px rgba(0, 234, 229, 0); }
}
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player-sidebar {
    background: var(--bg-card);
    border-left: 1px solid var(--border);
    padding: 20px 24px;
    overflow-y: auto;
}
.player-sidebar h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 16px;
}
.epg-list { display: flex; flex-direction: column; gap: 12px; }
.epg-item {
    padding: 12px;
    border-radius: var(--radius);
    background: var(--bg-input);
    border-left: 3px solid transparent;
}
.epg-item.now { border-left-color: var(--accent); }
.epg-time {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 4px;
    font-weight: 600;
}
.epg-item.now .epg-time { color: var(--accent); }
.epg-title { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.epg-desc { font-size: 12px; color: var(--text-dim); line-height: 1.4; }

@media (max-width: 1100px) {
    .live-layout { grid-template-columns: 1fr; }
    .live-sidebar { position: static; max-height: 240px; }
    .player-page { grid-template-columns: 1fr; }
    .player-sidebar { border-left: none; border-top: 1px solid var(--border); }
}

/* === Botão fullscreen do player (custom — alguns mobiles escondem o nativo) === */
.btn-fullscreen {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 8;
    backdrop-filter: blur(6px);
    transition: background 0.15s, transform 0.15s, opacity 0.2s;
    opacity: 0.8;
}
.btn-fullscreen:hover { background: rgba(0, 0, 0, 0.85); opacity: 1; transform: scale(1.05); }
.btn-fullscreen:active { transform: scale(0.95); }
.player-stage:fullscreen .btn-fullscreen,
.player-stage:-webkit-full-screen .btn-fullscreen { display: none; }

/* === Player: corrige overflow horizontal em mobile === */
@media (max-width: 720px) {
    .player-page {
        margin: -16px -16px 0;
        height: auto;
        min-height: calc(100vh - 64px);
    }
    .movie-player .player-stage {
        aspect-ratio: 16/9;
        max-height: 60vh;
    }
    .player-topbar { padding: 10px 14px; gap: 10px; flex-wrap: wrap; }
    .player-channel-name { font-size: 14px; }
    .btn-fullscreen { width: 38px; height: 38px; top: 8px; right: 8px; }
}

/* === Landscape mobile: player ocupa tela toda, sem topbar === */
@media (orientation: landscape) and (max-height: 500px) {
    .topbar { display: none; }
    .app-main { padding: 0; }
    .player-page {
        margin: 0;
        height: 100vh;
        min-height: 100vh;
    }
    .player-topbar {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        z-index: 6;
        background: linear-gradient(180deg, rgba(0,0,0,0.7), transparent);
        border-bottom: none;
        padding: 8px 14px;
        opacity: 0;
        transition: opacity 0.2s;
    }
    .player-stage:hover ~ .player-topbar,
    .player-page:hover .player-topbar { opacity: 1; }
    .movie-player .player-stage,
    .player-stage {
        aspect-ratio: auto !important;
        height: 100vh !important;
        max-height: 100vh !important;
    }
    .player-sidebar { display: none !important; }
    .btn-fullscreen { top: 14px; right: 14px; }
}

/* === Row header (categorias na home) === */
.row-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}
.row-see-all {
    color: var(--text-dim);
    font-size: 13px;
    transition: color 0.15s;
}
.row-see-all:hover { color: var(--accent); }

/* === Poster row (trilho horizontal de pôsteres) === */
.poster-row,
.scroll-row {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    align-items: flex-start;
    padding-bottom: 4px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
}
.poster-row::-webkit-scrollbar,
.scroll-row::-webkit-scrollbar { display: none; width: 0; height: 0; }

.poster-card-sm {
    flex: 0 0 160px;
    width: 160px;
}
.poster-card-sm .poster-img {
    width: 160px;
    height: 240px; /* 2:3 fixo */
    aspect-ratio: 2/3;
}
.poster-card-sm .poster-name {
    font-size: 12px;
    width: 160px;
}

/* Skeleton pra lazy load */
.skeleton-card {
    height: 240px;
    background: linear-gradient(90deg, var(--bg-card) 0%, var(--bg-hover) 50%, var(--bg-card) 100%);
    background-size: 200% 100%;
    animation: skeleton-shine 1.4s ease-in-out infinite;
    border-radius: var(--radius);
}
.row-skeleton { display: flex; gap: 10px; }
@keyframes skeleton-shine {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Sentinela de paginação na categoria */
.grid-sentinel {
    text-align: center;
    padding: 32px 0;
}

/* === Movies (VOD) === */
.poster-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 16px 12px;
    width: 100%;
    min-width: 0;
}
.poster-grid .poster-card {
    width: 100%;
    min-width: 0;
}
.poster-grid .poster-img {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3;
}
.poster-card {
    display: flex;
    flex-direction: column;
    color: inherit;
    cursor: pointer;
    transition: transform 0.15s;
    min-width: 0;
}
.poster-card:hover { transform: translateY(-3px); }
.poster-card:hover .poster-name { color: var(--text); }

.poster-img {
    position: relative;
    aspect-ratio: 2/3;
    background: var(--bg-input);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: box-shadow 0.15s;
}
.poster-card:hover .poster-img { box-shadow: 0 8px 24px rgba(0,0,0,0.5); }
.poster-img img { width: 100%; height: 100%; object-fit: cover; }
.poster-fallback {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-input), var(--bg-card));
    color: var(--muted);
    font-size: 28px;
    font-weight: 700;
    text-transform: uppercase;
}
.poster-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: #ffc107;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
}
.poster-name {
    margin-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.15s;
}

/* === Movie detail === */
.movie-detail {
    margin: -32px -48px 0;
    position: relative;
    --backdrop: none;
}
.movie-backdrop {
    position: absolute;
    inset: 0;
    height: 480px;
    background-image: linear-gradient(180deg, rgba(10,10,10,0.4) 0%, rgba(10,10,10,1) 100%), var(--backdrop);
    background-size: cover;
    background-position: center top;
    z-index: 0;
}
.movie-detail-body {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    padding: 60px 48px 24px;
    max-width: 1200px;
    align-items: start;
}
.movie-poster {
    width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 12px 40px rgba(0,0,0,0.6);
}
.movie-info-col h1 { font-size: 36px; font-weight: 700; margin-bottom: 12px; }
.movie-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-dim);
}
.movie-meta-line .movie-rating { color: #ffc107; font-weight: 700; }
.movie-meta-line .movie-genre {
    background: var(--bg-input);
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
}
.movie-progress { margin-bottom: 20px; max-width: 480px; }
.movie-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}
.movie-plot { margin-top: 20px; max-width: 720px; }
.movie-plot h3 { font-size: 14px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin-bottom: 8px; }
.movie-plot p { color: var(--text-dim); line-height: 1.6; }
.movie-credits {
    margin-top: 24px;
    display: grid;
    gap: 8px;
    font-size: 14px;
    max-width: 720px;
}
.movie-credits > div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; }
.movie-credits dt { color: var(--muted); font-size: 13px; }
.movie-credits dd { color: var(--text-dim); }

/* === Continue watching tile === */
.continue-tile { flex: 0 0 240px; padding: 0; overflow: hidden; }
.continue-poster {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-input);
    overflow: hidden;
}
.continue-poster img { width: 100%; height: 100%; object-fit: cover; }
.continue-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    transition: background 0.15s;
}
.continue-tile:hover .continue-overlay { background: rgba(0,0,0,0.55); }
.play-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    border: 2px solid white;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    padding-left: 4px;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.15s, transform 0.15s;
}
.continue-tile:hover .play-circle { opacity: 1; transform: scale(1); }

.progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255,255,255,0.15);
}
.progress-bar.large { position: static; height: 6px; border-radius: 3px; margin-bottom: 6px; }
.progress-fill { height: 100%; background: var(--accent); }

.continue-body { padding: 12px 16px 16px; }
.continue-body strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Movie player ocupa tudo */
.movie-player .player-stage { aspect-ratio: 16/9; }
.movie-player .player-sidebar { display: none; }

@media (max-width: 900px) {
    .movie-detail-body { grid-template-columns: 1fr; padding: 32px 16px; }
    .movie-poster-col { max-width: 200px; margin: 0 auto; }
    .movie-detail { margin: -16px -16px 0; }
}

/* === Series episodes === */
.series-episodes {
    max-width: 1200px;
    padding: 32px 48px 48px;
    margin: 0 auto;
}
.episodes-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.episodes-header h2 {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.season-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.season-tab {
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 600;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.season-tab:hover { background: var(--bg-hover); color: var(--text); }
.season-tab.active {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
    font-weight: 700;
}
.season-progress {
    display: inline-block;
    margin-left: 6px;
    font-size: 12px;
    opacity: 0.85;
}

.episode-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.episode-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: inherit;
    transition: border-color 0.15s, background 0.15s;
}
.episode-card.no-thumb {
    grid-template-columns: 1fr;
    padding: 16px 20px;
}
.episode-card:hover { border-color: var(--accent); background: var(--bg-hover); }
.episode-card.watched { opacity: 0.65; }
.episode-card.watched:hover { opacity: 1; }
.episode-meta-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.progress-bar.large { position: relative; margin-top: 10px; max-width: 200px; }

.episode-thumb {
    position: relative;
    aspect-ratio: 16/9;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
}
.episode-thumb img { width: 100%; height: 100%; object-fit: cover; }
.episode-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    transition: background 0.15s;
}
.episode-card:hover .episode-play-overlay { background: rgba(0,0,0,0.55); }
.episode-card:hover .episode-play-overlay .play-circle { opacity: 1; transform: scale(1); }
.episode-thumb .play-circle {
    width: 48px;
    height: 48px;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.15s, transform 0.15s;
}
.watched-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.episode-body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.episode-title-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}
.episode-title-line strong { font-size: 15px; font-weight: 600; }
.episode-plot {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

@media (max-width: 720px) {
    .series-episodes { padding: 0 16px 32px; }
    .episode-card { grid-template-columns: 1fr; }
    .episode-thumb { max-width: 100%; }
}

/* === Next episode button (canto direito durante reprodução) === */
.next-episode-btn {
    position: absolute;
    right: 24px;
    bottom: 80px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: rgba(0,0,0,0.85);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius);
    text-decoration: none;
    backdrop-filter: blur(8px);
    z-index: 6;
    max-width: 360px;
    animation: next-fade-in 0.3s ease-out;
    transition: background 0.15s, border-color 0.15s;
}
.next-episode-btn:hover { background: var(--accent); border-color: var(--accent); }
.next-episode-btn .next-thumb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
    padding-left: 3px;
}
.next-episode-btn .next-info { display: flex; flex-direction: column; min-width: 0; }
.next-episode-btn .next-info small {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.7);
}
.next-episode-btn .next-info strong {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@keyframes next-fade-in {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Countdown overlay (final do episódio) === */
.next-countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.85);
    z-index: 7;
    backdrop-filter: blur(4px);
}
.countdown-info { text-align: center; max-width: 480px; padding: 32px; }
.countdown-info small {
    display: block;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 6px;
}
.countdown-number {
    font-size: 64px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 12px;
    line-height: 1;
}
.countdown-info strong {
    display: block;
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 24px;
}
.countdown-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

@media (max-width: 720px) {
    .next-episode-btn { right: 12px; bottom: 70px; max-width: calc(100% - 24px); }
    .countdown-number { font-size: 48px; }
}

/* === Onboarding === */
.onboard-stage {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    background:
        radial-gradient(ellipse at 30% 0%, rgba(0, 234, 229, 0.18), transparent 60%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 234, 229, 0.08), transparent 60%),
        var(--bg);
}
.onboard-stage-wide .onboard-card { max-width: 880px; }
.onboard-card {
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 48px 40px;
    width: 100%;
    max-width: 560px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}
.onboard-logo {
    height: 70px;
    width: auto;
    margin: 0 auto 20px;
    display: block;
    filter: drop-shadow(0 8px 24px rgba(0, 234, 229, 0.35));
}
.onboard-step {
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 8px;
}
.onboard-card h1 {
    font-size: 30px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}
.onboard-lead {
    color: var(--text-dim);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
}
.onboard-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
    padding: 18px 20px;
    background: rgba(0,0,0,0.3);
    border-radius: 8px;
    border: 1px solid var(--border);
}
.onboard-features > div {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-dim);
}
.onboard-features span:first-child {
    width: 32px; height: 32px;
    display: inline-flex;
    align-items: center; justify-content: center;
    background: rgba(0, 234, 229, 0.12);
    border-radius: 8px;
    flex-shrink: 0;
}
.onboard-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.onboard-actions .btn-primary,
.onboard-actions .btn-secondary {
    display: inline-flex; align-items: center; justify-content: center;
    height: 42px; padding: 0 22px; font-size: 14px;
    border: 1px solid transparent; box-sizing: border-box;
    width: auto; margin-top: 0; line-height: 1;
}
.onboard-actions .btn-primary { border-color: var(--accent); }
.onboard-actions .btn-secondary { border-color: var(--border); }

/* Wizard "Seu gosto" cards */
.taste-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}
.taste-card {
    cursor: pointer;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 18px 12px;
    text-align: center;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.taste-card input { display: none; }
.taste-card:hover { background: var(--bg-hover); border-color: var(--border-strong); transform: translateY(-2px); }
.taste-card:has(input:checked) {
    border-color: var(--accent);
    background: rgba(0, 234, 229, 0.05);
}
.taste-emoji { font-size: 32px; margin-bottom: 4px; }
.taste-card strong { font-size: 14px; }
.taste-card span { font-size: 11px; }

/* Wizard categorias (pílulas) */
.cat-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    max-height: 360px;
    overflow-y: auto;
    padding: 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
}
.cat-pill {
    cursor: pointer;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    transition: background 0.12s, border-color 0.12s;
}
.cat-pill input { display: none; }
.cat-pill:hover { background: var(--bg-hover); }
.cat-pill:has(input:checked) {
    background: var(--accent);
    color: #0a0a0a;
    border-color: var(--accent);
    font-weight: 600;
}

/* Toggle switch */
.switch {
    position: relative;
    display: inline-block;
    width: 46px;
    height: 26px;
    flex-shrink: 0;
}
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; cursor: pointer;
    inset: 0;
    background: var(--bg-input);
    border-radius: 999px;
    transition: background 0.2s;
}
.switch .slider::before {
    content: '';
    position: absolute;
    width: 20px; height: 20px;
    left: 3px; bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}
.switch input:checked + .slider { background: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); }

.pref-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.pref-toggle:last-child { border-bottom: none; }
.pref-toggle > div { flex: 1; min-width: 0; }
.pref-toggle strong { display: block; margin-bottom: 4px; font-size: 14px; }
.pref-toggle select {
    width: auto; min-width: 140px; margin: 0; padding: 8px 12px; font-size: 13px;
}

.onboard-prefs .pref-toggle:first-child { padding-top: 0; }
.onboard-celebrate { font-size: 56px; text-align: center; margin-bottom: 16px; }
.onboard-done { text-align: center; }

/* === Settings page === */
.settings-form { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.settings-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
    padding: 4px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}
.settings-tab {
    background: none;
    border: none;
    color: var(--text-dim);
    padding: 10px 16px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    border-radius: var(--radius);
    transition: background 0.15s, color 0.15s;
}
.settings-tab:hover { background: var(--bg-hover); color: var(--text); }
.settings-tab.active { background: var(--accent); color: #0a0a0a; font-weight: 700; }

.settings-panel { display: none; padding: 24px 28px; }
.settings-panel.active { display: block; }
.settings-panel h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}
.settings-row {
    display: flex; gap: 24px; flex-wrap: wrap;
}
.settings-row label {
    flex: 1; min-width: 200px;
    background: var(--bg-input);
    padding: 14px 16px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}
.settings-row label strong { display: block; margin-bottom: 8px; font-size: 14px; }
.settings-row select { margin: 0; padding: 8px 12px; font-size: 13px; }

.sections-list { display: flex; flex-direction: column; gap: 8px; }
.section-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.section-arrow {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-dim);
    width: 28px; height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    font-family: inherit;
    transition: background 0.15s, color 0.15s;
}
.section-arrow:hover { background: var(--bg-hover); color: var(--text); }
.section-info { flex: 1; min-width: 0; }
.section-info strong { display: block; font-size: 14px; margin-bottom: 2px; }

.settings-bottom {
    display: flex; justify-content: flex-end;
    padding: 20px 28px;
    border-top: 1px solid var(--border);
    background: var(--bg-elevated);
    border-radius: 0 0 var(--radius) var(--radius);
}
.settings-bottom .btn-primary { width: auto; padding: 12px 24px; font-size: 14px; }

/* === Botão de favoritar (♥) === */
.btn-favorite {
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.btn-favorite .fav-icon { font-size: 16px; line-height: 1; }
.btn-favorite.is-favorite {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(0, 234, 229, 0.08);
}
.btn-favorite:hover { color: var(--accent); border-color: var(--accent); }
.btn-favorite:disabled { opacity: 0.6; cursor: wait; }

@media (max-width: 720px) {
    .onboard-card { padding: 32px 20px; }
    .onboard-card h1 { font-size: 22px; }
    .settings-tabs { overflow-x: auto; flex-wrap: nowrap; }
    .settings-tab { white-space: nowrap; }
    .settings-panel { padding: 16px; }
    .settings-row label { min-width: 100%; }
}

/* === Responsive === */
/* === Search no topbar === */
.topbar-search {
    position: relative;
    flex: 0 1 360px;
    min-width: 220px;
}
.topbar-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    display: flex;
    align-items: center;
    transition: color 0.15s;
}
.topbar-search input[type="search"] {
    width: 100%;
    margin: 0;
    padding: 10px 16px 10px 40px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    color: var(--text);
    font-size: 13.5px;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.topbar-search input[type="search"]:focus {
    background: rgba(255,255,255,0.12);
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 4px rgba(0, 234, 229, 0.12);
}
.topbar-search input[type="search"]:focus + .search-dropdown,
.topbar-search:focus-within .search-icon { color: var(--accent); }
.topbar-search input[type="search"]::placeholder { color: var(--muted); }
.topbar-search input[type="search"]::-webkit-search-cancel-button { filter: invert(0.7); cursor: pointer; }

.search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 480px;
    overflow-y: auto;
    background: var(--bg-elevated);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0,0,0,0.6);
    z-index: 100;
}
.search-loading,
.search-empty {
    padding: 20px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}
.search-group { padding: 6px 0; }
.search-group + .search-group { border-top: 1px solid var(--border); }
.search-group-title {
    padding: 8px 14px 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
    font-weight: 700;
}
.search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    color: var(--text);
    font-size: 13px;
    transition: background 0.12s;
}
.search-item:hover { background: var(--bg-hover); }
.search-thumb {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.search-thumb img { width: 100%; height: 100%; object-fit: cover; }
.search-fallback { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.search-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === Pagination === */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    margin: 32px 0 16px;
}
.page-link {
    padding: 8px 12px;
    min-width: 38px;
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.page-link:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-strong); }
.page-link.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}
.page-link.disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.page-ellipsis { padding: 0 6px; color: var(--muted); }

/* === Mobile menu (hambúrguer) === */
.topbar-burger { display: none; }

@media (max-width: 720px) {
    .topbar {
        padding: 12px 16px;
        gap: 12px;
        flex-wrap: wrap;
        position: relative;
    }
    .logo { order: 0; font-size: 18px; flex: 1; }

    .topbar-burger {
        order: 1;
        display: inline-flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 36px;
        padding: 8px;
        background: transparent;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        cursor: pointer;
        font-family: inherit;
    }
    .topbar-burger span {
        display: block;
        width: 20px;
        height: 2px;
        background: var(--text);
        border-radius: 2px;
        transition: transform 0.2s, opacity 0.2s;
    }
    .topbar.menu-open .topbar-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .topbar.menu-open .topbar-burger span:nth-child(2) { opacity: 0; }
    .topbar.menu-open .topbar-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    .user-menu { order: 2; }
    .topbar-search {
        order: 5;
        flex-basis: 100%;
        min-width: 0;
    }
    .topnav {
        order: 4;
        flex-basis: 100%;
        flex-direction: column;
        gap: 4px;
        background: var(--bg-elevated);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 8px;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        visibility: hidden;
        transition: max-height 0.25s ease, opacity 0.2s, padding 0.2s;
        padding-top: 0;
        padding-bottom: 0;
    }
    .topbar.menu-open .topnav {
        max-height: 320px;
        opacity: 1;
        visibility: visible;
        padding: 8px;
    }
    .topnav a {
        padding: 12px 14px;
        font-size: 14px;
        border-radius: var(--radius);
    }

    .app-main { padding: 16px; }
    .hero { margin: -16px -16px 24px; }
    .auth-card { padding: 32px 24px; }
    .user-name { display: none; }

    .poster-card-sm { flex: 0 0 130px; width: 130px; }
    .poster-card-sm .poster-img { width: 130px; height: 195px; }
    .poster-card-sm .poster-name { width: 130px; font-size: 11px; }

    .row-card { flex: 0 0 200px; }
    .continue-tile { flex: 0 0 200px; }
    .recent-channel-tile { flex: 0 0 200px; }

    /* Grade de pôsteres: 3 por linha no mobile */
    .poster-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px 8px;
    }
    .poster-grid .poster-name {
        margin-top: 6px;
        font-size: 12px;
        line-height: 1.25;
    }
    .poster-grid .poster-rating {
        font-size: 10px;
        padding: 2px 6px;
        top: 5px;
        right: 5px;
    }
    .poster-grid .poster-fallback { font-size: 20px; }
}

@media (max-width: 360px) {
    .poster-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px 8px;
    }
}

/* ============================================================
 * TV remote focus styles
 * Visible when navigating with keyboard / TV remote (:focus-visible).
 * Mouse clicks won't trigger these — keeps the desktop look clean.
 * ============================================================ */

/* Generic baseline — anything focusable gets a soft white outline.
 * Use :focus (not :focus-visible) so older smart-TV WebViews show it too. */
a:focus,
button:focus,
summary:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
    border-radius: 6px;
}

/* Profile selection cards — Netflix-style highlight */
.profile-card:focus {
    outline: none;
    color: var(--text);
    transform: translateY(-4px);
}
.profile-card:focus .profile-avatar {
    border-color: #ffffff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 0 4px rgba(255, 255, 255, 0.25);
}

/* Top nav links */
.topnav a:focus {
    outline: none;
    color: var(--text);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 -3px 0 0 #00eae5;
}

/* Poster / row tiles (filmes, séries, ao vivo) — strong border on focus */
.poster-card:focus,
.poster-grid > a:focus,
.poster-grid > button:focus,
.row-poster:focus,
.live-card:focus,
.channel-card:focus,
.movie-card:focus,
.series-card:focus {
    outline: 4px solid #ffffff;
    outline-offset: 0;
    transform: scale(1.04);
    z-index: 5;
    position: relative;
    transition: transform 120ms linear;
}

/* Form inputs — softer focus tint */
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid #00eae5;
    outline-offset: 1px;
}

/* Primary action buttons — accent ring */
.btn:focus,
.btn-primary:focus,
button[type="submit"]:focus {
    outline: 3px solid #00eae5;
    outline-offset: 3px;
}

/* Dropdown items in profile menu */
.dropdown-item:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.12);
}

/* Search input — outline when focused */
#topbar-search-input:focus {
    outline: 2px solid #00eae5;
    outline-offset: 0;
}

/* Section arrows in settings */
.section-arrow:focus {
    outline: 2px solid #00eae5;
    outline-offset: 2px;
}

/* Hide outline on body / non-interactive focus targets */
body:focus,
main:focus,
.app-main:focus {
    outline: none;
}

/* === TV-only overrides ===
 * Aplicado só quando user-agent é de smart TV (classe .is-tv adicionada
 * pelo tv-navigation.js no <html>). Não afeta PC. */
.is-tv .topbar .logo {
    pointer-events: none;
}
.is-tv .topbar .logo:focus,
.is-tv .topbar .logo:hover {
    outline: none !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Search wrapper recebe foco no lugar do input */
.is-tv .topbar-search.tv-search-trigger:focus {
    outline: 3px solid #00eae5;
    outline-offset: 2px;
    border-radius: 6px;
    cursor: pointer;
}
/* Quando o wrapper está focado, o input não mostra outline próprio */
.is-tv .topbar-search.tv-search-trigger:focus #topbar-search-input {
    outline: none;
}

/* === TV player "fullscreen" via CSS ===
 * Padrão usado por players profissionais em smart TV. Em vez de chamar
 * a Fullscreen API (que precisa de user gesture e quebra na navegação),
 * o vídeo é renderizado fixo a 100vw × 100vh com `object-fit: contain`
 * e todo resto da página fica oculto. Resultado visual idêntico, sem
 * depender de gesture nem da implementação de fullscreen da WebView. */
.is-tv body.player-mode {
    overflow: hidden;
}
.is-tv body.player-mode .topbar,
.is-tv body.player-mode .player-page .player-topbar,
.is-tv body.player-mode .player-page .player-sidebar,
.is-tv body.player-mode .player-page .player-tap-to-play,
.is-tv body.player-mode .player-page .player-unmute {
    display: none !important;
}
.is-tv body.player-mode .app-main,
.is-tv body.player-mode main {
    margin: 0 !important;
    padding: 0 !important;
}
.is-tv body.player-mode .player-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    margin: 0;
    padding: 0;
    background: #000;
    z-index: 9999;
    display: block;
}
.is-tv body.player-mode .player-page .player-stage {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: #000;
}
.is-tv body.player-mode .player-page video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
    display: block;
}
/* Mantém o spinner de loading visível, centralizado */
.is-tv body.player-mode .player-page .player-loading,
.is-tv body.player-mode .player-page .player-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

