:root {
  --purple: #a855f7;
  --purple-soft: #e9d5ff;
  --purple-glass: rgba(168, 85, 247, 0.22);
  --emerald: #34d399;
  --emerald-bright: #6ee7b7;
  --pink: #f472b6;
  --bg: #050814;
  --bg-2: #0b1020;
  --elevated: #0f172a;
  --text: #ffffff;
  --muted: #9ca3af;
  --line: rgba(255, 255, 255, 0.1);
  --radius: 16px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --font: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  overflow-x: hidden;
  max-width: 100%;
}
body.phone { width: 100%; touch-action: manipulation; }
body { min-height: 100vh; min-height: 100dvh; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font-family: inherit; }
:focus-visible { outline: 3px solid var(--purple); outline-offset: 3px; }

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

.dock { display: none; }

.plan-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}
.plan-modal[hidden] { display: none; }
.plan-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(10px);
}
.plan-card {
  position: relative;
  width: min(440px, 100%);
  padding: 36px 28px 28px;
  border-radius: 28px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(30, 16, 48, 0.96), rgba(8, 10, 22, 0.96));
  border: 1px solid rgba(168, 85, 247, 0.45);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}
.plan-card img {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  margin: 0 auto 14px;
  object-fit: cover;
  box-shadow: 0 10px 30px rgba(168, 85, 247, 0.35);
}
.plan-card h2 {
  margin: 6px 0 8px;
  font-size: 32px;
  letter-spacing: -0.04em;
}
.plan-card p { color: #d1d5db; line-height: 1.5; }
.plan-card input {
  width: 100%;
  margin: 0 0 12px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: white;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}
.plan-bot, .plan-card .btn { width: 100%; justify-content: center; margin-top: 16px; }
.plan-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin: 18px 0 14px;
  color: #9ca3af;
  font-size: 13px;
}
.plan-or::before, .plan-or::after {
  content: "";
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
}
.plan-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: white;
  cursor: pointer;
}
.apk-update { display: none; }
body.apk .apk-update {
  display: inline-flex;
  align-items: center;
  margin-left: auto;
  border: 1px solid rgba(168, 85, 247, 0.7);
  background: #a855f7;
  color: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
body.apk .plan-chip { margin-left: 0; }

.plan-chip {
  margin-left: auto;
  border: 1px solid rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.16);
  color: white;
  border-radius: 999px;
  padding: 8px 14px;
  font-weight: 700;
  cursor: pointer;
}
.plan-chip.is-on {
  background: rgba(16, 185, 129, 0.16);
  border-color: rgba(16, 185, 129, 0.45);
}
.access-error { min-height: 1.2em; margin-top: 10px; color: #fda4af; font-size: 14px; }

.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 14px 32px;
  background: linear-gradient(180deg, rgba(5, 8, 20, 0.92), rgba(5, 8, 20, 0.35) 80%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}
.brand img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.35), 0 8px 20px rgba(168, 85, 247, 0.25);
}
.brand strong { display: block; font-size: 16px; letter-spacing: -0.02em; }
.brand small { color: var(--muted); font-size: 11px; }

.nav-links {
  display: flex;
  gap: 8px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
}
.nav-links a {
  padding: 8px 16px;
  border-radius: 999px;
  color: #e5e7eb;
  font-size: 14px;
  font-weight: 500;
}
.nav-links a.active,
.nav-links a:hover {
  background: var(--purple-glass);
  color: var(--purple-soft);
}

.search { margin-left: auto; }
.search input {
  width: min(340px, 32vw);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: white;
  border-radius: 999px;
  padding: 10px 16px;
  font-size: 14px;
}
.search input::placeholder { color: #6b7280; }

.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: #000 center/cover no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 8, 20, 0.15) 0%, rgba(5, 8, 20, 0.2) 40%, var(--bg) 96%),
    linear-gradient(90deg, rgba(5, 8, 20, 0.82) 0%, rgba(5, 8, 20, 0.25) 55%, transparent 80%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 48px 56px;
  max-width: 720px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--emerald-bright);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(40px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -0.04em;
}
.hero p {
  color: #d1d5db;
  line-height: 1.6;
  max-width: 58ch;
  margin: 0 0 22px;
}
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #e5e7eb;
  font-size: 12px;
}
.pill.accent { background: var(--purple-glass); color: var(--purple-soft); }
.pill.green { background: rgba(52, 211, 153, 0.16); color: var(--emerald-bright); }

