/* ═══════════════════════════════════════════════════════════════
   PYROGLOW · 2026 COMPLETE REDESIGN
   A brand-new cinematic design system.
   Variable names preserved for JS compatibility (accent picker, etc.)
   ═══════════════════════════════════════════════════════════════ */

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

:root {
  /* Accent (JS overrides --flame / --flame-rgb via accent picker) */
  --flame: #ff5722;
  --flame-rgb: 255, 87, 34;
  --ember: #ffb020;

  /* Surfaces — deep, cinematic, slight cool tint */
  --bg: #07080d;
  --surface: rgba(255, 255, 255, 0.035);
  --surface2: rgba(255, 255, 255, 0.06);
  --surface3: rgba(255, 255, 255, 0.09);

  /* Text */
  --text: #f4f6fb;
  --text-muted: #9aa3b2;
  --text-dim: #5b6472;

  /* Lines & radius */
  --border: rgba(255, 255, 255, 0.08);
  --radius: 16px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 0.42s;

  --glass-blur: blur(22px) saturate(140%);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 1px rgba(var(--flame-rgb), 0.35), 0 18px 60px rgba(var(--flame-rgb), 0.28);
}

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


html { scroll-behavior: smooth; background: var(--bg); overscroll-behavior-y: none; }
html.loader-lock, body.loader-lock { overflow: hidden; height: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background:
    radial-gradient(1200px 600px at 12% -5%, rgba(var(--flame-rgb), 0.16), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(120, 90, 255, 0.12), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, rgba(0, 150, 200, 0.08), transparent 60%),
    linear-gradient(180deg, #090a11 0%, #06070c 50%, #050609 100%);
  background-attachment: fixed;
}

/* Ambient animated aurora layer */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(600px 300px at 20% 30%, rgba(var(--flame-rgb), 0.05), transparent 70%),
    radial-gradient(500px 260px at 80% 60%, rgba(120, 90, 255, 0.05), transparent 70%);
  animation: auroraDrift 22s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  0% { transform: translate3d(0, 0, 0) scale(1); opacity: 0.7; }
  100% { transform: translate3d(0, -30px, 0) scale(1.1); opacity: 1; }
}

.hero, main, footer { position: relative; z-index: 1; }

h1, h2, h3, .logo, .hero-title { font-family: 'Space Grotesk', 'Inter', sans-serif; }

a { color: inherit; }
button { font-family: inherit; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(var(--flame-rgb), 0.5); background-clip: padding-box; }

::selection { background: rgba(var(--flame-rgb), 0.35); color: #fff; }

#devblock { display: none; position: fixed; inset: 0; z-index: 99999; background: #000; align-items: center; justify-content: center; flex-direction: column; gap: 16px; }
#devblock.show { display: flex; }
#devblock p { color: #fff; font-size: 18px; }


/* ═══════════════════════════════════════════════
   LOADING SCREEN
   ═══════════════════════════════════════════════ */
.site-loader {
  position: fixed; inset: 0; z-index: 10000;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(700px 500px at 50% 40%, rgba(var(--flame-rgb), 0.16), transparent 60%),
    linear-gradient(180deg, #08090f, #050609);
  transition: opacity 0.6s var(--ease), visibility 0.6s var(--ease);
}
.site-loader.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.site-loader-sparks { position: absolute; inset: 0; overflow: hidden; opacity: 0.9; }
.site-loader-sparks span,
.homepage-sparks span {
  position: absolute; left: -10vw;
  width: var(--spark-size, 3px); height: var(--spark-size, 3px);
  border-radius: 999px; background: var(--flame);
  box-shadow: 0 0 14px rgba(var(--flame-rgb), 0.85), 38px 0 20px rgba(var(--flame-rgb), 0.25);
  top: var(--spark-top);
  animation: windSpark var(--spark-speed, 3.8s) linear infinite;
  animation-delay: var(--spark-delay, 0s);
  opacity: var(--spark-opacity, 0.7);
}
@keyframes windSpark {
  0% { transform: translate3d(-8vw, 0, 0) scale(0.65); opacity: 0; }
  10% { opacity: var(--spark-opacity, 0.75); }
  70% { opacity: var(--spark-opacity, 0.75); }
  100% { transform: translate3d(118vw, var(--spark-drift, -40px), 0) scale(1.2); opacity: 0; }
}

.site-loader-card {
  position: relative; z-index: 1; text-align: center;
  padding: 3rem 3.5rem;
  border-radius: 28px;
  background: rgba(12, 14, 22, 0.55);
  border: 1px solid rgba(var(--flame-rgb), 0.22);
  box-shadow: var(--shadow-lg), 0 0 100px rgba(var(--flame-rgb), 0.16);
  backdrop-filter: var(--glass-blur);
  animation: loaderCardIn 0.7s var(--ease-out) both;
}
@keyframes loaderCardIn { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }

.site-loader-logo {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  color: var(--flame); font-size: clamp(44px, 8vw, 76px);
  letter-spacing: 4px; line-height: 0.9;
  text-shadow: 0 0 40px rgba(var(--flame-rgb), 0.5);
}
.site-loader-logo span { color: var(--text); }
.site-loader-name { margin: 6px 0 2px; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; color: rgba(var(--flame-rgb), 0.9); font-weight: 700; }


.site-loader-dots { display: inline-flex; align-items: center; gap: 10px; margin: 22px 0 14px; }
.site-loader-dots span {
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--flame); box-shadow: 0 0 18px rgba(var(--flame-rgb), 0.8);
  animation: jumpDot 0.8s ease-in-out infinite;
}
.site-loader-dots span:nth-child(2) { animation-delay: 0.14s; }
.site-loader-dots span:nth-child(3) { animation-delay: 0.28s; }
@keyframes jumpDot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.5; } 40% { transform: translateY(-14px); opacity: 1; } }

