/*
 * Innova Player (web TV) - shared styles for Tizen and webOS builds.
 * Dark theme, brand green accent, ~5% safe margins against overscan,
 * large focus targets for TV remotes. Original code, INNOVATVPLUS LLC.
 */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #0b0f0c; color: #f2f5f2;
  font-family: "Segoe UI", "LG Smart UI", "Samsung One", Arial, sans-serif;
  font-size: 26px;
}
button, input { font-family: inherit; font-size: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
img { border: none; }

/* ---------------- launch splash ----------------
 * Official stacked logo (brand master art) full-frame on black,
 * shown from first paint; js/app.js fades it out once the home
 * screen is up (~2 s), same behavior as Android v1.2.45 and Roku. */
#splash {
  position: fixed; left: 0; top: 0; width: 100%; height: 100%;
  background: #000; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  opacity: 1; transition: opacity 0.45s ease;
}
#splash img { height: 94%; max-width: 94%; object-fit: contain; }
#splash.splash-hide { opacity: 0; pointer-events: none; }

/* ---------------- screens ---------------- */
.screen {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  padding: 4vh 5vw; display: none; overflow-y: auto; overflow-x: hidden;
  z-index: 1; /* above the AVPlay object (a body-level sibling) */
}
.screen.active { display: block; }
/* Transparent, NOT black: on Tizen the video plane sits UNDER
 * the screens, and an opaque background here would cover it
 * (the standard Tizen pattern: the app plane is transparent
 * where the video must show through). The HTML5 <video> paints
 * its own black, so other builds look the same. */
.screen-player { padding: 0; overflow: hidden; background: transparent; }

