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

:root {
  color-scheme: dark;
  --bg: #050509;
  --bg-elevated: #121018;
  --bg-elevated-2: #1a1722;
  --border: #262230;
  --border-hover: #3d3650;
  --accent: #b026ff;
  --accent-2: #ff2e92;
  --gold: #fbbf24;
  --cyan: #22d3ee;
  --text-dim: rgba(244,244,246,0.6);
}
body {
  background-color: var(--bg);
  color: #f4f4f6;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-image:
    radial-gradient(ellipse 1200px 600px at 15% -10%, rgba(176,38,255,0.16), transparent 60%),
    radial-gradient(ellipse 900px 500px at 100% 0%, rgba(34,211,238,0.08), transparent 60%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}
::-webkit-scrollbar { height: 10px; width: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #33333f; border-radius: 6px; }

.font-display { font-family: 'Space Grotesk', -apple-system, sans-serif; }

.brand-gradient {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: 'Space Grotesk', -apple-system, sans-serif;
}

.brand-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex; align-items: center; justify-content: center;
  font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 1.05rem; color: white;
  box-shadow: 0 0 22px -6px rgba(176,38,255,0.7);
}

/* The actual site logo (nav, landing header/footer) — public/favicon.svg rendered inline.
   Separate from .brand-mark, which stays a plain gradient badge reused for emoji feature icons. */
.logo-mark {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  box-shadow: 0 0 22px -6px rgba(176,38,255,0.7);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px -10px rgba(176,38,255,0.6);
  transition: box-shadow 0.2s ease, transform 0.2s ease, filter 0.2s ease;
}
.btn-primary:hover { box-shadow: 0 12px 32px -8px rgba(255,46,146,0.7); transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elevated-2); border: 1px solid var(--border);
  padding: 5px 13px; border-radius: 999px; font-size: 0.78rem; color: var(--text-dim);
  white-space: nowrap;
}
.chip-gold { color: var(--gold); border-color: rgba(251,191,36,0.35); background: rgba(251,191,36,0.08); }
.chip-cyan { color: var(--cyan); border-color: rgba(34,211,238,0.35); background: rgba(34,211,238,0.08); }

.row-scroll {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: visible;
  padding: 6px 4px 1.25rem;
  scroll-snap-type: x proximity;
}
.row-scroll::-webkit-scrollbar { height: 8px; }
.row-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.3rem;
  margin-bottom: 0.9rem; display: flex; align-items: center; gap: 10px;
}

.poster-card {
  flex: 0 0 auto;
  width: 170px;
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
}
.poster-frame {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 34px -16px rgba(0,0,0,0.8);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.poster-card:hover .poster-frame { transform: scale(1.055) translateY(-2px); box-shadow: 0 18px 40px -14px rgba(176,38,255,0.35); }
.poster-card img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
  display: block;
  background: #17171f;
}
.poster-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(5,5,9,0.95) 0%, rgba(5,5,9,0.25) 60%, transparent 100%);
  opacity: 0; transition: opacity 0.2s ease;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 10px;
  pointer-events: none;
}
.poster-card:hover .poster-overlay { opacity: 1; }
.poster-play {
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.18); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,0.3);
}
.poster-genres { font-size: 0.65rem; color: rgba(255,255,255,0.75); letter-spacing: 0.03em; }

.row-ranked .poster-card { padding-left: 34px; }
.rank-num {
  position: absolute; left: -8px; bottom: -14px; z-index: 2;
  font-family: 'Space Grotesk', sans-serif; font-weight: 800; font-size: 5rem; line-height: 0.8;
  color: var(--bg);
  -webkit-text-stroke: 2.5px var(--gold);
  paint-order: stroke fill;
  text-shadow: 0 0 30px rgba(251,191,36,0.3);
  pointer-events: none;
}

.profile-avatar {
  width: 100px;
  height: 100px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  font-weight: 800;
  color: white;
}

.plan-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-elevated);
  transition: border-color 0.2s ease;
}
.plan-card:hover { border-color: var(--border-hover); }
.plan-card.featured {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 1px var(--accent-2), 0 16px 44px -14px rgba(255,46,146,0.4);
}

/* Hero / backdrop banner (app.html home, index.html landing, detail.html) */
.hero-backdrop {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  max-height: 560px;
  min-height: 320px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.hero-backdrop img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(to top, var(--bg) 0%, rgba(5,5,9,0.35) 42%, transparent 75%),
    linear-gradient(to right, rgba(5,5,9,0.88) 0%, rgba(5,5,9,0.25) 55%, transparent 85%);
}
.hero-content {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 2rem clamp(1.25rem, 5vw, 4rem) 2.5rem;
  max-width: 720px;
}

/* Fact pills (detail page) */
.fact-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg-elevated-2); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; font-size: 0.8rem; color: var(--text-dim);
}

#player-container { position: relative; background: black; width: 100%; }
#player-container video { width: 100%; height: 100%; display: block; background: black; }

.channel-bug {
  position: absolute;
  bottom: 16px;
  right: 16px;
  opacity: 0.9;
  pointer-events: none;
  z-index: 20;
}

.ad-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  background: rgba(0,0,0,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.8rem;
  z-index: 20;
}

