/* ==========================================================================
   OneView — Design Tokens
   Palette: near-black base, violet→rose signature gradient, live-pulse red
   Type: Space Grotesk (display) / Inter (body)
   ========================================================================== */
:root {
  --bg: #0a0b0e;
  --bg-elevated: #14171c;
  --bg-card: #1a1e24;
  --bg-card-hover: #232830;
  --border: rgba(255,255,255,0.08);
  --text: #f5f6f7;
  --text-muted: #9aa1ac;
  --text-dim: #6b7280;

  --accent-1: #7c3aed;
  --accent-2: #e11d48;
  --accent-gradient: linear-gradient(135deg, #7c3aed 0%, #c026d3 50%, #e11d48 100%);
  --accent-gradient-soft: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(225,29,72,0.25));

  --live-red: #ff3b4e;
  --success: #22c55e;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-card: 0 8px 24px rgba(0,0,0,0.4);
  --shadow-elevated: 0 20px 60px rgba(0,0,0,0.6);

  --nav-h: 68px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
a { color: inherit; text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--text-muted); }

::-webkit-scrollbar { height: 8px; width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.25); }

:focus-visible {
  outline: 2px solid #a78bfa;
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 9999;
  background: var(--accent-gradient); color: white; font-weight: 700;
  padding: 12px 20px; border-radius: var(--radius-sm);
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 22px; border-radius: var(--radius-md);
  font-weight: 600; font-size: 0.95rem;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--accent-gradient); color: white;
  box-shadow: 0 4px 20px rgba(124,58,237,0.35);
}
.btn-primary:hover { box-shadow: 0 6px 28px rgba(124,58,237,0.55); transform: translateY(-1px); }
.btn-ghost {
  background: rgba(255,255,255,0.08); color: var(--text);
  backdrop-filter: blur(12px);
}
.btn-ghost:hover { background: rgba(255,255,255,0.15); }
.btn-lg { padding: 14px 28px; font-size: 1.02rem; }
.btn-icon {
  width: 44px; height: 44px; padding: 0; border-radius: 50%;
  background: rgba(255,255,255,0.08); display: inline-flex; align-items: center; justify-content: center;
}
.btn-icon:hover { background: rgba(255,255,255,0.18); }
.btn-icon svg { width: 20px; height: 20px; }
.btn-block { width: 100%; justify-content: center; }
.link { color: #c4b5fd; font-weight: 600; text-decoration: underline; }

/* ==========================================================================
   Loader
   ========================================================================== */
.loader {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
}
.loader-mark { font-family: var(--font-display); font-size: 2.4rem; font-weight: 700; letter-spacing: -0.02em; }
.loader-accent {
  background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.loader-bar { width: 180px; height: 3px; background: rgba(255,255,255,0.1); border-radius: 3px; overflow: hidden; }
.loader-bar-fill { width: 30%; height: 100%; background: var(--accent-gradient); border-radius: 3px; }

/* ==========================================================================
   Live pulse dot (signature motif)
   ========================================================================== */
.live-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--live-red);
  box-shadow: 0 0 0 0 rgba(255,59,78,0.7);
  animation: pulse-live 1.8s infinite;
}
.live-dot.sm { width: 7px; height: 7px; }
@keyframes pulse-live {
  0% { box-shadow: 0 0 0 0 rgba(255,59,78,0.6); }
  70% { box-shadow: 0 0 0 10px rgba(255,59,78,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,59,78,0); }
}

