:root {
  --bg-deep: #100906;
  --bg-card: #1d110c;
  --bg-card-hover: #261710;
  --gold-bright: #f5d68e;
  --gold-mid: #d6a856;
  --gold-dim: rgba(214, 168, 86, 0.28);
  --crimson: #b83324;
  --crimson-glow: #e04a36;
  --jade: #2b8a6e;
  --jade-bright: #6ce0bc;
  --text-main: #f7ead2;
  --text-muted: #bda688;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: radial-gradient(circle at 50% 0%, #24130c 0%, var(--bg-deep) 65%);
  color: var(--text-main);
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Serif SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

.palace-shell {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100svh;
  background: linear-gradient(180deg, #160c08 0%, #110906 100%);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.85);
  border-inline: 1px solid rgba(214, 168, 86, 0.16);
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}

/* 1. 顶部万金坊门头 */
.hero-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-bottom: 1px solid var(--gold-dim);
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(12, 6, 4, 0.52) 0%,
    rgba(16, 9, 6, 0.08) 38%,
    rgba(16, 9, 6, 0.72) 76%,
    #140b07 100%
  );
}

.topbar-strip {
  position: absolute;
  top: max(10px, env(safe-area-inset-top, 10px));
  inset-inline: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  z-index: 2;
}

.brand-plaque {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(18, 10, 7, 0.78);
  border: 1px solid var(--gold-dim);
  backdrop-filter: blur(6px);
  font-size: 12px;
}

.brand-seal {
  background: linear-gradient(135deg, #c93b29, #8f2114);
  color: #fff3da;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.5px;
}

.brand-sub {
  color: var(--gold-bright);
  font-weight: 600;
}

.wallet-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(26, 14, 9, 0.84);
  border: 1px solid rgba(245, 214, 142, 0.42);
  backdrop-filter: blur(6px);
  font-size: 12px;
  color: #edd5ab;
}

.wallet-pill strong {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
}

.wallet-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f4c158;
  box-shadow: 0 0 8px #f4c158;
}

.hero-headline-box {
  position: absolute;
  bottom: 12px;
  inset-inline: 14px;
  text-align: center;
  z-index: 2;
}

.hero-kicker {
  margin: 0 0 3px;
  font-size: 11.5px;
  letter-spacing: 1.5px;
  color: var(--gold-bright);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.9);
}

