/* ============================================================
   SeriesBox — mobile-first dark theme
   ============================================================ */
:root {
  --bg: #0a0a0f;
  --bg-2: #101016;
  --surface: #17171f;
  --surface-2: #21212b;
  --surface-3: #2b2b37;
  --text: #f3f3f7;
  --muted: #9b9bab;
  --muted-2: #6c6c7c;
  --accent: #ff3b5c;
  --accent-2: #ff8a5c;
  --accent-grad: linear-gradient(135deg, #ff3b5c, #ff8a5c);
  --ok: #3ddc84;
  --warn: #ffc857;
  --radius: 12px;
  --radius-sm: 8px;
  --gutter: 16px;
  --tabbar-h: 58px;
  --topbar-h: 56px;
  --card-w: 118px;
  --shadow: 0 8px 24px rgba(0, 0, 0, .45);
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Thai", "Leelawadee UI", Thonburi, Sarabun, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { height: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: contain;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
img { display: block; }
input, select { font: inherit; }
::selection { background: rgba(255, 59, 92, .35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #33333f; border-radius: 10px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- top bar (desktop) ---------- */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: calc(var(--topbar-h) + var(--sat));
  padding: var(--sat) var(--gutter) 0;
  display: flex; align-items: center; gap: 28px;
  background: linear-gradient(to bottom, rgba(10, 10, 15, .96), rgba(10, 10, 15, .75));
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, .05);
}
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 20px; letter-spacing: -.3px; }
.logo-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent-grad); color: #fff; }
.logo-text b { background: var(--accent-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.topnav { display: none; gap: 4px; }
.topnav a { padding: 8px 14px; border-radius: 999px; color: var(--muted); font-weight: 500; transition: .15s; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }
.topnav a.active { color: var(--text); background: var(--surface-2); }
.topsearch { display: none; margin-left: auto; align-items: center; gap: 8px; background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 999px; padding: 6px 14px; width: 300px; color: var(--muted); transition: .15s; }
.topsearch:focus-within { border-color: var(--accent); color: var(--text); width: 360px; }
.topsearch input { background: none; border: 0; outline: 0; color: var(--text); flex: 1; min-width: 0; }
.topsearch input::placeholder { color: var(--muted-2); }
.topsearch input::-webkit-search-cancel-button { filter: invert(1); }
.topsearch-btn { margin-left: auto; color: var(--text); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.topsearch-btn:active { background: var(--surface-2); }

/* ---------- bottom tab bar (mobile) ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  height: calc(var(--tabbar-h) + var(--sab));
  padding-bottom: var(--sab);
  display: flex; justify-content: space-around; align-items: stretch;
  background: rgba(14, 14, 20, .94);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, .06);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted-2); font-size: 11px; font-weight: 500; transition: color .15s; }
.tabbar a svg { width: 24px; height: 24px; transition: transform .2s; }
.tabbar a.active { color: var(--text); }
.tabbar a.active svg { color: var(--accent); transform: translateY(-1px); }

/* ---------- main view ---------- */
.view {
  padding-top: calc(var(--topbar-h) + var(--sat));
  padding-bottom: calc(var(--tabbar-h) + var(--sab) + 16px);
  min-height: 100vh;
}
body.immersive .topbar, body.immersive .tabbar { display: none !important; }
body.immersive .view { padding: 0; }

.container { padding: 0 var(--gutter); }
.section { margin: 22px 0 6px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 0 var(--gutter); margin-bottom: 10px; }
.section-head h2 { margin: 0; font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.section-head a { color: var(--muted); font-size: 13px; font-weight: 500; }
.section-head a:hover { color: var(--accent); }

/* ---------- horizontal rows ---------- */
.row { display: flex; gap: 10px; overflow-x: auto; padding: 4px var(--gutter) 10px; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.row::-webkit-scrollbar { display: none; }
.row > * { flex: 0 0 var(--card-w); scroll-snap-align: start; }
.row-wrap { position: relative; }
.row-arrow { display: none; position: absolute; top: 0; bottom: 10px; width: 44px; z-index: 2; place-items: center; color: #fff; background: linear-gradient(to right, rgba(10,10,15,.9), transparent); opacity: 0; transition: opacity .2s; }
.row-arrow.right { right: 0; background: linear-gradient(to left, rgba(10,10,15,.9), transparent); }
.row-arrow.left { left: 0; }
.row-arrow svg { width: 32px; height: 32px; filter: drop-shadow(0 2px 6px rgba(0,0,0,.6)); }
.row-wrap:hover .row-arrow { opacity: 1; }

/* ---------- poster card ---------- */
.card { display: block; position: relative; }
.card .poster { position: relative; aspect-ratio: 2 / 3; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: transform .2s ease, box-shadow .2s ease; }
.card .poster img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.card .poster img.loaded { opacity: 1; }
.card:hover .poster { transform: translateY(-3px) scale(1.02); box-shadow: 0 10px 28px rgba(0,0,0,.55); }
.card:active .poster { transform: scale(.97); }
.card .title { margin-top: 7px; font-size: 12.5px; line-height: 1.35; font-weight: 500; color: #d9d9e2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .sub { font-size: 11px; color: var(--muted-2); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { position: absolute; font-size: 10px; font-weight: 700; line-height: 1; padding: 4px 6px; border-radius: 6px; letter-spacing: .2px; backdrop-filter: blur(6px); }
.badge.audio { top: 6px; left: 6px; background: rgba(255, 59, 92, .92); color: #fff; }
.badge.audio.sub { background: rgba(58, 134, 255, .92); }
.badge.audio.both { background: rgba(140, 82, 255, .92); }
.badge.ep { bottom: 6px; left: 6px; background: rgba(0, 0, 0, .7); color: #fff; }
.badge.status { bottom: 6px; right: 6px; background: rgba(0, 0, 0, .65); color: var(--ok); }
.badge.status.ongoing { color: var(--warn); }
.progress-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.2); }
.progress-bar > i { display: block; height: 100%; background: var(--accent); }
.card .play-hint { position: absolute; inset: 0; display: grid; place-items: center; opacity: 0; transition: opacity .2s; background: rgba(0,0,0,.35); }
.card .play-hint span { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.92); color: #000; display: grid; place-items: center; }
.card:hover .play-hint { opacity: 1; }

/* ---------- grid ---------- */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; padding: 0 var(--gutter); }

/* ---------- hero ---------- */
.hero { position: relative; margin-top: -8px; }
.hero-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.hero-track::-webkit-scrollbar { display: none; }
.hero-item { flex: 0 0 100%; scroll-snap-align: start; position: relative; height: 62vw; max-height: 420px; min-height: 250px; overflow: hidden; }
.hero-item .bg { position: absolute; inset: -20px; background-size: cover; background-position: center 20%; filter: blur(18px) brightness(.55); transform: scale(1.1); }
.hero-item .bg-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 25%; opacity: .55; mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%); }
.hero-item .fade { position: absolute; inset: 0; background: linear-gradient(to top, var(--bg) 8%, rgba(10,10,15,.55) 45%, transparent 80%); }
.hero-content { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 18px; display: flex; gap: 14px; align-items: flex-end; }
.hero-poster { flex: 0 0 96px; aspect-ratio: 2/3; border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.hero-poster img { width: 100%; height: 100%; object-fit: cover; }
.hero-text { min-width: 0; flex: 1; }
.hero-text .kicker { color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.hero-text h1 { margin: 2px 0 6px; font-size: 20px; line-height: 1.25; font-weight: 800; letter-spacing: -.3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-text .meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.hero-text .meta span::before { content: "•"; margin-right: 8px; color: var(--muted-2); }
.hero-text .meta span:first-child::before { content: none; }
.hero-dots { position: absolute; right: var(--gutter); top: 12px; display: flex; gap: 5px; }
.hero-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255,255,255,.35); transition: .2s; }
.hero-dots i.active { background: #fff; width: 18px; border-radius: 4px; }

/* ---------- buttons & chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 999px; font-weight: 700; font-size: 14px; background: var(--surface-2); color: var(--text); transition: .15s; white-space: nowrap; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 18px rgba(255, 59, 92, .35); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: rgba(255,255,255,.1); backdrop-filter: blur(8px); }
.btn.icon { width: 42px; height: 42px; padding: 0; border-radius: 50%; }
.btn.sm { padding: 7px 14px; font-size: 13px; }
.btn svg { width: 20px; height: 20px; }
.btn.fav.on { color: var(--accent); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px var(--gutter); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid rgba(255,255,255,.08); font-size: 13px; font-weight: 500; color: var(--muted); transition: .15s; white-space: nowrap; }
.chip:hover { color: var(--text); border-color: rgba(255,255,255,.2); }
.chip.active { background: var(--text); color: #000; border-color: var(--text); font-weight: 700; }

/* ---------- page header ---------- */
.page-head { display: flex; align-items: center; gap: 10px; padding: 10px var(--gutter) 6px; }
.page-head h1 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.3px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-head .count { color: var(--muted); font-size: 13px; }
.back-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); flex: 0 0 auto; }
.back-btn svg { width: 22px; height: 22px; }

/* ---------- search ---------- */
.searchbox { display: flex; align-items: center; gap: 10px; margin: 8px var(--gutter) 14px; background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 14px; padding: 12px 14px; color: var(--muted); transition: .15s; }
.searchbox:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255,59,92,.15); }
.searchbox input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font-size: 16px; }
.searchbox input::placeholder { color: var(--muted-2); }
.searchbox input::-webkit-search-cancel-button { filter: invert(1); }
.searchbox svg { width: 22px; height: 22px; flex: 0 0 auto; }
.searchbox .clear { color: var(--muted); }
.recent { padding: 0 var(--gutter); }
.recent h3 { font-size: 13px; color: var(--muted); margin: 6px 0 8px; font-weight: 600; }
.recent .chip { margin: 0 8px 8px 0; display: inline-flex; gap: 6px; align-items: center; }

/* ---------- categories page ---------- */
.cat-group { margin: 18px 0; }
.cat-group h2 { font-size: 15px; color: var(--muted); font-weight: 600; margin: 0 var(--gutter) 10px; }
.cat-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 0 var(--gutter); }
.cat-item { position: relative; display: flex; align-items: center; padding: 16px 14px; border-radius: var(--radius); font-weight: 700; font-size: 14px; color: #fff; overflow: hidden; min-height: 64px; box-shadow: 0 4px 12px rgba(0,0,0,.3); transition: transform .15s; }
.cat-item:active { transform: scale(.97); }
.cat-item::after { content: ""; position: absolute; right: -16px; bottom: -22px; width: 70px; height: 70px; border-radius: 50%; background: rgba(255,255,255,.14); }
.cat-item svg { position: absolute; right: 10px; bottom: 8px; width: 26px; height: 26px; opacity: .5; }

/* ---------- series detail ---------- */
.detail { position: relative; }
.detail-backdrop { position: absolute; left: 0; right: 0; top: 0; height: 360px; overflow: hidden; z-index: 0; }
.detail-backdrop img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; filter: blur(22px) brightness(.5) saturate(1.2); transform: scale(1.2); }
.detail-backdrop::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(10,10,15,.2), var(--bg) 92%); }
.detail-body { position: relative; z-index: 1; padding: 20px var(--gutter) 0; }
.detail-top { display: flex; gap: 16px; align-items: flex-end; }
.detail-poster { flex: 0 0 120px; aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface-2); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }
.detail-title { min-width: 0; flex: 1; }
.detail-title h1 { margin: 0 0 8px; font-size: 21px; line-height: 1.25; font-weight: 800; letter-spacing: -.3px; }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 6px; background: rgba(255,255,255,.1); color: #e6e6ee; }
.tag.ok { background: rgba(61,220,132,.15); color: var(--ok); }
.tag.warn { background: rgba(255,200,87,.15); color: var(--warn); }
.tag.accent { background: rgba(255,59,92,.18); color: #ff7d94; }
.detail-actions { display: flex; gap: 10px; margin: 16px 0 6px; }
.detail-actions .btn.primary { flex: 1; padding: 13px 18px; font-size: 15px; }
.synopsis { margin: 14px 0 0; color: #c9c9d4; font-size: 14px; line-height: 1.6; }
.synopsis p { margin: 0; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.synopsis.open p { -webkit-line-clamp: unset; display: block; }
.synopsis button { color: var(--accent); font-weight: 600; margin-top: 4px; }

.ep-tabs { display: flex; gap: 6px; padding: 0 var(--gutter); margin: 22px 0 12px; border-bottom: 1px solid rgba(255,255,255,.08); }
.ep-tab { padding: 10px 14px; margin-bottom: -1px; font-weight: 700; color: var(--muted); border-bottom: 2px solid transparent; transition: .15s; }
.ep-tab.active { color: var(--text); border-color: var(--accent); }
.ep-tab small { font-weight: 500; color: var(--muted-2); margin-left: 5px; }
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; padding: 0 var(--gutter); }
.ep-btn { position: relative; height: 48px; border-radius: 10px; background: var(--surface); border: 1px solid rgba(255,255,255,.06); font-weight: 700; font-size: 15px; display: grid; place-items: center; overflow: hidden; transition: .15s; }
.ep-btn:hover { background: var(--surface-2); border-color: rgba(255,255,255,.15); }
.ep-btn:active { transform: scale(.95); }
.ep-btn.watched { color: var(--muted); }
.ep-btn.current { background: var(--accent-grad); border-color: transparent; color: #fff; box-shadow: 0 4px 14px rgba(255,59,92,.4); }
.ep-btn.current::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: #fff; top: 6px; right: 6px; }
.ep-btn .progress-bar { background: rgba(255,255,255,.12); }
.ep-btn.current .progress-bar > i { background: #fff; }
.ep-btn.disabled { opacity: .35; pointer-events: none; }

/* ---------- watch page ---------- */
.watch { display: flex; flex-direction: column; min-height: 100vh; background: #000; }
.watch-player { position: sticky; top: 0; z-index: 20; background: #000; padding-top: var(--sat); }
.watch-body { flex: 1; background: var(--bg); padding-bottom: calc(24px + var(--sab)); }
.watch-info { padding: 14px var(--gutter) 4px; }
.watch-info h1 { margin: 0; font-size: 17px; font-weight: 800; line-height: 1.3; }
.watch-info .ep-now { color: var(--muted); font-size: 13px; margin-top: 3px; }
.watch-actions { display: flex; gap: 8px; padding: 10px var(--gutter) 4px; overflow-x: auto; scrollbar-width: none; }
.watch-actions::-webkit-scrollbar { display: none; }
.watch-actions .btn { flex: 0 0 auto; }
.watch-eps { margin-top: 8px; }
.watch-eps .ep-tabs { margin-top: 4px; }
.watch-synopsis { padding: 6px var(--gutter) 0; }

/* ---------- player ---------- */
.pl { position: relative; width: 100%; aspect-ratio: 16 / 9; background: #000; overflow: hidden; user-select: none; -webkit-user-select: none; touch-action: manipulation; outline: 0; }
.pl video { width: 100%; height: 100%; display: block; background: #000; }
.pl.fullscreen, .pl:fullscreen { aspect-ratio: auto; width: 100vw; height: 100vh; }
.pl:fullscreen video { object-fit: contain; }
.pl-ui { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; pointer-events: none; }
.pl.show-ui .pl-ui { opacity: 1; pointer-events: auto; }
.pl.show-ui { cursor: default; }
.pl.hide-cursor { cursor: none; }
.pl-shade { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.6), transparent 30%, transparent 60%, rgba(0,0,0,.75)); }
.pl-top { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.pl-top .pl-title { flex: 1; min-width: 0; }
.pl-top .pl-title b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pl-top .pl-title span { display: block; font-size: 12px; color: #c8c8d2; }
.pl-btn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; transition: background .15s; flex: 0 0 auto; }
.pl-btn:hover { background: rgba(255,255,255,.15); }
.pl-btn svg { width: 24px; height: 24px; filter: drop-shadow(0 1px 3px rgba(0,0,0,.6)); }
.pl-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 34px; }
.pl-center .pl-btn { width: 52px; height: 52px; }
.pl-center .pl-btn svg { width: 34px; height: 34px; }
.pl-center .pl-play { width: 68px; height: 68px; background: rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.pl-center .pl-play svg { width: 40px; height: 40px; }
.pl-bottom { position: absolute; left: 0; right: 0; bottom: 0; padding: 0 12px 6px; }
.pl-seek { position: relative; height: 26px; display: flex; align-items: center; cursor: pointer; }
.pl-seek .track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); transition: height .15s; }
.pl-seek:hover .track, .pl-seek.dragging .track { height: 6px; }
.pl-seek .buffered { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,.4); border-radius: 4px; }
.pl-seek .played { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.pl-seek .thumb { position: absolute; top: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: #fff; transform: translateY(-50%) scale(0); transition: transform .15s; box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.pl-seek:hover .thumb, .pl-seek.dragging .thumb { transform: translateY(-50%) scale(1); }
.pl-row { display: flex; align-items: center; gap: 2px; }
.pl-time { font-size: 12.5px; font-variant-numeric: tabular-nums; color: #eee; padding: 0 6px; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.pl-row .spacer { flex: 1; }
.pl-btn.text { width: auto; padding: 0 10px; border-radius: 8px; font-size: 13px; font-weight: 700; }
.pl-loading { position: absolute; inset: 0; display: none; place-items: center; pointer-events: none; }
.pl.loading .pl-loading { display: grid; }
.spinner { width: 46px; height: 46px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.pl-error { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(0,0,0,.85); padding: 20px; text-align: center; }
.pl.error .pl-error { display: flex; }
.pl-error p { margin: 0; color: #ddd; font-size: 14px; }
.pl-overlay { position: absolute; right: 12px; bottom: 60px; background: rgba(20,20,28,.94); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 12px 14px; display: none; flex-direction: column; gap: 8px; box-shadow: var(--shadow); max-width: 280px; z-index: 5; }
.pl-overlay.open { display: flex; }
.pl-overlay b { font-size: 13px; }
.pl-overlay p { margin: 0; font-size: 13px; color: #ccc; }
.pl-overlay .actions { display: flex; gap: 8px; }
.pl-tip { position: absolute; left: 12px; bottom: 60px; background: rgba(20,20,28,.9); border-radius: 10px; padding: 8px 12px; font-size: 13px; display: none; align-items: center; gap: 10px; z-index: 5; }
.pl-tip.open { display: flex; }
.pl-tip button { color: var(--accent); font-weight: 700; }
.pl-seekhint { position: absolute; top: 50%; transform: translateY(-50%); width: 40%; height: 60%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 18px; opacity: 0; transition: opacity .2s; pointer-events: none; }
.pl-seekhint.left { left: 0; border-radius: 0 50% 50% 0; background: radial-gradient(circle at left, rgba(255,255,255,.18), transparent 70%); }
.pl-seekhint.right { right: 0; border-radius: 50% 0 0 50%; background: radial-gradient(circle at right, rgba(255,255,255,.18), transparent 70%); }
.pl-seekhint.show { opacity: 1; }
.pl-menu { position: absolute; right: 12px; bottom: 58px; background: rgba(20,20,28,.96); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: 6px; display: none; flex-direction: column; min-width: 150px; z-index: 6; box-shadow: var(--shadow); }
.pl-menu.open { display: flex; }
.pl-menu button { text-align: left; padding: 9px 12px; border-radius: 8px; font-size: 14px; display: flex; justify-content: space-between; gap: 12px; }
.pl-menu button:hover { background: rgba(255,255,255,.08); }
.pl-menu button.active { color: var(--accent); font-weight: 700; }
.pl-menu .menu-title { padding: 6px 12px 4px; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }

/* gestures: brightness layer, swipe indicator, lock, in-player episode panel */
.pl { touch-action: none; }
.pl-dim { position: absolute; inset: 0; background: #000; opacity: 0; pointer-events: none; z-index: 1; }
.pl-ui, .pl-loading, .pl-error, .pl-overlay, .pl-tip, .pl-menu, .pl-seekhint { z-index: 2; }
.pl-seekrow { display: flex; align-items: center; gap: 10px; }
.pl-seekrow .pl-seek { flex: 1; }
.pl-seekrow .pl-time { flex: 0 0 auto; padding: 0; }
.pl-btn.text { display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
.pl-btn.text svg { width: 20px; height: 20px; }
.pl-quality { font-size: 12px; font-weight: 800; color: #ffc857; padding: 0 8px; letter-spacing: .3px; }
.pl.narrow .opt { display: none !important; }
.pl.tiny [data-act="lock"] { display: none; }
.pl.tiny .pl-center { gap: 22px; }
.pl-lockbtn { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; background: rgba(20,20,28,.85); color: #fff; display: none; place-items: center; z-index: 4; box-shadow: var(--shadow); }
.pl-lockbtn svg { width: 24px; height: 24px; }
.pl-lockbtn.show { display: grid; }
.pl.locked { cursor: default; }
.pl-gesture { position: absolute; top: 18%; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 12px; background: rgba(20,20,28,.85); backdrop-filter: blur(6px); color: #fff; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity .15s; pointer-events: none; z-index: 5; }
.pl-gesture.show { opacity: 1; }
.pl-gesture .g-icon { display: grid; place-items: center; }
.pl-gesture .g-icon svg { width: 22px; height: 22px; }
.pl-gesture .g-bar { width: 110px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.25); overflow: hidden; }
.pl-gesture .g-bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.pl-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(62%, 420px); background: rgba(14,14,20,.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-left: 1px solid rgba(255,255,255,.08); transform: translateX(100%); transition: transform .25s ease; z-index: 6; display: flex; flex-direction: column; touch-action: pan-y; }
.pl-panel.open { transform: none; }
.pl-panel-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 15px; flex: 0 0 auto; }
.pl-panel-head .pl-btn { width: 36px; height: 36px; font-size: 16px; }
.pl-panel-body { flex: 1; overflow-y: auto; padding-bottom: 16px; }
.pl-panel-body .ep-tabs { margin: 6px 0 10px; padding: 0 14px; }
.pl-panel-body .ep-grid { padding: 0 14px; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 7px; }
.pl-panel-body .ep-btn { height: 42px; font-size: 14px; }
.pl:fullscreen .pl-top, .pl.fullscreen .pl-top { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-top: max(10px, env(safe-area-inset-top)); }
.pl:fullscreen .pl-bottom, .pl.fullscreen .pl-bottom { padding-left: max(12px, env(safe-area-inset-left)); padding-right: max(12px, env(safe-area-inset-right)); padding-bottom: max(6px, env(safe-area-inset-bottom)); }
.pl:fullscreen .pl-lockbtn { left: max(14px, env(safe-area-inset-left)); }
.pl:fullscreen .pl-center .pl-play { width: 80px; height: 80px; }
.pl:fullscreen .pl-center { gap: 48px; }

/* ---------- library ---------- */
.empty { text-align: center; padding: 50px var(--gutter); color: var(--muted); }
.empty svg { width: 56px; height: 56px; opacity: .3; margin-bottom: 10px; }
.empty p { margin: 0 0 14px; }
.list-item { display: flex; gap: 12px; padding: 8px var(--gutter); align-items: center; }
.list-item .thumb { flex: 0 0 64px; aspect-ratio: 2/3; border-radius: 8px; overflow: hidden; background: var(--surface-2); position: relative; }
.list-item .thumb img { width: 100%; height: 100%; object-fit: cover; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item .info span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.list-item .btn.icon { flex: 0 0 auto; width: 38px; height: 38px; color: var(--muted); }
.settings { padding: 0 var(--gutter); }
.settings .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.06); }
.settings .set-row b { display: block; font-size: 14px; }
.settings .set-row span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.settings select { background: var(--surface-2); color: var(--text); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; padding: 8px 10px; }
.online-card { display: flex; gap: 16px; align-items: flex-start; margin: 0 var(--gutter); padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(255,255,255,.06); }
.online-qr { flex: 0 0 116px; width: 116px; height: 116px; border-radius: 10px; background: #fff; padding: 6px; box-sizing: border-box; }
.online-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.online-info b { font-size: 14px; }
.online-url { font-size: 15px; font-weight: 700; color: #7fb4ff; word-break: break-all; }
.online-pw { font-size: 13px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.online-pw code { font-size: 17px; font-weight: 800; letter-spacing: 1.5px; color: var(--text); background: var(--bg-2); padding: 3px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.1); }
.online-pw span { flex-basis: 100%; font-size: 12px; color: var(--muted-2); }
.online-note { font-size: 12px; color: var(--muted-2); }
.online-actions { display: flex; gap: 8px; margin-top: 4px; flex-wrap: wrap; }
.set-row code { background: var(--bg-2); padding: 2px 6px; border-radius: 6px; color: var(--text); }
@media (max-width: 480px) { .online-card { flex-direction: column; align-items: center; text-align: center; } .online-info { align-items: center; } }
.switch { position: relative; width: 46px; height: 26px; border-radius: 13px; background: var(--surface-3); transition: .2s; flex: 0 0 auto; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: .2s; }
.switch.on { background: var(--accent); }
.switch.on::after { left: 23px; }

/* ---------- profiles ---------- */
.avatar { --size: 40px; --c: #ff3b5c; display: inline-grid; place-items: center; width: var(--size); height: var(--size); border-radius: 50%; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); box-shadow: 0 4px 14px color-mix(in srgb, var(--c) 45%, transparent); flex: 0 0 auto; }
.avatar > span { font-size: calc(var(--size) * .52); line-height: 1; transform: translateY(2%); }
.avatar.add { background: var(--surface-2); box-shadow: none; border: 2px dashed rgba(255,255,255,.2); color: var(--muted); }
.avatar.add > span { font-size: calc(var(--size) * .5); font-weight: 300; }
.topavatar { display: none; margin-left: 6px; padding: 0; border-radius: 50%; cursor: pointer; transition: transform .15s; }
.topavatar:hover { transform: scale(1.06); }
.tab-avatar { display: grid; place-items: center; height: 26px; }
.tab-avatar svg { width: 24px; height: 24px; }
.tab-avatar .avatar { box-shadow: none; }
.tabbar a.active .tab-avatar .avatar { outline: 2px solid var(--accent); outline-offset: 1px; }

.profiles { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(24px + var(--sat)) var(--gutter) calc(32px + var(--sab)); text-align: center; }
.profiles-head { margin-bottom: 26px; }
.profiles-head .logo-mark.big { width: 52px; height: 52px; border-radius: 14px; margin: 0 auto 16px; }
.profiles-head h1 { margin: 0 0 6px; font-size: 26px; font-weight: 800; letter-spacing: -.3px; }
.profiles-head p { margin: 0; color: var(--muted); font-size: 14px; }
.profile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px 18px; max-width: 760px; }
.profile-card { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 112px; padding: 8px 4px; border-radius: 14px; transition: transform .15s, background .15s; }
.profile-card b { font-size: 14px; font-weight: 600; color: #e6e6ee; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile-card small { font-size: 11px; color: var(--accent); margin-top: -6px; }
.profile-card:hover { transform: translateY(-3px); }
.profile-card:hover .avatar { outline: 3px solid rgba(255,255,255,.85); outline-offset: 3px; }
.profile-card:active { transform: scale(.96); }
.profile-card.current .avatar { outline: 3px solid var(--accent); outline-offset: 3px; }
.profiles-hint { margin-top: 30px; color: var(--muted-2); font-size: 12.5px; max-width: 360px; }

.profile-bar { display: flex; align-items: center; gap: 14px; margin: 4px var(--gutter) 10px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid rgba(255,255,255,.06); }
.profile-bar-info { flex: 1; min-width: 0; }
.profile-bar-info b { display: block; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-bar-info span { display: block; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.profile-actions { margin-bottom: 6px; }
.chip.danger { color: #ff8095; }

/* modal + PIN pad */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(5,5,10,.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); animation: fadein .15s ease; }
.modal-card { position: relative; width: 100%; max-width: 360px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid rgba(255,255,255,.08); border-radius: 20px; padding: 26px 22px 22px; box-shadow: 0 20px 60px rgba(0,0,0,.6); text-align: center; animation: pop .18s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; color: var(--muted); }
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-close svg { width: 20px; height: 20px; }
.modal-card h2 { margin: 12px 0 4px; font-size: 19px; font-weight: 800; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }
body.modal-open { overflow: hidden; }

.pin-profile { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pin-profile b { font-size: 15px; }
.pin-sub { margin: 0; color: var(--muted); font-size: 13px; min-height: 18px; }
.pin-dots { display: flex; justify-content: center; gap: 16px; margin: 20px 0 8px; }
.pin-dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); transition: .12s; }
.pin-dots i.on { background: var(--accent); border-color: var(--accent); transform: scale(1.1); box-shadow: 0 0 12px rgba(255,59,92,.6); }
.pin-msg { min-height: 20px; font-size: 13px; color: #ff8095; font-weight: 600; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; }
.keypad button { height: 58px; border-radius: 14px; background: var(--surface-2); font-size: 22px; font-weight: 600; transition: .1s; }
.keypad button:hover { background: var(--surface-3); }
.keypad button:active { transform: scale(.94); background: var(--accent); color: #fff; }
.pin-card.busy .keypad { opacity: .5; pointer-events: none; }
.pin-card.shake { animation: shake .4s; }
@keyframes shake { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-6px); } 40%, 60% { transform: translateX(6px); } }

.form-card { text-align: left; }
.form-card h2 { text-align: center; }
.pf-preview { display: flex; justify-content: center; margin: 14px 0 16px; }
.pf-name { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255,255,255,.1); background: var(--bg-2); color: var(--text); font-size: 16px; outline: 0; }
.pf-name:focus { border-color: var(--accent); }
.pf-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; margin: 16px 0 8px; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border-radius: 10px; font-size: 20px; background: var(--bg-2); border: 2px solid transparent; transition: .1s; }
.emoji-grid button.on { border-color: var(--accent); background: rgba(255,59,92,.15); }
.emoji-grid button:active { transform: scale(.9); }
.color-row { display: flex; gap: 10px; flex-wrap: wrap; }
.color-row button { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 3px solid transparent; transition: .1s; }
.color-row button.on { border-color: #fff; transform: scale(1.15); }
.pf-msg { min-height: 18px; margin-top: 8px; font-size: 13px; color: #ff8095; }

/* ---------- misc ---------- */
.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + var(--sab) + 16px); transform: translate(-50%, 20px); background: rgba(30,30,40,.96); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; transition: .25s; z-index: 100; pointer-events: none; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
body.immersive .toast { bottom: 24px; }
.loader { display: flex; justify-content: center; padding: 30px; }
.load-more { display: flex; justify-content: center; padding: 20px var(--gutter) 10px; }
.error-box { margin: 20px var(--gutter); padding: 16px; border-radius: var(--radius); background: rgba(255,59,92,.1); border: 1px solid rgba(255,59,92,.3); color: #ffb3c0; font-size: 14px; }
.error-box button { margin-top: 10px; }

/* skeletons */
.sk { position: relative; overflow: hidden; background: var(--surface-2); border-radius: var(--radius-sm); }
.sk::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.06), transparent); animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
.sk-card .poster { aspect-ratio: 2/3; }
.sk-line { height: 12px; margin-top: 8px; width: 80%; }
.sk-hero { height: 62vw; max-height: 420px; min-height: 250px; border-radius: 0; }

/* view transitions */
.view > * { animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ============================================================
   Tablet / desktop
   ============================================================ */
@media (min-width: 600px) {
  :root { --card-w: 150px; --gutter: 24px; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 16px 12px; }
  .hero-item { height: 46vw; }
  .hero-poster { flex-basis: 130px; }
  .hero-text h1 { font-size: 26px; }
  .cat-list { grid-template-columns: repeat(3, 1fr); }
  .detail-poster { flex-basis: 160px; }
  .detail-title h1 { font-size: 26px; }
  .ep-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); }
}
@media (min-width: 900px) {
  :root { --card-w: 168px; --gutter: 40px; --tabbar-h: 0px; }
  .tabbar { display: none; }
  .topnav { display: flex; }
  .topsearch { display: flex; }
  .topsearch-btn { display: none; }
  .topavatar { display: inline-block; }
  .row-arrow { display: grid; }
  .grid { grid-template-columns: repeat(6, 1fr); gap: 20px 14px; }
  .hero-item { height: 34vw; max-height: 520px; }
  .hero-item .bg-img { opacity: .6; object-position: center 15%; }
  .hero-content { bottom: 36px; align-items: center; }
  .hero-poster { flex-basis: 190px; }
  .hero-text h1 { font-size: 36px; }
  .hero-text .meta { font-size: 14px; }
  .section-head h2 { font-size: 20px; }
  .cat-list { grid-template-columns: repeat(4, 1fr); }
  .detail-backdrop { height: 480px; }
  .detail-body { padding-top: 40px; max-width: 1200px; margin: 0 auto; }
  .detail-top { align-items: flex-end; gap: 28px; }
  .detail-poster { flex-basis: 220px; }
  .detail-title h1 { font-size: 34px; }
  .detail-actions { margin-top: 18px; }
  .detail-actions .btn.primary { flex: 0 0 auto; padding: 13px 28px; }
  .synopsis { max-width: 800px; }
  .synopsis p { -webkit-line-clamp: 5; }
  .ep-grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .watch { flex-direction: row; align-items: flex-start; background: var(--bg); padding: 12px var(--gutter) 24px; gap: 20px; }
  .watch-player { flex: 1; min-width: 0; position: static; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
  .watch-body { flex: 0 0 380px; position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow-y: auto; border-radius: 12px; background: var(--surface); }
  .watch-info, .watch-actions, .watch-synopsis { padding-left: 16px; padding-right: 16px; }
  .watch-eps .ep-tabs, .watch-eps .ep-grid { padding-left: 16px; padding-right: 16px; }
  .watch-eps .ep-grid { grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); }
  .pl.fullscreen { border-radius: 0; }
  .toast { bottom: 32px; }
  .view { padding-bottom: 40px; }
  .pl-center .pl-play { width: 76px; height: 76px; }
}
@media (min-width: 1300px) {
  .grid { grid-template-columns: repeat(7, 1fr); }
  :root { --card-w: 180px; }
  .watch-body { flex-basis: 420px; }
}
/* ============================================================
   TV mode (Android TV app / ?tv=1): remote-friendly sizes + focus rings
   ============================================================ */
html.tv { font-size: 18px; cursor: none; }
html.tv body { font-size: 18px; }
html.tv { --card-w: 210px; --gutter: 56px; --topbar-h: 68px; }
html.tv .tabbar { display: none !important; }
html.tv .topnav, html.tv .topsearch { display: flex; }
html.tv .topsearch-btn { display: none; }
html.tv .view { padding-top: calc(var(--topbar-h) + 8px); padding-bottom: 48px; }
html.tv .row-arrow { display: none !important; }
html.tv .grid { grid-template-columns: repeat(7, 1fr); gap: 24px 16px; }
html.tv .section-head h2 { font-size: 24px; }
html.tv .card .title { font-size: 15px; }
html.tv .card .poster { transition: transform .15s, box-shadow .15s, outline-color .15s; outline: 4px solid transparent; outline-offset: 4px; border-radius: 10px; }
html.tv .card:focus { outline: none; }
html.tv .card:focus .poster { transform: scale(1.08); outline-color: #fff; box-shadow: 0 14px 34px rgba(0,0,0,.6); z-index: 2; }
html.tv .card:focus .title { color: #fff; }
html.tv .hero-item:focus { outline: none; }
html.tv .hero-item:focus .btn { outline: 4px solid #fff; outline-offset: 3px; }
html.tv .hero-text h1 { font-size: 40px; }
html.tv :focus { outline: none; }
html.tv .btn:focus, html.tv .chip:focus, html.tv .ep-tab:focus, html.tv .topnav a:focus, html.tv .topsearch:focus-within, html.tv .back-btn:focus, html.tv .switch:focus, html.tv select:focus, html.tv .keypad button:focus, html.tv .emoji-grid button:focus, html.tv .color-row button:focus, html.tv .modal-close:focus, html.tv .list-item a:focus, html.tv .profile-actions .chip:focus, html.tv [data-rm]:focus, html.tv .cat-item:focus, html.tv .section-head a:focus, html.tv .online-actions .btn:focus, html.tv .topavatar:focus, html.tv .synopsis button:focus, html.tv .profile-bar .btn:focus, html.tv .modal-actions .btn:focus { outline: 4px solid #fff; outline-offset: 3px; }
html.tv .ep-btn:focus { outline: 4px solid #fff; outline-offset: 2px; transform: scale(1.06); }
html.tv .profile-card:focus .avatar { outline: 4px solid #fff; outline-offset: 5px; transform: scale(1.06); }
html.tv .keypad button:focus { background: var(--surface-3); }
html.tv .pf-name:focus { border-color: #fff; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
html.tv .pl-btn:focus { background: rgba(255,255,255,.28); outline: 3px solid #fff; }
html.tv .pl:focus { outline: none; }
html.tv .pl-btn { width: 52px; height: 52px; }
html.tv .pl-btn svg { width: 30px; height: 30px; }
html.tv .pl-btn.text { width: auto; padding: 0 14px; font-size: 17px; }
html.tv body.immersive .view { padding: 0; }
html.tv body.immersive { overflow: hidden; }
html.tv .pl-time { font-size: 16px; }
html.tv .pl-center .pl-play { width: 96px; height: 96px; }
html.tv .pl-center .pl-btn svg { width: 40px; height: 40px; }
html.tv .pl-center .pl-play svg { width: 52px; height: 52px; }
html.tv .pl-panel { width: min(46%, 640px); }
html.tv .pl-panel-body .ep-grid { grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; }
html.tv .pl-panel-body .ep-btn { height: 54px; font-size: 18px; }
html.tv .watch { padding: 0; gap: 0; }
html.tv .watch-player { border-radius: 0; box-shadow: none; }
html.tv .pl, html.tv .watch-player { height: 100vh; aspect-ratio: auto; }
html.tv .watch-body { display: none; }
html.tv .keypad button { height: 66px; font-size: 26px; }
html.tv .modal-card { max-width: 440px; }
html.tv .cat-item { min-height: 84px; font-size: 18px; }
html.tv .toast { font-size: 18px; padding: 14px 22px; bottom: 40px; }

@media (hover: none) {
  .card:hover .poster { transform: none; box-shadow: 0 4px 14px rgba(0,0,0,.35); }
  .card .play-hint { display: none; }
}
@media (orientation: landscape) and (max-width: 899px) {
  .watch-player { padding-top: 0; }
  .pl { max-height: 100vh; }
}
