/*
 * Innova Player - desktop web overrides (loaded after app.css and
 * browse-pane.css only in the web package). Computers have no
 * overscan, so margins shrink; the Exit button is meaningless in a
 * browser tab and is hidden.
 * Original code, INNOVATVPLUS LLC.
 */
.screen { padding: 2vh 3vw; }
.home2-brand img { height: 88px; width: auto; flex: none; }
.home2-brand { font-size: 28px; }
/* the brand is a button to the public site (web only) */
.home2-brand { cursor: pointer; }
.home2-clock { font-size: 58px; }
.home2-date { font-size: 22px; }
.home2-tile { min-height: 230px; }
.home2-tile span { font-size: 34px; }
.home2-icon { width: 92px; height: 92px; margin-bottom: 14px; }
.home2-pill { font-size: 20px; padding: 11px 22px; }
.home2-barbtn { font-size: 21px; }
#set-exit { display: none; }
/* Two-stage fullscreen (web only): the player screen is stage 1
 * (in-page); the OSD Fullscreen button escalates to the browser's
 * native fullscreen (stage 2). app.css hides the button elsewhere. */
#osd-fs { display: block; }
/* fullscreen bridge (js/fs-bridge.js): while the browse
 * preview's media element is adopted by the player screen it
 * must fill it exactly like the player's own element (the
 * #player-video rule in app.css is ID-scoped and does not
 * reach it). */
#scr-player video.fs-adopted {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  background: #000;
}
#scr-player:fullscreen { background: #000; }
#scr-player:-webkit-full-screen { background: #000; }
body { cursor: default; }
.foc { cursor: pointer; }
input.foc { cursor: text; }

/* floating back button (js/float-back.js, web package only):
 * arrow-only, fixed at the top-left, stays put while the option
 * screens (Settings, Add Playlist, Guide, Detail) scroll; the
 * screens it serves get extra top padding so it never covers
 * their title. */
#float-back {
  position: fixed; z-index: 40; top: 16px; left: 16px;
  width: 54px; height: 54px; border-radius: 50%;
  align-items: center; justify-content: center;
  background: rgba(10, 26, 16, 0.88);
  border: 2px solid rgba(64, 199, 116, 0.9);
  line-height: 0; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
}
#float-back svg { display: block; }
#float-back:hover, #float-back:active { background: rgba(31, 157, 77, 0.92); }
section.float-back-pad { padding-top: 92px; }

/* Browse screens (Live TV, Movies, Series, Favorites): the
 * floating button replaces the header's own Back button, but
 * that button is display:none (below), so it leaves no slot in
 * the header row and the title starts right under the floating
 * button (owner report, 2026-12-02: the arrow sat on top of
 * the "L" of "Live TV", and the same on "Movies"). Shift the
 * browse header right so the title sits beside the button with
 * clear space between them, at any window width. The other
 * screens this button serves (Settings, Add, Guide, Detail)
 * are pushed DOWN by float-back-pad instead and never collide. */
#scr-browse .screen-head { padding-left: 60px; }

/* Owner order 2026-11-10: the screens' own bottom Back buttons are
 * unnecessary on the web; the floating green arrow replaces them.
 * Hidden ONLY in the web package (web.css): the elements and their
 * handlers stay in the DOM (the fullscreen twin clicks #osd-back),
 * and the TV packages keep their on-screen Back buttons. */
#osd-back, #set-back, #d-back, #wb-back,
#scr-add [data-back], #scr-guide [data-act="back"] { display: none !important; }

/* fullscreen player (js/float-back.js, web only): while the
 * player carries the ip-fs marker (fullscreen in fact), the
 * bottom-row Back button leaves the OSD menu; its twin rides
 * inside the OSD at the top-left, so it appears and hides with
 * the menu, and the title box shifts right to clear it. */
#fs-back { display: none; }
#scr-player.ip-fs #osd-back { display: none; }
#scr-player.ip-fs #fs-back {
  display: flex; align-items: center; justify-content: center;
  position: absolute; top: 16px; left: 16px; z-index: 5;
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(10, 26, 16, 0.88);
  border: 2px solid rgba(64, 199, 116, 0.9);
  line-height: 0; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
