/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #141414;
  --bg-card: #202020;
  --bg-elevated: #2b2b2b;
  --text: #f5f5f1;
  --text-muted: #b3b3b3;
  --primary: #e50914;
  --primary-dark: #b20710;
  --border: #333333;
  --shadow: 0 4px 24px rgba(0,0,0,0.45);
  --radius: 16px;
  --nav-height: 68px;
  --header-height: 56px;
  --overlay: rgba(0,0,0,0.72);
}

body.dark {
  --bg: #141414;
  --bg-card: #202020;
  --bg-elevated: #2b2b2b;
  --text: #f0f0f0;
  --text-muted: #a0a0a8;
  --border: #333333;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --overlay: rgba(0,0,0,0.7);
}

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + 12px);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

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

/* ===== Views ===== */
.view { display: none; }
.view.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Top Header ===== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
  padding: 0 10px 0 8px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  transition: box-shadow 0.2s, border-color 0.2s;
}

.top-header.scrolled {
  box-shadow: 0 2px 16px rgba(0,0,0,0.06);
  border-bottom-color: var(--border);
}

body.dark .top-header.scrolled {
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

/* Brand logo button */
.brand-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px 4px 4px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.brand-btn:active {
  transform: scale(0.97);
  background: color-mix(in srgb, var(--text) 5%, transparent);
}

.brand-logo-img {
  display: block;
  width: clamp(112px, 17vw, 158px);
  height: 38px;
  object-fit: contain;
  object-position: left center;
}

.brand-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.05em;
  border-radius: 9px;
  background: linear-gradient(145deg, #e50914, #b20710);
  box-shadow: 0 3px 10px rgba(124, 58, 237, 0.3);
  line-height: 1;
}

.brand-text {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
}

.brand-accent {
  color: var(--primary);
}

.icon-btn {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, transform 0.15s;
  position: relative;
}

.icon-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.icon-btn:active {
  transform: scale(0.92);
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

/* ===== Hero ===== */
.hero-section {
  position: relative;
  margin: 8px 14px 0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}

body.dark .hero-section {
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}

.hero-poster {
  position: relative;
  aspect-ratio: 3 / 4.05;
  max-height: 520px;
  background: #111;
}

.poster-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.poster-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.95) 0%,
    rgba(0,0,0,0.7) 28%,
    rgba(0,0,0,0.25) 55%,
    rgba(0,0,0,0.1) 75%,
    transparent 100%
  );
}

.hero-glow {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 120px;
  background: radial-gradient(ellipse, rgba(124,58,237,0.35) 0%, transparent 70%);
  pointer-events: none;
  z-index: 1;
}

.hero-top-row {
  position: absolute;
  top: 14px;
  left: 14px;
  right: 14px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 3;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags.secondary {
  position: absolute;
  top: 52px;
  left: 14px;
  z-index: 2;
}

.hero-rating-pill {
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 20px;
}

.tag {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 20px;
  letter-spacing: 0.2px;
}

.tag.free {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  box-shadow: 0 2px 8px rgba(34,197,94,0.35);
}
.tag.top {
  background: rgba(255,255,255,0.95);
  color: #1a1a1a;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.tag.outline {
  background: rgba(0,0,0,0.4);
  color: white;
  border: 1px solid rgba(255,255,255,0.35);
  backdrop-filter: blur(6px);
}

.hero-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 26px;
  z-index: 2;
  color: white;
}

.hero-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 6px;
  opacity: 0.95;
}

.hero-title {
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1.22;
  margin-bottom: 8px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  letter-spacing: -0.02em;
}

.hero-title .subtitle {
  font-weight: 600;
  font-size: 1.05rem;
  opacity: 0.9;
}

.hero-desc {
  font-size: 13px;
  line-height: 1.5;
  opacity: 0.88;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.btn-play {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14.5px;
  padding: 12px 22px;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(124, 58, 237, 0.5);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn-play:active {
  transform: scale(0.96);
  background: var(--primary-dark);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.35);
}

.btn-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.18);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.35);
  color: white;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 20px;
  border-radius: 50px;
  transition: transform 0.15s;
}

