/* Games lobby — match wallet / account (gold hero + dark sheet) */

:root {
  --wx-gold: #d9ac4f;
  --wx-gold-soft: #fae59f;
  --wx-gold-deep: #c4933f;
  --wx-ink: #1a1205;
  --wx-bg: #1a1a1a;
  --wx-panel: #2c2c2c;
  --wx-sheet: #292929;
  --wx-muted: rgba(255, 255, 255, 0.55);
  --wx-line: rgba(255, 255, 255, 0.06);
  --wx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --wx-press: 0.97;
  --wx-dur: 0.14s;
}

/* App shell：与首页一致 —— margin 居中，勿用 body flex（会打乱顶栏/弹层） */
html:has(body.wxgame-app),
body.wxgame-app {
  height: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  background: #090909 !important;
}

body.wxgame-app {
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
  overflow-x: hidden;
}

body.wxgame-app #app {
  width: 100%;
  max-width: 10rem;
  min-width: 0;
  min-height: 100vh;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
  background: var(--wx-bg);
}

/* Tabbar width/position: global app_shell.css (match home 10rem) */

body.wxgame-app .nav {
  position: static !important;
  height: 0 !important;
  overflow: visible !important;
}

.wx-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 100vh;
  background: var(--wx-bg) !important;
  padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  overflow-x: hidden;
  font-family: Roboto, Inter, system-ui, sans-serif;
}

/* —— Gold curved header + expand-left search —— */
.wx-hero {
  --wx-search-expand: 0.18s;
  --wx-search-ease: cubic-bezier(0.2, 0.9, 0.3, 1);
  position: relative;
  z-index: 1;
  overflow: visible;
  height: 105px;
  min-height: 1.55rem;
  padding: 0.32rem 0.36rem 1.5rem;
  border-radius: 0 0 0.8rem 0.8rem;
  background:
    radial-gradient(ellipse 70% 90% at 12% 0%, rgba(255, 248, 220, 0.55), transparent 55%),
    linear-gradient(105deg, #b8862e 0%, #d9ac4f 42%, #fae59f 100%);
}

.wx-hero::after {
  content: "";
  position: absolute;
  right: -0.4rem;
  top: -0.8rem;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.28) 0%, transparent 68%);
  pointer-events: none;
}

.wx-hero.is-search-open {
  z-index: 5;
  overflow: visible;
}

.wx-hero__nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  min-height: 1rem;
}

/* Western casino lobby title — left aligned */
.wx-hero__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.06rem;
  padding: 0.02rem 0 0.02rem 0.18rem;
  border-left: 0.05333rem solid rgba(90, 52, 8, 0.55);
  box-shadow: inset 0.04rem 0 0 rgba(255, 255, 255, 0.28);
  transition:
    opacity 0.14s ease,
    transform var(--wx-search-expand) var(--wx-search-ease),
    flex-basis var(--wx-search-expand) var(--wx-search-ease),
    padding var(--wx-search-expand) var(--wx-search-ease),
    border-color 0.12s ease;
}

.wx-hero__eyebrow {
  font-size: 0.18667rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(90, 52, 8, 0.58);
  line-height: 1;
}

.wx-hero__title-text {
  display: block;
  font-family: Georgia, "Times New Roman", "Palatino Linotype", serif;
  font-size: 0.48rem;
  font-weight: 700;
  font-style: italic;
  color: var(--wx-ink);
  letter-spacing: 0.01em;
  line-height: 1;
  text-shadow: 0 0.02rem 0 rgba(255, 255, 255, 0.35);
}

.wx-hero.is-search-open .wx-hero__title {
  opacity: 0;
  transform: translateX(-0.24rem);
  flex: 0 0 0;
  min-width: 0;
  max-width: 0;
  padding: 0;
  border-color: transparent;
  overflow: hidden;
  pointer-events: none;
}

