/* Neon layer — the over-the-top animation skin, loaded last so it wins.
   Everything here is presentation: no layout that the app depends on is
   changed structurally, only surfaces, borders, glow and motion. Every
   animation is gated behind `prefers-reduced-motion` and the shell's
   `.reduced-motion` class so the settings switch still kills the noise. */

:root {
  --neon-a: var(--accent, #ef3340);
  --neon-b: var(--accent-2, #ff5963);
  --neon-c: #7c5cff;
  --neon-d: #26d0d6;
  --neon-e: #ffc65b;
  --neon-line: rgba(255, 255, 255, 0.09);
  --neon-glass: rgba(14, 16, 24, 0.62);
  --neon-glass-2: rgba(20, 23, 34, 0.72);
  --neon-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --neon-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ------------------------------------------------------------------ shell */

.app-shell {
  position: relative;
  isolation: isolate;
}

/* Two slow drifting aurora blobs behind everything, above the starfield. */
.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  z-index: -1;
  width: 62vw;
  height: 62vw;
  max-width: 900px;
  max-height: 900px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
  opacity: 0.5;
  will-change: transform;
}

.app-shell::before {
  top: -26vw;
  left: -14vw;
  background: radial-gradient(circle at 34% 34%, rgba(124, 92, 255, 0.5), rgba(124, 92, 255, 0) 68%);
  animation: neon-drift-a 34s var(--neon-ease) infinite alternate;
}

.app-shell::after {
  bottom: -30vw;
  right: -16vw;
  background: radial-gradient(circle at 66% 66%, rgba(255, 71, 110, 0.42), rgba(38, 208, 214, 0) 70%);
  animation: neon-drift-b 42s var(--neon-ease) infinite alternate;
}

@keyframes neon-drift-a {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(6vw, 4vh, 0) scale(1.12); }
  100% { transform: translate3d(-3vw, 8vh, 0) scale(0.94); }
}

@keyframes neon-drift-b {
  0% { transform: translate3d(0, 0, 0) scale(1.05); }
  50% { transform: translate3d(-7vw, -5vh, 0) scale(0.9); }
  100% { transform: translate3d(4vw, -9vh, 0) scale(1.15); }
}

/* ---------------------------------------------------------------- sidebar */

.sidebar {
  background: linear-gradient(180deg, rgba(11, 13, 20, 0.9), rgba(9, 11, 17, 0.96));
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  border-right: 1px solid var(--neon-line);
  box-shadow: 24px 0 70px rgba(0, 0, 0, 0.45);
}

/* A thin animated beam down the sidebar edge. */
.sidebar::after {
  content: "";
  position: absolute;
  top: 0;
  right: -1px;
  width: 1px;
  height: 100%;
  background: linear-gradient(
    180deg,
    transparent,
    var(--neon-a) 18%,
    var(--neon-c) 50%,
    var(--neon-d) 76%,
    transparent
  );
  opacity: 0.55;
  animation: neon-beam 9s linear infinite;
  background-size: 100% 220%;
}

@keyframes neon-beam {
  0% { background-position: 0 -100%; }
  100% { background-position: 0 200%; }
}

.brand {
  position: relative;
}

.brand-mark {
  position: relative;
  border-radius: 13px;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

/* Rotating conic ring behind the logo mark. */
.brand-mark::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -1;
  padding: 2px;
  border-radius: 16px;
  background: conic-gradient(
    from 0deg,
    var(--neon-a),
    var(--neon-e),
    var(--neon-d),
    var(--neon-c),
    var(--neon-b),
    var(--neon-a)
  );
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: neon-spin 8s linear infinite;
  opacity: 0.9;
}

.brand-mark::after {
  content: "";
  position: absolute;
  inset: -14px;
  z-index: -2;
  border-radius: 22px;
  background: radial-gradient(circle, rgba(239, 51, 64, 0.45), transparent 70%);
  filter: blur(8px);
  animation: neon-pulse-glow 4.2s ease-in-out infinite;
}

@keyframes neon-spin {
  to { transform: rotate(360deg); }
}

@keyframes neon-pulse-glow {
  0%, 100% { opacity: 0.45; transform: scale(0.92); }
  50% { opacity: 0.95; transform: scale(1.08); }
}

.brand-copy strong {
  background: linear-gradient(100deg, #fff, #ffd9dc 34%, #fff 62%, #c9d4ff 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: neon-shimmer 7s linear infinite;
}

@keyframes neon-shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 260% 50%; }
}

