/* ====================================================
   AniVerse — Cinematic Premium Stylesheet
   ==================================================== */

:root {
  --av-bg: #07070b;
  --av-bg-2: #0d0d14;
  --av-card: #13131c;
  --av-line: #1f1f2e;
  --av-text: #e9e9f3;
  --av-muted: #8a8a9c;
  --av-orange: #ff7a18;
  --av-orange-2: #ff9a3c;
  --av-gold: #ffc857;
  --av-vip: #b88aff;
}

* { -webkit-font-smoothing: antialiased; }

html, body { background: #07070b; }

::selection { background: rgba(255,122,24,0.35); color: #fff; }

/* scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0a0a10; }
::-webkit-scrollbar-thumb { background: #2a2a3a; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #ff7a18; }

/* ============ Navbar ============ */
#av-nav .av-nav-bg {
  background: linear-gradient(180deg, rgba(7,7,11,0.95) 0%, rgba(7,7,11,0.4) 70%, transparent 100%);
  transition: backdrop-filter .3s, background .3s;
}
#av-nav.scrolled .av-nav-bg {
  background: rgba(7,7,11,0.85);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--av-line);
}
.av-nav-link {
  padding: .55rem 1rem;
  border-radius: 9999px;
  color: var(--av-muted);
  transition: all .25s;
  font-weight: 500;
}
.av-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.av-nav-icon {
  width: 40px; height: 40px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.05);
  display: grid; place-items: center;
  color: var(--av-text);
}
.av-menu-item {
  display: flex; align-items: center;
  padding: .65rem 1rem;
  gap: .25rem;
  transition: background .2s, color .2s;
}
.av-menu-item:hover { background: rgba(255,255,255,0.05); color: #fff; }

/* dropdown open state */
[data-dropdown].open [data-dropdown-menu] {
  opacity: 1 !important;
  transform: scale(1) !important;
  pointer-events: auto !important;
}

/* ============ Hero Slider ============ */
.hero-slider { position: relative; height: 88vh; min-height: 540px; max-height: 820px; overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 1s ease;
  background-size: cover; background-position: center;
}
.hero-slide.active { opacity: 1; z-index: 2; }
.hero-slide::before {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, transparent 0%, transparent 30%, rgba(7,7,11,0.85) 80%, var(--av-bg) 100%),
    linear-gradient(90deg, rgba(7,7,11,0.95) 0%, rgba(7,7,11,0.5) 50%, transparent 100%);
}
.hero-content {
  position: absolute; bottom: 8%; left: 0; right: 0;
  z-index: 5;
  padding: 0 24px;
}
@media (min-width: 768px) {
  .hero-content { padding: 0 60px; bottom: 12%; }
}

.hero-slide.active .hero-content > * { animation: heroIn .9s cubic-bezier(.2,.7,.2,1) backwards; }
.hero-slide.active .hero-content > *:nth-child(1) { animation-delay: .1s; }
.hero-slide.active .hero-content > *:nth-child(2) { animation-delay: .2s; }
.hero-slide.active .hero-content > *:nth-child(3) { animation-delay: .3s; }
.hero-slide.active .hero-content > *:nth-child(4) { animation-delay: .4s; }
.hero-slide.active .hero-content > *:nth-child(5) { animation-delay: .5s; }

@keyframes heroIn {
  from { opacity: 0; transform: translateY(30px); filter: blur(8px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* hero dot pagination */
.hero-dots { position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%); z-index: 10; display: flex; gap: 8px; }
.hero-dot { width: 28px; height: 4px; border-radius: 4px; background: rgba(255,255,255,0.25); cursor: pointer; transition: all .3s; }
.hero-dot.active { background: var(--av-orange); width: 48px; box-shadow: 0 0 12px rgba(255,122,24,.6); }

.hero-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  display: grid; place-items: center;
  z-index: 10; cursor: pointer; transition: all .3s;
  opacity: 0;
}
.hero-slider:hover .hero-nav { opacity: 1; }
.hero-nav:hover { background: var(--av-orange); border-color: var(--av-orange); }
.hero-nav.prev { left: 20px; }
.hero-nav.next { right: 20px; }

/* ============ Anime Card ============ */
.anime-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--av-card);
  transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s;
  will-change: transform;
  isolation: isolate;
}
.anime-card:hover {
  transform: translateY(-6px) scale(1.03);
  z-index: 5;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.8), 0 0 30px -8px rgba(255,122,24,0.4);
}
.anime-card .poster {
  aspect-ratio: 2/3;
  background-size: cover; background-position: center;
  position: relative;
  transition: transform .6s;
}
.anime-card:hover .poster { transform: scale(1.06); }
.anime-card .poster::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(7,7,11,0.95) 100%);
}
.anime-card .info {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 12px 12px 12px;
  z-index: 2;
}
.anime-card .title {
  font-weight: 600;
  font-size: 14px;
  line-height: 1.2;
  text-shadow: 0 2px 8px rgba(0,0,0,0.8);
}
.anime-card .meta {
  font-size: 11px;
  color: var(--av-muted);
  margin-top: 2px;
}

