/* ============================================================
   Mani272Playz — streaming UI
   Zero-build. No frameworks. Plain CSS.
   ============================================================ */

:root {
  --bg:        #141414;
  --bg-2:      #181818;
  --bg-3:      #232323;
  --red:       #e50914;
  --red-hover: #f6121d;
  --text:      #ffffff;
  --text-dim:  #b3b3b3;
  --text-dim2: #808080;
  --header-h:  68px;
  --radius:    6px;
  --ease:      cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* { box-sizing: border-box; }

/* A class-level `display` beats the UA rule for [hidden], so enforce it. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; cursor: pointer; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #444; }

/* ---------------- Brand ---------------- */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  font-size: 1.5rem;
  letter-spacing: -0.5px;
  color: var(--red);
  white-space: nowrap;
  text-transform: uppercase;
}
.brand__logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.4);
}
.brand span { color: var(--text); }
.brand--lg { font-size: 2.2rem; margin-bottom: 1.5rem; }

/* ---------------- Buttons ---------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.75rem 1.6rem;
  border: 0;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  transition: background 0.18s var(--ease), transform 0.12s var(--ease), opacity 0.18s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: #fff; color: #000; }
.btn--primary:hover { background: rgba(255,255,255,0.78); }

.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-hover); }

.btn--ghost { background: rgba(109,109,110,0.7); color: #fff; }
.btn--ghost:hover { background: rgba(109,109,110,0.5); }

.btn--icon {
  width: 42px; height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(42,42,42,0.7);
  border: 2px solid rgba(255,255,255,0.5);
  color: #fff;
}
.btn--icon:hover { border-color: #fff; background: rgba(60,60,60,0.8); }
.btn--icon.is-active { background: #fff; color: #000; border-color: #fff; }

/* ---------------- Setup gate ---------------- */