.sidebar-rule {
  background: linear-gradient(90deg, transparent, var(--neon-a), var(--neon-c), transparent);
  opacity: 0.5;
}

/* ---------------------------------------------------------------- nav */

.nav-link {
  --sweep: 0;
  overflow: hidden;
  transition: background 0.22s var(--neon-ease), color 0.22s var(--neon-ease),
    border-color 0.22s var(--neon-ease), transform 0.22s var(--neon-bounce),
    box-shadow 0.22s var(--neon-ease);
}

/* Light sweep that runs across the row on hover. */
.nav-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    100deg,
    transparent 20%,
    rgba(255, 255, 255, 0.14) 46%,
    rgba(255, 255, 255, 0.02) 58%,
    transparent 80%
  );
  transform: translateX(-120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.62s var(--neon-ease), opacity 0.3s ease;
}

.nav-link:hover::after {
  transform: translateX(120%);
  opacity: 1;
}

.nav-link:hover {
  transform: translateX(3px);
  color: #fff;
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--neon-line);
}

.nav-link.active {
  background: linear-gradient(100deg, rgba(239, 51, 64, 0.2), rgba(124, 92, 255, 0.12));
  border-color: rgba(239, 51, 64, 0.28);
  box-shadow: 0 0 0 1px rgba(239, 51, 64, 0.08), 0 10px 30px -12px rgba(239, 51, 64, 0.55);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--neon-b), var(--neon-a));
  box-shadow: 0 0 14px 1px rgba(239, 51, 64, 0.8);
  animation: neon-bar-pulse 2.6s ease-in-out infinite;
}

@keyframes neon-bar-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

.nav-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s var(--neon-bounce), color 0.22s ease, filter 0.22s ease;
}

.nav-icon svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link:hover .nav-icon {
  transform: scale(1.16) rotate(-4deg);
  color: var(--neon-b);
  filter: drop-shadow(0 0 8px rgba(255, 89, 99, 0.65));
}

.nav-link.active .nav-icon {
  color: var(--neon-b);
  filter: drop-shadow(0 0 9px rgba(255, 89, 99, 0.7));
}

.nav-count {
  background: linear-gradient(140deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid var(--neon-line);
}

.nav-pill {
  position: relative;
  color: #ffd3d6;
  background: linear-gradient(120deg, rgba(239, 51, 64, 0.35), rgba(124, 92, 255, 0.28));
  border: 1px solid rgba(255, 89, 99, 0.35);
  box-shadow: 0 0 14px -2px rgba(239, 51, 64, 0.6);
  animation: neon-pill-breathe 3.4s ease-in-out infinite;
}

@keyframes neon-pill-breathe {
  0%, 100% { box-shadow: 0 0 12px -3px rgba(239, 51, 64, 0.5); }
  50% { box-shadow: 0 0 20px 1px rgba(239, 51, 64, 0.75); }
}

.sidebar-status {
  background: linear-gradient(120deg, rgba(57, 214, 160, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(57, 214, 160, 0.16);
}

.status-dot {
  box-shadow: 0 0 10px 1px rgba(57, 214, 160, 0.75);
  animation: neon-dot 2.4s ease-in-out infinite;
}

@keyframes neon-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ---------------------------------------------------------------- topbar */

.topbar {
  background: linear-gradient(180deg, rgba(10, 12, 19, 0.86), rgba(10, 12, 19, 0.55));
  backdrop-filter: blur(24px) saturate(150%);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  border-bottom: 1px solid var(--neon-line);
  box-shadow: 0 18px 44px -28px rgba(0, 0, 0, 0.9);
}

/* Animated gradient hairline under the topbar. */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-a), var(--neon-c), var(--neon-d), transparent);
  background-size: 220% 100%;
  animation: neon-slide 8s linear infinite;
  opacity: 0.7;
}

