:root {
  --bg: #0a0a0c;
  --bg-elevated: #141418;
  --surface: #1a1a22;
  --surface-hover: #22222c;
  --text: #f4f4f5;
  --muted: #9ca3af;
  --accent: #22c55e;
  --accent-glow: rgba(34, 197, 94, 0.35);
  --brand: #facc15;
  --danger: #f87171;
  --border: #2e2e38;
  --shadow: rgba(0, 0, 0, 0.55);
  --radius: 12px;
  --font: "Vazirmatn", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --content-max: min(96vw, 1920px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 12, 0.88);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
}

.topbar-inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0.85rem clamp(0.75rem, 1.5vw, 1.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.brand-mark {
  color: var(--brand);
  font-size: 1.1rem;
}

a.brand {
  color: inherit;
  text-decoration: none;
}

a.brand:hover {
  color: var(--brand);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.9rem;
}

.topnav a {
  color: var(--muted);
  text-decoration: none;
}

.topnav a:hover {
  color: var(--text);
}

.sep {
  color: var(--muted);
  margin: 0 0.35rem;
}

.wrap {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 1.15rem clamp(0.75rem, 1.5vw, 1.5rem) 2.5rem;
}

.detail-page.wrap {
  padding-left: clamp(0.75rem, 1.5vw, 1.5rem);
  padding-right: clamp(0.75rem, 1.5vw, 1.5rem);
}

.section-head h1 {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
}

.muted {
  color: var(--muted);
  margin: 0;
}

.error {
  color: var(--danger);
  font-weight: 600;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (min-width: 1200px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
    gap: 1.1rem;
  }
}

@media (min-width: 1600px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.15rem;
  }
}

@media (min-width: 1920px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}

.card {
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 12px 24px var(--shadow);
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: #333;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  text-decoration: none;
}