/* ==========================================================================
   Navbar
   ========================================================================== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 500;
  height: var(--nav-h);
  transition: background 0.35s var(--ease), box-shadow 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}
.navbar.scrolled {
  background: rgba(10,11,14,0.85);
  backdrop-filter: blur(16px);
  box-shadow: 0 2px 20px rgba(0,0,0,0.35);
}
.nav-inner {
  height: 100%; max-width: 1600px; margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
  padding: 0 32px;
}
.brand {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem;
  letter-spacing: -0.02em; flex-shrink: 0;
}
.brand span { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.nav-links { display: flex; gap: 28px; flex-shrink: 0; }
.nav-link {
  font-size: 0.92rem; font-weight: 500; color: var(--text-muted);
  position: relative; padding: 6px 0; transition: color 0.2s;
}
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -4px; width: 0; height: 2px;
  background: var(--accent-gradient); transition: width 0.25s var(--ease); border-radius: 2px;
}
.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.search-box { position: relative; display: flex; align-items: center; }
.icon-search { width: 18px; height: 18px; color: var(--text-muted); position: absolute; left: 14px; pointer-events: none; }
.search-box input {
  width: 230px; background: rgba(255,255,255,0.08); border: 1px solid transparent;
  border-radius: 999px; padding: 9px 14px 9px 38px; color: var(--text); font-size: 0.88rem;
  transition: width 0.3s var(--ease), background 0.3s var(--ease), border-color 0.3s var(--ease);
}
.search-box input::placeholder { color: var(--text-dim); }
.search-box input:focus { width: 300px; background: rgba(255,255,255,0.12); border-color: rgba(124,58,237,0.5); outline: none; }
.search-results {
  position: absolute; top: calc(100% + 10px); right: 0; width: 340px; max-height: 420px; overflow-y: auto;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated); opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.search-results.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.search-result-item { display: flex; gap: 12px; padding: 10px 14px; align-items: center; transition: background 0.15s; }
.search-result-item:hover { background: rgba(255,255,255,0.06); }
.search-result-item img { width: 42px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }
.search-result-item .sr-title { font-size: 0.86rem; font-weight: 600; }
.search-result-item .sr-genre { font-size: 0.75rem; color: var(--text-muted); }
.search-empty { padding: 20px 14px; color: var(--text-muted); font-size: 0.85rem; text-align: center; }

.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--accent-gradient); display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem; color: white;
}
.profile-btn { border-radius: 50%; transition: transform 0.2s; }
.profile-btn:hover { transform: scale(1.05); }
.profile-menu {
  position: fixed; top: var(--nav-h); right: 32px; width: 240px;
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated); padding: 8px; z-index: 600;
  opacity: 0; pointer-events: none; transform: translateY(-8px);
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}
.profile-menu.open { opacity: 1; pointer-events: auto; transform: translateY(0); }
.profile-menu-header { padding: 12px 12px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; display: flex; flex-direction: column; }
.profile-menu-header span:first-child { font-weight: 600; font-size: 0.95rem; }
.profile-menu-header .muted { font-size: 0.78rem; margin-top: 2px; }
.profile-menu-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px;
  font-size: 0.88rem; font-weight: 500; transition: background 0.15s;
}
.profile-menu-item:hover { background: rgba(255,255,255,0.08); }
.profile-menu-item.accent { color: #c4b5fd; }
.profile-menu-item.danger { color: #fb7185; }

.mobile-menu-btn { display: none; flex-direction: column; gap: 5px; width: 24px; }
.mobile-menu-btn span { height: 2px; background: var(--text); border-radius: 2px; }
.mobile-nav {
  display: none; flex-direction: column; background: rgba(10,11,14,0.97); backdrop-filter: blur(16px);
  position: fixed; top: var(--nav-h); left: 0; right: 0; padding: 12px 20px; z-index: 490;
  border-bottom: 1px solid var(--border);
  transform: translateY(-120%); transition: transform 0.3s var(--ease);
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav .nav-link { padding: 14px 4px; border-bottom: 1px solid var(--border); }

/* ==========================================================================
   Auth Modal
   ========================================================================== */
