:root {
  color-scheme: dark;
  --bg: #08090d;
  --panel: #11131a;
  --panel-2: #171a22;
  --panel-3: #1d2029;
  --line: rgba(255,255,255,.09);
  --line-strong: rgba(255,255,255,.16);
  --text: #f7f8fb;
  --muted: #9da3af;
  --accent: #ff3159;
  --accent-2: #ff5f7f;
  --good: #32d583;
  --warn: #f5b942;
  --danger: #ff5b6e;
  --sidebar: 360px;
  --topbar: 72px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

#app { min-height: 100vh; }
.app-shell { min-height: 100vh; background: radial-gradient(circle at 78% 10%, rgba(255,49,89,.08), transparent 30%), var(--bg); }

.topbar {
  height: var(--topbar);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,9,13,.94);
  backdrop-filter: blur(18px);
  position: relative;
  z-index: 40;
}
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand > span, .login-brand > span {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  font-weight: 900; font-size: 20px;
  background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: 0 10px 28px rgba(255,49,89,.25);
}
.brand strong { font-size: 18px; letter-spacing: -.02em; }
.category-bar { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.category-bar::-webkit-scrollbar { display: none; }
.category-pill {
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap;
  cursor: pointer;
  transition: .18s ease;
}
.category-pill:hover { color: var(--text); background: rgba(255,255,255,.05); }
.category-pill.is-active { color: #fff; background: rgba(255,49,89,.14); border-color: rgba(255,49,89,.35); }
.category-pill small { font-size: 10px; opacity: .64; }
.account-area { position: relative; }
.account-button {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong);
  background: var(--panel-2); cursor: pointer; padding: 0;
}
.account-button span { display: grid; place-items: center; width: 100%; height: 100%; font-weight: 800; font-size: 13px; }
.account-menu {
  position: absolute; right: 0; top: calc(100% + 12px); width: 250px;
  background: #171920; border: 1px solid var(--line-strong); border-radius: 16px;
  padding: 8px; box-shadow: 0 22px 60px rgba(0,0,0,.45); z-index: 80;
}
.account-summary { padding: 12px 12px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; display: grid; gap: 3px; }
.account-summary strong { font-size: 14px; }
.account-summary span, .account-summary small { color: var(--muted); font-size: 12px; }
.account-menu button, .account-menu a {
  width: 100%; display: flex; align-items: center; border: 0; background: transparent;
  border-radius: 10px; padding: 11px 12px; cursor: pointer; font-size: 13px;
}
.account-menu button:hover, .account-menu a:hover { background: rgba(255,255,255,.06); }
.mobile-menu { display: none; border: 0; background: transparent; font-size: 22px; }

.tv-layout { height: calc(100vh - var(--topbar)); display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); }
.channel-sidebar { min-width: 0; border-right: 1px solid var(--line); background: rgba(13,15,20,.96); display: flex; flex-direction: column; overflow: hidden; }
.sidebar-head { height: 68px; padding: 14px 18px 8px; display: flex; align-items: center; justify-content: space-between; }
.sidebar-head > div { display: grid; gap: 2px; }
.sidebar-head strong { font-size: 15px; }
.sidebar-head span { color: var(--muted); font-size: 11px; }
.sidebar-head > button { display: none; border: 0; background: transparent; font-size: 28px; }
.search-box { margin: 0 14px 12px; height: 42px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.035); display: flex; align-items: center; gap: 9px; padding: 0 12px; }
.search-box:focus-within { border-color: rgba(255,49,89,.45); box-shadow: 0 0 0 3px rgba(255,49,89,.08); }
.search-box span { color: var(--muted); font-size: 20px; transform: rotate(-18deg); }
.search-box input { width: 100%; min-width: 0; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 13px; }
.search-box input::placeholder { color: #777e8a; }
.channel-list { min-height: 0; overflow-y: auto; padding: 0 8px 18px; scrollbar-width: thin; scrollbar-color: #353944 transparent; }
.channel-row { display: grid; grid-template-columns: minmax(0,1fr) 34px 34px; align-items: center; border-radius: 12px; margin: 2px 0; min-height: 62px; transition: .15s ease; }
.channel-row:hover { background: rgba(255,255,255,.045); }
.channel-row.is-active { background: linear-gradient(90deg, rgba(255,49,89,.18), rgba(255,49,89,.05)); box-shadow: inset 3px 0 0 var(--accent); }
.channel-row.is-hidden { opacity: .55; }
.channel-select { width: 100%; min-width: 0; height: 62px; display: grid; grid-template-columns: 40px 42px minmax(0,1fr) 8px; align-items: center; gap: 9px; border: 0; background: transparent; text-align: left; cursor: pointer; padding: 0 8px; }
.channel-number { color: #7f8692; font-size: 11px; font-variant-numeric: tabular-nums; }
.channel-mark { position: relative; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(145deg, #292d38, #171920); border: 1px solid var(--line); font-size: 10px; font-weight: 900; letter-spacing: -.03em; overflow: hidden; }
.channel-mark b { position: relative; z-index: 1; }
.channel-mark img { position: absolute; inset: 3px; z-index: 2; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.channel-copy { min-width: 0; display: grid; gap: 3px; }
.channel-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.channel-copy small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 10px; }
.channel-select i { width: 6px; height: 6px; border-radius: 50%; background: var(--good); opacity: 0; }
.channel-row.is-active .channel-select i { opacity: 1; box-shadow: 0 0 0 4px rgba(50,213,131,.11); }
.icon-action { width: 31px; height: 31px; padding: 0; border: 0; border-radius: 9px; background: transparent; color: #69707c; cursor: pointer; }
.icon-action:hover { color: #fff; background: rgba(255,255,255,.06); }
.icon-action.is-active { color: #ffd95c; }
.icon-action.visibility { font-size: 16px; }
.icon-action.visibility.is-hidden { color: var(--danger); }
.empty-list, .admin-empty { padding: 42px 22px; text-align: center; color: var(--muted); display: grid; gap: 7px; }
.empty-list strong { color: var(--text); }
.sidebar-backdrop { display: none; }

.player-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 20px 24px 18px; overflow: hidden; }
.player-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.player-heading > div:first-child { min-width: 0; }
.live-label { display: inline-flex; align-items: center; gap: 7px; color: #ff7791; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
.live-label i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(255,49,89,.12); }
.player-heading h1 { font-size: clamp(22px, 2vw, 34px); margin: 6px 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.035em; }
.player-heading-actions { display: flex; align-items: flex-end; gap: 7px; }
.quality-control { min-width: 142px; display: grid; grid-template-columns: auto; gap: 3px; color: var(--muted); font-size: 9px; }
.quality-control > span { text-transform: uppercase; letter-spacing: .08em; font-weight: 800; }
.quality-control select { height: 38px; min-width: 142px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); padding: 0 30px 0 10px; outline: 0; cursor: pointer; }
.quality-control select:focus { border-color: rgba(255,49,89,.55); box-shadow: 0 0 0 3px rgba(255,49,89,.08); }
.quality-control select:disabled { opacity: .55; cursor: not-allowed; }
.quality-control small { max-width: 170px; color: #737b88; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-heading-actions button { width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; font-size: 18px; }
.player-heading-actions button:hover { border-color: var(--line-strong); background: var(--panel-3); }
.player-heading-actions button.is-active { color: #ffd95c; }
.player-stage { flex: 1; min-height: 0; position: relative; border-radius: 18px; overflow: hidden; background: #000; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 26px 90px rgba(0,0,0,.34); }
.player-stage video { width: 100%; height: 100%; display: block; object-fit: contain; background: #000; }
.channel-bug { position: absolute; left: 18px; top: 16px; display: flex; align-items: center; gap: 9px; pointer-events: none; opacity: .9; text-shadow: 0 2px 7px #000; }
.channel-bug span { position: relative; overflow: hidden; width: 36px; height: 36px; border-radius: 9px; background: rgba(10,11,15,.72); border: 1px solid rgba(255,255,255,.16); display: grid; place-items: center; font-size: 9px; font-weight: 900; backdrop-filter: blur(10px); }
.channel-bug span b { position: relative; z-index: 1; }
.channel-bug span img { position: absolute; inset: 3px; z-index: 2; width: calc(100% - 6px); height: calc(100% - 6px); object-fit: contain; }
.channel-bug strong { font-size: 12px; }
.player-status { position: absolute; inset: 0; margin: auto; width: 220px; height: 130px; border: 0; background: rgba(8,9,13,.72); backdrop-filter: blur(10px); border-radius: 16px; display: grid; place-items: center; align-content: center; gap: 8px; cursor: pointer; transition: opacity .18s ease, transform .18s ease; }
.player-status strong { font-size: 13px; }
.player-status small { color: var(--muted); font-size: 10px; text-align: center; padding: 0 12px; }
.player-status.is-playing { display: none; }
.player-status.is-ready .spinner, .player-status.is-error .spinner, .player-status.is-reconnecting .spinner { display: none; }
.player-status.is-reconnecting { inset: auto 16px 16px auto; margin: 0; width: min(310px, calc(100% - 32px)); height: auto; min-height: 58px; padding: 12px 15px; place-items: start; align-content: center; background: rgba(8,9,13,.82); border: 1px solid rgba(255,255,255,.10); border-radius: 12px; pointer-events: none; }
.player-status.is-reconnecting strong { font-size: 12px; }
.player-status.is-reconnecting small { padding: 0; text-align: left; font-size: 9px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.16); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.number-entry { position: absolute; top: 18px; right: 18px; padding: 12px 16px; border-radius: 11px; background: rgba(8,9,13,.82); border: 1px solid rgba(255,255,255,.16); font-size: 24px; font-weight: 800; opacity: 0; transform: translateY(-8px); transition: .18s ease; pointer-events: none; }
.number-entry.is-visible { opacity: 1; transform: translateY(0); }
.player-footer { min-height: 38px; display: flex; align-items: center; gap: 20px; color: #717885; font-size: 10px; padding: 8px 2px 0; }
.no-channel { height: calc(100vh - var(--topbar)); display: grid; place-items: center; }

.login-page, .boot-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 10%, rgba(255,49,89,.13), transparent 36%), #08090d; }
.login-card { width: min(100%, 410px); background: rgba(20,22,29,.92); border: 1px solid var(--line-strong); border-radius: 24px; padding: 34px; box-shadow: 0 35px 100px rgba(0,0,0,.45); }
.login-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 32px; }
.login-brand strong { font-size: 20px; }
.login-card h1 { margin: 0 0 8px; font-size: 29px; letter-spacing: -.04em; }
.login-card > p { color: var(--muted); margin: 0 0 26px; font-size: 13px; }
.login-card form, .account-form, .modal-form { display: grid; gap: 15px; }
.login-card label, .account-form label, .modal-form label { display: grid; gap: 7px; font-size: 11px; color: #c5c9d2; }
.login-card input, .account-form input, .account-form select, .modal-form input {
  width: 100%; height: 45px; border: 1px solid var(--line); border-radius: 11px; background: #0d0f14; color: #fff; padding: 0 13px; outline: 0;
}
.login-card input:focus, .account-form input:focus, .account-form select:focus, .modal-form input:focus { border-color: rgba(255,49,89,.55); box-shadow: 0 0 0 3px rgba(255,49,89,.08); }
.login-card form > button, .account-form > button, .modal-form > button { height: 46px; border: 0; border-radius: 11px; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-weight: 800; cursor: pointer; }
.login-card button:disabled, .account-form button:disabled { opacity: .55; cursor: wait; }
.app-download-card { margin-top: 18px; min-height: 66px; display: flex; align-items: center; gap: 13px; padding: 12px 14px; border: 1px solid rgba(255,49,89,.28); border-radius: 14px; background: linear-gradient(135deg, rgba(255,49,89,.13), rgba(255,255,255,.03)); color: var(--text); text-decoration: none; transition: transform .16s ease, border-color .16s ease, background .16s ease; }
.app-download-card:hover, .app-download-card:focus { transform: translateY(-1px); border-color: rgba(255,49,89,.62); background: linear-gradient(135deg, rgba(255,49,89,.20), rgba(255,255,255,.05)); outline: 0; }
.app-download-card > span:not(.app-download-icon) { display: grid; gap: 4px; }
.app-download-card strong { font-size: 12px; }
.app-download-card small, .app-download-card > span:last-child { color: var(--muted); font-size: 10px; }
.app-download-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-size: 22px; font-weight: 900; }
.app-download-card.is-unavailable { opacity: .62; cursor: default; }
.form-error { min-height: 16px; color: #ff8497; font-size: 11px; }
.boot-page { gap: 22px; align-content: center; }
.boot-page .login-brand { margin: 0; }

.admin-shell { overflow-y: auto; height: 100vh; }
.admin-page { width: min(1480px, calc(100% - 40px)); margin: 0 auto; padding: 34px 0 60px; }
.admin-header a { color: var(--muted); font-size: 12px; }
.admin-header h1 { font-size: 34px; margin: 15px 0 6px; letter-spacing: -.04em; }
.admin-header p { color: var(--muted); margin: 0; font-size: 13px; }
.admin-tabs { display: flex; gap: 8px; margin: 28px 0 18px; border-bottom: 1px solid var(--line); }
.admin-tabs button { border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); padding: 11px 15px; cursor: pointer; }
.admin-tabs button.is-active { color: #fff; border-bottom-color: var(--accent); }
.admin-grid { display: grid; grid-template-columns: minmax(300px, .72fr) minmax(520px, 1.5fr); gap: 18px; align-items: start; }
.admin-card, .accounts-list-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 20px; }
.card-title h2 { margin: 0 0 5px; font-size: 17px; }
.card-title p { color: var(--muted); margin: 0; font-size: 11px; line-height: 1.5; }
.account-form { margin-top: 20px; }
.accounts-list { margin-top: 15px; display: grid; gap: 8px; }
.account-card { display: grid; grid-template-columns: 44px minmax(180px,1fr) auto; gap: 11px 13px; align-items: center; border: 1px solid var(--line); border-radius: 14px; background: #0d0f14; padding: 13px; }
.account-card.is-disabled { opacity: .68; }
.account-avatar { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: #222631; border: 1px solid var(--line); font-weight: 800; font-size: 12px; }
.account-main { display: grid; gap: 2px; min-width: 0; }
.account-main strong { font-size: 13px; }
.account-main span, .account-main small, .account-meta small { color: var(--muted); font-size: 10px; }
.account-meta { display: grid; justify-items: end; gap: 5px; }
.status-badge { border-radius: 999px; padding: 4px 8px; font-size: 9px; font-weight: 800; }
.status-active { background: rgba(50,213,131,.12); color: #6de4a7; }
.status-blocked, .status-expired { background: rgba(255,91,110,.12); color: #ff8797; }
.account-actions { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 7px; }
.account-actions button, .account-actions select { height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #171a22; color: #d8dbe2; padding: 0 10px; font-size: 10px; cursor: pointer; }
.account-actions button:hover { border-color: var(--line-strong); background: #20232c; }
.admin-loading { padding: 50px; display: flex; justify-content: center; gap: 10px; color: var(--muted); font-size: 12px; }
.channel-admin-card { padding: 0; overflow: hidden; }
.channel-admin-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; border-bottom: 1px solid var(--line); }
.admin-search { width: min(360px, 42vw); margin: 0; }
.admin-channel-list { max-height: calc(100vh - 300px); overflow-y: auto; padding: 8px; }
.admin-channel-list article { min-height: 58px; display: grid; grid-template-columns: 44px 42px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 11px; }
.admin-channel-list article:hover { background: rgba(255,255,255,.035); }
.admin-channel-list article > div { display: grid; gap: 3px; min-width: 0; }
.admin-channel-list article strong { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-channel-list article small { color: var(--muted); font-size: 10px; }
.visibility-toggle { min-width: 104px; height: 34px; border-radius: 9px; border: 1px solid var(--line); background: #171a22; color: #dfe2e8; font-size: 10px; cursor: pointer; }
.visibility-toggle.is-hidden { color: #76e3ac; border-color: rgba(50,213,131,.25); }

.modal-backdrop { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.modal { width: min(100%, 430px); position: relative; border-radius: 20px; background: #171920; border: 1px solid var(--line-strong); padding: 25px; box-shadow: 0 30px 90px rgba(0,0,0,.55); }
.modal h2 { margin: 0 0 18px; font-size: 20px; }
.modal-close { position: absolute; top: 12px; right: 13px; width: 32px; height: 32px; border: 0; background: transparent; font-size: 24px; cursor: pointer; color: var(--muted); }
.modal-message, .modal-note { color: var(--muted); font-size: 13px; line-height: 1.6; white-space: pre-wrap; }
.modal-actions { display: flex; justify-content: flex-end; margin-top: 22px; }
.modal-actions button { height: 38px; border: 0; border-radius: 10px; background: var(--panel-3); padding: 0 15px; cursor: pointer; }

#toast-root { position: fixed; z-index: 200; right: 20px; bottom: 20px; display: grid; gap: 9px; }
.toast { width: min(340px, calc(100vw - 40px)); background: #1a1d25; border: 1px solid var(--line-strong); border-radius: 13px; padding: 13px 15px; display: grid; gap: 4px; box-shadow: 0 16px 50px rgba(0,0,0,.38); opacity: 0; transform: translateY(12px); transition: .2s ease; }
.toast.is-visible { opacity: 1; transform: translateY(0); }
.toast strong { font-size: 12px; }
.toast span { color: var(--muted); font-size: 10px; line-height: 1.45; }

@media (max-width: 1050px) {
  :root { --sidebar: 320px; }
  .brand strong { display: none; }
  .topbar { gap: 13px; padding: 0 16px; }
  .player-column { padding: 16px; }
  .admin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  body { overflow: hidden; }
  .mobile-menu { display: block; }
  .brand { display: none; }
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; }
  .tv-layout { grid-template-columns: 1fr; }
  .channel-sidebar { position: fixed; z-index: 70; left: 0; top: 0; bottom: 0; width: min(88vw, 380px); transform: translateX(-105%); transition: transform .22s ease; box-shadow: 20px 0 60px rgba(0,0,0,.4); }
  .channel-sidebar.is-open { transform: translateX(0); }
  .sidebar-head > button { display: block; }
  .sidebar-backdrop { display: block; position: fixed; z-index: 60; inset: 0; border: 0; background: rgba(0,0,0,.62); opacity: 0; pointer-events: none; transition: .2s ease; }
  .sidebar-backdrop.is-visible { opacity: 1; pointer-events: auto; }
  .player-footer { display: none; }
  .player-column { height: calc(100vh - var(--topbar)); }
  .player-heading h1 { font-size: 22px; }
  .quality-control { min-width: 122px; }
  .quality-control select { min-width: 122px; }
  .quality-control > span, .quality-control small { display: none; }
  .admin-page { width: min(100% - 24px, 1480px); padding-top: 24px; }
  .channel-admin-head { align-items: stretch; flex-direction: column; }
  .admin-search { width: 100%; }
  .admin-channel-list { max-height: none; }
}

@media (max-width: 560px) {
  :root { --topbar: 62px; }
  .topbar { padding: 0 10px; gap: 8px; }
  .category-pill { padding: 7px 10px; font-size: 11px; }
  .category-pill small { display: none; }
  .account-button { width: 36px; height: 36px; }
  .player-column { padding: 12px; }
  .player-heading { align-items: center; }
  .player-heading-actions { gap: 5px; }
  .quality-control { min-width: 108px; }
  .quality-control select { min-width: 108px; width: 108px; height: 34px; font-size: 11px; padding-left: 8px; }
  .player-heading-actions button { width: 34px; height: 34px; }
  .player-heading-actions [data-current-favorite], .player-heading-actions [data-current-visibility] { display: none; }
  .player-stage { border-radius: 13px; }
  .channel-bug { left: 11px; top: 10px; }
  .account-card { grid-template-columns: 42px minmax(0,1fr); }
  .account-meta { grid-column: 2; justify-items: start; }
  .account-actions { grid-column: 1 / -1; }
  .admin-channel-list article { grid-template-columns: 36px 38px minmax(0,1fr); }
  .admin-channel-list .visibility-toggle { grid-column: 3; justify-self: start; }
  .login-card { padding: 26px 22px; border-radius: 20px; }
}

/* Valy TV R27 — navegação principal e catálogo VOD */
.topbar { grid-template-columns: auto auto minmax(0,1fr) minmax(0,2.4fr) auto; gap: 16px; }
.main-nav { display: flex; align-items: center; gap: 5px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); white-space: nowrap; }
.main-nav a { padding: 8px 11px; border-radius: 9px; color: var(--muted); font-size: 12px; font-weight: 700; }
.main-nav a:hover, .main-nav a:focus { color: #fff; background: rgba(255,255,255,.055); outline: 0; }
.main-nav a.is-active { color: #fff; background: linear-gradient(135deg, rgba(255,49,89,.26), rgba(255,49,89,.10)); box-shadow: inset 0 0 0 1px rgba(255,49,89,.28); }
.topbar-spacer { min-width: 0; }
.vod-shell { height: 100vh; overflow-y: auto; overflow-x: hidden; }
.vod-shell .topbar { position: sticky; top: 0; }
.vod-page, .vod-detail-page { width: min(1580px, calc(100% - 52px)); margin: 0 auto; padding: 38px 0 64px; }
.vod-header { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.section-kicker { color: #ff7891; text-transform: uppercase; letter-spacing: .12em; font-size: 10px; font-weight: 900; }
.vod-header h1, .vod-detail-copy h1 { margin: 7px 0 5px; font-size: clamp(32px, 4vw, 58px); letter-spacing: -.055em; }
.vod-header p, .vod-detail-copy p { margin: 0; color: var(--muted); font-size: 13px; }
.vod-search { width: min(420px, 38vw); height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255,255,255,.035); }
.vod-search:focus-within { border-color: rgba(255,49,89,.5); box-shadow: 0 0 0 3px rgba(255,49,89,.08); }
.vod-search span { font-size: 20px; color: var(--muted); transform: rotate(-18deg); }
.vod-search input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: #fff; }
.vod-categories, .season-tabs { display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 25px; }
.vod-categories::-webkit-scrollbar, .season-tabs::-webkit-scrollbar { display: none; }
.vod-categories button, .season-tabs button { flex: 0 0 auto; height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--muted); cursor: pointer; font-size: 11px; }
.vod-categories button:hover, .season-tabs button:hover, .vod-categories button:focus, .season-tabs button:focus { color: #fff; border-color: var(--line-strong); outline: 0; }
.vod-categories button.is-active, .season-tabs button.is-active { color: #fff; border-color: rgba(255,49,89,.40); background: rgba(255,49,89,.14); }
.vod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 24px 16px; }
.vod-card { min-width: 0; display: grid; gap: 8px; border-radius: 14px; padding: 7px; transition: transform .17s ease, background .17s ease, box-shadow .17s ease; }
.vod-card:hover, .vod-card:focus { transform: translateY(-4px); background: rgba(255,255,255,.045); box-shadow: 0 18px 45px rgba(0,0,0,.25); outline: 1px solid rgba(255,49,89,.35); }
.vod-poster, .vod-detail-poster { position: relative; overflow: hidden; background: linear-gradient(145deg, #272b36, #11131a); border: 1px solid var(--line); }
.vod-poster { aspect-ratio: 2 / 3; border-radius: 11px; }
.vod-poster img, .vod-detail-poster img { width: 100%; height: 100%; display: block; object-fit: cover; }
.poster-fallback { position: absolute; inset: 0; display: grid; place-items: center; font-size: 34px; font-weight: 900; color: rgba(255,255,255,.38); background: radial-gradient(circle at 50% 30%, rgba(255,49,89,.22), transparent 60%); }
.vod-card strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.vod-card > span { color: var(--muted); font-size: 10px; }
.vod-loading, .vod-empty { min-height: 300px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); }
.vod-empty strong { color: #fff; }
.vod-empty.full { min-height: calc(100vh - var(--topbar)); }
.vod-back { display: inline-flex; margin-bottom: 22px; color: var(--muted); font-size: 12px; }
.vod-back:hover { color: #fff; }
.vod-detail-hero { min-height: 270px; display: grid; grid-template-columns: 180px minmax(0,1fr); gap: 28px; align-items: end; margin-bottom: 25px; padding: 25px; border: 1px solid var(--line); border-radius: 24px; background: radial-gradient(circle at 20% 10%, rgba(255,49,89,.19), transparent 44%), linear-gradient(135deg, rgba(255,255,255,.04), rgba(255,255,255,.01)); }
.vod-detail-hero.compact { min-height: 230px; }
.vod-detail-poster { width: 180px; aspect-ratio: 2/3; border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.42); }
.vod-player-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; background: #000; box-shadow: 0 25px 80px rgba(0,0,0,.35); }
.vod-player-card video { width: 100%; max-height: min(72vh, 860px); min-height: 380px; display: block; background: #000; }
.series-watch-layout { display: grid; grid-template-columns: minmax(0,1.7fr) minmax(300px,.63fr); gap: 18px; align-items: start; }
.episode-now { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: #11131a; }
.episode-now span { padding: 5px 8px; border-radius: 7px; background: rgba(255,49,89,.14); color: #ff8ca1; font-size: 10px; font-weight: 900; }
.episode-now strong { font-size: 12px; }
.episode-list { max-height: min(72vh, 860px); overflow-y: auto; display: grid; gap: 4px; padding: 7px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.episode-row { min-height: 58px; display: grid; grid-template-columns: 34px minmax(0,1fr); gap: 10px; align-items: center; border: 0; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; padding: 7px 10px; }
.episode-row:hover, .episode-row:focus { background: rgba(255,255,255,.05); outline: 0; }
.episode-row.is-active { background: rgba(255,49,89,.13); box-shadow: inset 3px 0 0 var(--accent); }
.episode-row > span { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: #222631; color: var(--muted); font-size: 10px; }
.episode-row div { min-width: 0; display: grid; gap: 3px; }
.episode-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.episode-row small { color: var(--muted); font-size: 9px; }

@media (max-width: 1250px) {
  .topbar { grid-template-columns: auto auto minmax(0,1fr) auto; }
  .topbar .category-bar { display: none; }
  .main-nav a { padding-inline: 9px; }
  .vod-grid { grid-template-columns: repeat(auto-fill, minmax(145px,1fr)); }
}
@media (max-width: 860px) {
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; gap: 8px; padding-inline: 12px; }
  .topbar .brand { display: none; }
  .main-nav { justify-self: center; }
  .main-nav a { font-size: 11px; padding: 7px 8px; }
  .topbar-spacer { display: none; }
  .vod-page, .vod-detail-page { width: min(100% - 24px, 1580px); padding-top: 24px; }
  .vod-header { align-items: stretch; flex-direction: column; gap: 17px; }
  .vod-search { width: 100%; }
  .vod-detail-hero { grid-template-columns: 120px minmax(0,1fr); min-height: 190px; padding: 18px; gap: 18px; }
  .vod-detail-poster { width: 120px; }
  .series-watch-layout { grid-template-columns: 1fr; }
  .episode-list { max-height: 380px; }
  .vod-player-card video { min-height: 240px; }
}
@media (max-width: 560px) {
  .vod-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 17px 8px; }
  .vod-card { padding: 4px; }
  .vod-detail-hero { grid-template-columns: 88px minmax(0,1fr); border-radius: 17px; }
  .vod-detail-poster { width: 88px; }
  .vod-detail-copy h1 { font-size: 27px; }
  .main-nav a { padding-inline: 7px; }
}

/* Valy TV R27.1 — hotfix da topbar, gêneros e visibilidade VOD */
.topbar {
  grid-template-columns: auto auto minmax(0, 1fr) auto;
}
.topbar .category-bar { min-width: 0; width: 100%; }
.account-area { justify-self: end; }

.vod-card-wrap { min-width: 0; position: relative; border-radius: 14px; }
.vod-card-wrap.is-hidden { opacity: .52; }
.vod-card-wrap.is-hidden .vod-poster::after {
  content: 'OCULTO'; position: absolute; inset: auto 8px 8px; z-index: 4;
  padding: 5px 7px; border-radius: 7px; background: rgba(8,9,13,.88);
  color: #ff8aa0; font-size: 9px; font-weight: 900; letter-spacing: .08em;
  text-align: center; border: 1px solid rgba(255,49,89,.28);
}
.vod-visibility {
  width: calc(100% - 14px); min-height: 30px; margin: -2px 7px 5px;
  border: 1px solid var(--line); border-radius: 9px; background: #151820;
  color: var(--muted); cursor: pointer; font-size: 10px; font-weight: 700;
}
.vod-visibility:hover, .vod-visibility:focus { color: #fff; border-color: var(--line-strong); outline: 0; }
.vod-visibility.is-hidden { color: #71dfa9; border-color: rgba(50,213,131,.25); }
.vod-visibility:disabled { opacity: .5; cursor: wait; }
.vod-description { display: block; max-width: 860px; margin-top: 14px; color: #c7cbd3; font-size: 12px; line-height: 1.65; }
.vod-detail-visibility {
  min-height: 36px; margin-top: 16px; padding: 0 13px; border: 1px solid var(--line);
  border-radius: 10px; background: #151820; color: var(--muted); cursor: pointer;
  font-size: 11px; font-weight: 800;
}
.vod-detail-visibility:hover, .vod-detail-visibility:focus { color: #fff; border-color: var(--line-strong); outline: 0; }
.vod-detail-visibility.is-hidden { color: #71dfa9; border-color: rgba(50,213,131,.25); }

@media (max-width: 1250px) {
  .topbar { grid-template-columns: auto auto minmax(0,1fr) auto; }
  .topbar .category-bar { display: flex; }
}
@media (max-width: 860px) {
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; }
  .topbar .category-bar { display: none; }
}
.mobile-menu-placeholder { display: none; }
@media (max-width: 860px) {
  .mobile-menu-placeholder { display: block; width: 40px; height: 40px; }
}
