/* Standalone game index; uses the site's container, typography and palette. */
.page-games .games-directory { min-width: 0; padding: 32px 0 80px; color: var(--text-primary); }
.games-directory, .games-directory * { box-sizing: border-box; }
.games-directory__intro h1 { margin: 0; font-size: 30px; font-weight: 800; line-height: 1.2; letter-spacing: -.6px; }
.games-directory__intro p { max-width: 700px; margin: 10px 0 0; font-size: 14px; line-height: 21px; color: var(--text-muted); }
.games-directory__search-area { margin-top: 26px; }
.games-directory__search { display: flex; align-items: center; gap: 10px; width: min(100%, 520px); height: 44px; padding: 0 14px; border: 1px solid #dfe3eb; border-radius: 12px; background: #fff; color: #838c9f; transition: border-color 150ms ease, box-shadow 150ms ease; }
.games-directory__search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--ring); }
.games-directory__search svg { flex: none; }
.games-directory__search input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text-primary); font: inherit; font-size: 14px; }
.games-directory__search input::-webkit-search-cancel-button { display: none; }
.games-directory__search input::placeholder { color: #9aa3b2; }
.games-directory__clear { display: grid; place-items: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: 7px; background: transparent; color: #8a94a5; font-size: 23px; cursor: pointer; }
.games-directory__clear[hidden] { display: none; }
.games-directory__clear:hover { background: #f0f2f7; color: #626d81; }
.games-directory__count { margin: 14px 0 0; color: #64748b; font-size: 12px; line-height: 18px; }
.games-directory__layout { display: grid; grid-template-columns: 48px minmax(0,1fr); gap: 24px; align-items: start; margin-top: 28px; min-width: 0; }
.games-directory__alphabet { position: sticky; top: calc(var(--games-header-offset, 0px) + 16px); width: 48px; max-height: calc(100dvh - var(--games-header-offset,0px) - 24px); min-height: 0; }
.games-directory__alphabet-scroll { max-height: inherit; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #dde1e9 transparent; }
.games-directory__alphabet-set { display: grid; gap: 0; justify-items: start; }
.games-directory__alphabet-set + .games-directory__alphabet-set { margin-top: 9px; padding-top: 9px; border-top: 1px solid #e9ebf0; }
.games-directory__alphabet-set a { display: grid; place-items: center; width: 34px; height: 22px; border-radius: 7px; color: #626d81; font-size: 12px; font-weight: 600; line-height: 1; text-decoration: none; }
.games-directory__alphabet-set a:hover { background: #f0f2f7; color: #626d81; }
.games-directory__alphabet-set a.is-active { background: var(--primary-soft); color: var(--primary); }
.games-directory__alphabet-mode { display: none; }
.games-directory__groups { min-width: 0; }
.games-directory__group { min-width: 0; scroll-margin-top: calc(var(--games-header-offset,0px) + 24px); }
.games-directory__group + .games-directory__group { margin-top: 34px; }
.games-directory__group.is-first-visible { margin-top: 0; }
.games-directory__alphabet[hidden] { display: none; }
.games-directory__group h2 { margin: 0 0 14px; font-size: 20px; font-weight: 750; line-height: 26px; }
.games-directory__grid { display: grid; grid-template-columns: repeat(8,minmax(0,1fr)); column-gap: 14px; row-gap: 16px; min-width: 0; }
.games-directory__cell { min-width: 0; }
.games-directory__game { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; min-height: 108px; padding: 8px 4px; color: var(--text-primary); border-radius: 12px; text-decoration: none; text-align: center; transition: background-color 140ms ease; }
.games-directory__game:hover, .games-directory__game:focus-visible { background: #e9ecf2; color: var(--text-primary); }
.games-directory__icon { display: grid; flex: none; place-items: center; width: 58px; height: 58px; border: 1px solid #e4e7ec; border-radius: 13px; background: #fff; overflow: hidden; }
.games-directory__icon img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.games-directory__icon img[hidden] { display: none; }
.games-directory__fallback { display: grid; place-items: center; width: 100%; height: 100%; color: #9aa4b6; font-size: 26px; }
.games-directory__fallback[hidden] { display: none; }
.games-directory__name { display: -webkit-box; max-width: 100%; overflow: hidden; overflow-wrap: anywhere; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 12px; line-height: 16px; font-weight: 650; }
.games-directory__no-results { padding: 30px 0; }
.games-directory__no-results[hidden], .games-directory__group[hidden], .games-directory__cell[hidden], .games-directory__alphabet-set a[hidden], .games-directory__alphabet-set[hidden] { display: none !important; }
.games-directory__no-results strong { font-size: 16px; }
.games-directory__no-results p { margin: 8px 0 18px; color: var(--text-muted); font-size: 14px; }
.games-directory__no-results button { border: 1px solid #dde1e9; background: #f0f2f7; color: #626d81; border-radius: 11px; padding: 10px 14px; cursor: pointer; font-weight: 600; }
.games-directory :where(a,button):focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
@media (max-width: 1279px) { .games-directory__grid { grid-template-columns: repeat(7,minmax(0,1fr)); } .games-directory__icon { width: 56px; height: 56px; } }
@media (max-width: 1130px) { .games-directory__grid { grid-template-columns: repeat(6,minmax(0,1fr)); } .games-directory__layout { gap: 20px; } }
@media (max-width: 1023px) { .games-directory__intro h1 { font-size: 27px; } .games-directory__layout { grid-template-columns: 40px minmax(0,1fr); gap: 16px; } .games-directory__alphabet { width: 40px; } .games-directory__grid { grid-template-columns: repeat(5,minmax(0,1fr)); } .games-directory__icon { width: 54px; height: 54px; } }
@media (max-width: 767px) {
  .page-games .games-directory { padding: 22px 0 64px; }
  .games-directory__intro h1 { font-size: 25px; }
  .games-directory__layout { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
  .games-directory__alphabet { z-index: 3; width: 100%; top: var(--games-header-offset,0px); max-height: none; padding: 8px 0 6px; background: var(--surface-page); border-bottom: 1px solid #e5e7eb; }
  .games-directory__alphabet-mode { display: flex; gap: 6px; margin-bottom: 5px; }
  .games-directory__alphabet-mode button { min-width: 56px; min-height: 36px; padding: 0 12px; border: 1px solid #dde1e9; border-radius: 10px; background: #f0f2f7; color: #626d81; font-size: 12px; font-weight: 650; cursor: pointer; }
  .games-directory__alphabet-mode button[aria-pressed="true"] { background: var(--primary-soft); border-color: #dac6fc; color: var(--primary); }
  .games-directory__alphabet-scroll { display: flex; gap: 12px; width: 100%; max-height: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
  .games-directory__alphabet-scroll::-webkit-scrollbar { display: none; }
  .games-directory__alphabet-set { flex: none; display: flex; gap: 1px; }
  .games-directory__alphabet-set + .games-directory__alphabet-set { padding: 0; margin: 0; border: 0; }
  .games-directory__alphabet-set a { width: 36px; height: 40px; font-size: 13px; }
  .games-directory--enhanced .games-directory__alphabet-set[data-games-alphabet-set][hidden] { display: none !important; }
  .games-directory__groups { width: 100%; }
  .games-directory__grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px 10px; }
  .games-directory__icon { width: 52px; height: 52px; }
}
@media (max-width: 479px) {
  .page-games .games-directory { padding-top: 20px; }
  .games-directory__intro h1 { font-size: 24px; }
  .games-directory__search { height: 42px; }
  .games-directory__grid { grid-template-columns: repeat(3,minmax(0,1fr)); column-gap: 8px; row-gap: 10px; }
  .games-directory__icon { width: 48px; height: 48px; }
  .games-directory__game { min-height: 100px; }
  .games-directory__name { font-size: 11px; line-height: 15px; }
  .games-directory__alphabet-set a { min-width: 40px; width: 40px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .games-directory__search, .games-directory__game { transition: none; }
}

/*
 * /games compact layout v3.
 * Spacious per-letter game tiles, centered flat search,
 * sticky alphabet without a visible scrollbar.
 */
.page-games .games-directory {
  min-width: 0;
  padding: 0 0 64px;
  color: var(--text-primary);
}
.games-directory__intro p { margin-top: 7px; }
.games-directory__search-area { margin-top: 8px; }
.games-directory__count { margin: 9px 0 0; }
.games-directory__search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(100%, 520px);
  height: 36px;
  padding: 0;
  border: 0 !important;
  border-bottom: 1px solid #d7ddea !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #838c9f;
}
.games-directory__search:focus-within {
  border-bottom-color: var(--primary) !important;
  box-shadow: none !important;
}
.games-directory__search svg {
  flex: 0 0 auto;
  align-self: center;
  display: block;
  width: 17px;
  height: 17px;
}
.games-directory__search input,
.games-directory__search input:hover,
.games-directory__search input:focus,
.games-directory__search input:active {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  height: 34px !important;
  min-height: 0 !important;
  max-height: 34px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 34px !important;
  font-size: 14px !important;
  font-weight: 400;
  border: 0 !important;
  outline: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  transform: none !important;
  appearance: none;
  -webkit-appearance: none;
}
.games-directory__clear:hover { background: transparent; }
.games-directory__grid {
  display: grid;
  /* Fixed-width tracks avoid distributing excess space between game icons. */
  grid-template-columns: repeat(auto-fill, minmax(106px, 1fr));
  column-gap: 12px;
  row-gap: 15px;
  align-items: start;
  min-width: 0;
}
.games-directory__cell { min-width: 0; }
.games-directory__game {
  position: relative;
  min-height: 122px;
  gap: 8px;
  padding: 7px 4px;
}
.games-directory__icon { width: 64px; height: 64px; border-radius: 14px; }
.games-directory__name {
  font-size: 14px;
  line-height: 18px;
  font-weight: 650;
}
.games-directory__alphabet-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.games-directory__alphabet-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}
.games-directory__alphabet-set + .games-directory__alphabet-set {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #e9ebf0;
}
.games-directory__alphabet-set a {
  background: transparent !important;
  font-size: 14px;
  font-weight: 600;
  color: #687387;
  transition: color 120ms ease;
}
.games-directory__alphabet-set a:hover,
.games-directory__alphabet-set a:focus-visible,
.games-directory__alphabet-set a.is-active,
.games-directory__alphabet-set a[aria-current="location"] {
  color: #7028f5 !important;
  background: transparent !important;
}
.games-directory__alphabet-set a.is-active,
.games-directory__alphabet-set a[aria-current="location"] {
  font-weight: 800;
}
@media (prefers-reduced-motion: reduce) {
  .games-directory__alphabet-set a { transition: none; }
}
@media (min-width: 768px) {
  .page-games .games-directory {
    display: grid;
    grid-template-columns: 27px minmax(0, 1fr);
    column-gap: 12px;
    padding-top: 0;
  }
  .games-directory__layout { display: contents; }
  .games-directory__intro {
    grid-column: 2;
    grid-row: 1;
  }
  .games-directory__search-area {
    grid-column: 2;
    grid-row: 2;
    margin-top: 8px;
  }
  .games-directory__groups {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    margin-top: 8px;
  }
  .games-directory__alphabet {
    position: sticky;
    grid-column: 1;
    grid-row: 1 / 4;
    align-self: start;
    top: calc(var(--games-header-offset, 0px) + 5px);
    width: 27px;
    min-height: 0;
    max-height: calc(100dvh - var(--games-header-offset, 0px) - 10px);
  }
  .games-directory__alphabet-scroll {
    max-height: inherit;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
  }
  .games-directory__alphabet-set { justify-items: start; }
  .games-directory__alphabet-set a,
  .games-directory__alphabet-set a:hover {
    width: 27px;
    /* A little breathing room; vertical wheel scroll covers shorter screens. */
    height: 19px;
    border-radius: 0;
    line-height: 1;
  }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .games-directory__grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); column-gap: 10px; row-gap: 13px; }
  .games-directory__icon { width: 58px; height: 58px; }
  .games-directory__game { min-height: 116px; }
  .games-directory__name { font-size: 13px; line-height: 17px; }
}
@media (max-width: 767px) {
  .page-games .games-directory { padding-top: 8px; }
  .games-directory__layout { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
  .games-directory__alphabet {
    width: 100%;
    max-height: none;
  }
  .games-directory__alphabet-set a { width: 36px; height: 40px; font-size: 14px; }
  .games-directory__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 9px;
    row-gap: 12px;
  }
  .games-directory__game { min-height: 112px; padding: 5px 2px; gap: 6px; }
  .games-directory__icon { width: 54px; height: 54px; }
  .games-directory__name { font-size: 13px; line-height: 17px; }
}
@media (max-width: 479px) {
  .page-games .games-directory { padding-top: 8px; }
  .games-directory__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .games-directory__icon { width: 52px; height: 52px; }
  .games-directory__name { font-size: 12.5px; line-height: 16px; }
}

/* Per-letter sections with explicit readable headings.
 * Keep the compact 88px grid and independent sticky alphabet. */
.games-directory__group {
  min-width: 0;
  scroll-margin-top: calc(var(--games-header-offset, 0px) + 12px);
}
.games-directory__group + .games-directory__group {
  margin-top: 20px;
}
.games-directory__group.is-first-visible {
  margin-top: 0;
}
@media (max-width: 767px) {
  .games-directory__group + .games-directory__group {
    margin-top: 16px;
  }
}

/* A clear visual break between groups, without increasing card gaps. */
.games-directory__group .games-directory__group-heading {
  display: block;
  margin: 0 0 10px;
  padding: 0;
  color: var(--text-primary);
  font-size: 25px;
  font-weight: 800;
  line-height: 30px;
  letter-spacing: -0.4px;
}
.games-directory__group + .games-directory__group {
  margin-top: 24px;
}
@media (max-width: 767px) {
  .games-directory__group .games-directory__group-heading {
    font-size: 22px;
    line-height: 28px;
    margin-bottom: 9px;
  }
  .games-directory__group + .games-directory__group {
    margin-top: 20px;
  }
}
