/* ==========================================================================
   Beatavo — core stylesheet
   Mobile-first, bright + fun, accessible, no frameworks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Colour — light (default) */
  --color-bg: #ffffff;
  --color-bg-tint: #faf5ff;
  --color-surface: #ffffff;
  --color-surface-2: #f4effd;
  --color-text: #191033;
  --color-text-muted: #5b5273;
  --color-border: #e8e0f7;

  --color-brand: #7c4dff;
  --color-brand-strong: #5a2ce0;
  --color-brand-2: #ff3e9d;
  --color-accent: #ffd233;

  --color-on-brand: #ffffff;
  --color-on-accent: #2b1a00;

  /* Gradient used for hero + accents */
  --grad-brand: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-2) 100%);

  /* Shape + depth */
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(25, 16, 51, 0.06), 0 1px 3px rgba(25, 16, 51, 0.08);
  --shadow-md: 0 6px 18px rgba(25, 16, 51, 0.10);
  --shadow-lg: 0 14px 40px rgba(25, 16, 51, 0.16);

  /* Spacing scale */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;

  /* Layout */
  --container: 64rem;
  --tap: 48px;

  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;

  color-scheme: light;
}

/* Dark tokens apply when the system asks for dark and the visitor has not
   pinned light, or whenever dark has been pinned explicitly with the header
   toggle (see assets/js/theme.js). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --color-bg: #0e0b1a;
    --color-bg-tint: #14102a;
    --color-surface: #171226;
    --color-surface-2: #201a36;
    --color-text: #f5f2ff;
    --color-text-muted: #b3a9d1;
    --color-border: #2c2548;

    --color-brand: #9d7bff;
    --color-brand-strong: #b79bff;
    --color-brand-2: #ff6bb2;
    --color-accent: #ffd84d;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.55);

    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --color-bg: #0e0b1a;
  --color-bg-tint: #14102a;
  --color-surface: #171226;
  --color-surface-2: #201a36;
  --color-text: #f5f2ff;
  --color-text-muted: #b3a9d1;
  --color-border: #2c2548;

  --color-brand: #9d7bff;
  --color-brand-strong: #b79bff;
  --color-brand-2: #ff6bb2;
  --color-accent: #ffd84d;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 14px 40px rgba(0, 0, 0, 0.55);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base / reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 var(--space-3);
}

a {
  color: var(--color-brand-strong);
}

:focus-visible {
  outline: 3px solid var(--color-brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   Helpers
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

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

.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  z-index: 100;
  background: var(--color-brand);
  color: var(--color-on-brand);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn svg {
  flex: none;
}

.btn--primary {
  background: var(--grad-brand);
  color: var(--color-on-brand);
  box-shadow: var(--shadow-md);
}

.btn--primary:hover {
  box-shadow: var(--shadow-lg);
}

.btn--ghost {
  background: var(--color-surface-2);
  color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-border);
}

.btn--ghost:hover {
  background: var(--color-border);
}

.btn--coffee {
  background: var(--color-accent);
  color: var(--color-on-accent);
  box-shadow: var(--shadow-sm);
}

.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: saturate(1.4) blur(10px);
  background: color-mix(in srgb, var(--color-bg) 82%, transparent);
  border-bottom: 1px solid var(--color-border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: var(--color-text);
  text-decoration: none;
}

.brand__mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: block;
}

.brand__accent {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.header-nav {
  display: none;
  gap: var(--space-4);
  font-weight: 600;
}

.header-nav a {
  color: var(--color-text-muted);
  text-decoration: none;
  padding: var(--space-2) 0;
}

.header-nav a:hover {
  color: var(--color-text);
}

/* Language picker — always visible, compact on small screens. */
.lang {
  display: inline-flex;
  align-items: center;
}