.btn-detail:active { transform: scale(0.96); }

.carousel-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 3;
}

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: all 0.25s;
}

.dot.active {
  width: 18px;
  border-radius: 10px;
  background: var(--primary);
}

/* ===== Categories ===== */
.categories {
  margin: 18px 0 6px;
  padding: 0 14px;
}

.category-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
}

.category-scroll::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}

.cat-emoji {
  font-size: 14px;
  line-height: 1;
}

.cat-pill:hover {
  border-color: color-mix(in srgb, var(--primary) 40%, var(--border));
  background: color-mix(in srgb, var(--primary) 6%, var(--bg-card));
}

.cat-pill.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

/* ===== Sections & Grid ===== */
.section { margin: 24px 14px 0; }

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 10px;
}

.section-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.section-header h2 {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.section-accent {
  display: block;
  width: 28px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary), #ff4b55);
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.provider-select {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--border);
  color: var(--text-muted);
  flex-shrink: 0;
}

.provider-icon { color: #ff4b55; font-size: 13px; }

.drama-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.drama-card {
  background: var(--bg-card);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: 1px solid var(--border);
}

body.dark .drama-card {
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.drama-card:active {
  transform: scale(0.97);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.card-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #333;
}

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

.drama-card:hover .card-poster img { transform: scale(1.06); }

.badge {
  position: absolute;
  top: 8px;
  left: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  z-index: 2;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

.badge.free {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
}
.badge.hot {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}
.badge.new {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
}

.card-info {
  padding: 11px 12px 13px;
}

.card-info h3 {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

.card-info .meta {
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: color-mix(in srgb, var(--bg-card) 94%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid var(--border);
  z-index: 100;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 6px 8px;
  border-radius: 12px;
  transition: color 0.2s;
  min-width: 58px;
}

.nav-item.active { color: var(--primary); }
.nav-item.active svg { fill: var(--primary); stroke: var(--primary); }

/* ===== Detail Page Header ===== */
.detail-header {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  position: sticky;
  top: var(--header-height);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
  z-index: 50;
  min-height: 52px;
}

.detail-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: none;
  transition: background 0.15s, transform 0.15s;
}

.detail-back-btn:active {
  background: color-mix(in srgb, var(--text) 12%, transparent);
  transform: scale(0.92);
}

.detail-header-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  justify-content: center;
}

.detail-header-title {
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  color: var(--text);
}

.detail-header-sub {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.9;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.detail-header-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  background: transparent;
  border: none;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}

.detail-header-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 6%, transparent);
}

.detail-header-btn:active {
  transform: scale(0.9);
  background: color-mix(in srgb, var(--text) 10%, transparent);
}

.detail-header-btn.saved {
  color: #ef4444;
  background: color-mix(in srgb, #ef4444 10%, transparent);
}

.detail-header-btn.saved .icon-heart-outline { display: none; }
.detail-header-btn.saved .icon-heart-filled { display: block !important; color: #ef4444; }

.back-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text);
}

.back-btn:active { background: color-mix(in srgb, var(--text) 8%, transparent); }

.detail-content {
  padding: 0 0 40px;
}

.detail-page-inner {
  animation: detailFadeIn 0.35s ease;
}

@keyframes detailFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Cinematic detail hero */
.detail-hero {
  position: relative;
  margin-bottom: 4px;
}

.detail-hero-bg {
  position: absolute;
  inset: 0;
  height: 240px;
  overflow: hidden;
}

.detail-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(3px) saturate(1.15) brightness(0.85);
  transform: scale(1.12);
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.35) 0%,
    color-mix(in srgb, var(--bg) 40%, transparent) 45%,
    var(--bg) 100%
  );
}

.detail-hero-shine {
  position: absolute;
  top: -30%;
  left: -20%;
  width: 60%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(124,58,237,0.22) 0%, transparent 70%);
  pointer-events: none;
}