#scr-player.ip-fs .osd-top { margin-left: 84px; }

/* ---------------- mobile web (phones, <= 860px) ----------------
 * The layout above is the 10-foot TV/desktop design. Under this
 * breakpoint the same screens reflow for touch: everything stacks,
 * category rails become horizontal chip rows, poster grids go
 * fluid, Live TV becomes a phone-style channel list (the EPG
 * timeline grid is desktop-only; browse-pane.js renders it only
 * above this breakpoint) and every control keeps a >= 44px
 * touch target. Desktop and the TV
 * packages are untouched: this file only ships in the web build.
 */
@media (max-width: 860px) {
  html, body { font-size: 17px; }
  .screen {
    padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .screen-head { flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
  .screen-head h1 { font-size: 24px; }
  .screen-msg { font-size: 16px; padding: 10px 0; }
  .btn { padding: 12px 20px; font-size: 16px; min-height: 48px; }
  .chip { padding: 10px 16px; font-size: 15px; min-height: 42px; margin: 0 8px 8px 0; }
  .cat-rail { overflow-x: auto; white-space: nowrap; -webkit-overflow-scrolling: touch; }

  /* home: brand row, clock strip, 3-across tiles, wrapped bars */
  #scr-home { overflow-y: auto; overflow-x: hidden; }
  .home2 { height: auto; min-height: 100%; gap: 14px; }
  .home2-head { flex-wrap: wrap; gap: 10px; }
  .home2-brand { font-size: 20px; gap: 10px; }
  .home2-brand img { height: 44px; }
  .home2-headpills { flex-wrap: wrap; gap: 8px; }
  .home2-pill { font-size: 15px; padding: 10px 15px; min-height: 44px; }
  .home2-main { flex: none; flex-direction: column; gap: 14px; }
  .home2-left {
    width: 100%; flex-direction: row; align-items: baseline;
    flex-wrap: wrap; gap: 6px 16px;
  }
  .home2-clock { font-size: 38px; }
  .home2-date { font-size: 15px; margin-top: 0; }
  .home2-premium { font-size: 15px; margin-top: 0; }
  .home2-tiles { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .home2-tile { min-height: 104px; height: auto; padding: 14px 6px; border-radius: 14px; border-width: 2px; }
  .home2-icon { width: 38px; height: 38px; margin-bottom: 8px; }
  .home2-tile span { font-size: 16px; }
  .home2-side { width: 100%; flex-direction: row; flex-wrap: wrap; gap: 8px; }
  .home2-side .home2-pill { width: auto; flex: 1 1 42%; text-align: center; padding: 11px 10px; }
  .home2-bar { flex-wrap: wrap; gap: 8px; }
  .home2-barbtn { flex: 1 1 42%; font-size: 15px; padding: 13px 8px; min-height: 48px; }
  .home2-foot { font-size: 13px; gap: 10px; flex-wrap: wrap; }

  /* browse shell: search wraps full-width under the title row */
  #scr-browse.wb .screen-head { margin-bottom: 10px; padding-left: 56px; }
  #scr-browse.wb .screen-head h1 { font-size: 22px; }
  .search-input {
    margin-left: 0; width: 100%; flex: 1 1 100%; order: 3;
    font-size: 16px; padding: 11px 14px; min-height: 46px;
  }
  .wb-layout { flex-direction: column; gap: 10px; height: calc(100% - 124px); }
  /* Column direction makes height the main axis: without this,
   * .wb-main refuses to shrink below its content height, .wb-list
   * takes the full content height (scrollHeight == clientHeight,
   * zero scroll range) and the clipped remainder is unreachable
   * (the Live touch-scroll failure, 2026-11-05). */
  .wb-main { min-height: 0; }
  .wb-list { min-height: 0; }

  /* category rail -> horizontal chip row (collapse state ignored) */
  .wb-rail { width: 100%; flex: none; }
  .wb-layout.wb-railoff .wb-rail { width: 100%; }
  .wb-rail-head { display: none; }
  .wb-rail-body {
    display: flex; flex-direction: row; align-items: center; gap: 8px;
    overflow-x: auto; overflow-y: hidden; padding: 8px;
    -webkit-overflow-scrolling: touch;
  }
  .wb-layout.wb-railoff .wb-rail-body { display: flex; }
  .wb-cat {
    width: auto; flex: none; white-space: nowrap; margin-bottom: 0;
    padding: 9px 14px; font-size: 15px; min-height: 40px;
    background: #1c2620; border: 2px solid #33463a; border-radius: 999px;
  }
  .wb-group { display: flex; flex: none; align-items: center; gap: 8px; margin-bottom: 0; }
  .wb-ghead {
    width: auto; flex: none; white-space: nowrap;
    font-size: 14px; padding: 9px 10px; min-height: 40px;
  }
  .wb-gbody { display: flex; gap: 8px; padding: 0; align-items: center; }
  .wb-gbody .wb-cat { margin-bottom: 0; }
  .wb-lock { margin-top: 0; }

  /* preview / info pane compacts to a strip. The Live preview
   * floats its thumb left of the now/next text and puts every
   * control in ONE full-width row (owner fix, 2026-11-05: the
   * stacked full-width buttons ate ~60% of the phone screen and
   * left the channel area with barely two rows). */
  .wb-top { min-height: 0; padding: 10px; margin-bottom: 10px; }
  .wb-topempty { min-height: 56px; font-size: 15px; gap: 12px; }
  .wb-topempty img { width: 40px; height: 40px; }
  .wb-info { gap: 12px; }
  .wb-top[data-state="live"] .wb-pv { display: block; }
  .wb-vwrap { float: left; width: 138px; max-width: 40vw; margin: 0 12px 4px 0; }
  .wb-vempty img { width: 52px; height: 52px; }
  .wb-pinfo { display: block; }
  .wb-pname { font-size: 17px; }
  .wb-pnow { font-size: 14px; min-height: 0; margin-top: 4px; }
  .wb-pbar { margin-top: 5px; }
  .wb-pnext { font-size: 13px; min-height: 0; margin-top: 4px; }
  .wb-pdesc { display: none; }
  .wb-actions {
    clear: both; flex-wrap: nowrap; gap: 5px;
    margin-top: 0; padding-top: 10px;
  }
  .wb-actions .btn {
    padding: 10px 6px; font-size: 12.5px; min-height: 44px; white-space: nowrap;
  }
  .wb-actions #wb-pause { flex: none; width: 46px; }
  .wb-actions #wb-full { flex: 0.9 1 0; overflow: hidden; }
  .wb-actions #wb-fav { flex: 1.25 1 0; overflow: hidden; font-size: 12px; }
  .wb-vol { flex: none; gap: 5px; }
  .wb-vol-slider { width: 40px; }
  .wb-iposter { width: 60px; height: 88px; }
  .wb-ititle { font-size: 18px; }
  .wb-imeta { font-size: 13px; }
  .wb-iplot { font-size: 13px; -webkit-line-clamp: 2; }

  /* lists: compact rows, fluid poster grid */
  .wb-list { padding: 2px 2px 8px; }
  .wb-list.rows { gap: 8px; }
  .wb-row { gap: 10px; padding: 10px 12px; }
  .wb-rnum { font-size: 15px; min-width: 28px; }
  .wb-rlogo { width: 84px; height: 40px; }
  .wb-rlogo img { max-width: 84px; max-height: 40px; }
  .wb-rposter { width: 34px; height: 50px; }
  .wb-rposter img { max-width: 34px; max-height: 50px; }
  .wb-rname { font-size: 16px; min-width: 0; flex: 1; }
  .wb-rnow { font-size: 13px; }
  .wb-rnext { display: none; }
  .wb-rmeta { font-size: 13px; }
  .wb-msg { font-size: 14px; min-height: 22px; }
  .wb-list.cards { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 12px; }
  .wb-card { padding: 8px; }
  .wb-poster { height: auto; aspect-ratio: 2 / 3; }
  .wb-card-title { font-size: 13px; height: 36px; margin-top: 7px; }
  .wb-card-badge { font-size: 13px; }
  .wb-more { padding: 14px; font-size: 15px; min-height: 48px; }

  /* Live TV: phone-style channel list (browse-pane.js renders
   * .wb-phrow rows instead of the timeline grid on small screens,
   * mirroring the Android phone app). Native overflow scrolling;
   * nothing here may intercept touch drags. */
  .wb-list.wb-phlist { gap: 8px; }
  .wb-phrow { gap: 10px; padding: 9px 10px; }
  .wb-phrow .wb-rnum { font-size: 14px; min-width: 26px; }
  .wb-phrow .wb-rlogo { width: 64px; height: 36px; }
  .wb-phrow .wb-rlogo img { max-width: 64px; max-height: 32px; }
  .wb-phmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .wb-phname { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wb-phnow { font-size: 13px; color: #d8e4da; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wb-phbar { height: 5px; background: #26362c; border-radius: 3px; overflow: hidden; }
  .wb-phbar-fill { display: block; height: 100%; width: 0; background: #35d461; }
  .wb-phnext { font-size: 12px; color: #9fb8a6; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* EPG timeline grid, compact (mirrors browse-pane.js constants) */
  .wb-guidehead { height: 32px; margin-bottom: 6px; }
  .wb-gh-fixed { width: 168px; font-size: 13px; padding: 6px 8px; }
  .wb-gh-mark { font-size: 12px; top: 8px; margin-left: 4px; }
  .wb-grow { height: 56px; }
  .wb-gchan { width: 168px; height: 56px; padding: 6px 8px; gap: 7px; border-radius: 8px; }
  .wb-gchan .wb-rnum { font-size: 13px; min-width: 20px; }
  .wb-gchan .wb-rlogo { width: 60px; height: 30px; }
  .wb-gchan .wb-rlogo img { max-width: 60px; max-height: 30px; }
  .wb-gchan .wb-rname { font-size: 13px; }
  .wb-cell { top: 5px; height: 46px; padding: 4px 7px; border-radius: 7px; }
  .wb-cell-t { font-size: 12px; }
  .wb-cell-time { font-size: 10px; }
  .wb-cell-none { top: 5px; height: 46px; font-size: 12px; padding: 0 10px; }

  /* simple guide list (app.js guide screen) */
  .guide-row { flex-wrap: wrap; gap: 6px 12px; padding: 10px 12px; }
  .g-num { width: auto; font-size: 15px; }
  .g-name { width: auto; flex: 1; font-size: 16px; }
  .g-now { flex: 1 1 100%; font-size: 14px; }
  .g-next { flex: 1 1 100%; font-size: 13px; }

  /* detail: poster over info, cast scrolls sideways */
  .detail-wrap { flex-direction: column; gap: 16px; }
  .detail-poster { width: 148px; }
  .detail-body h1 { font-size: 25px; }
  .detail-meta, .detail-plot { font-size: 15px; }
  .detail-actions { flex-wrap: wrap; gap: 10px; }
  .cast-row { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; -webkit-overflow-scrolling: touch; }
  .cast-chip { flex: none; font-size: 14px; }
  .cast-photo { width: 36px; height: 36px; }
  .episode-btn { padding: 10px 12px; font-size: 15px; min-height: 48px; gap: 12px; }
  .ep-num { width: 34px; }

  /* forms & settings */
  .field { width: 100%; font-size: 16px; min-height: 48px; padding: 12px 14px; }
  .add-form label { font-size: 15px; }
  .form-actions { flex-wrap: wrap; }
  .settings-body h2 { font-size: 21px; margin: 22px 0 10px; }
  .set-row { flex-wrap: wrap; }
  .key-field { width: 100%; }
  .set-text { font-size: 14px; }

  /* player: big touch targets, safe-area aware OSD */
  #player-osd { padding: 10px; }
  .osd-top { padding: 12px 14px; }
  #osd-title { font-size: 19px; }
  #osd-meta { font-size: 13px; }
  .osd-bottom {
    padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  }
  #osd-progress { height: 26px; border-radius: 10px; }
  #osd-progress-thumb { width: 28px; height: 28px; margin: -14px 0 0 -14px; }
  .osd-times { font-size: 13px; margin-bottom: 10px; }
  .osd-buttons { flex-wrap: wrap; gap: 10px; }
  .osd-btn { min-width: 0; flex: 1 1 30%; min-height: 48px; padding: 12px 8px; font-size: 15px; }
  .osd-vol { flex: 1 1 100%; }
  .osd-vol .osd-btn { flex: none; min-width: 52px; }
  .vol-slider { flex: 1; width: auto; height: 36px; }
  #osd-menu { min-width: 0; width: 88vw; bottom: 160px; padding: 14px 16px; }
  .osd-menu-opt { min-height: 46px; font-size: 16px; }

  /* overlays & toast */
  .resume-box { padding: 24px 20px; }
  .resume-title { font-size: 22px; }
  .resume-text { font-size: 16px; }
  .pin-box { width: 92vw; max-width: 92vw; padding: 24px 14px; }
  .pin-title { font-size: 22px; }
  #pin-pad > span { width: 27vw; max-width: 108px; }
  .pin-key { width: 27vw; max-width: 108px; height: 58px; font-size: 24px; }
  #toast { font-size: 15px; max-width: 92vw; padding: 12px 18px; bottom: 4vh; }

  /* floating back button on small screens: slightly smaller and
   * clear of the notch / rounded corners. */
  #float-back {
    top: calc(10px + env(safe-area-inset-top));
    left: calc(10px + env(safe-area-inset-left));
    width: 48px; height: 48px;
  }
  #float-back svg { width: 26px; height: 26px; }
  section.float-back-pad { padding-top: 70px; }
}

/* coarse pointers (any size): never require hover, keep targets big */
@media (pointer: coarse) {
  .wb-cat, .wb-ghead, .wb-row, .wb-card, .wb-gchan, .wb-cell { -webkit-tap-highlight-color: rgba(53, 212, 97, 0.18); }
  .wb-rail-toggle { width: 44px; height: 44px; }
}

/* password eye (js/mobile-fields.js): hidden outside the mobile
 * breakpoint; inside it the toggle sits at the right edge of the
 * password field. Desktop Safari gets the same treatment via the
 * is-safari class mobile-fields.js puts on <html> (owner report
 * 2026-11-10: the eye never appeared on his Mac because the only
 * display rule lived under 860px). The two blocks below carry the
 * same declarations on purpose; keep them in sync. */
.pw-eye { display: none; }
@media (max-width: 860px) {
  .pw-field { position: relative; }
  .pw-field input { padding-right: 52px; }
  .pw-eye {
    display: flex; align-items: center; justify-content: center;
    position: absolute; right: 6px; top: 50%;
    transform: translateY(-50%);
    width: 42px; height: 42px; padding: 0;
    background: transparent; border: 0; border-radius: 50%;
    color: #9fd8b4; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .pw-eye:active { background: rgba(31, 157, 77, 0.25); }
  .pw-eye .pw-eye-slash { display: none; }
  .pw-eye:not(.on) .pw-eye-slash { display: block; }
}
html.is-safari .pw-field { position: relative; }
html.is-safari .pw-field input { padding-right: 52px; }
html.is-safari .pw-eye {
  display: flex; align-items: center; justify-content: center;
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 42px; height: 42px; padding: 0;
  background: transparent; border: 0; border-radius: 50%;
  color: #9fd8b4; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html.is-safari .pw-eye:active { background: rgba(31, 157, 77, 0.25); }
html.is-safari .pw-eye .pw-eye-slash { display: none; }
html.is-safari .pw-eye:not(.on) .pw-eye-slash { display: block; }
