/* ============================================================
   DRAMALUXE — Premium Telegram Mini App Styles
   Modern, luxurious dark theme with gold/amber accents
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  /* Brand colors */
  --brand-gold: #F5A623;
  --brand-gold-rgb: 245, 166, 35;
  --brand-amber: #FFCB6B;
  --brand-dark: #08080E;
  --brand-surface: #0E0E16;
  --brand-surface-2: #14141F;

  /* Source color (overridden per source page) */
  --source-color: #F5A623;
  --source-color-rgb: 245, 166, 35;

  /* Core palette */
  --bg-primary: #08080E;
  --bg-secondary: #0E0E16;
  --bg-card: rgba(255,255,255,0.04);
  --bg-card-hover: rgba(255,255,255,0.08);
  --border-color: rgba(255,255,255,0.06);
  --border-glow: rgba(var(--source-color-rgb), 0.15);
  --text-primary: #F0F0F5;
  --text-secondary: #9CA3AF;
  --text-muted: #5A5F6B;

  /* Radii */
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
  --transition-spring: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  /* Subtitle */
  --vp-subtitle-bottom: 35%;

  /* Telegram theme vars (overridden by telegram.js at runtime) */
  --tg-bg: #08080E;
  --tg-secondary-bg: #0E0E16;
  --tg-text: #F0F0F5;
  --tg-hint: #5A5F6B;
  --tg-button: #F5A623;
  --tg-button-text: #000000;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(var(--source-color-rgb), .3); border-radius: 3px; }

/* ============================================================
   TELEGRAM MINI APP — LANDING PAGE (DRAMALUXE HOME)
   ============================================================ */
.tg-landing {
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(var(--brand-gold-rgb), .06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(139, 92, 246, .04) 0%, transparent 40%),
    linear-gradient(180deg, #0a0a12 0%, var(--bg-primary) 100%);
  display: flex;
  flex-direction: column;
  padding: 0 16px calc(20px + var(--safe-bottom));
  padding-top: calc(12px + var(--safe-top));
  gap: 0;
}

/* ── App Header ─────────────────────────────────────────────── */
.tg-landing-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 20px;
}

.tg-landing-logo {
  width: 54px;
  height: 54px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(var(--brand-gold-rgb), .2) 0%, rgba(var(--brand-gold-rgb), .05) 100%);
  border: 1px solid rgba(var(--brand-gold-rgb), .25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(var(--brand-gold-rgb), .1);
}

.tg-landing-logo svg {
  width: 30px;
  height: 30px;
}

.tg-landing-title-wrap { flex: 1; min-width: 0; }

.tg-landing-app-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #FFCB6B 0%, #F5A623 50%, #E8912D 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.tg-landing-tagline {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
  letter-spacing: 0.3px;
}

/* ── Header Actions (share + reload) ──────────────────────── */
.tg-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.tg-header-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.tg-header-btn:active {
  transform: scale(0.9);
  background: var(--bg-card-hover);
}

.tg-header-btn svg {
  width: 18px;
  height: 18px;
}

/* ── Section Label ──────────────────────────────────────────── */
.tg-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tg-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-color) 0%, transparent 100%);
}

/* ── Source List ────────────────────────────────────────────── */
.tg-source-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tg-source-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.tg-source-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0% 50%, rgba(var(--card-color-rgb, var(--source-color-rgb)), .08) 0%, transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}

.tg-source-card::after {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  background: var(--card-color, var(--source-color));
  border-radius: 0 3px 3px 0;
  opacity: 0.9;
}

.tg-source-card:active {
  transform: scale(0.98);
  background: var(--bg-card-hover);
}

.tg-source-card:active::before { opacity: 1; }

@media (hover: hover) {
  .tg-source-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(var(--card-color-rgb, var(--source-color-rgb)), .2);
    transform: translateX(2px);
  }
  .tg-source-card:hover::before { opacity: 1; }
}