/* Search button → expands into input field */
.wx-search {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.08rem;
  width: auto;
  height: 0.72rem;
  margin: 0 0 0 auto;
  padding: 0;
  border-radius: 0.72rem;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: hidden;
  flex: 0 0 auto;
  transition:
    width var(--wx-search-expand) var(--wx-search-ease),
    flex var(--wx-search-expand) var(--wx-search-ease),
    height var(--wx-search-expand) var(--wx-search-ease),
    background 0.14s ease,
    border-color 0.14s ease,
    box-shadow 0.14s ease,
    padding 0.14s ease,
    border-radius 0.14s ease;
}

.wx-hero.is-search-open .wx-search {
  width: 100%;
  flex: 1 1 auto;
  height: 0.8rem;
  padding: 0 0.1rem 0 0.08rem;
  border-radius: 0.8rem;
  background: rgba(255, 252, 245, 0.92);
  border: 1px solid rgba(90, 52, 8, 0.2);
  box-shadow:
    0 0.08rem 0.22rem rgba(143, 82, 6, 0.16),
    inset 0 0.02rem 0 rgba(255, 255, 255, 0.75);
}

.wx-search__toggle {
  height: 0.72rem;
  margin: 0;
  padding: 0 0.24rem 0 0.2rem;
  border: 1px solid rgba(90, 52, 8, 0.28);
  border-radius: 0.72rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 248, 220, 0.28) 100%);
  box-shadow:
    0 0.04rem 0.12rem rgba(143, 82, 6, 0.14),
    inset 0 0.02rem 0 rgba(255, 255, 255, 0.55);
  color: var(--wx-ink);
  font-size: 0.28rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  cursor: pointer;
  transition:
    transform var(--wx-dur) var(--wx-ease),
    background 0.12s,
    border-color 0.12s,
    box-shadow 0.12s,
    padding 0.12s,
    height 0.12s,
    width 0.12s;
}

.wx-search__toggle-label {
  font-size: 0.25333rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--wx-ink);
  line-height: 1;
  white-space: nowrap;
  max-width: 2.4rem;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-search__toggle:active {
  transform: scale(var(--wx-press));
}

.wx-hero.is-search-open .wx-search__toggle {
  pointer-events: none;
  height: 0.64rem;
  width: 0.64rem;
  flex: 0 0 0.64rem;
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  color: rgba(90, 52, 8, 0.5);
  font-size: 0.3rem;
}

.wx-hero.is-search-open .wx-search__toggle-label {
  display: none;
}

.wx-search__input {
  flex: 1;
  min-width: 0;
  width: 0;
  opacity: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--wx-ink);
  font-size: 0.32rem;
  font-weight: 600;
  padding: 0 0.04rem;
  transition: opacity 0.1s ease 0.04s;
  -webkit-appearance: none;
  appearance: none;
}

.wx-hero.is-search-open .wx-search__input {
  opacity: 1;
  width: auto;
}

.wx-search__input::placeholder {
  color: rgba(90, 52, 8, 0.38);
  font-weight: 500;
}

.wx-search__input::-webkit-search-decoration,
.wx-search__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.wx-search__clear,
.wx-search__close {
  flex: 0 0 auto;
  width: 0.5rem;
  height: 0.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(90, 52, 8, 0.1);
  color: var(--wx-ink);
  font-size: 0.26rem;
  line-height: 1;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.wx-hero.is-search-open .wx-search__close {
  display: flex;
}

.wx-hero.is-search-open .wx-search__clear:not([hidden]) {
  display: flex;
}

.wx-search__clear:active,
.wx-search__close:active {
  transform: scale(var(--wx-press));
  background: rgba(90, 52, 8, 0.18);
}

/* Popup: appears together with expand */
.wx-search-layer {
  position: absolute;
  left: 0.36rem;
  right: 0.36rem;
  top: 1.36rem;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-0.08rem);
  transition:
    opacity 0.16s ease,
    transform 0.18s var(--wx-search-ease);
}

