:root {
  color-scheme: dark;
  --bg: #0a0a0f;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.095);
  --line: rgba(255, 255, 255, 0.12);
  --text: #ffffff;
  --muted: #8b8b9e;
  --accent: #00f0ff;
  --accent-strong: #53f7ff;
  --accent-soft: rgba(0, 240, 255, 0.12);
  --magenta: #ff0055;
  --danger: #ff3b6b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --glow: 0 0 22px rgba(0, 240, 255, 0.42);
  --glow-strong: 0 0 44px rgba(0, 240, 255, 0.62);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0, rgba(0, 240, 255, 0.16), transparent 34rem),
    radial-gradient(circle at 85% 12%, rgba(255, 0, 85, 0.16), transparent 30rem),
    linear-gradient(#0a0a0f, #08080d);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body::before,
body::after {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  z-index: -2;
  background-image:
    linear-gradient(rgba(0, 240, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 240, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(#000, transparent 78%);
}

body::after {
  z-index: -1;
  background: linear-gradient(115deg, transparent, rgba(0, 240, 255, 0.03) 45%, rgba(255, 0, 85, 0.035) 58%, transparent);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.terms-modal,
.resume-modal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: none;
  place-items: center;
  background: rgba(5, 5, 10, 0.82);
  padding: 20px;
  backdrop-filter: blur(18px);
}

.terms-modal.is-visible,
.resume-modal.is-visible {
  display: grid;
}

.terms-modal.is-hidden,
.resume-modal.is-hidden {
  display: none;
}

.user-info-modal {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: none;
  padding: 18px;
}

.user-info-modal.is-visible {
  display: grid;
  place-items: center;
}

.user-info-modal.is-hidden {
  display: none;
}

.user-info-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 229, 255, 0.18), transparent 32%),
    radial-gradient(circle at 80% 90%, rgba(255, 47, 92, 0.14), transparent 34%),
    rgba(3, 6, 11, 0.78);
  backdrop-filter: blur(18px);
}

.user-info-panel {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(88vh, 780px);
  overflow: auto;
  border: 1px solid rgba(0, 229, 255, 0.28);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(13, 32, 39, 0.96), rgba(15, 17, 25, 0.98)),
    rgba(12, 18, 26, 0.98);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.58), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.user-info-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 26px;
  line-height: 1;
}

.user-info-content {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.user-info-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding-right: 50px;
}

.user-info-avatar {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border: 1px solid rgba(0, 229, 255, 0.42);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(0, 229, 255, 0.24), rgba(255, 47, 92, 0.14));
  box-shadow: 0 0 42px rgba(0, 229, 255, 0.16);
  color: #9ff8ff;
  font-size: 24px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.user-info-hero h2 {
  margin: 3px 0 10px;
  color: #fff;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.user-info-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  border: 1px solid rgba(0, 229, 255, 0.26);
  border-radius: 999px;
  background: rgba(0, 229, 255, 0.08);
  color: #bcfbff;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.user-info-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 0 0 14px currentColor;
}

.user-info-status.active {
  border-color: rgba(84, 255, 144, 0.34);
  background: rgba(84, 255, 144, 0.1);
  color: #b9ffd1;
}

.user-info-status.warning {
  border-color: rgba(255, 209, 102, 0.42);
  background: rgba(255, 209, 102, 0.12);
  color: #ffe2a0;
}

.user-info-status.danger {
  border-color: rgba(255, 75, 105, 0.44);
  background: rgba(255, 75, 105, 0.12);
  color: #ffd1d9;
}

.user-info-hint {
  margin: -4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.user-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.user-info-tile,
.user-info-note,
.user-info-loading,
.user-info-error {
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.user-info-tile span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.user-info-tile strong {
  display: block;
  margin-top: 7px;
  color: #fff;
  font-size: 17px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.user-info-tile small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.user-info-note strong,
.user-info-error strong,
.user-info-loading strong {
  display: block;
  color: #fff;
  font-size: 16px;
}

.user-info-note p,
.user-info-error p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.user-info-loading {
  display: grid;
  place-items: center;
  min-height: 260px;
  text-align: center;
}

.user-info-loading span {
  width: 42px;
  height: 42px;
  margin-bottom: 14px;
  border: 3px solid rgba(0, 229, 255, 0.18);
  border-top-color: #00e5ff;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.user-info-error {
  display: grid;
  gap: 12px;
}

.terms-card,
.resume-card {
  display: grid;
  gap: 16px;
  width: min(100%, 560px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.075);
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(24px);
}

.terms-card h2,
.resume-card h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

.terms-card p,
.resume-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.6;
}

.resume-card {
  width: min(100%, 440px);
}

.resume-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.resume-actions .primary-button,
.resume-actions .secondary-button {
  min-width: 130px;
}

.terms-check {
  grid-template-columns: 18px 1fr;
  align-items: start;
  gap: 10px;
  color: #ffffff;
  font-weight: 700;
}

.terms-check input {
  min-height: 18px;
  accent-color: var(--accent);
}

.terms-card .primary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.45;
  transform: none;
}

.login-view {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 28px;
  min-height: 100vh;
  padding: clamp(24px, 5vw, 72px);
  overflow: hidden;
}

.login-view::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 10, 15, 0.92), rgba(10, 10, 15, 0.62), rgba(10, 10, 15, 0.92)),
    radial-gradient(circle at 28% 18%, rgba(0, 240, 255, 0.22), transparent 24rem),
    radial-gradient(circle at 72% 60%, rgba(255, 0, 85, 0.22), transparent 28rem),
    url("https://www.dtnx.com.br/_next/image?url=%2Fassets%2Fdtnx-hero-bg.jpg&w=1920&q=75") center / cover;
  content: "";
}

.eyebrow {
  display: inline-flex;
  margin: 0 0 14px;
  border: 1px solid rgba(103, 232, 249, 0.35);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.12);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.18);
  color: var(--accent);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.login-card,
.sidebar,
.content-area {
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(24px);
}

.login-card {
  display: grid;
  gap: 18px;
  width: min(100%, 420px);
  padding: 32px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-heading {
  display: grid;
  justify-items: center;
  gap: 6px;
  margin-bottom: 8px;
  text-align: center;
}

.login-heading strong {
  color: #ffffff;
  font-size: 48px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  text-shadow: 0 0 24px rgba(0, 240, 255, 0.36);
}

.login-heading span {
  display: inline-grid;
  place-items: center;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--magenta);
  color: #ffffff;
  padding: 3px 5px;
  font-size: 13px;
  vertical-align: top;
}

.login-heading p {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  padding: 0 14px;
  outline: none;
  transition: all 0.3s ease-out;
}

input:focus {
  border-color: rgba(0, 240, 255, 0.72);
  box-shadow: 0 0 0 1px rgba(0, 240, 255, 0.25), 0 0 24px rgba(0, 240, 255, 0.18);
}

.remember-row {
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 10px;
  font-weight: 600;
}

.remember-row input {
  min-height: 18px;
  accent-color: var(--accent);
}

.primary-button,
.secondary-button,
.icon-button,
.tab {
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 8px;
  min-height: 42px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: all 0.3s ease-out;
}

.primary-button {
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  box-shadow: var(--glow);
  color: #061015;
  justify-self: center;
  min-width: 200px;
}

.primary-button:hover {
  box-shadow: var(--glow-strong);
  transform: translateY(-2px);
}

.secondary-button,
.icon-button,
.tab {
  background: rgba(255, 255, 255, 0.035);
  color: #67e8f9;
}

.secondary-button:hover,
.icon-button:hover,
.tab:hover {
  background: rgba(0, 240, 255, 0.10);
  box-shadow: 0 0 26px rgba(0, 240, 255, 0.22);
  color: #cffafe;
  transform: translateY(-1px);
}

.form-message {
  min-height: 20px;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
}

.player-view {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  height: 100vh;
  min-height: 0;
  overflow: hidden;
}

.is-hidden {
  display: none;
}

.empty-player.is-hidden {
  display: none;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-width: 0 1px 0 0;
  padding: 20px;
  min-height: 0;
  overflow: hidden;
}

.sidebar-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 10px;
  row-gap: 7px;
  min-height: 88px;
  flex-shrink: 0;
}

.sidebar-top > div {
  display: contents;
}

.sidebar-top .eyebrow {
  grid-column: 1;
  grid-row: 1;
}

.sidebar-top h2 {
  grid-column: 1 / -1;
  grid-row: 2;
}

.account-name-link {
  width: fit-content;
  border-radius: 10px;
  cursor: pointer;
  transition: color 0.18s ease, text-shadow 0.18s ease, transform 0.18s ease;
}

.account-name-link:hover,
.account-name-link:focus-visible {
  color: #9ff8ff;
  text-shadow: 0 0 18px rgba(0, 229, 255, 0.34);
  outline: none;
}

.account-name-link:active {
  transform: translateY(1px);
}

.sidebar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  grid-column: 2;
  grid-row: 1;
  justify-content: flex-end;
}

.refresh-icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 0;
  border-radius: 999px;
}

.refresh-icon-button svg {
  display: none;
}

.refresh-icon-button::before {
  content: "⟳";
  display: grid;
  place-items: center;
  width: 1em;
  height: 1em;
  color: currentColor;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
  transform: translateY(-1px);
}

.sidebar-top h2 {
  max-width: 100%;
  color: #ffffff;
  font-size: clamp(18px, 1.55vw, 22px);
  line-height: 1.12;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  word-break: break-word;
}

.content-header {
  min-height: 56px;
}

.content-header .eyebrow {
  margin-bottom: 6px;
}

.content-header h2 {
  line-height: 1.1;
}

.content-header .secondary-button {
  min-width: 116px;
}