.tg-source-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--card-color-rgb, var(--source-color-rgb)), .1);
  border: 1px solid rgba(var(--card-color-rgb, var(--source-color-rgb)), .15);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.tg-source-icon svg {
  width: 26px;
  height: 26px;
  color: var(--card-color, var(--source-color));
}

.tg-source-info {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.tg-source-name {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.tg-source-desc {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.tg-source-chevron {
  color: var(--text-muted);
  flex-shrink: 0;
  opacity: 0.4;
  position: relative;
  z-index: 1;
}

.tg-source-chevron svg {
  width: 18px;
  height: 18px;
}

/* ── Landing Footer ────────────────────────────────────────── */
.tg-landing-footer {
  margin-top: auto;
  padding-top: 28px;
  text-align: center;
}

.tg-landing-footer .footer-brand {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 700;
  background: linear-gradient(135deg, #FFCB6B, #F5A623);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 4px;
}

.tg-landing-footer .footer-legal {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.6;
  line-height: 1.6;
}

.tg-landing-footer .footer-handle {
  font-size: 11px;
  color: rgba(var(--brand-gold-rgb), .5);
  margin-top: 2px;
  display: block;
}

/* ============================================================
   SOURCE HEADER — Redesigned for Telegram Mini App
   ============================================================ */
.source-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 8, 14, .95);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border-color);
  padding: 0 14px;
  padding-top: var(--safe-top);
}

/* Back button — always hidden, using Telegram BackButton */
.back-btn {
  display: none !important;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px 0 12px;
}

.header-top-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.header-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(var(--source-color-rgb), .1);
  border: 1px solid rgba(var(--source-color-rgb), .15);
  flex-shrink: 0;
}

.header-icon svg {
  width: 20px;
  height: 20px;
  color: var(--source-color);
}

.header-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Header action buttons (share + reload) */
.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.header-action-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.header-action-btn:active {
  transform: scale(0.88);
  background: rgba(var(--source-color-rgb), .1);
  color: var(--source-color);
}

.header-action-btn svg {
  width: 16px;
  height: 16px;
}

/* Search bar */
.header-search {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 16px;
  height: 16px;
}

.search-input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 11px 14px 11px 42px;
  border-radius: var(--radius-md);
  font-size: 16px;
  line-height: 1.2;
  outline: none;
  transition: var(--transition);
  touch-action: manipulation;
}

.search-input::placeholder { color: var(--text-muted); font-size: 14px; }

.search-input:focus {
  border-color: rgba(var(--source-color-rgb), .4);
  background: rgba(var(--source-color-rgb), .04);
  box-shadow: 0 0 0 3px rgba(var(--source-color-rgb), .08);
}

/* ============================================================
   TAB NAVIGATION
   ============================================================ */
.tab-nav {
  padding: 0 14px;
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none;
  background: rgba(8, 8, 14, .6);
}

.tab-nav::-webkit-scrollbar { display: none; }

.tab-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  position: relative;
  bottom: -1px;
  -webkit-tap-highlight-color: transparent;
}

.tab-btn:active { opacity: 0.7; }
.tab-btn.active {
  color: var(--source-color);
  border-bottom-color: var(--source-color);
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  padding: 14px 12px calc(80px + var(--safe-bottom));
}

/* ============================================================
   DRAMA GRID
   ============================================================ */