.poster {
  aspect-ratio: 2 / 3;
  background: #0b0b0b;
  overflow: hidden;
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-ph {
  display: none;
  width: 100%;
  height: 100%;
  background: linear-gradient(145deg, #2a2a2a, #111);
}

.poster.no-poster .poster-ph,
.detail-poster.no-poster .poster-ph,
.metro-poster.no-poster .metro-poster-ph {
  display: block;
}

.metro-poster .metro-poster-ph {
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.metro-poster:not(.no-poster) .metro-poster-ph {
  display: none;
}

.card-meta {
  padding: 0.65rem 0.75rem 0.85rem;
}

.card-meta h2 {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 600;
}

.pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: #2f2f2f;
  color: var(--muted);
}

.card-meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.pill-kind {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
}

.pill-dub {
  background: rgba(34, 197, 94, 0.18);
  color: #86efac;
}

.pill-ok {
  background: rgba(34, 197, 94, 0.22);
  color: #bbf7d0;
}

.pill-pending {
  background: rgba(234, 179, 8, 0.2);
  color: #fde68a;
}

.pill-year {
  background: #2f2f2f;
  color: var(--muted);
}

.continue-section {
  margin-bottom: 2rem;
}

.section-label-row {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.section-label {
  margin: 0;
  font-size: 1.2rem;
  color: var(--brand);
}

.continue-track {
  display: flex;
  gap: 0.85rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scroll-snap-type: x proximity;
}

.continue-card {
  flex: 0 0 150px;
  scroll-snap-align: start;
  position: relative;
}

.continue-remove-btn,
.favorite-remove-btn {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 3;
  width: 1.65rem;
  height: 1.65rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.85;
}

.continue-remove-btn:hover,
.favorite-remove-btn:hover {
  background: rgba(220, 38, 38, 0.9);
  opacity: 1;
}

.favorites-section {
  margin-bottom: 2rem;
}

.favorite-toggle-btn {
  margin: 0.5rem 0 0.75rem;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.favorite-toggle-btn.is-favorite {
  border-color: rgba(250, 204, 21, 0.55);
  background: rgba(250, 204, 21, 0.12);
  color: var(--brand);
}

.continue-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.continue-poster {
  position: relative;
  aspect-ratio: 2/3;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
}

.continue-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.continue-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  background: var(--brand);
}

.continue-meta h3 {
  margin: 0.45rem 0 0.15rem;
  font-size: 0.82rem;
  line-height: 1.3;
}

.continue-ep {
  margin: 0;
  font-size: 0.75rem;
  color: #fde68a;
}

.search-clear {
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
}

.chip-active {
  background: rgba(34, 197, 94, 0.2) !important;
  border-color: var(--accent) !important;
  color: #fff !important;
}

/* بازگشت به بالای صفحه — گوشه راست پایین */
.scroll-top-btn {
  position: fixed;
  right: 1.15rem;
  bottom: 1.25rem;
  z-index: 50;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(250, 204, 21, 0.45);
  border-radius: 50%;
  background: rgba(26, 26, 34, 0.92);
  color: var(--brand);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 24px var(--shadow);
  backdrop-filter: blur(8px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.15s ease;
}

.scroll-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.scroll-top-btn:hover {
  background: rgba(34, 197, 94, 0.25);
  border-color: var(--accent);
  color: #fff;
}

.scroll-top-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.auth-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1rem;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(250, 204, 21, 0.12), transparent),
    var(--bg);
}

.auth-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.85rem;
  box-shadow: 0 24px 60px var(--shadow);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.35rem;
}

.auth-logo {
  color: var(--brand);
  font-size: 1.4rem;
}

.auth-card h1 {
  margin: 0;
  font-size: 1.5rem;
}

.btn-primary,
.stack button[type="submit"] {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  font-size: 1rem;
}

.btn-primary:hover,
.stack button[type="submit"]:hover {
  filter: brightness(1.06);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.stack label {
  font-size: 0.9rem;
  color: var(--muted);
}

.stack input {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #141414;
  color: var(--text);
}

.stack button {
  margin-top: 0.5rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #041108;
  font-weight: 700;
  cursor: pointer;
}

.stack button:hover {
  filter: brightness(1.08);
}

.detail .facts {
  display: grid;
  grid-template-columns: minmax(0, 160px) 1fr;
  gap: 0.35rem 1rem;
  margin-top: 1rem;
}

.detail dt {
  color: var(--muted);
  font-size: 0.85rem;
}

.detail dd {
  margin: 0;
  word-break: break-word;
}

.detail code {
  font-size: 0.85rem;
  color: #e5e5e5;
}

.manifest {
  margin-top: 2rem;
}

.manifest h2 {
  font-size: 1.1rem;
}

.json {
  background: #141414;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  overflow: auto;
  max-height: 60vh;
  font-size: 0.8rem;
  line-height: 1.45;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #161616;
  color: var(--text);
  font-size: 0.85rem;
}

.chip:hover {
  border-color: #3f3f3f;
}

.chip-active {
  border-color: var(--accent);
  color: #dcfce7;
}

.detail-page .back-row {
  margin: 0 0 1rem;
}

.detail-header {
  margin-bottom: 0.25rem;
}

.detail-title {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  line-height: 1.35;
}

.detail-header .favorite-toggle-btn {
  margin-top: 0;
  margin-bottom: 0.65rem;
}

/* 3-column detail layout: video | story | poster (LTR visual order) */
.detail-layout {
  --detail-poster-w: min(300px, 24vw);
  --detail-poster-h: calc(var(--detail-poster-w) * 3 / 2);
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1.05fr) minmax(200px, var(--detail-poster-w));
  gap: 0.75rem 0.9rem;
  align-items: start;
  direction: ltr;
  margin-top: 0.5rem;
  width: 100%;
  max-width: var(--content-max);
}

@media (min-width: 900px) {
  .detail-layout {
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1.05fr) minmax(200px, var(--detail-poster-w));
    direction: ltr;
  }
}

@media (min-width: 1200px) {
  .detail-layout {
    --detail-poster-w: min(340px, 20vw);
    gap: 1rem 1.15rem;
  }
}

@media (min-width: 1600px) {
  .detail-layout {
    --detail-poster-w: min(380px, 18vw);
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1.1fr) minmax(220px, var(--detail-poster-w));
    gap: 1rem 1.35rem;
  }
}

