:root {
  --gold: #f6e27a;
  --gold-mid: #e0b93a;
  --gold-deep: #a67c1a;
  --magenta: #c43b9a;
  --violet: #2a1048;
  --violet-deep: #12061f;
  --text: #fff6df;
  --muted: #cbb6e8;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  height: 100%;
  font-family: "Noto Serif TC", "PingFang TC", "Microsoft JhengHei", "Noto Serif SC", serif;
  color: var(--text);
  background:
    radial-gradient(1200px 700px at 50% -10%, rgba(180, 60, 140, 0.35), transparent 55%),
    #12061f url("./assets/brand/hall-bg.jpg") center top / cover no-repeat fixed;
  overflow-x: hidden;
}

button { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; }
img { display: block; max-width: 100%; }

/* —— 氛围层 —— */
.ambiance {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.ambiance-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: .55;
  animation: glow-drift 10s ease-in-out infinite alternate;
}
.ambiance-glow-a {
  width: 280px; height: 280px;
  left: -60px; top: 12%;
  background: radial-gradient(circle, rgba(232, 90, 180, .55), transparent 70%);
}
.ambiance-glow-b {
  width: 320px; height: 320px;
  right: -80px; top: 38%;
  background: radial-gradient(circle, rgba(246, 210, 90, .28), transparent 70%);
  animation-delay: -4s;
}
.ambiance-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(10, 2, 20, .25) 0%, transparent 18%, transparent 72%, rgba(8, 2, 18, .72) 100%),
    radial-gradient(ellipse at center, transparent 40%, rgba(8, 2, 18, .55) 100%);
}
.ambiance-sparkles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255, 236, 170, .85), transparent),
    radial-gradient(1.5px 1.5px at 78% 18%, rgba(255, 236, 170, .7), transparent),
    radial-gradient(1px 1px at 42% 58%, rgba(255, 210, 255, .7), transparent),
    radial-gradient(1.5px 1.5px at 88% 72%, rgba(255, 236, 170, .65), transparent),
    radial-gradient(1px 1px at 28% 80%, rgba(255, 236, 170, .55), transparent);
  animation: sparkle 3.6s ease-in-out infinite;
}
@keyframes glow-drift {
  from { transform: translateY(0) scale(1); }
  to { transform: translateY(28px) scale(1.08); }
}
@keyframes sparkle {
  0%, 100% { opacity: .45; }
  50% { opacity: .9; }
}

.hall {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding: 10px 12px calc(22px + var(--safe-bottom));
}

