/* ═══════════════════════════════════════════════════════════
   Design System — v2
   ══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,300;0,14..32,400;0,14..32,500;0,14..32,600;0,14..32,700;0,14..32,800;1,14..32,400&display=swap');

/* ── CSS Variables ────────────────────────────────────────── */
:root {
  --bg-base:       #0a0a0f;
  --bg-card:       #13131a;
  --bg-card-hover: #1a1a24;
  --bg-overlay:    rgba(0,0,0,0.85);

  --accent:        #7c3aed;
  --accent-glow:   rgba(124,58,237,0.35);
  --accent-light:  #a78bfa;
  --accent-dark:   #5b21b6;

  --success:       #10b981;
  --warning:       #f59e0b;
  --danger:        #ef4444;

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;

  --border:        rgba(255,255,255,0.08);
  --border-accent: rgba(124,58,237,0.4);

  --radius-sm:  6px;
  --radius-md: 12px;
  --radius-lg: 20px;

  --shadow-card: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 40px var(--accent-glow);

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC',
          'Hiragino Sans GB', sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

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

/* ── Topbar ───────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(10,10,15,0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Cards ────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--border-accent);
  transform: translateY(-1px);
}

/* ── Buttons ──────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  box-shadow: 0 4px 15px var(--accent-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--accent-glow);
}
.btn-primary:active { transform: translateY(0); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--border-accent);
  background: var(--bg-card-hover);
}

.btn-danger {
  background: rgba(239,68,68,0.15);
  color: var(--danger);
  border: 1px solid rgba(239,68,68,0.3);
}
.btn-danger:hover { background: rgba(239,68,68,0.25); }

/* ── Forms ────────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.form-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
  font-family: var(--font);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  width: 100%;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.form-input::placeholder { color: var(--text-muted); }

select.form-input option {
  background: var(--bg-card);
  color: var(--text-primary);
}

/* ── Badges ───────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.badge-green  { background: rgba(16,185,129,0.15); color: #10b981; border: 1px solid rgba(16,185,129,0.3); }
.badge-yellow { background: rgba(245,158,11,0.15); color: #f59e0b; border: 1px solid rgba(245,158,11,0.3); }
.badge-red    { background: rgba(239,68,68,0.15);  color: #ef4444; border: 1px solid rgba(239,68,68,0.3); }
.badge-gray   { background: rgba(148,163,184,0.1); color: #94a3b8; border: 1px solid rgba(148,163,184,0.2); }

/* ── Spinner ──────────────────────────────────────────────── */
.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════
   HOME PAGE — Apple Glassmorphism
   ══════════════════════════════════════════════════════════ */

/* Deep cinematic background */
.home-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #0d0d14 0%, #09090f 100%);
  overflow-x: hidden;
}
.home-content { padding-bottom: 48px; }

/* ── Nav bar: Apple-style frosted glass ───────────────────── */
.home-nav {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 14px 20px;
  background: rgba(10,10,18,0.6);
  backdrop-filter: saturate(200%) blur(24px);
  -webkit-backdrop-filter: saturate(200%) blur(24px);
  border-bottom: 0.5px solid rgba(255,255,255,0.07);
}
.home-nav-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  color: #fff;
  margin-right: auto;
}
.home-nav-tab {
  font-size: 0.82rem;
  font-weight: 500;
  color: rgba(255,255,255,0.38);
  cursor: pointer;
  padding: 4px 12px;
  border-radius: 20px;
  transition: all 0.2s;
}
.home-nav-tab-active {
  color: #fff;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
}

