:root {
  color-scheme: dark;
  --bg: #070b14;
  --panel: rgba(16, 24, 39, .94);
  --panel-2: #151f33;
  --soft: #0d1423;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #263449;
  --gold: #f6c453;
  --brand-red: #8f160d;
  --brand-dark: #210806;
  --blue: #38bdf8;
  --green: #34d399;
  --red: #fb7185;
  --purple: #a78bfa;
  --ui-radius: 8px;
  --ui-radius-lg: 12px;
  --ui-control: rgba(17, 24, 39, .78);
  --ui-control-hover: rgba(55, 65, 101, .86);
  --ui-primary: #7c3aed;
  --ui-primary-2: #a855f7;
  --ui-focus: 0 0 0 3px rgba(168, 85, 247, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}
.ui-icon {
  display: block;
  width: 1.15em;
  height: 1.15em;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
button .ui-icon {
  pointer-events: none;
}

.app {
  min-height: 100vh;
  padding: max(12px, env(safe-area-inset-top)) 12px calc(72px + env(safe-area-inset-bottom));
  background-image:
    linear-gradient(180deg, rgba(7, 11, 20, .26), #070b14 310px),
    url("/assets/dice-board.svg");
  background-size: 100% auto, 128% auto;
  background-repeat: no-repeat;
  background-position: top center;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0 12px;
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 48px; height: 48px; flex: 0 0 auto; }
.brand-photo {
  object-fit: cover;
  border-radius: var(--ui-radius);
  border: 1px solid rgba(246, 196, 83, .42);
  box-shadow: 0 0 0 2px rgba(143, 22, 13, .22);
}
h1, h2, p { margin: 0; }
h1 { font-size: 21px; line-height: 1.12; }
h2 { font-size: 16px; line-height: 1.2; }
p, .muted { color: var(--muted); }
.brand p, .panel-head p { margin-top: 3px; font-size: 12px; }

.app-homebar {
  position: sticky;
  top: 0;
  z-index: 8;
  margin: calc(-1 * max(12px, env(safe-area-inset-top))) -12px 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  background:
    radial-gradient(circle at 72% 0%, rgba(246, 196, 83, .22), transparent 30%),
    linear-gradient(90deg, rgba(24, 19, 66, .96), rgba(52, 25, 86, .94));
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  backdrop-filter: blur(16px);
}
.app-homebar .brand h1 {
  font-size: 18px;
}
.app-homebar .brand p {
  max-width: 154px;
  overflow: hidden;
  color: rgba(255, 255, 255, .65);
  white-space: nowrap;
  text-overflow: ellipsis;
}
.top-account {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
}
.balance-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px 0 7px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, .12);
  background: rgba(9, 12, 34, .48);
}
.balance-pill span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #063326;
  background: linear-gradient(180deg, #86efac, #10b981);
  font-size: 15px;
}
.balance-pill strong {
  max-width: 76px;
  overflow: hidden;
  color: #fff;
  font-size: 13px;
  text-overflow: ellipsis;
}
.avatar-btn {
  position: relative;
  width: 38px;
  min-height: 38px;
  padding: 0;
  overflow: hidden;
  border-radius: 50%;
  border-color: rgba(246, 196, 83, .38);
  background: rgba(255, 255, 255, .1);
}
.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-btn b {
  position: absolute;
  right: 0;
  bottom: 0;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 999px;
  color: #2b1904;
  background: var(--gold);
  font-size: 10px;
}

.icon-btn, .ghost {
  display: inline-grid;
  place-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(148, 163, 184, .25);
  border-radius: var(--ui-radius);
  color: var(--text);
  background: var(--ui-control);
  font-weight: 900;
}
.icon-btn {
  width: 38px;
  padding: 0;
  font-size: 18px;
}

.notice {
  border: 1px solid rgba(246, 196, 83, .4);
  background: rgba(83, 48, 12, .62);
  padding: 9px 11px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 10px;
}
.notice:empty {
  display: none;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  background: rgba(10, 15, 26, .94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 10px;
  transition: color .15s ease, background .15s ease;
}
.bottom-nav button .ui-icon {
  width: 22px;
  height: 22px;
}
.bottom-nav button.active {
  color: var(--gold);
  background: rgba(246, 196, 83, .12);
}

.page { display: none; }
.page.active { display: block; }

.home-category-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -12px 10px;
  padding: 0 12px 3px;
  scrollbar-width: none;
}
.home-category-strip::-webkit-scrollbar { display: none; }
.home-category-strip button {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .74);
  background: rgba(21, 26, 62, .72);
  font-size: 13px;
}
.home-category-strip button.active {
  color: #fff;
  background: linear-gradient(180deg, rgba(168, 85, 247, .92), rgba(124, 58, 237, .92));
}
.home-category-strip span {
  display: grid;
  place-items: center;
  color: var(--gold);
  font-size: 15px;
}

