@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
  :root {
    /* Accent colors — overridden server-side by buildCssVars() in layout <head> */
    --accent: #e87722;
    --accent-rgb: 232, 119, 34;
    --accent-light: #f0a050;
    --accent-light-rgb: 240, 160, 80;
    --accent-dark: #cc6200;
    --accent-dark-rgb: 204, 98, 0;
    --accent-gold: #f0c040;
    --accent-gold-rgb: 240, 192, 64;
    /* Light mode surface palette */
    --bg: #ffffff;
    --card: #f5f5f5;
    --deep: #f5f5f5;
    --border: rgba(0, 0, 0, 0.08);
    --border-soft: rgba(0, 0, 0, 0.05);
    --text-primary: #1a1a2e;
    --text-secondary: #525252;
    --text-muted: rgba(0, 0, 0, 0.45);
    --btn-ghost: rgba(0, 0, 0, 0.04);
    --btn-ghost-hover: rgba(0, 0, 0, 0.08);
    --scrollbar-thumb: rgba(0, 0, 0, 0.1);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.2);
    --sheet-bg: #f5f5fa;
    --sheet-border: rgba(0, 0, 0, 0.1);
    --sheet-handle: rgba(0, 0, 0, 0.15);
    --auth-card-bg: #ffffff;
    --auth-card-shadow:
      0 8px 40px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
  }

  /* Dark mode surface palette — applied when <html class="dark"> */
  .dark {
    --bg: #1a1a2e;
    --card: #16213e;
    --deep: #0f3460;
    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.05);
    --text-primary: #ffffff;
    --text-secondary: #cccccc;
    --text-muted: #a0a0a0;
    --btn-ghost: rgba(255, 255, 255, 0.04);
    --btn-ghost-hover: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb: rgba(255, 255, 255, 0.1);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.2);
    --sheet-bg: #0e0e0e;
    --sheet-border: rgba(255, 255, 255, 0.07);
    --sheet-handle: rgba(255, 255, 255, 0.14);
    --auth-card-bg: rgba(22, 33, 62, 0.88);
    --auth-card-shadow:
      0 24px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--accent-rgb), 0.08);
  }

  html,
  body {
    background: var(--bg);
    color: var(--text-primary);
    font-family:
      var(--font-inter),
      Inter,
      system-ui,
      -apple-system,
      sans-serif;
    -webkit-font-smoothing: antialiased;
    /* Prevent horizontal scroll on all pages */
    overflow-x: hidden;
    max-width: 100vw;
  }

  /* ── Global scrollbar — slim, dark, unobtrusive ──────────────────────────
     Replaces the default browser scrollbar on every element.
     Windows/Chrome users especially see the ugly default; this fixes it.  */
  * {
    box-sizing: border-box;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) transparent;
  }
  *::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
  *::-webkit-scrollbar-track {
    background: transparent;
  }
  *::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 99px;
  }
  *::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
  }
  *::-webkit-scrollbar-corner {
    background: transparent;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}

@layer utilities {
  .scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
  .scrollbar-hide::-webkit-scrollbar {
    display: none;
  }

  /* Explicit thin scrollbar — slightly more visible than the global default,
     used on panels / lists that benefit from a visible scroll indicator.    */
  .scrollbar-thin {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb-hover) transparent;
  }
  .scrollbar-thin::-webkit-scrollbar {
    width: 4px;
    height: 4px;
  }
  .scrollbar-thin::-webkit-scrollbar-track {
    background: transparent;
  }
  .scrollbar-thin::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb-hover);
    border-radius: 99px;
  }
  .scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
    filter: brightness(1.3);
  }

  .line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .aspect-16-9 {
    aspect-ratio: 16 / 9;
  }
}

/* ─── Banner carousel progress bar ──────────────────────────────────────── */

@keyframes banner-prog {
  from {
    width: 0%;
  }
  to {
    width: 100%;
  }
}

/* ─── Music section detail page ─────────────────────────────────────────── */

@keyframes msd-head-in {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes msd-row-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ─── Content detail page ────────────────────────────────────────────────── */

@keyframes cd-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cd-row-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ─── Payment modal ──────────────────────────────────────────────────────── */

@keyframes pay-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes pay-scale {
  from {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.92);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}

@keyframes pay-success {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ─── Wallet page ────────────────────────────────────────────────────────── */

@keyframes wallet-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes wallet-card-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes wallet-shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(200%);
  }
}

/* ─── Upload page ────────────────────────────────────────────────────────── */

