/* Skynet TV web app: the look of the Apple TV and Fire TV apps (T-800 home screen, dark show screens, sunrise
   accent), sized for phones, tablets, computers and TV browsers. */
:root {
  --bg: #050507;
  --text: #f4f5f8;
  --dim: rgba(244, 245, 248, 0.62);
  --glass: rgba(20, 22, 30, 0.62);
  --line: rgba(255, 255, 255, 0.1);
  --sunrise: linear-gradient(90deg, #ff5a3c, #ff9a3c);
  --accent: #ff6a3c;
  --pad: clamp(16px, 4vw, 56px);
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; color: var(--text); } /* no body background: it would cover the backdrops */
body {
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
a { color: #ffb08a; }

/* Backgrounds */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #040406; }
.backdrop.home img { width: 100%; height: 100%; object-fit: cover; object-position: 67% center; }
.backdrop.home::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,.3) 45%, rgba(0,0,0,.78));
}
.backdrop.show { background: linear-gradient(180deg, #101116, #040406); }
.backdrop.show img {
  position: absolute; inset: -10%; width: 120%; height: 120%; object-fit: cover; filter: blur(48px); opacity: .28;
}
.backdrop.show::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% -10%, rgba(255,60,30,.22), transparent 60%),
              linear-gradient(180deg, transparent 30%, rgba(0,0,0,.6));
}

/* Layout */
.screen { padding: calc(env(safe-area-inset-top) + 20px) var(--pad) calc(env(safe-area-inset-bottom) + 48px); }
.top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.top .spacer { flex: 1; }
.logo { width: clamp(132px, 16vw, 200px); aspect-ratio: 2; border-radius: 10px; box-shadow: 0 6px 24px rgba(0,0,0,.5); display: block; }
.icon-button {
  width: 46px; height: 46px; border-radius: 50%; background: var(--glass); backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px); display: grid; place-items: center; font-size: 20px;
}
.back { font-size: 26px; }
h1 { font-size: clamp(24px, 3.4vw, 40px); margin: 0; letter-spacing: -.01em; }
h2 { font-size: clamp(19px, 2.2vw, 26px); margin: 26px 0 12px; }
.muted { color: var(--dim); }
.center { text-align: center; }

/* Cards */
.row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 300px); gap: 20px; overflow-x: auto;
       padding: 6px 4px 14px; margin: 0 -4px; scrollbar-width: none; }
.row::-webkit-scrollbar { display: none; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; padding: 6px 0; }
.card { text-align: left; border-radius: var(--radius); overflow: hidden; background: var(--glass);
        backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: 0 8px 26px rgba(0,0,0,.45);
        transition: transform .15s ease, box-shadow .15s ease; position: relative; display: block; width: 100%; }
.card:hover, .card:focus-visible { transform: scale(1.035); box-shadow: 0 12px 34px rgba(0,0,0,.6); outline-offset: 0; }
.poster { aspect-ratio: 16 / 9; background: #15161c center / cover no-repeat; position: relative; overflow: hidden; }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster.empty { background-image: url(/assets/logo.png); background-size: 55%; opacity: .55; }
.bar { height: 4px; background: rgba(255,255,255,.18); }
.bar > i { display: block; height: 100%; background: var(--sunrise); }
.card .info { padding: 10px 14px 12px; }
.card .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { color: var(--dim); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tick { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--sunrise);
        display: grid; place-items: center; font-size: 15px; font-weight: 700; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
.pills { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 4px; }
.pill { padding: 9px 18px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); font-weight: 600; }
.pill.on { background: var(--sunrise); border-color: transparent; }

/* Lists (choosing the library folder, settings) */
.panel { max-width: 720px; margin: 0 auto; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
         border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 3vw, 30px); }