.drama-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (min-width: 400px) { .drama-grid { gap: 10px; } }
@media (min-width: 480px) { .drama-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; } }
@media (min-width: 600px) { .drama-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 768px) { .drama-grid { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
@media (min-width: 1024px) { .drama-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1280px) { .drama-grid { grid-template-columns: repeat(6, 1fr); } }

/* ============================================================
   DRAMA CARD — Compact, elegant
   ============================================================ */
.drama-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  -webkit-tap-highlight-color: transparent;
}

.drama-card:active { transform: scale(.97); }

@media (hover: hover) {
  .drama-card:hover {
    transform: translateY(-3px);
    background: var(--bg-card-hover);
    border-color: rgba(var(--source-color-rgb), .25);
    box-shadow: 0 8px 24px rgba(0,0,0,.4), 0 0 0 1px rgba(var(--source-color-rgb), .1);
  }
  .drama-card:hover .card-thumb img { transform: scale(1.05); }
}

.card-thumb {
  position: relative;
  aspect-ratio: 3/4;
  overflow: hidden;
  background: #111118;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}

.card-eps {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  letter-spacing: 0.2px;
}

.card-hot {
  position: absolute;
  top: 6px;
  left: 6px;
  background: linear-gradient(135deg, #EF4444, #F97316);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
}

.card-info {
  padding: 8px 8px 10px;
}

.card-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.tag {
  background: rgba(var(--source-color-rgb), .1);
  color: var(--source-color);
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(var(--source-color-rgb), .12);
}

/* ── Play overlay ─────────────────────────────────────────── */
.card-play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s ease;
  pointer-events: none;
}

.card-play-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(var(--source-color-rgb), 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
}

@media (hover: hover) {
  .drama-card:hover .card-play-overlay { background: rgba(0,0,0,0.35); }
  .drama-card:hover .card-play-icon { opacity: 1; transform: scale(1); }
}

.drama-card:active .card-play-overlay { background: rgba(0,0,0,0.45); }
.drama-card:active .card-play-icon { opacity: 1; transform: scale(1); }

/* ── Loading overlay ──────────────────────────────────────── */
.card-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  z-index: 5;
}

.card-loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid rgba(255,255,255,0.15);
  border-top-color: var(--source-color);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

.drama-card.card-loading .card-loading-overlay { display: flex; }
.drama-card.card-loading { pointer-events: none; }

/* ── Locked card ──────────────────────────────────────────── */
.drama-card-locked {
  cursor: not-allowed !important;
  border-color: rgba(239,68,68,.25);
  background: rgba(239,68,68,.04);
}
.drama-card-locked .card-thumb img { filter: grayscale(.25) brightness(.65); }
.drama-card-locked .card-play-overlay { background: rgba(0,0,0,.55); }
.drama-card-locked .card-play-icon { opacity: 0 !important; transform: scale(.7) !important; }
.drama-card-locked .card-info { opacity: .9; }

.card-lock-badge {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 6;
  background: rgba(15,15,25,.9);
  border: 1px solid rgba(239,68,68,.45);
  color: #fecaca;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 6px;
  border-radius: var(--radius-full);
  backdrop-filter: blur(4px);
}

/* ============================================================
   SKELETON LOADING
   ============================================================ */
.skeleton-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.skeleton-img {
  aspect-ratio: 3/4;
  background: linear-gradient(90deg, #111118 25%, #1a1a28 50%, #111118 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

.skeleton-line {
  height: 10px;
  border-radius: 5px;
  background: linear-gradient(90deg, #111118 25%, #1a1a28 50%, #111118 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  margin: 8px 8px 0;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ============================================================
   EMPTY / ERROR STATE
   ============================================================ */
.empty-state, .error-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon,
.error-state .error-icon {
  font-size: 44px;
  margin-bottom: 14px;
  display: block;
}

.empty-state p, .error-state p { font-size: 14px; }

.retry-btn {
  background: rgba(var(--source-color-rgb), .12);
  border: 1px solid rgba(var(--source-color-rgb), .25);
  color: var(--source-color);
  padding: 10px 24px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
  margin-top: 14px;
}

/* ============================================================
   LOAD MORE / INFINITE SCROLL
   ============================================================ */
.load-more-container { text-align: center; margin-top: 24px; }

.load-more-btn {
  background: rgba(var(--source-color-rgb), .08);
  border: 1px solid rgba(var(--source-color-rgb), .2);
  color: var(--source-color);
  padding: 12px 36px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.load-more-btn:hover { background: rgba(var(--source-color-rgb), .15); }
.load-more-btn:disabled { opacity: .5; cursor: not-allowed; }

.scroll-sentinel { height: 1px; margin-top: 20px; }

.loading-more {
  grid-column: 1/-1;
  text-align: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.loading-more::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(var(--source-color-rgb), .2);
  border-top-color: var(--source-color);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   DETAIL MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity .3s ease;
}

.modal-overlay.show { opacity: 1; }

.modal-container {
  background: var(--bg-surface-2, #12121C);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  padding-bottom: var(--safe-bottom);
}

.modal-overlay.show .modal-container { transform: translateY(0); }

.modal-handle {
  width: 40px;
  height: 4px;
  background: rgba(255,255,255,.12);
  border-radius: 2px;
  margin: 12px auto 0;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  z-index: 10;
}

.modal-close:hover { background: rgba(239,68,68,.15); color: #ef4444; }

.modal-content { padding: 16px 16px 24px; }

.modal-hero { display: flex; gap: 16px; margin-bottom: 20px; }

.modal-thumb {
  width: 110px;
  min-width: 110px;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.modal-info { flex: 1; min-width: 0; }

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 8px;
}

.modal-status {
  display: inline-block;
  background: rgba(var(--source-color-rgb), .12);
  color: var(--source-color);
  border: 1px solid rgba(var(--source-color-rgb), .2);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-right: 6px;
  margin-bottom: 6px;
}

.modal-eps-count {
  display: inline-block;
  background: rgba(255,255,255,.05);
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.modal-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }

.modal-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.modal-episodes { border-top: 1px solid var(--border-color); padding-top: 18px; }

.episodes-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 7px;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 2px;
}

.ep-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 9px 4px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: var(--transition);
  text-align: center;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ep-btn:hover, .ep-btn.active {
  background: rgba(var(--source-color-rgb), .12);
  border-color: rgba(var(--source-color-rgb), .3);
  color: var(--source-color);
}

.ep-btn-locked, .ep-btn[disabled] {
  background: rgba(239,68,68,.06) !important;
  border-color: rgba(239,68,68,.3) !important;
  color: #fca5a5 !important;
  cursor: not-allowed !important;
  opacity: .78;
}

.ep-btn-locked:hover, .ep-btn[disabled]:hover,
.ep-btn-locked:active, .ep-btn[disabled]:active {
  transform: none !important;
}

/* ============================================================
   VIDEO PLAYER — REDESIGNED (Modern Streaming UI)
   ============================================================ */

/* ── Base overlay ─────────────────────────────────────────── */
.vp-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: #000 !important;
  z-index: 2000;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}

.vp-overlay.show { transform: translateY(0); }

.vp-touch-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: transparent;
  pointer-events: auto;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── Video fills entire overlay ───────────────────────────── */
#vp-video {
  position: absolute;
  top: 0; left: 0;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain;
  background: #000;
  z-index: 1;
  display: block;
}

/* ── Subtitle overlay ─────────────────────────────────────── */
.vp-subtitle-overlay {
  position: absolute;
  bottom: var(--vp-subtitle-bottom, 35%);
  left: 0;
  right: 0;
  text-align: center;
  padding: 0 16px;
  pointer-events: none;
  z-index: 8;
}

.vp-subtitle-overlay span {
  background: rgba(0,0,0,.65);
  color: #ffffff;
  font-family: 'Inter', 'Roboto', 'Noto Sans', sans-serif;
  font-size: clamp(14px, 2.8vw, 20px);
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 4px;
  line-height: 1.5;
  display: inline-block;
  max-width: min(94vw, 1050px);
  letter-spacing: 0.02em;
  word-break: break-word;
  text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 0 1px rgba(0,0,0,.8);
}

/* ── Loading spinner ──────────────────────────────────────── */
.vp-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,.35);
  z-index: 15;
}

.vp-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255,255,255,.15);
  border-top-color: var(--source-color);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

/* ── Controls auto-hide ───────────────────────────────────── */
.vp-top-overlay,
.vp-center-controls,
.vp-bottom-overlay {
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.vp-right-panel {
  opacity: 1;
  pointer-events: auto;
}

.vp-overlay.controls-visible .vp-top-overlay,
.vp-overlay.controls-visible .vp-center-controls,
.vp-overlay.controls-visible .vp-bottom-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* ── Center controls ──────────────────────────────────────── */
.vp-center-controls {
  position: absolute;
  top: 50%;
  left: 0; right: 0;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 36px;
}

/* ── Top overlay ──────────────────────────────────────────── */
.vp-top-overlay {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 20;
  padding: 14px 14px 40px;
  padding-top: calc(14px + var(--safe-top));
  background: linear-gradient(to bottom, rgba(0,0,0,.85) 0%, transparent 100%);
  display: flex;
  align-items: center;
  gap: 10px;
}

.vp-back-btn {
  background: rgba(255,255,255,.1);
  border: none;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s;
  -webkit-tap-highlight-color: transparent;
}

.vp-back-btn:active { background: rgba(255,255,255,.2); }

/* Telegram: hide internal back button */
body.tg-app .vp-back-btn { display: none !important; }

.vp-header-info { flex: 1; min-width: 0; }

.vp-drama-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  text-shadow: 0 1px 4px rgba(0,0,0,.8);
}

.vp-ep-title {
  font-size: 12px;
  color: rgba(255,255,255,.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  margin-top: 2px;
}

/* ── Right panel: hidden ──────────────────────────────────── */
.vp-right-panel { display: none !important; }

/* ── Bottom overlay ───────────────────────────────────────── */
.vp-bottom-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 20;
  padding: 24px 14px 8px;
  padding-bottom: calc(8px + var(--safe-bottom));
  background: linear-gradient(to top, rgba(0,0,0,.95) 0%, rgba(0,0,0,.6) 60%, transparent 100%);
}

.vp-seek-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.vp-time-cur, .vp-time-dur {
  font-size: 12px;
  color: rgba(255,255,255,.9);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  min-width: 36px;
}

.vp-time-dur { text-align: right; }

.vp-progress-bar-wrap {
  flex: 1;
  position: relative;
  height: 20px;
  display: flex;
  align-items: center;
}

.vp-progress-bar {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: rgba(255,255,255,.2);
  border-radius: 2px;
  overflow: hidden;
  pointer-events: none;
}

.vp-progress-buffered {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: rgba(255,255,255,.3);
  border-radius: 2px;
  width: 0%;
  transition: width .3s linear;
}

.vp-progress-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  background: var(--source-color);
  border-radius: 2px;
  width: 0%;
  transition: width .1s linear;
}

.vp-seek {
  position: absolute;
  left: 0; right: 0;
  width: 100%;
  height: 20px;
  opacity: 0;
  cursor: pointer;
  margin: 0;
  z-index: 2;
  -webkit-appearance: none;
}

/* ── Controls row ─────────────────────────────────────────── */
.vp-ctrl-row {
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 8px !important;
  padding: 4px 0 2px !important;
}

.vp-time-display {
  display: flex;
  align-items: center;
  gap: 2px;
  font-size: 12px;
  color: rgba(255,255,255,.9);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  text-shadow: 0 1px 3px rgba(0,0,0,.8);
  margin-right: 4px;
}

.vp-time-sep { color: rgba(255,255,255,.5); font-weight: 400; }
.vp-ctrl-spacer { flex: 1; min-width: 0; }

.vp-bottom-btn {
  background: none;
  border: none;
  color: rgba(255,255,255,.9);
  width: 42px;
  height: 42px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s, transform .15s, color .15s;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.vp-bottom-btn svg { width: 22px; height: 22px; }
.vp-bottom-btn:active { background: rgba(255,255,255,.12); transform: scale(.88); }
.vp-bottom-btn:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── Ctrl buttons ─────────────────────────────────────────── */
.vp-ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  transition: transform .15s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
  padding: 4px;
}

.vp-ctrl-btn:active { transform: scale(.88); opacity: .7; }

.vp-rewind-btn, .vp-forward-btn { position: relative; }

.vp-seek-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  line-height: 1;
  margin-top: 1px;
}