.setup {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 2rem 1.25rem;
  overflow-y: auto;
  background:
    linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.92)),
    radial-gradient(1200px 600px at 50% -10%, #3a0d10 0%, var(--bg) 60%);
}
.setup__card {
  width: 100%;
  max-width: 620px;
  background: rgba(0,0,0,0.72);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  padding: 2.5rem;
}
.setup__title { margin: 0 0 0.75rem; font-size: 1.9rem; }
.setup__lead { color: var(--text-dim); line-height: 1.65; margin: 0 0 1.5rem; }
.setup__lead strong { color: #fff; }

.setup__steps {
  color: var(--text-dim);
  line-height: 1.9;
  padding-left: 1.25rem;
  margin: 0 0 1.75rem;
}
.setup__steps a { color: var(--red); text-decoration: underline; }
.setup__steps strong { color: #fff; }

.setup__form { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.setup__input {
  flex: 1 1 260px;
  padding: 0.85rem 1rem;
  background: #232323;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  font-size: 1rem;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
}
.setup__input:focus { outline: 2px solid var(--red); outline-offset: 1px; }

.setup__msg { min-height: 1.4em; margin: 0.9rem 0 0; font-size: 0.92rem; }
.setup__msg.is-error { color: #ff6b6b; }
.setup__msg.is-ok { color: #4ade80; }
.setup__msg.is-busy { color: var(--text-dim); }

.setup__note { color: var(--text-dim2); font-size: 0.82rem; margin: 1.25rem 0 0; }

.setup__status {
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--bg-3);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.setup__status .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--text-dim2); flex-shrink: 0;
}
.setup__status.is-up   .dot { background: #46d369; box-shadow: 0 0 8px #46d369; }
.setup__status.is-down .dot { background: #ff6b6b; box-shadow: 0 0 8px #ff6b6b; }

.setup__foot { display: flex; gap: 0.6rem; margin-top: 1.5rem; flex-wrap: wrap; }

button.avatar { border: 0; color: #fff; font-family: inherit; }
button.avatar:hover { filter: brightness(1.15); }

/* ---------------- profile menu ---------------- */

.profile { position: relative; }

.profile__menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 210px;
  background: rgba(20,20,20,0.96);
  border: 1px solid #2e2e2e;
  border-radius: 6px;
  padding: 0.4rem;
  box-shadow: 0 12px 32px rgba(0,0,0,0.7);
  animation: pop 0.18s var(--ease);
}
.profile__menu::before {
  content: "";
  position: absolute;
  top: -12px; right: 10px;
  border: 6px solid transparent;
  border-bottom-color: #2e2e2e;
}

.profile__who {
  padding: 0.55rem 0.75rem;
  color: var(--text-dim2);
  font-size: 0.8rem;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 0.3rem;
  word-break: break-all;
}

.profile__item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: #e5e5e5;
  padding: 0.6rem 0.75rem;
  border-radius: 4px;
  font-size: 0.88rem;
}
.profile__item:hover { background: #2a2a2a; color: #fff; }

.profile__section {
  padding: 0.6rem 0.75rem 0.75rem;
  border-bottom: 1px solid #2a2a2a;
  margin-bottom: 0.3rem;
}
.profile__label {
  display: block;
  color: var(--text-dim2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 0.4rem;
}
.profile__select {
  width: 100%;
  background: var(--bg-3);
  color: #fff;
  border: 1px solid #3a3a3a;
  border-radius: 4px;
  padding: 0.45rem 0.55rem;
  font-size: 0.86rem;
}
.profile__select:focus { outline: 2px solid var(--red); outline-offset: 1px; }
.profile__hint {
  margin: 0.5rem 0 0;
  color: var(--text-dim2);
  font-size: 0.74rem;
  line-height: 1.5;
}
.profile__hint strong { color: var(--text-dim); }

/* watch-page tip */
.watch__tip {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  max-width: 760px;
  background: var(--bg-2);
  border: 1px solid #262626;
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.6;
}
.watch__tip svg { flex-shrink: 0; margin-top: 2px; color: var(--text-dim2); }
.watch__tip strong { color: #fff; font-weight: 600; }

.watch__note {
  margin: 0.9rem 0 0;
  max-width: 640px;
  color: var(--text-dim2);
  font-size: 0.82rem;
  line-height: 1.6;
}
.watch__note strong { color: var(--text-dim); }
.watch__sub strong { color: #fff; }

.watch__stall {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
  padding: 1rem 1.15rem;
  max-width: 760px;
  background: rgba(229, 9, 20, 0.1);
  border: 1px solid rgba(229, 9, 20, 0.4);
  border-radius: var(--radius);
}
.watch__stall strong { display: block; color: #fff; margin-bottom: 0.2rem; }
.watch__stall span { color: var(--text-dim); font-size: 0.86rem; line-height: 1.55; }

/* slow-connection warning */
.net-warn {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  max-width: 760px;
  margin: 1.25rem 0 0;
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  background: rgba(232, 168, 26, 0.1);
  border: 1px solid rgba(232, 168, 26, 0.4);
  color: var(--text-dim);
  font-size: 0.86rem;
  line-height: 1.6;
}
.net-warn svg { color: #e8a81a; flex-shrink: 0; margin-top: 2px; }
.net-warn strong { color: #fff; }
.net-warn.is-severe {
  background: rgba(229, 9, 20, 0.1);
  border-color: rgba(229, 9, 20, 0.45);
}
.net-warn.is-severe svg { color: var(--red); }
.net-warn .mini { flex-shrink: 0; align-self: center; }

/* server switcher */
.source-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin: 0 0 1.25rem;
}
.source-bar__label {
  color: var(--text-dim2);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.7px;
}
.source-bar__set { display: flex; gap: 0.35rem; }
.source-bar__hint { color: var(--text-dim2); font-size: 0.78rem; }

.source-chip {
  min-width: 38px;
  padding: 0.4rem 0.75rem;
  background: var(--bg-3);
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 0.86rem;
  font-weight: 600;
}
.source-chip:hover { color: #fff; border-color: #555; }
.source-chip.is-on {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* saved-position cue */
.resume-cue {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 0 1.25rem;
  padding: 0.8rem 1rem;
  background: var(--bg-2);
  border: 1px solid #2e2e2e;
  border-left: 3px solid var(--red);
  border-radius: var(--radius);
}
.resume-cue__main { display: flex; align-items: center; gap: 0.7rem; }
.resume-cue__main svg { color: var(--red); flex-shrink: 0; }
.resume-cue strong { display: block; color: #fff; font-size: 0.95rem; }
.resume-cue span { color: var(--text-dim); font-size: 0.83rem; }

/* ---------------- theater mode ---------------- */

body.theater { background: #000; overflow: hidden; }
body.theater .header,
body.theater .footer,
body.theater .watch__bar { display: none; }
body.theater .watch { padding-top: 0; }

body.theater .watch__stage {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  max-height: none;
  z-index: 90;
  background: #000;
}

body.theater::after {
  content: "Press Esc to exit";
  position: fixed;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  z-index: 95;
  padding: 0.4rem 0.9rem;
  border-radius: 20px;
  background: rgba(0,0,0,0.7);
  color: rgba(255,255,255,0.55);
  font-size: 0.78rem;
  pointer-events: none;
  animation: fadeOut 0.4s ease 4s forwards;
}
@keyframes fadeOut { to { opacity: 0; } }

.btn.is-on { background: var(--red); color: #fff; }

/* ---------------- audio guide ---------------- */

.audio-panel {
  margin-top: 1.75rem;
  max-width: 860px;
  background: var(--bg-2);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1.5rem 1.75rem 1.75rem;
}
.audio-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}
.audio-panel__head h2 { margin: 0; font-size: 1.25rem; }

.audio-panel__intro {
  margin: 0 0 1.5rem;
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.7;
}
.audio-panel__intro em { color: #ddd; font-style: italic; }

.audio-steps {
  margin: 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}
.audio-steps li { color: var(--text-dim); }
.audio-steps b {
  display: block;
  color: #fff;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}
.audio-steps span {
  display: block;
  font-size: 0.87rem;
  line-height: 1.65;
}
.audio-steps em { color: #ddd; font-style: normal; background: #262626;
  padding: 0.05rem 0.35rem; border-radius: 3px; }
.audio-steps strong { color: var(--red); font-weight: 700; }

.audio-panel__note {
  margin: 1.5rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid #2a2a2a;
  color: var(--text-dim2);
  font-size: 0.82rem;
  line-height: 1.6;
}

/* ---------------- Header ---------------- */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 4%;
  background: linear-gradient(180deg, rgba(0,0,0,0.85) 10%, transparent);
  transition: background-color 0.35s var(--ease);
}
.header.is-solid { background: var(--bg); }

.header__left,
.header__right { display: flex; align-items: center; gap: 1.5rem; }

.nav { display: flex; gap: 1.15rem; }
.nav a {
  color: #e5e5e5;
  font-size: 0.88rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav a:hover { color: var(--text-dim); }
.nav a.is-active { color: #fff; font-weight: 700; }

.search { display: flex; align-items: center; }
.search__btn {
  background: none; border: 0; color: #fff;
  display: grid; place-items: center; padding: 4px;
}
.search__input {
  width: 0; padding: 0; opacity: 0;
  background: rgba(0,0,0,0.75);
  border: 1px solid transparent;
  color: #fff; font-size: 0.9rem;
  transition: width 0.3s var(--ease), opacity 0.3s, padding 0.3s;
}
.search.is-open .search__input {
  width: 240px; opacity: 1;
  padding: 0.5rem 0.75rem;
  border-color: rgba(255,255,255,0.5);
}
.search__input:focus { outline: none; }

.avatar {
  width: 32px; height: 32px;
  border-radius: 4px;
  background: var(--red);
  display: grid; place-items: center;
  font-weight: 900; font-size: 0.95rem;
  flex-shrink: 0;
}

/* ---------------- Hero billboard ---------------- */

.hero {
  position: relative;
  height: 85vh;
  min-height: 520px;
  display: flex;
  align-items: center;
  margin-bottom: -6vh;
}
.hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background:
    linear-gradient(77deg, rgba(0,0,0,0.85) 0%, transparent 60%),
    linear-gradient(180deg, transparent 50%, rgba(20,20,20,0.7) 85%, var(--bg) 100%);
}
.hero__content {
  position: relative;
  z-index: 2;
  padding: 0 4%;
  max-width: 620px;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.6rem);
  font-weight: 900;
  line-height: 1.05;
  margin: 0 0 1rem;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.5);
}
.hero__meta {
  display: flex; align-items: center; gap: 0.85rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
  color: #ddd;
  flex-wrap: wrap;
}
.hero__score { color: #46d369; font-weight: 700; }
.hero__badge {
  border: 1px solid rgba(255,255,255,0.4);
  padding: 0.05rem 0.5rem;
  font-size: 0.78rem;
  border-radius: 3px;
}
.hero__overview {
  font-size: 1.05rem;
  line-height: 1.5;
  color: #eee;
  text-shadow: 1px 1px 4px rgba(0,0,0,0.6);
  margin: 0 0 1.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* ---------------- Rows ---------------- */

.rows { position: relative; z-index: 3; padding-bottom: 3rem; }

.row { margin: 0 0 2.6rem; }
.row__title {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 0.75rem;
  padding: 0 4%;
}
.row__wrap { position: relative; }

.row__track {
  display: flex;
  gap: 0.5rem;
  padding: 0 4% 0.5rem;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}
.row__track::-webkit-scrollbar { display: none; }

.row__arrow {
  position: absolute;
  top: 0; bottom: 0.5rem;
  width: 4%;
  min-width: 44px;
  z-index: 6;
  background: rgba(0,0,0,0.55);
  border: 0; color: #fff;
  font-size: 1.9rem;
  display: grid; place-items: center;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}
.row__wrap:hover .row__arrow { opacity: 1; }
.row__arrow:hover { background: rgba(0,0,0,0.8); }
.row__arrow--left  { left: 0; }
.row__arrow--right { right: 0; }
.row__arrow[disabled] { display: none; }

/* ---------------- Cards ---------------- */

.card {
  position: relative;
  flex: 0 0 auto;
  width: 235px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-3);
  cursor: pointer;
  transition: transform 0.3s var(--ease);
}
.card__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg-3); }
.card--poster { width: 175px; }
.card--poster .card__img { aspect-ratio: 2 / 3; }

.card__fallback {
  width: 100%; aspect-ratio: 16 / 9;
  display: grid; place-items: center;
  padding: 0.75rem; text-align: center;
  font-size: 0.85rem; color: var(--text-dim);
  background: var(--bg-3);
}
.card--poster .card__fallback { aspect-ratio: 2 / 3; }

.card__body {
  padding: 0.6rem 0.7rem 0.75rem;
  background: var(--bg-2);
}
.card__name {
  font-size: 0.88rem; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card__sub {
  display: flex; gap: 0.5rem; align-items: center;
  font-size: 0.75rem; color: var(--text-dim); margin-top: 0.25rem;
}
.card__sub .score { color: #46d369; font-weight: 700; }

.card:hover { transform: scale(1.06); z-index: 5; }
.row__track .card:hover { box-shadow: 0 8px 22px rgba(0,0,0,0.6); }

/* progress bar on Continue Watching cards */
.card__progress {
  position: absolute;
  left: 0; right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255,255,255,0.28);
}
.card--progress .card__progress { bottom: 62px; }
.card__progress i {
  display: block; height: 100%;
  background: var(--red);
}

.card__remove {
  position: absolute;
  top: 6px; right: 6px;
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 1.1rem; line-height: 1;
  display: none; place-items: center;
  z-index: 3;
}
.card:hover .card__remove { display: grid; }
.card__remove:hover { background: var(--red); }

/* ---------------- Grid (search / browse) ---------------- */

.page { padding: calc(var(--header-h) + 2.5rem) 4% 4rem; min-height: 80vh; }
.page__title { font-size: 1.7rem; margin: 0 0 0.35rem; }
.page__sub { color: var(--text-dim); margin: 0 0 2rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
  gap: 1.15rem 0.85rem;
}
.grid .card { width: 100%; }

/* ---------------- browse filters ---------------- */

.filters-bar {
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #262626;
}

.seg {
  display: flex;
  background: var(--bg-3);
  border: 1px solid #3a3a3a;
  border-radius: 6px;
  overflow: hidden;
}
.seg__b {
  background: none;
  border: 0;
  color: var(--text-dim);
  padding: 0.55rem 1.1rem;
  font-size: 0.88rem;
  white-space: nowrap;
}
.seg__b:hover { color: #fff; }
.seg__b.is-on { background: var(--red); color: #fff; font-weight: 700; }

.filt { display: flex; flex-direction: column; gap: 0.3rem; }
.filt > span {
  color: var(--text-dim2);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.filt .select { min-width: 130px; padding: 0.5rem 0.6rem; font-size: 0.86rem; }

.more-wrap {
  display: flex;
  justify-content: center;
  padding: 2.5rem 0 1rem;
  min-height: 60px;
}
.more-note { color: var(--text-dim2); font-size: 0.88rem; margin: 0; }

@media (max-width: 780px) {
  .filters-bar { gap: 0.5rem; }
  .filt .select { min-width: 0; width: 100%; }
  .filt { flex: 1 1 44%; }
  .seg { flex: 1 1 100%; }
  .seg__b { flex: 1; }
}

/* ---------------- Modal ---------------- */

.modal {
  position: fixed; inset: 0; z-index: 150;
  overflow-y: auto;
  padding: 3rem 1rem;
}
.modal__backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  animation: fade 0.25s var(--ease);
}
.modal__panel {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-2);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 12px 50px rgba(0,0,0,0.75);
  animation: pop 0.28s var(--ease);
}
@keyframes fade { from { opacity: 0; } }
@keyframes pop  { from { opacity: 0; transform: scale(0.96) translateY(12px); } }

.modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 36px; height: 36px;
  border-radius: 50%; border: 0;
  background: rgba(20,20,20,0.85);
  color: #fff; font-size: 1.6rem; line-height: 1;
  display: grid; place-items: center;
}
.modal__close:hover { background: var(--red); }

.detail__hero { position: relative; }
.detail__img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.detail__hero::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 45%, var(--bg-2) 98%);
}
.detail__heading {
  position: absolute;
  left: 2.5rem; right: 2.5rem; bottom: 1.5rem;
  z-index: 2;
}
.detail__title {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
  font-weight: 900;
  margin: 0 0 1rem;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.6);
}
.detail__actions { display: flex; gap: 0.65rem; align-items: center; flex-wrap: wrap; }

.detail__body { padding: 1.5rem 2.5rem 2.5rem; }
.detail__cols { display: grid; grid-template-columns: 2fr 1fr; gap: 2rem; }

.detail__meta {
  display: flex; gap: 0.85rem; align-items: center;
  flex-wrap: wrap; margin-bottom: 1rem;
  font-size: 0.92rem; color: #ddd;
}
.detail__overview { line-height: 1.6; color: #eee; margin: 0; }

.detail__facts { font-size: 0.88rem; line-height: 1.9; }
.detail__facts dt { color: var(--text-dim2); display: inline; }
.detail__facts dd { display: inline; margin: 0; color: #ddd; }
.detail__facts div { margin-bottom: 0.5rem; }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.chip {
  background: var(--bg-3);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  color: #ddd;
}

.section-h {
  font-size: 1.1rem;
  margin: 2rem 0 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #333;
}

/* season / episode picker */
.season-bar { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0 1rem; flex-wrap: wrap; }
.select {
  background: var(--bg-3);
  color: #fff;
  border: 1px solid #444;
  border-radius: 4px;
  padding: 0.55rem 0.85rem;
  font-size: 0.95rem;
}
.select:focus { outline: 2px solid var(--red); }

.eps { display: flex; flex-direction: column; gap: 0.4rem; }
.ep {
  display: grid;
  grid-template-columns: 42px 152px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem;
  border-radius: var(--radius);
  background: transparent;
  border: 0;
  text-align: left;
  color: inherit;
  transition: background 0.18s;
  width: 100%;
}
.ep:hover { background: var(--bg-3); }
.ep__num { font-size: 1.1rem; color: var(--text-dim2); text-align: center; }
.ep__still {
  width: 152px; aspect-ratio: 16/9;
  object-fit: cover; border-radius: 4px;
  background: var(--bg-3);
}
.ep__name { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.2rem; }
.ep__desc {
  font-size: 0.82rem; color: var(--text-dim); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ep__meta { font-size: 0.75rem; color: var(--text-dim2); margin-top: 0.25rem; }

.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1rem; }
.cast__p { text-align: center; font-size: 0.8rem; }
.cast__img {
  width: 100%; aspect-ratio: 1;
  object-fit: cover; border-radius: 50%;
  background: var(--bg-3); margin-bottom: 0.5rem;
}
.cast__name { font-weight: 600; }
.cast__role { color: var(--text-dim2); font-size: 0.75rem; }

/* ---------------- Watch page ---------------- */

.watch { padding-top: var(--header-h); }
.watch__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100vh - var(--header-h));
  background: #000;
}
.watch__stage iframe { width: 100%; height: 100%; border: 0; display: block; }

.watch__bar { padding: 1.5rem 4% 3rem; }
.watch__title { font-size: 1.6rem; margin: 0 0 0.35rem; }
.watch__sub { color: var(--text-dim); margin: 0 0 1.25rem; }
.watch__actions { display: flex; gap: 0.65rem; flex-wrap: wrap; }

/* ---------------- TV Series Season & Episode Bar ---------------- */
.tv-bar {
  margin: 1.25rem 0;
  background: var(--bg-2, #181818);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
.tv-bar__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}
.tv-bar__season {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.tv-bar__season select {
  padding: 0.45rem 0.85rem;
  background: #252525;
  border: 1px solid #3d3d3d;
  border-radius: 4px;
  color: #fff;
  font-size: 0.9rem;
}
.tv-bar__nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tv-bar__current {
  font-weight: 700;
  color: var(--red, #e50914);
  padding: 0 0.5rem;
  font-size: 0.95rem;
}
.tv-bar__episodes {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.5rem;
  scrollbar-width: thin;
}
.tv-ep-chip {
  flex: 0 0 auto;
  padding: 0.45rem 0.85rem;
  background: #252525;
  border: 1px solid #383838;
  border-radius: 4px;
  color: #ccc;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.tv-ep-chip:hover {
  background: #333;
  color: #fff;
  border-color: #555;
}
.tv-ep-chip.is-active {
  background: var(--red, #e50914);
  color: #fff;
  border-color: var(--red, #e50914);
  font-weight: 700;
}

/* ---------------- States ---------------- */

.state { padding: 5rem 1rem; text-align: center; color: var(--text-dim); }
.state h2 { color: #fff; margin: 0 0 0.5rem; }

.spinner {
  width: 46px; height: 46px;
  margin: 0 auto 1rem;
  border: 4px solid #333;
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, #1c1c1c 25%, #2a2a2a 50%, #1c1c1c 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer { to { background-position: -200% 0; } }

.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: #fff; color: #000;
  padding: 0.8rem 1.4rem;
  border-radius: 4px;
  font-weight: 600; font-size: 0.92rem;
  box-shadow: 0 8px 26px rgba(0,0,0,0.5);
  animation: rise 0.25s var(--ease);
  /* Never swallow input: this sits bottom-centre, which is exactly where
     a video player puts its control bar and volume slider. */
  pointer-events: none;
}
@keyframes rise { from { opacity: 0; transform: translate(-50%, 14px); } }

/* On the watch page keep transient UI clear of the player's controls
   entirely by moving it to the top of the screen. */
body.theater .toast,
.watch ~ .toast,
body:has(.watch) .toast {
  bottom: auto;
  top: 84px;
  animation: drop 0.25s var(--ease);
}
@keyframes drop { from { opacity: 0; transform: translate(-50%, -14px); } }

/* ---------------- Footer ---------------- */

.footer {
  padding: 3rem 4%;
  border-top: 1px solid #222;
  color: var(--text-dim2);
  font-size: 0.85rem;
  line-height: 1.8;
}
.footer__brand { font-weight: 900; color: var(--red); font-size: 1.1rem; margin: 0 0 0.5rem; }
.footer__brand span { color: #fff; }
.footer a { color: var(--text-dim); text-decoration: underline; }
.footer__fine { font-size: 0.78rem; margin-top: 0.75rem; }

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
  .detail__cols { grid-template-columns: 1fr; gap: 1.25rem; }
  .detail__body { padding: 1.25rem 1.5rem 2rem; }
  .detail__heading { left: 1.5rem; right: 1.5rem; }
  .ep { grid-template-columns: 32px 112px 1fr; gap: 0.75rem; }
  .ep__still { width: 112px; }
}

@media (max-width: 780px) {
  :root { --header-h: 58px; }
  .nav { display: none; }
  .header { padding: 0 4%; background: rgba(20,20,20,0.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .header__left, .header__right { gap: 0.85rem; }
  .brand { font-size: 1.2rem; }
  .hero { height: 68vh; min-height: 400px; }
  .hero__overview { font-size: 0.95rem; -webkit-line-clamp: 2; }
  .card { width: 148px; }
  .card--poster { width: 118px; }
  .search.is-open .search__input { width: 150px; }
  .grid { grid-template-columns: repeat(3, 1fr); gap: 0.6rem; padding: 0 3%; }
  .row__arrow { display: none; }
  .setup__card { padding: 1.75rem 1.25rem; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__panel { border-radius: 20px 20px 0 0; min-height: 80vh; max-height: 92vh; border: 1px solid rgba(255,255,255,0.12); border-bottom: 0; animation: slideUpSheet 0.28s cubic-bezier(0.2, 0.8, 0.25, 1); }
  
  #main { padding-bottom: 76px; }
  .footer { padding-bottom: 86px; }
  .toast { bottom: 80px; }
}

/* ---------------- Mobile App Bottom Navigation ---------------- */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(18, 18, 18, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 150;
  justify-content: space-around;
  align-items: center;
  padding: 0 0.5rem;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
}

.mobile-nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-dim2);
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
  flex: 1;
  height: 100%;
  transition: color 0.15s var(--ease), transform 0.1s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav__item svg {
  transition: transform 0.15s var(--ease);
}

.mobile-nav__item:active {
  transform: scale(0.92);
}

.mobile-nav__item.is-active {
  color: var(--red);
  font-weight: 700;
}

.mobile-nav__item.is-active svg {
  transform: translateY(-1px);
}

@media (max-width: 780px) {
  .mobile-nav {
    display: flex;
  }
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
  .row__track { scroll-behavior: auto; }
}

/* ---------------- Native Mobile App & Remote Update Overlay Styles ---------------- */
html.is-mobile-app, body.is-mobile-app {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior-y: contain;
}

.is-mobile-app .mobile-nav {
  display: flex !important;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(64px + env(safe-area-inset-bottom, 0px));
}

.is-mobile-app #main {
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

/* Update Modal & Maintenance Overlay */
.app-update-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: fadeIn 0.3s ease;
}

.app-update-card {
  background: #181818;
  border: 1px solid rgba(229, 9, 20, 0.4);
  border-radius: 16px;
  max-width: 440px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0,0,0,0.8), 0 0 30px rgba(229, 9, 20, 0.2);
  text-align: center;
  animation: slideUpSheet 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.app-update-card__icon {
  width: 64px;
  height: 64px;
  background: rgba(229, 9, 20, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem auto;
  color: var(--red);
}

.app-update-card h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: #fff;
}

.app-update-card .version-tag {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  margin-bottom: 1rem;
}

.app-update-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0 0 1.5rem 0;
  white-space: pre-line;
  text-align: left;
  background: rgba(255,255,255,0.03);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.06);
}

.app-update-actions {
  display: flex;
  gap: 0.75rem;
}

.app-update-actions .btn {
  flex: 1;
  padding: 0.85rem 1rem;
  font-weight: 600;
  border-radius: 8px;
  font-size: 0.95rem;
  cursor: pointer;
}