.home-banner {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 14px;
  min-height: 150px;
  margin-bottom: 10px;
  padding: 16px;
  border: 1px solid rgba(246, 196, 83, .28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(13, 10, 36, .36), rgba(55, 15, 79, .68)),
    url("/assets/bm-hero-pc28.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .35);
}
.home-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(5, 8, 22, .68) 100%);
  pointer-events: none;
}
.home-banner > * { position: relative; z-index: 1; }
.home-banner span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 1000;
}
.home-banner strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.05;
}
.home-banner p {
  margin-top: 6px;
  max-width: 245px;
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
}
.home-banner button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 16px;
  color: #fff;
  border-color: transparent;
  background: linear-gradient(180deg, #fb7185, #e11d48);
}

.home-quick-wallet {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.home-quick-wallet button {
  display: grid;
  place-items: center;
  min-height: 72px;
  padding: 8px 5px;
  border-color: rgba(255, 255, 255, .1);
  background:
    radial-gradient(circle at 50% 0%, rgba(246, 196, 83, .16), transparent 48%),
    rgba(26, 30, 71, .78);
}
.home-quick-wallet span,
.section-title span,
.tool-grid span {
  display: block;
  color: rgba(255, 255, 255, .58);
  font-size: 11px;
}
.home-quick-wallet strong {
  display: block;
  width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-game-section {
  margin: 10px 0;
}
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.section-title strong {
  display: block;
  margin-top: 3px;
  font-size: 17px;
}
.section-title button {
  min-height: 32px;
  padding: 0 10px;
  color: var(--gold);
  border-color: rgba(246, 196, 83, .24);
  background: rgba(246, 196, 83, .08);
}
.game-card-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -12px;
  padding: 0 12px 3px;
  scrollbar-width: none;
}
.game-card-row::-webkit-scrollbar { display: none; }
.game-tile {
  position: relative;
  flex: 0 0 142px;
  display: grid;
  align-content: end;
  justify-items: start;
  overflow: hidden;
  min-height: 128px;
  padding: 12px;
  border-color: rgba(255, 255, 255, .1);
  background:
    linear-gradient(180deg, rgba(21, 22, 58, .1), rgba(6, 9, 28, .88)),
    url("/assets/dice-board.svg");
  background-size: cover;
  background-position: center;
  text-align: left;
}
.game-tile.primary {
  flex-basis: 172px;
  border-color: rgba(246, 196, 83, .32);
  background:
    linear-gradient(180deg, rgba(21, 22, 58, .05), rgba(80, 22, 84, .9)),
    url("/assets/bm-hero-pc28.jpg");
  background-size: cover;
  background-position: center;
}
.game-tile span {
  color: var(--gold);
  font-size: 11px;
}
.game-tile strong {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.2;
}
.game-tile small {
  margin-top: 5px;
  color: rgba(255, 255, 255, .64);
}
.tool-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.tool-grid button {
  display: grid;
  align-content: center;
  min-height: 64px;
  padding: 8px;
  border-color: rgba(255, 255, 255, .1);
  background: rgba(20, 24, 58, .84);
}
.tool-grid strong {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #fff;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.activity-hero, .activity-cover {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid rgba(246, 196, 83, .3);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(13, 10, 36, .92), rgba(45, 18, 86, .7) 58%, rgba(10, 16, 28, .76)),
    url("/assets/bm-rules-banner.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 184, .05), 0 16px 36px rgba(0, 0, 0, .28);
}
.activity-hero::after, .activity-cover::after {
  content: "";
  position: absolute;
  inset: auto -20px -34px auto;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 196, 83, .24), transparent 62%);
  pointer-events: none;
}
.activity-hero > *, .activity-cover > * { position: relative; z-index: 1; }
.activity-hero span, .activity-cover span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
}
.activity-hero strong, .activity-cover strong {
  display: block;
  margin-top: 5px;
  font-size: 20px;
}
.activity-hero p, .activity-cover p {
  margin-top: 4px;
  font-size: 12px;
  max-width: 230px;
  color: rgba(255, 246, 220, .82);
}
.activity-hero button, .activity-cover button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 12px;
  color: #101827;
  border-color: transparent;
  background: linear-gradient(180deg, #fde68a, #f6c453);
}
.activity-cover {
  min-height: 156px;
  align-items: end;
  margin-bottom: 10px;
  background:
    linear-gradient(180deg, rgba(12, 9, 36, .26), rgba(12, 9, 36, .92)),
    url("/assets/bm-rules-banner.jpg");
  background-size: cover;
  background-position: center;
}
.activity-cover strong { max-width: 250px; }
.reward-flow {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.reward-flow article {
  display: grid;
  grid-template-columns: 38px 1fr;
  column-gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .78);
}
.reward-flow article span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: #3b2507;
  background: var(--gold);
  font-size: 12px;
  font-weight: 1000;
}
.reward-flow article strong { font-size: 15px; }
.reward-flow article p { margin-top: 3px; font-size: 12px; }
.activity-notes {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.activity-notes p {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  font-size: 12px;
  line-height: 1.45;
}
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.schedule-grid div {
  min-height: 66px;
  padding: 10px;
  border: 1px solid rgba(246, 196, 83, .2);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(143, 22, 13, .2), rgba(15, 23, 42, .76));
}
.schedule-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.schedule-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--gold);
  font-size: 14px;
  line-height: 1.25;
}

