/* MovieLinkBD Live TV — V78.53
   Standalone stylesheet: this page never loads min.css, so everything it needs
   is here. Sizes are viewport-relative so the same layout reads correctly on a
   360px phone and on a 65" TV at 1920px. */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: #000;
  color: #fff;
  font-family: "Segoe UI", Roboto, "Noto Sans Bengali", system-ui, -apple-system, sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

.mlbd-live { --live-accent: #e11d48; }

.live-stage {
  position: fixed;
  inset: 0;
  background: #000;
  overflow: hidden;
  cursor: default;
}

.live-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  /* scaled past the edges so the blur never reveals the frame boundary */
  transform: scale(1.25);
  filter: blur(48px) saturate(1.4);
  opacity: .4;
  pointer-events: none;
  transition: opacity .35s ease;
}
/* Once a frame is on screen the poster has done its job. Anything the picture does
   not cover is black, the way a broadcast letterbox is black. */
.live-stage.is-live .live-backdrop { opacity: 0; }
.live-stage.is-idle { cursor: none; }

/* Full-bleed. The picture fills the screen edge to edge on every channel, so there
   is no letterbox to fill and the bug's position is identical everywhere. */
.live-frame {
  position: absolute;
  inset: 0;
  background: transparent;
  overflow: hidden;
}

.live-video {
  width: 100%;
  height: 100%;
  /* Always contain, which makes the drawn box predictable; the fill-or-fit decision
     and the removal of any letterbox baked into the file are then one transform,
     computed in applyFit(). */
  object-fit: contain;
  transform-origin: center center;
  background: transparent;
  display: block;
}

/* ---------------------------------------------------------------- channel bug
   A broadcast DOG, not a web badge: right-aligned NOW/NEXT strap set against the
   channel logo tile, drawn straight onto the picture with a shadow instead of a
   container. It never idle-hides — it is what makes the page read as a channel. */
.live-bug {
  position: absolute;
  /* Relative to the raster, so it is in the same place on every channel. */
  top: calc(clamp(10px, 2.2vh, 26px) + env(safe-area-inset-top, 0px));
  right: calc(clamp(10px, 2vw, 28px) + env(safe-area-inset-right, 0px));
  z-index: 6;
  display: flex;
  /* flex-start, not stretch: the mark's own intrinsic size must not feed back into
     the strap height. Its height is measured and published as --bug-strap-h instead. */
  align-items: flex-start;
  gap: clamp(9px, 1.1vw, 16px);
  max-width: min(72vw, 820px);
  pointer-events: none;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, .85));
}
.live-bug__text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  text-align: right;
}
.live-bug__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(9px, 1.1vh, 12px);
  font-weight: 800;
  letter-spacing: .22em;
  line-height: 1;
  color: rgba(255, 255, 255, .78);
}
.live-bug__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--live-accent);
  animation: live-pulse 2s ease-in-out infinite;
}
/* NEXT is a preview, not what is on screen — drop the live dot for it. */
.live-bug.is-next .live-bug__dot { visibility: hidden; }
.live-bug__title {
  font-size: clamp(13px, 2vh, 23px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .01em;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.live-bug__lang {
  font-size: clamp(9px, 1.15vh, 12px);
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .92);
  background: rgba(255, 255, 255, .13);
  border-radius: 4px;
  padding: 2px 7px;
  line-height: 1.4;
}
.live-bug__lang[hidden] { display: none; }

/* The station ident: the mark alone, no tile and no frame. A bordered box reads as
   a UI element pasted onto the film; a clean mark reads as part of the broadcast.
   It spans the whole strap, from the NOW line down to the language chip. */
.live-bug__logo {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}
.live-bug__logo img {
  /* Exactly as tall as the NOW-to-language strap beside it, measured in JS. CSS has
     no way to reference a sibling's height, and `height: 100%` resolves to the file's
     intrinsic 192px because the parent takes its height from this element. */
  height: var(--bug-strap-h, 48px);
  width: auto;
  /* No radius: the asset is already a square mark with its own soft corners, and
     clipping it to a circle cut the M's shoulders off. */
  object-fit: contain;
  display: block;
}
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }

/* ---------------------------------------------------------------- subtitles */
.live-subs {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  /* Sits clear of the strap while the controls are up, and drops to a normal
     broadcast height once they fade. */
  bottom: clamp(120px, 22vh, 240px);
  z-index: 6;
  width: min(84%, 1100px);
  text-align: center;
  pointer-events: none;
  transition: bottom .35s ease;
}
.live-stage.is-idle .live-subs { bottom: clamp(40px, 8vh, 90px); }
.live-subs[hidden] { display: none; }
.live-subs__line {
  display: inline-block;
  margin: 2px 0;
  padding: 2px 10px;
  border-radius: 4px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: clamp(15px, 2.6vh, 30px);
  font-weight: 600;
  line-height: 1.35;
  text-shadow: 0 2px 4px rgba(0, 0, 0, .9);
}
.live-subs__line i, .live-subs__line em { font-style: italic; }
.live-subs__line b, .live-subs__line strong { font-weight: 800; }

