:root {
  --bg-base: #0f1419;
  --bg-deep: #0b0f13;
  --bg-card: #151c23;
  --bg-card-hover: #1b232c;
  --line-soft: rgba(255, 255, 255, 0.08);
  --line-gold: rgba(245, 184, 0, 0.40);
  --text-main: #ffffff;
  --text-sub: #a3b1bf;
  --text-muted: #6c7a89;
  --gold-1: #fcd34d;
  --gold-2: #f5b800;
  --gold-3: #c98e00;
  --live-green: #00e701;
  --danger: #ef4444;
  --nav-h: 58px;
  --shadow-sm: 0 8px 20px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.38);
  --shadow-lg: 0 22px 48px rgba(0, 0, 0, 0.48);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
}
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0; width: 100%; max-width: 100%; min-height: 100%; overflow-x: hidden;
  background-color: var(--bg-base); color: var(--text-main); font-size: 13px; line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.55; }
a { color: inherit; text-decoration: none; }
::selection { background: rgba(245, 184, 0, 0.25); color: #fff; }
.app-shell, .wallet-page, .game-page {
  width: 100%; min-height: 100dvh; margin: 0 auto;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px);
  position: relative; overflow-x: hidden;
}
.app-topbar {
  height: 54px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: 0 14px; border-bottom: 1px solid var(--line-soft); background: var(--bg-base);
}
.brand-mark {
  width: 36px; height: 36px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--bg-card-hover); border: 1px solid var(--line-gold);
  color: var(--gold-2); font-size: 11px; font-weight: 900; overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-name { font-size: 15px; font-weight: 800; color: var(--text-main); }