.detail-col {
  direction: rtl;
  min-width: 0;
}

.detail-section-label {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--brand);
  letter-spacing: 0.01em;
}

.detail-section-label--compact {
  margin-bottom: 0.45rem;
  font-size: 0.82rem;
}

.detail-col--story {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: linear-gradient(165deg, rgba(26, 26, 34, 0.95), rgba(14, 14, 18, 0.88));
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  min-height: 100%;
}

.detail-story-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  flex: 1;
}

.detail-plot-wrap {
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(52vh, 480px);
  overflow-y: auto;
  padding-left: 0.15rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(250, 204, 21, 0.35) transparent;
}

.detail-plot-empty {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
}

.detail-banner {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #0a0a0a;
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(34, 197, 94, 0.12);
  aspect-ratio: 2 / 3;
}

.detail-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-banner-ph {
  position: absolute;
  inset: 0;
  display: none;
}

.detail-banner.no-poster .detail-banner-ph {
  display: block;
}

.detail-col--media .player-section {
  margin-top: 0;
}

.media-player-row {
  width: 100%;
}

.media-player-row__main {
  min-width: 0;
  width: 100%;
}

.detail-trailer-block {
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.detail-trailer-block .detail-section-label--compact {
  margin-bottom: 0.4rem;
}

.detail-trailer-resize {
  resize: both;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-width: 100%;
  min-height: clamp(220px, 52vw, 360px);
  max-width: 100%;
  max-height: min(72vh, 560px);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.detail-trailer-resize .trailer-frame {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  min-height: 100%;
  border: 0;
  border-radius: 0;
}

.detail-trailer-resize .trailer-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
}

.trailer-section {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.trailer-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

.trailer-frame iframe,
.trailer-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.trailer-iframe--idle {
  display: none;
}

.trailer-frame.is-playing .trailer-iframe {
  display: block;
  width: 100%;
  height: 100%;
}

.trailer-frame.is-playing .trailer-lazy-play {
  display: none;
}

.trailer-lazy-play,
.trailer-lazy-fallback {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #000;
}

.trailer-lazy-play img,
.trailer-lazy-fallback img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.trailer-lazy-play__icon,
.trailer-lazy-fallback__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  pointer-events: none;
}

.trailer-video {
  max-height: none;
}

/* Mobile/tablet portrait stack — phones only; Fire TV / wide browsers keep 3-col */
@media (max-width: 767px) {
  .detail-layout {
    --detail-poster-w: min(240px, 58vw);
    grid-template-columns: 1fr;
    direction: rtl;
    gap: 1rem;
  }

  .detail-trailer-resize {
    resize: none;
    width: 100%;
    max-height: none;
  }

  .detail-col--poster {
    order: -1;
    max-width: min(240px, 58vw);
    margin: 0 auto;
    width: 100%;
  }

  .detail-col--story {
    order: 0;
  }

  .detail-col--media {
    order: 1;
  }

  .detail-plot-wrap {
    max-height: none;
    flex: none;
  }
}

/* Phone landscape only — not Fire TV (often ~960×480 logical px) */
@media (max-width: 767px) and (max-height: 500px) {
  .detail-layout {
    --detail-poster-w: min(200px, 40vw);
    grid-template-columns: 1fr;
    direction: rtl;
    gap: 0.85rem;
  }

  .detail-col--poster {
    order: -1;
    max-width: min(200px, 40vw);
    margin: 0 auto;
  }

  .detail-col--story {
    order: 0;
  }

  .detail-col--media {
    order: 1;
  }
}

/* Fire TV / STB: remote = coarse pointer + tall viewport — keep 3-column desktop */
@media (pointer: coarse) and (min-height: 501px) {
  :root {
    --content-max: min(98vw, 1920px);
  }

  .detail-layout {
    --detail-poster-w: min(300px, 24vw);
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 1.05fr) minmax(200px, var(--detail-poster-w));
    direction: ltr;
    gap: 0.75rem 0.9rem;
  }

  .detail-trailer-resize {
    resize: both;
    max-height: min(72vh, 560px);
  }

  .detail-col--poster {
    order: unset;
    max-width: none;
    margin: 0;
    width: auto;
  }

  .detail-col--story,
  .detail-col--media {
    order: unset;
  }

  .detail-plot-wrap {
    max-height: min(52vh, 480px);
    flex: 1 1 auto;
  }

  .metro-section {
    --metro-stage-h: 430px;
    --metro-poster-h-center: 400px;
    --metro-poster-h-side: 320px;
  }
}