.lang__select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 44px;
  padding: 0 var(--space-5) 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background-color: var(--color-surface-2);
  color: var(--color-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.lang__select:hover {
  border-color: var(--color-brand);
}

@media (min-width: 40rem) {
  .header-nav {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   Main / hero
   -------------------------------------------------------------------------- */
main {
  flex: 1 0 auto;
  padding-block: var(--space-5) var(--space-7);
}

.hero {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--grad-brand);
  color: var(--color-on-brand);
  box-shadow: var(--shadow-lg);
  margin-bottom: var(--space-5);
}

.hero h1 {
  font-size: clamp(1.6rem, 6vw, 2.4rem);
  margin: 0;
}

.hero p {
  margin: 0;
  opacity: 0.92;
  max-width: 40ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

.hero .btn--play {
  min-height: 60px;
  padding-inline: var(--space-6);
  font-size: 1.15rem;
  background: #ffffff;
  color: var(--color-brand-strong);
  box-shadow: var(--shadow-md);
}

.hero .btn--play:hover {
  background: #fff8fd;
}

.hero .btn--shuffle {
  min-height: 60px;
  padding-inline: var(--space-5);
  font-size: 1.05rem;
  background: rgba(255, 255, 255, 0.16);
  color: var(--color-on-brand);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.7);
}

.hero .btn--shuffle:hover {
  background: rgba(255, 255, 255, 0.28);
}

.hero .btn--shuffle[disabled] {
  opacity: 0.6;
}

/* --------------------------------------------------------------------------
   Dance of the day
   -------------------------------------------------------------------------- */
.dotd {
  margin-bottom: var(--space-5);
}

.dotd__label {
  font-size: 1.15rem;
  margin: 0 0 var(--space-1);
}

.dotd__hint {
  margin: 0 0 var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.dotd__card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.dotd__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.dotd__thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-2);
}

.dotd__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dotd__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.05));
}

.dotd__play svg {
  width: 60px;
  height: 60px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.dotd__body {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-2);
}

.dotd__title {
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.3;
}

.dotd__cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  align-self: flex-start;
  min-height: var(--tap);
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--grad-brand);
  color: var(--color-on-brand);
  font-weight: 700;
}

@media (min-width: 40rem) {
  .dotd__card {
    grid-template-columns: minmax(0, 320px) 1fr;
    align-items: center;
  }
}

/* --------------------------------------------------------------------------
   Browse by tag (chips)
   -------------------------------------------------------------------------- */
.tag-nav {
  margin-bottom: var(--space-4);
}

.tag-nav__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}

.tag-nav__list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 40px;
  padding: 0 var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.tag-chip:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
  border-color: var(--color-brand);
}

.tag-chip__count {
  display: inline-grid;
  place-items: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.35rem;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Section tabs
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-4);
}

.tab {
  flex: 1 1 0;
  min-height: var(--tap);
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab[aria-selected="true"] {
  background: var(--color-surface);
  color: var(--color-text);
  box-shadow: var(--shadow-sm);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.section-head h2 {
  font-size: 1.15rem;
  margin: 0;
}

.section-head .count {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Toolbar (search + filters)
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.search {
  flex: 1 1 16rem;
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  font-size: 1rem;
}

.search::placeholder {
  color: var(--color-text-muted);
}


/* --------------------------------------------------------------------------
   Video grid + cards
   -------------------------------------------------------------------------- */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-4);
}

@media (min-width: 40rem) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

.card {
  position: relative;
}

.card__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-md);
}

.card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-2);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.card__link:hover .card__thumb {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__badge {
  position: absolute;
  left: var(--space-2);
  top: var(--space-2);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.card__play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.05));
  transition: opacity 0.18s ease;
}

.card__link:hover .card__play,
.card__link:focus-visible .card__play {
  opacity: 1;
}

.card__play svg {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.4));
}