.anime-card .play-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(7,7,11,0.3) 0%, rgba(7,7,11,0.8) 100%);
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transition: opacity .3s;
  z-index: 3;
}
.anime-card:hover .play-overlay { opacity: 1; }
.anime-card .play-overlay .play-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--av-orange);
  display: grid; place-items: center;
  box-shadow: 0 0 30px rgba(255,122,24,0.6);
  transform: scale(0.6);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1) .1s;
}
.anime-card:hover .play-overlay .play-btn { transform: scale(1); }

/* Locked anime card */
.anime-card.locked .poster {
  filter: blur(8px) brightness(0.6) saturate(0.7);
  transform: scale(1.1);
}
.anime-card.locked:hover .poster { transform: scale(1.15); }
.anime-card.locked .lock-overlay {
  position: absolute; inset: 0;
  z-index: 4;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 10px;
  background: rgba(7,7,11,0.3);
}
.anime-card.locked .lock-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(255,122,24,0.15);
  border: 2px solid var(--av-orange);
  display: grid; place-items: center;
  color: var(--av-orange);
  font-size: 22px;
  box-shadow: 0 0 30px rgba(255,122,24,0.5);
  animation: pulseLock 2.5s ease-in-out infinite;
}
@keyframes pulseLock {
  0%, 100% { box-shadow: 0 0 25px rgba(255,122,24,0.45); transform: scale(1); }
  50%      { box-shadow: 0 0 45px rgba(255,122,24,0.75); transform: scale(1.06); }
}
.anime-card.locked .lock-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .15em;
  color: var(--av-orange);
  text-shadow: 0 0 12px rgba(255,122,24,0.5);
}

.anime-card .premium-badge,
.anime-card .vip-badge {
  position: absolute; top: 10px; right: 10px;
  z-index: 5;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  display: flex; align-items: center; gap: 4px;
}
.anime-card .premium-badge {
  background: linear-gradient(135deg, #ff7a18, #ffae45);
  color: #1a1300;
  box-shadow: 0 4px 14px rgba(255,122,24,0.45);
}
.anime-card .vip-badge {
  background: linear-gradient(135deg, #b88aff, #e8d5ff);
  color: #1a0e2e;
  box-shadow: 0 4px 14px rgba(184,138,255,0.45);
}
.anime-card .new-badge {
  position: absolute; top: 10px; left: 10px;
  z-index: 5;
  padding: 4px 8px;
  border-radius: 8px;
  background: #ef4444;
  color: white;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* progress bar on continue watching */
.anime-card .progress-bar {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 3px;
  background: rgba(255,255,255,0.15);
  z-index: 4;
}
.anime-card .progress-bar > div {
  height: 100%;
  background: linear-gradient(90deg, var(--av-orange), var(--av-orange-2));
  box-shadow: 0 0 12px rgba(255,122,24,0.6);
}

/* ============ Carousel ============ */
.carousel {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 12px 6px;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel > * {
  flex: 0 0 auto;
  width: 160px;
  scroll-snap-align: start;
}
@media (min-width: 640px) { .carousel > * { width: 180px; } }
@media (min-width: 1024px) { .carousel > * { width: 200px; } }

.carousel-wrap { position: relative; }
.carousel-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 80px;
  background: linear-gradient(90deg, rgba(7,7,11,0.95), rgba(7,7,11,0.4));
  display: none; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 6;
  transition: opacity .3s;
}
.carousel-wrap:hover .carousel-arrow { display: flex; }
.carousel-arrow.prev { left: 0; border-radius: 0 10px 10px 0; }
.carousel-arrow.next { right: 0; border-radius: 10px 0 0 10px; background: linear-gradient(-90deg, rgba(7,7,11,0.95), rgba(7,7,11,0.4)); }
.carousel-arrow i { font-size: 18px; }
.carousel-arrow:hover i { color: var(--av-orange); }

/* ============ Section Title ============ */
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 28px 0 6px;
  padding: 0 6px;
}
.section-title h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 26px;
  letter-spacing: .06em;
  position: relative;
  padding-left: 14px;
}
.section-title h2::before {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 4px; height: 70%;
  background: linear-gradient(180deg, var(--av-orange), var(--av-orange-2));
  border-radius: 2px;
  box-shadow: 0 0 12px rgba(255,122,24,0.5);
}
.section-title a {
  color: var(--av-muted);
  font-size: 13px;
}
.section-title a:hover { color: var(--av-orange); }

/* ============ Buttons ============ */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  background: linear-gradient(135deg, var(--av-orange), var(--av-orange-2));
  color: #1a0d00;
  font-weight: 700;
  transition: all .3s;
  box-shadow: 0 8px 24px -8px rgba(255,122,24,0.6);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -8px rgba(255,122,24,0.8); }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 24px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.12);
  color: white;
  font-weight: 600;
  transition: all .3s;
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); }