@keyframes neon-slide {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

.breadcrumbs strong {
  color: #fff;
  text-shadow: 0 0 16px rgba(239, 51, 64, 0.45);
}

.global-search {
  position: relative;
  transition: box-shadow 0.28s var(--neon-ease), border-color 0.2s ease, transform 0.2s var(--neon-ease);
}

.global-search:focus-within {
  transform: translateY(-1px);
  border-color: rgba(239, 51, 64, 0.5);
  box-shadow: 0 0 0 3px rgba(239, 51, 64, 0.13), 0 12px 30px -18px rgba(239, 51, 64, 0.8);
}

.global-search kbd {
  border: 1px solid var(--neon-line);
  background: rgba(255, 255, 255, 0.05);
}

.icon-button {
  transition: background 0.2s var(--neon-ease), color 0.2s ease, transform 0.24s var(--neon-bounce),
    box-shadow 0.24s ease, border-color 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-2px) scale(1.05);
  color: #fff;
  border-color: rgba(239, 51, 64, 0.4);
  box-shadow: 0 8px 24px -10px rgba(239, 51, 64, 0.85);
}

.icon-button:active {
  transform: translateY(0) scale(0.96);
}

.profile-chip {
  transition: transform 0.24s var(--neon-bounce), border-color 0.2s ease, box-shadow 0.24s ease;
}

.profile-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 51, 64, 0.4);
  box-shadow: 0 10px 26px -14px rgba(239, 51, 64, 0.9);
}

/* ---------------------------------------------------------------- headings */

.view-root {
  position: relative;
}

/* Route change: every direct child staggers up into place. */
.view-root > * {
  animation: neon-rise 0.5s var(--neon-ease) both;
}

.view-root > *:nth-child(2) { animation-delay: 0.05s; }
.view-root > *:nth-child(3) { animation-delay: 0.1s; }
.view-root > *:nth-child(4) { animation-delay: 0.15s; }
.view-root > *:nth-child(5) { animation-delay: 0.2s; }
.view-root > *:nth-child(6) { animation-delay: 0.25s; }
.view-root > *:nth-child(n + 7) { animation-delay: 0.3s; }

@keyframes neon-rise {
  from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.995); }
  to { opacity: 1; transform: none; }
}

.eyebrow {
  color: var(--neon-b);
  text-shadow: 0 0 14px rgba(255, 89, 99, 0.4);
}

.eyebrow:before {
  background: linear-gradient(90deg, var(--neon-a), var(--neon-c));
  box-shadow: 0 0 10px rgba(239, 51, 64, 0.7);
}

.page-title {
  background: linear-gradient(100deg, #ffffff 0%, #ffe3e5 26%, #ffffff 48%, #cdd7ff 72%, #ffffff 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: neon-shimmer 9s linear infinite;
  filter: drop-shadow(0 6px 26px rgba(124, 92, 255, 0.3));
}

.section-title {
  position: relative;
  padding-left: 13px;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.16em;
  bottom: 0.16em;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--neon-a), var(--neon-c));
  box-shadow: 0 0 12px rgba(239, 51, 64, 0.7);
}

/* ---------------------------------------------------------------- surfaces */

.panel {
  position: relative;
  background: linear-gradient(150deg, rgba(23, 26, 34, 0.86), rgba(14, 16, 23, 0.9));
  border: 1px solid var(--neon-line);
  box-shadow: 0 26px 70px -40px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
  border-color: rgba(255, 255, 255, 0.14);
}

/* Conic gradient border that only shows on hover — cheap, one layer. */
.panel::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 62%, var(--neon-a) 78%, var(--neon-c) 88%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
  animation: neon-angle 7s linear infinite;
}

.panel:hover::before {
  opacity: 0.85;
}

@property --angle {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@keyframes neon-angle {
  to { --angle: 360deg; }
}

/* ---------------------------------------------------------------- buttons */

.btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.22s var(--neon-bounce), box-shadow 0.24s ease, border-color 0.2s ease,
    background 0.2s ease;
}