.wx-hero.is-search-open .wx-search-layer {
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

.wx-search-layer__card {
  background: #2a2a2a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0.32rem;
  box-shadow: 0 0.2rem 0.56rem rgba(0, 0, 0, 0.42);
  padding: 0.24rem 0.24rem 0.18rem;
  max-height: min(52vh, 7.2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.wx-search-panel__block {
  padding: 0.06rem 0 0.18rem;
}

.wx-search-panel__block + .wx-search-panel__block {
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  padding-top: 0.18rem;
  margin-top: 0.02rem;
}

.wx-search-panel__block:last-child {
  padding-bottom: 0.02rem;
}

.wx-search-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.2rem;
  margin-bottom: 0.14rem;
  font-size: 0.26667rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.55);
}

.wx-search-panel__head span {
  display: inline-flex;
  align-items: center;
  gap: 0.1rem;
}

.wx-search-panel__head span::before {
  content: "";
  width: 0.08rem;
  height: 0.22rem;
  border-radius: 0.04rem;
  background: linear-gradient(180deg, var(--wx-gold-soft), var(--wx-gold-deep));
}

.wx-search-panel__link {
  border: 0;
  background: transparent;
  color: var(--wx-gold);
  font-size: 0.24rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.04rem 0;
}

.wx-search-panel__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.12rem;
}

.wx-search-panel__tag {
  border: 0;
  border-radius: 0.2rem;
  padding: 0.1rem 0.2rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid transparent;
  color: rgba(255, 255, 255, 0.88);
  font-size: 0.25333rem;
  font-weight: 600;
  cursor: pointer;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background var(--wx-dur), border-color var(--wx-dur), color var(--wx-dur), transform var(--wx-dur);
}

.wx-search-panel__tag:active {
  transform: scale(var(--wx-press));
  background: rgba(217, 172, 79, 0.2);
  border-color: rgba(217, 172, 79, 0.35);
  color: var(--wx-gold-soft);
}

.wx-search-panel__empty {
  display: none;
  font-size: 0.25333rem;
  color: rgba(255, 255, 255, 0.32);
  padding: 0.06rem 0 0.02rem;
}

.wx-search-panel__empty.is-show {
  display: block;
}

/* Dim content while search layer is open */
.wx-page.is-search-open .wx-sheet {
  filter: brightness(0.52);
  transition: filter 0.16s ease;
  pointer-events: none;
}

/* —— Content sheet sits on top of gold (same as wallet-box) —— */
.wx-sheet {
  position: relative;
  z-index: 2;
  margin-top: -1.06667rem;
  padding: 0 0.4rem 0.4rem;
  min-width: 0;
  max-width: 100%;
  overflow-x: clip;
  animation: wxIn 0.4s var(--wx-ease) both;
  transition: filter 0.28s var(--wx-ease);
}

.wx-sheet__meta {
  display: none;
}

.wx-sheet__panel {
  background: var(--wx-panel);
  border-radius: 0.4rem;
  border: 0.01333rem solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0.10667rem 0.48rem rgba(0, 0, 0, 0.22);
  padding: 0.28rem 0.28rem 0.24rem;
  margin-bottom: 0.32rem;
}

.wx-hall__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.08rem;
  background: rgba(0, 0, 0, 0.22);
  border-radius: 0.26667rem;
  padding: 0.08rem;
  margin-bottom: 0.14rem;
}

.wx-hall__chips:last-child {
  margin-bottom: 0;
}

.wx-hall__chip {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: var(--wx-muted);
  max-width: none;
  padding: 0.12rem 0.22rem;
  height: auto;
  min-height: 0.64rem;
  line-height: 1.2;
  font-size: 0.28rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  white-space: nowrap;
  overflow: visible;
  border-radius: 0.2rem;
  transition: color var(--wx-dur), background var(--wx-dur), transform var(--wx-dur);
}

.wx-hall__chip:active { transform: scale(var(--wx-press)); }

.wx-hall__chip.active {
  color: var(--wx-ink);
  font-weight: 700;
  background: linear-gradient(90deg, var(--wx-gold-deep) 0%, var(--wx-gold-soft) 100%);
  box-shadow: 0 0.06rem 0.18rem rgba(196, 147, 63, 0.28);
}