.spinner {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--accent), var(--accent-2), transparent 65%);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 4px), #000 calc(100% - 4px));
  animation: spin 0.9s linear infinite;
  filter: drop-shadow(0 0 10px rgba(176,38,255,0.35));
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Custom player control bar (public/js/player-controls.js) */
.pc-bar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 30;
  padding: 30px 18px 14px;
  background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.68) 45%, rgba(0,0,0,0.18) 78%, transparent 100%);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.pc-bar.pc-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.pc-bar.pc-hidden { display: none; }

/* Top scrim + in-player title (visible in fullscreen, where the page's own header is gone) */
.pc-top {
  position: absolute;
  left: 0; right: 0; top: 0;
  z-index: 29;
  padding: 18px 20px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.72) 0%, transparent 100%);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.pc-top.pc-visible { opacity: 1; transform: translateY(0); }
.pc-top.pc-hidden { display: none; }
.pc-title {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

/* Center play button, shown while paused */
.pc-center-btn {
  position: absolute;
  top: 50%; left: 50%;
  width: 72px; height: 72px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,8,16,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff; cursor: pointer;
  z-index: 25;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.pc-center-btn svg { width: 32px; height: 32px; margin-left: 3px; }
.pc-center-btn.pc-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.12), 0 0 42px -8px rgba(176,38,255,0.6), 0 12px 30px -10px rgba(0,0,0,0.65);
}
.pc-center-btn.pc-visible:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  transform: translate(-50%, -50%) scale(1.06);
}
.pc-center-btn.pc-hidden { display: none; }

.pc-seek { position: relative; padding: 6px 2px 14px; cursor: pointer; }
.pc-seek-disabled { opacity: 0.35; pointer-events: none; }
.pc-seek-track {
  position: relative;
  height: 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.22);
  transition: height 0.12s ease;
}
.pc-seek:hover .pc-seek-track, .pc-seek.pc-dragging .pc-seek-track { height: 7px; }
.pc-seek-buffered, .pc-seek-played {
  position: absolute; top: 0; left: 0; height: 100%; border-radius: 4px; width: 0%;
}
.pc-seek-buffered { background: rgba(255,255,255,0.38); }
.pc-seek-played {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px rgba(176,38,255,0.5), 0 0 4px rgba(255,46,146,0.55);
}
.pc-seek-thumb {
  position: absolute; top: 50%; left: 0%;
  width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transform: translate(-50%, -50%) scale(0.8);
  box-shadow: 0 0 0 3px rgba(176,38,255,0.32), 0 2px 6px rgba(0,0,0,0.5);
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.pc-seek:hover .pc-seek-thumb, .pc-seek.pc-dragging .pc-seek-thumb { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.pc-scrub-tooltip {
  position: absolute;
  bottom: 20px;
  transform: translateX(-50%);
  background: rgba(15,13,20,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.12s ease;
}
.pc-scrub-tooltip.pc-visible { opacity: 1; }

.pc-row { display: flex; align-items: center; gap: 2px; color: #fff; }
.pc-btn {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px;
  background: transparent; border: none; color: #fff; cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.pc-btn:hover { background: rgba(255,255,255,0.14); }
.pc-btn:active { transform: scale(0.92); }
.pc-btn svg { width: 21px; height: 21px; }

.pc-volume {
  width: 76px; accent-color: var(--accent); cursor: pointer;
}
.pc-cc { position: relative; }
.pc-cc.pc-cc-active { color: var(--accent-2); }
.pc-cc.pc-cc-active svg { filter: drop-shadow(0 0 4px rgba(255,46,146,0.6)); }
.pc-cc-dot {
  position: absolute; top: 4px; right: 4px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--gold);
  animation: pc-pulse 1.1s ease-in-out infinite;
}
@keyframes pc-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.pc-toast {
  position: absolute;
  right: 16px; bottom: 56px;
  background: rgba(18,16,24,0.95);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.78rem;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 8px 24px -8px rgba(0,0,0,0.6);
}
.pc-time { font-size: 0.8rem; font-variant-numeric: tabular-nums; color: rgba(255,255,255,0.85); margin-left: 6px; white-space: nowrap; }
.pc-spacer { flex: 1; }

@media (max-width: 640px) {
  .pc-volume { display: none; }
  .pc-center-btn { width: 60px; height: 60px; }
  .pc-center-btn svg { width: 26px; height: 26px; }
}

/* Skip Intro / Next Up panels — glass finish matching the player chrome */
.pc-skip-intro {
  position: absolute; bottom: 88px; right: 20px; z-index: 20;
  background: rgba(18,16,24,0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.22);
  color: #fff; font-weight: 600; font-size: 0.9rem;
  padding: 10px 20px; border-radius: 8px; cursor: pointer;
  box-shadow: 0 10px 28px -10px rgba(0,0,0,0.6);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.pc-skip-intro:hover {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: transparent;
  transform: translateY(-1px);
}

.pc-next-up {
  position: absolute; bottom: 88px; right: 20px; z-index: 20;
  background: rgba(15,13,20,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 16px; width: 260px;
  box-shadow: 0 0 0 1px rgba(176,38,255,0.15), 0 20px 44px -14px rgba(0,0,0,0.7);
}