#refreshButton {
  display: none;
}

.content-header {
  flex-shrink: 0;
}

.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sidebar h2,
.content-header h2 {
  margin: 0;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  flex-shrink: 0;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.mobile-menu-toggle {
  display: none;
}

.mobile-brand,
.mobile-search-toggle,
.mobile-sort-toggle,
.mobile-sort-menu {
  display: none;
}

.hamburger-lines {
  display: inline-grid;
  gap: 4px;
  width: 18px;
}

.hamburger-lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.icon-button {
  min-width: 62px;
  padding: 0 12px;
}

.tab.is-active {
  background: rgba(0, 240, 255, 0.08);
  box-shadow: none;
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.34);
}

.tab {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 14px;
  text-align: left;
}

.tab::after {
  color: var(--muted);
  font-size: 19px;
  font-weight: 900;
  line-height: 1;
  content: "+";
}

.tab[data-section="trends"]::after,
.tab[data-section="history"]::after,
.tab[data-section="favorites"]::after {
  content: "";
}

.tab.is-expanded::after {
  content: "-";
}

.search-box {
  order: 1;
  gap: 8px;
}

.tabs {
  order: 2;
}

.sidebar .content-header {
  display: none;
}

.category-list {
  display: none;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.category-button {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 0 12px;
  transition: all 0.3s ease-out;
}

.category-button:hover,
.category-button.is-active {
  background: var(--panel-strong);
  color: var(--text);
  border-color: rgba(0, 240, 255, 0.28);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.12);
}

.mobile-category-panel {
  display: grid;
  align-content: start;
  gap: 2px;
  max-height: min(42vh, 360px);
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  margin: -2px 0 10px 16px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 4px 0 8px 10px;
}

.mobile-category-panel > span {
  color: rgba(255, 255, 255, 0.52);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 0 10px 6px;
}

.mobile-category-panel .category-button {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: none;
  color: rgba(255, 255, 255, 0.68);
}

.mobile-category-panel .category-button:hover,
.mobile-category-panel .category-button.is-active {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.10);
  box-shadow: none;
  color: #ffffff;
}

.content-area {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  min-width: 0;
  min-height: 0;
  border-width: 0;
  padding: 20px;
  overflow: hidden;
}

.watch-layout {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  overflow: hidden;
}

.watch-layout:not(.has-playback) {
  grid-template-columns: minmax(0, 1fr);
}

.watch-layout:not(.has-playback) .player-panel {
  display: none;
}

.playlist-panel,
.player-panel {
  min-width: 0;
  min-height: 0;
}

.playlist-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  overflow: hidden;
}

.player-panel {
  display: grid;
  grid-template-rows: auto auto minmax(170px, 1fr);
  align-content: start;
  gap: 12px;
  overflow: hidden;
}

.mobile-close-player {
  display: none;
  align-items: center;
  justify-self: end;
  gap: 7px;
  min-height: 34px;
  border: 1px solid rgba(0, 240, 255, 0.26);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.10);
  color: #ffffff;
  padding: 0 10px 0 12px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

.watch-layout.has-playback .mobile-close-player {
  display: inline-flex;
}

.mobile-close-player:hover {
  border-color: rgba(0, 240, 255, 0.55);
  background: rgba(0, 240, 255, 0.18);
  color: #cffafe;
  transform: translateY(-1px);
}

.mobile-close-player svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.player-panel.hide-epg {
  grid-template-rows: auto minmax(180px, 1fr);
}

.player-panel.hide-epg .epg-panel {
  display: none;
}

.player-panel.hide-epg .video-stage {
  max-height: min(72vh, calc(100vh - 190px));
}

.video-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: min(56vh, calc(100vh - 320px));
  min-height: 260px;
  background: #05050a;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-stage:fullscreen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #000000;
}

.video-stage:fullscreen video {
  height: 100vh;
  object-fit: contain;
}

.video-stage:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  max-height: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #000000;
}

.video-stage:-webkit-full-screen video {
  height: 100vh;
  object-fit: contain;
}


.player-title-overlay {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 4;
  min-height: 54px;
  padding: 14px 16px 36px;
  background: linear-gradient(rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.36), transparent);
  color: #ffffff;
  font-size: clamp(14px, 2vw, 18px);
  font-weight: 900;
  line-height: 1.25;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  text-overflow: ellipsis;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.85);
  transform: translateY(-8px);
  transition: opacity 0.24s ease, transform 0.24s ease;
  white-space: nowrap;
}

.video-stage.is-active .player-title-overlay:not(.is-empty) {
  opacity: 1;
  transform: translateY(0);
}

.video-stage.is-active .yt-controls {
  opacity: 1;
  transform: translateY(0);
}

.video-stage.is-playing:not(.is-active) {
  cursor: none;
}

.video-stage.is-live .progress-track,
.video-stage.is-live .time-label {
  display: none;
}

.video-stage.is-live .yt-controls {
  padding-top: 44px;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: #05050a;
}

.empty-player {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

.empty-player strong {
  background: linear-gradient(90deg, #ffffff, #a2f4fd);
  background-clip: text;
  color: var(--text);
  font-size: 22px;
  -webkit-text-fill-color: transparent;
}

.playback-stats[hidden] {
  display: none;
}

.playback-stats {
  position: absolute;
  top: 12px;
  right: 12px;
  bottom: 68px;
  z-index: 7;
  width: min(510px, calc(100% - 24px));
  max-height: calc(100% - 80px);
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 10px;
  background: rgba(3, 8, 15, 0.94);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.58), 0 0 28px rgba(0, 240, 255, 0.12);
  color: #f8fafc;
  overflow: auto;
  padding: 12px;
  user-select: text;
  -webkit-user-select: text;
  backdrop-filter: blur(18px);
}

.playback-stats-header {
  position: sticky;
  top: -12px;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: -12px -12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(3, 8, 15, 0.98);
  padding: 12px;
}

.playback-stats-header > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.playback-stats-header strong {
  font-size: 13px;
}

.playback-stats-header span,
.playback-stats-note {
  color: #94a3b8;
  font-size: 10px;
  line-height: 1.4;
}

.playback-stats-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

.playback-stats-actions button {
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  padding: 4px 9px;
  font-size: 11px;
}

.playback-stats-actions button:hover,
.playback-stats-actions button:focus-visible {
  border-color: rgba(0, 240, 255, 0.52);
  background: rgba(0, 240, 255, 0.12);
  outline: none;
}

.playback-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 10px;
}

.playback-stat-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
  min-width: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  padding: 6px 7px;
}

.playback-stat-row span {
  color: #94a3b8;
}

.playback-stat-row strong {
  min-width: 0;
  color: #f8fafc;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.playback-stats-note {
  margin: 9px 1px 0;
}

.status-line {
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
}

.item-grid {
  display: grid;
  align-content: start;
  grid-template-columns: 1fr;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.item-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  min-height: 64px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  overflow: hidden;
  text-align: left;
  backdrop-filter: blur(18px);
  box-shadow: 0 0 24px rgba(0, 240, 255, 0.08);
  transition: all 0.3s ease-out;
}

.item-card:hover,
.item-card.is-playing {
  border-color: var(--accent);
  box-shadow: 0 0 34px rgba(0, 240, 255, 0.24);
  transform: translateY(-2px);
}

.poster {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(0, 240, 255, 0.18), transparent 55%),
    rgba(255, 255, 255, 0.055);
  color: var(--muted);
  overflow: hidden;
  width: 58px;
  height: 64px;
}

.rating-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.56);
  color: #ffffff;
  padding: 3px 6px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.favorite-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 5;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 214, 90, 0.42);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  color: rgba(255, 255, 255, 0.72);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  transition: transform 0.16s ease, background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.favorite-toggle:hover,
.favorite-toggle:focus-visible {
  background: rgba(255, 214, 90, 0.16);
  color: #ffffff;
  transform: scale(1.06);
  outline: none;
}

.favorite-toggle.is-favorite {
  background: rgba(255, 214, 90, 0.20);
  box-shadow: 0 0 18px rgba(255, 214, 90, 0.34);
  color: #ffd65a;
}