.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 13px 22px;
  font-weight: 700;
  font-size: 15px;
}
.btn-primary { background: var(--purple); color: white; box-shadow: 0 10px 30px rgba(168, 85, 247, 0.35); }
.btn-primary:hover { background: #9333ea; }
.btn-ghost { background: rgba(255, 255, 255, 0.1); color: white; }
.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.btn-green { background: var(--emerald); color: #042f1e; }

.page { padding: 8px 0 80px; }
.row { margin: 10px 0 28px; }
.row-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 0 48px 12px;
}
.row-head h2 { margin: 0; font-size: 22px; letter-spacing: -0.03em; }
.row-link {
  display: inline-flex;
  align-items: baseline;
  gap: 12px;
  color: inherit;
}
.row-link span {
  font-size: 13px;
  font-weight: 600;
  color: #c4b5fd;
  opacity: 0.75;
}
.row-link:hover h2 { color: #f3e8ff; }
.row-track {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 6px 48px 18px;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
.row-track::-webkit-scrollbar { height: 6px; }
.row-track::-webkit-scrollbar-thumb { background: rgba(168, 85, 247, 0.45); border-radius: 99px; }

.poster {
  flex: 0 0 176px;
  scroll-snap-align: start;
  border-radius: 14px;
  overflow: hidden;
  background: var(--elevated);
  transition: transform 180ms ease, box-shadow 180ms ease;
  position: relative;
}
.poster:hover, .poster:focus-visible {
  transform: translateY(-8px) scale(1.03);
  box-shadow: 0 18px 40px rgba(168, 85, 247, 0.28);
}
.poster img { aspect-ratio: 2/3; object-fit: cover; width: 100%; background: #111827; }
.poster .meta {
  position: absolute;
  inset: auto 0 0;
  padding: 28px 10px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.88));
  font-size: 13px;
  font-weight: 600;
}
.poster .score {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(5, 8, 20, 0.75);
  color: var(--emerald-bright);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  padding: 8px 48px 40px;
}
.grid .poster { flex: none; width: auto; }

.section-title { padding: 28px 48px 4px; }
.section-title h1 { margin: 0; font-size: 36px; letter-spacing: -0.04em; }
.section-title p { color: var(--muted); }

.category-hero {
  min-height: 38vh;
  padding: 110px 48px 36px;
  background: #050814 center/cover no-repeat;
  position: relative;
}
.category-hero-inner { max-width: 820px; }
.category-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(36px, 6vw, 64px);
  letter-spacing: -0.05em;
  line-height: 0.95;
}
.category-count { color: #c4b5fd; font-weight: 600; margin: 0; }
.back-link {
  display: inline-flex;
  margin-bottom: 14px;
  color: #e9d5ff;
  font-weight: 600;
  font-size: 14px;
}
.back-link:hover { color: white; }
.category-grid .poster { border-radius: 16px; }

.detail {
  position: relative;
  min-height: 70vh;
  padding: 120px 48px 40px;
  background: #000 center/cover no-repeat;
}
.detail::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(5,8,20,0.92) 0%, rgba(5,8,20,0.72) 48%, rgba(5,8,20,0.35) 100%),
              linear-gradient(180deg, rgba(5,8,20,0.2), var(--bg) 96%);
}
.detail-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  max-width: 1180px;
}
.detail-poster {
  border-radius: 18px;
  box-shadow: var(--shadow);
  width: 240px;
}
.detail h1 { margin: 0 0 10px; font-size: clamp(32px, 4vw, 52px); letter-spacing: -0.04em; }
.overview { color: #d1d5db; line-height: 1.7; max-width: 68ch; }

.cast { padding: 10px 48px 40px; }
.cast-list { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 10px; }
.cast-card { flex: 0 0 96px; text-align: center; }
.cast-card img {
  width: 76px; height: 76px; border-radius: 50%; object-fit: cover;
  margin: 0 auto 8px; background: #1f2937; border: 2px solid rgba(168,85,247,0.35);
}
.cast-card .name { font-size: 13px; font-weight: 600; }
.cast-card .role { font-size: 12px; color: var(--muted); }

.episodes { padding: 8px 48px 60px; position: relative; z-index: 2; background: var(--bg); }
.episode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--line);
  margin-bottom: 10px;
}
.episode:hover { border-color: rgba(168,85,247,0.5); background: var(--purple-glass); }
.episode-main { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.season-title { margin: 22px 0 12px; font-size: 18px; letter-spacing: -0.03em; }
.audio-flag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.16);
  font-size: 13px;
  font-weight: 600;
}

