/* Lumen TV — premium dark theme */
:root {
  --bg: #050608;
  --bg2: #0b0d12;
  --surface: rgba(255, 255, 255, 0.045);
  --surface2: rgba(255, 255, 255, 0.08);
  --hair: rgba(255, 255, 255, 0.08);
  --hair2: rgba(255, 255, 255, 0.14);
  --text: #f4f5f7;
  --text2: rgba(235, 238, 245, 0.68);
  --text3: rgba(235, 238, 245, 0.42);
  --accent: #8ab4ff;
  --accent2: #c7a5ff;
  --gold: #f3c969;
  --live: #ff3b4e;
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Inter, system-ui, sans-serif;
  --rail: 84px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; letter-spacing: -0.005em; }
body { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
input, select { font: inherit; color: inherit; }
.hidden { display: none !important; }
.spacer { flex: 1; }
::selection { background: rgba(138, 180, 255, 0.35); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.2); }
::-webkit-scrollbar-track { background: transparent; }

/* ambient wash */
#ambient { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
#ambientImg { position: absolute; inset: -20%; background-size: cover; background-position: center; filter: blur(90px) saturate(1.6); opacity: 0.32; transition: background-image 1.2s var(--ease), opacity 1.2s; transform: translateZ(0); }
#ambient::after { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 80% at 70% 0%, transparent 0%, rgba(5, 6, 8, 0.55) 55%, var(--bg) 100%); }

/* glass material (refraction added by liquid-glass.js on Chromium) */
.glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0.5px rgba(255, 255, 255, 0.35), inset 0 -10px 24px rgba(255, 255, 255, 0.03), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(22px) saturate(1.6);
  -webkit-backdrop-filter: blur(22px) saturate(1.6);
}
.pill { border-radius: 999px; }
.iconBtn { width: 40px; height: 40px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; transition: transform .25s var(--ease), background .25s; }
.iconBtn:hover { transform: scale(1.07); background-color: rgba(255, 255, 255, 0.14); }
.iconBtn:active { transform: scale(0.96); }
.ghostBtn { height: 40px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; background: var(--surface2); box-shadow: inset 0 0 0 1px var(--hair); font-weight: 500; transition: background .2s, transform .2s var(--ease); white-space: nowrap; }
.ghostBtn svg { width: 17px; height: 17px; }
.ghostBtn:hover { background: rgba(255, 255, 255, 0.15); }
.btnPlay { height: 48px; padding: 0 26px 0 22px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px; background: #fff; color: #000; font-weight: 650; font-size: 15px; box-shadow: 0 10px 40px rgba(255, 255, 255, 0.18); transition: transform .25s var(--ease), box-shadow .25s; }
.btnPlay:hover { transform: scale(1.04); box-shadow: 0 14px 50px rgba(255, 255, 255, 0.28); }
.btnPlay svg { width: 18px; height: 18px; }
.btnGlass { height: 48px; padding: 0 22px; border-radius: 999px; display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; transition: transform .25s var(--ease); }
.btnGlass:hover { transform: scale(1.04); }
.eyebrow { font-size: 11px; font-weight: 650; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text3); }
.field { width: 100%; height: 38px; padding: 0 14px; border-radius: 12px; border: 0; outline: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); color: var(--text); transition: box-shadow .2s, background .2s; }
.field:focus { background: var(--surface2); box-shadow: inset 0 0 0 1px rgba(138, 180, 255, 0.55), 0 0 0 4px rgba(138, 180, 255, 0.12); }
.field::placeholder { color: var(--text3); }

/* rail */
#rail { position: fixed; z-index: 30; left: 14px; top: 14px; bottom: 14px; width: 62px; border-radius: 26px; display: flex; flex-direction: column; align-items: center; padding: 14px 0; gap: 6px; transition: width .35s var(--ease); overflow: hidden; }
#rail:hover { width: 196px; }
#rail .logo { width: 100%; height: 52px; display: flex; align-items: center; padding-left: 15px; margin-bottom: 10px; }
.logoMark { width: 32px; height: 32px; border-radius: 10px; flex: none; position: relative; background: conic-gradient(from 210deg, #8ab4ff, #c7a5ff, #ff9ecf, #ffd28a, #8ab4ff); box-shadow: 0 6px 20px rgba(138, 180, 255, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.7); }
.logoMark::after { content: ""; position: absolute; inset: 9px 8px 9px 11px; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); border-radius: 2px; }
.logo::after { content: "Lumen"; margin-left: 12px; font-weight: 700; font-size: 19px; letter-spacing: -0.03em; opacity: 0; transition: opacity .25s; white-space: nowrap; }
#rail:hover .logo::after { opacity: 1; }
#rail button { width: calc(100% - 16px); height: 44px; border-radius: 14px; display: flex; align-items: center; gap: 14px; padding: 0 12px; color: var(--text2); transition: background .2s, color .2s; white-space: nowrap; position: relative; }
#rail button svg { width: 22px; height: 22px; }
#rail button span { opacity: 0; transition: opacity .2s; font-weight: 550; font-size: 14.5px; }
#rail:hover button span { opacity: 1; }
#rail button:hover { background: rgba(255, 255, 255, 0.08); color: var(--text); }
#rail button.active { color: #fff; background: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.25); }
#rail button.active::before { content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent2)); box-shadow: 0 0 12px var(--accent); }
#rail .grow { flex: 1; }

/* app shell */
#app { position: relative; z-index: 1; height: 100%; margin-left: calc(var(--rail) + 6px); display: flex; flex-direction: column; }
#top { position: absolute; z-index: 20; top: 0; left: 0; right: 0; display: flex; align-items: center; gap: 12px; padding: 18px 28px 0 10px; pointer-events: none; }
#top > * { pointer-events: auto; }
#top::before { content: ""; position: absolute; inset: 0 0 -34px calc(-1 * var(--rail) - 6px); background: linear-gradient(180deg, rgba(5, 6, 8, 0.92), rgba(5, 6, 8, 0.6) 55%, transparent); opacity: 0; transition: opacity .35s; pointer-events: none; z-index: -1; }
#top.scrolled::before { opacity: 1; }
#account { padding: 6px 12px; border-radius: 14px; background: rgba(0, 0, 0, 0.28); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
#searchBox { display: flex; align-items: center; gap: 10px; height: 44px; width: min(460px, 46vw); padding: 0 8px 0 16px; transition: width .35s var(--ease), box-shadow .25s; }
#searchBox:focus-within { width: min(620px, 60vw); box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45), inset 0 1px 0.5px rgba(255, 255, 255, 0.35), inset 0 0 0 1px rgba(138, 180, 255, 0.5), 0 0 0 5px rgba(138, 180, 255, 0.1); }
#searchBox svg { color: var(--text2); width: 18px; height: 18px; }
#search { flex: 1; border: 0; outline: 0; background: none; height: 100%; font-size: 14.5px; }
#search::placeholder { color: var(--text3); }
#search::-webkit-search-cancel-button { filter: invert(1); opacity: .5; }
kbd { font: 600 11px var(--font); color: var(--text3); padding: 4px 7px; border-radius: 7px; background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--hair); }
#account { text-align: right; font-size: 12px; color: var(--text3); line-height: 1.35; }
#account strong { color: var(--text); font-weight: 600; font-size: 13px; }
#account .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 8px #3ddc84; margin-right: 6px; vertical-align: 1px; }