/* ── Skeleton loader ──────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}
.home-skeleton { padding: 20px 16px; }
.skeleton-hero {
  width: 100%; height: 44vw; min-height: 200px; max-height: 380px;
  border-radius: 20px;
  background: linear-gradient(90deg, #1c1c24 25%, #26262f 50%, #1c1c24 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite linear;
  margin-bottom: 28px;
}
.skeleton-section-title {
  height: 18px; width: 120px; border-radius: 8px; margin-bottom: 16px;
  background: linear-gradient(90deg, #1c1c24 25%, #26262f 50%, #1c1c24 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite linear;
}
.skeleton-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 480px) { .skeleton-row { grid-template-columns: repeat(4, 1fr); } }
.skeleton-card {
  aspect-ratio: 2/3;
  border-radius: 14px;
  background: linear-gradient(90deg, #1c1c24 25%, #26262f 50%, #1c1c24 75%);
  background-size: 800px 100%;
  animation: shimmer 1.6s infinite linear;
}

/* ── Hero Feature Card ────────────────────────────────────── */
.hero-card {
  display: block;
  position: relative;
  margin: 16px 16px 0;
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7), 0 0 0 0.5px rgba(255,255,255,0.06);
  transition: transform 0.3s cubic-bezier(0.34,1.2,0.64,1);
}
.hero-card:active { transform: scale(0.98); }

.hero-image-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}
@media (min-width: 480px) {
  .hero-image-wrap { aspect-ratio: 21/9; }
}
.hero-image {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}
.hero-card:hover .hero-image { transform: scale(1.03); }
.hero-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #1a1a35, #2d1b4e, #111);
}

/* Cinematic gradients layered on hero */
.hero-gradient-top {
  position: absolute;
  top: 0; left: 0; right: 0; height: 40%;
  background: linear-gradient(to bottom, rgba(0,0,0,0.4) 0%, transparent 100%);
  pointer-events: none;
}
.hero-gradient-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 70%;
  background: linear-gradient(to top, rgba(8,8,18,1) 0%, rgba(8,8,18,0.6) 40%, transparent 100%);
  pointer-events: none;
}

/* Floating recommended pill */
.hero-pill {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.5px solid rgba(255,255,255,0.25);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 100px;
  letter-spacing: 0.06em;
}

/* Glass info panel at bottom of hero */
.hero-info-glass {
  background: rgba(12,12,22,0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(255,255,255,0.08);
  border-radius: 0 0 20px 20px;
}
.hero-info-inner {
  padding: 16px 18px 20px;
}
.hero-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  line-height: 1.25;
}
.hero-desc {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin-bottom: 14px;
}
.hero-cta { display: flex; gap: 10px; }
.hero-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 22px;
  background: #fff;
  color: #000;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 100px;
  letter-spacing: -0.01em;
  transition: opacity 0.15s;
}
.hero-cta-btn:active { opacity: 0.75; }

/* ── Section header ───────────────────────────────────────── */
.drama-section { padding: 28px 16px 0; }
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
}
.section-more {
  font-size: 0.78rem;
  color: #636cff;
  font-weight: 500;
}

/* ── Drama card grid ──────────────────────────────────────── */
.drama-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 480px) { .drama-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 768px) { .drama-grid { grid-template-columns: repeat(4, 1fr); } }

/* ── Recommend grid (compact 3 col) ───────────────────────── */
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

/* ── Drama card ───────────────────────────────────────────── */
.drama-card {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  background: #1c1c28;
  position: relative; /* Container for absolute info overlay */
  box-shadow:
    0 4px 20px rgba(0,0,0,0.5),
    0 0 0 0.5px rgba(255,255,255,0.05);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s cubic-bezier(0.34,1.2,0.64,1),
              box-shadow 0.25s ease;
}
.drama-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 16px 40px rgba(0,0,0,0.65), 0 0 0 0.5px rgba(255,255,255,0.09);
}
.drama-card:active { transform: scale(0.96); opacity: 0.85; }

.drama-thumb-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 2/3;
  overflow: hidden;
}
.drama-thumb {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.drama-card:hover .drama-thumb { transform: scale(1.06); }
.drama-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #1c1c2e, #2a1f3d, #111);
  display: flex; align-items: center; justify-content: center;
}
.placeholder-icon { font-size: 2.2rem; opacity: 0.3; }
.drama-thumb-gradient {
  position: absolute;
  bottom: 0; left: 0; right: 0; height: 45%;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  pointer-events: none;
}

/* Frosted glass hot badge */
.drama-hot-badge {
  position: absolute;
  top: 7px; right: 7px;
  font-size: 0.9rem;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5));
}

