/* Canonical Stage 2 Cinema tab geometry.
   Search, Randomizer, Watchlist and History must render this row identically. */

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-page-frame {
  padding-top: 8px !important;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-header-block {
  width: 100% !important;
  margin: 0 0 10px !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-title-row {
  display: none !important;
  height: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-page {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding-top: 0 !important;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs {
  box-sizing: border-box !important;
  width: 100% !important;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  margin: 0 !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 22px !important;
  overflow-x: auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  scrollbar-width: none;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs::-webkit-scrollbar {
  display: none;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a {
  box-sizing: border-box !important;
  height: 46px !important;
  min-height: 46px !important;
  max-height: 46px !important;
  margin: 0 !important;
  padding: 0 11px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  flex: 0 0 auto !important;
  border: 0 !important;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #a0a3b1 !important;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
  font-size: 14px !important;
  font-weight: 400 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a > svg {
  box-sizing: content-box !important;
  width: 19px !important;
  min-width: 19px !important;
  max-width: 19px !important;
  height: 19px !important;
  min-height: 19px !important;
  max-height: 19px !important;
  flex: 0 0 19px !important;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a:hover {
  color: #f1edf7 !important;
  background: transparent !important;
}

body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a.is-active,
body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a[aria-current="page"] {
  color: #f4effb !important;
  border-bottom-color: #b05cff !important;
  background: transparent !important;
}

/* Canonical Cinema order used by the approved Search/Randomizer layout. */
body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a[href$="randomizer.html"] { order: 1 !important; }
body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a[href$="search.html"] { order: 2 !important; }
body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a[href$="cinema-rpg.html"] { order: 3 !important; }
body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a[href$="watchlist.html"] { order: 4 !important; }
body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a[href$="history.html"] { order: 5 !important; }

@media (max-width: 620px) {
  body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs {
    gap: 6px !important;
  }

  body.cinema-v2:is(.cinema-search-page,.cinema-randomizer-page,.cinema-watchlist-page,.cinema-history-page) .cinema-primary-tabs > a {
    padding-inline: 8px !important;
    font-size: 12px !important;
  }
}
