/* Zaplio IPTV Player — shared stylesheet
   TV mode: fixed 1920x1080 canvas, scaled to the screen.
   Touch mode: fluid phone/tablet layout. */

@font-face { font-family: "Outfit"; font-weight: 400; src: url(../fonts/outfit-400.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 500; src: url(../fonts/outfit-500.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 600; src: url(../fonts/outfit-600.woff2) format("woff2"); }
@font-face { font-family: "Outfit"; font-weight: 700; src: url(../fonts/outfit-700.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 400; src: url(../fonts/inter-400.woff2) format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; src: url(../fonts/inter-500.woff2) format("woff2"); }

:root {
  --bg: #06080d;
  --panel: #0b0e16;
  --panel-2: #10141f;
  --panel-3: #171c2a;
  --line: rgba(255, 255, 255, .07);
  --line-2: rgba(255, 255, 255, .12);
  --text: #eef1f8;
  --muted: #8f97ab;
  --dim: #5d6579;
  --accent: #8b6dff;
  --accent-2: #33e0c2;
  --live: #ff4d61;
  --star: #ffc542;
  --focus-bg: #f4f6fb;
  --focus-text: #090c13;
  --display: "Outfit", "TizenSans", "LG Smart UI", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --body: "Inter", "TizenSans", "LG Smart UI", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; overflow: hidden; background: var(--bg); color: var(--text);
  font-family: var(--body); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.tizen, body.tizen html { background: transparent; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; }
img { display: block; }
.hidden { display: none !important; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- video layer (sits beneath the UI) ---------- */
#videoLayer { position: fixed; left: 0; top: 0; width: 0; height: 0; z-index: 0; background: #000; overflow: hidden; }
#videoLayer video, #videoLayer object { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
body.tizen #videoLayer { background: transparent; }
#videoLayer.fit-stretch video { object-fit: fill; }
#videoLayer.fit-zoom video { object-fit: cover; }

/* ---------- app canvas ---------- */
#app { position: absolute; left: 0; top: 0; z-index: 1; overflow: hidden; }
body.tv #app { width: 1920px; height: 1080px; transform-origin: 0 0; font-size: 28px; }
body.touch #app { width: 100%; height: 100%; font-size: 16px; }

.screen { position: absolute; inset: 0; display: none; background: var(--bg); }
.screen.on { display: flex; }
body.tv .screen { left: 120px; }
body.fullscreen .screen, body.fullscreen #rail { visibility: hidden; }

/* ---------- rail / tab bar ---------- */
#rail { position: absolute; z-index: 20; background: var(--panel); display: flex; }
body.tv #rail { left: 0; top: 0; bottom: 0; width: 120px; flex-direction: column; padding: 44px 20px; gap: 10px;
  border-right: 1px solid var(--line); transition: width .22s var(--ease), box-shadow .22s; }
body.tv #rail.open { width: 360px; box-shadow: 40px 0 80px rgba(0, 0, 0, .65); }
.rail-logo { display: flex; align-items: center; gap: 18px; height: 80px; margin-bottom: 30px; padding-left: 10px; color: var(--text); }
.rail-logo svg { width: 60px; height: 60px; flex: none; }
.rail-logo b { font-family: var(--display); font-weight: 700; font-size: 38px; letter-spacing: -.02em; white-space: nowrap; opacity: 0; transition: opacity .2s; }
#rail.open .rail-logo b { opacity: 1; }
.rail-item { display: flex; align-items: center; gap: 22px; height: 76px; padding: 0 22px; border-radius: 20px; color: var(--muted);
  font-family: var(--display); font-size: 30px; font-weight: 500; white-space: nowrap; overflow: hidden; }
.rail-item svg { font-size: 34px; }
.rail-item span { opacity: 0; transition: opacity .2s; }
#rail.open .rail-item span { opacity: 1; }
.rail-item.cur { color: var(--text); }
.rail-item.cur svg { color: var(--accent); }
.rail-item.is-focus { background: var(--focus-bg); color: var(--focus-text); }
.rail-item.is-focus svg { color: var(--focus-text); }
.rail-spacer { flex: 1; }

/* ---------- shared columns ---------- */
.col { display: flex; flex-direction: column; background: var(--panel); border-right: 1px solid var(--line); min-width: 0; }
.col-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 46px 32px 22px; }
.col-head h2 { font-family: var(--display); font-weight: 600; font-size: 34px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.col-head .count { color: var(--dim); font-size: 24px; flex: none; }
.grid { position: relative; flex: 1; overflow: hidden; }
.grid .track { position: absolute; left: 0; top: 0; right: 0; will-change: transform; transition: transform .18s var(--ease); }
.grid .cell { position: absolute; }
.grid .empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--dim); text-align: center; padding: 40px; font-size: 26px; }
body.touch .grid { overflow-y: auto; -webkit-overflow-scrolling: touch; }
body.touch .grid .track { transition: none; transform: none !important; }

/* category rows */
.cat { left: 16px; right: 16px; height: 72px; display: flex; align-items: center; gap: 16px; padding: 0 20px; border-radius: 16px;
  color: var(--muted); font-size: 27px; }
.cat .n { margin-left: auto; color: var(--dim); font-size: 22px; }
.cat .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat svg { font-size: 26px; }
.cat.is-sel { color: var(--text); background: var(--panel-3); }
.cat.is-sel::before { content: ""; position: absolute; left: 0; top: 20px; bottom: 20px; width: 4px; border-radius: 4px; background: var(--accent); }
.cat.is-focus { background: var(--focus-bg); color: var(--focus-text); }
.cat.is-focus .n { color: rgba(9, 12, 19, .55); }

/* channel rows */
.ch { left: 16px; right: 16px; height: 100px; display: flex; align-items: center; gap: 20px; padding: 0 20px; border-radius: 18px; }
.ch .num { width: 64px; color: var(--dim); font-size: 24px; font-variant-numeric: tabular-nums; text-align: right; flex: none; }
.logo { width: 96px; height: 64px; border-radius: 12px; background: var(--panel-3); display: flex; align-items: center; justify-content: center;
  overflow: hidden; flex: none; position: relative; }
.logo img { max-width: 84%; max-height: 80%; object-fit: contain; }
.logo .ini { font-family: var(--display); font-weight: 700; font-size: 26px; color: #fff; letter-spacing: .02em; }
.ch .meta { flex: 1; min-width: 0; }
.ch .nm { font-size: 29px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch .now { margin-top: 6px; display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 22px; }
.ch .now span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); overflow: hidden; flex: none; }
.bar i { display: block; height: 100%; background: var(--accent-2); border-radius: 4px; }
.ch .now .bar { width: 70px; }
.ch .flags { display: flex; gap: 10px; color: var(--star); font-size: 24px; }
.ch.playing .nm { color: var(--accent-2); }
.ch.playing .num::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--live); margin-right: 8px; vertical-align: middle; }
.ch.is-focus { background: var(--focus-bg); color: var(--focus-text); }
.ch.is-focus .num, .ch.is-focus .now { color: rgba(9, 12, 19, .6); }
.ch.is-focus .bar { background: rgba(9, 12, 19, .15); }
.ch.is-focus .bar i { background: var(--accent); }
.ch.is-focus .logo { background: #dfe3ec; }
.ch.is-focus.playing .nm { color: #0a7a68; }
.ch.is-sel { background: var(--panel-3); }

/* ---------- live screen ---------- */
#scr-live .cats { width: 380px; }
#scr-live .chans { width: 660px; }
.pane { position: relative; flex: 1; display: flex; flex-direction: column; padding: 46px 56px 40px 48px; overflow: hidden; min-width: 0; }
#scr-live { background: transparent; }
#scr-live .pane { background: transparent; }
.topbar { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; height: 48px; margin-bottom: 26px; color: var(--muted); }
.topbar .plname { font-size: 24px; display: flex; align-items: center; gap: 12px; }
.topbar .plname i { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-2); }
.topbar .plname.off i { background: var(--dim); }
.tb-r { display: flex; align-items: center; gap: 24px; }
.badge-lic { font-size: 21px; color: var(--star); border: 1px solid rgba(255, 197, 66, .35); border-radius: 10px; padding: 4px 14px; }
.badge-lic:empty { display: none; }
.badge-lic.bad { color: #ff7a85; border-color: rgba(255, 122, 133, .4); }
.clock { font-family: var(--display); font-size: 34px; font-weight: 500; color: var(--text); font-variant-numeric: tabular-nums; }

.slot { position: relative; z-index: 0; width: 100%; aspect-ratio: 16 / 9; border-radius: 24px; box-shadow: 0 0 0 3000px var(--bg); background: transparent; flex: none; }
@supports not (aspect-ratio: 1) { .slot { height: 0; padding-top: 56.25%; } }
.slot-idle { position: absolute; inset: 0; border-radius: 24px; background:
  radial-gradient(120% 90% at 20% 10%, rgba(139, 109, 255, .22), transparent 55%),
  radial-gradient(90% 80% at 90% 100%, rgba(51, 224, 194, .14), transparent 60%), var(--panel-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; color: var(--muted); font-size: 26px; }
.slot-idle svg { width: 84px; height: 84px; opacity: .9; }
.slot-status { position: absolute; left: 24px; bottom: 22px; display: flex; gap: 10px; }
.badge { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 10px; background: rgba(6, 8, 13, .72);
  color: #fff; font-size: 20px; font-weight: 600; letter-spacing: .04em; }
.badge.live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--live); }
.badge.q { background: rgba(139, 109, 255, .9); }
.spin { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, .18); border-top-color: #fff; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.slot-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center;
  padding: 30px; background: rgba(6, 8, 13, .82); border-radius: 24px; font-size: 26px; }
.slot-msg small { color: var(--muted); font-size: 22px; max-width: 80%; }

.info { position: relative; z-index: 1; margin-top: 34px; min-height: 0; flex: 1; display: flex; flex-direction: column; }
.info-head { display: flex; align-items: center; gap: 22px; }
.info-head .logo { width: 120px; height: 80px; }
.info-head h1 { font-family: var(--display); font-weight: 600; font-size: 46px; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-head .sub { color: var(--muted); font-size: 24px; margin-top: 6px; }
.prog { margin-top: 30px; }
.prog .t { font-size: 32px; font-weight: 500; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prog .tm { display: flex; align-items: center; gap: 18px; margin-top: 14px; color: var(--muted); font-size: 23px; font-variant-numeric: tabular-nums; }
.prog .tm .bar { flex: 1; max-width: 360px; height: 6px; }
.prog .d { margin-top: 18px; color: var(--muted); font-size: 23px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.prog .nx { margin-top: 20px; color: var(--dim); font-size: 23px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prog .nx b { color: var(--muted); font-weight: 500; }
.hints { position: relative; z-index: 1; display: flex; gap: 34px; color: var(--dim); font-size: 22px; padding-top: 18px; }
.hints span { display: inline-flex; align-items: center; gap: 10px; }
.hints span { white-space: nowrap; }
.key { white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 32px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--line-2); color: var(--muted); font-size: 18px; font-weight: 600; }
.dot { width: 18px; height: 18px; border-radius: 5px; display: inline-block; }
.dot.r { background: #e5484d; } .dot.g { background: #30a46c; } .dot.y { background: #f5d90a; } .dot.b { background: #3e63dd; }

/* ---------- VOD (movies / series) ---------- */
#scr-movies .cats, #scr-series .cats { width: 380px; }
.vod-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.poster { width: 100%; }
.pc { display: flex; flex-direction: column; gap: 12px; }
.pc .art { position: relative; width: 100%; aspect-ratio: 2 / 3; border-radius: 18px; overflow: hidden; background: var(--panel-3);
  transition: transform .18s var(--ease), box-shadow .18s; }
.pc .art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pc .art .gen { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 18px; font-family: var(--display); font-weight: 700;
  font-size: 30px; line-height: 1.05; letter-spacing: -.01em; }
.pc .art .rt { position: absolute; top: 12px; right: 12px; }
.pc .art .resbar { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; background: rgba(0, 0, 0, .5); }
.pc .art .resbar i { display: block; height: 100%; background: var(--accent-2); }
.pc .tt { font-size: 23px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.pc.is-focus .art { transform: scale(1.06); box-shadow: 0 0 0 5px var(--focus-bg), 0 24px 50px rgba(0, 0, 0, .6); }
.pc.is-focus .tt { color: var(--text); }

/* detail */
#scr-detail { background: var(--bg); }
.dt-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; opacity: .28; filter: blur(2px); }
.dt-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 25%, rgba(6, 8, 13, .55) 70%, rgba(6, 8, 13, .3)),
  linear-gradient(0deg, var(--bg), transparent 50%); }
.dt { position: relative; display: flex; gap: 70px; padding: 90px 100px 60px; width: 100%; }
.dt-poster { width: 360px; flex: none; }
.dt-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dt-body h1 { font-family: var(--display); font-size: 68px; font-weight: 700; letter-spacing: -.025em; line-height: 1.05; }
.dt-meta { display: flex; flex-wrap: wrap; gap: 26px; margin-top: 22px; color: var(--muted); font-size: 25px; }
.dt-meta .star { color: var(--star); }
.dt-plot { margin-top: 28px; color: #c9cfdc; font-size: 26px; line-height: 1.55; max-width: 1100px; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.dt-cast { margin-top: 18px; color: var(--dim); font-size: 22px; max-width: 1100px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.btns { display: flex; gap: 22px; margin-top: 40px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; gap: 14px; height: 76px; padding: 0 38px; border-radius: 20px; background: var(--panel-3);
  font-family: var(--display); font-size: 28px; font-weight: 600; color: var(--text); border: 1px solid var(--line); }
.btn svg { font-size: 30px; }
.btn.primary { background: var(--accent); border-color: transparent; }
.btn.is-focus { background: var(--focus-bg); color: var(--focus-text); border-color: transparent; transform: scale(1.04); }
.seasons { display: flex; gap: 14px; margin-top: 40px; flex-wrap: nowrap; overflow: hidden; }
.chip { height: 58px; padding: 0 26px; border-radius: 16px; display: inline-flex; align-items: center; background: var(--panel-2); color: var(--muted);
  font-size: 24px; white-space: nowrap; border: 1px solid var(--line); flex: none; }
.chip.is-sel { color: var(--text); border-color: var(--accent); }
.chip.is-focus { background: var(--focus-bg); color: var(--focus-text); border-color: transparent; }
.eps { margin-top: 24px; flex: 1; min-height: 300px; }
.ep { left: 0; right: 0; height: 104px; display: flex; align-items: center; gap: 24px; padding: 0 24px; border-radius: 18px; }
.ep .en { width: 60px; color: var(--dim); font-size: 30px; font-family: var(--display); font-weight: 600; text-align: center; flex: none; }
.ep .et { flex: 1; min-width: 0; }
.ep .et b { display: block; font-size: 27px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep .et small { display: block; color: var(--muted); font-size: 21px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep .bar { width: 120px; }
.ep.is-focus { background: var(--focus-bg); color: var(--focus-text); }
.ep.is-focus .en, .ep.is-focus small { color: rgba(9, 12, 19, .6); }

/* ---------- search ---------- */
.page { flex: 1; display: flex; flex-direction: column; padding: 56px 80px 40px; min-width: 0; }
.page h1 { font-family: var(--display); font-size: 54px; font-weight: 700; letter-spacing: -.02em; }
.page .lead { color: var(--muted); font-size: 25px; margin-top: 10px; }
.field { display: flex; align-items: center; gap: 18px; height: 84px; padding: 0 28px; border-radius: 20px; background: var(--panel-2);
  border: 2px solid var(--line); margin-top: 30px; }
.field svg { font-size: 32px; color: var(--muted); }
.field input { flex: 1; min-width: 0; background: transparent; border: 0; outline: 0; font-size: 30px; }
.field input::placeholder { color: var(--dim); }
.field.is-focus { border-color: var(--focus-bg); background: var(--panel-3); }
.field .fl { color: var(--muted); font-size: 22px; width: 190px; flex: none; }
.res { margin-top: 26px; }
.res .ch .kind { color: var(--dim); font-size: 20px; text-transform: uppercase; letter-spacing: .08em; flex: none; }

/* ---------- settings / forms ---------- */
.form { display: flex; flex-direction: column; max-width: 1180px; margin-top: 26px; overflow: hidden; flex: 1; }
.form-scroll { transition: transform .2s var(--ease); }
.row { display: flex; align-items: center; gap: 24px; min-height: 92px; padding: 0 30px; border-radius: 20px; margin-bottom: 8px; background: var(--panel); border: 1px solid var(--line); }
.row .lbl { flex: 1; min-width: 0; }
.row .lbl b { display: block; font-size: 28px; font-weight: 500; }
.row .lbl small { display: block; color: var(--muted); font-size: 21px; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .val { color: var(--accent-2); font-size: 26px; font-weight: 500; display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.row .val svg { color: var(--dim); }
.row.sect { background: transparent; border: 0; min-height: 70px; padding-top: 22px; color: var(--dim); font-size: 22px; text-transform: uppercase; letter-spacing: .1em; }
.row.is-focus { background: var(--focus-bg); color: var(--focus-text); border-color: transparent; }
.row.is-focus small, .row.is-focus .val svg { color: rgba(9, 12, 19, .55); }
.row.is-focus .val { color: #5b3fe0; }
.row.danger .lbl b { color: #ff7a85; }
.row.is-focus.danger .lbl b { color: #c4182b; }
.seg { display: flex; gap: 12px; margin-top: 30px; }
.pair-code { font-family: var(--display); font-weight: 700; font-size: 120px; letter-spacing: .14em; margin: 30px 0 10px; color: var(--text); font-variant-numeric: tabular-nums; }

/* onboarding */
#scr-welcome { left: 0 !important; z-index: 30; background:
  radial-gradient(70% 90% at 85% 10%, rgba(139, 109, 255, .25), transparent 60%),
  radial-gradient(60% 70% at 10% 100%, rgba(51, 224, 194, .12), transparent 60%), var(--bg); }
.welcome { display: flex; flex-direction: column; justify-content: center; padding: 0 160px; width: 100%; }
.welcome .mark { width: 120px; height: 120px; }
.welcome h1 { font-family: var(--display); font-size: 96px; font-weight: 700; letter-spacing: -.035em; margin-top: 36px; line-height: 1; }
.welcome p { color: var(--muted); font-size: 30px; margin-top: 22px; max-width: 1100px; line-height: 1.45; }
.welcome .btns { margin-top: 56px; }
.welcome .fine { color: var(--dim); font-size: 22px; margin-top: 60px; max-width: 1200px; line-height: 1.5; }

/* ---------- fullscreen player OSD ---------- */
#osd { position: absolute; inset: 0; z-index: 40; pointer-events: none; display: none; }
body.fullscreen #osd { display: block; }
.osd-top { position: absolute; left: 0; right: 0; top: 0; height: 200px; padding: 50px 80px; display: flex; justify-content: flex-end;
  background: linear-gradient(180deg, rgba(0, 0, 0, .7), transparent); opacity: 0; transition: opacity .3s; }
.osd-bot { position: absolute; left: 0; right: 0; bottom: 0; padding: 120px 80px 64px; background: linear-gradient(0deg, rgba(0, 0, 0, .92) 30%, rgba(0, 0, 0, .55) 70%, transparent);
  opacity: 0; transform: translateY(24px); transition: opacity .3s, transform .3s var(--ease); }
#osd.show .osd-top, #osd.show .osd-bot { opacity: 1; transform: none; }
.osd-row { display: flex; align-items: center; gap: 30px; }
.osd-row .logo { width: 150px; height: 100px; background: rgba(255, 255, 255, .08); }
.osd-num { font-family: var(--display); font-size: 56px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.osd-title { flex: 1; min-width: 0; }
.osd-title h2 { font-family: var(--display); font-size: 52px; font-weight: 600; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osd-title .sub { color: #c9cfdc; font-size: 28px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osd-badges { display: flex; gap: 10px; align-self: flex-start; }
.osd-prog { display: flex; align-items: center; gap: 24px; margin-top: 30px; color: #c9cfdc; font-size: 26px; font-variant-numeric: tabular-nums; }
.osd-prog .bar { flex: 1; height: 8px; background: rgba(255, 255, 255, .18); }
.osd-prog .bar i { background: #fff; position: relative; }
.osd-next { margin-top: 20px; color: var(--muted); font-size: 25px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.osd-next b { color: #c9cfdc; font-weight: 500; }
.osd-ctl { display: none; gap: 18px; margin-top: 34px; pointer-events: auto; }
.osd-ctl .btn { height: 70px; padding: 0 30px; background: rgba(255, 255, 255, .1); }
#osd .clock { font-size: 40px; }
#osdSpin { display: none; }
body.buffering #osdSpin { display: block; }
#osdMsg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); text-align: center; background: rgba(6, 8, 13, .85); padding: 40px 60px;
  border-radius: 24px; font-size: 30px; max-width: 1100px; }
#osdMsg small { display: block; color: var(--muted); font-size: 23px; margin-top: 12px; }
#numEntry { position: absolute; top: 60px; left: 80px; z-index: 45; font-family: var(--display); font-size: 90px; font-weight: 700; padding: 10px 36px;
  border-radius: 24px; background: rgba(6, 8, 13, .8); display: none; font-variant-numeric: tabular-nums; }
#numEntry.on { display: block; }

/* zap list (left overlay in fullscreen) */
#zap { position: absolute; left: 0; top: 0; bottom: 0; width: 760px; z-index: 50; background: linear-gradient(90deg, rgba(6, 8, 13, .97) 80%, rgba(6, 8, 13, 0));
  padding: 50px 120px 40px 30px; display: none; flex-direction: column; }
#zap.on { display: flex; }
#zap .col-head { padding: 0 20px 20px; }

/* options panel (right) */
#opts { position: absolute; right: 0; top: 0; bottom: 0; width: 600px; z-index: 50; background: rgba(11, 14, 22, .97); border-left: 1px solid var(--line);
  padding: 60px 30px; display: none; flex-direction: column; }
#opts.on { display: flex; }
#opts h3 { font-family: var(--display); font-size: 36px; font-weight: 600; padding: 0 20px 24px; }
#opts .row { min-height: 84px; }
#opts .ck { color: var(--accent-2); font-size: 30px; }

/* toast + dialog */
#toast { position: absolute; left: 50%; bottom: 70px; transform: translate(-50%, 30px); z-index: 90; background: var(--panel-3); border: 1px solid var(--line-2);
  padding: 22px 36px; border-radius: 18px; font-size: 26px; opacity: 0; transition: opacity .25s, transform .25s var(--ease); pointer-events: none; max-width: 1200px; text-align: center; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
#dialog { position: absolute; inset: 0; z-index: 80; background: rgba(0, 0, 0, .7); display: none; align-items: center; justify-content: center; }
#dialog.on { display: flex; }
.dlg { width: 980px; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 30px; padding: 56px 60px; }
.dlg h2 { font-family: var(--display); font-size: 44px; font-weight: 600; letter-spacing: -.02em; }
.dlg p { color: var(--muted); font-size: 26px; margin-top: 16px; line-height: 1.5; }
.dlg .fields { margin-top: 18px; }
.dlg .fields .field { margin-top: 14px; height: 78px; }
.dlg .btns { margin-top: 36px; }

.legal { max-height: 600px; overflow-y: auto; margin-top: 10px; padding-right: 20px; color: #c9cfdc; font-size: 23px; line-height: 1.55; scroll-behavior: smooth; }
.legal h3 { display: none; }
.legal h4 { font-family: var(--display); font-size: 26px; font-weight: 600; color: var(--text); margin: 26px 0 6px; }
.legal p { margin: 0; color: #c9cfdc; font-size: 23px; }
.legal .lv { color: var(--dim); font-size: 20px; }
.legal a { color: var(--accent-2); }
.dlg:has(.legal) { width: 1300px; }

/* ================= TOUCH (phones / tablets) ================= */
body.touch #rail { left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding: 0 6px env(safe-area-inset-bottom);
  flex-direction: row; justify-content: space-around; border-top: 1px solid var(--line); }
body.touch .rail-logo, body.touch .rail-spacer { display: none; }
body.touch .rail-item { flex-direction: column; justify-content: center; gap: 4px; height: 64px; padding: 0 4px; border-radius: 0; font-size: 11px; flex: 1; }
body.touch .rail-item span { opacity: 1; }
body.touch .rail-item svg { font-size: 22px; }
body.touch .rail-item.is-focus { background: none; color: var(--muted); }
body.touch .rail-item.cur, body.touch .rail-item.cur.is-focus { color: var(--text); }
body.touch .rail-item.cur svg { color: var(--accent); }
body.touch .screen { bottom: calc(64px + env(safe-area-inset-bottom)); flex-direction: column; padding-top: env(safe-area-inset-top); }
body.touch #scr-welcome, body.touch #scr-detail { bottom: 0; }
body.touch.fullscreen .screen, body.touch.fullscreen #rail { visibility: hidden; }

body.touch .col { border-right: 0; background: transparent; }
body.touch .col-head { padding: 16px 16px 8px; }
body.touch .col-head h2 { font-size: 22px; }
body.touch .col-head .count { font-size: 13px; }
body.touch .cats { width: auto !important; flex: none; }
body.touch .cats .col-head { display: none; }
body.touch .cats .grid { display: none; }
.chips { display: none; }
body.touch .chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 10px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
body.touch .chips::-webkit-scrollbar { display: none; }
body.touch .chips .chip { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 18px; }
body.touch .chips .chip.is-sel { background: var(--text); color: var(--bg); border-color: transparent; }

body.touch #scr-live { background: transparent; }
body.touch #scr-live .chans { width: auto; flex: 1; min-height: 0; order: 3; }
body.touch #scr-live .cats { order: 2; }
body.touch #scr-live .pane { order: 1; flex: none; padding: 0; }
body.touch .topbar { display: none; }
body.touch .slot { border-radius: 0; box-shadow: none; }
body.touch .slot-idle, body.touch .slot-msg { border-radius: 0; font-size: 14px; }
body.touch .slot-idle svg { width: 44px; height: 44px; }
body.touch #scr-live.idle .slot { display: none; }
body.touch .info { margin: 0; padding: 12px 16px 4px; flex: none; }
body.touch #scr-live.idle .info { display: none; }
body.touch .info-head { gap: 12px; }
body.touch .info-head .logo { width: 56px; height: 38px; border-radius: 8px; }
body.touch .info-head h1 { font-size: 19px; }
body.touch .info-head .sub { font-size: 13px; margin-top: 2px; }
body.touch .prog { margin-top: 8px; }
body.touch .prog .t { font-size: 15px; -webkit-line-clamp: 1; }
body.touch .prog .tm { font-size: 12px; margin-top: 6px; gap: 10px; }
body.touch .prog .tm .bar { height: 3px; }
body.touch .prog .d, body.touch .prog .nx, body.touch .hints { display: none; }
body.touch .info-acts { display: flex; gap: 8px; margin: 10px -16px 0; padding: 0 16px; overflow-x: auto; scrollbar-width: none; }
body.touch .info-acts::-webkit-scrollbar { display: none; }
body.touch .info-acts .btn { white-space: nowrap; flex: none; }
.info-acts { display: none; }
body.touch .info-acts .btn { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; gap: 6px; }
body.touch .info-acts .btn svg { font-size: 16px; }
body.touch .badge { height: 22px; padding: 0 7px; font-size: 11px; border-radius: 6px; gap: 5px; }
body.touch .slot-status { left: 10px; bottom: 10px; gap: 6px; }
body.touch .spin { width: 36px; height: 36px; margin: -18px 0 0 -18px; border-width: 3px; }

body.touch .cat { left: 8px; right: 8px; height: 44px; font-size: 15px; }
body.touch .ch { left: 8px; right: 8px; height: 64px; gap: 12px; padding: 0 10px; border-radius: 12px; }
body.touch .ch .num { width: 30px; font-size: 12px; }
body.touch .ch .logo { width: 58px; height: 40px; border-radius: 8px; }
body.touch .logo .ini { font-size: 15px; }
body.touch .ch .nm { font-size: 16px; }
body.touch .ch .now { font-size: 13px; margin-top: 3px; gap: 8px; }
body.touch .ch .now .bar { width: 40px; height: 3px; }
body.touch .ch .flags { font-size: 14px; }
body.touch .ch.is-focus { background: transparent; color: var(--text); }
body.touch .ch.is-focus .num, body.touch .ch.is-focus .now { color: var(--muted); }
body.touch .ch.is-focus .logo { background: var(--panel-3); }
body.touch .ch.is-focus .bar { background: rgba(255, 255, 255, .1); }
body.touch .ch.is-focus .bar i { background: var(--accent-2); }
body.touch .ch.playing { background: var(--panel-3); }

body.touch #scr-movies .cats, body.touch #scr-series .cats { width: auto; }
body.touch .vod-main .col-head { display: flex; }
body.touch .pc { gap: 6px; }
body.touch .pc .art { border-radius: 10px; }
body.touch .pc .art .gen { font-size: 15px; padding: 10px; }
body.touch .pc .tt { font-size: 12px; }
body.touch .pc.is-focus .art { transform: none; box-shadow: none; }
body.touch .pc .art .rt { top: 6px; right: 6px; }

body.touch .dt { flex-direction: column; gap: 18px; padding: calc(56px + env(safe-area-inset-top)) 18px 30px; overflow-y: auto; height: 100%; }
body.touch .dt-poster { width: 46%; max-width: 220px; }
body.touch .dt-body h1 { font-size: 28px; }
body.touch .dt-meta { gap: 14px; font-size: 14px; margin-top: 10px; }
body.touch .dt-plot { font-size: 15px; -webkit-line-clamp: 8; margin-top: 14px; }
body.touch .dt-cast { font-size: 13px; white-space: normal; }
body.touch .btns { gap: 10px; margin-top: 20px; }
body.touch .btn { height: 46px; padding: 0 20px; font-size: 16px; border-radius: 12px; gap: 8px; }
body.touch .btn svg { font-size: 18px; }
body.touch .btn.is-focus { background: var(--panel-3); color: var(--text); transform: none; border-color: var(--line); }
body.touch .btn.primary.is-focus { background: var(--accent); }
body.touch .seasons { overflow-x: auto; margin-top: 22px; gap: 8px; }
body.touch .seasons .chip { height: 36px; padding: 0 14px; font-size: 14px; }
body.touch .eps { min-height: 0; flex: none; overflow: visible; }
body.touch .eps .track { position: relative; }
body.touch .ep { height: 64px; gap: 12px; padding: 0 8px; }
body.touch .ep .en { width: 28px; font-size: 16px; }
body.touch .ep .et b { font-size: 15px; }
body.touch .ep .et small { font-size: 12px; }
body.touch .ep .bar { width: 50px; }
body.touch .ep.is-focus { background: transparent; color: var(--text); }
.backbtn { display: none; }
body.touch .backbtn { display: flex; position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px; z-index: 5; width: 40px; height: 40px;
  border-radius: 20px; background: rgba(6, 8, 13, .7); align-items: center; justify-content: center; font-size: 22px; }

body.touch .page { padding: 20px 16px 12px; overflow-y: auto; }
body.touch .page h1 { font-size: 28px; }
body.touch .page .lead { font-size: 14px; margin-top: 6px; }
body.touch .field { height: 50px; padding: 0 14px; border-radius: 12px; margin-top: 16px; gap: 10px; border-width: 1px; }
body.touch .field svg { font-size: 18px; }
body.touch .field input { font-size: 16px; }
body.touch .field .fl { font-size: 13px; width: 90px; }
body.touch .field.is-focus { border-color: var(--line-2); background: var(--panel-2); }
body.touch .res { margin-top: 12px; min-height: 300px; }
body.touch .res .ch .kind { font-size: 10px; }
body.touch .form { margin-top: 14px; overflow: visible; }
body.touch .form-scroll { transform: none !important; }
body.touch .row { min-height: 58px; padding: 10px 14px; gap: 12px; border-radius: 12px; margin-bottom: 6px; }
body.touch .row .lbl b { font-size: 15px; }
body.touch .row .lbl small { font-size: 12px; white-space: normal; }
body.touch .row .val { font-size: 14px; }
body.touch .row.sect { min-height: 36px; font-size: 11px; padding-top: 14px; }
body.touch .row.is-focus { background: var(--panel); color: var(--text); border-color: var(--line); }
body.touch .row.is-focus small { color: var(--muted); }
body.touch .row.is-focus .val { color: var(--accent-2); }
body.touch .row.is-focus.danger .lbl b { color: #ff7a85; }
body.touch .pair-code { font-size: 54px; margin: 16px 0 6px; }

body.touch .welcome { padding: calc(30px + env(safe-area-inset-top)) 24px 30px; overflow-y: auto; }
body.touch .welcome .mark { width: 64px; height: 64px; }
body.touch .welcome h1 { font-size: 42px; margin-top: 20px; }
body.touch .welcome p { font-size: 16px; margin-top: 12px; }
body.touch .welcome .btns { margin-top: 28px; flex-direction: column; }
body.touch .welcome .btns .btn { justify-content: center; }
body.touch .welcome .fine { font-size: 12px; margin-top: 26px; }

body.touch #osd { pointer-events: auto; }
body.touch .osd-top { height: auto; padding: calc(12px + env(safe-area-inset-top)) 16px 30px; justify-content: space-between; align-items: center; }
body.touch .osd-top .tb { display: flex; gap: 8px; }
.osd-top .tb { display: none; }
body.touch .osd-top .tb button { width: 44px; height: 44px; border-radius: 22px; background: rgba(255, 255, 255, .14); display: flex; align-items: center; justify-content: center; font-size: 22px; }
body.touch #osd .clock { font-size: 16px; }
body.touch .osd-bot { padding: 40px 16px calc(16px + env(safe-area-inset-bottom)); }
body.touch .osd-row { gap: 12px; }
body.touch .osd-row .logo { width: 60px; height: 40px; }
body.touch .osd-num { font-size: 20px; }
body.touch .osd-title h2 { font-size: 20px; }
body.touch .osd-title .sub { font-size: 13px; }
body.touch .osd-prog { margin-top: 12px; gap: 10px; font-size: 12px; }
body.touch .osd-prog .bar { height: 4px; }
body.touch .osd-next { display: none; }
body.touch .osd-ctl { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }
body.touch .osd-ctl .btn { height: 48px; width: 56px; padding: 0; justify-content: center; border-radius: 24px; }
body.touch .osd-ctl .btn.big { width: 64px; height: 64px; border-radius: 32px; background: rgba(255, 255, 255, .22); }
body.touch .osd-ctl .btn.big svg { font-size: 28px; }
body.touch #osdMsg { padding: 20px 26px; font-size: 16px; border-radius: 14px; width: 86%; }
body.touch #osdMsg small { font-size: 13px; }
body.touch #numEntry { display: none; }
body.touch #zap { width: 86%; max-width: 420px; padding: calc(20px + env(safe-area-inset-top)) 10px 10px; background: rgba(6, 8, 13, .97); }
body.touch #opts { width: 86%; max-width: 380px; padding: calc(24px + env(safe-area-inset-top)) 12px 20px; overflow-y: auto; }
body.touch #opts h3 { font-size: 20px; padding: 0 8px 12px; }
body.touch #opts .row { min-height: 50px; }
body.touch #toast { font-size: 14px; padding: 12px 18px; bottom: calc(80px + env(safe-area-inset-bottom)); border-radius: 12px; max-width: 90%; }
body.touch .dlg { width: 92%; padding: 24px 20px; border-radius: 20px; }
body.touch .dlg h2 { font-size: 22px; }
body.touch .dlg p { font-size: 15px; }
body.touch .dlg .fields .field { height: 48px; }
body.touch .key, body.touch .dot { display: none; }
body.touch .legal { max-height: 58vh; font-size: 14px; padding-right: 6px; }
body.touch .legal p { font-size: 14px; }
body.touch .legal h4 { font-size: 16px; margin-top: 16px; }
body.touch .legal .lv { font-size: 12px; }
body.touch .dlg:has(.legal) { width: 94%; }
body.touch .dlg .btns { flex-direction: column; }
body.touch .dlg .btns .btn { justify-content: center; }

/* ================= TABLETS (iPad, Android & Fire tablets, large phones in landscape) ================= */
@media (min-width: 900px) {
  body.touch #app { font-size: 17px; }
  body.touch #scr-live.on { display: grid; grid-template-columns: minmax(340px, 40%) 1fr; grid-template-rows: auto 1fr; grid-template-areas: "cats pane" "chans pane"; }
  body.touch #scr-live .cats { grid-area: cats; min-width: 0; }
  body.touch #scr-live .chans { grid-area: chans; min-height: 0; border-right: 1px solid var(--line); }
  body.touch #scr-live .pane { grid-area: pane; padding: 18px 24px 16px; overflow-y: auto; }
  body.touch #scr-live.idle .slot, body.touch #scr-live.idle .info { display: block; }
  body.touch #scr-live.idle .info { display: none; }
  body.touch .topbar { display: flex; height: 36px; margin-bottom: 14px; }
  body.touch .topbar .plname { font-size: 15px; }
  body.touch .clock { font-size: 20px; }
  body.touch .badge-lic { font-size: 13px; padding: 3px 10px; }
  body.touch .slot { border-radius: 16px; }
  body.touch .slot-idle, body.touch .slot-msg { border-radius: 16px; font-size: 16px; }
  body.touch .info { padding: 18px 2px 4px; }
  body.touch .info-head .logo { width: 84px; height: 56px; border-radius: 10px; }
  body.touch .info-head h1 { font-size: 26px; }
  body.touch .info-head .sub { font-size: 15px; }
  body.touch .prog .t { font-size: 19px; -webkit-line-clamp: 2; }
  body.touch .prog .tm { font-size: 14px; }
  body.touch .prog .d, body.touch .prog .nx { display: block; font-size: 15px; margin-top: 10px; }
  body.touch .prog .d { display: -webkit-box; }
  body.touch .info-acts .btn { height: 42px; font-size: 15px; padding: 0 16px; }
  body.touch .ch { height: 72px; }
  body.touch .ch .nm { font-size: 17px; }
  body.touch .col-head h2 { font-size: 24px; }
  body.touch .dt { flex-direction: row; gap: 32px; padding: 40px 36px 30px 36px; }
  body.touch .dt-poster { width: 30%; max-width: 300px; }
  body.touch .dt-body h1 { font-size: 38px; }
  body.touch .dt-plot { font-size: 17px; }
  body.touch .dlg { width: 560px; }
  body.touch .dlg .btns { flex-direction: row; flex-wrap: wrap; }
  body.touch .dlg:has(.legal) { width: 760px; }
  body.touch .page { padding: 28px 36px 16px; }
  body.touch .page h1 { font-size: 34px; }
  body.touch .form { max-width: 900px; }
  body.touch .welcome { padding: 60px 70px; }
  body.touch .welcome h1 { font-size: 60px; }
  body.touch .welcome p { font-size: 20px; max-width: 700px; }
  body.touch .welcome .btns { flex-direction: row; }
  body.touch .rail-item { font-size: 12px; }
  body.touch #zap, body.touch #opts { max-width: 460px; }
}

/* close buttons for phones/tablets (no Back key) */
.dlg-x, .panel-x { display: none; }
body.touch .dlg { position: relative; max-height: calc(100% - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
body.touch .dlg h2 { padding-right: 40px; }
body.touch .dlg-x, body.touch .panel-x { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 20px;
  background: rgba(255, 255, 255, .1); color: var(--text); border: 0; flex: none; cursor: pointer; }
body.touch .dlg-x { position: absolute; top: 14px; right: 14px; z-index: 2; }
body.touch .dlg-x svg, body.touch .panel-x svg { width: 20px; height: 20px; }
body.touch #zap .col-head, body.touch #opts h3 { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
body.touch #dialog { padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