.vp-play-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(var(--source-color-rgb), .85);
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .15s;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 4px 20px rgba(var(--source-color-rgb), .4);
}

.vp-play-btn:active {
  background: rgba(var(--source-color-rgb), 1);
  transform: scale(.92);
}

/* ── Settings popup ───────────────────────────────────────── */
.vp-settings-popup {
  position: absolute;
  right: 10px;
  bottom: 80px;
  z-index: 30;
  background: rgba(12,12,22,.97);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 16px;
  padding: 16px 14px;
  min-width: 200px;
  max-width: 260px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(.96);
  transition: opacity .2s ease, transform .2s ease;
  box-shadow: 0 12px 40px rgba(0,0,0,.7);
}

.vp-settings-popup.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.vp-settings-section { margin-bottom: 4px; }
.vp-settings-section:last-child { margin-bottom: 0; }

.vp-settings-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,.5);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 8px;
}

.vp-settings-sep {
  height: 1px;
  background: rgba(255,255,255,.06);
  margin: 10px 0;
}

.vp-speed-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.vp-speed-opt {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.06);
  color: rgba(255,255,255,.85);
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transition: background .15s, color .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent;
}

.vp-speed-opt:active, .vp-speed-opt.active {
  background: rgba(var(--source-color-rgb), .2);
  border-color: rgba(var(--source-color-rgb), .4);
  color: var(--source-color);
}

