/* Movies Galore — cinematic streaming interface
   A progressive visual layer. It leaves the catalogue queries, player and APIs intact. */
:root {
  --mg-stream-bg: #08090d;
  --mg-stream-surface: #111319;
  --mg-stream-card: #171a22;
  --mg-stream-text: #f7f7f8;
  --mg-stream-muted: #a7aab4;
  --mg-stream-accent: #e50919;
  --mg-stream-accent-2: #ff3544;
  --mg-stream-border: rgba(255,255,255,.10);
  --mg-stream-radius: 15px;
}
html { background: var(--mg-stream-bg); }
body[data-mg-theme] { background: var(--mg-stream-bg) !important; }

/* Global streaming navigation */
body[data-mg-theme] header.mg-site-header {
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(190px, auto) minmax(0, 1fr);
  grid-template-areas: "brand nav" "search search";
  align-items: center;
  gap: 8px clamp(18px, 3vw, 46px);
  width: 100%;
  padding: 13px clamp(16px, 4vw, 58px) 10px !important;
  text-align: left;
  background: rgba(8,9,13,.96) !important;
  border-bottom: 1px solid rgba(255,255,255,.08) !important;
  box-shadow: 0 8px 28px rgba(0,0,0,.22);
  position: relative;
  z-index: 1000;
}
body[data-mg-theme] header.mg-site-header > .mg-brand-link {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  min-width: 0;
  width: max-content;
  max-width: 100%;
}
body[data-mg-theme] header.mg-site-header > .mg-brand-link img {
  display: block;
  width: auto;
  max-width: min(220px, 42vw);
  height: 39px !important;
  object-fit: contain;
}
body[data-mg-theme] header.mg-site-header .mg-brand {
  grid-area: brand;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  color: #fff !important;
  font-size: clamp(19px, 2vw, 27px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -.045em;
  white-space: nowrap;
}
body[data-mg-theme] header.mg-site-header .mg-brand img {
  height: 39px !important;
  width: auto;
  max-width: 54px;
  object-fit: contain;
  margin: 0 !important;
}
body[data-mg-theme] header.mg-site-header .mg-main-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
body[data-mg-theme] header.mg-site-header .mg-main-nav::-webkit-scrollbar { display: none; }
body[data-mg-theme] header.mg-site-header .mg-main-nav > a {
  flex: 0 0 auto;
  padding: 9px 12px !important;
  border: 1px solid transparent !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #d6d7dc !important;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease, background .16s ease, border-color .16s ease;
}
body[data-mg-theme] header.mg-site-header .mg-main-nav > a:hover,
body[data-mg-theme] header.mg-site-header .mg-main-nav > a:focus-visible {
  color: #fff !important;
  background: rgba(255,255,255,.08) !important;
  border-color: rgba(255,255,255,.12) !important;
}
body[data-mg-theme] header.mg-site-header .mg-main-nav .user-info {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 0 8px;
}
body[data-mg-theme] header.mg-site-header .mg-profile-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #eee !important;
  text-decoration: none;
}
body[data-mg-theme] header.mg-site-header .user-avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  object-fit: cover;
}
body[data-mg-theme] header.mg-site-header .username { font-size: 12px; }
body[data-mg-theme] header.mg-site-header .logout-button {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
}
body[data-mg-theme] header.mg-site-header .header-search-wrapper {
  grid-area: search;
  width: min(100%, 920px);
  max-width: 920px;
  margin: 5px auto 2px;
}
body[data-mg-theme] header.mg-site-header .header-search-form { gap: 9px; }
body[data-mg-theme] header.mg-site-header .header-search-input {
  height: 47px;
  border-radius: 10px;
  background: #17191f;
}
body[data-mg-theme] header.mg-site-header .header-search-button {
  height: 47px;
  min-width: 98px;
  border-radius: 10px;
}
body[data-mg-theme] header.mg-site-header .mg-header-search-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 8px;
}
body[data-mg-theme] header.mg-site-header .mg-header-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #8f929c;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
}
body[data-mg-theme] header.mg-site-header .mg-header-filter select,
body[data-mg-theme] header.mg-site-header .mg-header-filter-clear {
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 7px;
  background: #15171d;
  color: #e6e7eb;
  font-size: 11px;
}
body[data-mg-theme] header.mg-site-header .mg-header-filter-clear { cursor: pointer; }