/* Card info overlayed on bottom of thumb */
.drama-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 30px 10px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.6) 40%, transparent 100%);
  z-index: 10;
  pointer-events: none;
}
.drama-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.35;
  letter-spacing: 0.02em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

/* ── Empty / error state ─────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 100px 20px;
}
.empty-state-icon  { font-size: 3.5rem; margin-bottom: 20px; opacity: 0.4; }
.empty-state-title { font-size: 1rem; font-weight: 600; color: rgba(255,255,255,0.45); }
.empty-state-desc  { font-size: 0.8rem; margin-top: 8px; color: rgba(255,255,255,0.25); }


/* ══════════════════════════════════════════════════════════
   CORP DECOY PAGE (Generic Lightweight Landing)
   ══════════════════════════════════════════════════════════ */
.corp-decoy {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.corp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 5%;
  border-bottom: 1px solid #f0f0f0;
}
.corp-logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.03em;
}
.corp-nav {
  display: none;
}
@media (min-width: 600px) {
  .corp-nav { display: flex; gap: 24px; }
  .corp-nav a { text-decoration: none; color: #666; font-size: 0.95rem; }
  .corp-nav a:hover { color: #000; }
}

.corp-main {
  flex: 1;
  padding: 60px 5%;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.corp-hero {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 60px;
}
.corp-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  color: #111;
  margin-bottom: 24px;
}
.corp-subtitle {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.6;
  margin-bottom: 32px;
}
.corp-button {
  background: #000;
  color: #fff;
  border: none;
  padding: 14px 32px;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
}

.corp-features {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 60px;
}
@media (min-width: 768px) {
  .corp-features { grid-template-columns: repeat(3, 1fr); }
}
.corp-feature-card {
  padding: 30px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #eaeaea;
}
.corp-feature-card h3 {
  font-size: 1.2rem;
  margin-bottom: 12px;
  color: #111;
}
.corp-feature-card p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.5;
}

.corp-footer {
  text-align: center;
  padding: 30px;
  border-top: 1px solid #eee;
  color: #999;
  font-size: 0.85rem;
}

.corp-status-bar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #111;
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.85rem;
  z-index: 1000;
}
.corp-spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top: 2px solid #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
@keyframes spin { 100% { transform: rotate(360deg); } }


/* Episode bar */
.episode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.ep-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-base);
  color: var(--text-secondary);
  transition: all 0.15s;
}
.ep-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.ep-btn.locked {
  color: var(--text-muted);
  position: relative;
}
.ep-btn.locked::after {
  content: '🔒';
  position: absolute;
  top: -4px;
  right: -4px;
  font-size: 0.55rem;
}
.ep-btn:hover:not(.locked) {
  border-color: var(--accent);
  color: var(--accent-light);
}

/* ── Share Modal ──────────────────────────────────────────── */
.share-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg-overlay);
  display: flex;
  align-items: flex-end;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

.share-panel {
  width: 100%;
  background: linear-gradient(180deg, #1a1025 0%, #0f0a1a 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: 24px 20px 40px;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-top: 1px solid var(--border-accent);
}

.share-title {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.share-subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.share-poster-container {
  position: relative;
  width: 100%;
  max-width: 200px;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(124,58,237,0.3);
  overflow: hidden;
}

.share-poster {
  display: block;
  width: 100%;
  height: auto;
  cursor: pointer;
  -webkit-touch-callout: default !important;
  touch-action: none;
}

.fingerprint-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 10, 30, 0.4);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  pointer-events: none;
  animation: pulse-glow 2s infinite;
}
.fingerprint-overlay svg {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}
.fingerprint-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  margin-top: 12px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.9);
}
@keyframes pulse-glow {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.share-hint {
  text-align: center;
  font-size: 0.8rem;
  color: var(--accent-light);
  margin-bottom: 20px;
  animation: pulse 2s ease infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.08);
  border-radius: 100px;
  overflow: hidden;
  margin: 0 0 8px;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 100px;
  transition: width 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 0 8px var(--accent-glow);
}
.progress-label {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.progress-bar-thick {
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 100px;
  overflow: hidden;
  margin: 0 0 8px;
  position: relative;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.05);
}
.progress-fill-thick {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #a855f7, #ec4899);
  border-radius: 100px;
  transition: width 0.8s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 12px;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.5);
}
.progress-pct-text {
  font-size: 0.8rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  font-family: monospace;
}