.auth-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease); }
.auth-modal.open { opacity: 1; pointer-events: auto; }
.auth-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.75); backdrop-filter: blur(6px); }
.auth-card {
  position: relative; width: 420px; max-width: 92vw; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 36px 32px;
  box-shadow: var(--shadow-elevated); transform: scale(0.92) translateY(20px); opacity: 0;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.auth-modal.open .auth-card { transform: scale(1) translateY(0); opacity: 1; }
.auth-close { position: absolute; top: 16px; right: 16px; color: var(--text-muted); font-size: 1.1rem; }
.auth-close:hover { color: var(--text); }
.auth-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.6rem; text-align: center; margin-bottom: 22px; }
.auth-brand span { background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-tabs { display: flex; gap: 4px; background: rgba(255,255,255,0.06); border-radius: var(--radius-md); padding: 4px; margin-bottom: 22px; }
.auth-tab { flex: 1; padding: 10px; border-radius: 8px; font-weight: 600; font-size: 0.88rem; color: var(--text-muted); transition: all 0.2s; }
.auth-tab.active { background: var(--bg-card); color: var(--text); }
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.field input {
  background: rgba(255,255,255,0.06); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 11px 14px; color: var(--text); font-size: 0.92rem; transition: border-color 0.2s;
}
.field input:focus { outline: none; border-color: #a78bfa; }
.auth-error { color: #fb7185; font-size: 0.82rem; min-height: 1em; }
.auth-hint { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-top: 4px; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; height: 92vh; min-height: 560px; width: 100%; overflow: hidden; }
.hero-slides { position: absolute; inset: 0; }
.hero-slide {
  position: absolute; inset: 0; background-size: cover; background-position: center top;
  opacity: 0; transition: opacity 1.1s ease; transform: scale(1.04);
}
.hero-slide.active { opacity: 1; animation: hero-kenburns 9s ease-out forwards; }
@keyframes hero-kenburns {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}
.hero-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(10,11,14,0.2) 0%, rgba(10,11,14,0.1) 30%, rgba(10,11,14,0.9) 88%, var(--bg) 100%),
    linear-gradient(90deg, rgba(10,11,14,0.95) 0%, rgba(10,11,14,0.5) 40%, rgba(10,11,14,0.05) 70%);
}
.hero-noise {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.035; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-content {
  position: absolute; left: 0; bottom: 14%; z-index: 2; max-width: 640px;
  padding: 0 32px 0 48px;
}
.hero-eyebrow {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font-size: 0.8rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted);
}
.hero-eyebrow .rank-num {
  font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; letter-spacing: -0.02em;
  background: var(--accent-gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,59,78,0.15); border: 1px solid rgba(255,59,78,0.4);
  color: #ff8a95; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 6px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05; letter-spacing: -0.02em; margin-bottom: 14px;
  text-shadow: 0 4px 30px rgba(0,0,0,0.5);
}
.hero-meta { font-size: 0.92rem; color: var(--text-muted); margin-bottom: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.hero-meta span:not(:last-child)::after { content: '•'; margin-left: 10px; color: var(--text-dim); }
.hero-tag {
  display: inline-block; border: 1px solid var(--border); border-radius: 5px;
  padding: 1px 8px; font-size: 0.72rem; font-weight: 600; color: var(--text-muted);
}
.hero-desc {
  font-size: 1rem; line-height: 1.6; color: rgba(245,246,247,0.85); margin-bottom: 26px;
  max-width: 560px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.hero-actions { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.hero-dots {
  position: absolute; right: 48px; bottom: 14%; z-index: 3;
  display: flex; flex-direction: column; gap: 10px;
}
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,0.3); transition: all 0.3s var(--ease); cursor: pointer; }
.hero-dot.active { background: var(--text); height: 26px; border-radius: 4px; }

/* ==========================================================================
   Section heads
   ========================================================================== */
.section-head { display: flex; align-items: center; justify-content: space-between; padding: 0 48px; margin-bottom: 16px; }
.section-head h2 {
  font-family: var(--font-display); font-size: 1.35rem; font-weight: 600;
  display: flex; align-items: center; gap: 10px; letter-spacing: -0.01em;
}
.section-head .view-all {
  font-size: 0.85rem; font-weight: 600; color: var(--text-muted);
  display: flex; align-items: center; gap: 4px; transition: color 0.2s, transform 0.2s var(--ease);
}
.section-head .view-all:hover { color: #c4b5fd; transform: translateX(2px); }
.section-head .view-all svg { width: 14px; height: 14px; }
.page-head { padding: calc(var(--nav-h) + 40px) 48px 20px; }
.page-head h2 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; }

/* ==========================================================================
   Live Strip
   ========================================================================== */
.live-strip-section { margin: 40px 0 8px; }
.live-strip { display: flex; gap: 18px; overflow-x: auto; padding: 4px 48px 20px; scroll-snap-type: x proximity; }
.live-strip::-webkit-scrollbar { display: none; }
.live-card {
  position: relative; flex-shrink: 0; width: 320px; aspect-ratio: 16/9;
  border-radius: var(--radius-md); overflow: hidden; cursor: pointer;
  scroll-snap-align: start; background: var(--bg-card);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.live-card:hover { transform: scale(1.04) translateY(-4px); box-shadow: var(--shadow-card); z-index: 5; }
.live-card img { width: 100%; height: 100%; object-fit: cover; }
.live-card-overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.85) 100%);
  display: flex; flex-direction: column; justify-content: flex-end; padding: 14px;
}
.live-card-badge {
  position: absolute; top: 10px; left: 10px;
  display: flex; align-items: center; gap: 6px;
  background: var(--live-red); color: white; font-size: 0.68rem; font-weight: 700;
  padding: 4px 9px; border-radius: 5px; letter-spacing: 0.03em;
}
.live-card-badge .live-dot { background: white; box-shadow: none; animation: none; }
.live-card-viewers {
  position: absolute; top: 10px; right: 10px;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(6px);
  font-size: 0.7rem; font-weight: 600; padding: 4px 9px; border-radius: 5px;
  display: flex; align-items: center; gap: 5px;
}
.live-card-title { font-weight: 700; font-size: 0.95rem; margin-bottom: 2px; }
.live-card-genre { font-size: 0.75rem; color: var(--text-muted); }
.live-card-playbtn {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,0.35); opacity: 0; transition: opacity 0.25s;
}
.live-card:hover .live-card-playbtn { opacity: 1; }
.live-card-playbtn svg { width: 44px; height: 44px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5)); }