.card__title {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Heart button — favourite toggle */
.card__fav {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.15s ease;
}

.card__fav:hover {
  background: rgba(0, 0, 0, 0.75);
}

.card__fav:active {
  transform: scale(0.92);
}

.card__fav[aria-pressed="true"] {
  background: #ffffff;
  color: var(--color-brand-2);
}

.card__fav[aria-pressed="true"] svg {
  fill: currentColor;
  stroke: currentColor;
}


/* --------------------------------------------------------------------------
   States: loading / empty / error
   -------------------------------------------------------------------------- */
.state {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
}

.state h2 {
  color: var(--color-text);
  font-size: 1.1rem;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: var(--space-4);
}

@media (min-width: 40rem) {
  .skeleton-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
}

.skeleton-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.skeleton {
  background: linear-gradient(90deg, var(--color-surface-2) 25%, var(--color-border) 37%, var(--color-surface-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--radius-md);
}

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

.skeleton--line {
  height: 0.9rem;
  width: 80%;
}

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

/* --------------------------------------------------------------------------
   Player page
   -------------------------------------------------------------------------- */
.player-layout {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 60rem) {
  .player-layout {
    grid-template-columns: minmax(0, 2fr) minmax(18rem, 1fr);
    align-items: start;
  }
}

.player__stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.player__stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.player__facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #000;
  display: block;
}

.player__facade img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
}

.player__facade-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}

.player__facade-play span {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-5);
  border-radius: var(--radius-pill);
  background: var(--color-brand);
  color: var(--color-on-brand);
  font-weight: 800;
  box-shadow: var(--shadow-lg);
}

.player__facade:hover .player__facade-play span {
  background: var(--color-brand-strong);
}

.player__controls {
  display: flex;
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.player__controls .btn {
  flex: 1 1 0;
}

.player__title {
  font-size: clamp(1.15rem, 4vw, 1.6rem);
  margin: var(--space-4) 0 var(--space-2);
}

.player__meta {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  margin: 0;
}

.player__share {
  margin-top: var(--space-4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.copy-status {
  color: var(--color-brand-strong);
  font-size: 0.85rem;
  font-weight: 600;
  min-height: 1.2em;
}

/* Mini sticky player bar (watch page) */
.miniplayer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--color-surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--color-border);
  box-shadow: var(--shadow-lg);
}

.miniplayer[hidden] {
  display: none;
}

.miniplayer__info {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.miniplayer__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}

.miniplayer__title {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.miniplayer__controls {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: none;
}

.mini-btn {
  display: grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}

.mini-btn:hover {
  background: var(--color-border);
}

.mini-btn:active {
  transform: scale(0.94);
}

.mini-btn--primary {
  background: var(--grad-brand);
  color: var(--color-on-brand);
  box-shadow: var(--shadow-sm);
}

.watch-page .site-footer {
  padding-bottom: calc(var(--space-5) + 72px);
}

/* Up next / queue */
.upnext {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}

.upnext h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
}

.queue {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  max-height: 60vh;
  overflow-y: auto;
}

.queue__item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: var(--space-3);
  align-items: center;
  width: 100%;
  min-height: var(--tap);
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: inherit;
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.queue__item:hover {
  background: var(--color-surface-2);
}

.queue__item[aria-current="true"] {
  background: var(--color-surface-2);
  box-shadow: inset 3px 0 0 var(--color-brand);
}

.queue__thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-2);
}

.queue__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.queue__title {
  font-weight: 600;
  font-size: 0.9rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Standalone content pages (privacy etc.)
   -------------------------------------------------------------------------- */
.prose {
  max-width: 46rem;
}

.prose h1 {
  font-size: clamp(1.6rem, 5vw, 2.2rem);
}

.prose h2 {
  font-size: 1.15rem;
  margin-top: var(--space-6);
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: var(--space-2);
}

.prose .lead {
  font-size: 1.05rem;
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  flex: none;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-tint);
  padding-block: var(--space-5);
  margin-top: var(--space-7);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  align-items: center;
  text-align: center;
}

.site-footer__tagline {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: center;
}

.footer-links a.footer-link {
  color: var(--color-text-muted);
  font-weight: 600;
  text-decoration: none;
  padding: var(--space-2);
}

.footer-links a.footer-link:hover {
  color: var(--color-text);
}

/* --------------------------------------------------------------------------
   Kids page — bigger buttons, roomier cards, always-visible play affordance
   -------------------------------------------------------------------------- */