/* Toast Notification */
.share-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 15, 20, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 24px 20px 20px;
  border-radius: 16px;
  z-index: 10001;
  width: 80%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.1);
  color: white;
  animation: toast-pop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes toast-pop {
  0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
.share-toast.error {
  box-shadow: 0 10px 40px rgba(255, 77, 79, 0.3), 0 0 0 1px rgba(255, 77, 79, 0.5);
}
.share-toast-msg {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 20px;
}
.share-toast.error .share-toast-msg {
  color: #ff4d4f;
}
.share-toast-close {
  position: absolute;
  top: 6px;
  right: 10px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 1.2rem;
  padding: 4px;
  cursor: pointer;
}
.share-toast-btn {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 24px;
  font-size: 0.9rem;
  cursor: pointer;
  width: 100%;
}

/* ── Decoy page ───────────────────────────────────────────── */
.decoy-page { min-height: 100vh; }

.decoy-news-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.decoy-news-thumb {
  width: 80px;
  height: 60px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #1e293b, #334155);
  border-radius: var(--radius-sm);
}
.decoy-news-title {
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--text-primary);
}
.decoy-news-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ══════════════════════════════════════════════════════════
   ADMIN LAYOUT
   ══════════════════════════════════════════════════════════ */
.admin-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  z-index: 50;
  overflow-y: auto;
}

.sidebar-logo {
  padding: 24px 20px 16px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.admin-sidebar nav {
  display: flex;
  flex-direction: column;
  padding: 8px 12px;
  gap: 2px;
}

.sidebar-nav-item {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
  text-decoration: none;
}
.sidebar-nav-item:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}
.sidebar-nav-item.active {
  background: rgba(124,58,237,0.15);
  color: var(--accent-light);
  border-left: 3px solid var(--accent);
}

/* Main content */
.admin-main {
  margin-left: 220px;
  flex: 1;
  padding: 32px;
  overflow-y: auto;
}

@media (max-width: 768px) {
  .admin-sidebar { display: none; }
  .admin-main { margin-left: 0; padding: 16px; }
}

/* ── Video Player ─────────────────────────────────────────── */
.player-page {
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  background: #000;
  display: flex;
  flex-direction: column;
}

.player-page > * {
  flex: 1;
}

.video-wrap {
  width: 100vw;
  height: 100vh;
  background: #000;
  position: relative; /* For absolutely positioned overlays */
}
video {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Back to cover to avoid black borders */
}

/* Big play button overlay */
.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: transform 0.2s, opacity 0.2s;
}
.play-overlay:active {
  transform: translate(-50%, -50%) scale(0.9);
}
.play-icon {
  color: rgba(255,255,255,0.9);
  font-size: 3rem;
  margin-left: 6px; /* visually center the play triangle */
}

/* Glassmorphism badge for current episode */
.video-ep-badge {
  position: absolute;
  top: 16px;
  left: 56px;
  padding: 6px 12px;
  background: rgba(10, 10, 18, 0.4);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  z-index: 10;
  pointer-events: none;
}

/* ── TikTok-style Video Actions ─────────────────────────────── */
.player-back-btn {
  position: absolute;
  top: 16px;
  left: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  color: #fff;
  font-size: 1.2rem;
  text-decoration: none;
  z-index: 50;
  transition: transform 0.2s;
}
.player-back-btn:active {
  transform: scale(0.9);
}

.video-actions {
  position: absolute;
  right: 12px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 20;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
  transition: transform 0.15s;
}

.action-btn:active {
  transform: scale(0.9);
}

.action-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 50%;
  font-size: 1.1rem;
}

.action-icon.heart {
  color: #ff2a5f; /* TikTok pinkish red */
}