@keyframes upload-page-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes upload-row-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes upload-success {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ─── Notification page ──────────────────────────────────────────────────── */

@keyframes notif-head-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes notif-row-in {
  from {
    opacity: 0;
    transform: translateX(12px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ─── Search page ────────────────────────────────────────────────────────── */

@keyframes srch-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes srch-card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes srch-eq {
  from {
    transform: scaleY(0.25);
  }
  to {
    transform: scaleY(1);
  }
}

/* ─── Subscription/Plans page ───────────────────────────────────────────── */

@keyframes plan-rise {
  from {
    opacity: 0;
    transform: translateY(28px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes plan-glow {
  0%,
  100% {
    opacity: 0.55;
  }
  50% {
    opacity: 1;
  }
}

@keyframes shimmer-slide {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

@keyframes feature-check-in {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-10deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* ─── Rent page ──────────────────────────────────────────────────────────── */

@keyframes rent-section-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes gold-shimmer {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(var(--accent-gold-rgb), 0);
  }
  50% {
    box-shadow: 0 0 12px rgba(var(--accent-gold-rgb), 0.55);
  }
}

/* ─── Subscriptions page ─────────────────────────────────────────────────── */

@keyframes sub-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes sub-card-out {
  from {
    opacity: 1;
    transform: scale(1);
    max-height: 280px;
    margin-bottom: 0;
  }
  to {
    opacity: 0;
    transform: scale(0.92);
    max-height: 0;
    margin-bottom: 0;
  }
}

/* ─── Feed page ──────────────────────────────────────────────────────────── */

@keyframes heart-pop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.45);
  }
  65% {
    transform: scale(0.88);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes feed-card-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Hero Banner Carousel ───────────────────────────────────────────────── */

@keyframes hero-zoom-in {
  from {
    transform: scale(1) translate(0%, 0%);
  }
  to {
    transform: scale(1.07) translate(-1.5%, -0.8%);
  }
}

@keyframes hero-content-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── Liked page ─────────────────────────────────────────────────────────── */

@keyframes liked-card-in {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heart-beat-once {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.35);
  }
  55% {
    transform: scale(0.92);
  }
  75% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes heart-glow-pulse {
  0%,
  100% {
    box-shadow: 0 0 0px rgba(var(--accent-rgb), 0);
  }
  50% {
    box-shadow: 0 0 32px rgba(var(--accent-rgb), 0.35);
  }
}

/* ─── Music page ─────────────────────────────────────────────────────────── */

.music-body {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 300px;
  align-items: stretch;
  min-height: calc(100vh - 56px);
}
@media (max-width: 1180px) {
  .music-body {
    grid-template-columns: 220px minmax(0, 1fr) 280px;
  }
}
@media (max-width: 980px) {
  .music-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }
  .music-right {
    display: none;
  }
}
@media (max-width: 720px) {
  .music-body {
    grid-template-columns: 1fr;
  }
  .music-left {
    display: none;
  }
}

/* Left panel */
.music-left {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px - 96px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 16px 0;
  scrollbar-width: none;
}
.music-left h4 {
  margin: 0;
  padding: 0 18px 12px;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary);
}
.music-left-section {
  display: flex;
  flex-direction: column;
}
.music-left-heading {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-transform: uppercase;
  padding: 16px 18px 6px;
}
.music-left-divider {
  height: 1px;
  background: var(--border);
  margin: 10px 12px;
}
.music-left-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  margin: 0 8px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  width: 100%;
  transition:
    background 160ms ease,
    color 160ms ease;
}
.music-left-item:hover {
  background: var(--card);
  color: var(--text-primary);
}
.music-left-item.active {
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}
.music-left-icon {
  width: 16px;
  display: inline-flex;
  flex-shrink: 0;
}
.music-left-label {
  flex: 1;
  min-width: 0;
}
.music-left-count {
  background: rgba(var(--accent-rgb), 0.18);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.music-left-arrow {
  transition: transform 200ms ease;
}
.music-left-item.expanded .music-left-arrow {
  transform: rotate(90deg);
}
.music-left-sub {
  display: flex;
  flex-direction: column;
  padding: 2px 0 6px 50px;
}
.music-left-sub button {
  text-align: left;
  font-size: 10px;
  color: var(--text-muted);
  padding: 5px 0;
  cursor: pointer;
  transition: color 140ms ease;
}
.music-left-sub button:hover {
  color: var(--text-primary);
}
.music-feat {
  margin: 20px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.music-feat-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #16213e;
  border-radius: 8px;
  overflow: hidden;
}
.music-feat-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.45));
}
.music-feat-name {
  color: #fff;
  font-size: 13px;
  font-weight: 500;
}
.music-feat-tracks {
  color: #999;
  font-size: 11px;
  margin-top: 2px;
}
.music-feat-btn {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  height: 34px;
  border-radius: 8px;
  width: 100%;
  transition: filter 160ms ease;
}
.music-feat-btn:hover {
  filter: brightness(1.08);
}

/* Center panel */
.music-center {
  padding: 32px 36px 40px;
  min-width: 0;
}
@media (max-width: 720px) {
  .music-center {
    padding: 24px 16px 32px;
  }
}

.music-now-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.music-now-art {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a4e, #0f3460);
  box-shadow:
    0 0 60px rgba(var(--accent-rgb), 0.2),
    0 16px 40px rgba(0, 0, 0, 0.55);
}
.music-now-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(0, 0, 0, 0.35));
}
.music-now-meta {
  margin-top: 20px;
  text-align: center;
}
.music-now-title {
  color: #fff;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.music-now-sub {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #fff;
  flex-wrap: wrap;
  justify-content: center;
}
.music-now-tick {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.music-now-album {
  color: #999;
  font-size: 11px;
  font-style: italic;
}
.music-now-actions {
  margin-top: 10px;
  display: flex;
  gap: 20px;
  align-items: center;
}
.music-now-actions button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 160ms ease;
}
.music-now-actions button:hover {
  transform: scale(1.12);
}

