/* VNPunchFlix Ultra-Light Cinematic Dark Mode CSS (GPU-Accelerated, Mobile Blur Disabled) */
:root {
  --bg: #08080d;
  --surface: #12121b;
  --surface-2: #1a1a26;
  --border: rgba(255, 255, 255, 0.08);
  --red: #e50914;
  --red-hover: #ff1e29;
  --text: #f4f4f8;
  --muted: #9ca3af;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Custom thin scrollbars */
.row-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.row-scroll::-webkit-scrollbar { display: none; }

/* GPU-accelerated movie card (transform & opacity ONLY) */
.movie-card {
  position: relative;
  flex: 0 0 155px;
  cursor: pointer;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  will-change: transform;
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease;
}
@media (min-width: 768px) {
  .movie-card { flex: 0 0 210px; }
}
.movie-card:hover {
  transform: translateY(-5px) scale(1.03);
  border-color: rgba(229, 9, 20, 0.55);
  z-index: 10;
}
.movie-card-grid { flex: none; width: 100%; }

.poster-box {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  background: #14141f;
  overflow: hidden;
}
.poster-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease, opacity 0.25s ease;
}
.movie-card:hover .poster-box img {
  transform: scale(1.05);
}

/* Hover Preview Video Layer */
.hover-preview-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.25s ease;
  background: #000;
}
.hover-preview-video.ready { opacity: 1; }

/* Skeleton Loading (GPU transform shimmer) */
.skeleton-card {
  position: relative;
  overflow: hidden;
  background: #14141f;
  border-radius: 14px;
  aspect-ratio: 2 / 3;
}
.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.2s infinite;
}
@keyframes shimmer {
  100% { transform: translateX(100%); }
}

/* Desktop translucent glass; DISABLED on mobile for 60 FPS low-end phones */
.glass-bar {
  background: rgba(8, 8, 13, 0.84);
  backdrop-filter: blur(12px);
}
@media (max-width: 768px) {
  .glass-bar {
    background: rgba(8, 8, 13, 0.97);
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

/* Spoiler comment blur */
.spoiler-hidden {
  filter: blur(7px);
  user-select: none;
  cursor: pointer;
  transition: filter 0.2s ease;
}
.spoiler-hidden:hover { filter: blur(4px); }

/* Skip Intro & Next Episode overlays */
.player-overlay-btn {
  position: absolute;
  right: 18px;
  bottom: 72px;
  z-index: 30;
  background: rgba(12, 12, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}
.player-overlay-btn:hover {
  background: var(--red);
  border-color: var(--red);
  transform: scale(1.04);
}

/* Subtitle cue styling */
video::cue {
  background: rgba(0, 0, 0, 0.78);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

/* Toast notification */
#toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  background: #181824;
  border: 1px solid rgba(229, 9, 20, 0.45);
  color: #fff;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast-item.show { opacity: 1; transform: translateY(0); }

/* ==================== WATCH PARTY FACE-TO-FACE THEATER (GPU-ACCELERATED, ZERO-LAG) ==================== */
.party-theater-active {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
}
@media (min-width: 1024px) {
  .party-theater-active {
    grid-template-columns: minmax(0, 1fr) 330px;
  }
}

.cam-tile {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #0d0d14;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  overflow: hidden;
  will-change: transform;
}
.cam-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cam-tile.local-mirror video {
  transform: scaleX(-1);
}

/* Mobile horizontal camera strip so cameras NEVER cover the movie or chat */
@media (max-width: 1023px) {
  #party-cams-grid {
    display: flex !important;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 4px;
  }
  #party-cams-grid .cam-tile {
    flex: 0 0 132px;
  }
}

/* GPU-only Floating Emoji Reactions (zero layout thrash) */
.floating-emoji {
  position: absolute;
  bottom: 18px;
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  animation: emojiFloatUp 2.3s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.65));
}
@keyframes emojiFloatUp {
  0% { transform: translate3d(0, 0, 0) scale(0.6); opacity: 0; }
  15% { transform: translate3d(0, -35px, 0) scale(1.15); opacity: 1; }
  85% { transform: translate3d(0, -210px, 0) scale(1); opacity: 0.92; }
  100% { transform: translate3d(0, -265px, 0) scale(0.85); opacity: 0; }
}

