/*
  Category Master browser and preview sheet (leaf-1.3.3).
  Mirrors client/Unity/Assets/Prefabs/UI/CategoryGamePlay/* (tile, rail card, search bar) and
  Prefabs/UI/CategoryPreview/CategoryPreviewPopup.prefab. Sizes are canvas units (--u); text that would fall
  under a readable minimum on a phone is floored with max().
*/

/* ---- screen -------------------------------------------------------------------------------------- */
/* TMP style Bold on a label: the 1.3.0 tile and rail-card names measure 0.048em of tracking at weight 800 (the shared --tmp-bold, 0.105em, belongs to BaseButton labels) */
.cat-screen {
  --cat-name-tracking: 0.048em;
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  /* the browser's mint backdrop, sampled from the 1.3.0 build: #d8ffcc at the top to #85ebdc at the bottom */
  background: linear-gradient(180deg, #d8ffcc 0%, #85ebdc 100%);
  color: var(--ink);
}
.cat-col {
  width: 100%;
  margin-inline: auto;
}
.cat-screen.is-wide .cat-col {
  max-width: var(--column-max);
  padding-inline: 24px;
}

/* header: the shared navy band with the mountains backdrop (Main.unity ScreenHeader override: 394x230, alpha 0.57) */
.cat-header {
  overflow: hidden;
}
/* The ticket pill is wider than Back; reserve equal side space so the title stays centred on the screen. The
   subtitle may run 16u past its column on each side, into the free space beside the 160u pill (the 24u column gap
   plus the 30u the 190u side column leaves), which keeps 38u (about 14px on a small phone) clear of the pill: the
   native 24u left the text 8px from the pill's rounded edge on a 360px phone. There it is fitted to one line
   (CategoryBrowser.js HeaderSubtitle). */
.cat-screen:not(.is-wide) .cat-header {
  grid-template-columns: calc(190 * var(--u)) minmax(0, 1fr) calc(190 * var(--u));
}
.cat-screen:not(.is-wide) .cat-header .screen-header__title p {
  max-width: none;
  margin-inline: calc(-16 * var(--u));
  white-space: normal;
  overflow: visible;
  text-wrap: balance;
}
/* CategoryBrowser.js HeaderSubtitle sets the fitted size (26u down to 20u, as TMP auto-size) */
.cat-subtitle {
  font-size: calc(100% * var(--cat-sub-fit, 1));
  white-space: nowrap;
}
.cat-subtitle.is-wrapping {
  white-space: normal;
}
.cat-header::before {
  content: '';
  position: absolute;
  right: calc(10 * var(--u));
  bottom: 0;
  width: calc(394 * var(--u));
  height: calc(230 * var(--u));
  background: url('../assets/unity/Art/UI/Images/mountains.webp') right bottom / contain no-repeat;
  opacity: 0.57;
  pointer-events: none;
}
.cat-header > * {
  position: relative;
  z-index: 1;
}
.cat-header .pill {
  min-width: calc(160 * var(--u));
  justify-content: space-between;
  gap: calc(20 * var(--u));
  padding-right: calc(44 * var(--u));
}
/* wide: Back and the pill keep the shared full-width header's screen edges (Modes, Couch, Online); the pill hugs
   its icon and count instead of the phone's 160u spread */
.cat-screen.is-wide .cat-header .pill {
  flex: none;
  min-width: 0;
  justify-content: center;
  gap: calc(14 * var(--u));
  padding: 0 calc(20 * var(--u)) 0 calc(16 * var(--u));
}

.cat-pinned {
  flex: none;
}
.cat-scroll {
  flex: 1;
  min-height: 0;
}

/* ---- search (CategoryPlaySearchBar: 130u row, 96u white field, 28u side margins) ---------------------- */
.cat-search {
  display: flex;
  align-items: center;
  height: calc(130 * var(--u));
  min-height: 54px;
  padding: 0 calc(28 * var(--u));
}
.cat-screen.is-wide .cat-search {
  height: 84px;
  padding: 0;
}
.cat-search__field {
  position: relative;
  width: 100%;
  height: max(44px, calc(96 * var(--u)));
  border-radius: min(calc(48 * var(--u)), 999px);
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(27, 37, 89, 0.1),
    0 calc(3 * var(--u)) calc(8 * var(--u)) rgba(27, 37, 89, 0.06);
}
.cat-screen.is-wide .cat-search__field {
  height: 56px;
  border-radius: 28px;
}
/* Unity: the field stays white while empty and idle, and turns light grey (#f5f5f5) once it has text or the caret */
.cat-search__field.has-value,
.cat-search__field:focus-within {
  background: #f5f5f5;
}
.cat-search__input {
  width: 100%;
  height: 100%;
  padding: 0 max(44px, calc(96 * var(--u))) 0 max(18px, calc(36 * var(--u)));
  border: 0;
  border-radius: inherit;
  background: transparent;
  outline-offset: 2px;
  font-weight: var(--w-medium);
  font-size: max(15px, calc(32 * var(--u)));
  color: #031c26;
}
.cat-screen.is-wide .cat-search__input {
  padding-left: 24px;
  font-size: 18px;
}
.cat-search__input::placeholder {
  font-style: italic;
  color: #808890;
  opacity: 0.8;
}
.cat-search__clear {
  position: absolute;
  top: 50%;
  right: max(4px, calc(18 * var(--u)));
  display: grid;
  place-items: center;
  width: max(36px, calc(60 * var(--u)));
  height: max(36px, calc(60 * var(--u)));
  transform: translateY(-50%);
  border-radius: 50%;
  background: #f1f1f3;
  color: #808890;
}
.cat-search__clear svg {
  width: 42%;
  height: 42%;
}
.cat-search__clear:hover {
  background: #e6e6ea;
}
.cat-status {
  margin: 0;
  padding: calc(24 * var(--u)) calc(56 * var(--u)) calc(8 * var(--u));
  text-align: center;
  font-weight: var(--w-medium);
  font-size: max(13px, calc(28 * var(--u)));
  line-height: 1.35;
  color: #6a7380;
}
.cat-screen.is-wide .cat-status {
  padding-inline: 0;
  font-size: 16px;
}

/* ---- "Hot this week" rail (CategoryPlayFeaturedRail: 230u; label 6u down, cards 160u tall from 56u) ---- */
/* 230u is the native rail height; the label and strip carry readable minimums (16px label row, 68px strip) that
   outgrow it on a small or short phone (360x640 needs 88px against 77px), so the rail may grow to hold them instead
   of letting the cards run into the first tile */
.cat-rail {
  min-height: calc(230 * var(--u));
}
.cat-screen.is-wide .cat-rail {
  min-height: 0;
  padding-bottom: 4px;
}
.cat-rail__label {
  display: flex;
  align-items: center;
  height: calc(36 * var(--u));
  min-height: 16px;
  margin: calc(6 * var(--u)) calc(28 * var(--u)) 0;
  font-weight: var(--w-medium);
  font-size: max(11px, calc(26 * var(--u)));
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4d5954;
}
/* wide: the label row also holds the paging arrows, right-aligned with the column edge, clear of every card */
.cat-screen.is-wide .cat-rail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 44px;
  margin-top: 2px;
}
.cat-screen.is-wide .cat-rail__label {
  margin: 0;
  font-size: 13px;
}
.cat-rail__frame {
  position: relative;
}
.cat-rail__arrows {
  display: flex;
  gap: 12px;
}
.cat-rail__arrow {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  box-shadow:
    0 0 0 1px rgba(27, 37, 89, 0.08),
    0 2px 6px rgba(27, 37, 89, 0.18);
  color: var(--ink);
  transition:
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast),
    opacity var(--t-fast);
}
.cat-rail__arrow:not(:disabled):hover {
  transform: scale(1.06);
  box-shadow:
    0 0 0 1px rgba(27, 37, 89, 0.1),
    0 3px 10px rgba(27, 37, 89, 0.24);
}
.cat-rail__arrow:not(:disabled):active {
  transform: scale(0.96);
}
.cat-rail__arrow:disabled {
  opacity: 0.45;
  box-shadow: 0 0 0 1px rgba(27, 37, 89, 0.08);
  cursor: default;
}
.cat-rail__arrow svg {
  width: 46%;
  height: 46%;
}
.cat-rail__scroll {
  display: flex;
  align-items: center;
  gap: calc(18 * var(--u));
  height: calc(176 * var(--u));
  min-height: 68px;
  margin-top: calc(6 * var(--u));
  padding: calc(4 * var(--u)) calc(28 * var(--u));
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  overflow-anchor: none;
  scrollbar-width: none;
}
.cat-rail__scroll::-webkit-scrollbar {
  display: none;
}
/* wide: a page of --rail-n whole cards that line up with the list's columns below: the same count (two, three from
   1700px where the grid goes to three) and the grid's own 24px gutter, so every card edge sits on a tile edge. The
   strip reaches 8px past the column on each side so card shadows and focus rings are not clipped; that band is
   narrower than the gap, so no neighbouring card ever peeks in. Paging and swiping snap to card starts. */