.btn::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.34), transparent);
  transform: skewX(-18deg);
  transition: left 0.55s var(--neon-ease);
  pointer-events: none;
}

.btn:hover::after {
  left: 120%;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn-primary {
  background: linear-gradient(120deg, var(--neon-a), #ff5a67 46%, #ff8360);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 34px -16px rgba(239, 51, 64, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.btn-primary:hover {
  box-shadow: 0 20px 44px -14px rgba(239, 51, 64, 1), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.input {
  transition: border-color 0.2s ease, box-shadow 0.24s ease, background 0.2s ease;
}

.input:focus {
  border-color: rgba(239, 51, 64, 0.55);
  box-shadow: 0 0 0 3px rgba(239, 51, 64, 0.12), 0 10px 26px -20px rgba(239, 51, 64, 0.9);
}

.chip {
  transition: transform 0.2s var(--neon-bounce), border-color 0.2s ease, color 0.2s ease,
    background 0.2s ease, box-shadow 0.2s ease;
}

.chip:hover {
  transform: translateY(-1px);
  border-color: rgba(239, 51, 64, 0.4);
  color: #fff;
}

.chip.active {
  background: linear-gradient(120deg, rgba(239, 51, 64, 0.28), rgba(124, 92, 255, 0.2));
  border-color: rgba(239, 51, 64, 0.45);
  box-shadow: 0 8px 22px -14px rgba(239, 51, 64, 0.9);
}

/* ---------------------------------------------------------------- cards */

.library-card,
.web-card {
  position: relative;
  transition: transform 0.32s var(--neon-ease), box-shadow 0.32s ease, border-color 0.28s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

.library-card::after,
.web-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    420px 420px at var(--card-x, 50%) var(--card-y, 0%),
    rgba(255, 255, 255, 0.1),
    transparent 62%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.library-card:hover,
.web-card:hover {
  transform: translateY(-6px);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 32px 60px -34px rgba(0, 0, 0, 1), 0 0 0 1px rgba(239, 51, 64, 0.16),
    0 18px 48px -28px rgba(124, 92, 255, 0.75);
}

.library-card:hover::after,
.web-card:hover::after {
  opacity: 1;
}

/* The fallback tile is a sibling of the cover <img>, so it has to be taken out
   of flow — otherwise it occupies the top of the square and shoves the artwork
   past the overflow edge, which is why every cover looked blank. */
.library-art .af-art-tile {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  font: 700 26px/1 system-ui;
  letter-spacing: 1px;
  color: rgba(255, 255, 255, 0.5);
}

.library-art > img {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.library-art,
.af-art-tile {
  transition: transform 0.5s var(--neon-ease), filter 0.4s ease;
}

.library-card:hover .library-art,
.library-card:hover .af-art-tile {
  transform: scale(1.055);
  filter: saturate(1.15) contrast(1.04);
}

.library-card img,
.web-card img {
  transition: transform 0.55s var(--neon-ease);
}

.library-card:hover img {
  transform: scale(1.03);
}

.library-tag {
  background: linear-gradient(120deg, rgba(239, 51, 64, 0.24), rgba(124, 92, 255, 0.18));
  border: 1px solid rgba(239, 51, 64, 0.3);
  color: #ffd8da;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card-grid {
  perspective: 1200px;
}

/* A soft focus ring for keyboard users, everywhere. */
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--neon-b);
  outline-offset: 2px;
  border-radius: 8px;
}

.empty-state,
.catalog-empty {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: radial-gradient(600px 220px at 50% 0%, rgba(124, 92, 255, 0.1), transparent 70%);
}

/* ---------------------------------------------------------------- mini player */

.mini-player {
  background: linear-gradient(150deg, rgba(20, 23, 34, 0.82), rgba(11, 13, 20, 0.9));
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--neon-line);
  box-shadow: 0 30px 80px -34px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.mini-player::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: conic-gradient(from var(--angle, 0deg), transparent 0 58%, var(--neon-a) 74%, var(--neon-c) 86%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.6;
  pointer-events: none;
  animation: neon-angle 9s linear infinite;
}

.mini-track-art {
  border-radius: 12px;
  box-shadow: 0 8px 26px -12px rgba(239, 51, 64, 0.8);
  transition: transform 0.4s var(--neon-bounce);
}

.mini-player:hover .mini-track-art {
  transform: rotate(-3deg) scale(1.04);
}

.main-play {
  transition: transform 0.24s var(--neon-bounce), box-shadow 0.26s ease, background 0.2s ease;
}

.main-play:hover {
  transform: scale(1.1);
  box-shadow: 0 0 0 4px rgba(239, 51, 64, 0.16), 0 14px 30px -12px rgba(239, 51, 64, 1);
}

/* Equalisers dance while a track is playing. */
body.music-playing .mini-track-art::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 16px;
  background-image: linear-gradient(90deg, var(--neon-b) 0 2px, transparent 2px 6px);
  background-size: 6px 100%;
  opacity: 0.7;
  animation: neon-eq 0.7s steps(4) infinite;
}

@keyframes neon-eq {
  0% { background-position: 0 62%; }
  50% { background-position: 0 18%; }
  100% { background-position: 0 74%; }
}

/* ---------------------------------------------------------------- toasts + dialogs */

.toast {
  animation: neon-toast-in 0.42s var(--neon-bounce) both;
  border: 1px solid var(--neon-line);
  box-shadow: 0 22px 50px -26px rgba(0, 0, 0, 1), 0 0 0 1px rgba(239, 51, 64, 0.12);
}

@keyframes neon-toast-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0) scale(0.94); }
  to { opacity: 1; transform: none; }
}