@media (pointer: coarse) and (min-height: 501px) and (min-width: 1200px) {
  .detail-layout {
    --detail-poster-w: min(340px, 20vw);
    gap: 1rem 1.15rem;
  }

  .metro-section {
    --metro-stage-h: 460px;
    --metro-poster-h-center: 430px;
    --metro-poster-h-side: 340px;
  }
}

@media (max-width: 480px) {
  .detail-layout {
    --detail-poster-w: 180px;
  }

  .detail-col--poster {
    max-width: 180px;
  }
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.badge {
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #161616;
}

.badge-muted {
  color: var(--muted);
}

.detail-plot {
  margin: 0;
  color: #d4d4d4;
  line-height: 1.65;
  font-size: 0.95rem;
}

.section-title {
  margin: 0 0 0.75rem;
  font-size: 1.05rem;
}

.player-section {
  margin-top: 1.25rem;
}

.small-note {
  font-size: 0.85rem;
  margin: 0 0 0.75rem;
}

.detail-video {
  width: 100%;
  max-height: 70vh;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #000;
}

/* --- Premium inline player (detail.html / tg-player) --- */

.player-shell {
  margin-top: 0.25rem;
}

.player-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.85rem;
}

.player-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--text);
  position: relative;
  padding-bottom: 0.35rem;
}

.player-title::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  height: 2px;
  width: min(160px, 46%);
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(34, 197, 94, 0.95), transparent);
  opacity: 0.95;
}

.tg-player .tg-variant-row {
  margin: 0;
  justify-content: flex-end;
}

.player-frame {
  position: relative;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(900px 360px at 50% -20%, rgba(34, 197, 94, 0.16), transparent 55%),
    linear-gradient(165deg, #161616 0%, #070707 100%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 26px 90px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.player-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.media-player-row__main .player-frame:not(.player-frame--empty) {
  min-height: var(--detail-poster-h, clamp(300px, 42vw, 450px));
}

.tg-player .player-frame .detail-video {
  display: block;
  width: 100%;
  height: var(--detail-poster-h, clamp(300px, 42vw, 450px));
  max-height: var(--detail-poster-h, clamp(300px, 42vw, 450px));
  object-fit: contain;
  background: #000;
  border: 0;
  border-radius: 0;
}

.player-frame--empty {
  min-height: clamp(220px, 36vh, 420px);
  display: grid;
  place-items: center;
}

.player-empty-state {
  position: relative;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  padding: 2rem 1rem;
  color: var(--muted);
}

.player-empty-glow {
  width: 76px;
  height: 76px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(34, 197, 94, 0.38), rgba(34, 197, 94, 0.06));
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.22),
    0 18px 60px rgba(0, 0, 0, 0.55);
}

.player-empty-label {
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.tg-player .tg-variant-btn {
  backdrop-filter: blur(10px);
  background: rgba(24, 24, 24, 0.72);
  border-color: rgba(255, 255, 255, 0.14);
}

.tg-player .tg-variant-btn.active {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.55);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.28),
    0 12px 34px rgba(0, 0, 0, 0.38);
}

@media (max-width: 720px) {
  .player-toolbar {
    align-items: flex-start;
  }

  .tg-player .tg-variant-row {
    justify-content: flex-start;
    width: 100%;
  }
}

/* Pause / end overlay on player */
.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(6px);
}

.player-overlay[hidden] {
  display: none !important;
}

.player-overlay-dismiss {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 3;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}

.player-overlay-dismiss:hover {
  background: rgba(220, 38, 38, 0.85);
}

.player-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.player-nav:hover:not(:disabled) {
  background: rgba(34, 197, 94, 0.35);
  border-color: rgba(34, 197, 94, 0.6);
}