.cat-screen.is-wide .cat-rail {
  --rail-n: 2;
  --rail-gap: 24px;
}
@media (min-width: 1700px) {
  .cat-screen.is-wide .cat-rail {
    --rail-n: 3;
  }
}
/* The wide card is composed, not stretched from the phone's 160u strip. CategoryBrowser.js fitRailNames sets
   --cat-lines on the strip: the lines the longest name in the rail needs (1 or 2); every card has the height that
   gives, so cards never change height while paging. The text (kicker, 6u gap, name) is one block centred in the card:
   on a page that mixes one- and two-line names every block reserves --cat-lines lines, so the kickers and first name
   lines sit on shared lines across the page; on a page whose names all have the same count each block is just its own
   lines (alignRail, [data-align="center"] below), centred on the glyph disc with the same air above and below.
   The glyph disc keeps 30u clear of the card's left, top and bottom edges. */
.cat-screen.is-wide .cat-rail__scroll {
  --rail-h: calc((140 + 30.2 * var(--cat-lines, 2)) * var(--u));
  --rail-disc: calc(var(--rail-h) - 60 * var(--u));
  --rail-text-left: calc(56 * var(--u) + var(--rail-disc));
  align-items: flex-start;
  height: auto;
  min-height: 0;
  margin: 0 -8px;
  padding: 6px 8px 14px;
  gap: var(--rail-gap);
  scroll-padding-inline: 8px;
  scroll-snap-type: x mandatory;
}
.cat-screen.is-wide .cat-rail-card {
  flex: 0 0 calc((100% - (var(--rail-n) - 1) * var(--rail-gap)) / var(--rail-n));
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: auto;
  height: var(--rail-h);
  min-height: 0;
  /* 5u off the bottom: the 9u lower lip makes the card's face sit a little above its box centre, so the block is
     lifted 2.5u and the disc (below) 3u, which puts the text's ink centre on the disc's centre */
  padding: 0 calc(88 * var(--u)) calc(5 * var(--u)) var(--rail-text-left);
  border-radius: calc(50 * var(--u));
  scroll-snap-align: start;
}
.cat-screen.is-wide .cat-rail-card__disc {
  left: calc(30 * var(--u));
  top: calc(50% - 3 * var(--u));
  width: var(--rail-disc);
  height: var(--rail-disc);
}
.cat-screen.is-wide .cat-rail-card__disc .cat-glyph {
  width: calc(var(--rail-disc) * 0.84);
  height: calc(var(--rail-disc) * 0.84);
}
.cat-screen.is-wide .cat-rail-card__badge,
.cat-screen.is-wide .cat-rail-card__name {
  position: static;
  flex: none;
}
.cat-screen.is-wide .cat-rail-card__badge {
  line-height: calc(34 * var(--u));
  margin-bottom: calc(6 * var(--u));
  font-size: max(11px, calc(28 * var(--u)));
}
/* the name box is exactly its lines tall at the fitted size; --cat-lines of them is the shared reserve (every
   block the same height, so kickers and first lines line up on a page that mixes one- and two-line names), and where
   a page's names all have the same count (CategoryBrowser.js alignRail sets data-align="center") each card's own
   count, which centres the block on the glyph disc instead of leaving a spare line beneath it */
.cat-screen.is-wide .cat-rail-card__name {
  align-items: flex-start;
  height: calc(var(--cat-lines, 2) * 1.1em);
  min-height: 0;
}
.cat-screen.is-wide .cat-rail__scroll[data-align='center'] .cat-rail-card__name {
  height: calc(var(--own-lines, var(--cat-lines, 2)) * 1.1em);
}
.cat-screen.is-wide .cat-rail__scroll[data-settled] .cat-rail-card__name {
  transition: height var(--t-med) var(--ease-out);
}
.cat-screen.is-wide .cat-rail-card__chevron {
  right: calc(40 * var(--u));
}
.cat-screen.is-wide .cat-skel--badge {
  left: var(--rail-text-left);
  top: calc((var(--rail-h) - 100 * var(--u)) / 2);
  height: calc(24 * var(--u));
}
.cat-screen.is-wide .cat-skel--rail-name {
  left: var(--rail-text-left);
  top: calc((var(--rail-h) - 100 * var(--u)) / 2 + 46 * var(--u));
}