.view { flex: 1; min-height: 0; animation: viewIn .5s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- HOME ---------- */
#home { overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; margin-left: calc(-1 * var(--rail) - 6px); padding-left: calc(var(--rail) + 6px); }
#hero { position: relative; height: min(76vh, 760px); min-height: 480px; margin-left: calc(-1 * var(--rail) - 6px); overflow: hidden; }
.heroBg { position: absolute; inset: 0; }
.heroBg .slide { position: absolute; inset: 0; background-size: cover; background-position: center 20%; opacity: 0; transform: scale(1.08); transition: opacity 1.4s var(--ease), transform 9s linear; }
.heroBg .slide.on { opacity: 1; transform: scale(1); }
.heroShade { position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(5, 6, 8, 0.92) 0%, rgba(5, 6, 8, 0.6) 32%, rgba(5, 6, 8, 0) 62%),
  linear-gradient(0deg, var(--bg) 0%, rgba(5, 6, 8, 0.4) 26%, rgba(5, 6, 8, 0) 50%),
  linear-gradient(180deg, rgba(5, 6, 8, 0.6) 0%, rgba(5, 6, 8, 0) 18%); }
.heroContent { position: absolute; left: calc(var(--rail) + 52px); bottom: 21%; width: min(600px, 52vw); }
.heroContent > * { animation: rise .9s var(--ease) both; }
.heroContent > *:nth-child(2) { animation-delay: .06s; } .heroContent > *:nth-child(3) { animation-delay: .12s; } .heroContent > *:nth-child(4) { animation-delay: .18s; } .heroContent > *:nth-child(5) { animation-delay: .24s; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } to { opacity: 1; transform: none; filter: none; } }
.heroContent .eyebrow { color: var(--accent); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.heroContent .eyebrow::before { content: ""; width: 18px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }
.heroTitle { font-size: clamp(38px, 5.2vw, 72px); line-height: 0.98; font-weight: 800; letter-spacing: -0.045em; margin: 0 0 16px; text-wrap: balance; text-shadow: 0 4px 40px rgba(0, 0, 0, 0.5); }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--text2); font-size: 13.5px; margin-bottom: 16px; }
.meta .tag { padding: 3px 9px; border-radius: 7px; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px var(--hair); font-weight: 600; font-size: 11.5px; letter-spacing: 0.04em; color: var(--text); }
.meta .rate { color: var(--gold); font-weight: 650; display: inline-flex; align-items: center; gap: 4px; }
.meta .rate svg { width: 14px; height: 14px; fill: var(--gold); stroke: none; }
.meta .sep { width: 3px; height: 3px; border-radius: 50%; background: var(--text3); }
.heroPlot { color: var(--text2); font-size: 15.5px; line-height: 1.55; margin: 0 0 26px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; max-width: 540px; }
.heroBtns { display: flex; gap: 12px; }
.heroDots { position: absolute; right: 44px; bottom: 23%; display: flex; gap: 8px; }
.heroDots button { width: 8px; height: 8px; border-radius: 8px; background: rgba(255, 255, 255, 0.3); transition: width .4s var(--ease), background .3s; overflow: hidden; position: relative; }
.heroDots button.on { width: 34px; background: rgba(255, 255, 255, 0.25); }
.heroDots button.on::after { content: ""; position: absolute; inset: 0; background: #fff; transform-origin: left; animation: dotfill 8s linear forwards; }
@keyframes dotfill { from { transform: scaleX(0); } to { transform: scaleX(1); } }

#rails { position: relative; margin-top: -11vh; padding-bottom: 60px; }
.rail { margin-bottom: 38px; }
.railHead { display: flex; align-items: baseline; gap: 12px; padding: 0 40px 0 12px; margin-bottom: 14px; }
.railHead h3 { margin: 0; font-size: 21px; font-weight: 700; letter-spacing: -0.025em; }
.railHead .sub { color: var(--text3); font-size: 13px; }
.railHead .more { margin-left: auto; color: var(--text2); font-size: 13px; font-weight: 550; display: inline-flex; align-items: center; gap: 2px; padding: 4px 8px; border-radius: 8px; }
.railHead .more:hover { color: #fff; background: var(--surface2); }
.railHead .more svg { width: 15px; height: 15px; }
.railWrap { position: relative; }
.railScroll { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x proximity; padding: 10px 40px 22px 12px; scroll-padding-left: 12px; scrollbar-width: none; }
.railScroll::-webkit-scrollbar { display: none; }
.railScroll > * { scroll-snap-align: start; flex: none; }
.railNav { position: absolute; top: 10px; bottom: 22px; width: 54px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .25s; z-index: 3; }
.railWrap:hover .railNav { opacity: 1; }
.railNav.l { left: 0; background: linear-gradient(90deg, var(--bg), transparent); }
.railNav.r { right: 0; background: linear-gradient(270deg, var(--bg), transparent); }
.railNav span { width: 40px; height: 40px; }

/* poster card */
.card { width: 168px; cursor: pointer; position: relative; }
.grid .card { width: auto; }
.poster { position: relative; aspect-ratio: 2/3; border-radius: 14px; overflow: hidden; background: linear-gradient(145deg, #1a1d26, #0e1016); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 1px var(--hair); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.poster img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .6s; }
.poster img.ok { opacity: 1; }
.poster .ph { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 14px; font-weight: 700; font-size: 15px; letter-spacing: -0.02em; line-height: 1.15; color: var(--text2); background: radial-gradient(120% 90% at 20% 0%, rgba(138, 180, 255, 0.18), transparent 60%), radial-gradient(100% 80% at 100% 100%, rgba(199, 165, 255, 0.14), transparent 60%); }
.poster::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(115deg, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 32%); opacity: 0; transition: opacity .45s; pointer-events: none; }
.card:hover .poster { transform: translateY(-6px) scale(1.04); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.22), 0 0 50px -10px rgba(138, 180, 255, 0.35); }
.card:hover .poster::after { opacity: 1; }
.card .badges { position: absolute; top: 9px; left: 9px; right: 9px; display: flex; gap: 6px; z-index: 2; }
.badge { height: 22px; padding: 0 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: 0.03em; background: rgba(10, 12, 18, 0.55); backdrop-filter: blur(12px) saturate(1.5); -webkit-backdrop-filter: blur(12px) saturate(1.5); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); }
.badge.r { color: var(--gold); }
.badge.r svg { width: 11px; height: 11px; fill: var(--gold); stroke: none; }
.card .fav { margin-left: auto; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(10, 12, 18, 0.55); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14); opacity: 0; transform: scale(.8); transition: opacity .25s, transform .25s var(--ease); }
.card .fav svg { width: 15px; height: 15px; }
.card:hover .fav, .card .fav.on { opacity: 1; transform: none; }
.card .fav.on { color: var(--gold); }
.card .fav.on svg { fill: var(--gold); stroke: var(--gold); }
.card .t { margin-top: 11px; font-weight: 600; font-size: 13.5px; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .s { color: var(--text3); font-size: 12px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* landscape "continue watching" card */
.wide { width: 300px; cursor: pointer; }
.wide .thumb { position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: #12141b center/cover; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 0 0 1px var(--hair); transition: transform .45s var(--ease), box-shadow .45s; }
.wide .thumb::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0, 0, 0, 0.75), transparent 55%); }
.wide:hover .thumb { transform: translateY(-5px) scale(1.03); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.22); }
.wide .playIco { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.18); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); opacity: 0; transform: scale(.85); transition: all .35s var(--ease); }
.wide:hover .playIco { opacity: 1; transform: none; }
.wide .playIco svg { width: 20px; height: 20px; margin-left: 3px; }
.wide .cap { position: absolute; left: 14px; right: 14px; bottom: 14px; }
.wide .cap .t { font-weight: 650; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wide .cap .s { font-size: 12px; color: var(--text2); }
.prog { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.22); margin-top: 8px; overflow: hidden; }
.prog i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 10px var(--accent); }