.player-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.player-nav--prev {
  right: 0.85rem;
}

.player-nav--next {
  left: 0.85rem;
}

.player-overlay-center-wrap {
  text-align: center;
  max-width: 90%;
}

.player-overlay-center {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  color: #fff;
}

.player-overlay-poster-ring {
  display: block;
  width: clamp(110px, 20vw, 156px);
  height: clamp(110px, 20vw, 156px);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(250, 204, 21, 0.55);
  box-shadow:
    0 0 0 4px rgba(0, 0, 0, 0.35),
    0 16px 48px rgba(0, 0, 0, 0.55);
  position: relative;
  margin: 0 auto;
}

.player-overlay-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.player-overlay-poster-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 30% 30%, rgba(34, 197, 94, 0.45), #1a1a1a);
}

.player-overlay-play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.85);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  padding-left: 0.15rem;
  pointer-events: none;
}

.player-overlay-ep-label {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
  color: #fde68a;
}

.player-overlay.is-ended .player-overlay-ep-label::after {
  content: " — قسمت بعدی؟";
}

.watch-resume-bar {
  z-index: 15;
}


.stream-links {
  margin: 0.75rem 0 0;
  padding: 0 1.25rem 0 0;
  line-height: 1.8;
}

.meta-section {
  margin-top: 2rem;
}

.facts-tight {
  grid-template-columns: minmax(0, 140px) 1fr;
}

.raw-json {
  margin-top: 2rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
  background: #151515;
}

.raw-json summary {
  cursor: pointer;
  color: var(--muted);
}

.tg-variant-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.65rem 0 0.75rem;
}

.tg-variant-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
}

.tg-variant-btn:hover {
  border-color: var(--accent);
  color: #fff;
  background: rgba(34, 197, 94, 0.2);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.tg-variant-btn.active {
  border-color: var(--accent);
  color: #fff;
  background: rgba(34, 197, 94, 0.28);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

.tg-variant-btn.active:hover {
  background: rgba(34, 197, 94, 0.36);
}

/* --- Series accordion stream picker --- */
.series-browser {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
}

.season-acc {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(30, 30, 30, 0.65), rgba(10, 10, 10, 0.55));
  overflow: hidden;
}

.season-acc-sum {
  cursor: pointer;
  font-weight: 650;
  padding: 0.7rem 0.85rem;
  list-style: none;
  color: var(--text);
}

.season-acc-sum::-webkit-details-marker {
  display: none;
}

.season-acc-body {
  padding: 0.35rem 0.65rem 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.ep-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.45rem 0.35rem;
  border-radius: 10px;
  cursor: pointer;
}

.ep-row:hover {
  background: rgba(255, 255, 255, 0.03);
}

.ep-label {
  color: var(--text);
  font-size: 0.92rem;
  cursor: pointer;
  user-select: none;
  transition: color 0.2s ease;
}

/* پیشرفت تماشا: بیش از ~۱۰ دقیقه → زرد؛ تقریباً تمام → سبز کم‌رنگ */
.ep-label.ep-watched-partial {
  color: #facc15;
  font-weight: 600;
}

.ep-label.ep-watched-done {
  color: #86efac;
  font-weight: 600;
}

.watch-resume-bar {
  display: none;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.35);
}
.watch-resume-bar.visible {
  display: flex;
}

.watch-resume-text {
  color: #fde68a;
  font-size: 0.9rem;
  flex: 1 1 auto;
}

.watch-resume-btn {
  padding: 0.35rem 0.85rem;
  border-radius: 8px;
  border: none;
  background: #eab308;
  color: #1c1917;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}

.watch-resume-btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.watch-resume-btn:hover {
  filter: brightness(1.08);
}

.ep-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tg-variant-btn--compact {
  padding: 0.28rem 0.62rem;
  font-size: 0.82rem;
  border-radius: 999px;
}

/* هاور روی متن قسمت → دکمهٔ دوبله مثل انتخاب‌شده */
.ep-row:has(.ep-label:hover) .tg-variant-btn--compact.active,
.ep-row:has(.ep-label:hover):not(:has(.tg-variant-btn--compact.active))
  .tg-variant-btn--compact:first-child {
  border-color: var(--accent);
  color: #fff;
  background: rgba(34, 197, 94, 0.22);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.45);
}