/* ==========================================================================
   Rails (VOD carousels)
   ========================================================================== */
.rail { margin-bottom: 44px; }
.rail-track-wrap { position: relative; }
.rail-track {
  display: flex; gap: 14px; overflow-x: auto; padding: 6px 48px 16px; scroll-snap-type: x proximity;
  scroll-behavior: smooth;
}
.rail-track::-webkit-scrollbar { display: none; }
.rail-nav {
  position: absolute; top: 0; bottom: 16px; width: 56px; z-index: 10;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(90deg, var(--bg) 10%, transparent);
  opacity: 0; transition: opacity 0.25s; color: var(--text);
}
.rail-nav.right { right: 0; background: linear-gradient(270deg, var(--bg) 10%, transparent); }
.rail-track-wrap:hover .rail-nav { opacity: 1; }
.rail-nav svg { width: 26px; height: 26px; }

.title-card {
  position: relative; flex-shrink: 0; width: 200px; aspect-ratio: 2/3;
  border-radius: var(--radius-sm); overflow: hidden; cursor: pointer; background: var(--bg-card);
  scroll-snap-align: start;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), z-index 0s;
  will-change: transform;
}
.title-card:hover, .title-card:focus-visible { transform: scale(1.08) translateY(-6px); box-shadow: var(--shadow-card); z-index: 8; }
.title-card img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s var(--ease); background: var(--bg-card); }
.title-card:hover img { transform: scale(1.05); }
.title-card-overlay {
  position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,0.92) 100%);
  opacity: 0; transition: opacity 0.3s; display: flex; flex-direction: column; justify-content: flex-end; padding: 12px;
}
.title-card:hover .title-card-overlay, .title-card:focus-visible .title-card-overlay { opacity: 1; }
.title-card-title { font-weight: 700; font-size: 0.85rem; margin-bottom: 2px; }
.title-card-genre { font-size: 0.7rem; color: var(--text-muted); }
.title-card-tag {
  position: absolute; top: 8px; left: 8px; z-index: 2;
  background: rgba(10,11,14,0.75); backdrop-filter: blur(6px);
  border: 1px solid var(--border); color: var(--text);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.02em;
  padding: 3px 7px; border-radius: 4px;
}
.title-card-tag.accent { background: var(--accent-gradient); border-color: transparent; display: inline-flex; align-items: center; gap: 4px; }
.title-card-tag .live-dot { background: white; box-shadow: none; animation: none; }
.title-card-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,0.2); }
.title-card-progress-fill { height: 100%; background: var(--accent-gradient); }
.title-card-playbtn {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) scale(0.6);
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center; opacity: 0;
  transition: all 0.3s var(--ease);
}
.title-card:hover .title-card-playbtn, .title-card:focus-visible .title-card-playbtn { opacity: 1; transform: translate(-50%,-50%) scale(1); }
.title-card-playbtn svg { width: 18px; height: 18px; color: #0a0b0e; margin-left: 2px; }

/* ==========================================================================
   Ranked rail (Top 10 style) — numerals encode the actual rank, since this
   rail specifically represents a real ordered "most watched" list.
   ========================================================================== */
.rail-track.ranked { gap: 0; padding-left: 60px; }
.ranked-item {
  position: relative; display: flex; align-items: flex-end; flex-shrink: 0;
  margin-right: 4px; scroll-snap-align: start;
}
.rank-numeral {
  font-family: var(--font-display); font-weight: 700;
  font-size: 7rem; line-height: 1; letter-spacing: -0.04em;
  -webkit-text-stroke: 1px rgba(255,255,255,0.18);
  color: var(--bg);
  background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.02));
  -webkit-background-clip: text; background-clip: text;
  margin-right: -34px; margin-bottom: -6px; z-index: 1;
  pointer-events: none; user-select: none;
  transition: transform 0.3s var(--ease);
}
.ranked-item:hover .rank-numeral { transform: translateY(-4px); }
.ranked-item .title-card { width: 170px; }