.detail-hero-body {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 16px;
  padding: 36px 16px 10px;
  align-items: flex-end;
}

.detail-poster-card {
  position: relative;
  width: 128px;
  flex-shrink: 0;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 12px 32px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.12);
  background: #222;
}

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

.detail-poster-card .badge {
  top: 8px;
  left: 8px;
  font-size: 10px;
  padding: 4px 8px;
  z-index: 2;
}

.poster-play-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  color: white;
  opacity: 0;
  transition: opacity 0.2s;
}

.detail-poster-card:active .poster-play-hint {
  opacity: 1;
}

.poster-play-hint svg {
  width: 36px;
  height: 36px;
  padding: 8px;
  background: var(--primary);
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(124,58,237,0.5);
}

.detail-hero-info {
  flex: 1;
  min-width: 0;
  padding-bottom: 6px;
}

.detail-kicker {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 6px;
  opacity: 0.95;
}

.detail-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.22;
  letter-spacing: -0.025em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.detail-genres {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.genre-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--primary) 12%, var(--bg-card));
  color: var(--primary);
  border: 1px solid color-mix(in srgb, var(--primary) 25%, var(--border));
}

.detail-body {
  padding: 0 14px;
}

/* Stats bar */
.detail-stats {
  display: flex;
  align-items: center;
  justify-content: space-around;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 8px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: 1;
}

.stat-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.stat-label {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
  flex-shrink: 0;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin: 0 0 16px;
  align-items: center;
}

.detail-actions .btn-primary {
  flex: 1;
  justify-content: center;
}

.detail-play-btn {
  background: linear-gradient(135deg, #e50914 0%, #e50914 50%, #b20710 100%) !important;
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.45) !important;
  padding: 14px 20px !important;
  font-size: 15px !important;
}

.play-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
}

.btn-primary {
  background: var(--primary);
  color: white;
  font-weight: 700;
  font-size: 14.5px;
  padding: 13px 20px;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 4px 16px rgba(124, 58, 237, 0.4);
  transition: transform 0.15s, background 0.15s, box-shadow 0.15s;
}

.btn-primary:active {
  transform: scale(0.97);
  background: var(--primary-dark);
  box-shadow: 0 2px 10px rgba(124, 58, 237, 0.3);
}

.btn-primary.full { width: 100%; justify-content: center; }

.btn-outline {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 600;
  font-size: 13.5px;
  padding: 12px 16px;
  border-radius: 50px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}

.btn-outline:active {
  background: color-mix(in srgb, var(--text) 6%, var(--bg-card));
  transform: scale(0.97);
}

.btn-icon-round {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text);
  transition: transform 0.15s, background 0.15s;
}

.btn-icon-round:active {
  background: color-mix(in srgb, var(--text) 6%, var(--bg-card));
  transform: scale(0.94);
}

.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.detail-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.detail-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 0;
  letter-spacing: -0.015em;
  position: relative;
  padding-left: 12px;
}

.detail-section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--primary), #ff4b55);
}

.ep-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 12%, var(--bg));
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
}

.detail-desc {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 0;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 8px;
}

.ep-btn {
  aspect-ratio: 1;
  min-height: 46px;
  border-radius: 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  position: relative;
  overflow: hidden;
}

.ep-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.08));
  pointer-events: none;
}

.ep-num {
  position: relative;
  z-index: 1;
}

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

.ep-btn:hover, .ep-btn.active {
  background: linear-gradient(135deg, #e50914, #b20710);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.35);
}

.ep-more-hint {
  margin-top: 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.detail-recommend .drama-grid {
  margin-top: 2px;
}

/* ===== Search ===== */
.search-page { padding: 10px 14px 20px; }

.search-bar-wrap { margin-bottom: 20px; }

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
}

.search-bar input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  color: var(--text);
  outline: none;
}

.search-bar input::placeholder { color: var(--text-muted); }

