body[data-page="games"] { background: #eef6f8; }

.hall {
  --hall-edge: clamp(10px, 3.2vw, 18px);
  --hall-ink: #0d3446;
  --hall-pill: #e8f2f5;
  max-width: 820px;
  margin-inline: auto;
  color: var(--hall-ink);
}

.hall-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: clamp(160px, 51vw, 250px);
  padding: calc(5px + env(safe-area-inset-top, 0px)) clamp(18px, 6.5vw, 40px) 32px;
  background: radial-gradient(ellipse at 73% 106%, #12c8b1, transparent 58%),
    linear-gradient(170deg, #043540 7%, #045563 53%, #02adad 100%);
  color: #fff;
}
.hall-hero-top { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.hall-hero-brand, .hall-hero-messages { display: grid; place-items: center; min-height: 44px; border-radius: 8px; }
.hall-hero-brand img { display: block; width: clamp(92px, 24vw, 124px); height: auto; }
.hall-hero-messages { position: relative; flex: 0 0 44px; margin-inline-end: -8px; }
.hall-hero-messages .icon { width: 23px; height: 23px; }
.hall-hero-messages i { position: absolute; inset: 11px 10px auto auto; width: 7px; height: 7px; border-radius: 50%; background: #ff4447; }
.hall-hero :focus-visible { outline-color: #a1f6ed; }
.hall-hero-copy { position: relative; z-index: 1; width: 51%; margin-top: clamp(10px, 4vw, 26px); }
.hall-hero-copy h1 { font-size: var(--type-page); font-weight: 800; line-height: 1.2; overflow-wrap: anywhere; }
.hall-hero-copy p { margin-top: 6px; color: #eafafa; font-size: var(--type-label); font-weight: 550; line-height: 1.45; }
.hall-hero-art {
  position: absolute;
  inset: auto 0 8px auto;
  width: min(54%, 310px);
  aspect-ratio: 116 / 87;
  background: url("./photos/hall-compact-reference.png?v=2") no-repeat;
  background-size: calc(22300% / 116) calc(69600% / 87);
  background-position: 100% calc(2200% / (696 - 87));
  mask-image: linear-gradient(to right, transparent, #000 16%), linear-gradient(to bottom, transparent, #000 14% 84%, transparent);
  mask-composite: intersect;
}

.hall-content {
  position: relative;
  margin-top: -10px;
  padding: clamp(8px, 2.4vw, 18px) var(--hall-edge) 14px;
  border-radius: clamp(12px, 6vw, 24px) clamp(12px, 6vw, 24px) 0 0;
  background: linear-gradient(180deg, #f4fafb, #eef6f8 90%);
}
.hall-toolbar {
  display: grid;
  grid-template-columns: minmax(60px, .65fr) minmax(0, 1.3fr) minmax(44px, .5fr);
  gap: clamp(6px, 2.5vw, 14px);
  margin-bottom: clamp(8px, 3vw, 16px);
}
.hall-all, .hall-category select, .hall-search-button {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: var(--hall-pill);
  color: var(--hall-ink);
  font-size: var(--type-label);
  font-weight: 750;
}
.hall-all[aria-pressed="true"], .hall-search-button[aria-expanded="true"] { background: #006777; color: #fff; }
.hall-category { position: relative; min-width: 0; }
.hall-category select {
  appearance: none;
  padding: 0 29px 0 10px;
  text-align: center;
  text-overflow: ellipsis;
  cursor: pointer;
}
.hall-category > .icon {
  position: absolute;
  inset: 50% 13px auto auto;
  width: 14px;
  height: 14px;
  pointer-events: none;
  transform: translateY(-50%) rotate(90deg);
}
.hall-search-button { display: grid; place-items: center; padding: 0; }
.hall-search-button .icon { width: 21px; height: 21px; }
.hall-search { display: flex; align-items: center; gap: 8px; padding-inline: 12px; margin-bottom: 12px; border: 1px solid #b2dcd9; border-radius: 12px; background: #fff; }
.hall-search:focus-within { outline: 2px solid var(--deep-teal); outline-offset: 2px; }
.hall-search .icon { width: 19px; height: 19px; color: var(--deep-teal); }
.hall-search input { min-width: 0; width: 100%; min-height: 44px; padding: 0; border: 0; outline: none; background: none; }

.hall-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(8px, 2vw, 14px); }
.hall-grid > .empty-state { grid-column: 1 / -1; }
.hall-card {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: clamp(4px, 1.2vw, 8px);
  min-width: 0;
  aspect-ratio: .85;
  padding: clamp(6px, 2vw, 13px);
  border-radius: var(--card-radius);
  background: #fbfdfd;
  box-shadow: 0 4px 12px #17475809;
  font-size: var(--type-card);
  font-weight: 750;
  line-height: 1.3;
  text-align: center;
  overflow-wrap: anywhere;
}
.hall-card-copy { max-width: 100%; text-wrap: balance; }
@media (max-width: 1023px) {
  html:not(:lang(zh)) .hall-card-copy { min-height: 2.6em; }
}
.hall-card-art {
  width: 100%;
  max-width: 124px;
  aspect-ratio: 57 / 46;
  border-radius: clamp(7px, 2.35vw, 13px);
  background: #f1f6f7 url("./photos/hall-compact-reference.png?v=2") no-repeat;
  --art-w: 57;
  --art-h: 46;
  background-size: calc(22300% / var(--art-w)) calc(69600% / var(--art-h));
  background-position: calc(var(--art-x) * 100% / (223 - var(--art-w))) calc(var(--art-y) * 100% / (696 - var(--art-h)));
}
.hall-empty { display: grid; justify-items: center; gap: 12px; }
.hall-card-emblem {
  display: grid;
  place-items: center;
  background: radial-gradient(ellipse at 50% 50%, #ddf9fb, #edf7fe 73%, #f9fcfd);
}
.hall-card-emblem > .icon {
  width: 58%;
  height: auto;
  aspect-ratio: 1;
  padding: 9%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 18%, #eaffff, #b5f2ef 38%, #00b8b0 85%);
  box-shadow: 0 5px 14px #008b9529;
  color: #006a73;
}

@media (hover: hover) {
  .hall-hero-brand:hover, .hall-hero-messages:hover { background: #ffffff16; }
  .hall-toolbar button:hover:not([aria-pressed="true"], [aria-expanded="true"]), .hall-category select:hover { background: #d8edf0; }
  .hall-card:hover { box-shadow: 0 7px 20px #0c647828; }
}

@media (max-width: 1023px) {
  body[data-page="games"] .page-scroll { container-type: size; }
  body[data-page="games"] .container { width: 100%; margin-top: 0; }
  .hall {
    --hall-hero-height: clamp(108px, 22cqh, 178px);
    --hall-row-gap: clamp(7px, 1.8vw, 10px);
    /* Reserve the header, controls, and row gaps before sizing four rows. */
    --hall-row-height: clamp(62px, (100cqh - var(--hall-hero-height) - 66px - 3 * var(--hall-row-gap)) / 4, 120px);
  }
  .hall-hero { min-height: var(--hall-hero-height); padding-inline: max(16px, var(--hall-edge)); padding-bottom: clamp(12px, 3cqh, 25px); }
  .hall-hero-copy { margin-top: clamp(4px, 1.7cqh, 18px); }
  .hall-hero-copy p { margin-top: 4px; }
  .hall-hero-art { right: var(--hall-edge); bottom: 8px; width: min(48%, (var(--hall-hero-height) - 20px) * 116 / 87, 218px); }
  .hall-content { padding-top: 8px; }
  .hall-toolbar { margin-bottom: 8px; }
  .hall-grid { row-gap: var(--hall-row-gap); }
  .hall-card { min-height: var(--hall-row-height); aspect-ratio: auto; gap: 4px; padding: 4px; font-size: clamp(.8125rem, 3.5vw, .9375rem); }
  .hall-card-art { width: min(85%, max(30px, var(--hall-row-height) - 38px) * 57 / 46, 88px); }
  html:not(:lang(zh)) .hall-hero-copy { width: 60%; }
  html:not(:lang(zh)) .hall-hero-art { width: min(43%, (var(--hall-hero-height) - 20px) * 116 / 87, 206px); }
  html:not(:lang(zh)) .hall-card-art { width: min(85%, max(24px, var(--hall-row-height) - 47px) * 57 / 46, 88px); }
}

@media (max-width: 379px) {
  .hall-hero-copy h1 { font-size: 1.25rem; }
  .hall-hero-copy p { font-size: .75rem; }
  .hall-card { font-size: .75rem; }
}

@media (min-width: 1024px) {
  .hall { max-width: none; }
  .hall-hero { display: flex; align-items: center; min-height: 160px; padding: 26px 32px; border-radius: var(--card-radius); }
  .hall-hero-top { display: none; }
  .hall-hero-copy { width: 58%; margin: 0; }
  .hall-hero-copy h1 { font-size: clamp(2rem, 3vw, 2.75rem); }
  .hall-hero-copy p { margin-top: 8px; font-size: 1rem; }
  .hall-hero-art {
    inset: 0 0 0 auto; width: 44%; height: 100%; aspect-ratio: auto;
    background: linear-gradient(90deg, #007d7950, transparent), url("./photos/number-cards.webp") center 52% / cover;
    mask-image: linear-gradient(90deg, transparent, black 42%); opacity: .9;
  }
  .hall-content { display: grid; grid-template-columns: minmax(0, 1fr) minmax(250px, 34%); align-items: center; gap: 20px; margin: 0; padding: 20px 0; background: none; }
  .hall-toolbar { grid-template-columns: minmax(72px, auto) minmax(140px, 205px); justify-content: start; gap: 10px; margin: 0; }
  .hall-toolbar .hall-search-button { display: none; }
  .hall-category select { padding-inline: 18px 32px; border: 1px solid #cbdedc; background: #fff; }
  .hall-search { grid-column: 2; grid-row: 1; margin: 0; border-color: #cbdedc; }
  .hall-grid { grid-column: 1 / -1; gap: 12px; }
  .hall-card {
    display: grid; grid-template-columns: auto minmax(0, 1fr) 24px; align-items: center; justify-items: start;
    gap: 14px; min-height: 96px; aspect-ratio: auto;
    padding: 14px; border: 1px solid #d9e6e5; background: #fff; text-align: start; font-size: 1.0625rem;
  }
  .hall-card:hover, .hall-card:focus-visible { border-color: #7bc8c2; }
  .hall-card-art { width: clamp(54px, 5.5vw, 74px); }
  .hall-card-copy { display: grid; min-width: 0; gap: 5px; }
  .hall-card-copy small { display: block; color: #526d75; font-size: .8125rem; font-weight: 500; }
  .hall-card-arrow { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #edf6f4; color: #34766f; }
  .hall-card-arrow .icon { width: 14px; height: 14px; }
}