.dialog-layer > * {
  animation: neon-dialog-in 0.34s var(--neon-bounce) both;
}

@keyframes neon-dialog-in {
  from { opacity: 0; transform: translate3d(0, 22px, 0) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------- scrollbars */

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 51, 64, 0.55) transparent;
}

*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  border-radius: 99px;
  background: linear-gradient(180deg, var(--neon-a), var(--neon-c));
  border: 3px solid transparent;
  background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--neon-b), var(--neon-d));
  background-clip: content-box;
}

/* ---------------------------------------------------------------- footer */

.app-footer {
  border-top: 1px solid var(--neon-line);
  color: var(--muted);
}

.footer-dot {
  box-shadow: 0 0 8px rgba(57, 214, 160, 0.8);
  animation: neon-dot 2.8s ease-in-out infinite;
}

/* ---------------------------------------------------------------- motion switches */

body.reduced-motion *,
body.reduced-motion *::before,
body.reduced-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
}

@media (prefers-reduced-motion: reduce) {
  .app-shell::before,
  .app-shell::after,
  .sidebar::after,
  .topbar::after,
  .brand-mark::before,
  .brand-mark::after,
  .nav-pill,
  .nav-link.active::before,
  .panel::before,
  .mini-player::before {
    animation: none !important;
  }
  .view-root > * {
    animation: none !important;
  }
}

/* The privacy cover and guard layer must stay above every glow. */
.privacy-cover {
  position: fixed;
}

/* ---------------------------------------------------------------- movies */

.movie-hero {
  position: relative;
  padding: 30px 28px 26px;
  border-radius: var(--radius);
  border: 1px solid var(--neon-line);
  background:
    radial-gradient(700px 260px at 12% -10%, rgba(239, 51, 64, 0.22), transparent 70%),
    radial-gradient(620px 300px at 88% 110%, rgba(124, 92, 255, 0.2), transparent 72%),
    linear-gradient(150deg, rgba(23, 26, 34, 0.9), rgba(11, 13, 20, 0.94));
  box-shadow: 0 30px 80px -50px rgba(0, 0, 0, 1), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
}

.movie-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 40%, rgba(255, 255, 255, 0.06) 50%, transparent 60%);
  background-size: 220% 100%;
  animation: neon-slide 12s linear infinite;
}