.action-icon.episodes {
  color: #fff;
}

.action-icon.more {
  color: #fff;
}

.action-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
}

/* ── Bottom Sheet Episode Selector ────────────────────────── */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  animation: fadeIn 0.2s ease;
}

.bottom-sheet {
  width: 100%;
  max-height: 70vh;
  background: linear-gradient(180deg, #1a1025 0%, #0f0a1a 100%);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -10px 40px rgba(0,0,0,0.5);
}

.bottom-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.bottom-sheet-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.bottom-sheet-close {
  background: rgba(255,255,255,0.1);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  line-height: 1;
}

.bottom-sheet-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}
.admin-page-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

/* ── Stats grid ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: border-color 0.2s;
}
.stat-card:hover { border-color: var(--border-accent); }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  margin-bottom: 6px;
}
.stat-value.accent { color: var(--accent-light); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger  { color: var(--danger); }

.stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead {
  background: rgba(255,255,255,0.03);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-secondary);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }

tbody tr:hover { background: var(--bg-card-hover); }

/* ── Funnel chart ─────────────────────────────────────────── */
.funnel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.funnel-item:last-child { border-bottom: none; }

.funnel-label {
  width: 100px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.funnel-bar-wrap {
  flex: 1;
  height: 24px;
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  overflow: hidden;
}
.funnel-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: 4px;
  transition: width 0.6s ease;
}
.funnel-count {
  width: 50px;
  text-align: right;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Probe log table ──────────────────────────────────────── */
.score-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
}
.score-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.score-dot.pass  { background: var(--success); }
.score-dot.fail  { background: var(--danger); }