#vp-ep-list-btn {
  pointer-events: auto !important;
  position: relative;
  z-index: 100;
}

/* ── Episode panel ────────────────────────────────────────── */
.vp-ep-panel {
  display: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  pointer-events: auto !important;
  background: var(--bg-surface-2, #12121C);
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255,255,255,.08);
  max-height: 55vh;
  flex-direction: column;
  padding-bottom: var(--safe-bottom);
}

.vp-ep-panel.open {
  display: flex;
  animation: ep-slide-up .3s cubic-bezier(.4,0,.2,1) both;
  pointer-events: auto !important;
}

@keyframes ep-slide-up {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.vp-ep-panel-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  flex-shrink: 0;
}

.vp-ep-panel-hdr span:first-child {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
}

.vp-ep-count {
  font-size: 12px;
  color: rgba(255,255,255,.5);
}

.vp-ep-panel-close {
  background: rgba(255,255,255,.08);
  border: none;
  color: rgba(255,255,255,.7);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s;
  -webkit-tap-highlight-color: transparent;
}

.vp-ep-panel-close:active { background: rgba(239,68,68,.25); color: #ef4444; }

.vp-episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 7px;
  padding: 12px 14px;
  overflow-y: auto;
  flex: 1;
}

.vp-ep-btn {
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.08);
  color: rgba(255,255,255,.75);
  padding: 10px 4px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: background .15s, border-color .15s, color .15s;
  text-align: center;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.vp-ep-btn:active { transform: scale(.93); }