/* Progress bar */
.music-pb-row {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  gap: 12px;
  align-items: center;
}
.music-pb-time {
  font-size: 11px;
  color: #999;
  font-variant-numeric: tabular-nums;
  text-align: center;
}
.music-pb-bar {
  position: relative;
  height: 4px;
  background: var(--deep);
  border-radius: 2px;
  cursor: pointer;
  transition: height 160ms ease;
}
.music-pb-bar:hover {
  height: 6px;
}
.music-pb-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  position: relative;
}
.music-pb-handle {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
  display: block;
}

/* Main controls */
.music-pc-main {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}
.music-pc-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition:
    transform 160ms ease,
    color 160ms ease;
}
.music-pc-btn.muted {
  color: #999;
}
.music-pc-btn:hover {
  transform: scale(1.1);
}
.music-pc-btn.is-active {
  color: var(--accent);
}
.music-pc-play {
  position: relative;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(var(--accent-rgb), 0.3);
  transition: transform 160ms ease;
}
.music-pc-play:hover {
  transform: scale(1.06);
}
.music-pc-play::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  animation: music-pulse-ring 1.5s ease-out infinite;
  pointer-events: none;
}
@keyframes music-pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.7;
  }
  100% {
    transform: scale(1.18);
    opacity: 0;
  }
}
.music-pc-secondary {
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.music-pc-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 180px;
}
.music-pc-vol-bar {
  flex: 1;
  height: 4px;
  background: var(--deep);
  border-radius: 2px;
  position: relative;
  cursor: pointer;
  max-width: 120px;
}
.music-pc-vol-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
}
.music-pc-right {
  display: flex;
  gap: 12px;
}
.music-pc-icon {
  cursor: pointer;
  color: #999;
  transition: color 160ms ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.music-pc-icon:hover {
  color: var(--accent);
}
.music-pc-icon.is-on {
  color: var(--accent);
}

/* Queue */
.music-queue {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.music-queue-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.music-queue-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
}
.music-queue-clear {
  color: var(--accent);
  font-size: 11px;
  cursor: pointer;
}
.music-queue-clear:hover {
  text-decoration: underline;
}
.music-queue-label {
  font-size: 10px;
  color: var(--accent);
  margin-top: 12px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 600;
}
.music-queue-label.muted {
  color: #999;
  margin-top: 16px;
}
.music-queue-row {
  display: grid;
  grid-template-columns: 16px 40px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  position: relative;
  border-left: 3px solid transparent;
  transition: background 140ms ease;
}
.music-queue-row:hover {
  background: var(--card);
}
.music-queue-row.is-playing {
  background: var(--card);
  border-left-color: var(--accent);
  padding-left: 7px;
}
.music-queue-num {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}
.music-queue-thumb {
  width: 40px;
  height: 40px;
  border-radius: 4px;
  overflow: hidden;
  background: #0f3460;
  position: relative;
}
.music-queue-meta {
  min-width: 0;
}
.music-queue-name {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-queue-row.is-playing .music-queue-name {
  color: var(--accent);
}
.music-queue-artist {
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.music-queue-dur {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

/* Right panel */
.music-right {
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px - 96px);
  overflow-y: auto;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  /* Outer shell — inner .music-rp-body handles its own scroll */
  scrollbar-width: none;
}
.music-right::-webkit-scrollbar {
  display: none;
}
.music-rp-tabs {
  display: flex;
  gap: 24px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.music-rp-tab {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition:
    color 160ms ease,
    border-color 160ms ease;
}
.music-rp-tab.active {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  border-bottom-color: var(--accent);
}
.music-rp-tab:not(.active):hover {
  color: var(--text-secondary);
}
.music-rp-body {
  flex: 1;
  padding: 20px 18px;
  overflow-y: auto;
}

/* Lyrics */
.music-lyr {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.music-lyr-line {
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.45;
  transition:
    color 300ms ease,
    font-size 300ms ease;
}
.music-lyr-line.past {
  color: #555;
}
.music-lyr-line.future {
  color: #888;
}
.music-lyr-line.current {
  color: var(--accent);
  font-size: 17px;
  font-weight: 500;
}
.music-lyr-foot {
  color: #555;
  font-size: 10px;
  text-align: center;
  margin-top: 24px;
}

/* Artist tab */
.music-art-banner {
  position: relative;
  height: 140px;
  background: #16213e;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
  margin: -20px -18px 0;
}
.music-art-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.music-art-grad {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 26, 46, 0) 0%,
    rgba(26, 26, 46, 0.6) 100%
  );
}
.music-art-name {
  margin-top: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  font-size: 17px;
  font-weight: 500;
}
.music-art-listeners {
  color: #999;
  font-size: 11px;
  margin-top: 3px;
}
.music-art-bio {
  color: #ccc;
  font-size: 12px;
  line-height: 1.6;
  margin-top: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.music-art-more {
  color: var(--accent);
  cursor: pointer;
  font-size: 12px;
}
.music-art-popular {
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  margin: 16px 0 8px;
}
.music-art-btn {
  width: 100%;
  height: 34px;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 14px;
  cursor: pointer;
  transition:
    background 160ms ease,
    color 160ms ease;
}
.music-art-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* Related grid */
.music-rel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.music-rel-card {
  cursor: pointer;
}
.music-rel-art {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #16213e;
  border-radius: 4px;
  overflow: hidden;
}
.music-rel-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 200ms ease,
    transform 200ms ease;
}
.music-rel-card:hover .music-rel-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.music-rel-name {
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.music-rel-artist {
  color: #999;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── Reels page ─────────────────────────────────────────────────────────── */

.reels-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  padding: 24px 32px;
  align-items: start;
  max-width: 1800px;
  margin: 0 auto;
}
.reels-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
}

.reels-progress-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
}
@media (max-width: 1280px) {
  .reels-stage {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 20px;
    padding: 20px 24px;
  }
}
@media (max-width: 1100px) {
  .reels-stage {
    grid-template-columns: 1fr;
    padding: 18px;
  }
}
@media (max-width: 768px) {
  .reels-stage {
    /* Full-bleed on mobile — full screen, single column */
    padding: 0;
    gap: 0;
    display: block;
    /* dvh = dynamic viewport height (adapts to browser chrome show/hide)
       subtract header (56px) + bottom nav (56px) + notch safe area */
    height: calc(100dvh - 56px - 56px - env(safe-area-inset-bottom, 0px));
    overflow: hidden;
  }
}

.reels-reel-col {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: calc(100dvh - 56px - 56px);
}
.reels-reel-frame {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  justify-content: center;
}
@media (max-width: 768px) {
  .reels-reel-col {
    width: 100%;
    height: calc(100dvh - 56px - 56px - env(safe-area-inset-bottom, 0px));
    min-height: unset;
  }
  .reels-reel-frame {
    position: relative;
    width: 100%;
    height: 100%;
    gap: 0;
    align-items: stretch;
  }
  /* Desktop action sidebar hidden — replaced by in-video overlay */
  .reels-actions {
    display: none;
  }
  .reels-nav {
    display: none;
  }
  /* Hide "more reels" list — full-screen video only on mobile */
  .reels-panel {
    display: none;
  }

  /* Dark overlay — visible on mobile */
  .reels-dark-overlay {
    display: block;
  }

  /* Creator info overlay: right padding leaves room for action button column */
  .reels-overlay {
    height: 44%;
    max-height: 340px;
    min-height: 200px;
    padding: 0 72px 20px 16px;
    background: linear-gradient(
      to top,
      rgba(0, 0, 0, 0.92) 0%,
      rgba(0, 0, 0, 0.68) 38%,
      rgba(0, 0, 0, 0.28) 65%,
      transparent 100%
    );
  }

  /* ── Mobile action panel (inside .reels-reel — Flutter Stack match) ── */
  .reels-mobile-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: absolute;
    right: 10px;
    /* sit comfortably above the progress bar (8px) */
    bottom: 20px;
    z-index: 10;
    gap: 14px;
  }
  .rma-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .rma-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
      transform 150ms ease,
      background 150ms ease;
    box-shadow:
      0 2px 12px rgba(0, 0, 0, 0.45),
      inset 0 1px 0 rgba(255, 255, 255, 0.12);
  }
  .rma-btn:active {
    transform: scale(0.84);
    background: rgba(0, 0, 0, 0.65);
  }
  .rma-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow:
      0 0 0 2px var(--accent),
      0 4px 16px rgba(0, 0, 0, 0.6);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    transition: transform 150ms ease;
  }
  .rma-avatar:active {
    transform: scale(0.84);
  }
  .rma-count,
  .rma-label {
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-shadow:
      0 1px 6px rgba(0, 0, 0, 0.9),
      0 0 10px rgba(0, 0, 0, 0.5);
    text-align: center;
    line-height: 1;
    letter-spacing: 0.01em;
  }
}