.clear-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--text-muted);
  color: var(--bg);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-suggestions h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-muted);
}

.suggestion-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sugg-tag {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.results-count {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ===== Watchlist / Empty ===== */
.page-header {
  padding: 12px 14px 8px;
}

.page-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
}

.empty-state {
  text-align: center;
  padding: 60px 30px;
}

.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state h3 { font-size: 1.15rem; margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }

/* ===== Providers ===== */
.provider-list { padding: 8px 14px 20px; display: flex; flex-direction: column; gap: 12px; }

.provider-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.provider-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: white;
  flex-shrink: 0;
}

.provider-info { flex: 1; }
.provider-info h3 { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.provider-info p { font-size: 12.5px; color: var(--text-muted); }

.provider-badge {
  font-size: 11px;
  font-weight: 600;
  background: var(--primary);
  color: white;
  padding: 4px 10px;
  border-radius: 8px;
}

/* ===== About ===== */
.about-page {
  padding: 12px 14px 40px;
  max-width: 560px;
  margin: 0 auto;
}

/* Hero with gradient */
.about-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 16px;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.about-hero-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #e50914 0%, #ff4b55 40%, #e50914 70%, #b20710 100%);
}

body.dark .about-hero-bg {
  background: linear-gradient(135deg, #b20710 0%, #e50914 45%, #ff4b55 100%);
}

.about-hero-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(0,0,0,0.12) 0%, transparent 45%);
}

.about-hero-content {
  position: relative;
  z-index: 1;
  padding: 32px 20px 28px;
  color: #fff;
}

.about-logo-wrap {
  width: clamp(210px, 48vw, 270px);
  height: clamp(82px, 19vw, 104px);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  padding: 8px 12px;
  box-sizing: border-box;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(8, 8, 12, 0.96), rgba(28, 8, 12, 0.92));
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28), 0 0 18px rgba(229, 9, 20, 0.22);
}

.about-logo-img {
  display: block;
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.35));
}

.about-hero h1 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.03em;
  text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.about-tagline {
  font-size: 14px;
  opacity: 0.92;
  margin-bottom: 16px;
  font-weight: 500;
}

.about-badges {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.about-badge {
  background: rgba(255,255,255,0.22);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 0.02em;
}

.about-badge.accent {
  background: rgba(255,255,255,0.95);
  color: #b20710;
  border-color: transparent;
}

/* Stats row */
.about-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.about-stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 10px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-num {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.stat-label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* Cards */
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}

.about-card-icon {
  font-size: 28px;
  margin-bottom: 10px;
  line-height: 1;
}

.about-card h3,
.about-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
}

.about-card > p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-muted);
}

/* Feature grid */
.about-feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.feature-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: color-mix(in srgb, var(--primary) 6%, var(--bg));
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 10%, var(--border));
  transition: transform 0.15s, background 0.15s;
}

.feature-card:active {
  transform: scale(0.97);
}

.feature-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.feature-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.feature-text strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.feature-text span {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Info pills */
.about-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.info-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.info-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.info-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

/* Footer */
.about-footer {
  text-align: center;
  padding: 28px 10px 12px;
  color: var(--text-muted);
  font-size: 13px;
}

.about-heart {
  font-size: 22px;
  margin-bottom: 8px;
  animation: heartBeat 1.6s ease-in-out infinite;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.18); }
  30% { transform: scale(1); }
  45% { transform: scale(1.12); }
  60% { transform: scale(1); }
}

.about-footer .copyright {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.75;
}

/* keep menu-item for any leftover usage */
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 500;
  text-align: left;
  width: 100%;
  transition: background 0.15s;
}