.live-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(246, 196, 83, .36);
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(circle at 84% 0%, rgba(246, 196, 83, .22), transparent 36%),
    linear-gradient(145deg, rgba(19, 31, 52, .95), rgba(12, 18, 31, .96));
  box-shadow: 0 18px 44px rgba(0, 0, 0, .34);
}

.live-head, .live-foot, .panel-head, .wallet-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.eyebrow, .wallet-strip span, .count-box span, .mini-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

#drawId { display: block; margin-top: 3px; font-size: 20px; color: var(--gold); }
.count-box {
  min-width: 88px;
  padding: 8px 10px;
  border: 1px solid rgba(246, 196, 83, .28);
  border-radius: 8px;
  background: rgba(8, 13, 24, .72);
  text-align: center;
}
.count-box strong { display: block; margin-top: 3px; color: var(--gold); font-size: 21px; }

.balls {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 14px 0 12px;
}
.balls span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: #0f172a;
  background: linear-gradient(180deg, #fff7d6, #f6c453);
  font-size: 22px;
  font-weight: 1000;
  box-shadow: inset 0 -4px 0 rgba(120, 53, 15, .18);
}
.balls span:last-child {
  color: #eff6ff;
  background: linear-gradient(180deg, #38bdf8, #2563eb);
}
.balls b { color: var(--muted); font-size: 18px; }
.live-foot { color: var(--muted); font-size: 12px; }
.draw-status {
  position: relative;
  overflow: hidden;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px solid rgba(148, 163, 184, .16);
  color: var(--muted);
  font-size: 12px;
}
.draw-status b {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--red));
}
.draw-status.closing span { color: var(--red); }

