/* Lumen second screen - the same blue and white as the TV apps; phone first, roomy on a laptop. */
:root {
  --bg: #0a2656;
  --bg-deep: #061a3d;
  --card: #13397a;
  --card-hi: #1b468f;
  --text: #fff;
  --text-2: #c6d5f0;
  --text-3: #a3b7dc;
  --accent: #6fd3ff;
  --live: #e5334f;
  --gold: #ffc857;
  --radius: 16px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: radial-gradient(900px 600px at 10% -10%, #1b4a92 0%, var(--bg) 50%, var(--bg-deep) 100%) fixed;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button { font: inherit; color: inherit; cursor: pointer; }
main { max-width: 760px; margin: 0 auto; padding: 0 14px 24px; }

/* Header and TV picker */
.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: rgba(6, 26, 61, 0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.top > * { flex: none; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 19px; }
.devices { display: flex; gap: 8px; overflow-x: auto; flex: 1; justify-content: flex-end; scrollbar-width: none; }
.devices::-webkit-scrollbar { display: none; }
.dev { display: flex; align-items: center; gap: 7px; white-space: nowrap; border: 0; border-radius: 999px; padding: 7px 13px;
  background: rgba(255, 255, 255, 0.1); color: var(--text-2); font-size: 14px; font-weight: 600; }
.dev.on { background: #fff; color: var(--bg); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #7d8db0; }
.dot.live { background: #3ddc84; box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.25); }

/* Now playing */
.now { margin-top: 14px; background: var(--card); border-radius: var(--radius); padding: 16px; min-height: 130px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25); }
.now .row1 { display: flex; gap: 14px; align-items: center; }
.logo { width: 64px; height: 64px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, 0.1) center / 78% no-repeat;
  display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--text-2); }
.now .logo { width: 76px; height: 76px; }
.now .where { color: var(--text-3); font-size: 13px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; }
.now .ch { font-size: 21px; font-weight: 700; line-height: 1.2; margin-top: 2px; }
.now .num { color: var(--accent); margin-right: 8px; }
.badges { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; font-weight: 800; letter-spacing: 0.8px; padding: 3px 8px; border-radius: 6px; background: rgba(255, 255, 255, 0.16); }
.badge.live { background: var(--live); }
.badge.q { border: 1.5px solid var(--accent); color: var(--accent); background: none; }
.badge.warn { background: #b8860b; }
.prog { margin-top: 14px; }
.prog .t { font-size: 17px; font-weight: 600; }
.prog .time { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; margin-top: 6px; }
.bar { flex: 1; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.18); overflow: hidden; }
.bar i { display: block; height: 100%; background: linear-gradient(90deg, #7fb2ff, var(--accent)); }
.prog .next { color: var(--text-3); font-size: 13px; margin-top: 6px; }
.stats { color: var(--text-3); font-size: 12.5px; margin-top: 10px; }
.offline { color: var(--text-2); }
.offline b { color: #fff; }

/* Remote buttons */
.controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin-top: 12px; }
.controls button { border: 0; border-radius: 14px; padding: 15px 8px; background: rgba(255, 255, 255, 0.12); font-weight: 700;
  font-size: 16px; display: flex; align-items: center; justify-content: center; gap: 8px; touch-action: manipulation; }
.controls button:active { background: #fff; color: var(--bg); transform: scale(0.98); }
.controls button:disabled { opacity: 0.35; }
.ic { font-size: 13px; }

/* LG TV: power, volume, inputs */
.lgtv { margin-top: 12px; background: rgba(0, 0, 0, 0.22); border-radius: var(--radius); padding: 14px; }
.lgrow { display: flex; align-items: center; justify-content: space-between; }
.lgtitle { font-weight: 800; font-size: 13px; letter-spacing: 0.8px; text-transform: uppercase; color: var(--text-3); }
.lgsub { font-size: 15px; font-weight: 600; margin-top: 2px; }
.power { width: 52px; height: 52px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, 0.12); color: #fff; touch-action: manipulation; }
.power.on { background: #e5334f; }
.power.confirm { background: #fff; color: #e5334f; box-shadow: 0 0 0 4px rgba(229, 51, 79, 0.4); }
.power.busy { opacity: 0.6; }
.vol { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.vbtn { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 0; background: rgba(255, 255, 255, 0.12); font-size: 24px;
  font-weight: 700; display: flex; align-items: center; justify-content: center; touch-action: manipulation; }
.vbtn:active { background: #fff; color: var(--bg); }
.vbtn.muted { background: #fff; color: var(--bg); }
.vbtn:disabled, .vol input:disabled { opacity: 0.35; }
#mute #mutex { display: none; }
#mute.muted #mutex { display: inline; }
.volmid { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.volmid input { flex: 1; min-width: 0; accent-color: var(--accent); height: 28px; }
.vollabel { width: 30px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.inputs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.inp { border: 0; border-radius: 999px; padding: 9px 14px; background: rgba(255, 255, 255, 0.1); font-weight: 650; font-size: 14px;
  touch-action: manipulation; }
.inp.idle { color: var(--text-3); }
.inp.current { background: #fff; color: var(--bg); }
.inp.lumen { background: rgba(111, 211, 255, 0.18); }
.inp.lumen.current { background: var(--accent); color: var(--bg); }
.inp:disabled { opacity: 0.35; }

/* Lists */
.tabs { display: flex; gap: 6px; margin: 20px 0 10px; background: rgba(0, 0, 0, 0.2); border-radius: 12px; padding: 4px; }
.tabs button { flex: 1; border: 0; background: none; padding: 10px 6px; border-radius: 9px; color: var(--text-2); font-weight: 700; }
.tabs button.on { background: #fff; color: var(--bg); }
.searchbox input { width: 100%; border: 0; border-radius: 12px; padding: 13px 14px; font-size: 16px; background: rgba(255, 255, 255, 0.12);
  color: #fff; outline: none; margin-bottom: 8px; }
.searchbox input::placeholder { color: var(--text-3); }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 14px; cursor: pointer; }
.item + .item { margin-top: 2px; }
.item:hover { background: rgba(255, 255, 255, 0.06); }
.item.playing { background: rgba(111, 211, 255, 0.12); }
.item .logo { width: 48px; height: 48px; border-radius: 11px; font-size: 14px; }
.item .main { flex: 1; min-width: 0; }
.item .nm { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { color: var(--text-3); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .bar { margin-top: 6px; max-width: 220px; flex: none; height: 3px; }
.item .watch { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(255, 255, 255, 0.14); font-weight: 700; font-size: 13px; }
.item .watch:active, .item:hover .watch { background: #fff; color: var(--bg); }
.item .tag { font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 5px; background: rgba(255, 255, 255, 0.14); margin-left: 6px; vertical-align: 2px; }
.empty { color: var(--text-3); text-align: center; padding: 26px 10px; }

footer { max-width: 760px; margin: 0 auto; padding: 8px 18px 30px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap;
  color: var(--text-3); font-size: 13px; }
footer a { color: var(--accent); text-decoration: none; }
footer form { margin-left: auto; }
.link { background: none; border: 0; color: var(--text-3); text-decoration: underline; padding: 0; }

.toast { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: #fff; color: var(--bg); font-weight: 700; padding: 11px 18px; border-radius: 999px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, transform 0.2s; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Login */
body.login { display: flex; align-items: center; justify-content: center; }
body.login form { width: min(340px, 90vw); text-align: center; background: var(--card); padding: 28px 24px; border-radius: 22px; }
body.login h1 { margin: 10px 0 0; }
body.login p { color: var(--text-2); margin: 4px 0 18px; }
body.login .err { color: #ffb4a8; }
body.login input { width: 100%; font-size: 22px; text-align: center; letter-spacing: 6px; border: 0; border-radius: 12px; padding: 12px;
  background: rgba(255, 255, 255, 0.12); color: #fff; outline: none; }
body.login button { width: 100%; margin-top: 12px; border: 0; border-radius: 12px; padding: 13px; background: #fff; color: var(--bg); font-weight: 800; font-size: 16px; }

@media (min-width: 900px) {
  main, footer { max-width: 1040px; }
  main { display: grid; grid-template-columns: 420px 1fr; gap: 26px; align-items: start; }
  .left { position: sticky; top: 72px; }
  .right .tabs { margin-top: 14px; }
}

/* ---- Movies and series ------------------------------------------------------------------------ */
.tabs button { font-size: 14px; padding: 10px 2px; }
.vodbar select { width: 100%; border: 0; border-radius: 12px; padding: 12px 14px; font: inherit; font-weight: 600; color: #fff;
  background: rgba(255, 255, 255, 0.12); margin-bottom: 12px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.vodbar select option { color: #000; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 10px; }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.tile { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; min-width: 0; }
.pimg { aspect-ratio: 2 / 3; border-radius: 12px; background: rgba(255, 255, 255, 0.1) center / cover no-repeat; display: flex;
  align-items: center; justify-content: center; font-weight: 800; color: var(--text-3); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); position: relative; overflow: hidden; }
.pimg .pbar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(0, 0, 0, 0.5); }
.pimg .pbar i { display: block; height: 100%; background: var(--accent); }
.tile .tt { font-weight: 650; font-size: 14px; margin-top: 6px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .ts { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.tile:active .pimg { transform: scale(0.97); }
.more { display: block; width: 100%; margin: 16px 0; border: 0; border-radius: 12px; padding: 13px; background: rgba(255, 255, 255, 0.12); font-weight: 700; }
.list .sec { list-style: none; font-size: 12px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--text-3); margin: 18px 10px 6px; }
.item .poster-s { width: 44px; height: 66px; flex: none; border-radius: 8px; background: rgba(255, 255, 255, 0.1) center / cover no-repeat; }
.controls.two { grid-template-columns: 1fr 1fr; margin-top: 10px; }

/* Now playing: a movie or episode */
.now .vrow { display: flex; gap: 14px; }
.now .vposter { width: 84px; height: 126px; flex: none; border-radius: 12px; background: rgba(255, 255, 255, 0.1) center / cover no-repeat; }
.now .vsub { color: var(--text-2); font-size: 14px; margin-top: 4px; }
.now .vtime { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; margin-top: 14px; font-variant-numeric: tabular-nums; }

/* Detail sheet */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(2, 10, 26, 0.6); display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-card { width: min(720px, 100%); max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: 22px 22px 0 0; padding: 18px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4); }
@media (min-width: 900px) { .sheet { align-items: center; } .sheet-card { border-radius: 22px; } }
.sheet .close { float: right; border: 0; background: rgba(255, 255, 255, 0.12); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; }
.sheet .shead { display: flex; gap: 16px; }
.sheet .sposter { width: 120px; height: 180px; flex: none; border-radius: 14px; background: rgba(255, 255, 255, 0.1) center / cover no-repeat; }
.sheet h2 { margin: 2px 0 6px; font-size: 22px; line-height: 1.2; }
.sheet .smeta { color: var(--accent); font-size: 14px; }
.sheet .splot { color: var(--text-2); font-size: 14.5px; margin-top: 12px; line-height: 1.5; }
.sheet .scast { color: var(--text-3); font-size: 13px; margin-top: 8px; }
.sheet .sbtns { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.sheet .play { border: 0; border-radius: 12px; padding: 13px 18px; background: #fff; color: var(--bg); font-weight: 800; font-size: 15px; }
.sheet .play.alt { background: rgba(255, 255, 255, 0.14); color: #fff; }
.sheet select { margin-top: 16px; }
.sheet .eps { list-style: none; margin: 10px 0 0; padding: 0; }
.sheet .ep { display: flex; align-items: center; gap: 12px; padding: 10px 6px; border-top: 1px solid rgba(255, 255, 255, 0.08); cursor: pointer; }
.sheet .ep .en { width: 34px; flex: none; color: var(--accent); font-weight: 800; }
.sheet .ep .em { flex: 1; min-width: 0; }
.sheet .ep .et { font-weight: 650; }
.sheet .ep .es { color: var(--text-3); font-size: 12.5px; }
.sheet .ep .bar { margin-top: 5px; height: 3px; max-width: 180px; }