.menu-item:active { background: color-mix(in srgb, var(--text) 6%, transparent); }
.menu-item span { font-size: 20px; width: 28px; text-align: center; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #1a1a1a;
  color: white;
  padding: 12px 22px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s;
  z-index: 200;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

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

body.dark .toast { background: #f0f0f0; color: #111; }

/* ===== Responsive ===== */
@media (min-width: 480px) {
  .hero-poster { max-height: 560px; }
  .drama-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 640px) {
  .drama-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 768px) {
  body {
    max-width: 900px;
    margin: 0 auto;
    box-shadow: 0 0 60px rgba(0,0,0,0.1);
  }
  .top-header, .bottom-nav {
    max-width: 900px;
    left: 50%;
    transform: translateX(-50%);
  }
  .hero-section { margin: 12px 20px 0; }
  .section, .categories { margin-left: 20px; margin-right: 20px; }
  .drama-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .hero-poster { aspect-ratio: 16/9; max-height: 420px; }
  .hero-title { font-size: 1.8rem; }
}

@media (min-width: 1024px) {
  body { max-width: 1100px; }
  .top-header, .bottom-nav { max-width: 1100px; }
  .drama-grid { grid-template-columns: repeat(5, 1fr); }
}

/* ===== Video Player Modal ===== */
.player-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: #000;
  display: none;
  flex-direction: column;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.player-modal.open {
  display: flex;
  opacity: 1;
}

.player-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.player-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.8), transparent);
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

.player-close, .player-fs {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  transition: background 0.2s;
}

.player-close:active, .player-fs:active {
  background: rgba(255,255,255,0.25);
}

.player-title-wrap {
  flex: 1;
  color: white;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.player-title-wrap #player-title {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-title-wrap #player-ep {
  font-size: 12px;
  opacity: 0.75;
}

.player-screen {
  flex: 1;
  position: relative;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.player-poster {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.35;
  filter: blur(8px);
  transform: scale(1.1);
}

.player-center-controls {
  display: flex;
  align-items: center;
  gap: 28px;
  z-index: 5;
  transition: opacity 0.3s;
}

.player-play-btn {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(124,58,237,0.9);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 24px rgba(124,58,237,0.5);
  transition: transform 0.2s, background 0.2s;
}

.player-play-btn:active {
  transform: scale(0.92);
}

.player-skip {
  color: white;
  font-size: 14px;
  font-weight: 600;
  opacity: 0.85;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.1);
}

.player-skip:active {
  background: rgba(255,255,255,0.2);
}

.player-loading {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.4);
  z-index: 6;
}

.player-loading.show {
  display: flex;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.player-controls {
  padding: 8px 16px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.95), rgba(0,0,0,0.7));
}

.progress-wrap {
  padding: 10px 0;
  cursor: pointer;
}

.progress-bar {
  height: 4px;
  background: rgba(255,255,255,0.25);
  border-radius: 4px;
  position: relative;
}

.progress-filled {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  width: 0%;
  transition: width 0.15s linear;
}

.progress-handle {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 14px;
  height: 14px;
  background: white;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  transition: left 0.15s linear;
}

.player-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: white;
  font-size: 12px;
}

.player-right-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.player-right-controls button {
  color: white;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255,255,255,0.1);
}

.player-episodes {
  background: #0a0a0a;
  padding: 12px 16px 20px;
  max-height: 160px;
  overflow-y: auto;
}

.player-episodes h4 {
  color: white;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 10px;
  opacity: 0.8;
}

.player-ep-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.player-ep-list .ep-btn {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: #1a1a1a;
  border: 1px solid #333;
  color: #ccc;
  font-weight: 600;
  font-size: 13px;
}

.player-ep-list .ep-btn.active,
.player-ep-list .ep-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

