/* FlyFam Network TV - shared web/TV app.
   Plain CSS with no custom properties and no grid, so it also runs on 2017+ Samsung Tizen
   and LG webOS 4+ browsers. Brand: black #060608, red #d7161e, text #f2f2f4 (same as Roku + site). */
@font-face { font-family: "Metropolis"; src: url("../fonts/Metropolis-Regular.ttf") format("truetype"); font-weight: 400; }
@font-face { font-family: "Metropolis"; src: url("../fonts/Metropolis-SemiBold.ttf") format("truetype"); font-weight: 600; }

html { font-size: 16px; }
html.tv { font-size: 1.25vw; }               /* 24px at 1920x1080, 16px at 1280x720 */
@media (max-width: 700px) { html:not(.tv) { font-size: 15px; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #060608; color: #f2f2f4; }
body { font-family: "Metropolis", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif; line-height: 1.4; overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.hidden { display: none !important; }
#app { position: absolute; top: 0; left: 0; right: 0; bottom: 0; }

/* ---------- top bar ---------- */
#topbar { position: absolute; z-index: 5; top: 0; left: 0; right: 0; height: 4.5rem; display: flex; align-items: center;
  padding: 0 3rem; background: linear-gradient(to bottom, rgba(6,6,8,.95), rgba(6,6,8,0)); }
#brand { display: block; height: 3.2rem; margin-right: 2rem; border-radius: .4rem; flex-shrink: 0; }
#brand img { height: 100%; width: auto; display: block; }
#menu { display: flex; align-items: center; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
#menu::-webkit-scrollbar { display: none; }
#menu-cats { display: flex; }
.menu-item { padding: .45rem 1rem; margin-right: .3rem; border-radius: 2rem; color: #c8ccd4; font-weight: 600; font-size: 1rem; border: 2px solid transparent; }
.menu-item.active { color: #fff; border-color: #d7161e; }

#view { position: absolute; top: 0; left: 0; right: 0; bottom: 0; overflow-y: auto; overflow-x: hidden; outline: none;
  -webkit-overflow-scrolling: touch; padding-bottom: 3rem; }
html.tv #view { overflow: hidden; }          /* TV: the focus manager scrolls */

/* ---------- focus (TV + keyboard) ---------- */
.focusable { outline: none; }
.focusable.focused, html.kbd .focusable:focus { box-shadow: 0 0 0 .22rem #fff, 0 0 1.4rem rgba(215,22,30,.9); }
.tile.focused, html.kbd .tile:focus { -webkit-transform: scale(1.06); transform: scale(1.06); z-index: 2; }
@media (hover: hover) { html:not(.tv) .focusable:hover { box-shadow: 0 0 0 .15rem rgba(255,255,255,.7); } }

/* ---------- hero ---------- */
/* Backdrops are 16:9 frames made for the Roku layout (art top-right, blurred fill), so the hero is a
   16:9 box and the whole image shows. */
.hero { position: relative; height: 56.25vw; max-height: 88vh; min-height: 22rem; overflow: hidden; background: #000; }
html.tv .hero { height: 56.25vw; max-height: 82vh; }
.hero-art { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; background-repeat: no-repeat;
  background-size: contain; background-position: center top; }   /* contain = never crop key art */
.hero-art-phone { display: none; }
@media (max-width: 700px) { html:not(.tv) .hero-art { display: none; } html:not(.tv) .hero-art-phone { display: block; } }
.hero-shade { position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to right, rgba(6,6,8,.85) 0%, rgba(6,6,8,.55) 35%, rgba(6,6,8,0) 55%), linear-gradient(to top, #060608 0%, rgba(6,6,8,0) 40%); }
.hero-body { position: absolute; left: 3rem; bottom: 3rem; width: 44%; min-width: 18rem; }
.hero-kicker { color: #ff4048; font-weight: 600; letter-spacing: .12em; font-size: .8rem; text-transform: uppercase; }
.hero h1 { font-size: 2.6rem; margin: .3rem 0 .5rem; line-height: 1.1; }
.hero p { color: #c8ccd4; margin: 0 0 1.2rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { color: #a9adb6; font-size: .9rem; margin-bottom: .6rem; }
.badge { display: inline-block; border: 1px solid #a9adb6; border-radius: .25rem; padding: 0 .35rem; margin-right: .5rem; font-size: .8rem; color: #e2e4ea; }
.hero-dots { position: absolute; right: 3rem; bottom: 1.5rem; }
.hero-dots span { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; background: #555; margin-left: .4rem; }
.hero-dots span.on { background: #d7161e; }

/* ---------- buttons ---------- */
.btn { display: inline-block; padding: .7rem 1.6rem; margin: 0 .6rem .6rem 0; border-radius: .4rem; background: #2a2a31; font-weight: 600; font-size: 1rem; }
.btn-primary { background: #d7161e; color: #fff; }
.btn.focused { background: #fff; color: #060608; }

/* ---------- rows ---------- */
.rows { padding-top: .5rem; }
.row { margin: 1.2rem 0 .4rem; }
.row h2 { font-size: 1.3rem; margin: 0 3rem .5rem; font-weight: 600; }
.row-scroll { overflow-x: auto; overflow-y: hidden; white-space: nowrap; padding: .6rem 3rem 1rem; scrollbar-width: none; }
.row-scroll::-webkit-scrollbar { display: none; }
html.tv .row-scroll { overflow: hidden; }
.tile { position: relative; display: inline-block; vertical-align: top; width: 16rem; margin-right: 1rem; white-space: normal;
  border-radius: .5rem; background: #121216; -webkit-transition: -webkit-transform .15s; transition: transform .15s; }
html.tv .tile { width: 17rem; }
@media (max-width: 700px) { html:not(.tv) .tile { width: 11.5rem; margin-right: .6rem; } html:not(.tv) .row-scroll { padding-left: 1rem; padding-right: 1rem; } html:not(.tv) .row h2 { margin: 0 1rem .5rem; } }
.tile-art { position: relative; width: 100%; padding-top: 56.25%; border-radius: .5rem .5rem 0 0; background: #000 no-repeat center;
  background-size: contain; }                /* posters/thumbnails are shown whole, never cropped */
.tile-tag { position: absolute; left: .5rem; top: .5rem; background: #d7161e; color: #fff; font-size: .65rem; font-weight: 600; padding: .1rem .4rem; border-radius: .2rem; letter-spacing: .06em; }
.tile-progress { position: absolute; left: 0; right: 0; bottom: 0; height: .25rem; background: rgba(255,255,255,.25); }
.tile-progress div { height: 100%; background: #d7161e; }
.tile-text { padding: .5rem .7rem .7rem; }
.tile-title { font-weight: 600; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-sub { color: #a9adb6; font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- detail page ---------- */
.detail .hero p { -webkit-line-clamp: 4; }
.seasons { padding: 0 3rem; margin: 1rem 0 .3rem; white-space: nowrap; overflow-x: auto; scrollbar-width: none; }
.season-tab { display: inline-block; padding: .4rem 1.1rem; margin-right: .5rem; border-radius: 2rem; border: 2px solid #333; font-weight: 600; }
.season-tab.active { border-color: #d7161e; }
.episodes { padding: .5rem 3rem 2rem; }
.episode { display: flex; align-items: center; padding: .7rem; margin-bottom: .6rem; border-radius: .5rem; background: #121216; width: 100%; text-align: left; }
.ep-thumb { position: relative; width: 14rem; flex-shrink: 0; padding-top: 7.875rem; border-radius: .35rem; background: #000 no-repeat center; background-size: contain; margin-right: 1.2rem; }
.ep-body { min-width: 0; }
.ep-title { font-weight: 600; font-size: 1.05rem; }
.ep-desc { color: #a9adb6; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 700px) { html:not(.tv) .ep-thumb { width: 9rem; padding-top: 5.06rem; margin-right: .8rem; } html:not(.tv) .episodes, html:not(.tv) .seasons { padding-left: 1rem; padding-right: 1rem; }
  html:not(.tv) .hero-body { left: 1rem; right: 1rem; width: auto; min-width: 0; bottom: 1.5rem; } html:not(.tv) .hero h1 { font-size: 1.8rem; }
  html:not(.tv) .hero { height: auto; min-height: 0; max-height: none; padding-top: 56.25vw; } html:not(.tv) .hero-art { bottom: auto; height: 56.25vw; }
  html:not(.tv) .hero-body { position: relative; left: 0; right: 0; bottom: 0; padding: 0 1rem 1rem; } html:not(.tv) .hero-shade { background: linear-gradient(to top, #060608 0%, rgba(6,6,8,0) 60%); }
  html:not(.tv) #topbar { padding: 0 1rem; } html:not(.tv) #brand { height: 2.4rem; margin-right: .6rem; } }

/* ---------- search ---------- */
.search { padding: 6rem 3rem 2rem; }
.search-bar { display: flex; align-items: center; margin-bottom: 1rem; }
#search-input { flex: 1; font: inherit; font-size: 1.4rem; padding: .7rem 1rem; border-radius: .4rem; border: 2px solid #333; background: #121216; color: #fff; outline: none; }
#search-input.focused, #search-input:focus { border-color: #fff; }
.keyboard { width: 30rem; max-width: 100%; margin: 0 0 1rem; }
.key { display: inline-block; width: 2.9rem; height: 2.6rem; margin: 0 .3rem .3rem 0; border-radius: .3rem; background: #1d1d23; font-weight: 600; text-align: center; line-height: 2.6rem; }
.key.wide { width: 6.1rem; }
.key.focused { background: #fff; color: #060608; }
.search-results { white-space: normal; }
.search-results .tile { margin-bottom: 1.2rem; }
.search-empty { color: #a9adb6; }
.search-layout { display: flex; align-items: flex-start; }
.search-layout .keyboard { flex-shrink: 0; margin-right: 2rem; }
.search-layout .search-results { flex: 1; }
html:not(.tv) .keyboard { display: none; }
html:not(.tv) .search-layout { display: block; }
@media (max-width: 700px) { html:not(.tv) .search { padding: 5rem 1rem 2rem; } }

/* ---------- player ---------- */
#player { position: fixed; z-index: 20; top: 0; left: 0; right: 0; bottom: 0; background: #000; }
#video { position: absolute; width: 100%; height: 100%; object-fit: contain; background: #000; }
#ad-container { position: absolute; top: 0; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none; }
#ad-container.active { pointer-events: auto; }
#ad-badge { position: absolute; z-index: 3; top: 1.5rem; left: 1.5rem; background: rgba(0,0,0,.7); padding: .3rem .8rem; border-radius: .3rem; font-weight: 600; }
#player-ui { position: absolute; z-index: 4; top: 0; left: 0; right: 0; bottom: 0; opacity: 1; -webkit-transition: opacity .3s; transition: opacity .3s;
  background: linear-gradient(to bottom, rgba(0,0,0,.75), rgba(0,0,0,0) 25%, rgba(0,0,0,0) 65%, rgba(0,0,0,.85)); }
#player.idle #player-ui { opacity: 0; }
#player.idle { cursor: none; }
.pl-top { padding: 2rem 3rem; }
#pl-title { font-size: 1.6rem; font-weight: 600; }
#pl-sub { color: #c8ccd4; }
.pl-bottom { position: absolute; left: 3rem; right: 3rem; bottom: 2rem; }
#pl-bar { position: relative; height: .45rem; background: rgba(255,255,255,.25); border-radius: .3rem; margin-bottom: 1rem; cursor: pointer; }
#pl-buffer { position: absolute; height: 100%; background: rgba(255,255,255,.35); border-radius: .3rem; width: 0; }
#pl-progress { position: absolute; height: 100%; background: #d7161e; border-radius: .3rem; width: 0; }
#pl-knob { position: absolute; top: 50%; width: 1.1rem; height: 1.1rem; margin: -.55rem 0 0 -.55rem; border-radius: 50%; background: #fff; left: 0; }
.pl-row { display: flex; align-items: center; }
.pl-btn { min-width: 3.2rem; height: 3.2rem; padding: 0 .9rem; margin-right: .7rem; border-radius: 1.6rem; background: rgba(255,255,255,.12); font-size: 1.1rem; font-weight: 600; }
.pl-btn.focused { background: #fff; color: #000; }
.pl-main { background: #d7161e; }
#pl-time { flex: 1; color: #e2e4ea; margin-left: .6rem; }
html.tv #pl-full, html.tv #pl-back { display: none; }
#upnext, #pl-error { position: absolute; z-index: 6; right: 3rem; bottom: 8rem; width: 30rem; max-width: 90%; padding: 1.5rem; background: rgba(18,18,22,.96); border-radius: .6rem; border: 1px solid #2a2a31; }
#pl-error { left: 50%; top: 50%; right: auto; bottom: auto; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%); text-align: center; }
.un-label { color: #ff4048; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
#un-title { font-size: 1.3rem; font-weight: 600; margin: .3rem 0 1rem; }
.un-row { margin-top: .8rem; }

/* ---------- dialog / splash / misc ---------- */
#dialog { position: fixed; z-index: 30; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.75); }
.dlg-box { position: absolute; left: 50%; top: 50%; width: 32rem; max-width: 92%; -webkit-transform: translate(-50%,-50%); transform: translate(-50%,-50%);
  background: #121216; border-radius: .6rem; padding: 2rem; border: 1px solid #2a2a31; }
.dlg-box h2 { margin-top: 0; }
.dlg-box p { color: #c8ccd4; white-space: pre-line; }
#splash { position: fixed; z-index: 40; top: 0; left: 0; right: 0; bottom: 0; background: #060608; text-align: center; padding-top: 35vh; }
#splash img { width: 22rem; max-width: 70%; }
.spinner { width: 3rem; height: 3rem; margin: 1.5rem auto; border-radius: 50%; border: .3rem solid rgba(255,255,255,.2); border-top-color: #d7161e;
  -webkit-animation: spin 1s linear infinite; animation: spin 1s linear infinite; }
#pl-spinner { position: absolute; z-index: 5; left: 50%; top: 50%; margin: -1.5rem 0 0 -1.5rem; }
@-webkit-keyframes spin { to { -webkit-transform: rotate(360deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
.message { padding: 8rem 3rem; text-align: center; color: #c8ccd4; }
.footer { color: #6f737c; font-size: .8rem; padding: 2rem 3rem; }
.footer a { color: #a9adb6; text-decoration: underline; margin-right: 1rem; }
html.tv .footer a { text-decoration: none; }
@media (max-width: 700px) {
  html:not(.tv) .pl-top { padding: 1rem; } html:not(.tv) #pl-title { font-size: 1.2rem; }
  html:not(.tv) .pl-bottom { left: 1rem; right: 1rem; bottom: 1.2rem; }
  html:not(.tv) .pl-btn { min-width: 2.6rem; height: 2.6rem; padding: 0 .6rem; margin-right: .4rem; font-size: .9rem; }
  html:not(.tv) #pl-time { font-size: .8rem; white-space: nowrap; margin-left: .2rem; }
  html:not(.tv) #upnext { right: 1rem; left: 1rem; width: auto; bottom: 7rem; }
}