.reels-reel {
  position: relative;
  aspect-ratio: 9 / 16;
  height: min(calc(100dvh - 110px), 920px);
  width: 100%;
  max-width: min(520px, calc((100dvh - 110px) * 9 / 16));
  background: #16213e;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 0 48px rgba(var(--accent-rgb), 0.12),
    0 20px 60px rgba(0, 0, 0, 0.6);
  cursor: pointer;
}
@media (max-width: 768px) {
  .reels-reel {
    /* True full-screen video on mobile */
    width: 100%;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    aspect-ratio: unset;
    box-shadow: none;
  }
}

/* Dark overlay inside .reels-reel — mobile vignette */
.reels-dark-overlay {
  display: none; /* shown only on mobile via @media (max-width: 768px) */
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.22) 0%,
    transparent 30%,
    transparent 60%,
    rgba(0, 0, 0, 0.18) 100%
  );
  pointer-events: none;
  z-index: 1;
}

/* Mobile action panel — shown only on mobile via @media (max-width: 768px) */
.reels-mobile-actions {
  display: none;
}

/* ── Must come AFTER the base .reels-dark-overlay / .reels-mobile-actions
   rules above so cascade order wins on mobile (equal specificity → later
   source wins). Without this, the base `display: none` overrides the
   `display: flex/block` set inside the earlier @media block and the
   like/comment/share action column disappears on mobile. ── */