.vp-ep-btn.active {
  background: rgba(var(--source-color-rgb), .18);
  border-color: rgba(var(--source-color-rgb), .45);
  color: var(--source-color);
  box-shadow: 0 0 0 1px rgba(var(--source-color-rgb), .2);
}

.vp-ep-btn-locked, .vp-ep-btn[disabled] {
  background: rgba(239,68,68,.08) !important;
  border-color: rgba(239,68,68,.3) !important;
  color: #fca5a5 !important;
  cursor: not-allowed !important;
  opacity: .82;
  box-shadow: none !important;
}

.vp-ep-btn-locked:active, .vp-ep-btn[disabled]:active {
  transform: none !important;
}

/* ── Double-tap seek feedback ─────────────────────────────── */
.vp-dtap-feedback {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s ease;
}

.vp-dtap-feedback.active { opacity: 1; }
.vp-dtap-left  { left: 10px; }
.vp-dtap-right { right: 10px; }

.vp-dtap-feedback span {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,.9);
}

.vp-dtap-ripple {
  position: absolute;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  transform: scale(0);
  animation: none;
}

.vp-dtap-feedback.active .vp-dtap-ripple {
  animation: dtap-ripple .6s ease-out forwards;
}

@keyframes dtap-ripple {
  0%   { transform: scale(0); opacity: .6; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ── Player bar (resolution + subtitle) ───────────────────── */
.vp-player-bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  z-index: 22;
  background: rgba(8,8,14,.97);
  border-top: 1px solid rgba(255,255,255,.06);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.vp-bar-item {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

.vp-bar-svg {
  color: var(--source-color);
  flex-shrink: 0;
  opacity: 0.9;
}

.vp-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.vp-bar-sep {
  width: 1px;
  height: 28px;
  background: rgba(255,255,255,.08);
  flex-shrink: 0;
}

.vp-select-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.vp-select {
  width: 100%;
  background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1);
  color: #fff;
  padding: 8px 28px 8px 10px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: background .2s, border-color .2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  touch-action: manipulation;
}

.vp-select:focus {
  border-color: rgba(var(--source-color-rgb), .4);
  background: rgba(var(--source-color-rgb), .08);
  box-shadow: 0 0 0 2px rgba(var(--source-color-rgb), .1);
}

.vp-select:disabled { opacity: 0.5; cursor: not-allowed; }

.vp-select option {
  background: #12121C;
  color: #fff;
  font-weight: 500;
}

.vp-select-wrap::after {
  content: '';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgba(255,255,255,.4);
  pointer-events: none;
}

.vp-resolution-bar, .vp-subtitle-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1;
  min-width: 0;
}

/* ── Autoplay overlay ─────────────────────────────────────── */
.vp-autoplay-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  z-index: 7;
}