.item-kind {
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rating-badge b {
  color: #ffd65a;
  font-size: 10px;
}

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

.item-name {
  display: -webkit-box;
  padding: 12px;
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.item-card.is-playing .item-name::before {
  color: var(--accent);
  content: "▶ ";
}

.item-details {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.item-details .item-name {
  padding-bottom: 0;
}

.item-progress {
  display: block;
  height: 4px;
  margin: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.item-progress span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: #ff003d;
  box-shadow: 0 0 12px rgba(255, 0, 61, 0.35);
}

.item-progress-label {
  margin: 0 12px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.item-grid.poster-grid {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  grid-auto-rows: max-content;
  gap: 14px;
}

.item-grid.poster-grid .item-card {
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  align-items: start;
  min-height: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  padding: 0;
}

.item-grid.poster-grid .item-card:hover,
.item-grid.poster-grid .item-card.is-playing {
  border-color: transparent;
  box-shadow: none;
  transform: none;
}

.item-grid.poster-grid .poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
}

.item-grid.poster-grid .poster img {
  border-radius: inherit;
}

.item-grid.poster-grid .item-details {
  align-self: start;
  min-width: 0;
}

.item-grid.poster-grid .item-name {
  padding: 7px 2px 0;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.16;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
  -webkit-line-clamp: 2;
}

.item-grid.poster-grid .item-progress,
.item-grid.poster-grid .item-progress-label {
  margin-right: 2px;
  margin-left: 2px;
}

.history-section {
  display: grid;
  gap: 10px;
}

.history-heading {
  margin: 12px 0 2px;
  color: #67e8f9;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.history-card {
  grid-template-columns: 58px minmax(0, 1fr) auto;
}

.item-grid.trends-grid {
  display: block;
  overflow-y: auto;
  padding: 0 2px 18px 0;
}

.trends-hero {
  position: relative;
  min-height: clamp(280px, 42vh, 520px);
  display: grid;
  align-content: end;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 14px;
  background:
    linear-gradient(90deg, rgba(5, 5, 10, 0.96), rgba(5, 5, 10, 0.58), rgba(5, 5, 10, 0.24)),
    radial-gradient(circle at 80% 20%, rgba(255, 0, 85, 0.20), transparent 36rem),
    radial-gradient(circle at 10% 10%, rgba(0, 240, 255, 0.18), transparent 30rem);
  background-position: center;
  background-size: cover;
  box-shadow: var(--shadow);
  margin: 0 0 22px;
  overflow: hidden;
  padding: clamp(22px, 4vw, 46px);
}

.trends-carousel {
  height: clamp(400px, 50vh, 580px);
  min-height: 0;
  animation: trend-carousel-in 620ms ease both;
  padding: clamp(20px, 3vw, 42px);
}

@keyframes trend-carousel-in {
  from {
    opacity: 0.18;
    filter: blur(6px) saturate(0.94) brightness(0.86);
  }

  to {
    opacity: 1;
    filter: blur(0) saturate(1) brightness(1);
  }
}

.trends-carousel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.50), transparent 26%, transparent 74%, rgba(0, 0, 0, 0.42)),
    radial-gradient(circle at 22% 80%, rgba(0, 240, 255, 0.12), transparent 34rem);
  pointer-events: none;
}

.trends-carousel::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(110deg, transparent 0 36%, rgba(255, 255, 255, 0.10) 46%, transparent 58%),
    linear-gradient(180deg, transparent 58%, rgba(0, 0, 0, 0.34));
  mix-blend-mode: screen;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-22%);
  animation: trend-light-sweep 900ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes trend-light-sweep {
  0% {
    opacity: 0;
    transform: translateX(-22%);
  }

  34% {
    opacity: 0.32;
  }

  100% {
    opacity: 0;
    transform: translateX(28%);
  }
}

.trends-carousel-top {
  position: absolute;
  z-index: 2;
  top: clamp(16px, 2vw, 28px);
  left: clamp(18px, 3vw, 34px);
  right: clamp(18px, 3vw, 34px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.trends-window-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.42);
  padding: 3px;
  backdrop-filter: blur(10px);
}

.trends-window-toggle button {
  min-height: 30px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  padding: 0 13px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.trends-window-toggle button.is-active {
  background: #ffffff;
  color: #05070a;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.30);
}

.trends-hero-content {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(78px, 116px) minmax(0, 760px);
  align-items: end;
  gap: clamp(16px, 2vw, 26px);
  max-width: min(900px, 78vw);
  min-height: 0;
  margin-top: 76px;
  animation: trend-content-in 760ms cubic-bezier(0.16, 1, 0.3, 1) 80ms both;
}

@keyframes trend-content-in {
  from {
    opacity: 0;
    transform: translate3d(0, 8px, 0);
  }

  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.trends-hero-poster {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.55);
  animation: trend-poster-in 620ms ease 80ms both;
}

@keyframes trend-poster-in {
  from {
    opacity: 0;
    transform: scale(0.985);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.trends-hero-copy {
  display: grid;
  align-content: end;
  gap: 12px;
  min-width: 0;
  min-height: 0;
}

.trends-meta {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 8px 26px rgba(0, 0, 0, 0.88);
}

.trends-nav {
  position: absolute;
  z-index: 3;
  top: 50%;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.36);
  color: #ffffff;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.trends-nav:hover,
.trends-nav:focus-visible {
  border-color: rgba(0, 240, 255, 0.56);
  background: rgba(0, 240, 255, 0.16);
}

.trends-nav.prev {
  left: clamp(10px, 1.5vw, 22px);
}

.trends-nav.next {
  right: clamp(10px, 1.5vw, 22px);
}

.trends-dots {
  position: absolute;
  z-index: 2;
  right: clamp(18px, 3vw, 34px);
  bottom: clamp(14px, 2vw, 26px);
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.26);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  padding: 7px 9px;
  backdrop-filter: blur(10px);
}

.trends-dots button {
  position: relative;
  width: 8px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  overflow: hidden;
  padding: 0;
  transition: width 260ms ease, background 260ms ease, opacity 260ms ease;
}

.trends-dots button.is-active {
  width: 42px;
  background: rgba(255, 255, 255, 0.18);
}

.trends-dots button.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffffff, #67e8f9);
  box-shadow: 0 0 18px rgba(0, 240, 255, 0.38);
  transform-origin: left center;
  animation: trend-dot-progress 10s linear both;
}

@keyframes trend-dot-progress {
  from {
    transform: scaleX(0);
  }

  to {
    transform: scaleX(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .trends-carousel,
  .trends-hero-content,
  .trends-hero-poster {
    animation: none;
  }
}

.trends-kicker {
  width: fit-content;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  color: #ffffff;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.trends-hero h2 {
  display: -webkit-box;
  max-width: 780px;
  max-height: 2.05em;
  overflow: hidden;
  margin: 0;
  color: #ffffff;
  font-size: clamp(30px, 4.3vw, 58px);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.02;
  text-shadow: 0 12px 38px rgba(0, 0, 0, 0.74);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trends-hero p {
  display: -webkit-box;
  max-width: 620px;
  overflow: hidden;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: clamp(14px, 1.5vw, 17px);
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.trends-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.trends-play,
.trends-detail {
  width: fit-content;
  min-height: 42px;
  border: 1px solid rgba(0, 240, 255, 0.42);
  border-radius: 999px;
  background: linear-gradient(135deg, #00e5ff, #00a6b8);
  box-shadow: 0 0 30px rgba(0, 240, 255, 0.22);
  color: #031016;
  padding: 0 18px;
  font-weight: 950;
}

.trends-detail {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.10);
  box-shadow: none;
  color: #ffffff;
}

.trend-favorite {
  position: static;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  font-size: 20px;
}

.trend-notice {
  border: 1px solid rgba(255, 214, 90, 0.24);
  border-radius: 10px;
  background: rgba(255, 214, 90, 0.08);
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 20px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
}

.trend-notice strong {
  color: #ffd65a;
}

.trend-rail {
  display: grid;
  gap: 10px;
  margin: 0 0 26px;
}

.trend-rail-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.trend-rail h3 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(18px, 2vw, 25px);
  line-height: 1.1;
}

.trend-rail p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.trend-row {
  display: grid;
  grid-auto-columns: minmax(146px, 178px);
  grid-auto-flow: column;
  gap: 12px;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  padding: 2px 2px 12px;
  scrollbar-width: thin;
}

.trend-rail.compact .trend-row {
  grid-auto-columns: minmax(170px, 220px);
}

.trend-card {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  color: #ffffff;
  cursor: pointer;
}

.trend-card:hover .trend-poster,
.trend-card:focus-visible .trend-poster {
  box-shadow: 0 0 0 2px var(--accent), 0 0 28px rgba(0, 240, 255, 0.24);
  transform: translateY(-2px);
}

.trend-poster {
  display: grid;
  place-items: center;
  aspect-ratio: 2 / 3;
  border-radius: 10px;
  background:
    radial-gradient(circle at 50% 15%, rgba(0, 240, 255, 0.18), transparent 56%),
    rgba(255, 255, 255, 0.08);
  color: var(--accent);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.trend-rail.compact .trend-poster {
  aspect-ratio: 16 / 9;
}

.trend-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.trend-title {
  display: -webkit-box;
  min-height: 32px;
  overflow: hidden;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.18;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.82);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.trend-meta {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.history-meta {
  display: grid;
  gap: 7px;
  min-width: 0;
  padding: 10px 0;
}

.history-meta .item-name {
  min-height: auto;
  padding: 0;
}

.history-progress {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  overflow: hidden;
}

.history-progress span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  background: #ff003d;
}

.history-time {
  color: var(--muted);
  font-size: 12px;
}

.history-actions {
  display: grid;
  align-self: center;
  gap: 6px;
}

.history-play,
.history-remove {
  align-self: center;
  min-height: 34px;
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  color: #67e8f9;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.history-remove {
  border-color: rgba(255, 59, 107, 0.35);
  color: #ff9ab4;
}

.history-remove:hover {
  background: rgba(255, 59, 107, 0.12);
}



.episode-detail-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 10, 0.86);
  padding: 18px;
  backdrop-filter: blur(18px);
}

.episode-detail-modal.is-visible {
  display: flex;
}

.episode-detail-modal.is-hidden {
  display: none;
}

.episode-detail-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(620px, 100%);
  max-height: min(84vh, 680px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 17, 25, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.episode-detail-body {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.episode-detail-body p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.6;
  white-space: pre-wrap;
}

.episode-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 18px;
}

@media (max-width: 700px) {
  .media-modal,
  .episode-detail-modal {
    align-items: stretch;
    padding: 10px;
  }

  .media-card,
  .episode-detail-card {
    max-height: calc(100dvh - 20px);
  }

  .media-card {
    width: 100%;
    min-height: 0;
  }

  .media-card-content {
    min-height: min(560px, calc(100dvh - 20px));
    padding: 138px 14px 18px;
  }

  .media-card h2 {
    max-width: calc(100% - 46px);
    font-size: clamp(24px, 8vw, 34px);
  }

  .episode-detail-body {
    padding: 14px;
  }

  .episode-detail-actions {
    display: grid;
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .media-favorite-button {
    top: 12px;
    right: 58px;
  }

  .media-card > .media-favorite-button {
    right: 12px;
  }
}

.episode-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 10, 0.84);
  padding: 18px;
  backdrop-filter: blur(18px);
}

.episode-modal.is-visible {
  display: flex;
}

.episode-modal.is-hidden {
  display: none;
}

.media-modal {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(5, 5, 10, 0.86);
  padding: 18px;
  backdrop-filter: blur(18px);
}

.media-modal.is-visible {
  display: flex;
}

.media-modal.is-hidden {
  display: none;
}

.media-card {
  position: relative;
  width: min(760px, 100%);
  max-height: min(86vh, 720px);
  min-height: 430px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: rgba(13, 17, 25, 0.98);
  background-position: center top;
  background-size: cover;
  box-shadow: var(--shadow);
  overflow: auto;
}

.media-card-content {
  min-height: 430px;
  padding: clamp(150px, 28vh, 230px) 18px 22px;
}

.media-card h2 {
  max-width: 90%;
  margin: 0;
  font-size: clamp(24px, 4vw, 38px);
  line-height: 1.05;
}

.media-back {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 4;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.38);
  color: #ffffff;
  padding: 0 12px;
  font-weight: 800;
  cursor: pointer;
}

.media-card > .media-favorite-button {
  right: 14px;
}

.episode-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(920px, 100%);
  height: min(86vh, 820px);
  max-height: min(86vh, 820px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background-color: rgba(13, 17, 25, 0.98);
  background-position: center top;
  background-size: cover;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.episode-head {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  min-height: 330px;
  padding: 48px 18px 18px;
}

.episode-head h2 {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.15;
}

.episode-head span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.media-modal-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.media-modal-meta span {
  display: inline-flex;
  margin: 0;
}

.media-type-pill {
  border: 1px solid rgba(0, 240, 255, 0.32);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.14);
  color: #67e8f9 !important;
  padding: 2px 8px;
  text-transform: uppercase;
}

.media-modal-plot {
  max-width: 760px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

.media-modal-credits {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 11px;
}

.media-cast-label {
  display: block;
  margin-top: 18px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.media-cast-list {
  display: flex;
  gap: 10px;
  max-width: 100%;
  margin-top: 9px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.media-cast-person {
  display: grid !important;
  justify-items: center;
  gap: 6px;
  width: 64px;
  flex: 0 0 64px;
  margin: 0 !important;
  color: rgba(255, 255, 255, 0.82) !important;
  text-align: center;
}

.media-cast-person b {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.20), rgba(255, 0, 93, 0.16));
  color: #ffffff;
  font-size: 13px;
  overflow: hidden;
}

.media-cast-person b img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media-cast-person small {
  display: -webkit-box;
  overflow: hidden;
  font-size: 9px;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.media-play-now {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 520px);
  min-height: 42px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #05050a;
  font-weight: 900;
  cursor: pointer;
}

.media-favorite-button {
  position: absolute;
  top: 16px;
  right: 70px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 214, 90, 0.36);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.34);
  color: rgba(255, 255, 255, 0.84);
  font-size: 21px;
  cursor: pointer;
}