/* ------------------------------------------------------------------- loading */
.live-loading {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, .35);
}
.live-loading[hidden] { display: none; }
.live-spinner {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .18);
  border-top-color: var(--live-accent);
  animation: live-spin .85s linear infinite;
}
@keyframes live-spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ simulcast */
/* A live channel plays in the same <video> as everything else, so it keeps the bug,
   the fit and the auto-unmute. What it has no use for is the parts that describe a
   SCHEDULE: there is no programme length to fill in and no poster to fade from. */
.live-embed { display: none; }
.live-stage.is-embed .live-progress,
.live-stage.is-embed .live-subs,
.live-stage.is-embed .live-backdrop { display: none; }

/* ------------------------------------------------------------- bottom actions */
/*
 * Two controls at the end of the channel strip, sized so they never crowd it.
 *
 * They used to be full "S Schedule" / "F Fullscreen" buttons — 360px of a 844px
 * phone screen for two words, leaving the nine channels fighting over the rest. The
 * channels are what the viewer came for, so the buttons shrink to square icons and
 * only grow labels where there is room for them.
 */
.live-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.live-act {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .18);
  background: rgba(255, 255, 255, .08);
  color: #fff;
  font: inherit;
  font-size: clamp(12px, 1.5vh, 15px);
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease;
}
.live-act:hover { background: rgba(255, 255, 255, .18); border-color: rgba(255, 255, 255, .36); }
.live-act:focus-visible { outline: 2px solid var(--live-accent, #e11d48); outline-offset: 2px; }
.live-act .live-icon { width: 20px; height: 20px; }
.live-act__text,
.live-act__key { display: none; }

/* Wide enough for words: give them back, and show the keyboard hint with them —
   a screen this size is a desktop or a TV, where there is a key to press. */
@media (min-width: 900px) {
  .live-act { width: auto; height: 46px; padding: 0 16px; }
  .live-act__text { display: inline; }
  .live-act__key {
    display: inline-grid;
    place-items: center;
    min-width: 22px;
    height: 22px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .14);
    font-size: 12px;
    font-weight: 700;
  }
}

/* One button, two icons: only the one matching the current state is drawn, so the
   control always says what pressing it will do. */
/* Scoped to .live-act on purpose. `.live-icon { display: block }` sits further down
   this file with the same weight, so a bare `.live-full-out { display: none }` lost
   the tie and BOTH icons were drawn — enter and exit side by side. */
.live-act .live-full-out { display: none; }
.live-stage.is-full .live-act .live-full-in { display: none; }
.live-stage.is-full .live-act .live-full-out { display: block; }

/* --------------------------------------------------------------------- icons */
/* Iconify artwork, inlined at the markup. Sized from the text it sits beside so the
   glyph and the label always share a baseline, whatever the viewport scales to. */
.live-icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 auto;
  display: block;
}
@keyframes live-rise { from { opacity: 0; transform: translateY(14px); } }

/* -------------------------------------------------------------------- chrome
   Everything that is allowed to disappear when the viewer stops interacting. */
.live-chrome {
  position: absolute;
  display: flex;
  flex-direction: column;
  left: 0; right: 0; bottom: 0;
  z-index: 7;
  padding: clamp(34px, 8vh, 90px)
           calc(clamp(12px, 2.5vw, 34px) + env(safe-area-inset-right, 0px))
           calc(clamp(12px, 2.4vh, 26px) + env(safe-area-inset-bottom, 0px))
           calc(clamp(12px, 2.5vw, 34px) + env(safe-area-inset-left, 0px));
  background: linear-gradient(to top, rgba(0, 0, 0, .92) 12%, rgba(0, 0, 0, .55) 55%, rgba(0, 0, 0, 0));
  transition: opacity .35s ease, transform .35s ease;
}
.live-stage.is-idle .live-chrome { opacity: 0; transform: translateY(14px); pointer-events: none; }

/* A progress line, not a scrub bar. Live has no seeking, so it must not look
   draggable — it only tells the viewer how far into the programme they joined. */
.live-progress {
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  overflow: hidden;
  margin-bottom: clamp(10px, 1.8vh, 18px);
}
.live-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--live-accent);
  transition: width 1s linear;
}

.live-bar { display: flex; align-items: center; gap: 10px; }
.live-channels {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 2px 0;
  /* Fades the chip the scroll cuts off, so a half-drawn button reads as "more to
     scroll" rather than as a rendering fault next to the Guide button. */
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent);
}
.live-channels::-webkit-scrollbar { display: none; }

.live-channels__item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px 10px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .06);
  color: #e9e9ea;
  font: inherit;
  font-size: clamp(12px, 1.5vh, 15px);
  font-weight: 600;
  letter-spacing: .01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