/* ============ Glass Card ============ */
.glass {
  background: rgba(19,19,28,0.7);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 18px;
}

/* ============ Background particles ============ */
.bg-particles {
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-particles .particle {
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.25;
  animation: floatP 25s ease-in-out infinite;
}
.bg-particles .particle:nth-child(1) { background: #ff7a18; top: 10%; left: -5%; animation-delay: 0s; }
.bg-particles .particle:nth-child(2) { background: #b88aff; top: 50%; right: -5%; animation-delay: -5s; }
.bg-particles .particle:nth-child(3) { background: #ff7a18; bottom: 10%; left: 30%; animation-delay: -10s; opacity: 0.15;}
.bg-particles .particle:nth-child(4) { background: #ffc857; top: 20%; right: 30%; animation-delay: -15s; opacity: 0.1; }
.bg-particles .particle:nth-child(5) { background: #b88aff; bottom: 30%; left: 60%; animation-delay: -20s; opacity: 0.15; }
@keyframes floatP {
  0%, 100% { transform: translate(0,0) scale(1); }
  33% { transform: translate(80px, -60px) scale(1.1); }
  66% { transform: translate(-60px, 80px) scale(0.9); }
}

/* ============ Modal ============ */
#premium-modal.open { display: flex !important; }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.92) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.animate-modal-in { animation: modalIn .35s cubic-bezier(.34,1.56,.64,1) backwards; }

/* ============ Auth pages ============ */
.auth-bg {
  background:
    radial-gradient(ellipse at top left, rgba(255,122,24,0.18), transparent 60%),
    radial-gradient(ellipse at bottom right, rgba(184,138,255,0.18), transparent 60%),
    var(--av-bg);
}

.input-field {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--av-line);
  border-radius: 12px;
  padding: 12px 16px 12px 44px;
  color: var(--av-text);
  font-size: 14px;
  transition: all .25s;
}
.input-field:focus {
  outline: none;
  border-color: var(--av-orange);
  background: rgba(255,255,255,0.06);
  box-shadow: 0 0 0 4px rgba(255,122,24,0.12);
}

/* ============ Video Player overrides ============ */
.av-player {
  width: 100%;
  aspect-ratio: 16/9;
  background: black;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}
.av-player video { width: 100%; height: 100%; display: block; }

/* ============ Toast ============ */
.toast {
  pointer-events: auto;
  min-width: 280px;
  padding: 14px 18px;
  border-radius: 12px;
  background: rgba(19,19,28,0.95);
  backdrop-filter: blur(20px);
  border: 1px solid var(--av-line);
  display: flex; align-items: center; gap: 12px;
  animation: toastIn .35s cubic-bezier(.34,1.56,.64,1);
}
.toast.success { border-color: rgba(34,197,94,0.4); }
.toast.error { border-color: rgba(239,68,68,0.4); }
.toast.info { border-color: rgba(255,122,24,0.4); }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes toastOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

/* ============ Pricing card ============ */
.price-card {
  position: relative;
  padding: 32px 28px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(19,19,28,0.85), rgba(13,13,20,0.85));
  border: 1px solid var(--av-line);
  transition: all .35s;
}
.price-card:hover { transform: translateY(-6px); border-color: rgba(255,122,24,0.3); }
.price-card.featured {
  border-color: var(--av-orange);
  background: linear-gradient(180deg, rgba(255,122,24,0.08), rgba(13,13,20,0.95));
  box-shadow: 0 0 40px -10px rgba(255,122,24,0.4);
}
.price-card.vip {
  border-color: var(--av-vip);
  background: linear-gradient(180deg, rgba(184,138,255,0.08), rgba(13,13,20,0.95));
  box-shadow: 0 0 40px -10px rgba(184,138,255,0.4);
}

/* ============ Admin sidebar ============ */
.admin-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px;
  border-radius: 10px;
  color: var(--av-muted);
  transition: all .2s;
  font-size: 14px;
}
.admin-link:hover { background: rgba(255,255,255,0.05); color: white; }
.admin-link.active {
  background: linear-gradient(90deg, rgba(255,122,24,0.15), transparent);
  color: var(--av-orange);
  border-left: 3px solid var(--av-orange);
  padding-left: 13px;
}

/* ============ Loader ============ */
.spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,122,24,0.15);
  border-top-color: var(--av-orange);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.page-loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--av-bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column; gap: 20px;
}
.page-loader.hidden { opacity: 0; pointer-events: none; transition: opacity .5s; }
.page-loader .logo {
  font-family: 'Bebas Neue';
  font-size: 48px;
  letter-spacing: .1em;
  background: linear-gradient(90deg, white, var(--av-orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: pulseLogo 1.5s ease-in-out infinite;
}
@keyframes pulseLogo { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* tilt-on-hover utility */
.tilt-card { transform-style: preserve-3d; transition: transform .35s ease; }

/* episode list item */
.ep-item {
  display: flex; align-items: center; gap: 14px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  transition: all .2s;
  cursor: pointer;
}
.ep-item:hover { background: rgba(255,255,255,0.04); border-color: var(--av-line); }
.ep-item.locked { opacity: 0.55; }
.ep-item.locked:hover { opacity: 1; }
.ep-thumb {
  width: 130px; height: 73px;
  border-radius: 8px;
  background-size: cover; background-position: center;
  flex-shrink: 0;
  position: relative;
  background-color: var(--av-card);
}
.ep-thumb .lock-mini {
  position: absolute; inset: 0;
  background: rgba(7,7,11,0.65);
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}

/* genre chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--av-line);
  font-size: 12px;
  color: var(--av-muted);
  transition: all .2s;
}
.chip:hover, .chip.active {
  background: rgba(255,122,24,0.15);
  border-color: var(--av-orange);
  color: var(--av-orange);
}

/* ratings */
.star-row { display: inline-flex; gap: 2px; color: var(--av-gold); font-size: 12px; }

/* utility */
.line-clamp-2 {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-3 {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Fade in on scroll */
.fade-in-up { opacity: 0; transform: translateY(30px); transition: all .7s cubic-bezier(.2,.7,.2,1); }
.fade-in-up.visible { opacity: 1; transform: translateY(0); }

/* Video.js theme tweaks (when used) */
.video-js .vjs-big-play-button {
  background: rgba(255,122,24,0.9) !important;
  border: none !important;
  width: 80px !important;
  height: 80px !important;
  border-radius: 50% !important;
  line-height: 80px !important;
  font-size: 36px !important;
  box-shadow: 0 0 40px rgba(255,122,24,0.5);
}
.video-js .vjs-control-bar {
  background: linear-gradient(180deg, transparent, rgba(0,0,0,0.85)) !important;
}
.video-js .vjs-play-progress { background: var(--av-orange) !important; }
.video-js .vjs-slider:focus { box-shadow: none !important; }

/* =====================================================
   V2: PROFILES (Netflix-style)
   ===================================================== */
.profile-selector {
  background: radial-gradient(1200px 600px at 50% 0%, rgba(255,122,24,0.10), transparent 60%), #07070b;
}
.profile-tile {
  display: flex; flex-direction: column; align-items: center;
  background: transparent; border: 0; cursor: pointer;
  transition: transform .25s ease;
}
.profile-tile:hover { transform: translateY(-4px) scale(1.04); }
.profile-tile-add { opacity: 0.7; }
.profile-tile-add:hover { opacity: 1; }
.profile-avatar {
  position: relative; width: 132px; height: 132px;
  border-radius: 22px; background: var(--av-card, #13131c);
  display: grid; place-items: center;
  border: 3px solid var(--av-line, #1f1f2e);
  overflow: hidden; transition: all .25s ease;
  box-shadow: 0 12px 35px -10px rgba(0,0,0,0.6);
}
.profile-tile:hover .profile-avatar {
  border-color: var(--av-orange, #ff7a18);
  box-shadow: 0 0 60px -10px rgba(255,122,24,0.6);
}
.profile-avatar img {
  width: 100%; height: 100%; object-fit: cover;
}
.profile-avatar-add {
  border: 3px dashed var(--av-line);
  color: var(--av-muted);
}
.profile-tile-add:hover .profile-avatar-add {
  border-color: var(--av-orange);
  color: var(--av-orange);
}
.profile-avatar.is-kids {
  border-color: #38bdf8;
}
.profile-kids-tag {
  position: absolute; bottom: 6px; left: 6px; right: 6px;
  background: #38bdf8; color: #000;
  font-size: 9px; font-weight: 900; letter-spacing: 1px;
  text-align: center; padding: 2px 0; border-radius: 6px;
}
.profile-lock {
  position: absolute; top: 8px; right: 8px;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0,0,0,0.7); display: grid; place-items: center;
  font-size: 12px; color: #ff7a18;
}

/* Profile themes - animated borders */
.profile-avatar.theme-sakura,
.theme-sakura .profile-avatar {
  border-color: #ff7eb9;
  box-shadow: 0 0 30px -5px rgba(255,126,185,0.5);
}
.profile-avatar.theme-neon,
.theme-neon .profile-avatar {
  border-color: #00d4ff;
  box-shadow: 0 0 30px -5px rgba(0,212,255,0.5);
}
.profile-avatar.theme-midnight,
.theme-midnight .profile-avatar {
  border-color: #7c5cff;
  box-shadow: 0 0 30px -5px rgba(124,92,255,0.5);
}
.profile-avatar.theme-vip,
.theme-vip .profile-avatar {
  border: 3px solid transparent;
  background:
    linear-gradient(#13131c,#13131c) padding-box,
    linear-gradient(135deg, #ffc857, #ff7a18, #b88aff, #ffc857) border-box;
  animation: vipBorder 3s linear infinite;
  background-size: 100% 100%, 300% 300%;
}
@keyframes vipBorder {
  0%   { background-position: 0 0, 0% 50%; }
  100% { background-position: 0 0, 300% 50%; }
}
.profile-tile.theme-vip:hover .profile-avatar {
  box-shadow: 0 0 70px -8px rgba(255,200,87,0.7);
}

/* Avatar picker */
.avatar-tile {
  border: 2px solid var(--av-line);
  border-radius: 12px; overflow: hidden;
  background: var(--av-card); cursor: pointer;
  transition: all .15s ease;
  padding: 0; aspect-ratio: 1/1;
}
.avatar-tile img { width: 100%; height: 100%; display: block; }
.avatar-tile:hover { border-color: var(--av-orange); transform: scale(1.05); }
.avatar-tile.active { border-color: var(--av-orange); box-shadow: 0 0 20px -4px rgba(255,122,24,.7); }

/* Theme picker */
.theme-tile {
  border: 2px solid var(--av-line);
  border-radius: 14px; padding: 8px;
  background: var(--av-card); cursor: pointer;
  transition: all .15s ease; text-align: center;
}
.theme-tile:hover { border-color: var(--av-orange); }
.theme-tile.active { border-color: var(--av-orange); box-shadow: 0 0 24px -8px rgba(255,122,24,.7); }
.theme-tile.locked { opacity: .5; cursor: not-allowed; }

/* =====================================================
   V2: CHAT (Discord-style)
   ===================================================== */
.chat-app {
  height: 100vh; overflow: hidden;
  background: #07070b;
}
.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr 260px;
  height: calc(100vh - 64px);
  gap: 0;
}
.chat-sidebar, .chat-online {
  background: #0d0d14; border-right: 1px solid var(--av-line);
  display: flex; flex-direction: column;
  min-height: 0; overflow: hidden;
}
.chat-online {
  border-left: 1px solid var(--av-line); border-right: 0;
}
.chat-main {
  display: flex; flex-direction: column;
  min-height: 0; min-width: 0;
  background: #07070b;
}
.chat-header {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--av-line);
  background: rgba(13,13,20,0.85);
  backdrop-filter: blur(12px);
}
.chat-channel-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 10px;
  color: var(--av-muted); font-size: 14px;
  transition: all .15s ease; cursor: pointer;
}
.chat-channel-link:hover { background: rgba(255,255,255,0.04); color: #e9e9f3; }
.chat-channel-link.active {
  background: rgba(255,122,24,0.12); color: #ff9a3c;
  border-left: 3px solid var(--av-orange);
  padding-left: 9px;
}

.chat-messages {
  flex: 1; min-height: 0; overflow-y: auto;
  padding: 20px;
  scroll-behavior: smooth;
}
.chat-messages::-webkit-scrollbar { width: 8px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }

.chat-msg {
  display: flex; gap: 12px; padding: 8px 10px;
  border-radius: 10px; margin-bottom: 4px;
  transition: background .15s ease;
  animation: chatMsgIn .25s ease;
}
@keyframes chatMsgIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-msg:hover { background: rgba(255,255,255,0.03); }
.chat-msg.is-pinned { background: rgba(255,122,24,0.06); border-left: 2px solid var(--av-orange); }
.chat-msg.is-deleted { opacity: 0.5; }

.chat-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--av-card); flex-shrink: 0;
  display: grid; place-items: center; font-weight: 700;
  border: 2px solid var(--av-line); overflow: hidden;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-avatar.role-vip { border-color: var(--av-vip); box-shadow: 0 0 12px -2px rgba(184,138,255,.6); }
.chat-avatar.role-premium { border-color: var(--av-orange); }
.chat-avatar.role-admin { border-color: #ef4444; }

.chat-msg-body { flex: 1; min-width: 0; position: relative; }
.chat-msg-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 2px;
  font-size: 14px;
}
.chat-msg-name { font-weight: 600; color: #f1f1f6; }
.chat-msg-time { font-size: 11px; color: var(--av-muted); }
.chat-msg-content {
  font-size: 14px; line-height: 1.5; color: #d8d8e4;
  word-wrap: break-word; overflow-wrap: anywhere;
}
.chat-attachment {
  max-width: 360px; max-height: 280px;
  border-radius: 10px; margin-top: 6px;
  display: block; border: 1px solid var(--av-line);
}

.role-badge {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 9px; font-weight: 800; letter-spacing: 0.5px;
  padding: 2px 6px; border-radius: 4px; text-transform: uppercase;
}
.role-badge.admin { background: #ef444420; color: #f87171; }
.role-badge.vip { background: rgba(184,138,255,0.15); color: var(--av-vip); animation: vipPulse 2s ease infinite; }
@keyframes vipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184,138,255,0); }
  50%      { box-shadow: 0 0 12px 0 rgba(184,138,255,0.5); }
}
.role-badge.premium { background: rgba(255,122,24,0.15); color: var(--av-orange); }

.chat-reactions {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px;
}
.chat-reaction {
  background: rgba(255,255,255,0.05); border: 1px solid var(--av-line);
  border-radius: 12px; padding: 2px 8px; font-size: 12px;
  cursor: pointer; transition: all .15s;
}
.chat-reaction:hover { background: rgba(255,122,24,0.1); border-color: var(--av-orange); }
.chat-reaction.mine { background: rgba(255,122,24,0.18); border-color: var(--av-orange); color: var(--av-orange); }

.chat-msg-actions {
  position: absolute; top: -8px; right: 8px;
  display: none; gap: 4px;
  background: var(--av-card); border: 1px solid var(--av-line);
  border-radius: 8px; padding: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.chat-msg:hover .chat-msg-actions { display: flex; }
.chat-msg-actions button {
  background: transparent; border: 0; cursor: pointer;
  width: 28px; height: 28px; border-radius: 6px;
  color: var(--av-muted); font-size: 13px;
  transition: all .15s;
}
.chat-msg-actions button:hover { background: rgba(255,255,255,0.05); color: var(--av-orange); }

.chat-typing {
  padding: 0 20px; min-height: 22px;
  font-size: 12px; color: var(--av-muted);
}
.typing-pulse { animation: typingPulse 1.2s ease infinite; }
@keyframes typingPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

.chat-composer {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-top: 1px solid var(--av-line);
  background: rgba(13,13,20,0.7); backdrop-filter: blur(10px);
}
.chat-input {
  flex: 1; background: rgba(255,255,255,0.05);
  border: 1px solid var(--av-line); border-radius: 999px;
  padding: 12px 18px; color: #fff; font-size: 14px;
  transition: border-color .15s;
}
.chat-input:focus { outline: none; border-color: var(--av-orange); }
.chat-input:disabled { opacity: 0.5; }

.chat-icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: transparent; border: 0;
  color: var(--av-muted); font-size: 18px; cursor: pointer;
  transition: all .15s; display: grid; place-items: center;
}
.chat-icon-btn:hover { background: rgba(255,255,255,0.06); color: var(--av-orange); }
.chat-burger { color: #fff; }

.chat-send {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--av-orange), var(--av-orange-2, #ff9a3c));
  border: 0; color: #000; font-size: 16px;
  cursor: pointer; transition: all .15s;
  display: grid; place-items: center;
}
.chat-send:hover { transform: scale(1.05); box-shadow: 0 0 25px -5px rgba(255,122,24,.8); }
.chat-send:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

.online-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: 10px;
  transition: background .15s;
}
.online-row:hover { background: rgba(255,255,255,0.04); }
.online-row.is-typing { background: rgba(255,122,24,0.06); }
.online-avatar {
  position: relative; width: 32px; height: 32px; border-radius: 50%;
  background: var(--av-card); display: grid; place-items: center;
  font-size: 12px; font-weight: 700; border: 2px solid var(--av-line);
  overflow: hidden;
}
.online-avatar img { width: 100%; height: 100%; object-fit: cover; }
.online-avatar.role-vip { border-color: var(--av-vip); }
.online-avatar.role-premium { border-color: var(--av-orange); }
.online-avatar.role-admin { border-color: #ef4444; }
.online-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #22c55e; border: 2px solid #0d0d14;
}

/* Emoji picker */
.emoji-picker {
  position: fixed; z-index: 200;
  background: var(--av-card); border: 1px solid var(--av-line);
  border-radius: 16px; padding: 10px;
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px;
  max-width: 240px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.6);
}
.emoji-picker.hidden { display: none; }
.emoji-tile {
  background: transparent; border: 0; cursor: pointer;
  width: 32px; height: 32px; font-size: 20px;
  border-radius: 8px; transition: background .12s;
}
.emoji-tile:hover { background: rgba(255,255,255,0.08); }

/* Chat responsive */
@media (max-width: 900px) {
  .chat-layout { grid-template-columns: 1fr; }
  .chat-sidebar, .chat-online {
    position: fixed; top: 64px; bottom: 0; width: 280px; z-index: 30;
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .chat-online { right: 0; transform: translateX(100%); border-left: 1px solid var(--av-line); }
  .chat-sidebar.open, .chat-online.open { transform: translateX(0); }
  .chat-attachment { max-width: 100%; }
}

/* =====================================================
   V2: MASSIVE CINEMATIC VIDEO PLAYER
   ===================================================== */
.av-player-wrap {
  position: relative; width: 100%;
  background: #000;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.8);
  transition: all .3s ease;
}
.av-player-wrap.theater {
  border-radius: 0;
}
.av-player-wrap .video-js {
  width: 100% !important;
  aspect-ratio: 16/9;
  height: auto !important;
  background: #000;
}
.av-player-controls {
  position: absolute; top: 12px; right: 12px;
  z-index: 5; display: flex; gap: 6px;
  opacity: 0; transition: opacity .2s ease;
}
.av-player-wrap:hover .av-player-controls,
.av-player-wrap.paused .av-player-controls { opacity: 1; }
.av-player-btn {
  background: rgba(0,0,0,0.6); backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff; border-radius: 10px;
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.av-player-btn:hover { background: rgba(255,122,24,0.85); border-color: var(--av-orange); }

/* Theater (wide) mode */
body.is-theater .av-page-grid { grid-template-columns: 1fr !important; }
body.is-theater .av-episode-sidebar { display: none; }
body.is-theater .av-player-wrap {
  margin-left: calc(50% - 50vw + 8px);
  margin-right: calc(50% - 50vw + 8px);
  border-radius: 0;
  max-width: 100vw;
}
body.is-theater .av-player-wrap .video-js {
  aspect-ratio: auto;
  height: calc(100vh - 220px) !important;
  max-height: 88vh;
}

/* Skip intro button */
.av-skip-intro {
  position: absolute; bottom: 80px; right: 24px;
  background: rgba(0,0,0,0.85); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,122,24,0.5); color: #fff;
  padding: 10px 18px; border-radius: 12px;
  font-weight: 600; cursor: pointer;
  display: none; align-items: center; gap: 8px;
  z-index: 4; animation: skipIntroIn .3s ease;
}
.av-skip-intro.show { display: flex; }
@keyframes skipIntroIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.av-skip-intro:hover { background: var(--av-orange); border-color: var(--av-orange); color: #000; }

/* Next episode overlay near end */
.av-next-ep {
  position: absolute; bottom: 80px; right: 24px;
  background: rgba(13,13,20,0.95); backdrop-filter: blur(14px);
  border: 1px solid var(--av-orange); border-radius: 16px;
  padding: 14px; width: 320px;
  display: none; z-index: 4;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}
.av-next-ep.show { display: block; animation: nextEpIn .3s ease; }
@keyframes nextEpIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.av-next-ep .label { font-size: 10px; color: var(--av-orange); text-transform: uppercase; letter-spacing: 1px; }
.av-next-ep .title { font-weight: 700; font-size: 15px; margin-top: 4px; }
.av-next-ep .meta { font-size: 12px; color: var(--av-muted); margin-top: 2px; }
.av-next-ep .actions { display: flex; gap: 6px; margin-top: 10px; }

/* Profile theme variants applied to navbar avatar borders */
.av-profile-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  background: rgba(255,255,255,0.06);
  font-size: 11px;
}

/* Notifications */
.notif-dot {
  position: absolute; top: 6px; right: 6px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #ef4444; border: 2px solid #07070b;
  animation: notifPulse 1.5s ease infinite;
}
@keyframes notifPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,.7); }
  50%      { box-shadow: 0 0 0 6px rgba(239,68,68,0); }
}
.notif-panel {
  position: absolute; right: 0; top: calc(100% + 6px);
  width: 360px; max-height: 480px; overflow-y: auto;
  background: rgba(13,13,20,0.96); backdrop-filter: blur(14px);
  border: 1px solid var(--av-line); border-radius: 16px;
  display: none; z-index: 60;
  box-shadow: 0 20px 60px rgba(0,0,0,0.7);
}
.notif-panel.open { display: block; }
.notif-row {
  display: flex; gap: 10px; padding: 12px 14px;
  border-bottom: 1px solid var(--av-line);
  transition: background .15s;
}
.notif-row:hover { background: rgba(255,255,255,0.04); }
.notif-row.unread { background: rgba(255,122,24,0.05); border-left: 3px solid var(--av-orange); padding-left: 11px; }

/* Image drop zone */
.drop-zone {
  border: 2px dashed var(--av-line);
  border-radius: 16px; padding: 24px; text-align: center;
  color: var(--av-muted); cursor: pointer;
  transition: all .15s;
}
.drop-zone:hover, .drop-zone.dragging {
  border-color: var(--av-orange);
  background: rgba(255,122,24,0.05);
  color: var(--av-text);
}
.drop-zone-preview {
  margin-top: 12px; max-width: 240px;
  border-radius: 12px; border: 1px solid var(--av-line);
  overflow: hidden;
}
.drop-zone-preview img { width: 100%; height: auto; display: block; }