.iptv, .empty, .status-card {
  margin: 28px 48px;
  padding: 28px;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(168,85,247,0.12), rgba(15,23,42,0.7));
  border: 1px solid rgba(168,85,247,0.25);
}
.iptv code, .status-card code {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #020617;
  color: var(--emerald-bright);
  overflow-x: auto;
}
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 18px 0 0;
}
.stat {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
}
.stat b { display: block; font-size: 26px; }
.stat span { color: var(--muted); font-size: 12px; }

.site-footer {
  padding: 28px 48px 40px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.site-footer img { width: 36px; height: 36px; border-radius: 10px; float: left; margin-right: 10px; }

.player-layer {
  position: fixed;
  inset: 0;
  background: #02010a;
  z-index: 80;
  display: flex;
  flex-direction: column;
}
.player-layer.hidden { display: none; }
.player-layer video {
  width: 100%;
  height: 100%;
  background: transparent;
  position: absolute;
  inset: 0;
  z-index: 1;
}
.player-layer:not(.is-ready) video {
  inset: auto !important;
  width: 1px !important;
  height: 1px !important;
  left: -200vw !important;
  top: 0 !important;
  right: auto !important;
  bottom: auto !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.player-layer video::-webkit-media-controls { display: none !important; }

.player-backdrop {
  position: absolute;
  inset: -24px;
  background: #0b0618 url("/assets/theater.jpg") center/cover no-repeat;
  filter: blur(28px) saturate(1.25);
  transform: scale(1.12);
  z-index: 0;
  animation: backdrop-drift 14s ease-in-out infinite alternate;
}
.player-layer:not(.is-ready) .player-backdrop {
  z-index: 2;
  opacity: 1;
}
.player-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(88, 28, 135, 0.28), rgba(2, 1, 10, 0.76) 62%),
    linear-gradient(180deg, rgba(2, 1, 10, 0.25), rgba(2, 1, 10, 0.8));
}
.player-layer.is-ready .player-backdrop {
  opacity: 0.35;
  filter: blur(40px) saturate(1.05);
  transition: opacity 400ms ease, filter 400ms ease;
}

.player-loader {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 20px;
  pointer-events: none;
}
.player-layer.is-ready:not(.is-buffering) .player-loader { display: none; }
.player-layer.is-ready.is-buffering .player-loader-title,
.player-layer.is-ready.is-buffering .player-loader-sub { display: none; }
.player-layer.is-ready.is-buffering .spinner { width: 42px; height: 42px; }
.spinner {
  width: 78px;
  height: 78px;
  position: relative;
  border-radius: 50%;
  border: 3px solid rgba(168, 85, 247, 0.2);
  border-top-color: #f3e8ff;
  border-right-color: #a855f7;
  box-shadow: 0 0 0 8px rgba(168, 85, 247, 0.1), 0 0 42px rgba(168, 85, 247, 0.55);
  animation: spin 0.7s linear infinite;
}
.spinner span,
.spinner::before {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-bottom-color: #c084fc;
  border-left-color: #7c3aed;
  animation: spin 1.15s linear infinite reverse;
}
.spinner span {
  inset: 22px;
  border-width: 2px;
  border-color: transparent;
  border-top-color: #e9d5ff;
  animation-duration: 0.85s;
  animation-direction: normal;
}
.player-loader-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.player-loader-sub { margin: 0; color: #c4b5fd; font-size: 13px; letter-spacing: 0.04em; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes backdrop-drift {
  from { transform: scale(1.08); }
  to { transform: scale(1.16); }
}