/* The number is the remote's shortcut, so it is styled like a key, not a bullet. */
.live-channels__item b {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, .72);
}
.live-channels__item:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); }
.live-channels__item.is-active {
  background: var(--chip, var(--live-accent));
  border-color: var(--chip, var(--live-accent));
  color: #fff;
}
.live-channels__item.is-active b { background: rgba(0, 0, 0, .28); color: #fff; }

/* Pinned beside the scrolling channel strip, so it never scrolls out of reach. */

/* ------------------------------------------------------------------- TV guide */
.live-guide {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  background: rgba(6, 6, 9, .95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: live-fade .2s ease;
}
.live-guide[hidden] { display: none; }
@keyframes live-fade { from { opacity: 0; } }

.live-guide__head {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: clamp(14px, 2.6vh, 26px) clamp(14px, 3vw, 40px);
  border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.live-guide__head strong { font-size: clamp(16px, 2.6vh, 24px); letter-spacing: .04em; }
.live-guide__hint { flex: 1 1 auto; font-size: clamp(10px, 1.4vh, 13px); color: rgba(255, 255, 255, .5); }
.live-guide__close {
  flex: 0 0 auto;
  /* Square now that it carries a glyph rather than the word "Close" — equal padding
     keeps the X centred in the circle at every clamp step. */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.live-guide__close:hover { background: rgba(255, 255, 255, .12); }
.live-guide__close .live-icon { width: 18px; height: 18px; }

.live-guide__body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: clamp(10px, 2vh, 22px) clamp(14px, 3vw, 40px) clamp(20px, 4vh, 44px);
  -webkit-overflow-scrolling: touch;
}
.live-guide__channel { margin-bottom: clamp(16px, 3vh, 30px); }
.live-guide__name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: clamp(11px, 1.5vh, 14px);
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--chip, #fff);
  background: none;
  border: 0;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}
.live-guide__name::after {
  content: 'Watch';
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  color: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 4px;
  padding: 2px 7px;
}
.live-guide__row {
  display: grid;
  grid-template-columns: minmax(56px, auto) 1fr minmax(58px, auto);
  align-items: baseline;
  gap: 6px 14px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: clamp(12px, 1.6vh, 15px);
  color: rgba(255, 255, 255, .82);
}
.live-guide__row + .live-guide__row { border-top: 1px solid rgba(255, 255, 255, .06); }
.live-guide__row.is-live { background: rgba(255, 255, 255, .07); color: #fff; }
.live-guide__time { font-variant-numeric: tabular-nums; font-weight: 700; color: rgba(255, 255, 255, .62); }
.live-guide__row.is-live .live-guide__time { color: var(--chip, var(--live-accent)); }
.live-guide__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.live-guide__tag {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
  background: rgba(255, 255, 255, .1);
  border-radius: 3px;
  padding: 1px 6px;
  vertical-align: 1px;
}
.live-guide__len { font-variant-numeric: tabular-nums; text-align: right; color: rgba(255, 255, 255, .45); font-size: .88em; }

@media (max-width: 560px) {
  .live-guide__row { grid-template-columns: minmax(48px, auto) 1fr; }
  .live-guide__len { display: none; }
}

/* ------------------------------------------------------------------- off air */
.live-offair {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: #06060a;
}
.live-offair h1 { margin: 0; font-size: clamp(20px, 3vh, 30px); }
.live-offair p { margin: 0; color: rgba(255, 255, 255, .6); font-size: 14px; }

/* Blocking notice: shown when this device cannot play the feed at all. */
.live-notice {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
  max-width: min(88vw, 520px);
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(10, 10, 12, .92);
  border: 1px solid rgba(255, 255, 255, .16);
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.live-notice[hidden] { display: none; }

@media (max-width: 560px) {
  .live-guide__row { grid-template-columns: minmax(48px, auto) 1fr; }
  .live-guide__len { display: none; }
}

/* ------------------------------------------------------------------- off air */
.live-offair {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 10px;
  text-align: center;
  padding: 24px;
  background: #06060a;
}
.live-offair h1 { margin: 0; font-size: clamp(20px, 3vh, 30px); }
.live-offair p { margin: 0; color: rgba(255, 255, 255, .6); font-size: 14px; }

/* Blocking notice: shown when this device cannot play the feed at all. */
.live-notice {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 9;
  max-width: min(88vw, 520px);
  padding: 18px 22px;
  border-radius: 16px;
  background: rgba(10, 10, 12, .92);
  border: 1px solid rgba(255, 255, 255, .16);
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.live-notice[hidden] { display: none; }

/* Toast used for channel changes and recovery messages. */

@media (max-width: 560px) {
  .live-bug { max-width: 78vw; gap: 8px; }
  .live-bug__logo { padding: 5px 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .live-bug__dot, .live-spinner { animation: none; }
  .live-chrome, .live-progress i { transition: none; }
}