.top-spacer { flex: 1; }
.icon-btn {
  width: 34px; min-width: 34px; height: 34px; flex-shrink: 0; border: 1px solid var(--line-soft);
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-sub); background: var(--bg-card); font-size: 15px;
}
.icon-btn:hover { border-color: var(--line-gold); color: var(--gold-2); }
.button {
  min-height: 44px; padding: 0 18px; border: 1px solid transparent; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 14px; font-weight: 800; color: #0f1419; background: var(--gold-2);
}
.button-outline { flex: 1; color: var(--text-main); border-color: var(--line-soft); background: var(--bg-card-hover); }
.button-fill { flex: 1; color: #0f1419; background: var(--gold-2); }
.button-danger { color: #fff; background: var(--danger); }
.button-quiet { color: var(--text-sub); background: var(--bg-card); border-color: var(--line-soft); }
.notice {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px; margin-bottom: 10px;
  border-radius: 10px; font-size: 12px; background: rgba(245, 184, 0, 0.14);
  border: 1px solid var(--line-gold); color: var(--gold-2);
}
.notice span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marquee {
  display: flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; margin-bottom: 10px;
  border-radius: 10px; background: var(--bg-card); border: 1px solid var(--line-soft); overflow: hidden;
}
.marquee .mq-icon { display: inline-flex; color: var(--gold-2); flex-shrink: 0; }
.marquee .mq-icon svg { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 2; }
.marquee .mq-track { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
.marquee .mq-text { display: inline-block; padding-left: 100%; font-size: 12px; color: var(--text-sub); animation: mqScroll 18s linear infinite; }
@keyframes mqScroll { to { transform: translateX(-100%); } }
.marquee .mq-arrow { color: var(--text-muted); font-size: 14px; flex-shrink: 0; }
.app-shell.home-app { max-width: 430px; padding: 10px 14px calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); }
.home-topbar { display: flex; align-items: center; gap: 10px; height: 46px; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line-soft); }
.home-topbar .brand-text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.home-topbar .brand-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wallet-card { background: var(--bg-card); border: 1px solid var(--line-gold); border-radius: 16px; padding: 14px 16px; margin-bottom: 10px; }
.wc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.wc-hi { font-size: 12.5px; font-weight: 600; color: var(--text-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wc-support { display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--line-soft); background: var(--bg-base); color: var(--text-sub); font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.wc-support i { display: inline-flex; width: 13px; height: 13px; }
.wc-support svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.wc-balance { margin-bottom: 12px; }
.wc-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 3px; }
.wc-amount-row { display: flex; align-items: center; gap: 8px; }
.wc-amount { font-size: 26px; line-height: 1.1; font-weight: 900; font-variant-numeric: tabular-nums; color: var(--gold-2); }
.wc-eye { width: 26px; height: 26px; border-radius: 8px; border: 1px solid var(--line-soft); background: var(--bg-base); color: var(--text-sub); font-size: 13px; display: inline-flex; align-items: center; justify-content: center; }
.wc-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.wc-btn { height: 38px; border-radius: 10px; font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.wc-btn.primary { background: var(--gold-2); color: #0f1419; }
.wc-btn.secondary { background: var(--bg-base); color: var(--text-main); border: 1px solid var(--line-soft); }
.category-tabs { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--line-soft); margin-bottom: 10px; }
.cat-tab { height: 30px; padding: 0 14px; border-radius: 7px; border: 0; background: transparent; color: var(--text-sub); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.cat-tab.active { background: var(--bg-card-hover); color: var(--gold-2); }
.games-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.game-card { display: flex; align-items: center; gap: 10px; padding: 10px; min-height: 70px; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--line-soft); }
.game-symbol { width: 48px; height: 48px; flex-shrink: 0; border-radius: 10px; background: var(--bg-base); border: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.game-symbol img { width: 100%; height: 100%; object-fit: contain; display: block; }
.game-info { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 5px; }
.game-info h3 { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--text-main); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; }
.live-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: rgba(0, 231, 1, 0.12); color: var(--live-green); font-size: 10.5px; font-weight: 700; }
.live-badge i { width: 5px; height: 5px; border-radius: 50%; background: var(--live-green); }
.empty-card { grid-column: 1 / -1; padding: 28px 12px; text-align: center; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--line-soft); color: var(--text-muted); }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 430px; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: rgba(15, 20, 25, 0.94); backdrop-filter: blur(16px); border-top: 1px solid var(--line-soft); display: flex; align-items: center; justify-content: space-around; z-index: 40; }
.nav-item { flex: 1; height: var(--nav-h); border: 0; background: transparent; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 0; }
.nav-item.active { color: var(--gold-2); }
.nav-item i { display: inline-flex; width: 20px; height: 20px; }
.nav-item svg, .wallet-action i svg, .menu-item i svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.85; stroke-linecap: round; stroke-linejoin: round; }
.modal-backdrop { position: fixed; z-index: 80; inset: 0; display: none; align-items: flex-end; justify-content: center; background: rgba(7, 10, 14, 0.78); backdrop-filter: blur(6px); padding: 12px; }
.modal-backdrop.show { display: flex; }
.modal { width: 100%; max-width: 460px; max-height: 88dvh; overflow-y: auto; padding: 18px; border: 1px solid var(--line-gold); border-radius: 16px; color: var(--text-main); background: var(--bg-card); }
.modal-head { display: flex; align-items: center; margin-bottom: 14px; }
.modal-head h3 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text-main); }
.modal-close { margin-left: auto; width: 30px; height: 30px; border: 1px solid var(--line-soft); border-radius: 8px; color: var(--text-sub); background: var(--bg-card-hover); font-size: 18px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; margin-bottom: 6px; color: var(--text-sub); font-size: 12px; font-weight: 700; }
.form-row input, .form-row select, .form-row textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-soft); border-radius: 10px; outline: none; color: var(--text-main); background: var(--bg-base); }
.form-row textarea { min-height: 88px; resize: vertical; }
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--gold-2); }
.form-hint { margin-top: 6px; color: var(--text-muted); font-size: 12px; line-height: 1.5; }
.modal-message, .auth-message { min-height: 18px; margin: 10px 0 0; color: var(--gold-2); font-size: 12.5px; font-weight: 600; }
.auth-page { min-height: 100dvh; display: grid; place-items: center; padding: 20px 14px; background: var(--bg-base); }
.auth-card { width: min(100%, 420px); padding: 24px 20px; border: 1px solid var(--line-gold); border-radius: 16px; background: var(--bg-card); }
.auth-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.auth-brand strong { color: var(--text-main); font-size: 19px; font-weight: 900; }
.auth-card h1 { margin: 0; color: var(--text-main); font-size: 24px; font-weight: 800; }
.auth-card .intro { margin: 6px 0 18px; color: var(--text-sub); font-size: 12.5px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; margin-bottom: 18px; border-radius: 10px; background: var(--bg-base); border: 1px solid var(--line-soft); }
.auth-tab { min-height: 36px; border: 0; border-radius: 8px; color: var(--text-sub); background: transparent; font-weight: 700; }
.auth-tab.active { color: #0f1419; background: var(--gold-2); }
.auth-pane { display: none; }
.auth-pane.active { display: block; }
.captcha-row { display: grid; grid-template-columns: 1fr 122px; gap: 8px; align-items: end; }
.captcha-box { height: 44px; overflow: hidden; border: 1px solid var(--line-soft); border-radius: 10px; background: #fff; padding: 0; }
.captcha-box svg { width: 120px; height: 42px; display: block; }
.wallet-page { max-width: 480px; padding: 0 0 calc(var(--nav-h) + env(safe-area-inset-bottom) + 18px); }
.profile-hero { padding: 18px 16px 14px; display: flex; align-items: center; gap: 12px; }
.profile-avatar { width: 56px; height: 56px; flex-shrink: 0; border: 1px solid var(--line-gold); border-radius: 16px; display: grid; place-items: center; color: var(--gold-2); background: var(--bg-card-hover); font-size: 26px; overflow: hidden; }
.profile-hero h1 { margin: 0; font-size: 18px; font-weight: 800; color: var(--text-main); }
.wallet-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 14px 14px; }
.wallet-box { padding: 14px; border: 1px solid var(--line-gold); border-radius: 16px; background: var(--bg-card); }
.wallet-box .w-title { display: flex; align-items: center; justify-content: space-between; color: var(--text-sub); font-size: 12px; font-weight: 700; }
.wallet-amount { margin-top: 10px; display: flex; align-items: baseline; gap: 5px; }
.wallet-box .collect { width: 100%; min-height: 34px; margin-top: 10px; border: 1px solid var(--line-soft); border-radius: 10px; color: var(--text-main); background: var(--bg-card-hover); font-size: 12px; font-weight: 700; }
.wallet-section { margin: 0 14px 12px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--bg-card); }
.wallet-section h2 { margin: 0 0 12px; color: var(--text-main); font-size: 14px; font-weight: 800; }
.wallet-menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.wallet-action { min-height: 76px; border: 0; border-radius: 12px; display: grid; justify-items: center; align-content: center; gap: 6px; color: var(--text-sub); background: transparent; font-size: 11.5px; font-weight: 600; }
.wallet-action i { width: 38px; height: 38px; border: 1px solid var(--line-soft); border-radius: 12px; display: grid; place-items: center; background: var(--bg-base); color: var(--gold-2); font-style: normal; }
.vip-current { padding: 16px; border-radius: 14px; color: #0f1419; background: var(--gold-2); }
.vip-current span { display: block; font-size: 12px; font-weight: 700; }
.vip-current b { display: block; margin-top: 4px; font-size: 26px; font-weight: 900; }
.vip-list { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 12px; background: var(--bg-base); }
.vip-list p { margin: 6px 0; color: var(--text-sub); font-size: 12.5px; }
.vip-list b { color: var(--gold-2); }
.game-page { max-width: 480px; }
.game-top { min-height: 54px; height: auto; padding: 6px 54px 6px 14px; position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px; color: var(--text-main); background: var(--bg-base); border-bottom: 1px solid var(--line-soft); }
.game-back { width: 34px; height: 34px; border: 1px solid var(--line-soft); border-radius: 10px; color: var(--text-main); background: var(--bg-card); font-size: 18px; display: grid; place-items: center; }
.game-title { min-width: 0; flex: 1; }
.game-title strong { display: block; overflow: hidden; font-size: 15px; font-weight: 800; white-space: nowrap; text-overflow: ellipsis; }
.game-title span { display: block; color: var(--text-muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.draw-panel { margin: 12px 14px; padding: 14px; border: 1px solid var(--line-gold); border-radius: 16px; background: var(--bg-card); }
.balls { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; min-height: 56px; margin: 12px 0; }
.draw-waiting { width: 100%; text-align: center; color: var(--text-muted); font-size: 13px; padding: 8px 0; }
.ball { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line-gold); border-radius: 50%; color: #0f1419; background: var(--gold-2); font-size: 15px; font-weight: 900; }
.rolling-ball { overflow: hidden; position: relative; }
.rolling-ball .roll-strip { display: flex; flex-direction: column; align-items: center; line-height: 36px; animation: digitRoll var(--dur, 1.2s) linear infinite; animation-delay: var(--delay, 0s); }
@keyframes digitRoll { from { transform: translateY(0); } to { transform: translateY(-360px); } }
.bet-area, .game-pane { margin: 0 14px 12px; padding: 14px; border: 1px solid var(--line-soft); border-radius: 16px; background: var(--bg-card); }
.panel-title { margin: 0 0 12px; font-size: 14px; font-weight: 800; color: var(--text-main); }
.bet-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bet-choice { min-height: 54px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 10px; text-align: left; color: var(--text-sub); background: var(--bg-base); }
.bet-choice b { display: block; color: var(--text-main); font-size: 13px; }
.bet-choice small { display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px; }
.stake-bar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 12px; }
.stake-bar input { min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--line-soft); border-radius: 10px; outline: none; background: var(--bg-base); color: var(--text-main); }
.chips { display: flex; gap: 6px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-width: 44px; height: 30px; border: 1px solid var(--line-soft); border-radius: 999px; color: var(--text-sub); background: var(--bg-base); font-size: 11.5px; font-weight: 700; }
.game-tabs { display: flex; gap: 6px; margin: 12px 14px 10px; padding: 4px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--line-soft); }
.game-tab { flex: 1; height: 34px; border: 0; border-radius: 8px; color: var(--text-sub); background: transparent; font-size: 12px; font-weight: 700; }
.game-pane { display: none; }
.game-pane.active { display: block; }
.list-record { padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 12.5px; }
.list-record:last-child { border-bottom: 0; }
.list-record b { color: var(--text-main); }
.list-record span { float: right; color: var(--gold-2); font-weight: 700; }
.lang-switch { position: relative; display: inline-flex; align-items: center; z-index: 9998; }
.lang-switch.fixed { position: fixed; top: max(10px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 99998; }
.lang-switch #langBtn { width: 34px; height: 34px; padding: 0; display: grid; place-items: center; border: 1px solid var(--line-soft); border-radius: 10px; color: var(--text-sub); background: var(--bg-card); font-size: 12px; font-weight: 800; }
.lang-menu { position: fixed; z-index: 99999; display: none; flex-direction: column; gap: 3px; padding: 6px; border: 1px solid var(--line-gold); border-radius: 12px; background: var(--bg-card); min-width: 126px; }
.lang-menu.open { display: flex; }
.lang-menu button { min-width: 114px; height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-sub); font-size: 13px; font-weight: 700; text-align: left; }
.lang-menu button.on { background: rgba(245, 184, 0, 0.16); color: var(--gold-2); }
.admin-empty { padding: 32px 15px; text-align: center; color: var(--text-muted); }
/* 小屏（≤430px）卡片较窄：压缩玩法信息与状态徽标，保证「每N秒 · 开放中」不被裁切 */
@media (max-width: 430px) {
  .game-card { min-width: 0; padding: 9px 8px; gap: 8px; }
  .game-meta { font-size: 10px; gap: 4px; }
  .live-badge { font-size: 10px; padding: 2px 6px; gap: 3px; flex-shrink: 0; }
}
@media (min-width: 768px) {
  .app-shell.home-app { max-width: 740px; padding: 18px 24px 96px; }
  .wallet-card { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "head head" "balance actions"; align-items: center; column-gap: 20px; padding: 18px 22px; margin-bottom: 14px; }
  .wc-head { grid-area: head; }
  .wc-balance { grid-area: balance; margin-bottom: 0; }
  .wc-amount { font-size: 30px; }
  .wc-actions { grid-area: actions; min-width: 240px; }
  .games-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .bottom-nav { max-width: 520px; bottom: 14px; height: 58px; padding-bottom: 0; border-radius: 16px; border: 1px solid var(--line-soft); }
  .modal-backdrop { align-items: center; }
  .wallet-page, .game-page { max-width: 740px; }
  .bet-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 1200px) {
  .app-shell.home-app { max-width: 1180px; padding: 22px 32px 100px; }
  .games-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
  .game-page { max-width: 1180px; padding: 16px 28px 100px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px; align-content: start; }
  .game-page .game-top, .game-page .notice, .game-page .game-tabs, .game-page .game-pane { grid-column: 1 / -1; margin-left: 0; margin-right: 0; }
  .game-page .draw-panel, .game-page .bet-area { margin: 0; }
}