.screen-head { display: flex; align-items: center; gap: 24px; margin-bottom: 28px; }
.screen-head h1 { font-size: 44px; font-weight: 600; }
.screen-msg { color: #9fb8a6; padding: 18px 0; min-height: 40px; }

/* ---------------- focus ---------------- */
.foc { outline: none; border-radius: 10px; }
.foc.focused {
  box-shadow: 0 0 0 4px #35d461, 0 0 22px rgba(53, 212, 97, 0.55);
  background-color: rgba(53, 212, 97, 0.14);
}

/* ---------------- buttons & fields ---------------- */
.btn {
  display: inline-block; padding: 14px 30px; border-radius: 10px;
  background: #1c2620; color: #f2f5f2; border: 2px solid #33463a;
}
.btn-primary { background: #1f9d4d; border-color: #35d461; color: #fff; font-weight: 600; }
.field {
  display: block; width: 640px; max-width: 100%; margin-top: 8px;
  padding: 14px 18px; border-radius: 10px; border: 2px solid #33463a;
  background: #121a15; color: #f2f5f2;
}
.field.focused { background: #121a15; }
.search-input {
  margin-left: auto; width: 420px; padding: 12px 18px; border-radius: 10px;
  border: 2px solid #33463a; background: #121a15; color: #f2f5f2;
}
.chip {
  display: inline-block; padding: 10px 22px; margin: 0 10px 12px 0;
  border-radius: 999px; background: #1c2620; border: 2px solid #33463a;
  white-space: nowrap;
}
.chip-on { background: #1f9d4d; border-color: #35d461; color: #fff; }
.cat-rail { margin-bottom: 20px; }

/* ---------------- home (mirrors the Android TV home) ---------------- */
#scr-home { overflow: hidden; }
.home2 { display: flex; flex-direction: column; height: 100%; gap: 2.2vh; }
.home2-head { display: flex; align-items: center; justify-content: space-between; }
.home2-brand { display: flex; align-items: center; gap: 18px; font-size: 34px; font-weight: 700; }
.home2-brand img { height: 88px; width: auto; flex: none; }
.home2-headpills { display: flex; gap: 14px; }
.home2-pill {
  padding: 13px 26px; border-radius: 999px; font-size: 24px;
  background: #1c2620; border: 2px solid #33463a; color: #f2f5f2; white-space: nowrap;
}
.home2-main { flex: 1; display: flex; gap: 34px; min-height: 0; }
.home2-left {
  width: 300px; flex: none; display: flex; flex-direction: column; justify-content: center;
}
.home2-clock { font-size: 76px; font-weight: 700; line-height: 1.05; }
.home2-date { font-size: 27px; color: #cfe3d3; margin-top: 10px; }
.home2-premium { font-size: 25px; color: #35d461; margin-top: 22px; }
.home2-tiles { flex: 1; display: flex; gap: 26px; align-items: center; min-width: 0; }
.home2-tile {
  flex: 1; height: 64%; min-height: 290px; border-radius: 20px;
  border: 3px solid rgba(255, 255, 255, 0.25);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 30px;
  color: #fff; text-align: center; min-width: 0;
}
.home2-icon {
  width: 116px; height: 116px; flex: none; margin-bottom: 20px;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
}
.home2-tile span { font-size: 42px; font-weight: 700; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); }
.tile-live { background: linear-gradient(155deg, #2bd866, #0f8a3d); }
.tile-movies { background: linear-gradient(155deg, #1cab52, #0b6b32); }
.tile-series { background: linear-gradient(155deg, #14857a, #083f3a); }
.home2-side {
  /* Owner order, 2026-11-28: the side menu spans the tiles' exact
   * height — first pill flush with the tiles' top, last pill flush
   * with their bottom, the rest evenly spaced between. The tiles
   * are height:64% and centered in .home2-tiles (which stretches
   * the full .home2-main height), so the side column takes the
   * same 64% height, centers itself the same way, and distributes
   * its pills with space-between instead of a fixed gap. */
  width: 300px; flex: none; display: flex; flex-direction: column;
  height: 64%; align-self: center;
  gap: 0; justify-content: space-between;
}
.home2-side .home2-pill { width: 100%; text-align: left; padding: 16px 24px; }
.home2-bar { display: flex; justify-content: space-between; gap: 22px; }
.home2-barbtn {
  flex: 1; padding: 17px 10px; font-size: 25px; border-radius: 12px;
  background: #16211a; border: 2px solid #33463a;
}
.home2-foot { display: flex; align-items: center; gap: 26px; color: #9fb8a6; font-size: 23px; }
#home-expiry { color: #cfe3d3; }
.home2-version { margin-left: auto; }

/* ---------------- guide ---------------- */
.guide-list { display: flex; flex-direction: column; gap: 8px; }
.guide-row {
  display: flex; align-items: center; gap: 20px; text-align: left;
  padding: 14px 20px; background: #141d17; border: 2px solid #26362c; border-radius: 10px;
}
.g-num { color: #35d461; width: 70px; font-weight: 700; }
.g-name { width: 380px; font-weight: 600; }
.g-now { flex: 1; color: #d8e4da; }
.g-next { flex: 1; color: #9fb8a6; }

/* ---------------- detail ---------------- */
.detail-wrap { display: flex; gap: 40px; }
.detail-poster { width: 340px; flex: none; }
.detail-poster img { width: 100%; border-radius: 12px; }
.detail-body { flex: 1; min-width: 0; }
.detail-body h1 { font-size: 46px; margin-bottom: 10px; }
.detail-meta { color: #9fb8a6; margin-bottom: 8px; }
.detail-plot { color: #d8e4da; line-height: 1.45; margin: 14px 0 22px; }
.detail-label { color: #35d461; font-weight: 600; margin: 16px 0 8px; }
.detail-actions { display: flex; gap: 16px; margin: 20px 0; }
.cast-row { display: flex; flex-wrap: wrap; gap: 14px; }
.cast-chip { display: flex; align-items: center; gap: 10px; background: #16211a; padding: 8px 16px 8px 8px; border-radius: 999px; }
.cast-photo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.episode-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.episode-btn {
  display: flex; gap: 18px; align-items: center; text-align: left;
  padding: 12px 20px; background: #141d17; border: 2px solid #26362c; border-radius: 10px;
}
.ep-num { color: #35d461; font-weight: 700; width: 50px; }
.ep-name { flex: 1; }
.ep-dur { color: #9fb8a6; }

/* ---------------- forms & settings ---------------- */
.add-tabs { margin-bottom: 24px; }
.add-form label { display: block; margin-bottom: 20px; color: #d8e4da; }
.form-actions { display: flex; gap: 16px; margin-top: 26px; }
/* Add Playlist layout: form column on the left, pairing QR
 * panel on the right (TV builds only; the panel is not rendered
 * on web, where .add-main simply takes the row alone). */
.add-wrap { display: flex; gap: 56px; align-items: flex-start; }
.add-main { flex: 1; min-width: 0; max-width: 760px; }
.add-qr { flex: none; width: 360px; text-align: center; padding-top: 4px; }
.add-qr-canvas { width: 320px; height: 320px; background: #fff; border-radius: 12px; }
.add-qr-text { color: #f2f5f2; font-size: 24px; line-height: 1.4; margin-top: 20px; }
.add-qr-url { color: #9fb8a6; font-size: 19px; margin-top: 10px; word-break: break-all; }
.add-qr .btn { margin-top: 18px; }
.add-qr .screen-msg { margin-top: 10px; }
.settings-body { max-width: 1300px; }
.settings-body h2 { font-size: 32px; margin: 30px 0 14px; color: #35d461; }
.set-row { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.set-label { flex: 1; }
.set-text { color: #d8e4da; margin-bottom: 10px; word-break: break-all; }
.key-field { width: 520px; margin-top: 0; }
/* Pairing block (TV builds): QR canvas beside the key text,
 * large enough to scan from the couch. */
.set-pair { display: flex; gap: 28px; align-items: flex-start; margin-bottom: 10px; }
.set-qr { width: 264px; height: 264px; flex: none; background: #fff; border-radius: 12px; }
.set-pair-text { flex: 1; min-width: 0; }

/* ---------------- player ---------------- */
/* The AVPlay <object> is a direct child of <body> (Samsung's
 * official AVPlay pattern; see index.html): always rendered,
 * never re-parented and never inside a display:none screen,
 * because re-parenting it destroys the plugin binding on real
 * Tizen firmware (round-1 regression, 2026-11-09: all video
 * black on the owner's Samsung), and with no intermediate
 * wrapper between body and the object (the old #av-stage fixed
 * container, removed 2026-11-28 after six displaced-preview
 * rounds). platform.js shows the video purely with the
 * object's CSS geometry + setDisplayRect, kept in lockstep;
 * while nothing plays the geometry is 0x0, so no hole remains. */
#av-player {
  position: absolute; display: block; background: transparent; border: none;
  pointer-events: none;
}
#player-video {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: #000; display: none;
}
#player-osd {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 4vh 5vw; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
#player-osd.show { opacity: 1; pointer-events: auto; }
/* Native-fullscreen escalation is a desktop-web-only control: the
 * button stays hidden in the TV packages (web.css reveals it). */
#osd-fs { display: none; }
.osd-top {
  background: rgba(5, 10, 6, 0.72); border-radius: 12px; padding: 22px 28px;
}
#osd-title { font-size: 40px; font-weight: 700; }
#osd-meta { color: #cfe3d3; margin-top: 8px; font-size: 25px; }
.osd-bottom {
  background: rgba(5, 10, 6, 0.72); border-radius: 12px; padding: 20px 28px;
}
/* Seek bar: a real slider, not a display. Click jumps, pointer
 * drag scrubs with a time bubble, and when the seek bar carries
 * remote focus the left/right keys seek (app.js). It only claims
 * to be seekable (.seekable) when the media exposes a seekable
 * range for a non-live title; otherwise it renders dimmed
 * (.disabled) and trying it says so honestly. The taller box is
 * the pointer target; the visible track is drawn by the fill's
 * row inside it. */
#osd-progress {
  position: relative; height: 16px; background: #26362c; border-radius: 8px;
  margin-bottom: 10px; touch-action: none; user-select: none; -webkit-user-select: none;
}
#osd-progress.seekable { cursor: pointer; }
#osd-progress.disabled { opacity: 0.5; }
#osd-progress.focused { background: #26362c; }
#osd-progress-fill {
  position: absolute; left: 0; top: 0; height: 100%; width: 0;
  background: #35d461; border-radius: 8px; pointer-events: none;
}
#osd-progress-thumb {
  position: absolute; top: 50%; left: 0; width: 24px; height: 24px;
  margin: -12px 0 0 -12px; border-radius: 50%; pointer-events: none;
  background: #35d461; border: 3px solid #eafff0; opacity: 0; transition: opacity 0.15s;
}
#osd-progress.seekable #osd-progress-thumb,
#osd-progress.focused #osd-progress-thumb,
#osd-progress.dragging #osd-progress-thumb { opacity: 1; }
#osd-progress-preview {
  position: absolute; bottom: 26px; left: 0; transform: translateX(-50%);
  background: rgba(5, 10, 6, 0.92); border: 2px solid #35d461; color: #fff;
  padding: 4px 12px; border-radius: 8px; font-size: 20px; white-space: nowrap;
  display: none; pointer-events: none;
}
#osd-progress.dragging #osd-progress-preview { display: block; }
.osd-times {
  display: flex; justify-content: space-between; color: #cfe3d3;
  font-size: 20px; margin-bottom: 14px;
}
.osd-buttons { display: flex; gap: 16px; align-items: center; }
.osd-btn { min-width: 170px; }
.osd-vol { display: inline-flex; align-items: center; gap: 10px; }
.osd-vol .osd-btn { min-width: 0; }
.vol-slider { width: 160px; accent-color: #2ecc71; cursor: pointer; }
#osd-menu { position: absolute; left: 50%; bottom: 170px; transform: translateX(-50%);
  background: rgba(10, 14, 20, 0.95); border: 1px solid #2ecc71; border-radius: 14px;
  padding: 18px 22px; min-width: 340px; z-index: 5; }
#osd-menu.hidden { display: none; }
#osd-menu-title { font-size: 22px; font-weight: 700; margin-bottom: 12px; }
.osd-menu-opt { display: block; width: 100%; text-align: left; margin-top: 8px;
  padding: 11px 18px; font-size: 20px; }
.osd-menu-opt.active { border-color: #2ecc71; color: #2ecc71; }
.osd-menu-opt.empty { opacity: .65; font-style: italic; cursor: default; }

/* ---------------- resume prompt ---------------- */
#resume-overlay {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(3, 6, 4, 0.88); display: none; z-index: 50;
  align-items: center; justify-content: center;
}
#resume-overlay.show { display: flex; }
.resume-box {
  background: #10160f; border: 2px solid #33463a; border-radius: 16px;
  padding: 40px 48px; text-align: center; width: 720px; max-width: 92vw;
}
.resume-title { font-size: 34px; font-weight: 700; margin-bottom: 14px; }
.resume-text { color: #cfe3d3; font-size: 25px; margin-bottom: 28px; }
.resume-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* Recently Watched rows: progress bar for in-progress titles
 * (same 2%-95% band as the resume offer; Android shows the
 * fraction on its recent cards the same way). */
.wb-rprog {
  display: block; height: 6px; background: #26362c; border-radius: 4px;
  margin-top: 8px; overflow: hidden;
}
.wb-rprog-fill { display: block; height: 100%; background: #35d461; }

/* ---------------- PIN overlay & toast ---------------- */
#pin-overlay {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(3, 6, 4, 0.88); display: none; z-index: 50;
  align-items: center; justify-content: center;
}
#pin-overlay.show { display: flex; }
.pin-box {
  background: #10160f; border: 2px solid #33463a; border-radius: 16px;
  padding: 40px 48px; text-align: center; width: 560px;
}
.pin-title { font-size: 34px; font-weight: 700; margin-bottom: 22px; }
#pin-dots { margin-bottom: 12px; }
.pin-dot {
  display: inline-block; width: 26px; height: 26px; margin: 0 8px;
  border-radius: 50%; border: 3px solid #35d461;
}
.pin-dot.on { background: #35d461; }
#pin-msg { color: #ff8080; min-height: 34px; margin-bottom: 10px; }
#pin-pad { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-bottom: 22px; }
#pin-pad > span { width: 130px; }
.pin-key {
  width: 130px; height: 74px; font-size: 32px;
  background: #1c2620; border: 2px solid #33463a; border-radius: 10px;
}
/* ---------------- first-launch onboarding (language + disclaimer) ----------------
 * Full-screen gate shown before anything else on the very first
 * launch only (localStorage disclaimer_accepted_v1). z-index above
 * the PIN overlay: nothing is reachable until Agree is pressed. */
#onboard-overlay {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: rgba(3, 6, 4, 0.95); display: none; z-index: 70;
  align-items: center; justify-content: center;
}
#onboard-overlay.show { display: flex; }
.onboard-box {
  background: #10160f; border: 2px solid #33463a; border-radius: 16px;
  padding: 44px 52px; text-align: center; width: 920px; max-width: 94vw;
  max-height: 92vh; display: flex; flex-direction: column;
}
.onboard-title { font-size: 38px; font-weight: 700; margin-bottom: 24px; }
.onboard-body {
  color: #cfe3d3; font-size: 24px; line-height: 1.55; text-align: left;
  overflow-y: auto; margin-bottom: 32px;
}
.onboard-body p { margin: 0 0 18px; }
.onboard-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
#onboard-lang-step.off { display: none; }
#onboard-disc-step { display: none; }
#onboard-disc-step.on { display: block; }

#toast {
  position: absolute; left: 50%; bottom: 6vh; transform: translateX(-50%);
  background: rgba(10, 18, 12, 0.95); border: 2px solid #35d461; color: #fff;
  padding: 18px 34px; border-radius: 12px; font-size: 27px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 60;
  max-width: 80vw; text-align: center;
}
#toast.show { opacity: 1; }