.cat-rail-card {
  position: relative;
  flex: none;
  width: calc(720 * var(--u));
  height: calc(160 * var(--u));
  min-height: 60px;
  border-radius: calc(40 * var(--u));
  background: linear-gradient(180deg, var(--top, #e2603c), var(--accent, #e2603c) 70%);
  box-shadow:
    inset 0 0 0 calc(6 * var(--u)) var(--ring-light, rgba(255, 255, 255, 0.4)),
    inset 0 calc(-9 * var(--u)) 0 calc(1 * var(--u)) var(--ring-dark, rgba(0, 0, 0, 0.16)),
    0 calc(10 * var(--u)) calc(10 * var(--u)) rgba(0, 0, 0, 0.07);
  color: #fff;
  text-align: left;
  transition:
    transform var(--t-fast) var(--ease-out),
    filter var(--t-fast);
}
.cat-rail-card:hover {
  filter: brightness(1.04);
}
.cat-rail-card:active {
  transform: translateY(calc(4 * var(--u)));
}
.cat-rail-card__disc {
  position: absolute;
  left: calc(16 * var(--u));
  top: 50%;
  display: grid;
  place-items: center;
  width: calc(110 * var(--u));
  height: calc(110 * var(--u));
  transform: translateY(-50%);
  border-radius: 50%;
  background: var(--disc, rgba(255, 255, 255, 0.25));
}
.cat-rail-card__disc .cat-glyph {
  width: calc(92 * var(--u));
  height: calc(92 * var(--u));
  object-fit: contain;
  filter: drop-shadow(0 calc(1 * var(--u)) 0 rgba(0, 0, 0, 0.5));
}
.cat-rail-card__badge,
.cat-rail-card__name {
  position: absolute;
  left: calc(140 * var(--u));
  right: calc(84 * var(--u));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-shadow: var(--on-colour-shadow);
}
.cat-rail-card__badge {
  top: calc(16 * var(--u));
  line-height: calc(32 * var(--u));
  font-weight: var(--w-semibold);
  font-size: max(10px, calc(27 * var(--u)));
  color: rgba(255, 255, 255, 0.88);
}
.cat-rail-card__name {
  top: calc(56 * var(--u));
  height: calc(92 * var(--u));
  min-height: 34px;
  display: flex;
  align-items: center;
  overflow: visible;
  white-space: normal;
  font-weight: var(--w-extrabold);
  font-size: calc(max(14px, calc(42 * var(--u))) * var(--cat-fit, 1));
  line-height: 1.1;
  letter-spacing: var(--cat-name-tracking);
  color: #fff;
}
/* one size for every name on the rail (CategoryBrowser.js fitRailNames sets --cat-fit on the strip): 42u while all
   names fit one line, else the two-line size, down to 32/42 like Unity's auto-size; then an ellipsis */
.cat-rail-card__name > span {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  /* titles are live data: break a two-line name evenly ("United States / Grand Prix"), never one word alone on the
     last line; a one-line name is unaffected and the first line still starts where the kicker's column does */
  text-wrap: balance;
}
.cat-rail-card__chevron {
  position: absolute;
  right: calc(34 * var(--u));
  top: 50%;
  transform: translate(50%, -50%);
  font-weight: var(--w-black);
  font-size: max(16px, calc(50 * var(--u)));
  line-height: 1;
  text-shadow: var(--on-colour-shadow);
}
.cat-rail-card--skeleton {
  background: rgba(255, 255, 255, 0.42);
  box-shadow: none;
}

/* ---- list and tile (CategoryPlayTilePrefab: 200u tall, rim 12u, lip 14u, spacing 20u, side padding 20u) -- */
.cat-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: calc(20 * var(--u) + var(--cat-fold-row, 0px)) calc(20 * var(--u));
  /* --cat-fold (the first row's top) and --cat-fold-row (every row gap): how far the rows sit lower than the prefab's
     20u so that the window's bottom edge does not slice a tile's text; CategoryBrowser.js useCleanFold measures them
     while the list is at the top */
  padding: calc(20 * var(--u) + var(--cat-fold, 0px)) calc(20 * var(--u)) calc(24 * var(--u) + var(--safe-bottom));
}
/* wide: two columns from a portrait tablet up (a single column of 770px bars wastes a tablet), three on a full-HD
   screen, whose column widens to 1480px so each tile keeps a full-size one-line name */
.cat-screen.is-wide .cat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(26px + var(--cat-fold-row, 0px)) 24px;
  padding: calc(18px + var(--cat-fold, 0px)) 0 48px;
}
@media (min-width: 1700px) {
  .cat-screen.is-wide .cat-col {
    max-width: 1480px;
  }
  .cat-screen.is-wide .cat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.cat-tile {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: calc(186 * var(--u));
  min-height: 72px;
  margin-bottom: calc(14 * var(--u));
  padding: 0 calc(14 * var(--u)) 0 calc(38 * var(--u));
  border-radius: calc(72 * var(--u));
  background: var(--accent, #3a7bd5);
  /* lip (sprite 153/255) over rim (204/255), then the translucent shadow band under the card */
  box-shadow:
    inset 0 calc(-14 * var(--u)) 0 0 var(--lip, rgba(0, 0, 0, 0.4)),
    inset 0 0 0 calc(12 * var(--u)) var(--rim, rgba(0, 0, 0, 0.2)),
    0 calc(14 * var(--u)) 0 0 rgba(0, 0, 0, 0.25);
  color: #fff;
  text-align: left;
  animation: cat-tile-in var(--t-slow) var(--ease-out) both;
  animation-delay: calc(var(--i, 0) * 28ms);
  transition:
    transform var(--t-fast) var(--ease-out),
    filter var(--t-fast);
}
.cat-tile:hover {
  filter: brightness(1.05);
}
.cat-tile:active {
  transform: translateY(calc(5 * var(--u)));
}
@keyframes cat-tile-in {
  from {
    opacity: 0;
    transform: translateY(calc(18 * var(--u)));
  }
}
.cat-tile__medallion {
  display: grid;
  place-items: center;
  flex: none;
  width: calc(150 * var(--u));
  height: calc(150 * var(--u));
  min-width: 52px;
  min-height: 52px;
  border-radius: 50%;
  background: var(--medallion, rgba(255, 255, 255, 0.3));
}
.cat-tile__medallion .cat-glyph {
  width: calc(120 * var(--u));
  height: calc(120 * var(--u));
  object-fit: contain;
  filter: drop-shadow(0 calc(1 * var(--u)) 0 rgba(0, 0, 0, 0.5));
}
.cat-glyph__letter {
  font-weight: var(--w-bold);
  font-size: calc(64 * var(--u));
  color: #fff;
  text-shadow: var(--on-colour-shadow);
}
.cat-tile__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: calc(10 * var(--u));
  margin-left: calc(23 * var(--u));
  padding-bottom: calc(6 * var(--u));
}
.cat-tile__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-weight: var(--w-extrabold);
  font-size: max(16px, calc(44 * var(--u)));
  line-height: 1.12;
  letter-spacing: var(--cat-name-tracking);
  color: #fff;
  text-shadow: var(--on-colour-shadow);
}
/* Unity draws this line white at 80 %; on the pale lilac, pink and lavender tiles that falls to ~1.5:1, so every
   tile gets solid white with the tile's own darker lip shade as a 1px under-shadow and a soft edge (the on-colour
   treatment, in the tile's colour), which holds the line on the palest face */
.cat-tile__meta {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-weight: var(--w-bold);
  font-size: max(11px, calc(26 * var(--u)));
  line-height: 1.2;
  color: #fff;
  text-shadow:
    0 1px 0 var(--lip, rgba(0, 0, 0, 0.35)),
    0 0 2px var(--lip, rgba(0, 0, 0, 0.25));
}
/* Unity: the ticket is 50u wide centred 164u from the right edge, the cost a 48u box centred 108u from it; the name
   box stops 213u from the right edge, 24u before the ticket, so a long name never runs up to the ticket */
.cat-tile__price {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: calc(7 * var(--u));
  margin: 0 calc(30 * var(--u)) 0 calc(24 * var(--u));
  font-weight: var(--w-semibold);
  font-size: max(13px, calc(32 * var(--u)));
  line-height: 1;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: var(--on-colour-shadow);
}
.cat-tile__price > span {
  display: inline-block;
  min-width: calc(48 * var(--u));
  text-align: center;
}
.cat-tile--event .cat-tile__price {
  font-size: max(14px, calc(36 * var(--u)));
}
.cat-tile__price img {
  width: max(18px, calc(50 * var(--u)));
  height: max(18px, calc(50 * var(--u)));
  object-fit: contain;
  opacity: 0.92;
}
.cat-tile__chevron {
  flex: none;
  width: calc(40 * var(--u));
  min-width: 14px;
  text-align: center;
  font-weight: var(--w-black);
  font-size: max(16px, calc(50 * var(--u)));
  line-height: 1;
  text-shadow: var(--on-colour-shadow);
}
.cat-screen.is-wide .cat-tile__chevron {
  margin-right: 6px;
}
/* wide: the name keeps at least ~0.65em of air before the chevron on the narrowest two-column tiles (a portrait
   tablet's 374px), where 44u would run "Current Events" up to it; wider tiles keep the full 44u */