@media (max-width: 768px) {
  .reels-dark-overlay {
    display: block;
  }
  .reels-mobile-actions {
    display: flex;
  }
}

.reels-mute-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 200ms ease,
    transform 150ms ease;
  z-index: 5;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.reels-reel:hover .reels-mute-btn {
  opacity: 1;
}
.reels-mute-btn:active {
  transform: scale(0.88);
}
/* Always show mute on touch devices (no hover state) */
@media (pointer: coarse) {
  .reels-mute-btn {
    opacity: 1;
  }
}

.reels-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
  box-shadow:
    0 0 0 8px rgba(255, 255, 255, 0.06),
    0 8px 32px rgba(0, 0, 0, 0.6);
  animation: reels-bigplay-pop 200ms ease-out both;
}
@keyframes reels-bigplay-pop {
  from {
    transform: translate(-50%, -50%) scale(0.75);
    opacity: 0;
  }
  to {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
}

.reels-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 280px;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.95) 0%,
    rgba(0, 0, 0, 0.72) 45%,
    rgba(0, 0, 0, 0.28) 72%,
    transparent 100%
  );
  padding: 0 18px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  pointer-events: none;
  z-index: 2;
}
.reels-overlay > * {
  pointer-events: auto;
}

.reels-creator-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.reels-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  border: 2.5px solid #fff;
  box-shadow:
    0 0 0 2px var(--accent),
    0 4px 16px rgba(0, 0, 0, 0.5);
  flex-shrink: 0;
}
.reels-handle {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8);
  letter-spacing: -0.01em;
}
.reels-connect-btn {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  font-size: 11px;
  font-weight: 700;
  padding: 0 16px;
  height: 30px;
  border-radius: 20px;
  margin-left: 4px;
  letter-spacing: 0.03em;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 120ms ease;
  flex-shrink: 0;
}
.reels-connect-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.reels-connect-btn:active {
  transform: scale(0.93);
}

.reels-caption {
  color: rgba(255, 255, 255, 0.95);
  font-size: 13.5px;
  line-height: 1.55;
  margin-top: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  font-weight: 500;
}
.reels-caption.expanded {
  -webkit-line-clamp: unset;
}
.reels-caption-more {
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.reels-sound {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  cursor: pointer;
}
/* Spinning vinyl disc for sound row */
.reels-sound-disc {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  background: radial-gradient(
    circle at 50% 50%,
    var(--accent) 0 5px,
    #1a1a2e 5px 11px,
    #2d1b4e 11px 15px
  );
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  animation: reels-spin 3s linear infinite;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 2px 8px rgba(0, 0, 0, 0.5);
}
.reels-sound-text {
  white-space: nowrap;
  display: inline-block;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  letter-spacing: 0.01em;
}
.reels-sound:hover .reels-sound-text {
  animation: reels-marquee 12s linear infinite;
}
@keyframes reels-marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-30%);
  }
}