.media-favorite-button.is-favorite {
  background: rgba(255, 214, 90, 0.18);
  color: #ffd65a;
  box-shadow: 0 0 18px rgba(255, 214, 90, 0.28);
}

.episode-close {
  position: relative;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 28px;
  line-height: 1;
}

.episode-filter {
  border-bottom: 1px solid var(--line);
  background: rgba(13, 17, 25, 0.94);
  padding: 14px 18px;
}

.season-field {
  display: grid;
  grid-template-columns: auto minmax(220px, 360px);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.season-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.season-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 8px;
  background: #151b24;
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 800;
  outline: none;
}

.episode-layout {
  min-height: 0;
  padding: 14px 18px 18px;
  overflow: hidden;
  background: rgba(13, 17, 25, 0.98);
}

.episode-list {
  display: grid;
  align-content: start;
  gap: 8px;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
}

.episode-button {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  gap: 4px 12px;
  align-items: start;
  min-height: 82px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  overflow: hidden;
  padding: 10px 12px;
  text-align: left;
}

.episode-button:hover {
  border-color: var(--accent);
  background: rgba(0, 240, 255, 0.10);
  box-shadow: 0 0 22px rgba(0, 240, 255, 0.16);
}


.episode-number {
  grid-row: span 2;
  align-self: start;
  justify-self: start;
  margin-top: 6px;
  border: 1px solid rgba(0, 240, 255, 0.28);
  border-radius: 999px;
  color: #67e8f9;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  white-space: nowrap;
}

.episode-copy {
  display: grid;
  gap: 4px;
  min-width: 0;
  align-self: stretch;
}

.episode-button strong,
.episode-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.episode-button strong {
  display: block;
  line-height: 1.25;
  white-space: nowrap;
}

.episode-button small {
  display: -webkit-box;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}


.episode-progress {
  display: block;
  width: 100%;
  height: 3px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  overflow: hidden;
}

.episode-progress span {
  display: block;
  width: var(--progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.34);
}

.episode-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  align-self: center;
}

.episode-action {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(0, 240, 255, 0.34);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.10);
  color: #67e8f9;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 12px rgba(0, 240, 255, 0.26);
}

.episode-action:hover {
  border-color: var(--accent);
  background: rgba(0, 240, 255, 0.20);
}

.episode-button.has-progress .episode-number {
  border-color: rgba(83, 247, 255, 0.55);
  background: rgba(0, 240, 255, 0.10);
}

.epg-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 12px;
  overflow: hidden;
  backdrop-filter: blur(24px);
}

.yt-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: grid;
  gap: 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  opacity: 0;
  padding: 56px 14px 12px;
  transform: translateY(12px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

.progress-track {
  position: relative;
  height: 16px;
  cursor: pointer;
}

.progress-track::before,
.progress-buffer,
.progress-fill {
  position: absolute;
  top: 7px;
  right: 0;
  left: 0;
  height: 4px;
  border-radius: 999px;
  content: "";
}

.progress-track::before {
  background: rgba(255, 255, 255, 0.28);
}

.progress-buffer {
  right: auto;
  width: 0%;
  background: rgba(255, 255, 255, 0.45);
}

.progress-fill {
  right: auto;
  width: 0%;
  background: #ff003d;
  box-shadow: 0 0 18px rgba(255, 0, 61, 0.45);
}

.timeline-preview {
  position: absolute;
  left: var(--preview-left, 0%);
  bottom: 24px;
  z-index: 8;
  width: min(220px, 42vw);
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(8, 10, 16, 0.94);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(8px) scale(0.96);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.timeline-preview.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.timeline-preview::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  content: "";
  background:
    linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent),
    rgba(255, 255, 255, 0.05);
  background-size: 180% 100%;
  animation: preview-shimmer 1.1s linear infinite;
}

.timeline-preview.is-ready::before {
  content: "";
  background: transparent;
  animation: none;
}

.timeline-preview img,
.timeline-preview video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #05070b;
}

.timeline-preview img {
  opacity: 0;
}

.timeline-preview.is-cached img {
  opacity: 1;
}

.timeline-preview video {
  opacity: 0;
}

.timeline-preview.is-ready video {
  opacity: 1;
}

.timeline-preview.is-cached video {
  opacity: 0;
}

@keyframes preview-shimmer {
  from {
    background-position: 100% 0;
  }

  to {
    background-position: -100% 0;
  }
}

.timeline-preview-time {
  position: absolute;
  right: 8px;
  bottom: 7px;
  z-index: 2;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  padding: 3px 7px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.8);
}

.yt-control-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.control-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.control-left {
  justify-content: flex-start;
}

.control-right {
  justify-content: flex-end;
}

.control-spacer {
  min-width: 0;
}

.vod-control,
.episode-control {
  display: none;
}

.video-stage.is-vod .vod-control {
  display: grid;
}

.video-stage.is-series .vod-control,
.video-stage.is-series .episode-control {
  display: grid;
}

.yt-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
  transition: background 0.2s ease, transform 0.2s ease;
}

.yt-button svg {
  width: 21px;
  height: 21px;
  fill: currentColor;
  pointer-events: none;
}

.yt-button:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: scale(1.04);
}

.yt-button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
  transform: none;
}

.yt-button:disabled:hover {
  background: transparent;
}

.stats-toggle {
  display: inline-flex;
  width: auto;
  min-width: 54px;
  padding: 0 9px;
  gap: 5px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 800;
}

.stats-toggle svg {
  width: 18px;
  height: 18px;
}

.stats-toggle[aria-expanded="true"] {
  background: rgba(0, 240, 255, 0.18);
  color: #cffafe;
}

.volume-control {
  position: relative;
  display: grid;
  place-items: center;
}

.volume-control::before {
  position: absolute;
  right: -18px;
  bottom: 34px;
  left: -18px;
  z-index: 0;
  display: block;
  height: 26px;
  content: "";
}

.yt-volume {
  width: 100px;
  max-width: 116px;
  min-width: 58px;
  min-height: 24px;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  cursor: pointer;
  --volume: 100%;
}

.yt-volume::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: linear-gradient(90deg, #ff003d 0 var(--volume), rgba(255, 255, 255, 0.82) var(--volume) 100%);
}

.yt-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  margin-top: -4.5px;
  border: 0;
  border-radius: 50%;
  background: #ff003d;
  box-shadow: 0 0 10px rgba(255, 0, 61, 0.45);
}

.yt-volume::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
}

.yt-volume::-moz-range-progress {
  height: 5px;
  border-radius: 999px;
  background: #ff003d;
}

.yt-volume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: #ff003d;
  box-shadow: 0 0 10px rgba(255, 0, 61, 0.45);
}