.cat-screen.is-wide .cat-tile {
  container-type: inline-size;
}
.cat-screen.is-wide .cat-tile__name {
  font-size: min(max(16px, calc(44 * var(--u))), 5.6cqi);
}

/* skeletons: the same silhouette in a quiet tone */
.cat-tile--skeleton {
  --accent: rgba(255, 255, 255, 0.5);
  --rim: rgba(255, 255, 255, 0.35);
  --lip: rgba(255, 255, 255, 0.28);
  --medallion: rgba(255, 255, 255, 0.55);
  pointer-events: none;
  animation: cat-skel-pulse 1.3s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.cat-skel {
  display: block;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
}
.cat-skel--name {
  width: 46%;
  height: calc(40 * var(--u));
  min-height: 14px;
}
.cat-skel--meta {
  width: 62%;
  height: calc(24 * var(--u));
  min-height: 10px;
}
.cat-skel--badge {
  position: absolute;
  left: calc(140 * var(--u));
  top: calc(22 * var(--u));
  width: 34%;
  height: calc(24 * var(--u));
  min-height: 8px;
}
.cat-skel--rail-name {
  position: absolute;
  left: calc(140 * var(--u));
  top: calc(86 * var(--u));
  width: 58%;
  height: calc(38 * var(--u));
  min-height: 12px;
}
.cat-rail-card--skeleton {
  animation: cat-skel-pulse 1.3s ease-in-out infinite;
}
@keyframes cat-skel-pulse {
  50% {
    opacity: 0.6;
  }
}
.reduced-motion .cat-tile,
.reduced-motion .cat-tile--skeleton,
.reduced-motion .cat-rail-card--skeleton {
  animation: none;
}

/* ==== preview sheet ================================================================================= */
.cat-sheet-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  /* the sheet docks under the screen header (the header stays visible, dimmed) with 22u side margins and 44u of dimmed backdrop below (measured on the 1.3.0 capture: 17.5 px at 430 wide) */
  padding: calc(var(--header-h) + var(--safe-top)) calc(22 * var(--u)) calc(44 * var(--u) + var(--safe-bottom));
  background: rgba(0, 0, 0, 0.45);
  animation: fade-in var(--t-med) var(--ease-out);
}
.cat-sheet-layer.is-wide {
  align-items: center;
  padding: max(24px, 4vh) 24px;
}
.cat-sheet-loading {
  margin: auto;
}
.cat-sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: 100%;
  border-radius: calc(48 * var(--u));
  background: #f9f7f3;
  box-shadow: 0 calc(16 * var(--u)) calc(48 * var(--u)) rgba(0, 0, 0, 0.32);
  overflow: hidden;
  animation: cat-sheet-in var(--t-med) var(--ease-out);
  outline: none;
}
.cat-sheet-layer.is-wide .cat-sheet {
  width: min(720px, 100%);
  max-height: min(920px, 100%);
  border-radius: 28px;
}
@keyframes cat-sheet-in {
  from {
    opacity: 0;
    transform: translateY(calc(40 * var(--u)));
  }
}

/* header band: accent colour, 132u, back / title / close */
.cat-sheet__band {
  position: relative;
  z-index: 3;
  flex: none;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: calc(24 * var(--u));
  min-height: max(60px, calc(132 * var(--u)));
  padding: 0 calc(26 * var(--u));
  background: var(--accent);
}
.cat-sheet-layer.is-wide .cat-sheet__band {
  min-height: 76px;
  padding: 0 16px;
  column-gap: 16px;
}
.cat-sheet__ctl {
  --size: max(44px, calc(84 * var(--u)));
  background: rgba(255, 255, 255, 0.22);
}
.cat-sheet__ctl.icon-btn--glass {
  color: #fff;
}
.cat-sheet__ctl svg {
  width: 48%;
  height: 48%;
  filter: drop-shadow(var(--on-colour-shadow-svg, 0 1px 0 rgba(0, 0, 0, 0.3)));
}
.cat-sheet__title {
  min-width: 0;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: var(--w-semibold);
  font-size: max(19px, calc(44 * var(--u)));
  line-height: 1.15;
  color: #fff;
  text-shadow: var(--on-colour-shadow);
}
.cat-sheet-layer.is-wide .cat-sheet__title {
  font-size: 26px;
}
.cat-ribbon {
  position: absolute;
  right: calc(140 * var(--u));
  bottom: 0;
  transform: translateY(50%);
  display: grid;
  place-items: center;
  min-width: calc(170 * var(--u));
  height: calc(58 * var(--u));
  min-height: 26px;
  padding: 0 14px;
  border-radius: 999px;
  background: #7b4dbd;
  box-shadow: inset 0 0 0 calc(4 * var(--u)) rgba(255, 255, 255, 0.9);
  font-weight: var(--w-semibold);
  font-size: max(11px, calc(28 * var(--u)));
  letter-spacing: 0.08em;
  color: #fff;
  text-shadow: var(--on-colour-shadow);
}

/* scrolling body: 26u side padding, 20u between cards, soft edge fades (24u top, 40u bottom) */
.cat-sheet__body {
  flex: 1 1 auto;
  min-height: min(calc(300 * var(--u)), 120px);
}
.cat-sheet__body::before,
.cat-sheet__body::after {
  content: '';
  position: sticky;
  display: block;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}