/* channel tile (home rail) */
.tile { width: 176px; cursor: pointer; }
.tile .box { aspect-ratio: 16/10; border-radius: 16px; display: flex; align-items: center; justify-content: center; padding: 22px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.025)); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), inset 0 1px 0.5px rgba(255, 255, 255, 0.25), inset 0 0 0 1px var(--hair); transition: transform .4s var(--ease), box-shadow .4s; position: relative; }
.tile .box img { max-width: 100%; max-height: 100%; object-fit: contain; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.5)); }
.tile .box .ini { font-weight: 800; font-size: 22px; letter-spacing: -0.03em; color: var(--text2); }
.tile:hover .box { transform: translateY(-5px) scale(1.04); box-shadow: 0 24px 50px rgba(0, 0, 0, 0.55), inset 0 1px 0.5px rgba(255, 255, 255, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.2); }
.tile .box .liveDot { position: absolute; top: 10px; right: 10px; }
.tile .t { margin-top: 10px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; color: var(--text2); }
.liveDot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); box-shadow: 0 0 0 0 rgba(255, 59, 78, 0.6); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 59, 78, 0.55); } 70% { box-shadow: 0 0 0 8px rgba(255, 59, 78, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 59, 78, 0); } }

/* ---------- BROWSE ---------- */
#browse { display: flex; padding-top: 76px; min-height: 0; }
#catPanel { width: 290px; flex: none; display: flex; flex-direction: column; gap: 12px; padding: 8px 14px 16px 6px; min-height: 0; }
.panelHead { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 6px; }
.panelHead h1 { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -0.04em; }
.select { position: relative; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 10px; max-width: 150px; }
.select svg { width: 15px; height: 15px; color: var(--text2); }
.select select { appearance: none; -webkit-appearance: none; border: 0; outline: 0; background: none; font-size: 12.5px; font-weight: 550; width: 100%; cursor: pointer; text-overflow: ellipsis; }
.select select option { background: #15171e; }
#chips { display: flex; flex-wrap: wrap; gap: 6px; padding-left: 4px; }
#chips button { height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); transition: all .2s var(--ease); }
#chips button:hover { color: #fff; background: var(--surface2); }
#chips button.active { color: #0a0b10; background: linear-gradient(135deg, #fff, #dfe8ff); box-shadow: 0 6px 18px rgba(138, 180, 255, 0.3); }
#cats { list-style: none; margin: 0; padding: 0 4px 0 0; overflow-y: auto; flex: 1; min-height: 0; }
#cats li { height: 38px; padding: 0 12px; border-radius: 11px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--text2); font-weight: 500; font-size: 13.5px; transition: background .15s, color .15s; }
#cats li span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#cats li:hover { background: var(--surface); color: var(--text); }
#cats li.active { background: rgba(255, 255, 255, 0.11); color: #fff; box-shadow: inset 0 1px 0.5px rgba(255, 255, 255, 0.18), inset 0 0 0 1px var(--hair); }
#cats li span:first-child { flex: 1; }
#cats li .ct { font-size: 9.5px; font-weight: 750; letter-spacing: 0.06em; color: var(--text3); padding: 1px 5px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--hair2); }
#cats li .n { color: var(--text3); font-size: 11.5px; font-variant-numeric: tabular-nums; font-weight: 600; }
#cats li.special { color: var(--text); }
#cats li.sep { height: 1px; padding: 0; margin: 8px 12px; background: var(--hair); pointer-events: none; }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text3); padding-left: 8px; cursor: pointer; user-select: none; }
.toggle input { display: none; }
.toggle .sw { width: 32px; height: 19px; border-radius: 19px; background: rgba(255, 255, 255, 0.14); position: relative; transition: background .25s; }
.toggle .sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 15px; height: 15px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4); transition: transform .3s var(--ease); }
.toggle input:checked + .sw { background: #34c759; }
.toggle input:checked + .sw::after { transform: translateX(13px); }

#content { flex: 1; min-width: 0; overflow-y: auto; padding: 8px 32px 40px 18px; }
#listHeader { display: flex; align-items: baseline; gap: 12px; margin: 6px 0 20px; }
#listHeader h2 { margin: 0; font-size: 24px; font-weight: 750; letter-spacing: -0.03em; }
#listCount { color: var(--text3); font-size: 13px; font-weight: 500; }
#sentinel { height: 40px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 30px 20px; }
.secTitle { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; margin: 26px 0 14px; }
.secTitle:first-child { margin-top: 0; }

/* channel rows */
.chanList { display: flex; flex-direction: column; gap: 3px; }
.chan { display: flex; align-items: center; gap: 14px; height: 62px; padding: 0 14px 0 8px; border-radius: 14px; cursor: pointer; transition: background .15s, transform .2s var(--ease); }
.chan:hover { background: var(--surface); }
.chan .no { width: 30px; text-align: right; color: var(--text3); font-size: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
.chan .lg { width: 64px; height: 44px; flex: none; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 6px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.02)); box-shadow: inset 0 0 0 1px var(--hair); }
.chan .lg img { max-width: 100%; max-height: 100%; object-fit: contain; }
.chan .lg .ini { font-weight: 800; font-size: 13px; color: var(--text3); }
.chan .nm { flex: 1; min-width: 0; }
.chan .nm .a { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chan .nm .b { font-size: 12px; color: var(--text3); display: flex; gap: 6px; align-items: center; }
.chan .q { font-size: 10px; font-weight: 800; letter-spacing: 0.05em; padding: 2px 6px; border-radius: 5px; color: var(--text2); box-shadow: inset 0 0 0 1px var(--hair2); }
.chan .q.k4 { color: #ffd98a; box-shadow: inset 0 0 0 1px rgba(255, 217, 138, 0.45); }
.chan .star { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--text3); opacity: 0; transition: opacity .2s, color .2s; }
.chan .star svg { width: 17px; height: 17px; }
.chan:hover .star, .chan .star.on { opacity: 1; }
.chan .star:hover { color: #fff; background: var(--surface2); }
.chan .star.on { color: var(--gold); }
.chan .star.on svg { fill: var(--gold); }
.chan.playing { background: linear-gradient(90deg, rgba(138, 180, 255, 0.16), rgba(199, 165, 255, 0.06)); box-shadow: inset 0 0 0 1px rgba(138, 180, 255, 0.25); }
.chan.playing .no { color: var(--accent); }
.eq { display: none; gap: 2px; align-items: flex-end; height: 14px; }
.chan.playing .eq { display: inline-flex; }
.eq i { width: 3px; background: var(--accent); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.3s; } .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%, 100% { height: 4px; } 50% { height: 14px; } }

/* live player */
#livePlayer { width: min(46%, 860px); flex: none; padding: 8px 28px 24px 4px; min-height: 0; display: flex; animation: slideIn .5s var(--ease); }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
.playerCard { flex: 1; display: flex; flex-direction: column; border-radius: 24px; overflow: hidden; background: rgba(12, 14, 20, 0.7); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 1px var(--hair), inset 0 1px 0.5px rgba(255, 255, 255, 0.15); backdrop-filter: blur(30px); -webkit-backdrop-filter: blur(30px); min-height: 0; }
.videoWrap { position: relative; background: #000; aspect-ratio: 16/9; flex: none; }
.videoWrap video { width: 100%; height: 100%; display: block; background: #000; }
.status { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; pointer-events: none; color: #fff; font-size: 14px; font-weight: 500; text-align: center; padding: 30px; text-shadow: 0 2px 12px #000; }
.status:empty { display: none; }
.status.loading::before { content: ""; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, 0.15); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.liveBadge { position: absolute; top: 14px; left: 14px; display: flex; align-items: center; gap: 7px; height: 26px; padding: 0 11px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: 0.12em; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); }
.liveBadge i { width: 7px; height: 7px; border-radius: 50%; background: var(--live); animation: pulse 2s infinite; }
.bufPill { position: absolute; top: 14px; right: 14px; height: 26px; padding: 0 11px; border-radius: 999px; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(0, 0, 0, 0.45); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15); opacity: 0; transition: opacity .3s; }
.bufPill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.bufPill:empty { display: none; }
.videoWrap:hover .bufPill, .bufPill.low { opacity: 1; }
.bufPill.ok { color: #3ddc84; } .bufPill.mid { color: var(--gold); } .bufPill.low { color: #ff6b7a; }
#liveVersions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 12px 18px; border-bottom: 1px solid var(--hair); }
#liveVersions:empty { display: none; }
#liveVersions .eyebrow { margin-right: 6px; }
#liveVersions button { height: 28px; padding: 0 12px; border-radius: 999px; font-size: 12px; font-weight: 700; color: var(--text2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); transition: all .2s; }
#liveVersions button:hover { color: #fff; background: var(--surface2); }
#liveVersions button.on { color: #0a0b10; background: #fff; }
.vctl { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 10px; padding: 40px 14px 14px; background: linear-gradient(0deg, rgba(0, 0, 0, 0.7), transparent); opacity: 0; transition: opacity .3s; }
.videoWrap:hover .vctl { opacity: 1; }
.vctl .iconBtn { width: 38px; height: 38px; }
.vctl .iconBtn svg { width: 18px; height: 18px; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.25); outline: 0; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5); transition: transform .15s; }
input[type=range]:hover::-webkit-slider-thumb { transform: scale(1.25); }
#liveVol { width: 90px; }
.nowBar { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--hair); }
.chLogo { width: 58px; height: 40px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; padding: 5px; background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)); box-shadow: inset 0 0 0 1px var(--hair); }
.chLogo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.nowText { flex: 1; min-width: 0; }
.nowText strong { display: block; font-size: 16px; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#liveFav.on { color: var(--gold); }
#liveFav.on svg { stroke: var(--gold); }
#epg { padding: 16px 18px; overflow-y: auto; flex: 1; min-height: 0; }
#epg .p { position: relative; padding: 12px 14px 12px 16px; border-radius: 14px; margin-bottom: 6px; }
#epg .p.now { background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); }
#epg .p .tm { font-size: 12px; font-weight: 650; color: var(--text3); font-variant-numeric: tabular-nums; display: flex; align-items: center; gap: 8px; }
#epg .p.now .tm { color: var(--accent); }
#epg .p.now .tm::after { content: "ON NOW"; font-size: 10px; letter-spacing: 0.1em; color: var(--live); }
#epg .p .tt { font-weight: 650; font-size: 14.5px; margin-top: 2px; }
#epg .p .ds { color: var(--text2); font-size: 12.5px; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
#epg .empty { color: var(--text3); font-size: 13px; padding: 10px 0; }

/* ---------- detail sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; }
#modal { background: rgba(0, 0, 0, 0.55); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); display: flex; align-items: center; justify-content: center; padding: 3vh 3vw; animation: fade .35s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.sheet { position: relative; width: min(1180px, 100%); max-height: 100%; overflow-y: auto; border-radius: 28px; background: #0a0b10; box-shadow: 0 40px 120px rgba(0, 0, 0, 0.8), inset 0 0 0 1px var(--hair2); animation: sheetIn .55s var(--ease); scrollbar-width: thin; }
@keyframes sheetIn { from { opacity: 0; transform: translateY(30px) scale(.97); } }
.sheet .close { position: sticky; float: right; top: 18px; margin: 18px 18px -58px 0; z-index: 5; }
.dHero { position: relative; min-height: 520px; display: flex; align-items: flex-end; padding: 60px 52px 44px; background-size: cover; background-position: center 18%; }
.dHero::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, #0a0b10 0%, rgba(10, 11, 16, 0.85) 34%, rgba(10, 11, 16, 0.2) 70%, rgba(10, 11, 16, 0.4) 100%), linear-gradient(0deg, #0a0b10 0%, rgba(10, 11, 16, 0) 45%); }
.dHero > * { position: relative; }
.dInner { display: flex; gap: 36px; align-items: flex-end; width: 100%; }
.dPoster { width: 210px; flex: none; aspect-ratio: 2/3; border-radius: 16px; background: #15171e center/cover; box-shadow: 0 30px 70px rgba(0, 0, 0, 0.7), inset 0 0 0 1px rgba(255, 255, 255, 0.12); animation: rise .8s var(--ease) both; }
.dText { flex: 1; min-width: 0; max-width: 680px; }
.dText > * { animation: rise .8s var(--ease) both; }
.dText > *:nth-child(2) { animation-delay: .05s; } .dText > *:nth-child(3) { animation-delay: .1s; } .dText > *:nth-child(4) { animation-delay: .15s; } .dText > *:nth-child(5) { animation-delay: .2s; }
.dTitle { margin: 6px 0 14px; font-size: clamp(32px, 4vw, 52px); font-weight: 800; letter-spacing: -0.045em; line-height: 1; text-wrap: balance; }
.dPlot { color: var(--text2); font-size: 15px; line-height: 1.6; margin: 0 0 24px; }
.dBtns { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dBtns .iconBtn { width: 48px; height: 48px; }
.dBtns .iconBtn.on { color: var(--gold); }
.verRow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 22px; }
.verRow .eyebrow { margin-right: 6px; }
.verRow button { height: 30px; padding: 0 12px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--text2); background: rgba(255, 255, 255, 0.07); box-shadow: inset 0 0 0 1px var(--hair2); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: all .2s; }
.verRow button:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.verRow button.on { color: #0a0b10; background: #fff; }
.verRow button i { font-style: normal; font-size: 10px; font-weight: 800; color: var(--gold); margin-left: 3px; }
.verRow button.on i { color: #a0700a; }
.credits { display: grid; grid-template-columns: 110px 1fr; gap: 8px 18px; padding: 0 52px 36px; font-size: 13.5px; }
.credits dt { color: var(--text3); font-weight: 550; }
.credits dd { margin: 0; color: var(--text2); }
.seasons { display: flex; gap: 8px; padding: 6px 52px 18px; overflow-x: auto; position: sticky; top: 0; z-index: 4; background: linear-gradient(#0a0b10 70%, transparent); }
.seasons button { height: 36px; padding: 0 16px; border-radius: 999px; font-weight: 600; font-size: 13px; color: var(--text2); background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); flex: none; transition: all .2s; }
.seasons button:hover { color: #fff; background: var(--surface2); }
.seasons button.active { color: #0a0b10; background: #fff; }
.episodes { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px 18px; padding: 0 52px 52px; }
.ep { cursor: pointer; }
.ep .thumb { position: relative; aspect-ratio: 16/9; border-radius: 14px; overflow: hidden; background: linear-gradient(145deg, #1a1d26, #0e1016) center/cover; box-shadow: inset 0 0 0 1px var(--hair); transition: transform .4s var(--ease), box-shadow .4s; }
.ep:hover .thumb { transform: scale(1.03); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.2); }
.ep .thumb .playIco { position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); opacity: 0; transition: opacity .3s; }
.ep .thumb .playIco svg { margin-left: 3px; }
.ep:hover .thumb .playIco { opacity: 1; }
.ep .thumb .dur { position: absolute; right: 8px; bottom: 8px; }
.ep .thumb .prog { position: absolute; left: 10px; right: 10px; bottom: 8px; margin: 0; }
.ep .et { margin-top: 10px; font-weight: 650; font-size: 14px; display: flex; gap: 8px; align-items: baseline; }
.ep .et .n { color: var(--text3); font-variant-numeric: tabular-nums; }
.ep .et .vlc { margin-left: auto; font-size: 11px; color: var(--text3); padding: 2px 8px; border-radius: 6px; box-shadow: inset 0 0 0 1px var(--hair); }
.ep .et .vlc:hover { color: #fff; }
.ep .ed { color: var(--text3); font-size: 12.5px; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ep.last .et::before { content: "Up next"; font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); font-weight: 750; }

/* ---------- VOD player ---------- */
#vodPlayer { background: #000; animation: fade .3s; }
#vodPlayer video { position: absolute; inset: 0; width: 100%; height: 100%; background: #000; }
#vodPlayer .status { z-index: 2; }
.vodTop { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; align-items: center; gap: 14px; padding: 22px 26px 60px; background: linear-gradient(180deg, rgba(0, 0, 0, 0.75), transparent); transition: opacity .45s; }
.vodTitle strong { display: block; font-size: 18px; letter-spacing: -0.02em; }
.vodTitle .eyebrow { color: var(--text2); }
.vodBottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; padding: 70px 34px 22px; background: linear-gradient(0deg, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.4) 55%, transparent); transition: opacity .45s; }
#vodPlayer.idle .vodTop, #vodPlayer.idle .vodBottom { opacity: 0; pointer-events: none; }
#vodPlayer.idle { cursor: none; }