.volume-control .yt-volume {
  position: absolute;
  bottom: 42px;
  left: 50%;
  z-index: 2;
  width: 104px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.78);
  opacity: 0;
  padding: 8px 10px;
  pointer-events: none;
  transform: translateX(-50%);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.volume-control:hover .yt-volume,
.volume-control.is-open .yt-volume {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(-2px);
}

.time-label {
  min-width: 0;
  overflow: hidden;
  color: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-align: right;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.75);
  white-space: nowrap;
}

.fullscreen-toggle {
  justify-self: end;
}

@media (max-width: 620px) {
  .playback-stats {
    top: 8px;
    right: 8px;
    bottom: 62px;
    width: calc(100% - 16px);
    max-height: calc(100% - 70px);
    padding: 9px;
  }

  .playback-stats-header {
    top: -9px;
    margin: -9px -9px 8px;
    padding: 9px;
  }

  .playback-stats-grid {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .playback-stat-row {
    grid-template-columns: minmax(88px, 0.75fr) minmax(0, 1.25fr);
    padding: 5px 6px;
  }

  .stats-toggle {
    min-width: 50px;
    padding: 0 7px;
  }
}

.epg-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 10px;
}

.epg-header .eyebrow {
  margin-bottom: 5px;
}

.epg-header h3 {
  margin: 0;
  font-size: 18px;
}

.epg-header span {
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.epg-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.epg-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 10px;
}

.epg-time {
  color: #67e8f9;
  font-size: 12px;
  font-weight: 800;
}

.epg-name {
  margin: 0;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.epg-desc {
  display: -webkit-box;
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.045);
}

::-webkit-scrollbar-thumb {
  border: 2px solid rgba(10, 10, 15, 0.9);
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.55);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 240, 255, 0.85);
}