.wx-hall__section {
  margin-bottom: 0.2rem;
  min-width: 0;
  max-width: 100%;
  animation: wxIn 0.4s var(--wx-ease) both;
}

.wx-hall__section:nth-of-type(2) { animation-delay: 0.05s; }

.wx-hall__section-head {
  display: flex;
  align-items: center;
  margin: 0.12rem 0 0.24rem;
  color: #fff;
  font-size: 0.37333rem;
  font-weight: 700;
}

.wx-hall__section-head:before {
  content: "";
  display: block;
  width: 0.08rem;
  height: 0.37333rem;
  margin-right: 0.14rem;
  border-radius: 0.04rem;
  background: linear-gradient(180deg, var(--wx-gold-soft), var(--wx-gold-deep));
}

.wx-hall__section-head h2 {
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  flex: 1;
}

.wx-hall__section-head small {
  color: var(--wx-muted);
  font-size: 0.26rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 0.2rem;
  padding: 0.04rem 0.14rem;
}

/* Hot: 4 cols, wrap; cards smaller than 全部游戏 (3 cols) */
.wx-hall__hot {
  --hot-gap: 0.14rem;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.04rem 0 0.12rem;
  overflow: visible;
}

.wx-hall__hot-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--hot-gap);
  width: 100%;
  box-sizing: border-box;
}

.wx-hall__hot .wx-card {
  width: 100%;
  max-width: none;
  border-radius: 0.24rem;
  box-shadow: 0 0.05rem 0.16rem rgba(0, 0, 0, 0.2);
}

.wx-hall__hot .wx-card__hot {
  font-size: 0.16rem;
  padding: 0.02rem 0.08rem;
  top: 0.06rem;
  left: 0.06rem;
  border-radius: 0.08rem;
}

.wx-hall__hot .wx-card__name {
  padding: 0.1rem 0.06rem 0.12rem;
  font-size: 0.2rem;
}

.wx-hall__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem;
}

.wx-card {
  position: relative;
  background: var(--wx-panel);
  border-radius: 0.32rem;
  overflow: hidden;
  text-align: center;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 0.08rem 0.24rem rgba(0, 0, 0, 0.22);
  transition: transform var(--wx-dur) var(--wx-ease), border-color var(--wx-dur), box-shadow var(--wx-dur);
}

.wx-card:active {
  transform: scale(var(--wx-press));
  border-color: rgba(217, 172, 79, 0.4);
  box-shadow: 0 0.06rem 0.2rem rgba(196, 147, 63, 0.22);
}

.wx-card__cover {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #111;
  overflow: hidden;
}

/* Vendor icons often ship with baked rounded corners + black padding;
   scale slightly so the art fills the card flush (no double-radius / dirty edges). */
.wx-card__cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transform: scale(1.08);
  transform-origin: center;
  transition: transform 0.35s var(--wx-ease);
}

.wx-card:active .wx-card__cover img {
  transform: scale(1.12);
}

.wx-card__hot {
  position: absolute;
  top: 0.1rem;
  left: 0.1rem;
  z-index: 2;
  font-size: 0.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--wx-ink);
  background: linear-gradient(90deg, var(--wx-gold-deep), var(--wx-gold-soft));
  border-radius: 0.1rem;
  padding: 0.04rem 0.12rem;
  line-height: 1.3;
  box-shadow: 0 0.04rem 0.12rem rgba(0, 0, 0, 0.3);
}

.wx-card__name {
  padding: 0.16rem 0.1rem 0.18rem;
  font-size: 0.26rem;
  line-height: 1.25;
  color: #f2f2f2;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wx-hall__more,
.wx-hall__retry {
  display: block;
  width: 100%;
  margin: 0.36rem 0 0.12rem;
  border: 0;
  background: linear-gradient(90deg, var(--wx-gold-deep) 0%, var(--wx-gold-soft) 100%);
  color: var(--wx-ink);
  border-radius: 0.32rem;
  padding: 0.28rem;
  font-size: 0.34667rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0.08rem 0.26667rem rgba(196, 147, 63, 0.28);
  transition: transform var(--wx-dur) var(--wx-ease), filter var(--wx-dur);
}

.wx-hall__more:active,
.wx-hall__retry:active {
  transform: scale(var(--wx-press));
  filter: brightness(1.04);
}

.wx-hall__more:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}

