:root {
  --bg: #05090f;
  --card: #121820;
  --chip: #1a2330;
  --text: #f4f7fb;
  --muted: #8b97a8;
  --line: #243044;
  --gold: #e8c07a;
  --gold-2: #c9963a;
  --on-gold: #3d2a08;
  --danger: #ea4e3d;
  --max: 480px;
  --tab: 62px;
  --bar: 52px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #02060b;
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; }

#splash {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  background: #05090f;
  transition: opacity 0.45s ease;
}
#splash img { width: 84px; height: 84px; border-radius: 18px; }
#splash strong { font-size: 20px; letter-spacing: 2px; }
#splash.off { opacity: 0; pointer-events: none; }

#app {
  width: min(100%, var(--max));
  min-height: 100%;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  height: var(--bar);
  padding: 0 12px;
  background: #0b1018;
  border-bottom: 1px solid var(--line);
}
.logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  object-fit: cover;
}
.brand {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  border-radius: 16px;
  object-fit: cover;
}
.topbar h1 {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 600;
}
.menu-btn, .back {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 22px;
}
.pill, .pill-solid {
  height: 28px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-size: 13px;
}
.pill-solid { background: linear-gradient(180deg, var(--gold), var(--gold-2)); color: var(--on-gold); border-color: transparent; }
.session-box { margin-left: auto; text-align: right; line-height: 1.2; }
.session-box b { display: block; font-size: 13px; }
.session-box span { font-size: 12px; color: var(--gold); }

.page { padding: 10px 12px 16px; }
.page.with-tab { padding-bottom: calc(var(--tab) + 16px); }

.banner {
  display: grid;
  place-items: center;
  width: 100%;
  height: 148px;
  border: 0;
  border-radius: 14px;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(232, 192, 122, 0.28), transparent 55%),
    linear-gradient(180deg, #1c2433, #0d121b);
  color: var(--gold);
}
.banner strong { font-size: 32px; font-weight: 700; letter-spacing: 4px; }

.marquee {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 0 10px;
  height: 32px;
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}
.marquee img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.marquee p { margin: 0; white-space: nowrap; animation: slide 14s linear infinite; }
@keyframes slide {
  from { transform: translateX(20%); }
  to { transform: translateX(-100%); }
}

.cats {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cats button {
  flex: none;
  width: 68px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
}
.cats img { width: 68px; height: 86px; object-fit: contain; }
.cats button.plain { width: 58px; }
.cats button.plain img { width: 36px; height: 36px; margin: 8px auto 0; }
.cats button.plain span { display: block; margin-top: 4px; text-align: center; }
.cats button.on { color: var(--gold); font-weight: 600; }

.search {
  display: flex;
  margin-top: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
}
.search input {
  flex: 1;
  height: 36px;
  border: 0;
  outline: none;
  padding: 0 14px;
  background: transparent;
  font-size: 14px;
}
.search input:focus { outline: none; }

.banners, .badges { display: grid; gap: 10px; margin-top: 12px; }
.badges { grid-template-columns: repeat(3, 1fr); }
.banners button, .badges button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
}
.banners img, .badges img { width: 100%; height: auto; border-radius: 12px; }
.vendors { display: grid; gap: 8px; margin-top: 12px; }
.vendor, .activity {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: left;
  font-size: 15px;
}
.vendor img, .activity i {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #0d121b;
}
.activity i {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-style: normal;
  font-weight: 700;
}
.vendor b, .activity b { display: block; font-weight: 600; }
.vendor span, .activity span { display: block; margin-top: 2px; color: var(--muted); font-size: 12px; }
.vendor em, .activity em { margin-left: auto; color: var(--muted); font-style: normal; }
.crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gold);
  font-size: 13px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 10px;
  gap: 8px;
}
.card { position: relative; }
.play {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}
.card img, .game-fallback {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  background: #1c2433;
}
.group-title { margin: 14px 0 0; font-size: 15px; font-weight: 600; }
.game-fallback {
  display: grid;
  place-items: center;
  padding: 8px;
  color: var(--gold);
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}
.card span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fav {
  position: absolute;
  top: 6px;
  right: 6px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
}
.fav img { width: 16px; height: 16px; }

.empty { margin-top: 28px; text-align: center; color: var(--muted); }
.empty strong { display: block; margin-bottom: 6px; color: var(--gold); font-size: 18px; }

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, var(--max));
  height: var(--tab);
  transform: translateX(-50%);
  background: #0b1018;
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}
.tabbar button.on { color: var(--gold); }
.tabbar img { width: 24px; height: 24px; margin: 0 auto 2px; object-fit: contain; }
.tab-raise { position: relative; top: -16px; }
.tab-raise img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
}