/* Featured cinematic hero. The homepage intentionally uses artwork, not an autoplay iframe. */
.mg-streaming-home {
  width: 100%;
  max-width: 1780px;
  margin: 0 auto;
  padding: 0 0 46px;
  overflow: hidden;
}
.mg-streaming-home .mg-hero {
  position: relative;
  isolation: isolate;
  display: flex;
  align-items: center;
  min-height: clamp(360px, 42vw, 560px);
  margin: 0 0 25px;
  padding: clamp(28px, 5vw, 76px) clamp(20px, 5.4vw, 86px);
  overflow: hidden;
  background: #11131a;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.mg-hero-backdrop {
  position: absolute;
  z-index: -2;
  inset: -8%;
  overflow: hidden;
  background: radial-gradient(ellipse at 70% 40%, #333b4c, #0a0b10 72%);
}
.mg-hero-backdrop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 28%;
  filter: blur(15px) brightness(.36) saturate(.78);
  transform: scale(1.09);
}
.mg-hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, #08090df7 0%, #08090dcc 40%, #08090d66 72%, #08090d99 100%),
    linear-gradient(0deg, #08090d 0%, transparent 34%, rgba(8,9,13,.15) 100%);
}
.mg-hero-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(150px, .55fr);
  align-items: center;
  gap: clamp(22px, 5vw, 80px);
  width: 100%;
  max-width: 1450px;
  margin: 0 auto;
}
.mg-hero-copy { max-width: 760px; min-width: 0; }
.mg-hero-kicker {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 16px;
  color: #ff6670;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .19em;
}
.mg-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mg-stream-accent);
  box-shadow: 0 0 14px rgba(229,9,25,.75);
}
.mg-hero-copy h2,
.mg-hero-empty h2 {
  max-width: 850px;
  margin: 0 0 14px;
  color: #fff !important;
  font-size: clamp(32px, 5.1vw, 68px);
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.mg-hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  margin: 0 0 17px;
  color: #e3e4e8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.mg-hero-meta span + span::before {
  content: "•";
  margin-right: 9px;
  color: #858995;
}
.mg-hero-description {
  display: -webkit-box;
  max-width: 650px;
  margin: 0 0 23px;
  overflow: hidden;
  color: #d0d2d9 !important;
  font-size: clamp(14px, 1.35vw, 17px);
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.mg-hero-actions { display: flex; flex-wrap: wrap; gap: 11px; }
.mg-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 47px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}
.mg-button:hover { transform: translateY(-2px); filter: brightness(1.08); }
.mg-button:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.mg-button-primary {
  background: linear-gradient(135deg, #e50919, #fa3544);
  color: #fff !important;
  box-shadow: 0 8px 22px rgba(229,9,25,.24);
}
.mg-button-secondary {
  background: rgba(100,103,113,.43);
  border-color: rgba(255,255,255,.16);
  color: #fff !important;
  backdrop-filter: blur(10px);
}
.mg-hero-artwork {
  display: block;
  justify-self: center;
  width: clamp(155px, 19vw, 255px);
  max-height: 365px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 13px;
  box-shadow: 0 24px 65px rgba(0,0,0,.55);
  transform: rotate(1.5deg);
  transition: transform .2s ease;
}
.mg-hero-artwork:hover { transform: rotate(0) scale(1.025); }
.mg-hero-artwork img { display: block; width: 100%; height: 100%; object-fit: cover; }
.mg-hero-empty { position: relative; max-width: 1100px; margin: 0 auto; }
.mg-hero-empty p:not(.mg-hero-kicker) { color: #d0d2d9; font-size: 17px; }

/* Netflix-like horizontal content rows */
.mg-streaming-home > section:not(.mg-hero) {
  position: relative;
  margin: 0 0 23px;
  padding: 0 clamp(10px, 2.6vw, 38px);
}
.mg-streaming-home > section:not(.mg-hero) > h2 {
  margin: 0 0 7px;
  padding: 0 10px;
  color: #f4f4f6 !important;
  font-size: clamp(19px, 2vw, 25px);
  line-height: 1.25;
  font-weight: 850;
  letter-spacing: -.025em;
}
.mg-streaming-home .slider-container {
  display: flex;
  align-items: center;
  width: 100%;
  position: relative;
}
.mg-streaming-home .movies-slider {
  display: flex;
  align-items: stretch;
  gap: clamp(11px, 1.25vw, 19px);
  width: 100%;
  min-width: 0;
  padding: 12px 10px 22px;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 10px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mg-streaming-home .movies-slider::-webkit-scrollbar { display: none; }
.mg-streaming-home .movies-slider > .movie-block {
  box-sizing: border-box;
  flex: 0 0 clamp(132px, 14vw, 188px) !important;
  width: clamp(132px, 14vw, 188px) !important;
  min-width: 0;
  padding: 0 !important;
  overflow: visible !important;
  border: 0 !important;
  border-radius: 10px !important;
  background: transparent !important;
  box-shadow: none !important;
  scroll-snap-align: start;
  text-align: left !important;
  transition: transform .18s ease;
}
.mg-streaming-home .movies-slider > .movie-block .mg-card-link {
  display: block;
  height: 100%;
  color: #f5f5f7 !important;
  text-decoration: none;
}
.mg-streaming-home .mg-poster-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 9px;
  background: #171a22;
  box-shadow: 0 8px 23px rgba(0,0,0,.32);
}
.mg-streaming-home .mg-poster-frame img.movie-poster {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  border-radius: 0 !important;
  object-fit: cover !important;
  transition: transform .24s ease, filter .24s ease;
}
.mg-streaming-home .mg-poster-frame::after {
  content: "▶";
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  padding-left: 3px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 50%;
  background: rgba(12,13,17,.72);
  color: #fff;
  font-size: 17px;
  opacity: 0;
  transform: translate(-50%,-44%) scale(.88);
  transition: opacity .18s ease, transform .18s ease;
}
.mg-streaming-home .movie-title {
  display: -webkit-box !important;
  min-height: 2.55em;
  margin: 9px 1px 3px !important;
  overflow: hidden;
  color: #f2f2f4 !important;
  font-size: 13px !important;
  font-weight: 750 !important;
  line-height: 1.28 !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.mg-streaming-home .movie-year {
  margin: 0 1px 5px !important;
  color: #a8aab3 !important;
  font-size: 11px !important;
}
.mg-streaming-home .movie-description { display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow:hidden; }
.mg-streaming-home .mg-media-type-badge {
  top: 7px !important;
  left: 7px !important;
  padding: 4px 6px !important;
  border: 0 !important;
  border-radius: 4px !important;
  background: rgba(8,9,13,.78) !important;
  font-size: 9px !important;
}
.mg-streaming-home .slider-button {
  z-index: 5;
  display: grid;
  place-items: center;
  width: 38px;
  height: 62px;
  padding: 0;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 8px;
  background: rgba(9,10,14,.82);
  color: #fff;
  font-size: 19px;
  opacity: .9;
  backdrop-filter: blur(8px);
}
.mg-streaming-home .slider-button.left { left: 0; }
.mg-streaming-home .slider-button.right { right: 0; }
.mg-streaming-home .remove-button {
  margin-top: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 7px;
  background: #252832;
  color: #ddd;
  font-size: 11px;
}
.mg-streaming-home .favorite-button {
  border-radius: 7px;
  background: #252832;
  color: #fff;
}
.mg-streaming-home .movie-block:focus-within {
  outline: 2px solid var(--mg-stream-accent);
  outline-offset: 3px;
}
@media (hover:hover) and (pointer:fine) {
  .mg-streaming-home .movies-slider > .movie-block:hover { transform: translateY(-5px) scale(1.035); }
  .mg-streaming-home .movies-slider > .movie-block:hover .mg-poster-frame img.movie-poster { filter: brightness(.82); transform: scale(1.04); }
  .mg-streaming-home .movies-slider > .movie-block:hover .mg-poster-frame::after { opacity: 1; transform: translate(-50%,-50%) scale(1); }
}
@media (max-width: 900px) {
  body[data-mg-theme] header.mg-site-header {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "nav" "search";
    gap: 8px;
    padding: 11px 14px 9px !important;
  }
  body[data-mg-theme] header.mg-site-header .mg-main-nav { justify-content: flex-start; }
  body[data-mg-theme] header.mg-site-header .header-search-wrapper { width: 100%; margin: 2px auto; }
}
@media (max-width: 600px) {
  body[data-mg-theme] header.mg-site-header .mg-brand { font-size: 21px; }
  body[data-mg-theme] header.mg-site-header .mg-brand img { height: 34px !important; }
  body[data-mg-theme] header.mg-site-header .mg-main-nav > a { padding: 8px 10px !important; font-size: 12px; }
  body[data-mg-theme] header.mg-site-header .mg-main-nav .user-info { margin-left: 3px; }
  body[data-mg-theme] header.mg-site-header .username { display: none; }
  body[data-mg-theme] header.mg-site-header .header-search-form { gap: 6px; }
  body[data-mg-theme] header.mg-site-header .header-search-button { min-width: 76px; padding: 0 10px; }
  body[data-mg-theme] header.mg-site-header .mg-header-search-filters {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 3px;
  }
  body[data-mg-theme] header.mg-site-header .mg-header-filter { flex: 0 0 auto; }
  .mg-streaming-home .mg-hero { min-height: 390px; padding: 35px 21px 42px; }
  .mg-hero-inner { display: block; }
  .mg-hero-copy { max-width: 100%; }
  .mg-hero-copy h2 { font-size: clamp(32px, 9vw, 46px); }
  .mg-hero-description { max-width: 100%; font-size: 14px; -webkit-line-clamp: 4; }
  .mg-hero-artwork { display: none; }
  .mg-button { min-height: 45px; padding: 0 16px; font-size: 13px; }
  .mg-streaming-home > section:not(.mg-hero) { padding: 0 8px; margin-bottom: 18px; }
  .mg-streaming-home > section:not(.mg-hero) > h2 { padding: 0 8px; font-size: 19px; }
  .mg-streaming-home .movies-slider { gap: 11px; padding: 10px 8px 18px; }
  .mg-streaming-home .movies-slider > .movie-block { flex-basis: 137px !important; width: 137px !important; }
  .mg-streaming-home .slider-button { display: none; }
}
@media (min-width: 1200px) {
  .mg-streaming-home .movies-slider > .movie-block { flex-basis: 190px !important; width: 190px !important; }
}
/* Remote-friendly controls for Android TV and other 10-foot browsers. */
html[data-mg-device="tv"] body[data-mg-theme] header.mg-site-header { padding: 22px 3vw 15px !important; }
html[data-mg-device="tv"] body[data-mg-theme] header.mg-site-header .mg-main-nav > a { padding: 13px 17px !important; font-size: 17px; }
html[data-mg-device="tv"] .mg-streaming-home .mg-hero { min-height: min(48vw, 680px); }
html[data-mg-device="tv"] .mg-streaming-home .movies-slider > .movie-block { flex-basis: 220px !important; width: 220px !important; }
html[data-mg-device="tv"] .mg-streaming-home .movie-title { font-size: 16px !important; }
html[data-mg-device="tv"] .mg-streaming-home a:focus-visible,
html[data-mg-device="tv"] .mg-streaming-home button:focus-visible,
html[data-mg-device="tv"] body[data-mg-theme] header a:focus-visible {
  outline: 4px solid #fff !important;
  outline-offset: 4px;
  box-shadow: 0 0 0 7px rgba(229,9,25,.65);
}
@media (prefers-reduced-motion: reduce) {
  .mg-button, .mg-streaming-home .movies-slider > .movie-block,
  .mg-streaming-home .mg-poster-frame img.movie-poster { transition: none !important; }
  .mg-streaming-home .movies-slider { scroll-behavior: auto; }
}


/* Poster reliability and Continue Watching polish. */
.mg-streaming-home .mg-poster-frame {
  isolation: isolate;
  background: linear-gradient(145deg,#202632,#10131a);
}
.mg-streaming-home .mg-poster-frame img.movie-poster {
  color: transparent;
  font-size: 0;
}
.mg-streaming-home .mg-progress-track {
  position: absolute;
  z-index: 25;
  left: 8px;
  right: 8px;
  bottom: 9px;
  display: block;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255,255,255,.42);
  box-shadow: 0 1px 5px rgba(0,0,0,.75);
}
.mg-streaming-home .mg-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #e50919;
}
.mg-streaming-home .mg-episode-badge {
  position: absolute;
  z-index: 25;
  left: 8px;
  bottom: 19px;
  padding: 4px 6px;
  border-radius: 5px;
  color: #fff;
  background: rgba(0,0,0,.78);
  font: 800 10px/1.2 system-ui,sans-serif;
}
.mg-streaming-home .movies-slider > .movie-block {
  flex-basis: clamp(145px, 14.5vw, 198px) !important;
  width: clamp(145px, 14.5vw, 198px) !important;
}
.mg-streaming-home .mg-card-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 4px;
  border-radius: 10px;
}
@media (max-width: 600px) {
  .mg-streaming-home .movies-slider > .movie-block {
    flex-basis: 142px !important;
    width: 142px !important;
  }
}

/* Donation card is centered across the complete site header, not the left grid column. */
body[data-mg-theme] header.mg-site-header > #donationBanner,
header.mg-site-header > #donationBanner {
  grid-column: 1 / -1;
  justify-self: center;
  align-self: center;
  width: min(100%, 720px);
  max-width: 720px;
  box-sizing: border-box;
  margin: 10px auto 0;
  text-align: center;
}
header.mg-site-header > #donationBanner > p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
header.mg-site-header > #donationBanner > .donate-btn {
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 600px) {
  header.mg-site-header > #donationBanner {
    width: 100%;
    padding: 12px 10px;
  }
}