@media (max-width: 720px) {
  .ep-row {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .ep-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

/* --- Prime-style episode grid (series detail) --- */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.episodes-section {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.episodes-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.episodes-section-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.episodes-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.season-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.season-select--native {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.season-dropdown {
  position: relative;
  display: inline-block;
}

.season-dropdown__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.48rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(165deg, rgba(34, 34, 42, 0.98), rgba(18, 18, 24, 0.96));
  color: var(--text);
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  min-width: 8rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.season-dropdown__btn:hover,
.season-dropdown__btn:focus {
  border-color: rgba(34, 197, 94, 0.45);
  outline: none;
}

.season-dropdown__btn[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.season-dropdown__arrow {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1;
}

.season-dropdown__list {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  z-index: 40;
  min-width: 100%;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: linear-gradient(165deg, rgba(28, 28, 36, 0.99), rgba(14, 14, 18, 0.98));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
}

.season-dropdown__item {
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}

.season-dropdown__item:hover,
.season-dropdown__item:focus {
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}

.season-dropdown__item.is-selected {
  background: rgba(34, 197, 94, 0.16);
  color: #ecfdf5;
}

.season-select {
  appearance: none;
  padding: 0.45rem 2rem 0.45rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background:
    linear-gradient(165deg, rgba(30, 30, 36, 0.95), rgba(16, 16, 20, 0.92))
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23aaa' d='M1 1l5 5 5-5'/%3E%3C/svg%3E")
    no-repeat left 0.65rem center;
  color: var(--text);
  color-scheme: dark;
  font: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  min-width: 7.5rem;
}

.season-select option {
  background: #1a1a22;
  color: #f0f0f5;
}

.season-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.episodes-count {
  display: inline-flex;
  align-items: center;
  padding: 0.38rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.88rem;
  white-space: nowrap;
}

.episodes-range-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.85rem;
}

.ep-range-btn {
  padding: 0.32rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(24, 24, 28, 0.85);
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.ep-range-btn:hover {
  border-color: rgba(255, 255, 255, 0.22);
  color: var(--text);
}

.ep-range-btn.active {
  border-color: rgba(34, 197, 94, 0.55);
  color: #fff;
  background: rgba(34, 197, 94, 0.16);
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 0.85rem 0.75rem;
}

@media (min-width: 1100px) {
  .episodes-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }
}

.ep-card {
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: linear-gradient(165deg, rgba(28, 28, 34, 0.92), rgba(12, 12, 16, 0.88));
  overflow: hidden;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    transform 0.18s ease;
}

.ep-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
}

.ep-card--active {
  border-color: rgba(34, 197, 94, 0.65);
  box-shadow:
    0 0 0 1px rgba(34, 197, 94, 0.35),
    0 16px 40px rgba(0, 0, 0, 0.5);
}

.ep-card--out-of-range {
  display: none;
}

.ep-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0a0a0a;
  overflow: hidden;
}

.ep-card-thumb img,
.ep-card-thumb-ph {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ep-card-thumb-ph {
  background:
    radial-gradient(circle at 30% 20%, rgba(34, 197, 94, 0.12), transparent 55%),
    linear-gradient(135deg, #1a1a22, #0a0a0e);
}

.ep-card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.18s ease, background 0.18s ease;
  pointer-events: none;
}

.ep-card:hover .ep-card-play,
.ep-card--active .ep-card-play {
  opacity: 1;
}

.ep-card--active .ep-card-play {
  background: rgba(34, 197, 94, 0.85);
}

.ep-card-progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, #eab308, #facc15);
  transform-origin: right center;
  pointer-events: none;
}

.ep-card-body {
  padding: 0.65rem 0.75rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-height: 4.5rem;
}

.ep-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-card-title.ep-watched-partial,
.ep-card.ep-card--partial .ep-card-title {
  color: #facc15;
}

.ep-card-title.ep-watched-done,
.ep-card.ep-card--done .ep-card-title {
  color: #86efac;
}

.ep-card-desc {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ep-card-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.15rem;
}

.ep-card-variant {
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
}

@media (max-width: 720px) {
  .episodes-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .episodes-grid {
    grid-template-columns: 1fr;
  }
}

/* Series player: leave room for top bar when scrolling from episode buttons */
#series-player-anchor {
  scroll-margin-top: 5.5rem;
}

/* --- Catalog search + pagination (RTL) --- */
.catalog-search-row {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 1.15rem;
}

.search-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: stretch;
  margin: 0.85rem 0 0.65rem;
}