.cat-sheet__body::before {
  top: 0;
  height: calc(24 * var(--u));
  margin-bottom: calc(-24 * var(--u));
  background: linear-gradient(#f9f7f3, rgba(249, 247, 243, 0));
}
.cat-sheet__body::after {
  bottom: 0;
  height: calc(40 * var(--u));
  margin-top: calc(-40 * var(--u));
  background: linear-gradient(rgba(249, 247, 243, 0), #f9f7f3);
}
.cat-sheet__content {
  display: flex;
  flex-direction: column;
  gap: calc(20 * var(--u));
  padding: calc(24 * var(--u)) calc(26 * var(--u)) calc(28 * var(--u));
}
.cat-sheet-layer.is-wide .cat-sheet__content {
  gap: 16px;
  padding: 22px 24px 24px;
}

.cat-card {
  border-radius: calc(36 * var(--u));
  background: #fefefe;
  box-shadow:
    inset 0 0 0 max(1px, calc(2 * var(--u))) #e6e6e7,
    0 calc(10 * var(--u)) calc(10 * var(--u)) rgba(0, 0, 0, 0.067);
}
.cat-sheet-layer.is-wide .cat-card {
  border-radius: 22px;
}
.cat-label {
  margin: 0;
  font-weight: var(--w-semibold);
  font-size: max(9.5px, calc(23 * var(--u)));
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5f6877;
}
.cat-sheet-layer.is-wide .cat-label {
  font-size: 13px;
}
.cat-hint {
  margin: 0;
  font-weight: var(--w-medium);
  font-size: max(11px, calc(26 * var(--u)));
  line-height: 1.3;
  color: #808890;
}
.cat-sheet-layer.is-wide .cat-hint {
  font-size: 15px;
}

/* identity card */
.cat-hero {
  display: flex;
  align-items: center;
  gap: calc(22 * var(--u));
  padding: calc(22 * var(--u)) calc(26 * var(--u));
}
.cat-sheet-layer.is-wide .cat-hero {
  gap: 18px;
  padding: 16px 20px;
}
.cat-hero__ring {
  display: grid;
  place-items: center;
  flex: none;
  width: max(52px, calc(118 * var(--u)));
  height: max(52px, calc(118 * var(--u)));
  border-radius: 50%;
}
.cat-hero__ring .cat-glyph {
  width: 60%;
  height: 60%;
  object-fit: contain;
}
.cat-hero__letter {
  font-weight: var(--w-bold);
  font-size: calc(54 * var(--u));
  color: var(--accent-ink);
}
.cat-hero__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
}
.cat-hero__text h3 {
  margin: 0;
  overflow-wrap: anywhere;
  font-weight: var(--w-semibold);
  font-size: max(18px, calc(44 * var(--u)));
  line-height: 1.12;
}
.cat-hero__text p {
  margin: 0;
  font-weight: var(--w-medium);
  font-size: max(12px, calc(27 * var(--u)));
  line-height: 1.25;
  color: #808890;
}
.cat-sheet-layer.is-wide .cat-hero__text h3 {
  font-size: 26px;
}
.cat-sheet-layer.is-wide .cat-hero__text p {
  font-size: 15px;
}

/* chips */
.cat-chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: calc(8 * var(--u));
  height: max(26px, calc(52 * var(--u)));
  padding: 0 max(10px, calc(20 * var(--u)));
  border-radius: 999px;
  font-weight: var(--w-semibold);
  font-size: max(11px, calc(26 * var(--u)));
  white-space: nowrap;
}
.cat-chip--solid {
  color: #fff;
  text-shadow: var(--on-colour-shadow);
}
.cat-chip--solid img {
  width: max(14px, calc(30 * var(--u)));
  height: max(14px, calc(30 * var(--u)));
}
.cat-chip--soft {
  height: max(28px, calc(54 * var(--u)));
  padding: 0 max(12px, calc(22 * var(--u)));
}
.cat-chip--club {
  align-self: flex-start;
  background: #efe9f9;
  color: #7b4dbd;
}
.cat-sheet-layer.is-wide .cat-chip {
  height: 32px;
  padding: 0 14px;
  font-size: 14px;
}

/* mastery */
.cat-mastery {
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
  padding: calc(24 * var(--u)) calc(32 * var(--u));
}
.cat-sheet-layer.is-wide .cat-mastery {
  gap: 10px;
  padding: 16px 22px;
}
.cat-mastery__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(12 * var(--u));
}
.cat-mastery__level {
  font-weight: var(--w-semibold);
  font-size: max(19px, calc(50 * var(--u)));
  line-height: 1.1;
  color: #031c26;
}
.cat-sheet-layer.is-wide .cat-mastery__level {
  font-size: 30px;
}
.cat-mastery__bar {
  display: flex;
  gap: calc(8 * var(--u));
  height: max(8px, calc(22 * var(--u)));
}
.cat-mastery__bar i {
  flex: 1;
  border-radius: 999px;
  background: #ececef;
}

/* difficulty */
.cat-difficulty {
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
  padding: calc(24 * var(--u)) calc(32 * var(--u));
}
.cat-sheet-layer.is-wide .cat-difficulty {
  gap: 10px;
  padding: 16px 22px;
}
.cat-difficulty__pills {
  display: flex;
  gap: calc(12 * var(--u));
}
.cat-pill {
  flex: 1 1 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: calc(8 * var(--u));
  height: max(28px, calc(70 * var(--u)));
  padding: 0 calc(10 * var(--u));
  border-radius: 999px;
  font-weight: var(--w-semibold);
  font-size: max(11px, calc(27 * var(--u)));
  white-space: nowrap;
}
.cat-pill.is-open {
  color: #031c26;
}
.cat-pill.is-open b {
  font-weight: var(--w-medium);
  font-size: 1.05em;
}
.cat-pill.is-locked {
  background: #ececef;
  color: #9ea6ad;
}
.cat-pill img {
  width: max(12px, calc(26 * var(--u)));
  height: max(12px, calc(26 * var(--u)));
  object-fit: contain;
}
.cat-sheet-layer.is-wide .cat-pill {
  height: 40px;
  font-size: 15px;
}

.cat-pass {
  display: flex;
  align-items: center;
  min-height: max(34px, calc(76 * var(--u)));
  padding: calc(14 * var(--u)) calc(28 * var(--u));
  border-radius: calc(30 * var(--u));
  background: #fff4d8;
  box-shadow: inset 0 0 0 max(1px, calc(2 * var(--u))) rgba(254, 185, 11, 0.55);
  font-weight: var(--w-semibold);
  font-size: max(12px, calc(27 * var(--u)));
  color: #031c26;
}

/* weekly board */
.cat-board {
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
  padding: calc(24 * var(--u)) calc(32 * var(--u));
  cursor: pointer;
  text-align: left;
}
.cat-sheet-layer.is-wide .cat-board {
  gap: 10px;
  padding: 16px 22px;
}
.cat-board__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: calc(8 * var(--u));
}
.cat-board__all {
  font-weight: var(--w-semibold);
  font-size: max(11px, calc(23 * var(--u)));
  color: #5f6877;
}
.cat-sheet-layer.is-wide .cat-board__all {
  font-size: 14px;
}
.cat-board__rows {
  display: flex;
  flex-direction: column;
  gap: calc(10 * var(--u));
}
.cat-board__row {
  display: flex;
  align-items: center;
  gap: calc(14 * var(--u));
  min-height: max(34px, calc(64 * var(--u)));
  padding: 0 calc(10 * var(--u));
  border-radius: calc(20 * var(--u));
}
.cat-board__row.is-self {
  background: color-mix(in srgb, var(--accent) 26%, #fff);
}
.cat-medal {
  display: grid;
  place-items: center;
  flex: none;
  width: max(38px, calc(78 * var(--u)));
  height: max(22px, calc(44 * var(--u)));
  border-radius: 999px;
  background: #ececef;
  font-weight: var(--w-semibold);
  font-size: max(11px, calc(23 * var(--u)));
  color: #031c26;
}
.cat-medal.is-podium {
  color: #fff;
  text-shadow: var(--on-colour-shadow);
}
.cat-avatar {
  flex: none;
  width: max(26px, calc(52 * var(--u)));
  height: max(26px, calc(52 * var(--u)));
  border-radius: 50%;
  object-fit: cover;
  background: #ececef;
}
.cat-avatar--letter {
  display: grid;
  place-items: center;
  background: hsl(var(--hue, 210) 55% 52%);
  font-weight: var(--w-bold);
  font-size: max(12px, calc(26 * var(--u)));
  color: #fff;
  text-shadow: var(--on-colour-shadow);
}
.cat-board__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: var(--w-semibold);
  font-size: max(13px, calc(29 * var(--u)));
  color: #031c26;
}
.cat-board__score {
  flex: none;
  min-width: calc(130 * var(--u));
  text-align: right;
  font-weight: var(--w-semibold);
  font-size: max(13px, calc(29 * var(--u)));
  font-variant-numeric: tabular-nums;
  color: #031c26;
}
.cat-board__tries {
  flex: none;
  min-width: calc(110 * var(--u));
  text-align: right;
  font-weight: var(--w-medium);
  font-size: max(11px, calc(23 * var(--u)));
  color: #808890;
}
.cat-board__gap {
  display: flex;
  align-items: center;
  gap: calc(12 * var(--u));
  min-height: max(18px, calc(34 * var(--u)));
  padding: 0 calc(10 * var(--u));
  font-weight: var(--w-medium);
  font-size: max(11px, calc(21 * var(--u)));
  color: #808890;
}
.cat-board__gap i {
  flex: 1;
  height: 1px;
  background: rgba(3, 28, 38, 0.1);
}
.cat-board__divider {
  height: max(1px, calc(2 * var(--u)));
  background: rgba(3, 28, 38, 0.08);
}
.cat-board__status {
  margin: 0;
  font-weight: var(--w-medium);
  font-size: max(11px, calc(26 * var(--u)));
  line-height: 1.3;
  color: #808890;
}
.cat-board__status strong {
  font-weight: var(--w-bold);
}
.cat-sheet-layer.is-wide .cat-board__status,
.cat-sheet-layer.is-wide .cat-board__name,
.cat-sheet-layer.is-wide .cat-board__score {
  font-size: 15px;
}
.cat-sheet-layer.is-wide .cat-board__tries,
.cat-sheet-layer.is-wide .cat-medal {
  font-size: 13px;
}