.site-loader-motto { color: var(--text-muted); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; }
.site-loader-fail { display: none; margin-top: 16px; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.site-loader.failed .site-loader-fail { display: block; animation: failIn 0.3s ease both; }
.site-loader.failed .site-loader-dots span { animation-play-state: paused; opacity: 0.25; }
.site-loader-fail a { color: var(--flame); font-weight: 700; text-decoration: none; }
.site-loader-fail a:hover { text-decoration: underline; }
@keyframes failIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Homepage ambient sparks (opt-in via body.home-sparks-enabled) */
.homepage-sparks { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; display: none; opacity: 0.5; }
body.home-view.home-sparks-enabled .homepage-sparks { display: block; }

/* ═══════════════════════════════════════════════
   EMBER FIRE SPRITE (injected by ember.js)
   ═══════════════════════════════════════════════ */
.ember-sprite { position: relative; width: 116px; height: 132px; margin: 0 auto 18px; animation: emberBob 2.6s ease-in-out infinite; }
@keyframes emberBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.ember-flame-tip { position: absolute; left: 50%; top: 4px; width: 26px; height: 40px; margin-left: -13px; border-radius: 50% 50% 50% 50% / 75% 75% 25% 25%; background: linear-gradient(180deg, var(--flame), var(--ember)); transform-origin: 50% 100%; animation: emberTip 0.8s ease-in-out infinite; opacity: 0.95; }
@keyframes emberTip { 0%,100% { transform: rotate(-4deg) scaleY(1); } 50% { transform: rotate(5deg) scaleY(1.18); } }
.ember-flame-body { position: absolute; left: 50%; bottom: 16px; width: 80px; height: 80px; margin-left: -40px; border-radius: 52% 48% 50% 50% / 64% 64% 38% 38%; background: linear-gradient(180deg, #ffd166 0%, var(--ember) 38%, var(--flame) 85%); box-shadow: 0 0 32px rgba(var(--flame-rgb),0.55), 0 0 72px rgba(240,165,0,0.22); transform-origin: 50% 90%; animation: emberFlicker 1.1s ease-in-out infinite; }
@keyframes emberFlicker { 0%,100% { transform: scale(1,1) rotate(0deg); } 25% { transform: scale(0.97,1.04) rotate(-1.6deg); } 55% { transform: scale(1.04,0.97) rotate(1.4deg); } 80% { transform: scale(0.99,1.02) rotate(-0.8deg); } }
.ember-flame-glow { position: absolute; left: 50%; bottom: 24px; width: 46px; height: 52px; margin-left: -23px; border-radius: 50% 50% 50% 50% / 62% 62% 40% 40%; background: linear-gradient(180deg, #fff3c4, #ffd166); opacity: 0.9; animation: emberFlicker 0.85s ease-in-out infinite reverse; }
.ember-face { position: absolute; left: 50%; bottom: 34px; width: 60px; margin-left: -30px; height: 34px; z-index: 2; }
.ember-eye { position: absolute; top: 0; width: 9px; height: 13px; border-radius: 50%; background: #2b1006; animation: emberBlink 4.2s infinite; }
.ember-eye.left { left: 12px; } .ember-eye.right { right: 12px; }
@keyframes emberBlink { 0%,90%,100% { transform: scaleY(1); } 93%,96% { transform: scaleY(0.08); } }
.ember-mouth { position: absolute; left: 50%; top: 17px; width: 16px; height: 9px; margin-left: -8px; border-radius: 0 0 16px 16px; background: #2b1006; }
.ember-cheek { position: absolute; top: 13px; width: 10px; height: 5px; border-radius: 999px; background: rgba(255,255,255,0.34); }
.ember-cheek.left { left: 2px; } .ember-cheek.right { right: 2px; }
.ember-shadow { position: absolute; left: 50%; bottom: 2px; width: 64px; height: 10px; margin-left: -32px; border-radius: 50%; background: rgba(var(--flame-rgb),0.28); filter: blur(4px); }
.ember-spark { position: absolute; width: 5px; height: 5px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 8px rgba(240,165,0,0.8); opacity: 0; animation: emberSparkUp 1.8s ease-in infinite; }
.ember-spark.s1 { left: 24px; bottom: 60px; animation-delay: 0s; }
.ember-spark.s2 { right: 22px; bottom: 70px; animation-delay: 0.6s; }
.ember-spark.s3 { left: 54px; bottom: 96px; animation-delay: 1.2s; }
@keyframes emberSparkUp { 0% { transform: translateY(0) scale(1); opacity: 0; } 15% { opacity: 0.95; } 100% { transform: translateY(-44px) scale(0.2); opacity: 0; } }
/* Mini ember used in nav/chat */
.ember-mini { position: relative; width: 34px; height: 38px; display: inline-block; animation: emberBob 2.6s ease-in-out infinite; transform-origin: 50% 80%; }
.ember-mini .ember-flame-tip { width: 8px; height: 13px; margin-left: -4px; top: 1px; }
.ember-mini .ember-flame-body { width: 24px; height: 24px; margin-left: -12px; bottom: 5px; }
.ember-mini .ember-flame-glow { width: 14px; height: 16px; margin-left: -7px; bottom: 8px; }
.ember-mini .ember-face { left: 50%; bottom: 12px; width: 15px; height: 9px; margin-left: -7.5px; }
.ember-mini .ember-eye { width: 3px; height: 3px; top: 2px; } .ember-mini .ember-eye.left { left: 2px; } .ember-mini .ember-eye.right { right: 2px; }
.ember-mini .ember-cheek { display: none; } .ember-mini .ember-mouth { width: 5px; height: 3px; left: 5px; top: 5px; }
.ember-mini .ember-shadow { width: 18px; height: 4px; margin-left: -9px; bottom: 1px; }


/* ═══════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════ */
nav#mainNav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 2000;
  display: flex; align-items: center; gap: 1.5rem;
  padding: 0 clamp(1rem, 3vw, 2.5rem); height: 68px;
  background: linear-gradient(180deg, rgba(7,8,13,0.85), rgba(7,8,13,0));
  transition: background var(--dur) var(--ease), backdrop-filter var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}
nav#mainNav.scrolled {
  background: rgba(9, 10, 16, 0.72);
  backdrop-filter: var(--glass-blur);
  border-bottom-color: var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.4);
}
.logo {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: 26px; letter-spacing: 1px; color: var(--flame);
  text-decoration: none; flex-shrink: 0;
  text-shadow: 0 0 24px rgba(var(--flame-rgb), 0.35);
  transition: transform 0.25s var(--ease);
}
.logo:hover { transform: scale(1.04); }
.logo span { color: var(--text); }

.nav-links { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  font-size: 14px; font-weight: 500; color: var(--text-muted);
  text-decoration: none; padding: 8px 14px; border-radius: 999px;
  transition: color 0.2s, background 0.2s; white-space: nowrap;
  display: flex; align-items: center; gap: 6px; cursor: pointer;
  border: none; background: none; position: relative;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: #fff; background: rgba(var(--flame-rgb), 0.14); }
.nav-link.active::after {
  content: ''; position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: 5px; height: 5px; border-radius: 50%; background: var(--flame);
  box-shadow: 0 0 10px rgba(var(--flame-rgb), 0.9);
}
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
#navRight { display: flex; align-items: center; gap: 14px; }

.nav-search-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 16px; border-radius: 999px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--border);
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  transition: all 0.22s var(--ease);
}
.nav-search-btn:hover { background: rgba(255,255,255,0.1); border-color: rgba(var(--flame-rgb),0.4); color: var(--text); transform: translateY(-1px); }
.nav-search-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
.nav-search-kbd { font-size: 10px; padding: 3px 6px; border-radius: 5px; background: rgba(255,255,255,0.08); color: var(--text-dim); letter-spacing: 0.5px; }
body.has-banner nav#mainNav { top: 0; }


/* ═══════════════════════════════════════════════
   ANNOUNCEMENT BANNER
   ═══════════════════════════════════════════════ */
#annBanner {
  position: fixed; top: 74px; left: clamp(10px, 3vw, 28px); right: clamp(10px, 3vw, 28px); z-index: 1900;
  transform: translateY(-160%); transition: transform 0.45s var(--ease), opacity 0.3s ease;
  pointer-events: none; opacity: 0;
}
#annBanner.visible { transform: translateY(0); pointer-events: all; opacity: 1; }
.ann-banner-inner {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 14px;
  padding: 13px 1.5rem; min-height: 52px; border-radius: 16px;
  box-shadow: var(--shadow-lg); backdrop-filter: var(--glass-blur);
}
#annBanner.type-notice .ann-banner-inner { background: linear-gradient(100deg, rgba(30,45,90,0.85), rgba(15,22,44,0.8)); border: 1px solid rgba(99,140,255,0.4); }
#annBanner.type-urgent .ann-banner-inner { background: linear-gradient(100deg, rgba(60,18,8,0.9), rgba(24,12,10,0.85)); border: 1px solid rgba(var(--flame-rgb),0.55); animation: urgentShake 0.5s ease 0.1s; }
@keyframes urgentShake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }
.ann-banner-inner::after { content:''; position:absolute; inset:-80% -20%; background:linear-gradient(90deg,transparent,rgba(255,255,255,0.12),transparent); transform:translateX(-70%) rotate(8deg); animation:annSweep 3.6s ease-in-out infinite; pointer-events:none; }
@keyframes annSweep { 0%,35%{transform:translateX(-70%) rotate(8deg)} 70%,100%{transform:translateX(70%) rotate(8deg)} }
.ann-banner-icon { flex-shrink:0; display:flex; align-items:center; justify-content:center; width:32px; height:32px; border-radius:9px; }
.type-notice .ann-banner-icon { background:rgba(99,140,255,0.2); }
.type-urgent .ann-banner-icon { background:rgba(var(--flame-rgb),0.22); }
.ann-banner-text { flex:1; min-width:0; }
.ann-banner-title { font-size:14px; font-weight:700; }
.type-notice .ann-banner-title { color:#a9c2ff; }
.type-urgent .ann-banner-title { color:#ff8a70; }
.ann-banner-msg { font-size:12.5px; color:rgba(244,246,251,0.72); margin-top:2px; }
.ann-banner-dismiss { flex-shrink:0; background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12); border-radius:999px; color:rgba(255,255,255,0.6); font-size:11px; padding:6px 13px; cursor:pointer; transition:all 0.16s; }
.ann-banner-dismiss:hover { background:rgba(255,255,255,0.16); color:#fff; }
.type-urgent .ann-banner-dismiss { display:none; }
.ann-banner-pulse { position:absolute; inset:0; pointer-events:none; }
.type-urgent .ann-banner-pulse { animation: urgentGlow 2s ease-in-out infinite; }
@keyframes urgentGlow { 0%,100%{box-shadow:inset 0 0 0 1px rgba(var(--flame-rgb),0)} 50%{box-shadow:inset 0 0 22px 2px rgba(var(--flame-rgb),0.14)} }


/* ═══════════════════════════════════════════════
   SEARCH OVERLAY
   ═══════════════════════════════════════════════ */
.search-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(5,6,10,0.72); backdrop-filter: blur(24px) saturate(120%);
  display: flex; flex-direction: column; align-items: center;
  padding: 12vh 1.5rem 3rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.search-overlay.open { opacity: 1; pointer-events: all; }
.search-box-wrap {
  width: 100%; max-width: 720px;
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,0.07); border: 1.5px solid rgba(255,255,255,0.14);
  border-radius: 18px; padding: 18px 22px;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  animation: searchBoxIn 0.35s var(--ease-out) both;
}
@keyframes searchBoxIn { from { opacity: 0; transform: translateY(-16px) scale(0.98); } to { opacity: 1; transform: none; } }
.search-box-wrap:focus-within {
  border-color: rgba(var(--flame-rgb),0.6);
  background: rgba(255,255,255,0.09);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(var(--flame-rgb),0.22);
}
.search-box-wrap svg { width: 22px; height: 22px; fill: none; stroke: var(--text-muted); stroke-width: 2; flex-shrink: 0; }
#searchInput { flex: 1; background: none; border: none; outline: none; font-family: inherit; font-size: 19px; color: var(--text); caret-color: var(--flame); }
#searchInput::placeholder { color: var(--text-dim); }
.search-esc { font-size: 11px; padding: 5px 9px; border-radius: 7px; background: rgba(255,255,255,0.08); color: var(--text-dim); cursor: pointer; border: 1px solid rgba(255,255,255,0.08); flex-shrink: 0; }
.search-esc:hover { color: var(--text-muted); background: rgba(255,255,255,0.12); }
.search-results { width: 100%; max-width: 720px; margin-top: 16px; display: flex; flex-direction: column; gap: 6px; max-height: 64vh; overflow-y: auto; padding: 2px; }
.search-result-item {
  display: flex; align-items: center; gap: 15px;
  padding: 12px 16px; border-radius: 14px;
  background: rgba(255,255,255,0.04); border: 1px solid var(--border);
  cursor: pointer; text-decoration: none; color: inherit;
  transition: background 0.16s, border-color 0.16s, transform 0.16s;
  animation: resultIn 0.18s ease both;
}
.search-result-item:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.14); transform: translateX(4px); }
.search-result-item.keyboard-focus { background: rgba(var(--flame-rgb),0.12); border-color: rgba(var(--flame-rgb),0.45); }
@keyframes resultIn { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform: none; } }
.search-result-poster { width: 40px; height: 60px; border-radius: 8px; flex-shrink: 0; background: var(--surface2); overflow: hidden; }
.search-result-poster img { width: 100%; height: 100%; object-fit: cover; }
.search-result-poster-ph { width: 100%; height: 100%; background: linear-gradient(135deg, rgba(var(--flame-rgb),0.3), rgba(120,90,255,0.2)); }
.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; display: flex; gap: 8px; }
.search-result-rating { color: var(--ember); }
.search-result-arrow { color: var(--text-dim); font-size: 18px; flex-shrink: 0; }
.search-empty { padding: 2.5rem; text-align: center; color: var(--text-dim); font-size: 14px; }
.search-hint { margin-top: 1rem; font-size: 12.5px; color: var(--text-dim); text-align: center; letter-spacing: 0.5px; }