/* Homepage visibility guard: keep the catalogue visible even when legacy
   global theme styles target generic main/section containers. */
body[data-mg-theme] main.mg-streaming-home,
main.mg-streaming-home {
  display: block !important;
  visibility: visible !important;
  position: relative;
  width: 100%;
  min-height: 220px;
  color: #f7f7f8 !important;
}
main.mg-streaming-home > .mg-hero {
  display: flex !important;
  visibility: visible !important;
  min-height: clamp(330px, 38vw, 520px);
}
main.mg-streaming-home > section:not(.mg-hero) {
  display: block !important;
  visibility: visible !important;
}
main.mg-streaming-home .mg-hero-empty {
  position: relative;
  z-index: 2;
  display: block;
  width: min(100%, 900px);
  color: #f7f7f8;
}
main.mg-streaming-home .mg-hero-empty h2,
main.mg-streaming-home .mg-hero-empty p {
  color: inherit;
}

/* The navigation identity follows the selected family viewer. Account settings stay separate. */
.mg-account-link{display:inline-flex;align-items:center;justify-content:center;min-height:32px;padding:6px 9px;border:1px solid rgba(255,255,255,.12);border-radius:8px;background:rgba(255,255,255,.045);color:#e8e8ec!important;font-size:11px;font-weight:700;text-decoration:none;white-space:nowrap}
.mg-account-link:hover,.mg-account-link:focus-visible{border-color:rgba(255,255,255,.3);background:rgba(255,255,255,.09);outline:none}

.mg-card-details{display:inline-flex;padding:6px 10px;margin:5px 0;color:#eee;background:#242630;border:1px solid #ffffff24;border-radius:6px;font-size:12px;text-decoration:none}.mg-card-details:focus-visible{outline:2px solid white}