/* Smoother animations */
.view {
  animation: fadeSlide 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.drama-card {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s;
}

.drama-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

body.dark .drama-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.cat-pill {
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.btn-play, .btn-detail, .btn-primary, .btn-outline {
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.btn-play:hover, .btn-primary:hover {
  box-shadow: 0 6px 20px rgba(124, 58, 237, 0.5);
  transform: translateY(-1px);
}

.nav-item {
  transition: color 0.25s, transform 0.2s;
}

.nav-item:active {
  transform: scale(0.9);
}

.toast {
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Hide bottom nav when player open */
body.player-open .bottom-nav,
body.player-open .top-header {
  display: none;
}


/* ===== Continue Watching ===== */
.continue-scroll {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
}
.continue-scroll::-webkit-scrollbar { display: none; }

.continue-card {
  flex-shrink: 0;
  width: 160px;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  transition: transform 0.25s;
}
.continue-card:active { transform: scale(0.97); }

.continue-poster {
  position: relative;
  aspect-ratio: 16/10;
  background: #222;
  overflow: hidden;
}
.continue-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.continue-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(255,255,255,0.25);
}
.continue-progress-fill {
  height: 100%;
  background: var(--primary);
}
.continue-info {
  padding: 8px 10px 10px;
}
.continue-info h4 {
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.continue-info p {
  font-size: 11px;
  color: var(--text-muted);
}

.section-sub {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ===== Enhanced Card / Poster Design ===== */
.drama-card {
  position: relative;
}
.card-poster {
  position: relative;
}
.card-poster::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.8) 0%,
    rgba(0,0,0,0.2) 38%,
    transparent 65%
  );
  pointer-events: none;
  opacity: 0.9;
}
.card-poster .badge {
  z-index: 2;
}
.card-ep-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,0.65);
  color: white;
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.12);
  letter-spacing: 0.2px;
}
.card-rating {
  position: absolute;
  bottom: 8px;
  left: 8px;
  z-index: 2;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  box-shadow: 0 2px 6px rgba(217,119,6,0.35);
}

/* Cinematic hero enhancement */
.hero-poster {
  box-shadow: inset 0 0 80px rgba(0,0,0,0.3);
}
.hero-title {
  letter-spacing: -0.3px;
}
.hero-desc {
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* History list items */
.history-item {
  display: flex;
  gap: 14px;
  background: var(--bg-card);
  border-radius: 14px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.history-item:active {
  transform: scale(0.98);
}
.history-thumb {
  width: 90px;
  height: 120px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #333;
}
.history-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.history-info h3 {
  font-size: 14.5px;
  font-weight: 600;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.history-info .meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.history-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.history-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
}
.history-info .ep-label {
  font-size: 11.5px;
  color: var(--primary);
  font-weight: 600;
}

/* Page header with back */
.page-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Subtle Chinese-inspired accent line on sections */
.section-header h2::after {
  content: '';
  display: block;
  width: 28px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), transparent);
  margin-top: 4px;
  border-radius: 2px;
}