/* ═══════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════ */
.hero { position: relative; height: 92vh; min-height: 600px; overflow: hidden; display: flex; align-items: flex-end; }
.hero-progress { position: absolute; top: 68px; left: 0; right: 0; height: 3px; z-index: 30; background: rgba(255,255,255,0.08); }
@media (max-width: 700px) { .hero-progress { top: 60px; } }
.hero-progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #ff5722, #ffb020, #22d3ee, #a855f7, #ff2d92, #ff5722);
  background-size: 300% 100%;
  animation: progressHue 3s linear infinite;
  transition: width 0.12s linear;
  box-shadow: 0 0 16px rgba(255,255,255,0.4);
}
@keyframes progressHue { 0% { background-position: 0% 0; } 100% { background-position: 300% 0; } }
.hero-slides { position: absolute; inset: 0; }
.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 1.1s var(--ease); pointer-events: none; }
.hero-slide.active { opacity: 1; pointer-events: auto; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center 20%; transform: scale(1.08); transition: transform 9s ease-out; filter: brightness(0.85) saturate(1.05); }
.hero-slide.active .hero-bg { transform: scale(1); }
.hero-bg-gradient {
  position: absolute; inset: 0;
  background:
    linear-gradient(to right, rgba(7,8,13,0.96) 0%, rgba(7,8,13,0.7) 42%, rgba(7,8,13,0.15) 75%, transparent 100%),
    linear-gradient(to top, var(--bg) 2%, rgba(7,8,13,0.5) 30%, transparent 62%);
}
.hero-content {
  position: relative; z-index: 10;
  padding: 0 clamp(1.5rem, 5vw, 5rem) clamp(4rem, 9vh, 7rem);
  max-width: 720px;
  animation: heroContentIn 0.9s var(--ease-out) both;
}
@keyframes heroContentIn { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; }
.hero-badge-pill { font-size: 11px; padding: 5px 12px; border-radius: 999px; font-weight: 700; letter-spacing: 0.6px; text-transform: uppercase; }
.pill-movie { background: rgba(255,255,255,0.12); color: var(--text); backdrop-filter: blur(8px); }
.pill-rating { background: rgba(var(--flame-rgb),0.16); color: var(--ember); border: 1px solid rgba(240,165,0,0.35); display: inline-flex; align-items: center; gap: 4px; }
.pill-rating svg { width: 11px; height: 11px; fill: currentColor; }
.hero-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(40px, 7vw, 88px); letter-spacing: -1.5px; line-height: 0.98;
  margin-bottom: 18px; text-shadow: 0 6px 40px rgba(0,0,0,0.6);
}
.hero-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.genre-tag { font: inherit; font-size: 12px; padding: 6px 13px; border-radius: 999px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); cursor: pointer; transition: all 0.2s var(--ease); }
.genre-tag:hover { background: rgba(var(--flame-rgb),0.2); color: #fff; border-color: rgba(var(--flame-rgb),0.4); transform: translateY(-2px); }
.hero-desc { font-size: 15.5px; line-height: 1.7; color: rgba(244,246,251,0.78); max-width: 540px; margin-bottom: 30px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }


/* ═══════════════════════════════════════════════
   BUTTONS (shared)
   ═══════════════════════════════════════════════ */
.btn-play {
  display: inline-flex; align-items: center; gap: 9px;
  background: linear-gradient(135deg, var(--flame), #ff7a3c);
  color: #fff; border: none; padding: 15px 34px; border-radius: 999px;
  font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), filter 0.25s var(--ease);
  text-decoration: none; box-shadow: 0 10px 32px rgba(var(--flame-rgb),0.4);
  position: relative; overflow: hidden;
}
.btn-play::before { content:''; position:absolute; inset:0; background:linear-gradient(120deg,transparent,rgba(255,255,255,0.35),transparent); transform:translateX(-120%); transition:transform 0.6s var(--ease); }
.btn-play:hover { transform: translateY(-3px) scale(1.03); box-shadow: 0 16px 46px rgba(var(--flame-rgb),0.55); filter: brightness(1.05); }
.btn-play:hover::before { transform: translateX(120%); }
.btn-play:active { transform: translateY(-1px) scale(1.01); }
.btn-play svg { width: 15px; height: 15px; fill: currentColor; }

.btn-outline {
  display: inline-flex; align-items: center; gap: 9px;
  background: rgba(255,255,255,0.09); color: var(--text);
  border: 1px solid rgba(255,255,255,0.18); padding: 15px 28px; border-radius: 999px;
  font-family: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all 0.25s var(--ease); backdrop-filter: blur(10px); text-decoration: none;
}
.btn-outline:hover { background: rgba(255,255,255,0.16); border-color: rgba(255,255,255,0.32); transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,0.35); }
.btn-outline svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }

/* Hero dots + arrows */
.hero-nav { position: absolute; bottom: 2.2rem; left: clamp(1.5rem, 5vw, 5rem); z-index: 20; display: flex; align-items: center; gap: 9px; }
.hero-dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,0.3); cursor: pointer; transition: width 0.35s var(--ease), background 0.35s var(--ease); }
.hero-dot.active { width: 34px; background: linear-gradient(90deg, var(--flame), var(--ember)); box-shadow: 0 0 12px rgba(var(--flame-rgb),0.6); }
.hero-arrows { position: absolute; bottom: 2rem; right: clamp(1.5rem, 4vw, 3rem); z-index: 20; display: flex; gap: 10px; }
.hero-arrow { width: 46px; height: 46px; border-radius: 50%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14); color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.25s var(--ease); backdrop-filter: blur(10px); }
.hero-arrow:hover { background: var(--flame); border-color: var(--flame); transform: scale(1.08); box-shadow: 0 8px 24px rgba(var(--flame-rgb),0.5); }
.hero-arrow svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }


/* ═══════════════════════════════════════════════
   MAIN + SECTIONS
   ═══════════════════════════════════════════════ */
main#mainContent { padding-bottom: 2rem; }
body.home-view main { padding-top: 1rem; }

.section { padding: 2.75rem clamp(1.2rem, 4vw, 4rem) 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.35rem; }
.section-title {
  font-family: 'Space Grotesk', sans-serif; font-weight: 700;
  font-size: clamp(1.4rem, 2.6vw, 2.1rem); letter-spacing: -0.5px; color: #fff;
  display: flex; align-items: center; gap: 12px; line-height: 1.05;
}
.section-title::before {
  content: ''; width: 5px; height: 1.1em; border-radius: 999px;
  background: linear-gradient(180deg, var(--flame), var(--ember));
  box-shadow: 0 0 14px rgba(var(--flame-rgb),0.6);
}
.section-title.flame-gold::before { background: linear-gradient(180deg, var(--ember), #ffcf5a); }
.ai-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(var(--flame-rgb),0.16); border: 1px solid rgba(var(--flame-rgb),0.35); color: var(--ember); font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; margin-left: 4px; }

.section-link { appearance: none; border: 0; background: transparent; padding: 6px 4px; cursor: pointer; color: var(--text-muted); text-decoration: none; font: inherit; font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; transition: color 0.2s, transform 0.2s; white-space: nowrap; }
.section-link:hover { color: var(--flame); transform: translateX(3px); }

/* Reveal on scroll */
.reveal-on-scroll { opacity: 0; transform: translateY(24px); transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
.reveal-on-scroll.is-visible { opacity: 1; transform: none; }

/* ═══════════════════════════════════════════════
   CONTENT ROWS + SCROLL ARROWS
   ═══════════════════════════════════════════════ */
.popular-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 22px); margin-bottom: 1rem; }
.scroll-section { position: relative; margin-bottom: 0.5rem; }
.scroll-row-wrap { position: relative; overflow: hidden; border-radius: 8px; }
.scroll-row { display: flex; gap: clamp(12px, 1.4vw, 20px); transition: transform 0.5s var(--ease); will-change: transform; }
.scroll-row .card { flex: 0 0 clamp(150px, 13vw, 200px); min-width: 150px; }

.scroll-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 12;
  width: 52px; height: 52px; border-radius: 50%;
  background: rgba(10,12,20,0.82); border: 1px solid rgba(255,255,255,0.16);
  color: var(--text); cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: all 0.28s var(--ease); backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5); opacity: 0;
}
.scroll-section:hover .scroll-arrow { opacity: 1; }
.scroll-arrow:hover { background: var(--flame); border-color: var(--flame); transform: translateY(-50%) scale(1.1); box-shadow: 0 14px 36px rgba(var(--flame-rgb),0.45); }
.scroll-arrow:disabled { opacity: 0 !important; pointer-events: none; }
.scroll-arrow svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.scroll-arrow-left { left: -10px; }
.scroll-arrow-right { right: -10px; }


/* ═══════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════ */
.card {
  position: relative; display: block; overflow: hidden;
  border-radius: 16px; border: 1px solid var(--border);
  background: var(--surface); text-decoration: none; color: inherit;
  cursor: pointer; transform-origin: center bottom;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), border-color 0.4s var(--ease);
  will-change: transform;
}
.card::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.06);
  transition: box-shadow 0.4s var(--ease);
}
.card:hover {
  transform: translateY(-10px) scale(1.03);
  border-color: rgba(var(--flame-rgb),0.35);
  box-shadow: 0 28px 70px rgba(0,0,0,0.6), 0 0 40px rgba(var(--flame-rgb),0.2);
  z-index: 6;
}
.card:hover::after { box-shadow: inset 0 0 0 1px rgba(var(--flame-rgb),0.3); }

.card-poster { position: relative; aspect-ratio: 2/3; overflow: hidden; background: var(--surface2); border-radius: inherit; }
.card-poster img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease), filter 0.4s ease; display: block; }
.card:hover .card-poster img { transform: scale(1.09); filter: saturate(1.12) brightness(1.06); }

