/* Phone layout for Lumen on Android, loaded after the desktop styles (styles.css). The pages stay the same;
   sizes shrink, the page links become a bottom tab bar, and touch replaces hover. */

:root { --gutter: 16px; --titlebar: 0px; --tabbar: 64px; }
body.android { font-size: 14px; -webkit-tap-highlight-color: transparent; overscroll-behavior-y: none; }
body.android * { -webkit-app-region: none !important; }
body.android ::-webkit-scrollbar { display: none; }

/* top bar: logo, search, bell, profile */
.android .nav { padding: 8px 10px 0; }
.android .nav-inner { height: 52px; gap: 6px; padding: 0 6px 0 12px; border-radius: 16px; }
.android .logo { font-size: 20px; }
.android .logo svg { width: 24px; height: 24px; }
.android .icon-btn { width: 40px; height: 40px; }

/* bottom tab bar */
.android .links { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; margin: 0; gap: 0; display: grid; grid-template-columns: repeat(6, 1fr);
  height: var(--tabbar); padding: 4px 4px 6px; background: rgba(8,9,15,.92); border-top: 1px solid var(--stroke);
  -webkit-backdrop-filter: blur(20px) saturate(150%); backdrop-filter: blur(20px) saturate(150%); }
.android .links a.in-more { display: none; }
.android .links a, .android .links .tab-more { display: grid; justify-items: center; align-content: center; gap: 3px; padding: 4px 0; border-radius: 12px; background: none;
  color: var(--faint); font-size: 10.5px; font-weight: 800; letter-spacing: .01em; text-decoration: none; }
.android .links svg { width: 22px; height: 22px; }
.android .links a.on, .android .links .tab-more.on, .android .links .tab-more.active { color: var(--ink); background: none; }
.android .links a.on svg, .android .links .tab-more.active svg { color: var(--accent); }
.android .links a span, .android .links .tab-more span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.more-sheet { position: fixed; right: 10px; bottom: calc(var(--tabbar) + 10px); z-index: 46; display: grid; min-width: 190px; padding: 6px; border-radius: 16px;
  background: rgba(12,14,22,.94) !important; animation: rise .2s ease; }
.more-sheet a { padding: 13px 16px; border-radius: 11px; font-weight: 800; font-size: 15px; text-decoration: none; }
.more-sheet a:active { background: var(--glass-hi); }
.android main { padding-bottom: calc(var(--tabbar) + 30px); }
.android .toast { bottom: calc(var(--tabbar) + 14px); }
body.android.locked .links, body.android.locked .more-sheet { display: none; }

/* hero */
.android .hero { height: 66vh; min-height: 440px; max-height: 620px; }
.android .hero-bg { background-position: center top; }
.android .hero::after { background:
  linear-gradient(0deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, transparent) 30%, color-mix(in srgb, var(--bg) 0%, transparent) 62%),
  linear-gradient(180deg, color-mix(in srgb, var(--bg) 60%, transparent) 0%, transparent 18%); }
.android .hero-copy { bottom: 74px; max-width: none; }
.android .hero h1 { font-size: clamp(32px, 10vw, 46px); margin: 10px 0 8px; }
.android .hero p { font-size: 14px; margin: 8px 0 14px; -webkit-line-clamp: 2; }
.android .eyebrow { font-size: 10.5px; padding: 5px 10px; }
.android .meta { font-size: 12.5px; gap: 4px 10px; }
.android .dots { display: none; }
.android .btn { height: 44px; padding: 0 16px; font-size: 14px; border-radius: 13px; gap: 8px; }
.android .btn-round { width: 44px; padding: 0; }
.android .btn-small { height: 36px; padding: 0 12px; font-size: 12.5px; }
.android .hero:not([hidden]) + main { margin-top: -54px; }
/* pages under a banner (Movies, Series, Anime) start right below it, not a top bar's height lower */
.android .hero:not([hidden]) + main .page { padding-top: 8px; }