.player-close,
.player-chrome,
.player-bar {
  transition: opacity 220ms ease;
}
.player-layer.is-ready.is-chrome-hidden .player-close,
.player-layer.is-ready.is-chrome-hidden .player-chrome,
.player-layer.is-ready.is-chrome-hidden .player-bar {
  opacity: 0;
  pointer-events: none;
}
.player-close {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 4;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(5, 8, 20, 0.45);
  backdrop-filter: blur(10px);
  color: white;
  cursor: pointer;
  font-size: 18px;
}
.player-close:hover { background: rgba(168, 85, 247, 0.35); }
.player-chrome {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 18px;
  z-index: 8;
  color: #ede9fe;
  font-weight: 600;
  text-shadow: 0 2px 10px #000;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 12px;
  pointer-events: none;
}
.player-title {
  position: absolute;
  left: 72px;
  right: 140px;
  top: 12px;
  max-width: none;
  pointer-events: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player-tools,
.player-tools[hidden] {
  display: flex !important;
  gap: 10px;
  pointer-events: auto;
  flex-shrink: 0;
  z-index: 6;
}
#sub-picker,
#sub-picker[hidden] {
  display: block !important;
}
.track-picker { position: relative; }
.track-btn {
  min-width: 46px;
  height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(5, 8, 20, 0.5);
  backdrop-filter: blur(10px);
  color: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.track-btn:hover, .track-btn.is-open {
  background: rgba(168, 85, 247, 0.4);
  border-color: rgba(232, 213, 255, 0.4);
}
.track-menu {
  position: absolute;
  top: 54px;
  right: 0;
  width: min(320px, 78vw);
  max-height: min(62vh, calc(100dvh - 150px));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  z-index: 9;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(10, 6, 24, 0.96);
  box-shadow: var(--shadow);
}
.track-option:focus {
  outline: 3px solid #e9d5ff;
  outline-offset: 1px;
}
.track-empty {
  margin: 4px 12px 10px;
  color: #c4b5fd;
  font-size: 13px;
  line-height: 1.4;
}
.track-menu h4 {
  margin: 4px 10px 8px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c4b5fd;
}
.track-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: white;
  cursor: pointer;
  text-align: left;
  font-size: 14px;
}
.track-option:hover { background: rgba(168, 85, 247, 0.22); }
.track-option.is-active {
  background: rgba(168, 85, 247, 0.32);
  box-shadow: inset 0 0 0 1px rgba(192, 132, 252, 0.45);
}
.track-option small { color: #c4b5fd; font-size: 11px; }
.track-option:disabled { opacity: 0.45; cursor: not-allowed; }
.player-bar {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(8, 5, 20, 0.62);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
  pointer-events: auto;
}
.player-layer:not(.is-ready) .player-bar { opacity: 0.35; }
.bar-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.28);
  color: white;
  cursor: pointer;
  font-size: 14px;
}
.bar-btn:hover { background: rgba(168, 85, 247, 0.5); }
.bar-time {
  min-width: 46px;
  font-size: 12px;
  font-weight: 600;
  color: #ede9fe;
  font-variant-numeric: tabular-nums;
}
.bar-seek {
  flex: 1;
  appearance: none;
  height: 5px;
  border-radius: 99px;
  background: rgba(255,255,255,0.18);
  outline: none;
  cursor: pointer;
}
.bar-seek::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #c084fc;
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.25);
}
.subtitle-cue {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 92px;
  z-index: 20;
  text-align: center;
  font-size: clamp(18px, 2.4vw, 32px);
  font-weight: 700;
  line-height: 1.35;
  color: #fff;
  text-shadow: 0 2px 2px #000, 0 0 14px rgba(0,0,0,0.9);
  -webkit-text-stroke: 0.4px rgba(0,0,0,0.65);
  white-space: pre-wrap;
  pointer-events: none;
}
.subtitle-cue.is-loading {
  font-size: 14px;
  font-weight: 600;
  color: #c4b5fd;
  -webkit-text-stroke: 0;
  text-shadow: none;
}
.subtitle-cue:empty { display: none; }

