/* ============================================================================
   BootyMansion — site styles
   ----------------------------------------------------------------------------
   One stylesheet for the whole site: the home page and the watch page
   (/watch) load this file, so a card looks the same wherever it appears.
   ========================================================================== */

  /* ============ 1. TOKENS ============ */
  :root {
    color-scheme: dark;

    /* ---- surfaces & ink -------------------------------------------- */
    --bg: #0B0B0F;
    --surface: #15151B;
    --surface-2: #1B1B22;
    --surface-3: #101016;
    --text: #F4F4F6;
    --muted: #9A9AA8;
    --quiet: #86869A;
    --line: #26262F;
    --line-soft: #1F1F27;
    --line-strong: #33333E;
    --tint: rgba(255, 255, 255, 0.04);
    --tint-soft: rgba(255, 255, 255, 0.025);
    --tint-strong: rgba(255, 255, 255, 0.07);

    /* ---- accent: crimson rose -------------------------------------- */
    --accent: #F43F5E;
    --accent-hi: #FB7185;
    --accent-deep: #E11D48;
    --accent-gradient: linear-gradient(135deg, #FB7185 0%, #E11D48 100%);
    /* deeper twin for small fills that carry white text (>= 4.5:1) */
    --accent-gradient-ink: linear-gradient(135deg, #E11D48 0%, #BE123C 100%);
    --rose: var(--accent-hi);
    --rose-200: #FB7185;
    --rose-400: #E11D48;
    --rose-soft: rgba(244, 63, 94, 0.14);
    --rose-line: rgba(244, 63, 94, 0.38);
    --rose-fill: rgba(244, 63, 94, 0.18);
    --on-rose: #FFFFFF;

    /* ---- Telegram: blue in BOTH themes ----------------------------- */
    --tg: #229ED9;
    --tg-hover: #1C8CC2;

    /* ---- type ------------------------------------------------------ */
    --font-display: "Plus Jakarta Sans", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --font-body: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font: var(--font-body);

    /* ---- elevation + chrome ---------------------------------------- */
    --shadow: 0 30px 70px rgba(0, 0, 0, 0.55);
    --card-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
    --card-ring: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    --frame-shadow: 0 34px 80px rgba(0, 0, 0, 0.6);
    --header-bg: rgba(11, 11, 15, 0.82);
    --panel-bg: rgba(21, 21, 27, 0.98);
    --toast-bg: rgba(27, 27, 34, 0.96);
    --tabbar-bg: rgba(15, 15, 20, 0.92);

    /* ---- component surfaces ---------------------------------------- */
    --input-bg: rgba(255, 255, 255, 0.045);
    --input-bg-focus: rgba(255, 255, 255, 0.07);
    --chip-bg: rgba(255, 255, 255, 0.045);
    --chip-active-bg: var(--accent-gradient-ink);
    --chip-active-text: #FFFFFF;
    --ad-label: #9A9AA8;
    --ad-bg: linear-gradient(150deg, rgba(27, 27, 34, 0.7), rgba(16, 16, 22, 0.9));
    --sponsored-bg: radial-gradient(ellipse at 92% 6%, rgba(244, 63, 94, 0.16), transparent 46%),
      linear-gradient(150deg, rgba(30, 20, 26, 0.98), rgba(16, 14, 18, 0.98));
    --cta-bg: linear-gradient(135deg, #1B1418, #101016);
    --poster-bg: radial-gradient(ellipse 70% 60% at 72% 18%, rgba(var(--tone, 244, 63, 94), 0.26), transparent 62%),
      linear-gradient(150deg, #1B1418, #09090E 78%);
    --poster-grid: rgba(255, 255, 255, 0.035);
    --media-bg: #0D0D12;
    --ambient: radial-gradient(ellipse 70% 55% at 50% -8%, rgba(244, 63, 94, 0.12), transparent 62%);
    --selection: rgba(244, 63, 94, 0.3);
    --avatar-bg: linear-gradient(140deg, rgba(251, 113, 133, 0.32), rgba(225, 29, 72, 0.12));
    --footer-quiet: #7C7C8A;
    --ring-track: rgba(244, 63, 94, 0.16);
    --glow: rgba(244, 63, 94, 0.35);

    /* ---- fixed surfaces: identical in both themes ------------------
       The player, the media area and the 18+ / Telegram banner stay dark so
       white text on them keeps its contrast after a theme switch. */
    --player-bg: #08080C;
    --banner-bg: radial-gradient(ellipse at 12% 0%, rgba(244, 63, 94, 0.28), transparent 55%),
      linear-gradient(135deg, #1A1013, #0B0B0F 70%);
    --banner-line: rgba(255, 255, 255, 0.08);
    --banner-text: #F4F4F6;
    --banner-muted: #B4B4C0;

    --radius: 18px;
    --radius-lg: 26px;
    --radius-sm: 12px;
    --max: 1440px;
  }

  /* ---------------------------------------------------------------
     LIGHT THEME — off-white page, white cards, deep rose accent so
     buttons, links and chips stay readable on light backgrounds.
     --------------------------------------------------------------- */
  [data-theme="light"] {
    color-scheme: light;

    --bg: #F7F7FA;
    --surface: #FFFFFF;
    --surface-2: #F2F2F7;
    --surface-3: #FFFFFF;
    --text: #14141A;
    --muted: #6B6B7A;
    --quiet: #686878;
    --line: #E4E4EC;
    --line-soft: rgba(20, 20, 26, 0.06);
    --line-strong: #D5D5E0;
    --tint: rgba(20, 20, 26, 0.04);
    --tint-soft: rgba(20, 20, 26, 0.025);
    --tint-strong: rgba(20, 20, 26, 0.07);

    /* the accent is identical in both themes */
    --accent: #F43F5E;
    --accent-hi: #FB7185;
    --accent-deep: #E11D48;
    --accent-gradient: linear-gradient(135deg, #FB7185 0%, #E11D48 100%);
    --accent-gradient-ink: linear-gradient(135deg, #E11D48 0%, #BE123C 100%);
    --rose: #D6184A;
    --rose-200: #BE123C;
    --rose-400: #E11D48;
    --rose-soft: rgba(244, 63, 94, 0.1);
    --rose-line: rgba(244, 63, 94, 0.34);
    --rose-fill: rgba(244, 63, 94, 0.12);
    --on-rose: #FFFFFF;

    --shadow: 0 24px 60px rgba(20, 20, 26, 0.08);
    --card-shadow: 0 12px 30px rgba(20, 20, 26, 0.07);
    --card-ring: inset 0 0 0 1px rgba(20, 20, 26, 0.05);
    --frame-shadow: 0 26px 60px rgba(20, 20, 26, 0.14);
    --header-bg: rgba(247, 247, 250, 0.86);
    --panel-bg: rgba(255, 255, 255, 0.99);
    --toast-bg: rgba(255, 255, 255, 0.98);
    --tabbar-bg: rgba(255, 255, 255, 0.94);

    --input-bg: #FFFFFF;
    --input-bg-focus: #FFFFFF;
    --chip-bg: rgba(20, 20, 26, 0.04);
    --chip-active-bg: var(--accent-gradient-ink);
    --chip-active-text: #FFFFFF;
    --ad-label: #6B6B7A;
    --ad-bg: linear-gradient(150deg, #F2F2F7, #FFFFFF);
    --sponsored-bg: radial-gradient(ellipse at 92% 6%, rgba(244, 63, 94, 0.1), transparent 46%),
      linear-gradient(150deg, #FFFFFF, #FFF5F6);
    --cta-bg: linear-gradient(135deg, #FFF5F6, #FFFFFF);
    --poster-bg: radial-gradient(ellipse 70% 60% at 72% 18%, rgba(var(--tone, 244, 63, 94), 0.16), transparent 62%),
      linear-gradient(150deg, #F2F2F7, #E7E7EE 78%);
    --poster-grid: rgba(20, 20, 26, 0.05);
    --media-bg: #EDEDF2;
    --ambient: radial-gradient(ellipse 70% 55% at 50% -8%, rgba(244, 63, 94, 0.08), transparent 62%);
    --selection: rgba(244, 63, 94, 0.18);
    --avatar-bg: linear-gradient(140deg, rgba(251, 113, 133, 0.2), rgba(225, 29, 72, 0.06));
    --footer-quiet: #7A7A88;
    --ring-track: rgba(244, 63, 94, 0.18);
    --glow: rgba(244, 63, 94, 0.16);
  }

  /* ============ 2. BASE ============ */
  *, *::before, *::after { box-sizing: border-box; }
  [hidden] { display: none !important; }

  html {
    scroll-behavior: smooth;
    scroll-padding-top: 92px;
    background: var(--bg);
  }

  body {
    min-width: 320px;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
  }

  img, video { display: block; max-width: 100%; }
  a { color: inherit; text-decoration: none; }
  button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
  input { font: inherit; }
  :focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; border-radius: 6px; }
  ::selection { background: var(--selection); }

  .shell {
    width: min(var(--max), 100% - 2rem);
    margin-inline: auto;
  }

  @media (min-width: 1024px) {
    .shell { width: min(var(--max), 100% - 5rem); }
  }

  .icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  .icon--fill { fill: currentColor; stroke: none; }

  .ambient {
    position: fixed;
    z-index: -1;
    inset: 0 0 auto;
    height: 620px;
    background: var(--ambient);
    pointer-events: none;
  }

  .skip-link {
    position: fixed;
    z-index: 100;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.7rem 1rem;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    transform: translateY(-160%);
    transition: transform 160ms ease;
  }

  .skip-link:focus { transform: translateY(0); }

  /* ============ 3. HEADER / NAV ============ */
  .site-header {
    position: sticky;
    z-index: 40;
    top: 0;
    border-bottom: 1px solid var(--line-soft);
    background: var(--header-bg);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
  }

  .nav-shell {
    position: relative;
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 0.9rem;
  }

  @media (min-width: 768px) {
    .nav-shell { min-height: 72px; gap: 1.25rem; }
  }

  @media (min-width: 1024px) {
    .nav-shell { gap: 2.5rem; }
  }

  .brand {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    color: var(--text);
  }

  /* Transparent PNG lockup: no plate, width follows the 707:108 ratio.
     The light variant swaps in via the same element (no second <img>). */
  .brand-logo {
    --logo-h: 36px;
    display: block;
    flex: 0 0 auto;
    height: var(--logo-h);
    width: calc(var(--logo-h) * 707 / 108);
    max-width: 100%;
    background-image: url("/assets/logo-lockup@3x.png");
    background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;
  }

  [data-theme="light"] .brand-logo {
    background-image: url("/assets/logo-lockup-light@3x.png");
  }

  @media (max-width: 768px) {
    .brand-logo { --logo-h: 30px; }
  }

  @media (max-width: 420px) {
    .brand-logo { --logo-h: 26px; }
  }

  @media (max-width: 360px) {
    .brand-logo { --logo-h: 22px; }
  }

  @media (max-width: 340px) {
    .brand-logo { --logo-h: 20px; }
    .nav-actions { gap: 0.1rem; }
    .nav-shell { gap: 0.35rem; }
  }

  .primary-nav {
    display: none;
    align-items: center;
    gap: 1.6rem;
    font-size: 13.5px;
  }

  @media (min-width: 1140px) { .primary-nav { display: flex; } }

  .primary-nav a {
    color: var(--muted);
    transition: color 160ms ease;
  }

  .primary-nav a:hover,
  .primary-nav a.is-active { color: var(--text); }

  .nav-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin-left: auto;
  }

  .search {
    display: flex;
    height: 40px;
    align-items: center;
    gap: 0.6rem;
    padding: 0 0.95rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--input-bg);
    transition: border-color 160ms ease, background 160ms ease;
  }

  .search:focus-within {
    border-color: var(--rose-line);
    background: var(--input-bg-focus);
  }

  .search__icon { display: grid; place-items: center; color: var(--quiet); }

  .search input {
    width: 100%;
    border: 0;
    background: transparent;
    color: var(--text);
    font-size: 13px;
    outline: none;
  }

  .search input::placeholder { color: var(--quiet); }
  .search input::-webkit-search-cancel-button { -webkit-appearance: none; }

  .search--desktop { display: none; }

  @media (min-width: 1024px) {
    .search--desktop { display: flex; width: 220px; }
  }

  @media (min-width: 1260px) {
    .search--desktop { width: 300px; }
  }

  .icon-btn {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border-radius: 999px;
    color: var(--muted);
    transition: background 160ms ease, color 160ms ease;
  }

  .icon-btn:hover { background: var(--tint-strong); color: var(--text); }

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: 999px;
    font-weight: 500;
    white-space: nowrap;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease, border-color 160ms ease;
  }

  /* Primary accent button — purple gradient from the logo palette. */
  .btn-accent {
    height: 40px;
    padding: 0 0.9rem;
    background: var(--accent-gradient);
    color: #FFFFFF;
    font-size: 13px;
    text-shadow: 0 1px 2px rgba(10, 6, 20, 0.4);
    box-shadow: 0 12px 28px rgba(63, 42, 122, 0.35);
  }

  .btn-accent:hover { background: linear-gradient(135deg, #33215F 0%, #8B6FDB 100%); }

  /* Telegram actions are Telegram blue with a white plane — in BOTH themes. */
  .btn-telegram-nav {
    height: 40px;
    padding: 0 0.9rem;
    background: var(--tg);
    color: #FFFFFF;
    font-size: 13px;
    box-shadow: 0 12px 28px rgba(34, 158, 217, 0.26);
  }

  .btn-telegram-nav:hover { background: var(--tg-hover); color: #FFFFFF; }
  .btn-telegram-nav .icon { color: #FFFFFF; }

  .telegram-label { display: none; }

  @media (min-width: 560px) { .telegram-label { display: inline; } }

  .menu-toggle { display: grid; }

  @media (min-width: 1140px) { .menu-toggle { display: none; } }

  .search-mobile {
    padding: 0 0 0.8rem;
  }

  .search-mobile .search { display: flex; width: 100%; }

  @media (min-width: 1024px) { .search-mobile, .search-toggle { display: none !important; } }

  @media (max-width: 420px) {
    .nav-shell { gap: 0.5rem; }
    .brand { white-space: nowrap; }
    .nav-actions { gap: 0.15rem; }
  }

  /* Mobile nav panel */
  @media (max-width: 1139px) {
    .primary-nav {
      position: absolute;
      z-index: 55; /* above the fixed tab bar, below toasts */
      top: calc(100% + 0.35rem);
      right: 0;
      left: 0;
      display: none;
      flex-direction: column;
      align-items: stretch;
      gap: 0.15rem;
      padding: 0.5rem;
      border: 1px solid var(--line-strong);
      border-radius: 16px;
      background: var(--panel-bg);
      box-shadow: var(--shadow);
    }

    .primary-nav.is-open { display: flex; }

    .primary-nav a {
      padding: 0.8rem 0.9rem;
      border-radius: 10px;
      font-size: 14px;
    }

    .primary-nav a:hover { background: var(--tint); }
  }

  /* ============ 4. SHARED BITS ============ */
  .eyebrow {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 0 0.55rem;
    color: var(--rose);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.2em;
    line-height: 1.4;
    text-transform: uppercase;
  }

  .eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rose);
    box-shadow: 0 0 12px rgba(251, 113, 133, 0.75);
  }

  .section { margin-top: 2.25rem; }

  @media (min-width: 640px) { .section { margin-top: 2.5rem; } }

  .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .section-head__title {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--text);
  }

  .section-head__title .icon { color: var(--rose); }

  .section-head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.03em;
  }

  .section-head p {
    margin: 0.25rem 0 0;
    color: var(--quiet);
    font-size: 13px;
  }

  .link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    color: var(--muted);
    font-size: 12.5px;
    transition: color 160ms ease;
  }

  .link-btn:hover { color: var(--rose); }

  /* ============ 5. HERO ============ */
  /* Featured block: player | info | Up next side by side on desktop,
     stacked below that. Every block and the next section share one
     spacing rhythm, so the page never opens a hole between them. */
  .hero {
    display: grid;
    align-items: start;
    gap: 1.5rem;
    padding-top: 1.5rem;
    margin-bottom: 2.25rem;
  }

  @media (min-width: 640px) { .hero { padding-top: 2.5rem; } }

  .hero-stage {
    position: relative;
    min-width: 0;
  }

  .hero-stage__inner {
    display: flex;
    flex-direction: column;
    gap: 1rem;
  }

  .hero-player { min-width: 0; flex: 1 1 auto; }

  .video-frame {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    background: var(--player-bg);
    box-shadow: var(--frame-shadow);
    isolation: isolate;
  }

  /* The blurred, darkened poster that sits behind the video: a vertical
     clip keeps its true 9:16 shape and the sides are filled with this
     copy instead of black bars. */
  .video-frame__blur {
    position: absolute;
    z-index: 0;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) brightness(0.42) saturate(1.15);
    transform: scale(1.08);
    pointer-events: none;
  }

  .video-frame > video {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    object-fit: contain;
  }

  .player-empty {
    position: relative;
    z-index: 2;
    display: grid;
    height: 100%;
    place-content: center;
    gap: 0.4rem;
    padding: 1.5rem;
    color: #A1A1AA;
    font-size: 13.5px;
    text-align: center;
  }

  .player-empty strong { color: #fff; font-weight: 500; }
  .player-empty span { color: #A1A1AA; font-size: 12.5px; }
  .player-empty a { color: var(--accent-hi); font-weight: 500; }

  .video-frame iframe {
    position: absolute;
    z-index: 2;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: var(--player-bg);
  }

  .empty-library {
    display: grid;
    gap: 0.55rem;
    padding: clamp(1.6rem, 5vw, 2.6rem);
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(160deg, #1A1013, #0D0B0E);
    text-align: center;
    justify-items: center;
  }

  .empty-library strong { color: #fff; font-size: 1.05rem; font-weight: 500; }
  .empty-library p { margin: 0; max-width: 46ch; color: #A1A1AA; font-size: 13.5px; }
  .empty-library .btn { margin-top: 0.5rem; }

  /* Save / Share / Open / Telegram live in one row inside the info panel,
     so the player is never split by a separate button column. */
  .hero-rail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.9rem;
  }

  .rail-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    padding: 0.3rem 0.7rem 0.3rem 0.35rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--tint);
    color: var(--muted);
    font-size: 11px;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  }

  .rail-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--tint-strong); }

  .rail-btn__icon {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    transition: background 160ms ease, border-color 160ms ease;
  }

  .rail-btn:hover .rail-btn__icon { background: var(--tint-strong); }
  .rail-btn[data-telegram] .rail-btn__icon { border-color: rgba(34, 158, 217, 0.45); color: var(--tg); }
  .rail-btn[data-telegram]:hover .rail-btn__icon { background: rgba(34, 158, 217, 0.16); color: var(--tg); }
  .rail-btn.is-on { color: var(--rose); }
  .rail-btn.is-on .rail-btn__icon { border-color: var(--rose-line); color: var(--rose); }

  .hero-meta {
    display: flex;
    min-width: 0;
    flex-direction: column;
  }

  .hero-title {
    margin: 0.35rem 0 0;
    font-size: clamp(1.9rem, 4.6vw, 2.75rem);
    font-weight: 600;
    letter-spacing: -0.045em;
    line-height: 1.05;
    overflow-wrap: anywhere;
  }

  .hero-sub {
    margin: 0.55rem 0 0;
    color: var(--muted);
    font-size: 14.5px;
    line-height: 1.6;
    max-width: 42ch;
  }

  .creator {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1rem;
  }

  .avatar {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    border-radius: 999px;
    background: var(--avatar-bg);
    color: var(--rose-200);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    box-shadow: inset 0 0 0 1px var(--rose-line);
  }

  .creator .avatar { width: 40px; height: 40px; font-size: 15px; }

  .creator__name {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
  }

  .creator__name .icon { color: var(--rose); width: 15px; height: 15px; }

  .creator__note { color: var(--quiet); font-size: 12px; }

  .hero-follow {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: auto;
    padding: 0.45rem 0.9rem;
    border: 1px solid transparent;
    border-radius: 999px;
    background: var(--tg);
    color: #FFFFFF;
    font-size: 12.5px;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease;
  }

  .hero-follow:hover { background: var(--tg-hover); color: #FFFFFF; }
  .hero-follow .icon { color: #FFFFFF; }

  .hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 1.2rem;
    margin-top: 1rem;
    padding: 0.6rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
  }

  .hero-stats b { color: var(--text); font-weight: 500; }

  .upnext { margin-top: 1.6rem; }

  .upnext__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
  }

  .upnext__head h2 {
    margin: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
  }

  /* The track is allowed to shrink so a long title never pushes the
     list out of its column. */
  .upnext__list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.6rem;
  }

  .upnext__item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    padding: 0.3rem;
    border-radius: 14px;
    transition: background 160ms ease;
  }

  .upnext__item:hover { background: var(--tint); }

  /* A 128 x 72 poster with the length sitting on it. */
  .upnext__thumb {
    position: relative;
    width: clamp(104px, 8.6vw, 124px);
    flex: 0 0 auto;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-radius: 10px;
    background: var(--surface-2);
  }

  .upnext__thumb.poster {
    border-radius: 10px;
    box-shadow: none;
  }

  .upnext__thumb .poster__dur {
    top: auto;
    right: 0.35rem;
    bottom: 0.35rem;
    font-size: 9.5px;
  }

  .upnext__body { min-width: 0; flex: 1 1 auto; }

  .upnext__title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
  }

  .upnext__title {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 160ms ease;
  }

  .upnext__item:hover .upnext__title { color: var(--rose-200); }

  .upnext__short {
    position: absolute;
    z-index: 3;
    top: 0.35rem;
    left: 0.35rem;
    padding: 0.1rem 0.35rem;
    border-radius: 6px;
    background: var(--accent-gradient-ink);
    color: #FFFFFF;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-shadow: 0 1px 2px rgba(10, 6, 20, 0.45);
  }

  .upnext__meta {
    display: block;
    margin: 0.2rem 0 0;
    overflow: hidden;
    color: var(--quiet);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .upnext__empty {
    padding: 1rem;
    border: 1px dashed var(--line-strong);
    border-radius: 16px;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.6;
  }

  .upnext__empty a { color: var(--rose-200); text-decoration: underline; text-underline-offset: 3px; }

  /* ============ 6. AD SLOTS (config-driven, max 3) ============ */
  /* Every slot is built from AD_CONFIG in the script below:
       (a) banner between Shorts and Trending,
       (b) native card inside the feed,
       (c) one Smartlink "Sponsored" card.
     A slot with no ad code is removed completely — no empty box is left
     behind. Active slots keep a small label and a reserved height so the
     ad never shifts the page. */
  .ad-slot {
    max-width: 728px;
    margin: 2.5rem auto 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--ad-bg);
  }

  .ad-slot[hidden] { display: none !important; }

  .ad-slot__label,
  .ad-card__label {
    display: block;
    padding: 0.55rem 0.85rem 0;
    color: var(--ad-label);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }

  .ad-slot__frame {
    display: grid;
    place-items: center;
    min-height: 250px;
    padding: 0.5rem;
  }

  .ad-slot__frame > * { max-width: 100%; }

  @media (min-width: 768px) {
    .ad-slot__frame { min-height: 90px; }
  }

  /* Native card: sits in the feed like a video card. */
  .ad-card {
    overflow: hidden;
    border: 1px solid var(--rose-line);
    border-radius: var(--radius);
    background: var(--sponsored-bg);
  }

  .ad-card__frame {
    display: grid;
    place-items: center;
    min-height: 200px;
    padding: 0.75rem;
  }

  .ad-card__frame > * { max-width: 100%; }


  /* ============ 8. CHIPS ============ */
  .chips {
    display: flex;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding-bottom: 0.35rem;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .chips::-webkit-scrollbar { display: none; }

  .chip {
    flex: 0 0 auto;
    padding: 0.5rem 1rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--tint-soft);
    color: var(--muted);
    font-size: 12.5px;
    transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
  }

  .chip:hover { color: var(--text); border-color: var(--line-strong); }

  .chip.is-active {
    border-color: transparent;
    background: var(--chip-active-bg);
    color: var(--chip-active-text);
    font-weight: 500;
  }

  /* ============ 9. POSTERS / CARDS ============ */
  .poster {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--surface-2);
    box-shadow: var(--card-shadow);
    box-shadow: var(--card-shadow), var(--card-ring);
  }

  .poster--wide { aspect-ratio: 16 / 9; }
  .poster--vertical { aspect-ratio: 9 / 16; border-radius: 18px; }
  /* The player poster sits on top of the blurred backdrop and keeps the
     clip's own shape, so the space around it shows that blurred copy
     instead of black bars. */
  .poster--player {
    position: absolute;
    z-index: 2;
    inset: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .poster--player .poster__media {
    object-fit: contain;
    background: transparent;
  }


  .poster__btn {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    color: #fff;
    text-align: left;
  }

  .poster__art {
    position: absolute;
    inset: 0;
    background: var(--poster-bg);
    transition: opacity 400ms ease;
  }

  .poster__art::after {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(var(--poster-grid) 1px, transparent 1px),
      linear-gradient(90deg, var(--poster-grid) 1px, transparent 1px);
    background-size: 44px 44px;
    content: "";
    mask-image: linear-gradient(140deg, #000, transparent 72%);
    -webkit-mask-image: linear-gradient(140deg, #000, transparent 72%);
  }

  .poster__media {
    position: absolute;
    z-index: 1;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: cover;
    opacity: 0;
    transition: opacity 420ms ease, transform 700ms ease;
    pointer-events: none;
    background: var(--media-bg);
  }

  .poster.has-media .poster__art { opacity: 0; }
  .poster.has-media .poster__media { opacity: 1; }

  .poster:hover .poster__media { transform: scale(1.04); }

  .poster__shade {
    position: absolute;
    z-index: 2;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.05) 46%, rgba(0, 0, 0, 0.2));
    pointer-events: none;
  }

  .poster--player .poster__shade {
    background: radial-gradient(ellipse at center, transparent 35%, rgba(0, 0, 0, 0.45));
  }

  .poster__badge {
    position: absolute;
    z-index: 3;
    top: 0.85rem;
    left: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: var(--accent-gradient-ink);
    color: #fff;
    font-size: 10.5px;
    text-shadow: 0 1px 2px rgba(10, 6, 20, 0.45);
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
  }

  .pulse {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rose-400);
    animation: pulse 2.4s ease-in-out infinite;
  }

  .poster__badge .pulse { background: #FFFFFF; }

  @keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.45; transform: scale(0.8); }
  }

  .poster__tag {
    position: absolute;
    z-index: 3;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: var(--accent-gradient-ink);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(10, 6, 20, 0.45);
  }

  .poster__badge + .poster__tag { left: auto; right: 0.75rem; }

  .poster__dur {
    position: absolute;
    z-index: 3;
    top: 0.75rem;
    right: 0.75rem;
    padding: 0.15rem 0.4rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.68);
    color: #fff;
    font-size: 10.5px;
    font-variant-numeric: tabular-nums;
    backdrop-filter: blur(6px);
  }

  .poster--wide .poster__dur,
  .poster--player .poster__dur {
    top: auto;
    bottom: 0.75rem;
  }

  .poster__play {
    position: absolute;
    z-index: 4;
    top: 50%;
    left: 50%;
    display: grid;
    width: 52px;
    height: 52px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.9);
    backdrop-filter: blur(10px);
    transition: opacity 200ms ease, transform 200ms ease;
  }

  .poster__play .icon { width: 18px; height: 18px; transform: translateX(1px); }

  .poster--player .poster__play,
  .poster:hover .poster__play,
  .poster__btn:focus-visible .poster__play {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }

  .poster--player .poster__play { width: 64px; height: 64px; }

  .poster__caption {
    position: absolute;
    z-index: 3;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    gap: 0.15rem;
    padding: 0.85rem;
  }

  .poster__title {
    display: -webkit-box;
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .poster__meta { color: rgba(228, 228, 231, 0.72); font-size: 11px; }

  /* Landscape card body */
  .media-card { min-width: 0; }

  .media-card .poster { transition: box-shadow 200ms ease; }

  .media-card:hover .poster { box-shadow: var(--card-shadow), inset 0 0 0 1px var(--rose-line); }
  .media-card:hover .card__title { color: var(--rose-200); }

  .card__body {
    display: flex;
    gap: 0.7rem;
    margin-top: 0.8rem;
  }

  .card__text { min-width: 0; }

  .card__title {
    margin: 0;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.4;
    overflow-wrap: anywhere;
    transition: color 160ms ease;
  }

  .card__title button { padding: 0; text-align: left; }

  .card__meta {
    margin: 0.2rem 0 0;
    color: var(--quiet);
    font-size: 12px;
    line-height: 1.5;
  }

  /* Sponsored card inside grids */
  .sponsored-card {
    display: flex;
    min-height: 100%;
    overflow: hidden;
    border: 1px solid var(--rose-line);
    border-radius: var(--radius);
    background: var(--sponsored-bg);
  }

  .sponsored-card__link {
    display: flex;
    width: 100%;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem;
    color: var(--text);
  }

  .sponsored-label {
    color: var(--rose);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.17em;
    text-transform: uppercase;
  }

  .sponsored-card__title {
    display: block;
    margin-top: 0.45rem;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.2;
  }

  .sponsored-card__description {
    display: block;
    margin-top: 0.4rem;
    color: var(--muted);
    font-size: 12.5px;
    line-height: 1.55;
  }

  .sponsored-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--rose-200);
    font-size: 12.5px;
    font-weight: 600;
  }

  /* ============ 10. GRIDS ============ */
  .grid-shorts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }

  @media (min-width: 640px) { .grid-shorts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; } }
  @media (min-width: 1024px) { .grid-shorts { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

  .grid-trending {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem 1.5rem;
  }

  @media (min-width: 640px) { .grid-trending { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 1024px) { .grid-trending { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

  /* Masonry feed: two balanced columns on desktop, three on mobile. */
  .grid-feed {
    display: flex;
    align-items: flex-start;
    gap: var(--masonry-gap, 20px);
    --masonry-gap: 20px;
  }

  .masonry__col {
    display: flex;
    min-width: 0;
    flex: 1 1 0;
    flex-direction: column;
    gap: var(--masonry-gap, 20px);
  }

  .grid-feed .empty-card { flex: 1 1 100%; }

  .masonry__col .sponsored-card { min-height: 0; }

  @media (max-width: 767px) {
    .grid-feed { --masonry-gap: 9px; }
  }

  /* Feed card: natural aspect ratio, duration on the thumbnail, title + creator below. */
  .masonry-card { min-width: 0; }

  .masonry-card .poster {
    aspect-ratio: var(--ar, 16 / 9);
    border-radius: 20px;
  }

  .masonry-card .poster__dur {
    top: auto;
    right: 0.6rem;
    bottom: 0.6rem;
  }

  .masonry-card .card__body {
    margin-top: 0.7rem;
  }

  .masonry-card .card__title { font-size: 13.5px; }

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

  .masonry-card .card__meta {
    margin-top: 0.15rem;
    font-size: 12px;
  }

  @media (max-width: 767px) {
    .masonry-card .poster {
      aspect-ratio: 3 / 4;
      border-radius: 14px;
    }

    .masonry-card .poster__media { object-fit: cover; }

    .masonry-card .poster__dur {
      right: 0.3rem;
      bottom: 0.3rem;
      padding: 0.1rem 0.3rem;
      border-radius: 5px;
      font-size: 9.5px;
    }

    .masonry-card .poster__play {
      width: 30px;
      height: 30px;
    }

    .masonry-card .poster__play .icon {
      width: 12px;
      height: 12px;
    }

    .masonry-card .card__body { margin-top: 0.4rem; }

    .masonry-card .card__title {
      font-size: 11.5px;
      line-height: 1.35;
    }

    .masonry-card .card__title button {
      display: block;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }

    .masonry-card .card__meta { display: none; }
  }

  .empty-card {
    grid-column: 1 / -1;
    padding: 1.5rem;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    color: var(--muted);
    font-size: 13px;
    text-align: center;
  }

  /* ============ 11. RESULTS ============ */
  .results { margin-top: 2.5rem; }

  .results__head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .results__head h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    letter-spacing: -0.03em;
  }

  .results__count { color: var(--quiet); font-size: 13px; margin-left: 0.5rem; }

  /* ============ 12. TELEGRAM CTA ============ */
  .telegram-cta {
    position: relative;
    margin-top: 5rem;
    overflow: hidden;
    padding: 2rem 1.5rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--radius-lg);
    background: var(--banner-bg);
    border-color: var(--banner-line);
    color: var(--banner-text);
  }

  @media (min-width: 640px) { .telegram-cta { padding: 2.25rem 2.5rem; } }

  .telegram-cta::before {
    position: absolute;
    top: -5rem;
    right: -5rem;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    background: var(--glow);
    filter: blur(60px);
    content: "";
    pointer-events: none;
  }

  .telegram-cta__inner {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
  }

  @media (min-width: 768px) {
    .telegram-cta__inner { flex-direction: row; align-items: center; }
  }

  .telegram-cta h2 {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 1.75rem);
    font-weight: 600;
    letter-spacing: -0.035em;
    line-height: 1.15;
  }

  .telegram-cta p {
    max-width: 44ch;
    margin: 0.55rem 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.6;
  }

  .btn-telegram {
    height: 48px;
    padding: 0 1.65rem;
    background: var(--tg);
    color: #FFFFFF;
    font-size: 14px;
    box-shadow: 0 14px 32px rgba(34, 158, 217, 0.28);
  }

  .btn-telegram:hover { background: var(--tg-hover); color: #FFFFFF; }
  .btn-telegram .icon { color: #FFFFFF; }

  /* ============ 13. FOLLOW / SOCIALS ============ */
  .follow {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--line);
  }

  @media (min-width: 900px) {
    .follow { flex-direction: row; align-items: center; justify-content: space-between; }
  }

  .follow h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.02em;
  }

  .follow p { margin: 0.25rem 0 0; color: var(--quiet); font-size: 13px; }

  .social-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }

  .social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--tint-soft);
    color: var(--muted);
    font-size: 12px;
    transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
  }

  .social-link svg { width: 15px; height: 15px; fill: currentColor; }
  .social-link:hover { border-color: var(--rose-line); color: var(--text); background: var(--rose-soft); }

  /* ============ 14. FOOTER ============ */
  .site-footer {
    margin-top: 4rem;
    border-top: 1px solid var(--line);
  }

  .footer-inner {
    padding: 2rem 0 2.5rem;
  }

  .footer-top {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1.5rem;
  }

  @media (min-width: 900px) {
    .footer-top { flex-direction: row; align-items: center; justify-content: space-between; }
  }

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.75rem;
    color: var(--quiet);
    font-size: 12.5px;
  }

  .footer-links a { transition: color 160ms ease; }
  .footer-links a:hover { color: var(--text); }

  /* Telegram link in the footer: same blue pill, never the accent. */
  .footer-links a[data-telegram] {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin: -0.2rem 0;
    padding: 0.16rem 0.6rem;
    border-radius: 999px;
    background: var(--tg);
    color: #FFFFFF;
    transition: background 160ms ease, color 160ms ease;
  }

  .footer-links a[data-telegram]:hover { background: var(--tg-hover); color: #FFFFFF; }
  .footer-links a[data-telegram] .icon { width: 12px; height: 12px; color: #FFFFFF; }

  .footer-badge {
    padding: 0.2rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--quiet);
    font-size: 11px;
  }

  .footer-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: 1.75rem;
    color: var(--footer-quiet);
    font-size: 11.5px;
  }

  .footer-bottom p { margin: 0; }

  .footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.25rem;
  }

  .footer-legal a {
    color: var(--footer-quiet);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 160ms ease;
  }

  .footer-legal a:hover { color: var(--rose); }

  /* ============ 15. TOAST / UTIL ============ */
  .toast {
    position: fixed;
    z-index: 60;
    bottom: 1.25rem;
    left: 50%;
    padding: 0.65rem 1.1rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--toast-bg);
    color: var(--text);
    font-size: 12.5px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    transform: translate(-50%, 140%);
    opacity: 0;
    transition: transform 220ms ease, opacity 220ms ease;
    backdrop-filter: blur(12px);
    pointer-events: none;
  }

  .toast.is-visible { transform: translate(-50%, 0); opacity: 1; }

  /* ============ 16. THEME TOGGLE ============ */
  .theme-toggle {
    position: relative;
    display: grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: var(--tint-soft);
    color: var(--text);
    transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
  }

  .theme-toggle:hover {
    border-color: var(--rose-line);
    background: var(--tint-strong);
    color: var(--rose);
  }

  .theme-toggle:active { transform: scale(0.94); }

  /* Small phones: shrink the four nav controls together so the bar stays on one line. */
  @media (max-width: 420px) {
    .icon-btn,
    .theme-toggle { width: 36px; height: 36px; }
    .btn-telegram-nav { width: 36px; height: 36px; padding: 0; }
  }

  @media (max-width: 340px) {
    .icon-btn,
    .theme-toggle,
    .btn-telegram-nav { width: 32px; height: 32px; }
    .theme-icon { width: 16px; height: 16px; }
  }

  .theme-icon {
    position: absolute;
    width: 18px;
    height: 18px;
    transition: opacity 0.3s ease, transform 0.45s cubic-bezier(0.34, 1.4, 0.64, 1);
  }

  .theme-icon--sun { opacity: 1; transform: rotate(0deg) scale(1); }
  .theme-icon--moon { opacity: 0; transform: rotate(-90deg) scale(0.4); }

  [data-theme="light"] .theme-icon--sun { opacity: 0; transform: rotate(90deg) scale(0.4); }
  [data-theme="light"] .theme-icon--moon { opacity: 1; transform: rotate(0deg) scale(1); }

  /* Toggle row inside the mobile menu */
  .nav-theme {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.35rem;
    padding: 0.8rem 0.9rem;
    border-top: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    font-size: 14px;
    text-align: left;
    transition: background 160ms ease, color 160ms ease;
  }

  .nav-theme:hover { background: var(--tint); color: var(--text); }

  .nav-theme__icon {
    position: relative;
    display: grid;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    place-items: center;
    color: var(--rose);
  }

  .nav-theme__icon .theme-icon { width: 16px; height: 16px; }

  .nav-theme { display: none; }

  @media (max-width: 1139px) {
    .nav-theme { display: flex; }
  }

  /* Light-mode touch-ups that are not simple colour tokens */
  [data-theme="light"] .video-frame__blur { filter: blur(26px) brightness(0.62) saturate(1.05); }
  [data-theme="light"] .poster { box-shadow: var(--card-shadow); }
  [data-theme="light"] .site-header { border-bottom-color: var(--line); }

  /* Smooth cross-fade of every colour while the theme flips (temporary). */
  html.is-theming *,
  html.is-theming *::before,
  html.is-theming *::after {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease,
      box-shadow 0.3s ease, fill 0.3s ease, stroke 0.3s ease !important;
  }

  /* ============ 17. PRELOADER ============ */
  .preloader {
    position: fixed;
    z-index: 90;
    inset: 0;
    display: grid;
    place-items: center;
    background: var(--bg);
    opacity: 1;
    visibility: visible;
    /* Fades itself out at 3s even if JavaScript never runs. */
    animation: preloader-auto-out 0.45s ease 3s forwards;
  }

  .preloader.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }

  .preloader__stage {
    position: relative;
    display: grid;
    place-items: center;
    width: clamp(200px, 56vw, 268px);
    aspect-ratio: 1;
  }

  .preloader__stage::before {
    position: absolute;
    inset: 16%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(107, 75, 181, 0.3), transparent 70%);
    filter: blur(18px);
    content: "";
  }

  .preloader__ring {
    position: absolute;
    inset: 0;
    border: 2px solid var(--ring-track);
    border-radius: 50%;
    box-shadow: 0 0 44px var(--glow);
  }

  /* Smooth violet sweep on top of the static track (falls back to the track). */
  .preloader__ring::after {
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: conic-gradient(
      from 0deg,
      transparent 0 8%,
      rgba(251, 113, 133, 0.1) 26%,
      var(--accent-hi) 94%,
      transparent 100%
    );
    content: "";
    mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 0);
    animation: preloader-spin 1.05s linear infinite;
  }

  .preloader__logo {
    position: relative;
    display: block;
    width: 86%;
    aspect-ratio: 707 / 108;
    background-image: url("/assets/logo-lockup@3x.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
  }

  [data-theme="light"] .preloader__logo {
    background-image: url("/assets/logo-lockup-light@3x.png");
  }

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

  @keyframes preloader-auto-out {
    to { opacity: 0; visibility: hidden; }
  }

  @media (prefers-reduced-motion: reduce) {
    .preloader__ring::after { animation: none; }
  }

  /* ============ 19. AGE GATE LOCK ============ */
  /* assets/age-gate.js adds these classes before the page paints. While
     locked, nothing behind the overlay is visible or scrollable. */
  html.age-locked,
  html.age-locked body { overflow: hidden; }

  html.age-locked body > :not(.age-gate) { visibility: hidden !important; }

  /* ============ 18. MOTION / A11Y ============ */
  @media (hover: none) {
    .poster__play {
      width: 46px;
      height: 46px;
      opacity: 1;
      transform: translate(-50%, -50%) scale(1);
    }

    .poster--player .poster__play { width: 62px; height: 62px; }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    .poster:hover .poster__media { transform: none; }
  }

  /* ================================================================
     MOCKUP RESTYLE
     ----------------------------------------------------------------
     Everything below styles the components to match the reference
     design. It only ever reads design tokens, so the light theme gets
     the identical layout, spacing, sizes and motion — only the colours
     differ. The player, thumbnails and the 18+ / Telegram banner use
     tokens that are NOT overridden in the light theme, so they stay
     dark in both and white text keeps its contrast.
     ================================================================ */

  /* ---- type ------------------------------------------------------ */
  h1, h2, h3,
  .hero-title,
  .section-head h2,
  .upnext__head h2,
  .telegram-cta h2,
  .empty-library strong,
  .card__title,
  .follow h2 {
    font-family: var(--font-display);
    font-weight: 700;
    letter-spacing: -0.032em;
  }

  .hero-title { font-weight: 800; letter-spacing: -0.045em; line-height: 1.02; }
  .section-head h2 { font-size: 1.15rem; }

  /* ---- header: pills + blurred bar ------------------------------- */
  .site-header {
    border-bottom: 1px solid var(--line-soft);
    background: var(--header-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
  }

  .nav-shell { min-height: 66px; }

  .primary-nav { gap: 0.25rem; }

  .primary-nav a {
    padding: 0.52rem 0.95rem;
    border-radius: 999px;
    color: var(--muted);
    font-size: 13.5px;
    font-weight: 500;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
  }

  .primary-nav a:hover { background: var(--tint); color: var(--text); }

  .primary-nav a.is-active {
    background: var(--accent-gradient-ink);
    color: #FFFFFF;
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.26);
  }

  .search {
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--input-bg);
  }

  .search:focus-within { border-color: var(--rose-line); background: var(--input-bg-focus); }

  /* ---- hero: player | info | up next ----------------------------- */
  /* The player is the only card in the block: the info panel and the
     Up next rail sit straight on the page, like the reference design. */
  .hero-stage {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .hero-stage__inner { gap: 0.5rem; }

  .hero-meta {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    container-type: inline-size;
    container-name: heroinfo;
  }

  .hero-upnext {
    min-width: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .hero-upnext .upnext { margin-top: 0; }

  /* Three columns from 1024px: player 45% | info 28% | Up next 27%.
     Every column is exactly as tall as the player, so nothing is
     stretched and the block reads as one row. */
  @media (min-width: 1024px) {
    .hero {
      grid-template-columns: minmax(0, 1.8fr) minmax(0, 1.12fr) minmax(0, 1.08fr);
      align-items: stretch;
      gap: 1.5rem;
    }

    .hero-stage,
    .hero-meta,
    .hero-upnext {
      align-self: stretch;
      max-height: 420px;
    }

    /* The player fills the row height and keeps its own ratio inside:
       the space around a vertical clip is the blurred poster, never a
       black bar. */
    .hero-stage { display: flex; }
    .hero-stage__inner { flex: 1 1 auto; }
    .hero-player { display: flex; }
    .video-frame--player {
      width: 100%;
      height: 100%;
      max-height: 420px;
      aspect-ratio: auto;
      margin: auto 0;
    }

    .hero-meta {
      overflow: hidden auto;
      scrollbar-width: thin;
    }
  }

  /* When the info column is narrow the panel tightens up: a smaller
     title, tighter stats and icon-only action buttons, so nothing is
     ever pushed out of the featured block. The labels stay in the DOM
     for screen readers. */
  @media (min-width: 1024px) {
    @container heroinfo (max-width: 380px) {
      .hero-title { font-size: clamp(1.4rem, 10.5cqi, 2rem); }

      .hero-stats { gap: 0.3rem 0.85rem; font-size: 11.5px; }

      .hero-actions .btn-ghost { padding: 0 1rem; }

      .hero-actions .btn-ghost > span,
      .hero-rail .rail-btn > span:last-child {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
      }

      .hero-rail .rail-btn { padding: 0.35rem; }
    }
  }

  .eyebrow {
    display: inline-flex;
    align-self: flex-start;
    gap: 0.4rem;
    margin-bottom: 0.7rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--accent-gradient-ink);
    color: #FFFFFF;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
  }

  .eyebrow-dot {
    width: 5px;
    height: 5px;
    background: #FFFFFF;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 1.1rem;
  }

  .btn-primary {
    height: 44px;
    padding: 0 1.15rem;
    border-radius: 999px;
    background: var(--accent-gradient-ink);
    color: #FFFFFF;
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 600;
    box-shadow: 0 12px 26px rgba(244, 63, 94, 0.3);
  }

  .btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }

  .btn-ghost {
    height: 44px;
    padding: 0 1.05rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    background: transparent;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 13.5px;
    font-weight: 500;
  }

  .btn-ghost:hover { border-color: var(--rose-line); color: var(--rose-200); background: var(--tint); }
  .btn-ghost.is-on { border-color: var(--rose-line); color: var(--rose-200); background: var(--rose-soft); }

  .rail-btn__icon { border-radius: 14px; }
  .rail-btn.is-on .rail-btn__icon { border-color: var(--rose-line); color: var(--rose); }

  /* ---- category chips ------------------------------------------- */
  .chips { gap: 0.5rem; margin-top: 2rem; }

  .chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--chip-bg);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
  }

  .chip .chip__icon { width: 15px; height: 15px; opacity: 0.85; }
  .chip:hover { color: var(--text); border-color: var(--line-strong); background: var(--tint-strong); }

  .chip.is-active {
    border-color: transparent;
    background: var(--chip-active-bg);
    color: var(--chip-active-text);
    box-shadow: 0 8px 20px rgba(244, 63, 94, 0.25);
  }

  .chip.is-active .chip__icon { opacity: 1; }

  /* ---- shorts: horizontal shelf --------------------------------- */
  .grid-shorts {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.4rem;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .grid-shorts::-webkit-scrollbar { display: none; }
  .grid-shorts > * { flex: 0 0 clamp(152px, 15vw, 196px); scroll-snap-align: start; }

  @media (max-width: 560px) {
    .grid-shorts { gap: 0.7rem; }
    .grid-shorts > * { flex-basis: 40%; }
  }

  .section-head__actions { display: flex; align-items: center; gap: 0.75rem; }

  .row-arrow {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--text);
    transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
  }

  .row-arrow:hover {
    border-color: transparent;
    background: var(--accent-gradient-ink);
    color: #FFFFFF;
  }

  /* ---- recommended: one wide card + the rest -------------------- */
  @media (min-width: 1024px) {
    .grid-trending { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; }
    .grid-trending > :first-child { grid-column: span 2; }
  }

  .media-card .card__title { font-size: 14px; }

  /* ---- cards / posters ------------------------------------------ */
  .poster { border-radius: var(--radius); }
  .poster--vertical { border-radius: var(--radius); }

  .poster__badge { background: var(--accent-gradient-ink); }
  .poster__tag { background: var(--accent-gradient-ink); }

  .poster__dur {
    background: rgba(0, 0, 0, 0.68);
    color: #FFFFFF;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .upnext__item { border-radius: 14px; }
  .upnext__thumb { border-radius: 10px; }

  /* ---- 18+ / Telegram banner ------------------------------------ */
  .telegram-cta {
    border-radius: var(--radius-lg);
    background: var(--banner-bg);
    border-color: var(--banner-line);
  }

  .telegram-cta h2 { color: var(--banner-text); font-size: clamp(1.3rem, 2.6vw, 1.6rem); }
  .telegram-cta p { color: var(--banner-muted); }

  .telegram-cta__inner { gap: 1.15rem; }

  @media (min-width: 640px) {
    .telegram-cta__inner { align-items: center; }
  }

  .banner-age {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 auto;
    place-items: center;
    border: 1.5px solid rgba(251, 113, 133, 0.6);
    border-radius: 999px;
    background: rgba(244, 63, 94, 0.14);
    color: var(--accent-hi);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
  }

  .telegram-cta__copy { min-width: 0; flex: 1 1 auto; }

  .btn-telegram { margin-left: auto; }
  .banner-arrow { display: none; }

  @media (min-width: 640px) {
    .banner-arrow { display: block; width: 16px; height: 16px; }
  }

  /* ---- mobile tab bar ------------------------------------------- */
  .tabbar {
    position: fixed;
    z-index: 45;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0.45rem 0.35rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--tabbar-bg);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
  }

  .tabbar a {
    display: grid;
    justify-items: center;
    gap: 0.2rem;
    padding: 0.4rem 0.2rem;
    border-radius: 14px;
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 500;
    transition: color 160ms ease, background 160ms ease;
  }

  .tabbar .icon { width: 20px; height: 20px; }
  .tabbar a:hover { color: var(--text); background: var(--tint); }
  .tabbar a.is-active { color: var(--rose-200); }
  .tabbar a.is-active .icon { color: var(--accent); }

  @media (min-width: 1024px) { .tabbar { display: none; } }

  @media (max-width: 1023px) {
    body { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  }

  /* ---- ads ------------------------------------------------------- */
  .ad-slot { border-radius: var(--radius); border-color: var(--line); }
  .sponsored-card { border-radius: var(--radius); }
  .ad-label { letter-spacing: 0.14em; }

  /* ---- light theme: only tokens change --------------------------- */
  [data-theme="light"] .btn-primary,
  [data-theme="light"] .chip.is-active,
  [data-theme="light"] .primary-nav a.is-active { color: #FFFFFF; }