.auth { min-height: 100vh; background: var(--bg); }
.auth-head {
  display: flex;
  align-items: center;
  height: var(--bar);
  padding: 0 8px;
  background: #0b1018;
}
.auth-card {
  margin: 16px 12px;
  padding: 22px 16px 18px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--line);
}
.auth-card h2 { margin: 8px 0 16px; text-align: center; font-size: 20px; }
.field { margin-bottom: 12px; }
.field label { display: block; margin-bottom: 6px; font-size: 13px; color: var(--muted); }
.field input[type="text"],
.field input[type="password"] {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #0d121b;
  font-size: 15px;
}
.field input:focus { border-color: var(--gold); }
.icon-input { position: relative; }
.icon-input > img {
  position: absolute;
  left: 12px;
  top: 11px;
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.field .icon-input input { padding: 0 12px 0 44px; }
.pwd { position: relative; }
.field .pwd input { padding-right: 48px; }
.pwd button {
  position: absolute;
  top: 0;
  right: 0;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
}
.pwd button img { width: 22px; height: 22px; object-fit: contain; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 14px; font-size: 13px; color: var(--muted); }
.submit {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--gold), var(--gold-2));
  color: var(--on-gold);
  font-size: 16px;
  font-weight: 600;
}
.form-error { min-height: 18px; margin: 0 0 8px; color: var(--danger); font-size: 13px; }
.switch, .note { margin: 14px 0 0; text-align: center; font-size: 13px; color: var(--muted); }
.note { font-size: 12px; }

.mine-head {
  margin: -10px -12px 12px;
  padding: 18px 16px 16px;
  background: linear-gradient(180deg, #1a140c, #0b1018 70%);
}
.who { display: flex; align-items: center; gap: 12px; }
.avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #243044;
  color: var(--gold);
  font-size: 22px;
  font-weight: 700;
}
.who p { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-top: 14px;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: rgba(232, 192, 122, 0.12);
  text-align: left;
  font: inherit;
}
.balance b { color: var(--gold); font-size: 20px; }
.guest-actions { display: flex; gap: 8px; margin-top: 14px; }
.menu { overflow: hidden; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  font-size: 15px;
}
.menu img { width: 28px; height: 28px; object-fit: contain; border-radius: 8px; }
.menu button span:last-child { margin-left: auto; color: var(--muted); }
.menu button:last-child { border-bottom: 0; }
.logout {
  width: 100%;
  height: 44px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  color: var(--danger);
  font-size: 15px;
}
.recover-card {
  margin-bottom: 12px;
  padding: 18px 16px;
  border-radius: 12px;
  background: linear-gradient(180deg, #2a2114, #121820);
  border: 1px solid rgba(232, 192, 122, 0.35);
}
.recover-card p { margin: 0; font-size: 13px; color: var(--muted); }
.recover-card strong { display: block; margin-top: 6px; color: var(--gold); font-size: 28px; }
.recover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  font-size: 14px;
}
.recover-btn { margin-top: 16px; }
.recover-btn:disabled { opacity: 0.7; }

.drawer-mask {
  position: fixed;
  z-index: 70;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, var(--max));
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.55);
}
.drawer {
  width: min(78%, 320px);
  height: 100%;
  padding: 14px 14px 28px;
  overflow: auto;
  background: #0d121b;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; }
.drawer-head img { width: 42px; height: 42px; border-radius: 10px; }
.drawer-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--chip);
}
.drawer-close img { width: 16px; height: 16px; object-fit: contain; }
.drawer-user {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  padding: 12px;
  border-radius: 12px;
  background: #1a2330;
}
.drawer-user b { display: block; }
.drawer-user span { font-size: 12px; color: var(--gold); }
.drawer h3 { margin: 8px 0; font-size: 14px; }
.drawer-cats, .drawer-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.drawer-cats button {
  width: auto;
  border: 0;
  border-radius: 10px;
  padding: 2px;
  background: transparent;
  color: var(--text);
  font-size: 11px;
}
.drawer-cats img { width: 100%; height: 72px; margin: 0 auto; object-fit: contain; }
.drawer-cats button.plain img { width: 28px; height: 28px; margin: 8px auto 0; }
.drawer-cats button.on { color: var(--gold); font-weight: 600; }
.drawer-links { grid-template-columns: repeat(3, 1fr); }
.drawer-links button {
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--chip);
  color: var(--text);
  font-size: 12px;
}
.drawer-links { margin-bottom: 8px; }
.drawer-links button { height: 40px; }

.toast {
  position: fixed;
  top: 16px;
  left: 50%;
  z-index: 50;
  transform: translateX(-50%);
  max-width: min(78%, 360px);
  padding: 8px 14px;
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.78);
  color: #fff;
  font-size: 13px;
}
.enter-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  text-align: center;
}
.enter-mask strong { display: block; font-size: 32px; letter-spacing: 2px; }
.enter-mask span { display: block; margin-top: 12px; font-size: 18px; font-weight: 600; }
.soon-mark {
  width: 72px;
  height: 72px;
  margin: 48px auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #1c2433;
  color: var(--gold);
  font-size: 28px;
}