.search-bar--compact {
  margin: 0;
  gap: 0.4rem;
  max-width: 420px;
  flex: 0 1 420px;
}

.search-input {
  flex: 1 1 200px;
  min-width: 0;
  padding: 0.55rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

.search-bar--compact .search-input {
  flex: 1 1 160px;
  padding: 0.38rem 0.65rem;
  border-radius: 8px;
  font-size: 0.84rem;
  background: rgba(26, 26, 34, 0.92);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.search-btn {
  flex: 0 0 auto;
  padding: 0.55rem 1.1rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.search-bar--compact .search-btn {
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
}

.search-btn:hover {
  background: rgba(34, 197, 94, 0.28);
}

.search-clear--compact {
  padding: 0.38rem 0.6rem;
  border-radius: 8px;
  font-size: 0.8rem;
}

.catalog-pending {
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 1px solid rgba(234, 179, 8, 0.35);
  background: rgba(234, 179, 8, 0.08);
}

.catalog-pending-title {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: #fbbf24;
}

.catalog-stats {
  margin-top: 0.35rem;
  margin-bottom: 0.65rem;
  line-height: 1.5;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}

.page-link {
  display: inline-block;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-weight: 600;
}

.page-link:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.page-link--disabled {
  opacity: 0.38;
  cursor: not-allowed;
  color: var(--muted);
  border-color: var(--border);
}

.page-status {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.95rem;
}

/* --- Homepage metro carousel --- */
.metro-section {
  --metro-stage-h: 410px;
  --metro-poster-h-center: 385px;
  --metro-poster-h-side: 305px;
  margin: 0 0 2rem;
}

.metro-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.metro-head-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  flex: 0 1 auto;
  min-width: 0;
}

.metro-pill {
  display: inline-block;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.55);
  color: var(--accent);
  font-size: 0.88rem;
  font-weight: 650;
}

.metro-sub {
  font-size: 0.88rem;
}

.metro-carousel {
  display: grid;
  grid-template-columns: 2.75rem 1fr 2.75rem;
  align-items: center;
  gap: 0.35rem;
  min-height: var(--metro-stage-h);
}

.metro-viewport {
  grid-column: 2;
  overflow: hidden;
  height: var(--metro-stage-h);
  display: flex;
  align-items: center;
  justify-content: center;
  direction: ltr; /* چیدمان اسلایدر همیشه: چپ | وسط بزرگ | راست */
}

.metro-track {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  height: 100%;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  direction: ltr;
  transition: transform 0.4s ease;
}

.metro-slide {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--metro-stage-h);
  opacity: 0;
  transform: scale(0.78);
  transform-origin: center center;
  transition: opacity 0.35s ease, transform 0.35s ease;
  pointer-events: none;
}

.metro-slide.is-off {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  opacity: 0;
  order: 0;
  pointer-events: none;
}

.metro-slide.is-left {
  order: 1;
  opacity: 0.65;
  transform: scale(0.82);
  pointer-events: auto;
  z-index: 2;
}

.metro-slide.is-right {
  order: 3;
  opacity: 0.65;
  transform: scale(0.82);
  pointer-events: auto;
  z-index: 2;
}

.metro-slide.is-center {
  order: 2;
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  z-index: 4;
}

.metro-slide-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.metro-slide-link:hover {
  text-decoration: none;
}