.card-poster-placeholder {
  width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(circle at 30% 20%, rgba(var(--flame-rgb),0.22), transparent 45%), linear-gradient(135deg, #14161f, #0a0b11);
  color: rgba(244,246,251,0.5); text-align: center; padding: 14px;
}
.card-poster-placeholder svg { width: 36px; height: 36px; stroke: rgba(var(--flame-rgb),0.6); fill: none; stroke-width: 1.5; }
.card-poster-placeholder::after { content: 'Artwork unavailable'; font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.media-broken-ph { position: absolute; inset: 0; }
.search-result-poster .card-poster-placeholder::after, .trending-poster .card-poster-placeholder::after { display: none; }

.card-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(var(--flame-rgb),0.32), transparent 45%), linear-gradient(to top, rgba(0,0,0,0.75), transparent 55%);
  opacity: 0; transition: opacity 0.35s var(--ease);
}
.card:hover .card-overlay { opacity: 1; }
.card-play-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(var(--flame-rgb),0.95); display: flex; align-items: center; justify-content: center;
  transform: scale(0.7); transition: transform 0.35s var(--ease); box-shadow: 0 8px 26px rgba(var(--flame-rgb),0.5);
}
.card:hover .card-play-icon { transform: scale(1); }
.card-play-icon svg { width: 20px; height: 20px; fill: #fff; margin-left: 3px; }

.card-badge { position: absolute; top: 10px; left: 10px; z-index: 4; font-size: 10px; padding: 4px 10px; border-radius: 999px; font-weight: 800; letter-spacing: 0.3px; backdrop-filter: blur(8px); box-shadow: 0 6px 18px rgba(0,0,0,0.4); }
.badge-new { background: rgba(28,231,131,0.9); color: #04120a; }
.badge-featured { background: linear-gradient(135deg, var(--flame), var(--ember)); color: #fff; }
.badge-trending { background: rgba(255,176,32,0.92); color: #1a1204; }


/* Card info overlay (bottom-anchored, Netflix style) */
.card-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  padding: 34px 12px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.9) 10%, rgba(0,0,0,0.5) 55%, transparent);
}
.card-title { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 2px 10px rgba(0,0,0,0.9); }
.card-meta { margin-top: 6px; min-height: 20px; font-size: 11px; color: rgba(244,246,251,0.7); display: flex; align-items: center; gap: 6px; }
.card-meta > span:not(.card-rating) { color: rgba(244,246,251,0.55); }
.card-rating {
  position: absolute; right: 10px; bottom: 10px; z-index: 5;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 9px; border-radius: 999px; background: rgba(0,0,0,0.6);
  border: 1px solid rgba(255,255,255,0.14); color: #fff; font-weight: 800; font-size: 11px;
  backdrop-filter: blur(10px); box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}
.card-rating svg { width: 12px; height: 12px; fill: var(--ember); color: var(--ember); filter: drop-shadow(0 0 5px rgba(255,176,0,0.4)); }

/* Genre chips on card hover */
.card-genres { position: absolute; left: 10px; right: 10px; bottom: 52px; z-index: 6; display: flex; gap: 5px; flex-wrap: wrap; opacity: 0; transform: translateY(6px); transition: opacity 0.25s var(--ease), transform 0.25s var(--ease); }
.card:hover .card-genres { opacity: 1; transform: none; }
.genre-chip { border: 0; background: rgba(255,255,255,0.14); color: #fff; border-radius: 999px; padding: 4px 9px; cursor: pointer; font: inherit; font-size: 10px; font-weight: 600; backdrop-filter: blur(6px); transition: background 0.16s, transform 0.16s; }
.genre-chip:hover { background: rgba(var(--flame-rgb),0.85); transform: translateY(-1px); }

.countdown-badge { position: absolute; left: 10px; bottom: 10px; z-index: 5; background: rgba(0,0,0,0.7); border: 1px solid rgba(255,255,255,0.16); color: #fff; font-size: 10px; font-weight: 700; border-radius: 999px; padding: 4px 9px; backdrop-filter: blur(6px); }

/* Skeleton loading cards */
.skeleton { background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.card .card-poster.skeleton { border-radius: 16px 16px 0 0; }

.empty-state { padding: 3rem; text-align: center; color: var(--text-dim); font-size: 14px; grid-column: 1/-1; }

/* Home ad slots */
.home-ad-slot { position: relative; margin: 2rem clamp(1.2rem,4vw,4rem); min-height: 90px; border: 1px solid var(--border); border-radius: 18px; background: rgba(255,255,255,0.02); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.home-ad-slot::before { content: 'Advertisement'; position: absolute; top: 8px; left: 14px; font-size: 9px; color: var(--text-dim); letter-spacing: 0.14em; text-transform: uppercase; }


/* ═══════════════════════════════════════════════
   CONTINUE WATCHING
   ═══════════════════════════════════════════════ */
.continue-card-wrap { position: relative; }
.continue-note { font-size: 11px; color: rgba(244,246,251,0.6); margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.continue-card-wrap .card-info { padding-bottom: 14px; }
.continue-menu-btn {
  position: absolute; top: 10px; right: 10px; z-index: 7;
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.16); background: rgba(0,0,0,0.72); color: #fff;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transform: scale(0.85); transition: all 0.18s var(--ease);
  cursor: pointer; font-size: 18px; line-height: 1; backdrop-filter: blur(8px);
}
.continue-card-wrap:hover .continue-menu-btn, .continue-menu-btn:focus { opacity: 1; transform: scale(1); }
.continue-menu-btn:hover { background: rgba(var(--flame-rgb),0.9); }
.continue-menu-pop { position: absolute; top: 48px; right: 10px; z-index: 9; width: 220px; background: #14161f; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: none; }
.continue-menu-pop.open { display: block; animation: ddIn 0.16s var(--ease-out) both; }
.continue-menu-pop button { width: 100%; border: 0; background: none; color: var(--text-muted); padding: 10px 12px; border-radius: 9px; font: inherit; font-size: 12.5px; text-align: left; cursor: pointer; transition: background 0.15s, color 0.15s; }
.continue-menu-pop button:hover { background: rgba(var(--flame-rgb),0.16); color: #fff; }

/* ═══════════════════════════════════════════════
   FILTER / CATEGORY VIEWS
   ═══════════════════════════════════════════════ */
.filter-header { padding: 6rem clamp(1.2rem,4vw,4rem) 0; display: flex; align-items: center; gap: 16px; }
.filter-header h2 { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(1.9rem, 4vw, 2.8rem); letter-spacing: -1px; }
.filter-count { font-size: 13px; color: var(--text-muted); padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,0.05); border: 1px solid var(--border); }
.filter-grid { padding: 1.5rem clamp(1.2rem,4vw,4rem) 3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: clamp(14px, 1.6vw, 22px); }
.filter-grid .card { opacity: 0; transform: translateY(30px); animation: cardSlideIn 0.55s var(--ease-out) forwards; animation-delay: calc(min(var(--stagger, 0) * 26ms, 800ms)); }
@keyframes cardSlideIn { to { opacity: 1; transform: none; } }


/* ═══════════════════════════════════════════════
   TRENDING LIST
   ═══════════════════════════════════════════════ */
.trending-grid { padding: 1.5rem clamp(1.2rem,4vw,4rem) 3rem; display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.trending-row {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px 16px; cursor: pointer; text-decoration: none; color: inherit;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.trending-row:hover { background: var(--surface2); border-color: rgba(var(--flame-rgb),0.3); transform: translateX(5px); }
.trending-rank { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 30px; background: linear-gradient(180deg, rgba(var(--flame-rgb),0.9), rgba(var(--flame-rgb),0.35)); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; flex-shrink: 0; width: 40px; text-align: center; line-height: 1; }
.trending-poster { width: 46px; height: 68px; border-radius: 8px; background: var(--surface2); flex-shrink: 0; overflow: hidden; }
.trending-poster img { width: 100%; height: 100%; object-fit: cover; }
.trending-info { flex: 1; min-width: 0; }
.trending-title { font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trending-meta { font-size: 11.5px; color: var(--text-dim); margin-top: 4px; display: flex; gap: 8px; }
.trending-score { font-size: 11px; color: rgba(var(--flame-rgb),0.75); font-weight: 700; margin-left: auto; white-space: nowrap; flex-shrink: 0; }

/* ═══════════════════════════════════════════════
   GENRES VIEW
   ═══════════════════════════════════════════════ */
.genre-cloud { padding: 1.5rem clamp(1.2rem,4vw,4rem) 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px; }
.genre-box {
  position: relative; min-height: 116px; border: 0; text-align: left; border-radius: 20px; overflow: hidden; cursor: pointer; color: #fff;
  background: linear-gradient(135deg, rgba(var(--flame-rgb),0.4), rgba(120,90,255,0.15));
  box-shadow: 0 14px 40px rgba(0,0,0,0.4);
  animation: genrePop 0.55s var(--ease-out) both; animation-delay: calc(var(--stagger,0) * 42ms);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.genre-box::before { content: ''; position: absolute; inset: 0; background: var(--genre-bg, linear-gradient(135deg,#28100b,#090909)); background-size: cover; background-position: center; opacity: 0.36; transition: transform 0.5s var(--ease), opacity 0.3s ease; }
.genre-box::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.75)); }
.genre-box:hover { transform: translateY(-5px); box-shadow: 0 22px 54px rgba(var(--flame-rgb),0.28); }
.genre-box:hover::before { transform: scale(1.1); opacity: 0.5; }
.genre-box span { position: relative; z-index: 1; display: block; padding: 20px 18px 4px; font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 24px; letter-spacing: -0.5px; text-shadow: 0 2px 16px rgba(0,0,0,0.8); }
.genre-box small { position: relative; z-index: 1; display: block; padding: 0 18px 18px; color: rgba(255,255,255,0.78); font-size: 12px; }
@keyframes genrePop { from { opacity: 0; transform: translateY(24px) scale(0.96); } to { opacity: 1; transform: none; } }
.genre-collection { padding: 2rem clamp(1.2rem,4vw,4rem) 0; }
.genre-collection .popular-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }


/* ═══════════════════════════════════════════════
   TITLE DETAIL MODAL
   ═══════════════════════════════════════════════ */
body.modal-open { overflow: hidden; }
.title-modal-backdrop {
  position: fixed; inset: 0; z-index: 3000; display: none; align-items: center; justify-content: center;
  padding: clamp(16px, 3vw, 46px); background: rgba(4,5,9,0.72); backdrop-filter: blur(20px) saturate(120%);
}
.title-modal-backdrop.open { display: flex; animation: modalFade 0.22s ease both; }
@keyframes modalFade { from { opacity: 0; } to { opacity: 1; } }
.title-modal {
  position: relative; width: min(960px, 96vw); max-height: min(780px, 92vh); overflow: hidden;
  display: grid; grid-template-columns: minmax(200px, 300px) 1fr; border-radius: 28px;
  background: linear-gradient(135deg, rgba(20,22,32,0.98), rgba(9,10,16,0.98));
  border: 1px solid rgba(255,255,255,0.12); box-shadow: var(--shadow-lg);
  animation: modalPop 0.4s var(--ease-out) both;
}
@keyframes modalPop { from { opacity: 0; transform: translateY(36px) scale(0.92); } to { opacity: 1; transform: none; } }
.title-modal::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 20% 8%, rgba(var(--flame-rgb),0.22), transparent 38%), radial-gradient(circle at 82% 0%, rgba(120,90,255,0.2), transparent 42%); }
.title-modal-poster { position: relative; min-height: 440px; background: var(--surface2); overflow: hidden; }
.title-modal-poster img { width: 100%; height: 100%; object-fit: cover; display: block; }
.title-modal-poster::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.6), transparent 46%); }
.title-modal-body { position: relative; z-index: 1; padding: clamp(24px, 4vw, 44px); overflow-y: auto; }
.title-modal-close { position: absolute; top: 18px; right: 18px; z-index: 4; width: 42px; height: 42px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.14); background: rgba(0,0,0,0.5); color: #fff; cursor: pointer; font-size: 22px; line-height: 1; transition: all 0.2s var(--ease); backdrop-filter: blur(8px); }
.title-modal-close:hover { background: var(--flame); border-color: var(--flame); transform: rotate(90deg); }
.title-modal-kicker { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; color: var(--text-muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.title-modal-kicker span { padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.08); }
.title-modal-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(2rem, 4.5vw, 3.6rem); line-height: 0.98; letter-spacing: -1.5px; margin-bottom: 16px; }
.title-modal-genres { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.title-modal-genres span { color: #fff; background: rgba(var(--flame-rgb),0.16); border: 1px solid rgba(var(--flame-rgb),0.28); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 700; }
.title-modal-desc { color: rgba(244,246,251,0.78); line-height: 1.75; font-size: 15px; max-width: 60ch; margin-bottom: 22px; }
.title-modal-cast { color: var(--text-muted); font-size: 13.5px; line-height: 1.6; margin-bottom: 26px; }
.title-modal-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.title-modal-actions a { text-decoration: none; }
@media (max-width: 740px) { .title-modal { grid-template-columns: 1fr; max-height: 90vh; } .title-modal-poster { min-height: 240px; max-height: 34vh; } }

/* AI recs states */
.ai-recs-loading { display: flex; align-items: center; gap: 12px; padding: 1.5rem 0; color: var(--text-muted); font-size: 14px; }
.ai-pulse { width: 9px; height: 9px; border-radius: 50%; background: var(--flame); animation: aiPulse 1.2s infinite; box-shadow: 0 0 12px rgba(var(--flame-rgb),0.7); }
@keyframes aiPulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.3; transform: scale(0.6); } }
.ai-recs-signin { padding: 1.75rem; background: linear-gradient(135deg, rgba(var(--flame-rgb),0.08), rgba(120,90,255,0.05)); border: 1px solid rgba(var(--flame-rgb),0.18); border-radius: 18px; display: flex; align-items: center; gap: 16px; }
.ai-recs-signin svg { width: 24px; height: 24px; fill: none; stroke: var(--flame); stroke-width: 1.5; flex-shrink: 0; }
.ai-recs-signin a { color: var(--flame); text-decoration: none; font-weight: 700; }
.ai-recs-signin a:hover { text-decoration: underline; }


/* ═══════════════════════════════════════════════
   NOTIFICATIONS + AVATAR MENU
   ═══════════════════════════════════════════════ */
.notification-bell { position: relative; width: 40px; height: 40px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--text); cursor: pointer; transition: all 0.2s var(--ease); }
.notification-bell svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.notification-bell:hover { color: #fff; background: rgba(var(--flame-rgb),0.16); border-color: rgba(var(--flame-rgb),0.4); }
.notification-bell.notif-open { color: #fff; background: rgba(var(--flame-rgb),0.2); }
.notification-count { position: absolute; top: -5px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: linear-gradient(135deg, var(--flame), var(--ember)); color: #fff; font-size: 10px; font-weight: 800; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px var(--bg); }

#notifPanel { display: none; position: fixed; top: 74px; right: clamp(10px,3vw,24px); width: 360px; max-width: calc(100vw - 20px); background: rgba(16,18,26,0.96); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 2100; overflow: hidden; backdrop-filter: var(--glass-blur); }
#notifPanel.open { display: block; animation: ddIn 0.2s var(--ease-out); }
@keyframes ddIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px 13px; border-bottom: 1px solid var(--border); }
.notif-head-title { font-size: 14px; font-weight: 700; }
.notif-head-clear { font-size: 11px; color: var(--text-muted); background: none; border: none; cursor: pointer; padding: 4px 8px; border-radius: 7px; }
.notif-head-clear:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.notif-list { max-height: 380px; overflow-y: auto; padding: 4px 0; }
.notif-item { display: flex; gap: 11px; align-items: flex-start; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.notif-item:last-child { border-bottom: none; }
.notif-item-poster { flex-shrink: 0; width: 40px; height: 58px; border-radius: 7px; object-fit: cover; display: block; }
.notif-item-poster-placeholder { flex-shrink: 0; width: 40px; height: 58px; border-radius: 7px; background: var(--surface3); display: flex; align-items: center; justify-content: center; }
.notif-item-body { flex: 1; min-width: 0; }
.notif-item-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; line-height: 1.35; }
.notif-item-title a { color: var(--text); text-decoration: none; }
.notif-item-title a:hover { text-decoration: underline; }
.notif-item-msg { font-size: 12px; color: var(--text-muted); line-height: 1.5; word-break: break-word; }
.notif-item-tag { display: inline-block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 6px; border-radius: 5px; margin-bottom: 5px; }
.notif-item-tag.urgent { background: rgba(255,138,112,0.16); color: #ff8a70; }
.notif-item-tag.notice, .notif-item-tag.update { background: rgba(147,197,253,0.12); color: #93c5fd; }
.notif-item-tag.episode { background: rgba(167,139,250,0.14); color: #a78bfa; }
.notif-item-tag.season { background: rgba(52,211,153,0.13); color: #34d399; }
.notif-item-tag.franchise { background: rgba(245,158,11,0.14); color: #f59e0b; }
.notif-date { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.notif-empty { padding: 34px 16px; text-align: center; color: var(--text-muted); font-size: 13px; }
.notif-empty svg { display: block; margin: 0 auto 10px; opacity: 0.25; }
.notif-follows-hint { padding: 10px 14px 14px; font-size: 11px; color: var(--text-dim); text-align: center; border-top: 1px solid var(--border); }


/* Avatar / login button / user dropdown */
.login-icon-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,0.06); border: 1px solid var(--border); color: var(--flame); text-decoration: none; transition: all 0.2s var(--ease); }
.login-icon-btn:hover { background: rgba(var(--flame-rgb),0.16); color: #fff; transform: translateY(-1px); }
.login-icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.nav-user-wrap { position: relative; }
.nav-user { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-muted); cursor: pointer; padding: 4px 6px 4px 4px; border-radius: 999px; transition: background 0.16s; background: none; border: 0; font-family: inherit; }
.nav-user:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.nav-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--flame), var(--ember)); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #fff; flex-shrink: 0; overflow: hidden; }
.avatar-dropdown { position: absolute; top: 100%; right: 0; margin-top: 10px; background: rgba(16,18,26,0.97); border: 1px solid var(--border); border-radius: 14px; min-width: 210px; padding: 8px; box-shadow: var(--shadow-lg); z-index: 300; display: none; flex-direction: column; backdrop-filter: var(--glass-blur); }
.avatar-dropdown.open { display: flex; animation: ddIn 0.18s var(--ease-out) both; }
.avatar-dropdown a, .avatar-dropdown button { display: flex; align-items: center; gap: 11px; padding: 10px 12px; font-size: 13.5px; color: var(--text-muted); text-decoration: none; background: none; border: none; cursor: pointer; font-family: inherit; border-radius: 10px; transition: background 0.15s, color 0.15s; width: 100%; text-align: left; }
.avatar-dropdown a:hover, .avatar-dropdown button:hover { background: rgba(var(--flame-rgb),0.14); color: #fff; }
.avatar-dropdown svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; flex-shrink: 0; }
.dd-divider { height: 1px; background: var(--border); margin: 6px 4px; }

/* ═══════════════════════════════════════════════
   FOLLOW BUTTON + POPUP
   ═══════════════════════════════════════════════ */
.btn-follow { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,0.08); color: var(--text-muted); border: 1px solid rgba(255,255,255,0.16); padding: 15px 24px; border-radius: 999px; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: all 0.22s var(--ease); }
.btn-follow:hover { background: rgba(255,255,255,0.14); color: var(--text); transform: translateY(-2px); }
.btn-follow.following { background: rgba(var(--flame-rgb),0.14); border-color: rgba(var(--flame-rgb),0.4); color: var(--flame); }
.btn-follow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; flex-shrink: 0; }
#followPopup { display: none; position: fixed; inset: 0; z-index: 9500; background: rgba(4,5,9,0.72); backdrop-filter: blur(16px); align-items: center; justify-content: center; }
#followPopup.open { display: flex; animation: modalFade 0.2s ease both; }
.follow-popup-box { background: linear-gradient(135deg, rgba(20,22,32,0.98), rgba(9,10,16,0.98)); border: 1px solid var(--border); border-radius: 22px; padding: 34px 30px 26px; max-width: 400px; width: calc(100% - 40px); text-align: center; box-shadow: var(--shadow-lg); animation: modalPop 0.35s var(--ease-out) both; }
.follow-popup-icon { width: 58px; height: 58px; border-radius: 50%; background: rgba(var(--flame-rgb),0.14); border: 1px solid rgba(var(--flame-rgb),0.28); display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.follow-popup-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; line-height: 1.3; }
.follow-popup-msg { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; margin-bottom: 24px; }
.follow-popup-actions { display: flex; gap: 12px; justify-content: center; }
.follow-popup-actions .btn-play, .follow-popup-actions .btn-outline { padding: 12px 26px; font-size: 14px; }


/* ═══════════════════════════════════════════════
   DOMAIN CORNER
   ═══════════════════════════════════════════════ */
.domain-corner {
  position: fixed; left: 20px; bottom: 20px; z-index: 2500;
  width: min(330px, calc(100vw - 32px));
  padding: 16px 16px 15px; border-radius: 18px;
  background: linear-gradient(160deg, rgba(19,21,31,0.97), rgba(10,11,17,0.97));
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(var(--flame-rgb),0.1);
  backdrop-filter: var(--glass-blur);
  transform: translateY(24px) scale(0.96); opacity: 0; pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.domain-corner.visible { opacity: 1; transform: none; pointer-events: auto; }
.domain-close { position: absolute; top: 12px; right: 12px; width: 26px; height: 26px; border: 0; border-radius: 50%; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); cursor: pointer; font-size: 16px; line-height: 1; transition: all 0.16s; }
.domain-close:hover { background: rgba(var(--flame-rgb),0.24); color: #fff; }
.domain-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em; color: var(--ember); font-weight: 800; margin-bottom: 7px; }
.domain-kicker::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 8px var(--ember); }
.domain-title { font-size: 14px; color: #fff; font-weight: 700; margin-bottom: 12px; line-height: 1.4; padding-right: 20px; }
.domain-list { display: flex; flex-direction: column; gap: 8px; }
.domain-pill { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 600; color: rgba(255,255,255,0.85); padding: 9px 12px; border-radius: 11px; background: rgba(255,255,255,0.045); border: 1px solid rgba(255,255,255,0.07); transition: border-color 0.2s, background 0.2s; }
.domain-pill:hover { background: rgba(var(--flame-rgb),0.08); border-color: rgba(var(--flame-rgb),0.25); }
.domain-pill::before { content: '✓'; flex-shrink: 0; display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: rgba(var(--flame-rgb),0.2); color: var(--ember); font-size: 11px; font-weight: 900; }

/* ═══════════════════════════════════════════════
   EMBER CHAT WIDGET
   ═══════════════════════════════════════════════ */
.ember-widget { position: fixed; right: 20px; bottom: 20px; z-index: 2700; }
.ember-toggle { height: 56px; min-width: 128px; border: 0; border-radius: 999px; padding: 0 20px 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; background: linear-gradient(135deg, var(--flame), #ff9f3c); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer; box-shadow: 0 16px 44px rgba(var(--flame-rgb),0.4); transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease); }
.ember-toggle:hover { transform: translateY(-3px); box-shadow: 0 22px 54px rgba(var(--flame-rgb),0.55); }
.ember-panel { position: absolute; right: 0; bottom: 68px; width: min(380px, calc(100vw - 40px)); height: min(70vh, 520px); display: none; flex-direction: column; overflow: hidden; border-radius: 22px; background: rgba(14,15,22,0.97); border: 1px solid rgba(var(--flame-rgb),0.28); box-shadow: var(--shadow-lg); backdrop-filter: var(--glass-blur); }
.ember-widget.open .ember-panel { display: flex; animation: emberIn 0.24s var(--ease-out) both; }
@keyframes emberIn { from { opacity: 0; transform: translateY(14px) scale(0.97); } to { opacity: 1; transform: none; } }
.ember-head { display: flex; align-items: center; justify-content: space-between; padding: 15px 16px; border-bottom: 1px solid var(--border); background: linear-gradient(90deg, rgba(var(--flame-rgb),0.16), transparent); }
.ember-head strong { display: block; color: #fff; font-size: 14px; }
.ember-head span { display: block; color: var(--text-muted); font-size: 11.5px; margin-top: 2px; }
.ember-head button { border: 0; background: rgba(255,255,255,0.08); color: #fff; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; transition: background 0.16s; }
.ember-head button:hover { background: rgba(var(--flame-rgb),0.4); }
.ember-messages { flex: 1; overflow: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.ember-msg { max-width: 88%; padding: 11px 14px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; white-space: pre-wrap; }
.ember-bot { align-self: flex-start; background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); border-bottom-left-radius: 5px; }
.ember-user { align-self: flex-end; background: linear-gradient(135deg, var(--flame), #ff8a4c); color: #fff; border-bottom-right-radius: 5px; }
.ember-bot-row { display: flex; align-items: flex-end; gap: 8px; }
.ember-typing { display: inline-flex; gap: 5px; align-items: center; }
.ember-typing span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.5); animation: jumpDot 0.9s ease-in-out infinite; }
.ember-typing span:nth-child(2) { animation-delay: 0.15s; }
.ember-typing span:nth-child(3) { animation-delay: 0.3s; }
.ember-form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--border); }
.ember-form input { flex: 1; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: #fff; border-radius: 999px; padding: 11px 15px; outline: none; font-family: inherit; font-size: 13.5px; transition: border-color 0.2s; }
.ember-form input:focus { border-color: rgba(var(--flame-rgb),0.55); }
.ember-form button { width: 44px; height: 44px; border: 0; border-radius: 50%; background: linear-gradient(135deg, var(--flame), var(--ember)); color: #fff; cursor: pointer; flex-shrink: 0; transition: transform 0.2s var(--ease); }
.ember-form button:hover { transform: scale(1.08); }


/* ═══════════════════════════════════════════════
   ACCENT PICKER MODAL
   ═══════════════════════════════════════════════ */
.accent-modal-bg { position: fixed; inset: 0; z-index: 9100; background: rgba(4,5,9,0.72); backdrop-filter: blur(16px); display: flex; align-items: center; justify-content: center; padding: 1.5rem; opacity: 0; pointer-events: none; transition: opacity 0.2s var(--ease); }
.accent-modal-bg.open { opacity: 1; pointer-events: all; }
.accent-modal { background: linear-gradient(135deg, rgba(20,22,32,0.98), rgba(9,10,16,0.98)); border: 1px solid var(--border); border-radius: 22px; padding: 2rem; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg); animation: modalPop 0.35s var(--ease-out) both; }
.accent-modal-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: -0.5px; margin-bottom: 4px; }
.accent-modal-sub { font-size: 12.5px; color: var(--text-muted); margin-bottom: 1.5rem; }
.accent-swatch-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 1.5rem; }
.accent-swatch { display: flex; flex-direction: column; align-items: center; gap: 7px; cursor: pointer; padding: 8px; border-radius: 12px; border: 1.5px solid transparent; transition: all 0.16s var(--ease); }
.accent-swatch:hover { background: rgba(255,255,255,0.06); transform: translateY(-2px); }
.accent-swatch.selected { border-color: rgba(255,255,255,0.4); background: rgba(255,255,255,0.08); }
.accent-swatch-dot { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 4px 14px rgba(0,0,0,0.4); }
.accent-swatch-label { font-size: 9.5px; color: var(--text-muted); text-align: center; line-height: 1.3; }
.accent-modal-close { width: 100%; padding: 12px; border-radius: 12px; background: rgba(255,255,255,0.07); border: 1px solid var(--border); color: var(--text); font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 0.16s; }
.accent-modal-close:hover { background: rgba(255,255,255,0.12); }

/* ═══════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════ */
footer { margin-top: 4rem; padding: 3rem clamp(1.2rem,4vw,4rem); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; background: linear-gradient(180deg, transparent, rgba(0,0,0,0.3)); }
.footer-logo { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 22px; letter-spacing: 1px; color: var(--flame); }
.footer-logo span { color: var(--text-muted); }
.footer-links { display: flex; gap: 2rem; }
.footer-link { font-size: 13px; color: var(--text-dim); text-decoration: none; transition: color 0.2s; }
.footer-link:hover { color: var(--flame); }
.footer-copy { font-size: 12px; color: var(--text-dim); }


/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 1000px) {
  .popular-grid { grid-template-columns: repeat(4, 1fr); }
  .scroll-row .card { flex: 0 0 clamp(140px, 22vw, 180px); }
  .trending-grid { grid-template-columns: 1fr; }
  .hero { height: 84vh; }
}

@media (max-width: 700px) {
  nav#mainNav { height: 60px; gap: 0.75rem; padding: 0 1rem; }
  .nav-links { display: none; }
  .nav-search-kbd { display: none; }
  .nav-search-btn { padding: 9px 12px; }
  .logo { font-size: 22px; }

  .hero { height: 78vh; min-height: 500px; }
  .hero-content { padding: 0 1.25rem 3.5rem; }
  .hero-title { font-size: clamp(34px, 11vw, 52px); }
  .hero-desc { font-size: 14px; -webkit-line-clamp: 2; }
  .hero-nav { left: 1.25rem; bottom: 1.5rem; }
  .hero-arrows { display: none; }
  .btn-play, .btn-outline { padding: 13px 24px; font-size: 14px; }

  .section { padding: 2rem 1rem 0; }
  .section-title { font-size: 1.35rem; }
  .popular-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .scroll-row .card { flex: 0 0 40vw; min-width: 130px; }
  .scroll-arrow { display: none; }
  .filter-header { padding-top: 5rem; }
  .filter-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .genre-cloud { grid-template-columns: repeat(2, 1fr); }

  #annBanner { top: 66px; }
  .domain-corner { left: 12px; right: 12px; bottom: 84px; width: auto; }
  .ember-widget { right: 12px; bottom: 12px; }
  .ember-toggle { min-width: 0; height: 52px; }
  .card-genres { display: none; }
  #notifPanel { top: 66px; }
}

@media (max-width: 420px) {
  .popular-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ═══════════════════════════════════════════════
   REDUCED MOTION
   ═══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
  body::before, .ember-sprite, .ember-flame-body, .ember-flame-tip, .ember-flame-glow, .ember-spark { animation: none !important; }
  .reveal-on-scroll { opacity: 1 !important; transform: none !important; }
  .filter-grid .card, .genre-box { opacity: 1 !important; transform: none !important; }
  .hero-bg { transform: none !important; }
}


/* ═══════════════════════════════════════════════
   POSTER FALLBACK HARDENING (search + trending)
   Guarantees a missing/broken image never renders as a
   stretched broken-image bar — always a contained tile.
   ═══════════════════════════════════════════════ */
.search-result-poster, .trending-poster { position: relative; }
.search-result-poster img, .trending-poster img { display: block; width: 100%; height: 100%; object-fit: cover; }
.search-result-poster-ph, .trending-poster-ph {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(var(--flame-rgb),0.28), rgba(120,90,255,0.22));
}
.search-result-poster-ph::before, .trending-poster-ph::before {
  content: ''; width: 45%; height: 45%;
  background: currentColor; color: rgba(255,255,255,0.55);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='8.5' cy='9' r='1.6'/%3E%3Cpath d='M4 16l4.5-4.5 4 4 3-3L20 17'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='3'/%3E%3Ccircle cx='8.5' cy='9' r='1.6'/%3E%3Cpath d='M4 16l4.5-4.5 4 4 3-3L20 17'/%3E%3C/svg%3E") center/contain no-repeat;
}


/* ═══════════════════════════════════════════════
   ONE-TIME "NEW UI" ANNOUNCEMENT POPUP
   ═══════════════════════════════════════════════ */
.newui-overlay {
  position: fixed; inset: 0; z-index: 9600;
  display: flex; align-items: center; justify-content: center; padding: 1.5rem;
  background: rgba(4,5,9,0.7); backdrop-filter: blur(18px);
  opacity: 0; pointer-events: none; transition: opacity 0.32s var(--ease);
}
.newui-overlay.open { opacity: 1; pointer-events: all; }
.newui-card {
  position: relative; overflow: hidden;
  width: min(460px, calc(100vw - 40px));
  padding: 40px 32px 30px; text-align: center;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(22,24,34,0.98), rgba(10,11,17,0.98));
  border: 1px solid rgba(var(--flame-rgb),0.28);
  box-shadow: var(--shadow-lg), 0 0 90px rgba(var(--flame-rgb),0.2);
  transform: translateY(30px) scale(0.94);
  transition: transform 0.42s var(--ease-out);
}
.newui-overlay.open .newui-card { transform: none; }
.newui-glow { position: absolute; top: -60px; left: 50%; transform: translateX(-50%); width: 260px; height: 160px; background: radial-gradient(circle, rgba(var(--flame-rgb),0.4), transparent 70%); pointer-events: none; animation: auroraDrift 6s ease-in-out infinite alternate; }
.newui-spark { font-size: 44px; margin-bottom: 12px; animation: emberBob 2.6s ease-in-out infinite; }
.newui-kicker { display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ember); margin-bottom: 10px; }
.newui-title { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: clamp(1.6rem, 4vw, 2.2rem); letter-spacing: -0.5px; margin-bottom: 12px; line-height: 1.05; }
.newui-text { color: var(--text-muted); font-size: 14.5px; line-height: 1.7; max-width: 40ch; margin: 0 auto 26px; }
.newui-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.newui-close { position: absolute; top: 16px; right: 16px; width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.14); background: rgba(0,0,0,0.4); color: #fff; cursor: pointer; font-size: 22px; line-height: 1; transition: all 0.2s var(--ease); z-index: 2; }
.newui-close:hover { background: var(--flame); border-color: var(--flame); transform: rotate(90deg); }