.reels-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  z-index: 4;
  cursor: pointer;
}
/* Taller invisible hit area for easier scrubbing */
.reels-progress::before {
  content: "";
  position: absolute;
  inset: -12px 0 0 0;
}
@media (max-width: 768px) {
  .reels-progress {
    height: 3px;
    background: rgba(255, 255, 255, 0.2);
  }
  /* Larger touch target on mobile */
  .reels-progress::before {
    inset: -16px 0 0 0;
  }
}
.reels-progress-fill {
  height: 100%;
  background: linear-gradient(
    to right,
    var(--accent),
    color-mix(in srgb, var(--accent) 70%, #fff)
  );
  transition: width 0.08s linear;
  border-radius: 0 2px 2px 0;
  position: relative;
}
/* Playhead dot at the tip */
.reels-progress-fill::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 150ms ease;
}
.reels-progress:hover .reels-progress-fill::after {
  opacity: 1;
}

/* Right action bar — desktop only; hidden on mobile (≤768px) via override below */
.reels-actions {
  width: 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding-left: 14px;
  align-self: center;
}
/* ── Must come AFTER base .reels-actions so cascade order wins ── */
@media (max-width: 768px) {
  .reels-actions {
    display: none;
  }
}
.reels-action-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.reels-action-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.reels-action-stack:hover .reels-action-icon {
  transform: scale(1.1);
  background: rgba(0, 0, 0, 0.75);
  border-color: rgba(255, 255, 255, 0.3);
}
.reels-action-count {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.reels-action-label {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.reels-action-avatar-wrap {
  position: relative;
}
.reels-action-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  border: 2.5px solid #fff;
  box-shadow:
    0 0 0 2px var(--accent),
    0 4px 14px rgba(0, 0, 0, 0.5);
}
.reels-action-plus {
  position: absolute;
  left: 50%;
  bottom: -7px;
  transform: translateX(-50%);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  border: 2px solid #000;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.reels-vinyl {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(
    circle at 50% 50%,
    var(--accent) 0 7px,
    #0d0d1a 7px 13px,
    #1a0a2e 13px 19px,
    #0d0d1a 19px 21px
  );
  animation: reels-spin 6s linear infinite;
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.12),
    0 3px 12px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}
@keyframes reels-spin {
  to {
    transform: rotate(360deg);
  }
}

/* Nav buttons */
.reels-nav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 16px;
  align-self: center;
}
.reels-nav-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 4px 20px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 120ms ease;
}
.reels-nav-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.05);
}
.reels-nav-btn:active {
  transform: scale(0.92);
}
.reels-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.reels-nav-btn:disabled:hover {
  background: rgba(0, 0, 0, 0.55);
  border-color: rgba(255, 255, 255, 0.18);
  transform: none;
}
/* ── Must come AFTER base .reels-nav so cascade order wins on mobile ── */
@media (max-width: 768px) {
  .reels-nav {
    display: none;
  }
}

/* Right panel */
.reels-panel {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
  padding-right: 4px;
}
/* inherits the global 4px subtle scrollbar */

.reels-panel-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}
.reels-panel-title {
  color: var(--text-primary);
  font-size: 15px;
  font-weight: 600;
}
.reels-chips {
  display: flex;
  gap: 8px;
}
.reels-chip {
  background: var(--card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  transition:
    background 160ms ease,
    color 160ms ease;
}
.reels-chip:hover {
  color: var(--text-primary);
  background: var(--deep);
}
.reels-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.reels-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.reels-list-card {
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease;
  position: relative;
}
.reels-list-card:hover {
  background: var(--card);
}
.reels-list-thumb {
  position: relative;
  width: 110px;
  flex-shrink: 0;
  aspect-ratio: 9 / 16;
  border-radius: 6px;
  overflow: hidden;
  background: var(--deep);
  transition: box-shadow 160ms ease;
}
.reels-list-card:hover .reels-list-thumb {
  box-shadow: -2px 0 0 var(--accent);
}
.reels-list-card.active .reels-list-thumb {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.reels-list-play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.reels-list-eq {
  position: absolute;
  top: 6px;
  right: 6px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
}
.reels-list-eq span {
  width: 2px;
  background: var(--accent);
  border-radius: 1px;
  animation: reels-eq 800ms ease-in-out infinite alternate;
}
.reels-list-eq span:nth-child(1) {
  height: 50%;
  animation-delay: 0ms;
}
.reels-list-eq span:nth-child(2) {
  height: 100%;
  animation-delay: 120ms;
}
.reels-list-eq span:nth-child(3) {
  height: 65%;
  animation-delay: 240ms;
}
@keyframes reels-eq {
  from {
    height: 20%;
  }
  to {
    height: 100%;
  }
}

.reels-list-meta {
  flex: 1;
  min-width: 0;
  padding-top: 4px;
}
.reels-list-name {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}
.reels-list-tick {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.reels-list-cap {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.4;
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.reels-list-stats {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 6px;
}
.reels-list-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

@media (max-width: 1100px) {
  .reels-panel {
    position: relative;
    top: 0;
    max-height: none;
  }
}

/* ─── Watch page ─────────────────────────────────────────────────────────── */

.watch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  padding: 20px;
  max-width: 1600px;
}
@media (max-width: 1180px) {
  .watch-grid {
    grid-template-columns: 1fr;
  }
}

/* Player */
.watch-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0f3460;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}
.watch-player-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.15) 0%,
    rgba(0, 0, 0, 0) 30%,
    rgba(0, 0, 0, 0) 60%,
    rgba(0, 0, 0, 0.6) 100%
  );
  pointer-events: none;
}
.watch-hd-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 6px;
  border-radius: 3px;
}
.watch-bigplay {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(var(--accent-rgb), 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.5);
  transition: transform 200ms ease;
  padding-left: 4px;
}
.watch-bigplay:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