/* stats */
.cat-stats {
  display: flex;
  align-items: center;
  gap: calc(16 * var(--u));
  padding: calc(20 * var(--u)) calc(26 * var(--u));
}
.cat-stats__cell {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: calc(4 * var(--u));
  text-align: center;
}
.cat-stats__cell span {
  font-weight: var(--w-semibold);
  font-size: max(11px, calc(22 * var(--u)));
  letter-spacing: 0.04em;
  color: #808890;
}
.cat-stats__cell strong {
  font-weight: var(--w-semibold);
  font-size: max(16px, calc(37 * var(--u)));
  color: #031c26;
}
.cat-stats--line {
  justify-content: center;
  min-height: max(34px, calc(74 * var(--u)));
}
.cat-stats--line p {
  margin: 0;
  text-align: center;
  font-weight: var(--w-medium);
  font-size: max(12px, calc(26 * var(--u)));
  color: #808890;
}
.cat-sheet-layer.is-wide .cat-stats--line p {
  font-size: 15px;
}
.cat-sheet.is-hinting .cat-stats {
  visibility: hidden;
}

/* topics (a category with children) */
.cat-topics {
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
  padding-top: calc(4 * var(--u));
}
.cat-topics__list {
  display: flex;
  flex-direction: column;
  gap: calc(14 * var(--u));
}
.cat-topics__none {
  padding: 0 calc(8 * var(--u));
  text-align: center;
}
.cat-toolbar {
  display: flex;
  align-items: center;
  gap: calc(14 * var(--u));
  min-height: max(44px, calc(92 * var(--u)));
}
.cat-toolbar__input {
  flex: 1;
  min-width: min(calc(300 * var(--u)), 38%);
  height: max(40px, calc(80 * var(--u)));
  padding: 0 calc(28 * var(--u));
  border: 0;
  border-radius: calc(40 * var(--u));
  background: #ececef;
  font-weight: var(--w-medium);
  font-size: max(14px, calc(27 * var(--u)));
  color: #031c26;
}
.cat-toolbar__input::placeholder {
  font-style: italic;
  color: #808890;
  opacity: 0.8;
}
.cat-toolbar__back {
  flex: none;
  height: max(40px, calc(80 * var(--u)));
  padding: 0 calc(30 * var(--u));
  border-radius: calc(40 * var(--u));
  background: #fae7eb;
  font-weight: var(--w-semibold);
  font-size: max(11px, calc(26 * var(--u)));
  white-space: nowrap;
  color: #83384c;
}
.cat-sheet-layer.is-wide .cat-toolbar__input,
.cat-sheet-layer.is-wide .cat-toolbar__back {
  height: 48px;
  border-radius: 24px;
  font-size: 15px;
}
.cat-sheet-layer.is-wide .cat-toolbar__back {
  padding: 0 22px;
}