.list { display: flex; flex-direction: column; margin: 10px 0; border-top: 1px solid var(--line); }
.list button { display: flex; align-items: center; gap: 12px; padding: 14px 6px; border-bottom: 1px solid var(--line); text-align: left; }
.list button:hover { background: rgba(255,255,255,.05); }
.list .chev { margin-left: auto; color: var(--dim); }
.primary { background: var(--sunrise); color: #fff; font-weight: 700; padding: 13px 22px; border-radius: 12px; }
.secondary { background: rgba(255,255,255,.1); padding: 12px 20px; border-radius: 12px; font-weight: 600; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; }
input[type=text] { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: rgba(0,0,0,.35);
                   color: var(--text); font: inherit; }

/* Signed out */
.welcome { min-height: 100vh; display: grid; place-items: center; padding: var(--pad); }
.welcome .panel { text-align: center; max-width: 560px; }
.welcome .logo { width: min(320px, 70vw); margin: 0 auto 22px; }
.google { text-decoration: none; display: inline-flex; align-items: center; gap: 12px; background: #fff; color: #1f1f1f; font-weight: 600;
          padding: 12px 22px; border-radius: 999px; margin: 18px 0 8px; font-size: 17px; }
.google svg { width: 22px; height: 22px; }
.notes { text-align: left; color: var(--dim); font-size: 14px; margin-top: 18px; }
.notes li { margin: 6px 0; }
.error { color: #ff9a8a; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid rgba(255,255,255,.15); border-top-color: var(--accent);
           animation: spin 1s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Player */
#player { position: fixed; inset: 0; z-index: 50; background: #000; }
#player video { width: 100%; height: 100%; }
#player .close { position: absolute; top: calc(env(safe-area-inset-top) + 14px); left: 14px; z-index: 2; width: 44px; height: 44px;
                 border-radius: 50%; background: rgba(0,0,0,.55); font-size: 20px; }
#player .caption { position: absolute; top: calc(env(safe-area-inset-top) + 22px); left: 72px; right: 20px; font-weight: 600;
                   text-shadow: 0 1px 6px #000; pointer-events: none; transition: opacity .6s; }
#player.idle .caption, #player.idle .close { opacity: 0; }

/* The opening animation: 3 s, the same timeline as the TV apps' Splash. */
#splash { position: fixed; inset: 0; z-index: 100; background: #000; overflow: hidden; pointer-events: none;
          animation: splash-out .5s ease-in 2.5s forwards; }
#splash .skull { position: absolute; left: 50%; top: 50%; width: max(100vw, 177.78vh); aspect-ratio: 16 / 9;
                 transform: translate(-50%, -50%) scale(1.18); opacity: 0;
                 animation: skull-in 1s ease-out forwards, push-in 3s ease-out forwards; }
#splash .skull video { width: 100%; height: 100%; object-fit: cover; display: block; }
#splash .eye { position: absolute; width: 8%; aspect-ratio: 1; transform: translate(-50%, -50%); mix-blend-mode: screen;
               background: radial-gradient(circle, rgb(255, 31, 13), transparent 50%); opacity: 0;
               animation: fade-in .25s ease-in .55s forwards; }
#splash .title { position: absolute; left: 50%; top: 74%; width: min(80vw, 130vh); aspect-ratio: 4; transform: translate(-50%, -50%); }
#splash .title img { position: absolute; inset: 0; width: 100%; height: 100%; }
#splash .title .left { clip-path: inset(0 28.3% 0 0); transform: translateX(-100vw); animation: fly .45s cubic-bezier(.25,.9,.35,1) .8s forwards; }
#splash .title .right { clip-path: inset(0 0 0 71.7%); transform: translateX(100vw); animation: fly .45s cubic-bezier(.25,.9,.35,1) .8s forwards; }
#splash .shine { position: absolute; inset: 0; mix-blend-mode: plus-lighter;
                 -webkit-mask: url(/assets/splash-title.png) center / 100% 100% no-repeat; mask: url(/assets/splash-title.png) center / 100% 100% no-repeat;
                 background: linear-gradient(105deg, transparent 42%, rgba(255,255,255,.85) 50%, transparent 58%) 100% 0 / 300% 100% no-repeat;
                 animation: shine .65s ease-in-out 1.7s forwards; }
#splash .flash { position: absolute; inset: 0; opacity: 0; mix-blend-mode: plus-lighter;
                 background: radial-gradient(circle at 50% 74%, rgba(255, 77, 13, .5), transparent 50%), rgba(255, 255, 255, .28);
                 animation: flash .58s linear 1.22s forwards; }
@media (max-aspect-ratio: 6 / 5) {
  /* Upright phone: the face (both eyes to the jaw) fills the width, fading into black above and below. */
  #splash .skull { width: 238vw; top: 40%;
                   -webkit-mask: linear-gradient(transparent, #000 20%, #000 80%, transparent); mask: linear-gradient(transparent, #000 20%, #000 80%, transparent); }
  #splash .title { top: calc(40% + 45.6vw); }
}
@keyframes skull-in { to { opacity: 1; } }
@keyframes push-in { to { transform: translate(-50%, -50%) scale(1); } }
@keyframes fade-in { to { opacity: 1; } }
@keyframes fly { to { transform: translateX(0); } }
@keyframes shine { to { background-position: 0 0; } }
@keyframes flash { 0% { opacity: 0; } 14% { opacity: 1; } 100% { opacity: 0; } }
@keyframes splash-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { #splash { display: none; } }

@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
  .row { grid-auto-columns: minmax(210px, 75vw); }
}