/* ===== Auth / Login ===== */
.auth-page {
  min-height: calc(100vh - var(--nav-height) - var(--header-height));
  padding: 12px 16px 28px;
  position: relative;
}
.auth-back {
  margin-bottom: 8px;
}
.auth-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px 18px 20px;
  box-shadow: var(--shadow);
  max-width: 420px;
  margin: 0 auto;
}
.auth-brand {
  text-align: center;
  margin-bottom: 18px;
}
.auth-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 10px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  color: #fff;
  background: linear-gradient(135deg, #e50914, #ff4b55);
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.35);
}
.auth-brand h1 {
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.auth-brand p {
  color: var(--text-muted);
  font-size: 13px;
}
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: var(--bg);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.auth-tab {
  padding: 10px 12px;
  border-radius: 10px;
  font-weight: 650;
  font-size: 14px;
  color: var(--text-muted);
}
.auth-tab.active {
  background: var(--bg-card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.auth-field input {
  width: 100%;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
}
.auth-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.15);
}
.auth-error {
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.auth-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}
.menu-item.danger {
  color: #dc2626;
}
.menu-item.danger span {
  filter: none;
}


@media (max-width: 380px) {
  .brand-logo-img { width: 108px; height: 32px; }
  .about-logo-wrap { height: 40px; }
  .about-logo-img { max-height: 40px; }
}

/* ===== RMDSTORE Elegant Premium Header ===== */
.top-header {
  --header-glow: rgba(124, 58, 237, 0.16);
  height: 64px;
  padding: 0 14px 0 10px;
  background: linear-gradient(110deg,
    color-mix(in srgb, var(--bg-card) 94%, #e50914 6%),
    color-mix(in srgb, var(--bg) 91%, #ff4b55 9%));
  border-bottom: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  box-shadow: 0 5px 22px rgba(40, 20, 70, 0.07);
  isolation: isolate;
}
.top-header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(167,139,250,.75), rgba(124,58,237,.35), transparent);
  pointer-events: none;
}
body.dark .top-header {
  background: linear-gradient(110deg, rgba(18,14,29,.97), rgba(31,22,48,.96) 58%, rgba(20,16,31,.98));
  border-bottom-color: rgba(167,139,250,.20);
  box-shadow: 0 8px 26px rgba(0,0,0,.24);
}
.top-header.scrolled {
  box-shadow: 0 8px 28px rgba(32, 18, 55, .13);
}
body.dark .top-header.scrolled {
  box-shadow: 0 8px 28px rgba(0,0,0,.38);
}
.header-left, .header-right { gap: 7px; }
.brand-btn {
  padding: 5px 9px 5px 5px;
  border-radius: 14px;
  transition: transform .2s ease, background .2s ease, filter .2s ease;
}
.brand-btn:hover {
  background: rgba(124,58,237,.08);
  filter: drop-shadow(0 2px 8px rgba(124,58,237,.16));
}
.brand-logo-img {
  width: clamp(126px, 19vw, 166px);
  height: 43px;
  object-fit: contain;
  object-position: left center;
  filter: drop-shadow(0 2px 7px rgba(124,58,237,.12));
}
.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid color-mix(in srgb, var(--primary) 15%, var(--border));
  background: color-mix(in srgb, var(--bg-card) 76%, transparent);
  color: var(--text-muted);
  box-shadow: 0 2px 8px rgba(25, 15, 40, .045);
}
body.dark .icon-btn {
  background: linear-gradient(145deg, rgba(55,42,78,.72), rgba(35,27,51,.78));
  border-color: rgba(167,139,250,.17);
  color: #ffb3b8;
}
.icon-btn:hover {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
  background: color-mix(in srgb, var(--primary) 10%, var(--bg-card));
  transform: translateY(-1px);
}
body.dark .icon-btn:hover {
  color: #fff;
  background: linear-gradient(145deg, #e50914, #512b91);
  border-color: rgba(196,181,253,.48);
}
.icon-btn:active { transform: scale(.94); }
@media (max-width: 380px) {
  .top-header { height: 60px; padding-right: 10px; }
  .brand-logo-img { width: 116px; height: 39px; }
  .header-left, .header-right { gap: 4px; }
  .icon-btn { width: 36px; height: 36px; }
}

/* Zona Drama official header logo */
.brand-logo-img {
  display: block;
  width: clamp(132px, 20vw, 176px);
  height: 44px;
  object-fit: contain;
  object-position: left center;
  border-radius: 5px;
}
@media (max-width: 380px) {
  .brand-logo-img { width: 122px; height: 40px; }
}


/* Vertical swipe navigation between episodes */
.player-screen { touch-action: pan-y; }


/* Video player stability: keep the video frame responsive and custom controls accessible */
#player-screen {
  min-height: 220px;
  height: min(56.25vw, 70vh);
  flex: 0 0 auto;
  touch-action: pan-y;
}
#zd-real-video {
  display: block;
  width: 100%;
  height: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
  z-index: 3;
}
#player-screen .player-center-controls {
  position: relative;
  z-index: 5;
  pointer-events: none;
}
#player-screen .player-center-controls button {
  pointer-events: auto;
}
@media (max-width: 600px) {
  #player-screen {
    height: 56.25vw;
    min-height: 200px;
    max-height: 56.25vw;
  }
  #zd-real-video {
    max-height: 56.25vw;
  }
}