/* shelves */
.android .row { margin-bottom: 18px; }
.android .row-head { margin-bottom: 4px; }
.android .row-head h2 { font-size: 17px; }
.android .row-nav { display: none; }
.android .track { gap: 10px; padding: 8px var(--gutter) 12px; }
.android .poster { width: 112px; }
.android .wide { width: 236px; }
.android .top { width: 160px; }
.android .top .num { font-size: 52px; }
.android .top .num.two { font-size: 38px; }
.android .card-title { font-size: 13px; }
.android .card-foot { padding: 30px 9px 8px; }
.android .card:hover, .android .card:focus-visible { transform: none; box-shadow: none; }
.android .card:active { transform: scale(.97); }
.android .grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }

/* pages */
.android .page { padding: 76px var(--gutter) 0; }
.android .page h1 { font-size: 30px; }
.android .page .sub { margin-bottom: 16px; }
.android .panel { padding: 18px; border-radius: 18px; }
.android .panel h2 { font-size: 20px; }
.android .two-col { grid-template-columns: 1fr; }
.android .search-box { height: 52px; padding: 0 16px; margin-bottom: 16px; }
.android .search-box input { font-size: 16px; }
.android .setting-row { flex-wrap: wrap; }
.android .addon { grid-template-columns: 40px minmax(0, 1fr); padding: 12px 14px; gap: 6px 12px; align-items: start; }
.android .addon-ico { width: 40px; height: 40px; border-radius: 11px; font-size: 17px; }
.android .addon h3 { font-size: 15px; }
.android .addon p { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; margin-bottom: 6px; }
.android .addon > :nth-child(n+3) { grid-column: 2 / -1; justify-self: start; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.android .catalog-grid { grid-template-columns: 1fr; gap: 10px; }
/* clips need FFmpeg, which phones don't have */
.android #clipsLib { display: none; }
.android .code-box .code { font-size: 34px; }

/* title page: full screen sheet */
.android .overlay { padding: 0; background: var(--bg); }
.android .sheet { border-radius: 0; min-height: 100%; max-width: none; background: var(--bg); }
.android .sheet.dialog { border-radius: 20px; margin: 18vh 14px 0; min-height: 0; background: var(--glass-strong); }
.android .dialog-body { padding: 22px 20px; }
.android .sheet-hero { aspect-ratio: 16/11; }
.android .sheet-close { top: 10px; right: 10px; }
.android .sheet-head { margin-top: -70px; padding: 0 var(--gutter); }
.android .sheet-head h2 { font-size: clamp(28px, 8.5vw, 40px); margin-bottom: 10px; }
.android .sheet-body { grid-template-columns: 1fr; gap: 16px; padding: 16px var(--gutter) 6px; }
.android .sheet-body p { font-size: 14px; }
.android .tabs { padding: 0 var(--gutter); overflow-x: auto; }
.android .tab { white-space: nowrap; padding: 12px 10px; }
.android .tab-panel { padding: 16px var(--gutter) 28px; }
.android .ep { grid-template-columns: 120px minmax(0, 1fr); gap: 12px; padding: 8px 0; }
.android .ep-n { display: none; }
.android .ep .prog { grid-column: 1; margin-top: -6px; }
.android .ep h4 { font-size: 14px; flex-direction: column; gap: 0; }
.android .stream { grid-template-columns: auto minmax(0, 1fr); gap: 10px; padding: 11px 12px; }
.android .stream > :last-child:not(:nth-child(2)) { display: none; }
.android .stream-name, .android .stream-sub { white-space: normal; }

/* profiles */
.android .profiles-screen { padding: 40px var(--gutter); }
.android .ptiles { gap: 16px; }
.android .ptile { width: 104px; }
.android .pav { width: 96px; height: 96px; border-radius: 24px; }
.android .pdrop, .android .ndrop { right: 10px !important; left: auto; top: 66px; max-width: calc(100vw - 20px); }

/* Settings, as in Android's own settings: a list of categories (.set-list), and a category opens on its own page
   with a back button (android-ui.js switches between the two) */
.android .nav.scrolled .nav-inner { background: rgba(10,11,19,.94) !important; }
.android .set-layout { grid-template-columns: 1fr; gap: 12px; }
.android .set-layout:not(.set-list) .set-nav, .android .set-layout.set-list .set-body { display: none; }
.android .page:has(.set-layout:not(.set-list)) > h1, .android .page:has(.set-layout:not(.set-list)) > .sub { display: none; }
.android .set-nav { position: static; display: grid; grid-auto-flow: row; gap: 0; padding: 4px 0; border-radius: 18px; overflow: hidden; }
.android .set-cat { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 58px; padding: 8px 16px; border-radius: 0; font-size: 15.5px; font-weight: 700;
  color: var(--ink); background: none !important; border: 0; box-shadow: none; text-align: left; }
.android .set-cat + .set-cat { border-top: 1px solid rgba(255,255,255,.06); }
.android .set-cat svg { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); }
.android .set-cat span { flex: 1; min-width: 0; }
.android .set-cat::after { content: ''; flex: none; width: 8px; height: 8px; border: solid var(--faint); border-width: 2px 2px 0 0; transform: rotate(45deg); margin-right: 4px; }
.android .set-cat.on { color: var(--ink); }
.android .set-cat:active { background: rgba(255,255,255,.06) !important; }
.android .set-back { display: inline-flex; align-items: center; gap: 8px; justify-self: start; height: 40px; padding: 0 14px 0 10px; margin-top: -8px; border-radius: 999px;
  border: 1px solid var(--stroke); background: rgba(255,255,255,.05); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; }
