:root {
  --catalog-ink: #171323;
  --catalog-paper: #f7f5f1;
  --catalog-purple: #7448f4;
  --catalog-coral: #ff685d;
  --catalog-yellow: #ffd752;
  --catalog-mint: #a8ead1;
  --catalog-line: rgba(23, 19, 35, .12);
  --catalog-muted: #736b7b;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body {
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  color: var(--catalog-ink);
  background: var(--catalog-paper);
  font-family: "Manrope", Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.catalog-page {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 104, 93, .15), transparent 24rem),
    radial-gradient(circle at 8% 36%, rgba(116, 72, 244, .1), transparent 26rem),
    linear-gradient(180deg, #fbfaf7 0%, #f8f5ff 55%, #f7f5f1 100%);
}

.nav-actions a[aria-current="page"] { color: var(--catalog-purple); position: relative; }
.nav-actions a[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -8px;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--catalog-coral);
}

.catalog-main { padding-bottom: 40px; }

.catalog-overline {
  margin: 0 0 18px;
  color: var(--catalog-purple);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .16em;
}

.catalog-section { padding-block: clamp(76px, 8vw, 112px); }
.catalog-section + .catalog-section { border-top: 1px solid var(--catalog-line); }
.catalog-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 56px; margin-bottom: 34px; }
.catalog-section-head h2 { margin: 0; font: 700 clamp(38px, 5vw, 64px)/.96 "Space Grotesk", ui-sans-serif, system-ui, sans-serif; letter-spacing: -.055em; }
.catalog-total-count { color: #77718f; font-size: .58em; letter-spacing: -.04em; white-space: nowrap; }
.catalog-section-head > p { max-width: 440px; margin: 0 0 4px; color: var(--catalog-muted); font-size: 16px; line-height: 1.65; }

.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.games-toolbar { margin: -24px 0 20px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.games-filter-toggle,
.game-filter,
.custom-combobox-trigger {
  min-height: 40px;
  padding: 0 15px;
  color: #625a6a;
  border: 1px solid var(--catalog-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .7);
  font: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
  transition: color .25s ease, border-color .25s ease, background .25s ease, transform .25s ease, box-shadow .25s ease;
}
.games-filter-toggle { display: inline-flex; align-items: center; gap: 9px; }
.games-filter-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--catalog-purple);
  transition: color .25s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.select-chevron {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: var(--catalog-purple);
  transition: color .25s ease, transform .3s cubic-bezier(.22, 1, .36, 1);
}
.games-filter-toggle[aria-expanded="true"] { color: #fff; border-color: var(--catalog-purple); background: var(--catalog-purple); box-shadow: 0 10px 24px rgba(116, 72, 244, .2); }
.games-filter-toggle[aria-expanded="true"] .games-filter-chevron,
.custom-combobox-trigger[aria-expanded="true"] .select-chevron { color: inherit; transform: rotate(180deg); }
.games-filter-toggle:focus-visible,
.game-filter:focus-visible,
.custom-combobox-trigger:focus-visible,
.game-search-box input:focus-visible { outline: 2px solid var(--catalog-purple); outline-offset: 3px; }
.game-filters-collapse { position: relative; z-index: 1; min-width: 0; width: 100%; display: grid; grid-template-rows: 0fr; opacity: 0; visibility: hidden; transition: grid-template-rows .42s cubic-bezier(.22, 1, .36, 1), opacity .22s ease, visibility 0s linear .42s; }
.game-filters-collapse.is-expanded { z-index: 20; grid-template-rows: 1fr; opacity: 1; visibility: visible; transition: grid-template-rows .42s cubic-bezier(.22, 1, .36, 1), opacity .28s ease .05s, visibility 0s; }
.game-filters-collapse-inner { min-width: 0; min-height: 0; overflow: hidden; }
.game-filters-collapse.is-expanded .game-filters-collapse-inner { overflow: visible; }
.game-filters { min-width: 0; width: 100%; max-width: 100%; margin: 0 0 24px; padding: 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid var(--catalog-line); border-radius: 22px; background: rgba(255, 255, 255, .55); }
.game-search-box { min-width: 250px; height: 42px; padding: 0 12px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--catalog-line); border-radius: 14px; background: white; }
.game-search-box > span { color: var(--catalog-purple); font-size: 20px; transform: rotate(-18deg); }
.game-search-box input { min-width: 0; width: 100%; border: 0; outline: 0; color: var(--catalog-ink); background: transparent; font: inherit; font-size: 12px; }
.game-search-box input::placeholder { color: #a099a6; }
.game-search-clear { width: 28px; height: 28px; padding: 0; color: #716978; border: 0; border-radius: 50%; background: #f0ecf3; font-size: 17px; cursor: pointer; }
.game-filter-controls { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.game-filter-buttons { min-width: 0; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.game-filter:hover,
.custom-combobox-trigger:hover { color: var(--catalog-ink); border-color: rgba(116, 72, 244, .32); transform: translateY(-1px); }
.game-filter[aria-pressed="true"] { color: #fff; border-color: var(--catalog-ink); background: var(--catalog-ink); box-shadow: 0 8px 20px rgba(23, 19, 35, .13); }
.custom-combobox { position: relative; }
.custom-combobox-trigger { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.custom-combobox-menu { min-width: 190px; margin: 8px 0 0; padding: 7px; position: absolute; right: 0; z-index: 30; list-style: none; border: 1px solid rgba(116, 72, 244, .18); border-radius: 16px; background: rgba(255, 255, 255, .98); box-shadow: 0 20px 48px rgba(44, 31, 77, .18); }
.custom-combobox-menu[hidden] { display: none; }
.custom-combobox-option { padding: 11px 12px; color: #655d6c; border-radius: 10px; font-size: 12px; font-weight: 700; cursor: pointer; }
.custom-combobox-option:hover,
.custom-combobox-option.is-selected { color: var(--catalog-ink); background: rgba(116, 72, 244, .09); }

.catalog-shelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 42px);
}

.app-tile {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  color: inherit;
  text-decoration: none;
}
.app-tile[hidden] { display: none; }
.app-tile > img {
  width: min(100%, 210px);
  height: auto;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
  border-radius: 28%;
  box-shadow: 0 13px 28px rgba(43, 31, 70, .16);
  transition: transform .3s cubic-bezier(.22, 1, .36, 1), box-shadow .3s ease;
}
.app-tile:hover > img { transform: translateY(-5px) scale(1.025); box-shadow: 0 20px 38px rgba(43, 31, 70, .22); }
.app-placeholder {
  width: min(100%, 210px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: rgba(116, 72, 244, .72);
  border: 1px dashed rgba(116, 72, 244, .34);
  border-radius: 28%;
  background:
    radial-gradient(circle at 72% 24%, rgba(255, 215, 82, .23), transparent 27%),
    linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(116, 72, 244, .11));
  box-shadow: 0 13px 28px rgba(43, 31, 70, .1);
}
.app-placeholder .ui-icon { width: 46px; height: 46px; }
.app-placeholder span { font-size: 10px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.app-tile.is-unavailable { cursor: default; }
.app-tile strong { width: 100%; margin-top: 17px; overflow: hidden; color: var(--catalog-ink); font: 600 clamp(16px, 1.6vw, 21px)/1.25 "Manrope", ui-sans-serif, system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; }
.app-tile small { width: 100%; margin-top: 6px; overflow: hidden; color: var(--catalog-muted); font-size: 12px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.app-status { margin-top: 8px; display: inline-flex; align-items: center; gap: 6px; color: #736b7b; font-size: 10px; font-weight: 750; }
.app-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.app-status.is-live { color: #16836b; }
.app-status.is-soon { color: #9a7417; }
.catalog-empty { padding: 44px; color: var(--catalog-muted); border: 1px dashed var(--catalog-line); border-radius: 24px; text-align: center; }

@media (max-width: 900px) {
  .catalog-section-head { align-items: flex-start; flex-direction: column; gap: 20px; }
  .game-filters { align-items: stretch; flex-direction: column; }
  .game-search-box { min-width: 0; width: 100%; }
  .game-filter-controls { width: 100%; justify-content: flex-start; }
  .game-filter-buttons { justify-content: flex-start; }
  .catalog-shelf { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .catalog-section { padding-block: 56px 72px; }
  .catalog-section-head { margin-bottom: 26px; }
  .catalog-section-head > p { font-size: 14px; }
  .games-toolbar { margin-top: -12px; }
  .game-filters { margin-bottom: 18px; padding: 14px; border-radius: 18px; }
  .game-search-box,
  .game-filter-buttons { min-width: 0; width: 100%; max-width: 100%; }
  .game-filter-controls { align-items: stretch; flex-direction: column; gap: 14px; }
  .game-filter-buttons { justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; padding: 2px 2px 7px; scrollbar-width: none; }
  .game-filter-buttons::-webkit-scrollbar { display: none; }
  .game-filter { flex: none; }
  .custom-combobox { width: 100%; }
  .custom-combobox-trigger { width: 100%; justify-content: space-between; }
  .custom-combobox-menu { width: 100%; min-width: 0; max-height: min(260px, 42vh); position: static; overflow-y: auto; }
  .catalog-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .app-tile > img,
  .app-placeholder { width: 100%; border-radius: 26%; }
  .app-tile strong { margin-top: 13px; font-size: 16px; }
  .app-tile small { font-size: 10px; }
}

@media (max-width: 370px) {
  .game-filter,
  .custom-combobox-trigger { min-height: 38px; padding-inline: 12px; font-size: 10px; }
  .catalog-shelf { gap: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .game-filters-collapse,
  .game-filter,
  .custom-combobox-trigger,
  .app-tile > img { transition-duration: .01ms !important; }
}