/* ── Login overlay ────────────────────────────────────────── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.login-box {
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-card);
}
.login-title {
  font-size: 1.4rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #a78bfa, #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.login-subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

/* ── Episode editor modal ─────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: fadeIn 0.15s ease;
}
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-close {
  background: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.15s;
}
.modal-close:hover { color: var(--text-primary); }

/* ── Episode row in editor ────────────────────────────────── */
.ep-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}
.ep-row-num {
  width: 36px;
  flex-shrink: 0;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: 4px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Responsive tweaks ────────────────────────────────────── */
@media (max-width: 480px) {
  .share-panel { padding: 20px 16px 36px; }
  .share-poster { max-width: 240px; }
  .admin-page-title { font-size: 1.1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Scrollbar ────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ══════════════════════════════════════════════════════════
   Analytics & Charts
   ══════════════════════════════════════════════════════════ */
/* KPI Cards */
.kpi-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.kpi-card { position: relative; overflow: hidden; }
.kpi-icon { font-size: 1.6rem; margin-bottom: 8px; }
.kpi-sub { font-size: 0.7rem; color: var(--text-muted); margin-top: 4px; }

/* Funnel Summary Row */
.funnel-summary-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 16px 20px; margin-bottom: 24px;
  overflow-x: auto;
}
.funnel-step { text-align: center; min-width: 80px; }
.funnel-icon { font-size: 1.2rem; margin-bottom: 4px; }
.funnel-count { font-size: 1.4rem; font-weight: 900; }
.funnel-label { font-size: 0.72rem; color: var(--text-secondary); }
.funnel-pct { font-size: 0.7rem; color: var(--text-muted); margin-top: 2px; }
.funnel-arrow { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; }

/* Chart section */
.chart-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px; margin-bottom: 24px;
}
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.chart-title { font-size: 1rem; font-weight: 700; margin: 0; }
.chart-wrap { height: 140px; }
.chart-loading { color: var(--text-muted); font-size: 0.85rem; padding: 40px; text-align: center; }
.chart-empty { color: var(--text-muted); font-size: 0.85rem; padding: 40px; text-align: center; }

/* Tab group */
.tab-group { display: flex; gap: 4px; }
.tab-btn {
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; color: var(--text-secondary); font-size: 0.78rem;
  cursor: pointer; transition: all 0.15s;
}
.tab-btn.active, .tab-btn:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* Spark chart (mini bar chart) */
.spark-chart {
  display: flex; align-items: flex-end; gap: 2px; height: 100%; padding-top: 8px;
}
.spark-bar-wrap { flex: 1; height: 100%; display: flex; align-items: flex-end; min-width: 4px; }
.spark-bar {
  width: 100%; background: var(--accent); border-radius: 2px 2px 0 0;
  opacity: 0.8; transition: opacity 0.15s;
}
.spark-bar-wrap:hover .spark-bar { opacity: 1; }

/* Analytics page */
.analytics-section {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; padding: 20px; margin-bottom: 24px;
}
.section-title { font-size: 1rem; font-weight: 700; margin: 0 0 12px; }
.section-hint { font-size: 0.78rem; color: var(--text-muted); margin: -8px 0 12px; }

/* Funnel bars (full) */
.funnel-bars { display: flex; flex-direction: column; gap: 10px; }
.funnel-bar-row { display: flex; align-items: center; gap: 12px; }
.funnel-bar-label { min-width: 110px; font-size: 0.82rem; color: var(--text-secondary); text-align: right; }
.funnel-bar-track { flex: 1; height: 22px; background: rgba(255,255,255,0.05); border-radius: 4px; overflow: hidden; }
.funnel-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; transition: width 0.6s ease; }
.funnel-bar-fill.negative { background: #f87171; }
.funnel-bar-count { min-width: 100px; font-size: 0.82rem; font-weight: 700; }
.funnel-bar-pct { font-weight: 400; color: var(--text-muted); margin-left: 4px; }

/* Dual trend chart */
.dual-chart { }
.dual-legend { display: flex; gap: 16px; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 8px; align-items: center; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 4px; }
.legend-dot.success { background: var(--success); }
.legend-dot.fail { background: var(--accent); }
.dual-bars {
  display: flex; align-items: flex-end; gap: 3px; height: 100px; overflow-x: auto; padding-bottom: 24px;
}
.dual-bar-group { display: flex; flex-direction: column; align-items: center; min-width: 20px; flex: 1; }
.dual-bar-inner { display: flex; gap: 1px; align-items: flex-end; height: 80px; }
.dual-bar { width: 8px; border-radius: 2px 2px 0 0; min-height: 2px; }
.dual-bar.success { background: var(--success); }
.dual-bar.fail { background: var(--accent); }
.dual-bar-label { font-size: 0.6rem; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }

/* Horse-race ranking table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
th { text-align: left; padding: 12px 16px; color: var(--text-muted); border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap; }
td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.05); }
tbody tr:hover { background: rgba(255,255,255,0.02); }

.rank-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%; font-size: 0.75rem; font-weight: 700;
  background: rgba(255,255,255,0.1);
}
.rank-gold td { background: rgba(234,179,8,0.05); }
.rank-silver td { background: rgba(148,163,184,0.05); }
.rank-bronze td { background: rgba(180,83,9,0.05); }
.rank-gold .rank-badge { background: #eab308; color: #000; }
.rank-silver .rank-badge { background: #94a3b8; color: #000; }
.rank-bronze .rank-badge { background: #b45309; }

.rate-cell { display: flex; align-items: center; gap: 8px; min-width: 80px; }
.rate-bar {
  height: 6px; border-radius: 3px; background: var(--accent);
  min-width: 2px; max-width: 60px; transition: width 0.4s ease;
}

/* Retention chart */
.retention-chart {
  display: flex; align-items: flex-end; gap: 3px; height: 120px;
  overflow-x: auto; padding-bottom: 24px;
}
.retention-bar-col { display: flex; flex-direction: column; align-items: center; min-width: 20px; flex: 1; }
.retention-bar-wrap { height: 100px; display: flex; align-items: flex-end; width: 100%; }
.retention-bar { width: 100%; border-radius: 2px 2px 0 0; transition: height 0.5s ease; }
.retention-ep-label { font-size: 0.6rem; color: var(--text-muted); margin-top: 4px; }
.retention-legend { display: flex; gap: 16px; font-size: 0.78rem; color: var(--text-muted); margin-top: 8px; align-items: center; }
