/* style.css — ZET Player Tizen TV UI.
 * Authored on a 1920x1080 grid, scaled to fit ANY panel (720p -> 4K) via the
 * #stage transform (scale set in js/app.js). No external fonts (instant startup
 * on TVs). Large hit targets + clear focus ring for 10-foot D-pad navigation.
 */

:root {
  --ink: #0c0b1d;
  --ink-2: #11102a;
  --panel: rgba(24, 23, 48, 0.96);
  --panel-2: #1a193a;
  --line: #2e2b55;
  --text: #eeeeff;
  --muted: #7e7ea8;
  --signal: #7c6ff0;
  --signal-2: #9d94f5;
  --live: #ff3b3b;
  --ok: #34d399;
  --danger: #ff5c5c;
  --focus: #7c6ff0;
  --scale: 1;
}

/* Hide all scrollbars globally — scrolling still works, just invisible */
::-webkit-scrollbar { display: none; }
* { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: none; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: var(--ink); color: var(--text);
  font-family: "Samsung One", "Tizen Sans", Arial, sans-serif;
  font-size: 26px; user-select: none; cursor: none;
}

#stage {
  position: fixed; top: 50%; left: 50%;
  width: 1920px; height: 1080px;
  transform: translate(-50%, -50%) scale(var(--scale));
  transform-origin: center center;
  z-index: 5;
  background: transparent; /* explicit transparent prevents Tizen compositor from using an opaque default for the transformed layer */
}

#video { position: fixed; inset: 0; width: 100%; height: 100%; background: #000; object-fit: contain; z-index: 0; }

.screen { position: fixed; inset: 0; z-index: 10; display: none; }
.screen.active { display: block; }

/* ---------- Focus ring (shared) ---------- */
.focusable { transition: transform .08s ease, box-shadow .08s ease, background .08s ease; }
.focusable.focused {
  outline: none;
  box-shadow: 0 0 0 4px var(--focus), 0 10px 40px rgba(0,0,0,.55);
  transform: scale(1.03);
  background: rgba(124,111,240,0.14);
}
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  padding: 18px 40px; border-radius: 999px; border: 2px solid var(--signal);
  background: var(--signal); color: #f0eeff; font-size: 26px; font-weight: 700; cursor: none;
}
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }

/* ---------- Status screens (expired / no playlist) ---------- */
.center-screen { background: radial-gradient(1400px 800px at 70% -10%, rgba(124,111,240,.14), transparent 60%), var(--ink); }
.status-wrap { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); text-align: center; width: 1200px; }
.logo-xl { font-size: 48px; font-weight: 800; letter-spacing: 5px; margin-bottom: 22px; }
.logo-xl span { color: var(--signal); }
.status-wrap h1 { font-size: 40px; font-weight: 700; margin: 10px 0 14px; }
.status-wrap p { color: var(--muted); font-size: 27px; margin: 6px 0; }
.status-badge {
  display: inline-block; padding: 8px 22px; border-radius: 999px; font-size: 22px;
  font-weight: 700; letter-spacing: 2px; background: rgba(124,111,240,.18);
  color: var(--signal); border: 1px solid var(--signal); margin-bottom: 18px;
}
.status-badge.danger { background: rgba(255,92,92,.14); color: var(--danger); border-color: var(--danger); }
.activation-url {
  font-size: 40px; font-weight: 800; color: var(--signal); margin: 18px auto;
  background: var(--panel-2); border: 2px solid var(--line); border-radius: 16px;
  padding: 22px 36px; display: inline-block; letter-spacing: 1px;
}
.device-id {
  margin: 28px auto; font-size: 64px; font-weight: 800; letter-spacing: 6px;
  color: var(--text); background: var(--panel-2); border: 2px solid var(--line);
  border-radius: 18px; padding: 24px 40px; display: inline-block;
}
.pair-url { color: var(--text); font-size: 30px; }
.pair-url b { color: var(--signal); }
.actions { margin-top: 36px; display: flex; gap: 20px; justify-content: center; }