.cat-topic,
.cat-browse-all {
  display: flex;
  align-items: center;
  width: 100%;
  border-radius: calc(36 * var(--u));
  background: #fefefe;
  box-shadow:
    inset 0 0 0 max(1px, calc(2 * var(--u))) #e6e6e7,
    0 calc(10 * var(--u)) calc(10 * var(--u)) rgba(0, 0, 0, 0.067);
  text-align: left;
  transition:
    transform var(--t-fast) var(--ease-out),
    background var(--t-fast);
}
.cat-topic {
  gap: calc(18 * var(--u));
  min-height: max(52px, calc(128 * var(--u)));
  padding: calc(16 * var(--u)) calc(24 * var(--u));
}
.cat-topic:hover:not(.cat-topic--skeleton),
.cat-browse-all:hover {
  background: #f8f8fa;
}
.cat-topic:active:not(.cat-topic--skeleton),
.cat-browse-all:active {
  transform: scale(0.992);
  background: #f3f3f5;
}
.cat-topic__ring {
  display: grid;
  place-items: center;
  flex: none;
  width: max(40px, calc(86 * var(--u)));
  height: max(40px, calc(86 * var(--u)));
  border-radius: 50%;
}
.cat-topic__ring .cat-glyph {
  width: 63%;
  height: 63%;
  object-fit: contain;
}
.cat-topic__letter {
  font-weight: var(--w-bold);
  font-size: calc(40 * var(--u));
  color: var(--accent-ink);
}
.cat-topic__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(5 * var(--u));
}
.cat-topic__text strong {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  overflow-wrap: anywhere;
  font-weight: var(--w-semibold);
  font-size: max(14px, calc(31 * var(--u)));
  line-height: 1.15;
  color: #031c26;
}
.cat-topic__text > span:not(.cat-pips) {
  font-weight: var(--w-medium);
  font-size: max(11px, calc(24 * var(--u)));
  color: #808890;
}
.cat-pips {
  display: flex;
  gap: calc(8 * var(--u));
  height: max(6px, calc(14 * var(--u)));
}
.cat-pips i {
  width: max(6px, calc(14 * var(--u)));
  height: max(6px, calc(14 * var(--u)));
  border-radius: 50%;
  background: #ececef;
}
.cat-topic__chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  gap: calc(6 * var(--u));
  height: max(24px, calc(48 * var(--u)));
  padding: 0 max(10px, calc(18 * var(--u)));
  border-radius: 999px;
  background: #ececef;
  font-weight: var(--w-semibold);
  font-size: max(12px, calc(25 * var(--u)));
  line-height: 1;
  color: #031c26;
}
.cat-topic__chip img {
  width: max(14px, calc(28 * var(--u)));
  height: max(14px, calc(28 * var(--u)));
  object-fit: contain;
}
.cat-topic__chip.is-owned {
  background: #efe9f9;
  color: #7b4dbd;
}
.cat-topic__chip.is-mastered {
  background: #e0efe5;
  color: #0d8439;
}
.cat-topic__chip.is-new {
  background: #0d8439;
  color: #fff;
}
.cat-topic__chip.is-sale {
  background: #499de6;
  color: #fff;
}
.cat-topic__chip.is-sale-big {
  background: #f98b2f;
  color: #fff;
}
.cat-topic__chevron {
  flex: none;
  width: calc(24 * var(--u));
  min-width: 10px;
  text-align: center;
  font-weight: var(--w-semibold);
  font-size: max(20px, calc(40 * var(--u)));
  line-height: 1;
}
.cat-topic__chevron--grey {
  color: #808890;
}
.cat-topic--skeleton {
  pointer-events: none;
  animation: cat-skel-pulse 1.3s ease-in-out infinite;
  animation-delay: calc(var(--i, 0) * 120ms);
}
.cat-topic--skeleton .cat-topic__ring {
  background: #ececef;
}
.cat-topic--skeleton .cat-skel {
  background: #ececef;
}
.cat-skel--topic-name {
  width: 56%;
  height: calc(26 * var(--u));
  min-height: 12px;
}
.cat-skel--topic-meta {
  width: 34%;
  height: calc(18 * var(--u));
  min-height: 9px;
}
.cat-browse-all {
  gap: calc(20 * var(--u));
  min-height: max(52px, calc(116 * var(--u)));
  padding: calc(16 * var(--u)) calc(28 * var(--u)) calc(16 * var(--u)) calc(24 * var(--u));
}
.cat-browse-all__ring {
  display: grid;
  place-items: center;
  flex: none;
  width: max(40px, calc(80 * var(--u)));
  height: max(40px, calc(80 * var(--u)));
  border-radius: 50%;
  background: #fae7eb;
}
.cat-browse-all__ring .cat-glyph {
  width: 60%;
  height: 60%;
  object-fit: contain;
}
.cat-browse-all__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: calc(4 * var(--u));
}
.cat-browse-all__text strong {
  font-weight: var(--w-semibold);
  font-size: max(14px, calc(31 * var(--u)));
  line-height: 1.15;
  color: #031c26;
}
.cat-browse-all__text span {
  font-weight: var(--w-medium);
  font-size: max(11px, calc(24 * var(--u)));
  color: #808890;
}
.cat-sheet-layer.is-wide .cat-topic {
  min-height: 76px;
  gap: 16px;
  padding: 12px 18px;
}
.cat-sheet-layer.is-wide .cat-topic__ring {
  width: 52px;
  height: 52px;
}
.cat-sheet-layer.is-wide .cat-topic__text strong,
.cat-sheet-layer.is-wide .cat-browse-all__text strong {
  font-size: 18px;
}
.cat-sheet-layer.is-wide .cat-topic__text > span:not(.cat-pips),
.cat-sheet-layer.is-wide .cat-browse-all__text span {
  font-size: 14px;
}
.cat-sheet-layer.is-wide .cat-pips,
.cat-sheet-layer.is-wide .cat-pips i {
  height: 8px;
}
.cat-sheet-layer.is-wide .cat-pips i {
  width: 8px;
}
.cat-sheet-layer.is-wide .cat-topic__chip {
  height: 30px;
  padding: 0 12px;
  font-size: 14px;
}
.cat-sheet-layer.is-wide .cat-topic__chevron {
  font-size: 26px;
}
.cat-sheet-layer.is-wide .cat-browse-all {
  min-height: 72px;
  gap: 16px;
  padding: 12px 18px;
}
.cat-sheet-layer.is-wide .cat-browse-all__ring {
  width: 48px;
  height: 48px;
}