.vp-autoplay-overlay p {
  font-size: 14px;
  color: rgba(255,255,255,.8);
  text-align: center;
}

.vp-autoplay-countdown {
  font-size: 36px;
  font-weight: 800;
  color: var(--source-color);
}

.vp-autoplay-btn {
  background: var(--source-color);
  border: none;
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}

.vp-autoplay-cancel {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.7);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
}

/* ============================================================
   TOAST NOTIFICATION
   ============================================================ */
.toast-notification {
  position: fixed;
  bottom: calc(24px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(14, 14, 22, .95);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 11px 22px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  z-index: 9999;
  opacity: 0;
  transition: all .3s ease;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  max-width: calc(100vw - 40px);
  text-align: center;
  backdrop-filter: blur(12px);
}

.toast-notification.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast-notification.toast-error {
  border-color: rgba(239,68,68,.3);
  background: rgba(239,68,68,.1);
  color: #fca5a5;
}

.toast-notification.toast-success {
  border-color: rgba(16,185,129,.3);
  background: rgba(16,185,129,.1);
  color: #6ee7b7;
}

/* ============================================================
   CSS FULLSCREEN (Telegram mini-app)
   ============================================================ */
.vp-overlay.vp-css-fullscreen {
  position: fixed !important;
  top: 0 !important; left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  height: 100dvh !important;
  z-index: 99999 !important;
  background: #000 !important;
  display: flex !important;
  flex-direction: column !important;
  overflow: visible !important;
}

.vp-overlay.vp-css-fullscreen .vp-video-section {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  position: relative !important;
}

.vp-overlay.vp-css-fullscreen .vp-video-wrap {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important;
  width: auto !important; height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.vp-overlay.vp-css-fullscreen #vp-video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
}

.vp-overlay.vp-css-fullscreen .vp-episodes-section,
.vp-overlay.vp-css-fullscreen .vp-player-bar {
  display: none !important;
}

.vp-overlay.vp-css-fullscreen .vp-header {
  flex-shrink: 0 !important;
  padding-top: calc(8px + var(--safe-top));
  padding-bottom: 8px;
}

/* Native fullscreen */
#vp-overlay:fullscreen,
#vp-overlay:-webkit-full-screen {
  display: flex !important;
  flex-direction: column !important;
  background: #000 !important;
  overflow: hidden !important;
}