.kids-back {
  margin-bottom: var(--space-4);
}

.hero--kids {
  background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-2) 100%);
}

.kids-page .btn--kids {
  min-height: 72px;
  padding-inline: var(--space-6);
  font-size: 1.25rem;
  border-radius: var(--radius-lg);
}

.kids-page .btn--kids svg {
  width: 28px;
  height: 28px;
}

.video-grid--kids {
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-5);
}

@media (min-width: 40rem) {
  .video-grid--kids {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  }
}

.card--kids .card__thumb {
  border-radius: var(--radius-lg);
}

.card--kids .card__title {
  font-size: 1.15rem;
}

.card--kids .card__play {
  opacity: 1;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0));
}

.card--kids .card__play svg {
  width: 72px;
  height: 72px;
}

/* --------------------------------------------------------------------------
   Embeddable player (/embed/)
   -------------------------------------------------------------------------- */
.embed-page {
  background: #000;
}

.embed {
  flex: 1 1 auto;
  display: grid;
  place-content: center;
  gap: var(--space-2);
  min-height: 100dvh;
  background: #000;
}

.embed .player__stage {
  width: 100%;
  border-radius: 0;
  box-shadow: none;
}

.embed__caption {
  margin: 0;
  color: #fff;
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.75;
}

/* --------------------------------------------------------------------------
   Dance challenge
   -------------------------------------------------------------------------- */
.challenge {
  text-align: center;
}

.challenge--intro,
.challenge--finish {
  max-width: 40rem;
  margin-inline: auto;
}

.challenge--intro h1 {
  font-size: clamp(1.8rem, 5vw, 2.6rem);
}

.challenge__streak {
  display: inline-block;
  margin: var(--space-2) 0 var(--space-4);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.95rem;
}

.challenge__player {
  position: relative;
  max-width: 56rem;
  margin: 0 auto var(--space-4);
}

.challenge__countdown {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: var(--space-2);
  border-radius: var(--radius-md);
  background: rgba(14, 11, 26, 0.72);
  color: #fff;
}

.challenge__countdown-label {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9rem;
}

.challenge__countdown-num {
  font-size: clamp(3rem, 14vw, 5.5rem);
  font-weight: 800;
  line-height: 1;
}

.challenge__progress {
  font-weight: 700;
  margin-bottom: var(--space-1);
}

.challenge--finish h2 {
  font-size: clamp(1.6rem, 5vw, 2.4rem);
}

/* --------------------------------------------------------------------------
   Kids mode toggle (header)
   -------------------------------------------------------------------------- */
.mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.mode-toggle:hover {
  border-color: var(--color-brand);
}

.mode-toggle[hidden] {
  display: none;
}

.mode-toggle__text {
  display: none;
  white-space: nowrap;
}

@media (min-width: 60rem) {
  .mode-toggle__text {
    display: inline;
  }
}

.kids-lock {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-4);
  padding: var(--space-1) var(--space-4);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-weight: 700;
  font-size: 0.9rem;
}

.kids-lock[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Recently played row
   -------------------------------------------------------------------------- */
.recent {
  margin-bottom: var(--space-5);
}

.recent__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}

.recent__list {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0 0 var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.recent__item {
  flex: 0 0 auto;
  width: 200px;
  scroll-snap-align: start;
}

.recent__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-decoration: none;
  color: var(--color-text);
}

.recent__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-2);
  box-shadow: var(--shadow-sm);
}

.recent__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent__title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Playlist buttons on cards
   -------------------------------------------------------------------------- */
.card__pl {
  position: absolute;
  top: var(--space-2);
  right: var(--space-2);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.15s ease, transform 0.15s ease;
}

/* When a heart button is also present, drop the playlist button below it. */
.card__fav + .card__pl {
  top: calc(var(--space-2) + 44px + var(--space-2));
}

.card__pl:hover {
  background: rgba(0, 0, 0, 0.75);
}