@media (max-width: 900px) {
  .player-view {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  .sidebar {
    position: relative;
    z-index: 20;
    border-width: 0 0 1px;
    max-height: none;
    overflow: visible;
  }

  .sidebar,
  .content-area,
  .playlist-panel,
  .player-panel,
  .item-grid,
  .item-card,
  .tabs,
  .category-list {
    min-width: 0;
    max-width: 100%;
  }


  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
    color: #67e8f9;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0 14px;
  }

  .mobile-menu-toggle[aria-expanded="true"] {
    background: rgba(0, 240, 255, 0.12);
    color: #cffafe;
    box-shadow: 0 0 26px rgba(0, 240, 255, 0.20);
  }

  .tabs,
  .category-list {
    position: static;
    z-index: 30;
    display: none;
    grid-template-columns: 1fr;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 0;
    border: 1px solid rgba(0, 240, 255, 0.22);
    border-radius: 8px;
    background: rgba(12, 16, 24, 0.98);
    box-shadow: var(--shadow);
    padding: 8px;
    overflow: hidden;
  }

  .sidebar.menu-open .tabs,
  .sidebar.menu-open .category-list {
    display: grid;
  }

  .tab,
  .category-button {
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .category-list::before {
    content: "Categorias";
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 4px 4px 8px;
  }

  .watch-layout,
  .watch-layout:not(.has-playback) {
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .playlist-panel {
    max-height: 42vh;
  }

  .player-panel {
    overflow: visible;
  }

  .category-list {
    align-content: start;
    gap: 8px;
    max-height: min(46vh, 360px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .content-area {
    min-height: 70vh;
    overflow: visible;
  }

  .video-stage {
    max-height: none;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .sidebar {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-top {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 4px;
    min-height: 74px;
  }

  .sidebar-top > div {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .sidebar-top .eyebrow,
  .sidebar-top h2 {
    grid-column: auto;
    grid-row: auto;
  }

  .sidebar-top h2 {
    padding-left: 0;
    font-size: 15px;
    white-space: nowrap;
  }

  .sidebar-top h2::before {
    display: none;
  }

  .sidebar-actions {
    align-self: start;
    gap: 6px;
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .sidebar-top #logoutButton {
    min-width: 58px;
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .refresh-icon-button {
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .mobile-category-panel {
    max-height: none;
    overflow: visible;
  }

  .tabs {
    overflow: visible;
  }

  .watch-layout {
    grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.05fr);
  }

  .yt-controls {
    gap: 5px;
    padding: 42px 8px 8px;
  }

  .progress-track {
    height: 12px;
  }

  .progress-track::before,
  .progress-buffer,
  .progress-fill {
    top: 5px;
  }

  .yt-control-row {
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 5px;
  }

  .control-cluster {
    gap: 5px;
  }

  .yt-button {
    width: 32px;
    height: 32px;
  }

  .yt-button svg {
    width: 18px;
    height: 18px;
  }

  .volume-control .yt-volume {
    width: 92px;
    min-width: 92px;
  }

  .time-label {
    font-size: 11px;
  }
}

@media (max-width: 700px) {
  .episode-modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 8px;
  }

  .episode-card {
    display: block;
    width: 100%;
    height: calc(100dvh - 16px);
    max-height: none;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .episode-head {
    display: flex;
    align-items: flex-end;
    min-height: 405px;
    max-height: none;
    overflow: hidden;
    padding: 50px 12px 14px;
  }

  .episode-head h2 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 19px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .episode-head > div {
    width: 100%;
    min-width: 0;
  }

  .episode-head > div > .eyebrow {
    margin-bottom: 8px;
  }

  .episode-head > div > span {
    margin-top: 4px;
    font-size: 13px;
  }

  .episode-head .media-modal-plot,
  .episode-head .media-modal-credits {
    display: none;
  }

  .episode-head .media-modal-meta {
    gap: 5px;
    margin-top: 7px;
    font-size: 11px;
  }

  .episode-head .media-modal-cast {
    display: block;
    margin-top: 8px;
  }

  .episode-head .media-cast-label {
    margin-top: 0;
  }

  .episode-head .media-cast-list {
    gap: 8px;
    margin-top: 6px;
    padding-bottom: 2px;
  }

  .episode-head .media-cast-person {
    width: 50px;
    flex-basis: 50px;
  }

  .episode-head .media-cast-person b {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .episode-head .media-play-now {
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
  }

  .episode-head .episode-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 8;
    width: 38px;
    height: 38px;
  }

  .episode-head .media-favorite-button {
    top: 10px;
    right: 56px;
    z-index: 8;
    width: 38px;
    height: 38px;
  }

  .episode-filter {
    padding: 10px 12px;
  }

  .season-field {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .episode-layout {
    min-height: 0;
    overflow: visible;
    padding: 10px 12px 14px;
  }

  .episode-list {
    height: auto;
    min-height: 0;
    overflow: visible;
    padding: 0 0 16px;
  }

  .episode-button {
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas:
      "number copy actions";
    align-items: center;
    gap: 8px;
    min-height: 72px;
    overflow: hidden;
    padding: 9px;
  }

  .episode-number {
    grid-area: number;
    grid-row: auto;
    margin-top: 2px;
    padding: 5px 7px;
    font-size: 11px;
  }

  .episode-copy {
    grid-area: copy;
    width: 100%;
    min-width: 0;
  }

  .episode-actions {
    grid-area: actions;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    width: auto;
    gap: 5px;
  }

  .episode-action {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .episode-button strong {
    display: -webkit-box;
    overflow: hidden;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .episode-button small {
    display: none;
  }

  .epg-item {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .yt-control-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .control-spacer {
    display: none;
  }

  .control-left,
  .control-right {
    justify-content: space-between;
    width: 100%;
    gap: 5px;
  }

  .yt-button {
    width: 34px;
    height: 34px;
  }

  .time-label {
    font-size: 11px;
  }

  .volume-control .yt-volume {
    bottom: 40px;
    width: 86px;
    min-width: 86px;
    max-width: 86px;
  }
}

@media (max-width: 560px) {
  .player-title-overlay {
    min-height: 48px;
    padding: 11px 12px 30px;
    font-size: 13px;
  }

  .login-view,
  .sidebar,
  .content-area {
    padding: 14px;
  }

  .content-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .sidebar-top {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .item-card {
    grid-template-columns: 52px minmax(0, 1fr);
    width: 100%;
  }

  .poster {
    width: 52px;
  }
}

.series-now {
  display: grid;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 12px;
}

.series-now strong {
  color: var(--text);
  line-height: 1.25;
}

.series-now small {
  color: var(--muted);
}

.series-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.series-actions .secondary-button {
  min-width: 0;
  width: 100%;
  min-height: 38px;
  padding: 0 8px;
}

.series-actions .secondary-button:disabled {
  cursor: not-allowed;
  filter: grayscale(1);
  opacity: 0.45;
  transform: none;
}


@media (max-width: 520px) {
  .series-actions {
    grid-template-columns: 1fr;
  }
}


@media (max-height: 680px) {
  .episode-card {
    max-height: calc(100dvh - 12px);
  }

  @media (max-width: 700px) {
    .episode-card {
      height: calc(100dvh - 12px);
      max-height: none;
      overflow-x: hidden;
      overflow-y: auto;
    }

    .episode-head {
      min-height: 270px;
      max-height: none;
      overflow: hidden;
      padding: 42px 12px 12px;
    }

    .episode-head .media-modal-cast {
      display: none;
    }

    .episode-layout {
      min-height: 0;
      overflow: visible;
    }

    .episode-list {
      height: auto;
      min-height: 0;
      overflow: visible;
    }
  }

  .episode-head {
    min-height: auto;
    max-height: 42dvh;
    padding: 10px 12px;
  }

  .episode-head .eyebrow {
    margin-bottom: 6px;
  }

  .episode-head h2 {
    font-size: 20px;
  }

  .episode-filter {
    padding: 10px 12px;
  }

  .episode-layout {
    padding: 10px 12px 12px;
  }

  @media (max-width: 700px) {
    .episode-card {
      overflow-x: hidden;
      overflow-y: auto;
    }

    .episode-head {
      min-height: 270px;
      max-height: none;
      overflow: hidden;
      padding: 42px 12px 12px;
    }

    .episode-head .media-modal-cast {
      display: none;
    }

    .episode-layout {
      min-height: 0;
      overflow: visible;
    }

    .episode-list {
      height: auto;
      min-height: 0;
      overflow: visible;
    }
  }
}

@media (min-width: 701px) {
  .episode-card {
    display: block;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .episode-head {
    min-height: 330px;
  }

  .episode-layout {
    overflow: visible;
  }

  .episode-list {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 900px) {
  .player-view {
    padding-top: 50px;
  }

  .sidebar {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: block;
    width: 100%;
    height: 100dvh;
    min-height: 0;
    border: 0;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
    padding: 0;
    overflow: hidden;
    pointer-events: none;
  }

  .sidebar::before {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: rgba(0, 0, 0, 0.62);
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .sidebar.menu-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar::after {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 1;
    height: 50px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.96);
    content: "";
    pointer-events: none;
  }

  .mobile-menu-toggle,
  .mobile-search-toggle,
  .mobile-sort-toggle,
  .mobile-brand {
    position: fixed;
    top: 0;
    z-index: 4;
    pointer-events: auto;
  }

  .mobile-menu-toggle {
    left: 0;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    min-height: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #ffffff;
    padding: 0;
  }

  .mobile-menu-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: none;
    color: #ffffff;
  }

  .mobile-menu-toggle #mobileMenuLabel {
    display: none;
  }

  .hamburger-lines {
    width: 23px;
    gap: 5px;
  }

  .hamburger-lines span {
    height: 2px;
    background: #ffffff;
  }

  .mobile-brand {
    left: 50%;
    height: 50px;
    color: #ffffff;
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 0.02em;
    line-height: 50px;
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.75);
    transform: translateX(-50%);
  }

  .mobile-brand span {
    display: inline-grid;
    place-items: center;
    margin-left: 2px;
    border-radius: 999px;
    background: #ff003d;
    color: #ffffff;
    padding: 1px 3px;
    font-size: 9px;
    vertical-align: super;
  }

  .mobile-search-toggle {
    right: 0;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 0;
    background: transparent;
    color: #ffffff;
  }

  .mobile-sort-toggle {
    right: 50px;
    display: grid;
    place-items: center;
    width: 50px;
    height: 50px;
    border: 0;
    background: transparent;
    color: #ffffff;
    padding: 0;
  }

  .mobile-sort-toggle svg {
    width: 23px;
    height: 23px;
    fill: currentColor;
  }

  .mobile-search-toggle svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
  }

  .sidebar-top,
  .tabs,
  .search-box,
  .category-list {
    position: fixed;
    left: 0;
    z-index: 3;
    width: min(278px, 78vw);
    border-right: 1px solid rgba(255, 255, 255, 0.20);
    background:
      linear-gradient(145deg, rgba(5, 6, 10, 0.96), rgba(16, 20, 28, 0.86)),
      radial-gradient(circle at 15% 38%, rgba(0, 240, 255, 0.12), transparent 32%),
      radial-gradient(circle at 80% 72%, rgba(255, 0, 61, 0.18), transparent 38%);
    transform: translateX(-105%);
    transition: transform 0.24s ease;
    pointer-events: auto;
  }

  .sidebar.menu-open .sidebar-top,
  .sidebar.menu-open .tabs,
  .sidebar.menu-open .search-box,
  .sidebar.menu-open .category-list {
    transform: translateX(0);
  }

  .sidebar-top {
    top: auto;
    bottom: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    height: 132px;
    min-height: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    padding: 14px 20px;
  }

  .sidebar-top .eyebrow {
    display: none;
  }

  .sidebar-top h2 {
    position: relative;
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    margin: 0;
    padding-left: 30px;
    color: #ffffff;
    font-size: clamp(15px, 4.2vw, 16px);
    line-height: 1.16;
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
    word-break: break-word;
  }

  .sidebar-top h2::before {
    position: absolute;
    left: 0;
    top: 50%;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    content: "";
    transform: translateY(-50%);
  }

  .sidebar-top .icon-button {
    justify-self: start;
    min-width: 0;
    min-height: 34px;
    border: 0;
    background: transparent;
    color: #ffffff;
    padding: 0;
    text-align: left;
  }

  .sidebar-top #logoutButton {
    grid-column: 1 / -1;
    justify-self: start;
    min-width: 62px;
    padding: 0 12px;
  }

  .sidebar-actions {
    display: contents;
  }

  .refresh-icon-button {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    width: 36px;
    min-width: 36px;
    min-height: 34px;
  }

  .tabs {
    top: 128px;
    bottom: 132px;
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    gap: 6px;
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 18px 16px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .tab {
    justify-content: flex-start;
    min-height: 48px;
    border: 0;
    border-left: 3px solid transparent;
    border-radius: 0 6px 6px 0;
    background: transparent;
    color: #ffffff;
    font-size: 16px;
    letter-spacing: 0;
    padding: 0 16px;
    text-align: left;
    text-transform: none;
  }

  .tab.is-active {
    border-left-color: #ff003d;
    background: linear-gradient(90deg, rgba(255, 0, 61, 0.32), transparent);
    box-shadow: none;
    color: #ffffff;
  }

  .search-box {
    top: 50px;
    display: grid;
    gap: 8px;
    padding: 10px 18px;
  }

  .category-list {
    display: none;
  }

  .sidebar.menu-open .category-list {
    display: none;
  }

  .category-list::before {
    padding: 0 0 8px;
    color: rgba(255, 255, 255, 0.52);
  }

  .category-button {
    min-height: 38px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: rgba(255, 255, 255, 0.86);
    padding: 0 10px;
    font-size: 14px;
    font-weight: 700;
  }

  .category-button.is-active,
  .category-button:hover {
    border-color: transparent;
    background: rgba(255, 255, 255, 0.10);
    box-shadow: none;
    color: #ffffff;
  }

  .tab:not([data-section="trends"]):not([data-section="history"]):not([data-section="favorites"])::after {
    justify-self: end;
    color: rgba(255, 255, 255, 0.62);
    content: "+";
    font-size: 20px;
    line-height: 1;
  }

  .tab:not([data-section="trends"]):not([data-section="history"]):not([data-section="favorites"]) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .tab.is-expanded:not([data-section="trends"]):not([data-section="history"]):not([data-section="favorites"])::after {
    content: "-";
  }

  .mobile-category-panel {
    display: grid;
    align-content: start;
    gap: 2px;
    max-height: none;
    overflow: visible;
    border-left: 1px solid rgba(255, 255, 255, 0.18);
    margin: -2px 0 8px 18px;
    padding: 4px 6px 7px 12px;
  }

  .mobile-category-panel > span {
    color: rgba(255, 255, 255, 0.52);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 0 10px 6px;
  }

  .mobile-category-panel .category-button {
    width: 100%;
  }

  .content-area {
    padding-top: 64px;
  }
}


@media (max-width: 900px) {
  .item-grid.poster-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    overflow: visible;
    padding-right: 0;
  }

  .item-grid.poster-grid .item-card {
    display: grid;
    grid-template-columns: 1fr;
    align-content: start;
    min-height: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
    padding: 0;
  }

  .item-grid.poster-grid .poster {
    width: 100%;
    height: auto;
    aspect-ratio: 2 / 3;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
  }

  .item-grid.poster-grid .poster img {
    border-radius: inherit;
  }

  .item-grid.poster-grid .item-details {
    min-width: 0;
  }

  .item-grid.poster-grid .item-name {
    padding: 6px 2px 0;
    color: #ffffff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.15;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
    -webkit-line-clamp: 2;
  }

  .item-grid.poster-grid .item-progress,
  .item-grid.poster-grid .item-progress-label {
    margin-right: 2px;
    margin-left: 2px;
  }

  .item-grid.trends-grid {
    overflow: visible;
    padding: 0 0 180px;
  }

  .trends-hero {
    height: 430px;
    min-height: 0;
    border-radius: 0;
    margin: -2px -12px 20px;
    padding: 22px 14px 34px;
  }

  .trends-carousel-top {
    top: 14px;
    right: 12px;
    left: 12px;
    align-items: flex-start;
    gap: 10px;
  }

  .trends-window-toggle button {
    min-height: 28px;
    padding: 0 10px;
    font-size: 11px;
  }

  .trends-hero-content {
    grid-template-columns: 74px minmax(0, 1fr);
    max-width: none;
    gap: 12px;
    margin-top: 88px;
  }

  .trends-hero-poster {
    border-radius: 8px;
  }

  .trends-meta {
    font-size: 11px;
  }

  .trends-hero h2 {
    font-size: clamp(25px, 9vw, 42px);
    line-height: 1;
    -webkit-line-clamp: 2;
  }

  .trends-hero p {
    max-width: 100%;
    font-size: 13px;
    -webkit-line-clamp: 3;
  }

  .trends-nav {
    top: 56%;
    width: 34px;
    height: 34px;
    font-size: 26px;
  }

  .trends-nav.prev {
    left: 8px;
  }

  .trends-nav.next {
    right: 8px;
  }

  .trends-dots {
    right: 14px;
    bottom: 16px;
    gap: 5px;
    padding: 6px 7px;
  }

  .trends-dots button {
    width: 6px;
    height: 6px;
  }

  .trends-dots button.is-active {
    width: 28px;
  }

  .trend-row {
    grid-auto-columns: minmax(122px, 34vw);
    gap: 10px;
    margin-right: -12px;
    padding-bottom: 10px;
  }

  .trend-rail.compact .trend-row {
    grid-auto-columns: minmax(142px, 46vw);
  }

  .trend-title {
    font-size: 12px;
  }

  .trend-rail p {
    font-size: 12px;
  }
}


.menu-empty-state {
  min-height: min(58vh, 560px);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  padding: 32px 18px;
  color: var(--text);
  text-align: center;
}

.menu-empty-state strong {
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  letter-spacing: 0;
}

.menu-empty-state p {
  max-width: 440px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.menu-empty-icon {
  width: 54px;
  height: 54px;
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(35, 224, 255, 0.48);
  border-radius: 14px;
  background: rgba(35, 224, 255, 0.08);
  box-shadow: 0 0 22px rgba(35, 224, 255, 0.16);
}

.menu-empty-icon span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--cyan);
}

@media (max-width: 900px) {
  .menu-empty-state {
    min-height: calc(100dvh - 96px);
    padding: 44px 22px;
  }

  .menu-empty-state strong {
    font-size: 1.55rem;
  }
}


@media (max-width: 900px) {
  .sidebar:not(.menu-open)::before {
    display: none;
    opacity: 0;
    pointer-events: none;
  }

  .sidebar:not(.menu-open) .sidebar-top,
  .sidebar:not(.menu-open) .tabs,
  .sidebar:not(.menu-open) .search-box,
  .sidebar:not(.menu-open) .category-list {
    pointer-events: none;
    visibility: hidden;
  }

  .sidebar.menu-open .sidebar-top,
  .sidebar.menu-open .tabs,
  .sidebar.menu-open .search-box,
  .sidebar.menu-open .category-list {
    pointer-events: auto;
    visibility: visible;
  }

  .content-area,
  .watch-layout,
  .playlist-panel,
  .item-grid,
  .item-card,
  .player-panel {
    position: relative;
    z-index: 1;
  }

  .menu-empty-state {
    position: relative;
    min-height: calc(100dvh - 96px);
    overflow: hidden;
  }

  .menu-empty-bg {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.055);
    font-size: clamp(3.8rem, 20vw, 8.5rem);
    font-weight: 950;
    letter-spacing: 0;
    line-height: 0.86;
    text-align: center;
    pointer-events: none;
    user-select: none;
  }

  .menu-empty-bg span {
    display: block;
    color: rgba(35, 224, 255, 0.09);
    font-size: 0.42em;
    letter-spacing: 0.08em;
  }

  .menu-empty-icon,
  .menu-empty-state strong,
  .menu-empty-state p {
    position: relative;
    z-index: 1;
  }
}


.menu-loading-state {
  min-height: 40vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--text);
  text-align: center;
}

.menu-loading-state span {
  width: 42px;
  height: 42px;
  border: 3px solid rgba(35, 224, 255, 0.18);
  border-top-color: var(--cyan);
  border-radius: 999px;
  animation: dtnx-spin 0.9s linear infinite;
}

.menu-loading-state strong {
  color: var(--muted);
  font-size: 0.95rem;
}

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

@media (max-width: 900px) {
  .menu-loading-state {
    min-height: calc(100dvh - 110px);
  }
}


@media (max-width: 900px) {
  body .player-view .sidebar,
  body .player-view .sidebar:not(.menu-open) {
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: none;
  }
}


/* Mobile responsive playlist panel */
@media (max-width: 900px) {
  .watch-layout .playlist-panel {
    width: 100%;
    max-width: 100%;
    max-height: none;
    min-height: 0;
  }

  .watch-layout:not(.has-playback) .playlist-panel {
    height: max(360px, calc(100dvh - 176px));
  }

  .watch-layout.has-playback .playlist-panel {
    height: clamp(320px, 58dvh, 680px);
  }

  .playlist-panel .item-grid {
    width: 100%;
    max-width: 100%;
    min-height: 0;
    max-height: 100%;
    padding-right: 0;
  }
}


/* Sidebar content header */
.content-area {
  grid-template-rows: minmax(0, 1fr);
}

.sidebar .content-header {
  display: grid;
  align-items: start;
  justify-content: stretch;
  gap: 10px;
  min-height: 0;
  border: 1px solid rgba(0, 240, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  padding: 12px;
}

.sidebar .content-header > div {
  min-width: 0;
}

.sidebar .content-header .eyebrow {
  margin-bottom: 8px;
}

.sidebar .content-header h2 {
  max-width: 100%;
  color: var(--text);
  font-size: 18px;
  line-height: 1.18;
  overflow-wrap: anywhere;
}

.sidebar .content-header .secondary-button {
  width: 100%;
  min-width: 0;
}

@media (max-width: 900px) {
  .sidebar .content-header {
    display: none;
  }
}


/* Mobile poster card height guard */
@media (max-width: 900px) {
  .item-grid.poster-grid {
    grid-auto-rows: max-content;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .item-grid.poster-grid .item-card {
    height: auto;
    min-height: calc((((100dvw - 48px) / 3) * 1.5) + 42px);
    align-items: start;
    align-content: start;
    grid-template-rows: auto minmax(30px, auto);
  }

  .item-grid.poster-grid .poster {
    align-self: start;
  }

  .item-grid.poster-grid .item-details {
    align-self: start;
  }
}


/* Mobile top search */
@media (max-width: 900px) {
  .sidebar.search-open .search-box {
    top: 0;
    right: 50px;
    left: 50px;
    z-index: 5;
    display: block;
    width: auto;
    height: 50px;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.96);
    box-shadow: none;
    padding: 5px 4px;
    transform: none;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar.search-open .search-box > span {
    display: none;
  }

  .sidebar.search-open .search-box input {
    min-height: 40px;
    height: 40px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.11);
    padding: 0 14px;
  }

  .sidebar.search-open .mobile-brand {
    opacity: 0;
    visibility: hidden;
  }

  .sidebar.search-open .mobile-search-toggle {
    background: rgba(0, 240, 255, 0.10);
  }
}

/* Mobile continuous catalog and ordering */
@media (max-width: 900px) {
  .watch-layout .playlist-panel,
  .watch-layout:not(.has-playback) .playlist-panel,
  .watch-layout.has-playback .playlist-panel {
    height: auto;
    max-height: none;
    grid-template-rows: auto auto;
    overflow: visible;
  }

  .playlist-panel .item-grid {
    height: auto;
    max-height: none;
    overflow: visible;
    padding-bottom: 24px;
  }

  .content-area,
  .watch-layout {
    overflow: visible;
  }

  .mobile-sort-menu {
    position: fixed;
    top: 58px;
    right: 10px;
    z-index: 420;
    display: none;
    width: min(236px, calc(100vw - 20px));
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 10px;
    background: rgba(8, 10, 16, 0.98);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
    padding: 7px;
    pointer-events: auto;
    visibility: visible;
    touch-action: manipulation;
  }

  .sidebar.sort-open .mobile-sort-menu {
    display: grid;
    gap: 4px;
    pointer-events: auto;
  }

  .mobile-sort-menu button {
    min-height: 42px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #ffffff;
    font-weight: 800;
    text-align: left;
    padding: 0 12px;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .mobile-sort-menu button:hover,
  .mobile-sort-menu button:focus-visible {
    background: rgba(0, 240, 255, 0.13);
    outline: none;
  }

  .sidebar.sort-open .mobile-sort-toggle {
    background: rgba(0, 240, 255, 0.10);
  }

  .item-grid.poster-grid .rating-badge {
    top: 7px;
    left: 7px;
  }

  .favorite-toggle {
    top: 7px;
    right: 7px;
    width: 28px;
    height: 28px;
    font-size: 17px;
  }
}


/* Mobile topbar brand */
@media (max-width: 900px) {
  .mobile-brand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: auto;
    min-width: 0;
    height: 50px;
    color: #ffffff;
    font-size: 31px;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1;
    text-shadow:
      0 0 12px rgba(0, 240, 255, 0.42),
      0 0 26px rgba(0, 240, 255, 0.24);
    white-space: nowrap;
  }

  .mobile-brand span {
    margin-left: 4px;
    align-self: flex-start;
    margin-top: 11px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 999px;
    background: var(--magenta);
    box-shadow:
      0 0 0 1px rgba(0, 240, 255, 0.18),
      0 0 18px rgba(0, 240, 255, 0.28),
      0 0 18px rgba(255, 0, 85, 0.28);
    padding: 2px 4px;
    font-size: 11px;
    line-height: 1;
    vertical-align: top;
  }
}


/* Mobile fullscreen exit */
.mobile-exit-player {
  display: none;
}

@media (max-width: 700px) {
  .video-stage:fullscreen .mobile-exit-player,
  .video-stage:-webkit-full-screen .mobile-exit-player {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    z-index: 8;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
    padding: 0;
  }

  .mobile-exit-player svg {
    width: 25px;
    height: 25px;
    fill: currentColor;
  }
}


/* Mobile native fullscreen exit */
@media (max-width: 700px) {
  .video-stage:fullscreen .mobile-exit-player,
  .video-stage:-webkit-full-screen .mobile-exit-player {
    position: absolute;
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
    z-index: 9;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.68);
    color: #ffffff;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
    padding: 0;
  }
}

/* Mobile playback flow and landscape drawer */
@media (max-width: 700px) {
  .player-view .content-area {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .watch-layout.has-playback .player-panel {
    position: fixed;
    top: calc(60px + env(safe-area-inset-top));
    right: 10px;
    left: 10px;
    z-index: 70;
    grid-template-rows: auto auto;
    gap: 8px;
    max-height: calc(100dvh - 72px - env(safe-area-inset-top));
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 10px;
    background: rgba(6, 9, 15, 0.96);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.68), 0 0 32px rgba(0, 240, 255, 0.16);
    padding: 10px;
  }

  .watch-layout.has-playback .player-panel .epg-panel {
    display: none;
  }

  .watch-layout.has-playback .player-panel .video-stage {
    min-height: 0;
    max-height: calc(100dvh - 130px - env(safe-area-inset-top));
  }

  .watch-layout.has-playback .mobile-close-player {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 7px;
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 0 10px 0 12px;
    font-size: 12px;
    font-weight: 800;
  }

  .mobile-close-player svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .player-view .content-area {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  .watch-layout.has-playback .player-panel {
    position: fixed;
    top: calc(58px + env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    left: max(10px, env(safe-area-inset-left));
    z-index: 70;
    grid-template-rows: auto auto;
    gap: 8px;
    max-height: calc(100dvh - 68px - env(safe-area-inset-top));
    border: 1px solid rgba(0, 240, 255, 0.18);
    border-radius: 10px;
    background: rgba(6, 9, 15, 0.96);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.68), 0 0 32px rgba(0, 240, 255, 0.16);
    padding: 10px;
  }

  .watch-layout.has-playback .player-panel .epg-panel {
    display: none;
  }

  .watch-layout.has-playback .mobile-close-player {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 7px;
    min-height: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    padding: 0 10px 0 12px;
    font-size: 12px;
    font-weight: 800;
  }

  .watch-layout.has-playback .player-panel .video-stage {
    min-height: 0;
    width: min(100%, calc((100dvh - 124px - env(safe-area-inset-top)) * 1.7778));
    max-height: calc(100dvh - 124px - env(safe-area-inset-top));
    justify-self: center;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .sidebar.menu-open::before {
    overscroll-behavior: contain;
    touch-action: none;
  }

  .sidebar.menu-open .tabs {
    top: 118px;
    bottom: 82px;
    gap: 2px;
    padding: 6px 12px;
  }

  .sidebar.menu-open .tab {
    min-height: 36px;
    font-size: 14px;
  }

  .sidebar.menu-open .search-box {
    top: 50px;
    min-height: 68px;
    padding: 6px 12px;
  }

  .sidebar.menu-open .category-list {
    display: none;
  }

  .sidebar.menu-open .sidebar-top {
    height: 82px;
    padding: 8px 16px;
  }

  .sidebar.menu-open .mobile-category-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 680px) {
  .user-info-modal {
    padding: 0;
  }

  .user-info-panel {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .user-info-content {
    padding: 20px 14px 24px;
  }

  .user-info-close {
    top: 10px;
    right: 10px;
  }

  .user-info-hero {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding-right: 44px;
  }

  .user-info-avatar {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    font-size: 20px;
  }

  .user-info-grid {
    grid-template-columns: 1fr;
  }

  .user-info-tile strong {
    font-size: 16px;
  }
}

/* Playback-specific control visibility */
.video-stage.is-live .vod-control,
.video-stage.is-live .episode-control,
.video-stage.is-vod .episode-control {
  display: none !important;
}

.video-stage.is-vod .vod-control,
.video-stage.is-series .vod-control,
.video-stage.is-series .episode-control {
  display: grid !important;
}

@media (min-width: 901px) {
  .sidebar-top {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    min-height: 0;
  }

  .sidebar-top .eyebrow {
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #ffffff;
    display: inline-flex;
    align-items: flex-start;
    gap: 4px;
    margin: 0 0 10px;
    padding: 0;
    font-size: 30px;
    font-weight: 950;
    letter-spacing: 0.02em;
    line-height: 0.9;
  }

  .sidebar-top .eyebrow::before {
    content: "DTNX";
    font-size: 30px;
    text-shadow:
      0 0 12px rgba(0, 240, 255, 0.42),
      0 0 26px rgba(0, 240, 255, 0.24);
  }

  .sidebar-top .eyebrow::after {
    display: inline-grid;
    place-items: center;
    min-width: 25px;
    height: 20px;
    border: 1px solid rgba(255, 255, 255, 0.36);
    border-radius: 999px;
    background: var(--magenta);
    box-shadow:
      0 0 0 1px rgba(0, 240, 255, 0.18),
      0 0 18px rgba(0, 240, 255, 0.28),
      0 0 18px rgba(255, 0, 85, 0.28);
    color: #ffffff;
    content: "TV";
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0;
    line-height: 1;
    transform: translateY(-3px);
  }

  .sidebar-top .eyebrow {
    font-size: 0;
  }

  .sidebar-top h2 {
    font-size: clamp(17px, 1.45vw, 20px);
  }

  .sidebar .content-header {
    display: none !important;
  }

  .sidebar-top {
    order: 0;
  }

  .search-box {
    order: 1;
  }

  .tabs {
    order: 2;
  }
}

/* Mobile floating player: keeps playback reachable during infinite scroll. */
@media (max-width: 900px) {
  .watch-layout.has-playback {
    padding-bottom: clamp(220px, 64vw, 430px);
  }

  .watch-layout.has-playback .playlist-panel {
    height: auto;
    max-height: none;
  }

  .watch-layout.has-playback .player-panel {
    position: fixed !important;
    top: auto !important;
    right: max(8px, env(safe-area-inset-right)) !important;
    bottom: max(8px, env(safe-area-inset-bottom)) !important;
    left: max(8px, env(safe-area-inset-left)) !important;
    z-index: 95;
    display: grid;
    grid-template-rows: auto auto;
    gap: 7px;
    max-height: min(430px, calc(100dvh - 76px - env(safe-area-inset-top)));
    overflow: visible;
    border: 1px solid rgba(0, 240, 255, 0.28);
    border-radius: 12px;
    background:
      linear-gradient(135deg, rgba(9, 31, 35, 0.96), rgba(18, 10, 20, 0.97)),
      rgba(6, 9, 15, 0.97);
    box-shadow:
      0 18px 70px rgba(0, 0, 0, 0.76),
      0 0 30px rgba(0, 240, 255, 0.16);
    padding: 8px;
  }

  .watch-layout.has-playback .player-panel .epg-panel {
    display: none;
  }

  .watch-layout.has-playback .player-panel .video-stage {
    width: 100%;
    min-height: 0;
    max-height: min(52dvh, 360px);
    border-radius: 9px;
  }

  .watch-layout.has-playback .mobile-close-player {
    display: inline-flex;
    align-items: center;
    justify-self: end;
    gap: 7px;
    min-height: 32px;
    border: 1px solid rgba(0, 240, 255, 0.26);
    border-radius: 999px;
    background: rgba(0, 240, 255, 0.10);
    color: #ffffff;
    padding: 0 10px 0 12px;
    font-size: 12px;
    font-weight: 900;
  }

  .watch-layout.has-playback .mobile-close-player svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .watch-layout.has-playback {
    padding-bottom: 0;
  }

  .watch-layout.has-playback .player-panel {
    width: min(520px, 62vw);
    left: auto !important;
    max-height: calc(100dvh - 18px);
  }

  .watch-layout.has-playback .player-panel .video-stage {
    max-height: calc(100dvh - 78px);
  }
}

/* Final responsive sidebar polish for compact desktop and mobile. */
@media (min-width: 901px) and (max-width: 1100px) {
  .player-view {
    grid-template-columns: 260px minmax(0, 1fr);
  }

  .sidebar {
    gap: 14px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
  }

  .sidebar-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    min-height: 0;
  }

  .sidebar-top > div {
    display: grid;
    gap: 4px;
    min-width: 0;
  }

  .sidebar-top .eyebrow,
  .sidebar-top h2,
  .sidebar-actions {
    grid-column: auto;
    grid-row: auto;
  }

  .sidebar-top h2 {
    max-width: 100%;
    padding-left: 0;
    font-size: 15px;
    line-height: 1.12;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
  }

  .sidebar-top h2::before {
    display: none;
  }

  .sidebar-actions {
    display: contents;
  }

  .sidebar-top #logoutButton {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    min-width: 58px;
    min-height: 36px;
    padding: 0 10px;
    font-size: 12px;
  }

  .refresh-icon-button {
    grid-column: 2;
    grid-row: 2;
    align-self: center;
    justify-self: end;
    width: 36px;
    min-width: 36px;
    min-height: 36px;
  }

  .tabs {
    overflow: visible;
    padding-right: 0;
  }

  .mobile-category-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 900px) {
  .sidebar-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    height: 114px;
    gap: 8px 10px;
    padding: 12px 18px;
  }

  .sidebar-top > div {
    display: contents;
  }

  .sidebar-top h2 {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    min-width: 0;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
    word-break: normal;
  }

  .sidebar-actions {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    align-self: center;
    justify-self: end;
    gap: 8px;
  }

  .sidebar-top #logoutButton {
    min-width: 52px;
    min-height: 34px;
    padding: 0 10px;
    font-size: 12px;
  }

  .refresh-icon-button {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .tabs {
    bottom: 114px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: 18px;
  }

  .mobile-category-panel {
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .sidebar.menu-open .sidebar-top {
    height: 82px;
    padding: 8px 14px;
  }

  .sidebar.menu-open .tabs {
    bottom: 82px;
    overflow-y: auto;
  }

  .sidebar.menu-open .sidebar-top h2 {
    font-size: 13px;
  }

  .sidebar.menu-open .sidebar-top #logoutButton {
    min-width: 48px;
    min-height: 30px;
  }

  .sidebar.menu-open .refresh-icon-button {
    width: 30px;
    min-width: 30px;
    min-height: 30px;
  }

  .sidebar.menu-open .mobile-category-panel {
    max-height: none;
    overflow: visible;
  }
}
