/* Viblu TV app. Designed on a 1920x1080 stage that is scaled to the screen (TV); colours from the Viblu palette. */
:root {
  --bg: #070b16;
  --bg-2: #0d1424;
  --surface: #131c30;
  --surface-2: #1b2640;
  --line: #24314f;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #38bdf8;
  --accent-2: #0ea5e9;
  --live: #ef4444;
  --radius: 14px;
  --ring: 0 0 0 4px var(--accent), 0 18px 40px rgba(0, 0, 0, .55);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; height: 100%; background: #000; overflow: hidden; }
body { font-family: var(--font); color: var(--text); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }
[hidden] { display: none !important; }

#stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; background: var(--bg); overflow: hidden;
}

/* ---------------- top bar ---------------- */
#nav {
  position: absolute; z-index: 20; left: 0; right: 0; top: 0; height: 110px;
  display: flex; align-items: center; padding: 0 96px;
  background: linear-gradient(180deg, rgba(7, 11, 22, .95) 0%, rgba(7, 11, 22, .6) 70%, rgba(7, 11, 22, 0) 100%);
}
#nav { transition: background .2s; }
#nav.solid { background: rgba(7, 11, 22, .97); box-shadow: 0 6px 24px rgba(0, 0, 0, .45); }
.brand { display: flex; align-items: center; gap: 14px; font-size: 34px; letter-spacing: -.5px; margin-right: 64px; }
.brand b { color: var(--accent); font-weight: 800; }
.logo-dot { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7dd3fc, var(--accent-2)); box-shadow: 0 0 18px rgba(56, 189, 248, .7); }
.nav-items { display: flex; gap: 8px; }
.nav-item { font-size: 26px; font-weight: 600; color: var(--muted); padding: 12px 26px; border-radius: 40px; transition: background .15s, color .15s; }
.nav-item.active { color: var(--text); }
.nav-item.active::after { content: ""; display: block; height: 3px; margin-top: 6px; border-radius: 2px; background: var(--accent); }
.nav-item.focused { background: var(--text); color: var(--bg); }
.nav-item.focused::after { background: transparent; }
.clock { margin-left: auto; font-size: 28px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------- screens ---------------- */
#screens { position: absolute; inset: 0; }
.screen { position: absolute; inset: 0; overflow: hidden; display: none; }
.screen.active { display: block; }
.scroller { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; scroll-behavior: smooth; padding-bottom: 120px; }
.scroller::-webkit-scrollbar { display: none; }

/* ---------------- hero ---------------- */
.hero { position: relative; height: 760px; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 30%; transition: background-image .4s; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background:
  linear-gradient(90deg, rgba(7, 11, 22, .96) 0%, rgba(7, 11, 22, .75) 38%, rgba(7, 11, 22, 0) 70%),
  linear-gradient(0deg, var(--bg) 0%, rgba(7, 11, 22, 0) 45%); }
.hero-body { position: absolute; left: 96px; bottom: 120px; width: 860px; }
.eyebrow { font-size: 22px; letter-spacing: 3px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 18px; }
.hero h1 { font-size: 84px; line-height: 1.02; font-weight: 800; letter-spacing: -1.5px; margin-bottom: 22px; }
.meta { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; font-size: 26px; color: var(--muted); margin-bottom: 22px; }
.meta .pill { border: 2px solid var(--dim); border-radius: 6px; padding: 0 10px; font-size: 22px; line-height: 34px; color: var(--text); }
.desc { font-size: 27px; line-height: 1.45; color: #cbd5e1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-bottom: 36px; }
.actions { display: flex; gap: 20px; }
.btn { display: inline-flex; align-items: center; gap: 14px; font-size: 28px; font-weight: 700; padding: 18px 40px; border-radius: 60px; background: rgba(255, 255, 255, .14); transition: transform .15s, background .15s, color .15s; }
.btn.primary { background: var(--accent); color: #04121f; }
.btn.focused { background: var(--text); color: var(--bg); transform: scale(1.06); box-shadow: 0 12px 30px rgba(0, 0, 0, .5); }
.btn .ico { width: 0; height: 0; border-left: 20px solid currentColor; border-top: 12px solid transparent; border-bottom: 12px solid transparent; }

/* ---------------- rails ---------------- */
.rail { position: relative; margin: 0 0 52px; }
.rail h2 { font-size: 32px; font-weight: 700; margin: 0 96px 20px; letter-spacing: -.3px; }
.track { display: flex; gap: 28px; padding: 14px 96px 26px; overflow-x: auto; scrollbar-width: none; scroll-behavior: smooth; }
.track::-webkit-scrollbar { display: none; }
.card { position: relative; flex: 0 0 auto; width: 440px; border-radius: var(--radius); background: var(--surface); transition: transform .18s ease, box-shadow .18s ease; text-align: left; }
.card .thumb { width: 100%; aspect-ratio: 16 / 9; border-radius: var(--radius); background: var(--surface-2) center / cover no-repeat; overflow: hidden; position: relative; }
.card .label { padding: 16px 6px 0; font-size: 25px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e2e8f0; }
.card .sub { padding: 4px 6px 0; font-size: 21px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card.bare { background: transparent; }
.card.focused { transform: scale(1.07); z-index: 2; }
.card.focused .thumb { box-shadow: var(--ring); }
.card .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 7px; background: rgba(255, 255, 255, .25); }
.card .bar i { display: block; height: 100%; background: var(--accent); }
.badge-live { position: absolute; left: 14px; top: 14px; background: var(--live); color: #fff; font-size: 18px; font-weight: 800; letter-spacing: 1.5px; padding: 4px 12px; border-radius: 6px; }
.chan-card .thumb { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #12203d, #0b1426); }
.chan-card .thumb img.logo { max-width: 60%; max-height: 55%; object-fit: contain; }
.chan-card .thumb .num { position: absolute; right: 16px; top: 12px; font-size: 22px; color: var(--muted); font-weight: 700; }
.chan-card .thumb .cname { font-size: 40px; font-weight: 800; letter-spacing: -.5px; text-align: center; padding: 0 24px; }
.chan-card .thumb .now-bg { position: absolute; inset: 0; background: center / cover no-repeat; opacity: .35; }

.empty { margin: 220px 96px 0; font-size: 30px; color: var(--muted); }

/* ---------------- guide ---------------- */
.guide-top { position: absolute; left: 0; right: 0; top: 0; height: 420px; padding: 140px 96px 0; display: flex; gap: 48px; }
.guide-top .gbg { position: absolute; inset: 0; background: center 30% / cover no-repeat; opacity: .35; }
.guide-top .gbg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 25%, rgba(7, 11, 22, .4)), linear-gradient(0deg, var(--bg), rgba(7, 11, 22, 0) 60%); }
.guide-top .ginfo { position: relative; width: 1100px; }
.guide-top h1 { font-size: 56px; font-weight: 800; letter-spacing: -1px; margin-bottom: 14px; }
.guide-top .desc { -webkit-line-clamp: 2; margin-bottom: 0; }
.grid { position: absolute; left: 0; right: 0; top: 420px; bottom: 0; }
.grid-times { position: absolute; left: 380px; right: 0; top: 0; height: 56px; overflow: hidden; border-bottom: 1px solid var(--line); }
.grid-times span { position: absolute; top: 12px; font-size: 22px; color: var(--muted); font-variant-numeric: tabular-nums; }
.grid-rows { position: absolute; left: 0; right: 0; top: 56px; bottom: 0; overflow: hidden; }
.grow { position: relative; height: 112px; border-bottom: 1px solid var(--line); }
.gchan { position: absolute; left: 96px; top: 0; width: 270px; height: 112px; display: flex; align-items: center; gap: 18px; padding: 0 16px; border-radius: 10px; }
.gchan .num { font-size: 24px; color: var(--muted); width: 48px; font-weight: 700; }
.gchan img { max-width: 90px; max-height: 60px; object-fit: contain; }
.gchan .nm { font-size: 24px; font-weight: 700; line-height: 1.2; }
.glane { position: absolute; left: 380px; right: 0; top: 0; height: 112px; overflow: hidden; }
.gprog { position: absolute; top: 10px; height: 92px; padding: 14px 18px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); text-align: left; overflow: hidden; }
.gprog b { display: block; font-size: 24px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gprog small { font-size: 19px; color: var(--muted); }
.gprog.has-thumb { padding-left: 150px; }
.gprog .gthumb { position: absolute; left: 10px; top: 10px; width: 128px; height: 72px; border-radius: 8px; background: var(--surface-2) center / cover no-repeat; }
.gchan img { max-width: 110px; max-height: 64px; object-fit: contain; }
.gprog.now { background: var(--surface-2); }
.gprog.focused { background: var(--text); color: var(--bg); border-color: var(--text); z-index: 2; }
.gprog.focused small { color: #334155; }
.now-line { position: absolute; top: 56px; bottom: 0; width: 3px; background: var(--accent); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; top: -8px; left: -6px; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); }

/* ---------------- search ---------------- */
.search-wrap { position: absolute; inset: 140px 0 0; display: flex; }
.kb { width: 640px; padding: 0 40px 0 96px; }
.kb .query { height: 84px; font-size: 40px; font-weight: 700; border-bottom: 3px solid var(--accent); margin-bottom: 30px; display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.kb .query .ph { color: var(--dim); font-weight: 500; font-size: 28px; }
.kb .query .caret { width: 3px; height: 46px; background: var(--accent); margin-left: 4px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.keys { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.key { height: 70px; border-radius: 10px; background: var(--surface); font-size: 30px; font-weight: 600; text-transform: uppercase; }
.key.wide { grid-column: span 3; font-size: 24px; text-transform: none; }
.key.focused { background: var(--text); color: var(--bg); }
.results { flex: 1; position: relative; overflow: hidden; }
.results .scroller { padding-top: 10px; }
.results .rgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 34px 28px; padding: 14px 96px 0 30px; }
.results .card { width: auto; }
.results .hint { font-size: 28px; color: var(--muted); padding: 20px 30px; }

/* ---------------- settings ---------------- */
.settings { padding: 170px 96px; }
.settings h1 { font-size: 56px; font-weight: 800; margin-bottom: 44px; }
.setting { display: flex; align-items: center; gap: 40px; margin-bottom: 36px; }
.setting .k { width: 300px; font-size: 30px; color: var(--muted); }
.choice { font-size: 28px; font-weight: 600; padding: 16px 36px; border-radius: 40px; background: var(--surface); }
.choice.on { background: var(--accent); color: #04121f; }
.choice.focused { background: var(--text); color: var(--bg); transform: scale(1.05); }
.about { margin-top: 70px; font-size: 22px; color: var(--dim); line-height: 1.6; }

/* ---------------- details ---------------- */
.details .hero { height: 1080px; }
.details .hero-body { bottom: auto; top: 250px; width: 980px; }
.details .desc { -webkit-line-clamp: 6; }
.details .episodes { position: absolute; left: 0; right: 0; bottom: 30px; }

/* ---------------- player ---------------- */
#player { position: absolute; inset: 0; z-index: 50; background: #000; }
#video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* channel logo ("bug"): corner, width and opacity come from the channel settings */
.bug { position: absolute; z-index: 1; pointer-events: none; height: auto; }
.bug.top-right { top: 54px; right: 64px; }
.bug.top-left { top: 54px; left: 64px; }
.bug.bottom-right { bottom: 54px; right: 64px; }
.bug.bottom-left { bottom: 54px; left: 64px; }
.osd { position: absolute; inset: 0; z-index: 2; pointer-events: none; opacity: 0; transition: opacity .25s; }
.osd.show { opacity: 1; }
.osd .shade { position: absolute; left: 0; right: 0; bottom: 0; height: 520px; background: linear-gradient(0deg, rgba(0, 0, 0, .92), rgba(0, 0, 0, 0)); }
.osd .top-shade { position: absolute; left: 0; right: 0; top: 0; height: 220px; background: linear-gradient(180deg, rgba(0, 0, 0, .7), rgba(0, 0, 0, 0)); }
.osd .panel { position: absolute; left: 96px; right: 96px; bottom: 80px; }
.osd .chan { display: flex; align-items: center; gap: 22px; margin-bottom: 18px; }
.osd .chan .num { font-size: 40px; font-weight: 800; color: var(--accent); }
.osd .chan .nm { font-size: 30px; font-weight: 700; }
.osd .chan img { max-height: 56px; max-width: 160px; object-fit: contain; }
.osd .chan .badge-live { position: static; }
.osd h2 { font-size: 58px; font-weight: 800; letter-spacing: -1px; margin-bottom: 10px; }
.osd .times { font-size: 26px; color: #cbd5e1; margin-bottom: 18px; font-variant-numeric: tabular-nums; }
.osd .prog { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; margin-bottom: 18px; }
.osd .prog i { display: block; height: 100%; background: var(--accent); }
.osd .next { font-size: 25px; color: var(--muted); }
.osd .next b { color: #e2e8f0; font-weight: 600; }
.osd .hint { position: absolute; right: 96px; top: 60px; font-size: 22px; color: #cbd5e1; }
.osd .state { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 150px; height: 150px; border-radius: 50%; background: rgba(0, 0, 0, .55); display: flex; align-items: center; justify-content: center; }
.osd .state i { width: 0; height: 0; border-left: 50px solid #fff; border-top: 30px solid transparent; border-bottom: 30px solid transparent; margin-left: 12px; }
.osd .state.pause i { width: 46px; height: 56px; border: 0; margin: 0; background: linear-gradient(90deg, #fff 0 35%, transparent 35% 65%, #fff 65%); }
/* mouse / touch controls in the player (computers, phones); hidden on TV remotes */
.pctl { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
.pctl .pbtn { pointer-events: auto; background: rgba(2, 6, 23, .62); color: #fff; border: 2px solid rgba(255, 255, 255, .25); border-radius: 50%; width: 84px; height: 84px; font-size: 30px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pctl .pbtn:hover { background: var(--accent); color: #04121f; border-color: var(--accent); }
.pctl .pback { position: absolute; left: 56px; top: 44px; }
.pctl .pmid { position: absolute; right: 64px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 22px; }
.pctl.vod .pmid { right: auto; left: 50%; top: auto; bottom: 230px; transform: translateX(-50%); flex-direction: row; gap: 34px; }
.pctl.vod .pbtn { width: 96px; height: 96px; font-size: 24px; }
.pctl.live .vod-only, .pctl.vod .live-only, .pctl.ad .pmid { display: none; }
.adbadge { position: absolute; z-index: 3; left: 64px; top: 54px; background: rgba(0, 0, 0, .62); color: #fff; font-size: 24px; font-weight: 700; padding: 10px 20px; border-radius: 8px; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.player-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 1000px; text-align: center; font-size: 30px; line-height: 1.5; background: rgba(13, 20, 36, .92); padding: 40px 60px; border-radius: 18px; }

/* ---------------- loading ---------------- */
.loading { position: absolute; inset: 0; z-index: 100; background: var(--bg); display: flex; align-items: center; justify-content: center; transition: opacity .3s; }
.loading.done { opacity: 0; pointer-events: none; }
.spinner { width: 74px; height: 74px; border-radius: 50%; border: 6px solid rgba(255, 255, 255, .15); border-top-color: var(--accent); animation: spin .9s linear infinite; }
#spinner { position: absolute; left: 50%; top: 50%; margin: -37px 0 0 -37px; }
@keyframes spin { to { transform: rotate(360deg); } }

.toast { position: absolute; z-index: 90; left: 50%; bottom: 70px; transform: translateX(-50%); background: var(--surface-2); padding: 18px 36px; border-radius: 40px; font-size: 26px; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }

/* Browser (website) layout: mouse and touch, the stage keeps its TV proportions. */
body.pointer .focusable:hover { cursor: pointer; }