.movie-hero h1 {
  margin: 6px 0 8px;
  font-size: clamp(30px, 4vw, 46px);
  letter-spacing: -1.2px;
  background: linear-gradient(100deg, #fff, #ffe3e5 30%, #fff 55%, #cdd7ff 80%, #fff);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: neon-shimmer 9s linear infinite;
}

.movie-search {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  max-width: 720px;
}

.movie-search .input {
  flex: 1 1 auto;
}

.movie-status {
  min-height: 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 16px;
  margin-top: 6px;
}

.movie-card {
  position: relative;
  padding: 0;
  text-align: left;
  border: 1px solid var(--neon-line);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(23, 26, 34, 0.9), rgba(12, 14, 21, 0.94));
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.3s var(--neon-ease), box-shadow 0.3s ease, border-color 0.3s ease;
}

.movie-card:hover {
  transform: translateY(-6px) scale(1.014);
  border-color: rgba(239, 51, 64, 0.42);
  box-shadow: 0 28px 56px -30px rgba(0, 0, 0, 1), 0 0 0 1px rgba(239, 51, 64, 0.18),
    0 18px 44px -26px rgba(124, 92, 255, 0.8);
}

.movie-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 255, 255, 0.08), transparent 70%),
    linear-gradient(160deg, #1b1f2a, #0c0e14);
  overflow: hidden;
}

.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--neon-ease), filter 0.4s ease;
}

.movie-card:hover .movie-poster img {
  transform: scale(1.06);
  filter: saturate(1.15) contrast(1.05);
}

.movie-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 6px;
  font: 700 9px/1 system-ui;
  letter-spacing: 1.2px;
  color: #ffd8da;
  background: rgba(10, 12, 18, 0.72);
  border: 1px solid rgba(239, 51, 64, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.movie-body {
  padding: 9px 11px 11px;
}

.movie-body strong {
  display: block;
  font-size: 12.5px;
  line-height: 1.3;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-body small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted-2);
}

/* ---- player ---- */

.movie-player-shell {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 700px at 50% -20%, #131726, #05060a 70%);
  animation: neon-dialog-in 0.3s var(--neon-ease) both;
}

.movie-player-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--neon-line);
  background: linear-gradient(180deg, rgba(10, 12, 19, 0.94), rgba(10, 12, 19, 0.7));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  flex-wrap: wrap;
}

.movie-title-block strong {
  font-size: 13.5px;
  color: #fff;
  display: block;
}

.movie-title-block small {
  font-size: 10.5px;
  color: var(--muted-2);
}

.movie-player-bar .spacer {
  flex: 1 1 auto;
}

.movie-episode-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.movie-episode-bar .input {
  height: 32px;
  min-width: 74px;
  margin-left: 5px;
  text-transform: none;
  letter-spacing: 0;
}

.movie-episode-bar[hidden] { display: none; }

.movie-server-row {
  display: flex;
  gap: 8px;
  padding: 9px 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--neon-line);
  background: rgba(8, 10, 16, 0.6);
}

.movie-server {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--neon-line);
  transition: color 0.2s ease, background 0.24s ease, border-color 0.24s ease,
    box-shadow 0.24s ease, transform 0.24s var(--neon-bounce);
}

.movie-server:hover {
  color: #fff;
  transform: translateY(-1px);
  border-color: rgba(239, 51, 64, 0.4);
}

.movie-server.active {
  color: #fff;
  background: linear-gradient(120deg, rgba(239, 51, 64, 0.32), rgba(124, 92, 255, 0.24));
  border-color: rgba(239, 51, 64, 0.5);
  box-shadow: 0 8px 22px -12px rgba(239, 51, 64, 0.9);
}

.movie-stage {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  background: #05060a;
}

.movie-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: #05060a;
}

.movie-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 24px;
  color: var(--muted);
  background: radial-gradient(700px 340px at 50% 40%, rgba(124, 92, 255, 0.14), transparent 72%), #05060a;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}

.movie-loading.hidden {
  opacity: 0;
  visibility: hidden;
}

.movie-loading span {
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.4px;
}

.movie-loading small {
  font-size: 11px;
  color: var(--muted-2);
  max-width: 380px;
  line-height: 1.7;
}

@media (max-width: 760px) {
  .movie-search { flex-wrap: wrap; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 11px; }
  .movie-player-bar { gap: 8px; padding: 8px 10px; }
  .movie-server-row { padding: 8px 10px; }
}