#vp-overlay:fullscreen .vp-video-section,
#vp-overlay:-webkit-full-screen .vp-video-section {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  position: relative !important;
}

#vp-overlay:fullscreen .vp-video-wrap,
#vp-overlay:-webkit-full-screen .vp-video-wrap {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  right: 0 !important; bottom: 0 !important;
  width: auto !important; height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#vp-overlay:fullscreen #vp-video,
#vp-overlay:-webkit-full-screen #vp-video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
}

#vp-overlay:fullscreen .vp-episodes-section,
#vp-overlay:-webkit-full-screen .vp-episodes-section,
#vp-overlay:fullscreen .vp-player-bar,
#vp-overlay:-webkit-full-screen .vp-player-bar {
  display: none !important;
}

/* Legacy fullscreen compat */
.vp-video-wrap:fullscreen,
.vp-video-wrap:-webkit-full-screen {
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vp-video-wrap:fullscreen #vp-video,
.vp-video-wrap:-webkit-full-screen #vp-video {
  max-height: 100vh;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Bottom control buttons: always interactive */
.vp-ctrl-row .vp-bottom-btn {
  pointer-events: auto !important;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (min-width: 600px) {
  .modal-container {
    border-radius: var(--radius-xl);
    margin: auto;
    max-height: 85vh;
  }
  .modal-overlay { align-items: center; }
  .modal-overlay .modal-container { transform: translateY(20px) scale(.97); }
  .modal-overlay.show .modal-container { transform: translateY(0) scale(1); }
}

@media (min-width: 768px) {
  .main-content { padding: 20px 20px 80px; }
  .drama-grid { gap: 12px; }
  .card-title { font-size: 12px; }
  .card-eps { font-size: 10px; }
}

/* ============================================================
   POWERED BY FOOTER (Source Pages)
   ============================================================ */
.source-footer {
  text-align: center;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  margin-top: 0;
}

.source-footer .footer-brand {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 700;
  background: linear-gradient(135deg, #FFCB6B, #F5A623);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
  margin-bottom: 2px;
}

.source-footer .footer-legal {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.5;
}

/* ── Unmute Overlay (shown when video plays muted after ad gate) ── */
.vp-unmute-overlay {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  animation: vp-unmute-slide-in 0.3s ease-out;
}

.vp-unmute-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  transition: all 0.2s ease;
}

.vp-unmute-btn:active {
  transform: scale(0.95);
  background: rgba(245, 166, 35, 0.3);
}

.vp-unmute-btn svg {
  flex-shrink: 0;
  opacity: 0.9;
}

.vp-unmute-hiding {
  animation: vp-unmute-slide-out 0.3s ease-in forwards;
}

@keyframes vp-unmute-slide-in {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes vp-unmute-slide-out {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ── Play Overlay Prompt (last resort when autoplay completely blocked) ── */
.vp-play-overlay-prompt {
  position: absolute;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: vp-play-prompt-fade-in 0.3s ease-out;
}

.vp-play-prompt-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 40px;
  background: rgba(0, 0, 0, 0.7);
  border: 2px solid rgba(245, 166, 35, 0.4);
  border-radius: 20px;
  color: #fff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.vp-play-prompt-btn:active {
  transform: scale(0.95);
  border-color: rgba(245, 166, 35, 0.8);
  background: rgba(245, 166, 35, 0.15);
}

.vp-play-prompt-btn svg {
  color: var(--brand-gold, #F5A623);
}

.vp-play-prompt-btn span {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}

@keyframes vp-play-prompt-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