.app-usage {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
  max-width: 440px;
}
.app-usage div {
  background: rgba(8, 6, 20, 0.62);
  border: 1px solid rgba(168, 85, 247, 0.38);
  border-radius: 16px;
  padding: 12px 12px 10px;
}
.app-usage b {
  display: block;
  color: white;
  font-size: 22px;
  line-height: 1;
  font-weight: 800;
}
.app-usage span {
  display: block;
  margin-top: 6px;
  color: #c4b5fd;
  font-size: 12px;
  font-weight: 600;
}
.skeleton {
  background: linear-gradient(90deg, #111827, #1f2937, #111827);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 14px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

@media (max-width: 820px) {
  .nav {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-top));
    padding-top: calc(10px + env(safe-area-inset-top));
  }
  .brand { min-width: 0; flex: 1; }
  .plan-chip { margin-left: 0; }
  body.apk .apk-update { margin-left: auto; }
  .brand small { display: none; }
  .nav-links { display: none; }
  .search, .search input { width: 100%; margin-left: 0; }
  .search input { font-size: 16px; }
  .hero { min-height: 62vh; }
  .hero h1 { font-size: clamp(32px, 11vw, 48px); }
  .hero-content { padding: 0 16px 28px; }
  .actions .btn { flex: 1 1 140px; justify-content: center; }
  .row-head, .row-track, .section-title, .cast, .episodes, .grid, .site-footer, .iptv, .empty, .status-card, .category-hero {
    padding-left: 16px;
    padding-right: 16px;
  }
  .row-head { padding-bottom: 8px; }
  .row-head h2 { font-size: 18px; }
  .row-track { gap: 10px; padding-top: 4px; padding-bottom: 12px; -webkit-overflow-scrolling: touch; }
  .poster { flex-basis: 132px; border-radius: 12px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 10px; padding-bottom: 28px; }
  .detail { padding: 88px 16px 24px; }
  .detail-inner { grid-template-columns: 1fr; }
  .detail-poster { width: 140px; }
  .section-title h1 { font-size: 28px; }
  .category-hero { padding: 88px 16px 28px; min-height: 28vh; }
  .page { padding-bottom: 28px; }
  .site-footer { padding-bottom: 28px; }
  body:not(.tv) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }
  body:not(.tv) .dock {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    justify-content: space-around;
    gap: 4px;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
    background: rgba(5, 8, 20, 0.92);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(18px);
  }
  .dock a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: #9ca3af;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
    padding: 6px 4px;
    border-radius: 12px;
  }
  .dock a svg { width: 22px; height: 22px; }
  .dock a.active, .dock a:hover {
    color: var(--purple-soft);
    background: var(--purple-glass);
  }
  .player-close {
    top: calc(12px + env(safe-area-inset-top));
    left: 12px;
  }
  .player-chrome {
    top: calc(12px + env(safe-area-inset-top));
    left: 64px;
  }
  .player-bar {
    left: 10px;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 8px 10px;
    gap: 8px;
  }
  .bar-btn { width: 44px; height: 44px; }
  .bar-seek::-webkit-slider-thumb { width: 20px; height: 20px; }
  .subtitle-cue {
    left: 6%;
    right: 6%;
    bottom: calc(86px + env(safe-area-inset-bottom));
    font-size: clamp(16px, 4.6vw, 24px);
  }
  .player-title { right: 128px; max-width: none; font-size: 13px; }
  .player-tools { gap: 8px; }
  .track-btn { min-width: 52px; height: 44px; font-size: 14px; }
}

@media (hover: none) {
  .poster:hover, .poster:focus-visible { transform: none; box-shadow: none; }
}

@media (display-mode: standalone) {
  .nav { padding-top: calc(12px + env(safe-area-inset-top)); }
}

/* Modo TV: focos grandes, sin hover */
body.tv .nav { padding: 22px 48px; }
body.tv .nav-links a, body.tv .btn, body.tv .poster, body.tv .episode, body.tv .search input {
  transition: box-shadow 120ms ease, transform 120ms ease;
}
body.tv .poster { flex-basis: 210px; }
body.tv .dock { display: none !important; }
body.tv .nav-links a:focus, body.tv .btn:focus, body.tv .poster:focus, body.tv .episode:focus, body.tv .plan-chip:focus, body.tv input:focus {
  outline: 4px solid var(--purple);
  outline-offset: 4px;
  transform: scale(1.04);
}