.timeline { position: relative; height: 22px; display: flex; align-items: center; margin-bottom: 8px; }
.tlTrack { position: absolute; left: 0; right: 0; height: 5px; border-radius: 5px; background: rgba(255, 255, 255, 0.18); overflow: hidden; transition: height .2s var(--ease); }
.timeline:hover .tlTrack { height: 8px; }
.tlTrack i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; }
.tlBuf { background: rgba(255, 255, 255, 0.28); }
.tlPlay { background: linear-gradient(90deg, var(--accent), var(--accent2)); box-shadow: 0 0 14px rgba(138, 180, 255, 0.6); }
#vSeek { position: absolute; left: 0; right: 0; width: 100%; height: 22px; margin: 0; background: transparent; opacity: 0; cursor: pointer; }
.tlTip { position: absolute; bottom: 30px; transform: translateX(-50%); padding: 5px 10px; border-radius: 9px; font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; background: rgba(20, 22, 30, 0.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: inset 0 0 0 1px var(--hair2); opacity: 0; transition: opacity .15s; pointer-events: none; }
.timeline:hover .tlTip { opacity: 1; }

.vbar { display: flex; align-items: center; gap: 6px; }
.vbtn { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; transition: background .2s, transform .2s var(--ease); }
.vbtn:hover { background: rgba(255, 255, 255, 0.14); transform: scale(1.06); }
.vbtn svg { width: 24px; height: 24px; }
#vPlay svg { width: 26px; height: 26px; }
.vbtn.on { color: var(--accent); }
.vvol { display: flex; align-items: center; }
.vvol input { width: 0; opacity: 0; transition: width .3s var(--ease), opacity .3s; }
.vvol:hover input, .vvol input:focus { width: 90px; opacity: 1; margin: 0 8px 0 2px; }
.vtime { margin-left: 8px; font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text2); }
.vtime b { color: #fff; font-weight: 650; }
.vchips { display: flex; gap: 6px; margin-right: 6px; }
.vchips span { height: 24px; padding: 0 9px; border-radius: 7px; display: inline-flex; align-items: center; font-size: 11px; font-weight: 750; letter-spacing: 0.04em; color: var(--text2); box-shadow: inset 0 0 0 1px var(--hair2); }

/* track menu */
.vmenu { position: absolute; z-index: 5; right: 30px; bottom: 96px; display: flex; gap: 0; max-height: calc(100vh - 200px); border-radius: 22px; overflow: hidden;
  background: rgba(22, 24, 32, 0.78); backdrop-filter: blur(40px) saturate(1.8); -webkit-backdrop-filter: blur(40px) saturate(1.8);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6), inset 0 1px 0.5px rgba(255, 255, 255, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.1); animation: menuIn .35s var(--ease); transform-origin: bottom right; }