.wallet-strip {
  margin: 10px 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 16, 28, .86);
}
.wallet-strip div { flex: 1; min-width: 0; }
.wallet-strip strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
  color: var(--text);
  white-space: nowrap;
}

.home-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 10px 0;
}
.feature-card {
  display: grid;
  align-content: center;
  justify-items: start;
  min-height: 72px;
  padding: 12px;
  border-color: rgba(246, 196, 83, .24);
  background:
    radial-gradient(circle at 90% 10%, rgba(56, 189, 248, .16), transparent 42%),
    linear-gradient(145deg, #17243a, #101827);
}
.feature-card span { color: var(--muted); font-size: 12px; }
.feature-card strong { margin-top: 5px; font-size: 15px; }
.activity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.activity-grid div {
  min-height: 82px;
  padding: 10px;
  border: 1px solid rgba(56, 189, 248, .18);
  border-radius: 8px;
  background: rgba(15, 23, 42, .82);
}
.activity-grid div.done {
  border-color: rgba(52, 211, 153, .32);
  background: rgba(20, 83, 45, .22);
}
.activity-grid div.active-task {
  border-color: rgba(246, 196, 83, .42);
  background: linear-gradient(145deg, rgba(143, 22, 13, .36), rgba(15, 23, 42, .82));
}
.activity-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.activity-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--gold);
  font-size: 18px;
}
.activity-grid small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  margin: 10px 0;
  padding: 13px;
  backdrop-filter: blur(8px);
}

.overview-grid, .mine-stats, .record-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.overview-grid div, .mine-stats div, .record-stats div {
  min-height: 64px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .76);
}
.overview-grid span, .mine-stats span, .record-stats span { display: block; color: var(--muted); font-size: 11px; }
.overview-grid strong, .mine-stats strong, .record-stats strong {
  display: block;
  margin-top: 7px;
  font-size: 15px;
  color: var(--text);
  white-space: nowrap;
}

.tag {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(56, 189, 248, .28);
  border-radius: 999px;
  color: var(--blue);
  background: rgba(14, 116, 144, .16);
  font-size: 12px;
  font-weight: 900;
}

.prediction-grid, .stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.metric {
  min-height: 74px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .78);
}
.metric span { color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 7px; font-size: 18px; }
.metric small { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.roadmap {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 6px;
  margin-top: 12px;
}
.road-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 8px;
  color: #07111f;
  font-size: 12px;
  font-weight: 1000;
  background: var(--gold);
}
.road-cell.big { background: #38bdf8; color: #082f49; }
.road-cell.small { background: #f6c453; color: #3b2507; }
.road-cell.extreme { outline: 2px solid rgba(251, 113, 133, .8); }

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.mini-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.chip-list, .dragon-list { display: grid; gap: 7px; }
.chip, .dragon {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  font-size: 12px;
}
.chip b, .dragon b { color: var(--gold); }
.draw-detail {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.detail-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(246, 196, 83, .26);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(143, 22, 13, .24), rgba(15, 23, 42, .82));
}
.detail-total span { color: var(--muted); font-size: 13px; }
.detail-total strong { color: var(--gold); font-size: 22px; }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.detail-row {
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .76);
}
.detail-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.detail-row strong {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 22px;
}
.detail-row small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.35;
}