/* —— 品牌头 —— */
.hero-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 2px 12px;
  animation: rise-in .55s ease both;
}
.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(246, 210, 90, .45));
}
.brand-word { display: flex; flex-direction: column; line-height: 1.1; }
.brand-en {
  font-family: Cinzel, "Noto Serif TC", serif;
  font-size: 11px;
  letter-spacing: .28em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(246, 210, 90, .35);
}
.brand-cn {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .12em;
  background: linear-gradient(180deg, #fff6c8 0%, #f0c84a 48%, #b8860b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(80, 40, 0, .45));
}

/* —— 玩家面板 —— */
.player-panel {
  position: relative;
  margin-bottom: 10px;
  border-radius: 16px;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    0 0 0 1px rgba(246, 210, 90, .28),
    0 10px 28px rgba(0, 0, 0, .45),
    inset 0 1px 0 rgba(255, 255, 255, .08);
  animation: rise-in .65s ease both;
  animation-delay: .05s;
}
.player-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(246, 210, 90, .12), transparent 40%, rgba(196, 59, 154, .12));
  pointer-events: none;
  z-index: 1;
}
.panel-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .9;
  z-index: 0;
}
.player-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 12px 10px 12px 12px;
  background: linear-gradient(180deg, rgba(40, 12, 70, .55), rgba(18, 6, 36, .72));
}
.player {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.avatar-wrap {
  position: relative;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
}
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
.avatar-frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  filter: drop-shadow(0 0 8px rgba(246, 210, 90, .35));
}
.avatar-shine {
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,.35), transparent 45%);
  pointer-events: none;
  mix-blend-mode: screen;
}
.player-meta { min-width: 0; }
.nickname {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0,0,0,.65);
}
.uid {
  font-family: Cinzel, sans-serif;
  font-size: 10px;
  letter-spacing: .08em;
  color: var(--muted);
  margin-top: 3px;
}
.balances {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.bal {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 118px;
  height: 26px;
  padding: 0 10px 0 5px;
  background:
    linear-gradient(180deg, rgba(80, 40, 20, .35), rgba(20, 8, 30, .55)),
    url("./assets/brand/mygold-bg.png") center / 100% 100% no-repeat;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(246, 210, 90, .25);
}
.bal-icon { width: 18px; height: 18px; flex-shrink: 0; }
.bal-num {
  font-family: Cinzel, "Noto Serif TC", serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  text-shadow: 0 0 8px rgba(246, 210, 90, .35);
}
.refresh-btn {
  width: 30px;
  height: 30px;
  opacity: .92;
  transition: transform .2s ease, filter .2s ease;
}
.refresh-btn:active { transform: rotate(90deg) scale(.92); }
.refresh-btn img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 6px rgba(246,210,90,.4)); }

/* —— 公告 —— */
.notice {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  margin: 0 0 12px;
  padding: 0 12px;
  background:
    linear-gradient(90deg, rgba(90, 20, 70, .55), rgba(40, 12, 70, .35)),
    url("./assets/brand/notice-bg.png") center / 100% 100% no-repeat;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(246, 210, 90, .2);
  overflow: hidden;
  animation: rise-in .7s ease both;
  animation-delay: .1s;
}
.laba { width: 18px; height: 18px; flex-shrink: 0; animation: laba-bob 1.4s ease-in-out infinite; }
.notice-track {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  font-size: 12px;
  color: #ffe9a8;
}
.notice-track span {
  display: inline-block;
  padding-left: 100%;
  animation: marquee 16s linear infinite;
}
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-100%); }
}
@keyframes laba-bob {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(10deg); }
}

/* —— Banner —— */
.banner-wrap {
  position: relative;
  margin: 0 0 16px;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 2.35 / 1;
  background: rgba(0,0,0,.28);
  box-shadow:
    0 0 0 1px rgba(246, 210, 90, .35),
    0 12px 30px rgba(0, 0, 0, .45),
    0 0 40px rgba(196, 59, 154, .18);
  animation: rise-in .75s ease both;
  animation-delay: .15s;
}
.banner-frame {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: 14px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 230, 150, .35),
    inset 0 0 24px rgba(246, 210, 90, .12);
}
.banner-slider {
  display: flex;
  height: 100%;
  transition: transform .45s cubic-bezier(.22, .8, .28, 1);
}
.banner-img {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.banner-dots {
  position: absolute;
  left: 0; right: 0; bottom: 8px;
  display: flex;
  justify-content: center;
  gap: 6px;
  z-index: 3;
}
.banner-dots span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: rgba(255,255,255,.28);
  box-shadow: 0 0 0 1px rgba(0,0,0,.25);
  transition: transform .2s ease, background .2s ease;
}
.banner-dots span.on {
  background: var(--gold);
  transform: scale(1.25);
  box-shadow: 0 0 10px rgba(246, 210, 90, .7);
}