.grid-rail {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px; padding: 0 48px 60px;
}
.grid-rail.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; padding: 0; }
.grid-rail .title-card { width: 100%; }

.empty-state { text-align: center; padding: 80px 20px; color: var(--text-muted); }
.empty-state p { font-size: 1.1rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state span { font-size: 0.9rem; }

.view { display: none; min-height: 60vh; }
.view.active { display: block; }

/* ==========================================================================
   Title Detail Modal
   ========================================================================== */
.detail-modal { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease); padding: 24px; }
.detail-modal.open { opacity: 1; pointer-events: auto; }
.detail-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(6px); }
.detail-card {
  position: relative; width: 780px; max-width: 100%; max-height: 88vh; overflow-y: auto;
  background: var(--bg-elevated); border-radius: var(--radius-lg); box-shadow: var(--shadow-elevated);
  transform: scale(0.94) translateY(20px); opacity: 0; transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.detail-modal.open .detail-card { transform: scale(1) translateY(0); opacity: 1; }
.detail-close {
  position: absolute; top: 16px; right: 16px; z-index: 5;
  width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; color: white;
}
.detail-close:hover { background: rgba(0,0,0,0.75); }
.detail-backdrop-img { height: 340px; background-size: cover; background-position: center; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.detail-backdrop-gradient { height: 140px; margin-top: -140px; background: linear-gradient(180deg, transparent, var(--bg-elevated)); position: relative; }
.detail-body { padding: 0 32px 32px; margin-top: -30px; position: relative; }
.detail-body h2 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; margin-bottom: 10px; }
.detail-meta { font-size: 0.88rem; color: var(--text-muted); margin-bottom: 14px; }
.detail-meta span:not(:last-child)::after { content: '•'; margin-left: 8px; margin-right: 0; color: var(--text-dim); }
.detail-desc { line-height: 1.65; color: rgba(245,246,247,0.85); margin-bottom: 24px; }
.detail-actions { display: flex; gap: 12px; margin-bottom: 32px; }
.btn-icon.copied svg { color: var(--success); }
.detail-related h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 16px; font-weight: 600; }

/* ==========================================================================
   Player Overlay
   ========================================================================== */
.player-overlay { position: fixed; inset: 0; z-index: 3000; background: #000; opacity: 0; pointer-events: none; transition: opacity 0.35s var(--ease); }
.player-overlay.open { opacity: 1; pointer-events: auto; }
.player-wrap { position: relative; width: 100%; height: 100%; display: flex; }
.player-topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20; padding: 20px 28px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(0,0,0,0.7), transparent);
  opacity: 1; transition: opacity 0.3s;
}
.player-close { display: flex; align-items: center; gap: 12px; font-weight: 600; font-size: 1rem; }
.player-close svg { width: 22px; height: 22px; }
.player-live-badge {
  display: flex; align-items: center; gap: 10px; background: rgba(255,59,78,0.15);
  border: 1px solid rgba(255,59,78,0.4); padding: 6px 14px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; color: #ff8a95;
}
.viewer-count { color: var(--text-muted); font-weight: 500; padding-left: 10px; border-left: 1px solid rgba(255,255,255,0.2); }
.player-stage { position: relative; flex: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
#video-player { width: 100%; height: 100%; object-fit: contain; background: #000; }

.reaction-canvas { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 15; }
.flying-emoji { position: absolute; font-size: 2rem; bottom: 90px; will-change: transform, opacity; }

.player-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 28px 22px;
  background: linear-gradient(0deg, rgba(0,0,0,0.85), transparent);
  opacity: 1; transition: opacity 0.3s;
}
.player-stage.controls-hidden .player-controls,
.player-stage.controls-hidden ~ .player-topbar { opacity: 0; }
.progress-row { margin-bottom: 12px; }
.progress-track { position: relative; height: 4px; background: rgba(255,255,255,0.25); border-radius: 4px; cursor: pointer; transition: height 0.15s; }
.progress-track:hover { height: 6px; }
.progress-buffered { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,255,255,0.35); border-radius: 4px; width: 0%; }
.progress-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-gradient); border-radius: 4px; width: 0%; }
.progress-handle {
  position: absolute; top: 50%; width: 13px; height: 13px; border-radius: 50%; background: white;
  transform: translate(-50%, -50%); left: 0%; box-shadow: 0 2px 6px rgba(0,0,0,0.4);
  opacity: 0; transition: opacity 0.15s;
}
.progress-track:hover .progress-handle { opacity: 1; }
.controls-row { display: flex; align-items: center; justify-content: space-between; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 14px; }
.ctrl-btn { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; border-radius: 8px; transition: background 0.2s; }
.ctrl-btn:hover { background: rgba(255,255,255,0.12); }
.ctrl-btn svg { width: 22px; height: 22px; }
#volume-slider { width: 90px; accent-color: #c026d3; cursor: pointer; }
.time-label { font-size: 0.82rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }

.reaction-bar { display: flex; gap: 6px; background: rgba(255,255,255,0.08); padding: 6px; border-radius: 999px; }
.reaction-btn { font-size: 1.1rem; padding: 6px 8px; border-radius: 999px; transition: transform 0.15s var(--ease), background 0.15s; }
.reaction-btn:hover { background: rgba(255,255,255,0.15); }
.reaction-btn:active { transform: scale(1.4); }

/* ==========================================================================
   Chat panel
   ========================================================================== */
.chat-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 340px; z-index: 25;
  background: rgba(15,17,21,0.96); backdrop-filter: blur(16px);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform 0.35s var(--ease);
}
.chat-panel.open { transform: translateX(0); }
.chat-head { padding: 18px 20px; font-weight: 700; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.chat-head button { color: var(--text-muted); font-size: 1.1rem; }
.chat-messages { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { font-size: 0.85rem; line-height: 1.4; animation: chat-in 0.3s var(--ease); }
@keyframes chat-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.chat-msg .chat-name { font-weight: 700; margin-right: 6px; }
.chat-msg .chat-name.system { color: #c4b5fd; }
.chat-msg .chat-text { color: rgba(245,246,247,0.9); }
.chat-input-row { display: flex; gap: 8px; padding: 14px; border-top: 1px solid var(--border); }
#chat-input {
  flex: 1; background: rgba(255,255,255,0.08); border: 1px solid var(--border); border-radius: 999px;
  padding: 10px 16px; color: var(--text); font-size: 0.85rem;
}
#chat-input:focus { outline: none; border-color: #a78bfa; }
.chat-send {
  width: 40px; height: 40px; border-radius: 50%; background: var(--accent-gradient);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}

/* ==========================================================================
   Toast
   ========================================================================== */
.toast {
  position: fixed; bottom: 28px; left: 50%; z-index: 4000;
  background: var(--bg-elevated); border: 1px solid var(--border);
  padding: 13px 22px; border-radius: 999px; font-size: 0.88rem; font-weight: 600;
  box-shadow: var(--shadow-elevated);
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

/* ==========================================================================
   Mini live ticker (signature floating element)
   ========================================================================== */
.mini-ticker {
  position: fixed; bottom: 24px; left: 24px; z-index: 400;
  display: flex; align-items: center; gap: 10px;
  background: rgba(20,23,28,0.9); backdrop-filter: blur(12px);
  border: 1px solid var(--border); padding: 10px 16px 10px 12px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 600; box-shadow: var(--shadow-card);
  cursor: pointer; max-width: 280px;
}
.mini-ticker-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live-red); flex-shrink: 0; animation: pulse-live 1.8s infinite; }
#mini-ticker-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
  .nav-links { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-nav { display: flex; }
  .search-box input { width: 160px; }
  .search-box input:focus { width: 200px; }
  .hero-content { max-width: 90%; padding: 0 24px; }
  .hero-dots { display: none; }
  .chat-panel { width: 100%; }
}
@media (max-width: 640px) {
  .nav-inner { padding: 0 16px; gap: 12px; }
  .search-box input { width: 120px; }
  .hero { height: 78vh; }
  .hero-actions { flex-wrap: wrap; }
  .section-head, .live-strip, .rail-track, .grid-rail, .page-head { padding-left: 20px; padding-right: 20px; }
  .title-card { width: 140px; }
  .live-card { width: 240px; }
  .detail-body { padding: 0 20px 24px; }
  .mini-ticker { left: 12px; right: 12px; max-width: none; bottom: 12px; }
  .controls-left { gap: 8px; }
  #volume-slider { display: none; }
  .rank-numeral { font-size: 4.2rem; margin-right: -18px; }
  .ranked-item .title-card { width: 120px; }
  .rail-track.ranked { padding-left: 36px; }
  .hero-eyebrow { font-size: 0.72rem; }
}