.stake-box {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0f172a;
}
.stake-box span { color: var(--muted); font-size: 12px; }
input {
  width: 88px;
  height: 30px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
  font-weight: 900;
}
.stake-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 12px 0 10px;
}
.stake-presets button.active {
  color: #2b1904;
  border-color: rgba(246, 196, 83, .78);
  background: linear-gradient(180deg, #fde68a, #f6c453);
}

.bet-hero {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.bet-hero div {
  min-height: 82px;
  padding: 13px;
  border: 1px solid rgba(56, 189, 248, .24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 100% 0%, rgba(56, 189, 248, .18), transparent 38%),
    rgba(15, 23, 42, .9);
}
.bet-hero span { color: var(--muted); font-size: 12px; }
.bet-hero strong { display: block; margin-top: 9px; color: var(--gold); font-size: 22px; }
.bet-slip {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.bet-slip div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .84);
}
.bet-slip span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.bet-slip strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}
.bet-slip .closed { color: var(--red); }
.current-bets-panel {
  border-color: rgba(246, 196, 83, .28);
  background:
    radial-gradient(circle at 100% 0%, rgba(246, 196, 83, .14), transparent 36%),
    rgba(16, 24, 39, .94);
}
.bet-recent-panel { padding-bottom: 11px; }
.bet-recent-rail {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-top: 12px;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.bet-recent-rail::-webkit-scrollbar { display: none; }
.bet-recent-item {
  flex: 0 0 58px;
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .76);
}
.bet-recent-item strong {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #2b1904;
  background: var(--gold);
  font-size: 14px;
}
.bet-recent-item span {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
}
.bet-recent-item small {
  color: var(--muted);
  font-size: 10px;
}
.play-guide {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.play-guide article {
  min-height: 68px;
  padding: 10px;
  border: 1px solid rgba(246, 196, 83, .22);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(143, 22, 13, .22), rgba(15, 23, 42, .82));
}
.play-guide span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.play-guide strong {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.25;
}

.play-group { margin-top: 12px; }
.play-group h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 8px; }
.numbers { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
button {
  min-height: 42px;
  border: 1px solid #334155;
  border-radius: var(--ui-radius);
  color: var(--text);
  background: linear-gradient(180deg, #1d2a40, #111827);
  font-weight: 900;
}
button:active { transform: translateY(1px); }
button:focus-visible,
input:focus-visible {
  outline: 0;
  box-shadow: var(--ui-focus);
}
button:disabled {
  opacity: .58;
  transform: none;
}
.bet-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  text-align: left;
}
.bet-card small { color: var(--muted); font-weight: 800; }
.bet-card.unavailable, .num.unavailable {
  opacity: .52;
  border-color: rgba(148, 163, 184, .16);
  background: rgba(15, 23, 42, .52);
}
.num { min-height: 38px; padding: 0; }

.history, .bets { display: grid; gap: 8px; margin-top: 12px; }
.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, .72);
  border-radius: 8px;
  font-size: 13px;
}
.pill { padding: 4px 8px; border-radius: 999px; background: #0f172a; color: var(--blue); font-weight: 1000; }
.pending { color: var(--gold); }
.won { color: var(--green); }
.lost { color: var(--red); }
.bet-row strong {
  white-space: nowrap;
  text-align: right;
}

.red { color: var(--red); }
.green { color: var(--green); }
.blue { color: var(--blue); }
.gold { color: var(--gold); }

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  padding: 14px;
  border: 1px solid rgba(246, 196, 83, .28);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(13, 10, 36, .94), rgba(38, 18, 80, .72) 48%, rgba(11, 17, 30, .9)),
    url("/assets/bm-rules-banner.jpg");
  background-size: cover;
  background-position: center;
}
.profile-card img {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(246, 196, 83, .44);
}
.profile-card span { color: var(--muted); font-size: 12px; }
.profile-card strong { display: block; margin-top: 4px; font-size: 20px; }
.profile-card p { margin-top: 3px; font-size: 12px; }
.activity-list {
  display: grid;
  gap: 8px;
  margin: 10px 0;
}
.activity-list article {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .82);
}
.activity-list span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.activity-list strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
}
.activity-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}
.activity-list button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 10px;
  color: var(--gold);
  background: rgba(246, 196, 83, .08);
}
.activity-list button:disabled {
  opacity: .58;
  color: var(--muted);
}
.help-panel {
  border-color: rgba(246, 196, 83, .22);
  background:
    radial-gradient(circle at 100% 0%, rgba(246, 196, 83, .12), transparent 36%),
    var(--panel);
}
.help-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.help-list article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
}
.help-list strong {
  display: block;
  color: var(--text);
  font-size: 13px;
}
.help-list p {
  margin-top: 5px;
  font-size: 12px;
  line-height: 1.4;
}
.support-btn {
  width: 100%;
  margin-top: 10px;
  min-height: 40px;
  color: var(--gold);
  border-color: rgba(246, 196, 83, .28);
  background: rgba(246, 196, 83, .08);
}
.leaderboard {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.leader-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  font-size: 13px;
}
.leader-row b {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  color: #331b04;
  background: var(--gold);
}
.leader-row strong { color: var(--green); }
.rules-list { display: grid; gap: 8px; margin-top: 12px; }
.rules-list div, .play-rules div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 42, .72);
  font-size: 13px;
}
.play-rules { display: grid; gap: 8px; margin-top: 12px; }
.rules-list span, .play-rules span { color: var(--muted); }
.rules-list b, .play-rules b { color: var(--gold); text-align: right; }