@keyframes menuIn { from { opacity: 0; transform: translateY(10px) scale(.96); } }
.vcol { width: 270px; padding: 16px 8px 12px; overflow-y: auto; }
.vcol + .vcol { border-left: 1px solid var(--hair); }
.vcol h4 { margin: 0 12px 8px; font-size: 11px; font-weight: 750; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text3); }
.vopt { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; text-align: left; color: var(--text); transition: background .15s; }
.vopt:hover { background: rgba(255, 255, 255, 0.09); }
.vopt .ck { width: 18px; flex: none; color: var(--accent); opacity: 0; }
.vopt .ck svg { width: 18px; height: 18px; stroke-width: 2.4; }
.vopt.on .ck { opacity: 1; }
.vopt .tx { flex: 1; min-width: 0; }
.vopt .tx b { display: block; font-weight: 600; font-size: 14px; }
.vopt .tx small { display: block; color: var(--text3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vopt[disabled] { opacity: .4; cursor: not-allowed; }
.vopt .tag { font-size: 10px; font-weight: 750; padding: 2px 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--hair2); color: var(--text2); }
.vsizes { display: flex; gap: 6px; padding: 10px 12px 2px; }
.vsizes button { flex: 1; height: 32px; border-radius: 10px; font-weight: 700; color: var(--text2); background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1px var(--hair); }
.vsizes button.on { background: #fff; color: #0a0b10; }
.vnote { margin: 10px 12px 0; font-size: 11.5px; color: var(--text3); line-height: 1.45; }
.vloading { padding: 10px 12px; color: var(--text3); font-size: 13px; }

/* subtitles */
.subs { position: absolute; z-index: 2; left: 8%; right: 8%; bottom: 9%; display: flex; flex-direction: column; align-items: center; gap: 4px; pointer-events: none; transition: bottom .45s var(--ease); --subSize: 2.6vw; }
#vodPlayer:not(.idle) .subs { bottom: 150px; }
.subs span { max-width: 100%; text-align: center; font-size: clamp(16px, var(--subSize), 52px); font-weight: 600; line-height: 1.28; letter-spacing: -0.005em; color: #fff; padding: 2px 12px; border-radius: 8px; background: rgba(0, 0, 0, 0.45); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); white-space: pre-line; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.subs.s1 { --subSize: 2vw; } .subs.s3 { --subSize: 3.3vw; }

/* ---------- settings ---------- */
.settings { padding: 44px 48px 40px; max-width: 760px; }
.settings h2 { margin: 6px 0 24px; font-size: 32px; font-weight: 800; letter-spacing: -0.04em; }
.prof { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 18px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); margin-bottom: 10px; transition: background .2s; }
.prof.active { background: linear-gradient(120deg, rgba(138, 180, 255, 0.14), rgba(199, 165, 255, 0.07)); box-shadow: inset 0 0 0 1px rgba(138, 180, 255, 0.35); }
.prof .av { width: 44px; height: 44px; border-radius: 13px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; background: conic-gradient(from 200deg, #8ab4ff, #c7a5ff, #ff9ecf, #8ab4ff); color: #0a0b10; flex: none; }
.prof .grow { flex: 1; min-width: 0; }
.prof .grow strong { font-size: 15px; }
.prof .grow .in { font-size: 10px; letter-spacing: 0.1em; font-weight: 750; color: #3ddc84; margin-left: 8px; }
.prof .sub { color: var(--text3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.form { display: grid; gap: 14px; margin-top: 30px; padding-top: 28px; border-top: 1px solid var(--hair); }
.form h3 { margin: 0; font-size: 18px; letter-spacing: -0.02em; }
.form label { display: grid; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text3); }
.form textarea { min-height: 76px; padding: 10px 14px; resize: vertical; line-height: 1.5; height: auto; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.err { color: #ff6b7a; font-size: 13px; }
.okmsg { color: var(--text3); font-size: 13px; }

/* toast + skeletons + empty */
#toast { position: fixed; z-index: 90; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 13.5px; background: rgba(30, 32, 40, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), inset 0 0 0 1px var(--hair2); transition: all .4s var(--ease); pointer-events: none; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
.sk { position: relative; overflow: hidden; background: rgba(255, 255, 255, 0.05); border-radius: 14px; }
.sk::after { content: ""; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.empty { color: var(--text3); padding: 80px 20px; text-align: center; font-size: 15px; }
.empty b { display: block; color: var(--text); font-size: 20px; letter-spacing: -0.02em; margin-bottom: 6px; }

@media (max-width: 1180px) {
  #catPanel { width: 236px; }
  #livePlayer { position: absolute; right: 0; top: 70px; bottom: 0; width: min(560px, 62%); z-index: 15; }
  #account { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- desktop app (Electron) ---------- */
html.electron #top { -webkit-app-region: drag; }
html.electron #top > *, html.electron #top input, html.electron #top button { -webkit-app-region: no-drag; }
html.electron:not(.fs) #rail { top: 44px; }
html.electron .vodTop { -webkit-app-region: drag; }
html.electron .vodTop > * { -webkit-app-region: no-drag; }
html.electron:not(.fs) .vodTop { padding-left: 92px; }

/* shared link: no account editing or VLC (it would open on the host Mac) */
html[data-remote] #settings, html[data-remote] #liveVlc, html[data-remote] #vodVlc, html[data-remote] #mVlc, html[data-remote] .et .vlc, html[data-remote] #refresh { display: none !important; }

/* ---------- phones & small tablets ---------- */
#liveClose { display: none; }
@media (hover: none) {
  .chan .star { opacity: .55; }
  .card .fav { opacity: 1; transform: none; }
  .vctl { opacity: 1; }
  .card:hover .poster { transform: none; }
}
@media (max-width: 760px) {
  :root { --rail: 0px; --tabs: calc(66px + env(safe-area-inset-bottom)); }
  html, body { font-size: 14px; }

  /* side rail → floating glass tab bar */
  #rail, #rail:hover { left: 10px; right: 10px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); width: auto; height: 62px; flex-direction: row; justify-content: space-around; padding: 0 6px; gap: 0; border-radius: 24px; }
  #rail .logo, #rail .grow { display: none; }
  #rail button { width: auto; flex: 1; height: 52px; flex-direction: column; justify-content: center; gap: 3px; padding: 0; border-radius: 16px; }
  #rail button span, #rail:hover button span { opacity: 1; font-size: 10px; font-weight: 600; letter-spacing: 0; }
  #rail button svg { width: 22px; height: 22px; }
  #rail button.active { background: rgba(255, 255, 255, 0.12); }
  #rail button.active::before { left: 30%; right: 30%; top: auto; bottom: -5px; width: auto; height: 3px; }

  #app { margin-left: 0; }
  #top { padding: calc(10px + env(safe-area-inset-top)) 12px 0; gap: 8px; }
  #top::before { inset: 0 0 -24px 0; }
  #searchBox, #searchBox:focus-within { flex: 1; width: auto; height: 42px; }
  #searchBox kbd, #account, #top .spacer { display: none; }
  #search { font-size: 16px; } /* 16px stops iOS from zooming into the field */

  /* home */
  #home { margin-left: 0; padding-left: 0; padding-bottom: calc(var(--tabs) + 10px); }
  #hero { margin-left: 0; height: 68vh; min-height: 440px; max-height: 640px; }
  .heroContent { left: 18px; right: 18px; width: auto; bottom: 15%; }
  .heroTitle { font-size: clamp(30px, 9vw, 44px); margin-bottom: 10px; }
  .heroPlot { font-size: 14px; margin-bottom: 18px; -webkit-line-clamp: 2; }
  .heroBtns .btnPlay { flex: 1; justify-content: center; }
  .heroDots, .railHead .sub { display: none; }
  .railHead .more { white-space: nowrap; }
  .heroContent { bottom: 11%; }
  #rails { margin-top: -6vh; }
  .rail { margin-bottom: 26px; }
  .railHead { padding: 0 16px; margin-bottom: 4px; }
  .railScroll { gap: 10px; padding: 8px 16px 16px; scroll-padding-left: 16px; }
  .railNav { display: none; }
  .railHead h3 { font-size: 18px; }
  .card { width: 118px; }
  .card .t { font-size: 12.5px; margin-top: 8px; }
  .card .fav { display: none; }
  .card .badges { top: 7px; left: 7px; right: 7px; gap: 4px; }

  /* browse: categories become a sideways row above the list */
  #browse { flex-direction: column; padding-top: calc(60px + env(safe-area-inset-top)); }
  #catPanel { width: auto; flex: none; gap: 8px; padding: 6px 0 4px; }
  .panelHead { padding: 0 14px; }
  .panelHead h1 { font-size: 26px; }
  #chips, #cats { flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 0 14px; }
  #chips::-webkit-scrollbar, #cats::-webkit-scrollbar { display: none; }
  #chips button { flex: none; height: 30px; }
  #cats { display: flex; gap: 6px; flex: none; }
  #cats li { flex: none; height: 32px; max-width: 220px; border-radius: 999px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--hair); font-size: 12.5px; padding: 0 12px; }
  #cats li.sep, #cats li .n { display: none; }
  #cats li.sk { width: 96px; }
  #catFilter, #catPanel .toggle { display: none; }
  #content { padding: 6px 14px calc(var(--tabs) + 20px); }
  #listHeader { margin: 4px 0 12px; }
  #listHeader h2 { font-size: 19px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 20px 10px; }
  .chan { height: 60px; padding: 0 6px 0 2px; gap: 10px; }
  .chan .no { display: none; }
  .chan .lg { width: 56px; height: 40px; }

  /* live player takes the whole screen */
  #livePlayer, #livePlayer:not(.hidden) { position: fixed; inset: 0; z-index: 45; width: auto; padding: 0; background: var(--bg); animation: fade .25s; }
  .playerCard { border-radius: 0; background: var(--bg); box-shadow: none; padding-top: env(safe-area-inset-top); }
  .nowBar { padding: 12px 14px; gap: 10px; }
  #liveClose { display: inline-flex; flex: none; }
  body:has(#livePlayer:not(.hidden)) #rail { display: none; }
  .nowBar .ghostBtn { height: 36px; padding: 0 12px; font-size: 12.5px; }
  #liveVol { display: none; }
  #epg { padding: 12px 14px calc(20px + env(safe-area-inset-bottom)); }

  /* detail sheet slides up from the bottom */
  #modal { padding: 0 !important; align-items: flex-end; }
  .sheet { border-radius: 24px 24px 0 0; max-height: calc(100% - 20px - env(safe-area-inset-top)); }
  .sheet .close { top: 12px; margin: 12px 12px -56px 0; }
  .dHero { min-height: 0; padding: 120px 18px 24px; background-position: center top; }
  .dHero::before { background: linear-gradient(0deg, #0a0b10 30%, rgba(10, 11, 16, 0.75) 65%, rgba(10, 11, 16, 0.25)) !important; }
  .dInner { flex-direction: column; align-items: flex-start; gap: 18px; }
  .dPoster { width: 120px; }
  .dTitle { font-size: 30px; }
  .dPlot { font-size: 14px; }
  .dBtns .btnPlay { flex: 1; justify-content: center; }
  .seasons { padding: 6px 18px 14px; }
  .credits { padding: 0 18px 28px; grid-template-columns: 90px 1fr; }
  .settings { padding: 28px 18px calc(28px + env(safe-area-inset-bottom)); }
  .settings h2 { font-size: 26px; }
  .prof { flex-wrap: wrap; padding: 14px; }
  .form .row { grid-template-columns: 1fr; }
  .field, .form input, .form textarea { font-size: 16px; }

  /* movie player */
  .vodTop { padding: calc(12px + env(safe-area-inset-top)) 14px 50px; gap: 10px; }
  .vodTop .ghostBtn { height: 36px; padding: 0 12px; font-size: 12.5px; }
  .vodBottom { padding: 50px 12px calc(10px + env(safe-area-inset-bottom)); }
  .vbar { gap: 2px; }
  .vvol, .vchips, #vBack10 { display: none; }
  .vtime { font-size: 12px; margin-left: 4px; }
  .vbtn { width: 40px; height: 40px; }
  .vbtn svg { width: 22px; height: 22px; }
  .vmenu { left: 10px; right: 10px; bottom: calc(90px + env(safe-area-inset-bottom)); max-height: 60vh; }
  #vodPlayer:not(.idle) .subs { bottom: 120px; }
  .subs.s1 { --subSize: 4.2vw; } .subs.s2, .subs { --subSize: 5vw; } .subs.s3 { --subSize: 6vw; }
  #toast { bottom: calc(var(--tabs) + 16px); max-width: calc(100% - 32px); text-align: center; }
}
/* phone held sideways: use the width for the picture */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
  #livePlayer, #livePlayer:not(.hidden) { position: fixed; inset: 0; z-index: 45; width: auto; padding: 0; background: #000; }
  .playerCard { border-radius: 0; background: #000; }
  .videoWrap { height: 100vh; aspect-ratio: auto; }
  #liveClose { display: inline-flex; position: fixed; top: 12px; left: calc(12px + env(safe-area-inset-left)); z-index: 5; }
}