/* ---------- HOME hub ---------- */
#home { background: radial-gradient(1200px 700px at 80% -5%, rgba(124,111,240,.12), transparent 55%), var(--ink); padding: 48px 70px; }
.home-top { display: flex; align-items: center; justify-content: space-between; }
.home-top .logo { font-size: 40px; font-weight: 800; letter-spacing: 4px; }
.home-top .logo span { color: var(--signal); }
.home-top-right { display: flex; align-items: center; gap: 32px; }
.clock { text-align: right; }
.clock .time { font-size: 40px; font-weight: 800; line-height: 1; }
.clock .date { font-size: 22px; color: var(--muted); margin-top: 4px; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 12px; font-size: 25px;
  padding: 16px 28px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel-2);
}
.acct-btn .ico { color: var(--signal); font-size: 28px; }
.privacy-btn {
  display: inline-flex; align-items: center; gap: 10px; font-size: 23px;
  padding: 14px 24px; border-radius: 14px; border: 2px solid var(--line); background: var(--panel-2);
  color: var(--muted); transition: border-color .15s, color .15s, background .15s, box-shadow .15s;
}
.privacy-btn.on { border-color: #4caf50; color: #4caf50; background: rgba(76,175,80,0.15); }
.privacy-btn.focused { border-color: var(--signal); color: #fff; box-shadow: 0 0 0 3px var(--signal), 0 0 14px 2px rgba(124,111,240,0.5); }
.privacy-btn.on.focused { border-color: #4caf50; box-shadow: 0 0 0 3px #4caf50, 0 0 14px 2px rgba(76,175,80,0.5); }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 32px; }
.tile {
  background: linear-gradient(160deg, var(--panel-2), var(--ink-2));
  border: 1px solid var(--line); border-radius: 22px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
}
.tile.big { height: 290px; }
.tiles.secondary { margin-top: 24px; }
.tiles.secondary .tile { height: 160px; }
.tile-ico { font-size: 84px; color: var(--signal); line-height: 1; }
.tiles.secondary .tile-ico { font-size: 54px; }
.tile-label { font-size: 32px; font-weight: 700; }
.tiles.secondary .tile-label { font-size: 26px; }

/* Recently Added Movies row */
.home-recent { margin-top: 24px; }
.home-recent-title { font-size: 24px; font-weight: 700; color: var(--muted); margin-bottom: 12px; letter-spacing: 1px; text-transform: uppercase; }
.home-recent-row { display: flex; gap: 14px; overflow-x: auto; padding: 10px 4px; }
.recent-card { flex: none; width: 150px; }
.recent-poster {
  width: 150px; height: 225px; border-radius: 10px; overflow: hidden;
  background: var(--panel-2); border: 1px solid var(--line); position: relative;
}
.recent-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recent-noposter { font-size: 38px; color: var(--line); display: flex; align-items: center; justify-content: center; height: 100%; }
.recent-card-label {
  margin-top: 7px; font-size: 18px; color: var(--muted);
  white-space: nowrap; overflow: hidden;
}
.recent-card-label span { display: inline-block; white-space: nowrap; }
.recent-card-label.vcard-marquee span { animation: vcard-marquee-anim 7s ease-in-out infinite; }
.recent-card.focusable.focused .recent-poster {
  box-shadow: 0 0 0 3px var(--focus), 0 8px 24px rgba(0,0,0,.5);
  transform: scale(1.04);
}
/* Override default focusable transform on the card wrapper */
.recent-card.focusable.focused { transform: none; box-shadow: none; background: transparent; }

/* ---------- LIVE TV Screen ---------- */
#live {
  background: transparent;  /* panels carry their own bg; preview area is transparent for AVPlay */
  display: none;
  flex-direction: column;
}
#live.active { display: flex; }

.ltv-top {
  height: 68px; flex: none;
  background: rgba(11, 10, 26, 0.98);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; padding: 0 24px; gap: 0;
}
.ltv-cat-info {
  display: flex; align-items: center; gap: 12px;
  font-size: 27px; font-weight: 700; min-width: 320px;
}
.ltv-cat-ico { color: var(--signal); font-size: 22px; }
.ltv-hints {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 30px; font-size: 21px; color: var(--muted);
}
.dot-r { color: #ff4444; }
.dot-g { color: #44cc44; }
.dot-y { color: #ddcc00; }
.dot-b { color: #4488ff; }
.ltv-time { font-size: 30px; font-weight: 800; min-width: 100px; text-align: right; }

.ltv-body { flex: 1; display: flex; overflow: hidden; }

/* Left: channel list */
.ltv-ch-col {
  width: 820px; flex: none;
  background: rgba(11, 10, 26, 0.97);
  border-right: 1px solid var(--line);
  overflow-y: auto; display: flex; flex-direction: column;
}
.ltv-ch-item {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(46, 43, 85, 0.45);
  min-height: 84px; cursor: none; position: relative;
  transition: background .08s;
}
.ltv-ch-item.ltv-ch-selected {
  background: #f0eeff;
}
.ltv-ch-item.ltv-ch-selected .ltv-ch-num  { color: #2a1a8e; }
.ltv-ch-item.ltv-ch-selected .ltv-ch-name { color: var(--signal); font-weight: 800; }
.ltv-ch-item.ltv-ch-selected.focused { transform: none; background: #e4dfff; }
.ltv-ch-rec {
  position: absolute; top: 7px; right: 10px;
  background: #cc1111; color: #fff; font-size: 16px; font-weight: 800;
  padding: 2px 9px; border-radius: 5px; letter-spacing: 1px;
}
.ltv-ch-num {
  font-size: 24px; color: var(--signal); font-weight: 800;
  width: 46px; flex: none; text-align: center;
}
.ltv-ch-logo {
  width: 60px; height: 44px; object-fit: contain;
  background: rgba(0,0,0,0.4); border-radius: 6px; flex: none;
}
.ltv-ch-name {
  flex: 1; font-size: 26px; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ltv-ch-fav { color: var(--signal); flex: none; font-size: 18px; }
.ltv-ch-item.focusable.focused { transform: none; background: rgba(124,111,240,0.18); }

/* Center: video preview + EPG */
.ltv-main {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
  /* no background — the transparent area lets AVPlay show through the preview rect */
}

.ltv-preview {
  /* fills full width of center col (960px); 540px = 960×9/16 → exact 16:9, no side bars */
  height: 540px; width: 100%; flex: none;
  background: transparent;        /* AVPlay shows through here */
  position: relative;
}
.ltv-preview-info {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px; flex: none;
  background: rgba(13, 12, 32, 0.98);
  border-bottom: 1px solid rgba(46, 43, 85, 0.5);
}
.ltv-pi-num  { font-size: 24px; font-weight: 800; color: var(--signal); width: 44px; flex: none; text-align: center; }
.ltv-pi-logo { width: 56px; height: 38px; object-fit: contain; background: rgba(0,0,0,0.4); border-radius: 5px; flex: none; }
.ltv-pi-name { font-size: 24px; font-weight: 800; flex: none; max-width: 400px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltv-pi-prog { flex: 1; text-align: right; font-size: 21px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ltv-preview-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: flex-start; justify-content: flex-end;
  padding: 18px 22px;
  background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, transparent 45%);
  pointer-events: none;
}
.ltv-preview-name { font-size: 30px; font-weight: 800; text-shadow: 0 2px 8px rgba(0,0,0,.9); }
.ltv-preview-hint { font-size: 19px; color: var(--muted); margin-top: 3px; }

.ltv-epg-header { display: none; }
.ltv-epg-list {
  flex: 1; overflow-y: auto;
  background: rgba(11, 10, 26, 0.97);
  display: flex; flex-direction: column;
}
.ltv-epg-entry {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 18px;
  border-bottom: 1px solid rgba(46, 43, 85, 0.35);
  min-height: 58px; cursor: none;
}
.ltv-epg-entry.epg-current { background: rgba(124, 111, 240, 0.09); }
.ltv-epg-entry.epg-past { opacity: 0.65; }
.ltv-epg-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--muted); flex: none;
}
.ltv-epg-entry.epg-current .ltv-epg-dot { background: var(--ok); box-shadow: 0 0 6px var(--ok); }
.ltv-epg-entry.epg-past .ltv-epg-dot { background: #2e2b55; }
.ltv-epg-time {
  font-size: 19px; color: var(--muted); flex: none;
  margin-left: auto; text-align: right; white-space: nowrap;
}
.ltv-epg-entry.epg-current .ltv-epg-time { color: var(--text); font-weight: 700; }
.ltv-epg-title {
  flex: 1; font-size: 22px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ltv-epg-entry.epg-current .ltv-epg-title { color: var(--signal); }
.ltv-epg-replay {
  font-size: 17px; padding: 3px 10px; border-radius: 7px;
  border: 1px solid var(--ok); color: var(--ok); flex: none; display: none;
}
.ltv-epg-entry.epg-catchup .ltv-epg-replay { display: block; }
.ltv-epg-entry.focusable.focused { transform: none; background: rgba(124,111,240,0.16); }

/* Right: date picker */
.ltv-date-col {
  width: 140px; flex: none;
  background: rgba(11, 10, 26, 0.97);
  border-left: 1px solid var(--line);
  overflow-y: auto; display: flex; flex-direction: column; align-items: center;
  padding: 6px 0;
}
.ltv-date-item {
  width: 100%; padding: 14px 0; min-height: 88px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: none; border-bottom: 1px solid rgba(46, 43, 85, 0.3);
}
.ltv-date-item.date-today { background: rgba(124, 111, 240, 0.10); }
.ltv-date-item.date-selected {
  background: rgba(124, 111, 240, 0.22);
  border: 2px solid var(--signal); border-radius: 10px;
  margin: 2px 8px; width: calc(100% - 16px);
}
.ltv-date-num { font-size: 26px; font-weight: 800; }
.ltv-date-item.date-today .ltv-date-num { color: var(--signal); }
.ltv-date-wday { font-size: 17px; color: var(--muted); }
.ltv-date-item.focusable.focused { transform: none; background: rgba(124,111,240,0.22); }

/* Category overlay */
.ltv-cat-overlay {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 50; padding-top: 68px;
}
.ltv-cat-panel {
  width: 380px; height: calc(1080px - 68px);
  background: rgba(13, 12, 30, 0.99);
  border-right: 2px solid var(--signal);
  overflow-y: auto; display: flex; flex-direction: column;
}
.ltv-cat-row {
  padding: 19px 24px; font-size: 24px;
  border-bottom: 1px solid var(--line); cursor: none;
}
.ltv-cat-row.active { color: var(--signal); font-weight: 700; }
.ltv-cat-row.focusable.focused { background: rgba(124,111,240,0.18); color: var(--text); }

/* ---------- BROWSE (categories + vertical list) ---------- */
#browse, #playlists, #account { background: var(--ink); padding: 44px 60px; }
.browse-top, .account-body, .pl-list { max-width: 1800px; }
.browse-top { display: flex; align-items: center; gap: 26px; margin-bottom: 26px; }
.browse-top h2 { font-size: 38px; font-weight: 700; }
.browse-hint { margin-left: auto; color: var(--muted); font-size: 22px; }
.back-chip {
  display: inline-flex; align-items: center; gap: 10px; font-size: 24px;
  padding: 12px 24px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2);
}
.back-chip span { color: var(--signal); font-size: 28px; }

.browse-body { display: grid; grid-template-columns: 420px 1fr; gap: 30px; height: 880px; }
.browse-body.no-cats { grid-template-columns: 1fr; }
.cat-col { display: flex; flex-direction: column; gap: 12px; padding: 10px 12px; overflow-y: auto; scrollbar-width: none; }
.cat {
  padding: 22px 26px; border-radius: 14px; font-size: 26px; color: var(--muted);
  background: var(--panel-2); border: 1px solid var(--line);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
  min-height: 76px;
}
.cat.active { color: var(--text); border-color: var(--signal); }
.cat.focusable.focused { transform: none; }

.list-col { display: flex; flex-direction: column; gap: 12px; padding-right: 8px; }
.vrow {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 18px 26px; display: flex; align-items: center; gap: 22px; min-height: 92px;
}
.vrow .logo { width: 84px; height: 60px; object-fit: contain; background: #000; border-radius: 8px; flex: none; }
.vrow .num { font-size: 26px; color: var(--signal); font-weight: 800; width: 64px; flex: none; text-align: center; }
.vrow .info { flex: 1; overflow: hidden; }
.vrow .name { font-size: 29px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .sub { font-size: 22px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vrow .tags { display: flex; gap: 10px; flex: none; }
.vrow .pill { font-size: 18px; padding: 4px 12px; border-radius: 8px; border: 1px solid var(--line); color: var(--muted); }
.vrow .pill.fav { color: var(--signal); border-color: var(--signal); }
.vrow .pill.arch { color: var(--ok); border-color: var(--ok); }
.empty-note { color: var(--muted); font-size: 26px; padding: 40px; text-align: center; }

/* ---- VOD poster-card grid (Movies / Series) ---- */
.list-col.vod-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
  gap: 16px 14px;
  align-content: start;
  overflow-y: auto;
  padding: 14px;
}
.vcard { display: flex; flex-direction: column; border-radius: 10px; outline: none; }
.vcard-poster {
  width: 100%; aspect-ratio: 2 / 3; border-radius: 10px;
  overflow: hidden; background: var(--panel-2); border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
  position: relative;
}
.vcard-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vcard-noposter { font-size: 48px; color: var(--line); }
.vcard-progress {
  position: absolute; bottom: 0; left: 0; height: 5px;
  background: var(--signal); min-width: 4px; border-radius: 0 0 0 8px;
}
.vcard-title {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 10px 11px;
  background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0) 100%);
  color: rgba(255,255,255,0.88);
  font-size: 18px; font-weight: 600;
  text-align: center; white-space: nowrap; overflow: hidden;
  transition: background .12s ease, color .12s ease;
}
.vcard-title span { display: inline-block; white-space: nowrap; }
.vcard-title.vcard-marquee span { animation: vcard-marquee-anim 7s ease-in-out infinite; }
@keyframes vcard-marquee-anim {
  0%, 25% { transform: translateX(0); }
  75%, 100% { transform: translateX(var(--vcard-marquee-offset, 0px)); }
}
.vcard.focused .vcard-poster {
  border-color: var(--signal);
  box-shadow: 0 0 0 4px var(--signal), 0 0 20px 4px rgba(124,111,240,0.55), 0 8px 28px rgba(0,0,0,.6);
  transform: scale(1.06);
}
.vcard.focused .vcard-title {
  color: #fff; font-weight: 700;
  background: linear-gradient(to top, rgba(0,0,0,0.94) 0%, rgba(0,0,0,0.1) 100%);
  text-shadow: 0 1px 6px rgba(0,0,0,0.9);
}

/* Browse body height shrinks when detail panel opens */
.browse-body { transition: height .2s ease; }
#browse.vod-detail-open .browse-body { height: 600px; }

/* ---- VOD detail panel ---- */
#vodDetail {
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 252px; z-index: 20; overflow: hidden;
  transform: translateY(100%);
  transition: transform .22s ease;
  pointer-events: none;
}
#vodDetail.show { transform: translateY(0); }
.vod-detail-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 25%;
  filter: blur(28px) brightness(0.45); opacity: 0.55;
}
#vodDetail::before {
  content: ''; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top,
    rgba(9,8,22,0.98) 0%,
    rgba(9,8,22,0.88) 45%,
    rgba(9,8,22,0.65) 100%);
}
.vod-detail-body {
  position: relative; z-index: 2;
  display: flex; align-items: flex-start; gap: 26px;
  padding: 20px 60px; height: 100%; box-sizing: border-box;
}
.vod-detail-poster {
  width: 108px; height: 162px; object-fit: cover; flex: none;
  border-radius: 9px; border: 1.5px solid rgba(255,255,255,0.18);
  background: var(--panel-2);
}
.vod-detail-info {
  flex: 1; overflow: hidden; display: flex; flex-direction: column;
  gap: 6px; padding-top: 4px;
}
.vod-detail-title {
  font-size: 32px; font-weight: 800; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vod-detail-meta { font-size: 21px; color: var(--muted); }
.vod-detail-meta .vd-rating { color: #f5c518; margin-left: 12px; }
.vod-detail-plot {
  font-size: 20px; color: rgba(255,255,255,0.56); line-height: 1.5;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.vod-detail-trailer { font-size: 21px; margin-top: 2px; color: var(--muted); }

/* ---- Trailer overlay ---- */
#trailerOverlay {
  position: fixed; inset: 0; z-index: 200;
  background: #000; flex-direction: column;
  display: none;
}
#trailerFrame { flex: 1; width: 100%; height: 100%; border: none; }
.trailer-hint { text-align: center; padding: 14px; font-size: 22px; color: rgba(255,255,255,0.45); flex-shrink: 0; }

/* ===== Detail pages: Movie (#vodPage) + Series (#seriesPage) ===== */
#vodPage, #seriesPage { overflow: hidden; }
.dp-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center 25%;
  filter: brightness(0.38) saturate(0.75);
}
.dp-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(
    108deg,
    rgba(9,8,22,0.99) 0%,
    rgba(9,8,22,0.95) 36%,
    rgba(9,8,22,0.74) 62%,
    rgba(9,8,22,0.18) 100%
  );
}
.dp-inner {
  position: relative; z-index: 2;
  height: 100%; display: flex; flex-direction: column;
  padding: 38px 60px 40px; box-sizing: border-box;
}
.dp-topbar { flex-shrink: 0; margin-bottom: 18px; }
.dp-header  { display: flex; gap: 46px; flex-shrink: 0; }
.dp-poster {
  width: 210px; height: 315px; object-fit: cover; flex: none;
  border-radius: 14px; border: 2px solid rgba(255,255,255,0.18);
  background: var(--panel-2);
}
.dp-info {
  flex: 1; max-width: 870px;
  display: flex; flex-direction: column; padding-top: 6px;
}
.dp-title {
  font-size: 48px; font-weight: 900; color: #fff; line-height: 1.1;
  margin-bottom: 10px;
  overflow: hidden; white-space: nowrap;
}
@keyframes dp-title-marquee {
  0%, 15%   { transform: translateX(0); }
  85%, 100% { transform: translateX(var(--marquee-offset, 0px)); }
}
.dp-title.dp-marquee {
  animation: dp-title-marquee 10s ease-in-out infinite alternate;
}
.dp-meta { font-size: 23px; color: var(--muted); margin-bottom: 16px; }
.dp-plot {
  font-size: 22px; color: rgba(255,255,255,0.62); line-height: 1.65;
  overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  margin-bottom: 26px; flex-shrink: 0;
}
.dp-actions { display: flex; gap: 14px; align-items: center; flex-wrap: nowrap; }
/* --- Buttons --- */
.dp-btn {
  border-radius: 10px; padding: 14px 30px; font-size: 26px; font-weight: 700;
  border: 2px solid transparent; cursor: none;
  display: inline-flex; align-items: center; gap: 10px; white-space: nowrap;
}
.dp-btn-primary { background: var(--signal); color: #fff; border-color: var(--signal); }
.dp-btn-primary.focused {
  background: var(--signal-2); border-color: var(--signal-2);
  box-shadow: 0 0 0 4px rgba(124,111,240,0.4);
}
.dp-btn-secondary {
  background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.28); color: #fff;
}
.dp-btn-secondary.focused { border-color: var(--signal); background: rgba(124,111,240,0.2); }
.dp-btn-icon {
  padding: 13px 20px; font-size: 30px; line-height: 1;
  background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.22); color: rgba(255,255,255,0.75);
}
.dp-btn-icon.focused   { border-color: var(--signal); box-shadow: 0 0 0 3px rgba(124,111,240,0.35); }
.dp-btn-icon.in-watchlist { background: rgba(232,90,106,0.18); border-color: #e85a6a; color: #e85a6a; }
.dp-btn-icon.in-watchlist.focused { border-color: #e85a6a; box-shadow: 0 0 0 3px rgba(232,90,106,0.35); }
.dp-btn-remove {
  font-size: 22px; padding: 14px 22px;
  background: rgba(232,90,106,0.10); border-color: rgba(232,90,106,0.35); color: #e85a6a;
}
.dp-btn-remove.focused { border-color: #e85a6a; background: rgba(232,90,106,0.26); }
/* --- Cast strip (movie page) --- */
.dp-cast-section { margin-top: auto; padding-top: 26px; }
.dp-section-title { font-size: 29px; font-weight: 700; color: rgba(255,255,255,0.82); margin-bottom: 14px; }
.dp-cast-row {
  display: flex; gap: 28px; overflow-x: auto; overflow-y: visible;
  padding: 10px 2px 10px; scrollbar-width: none;
}
.dp-cast-row::-webkit-scrollbar { display: none; }
.dp-cast-card { flex: none; width: 136px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.dp-cast-photo {
  width: 136px; height: 136px; border-radius: 50%; object-fit: cover;
  background: var(--panel-2); border: 3px solid rgba(255,255,255,0.14);
  display: block; flex-shrink: 0;
}
.dp-cast-name { font-size: 20px; font-weight: 600; color: rgba(255,255,255,0.90); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
.dp-cast-char { font-size: 17px; color: var(--muted); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; }
/* --- Seasons (series page) --- */
.dp-seasons { margin-top: 26px; flex: 1; display: flex; flex-direction: column; min-height: 0; }
.dp-season-tabs {
  display: flex; gap: 12px; flex-wrap: nowrap; overflow-x: auto;
  padding: 10px 2px; margin-bottom: 8px; scrollbar-width: none; flex-shrink: 0;
}
.dp-season-tabs::-webkit-scrollbar { display: none; }
.dp-season-tab {
  padding: 10px 28px; border-radius: 26px; font-size: 23px; font-weight: 600;
  color: var(--muted); background: rgba(255,255,255,0.06);
  border: 2px solid rgba(255,255,255,0.14); flex: none; cursor: none; white-space: nowrap;
}
.dp-season-tab.active  { color: #fff; border-color: var(--signal); background: rgba(124,111,240,0.22); }
.dp-season-tab.focused { border-color: var(--signal); color: #fff; background: rgba(124,111,240,0.30); box-shadow: 0 0 0 3px var(--signal), 0 0 14px 2px rgba(124,111,240,0.5); transform: scale(1.05); }
.dp-episodes {
  display: flex; gap: 18px; overflow-x: auto;
  padding: 12px 4px; scrollbar-width: none; flex-shrink: 0; align-items: flex-start;
}
.dp-episodes::-webkit-scrollbar { display: none; }
.dp-ep-card { flex: none; width: 244px; display: flex; flex-direction: column; gap: 8px; cursor: none; }
.dp-ep-thumb {
  width: 244px; height: 137px; border-radius: 10px; overflow: hidden;
  background: var(--panel-2); border: 2px solid rgba(255,255,255,0.10);
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
  display: flex; align-items: center; justify-content: center;
}
.dp-ep-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dp-ep-thumb-placeholder { font-size: 38px; color: var(--line); }
.dp-ep-card.focused .dp-ep-thumb {
  border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--signal), 0 0 16px 3px rgba(124,111,240,0.5), 0 6px 20px rgba(0,0,0,.6);
  transform: scale(1.04);
}
.dp-ep-label { font-size: 21px; font-weight: 700; color: #fff; }
.dp-ep-title { font-size: 17px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Playlists chooser ---------- */
.pl-list { display: flex; flex-direction: column; gap: 16px; height: 900px; overflow-y: auto; }
.pl-card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 30px; display: flex; align-items: center; gap: 24px;
}
.pl-card .pl-ico { font-size: 40px; color: var(--signal); }
.pl-card .pl-meta { flex: 1; }
.pl-card .pl-title { font-size: 30px; font-weight: 700; }
.pl-card .pl-desc { font-size: 22px; color: var(--muted); margin-top: 4px; }
.pl-card .pill { font-size: 20px; padding: 6px 16px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.pl-card.current .pill { color: var(--ok); border-color: var(--ok); }

/* ---------- Account ---------- */
.account-body { display: flex; flex-direction: column; gap: 16px; }
.acct-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.acct-item {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 24px 30px;
}
.acct-item .k { font-size: 21px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.acct-item .v { font-size: 30px; font-weight: 700; margin-top: 8px; }
.acct-item .v.ok { color: var(--ok); }
.acct-item .v.warn { color: var(--signal); }
.acct-item .v.bad { color: var(--danger); }

/* ---------- Settings row + toggle ---------- */
.setting-row {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
  padding: 24px 30px; margin-top: 6px;
}
.setting-row .label { font-size: 27px; }
.setting-row .desc { font-size: 21px; color: var(--muted); margin-top: 4px; max-width: 1200px; }
.toggle { width: 84px; height: 44px; border-radius: 999px; background: var(--line); position: relative; flex: none; }
.toggle.on { background: var(--signal); }
.toggle > i { position: absolute; top: 5px; left: 5px; width: 34px; height: 34px; border-radius: 50%; background: #fff; transition: left .12s; }
.toggle.on > i { left: 45px; }

/* ---------- Player overlay ---------- */
#playerOverlay { position: fixed; inset: 0; z-index: 30; display: none; }
#playerOverlay.show { display: block; }
.infobar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 56px 44px;
  background: linear-gradient(to top, rgba(9,8,22,0.97) 0%, rgba(9,8,22,0.94) 78%, rgba(9,8,22,0.0) 100%);
  display: flex; flex-direction: column;
}
.infobar .live-dot { display:inline-block; width:14px; height:14px; border-radius:50%; background:var(--live); margin-right:12px; vertical-align: middle; }
.infobar .ch-name { font-size: 42px; font-weight: 800; }
.infobar .prog-title { font-size: 30px; margin-top: 8px; }
.infobar .prog-time { color: var(--muted); font-size: 23px; }
.infobar .next { color: var(--muted); font-size: 23px; margin-top: 6px; }
.progress { height: 8px; background: var(--line); border-radius: 4px; margin: 18px 0 6px; overflow: visible; }
.progress > i { display: block; height: 100%; background: var(--signal); width: 0; border-radius: 4px; position: relative; }
.progress-dot { position: absolute; right: -10px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; background: var(--signal-2); border-radius: 50%; box-shadow: 0 0 0 5px rgba(124,111,240,0.28); }
.keyhints { position: absolute; top: 40px; right: 56px; color: var(--muted); font-size: 20px; text-align: right; line-height: 2; }
.keyhints b { color: var(--text); }
.badge { display:inline-block; background: var(--panel-2); border:1px solid var(--line); border-radius:8px; padding:4px 12px; font-size:20px; color: var(--ok); margin-left: 10px; }

/* On-screen player controls bar — now inside .infobar, flows above channel name */
.ctrl-bar {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  margin-bottom: 20px; flex: none;
}
.ctrl-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 16px 30px; border-radius: 14px;
  background: rgba(13, 12, 32, 0.90); border: 1.5px solid rgba(255,255,255,0.12);
  font-size: 24px; font-weight: 600; color: var(--text);
  transition: transform .08s ease, box-shadow .08s ease, background .08s ease;
  cursor: none;
}
.ctrl-btn.focused {
  outline: none;
  background: rgba(124,111,240,0.22); border-color: var(--signal);
  box-shadow: 0 0 0 3px var(--focus), 0 8px 28px rgba(0,0,0,.55);
  transform: scale(1.05);
}

/* ---------- VOD seek bar ---------- */
#vodSeekBar {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 29;
  padding: 56px 64px 44px;
  background: linear-gradient(to top, rgba(9,8,22,0.97) 0%, rgba(9,8,22,0.75) 55%, transparent 100%);
  pointer-events: none;
}
.vsb-title {
  font-size: 34px; font-weight: 700; color: #fff; margin-bottom: 22px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.vsb-row { display: flex; align-items: center; gap: 24px; }
.vsb-ico { font-size: 34px; color: var(--signal-2); flex: none; width: 44px; text-align: center; }
.vsb-time {
  font-size: 30px; font-weight: 700; color: #fff; flex: none; min-width: 110px;
}
.vsb-dur {
  font-size: 24px; color: var(--muted); flex: none; min-width: 110px; text-align: right;
}
.vsb-track {
  flex: 1; height: 5px;
  background: var(--line); border-radius: 3px;
  position: relative; overflow: visible;
}
.vsb-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--signal); border-radius: 3px;
}
.vsb-dot {
  position: absolute; right: -12px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; background: var(--signal-2); border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(124,111,240,0.28);
}

/* ---------- Player EPG overlay — full-screen grid guide ---------- */
#playerEpgOverlay {
  position: absolute; inset: 0; z-index: 35;
  background: rgba(7, 6, 18, 0.98);
  display: none; flex-direction: column;
  /*
   * Punch a transparent hole for the corner player so AVPlay shows through.
   * Corner player: top=20 right=24 width=400 height=225  →  left=1496 bottom=245
   * Hole has 2px margin on all sides (left=1494 top=18 right=1898 bottom=247).
   * Inner path is counterclockwise → nonzero fill-rule creates the hole.
   */
  clip-path: path('M 0 0 L 1920 0 L 1920 1080 L 0 1080 Z M 1494 18 L 1494 247 L 1898 247 L 1898 18 Z');
}

/* Top bar: channel info on the left; right side aligns with the corner-player hole */
.epg-top-bar {
  height: 249px; flex: none;
  display: flex; flex-direction: row; align-items: center;
  background: rgba(9, 8, 22, 0.98);
  border-bottom: 2px solid var(--line);
  padding: 0 24px; gap: 20px;
}
.epg-top-info {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  gap: 6px; overflow: hidden;
}
.epg-top-label   { font-size: 18px; color: var(--signal); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; }
.epg-top-ch-name { font-size: 28px; font-weight: 800; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-top-prog    { font-size: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-corner-spacer { width: 430px; flex: none; } /* reserves space matching corner player */

/* Corner player: direct child of #stage → no opaque ancestors → AVPlay shows through */
#cornerPlayer {
  position: absolute; top: 20px; right: 24px;
  width: 400px; height: 225px;
  z-index: 36; background: transparent;
  border: 2px solid var(--signal); border-radius: 10px;
  display: none;
}

/* Two-column layout: channel list | ruler + programs */
.epg-layout {
  flex: 1; min-height: 0; overflow: hidden;
  display: flex; flex-direction: row;
}

/* ---- Left channel column ---- */
.epg-ch-col {
  width: 260px; flex: none;
  display: flex; flex-direction: column;
  background: rgba(9, 8, 22, 0.98);
  border-right: 2px solid var(--line); z-index: 10;
}
.epg-ch-head {
  height: 54px; flex: none;
  display: flex; align-items: center; padding: 0 20px;
  font-size: 22px; font-weight: 700; color: var(--signal);
  border-bottom: 1px solid var(--line);
}
.epg-ch-scroll { flex: 1; overflow: hidden; }
.epg-ch-item {
  height: 78px; display: flex; align-items: center; gap: 10px;
  padding: 0 12px; border-bottom: 1px solid rgba(46,43,85,0.35); cursor: none;
  transition: background .08s;
}
.epg-ch-item.epg-ch-active {
  background: rgba(124,111,240,0.16);
  border-left: 3px solid var(--signal); padding-left: 9px;
}
.epg-ch-num  { font-size: 17px; color: var(--signal); font-weight: 700; width: 34px; flex: none; text-align: center; }
.epg-ch-logo { width: 50px; height: 34px; object-fit: contain; background: rgba(0,0,0,0.3); border-radius: 4px; flex: none; }
.epg-ch-name { flex: 1; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---- Right: ruler + programs ---- */
.epg-right { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.epg-ruler-wrap {
  height: 54px; flex: none; overflow: hidden;
  background: rgba(9, 8, 22, 0.98);
  border-bottom: 1px solid var(--line);
}
.epg-ruler { height: 54px; position: relative; }
.epg-ruler-slot {
  position: absolute; top: 0; bottom: 0;
  display: flex; align-items: center; padding-left: 10px;
  font-size: 18px; color: var(--muted);
  border-left: 1px solid rgba(46,43,85,0.4); white-space: nowrap;
}
.epg-ruler-now {
  position: absolute; top: 6px; bottom: 6px; width: 2px;
  background: var(--live); border-radius: 1px;
}

/* ---- Program rows ---- */
.epg-progs-wrap { flex: 1; overflow: auto; }
#epgProgRows    { position: relative; }
.epg-prog-row   {
  height: 78px; position: relative;
  border-bottom: 1px solid rgba(46,43,85,0.28);
}
.epg-prog-row.epg-row-active { background: rgba(124,111,240,0.05); }

/* Program blocks (position:absolute within their row) */
.epg-prog {
  position: absolute; top: 6px; bottom: 6px;
  border-radius: 7px; overflow: hidden; padding: 6px 10px;
  background: rgba(26,24,56,0.92);
  border: 1px solid rgba(46,43,85,0.52);
  box-sizing: border-box; cursor: none;
  transition: background .08s, border-color .08s;
}
.epg-prog-title { font-size: 16px; font-weight: 700; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.epg-prog-time  { font-size: 13px; color: var(--muted); display: block; margin-top: 2px; white-space: nowrap; }
.epg-prog.epg-prog-current {
  background: rgba(44,40,100,0.95); border-color: rgba(124,111,240,0.55);
}
.epg-prog.epg-prog-past { opacity: 0.35; }
.epg-prog.epg-prog-loading {
  left: 0 !important; width: 100% !important;
  display: flex; align-items: center;
  color: var(--muted); font-size: 16px;
  background: rgba(14,13,32,0.5); border: none; border-radius: 0;
}
.epg-prog.focusable.focused {
  background: var(--signal) !important;
  border-color: var(--signal-2) !important;
  opacity: 1 !important; transform: none !important;
  box-shadow: 0 0 0 2px var(--signal-2), 0 4px 18px rgba(124,111,240,0.45);
}
.epg-prog.focusable.focused .epg-prog-time { color: rgba(255,255,255,0.8); }

/* Vertical "now" line across all rows */
.epg-now-line {
  position: absolute; top: 0; width: 2px;
  background: var(--live); pointer-events: none; z-index: 4;
}

/* ---------- Subtitle rendered text (bottom-center overlay) ---------- */
#subtitleDisplay {
  position: absolute; bottom: 130px; left: 0; right: 0;
  z-index: 50; text-align: center; pointer-events: none;
  --sub-sz: 36px; --sub-col: #ffffff; --sub-bg: rgba(0,0,0,0.75);
}
#subtitleDisplay span {
  display: inline-block;
  background: var(--sub-bg);
  color: var(--sub-col); font-size: var(--sub-sz); font-weight: 600;
  line-height: 1.45; padding: 6px 22px; border-radius: 6px;
  max-width: 1400px; white-space: pre-wrap;
}

/* ---------- Subtitle / Audio track selection panel (left side, VOD) ---------- */
#subPanel, #audioPanel {
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 380px; z-index: 45;
  background: rgba(9, 8, 22, 0.97);
  border-right: 2px solid var(--line);
  flex-direction: column;
}
.sub-panel-title {
  padding: 28px 24px 18px;
  font-size: 24px; font-weight: 700; color: var(--signal);
  flex: none; border-bottom: 1px solid var(--line);
}
.sub-panel-list { flex: 1; overflow-y: auto; padding: 10px 0; }
.sub-track-item {
  padding: 16px 24px; font-size: 22px; cursor: none;
  display: flex; align-items: center;
  border-bottom: 1px solid rgba(46,43,85,0.35);
}
.sub-track-item.sub-active { color: var(--signal); font-weight: 700; }
.sub-track-item.focused    { background: var(--signal); color: #fff; }
.sub-track-item.sub-active.focused { background: var(--signal); color: #fff; }

.sub-settings-divider {
  padding: 12px 24px 8px; flex: none;
  font-size: 13px; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 1px;
  border-top: 1px solid var(--line);
}
.sub-setting-row {
  padding: 14px 20px; flex: none;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid rgba(46,43,85,0.35); cursor: none;
}
.sub-setting-row.focused { background: var(--signal); color: #fff; }
.sub-setting-label { font-size: 21px; }
.sub-setting-ctrl { display: flex; align-items: center; gap: 10px; }
.sub-setting-val { min-width: 74px; text-align: center; font-size: 20px; font-weight: 700; }
.sub-setting-arrow { font-size: 14px; opacity: 0.5; }
.sub-setting-row.focused .sub-setting-arrow { opacity: 1; }
.sub-color-bar { display: flex; gap: 10px; align-items: center; }
.sub-color-dot {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15); transition: transform .15s;
}
.sub-color-dot.sub-color-active {
  border-color: var(--signal); box-shadow: 0 0 0 2px var(--signal); transform: scale(1.25);
}
.sub-setting-row.focused .sub-color-dot.sub-color-active {
  border-color: #fff; box-shadow: 0 0 0 2px #fff;
}

/* ---------- Toast / loading ---------- */
#toast { position: fixed; top: 40px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 28px; font-size: 24px; display: none; }
#toast.show { display: block; }
#loading { position: fixed; inset: 0; z-index: 70; display: none; align-items: center; justify-content: center; background: rgba(9,8,22,0.88); }
#loading.show { display: flex; }
.spinner { width: 64px; height: 64px; border: 6px solid var(--line); border-top-color: var(--signal); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.scroll { overflow-y: auto; }