.bet-confirm {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: end;
  padding: 12px;
  background: rgba(0, 0, 0, .48);
}
.bet-confirm.open { display: flex; }
.confirm-sheet {
  width: 100%;
  max-width: 780px;
  margin: 0 auto calc(env(safe-area-inset-bottom));
  padding: 14px;
  border: 1px solid rgba(246, 196, 83, .34);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(33, 8, 6, .92), rgba(7, 11, 20, .98)),
    url("/assets/bm-rules-banner.jpg");
  background-size: cover;
  background-position: center;
  box-shadow: 0 -22px 54px rgba(0, 0, 0, .42);
}
.confirm-sheet header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}
.confirm-sheet header span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.confirm-sheet header strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
  color: var(--gold);
}
#confirmCancel {
  display: grid;
  place-items: center;
  width: 38px;
  min-height: 38px;
  padding: 0;
  color: var(--text);
  background: rgba(15, 23, 42, .76);
  font-size: 20px;
}
.confirm-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.confirm-grid div {
  min-height: 62px;
  padding: 10px;
  border: 1px solid rgba(246, 196, 83, .2);
  border-radius: 8px;
  background: rgba(15, 23, 42, .78);
}
.confirm-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}
.confirm-grid strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
}
#confirmMeta {
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, .18);
  border-radius: 8px;
  background: rgba(7, 11, 20, .66);
  font-size: 12px;
}
.primary-action {
  width: 100%;
  margin-top: 10px;
  min-height: 46px;
  color: #2b1904;
  border-color: transparent;
  background: linear-gradient(180deg, #fde68a, #f6c453);
}

.game-shell {
  overflow: hidden;
  margin: -8px -12px 0;
  min-height: calc(100vh - 92px);
  padding-bottom: 212px;
  border: 1px solid rgba(124, 58, 237, .28);
  background:
    radial-gradient(circle at 16% 22%, rgba(56, 189, 248, .24), transparent 30%),
    radial-gradient(circle at 86% 8%, rgba(168, 85, 247, .33), transparent 34%),
    linear-gradient(180deg, rgba(34, 20, 92, .74), rgba(8, 13, 31, .92) 46%, rgba(16, 10, 36, .96)),
    url("/assets/bm-game-bg.jpg"),
    linear-gradient(180deg, #22145c 0%, #080d1f 42%, #100a24 100%);
  background-size: auto, auto, auto, cover, auto;
  background-position: center, center, center, top center, center;
}
.game-titlebar {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 7px;
  padding: 8px 10px 6px;
}
.game-titlebar span {
  display: block;
  color: rgba(255, 255, 255, .7);
  font-size: 10px;
}
.game-titlebar strong {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  text-align: center;
}
.back-btn {
  display: grid;
  place-items: center;
  width: 31px;
  min-height: 31px;
  padding: 0;
  border-color: transparent;
  background: rgba(255, 255, 255, .08);
  font-size: 16px;
  line-height: 1;
}
.coin-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 58px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
}
.coin-chip span {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #042f2e;
  background: linear-gradient(180deg, #6ee7b7, #10b981);
  font-size: 11px;
  font-weight: 1000;
}
.coin-chip strong {
  margin: 0;
  color: #fff;
  font-size: 12px;
  text-align: left;
}
.draw-board {
  margin: 3px 10px 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background:
    radial-gradient(circle at 80% 0%, rgba(236, 72, 153, .24), transparent 44%),
    linear-gradient(135deg, rgba(69, 52, 160, .96), rgba(31, 41, 109, .94));
  box-shadow: 0 18px 38px rgba(0, 0, 0, .26);
}
.draw-board > strong {
  display: block;
  padding-top: 10px;
  text-align: center;
  font-size: 14px;
}
.draw-equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 7px 12px;
}
.draw-equation span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  font-size: 15px;
  font-weight: 1000;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .16);
}
.draw-equation span:nth-of-type(1) { background: linear-gradient(180deg, #34d399, #0d9488); }
.draw-equation span:nth-of-type(2) { background: linear-gradient(180deg, #fb7185, #e11d48); }
.draw-equation span:nth-of-type(3) { background: linear-gradient(180deg, #3b82f6, #1d4ed8); }
.draw-equation span:nth-of-type(4) { background: linear-gradient(180deg, #fb923c, #f97316); }
.draw-equation b {
  color: rgba(255, 255, 255, .88);
  font-size: 15px;
}
.draw-board-foot {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 9px;
  background: rgba(19, 24, 72, .72);
  color: rgba(255, 255, 255, .78);
  font-size: 12px;
  font-weight: 900;
}
.draw-board-foot b { font-size: 14px; }
.draw-board-foot #betDrawState { color: #f6c453; }
.countdown-box {
  padding: 4px 6px;
  border-radius: 5px;
  color: #fff;
  background: #090914;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 1px;
}
.game-tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 10px 2px;
}
.game-tabs button {
  position: relative;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, .72);
  font-size: 13px;
}
.game-tabs button.active {
  color: #fff;
}
.game-tabs button.active::after {
  content: "";
  position: absolute;
  left: 24%;
  right: 24%;
  bottom: 0;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e879f9, #7c3aed);
}
.bet-section { display: none; padding: 8px 10px 12px; }
.bet-section.active { display: block; }
.bet-desk {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 0;
  min-height: 270px;
  border-radius: 8px;
  background: rgba(9, 13, 34, .52);
}
.bet-side-tabs {
  display: grid;
  align-content: start;
  overflow: hidden;
  border-radius: 8px 0 0 8px;
  background: rgba(77, 68, 150, .66);
}
.bet-side-tabs button {
  min-height: 50px;
  padding: 0 5px;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: transparent;
  font-size: 12px;
  line-height: 1.18;
}
.bet-side-tabs button.active {
  background: linear-gradient(180deg, #df2cff, #531dff);
}
.bet-category-content {
  min-width: 0;
  padding: 0 0 10px 8px;
}
.bet-category-panel { display: none; }
.bet-category-panel.active { display: block; }
.bet-category-panel h3,
.road-card h3 {
  margin: 0 0 7px;
  padding-top: 2px;
  color: #fff;
  font-size: 14px;
}
.odds-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 12px;
}
.odds-card {
  display: grid;
  place-items: center;
  min-height: 47px;
  padding: 5px 4px;
  border: 1px solid rgba(255, 255, 255, .06);
  background: linear-gradient(180deg, rgba(54, 57, 112, .96), rgba(37, 36, 82, .96));
}
.odds-card strong {
  font-size: 15px;
  line-height: 1;
}
.odds-card span {
  display: block;
  margin-top: 3px;
  color: rgba(255, 255, 255, .72);
  font-size: 11px;
}
.odds-card.unavailable,
.odds-num.unavailable {
  opacity: .48;
  filter: grayscale(.25);
}
.number-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}
.odds-num {
  min-height: 31px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .08);
  background: linear-gradient(180deg, rgba(48, 55, 111, .96), rgba(31, 31, 76, .96));
}
.road-card {
  margin-bottom: 9px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: 8px;
  background: rgba(34, 37, 84, .74);
}
.bet-road-grid {
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-auto-rows: 18px;
  gap: 2px;
  min-height: 94px;
  padding: 5px 2px;
  background-image:
    linear-gradient(rgba(255, 255, 255, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .08) 1px, transparent 1px);
  background-size: 18px 18px;
}
.road-dot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  color: #fff;
  font-size: 10px;
  font-weight: 1000;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
}
.road-dot.big,
.road-dot.odd { background: linear-gradient(180deg, #fb7185, #e11d48); }
.road-dot.small,
.road-dot.even { background: linear-gradient(180deg, #38bdf8, #0284c7); }
.game-shell .current-bets-panel {
  margin: 0;
  padding: 9px;
  border-radius: 8px;
  background: rgba(18, 22, 55, .78);
}
.game-shell .play-rules {
  margin: 0;
}
.game-shell .play-rules div {
  background: rgba(33, 37, 89, .78);
  font-size: 11px;
}
.game-shell .target-rules {
  gap: 8px;
  padding-bottom: 6px;
}
.game-shell .target-rules div {
  min-height: 42px;
  align-items: center;
  padding: 8px 10px;
  border-color: rgba(99, 102, 241, .24);
  background: rgba(34, 38, 90, .88);
}
.game-shell .target-rules span {
  flex: 0 0 74px;
  color: rgba(210, 218, 244, .68);
  font-size: 13px;
  font-weight: 900;
}
.game-shell .target-rules b {
  min-width: 0;
  color: #f6c453;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.stake-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 58px;
  z-index: 6;
  display: grid;
  gap: 7px;
  padding: 8px 10px 10px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  background: rgba(34, 34, 82, .92);
  backdrop-filter: blur(14px);
}
.stake-bar > span {
  color: rgba(255, 255, 255, .76);
  font-size: 11px;
}
.stake-bar .stake-presets {
  margin: 0;
}
.stake-bar .stake-presets button {
  min-height: 38px;
  border-color: rgba(255, 255, 255, .06);
  background: rgba(61, 61, 117, .92);
  font-size: 14px;
}
.stake-bar label {
  display: block;
}
.stake-bar input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(5, 8, 22, .52);
  font-size: 12px;
}
.stake-actions {
  display: grid;
  grid-template-columns: .8fr 1.2fr;
  gap: 7px;
}
.stake-actions button {
  min-height: 36px;
  border-color: transparent;
}
.stake-actions #clearPick {
  background: rgba(255, 255, 255, .08);
}
.stake-actions #quickSubmit {
  color: #fff;
  background: linear-gradient(180deg, #fb7185, #f43f5e);
}
.stake-bar p {
  color: rgba(255, 255, 255, .68);
  font-size: 10px;
}
.stake-bar p b { color: #fff; }
.game-record-card {
  margin-top: 10px;
}
.game-record-list {
  display: grid;
  gap: 8px;
}
.game-record-list .bet-row {
  background: rgba(7, 9, 28, .42);
}

@media (min-width: 680px) {
  .app {
    max-width: 780px;
    margin: 0 auto;
    padding-left: 18px;
    padding-right: 18px;
  }
  .grid { grid-template-columns: repeat(4, 1fr); }
  .numbers { grid-template-columns: repeat(14, 1fr); }
  .stake-bar {
    left: 50%;
    right: auto;
    width: 780px;
    max-width: 100vw;
    transform: translateX(-50%);
  }
  .bottom-nav {
    left: 50%;
    right: auto;
    width: 780px;
    max-width: 100vw;
    transform: translateX(-50%);
  }
}

@media (max-width: 380px) {
  .play-guide { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .schedule-grid { grid-template-columns: 1fr; }
}