.android .set-back::before { content: ''; width: 8px; height: 8px; border: solid currentColor; border-width: 0 0 2px 2px; transform: rotate(45deg); margin-left: 4px; }
.android .set-body { gap: 12px; }
.android .set-body .panel { padding: 18px 16px 6px; }
.android .set-body .panel h2 { font-size: 22px; margin-bottom: 4px; }
.android .set-body .panel > p { font-size: 13px; margin-bottom: 8px; }
/* each setting: its name and a short line, then the control across the full width */
.android .setting-row { display: grid; grid-template-columns: minmax(0, 1fr); padding: 16px 0; gap: 10px; }
.android .setting-row b { font-size: 15px; }
.android .setting-row span { font-size: 13px; line-height: 1.45; }
.android .setting-row > .select { width: 100% !important; height: 46px; border-radius: 13px; }
.android .setting-row > .btn { justify-self: start; }
.android .setting-row > .seg { display: flex; width: 100%; max-width: 100%; }
.android .setting-row > .seg .chip { flex: 1 0 auto; justify-content: center; height: 40px; }
.android .field { gap: 8px; }
.android .field input, .android .select { height: 42px; font-size: 14px; }

/* chips that wrapped into many lines (genres, languages) scroll sideways in one line */
.android .lang-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.android .lang-filter .chip { flex: none; }
/* genres: two rows that scroll sideways and fade out at the edge, so a cut-off chip reads as "more this way" */
.android .genre-bar .lang-filter { margin-bottom: 4px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 var(--gutter), #000 calc(100% - 48px), transparent); }
.android .genre-bar .chip { height: 36px; padding: 0 15px; font-size: 13.5px; }
.android .genre-label { margin: 8px 0 8px; font-size: 10.5px; }
.android .genre-head h2 { font-size: 20px; }
.android .seg { max-width: none; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.android .seg .chip { flex: none; }

/* Browse / Calendar: a small switch on the left under the banner (on its own at the right it looked lost) */
.android .browse-head { justify-content: flex-start; margin: 0 0 10px; }
.android .anime-head { gap: 10px; margin-bottom: 12px; }
.android .anime-head h1 { font-size: 26px; margin: 0 auto 0 0; }
.android .anime-views .chip { height: 34px; padding: 0 14px; font-size: 13px; }
.android .anime-views svg { width: 14px; height: 14px; }

/* Anime filters: the search, then every filter in two even columns, instead of a stack of odd widths */
.android .anime-filters { gap: 8px; padding: 10px; border-radius: 16px; margin-bottom: 18px; }
.android .anime-filters .anime-search { height: 44px; margin: 0; padding: 0 12px; border-radius: 12px; }
.android .anime-filters .anime-search input { font-size: 15px; }
.android .anime-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.android .anime-selects .select, .android .studio-pick .select { width: 100%; min-width: 0; height: 40px; font-size: 13px; padding-left: 12px; text-overflow: ellipsis; }
.android .studio-pick { min-width: 0; }
.android .studio-pick .chip, .android .anime-selects .adult-chip { width: 100%; height: 40px; justify-content: center; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.android .anime-selects .link-btn { grid-column: 1 / -1; justify-self: start; }

/* calendars */
.android .cal-days { display: flex; overflow-x: auto; scrollbar-width: none; margin-left: calc(-1 * var(--gutter)); margin-right: calc(-1 * var(--gutter)); padding: 0 var(--gutter); }
.android .cal-daychip { flex: none; min-width: 62px; padding: 8px 6px; }
.android .cal-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.android .cal-card b { font-size: 12.5px; }
.android .cal-bar { padding: 10px 12px; gap: 8px 12px; }
.android .cal-week { grid-template-columns: repeat(7, 78vw); }

/* touch screens keep :hover after a tap, which left buttons looking pressed */
@media (hover: none) {
  .android .icon-btn:hover, .android .btn-glass:hover, .android .pm-item:hover:not([disabled]), .android .set-cat:not(.on):hover { background: none; }
}

/* player, laid out like phone video apps: a dark fade at the top and bottom instead of glass boxes, play/pause and
   the 10 second skips as big buttons in the middle, and finger-sized buttons along the bottom. Android draws the
   picture behind the page, so frosted glass in the player had nothing to blur and only cost battery. */
.android .player #video { z-index: -1; }
.android .player::before { content: ''; position: absolute; inset: 0; z-index: 0; pointer-events: none; transition: opacity .3s;
  background: linear-gradient(180deg, rgba(0,0,0,.72) 0, rgba(0,0,0,0) 30%, rgba(0,0,0,0) 55%, rgba(0,0,0,.82) 100%), rgba(0,0,0,.18); }
.android .player.idle:not(.paused)::before { opacity: 0; }
.android .player .glass, .android .player .btn-glass { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.android .player-top { padding: max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 30px max(16px, env(safe-area-inset-left)); gap: 10px; background: none; }
.android .player-top .icon-btn { width: 46px; height: 46px; font-size: 22px; background: rgba(0,0,0,.35) !important; border-color: transparent; }
.android .player-top h3 { font-size: 16px; min-width: 0; flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.android .player-top small { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.android .player-top .spacer { display: none; }
/* Watch together / Play on TV: icons only */
.android .player-top .btn { flex: none; width: 46px; height: 46px; padding: 0; gap: 0; justify-content: center; font-size: 0; border-radius: 50%; background: rgba(0,0,0,.35) !important; border-color: transparent; }
.android .player-top .btn svg { font-size: 21px; }
.android .player-center { display: flex; align-items: center; justify-content: center; gap: clamp(28px, 9vw, 72px); transition: opacity .3s; }
.android .player-center .icon-btn { pointer-events: auto; width: 60px; height: 60px; font-size: 30px; border-radius: 50%; background: rgba(0,0,0,.35); }
.android .big-play { width: 78px; height: 78px; font-size: 34px; opacity: 1; transform: none; background: rgba(0,0,0,.45) !important; border-color: rgba(255,255,255,.18); }
.android .player.idle:not(.paused) .player-center { opacity: 0; }
.android .player.idle:not(.paused) .player-center button { pointer-events: none; }
.android .player-center button:active { transform: scale(.92); }
body.android .player .controls { left: 0; right: 0; bottom: 0; padding: 0 max(18px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  gap: 0; border: 0; border-radius: 0; box-shadow: none; background: none !important; }
.android .scrub { height: 30px; }
.android .scrub-knob { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
.android .volume, .android [data-mute], .android [data-fs] { display: none; }
.android .ctrl-row .src-label { display: none; }
.android .ctrl-row { gap: 6px; }
.android .ctrl-row .icon-btn { width: 46px; height: 46px; font-size: 22px; }
.android .ctrl-row .icon-btn:active { background: rgba(255,255,255,.14); }
.android .ctrl-row .time { font-size: 13.5px; margin-left: 2px; color: var(--ink); }
/* menus (audio and subtitles, episodes, Watch together, TV): a panel on the right instead of most of the screen */
.android .pmenu { left: auto; right: 10px; top: 8px; bottom: 76px; width: min(360px, 52vw); max-height: none; flex-direction: column; gap: 4px; overflow-y: auto; padding: 8px; border-radius: 16px; }
.android .pm-col { width: auto; overflow: visible; padding-right: 0; }
.android .pm-col h4 { font-size: 13.5px; margin: 4px 8px 4px; }
.android .pm-item { padding: 6px 10px 6px 26px; border-radius: 10px; }
.android .pm-item b { font-size: 13px; }
.android .pm-item span { font-size: 11.5px; }
.android .pm-item.on::before { left: 10px; top: 13px; width: 7px; height: 7px; }
.android .pm-note { font-size: 12px; margin: 2px 10px 6px; }
.android .pm-sizes { margin: 6px 6px 2px; flex-wrap: wrap; }
.android .pm-sizes .chip { height: 28px; padding: 0 10px; font-size: 11.5px; }
.android .pm-tools { margin: 6px 6px 2px; padding-top: 6px; }
.android .pm-look { margin: 6px 6px 2px; }
.android .pm-opt { min-height: 46px; }
.android .pm-seg button { height: 34px; min-width: 38px; }
.android .pm-delay .icon-btn { width: 34px; height: 34px; }
.android .pm-swatches { gap: 10px; }
.android .pm-swatches button { width: 28px; height: 28px; }
.android .pm-ip { margin: 6px; }
.android .pm-ip .input { height: 36px; }
.android .ep-list { max-height: none; overflow: visible; }
.android .ep-pick { grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 4px; }
.android .ep-pick-text b { font-size: 13px; }
.android .party-col { min-width: 0; max-width: none; gap: 8px; }
.android .party-col .btn { height: 40px; font-size: 13px; }
.android .party-code b { font-size: 22px; }
.android .party-box { left: 10px; right: 10px; width: auto; bottom: calc(var(--tabbar) + 10px); padding: 14px; }
.android .skip-btn, .android .next-card { right: 12px; bottom: 90px; }
.android .player.idle:not(.paused) .skip-btn, .android .player.idle:not(.paused) .next-card { bottom: 20px; }
.android .next-card { width: min(420px, calc(100% - 24px)); padding: 10px; gap: 10px; }
.android .next-thumb { width: 112px; }
.android .psubs { left: 4%; right: 4%; }
.android .player:not(.idle) .psubs, .android .player.paused .psubs { bottom: 96px; }
.android .psubs.size-s span { font-size: 15px; }
.android .psubs.size-m span { font-size: 18px; }
.android .psubs.size-l span { font-size: 22px; }
.android .player-msg { max-width: calc(100% - 32px); padding: 18px 20px; }

/* While Android's player draws the picture behind the page, the page is see-through except for the player's controls. */
html.native-video, html.native-video body { background: transparent !important; }
html.native-video .ambient, html.native-video body > :not(#player):not(#toast) { visibility: hidden; }
html.native-video .player, html.native-video .player lumen-video { background: transparent !important; animation: none; }
lumen-video { position: absolute; inset: 0; display: block; }

/* Sources on a phone: compact rows (picture quality, one line of title, one row of tags, one line of details) */
.android .sources-head { align-items: flex-start; gap: 10px; }
.android .sh-title b { font-size: 16px; line-height: 1.25; }
.android .sh-sub { font-size: 12px; }
.android .src-sel { height: 36px; padding: 0 10px; font-size: 12.5px; }
.android .src-bar { padding: 8px; gap: 8px; }
.android .src-seg button { height: 30px; padding: 0 10px; font-size: 12px; }
.android .src-tools { width: 100%; margin-left: 0; gap: 6px; }
.android .src-search { flex: 1 1 100%; min-width: 0; height: 36px; }
.android .src-tools .src-sel { flex: 1 1 0; min-width: 0; }
.android .stream { grid-template-columns: auto minmax(0, 1fr) auto; gap: 4px 10px; padding: 10px 12px; align-items: start; border-radius: 14px; }
.android .stream .q { min-width: 44px; font-size: 11px; padding: 5px 6px; align-self: start; }
.android .s-title { font-size: 13px; }
.android .s-meta { flex-wrap: nowrap; overflow: hidden; gap: 4px; margin-top: 3px; }
.android .s-meta .s-pill { flex: none; font-size: 9.5px; padding: 1px 5px; letter-spacing: .03em; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.android .stream-sub { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; white-space: normal; font-size: 11px; margin-top: 2px; }
.android .s-size { font-size: 12.5px; }
.android .s-type { font-size: 9px; letter-spacing: .04em; }
body.android .stream > .s-side:last-child:not(:nth-child(2)) { display: grid; }
.android .s-type { display: none; }
.android .s-size { white-space: nowrap; color: var(--ink); }