/* ---- footer: PLAY / PLAY MIX, OWN THIS TOPIC, the no-tickets recovery stack ----------------------------- */
.cat-footer {
  position: relative;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--u));
  padding: calc(12 * var(--u)) calc(26 * var(--u)) calc(28 * var(--u));
  background: #f9f7f3;
}
.cat-sheet-layer.is-wide .cat-footer {
  gap: 10px;
  padding: 10px 24px 22px;
}
.cat-cta.btn {
  --btn-h: max(44px, calc(112 * var(--u)));
  --btn-font: calc(max(15px, calc(46 * var(--u))) * var(--cat-fit, 1));
  width: 100%;
  min-width: 0;
  text-shadow: var(--on-colour-shadow);
}
.cat-sheet-layer.is-wide .cat-cta.btn {
  --btn-h: 62px;
  --btn-font: calc(22px * var(--cat-fit, 1));
}
.cat-cta .btn__icon {
  width: calc(var(--btn-h) * 0.5);
  height: calc(var(--btn-h) * 0.5);
  filter: none;
}
.cat-cta .btn__cost {
  font-size: calc(var(--btn-font) * 1.08);
  letter-spacing: 0.02em;
}
.cat-cta .btn__cost img {
  width: calc(var(--btn-h) * 0.44);
  height: calc(var(--btn-h) * 0.44);
}
.cat-cta--play.btn {
  /* BaseButton pill with a light accent rim (Lerp(accent, white, .48), 6u) over a gentle gradient */
  background: linear-gradient(180deg, color-mix(in srgb, var(--btn-base) 95%, #fff), var(--btn-base) 100%);
  box-shadow:
    0 0 0 max(2px, calc(6 * var(--u))) color-mix(in srgb, var(--btn-base) 52%, #fff),
    0 calc(12 * var(--u)) calc(18 * var(--u)) color-mix(in srgb, var(--btn-base) 55%, transparent);
}
.cat-cta--play.btn:active:not(:disabled) {
  transform: translateY(calc(4 * var(--u)));
}
.cat-cta--play.btn:disabled {
  --btn-base: var(--disabled-face);
}
.cat-cta--ad.btn {
  --btn-h: max(44px, calc(112 * var(--u)));
  --btn-font: calc(max(14px, calc(31 * var(--u))) * var(--cat-fit, 1));
}
.cat-cta--slate.btn {
  --btn-h: max(38px, calc(96 * var(--u)));
  --btn-font: calc(max(12px, calc(31 * var(--u))) * var(--cat-fit, 1));
  gap: calc(12 * var(--u));
  padding: 0 calc(20 * var(--u));
}
.cat-cta--slate.btn .btn__icon {
  width: calc(var(--btn-h) * 0.52);
  height: calc(var(--btn-h) * 0.52);
}
.cat-cta--free.btn {
  --btn-h: max(40px, calc(84 * var(--u)));
  --btn-font: calc(max(13px, calc(28 * var(--u))) * var(--cat-fit, 1));
  text-transform: none;
}
.cat-sheet-layer.is-wide .cat-cta--ad.btn {
  --btn-h: 58px;
  --btn-font: 18px;
}
.cat-sheet-layer.is-wide .cat-cta--slate.btn {
  --btn-h: 52px;
  --btn-font: 16px;
}
.cat-sheet-layer.is-wide .cat-cta--free.btn {
  --btn-h: 46px;
  --btn-font: 16px;
}
.cat-busy {
  width: calc(var(--btn-h) * 0.42);
  height: calc(var(--btn-h) * 0.42);
  border-radius: 50%;
  border: max(3px, calc(8 * var(--u))) solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 800ms linear infinite;
}
.reduced-motion .cat-busy {
  animation-duration: 2400ms;
}

/* OWN THIS TOPIC (gems): soft purple, armed purple, or a grey face when the gems are short */
.cat-own {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(14 * var(--u));
  width: 100%;
  height: max(44px, calc(96 * var(--u)));
  padding: 0 calc(30 * var(--u));
  border-radius: 999px;
  font-weight: var(--w-extrabold);
  font-size: calc(max(13px, calc(31 * var(--u))) * var(--cat-fit, 1));
  letter-spacing: var(--tmp-bold);
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-out);
}
.cat-own__icon {
  width: calc(46 * var(--u));
  min-width: 18px;
  height: calc(46 * var(--u));
  min-height: 18px;
}
.cat-own__cost {
  display: inline-flex;
  align-items: center;
  gap: calc(8 * var(--u));
  font-size: 1.2em;
  letter-spacing: 0.02em;
}
.cat-own__cost img {
  width: calc(42 * var(--u));
  min-width: 16px;
  height: calc(42 * var(--u));
  min-height: 16px;
  object-fit: contain;
}
.cat-own.is-soft {
  background: #efe9f9;
  color: #7b4dbd;
  box-shadow:
    inset 0 0 0 max(2px, calc(5 * var(--u))) rgba(123, 77, 189, 0.22),
    0 calc(8 * var(--u)) calc(12 * var(--u)) rgba(123, 77, 189, 0.16);
}
.cat-own.is-armed {
  background: #7b4dbd;
  color: #fff;
  text-shadow: var(--on-colour-shadow);
  box-shadow:
    inset 0 calc(-6 * var(--u)) 0 #5e3a94,
    0 calc(8 * var(--u)) calc(12 * var(--u)) rgba(123, 77, 189, 0.35);
}
.cat-own.is-locked {
  background: #d2d2d3;
  color: #1b2559;
  box-shadow:
    inset 0 0 0 max(2px, calc(5 * var(--u))) rgba(255, 255, 255, 0.45),
    0 calc(8 * var(--u)) calc(12 * var(--u)) rgba(0, 0, 0, 0.1);
}
.cat-own.is-locked .cat-own__cost {
  color: #f15a46;
}
.cat-own:hover:not(:disabled) {
  filter: brightness(1.03);
}
.cat-own:active:not(:disabled) {
  transform: translateY(calc(3 * var(--u)));
}
.cat-sheet-layer.is-wide .cat-own {
  height: 56px;
  font-size: calc(17px * var(--cat-fit, 1));
}
.cat-caption {
  margin: 0;
  text-align: center;
  font-weight: var(--w-medium);
  font-size: max(12px, calc(25 * var(--u)));
  line-height: 1.3;
  color: #808890;
}
.cat-sheet-layer.is-wide .cat-caption {
  font-size: 15px;
}

/* no tickets: alert card, optional meter, then the stack */
.cat-alert {
  display: flex;
  flex-direction: column;
  gap: calc(9 * var(--u));
  padding: calc(16 * var(--u)) calc(28 * var(--u)) calc(20 * var(--u));
  border-radius: calc(30 * var(--u));
  background: #fdece9;
  box-shadow: inset 0 0 0 max(1px, calc(2 * var(--u))) rgba(224, 68, 58, 0.28);
  text-align: center;
}
.cat-alert__text {
  margin: 0;
  font-weight: var(--w-semibold);
  font-size: max(14px, calc(28 * var(--u)));
  line-height: 1.25;
  color: #ad292e;
}
.cat-alert__meter {
  display: flex;
  flex-direction: column;
  gap: calc(6 * var(--u));
  font-weight: var(--w-semibold);
  font-size: max(11px, calc(20 * var(--u)));
  color: #808890;
}
.cat-alert__track {
  height: max(5px, calc(8 * var(--u)));
  border-radius: 999px;
  background: rgba(3, 28, 38, 0.1);
  overflow: hidden;
}
.cat-alert__track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #0d8439;
}
.cat-stack {
  display: flex;
  flex-direction: column;
  gap: calc(12 * var(--u));
}
.cat-stack__row {
  display: flex;
  gap: calc(20 * var(--u));
}
.cat-stack__row > * {
  flex: 1 1 0;
}
.cat-sheet-layer.is-wide .cat-alert__text {
  font-size: 17px;
}
.cat-sheet-layer.is-wide .cat-alert__meter {
  font-size: 13px;
}
.cat-sheet-layer.is-wide .cat-stack {
  gap: 10px;
}

/* first-time hint (FirstTimeHintView): a navy pill above the PLAY button, gone at a tap */
.cat-hint-pill {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 14 * var(--u));
  z-index: 3;
  width: max-content;
  max-width: calc(100% - 24px);
  padding: calc(18 * var(--u)) calc(44 * var(--u));
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--navy);
  box-shadow: 0 calc(8 * var(--u)) calc(16 * var(--u)) rgba(0, 18, 66, 0.35);
  font-weight: var(--w-medium);
  font-size: max(13px, calc(28 * var(--u)));
  line-height: 1.25;
  text-align: center;
  color: #fff;
  text-shadow: var(--on-colour-shadow);
  animation: pop-in var(--t-med) var(--ease-spring);
}
.cat-hint-pill i {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 12px;
  height: 12px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--navy);
}
.cat-sheet-layer.is-wide .cat-hint-pill {
  padding: 12px 26px;
  font-size: 15px;
}

/* strings authored with runs of spaces (bullets, pass banner, CTA labels) keep them */
.cat-tile__meta,
.cat-hero__text p,
.cat-cta .btn__label,
.cat-pass,
.cat-caption,
.cat-chip {
  white-space: pre-wrap;
}
.cat-chip,
.cat-cta .btn__label {
  white-space: pre;
}

/* keyboard focus: a navy outline reads on the mint backdrop and on white cards (the shared white ring does not) */
.cat-tile:focus-visible,
.cat-rail-card:focus-visible,
.cat-topic:focus-visible,
.cat-browse-all:focus-visible,
.cat-board:focus-visible,
.cat-own:focus-visible,
.cat-toolbar__back:focus-visible,
.cat-rail__arrow:focus-visible,
.cat-search__clear:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
}
.cat-search__input:focus-visible,
.cat-toolbar__input:focus-visible {
  outline: none;
  box-shadow: none;
}
/* a touch phone shows the grey fill and the caret only (the 1.3.0 capture); a pointer-and-keyboard desktop also gets a slim ring */
@media (hover: hover) and (pointer: fine) {
  .cat-search__field:focus-within {
    box-shadow: 0 0 0 2px rgba(0, 18, 66, 0.62);
  }
}
.cat-toolbar__input:focus-visible {
  box-shadow: inset 0 0 0 2px rgba(0, 18, 66, 0.7);
}
.cat-sheet:focus-visible {
  outline: none;
  box-shadow: 0 calc(16 * var(--u)) calc(48 * var(--u)) rgba(0, 0, 0, 0.32);
}
/* The existing preview footer's fixed-pack offer; artwork comes from the shared resource atlas. */
.cat-ticket-offer { display:grid;gap:8px; }
.cat-ticket-offer__quantity { display:flex;justify-content:center;align-items:center;gap:10px;font-size:24px; }
.cat-ticket-offer__quantity img { width:36px;height:36px;object-fit:contain; }
.cat-ticket-offer__extras { display:flex;justify-content:center;gap:16px;list-style:none;margin:0;padding:0; }
.cat-ticket-offer__extras li { display:flex;align-items:center;gap:5px; }
.cat-ticket-offer__extras img { width:28px;height:28px;object-fit:contain; }