.hero-title {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 4px;
  background: linear-gradient(180deg, #fff6d6 0%, #f1c36b 58%, #c58932 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.9));
}

.hero-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #e6d2b5;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* 2. 跑马喜报 + 筛选栏 */
.marquee-ribbon {
  margin: 10px 12px 0;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(34, 20, 14, 0.86);
  border: 1px solid rgba(214, 168, 86, 0.22);
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.marquee-tag {
  flex-shrink: 0;
  background: rgba(214, 168, 86, 0.18);
  border: 1px solid rgba(214, 168, 86, 0.36);
  color: var(--gold-bright);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.marquee-text {
  margin: 0;
  font-size: 12px;
  color: #edd7b4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-bar {
  display: flex;
  gap: 7px;
  padding: 10px 12px 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-pill {
  flex-shrink: 0;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(214, 168, 86, 0.26);
  background: rgba(31, 18, 12, 0.9);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.filter-pill em {
  font-style: normal;
  opacity: 0.75;
  margin-left: 2px;
  font-size: 11px;
}

.filter-pill.is-active {
  background: linear-gradient(135deg, #4b2514, #2d150b);
  border-color: var(--gold-bright);
  color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(214, 168, 86, 0.22);
}

/* 3. 厅堂区块 */
.halls-main {
  padding: 6px 12px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-block[hidden] {
  display: none;
}

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.section-title {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--gold-bright);
  letter-spacing: 0.5px;
}

.section-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

.live-pulse-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  color: #7ef2ad;
  font-weight: 600;
}

.live-pulse-tag i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #39d97a;
  box-shadow: 0 0 8px #39d97a;
}

/* 4. 容器自适应语义化卡片 (<article class="hall-card">) */
.hall-card {
  position: relative;
  container-type: inline-size;
  background: linear-gradient(180deg, #23140e 0%, #170d09 100%);
  border: 1px solid rgba(214, 168, 86, 0.28);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.hall-card[hidden] {
  display: none;
}

.hall-card:has(a.card-link) {
  position: relative;
}

.hall-card a.card-link {
  color: inherit;
  text-decoration: none;
}

.hall-card a.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
}

.hall-card a.card-link:focus-visible {
  outline: none;
}

.hall-card:has(a.card-link:focus-visible) {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.hall-card:has(a.card-link:hover) {
  border-color: var(--gold-bright);
  box-shadow: 0 10px 28px rgba(214, 168, 86, 0.18);
  transform: translateY(-1px);
}

.hall-card:has(a.card-link) :is(a:not(.card-link), button) {
  position: relative;
  z-index: 1;
}

.hall-card > img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 3.8;
  object-fit: cover;
  object-position: center 18%;
  display: block;
  border-bottom: 1px solid rgba(214, 168, 86, 0.18);
}

.hall-card > header {
  padding: 10px 11px 4px;
}

.hall-card h3 {
  margin: 6px 0 2px;
  font-size: 15.5px;
  font-weight: 800;
  color: #fff1d4;
}

.hostess-line {
  margin: 0;
  font-size: 11.5px;
  color: var(--gold-mid);
  font-weight: 600;
}

.card-desc {
  margin: 0;
  padding: 2px 11px 8px;
  font-size: 12px;
  line-height: 1.48;
  color: var(--text-muted);
}

.card-meta-box .card-desc {
  padding-inline: 0;
}

.card-meta-box {
  padding: 2px 11px 8px;
}

.hall-card > footer {
  padding: 8px 11px 10px;
  border-top: 1px solid rgba(214, 168, 86, 0.13);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
}

/* 宽卡片（头牌一号厅 & 后院知微阁）通过 @container 自动切换左右横版分栏！ */
@container (min-width: 340px) {
  .hall-card:has(> img) > img {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 138px;
    height: 100%;
    aspect-ratio: auto;
    border-bottom: none;
    border-right: 1px solid rgba(214, 168, 86, 0.22);
    object-position: center 16%;
  }

  .hall-card:has(> img) > header,
  .hall-card:has(> img) > .card-meta-box,
  .hall-card:has(> img) > .card-desc,
  .hall-card:has(> img) > footer {
    margin-left: 138px;
  }
}

.hall-card.is-flagship {
  border-color: rgba(245, 214, 142, 0.55);
  background: linear-gradient(145deg, #2b150d 0%, #190d08 100%);
  box-shadow: 0 10px 30px rgba(184, 51, 36, 0.22);
}

.hall-card.is-side-corner {
  border-color: rgba(108, 224, 188, 0.34);
  background: linear-gradient(145deg, #13221d 0%, #110d0b 100%);
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.hall-rank-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(214, 168, 86, 0.16);
  color: var(--gold-bright);
  border: 1px solid rgba(214, 168, 86, 0.3);
}

.hall-rank-tag.is-gold {
  background: linear-gradient(135deg, #d89e3c, #9c6518);
  color: #1c0e06;
  border: none;
}

.hall-rank-tag.is-jade {
  background: rgba(43, 138, 110, 0.28);
  color: var(--jade-bright);
  border-color: rgba(108, 224, 188, 0.36);
}

.status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.status-pill.is-live {
  background: rgba(40, 168, 92, 0.2);
  color: #84f5b0;
  border: 1px solid rgba(68, 214, 126, 0.38);
}

.status-pill.is-live-jade {
  background: rgba(43, 138, 110, 0.24);
  color: var(--jade-bright);
}

.status-pill.is-soon {
  background: rgba(255, 255, 255, 0.06);
  color: #cbb699;
}

.live-roadmap-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.road-chip {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 999px;
}

.road-chip.is-big {
  background: rgba(196, 56, 40, 0.32);
  color: #ff9c8f;
  border: 1px solid rgba(224, 74, 54, 0.45);
}

.road-chip.is-small {
  background: rgba(42, 118, 178, 0.32);
  color: #93d2ff;
  border: 1px solid rgba(74, 158, 224, 0.45);
}

.road-chip.is-bao {
  background: rgba(214, 160, 46, 0.32);
  color: #ffe394;
  border: 1px solid rgba(245, 200, 92, 0.55);
}

.players-count {
  font-size: 11.5px;
  color: #d9c3a3;
}

.enter-cta-visual {
  flex-shrink: 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, #d13d2a, #962012);
  color: #fff6e3;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 3px 10px rgba(184, 51, 36, 0.45);
}

.enter-cta-visual.is-jade {
  background: linear-gradient(135deg, #2d8f72, #1b5c48);
  box-shadow: 0 3px 10px rgba(43, 138, 110, 0.4);
}

/* 2列博戏分厅网格 */
.tables-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.odds-tag {
  font-size: 10.5px;
  color: var(--gold-bright);
  font-weight: 700;
}

.preview-btn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 5px 9px;
  min-height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(245, 214, 142, 0.45);
  background: rgba(66, 36, 20, 0.88);
  color: var(--gold-bright);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.preview-btn:hover {
  background: rgba(98, 52, 28, 0.95);
}

.palace-footer {
  margin-top: 20px;
  padding: 12px;
  text-align: center;
  font-size: 11.5px;
  color: #8c755c;
  border-top: 1px solid rgba(214, 168, 86, 0.12);
}

.palace-footer p {
  margin: 0;
}

/* 原生 <dialog> 实机盘面预览框 */
.preview-dialog {
  padding: 0;
  border: 1px solid rgba(245, 214, 142, 0.5);
  border-radius: 16px;
  background: #180e09;
  color: var(--text-main);
  max-width: min(390px, 92vw);
  width: 100%;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9);
}

.preview-dialog::backdrop {
  background-color: rgba(6, 3, 2, 0.76);
  backdrop-filter: blur(4px);
}

.dialog-card {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
}

.dialog-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(245, 214, 142, 0.45);
  background: rgba(16, 9, 6, 0.8);
  color: #fff2d6;
  font-size: 15px;
  cursor: pointer;
  z-index: 2;
}

.dialog-hero-img {
  width: 100%;
  height: auto;
  max-height: 54svh;
  aspect-ratio: 9 / 13.5;
  object-fit: cover;
  object-position: center 22%;
  display: block;
}

.dialog-info {
  padding: 12px 14px 15px;
  border-top: 1px solid rgba(214, 168, 86, 0.25);
}

.dialog-tag-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.dialog-title {
  margin: 0 0 6px;
  font-size: 18px;
  color: var(--gold-bright);
}

.dialog-desc {
  margin: 0 0 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: #dec9ac;
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.urge-btn {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(245, 214, 142, 0.55);
  background: linear-gradient(135deg, #572b14, #36190a);
  color: var(--gold-bright);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.urge-btn.is-urged {
  background: linear-gradient(135deg, #275945, #18382b);
  border-color: var(--jade-bright);
  color: var(--jade-bright);
}

.go-live-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #cc3a28, #911d10);
  color: #fff6e5;
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 800;
}