.metro-poster {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  width: calc(var(--metro-poster-h-side) * 2 / 3);
  height: var(--metro-poster-h-side);
  flex-shrink: 0;
  background: #0a0a0a;
  box-shadow: 0 18px 40px var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.metro-slide.is-center .metro-poster {
  width: min(calc(var(--metro-poster-h-center) * 2 / 3), 75vw);
  height: var(--metro-poster-h-center);
  max-height: calc(var(--metro-stage-h) - 1rem);
}

.metro-slide.is-center .metro-poster {
  border-color: rgba(34, 197, 94, 0.35);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(34, 197, 94, 0.2);
}

.metro-slide.is-left .metro-poster,
.metro-slide.is-right .metro-poster {
  width: calc(var(--metro-poster-h-side) * 2 / 3);
  height: var(--metro-poster-h-side);
}

.metro-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.metro-overlay {
  position: absolute;
  inset: auto 0 0 0;
  padding: 2.5rem 0.85rem 0.85rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.92));
  pointer-events: none;
}

.metro-slide:not(.is-center) .metro-overlay {
  padding: 1.5rem 0.55rem 0.55rem;
}

.metro-slide:not(.is-center) .metro-title {
  font-size: 0.82rem;
}

.metro-slide:not(.is-center) .metro-ep,
.metro-slide:not(.is-center) .metro-year {
  display: none;
}

.metro-tag {
  display: inline-block;
  margin-bottom: 0.35rem;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.metro-tag--update {
  background: rgba(234, 179, 8, 0.9);
  color: #111;
}

.metro-title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.35;
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
}

.metro-ep {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: #d4d4d4;
}

.metro-year {
  display: inline-block;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.metro-nav {
  position: relative;
  z-index: 6;
  justify-self: center;
  align-self: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(6px);
  flex-shrink: 0;
}

.metro-nav:hover {
  border-color: var(--accent);
  background: rgba(34, 197, 94, 0.25);
}

.metro-nav--prev {
  grid-column: 1;
  grid-row: 1;
}

.metro-nav--next {
  grid-column: 3;
  grid-row: 1;
}

.metro-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.metro-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.metro-dot.active {
  background: var(--accent);
  transform: scale(1.2);
}

@media (min-width: 1200px) {
  .metro-section {
    --metro-stage-h: 460px;
    --metro-poster-h-center: 430px;
    --metro-poster-h-side: 340px;
  }

  .metro-track {
    gap: 1.75rem;
  }
}

@media (min-width: 1600px) {
  .metro-section {
    --metro-stage-h: 510px;
    --metro-poster-h-center: 480px;
    --metro-poster-h-side: 380px;
  }

  .metro-track {
    gap: 2rem;
  }
}

@media (max-width: 640px) {
  .metro-section {
    --metro-stage-h: 340px;
    --metro-poster-h-center: 300px;
    --metro-poster-h-side: 230px;
  }

  .metro-carousel {
    grid-template-columns: 2.1rem 1fr 2.1rem;
  }

  .metro-slide.is-left,
  .metro-slide.is-right {
    opacity: 0.45;
  }
}

.topnav-user {
  color: var(--muted, #888);
  font-size: 0.9rem;
  padding: 0 0.35rem;
}

.admin-panel {
  background: var(--surface, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.75rem;
}

.admin-table th,
.admin-table td {
  text-align: right;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.08));
}

.success {
  color: #6ee7a0;
  margin: 0.75rem 0;
}

.admin-delete-form {
  display: inline;
  margin: 0;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.btn-secondary {
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.28);
  color: var(--text, #e2e8f0);
  border-radius: 8px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s ease;
}

.btn-secondary:hover {
  background: rgba(148, 163, 184, 0.22);
}

.admin-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.admin-modal[hidden] {
  display: none;
}

.admin-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.admin-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  background: var(--surface, #1a1a1f);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.08));
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

.admin-modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-start;
  margin-top: 0.5rem;
}

.btn-danger {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fca5a5;
  border-radius: 8px;
  padding: 0.35rem 0.85rem;
  cursor: pointer;
  font-size: 0.875rem;
  transition: background 0.15s ease;
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.28);
}

.btn-sm {
  line-height: 1.2;
}