.card__pl:active {
  transform: scale(0.92);
}

.card__pl[aria-pressed="true"] {
  background: #ffffff;
  color: var(--color-brand);
}

/* --------------------------------------------------------------------------
   Modals (add-to-playlist, grown-up gate, shortcut help)
   -------------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--space-4);
}

.modal[hidden] {
  display: none;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(14, 11, 26, 0.55);
  backdrop-filter: blur(2px);
}

.modal__panel {
  position: relative;
  width: min(28rem, 100%);
  max-height: min(88dvh, 40rem);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.modal__head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal__x {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.modal__x:hover {
  background: var(--color-border);
}

.modal__sub {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-2);
  margin-top: var(--space-1);
}

body.modal-open {
  overflow: hidden;
}

/* Playlist list inside the dialog */
.pl-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.pl-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: var(--tap);
  padding: 0 var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
}

.pl-item:hover {
  background: var(--color-surface-2);
}

.pl-item input {
  flex: none;
  width: 22px;
  height: 22px;
  accent-color: var(--color-brand);
}

.pl-item__name {
  flex: 1 1 auto;
  font-weight: 600;
}

.pl-item__count {
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.pl-empty {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  padding: var(--space-2) var(--space-1);
}

.pl-new {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.pl-new__input,
.pl-create__input {
  flex: 1 1 auto;
  width: 100%;
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

/* Grown-up gate */
.gate__q {
  display: block;
  font-weight: 700;
  margin-bottom: var(--space-2);
}

.gate__error {
  color: var(--color-brand-2);
  font-weight: 600;
  margin: var(--space-2) 0 0;
}

/* Keyboard shortcut help */
.shortcuts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.shortcuts__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.shortcuts__keys {
  display: inline-flex;
  gap: var(--space-1);
}

.shortcuts__keys kbd {
  min-width: 1.8rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid var(--color-border);
  border-bottom-width: 2px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.85rem;
  text-align: center;
}

.shortcuts__label {
  color: var(--color-text-muted);
}

/* Square ghost icon button (watch page actions) */
.btn--icon {
  width: var(--tap);
  min-width: var(--tap);
  padding: 0;
}

.player__slot {
  display: inline-flex;
}

/* --------------------------------------------------------------------------
   Playlists page
   -------------------------------------------------------------------------- */
.playlists {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.pl-block__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.pl-block__head h2 {
  margin: 0;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.pl-block__head .count {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

.pl-block__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.pl-create {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.pl-create__input {
  flex: 1 1 12rem;
  width: auto;
}

/* --------------------------------------------------------------------------
   Install banner ("Add to home screen")
   -------------------------------------------------------------------------- */
.install-banner {
  position: fixed;
  left: 50%;
  bottom: max(var(--space-4), env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 55;
  width: min(92%, 30rem);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}

.install-banner__icon {
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
}

.install-banner__text {
  flex: 1 1 auto;
  font-weight: 600;
  line-height: 1.3;
}

.install-banner__add {
  flex: 0 0 auto;
}

.install-banner__close {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-content: center;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--color-text-muted);
  font-size: 1.5rem;
  line-height: 1;
  border-radius: var(--radius-pill);
}

.install-banner__close:hover {
  background: var(--color-surface-2);
}

/* --------------------------------------------------------------------------
   Watch page — sleep timer + loop toggle
   -------------------------------------------------------------------------- */
.sleep {
  display: inline-flex;
  align-items: center;
}

.sleep__select {
  min-height: var(--tap);
  padding: 0 var(--space-3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  cursor: pointer;
}

.btn--icon[aria-pressed="true"] {
  background: var(--grad-brand);
  color: var(--color-on-brand);
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   Kids page — extra-large, age-friendly sizing (no search, kids videos only)
   -------------------------------------------------------------------------- */
.kids-page {
  font-size: 1.125rem;
}

.kids-page .btn:not(.btn--kids) {
  font-size: 1.15rem;
  min-height: 60px;
}

.kids-page .btn--kids {
  min-height: 80px;
  font-size: 1.35rem;
}

.kids-page .btn svg {
  width: 28px;
  height: 28px;
}

.kids-page .card--kids .card__title {
  font-size: 1.25rem;
}

/* --------------------------------------------------------------------------
   Offline page
   -------------------------------------------------------------------------- */
.offline {
  max-width: 40rem;
  margin: 0 auto;
  padding-block: var(--space-6);
  text-align: center;
}

.offline__icon {
  font-size: 3rem;
  margin: 0 0 var(--space-3);
}

.offline__body {
  color: var(--color-text-muted);
}

.offline__recent {
  margin: var(--space-6) 0;
  text-align: start;
}

.offline__recent-label {
  font-size: 1.1rem;
}

.offline__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.offline__link {
  display: block;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  font-weight: 600;
  text-decoration: none;
}

.offline__link:hover {
  border-color: var(--color-brand);
}

.offline__empty {
  color: var(--color-text-muted);
}

.offline__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Error page (404)
   -------------------------------------------------------------------------- */
.error-page__body {
  max-width: 36rem;
  margin: 0 auto;
  padding-block: var(--space-7);
  text-align: center;
}

.error-page__code {
  margin: 0 0 var(--space-2);
  font-size: clamp(3.5rem, 18vw, 7rem);
  font-weight: 800;
  line-height: 1;
  color: var(--color-brand-strong);
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-top: var(--space-4);
}

/* --------------------------------------------------------------------------
   Theme toggle (header)
   -------------------------------------------------------------------------- */
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--color-brand);
}

/* --------------------------------------------------------------------------
   Watch page — "Up next" queue (reorder + remove)
   -------------------------------------------------------------------------- */
.queue__row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: var(--space-1);
}

.queue__row .queue__item {
  grid-template-columns: 80px 1fr;
  min-height: 0;
}

.queue__actions {
  display: flex;
  gap: 0.15rem;
}

.queue__btn {
  display: grid;
  place-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
}

.queue__btn:hover:not([disabled]) {
  border-color: var(--color-brand);
}

.queue__btn[disabled] {
  opacity: 0.4;
  cursor: not-allowed;
}

.queue__empty {
  padding: var(--space-3);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Watch page — "More like this" row
   -------------------------------------------------------------------------- */
.related {
  margin-top: var(--space-5);
}

.related__label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-2);
}

.related__list {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: 0;
  padding: 0 0 var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.related__item {
  flex: 0 0 auto;
  width: 200px;
  scroll-snap-align: start;
}

.related__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  text-decoration: none;
  color: var(--color-text);
}

.related__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-surface-2);
  box-shadow: var(--shadow-sm);
}

.related__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related__title {
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Home page — auto sections per tag
   -------------------------------------------------------------------------- */
.tag-sections {
  margin-top: var(--space-7);
}

.tag-sections__heading {
  font-size: 1.1rem;
  margin-bottom: var(--space-4);
}

.tag-section {
  margin-bottom: var(--space-6);
}

.tag-section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.tag-section__head h3 {
  margin: 0;
  font-size: 1.15rem;
}

.tag-section .see-all {
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.tag-section__row {
  list-style: none;
  display: flex;
  gap: var(--space-4);
  margin: 0;
  padding: 0 0 var(--space-2);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.tag-section__row > li {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: start;
}

/* --------------------------------------------------------------------------
   Favourites page — saved videos + "Your top dances"
   -------------------------------------------------------------------------- */
.top-dances {
  margin-top: var(--space-7);
}

.top-dances__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-2);
}

.top-dance {
  display: grid;
  grid-template-columns: 2rem 96px 1fr auto;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}

.top-dance__rank {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--color-brand-strong);
  text-align: center;
}

.top-dance__link {
  display: contents;
  color: inherit;
  text-decoration: none;
}

.top-dance__thumb {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--color-surface-2);
}

.top-dance__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-dance__title {
  font-weight: 600;
}

.top-dance__count {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.top-dances__empty {
  color: var(--color-text-muted);
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