/* Progress bar */
.watch-progress-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  height: 4px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: height 160ms ease;
}
.watch-progress-bar:hover {
  height: 6px;
}
.watch-progress-fill {
  height: 100%;
  background: var(--accent);
  position: relative;
}
.watch-progress-handle {
  position: absolute;
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--accent-rgb), 0.25);
}
.watch-progress-marker {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
}
.watch-progress-tip {
  position: absolute;
  bottom: 18px;
  transform: translateX(-50%);
  background: #0f3460;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}

/* Controls */
.watch-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 52px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0));
}
.watch-ctl-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: background 140ms ease;
}
.watch-ctl-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}
.watch-vol {
  display: flex;
  align-items: center;
  gap: 8px;
}
.watch-vol-track {
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  cursor: pointer;
}
.watch-vol-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--accent);
  border-radius: 2px;
}
.watch-vol-handle {
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
}
.watch-time {
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  padding: 0 6px;
}

/* Title */
.watch-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.35;
  margin: 16px 0 0;
  letter-spacing: -0.01em;
}

/* Channel row */
.watch-channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.watch-channel-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.watch-channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #2a2a4e;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
}
.watch-channel-name {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.watch-channel-tick {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.watch-channel-subs {
  color: var(--text-muted);
  font-size: 11px;
}
.watch-btn-connect {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  height: 28px;
  padding: 0 14px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  transition:
    background 160ms ease,
    color 160ms ease;
  white-space: nowrap;
}
.watch-btn-connect:hover {
  background: var(--accent);
  color: #fff;
}

/* Action buttons */
.watch-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.watch-pill-group {
  display: flex;
  align-items: stretch;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 20px;
  overflow: hidden;
  height: 32px;
}
.watch-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  transition: background 160ms ease;
}
.watch-pill-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}
.watch-pill-btn.active {
  background: var(--accent);
  color: #fff;
}
.watch-pill-divider {
  width: 1px;
  background: var(--border);
}
.watch-action-btn {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
  background: var(--deep);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  transition: background 160ms ease;
  white-space: nowrap;
}
.watch-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}
.watch-action-circle {
  width: 32px;
  padding: 0;
  justify-content: center;
}

/* Description */
.watch-desc {
  background: var(--card);
  border-radius: 8px;
  padding: 14px;
  margin-top: 14px;
  border: 1px solid var(--border);
}
.watch-desc-meta {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}
.watch-desc-text {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 8px;
}
.watch-desc-toggle {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
  display: inline-block;
}
.watch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}
.watch-tag {
  background: rgba(var(--accent-rgb), 0.1);
  color: var(--accent);
  font-size: 10px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 12px;
}