.wx-hall__state {
  padding: 1.2rem 0.4rem;
  text-align: center;
  color: var(--wx-muted);
  font-size: 0.32rem;
}

.wx-hall__state strong {
  display: block;
  color: var(--wx-gold);
  font-size: 0.4rem;
  margin-bottom: 0.16rem;
}

.wx-hall__state-ico {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0 auto 0.24rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(217, 172, 79, 0.12);
  border: 1px solid rgba(217, 172, 79, 0.28);
  color: var(--wx-gold);
  font-size: 0.48rem;
}

.wx-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.78);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.24rem;
  color: var(--wx-gold-soft);
  font-size: 0.34667rem;
  backdrop-filter: blur(2px);
}

.wx-overlay.show { display: flex; }

.wx-overlay__spin {
  width: 0.72rem;
  height: 0.72rem;
  border: 0.05333rem solid rgba(250, 229, 159, 0.2);
  border-top-color: var(--wx-gold-soft);
  border-radius: 50%;
  animation: wx-spin 0.7s linear infinite;
}

@keyframes wx-spin {
  to { transform: rotate(360deg); }
}

@keyframes wxIn {
  from {
    opacity: 0;
    transform: translateY(0.2rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Play page */
.wx-play {
  min-height: 100vh;
  background: var(--wx-bg);
  color: #fff;
  font-family: Roboto, Inter, system-ui, sans-serif;
}

.wx-play .navbar[data-v-106b99c8] {
  width: 100%;
  max-width: 10rem;
  top: 0;
  height: 1.33333rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  color: var(--wx-ink);
  background:
    radial-gradient(ellipse 70% 90% at 12% 0%, rgba(255, 248, 220, 0.45), transparent 55%),
    linear-gradient(105deg, #b8862e 0%, #d9ac4f 42%, #fae59f 100%);
  box-shadow: 0 0.08rem 0.24rem rgba(0, 0, 0, 0.2);
}

.wx-play .navbar-title[data-v-106b99c8] {
  font-size: 0.4rem;
  flex: 1;
  text-align: center;
  font-weight: 800;
  color: var(--wx-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 1.2rem;
}

.wx-play .navbar-left[data-v-106b99c8],
.wx-play .navbar-right[data-v-106b99c8] {
  position: absolute;
  top: 0;
  bottom: 0;
  padding: 0 0.26667rem;
  display: flex;
  align-items: center;
}

.wx-play .navbar-left[data-v-106b99c8] { left: 0; }
.wx-play .navbar-right[data-v-106b99c8] { right: 0; }
.wx-play .navbar-left i { color: var(--wx-ink) !important; }

.wx-play__body { padding-top: 1.33333rem; }

.wx-play__error {
  display: none;
  padding: 1.6rem 0.4rem;
  text-align: center;
  color: var(--wx-muted);
  font-size: 0.34667rem;
  animation: wxIn 0.3s var(--wx-ease) both;
}

.wx-play__error.show { display: block; }

.wx-play__error .wx-hall__more {
  max-width: 6.4rem;
  margin-left: auto;
  margin-right: auto;
}

.wx-play__error .wx-btn-ghost {
  background: var(--wx-panel);
  color: #fff;
  box-shadow: none;
  border: 1px solid var(--wx-line);
  margin-top: 0.2rem;
}

@media (prefers-reduced-motion: reduce) {
  .wx-sheet,
  .wx-hall__section,
  .wx-card,
  .wx-hero__title,
  .wx-search,
  .wx-search__input,
  .wx-search-layer {
    animation: none !important;
    transition: none !important;
  }

  .wx-hero.is-search-open .wx-search-layer {
    opacity: 1;
    transform: none;
  }
}