/* —— 分类切换 —— */
.cat-tabs {
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 4px 0 12px;
  animation: rise-in .75s ease both;
  animation-delay: .12s;
}
.cat-tab {
  flex: 1;
  max-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 10px 9px;
  border: 1px solid rgba(246, 210, 90, .22);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(60, 36, 12, .55), rgba(24, 12, 6, .72));
  color: rgba(255, 246, 220, .72);
  box-shadow: inset 0 1px 0 rgba(255, 230, 150, .12);
  transition: border-color .2s ease, color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.cat-tab .cat-en {
  font-family: Cinzel, serif;
  font-size: 8px;
  letter-spacing: .28em;
  opacity: .7;
}
.cat-tab .cat-cn {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .12em;
}
.cat-tab.on {
  color: #fff6df;
  border-color: rgba(246, 210, 90, .72);
  box-shadow:
    inset 0 1px 0 rgba(255, 230, 150, .28),
    0 0 14px rgba(246, 210, 90, .28);
  background:
    linear-gradient(180deg, rgba(110, 72, 18, .75), rgba(48, 26, 8, .88));
}
.cat-tab:active { transform: scale(.97); }

/* —— 分区头 —— */
.section-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 2px 0 14px;
  animation: rise-in .8s ease both;
  animation-delay: .2s;
}
.sec-ornament {
  width: 42px;
  height: 14px;
  object-fit: contain;
  opacity: .75;
}
.sec-ornament.right { transform: scaleX(-1); }
.sec-icon {
  width: 34px;
  height: 34px;
  filter: drop-shadow(0 0 8px rgba(246, 210, 90, .4));
}
.sec-titles {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}
.sec-en {
  font-family: Cinzel, serif;
  font-size: 9px;
  letter-spacing: .32em;
  color: rgba(246, 210, 90, .75);
}
.sec-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .18em;
  background: linear-gradient(180deg, #fff8d0, #f0c84a 55%, #c9971e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(60, 30, 0, .4));
}
.sec-hot {
  width: 38px;
  height: auto;
  animation: badge-hot-pulse 1.1s ease-in-out infinite;
}

/* —— 游戏宫格 —— */
.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px 10px;
  padding: 0 0 8px;
}
.game-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: tile-in .55s ease both;
  animation-delay: var(--delay, 0s);
}
.game-item:disabled { opacity: .55; }
.game-pic {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
}
.game-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: -webkit-optimize-contrast;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.45));
  transition: transform .15s ease;
}
.game-item:active .game-icon { transform: scale(.94); }
.game-badge {
  position: absolute;
  left: -2%;
  top: -4%;
  width: 42%;
  height: auto;
  pointer-events: none;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.45));
  transform-origin: center center;
}
.badge-hot { animation: badge-hot-pulse 1.1s ease-in-out infinite; }
.badge-new { animation: badge-new-spin 2.4s linear infinite; }
@keyframes badge-hot-pulse {
  0%, 100% { transform: scale(1) rotate(-6deg); }
  50% { transform: scale(1.12) rotate(4deg); }
}
@keyframes badge-new-spin {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.08) rotate(-8deg); }
  50% { transform: scale(1) rotate(0deg); }
  75% { transform: scale(1.08) rotate(8deg); }
}
.game-name {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.25;
  text-align: center;
  color: #ffeec0;
  text-shadow: 0 1px 3px rgba(0,0,0,.75), 0 0 10px rgba(246, 210, 90, .2);
  letter-spacing: .04em;
}

.err {
  color: #ffb0b0;
  font-size: 13px;
  text-align: center;
  margin: 10px 0 4px;
  text-shadow: 0 1px 2px rgba(0,0,0,.5);
}
.foot-mark {
  margin-top: 18px;
  text-align: center;
  font-family: Cinzel, serif;
  font-size: 9px;
  letter-spacing: .28em;
  color: rgba(203, 182, 232, .45);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes tile-in {
  from { opacity: 0; transform: translateY(16px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (min-width: 420px) {
  .game-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .ambiance-glow,
  .ambiance-sparkles,
  .laba,
  .notice-track span,
  .game-item,
  .hero-brand,
  .player-panel,
  .notice,
  .banner-wrap,
  .section-head {
    animation: none !important;
  }
}