/* Chapters */
.watch-chapters {
  background: var(--card);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 12px;
  border: 1px solid var(--border);
}
.watch-chapters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.watch-chapters-title {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}
.watch-chapters-list {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.watch-chapter {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 6px;
  border-left: 3px solid transparent;
  transition: background 140ms ease;
  cursor: pointer;
}
.watch-chapter:hover {
  background: rgba(255, 255, 255, 0.04);
}
.watch-chapter.active {
  background: #1a2547;
  border-left-color: var(--accent);
}
.watch-chapter-time {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  min-width: 56px;
  font-variant-numeric: tabular-nums;
}
.watch-chapter-thumb {
  position: relative;
  width: 80px;
  height: 45px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #0f3460;
}
.watch-chapter-title {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.4;
  flex: 1;
}

/* Comments */
.watch-comments {
  margin-top: 28px;
}
.watch-comments-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.watch-comments-title {
  color: var(--text-primary);
  font-size: 16px;
  font-weight: 600;
}
.watch-comments-count {
  color: var(--text-muted);
  font-size: 12px;
}
.watch-sort-btn {
  margin-left: auto;
  background: var(--card);
  color: var(--text-primary);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  cursor: pointer;
}
.watch-add-comment {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 18px;
}
.watch-comment-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.watch-comment-input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 12px;
  padding: 6px 2px;
  outline: 0;
  font-family: inherit;
  transition: border-color 160ms ease;
}
.watch-comment-input::placeholder {
  color: #555;
}
.watch-comment-input:focus {
  border-bottom-color: var(--accent);
}
.watch-comment-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 10px;
}
.watch-btn-text {
  background: transparent;
  color: #999;
  font-size: 11px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 6px;
}
.watch-btn-text:hover {
  color: #fff;
}
.watch-btn-primary {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 6px;
  transition: filter 160ms ease;
}
.watch-btn-primary:hover {
  filter: brightness(1.08);
}
.watch-comment {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.watch-comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.watch-comment-name {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
}
.watch-comment-time {
  color: var(--text-muted);
  font-size: 10px;
}
.watch-comment-text {
  color: var(--text-primary);
  font-size: 12px;
  line-height: 1.6;
  margin-top: 4px;
}
.watch-comment-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 8px;
}
.watch-comment-act {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #888;
  font-size: 11px;
  transition: color 140ms ease;
  cursor: pointer;
}
.watch-comment-act:hover {
  color: var(--accent);
}
.watch-comment-replies {
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  cursor: pointer;
}
.watch-show-more {
  width: 100%;
  margin-top: 22px;
  height: 38px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  transition:
    background 160ms ease,
    color 160ms ease;
}
.watch-show-more:hover {
  background: var(--accent);
  color: #fff;
}

/* Right sidebar */
.watch-side-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.watch-autoplay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px 4px;
}
.watch-autoplay-label {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}
.watch-toggle {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #333;
  position: relative;
  transition: background 200ms ease;
  cursor: pointer;
  flex-shrink: 0;
  border: none;
}
.watch-toggle.on {
  background: var(--accent);
}
.watch-toggle-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 200ms cubic-bezier(0.4, 0, 0.2, 1);
}
.watch-toggle.on .watch-toggle-knob {
  transform: translateX(16px);
}

/* Recommended card */
.watch-rec-card {
  display: flex;
  gap: 10px;
  padding: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 140ms ease;
}
.watch-rec-card:hover {
  background: var(--card);
}
.watch-rec-thumb {
  position: relative;
  width: 160px;
  height: 90px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: #16213e;
}
.watch-duration {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 3px;
  font-family: monospace;
}
.watch-rec-meta {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}
.watch-rec-title {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.005em;
}
.watch-rec-creator {
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.watch-rec-stats {
  color: var(--text-muted);
  font-size: 10px;
  margin-top: 1px;
}

/* Mini reels */
.watch-mini-reels-label {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 600;
  padding: 14px 4px 8px;
}
.watch-mini-reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.watch-mini-reel {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 4px;
  overflow: hidden;
  background: #16213e;
  cursor: pointer;
  transition: transform 180ms ease;
}
.watch-mini-reel:hover {
  transform: translateY(-2px);
}
.watch-reel-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(var(--accent-rgb), 0.85);
  color: #fff;
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 2px 4px;
  border-radius: 2px;
}
.watch-reel-likes {
  position: absolute;
  right: 4px;
  bottom: 4px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 9px;
  font-weight: 600;
  padding: 2px 5px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* ─── Profile page ───────────────────────────────────────────────────────── */

@keyframes prof-banner-in {
  from {
    transform: scale(1.06);
    opacity: 0.5;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}
@keyframes prof-avatar-in {
  from {
    transform: scale(0.6) translateY(14px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}
@keyframes prof-content-in {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes prof-card-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
@keyframes prof-stat-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes prof-orb-pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 3px rgba(var(--accent-rgb), 0.5),
      0 0 0 0 rgba(var(--accent-rgb), 0);
  }
  50% {
    box-shadow:
      0 0 0 5px rgba(var(--accent-rgb), 0.3),
      0 0 28px rgba(var(--accent-rgb), 0.35);
  }
}
@keyframes prof-feed-in {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes prof-tab-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@layer components {
  .dt-live-dot {
    @apply inline-block w-2 h-2 rounded-full bg-red-600;
    box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.6);
    animation: dt-live-pulse 1.6s ease-out infinite;
  }

  @keyframes dt-live-pulse {
    0% {
      box-shadow: 0 0 0 0 rgba(217, 48, 37, 0.6);
    }
    70% {
      box-shadow: 0 0 0 8px rgba(217, 48, 37, 0);
    }
    100% {
      box-shadow: 0 0 0 0 rgba(217, 48, 37, 0);
    }
  }
}
