/* B.A. Media Centre: blue-to-charcoal TV look from the design mockups. */
:root {
  --bg-top: #2b6cb0;
  --bg-mid: #1c3550;
  --bg-bot: #262626;
  --card: rgba(255, 255, 255, 0.13);
  --card-hover: rgba(255, 255, 255, 0.2);
  --card-on: #f1f1f1;
  --text: #ffffff;
  --text-2: rgba(255, 255, 255, 0.72);
  --text-3: rgba(255, 255, 255, 0.5);
  --ink: #111418;
  --nav: rgba(14, 32, 58, 0.88);
  --live: #ff3b30;
  --accent: #1f86ff;
  --green: #30d158;
  --amber: #ffcc00;
  --radius: 11px;
  /* One type scale for the whole app. */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 13px;
  --fs-base: 14px;
  --fs-lg: 15px;
  --fs-title: clamp(20px, 1.9vw, 26px);
  --fs-hero: clamp(20px, 2.2vw, 28px);
  /* One size for every movie, series and episode tile (16:9), one height for every hero banner. */
  --tile-w: 236px;
  --feature-h: clamp(210px, 24vw, 320px);
  --gutter: clamp(16px, 5vw, 96px);
  --chw: 208px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 14px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg-bot);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
/* The blue-to-charcoal backdrop is its own fixed layer. (background-attachment: fixed on the body
   makes iOS repaint the whole page every scroll frame, which smeared and stretched cards and icons
   mid-scroll.) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--bg-top) 0, var(--bg-mid) 256px, var(--bg-bot) 576px);
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
input { font: inherit; }
.icon { flex: none; display: block; }
:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 50;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(ellipse at 50% 45%, #1d4f86 0%, #12243a 55%, #0a0f16 100%);
  transition: opacity .6s ease .25s;
}
.splash.leaving { opacity: 0; pointer-events: none; }
.splash-name { font-size: var(--fs-title); font-weight: 700; letter-spacing: .01em; }
.splash-sub { color: var(--text-2); font-size: var(--fs-sm); min-height: 1.4em; }
.bird.spin { animation: spin 1.6s cubic-bezier(.55, .15, .45, .85) infinite; filter: drop-shadow(0 0 22px rgba(31, 134, 255, .55)); }
@keyframes spin { to { transform: rotate(360deg); } }
.flash {
  position: fixed; inset: 0; z-index: 60; pointer-events: none;
  background: radial-gradient(circle at 50% 45%, #fff 0%, #fff 35%, rgba(255, 255, 255, .85) 70%);
  animation: flash 1.1s ease-out forwards;
}
@keyframes flash { 0% { opacity: 0; } 18% { opacity: 1; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .bird.spin { animation: none; }
  .flash { animation-duration: .4s; }
}

/* ---------- Shell & navigation ---------- */
.shell { padding: 0 var(--gutter) 96px; min-height: 100vh; }
.topnav { position: sticky; top: 0; z-index: 20; display: flex; justify-content: center; padding: max(11px, env(safe-area-inset-top)) 0 8px; }
.pills {
  display: flex; gap: 3px; padding: 4px; border-radius: 999px; background: var(--nav);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.pills::-webkit-scrollbar { display: none; }
.pill { display: flex; align-items: center; gap: 7px; padding: 8px 16px; border-radius: 999px; color: var(--text-2); font-weight: 600; font-size: var(--fs-md); white-space: nowrap; transition: background .15s, color .15s; }
@media (hover: hover) { .pill:hover { color: #fff; } }
.pill.on { background: var(--card-on); color: var(--ink); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.pill.icon-only { padding: 8px 13px; }

.banner { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 5px auto 0; max-width: 576px; padding: 8px 13px; border-radius: 10px; background: rgba(31, 134, 255, .22); font-weight: 600; font-size: var(--fs-sm); text-align: center; }
.banner.warn { background: rgba(255, 159, 10, .2); }
.dot-spin { width: 11px; height: 11px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite; }

.page { animation: fadein .25s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(5px); } }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 13px; padding: 27px 0 21px; }
.page-head h1 { margin: 0; font-size: var(--fs-title); line-height: 1.05; font-weight: 800; letter-spacing: -.01em; }
.page-head p { margin: 8px 0 0; color: var(--text-2); font-size: var(--fs-md); }
.page-head time { color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; padding-top: 6px; }
section { margin-bottom: 24px; }
h2 { font-size: var(--fs-lg); margin: 0 0 11px; font-weight: 700; }
h4 { margin: 18px 0 8px; color: var(--text-3); font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; }
.muted-text { color: var(--text-2); }
.small { font-size: var(--fs-xs); }

/* ---------- Buttons, chips, bars ---------- */
/* Buttons: one shape everywhere, a rounded rectangle with a soft translucent fill. The main action
   ("Play", "Resume") is the same shape with a bolder label and a dimmed detail ("S01E01");
   icon-only buttons are squares of the same height. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; background: rgba(255, 255, 255, .12); color: #fff; font-size: var(--fs-base); font-weight: 600; white-space: nowrap; transition: background .15s, transform .1s; }
@media (hover: hover) { .btn:hover { background: rgba(255, 255, 255, .2); } }
.btn:active { transform: scale(.97); }
.btn.play { padding: 0 20px; font-weight: 700; }
.btn-sub { color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; letter-spacing: .04em; }
.btn.icon { width: 40px; padding: 0; }
.btn.primary { background: var(--accent); }
@media (hover: hover) { .btn.primary:hover { background: #3b95ff; } }
.btn.small { height: 28px; padding: 0 10px; border-radius: 8px; font-size: var(--fs-sm); }
.btn.wide { width: 100%; margin-top: 10px; }
.btn[disabled] { opacity: .6; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.modal .actions { flex-wrap: nowrap; }
.modal .actions .btn.play { flex: 1; }
.btn.icon.on { background: rgba(255, 255, 255, .26); }
.menu-list { display: flex; flex-direction: column; padding: 4px; border-radius: 10px; background: rgba(255, 255, 255, .06); }
.menu-list button { text-align: left; padding: 10px 12px; border-radius: 8px; font-size: var(--fs-base); font-weight: 600; }
@media (hover: hover) { .menu-list button:hover { background: rgba(255, 255, 255, .1); } }
.feature .btn { background: rgba(255, 255, 255, .16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
@media (hover: hover) { .feature .btn:hover { background: rgba(255, 255, 255, .26); } }
.link { color: var(--text-2); text-decoration: underline; font-size: var(--fs-sm); align-self: flex-start; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.end { justify-content: flex-end; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; padding: 8px 18px; border-radius: 999px; background: var(--card); color: var(--text-2); font-weight: 600; font-size: var(--fs-md); white-space: nowrap; }
.chip.on { background: var(--card-on); color: var(--ink); }

.bar { position: relative; height: 3px; flex: 1; min-width: 48px; border-radius: 3px; background: rgba(255, 255, 255, .22); overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: #fff; border-radius: 3px; }
.bar.light { background: rgba(0, 0, 0, .15); }
.bar.light i { background: var(--ink); }
.live-tag { display: inline-block; padding: 2px 6px; border-radius: 4px; background: var(--live); color: #fff; font-size: .62em; font-weight: 800; letter-spacing: .04em; vertical-align: .18em; margin-left: 6px; line-height: 1.3; }
.live-tag.big { font-size: var(--fs-xs); margin: 0 11px 0 0; padding: 3px 7px; }
.badge { flex: none; display: grid; place-items: center; width: 51px; height: 37px; border-radius: 7px; background: rgba(255, 255, 255, .18); font-size: var(--fs-xs); font-weight: 800; letter-spacing: .02em; overflow: hidden; }

/* ---------- Cards ---------- */
.card { display: block; text-align: left; border-radius: var(--radius); background: var(--card); padding: 14px 18px; transition: background .15s, transform .15s, box-shadow .15s; }
.card:focus-visible { background: var(--card-hover); }
@media (hover: hover) { .card:hover { background: var(--card-hover); } }
.card .meta { display: flex; align-items: center; justify-content: space-between; gap: 6px; color: var(--text-2); font-size: var(--fs-sm); }
.card .title { font-weight: 700; font-size: var(--fs-lg); margin: 6px 0 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .sub { color: var(--text-2); font-size: var(--fs-md); margin-top: 3px; }
.card .sub.dim { color: var(--text-3); }
.row-scroll { display: flex; gap: 18px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.row-scroll > * { scroll-snap-align: start; }
.cards4 > * { flex: 0 0 min(320px, 62.4vw); }
.cards3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 264px), 1fr)); gap: 18px; }
.game .title { white-space: normal; margin-bottom: 5px; font-size: var(--fs-lg); }
.game.is-live { background: rgba(255, 255, 255, .17); }
.connect-card { display: flex; flex-direction: column; gap: 5px; max-width: 416px; }
.connect-card span { color: var(--text-2); }
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,.08), rgba(255,255,255,.16), rgba(255,255,255,.08)); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Hero banners (Home, a series, a movie's details) ----------
   Every hero is the same height. Artwork is shown whole (contain), never cropped; a blurred copy
   of it fills the rest of the banner. Titles sit on the banner only here. */
.feature { flex: none; position: relative; display: flex; flex-direction: column; justify-content: flex-end; height: var(--feature-h); padding: clamp(16px, 2.4vw, 32px); border-radius: 16px; overflow: hidden; background: #14202e; box-shadow: 0 16px 40px rgba(0, 0, 0, .3); margin-bottom: 22px; isolation: isolate; }
.feature.skeleton { box-shadow: none; }
.hero { background: linear-gradient(110deg, #0e3d6b 0%, #1d68a8 55%, #35a0dc 100%); }
.feature-bg, .feature-img { position: absolute; z-index: -2; width: 100%; height: 100%; inset: 0; }
.feature-bg { object-fit: cover; filter: blur(28px) brightness(.5) saturate(1.2); transform: scale(1.2); }
.feature-img { object-fit: contain; object-position: right center; }
.feature-shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(8, 13, 20, .88) 0%, rgba(8, 13, 20, .55) 40%, transparent 72%), linear-gradient(0deg, rgba(8, 13, 20, .7), transparent 55%); }
.feature-body { max-width: 560px; }
.hero-meta { display: flex; align-items: center; gap: 8px; font-size: var(--fs-md); color: rgba(255, 255, 255, .85); }
.hero-title { font-size: var(--fs-hero); line-height: 1.15; font-weight: 700; margin: 8px 0 6px; }
.hero-sub { font-size: var(--fs-base); color: rgba(255, 255, 255, .8); margin: 0 0 14px; }
.hero-meta + .row, .hero-title + .row { margin-top: 8px; }
.modal .feature { margin: -22px -22px 4px; border-radius: 16px 16px 0 0; box-shadow: none; }

/* ---------- Tiles: every movie, series, episode and continue-watching card ----------
   One size (--tile-w) and one shape (16:9, like the video itself). The picture is shown whole;
   the title and details go underneath, never on top of the picture. */
.tiles { display: flex; gap: 14px; }
.tiles.wrap { display: grid; grid-template-columns: repeat(auto-fill, var(--tile-w)); gap: 18px 14px; }
.tile { flex: 0 0 var(--tile-w); width: var(--tile-w); display: flex; flex-direction: column; gap: 7px; text-align: left; min-width: 0; }
.tile-art { position: relative; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: #1a2330; isolation: isolate; transition: box-shadow .15s; }
.tile-art .bg, .tile-art .fg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tile-art .bg { z-index: -1; object-fit: cover; filter: blur(14px) brightness(.5); transform: scale(1.2); }
.tile-art .fg { object-fit: contain; }
.tile-tag { position: absolute; left: 6px; top: 6px; padding: 2px 6px; border-radius: 4px; background: rgba(0, 0, 0, .72); font-size: var(--fs-xs); font-weight: 700; }
.tile-art .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 0; background: rgba(0, 0, 0, .5); }
.tile-art .bar i { border-radius: 0; background: var(--accent); }
.tile-title { font-size: var(--fs-md); font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { margin-top: -4px; color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.on .tile-art, .tile.sel .tile-art, .tile:focus-visible .tile-art { box-shadow: 0 0 0 3px #fff; }
.tile:focus-visible { outline: none; }
@media (hover: hover) { .tile:hover .tile-art { box-shadow: 0 0 0 3px rgba(255, 255, 255, .85); } }
.tile.skeleton .tile-art { background: none; }
.tile.skeleton .tile-title { height: 12px; width: 70%; border-radius: 4px; background: rgba(255, 255, 255, .08); }

/* Series page */
.series-eps { min-width: 0; margin-bottom: 22px; }

/* ---------- Sidebar layouts (Live TV, Settings) ---------- */
.split { display: grid; grid-template-columns: minmax(160px, 320px) 1fr; gap: 32px; align-items: start; }
.side { position: sticky; top: 74px; display: flex; flex-direction: column; gap: 3px; max-height: calc(100vh - 88px); overflow-y: auto; scrollbar-width: none; }
.side-item { text-align: left; padding: 11px 21px; border-radius: 10px; color: var(--text-2); font-size: var(--fs-base); font-weight: 500; }
@media (hover: hover) { .side-item:hover { color: #fff; background: rgba(255, 255, 255, .06); } }
.side-item.on { background: var(--card-on); color: var(--ink); font-weight: 700; }
.list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.search { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 0 13px; border-radius: 10px; background: var(--card); color: var(--text-2); margin-bottom: 5px; }
.search input { flex: 1; min-width: 0; height: 38px !important; border: 0 !important; background: none !important; color: #fff; outline: none; padding: 0 !important; font-size: 16px; }

.search-big { margin: 0 0 18px; }
.search-big input { height: 44px !important; }
.search .clear { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .15); color: #fff; }
.search input::-webkit-search-cancel-button { display: none; }
.search-hint { margin: 0; }
h2 .count { margin-left: 6px; color: var(--text-3); font-size: .75em; font-weight: 600; }
.link-inline { color: #fff; text-decoration: underline; }
.airing { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 14px; align-items: center; padding: 11px 14px 11px 18px; border-radius: 10px; background: var(--card); text-align: left; }
.airing-title { font-weight: 700; font-size: var(--fs-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.airing-ch { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.airing-ch small { color: var(--text-3); font-size: inherit; }
@media (hover: hover) { .airing:hover { background: var(--card-hover); } }
.ch-row { display: grid; grid-template-columns: 45px 51px minmax(96px, 1fr) minmax(0, 1.5fr) 29px; gap: 18px; align-items: center; padding: 11px 14px 11px 18px; border-radius: 10px; background: var(--card); cursor: pointer; transition: background .15s; }
.ch-row:focus-visible { background: var(--card-on); color: var(--ink); }
@media (hover: hover) { .ch-row:hover { background: var(--card-on); color: var(--ink); } }
.ch-row:focus-visible .badge { background: #e2e2e2; }
@media (hover: hover) { .ch-row:hover .badge { background: #e2e2e2; } }
.ch-row:focus-visible .bar { background: rgba(0, 0, 0, .14); }
@media (hover: hover) { .ch-row:hover .bar { background: rgba(0, 0, 0, .14); } }
.ch-row:focus-visible .bar i { background: var(--ink); }
@media (hover: hover) { .ch-row:hover .bar i { background: var(--ink); } }
@media (hover: hover) { .ch-row:hover .when, .ch-row:hover .num, .ch-row:hover .ch-name small { color: #333; } }
.num { text-align: right; color: var(--text-2); font-size: var(--fs-base); font-variant-numeric: tabular-nums; }
.ch-name { font-size: var(--fs-lg); font-weight: 700; display: flex; flex-direction: column; min-width: 0; }
.ch-name small { color: var(--text-3); font-size: var(--fs-xs); font-weight: 600; }
.ch-now { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.ch-now .t { font-size: var(--fs-base); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.when { display: flex; align-items: center; gap: 11px; color: var(--text-2); font-size: var(--fs-sm); white-space: nowrap; }
.star { color: var(--text-3); padding: 5px; border-radius: 6px; }
.star.on { color: var(--amber); }
.empty { padding: 32px 16px; text-align: center; color: var(--text-2); }
.empty h3 { color: #fff; margin: 0 0 5px; }

/* ---------- Guide grid ---------- */
.grid-wrap { overflow-x: auto; border-radius: 11px; background: rgba(0, 0, 0, .18); }
.grid { position: relative; display: grid; grid-template-columns: var(--chw) var(--w); min-width: calc(var(--chw) + var(--w)); }
.g-corner { position: sticky; left: 0; z-index: 3; background: #1d2a39; height: 34px; }
.g-ruler { position: relative; height: 34px; background: #1d2a39; }
.g-ruler span { position: absolute; top: 10px; padding-left: 6px; border-left: 1px solid rgba(255, 255, 255, .2); color: var(--text-2); font-size: var(--fs-xs); white-space: nowrap; }
.g-ch { position: sticky; left: 0; z-index: 2; display: flex; align-items: center; gap: 8px; height: 51px; padding: 0 10px; background: #232c36; border-bottom: 1px solid rgba(255, 255, 255, .06); text-align: left; }
.g-ch .num { width: 32px; font-size: var(--fs-md); }
.g-ch .badge { width: 42px; height: 29px; font-size: var(--fs-xs); }
.g-name { font-weight: 650; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-row { position: relative; height: 51px; border-bottom: 1px solid rgba(255, 255, 255, .06); }
.g-prog { position: absolute; top: 4px; bottom: 4px; display: flex; flex-direction: column; justify-content: center; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, .1); text-align: left; overflow: hidden; }
.g-prog b { font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.g-prog span { color: var(--text-3); font-size: var(--fs-xs); white-space: nowrap; }
.g-prog.now { background: rgba(255, 255, 255, .2); }
@media (hover: hover) { .g-prog:hover { background: var(--card-on); color: var(--ink); } }
.g-prog.empty { color: var(--text-3); background: none; }
.g-now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--live); z-index: 1; pointer-events: none; box-shadow: 0 0 8px rgba(255, 59, 48, .7); }

/* ---------- Settings ---------- */
.settings { gap: 6px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 13px; width: 100%; min-height: 58px; padding: 11px 21px; border-radius: 10px; background: var(--card); text-align: left; }
.set-row.tap:focus-visible { background: var(--card-on); color: var(--ink); }
@media (hover: hover) { .set-row.tap:hover { background: var(--card-on); color: var(--ink); } }
@media (hover: hover) { .set-row.tap:hover small, .set-row.tap:hover .set-value { color: #333; } }
.set-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-text b { font-size: var(--fs-lg); }
.set-text small { color: var(--text-2); font-size: var(--fs-sm); }
.set-value { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: var(--fs-md); text-align: right; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.red { background: var(--live); }
.tick { color: var(--green); font-size: var(--fs-lg); font-weight: 800; }
.toggle { width: 46px; height: 27px; border-radius: 999px; background: rgba(255, 255, 255, .25); position: relative; transition: background .2s; }
.toggle i { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.toggle.on { background: var(--green); }
.toggle.on i { transform: translateX(19px); }
.cat-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 5px; padding: 8px 5px; }
.check { display: flex; gap: 8px; align-items: center; padding: 6px 8px; border-radius: 6px; background: rgba(255, 255, 255, .06); }
.help details { background: var(--card); border-radius: 10px; padding: 13px 18px; margin-bottom: 6px; }
.help summary { font-weight: 700; cursor: pointer; font-size: var(--fs-base); }
.help p { color: var(--text-2); }

/* ---------- Forms, modals, login ---------- */
.form-card, .login-card, .modal { display: flex; flex-direction: column; gap: 11px; max-width: 384px; }
.form-card h3, .modal h2, .login-card h1 { margin: 0; }
.form-card .sub, .modal .sub, .login-card .sub { color: var(--text-2); margin: 0; }
label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: var(--fs-sm); color: var(--text-2); }
label input:not([type="checkbox"]) { height: 40px; padding: 0 13px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .15); background: rgba(0, 0, 0, .3); color: #fff; font-size: 16px; outline: none; }
label input:focus { border-color: var(--accent); }
.check input { width: 14px; height: 14px; }
.notice { padding: 10px 13px; border-radius: 10px; background: rgba(255, 159, 10, .18); border: 1px solid rgba(255, 159, 10, .35); color: #ffe3b0; font-size: var(--fs-sm); }
.field-hint { margin-top: -8px; color: #ffd27a; font-size: var(--fs-sm); }
.login { min-height: 100vh; display: grid; place-items: center; padding: 19px 13px; }
.login-card { width: 100%; padding: 27px 24px; border-radius: 19px; background: rgba(14, 32, 58, .72); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); align-items: stretch; text-align: left; }
.login-card .bird { align-self: center; }
.login-card h1 { text-align: center; font-size: var(--fs-title); }
.login-card .sub { text-align: center; }
.modal-back { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 13px; background: rgba(0, 0, 0, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal { width: 100%; padding: 22px; border-radius: 16px; background: #1f2b3a; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); max-height: 90vh; overflow-y: auto; }
.modal.detail { max-width: 512px; }
.overview { color: var(--text-2); margin: 0; font-size: var(--fs-base); line-height: 1.5; }

.toasts { position: fixed; left: 50%; bottom: max(19px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 70; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(448px, calc(100vw - 32px)); }
.toast { padding: 10px 16px; border-radius: 11px; background: rgba(20, 24, 30, .92); box-shadow: 0 10px 30px rgba(0, 0, 0, .4); font-weight: 600; text-align: center; animation: fadein .2s ease; }

/* ---------- Player ---------- */
.player { position: fixed; inset: 0; z-index: 30; background: #000; display: flex; align-items: center; justify-content: center; }
.player video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-spinner { position: absolute; display: grid; place-items: center; pointer-events: none; }
.player-error { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 19px; text-align: center; background: rgba(0, 0, 0, .7); }
.player-error h3 { margin: 0; font-size: var(--fs-lg); }
.hud-top, .hud-bottom { position: absolute; left: 0; right: 0; padding: 14px max(16px, env(safe-area-inset-left)); opacity: 0; transition: opacity .3s; pointer-events: none; }
.player.hud-on .hud-top, .player.hud-on .hud-bottom { opacity: 1; pointer-events: auto; }
.player.hud-on { cursor: default; }
.player:not(.hud-on) { cursor: none; }
.hud-top { top: 0; display: flex; align-items: center; gap: 11px; padding-top: max(14px, env(safe-area-inset-top)); background: linear-gradient(180deg, rgba(0, 0, 0, .75), transparent); }
.hud-title { flex: 1; min-width: 0; }
.hud-title .t1 { font-size: var(--fs-lg); font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-title .t2 { color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-bottom { bottom: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(0, 0, 0, .8), transparent); }
.hud-prog { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--text-2); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
.hud-prog input[type="range"] { flex: 1; accent-color: #fff; }
.hud-controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.grp { display: flex; align-items: center; gap: 5px; }
.icon-btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: rgba(255, 255, 255, .12); }
@media (hover: hover) { .icon-btn:hover { background: rgba(255, 255, 255, .22); } }
.icon-btn.big { width: 48px; height: 48px; border-radius: 12px; background: rgba(255, 255, 255, .22); }
.improve { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border-radius: 10px; background: rgba(255, 255, 255, .12); font-weight: 600; }
.improve .icon { color: #6fb2ff; }
@media (hover: hover) { .improve:hover { background: rgba(255, 255, 255, .22); } }
.improve.on { background: rgba(31, 134, 255, .35); }
.improve.on .icon { color: #fff; }
.pill-btn { height: 40px; padding: 0 14px; border-radius: 10px; background: rgba(255, 255, 255, .12); font-weight: 600; }
.player-menu { position: absolute; right: 16px; bottom: 88px; z-index: 2; display: flex; flex-direction: column; min-width: 192px; max-height: 60vh; overflow-y: auto; padding: 5px; border-radius: 13px; background: rgba(28, 32, 40, .96); box-shadow: 0 20px 50px rgba(0, 0, 0, .6); }
.player-menu button { text-align: left; padding: 10px 13px; border-radius: 8px; font-weight: 600; }
@media (hover: hover) { .player-menu button:hover { background: rgba(255, 255, 255, .1); } }
.player-menu button.sel { background: #fff; color: var(--ink); }
.player-menu button.muted { color: var(--text-3); }
.player.mini { inset: auto 16px max(16px, env(safe-area-inset-bottom)) auto; width: min(304px, calc(100vw - 32px)); aspect-ratio: 16 / 9; height: auto; border-radius: 11px; overflow: hidden; box-shadow: 0 20px 50px rgba(0, 0, 0, .6); cursor: pointer; }
.mini-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; align-items: center; gap: 5px; padding: 6px 8px; background: linear-gradient(0deg, rgba(0, 0, 0, .8), transparent); }
.mini-bar .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
.mini-title { flex: 1; min-width: 0; font-weight: 700; font-size: var(--fs-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Hover looks are for a mouse only (the "@media (hover: hover)" lines). On a touch screen a finger
   sliding over a row while scrolling counts as hovering it, so rows lit up and grew under the
   finger mid-scroll. */

/* ---------- Phones and narrow windows ---------- */
@media (max-width: 900px) {
  :root { --chw: 136px; }
  .split { grid-template-columns: 1fr; gap: 11px; }
  .side { position: static; flex-direction: row; overflow-x: auto; max-height: none; padding-bottom: 3px; }
  .side-item { flex: none; padding: 7px 14px; border-radius: 999px; font-size: var(--fs-md); background: var(--card); white-space: nowrap; }
}
@media (max-width: 760px) {
  :root { --tile-w: 168px; --feature-h: 220px; }
  .pill { padding: 7px 11px; font-size: var(--fs-sm); gap: 5px; }
  .pill span { display: none; }
  .pill.on span { display: inline; }
  .page-head { padding: 16px 0 13px; flex-direction: column; gap: 5px; }
  .page-head time { padding: 0; font-size: var(--fs-xs); }
  .ch-row { grid-template-columns: 32px 1fr 29px; grid-template-areas: "num name star" "num now now"; gap: 5px 10px; padding: 10px 8px 10px 10px; }
  .ch-row .num { grid-area: num; font-size: var(--fs-md); align-self: start; padding-top: 2px; }
  .ch-row .badge { display: none; }
  .ch-row .ch-name { grid-area: name; font-size: var(--fs-base); }
  .ch-row .ch-now { grid-area: now; }
  .ch-row .ch-now .t { font-size: var(--fs-md); }
  .ch-row .star { grid-area: star; }
  .when { font-size: var(--fs-xs); }
  .airing { grid-template-columns: 1fr; gap: 3px; padding: 10px 12px; }
  .g-ch .badge { display: none; }
  .hero-meta { font-size: var(--fs-sm); flex-wrap: wrap; gap: 5px; }
  .hud-controls .grp { flex-wrap: wrap; }
  .player-menu { left: 13px; right: 13px; bottom: 96px; }
}
@media (max-width: 480px) {
  .pills { gap: 0; }
  .pill, .pill.icon-only { padding: 7px 9px; }
  .pill.on span { display: none; }
}
