/* ==========================================================================
   MS39 mobile layer — black + gold, app-style.
   Loaded after m.css. Re-points the build's own blue tokens at gold, then
   styles the new home, top bar and bottom bar.
   ========================================================================== */

:root {
  --m-blue:       #d4a937;
  --m-blue-lit:   #e9c35f;
  --m-blue-deep:  #f5d97f;
  --m-teal:       #d4a937;
  --m-logo-green:       #d4a937;
  --m-logo-green-lit:   #ecc865;
  --m-logo-green-deep:  #a47c1c;
  --m-logo-orange:      #d4a937;
  --m-logo-orange-lit:  #ecc865;
  --m-logo-orange-deep: #a47c1c;
  --m-ground:     #0a0a0b;
  --m-line:       #26241f;
  --m-shadow:     none;
  --m-card:       none;
  --m-tint-blue:   rgba(212, 169, 55, .14);
  --m-tint-indigo: rgba(212, 169, 55, .14);
  --m-tint-green:  rgba(63, 180, 111, .16);
  --m-tint-purple: rgba(212, 169, 55, .14);
  --m-tint-amber:  rgba(212, 169, 55, .18);
}

body.mgk {
  background: var(--c-bg);
  color: var(--c-ink);
  padding-top: 0;
}
body.mgk.has-bottom-nav { padding-bottom: 86px; }
body.mgk h1, body.mgk h2, body.mgk h3, body.mgk h4, body.mgk h5 { color: var(--c-ink); }

/* Buttons that sat on the old palette */
body.mgk .btn-orange, body.mgk .btn-gold, body.mgk .m-vip-btn, body.mgk .btn-primary {
  background: var(--gold-grad) !important; color: var(--on-gold) !important; border: 0 !important; font-weight: 600;
}
body.mgk .acc-submit:not(:disabled) { color: var(--on-gold); }
body.mgk .pill-new { background: var(--gold-grad); color: var(--on-gold); }

/* --- Top bar --------------------------------------------------------------- */
.mg-top {
  position: sticky !important; top: 0; left: auto !important; transform: none !important; width: 100%; z-index: 40;
  height: 60px; padding: 0 14px;
  display: flex !important; align-items: center; justify-content: space-between;
  background: #0a0a0b !important; border-bottom: 1px solid rgba(255, 255, 255, .04);
  box-shadow: none !important;
}
.mg-top .brand-logo img { height: 34px; width: auto; }
.mg-hello { display: flex; align-items: center; gap: 10px; min-width: 0; }
.mg-mark { width: 36px; height: 36px; flex: 0 0 36px; }
.mg-hello b { display: block; font-size: 17px; line-height: 1.15; color: var(--c-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 52vw; }
.mg-hello small { font-size: 11.5px; color: var(--c-muted); }
/* Home only: the logo ahead of the greeting, split from it by a hairline. The
   text column takes what is left and ellipsises, so a long username or a long
   translated tagline never pushes the language button off the row. */
.mg-hello-logo { flex: 0 0 auto; display: flex; align-items: center; padding-right: 10px; border-right: 1px solid rgba(212, 169, 55, .25); }
.mg-hello-logo img { height: 26px; width: auto; display: block; }
.mg-hello-txt { min-width: 0; }
.mg-hello-txt b { max-width: none; }
.mg-hello-txt small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-top-acts {
  display: flex; align-items: center; gap: 0;
  background: var(--c-surface); border: 1px solid var(--gold-line); border-radius: 12px; padding: 3px;
}
.mg-top-acts .sep { width: 1px; height: 18px; background: var(--gold-line); }
.mg-ico {
  width: 36px; height: 34px; display: grid; place-items: center;
  background: none; border: 0; color: var(--gold); font-size: 17px;
}

/* --- Drawer, repainted ---------------------------------------------------- */
body.mgk .m-drawer { background: #111113; color: var(--c-ink); }
body.mgk .drawer-grid a, body.mgk .drawer-grid button { color: var(--c-body); }
body.mgk .drawer-grid .ico { background: var(--gold-glow); color: var(--gold); }

/* --- Home ----------------------------------------------------------------- */
.mg-home { padding: 6px 14px 10px; }
.mg-wallet { padding: 4px 2px 12px; }
.mg-bal { display: flex; align-items: center; gap: 8px; }
.mg-bal .cur { font-size: 24px; font-weight: 700; color: var(--gold); }
.mg-bal b { font-size: 26px; font-weight: 700; color: var(--c-ink); }
.mg-bal b.masked { color: transparent; text-shadow: 0 0 12px rgba(244, 239, 226, .55); }
.mg-bal .eye { background: none; border: 0; color: var(--c-muted); font-size: 19px; }
.mg-bal-acts { display: flex; align-items: center; gap: 16px; margin-top: 8px; }
.mg-pill { height: 34px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--gold); color: var(--gold-lit); display: inline-flex; align-items: center; font-weight: 600; }
.mg-link { color: var(--c-body); }

.mg-guest {
  padding: 16px; border-radius: 16px; border: 1px solid var(--gold-line);
  background: linear-gradient(130deg, #221c0e, #141416 70%);
}
.mg-guest b { display: block; color: var(--gold-lit); font-size: 19px; }
.mg-guest span { color: var(--c-body); font-size: 12.5px; }
.mg-auth { display: flex; gap: 10px; margin-top: 12px; }
.mg-btn { flex: 1; height: 42px; border-radius: 999px; display: grid; place-items: center; font-weight: 600; }
.mg-btn.gold { background: var(--gold-grad); color: var(--on-gold); }
.mg-btn.ghost { border: 1px solid var(--gold-line); color: var(--gold-lit); }

.mg-quick {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: linear-gradient(180deg, #1a1810, #141416);
  border: 1px solid var(--gold-line); border-radius: 16px; padding: 10px 2px; margin-bottom: 14px;
}
.mg-quick a { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--gold-lit); font-size: 11px; font-weight: 600; border-right: 1px solid rgba(212, 169, 55, .14); text-align: center; }
.mg-quick a:last-child { border-right: 0; }
.mg-quick a i { font-size: 20px; color: var(--gold); }

.mg-hero { border-radius: 16px; overflow: hidden; border: 1px solid var(--c-line); aspect-ratio: 2172 / 724; }
.mg-hero .dots { left: 0; right: 0; justify-content: center; }
.mg-hero .dots button { background: rgba(255, 255, 255, .5); }
.mg-hero .dots button.active { background: var(--gold); }
body.mgk .m-ticker, body.mgk .ticker-bar { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 12px; margin-top: 10px; }
body.mgk .ticker-bar .ico, body.mgk .m-ticker .ico { color: var(--gold); }

.mg-rewards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.mg-rewards .col-l { display: grid; gap: 8px; }
.mg-reward {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 8px;
  padding: 10px; border-radius: 14px; background: var(--c-surface); border: 1px solid var(--c-line);
}
.mg-reward .ic { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 10px; display: grid; place-items: center; background: var(--gold-glow); color: var(--gold); font-size: 16px; }
.mg-reward b { font-size: 12px; line-height: 1.25; color: var(--c-ink); font-weight: 600; }
.mg-reward.tall { flex-direction: column; align-items: flex-start; justify-content: space-between; background: linear-gradient(140deg, #221c0e, #151517 70%); border-color: var(--gold-line); }
.mg-reward.tall b { font-size: 14px; color: var(--gold-lit); position: relative; z-index: 1; }
.mg-reward .deco { position: absolute; right: -6px; bottom: -10px; font-size: 64px; color: rgba(212, 169, 55, .1); }

/* Lobby: vertical category rail + platform cards */
.mg-lobby { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 8px; margin-top: 16px; }
.mg-cat-rail { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 68px; align-self: start; }
.mg-cat-rail button {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px;
  border-radius: 12px; border: 1px solid var(--c-line); background: var(--c-surface);
  color: var(--c-muted); font-size: 10px; line-height: 1.15;
}
.mg-cat-rail button i { font-size: 19px; color: var(--gold); }
.mg-cat-rail button.active { background: var(--gold-grad); color: var(--on-gold); border-color: transparent; font-weight: 600; }
.mg-cat-rail button.active i { color: var(--on-gold); }
.mg-lobby-body { min-width: 0; }
.mg-logo-strip { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 6px; scrollbar-width: none; }
.mg-logo-strip::-webkit-scrollbar { display: none; }
.mg-logo-strip a { flex: 0 0 76px; height: 40px; border-radius: 9px; display: grid; place-items: center; background: var(--c-surface); border: 1px solid var(--c-line); padding: 4px; font-size: 9.5px; color: var(--c-body); text-align: center; }
.mg-logo-strip a.maint { opacity: .45; }
.mg-logo-strip img { max-width: 100%; max-height: 100%; object-fit: contain; }
.mg-lobby .plat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; background: none; padding: 0; }
/* Same box as the desktop card (PLATFORM_ICON_BOX, 520×676): scaled, never cut. */
.mg-lobby .plat-tile img { border-radius: 12px; aspect-ratio: 520 / 676; object-fit: contain;
  /* Thin gold frame, matching the desktop card. */
  border: 1.5px solid rgba(212, 169, 55, .55); background: var(--c-surface); box-sizing: border-box; }
.mg-lobby .prov-grid { background: none; padding: 0; }

.mg-sec { margin-top: 20px; }
.mg-sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.mg-sec-head h2 { font-size: 16px; font-weight: 700; margin: 0; padding-left: 10px; position: relative; }
.mg-sec-head h2::before { content: ''; position: absolute; left: 0; top: 3px; bottom: 3px; width: 3px; border-radius: 3px; background: var(--gold-grad); }
.mg-sec-head a { font-size: 12px; color: var(--gold); }
.mg-rail { display: grid; grid-auto-flow: column; grid-auto-columns: 30%; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.mg-game .thumb { position: relative; aspect-ratio: 1; border-radius: 12px; overflow: hidden; border: 1px solid var(--c-line); }
.mg-game .thumb img { width: 100%; height: 100%; object-fit: cover; }
.mg-game .name { font-size: 11px; color: var(--c-body); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.mg-promos { display: grid; gap: 10px; }
.mg-promo { display: block; border-radius: 14px; overflow: hidden; background: var(--c-surface); border: 1px solid var(--c-line); }
.mg-promo img, .mg-promo .thumb { width: 100%; display: block; aspect-ratio: 1920 / 700; object-fit: cover; }
.mg-promo .ttl { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; font-size: 13px; }
.mg-promo .ttl b { color: var(--c-ink); font-weight: 600; }
.mg-promo .ttl em { font-style: normal; color: var(--gold); white-space: nowrap; }

.mg-games { padding-top: 0; }
.mg-games .mg-lobby { margin-top: 10px; }

/* --- Bottom bar ------------------------------------------------------------ */
.mg-bottom {
  background: #111113 !important; border-top: 1px solid var(--gold-line) !important;
  padding: 6px 4px calc(8px + env(safe-area-inset-bottom)) !important; overflow: visible;
}
.mg-bottom a { color: var(--c-muted) !important; font-size: 10.5px !important; background: none !important; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mg-bottom a .ic i { font-size: 20px; margin: 0; }
.mg-bottom a.active { color: var(--gold-lit) !important; }
.mg-bottom a.active .ic i { color: var(--gold); }
.mg-bottom a.mg-home .ic {
  width: 54px; height: 54px; margin-top: -26px; border-radius: 50%;
  display: grid; place-items: center; background: var(--gold-grad);
  box-shadow: 0 0 0 5px #0a0a0b, 0 6px 18px rgba(212, 169, 55, .35);
}
.mg-bottom a.mg-home .ic i { color: var(--on-gold); font-size: 23px; }
.mg-bottom a.mg-home { color: var(--gold-lit) !important; font-weight: 600; }

/* --- Footer and floating buttons --------------------------------------------- */
body.mgk .m-footer { background: transparent; border-top: 1px solid var(--c-line); margin: 24px 14px 0; padding: 22px 0 30px; }
body.mgk .m-footer h5 { color: var(--c-faint); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
body.mgk .m-footer .foot-badges.lg img { filter: invert(1) grayscale(1) brightness(.75); }
body.mgk .m-footer .copyright { color: var(--c-faint); }
body.mgk .float-chat { background: var(--gold-grad); color: var(--on-gold); bottom: 96px; }
body.mgk .float-top { background: var(--c-surface); color: var(--gold); border: 1px solid var(--gold-line); bottom: 150px; }

/* --- Inner pages: back bars, cards, forms ------------------------------------ */
body.mgk .m-acc-bar, body.mgk .m-page-bar { background: #0a0a0b; border-bottom: 1px solid rgba(255, 255, 255, .04); }
body.mgk .m-acc-bar .back, body.mgk .m-page-bar .back { color: var(--gold); }
body.mgk .m-acc-bar .ttl, body.mgk .m-page-bar .ttl { color: var(--c-ink); }
body.mgk .m-acc-tile, body.mgk .m-acc-card, body.mgk .acc-card, body.mgk .m-card, body.mgk .m-promo-card,
body.mgk .auth-card, body.mgk .m-wallet-card {
  background: var(--c-surface); border: 1px solid var(--c-line); box-shadow: none; color: var(--c-ink);
}
body.mgk .form-control, body.mgk .form-select {
  background-color: var(--c-soft); border: 1px solid var(--c-line); color: var(--c-ink); border-radius: 12px;
}
body.mgk .form-control::placeholder { color: var(--c-faint); }
body.mgk .form-control:focus, body.mgk .form-select:focus { border-color: var(--gold); background-color: var(--c-soft); color: var(--c-ink); }
body.mgk label { color: var(--c-body); }
body.mgk table, body.mgk .table { color: var(--c-body); --bs-table-bg: transparent; --bs-table-color: var(--c-body); }
body.mgk dialog { background: var(--c-surface); color: var(--c-ink); border: 1px solid var(--gold-line); }
body.mgk dialog::backdrop { background: rgba(0, 0, 0, .7); }
body.mgk .text-muted, body.mgk .text-muted-2 { color: var(--c-muted) !important; }

/* Wallet card on 我的帳戶 / 資金: a dark-gold plate instead of the silver one. */
body.mgk .m-wallet-top {
  background: linear-gradient(135deg, #2a2210 0%, #17150f 60%, #111113 100%);
  box-shadow: inset 0 1px 0 rgba(245, 217, 127, .18), 0 3px 10px rgba(0, 0, 0, .5);
  border: 1px solid var(--gold-line);
}
body.mgk .m-wallet-top::before { background: linear-gradient(120deg, transparent 0 59.9%, rgba(212, 169, 55, .06) 59.9% 100%); }
body.mgk .m-wallet-top::after { opacity: .25; }
body.mgk .m-wallet-top .bal b { color: var(--gold-lit); }
body.mgk .m-wallet-top .sub, body.mgk .m-wallet-top .cur { color: var(--c-muted); }
body.mgk .m-wallet-stack::after { background: linear-gradient(180deg, #f5d97f, #d4a937 45%, #8a6514); box-shadow: none; }

/* Logo on inner pages */
.mg-top .brand-logo { display: flex; align-items: center; }
.mg-top .brand-logo img { height: 34px !important; width: auto !important; display: block; }

/* Search fields on product pages */
body.mgk input[type=search], body.mgk .m-search input { background: transparent !important; color: var(--c-ink) !important; border: 0; }
body.mgk .m-wallet-top .dep { border: 0 !important; outline: 0; box-shadow: 0 4px 14px rgba(212, 169, 55, .3); background: var(--gold-grad); color: var(--on-gold); }

/* Promotion list buttons */
body.mgk .m-promo-item .acts .info { background: transparent !important; border: 1px solid var(--gold); color: var(--gold-lit) !important; }
body.mgk .m-promo-item .acts .join { background: var(--gold-grad) !important; color: var(--on-gold) !important; }

/* No footer any more: leave room so the last row clears the floating chat button. */
.mg-home { padding-bottom: 72px; }

/* Language list: flag, name, chevron — one full-width row per language. */
.lang-list { display: flex; flex-direction: column; }
.lang-list-hd { margin: 14px 0 4px; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--c-faint); }
.lang-row {
  display: flex; align-items: center; gap: 16px;
  padding: 16px 4px; border-bottom: 1px solid var(--c-line);
  color: var(--c-ink); font-size: 16px; text-decoration: none;
  transition: background .15s ease, color .15s ease;
}
.lang-row:hover { background: var(--gold-glow); color: var(--gold-lit); }
.lang-row .lf { flex: 0 0 40px; width: 40px; height: 27px; border-radius: 3px; overflow: hidden; box-shadow: 0 0 0 1px rgba(255,255,255,.08); }
.lang-row .lf-svg { width: 100%; height: 100%; display: block; }
.lang-row .lf-globe { display: grid; place-items: center; width: 100%; height: 100%; background: var(--c-soft-2); color: var(--gold); }
.lang-row .ln { flex: 1; }
.lang-row > .bi { color: var(--c-muted); font-size: 15px; }
.lang-row.active { color: var(--gold-lit); }
.lang-row.active > .bi { color: var(--gold); font-size: 18px; }
body.mgk .drawer-lang .lang-row { padding: 18px 4px; }

/* Every inner page: the logo row (60px, sticky) then the "← Title" row stuck
   right under it, the same on the account pages and the product pages. */
:root { --m-header-h: 60px; }
body.mgk .m-page-bar, body.mgk .m-acc-bar {
  position: sticky; top: 60px; z-index: 39;
  background: #0a0a0b; border-bottom: 1px solid rgba(255, 255, 255, .04);
  padding: 12px 16px; gap: 14px;
}
body.mgk .m-page-bar .back, body.mgk .m-acc-bar .back { font-size: 19px; color: var(--gold); line-height: 1; }
body.mgk .m-page-bar .ttl, body.mgk .m-acc-bar .ttl { font-size: 18px; font-weight: 600; color: var(--c-ink); }
body.mgk .m-acc-bar .dots { display: none; }

/* --- My Account: user + balance + Deposit, then a plain list ---------------- */
.ma-wrap { padding: 14px 16px 24px; }
.ma-head {
  background: linear-gradient(135deg, #2a2210 0%, #17150f 60%, #111113 100%);
  border: 1px solid var(--gold-line); border-radius: 16px; padding: 16px; margin-bottom: 14px;
}
.ma-user { display: flex; align-items: center; gap: 12px; }
.ma-user .av {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-grad); color: var(--on-gold); font-size: 22px;
}
.ma-user b { font-size: 18px; font-weight: 600; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ma-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ma-info { min-width: 0; flex: 1; }
.ma-info .ma-bal { margin-top: 14px; }
.ma-acts { display: flex; flex-direction: column; gap: 8px; flex: 0 0 auto; }
.ma-bal { min-width: 0; }
.ma-bal small { display: block; font-size: 12px; color: var(--c-muted); margin-bottom: 2px; }
.ma-bal .cur { font-size: 14px; font-weight: 600; color: var(--c-muted); margin-right: 4px; }
.ma-bal b { font-size: 24px; font-weight: 700; color: var(--gold-lit); }
.ma-dep, .ma-signout {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--gold-grad); color: var(--on-gold); font-weight: 600; border-radius: 999px;
  box-shadow: 0 4px 14px rgba(212, 169, 55, .3); text-decoration: none;
}
.ma-dep, .ma-wd { height: 38px; padding: 0 16px; font-size: 14px; min-width: 116px; }
.ma-wd {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px;
  border: 1px solid var(--gold); color: var(--gold-lit); font-weight: 600; text-decoration: none; background: transparent;
}
.ma-wd:hover { color: var(--gold-lit); background: var(--gold-glow); }
.ma-list { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; overflow: hidden; }
.ma-list a, .ma-list button {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 15px 16px;
  background: none; border: 0; border-bottom: 1px solid var(--c-line);
  color: var(--c-ink); font-size: 15px; text-align: left; text-decoration: none;
}
.ma-list > :last-child { border-bottom: 0; }
.ma-list a:active, .ma-list button:active { background: var(--gold-glow); }
.ma-list .ic { font-size: 19px; color: var(--gold); width: 22px; text-align: center; }
.ma-list .lb { flex: 1; }
.ma-list .dot { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; }
.ma-list .chev { font-size: 14px; color: var(--c-faint); }
.ma-signout { display: flex; width: 100%; height: 48px; margin-top: 18px; font-size: 15px; }
.ma-signout:hover, .ma-dep:hover { color: var(--on-gold); }

/* --- Rebate Rate: one card per category, platform and % per row ------------- */
.rr-intro { font-size: 13px; color: var(--c-muted); margin: 0 0 14px; }
.rr-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; padding: 4px 16px; margin-bottom: 14px; }
.rr-card h2 { font-size: 14px; font-weight: 600; color: var(--gold-lit); margin: 12px 0 4px; display: flex; align-items: center; gap: 8px; }
.rr-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--c-line); font-size: 14px; }
.rr-card h2 + .rr-row { border-top: 0; }
.rr-row b { color: var(--gold-lit); font-weight: 600; }
.rr-empty { text-align: center; color: var(--c-muted); padding: 40px 0; font-size: 14px; }
.rr-empty i { display: block; font-size: 34px; color: var(--gold); margin-bottom: 8px; }

/* 信用模式: Deposit / Withdraw for a member opened by a credit agent. */
.credit-notice {
  margin: 16px; padding: 32px 20px; text-align: center;
  background: var(--c-surface); border: 1px solid var(--gold-line); border-radius: 16px;
}
.credit-notice .ic {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-glow); color: var(--gold); font-size: 26px;
}
.credit-notice h2 { font-size: 18px; font-weight: 600; color: var(--gold-lit); margin: 0 0 8px; }
.credit-notice p { font-size: 13px; color: var(--c-muted); margin: 0 0 20px; }
.credit-notice-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 42px; padding: 0 26px;
  border-radius: 999px; background: var(--gold-grad); color: var(--on-gold); font-weight: 600; text-decoration: none;
}
.credit-notice-btn:hover { color: var(--on-gold); }

/* Rebate Rate: three columns — Self, Level 1, Level 2. */
.rr-row b { flex: 0 0 64px; text-align: right; }
.rr-row span { flex: 1; min-width: 0; }
.rr-row.rr-hd { font-size: 11px; color: var(--c-faint); padding: 6px 0; text-transform: uppercase; letter-spacing: .04em; }
.rr-row.rr-hd b { color: var(--c-faint); font-weight: 600; }

/* Favourite games — the star in a card's top-right corner (inc/favorites.php)
   and the My Favourites page. */
.fav-star { position: absolute; top: 5px; right: 5px; z-index: 3; width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(0, 0, 0, .55); color: #fff; font-size: 13px; }
.fav-star.on { color: #ff3b47; }
.fav-star[aria-busy="true"] { opacity: .5; pointer-events: none; }
.thumb:has(.fav-star) { position: relative; }
.fav-grid { padding: 0; }
.fav-empty .fav-browse { display: inline-block; margin-top: 16px; padding: 9px 28px; border-radius: 999px;
  background: var(--gold-grad); color: var(--on-gold); font-weight: 600; }

/* --- My Account → Agent (account/agent.php): team list, 占成% form, report --- */
.agp-note { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 12px; font-size: 13px; margin-bottom: 12px; }
.agp-note.ok  { background: rgba(63,180,111,.14); color: #3fb46f; }
.agp-note.err { background: rgba(224,72,79,.14); color: #e0484f; }
.agp-head, .agp-sum {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 14px;
  background: var(--c-surface); border: 1px solid var(--gold-line, var(--c-line)); border-radius: 16px; overflow: hidden;
}
.agp-head > div, .agp-sum > div { padding: 12px 10px; text-align: center; border-left: 1px solid var(--c-line); min-width: 0; }
.agp-head > div:first-child, .agp-sum > div:first-child { border-left: 0; }
.agp-head small, .agp-sum small { display: block; font-size: 11px; color: var(--c-muted); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agp-head b { font-size: 18px; font-weight: 700; color: var(--gold-lit); }
.agp-sum b { font-size: 13px; font-weight: 600; color: var(--c-ink); word-break: break-word; }
.agp-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin-bottom: 14px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 999px; }
.agp-tabs a { display: flex; align-items: center; justify-content: center; gap: 5px; height: 38px; min-width: 0; white-space: nowrap; border-radius: 999px;
  font-size: 14px; font-weight: 600; color: var(--c-muted); text-decoration: none; }
.agp-tabs a.on { background: var(--gold-grad); color: var(--on-gold); }
.agp-card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; margin-bottom: 14px; }
.agp-list .agp-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--c-line); }
.agp-list .agp-row:first-child { border-top: 0; }
.agp-row .who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.agp-row .who b { font-size: 14px; color: var(--c-ink); overflow: hidden; text-overflow: ellipsis; }
.agp-row .who small { font-size: 11px; color: var(--c-faint); }
.agp-row a.who { text-decoration: none; }
.agp-row .who b i { font-size: 11px; color: var(--c-faint); }
.agp-tag { font-size: 12px; font-weight: 600; color: var(--gold-lit); background: var(--gold-glow); border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.agp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 42px; padding: 0 20px;
  border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.agp-btn.sm { height: 32px; padding: 0 14px; font-size: 13px; }
.agp-btn.gold { background: var(--gold-grad); color: var(--on-gold); }
.agp-btn.gold:hover { color: var(--on-gold); }
.agp-btn.line { background: transparent; border-color: var(--gold); color: var(--gold-lit); }
.agp-form { padding: 16px; }
.agp-field { margin-bottom: 14px; min-width: 0; }
.agp-field label { display: block; font-size: 12px; color: var(--c-muted); margin-bottom: 6px; }
.agp-field label i { color: #e0484f; font-style: normal; }
.agp-cap { float: right; color: var(--gold-lit); font-weight: 600; }
.agp-static { padding: 10px 0; font-size: 15px; color: var(--c-ink); }
.agp-acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.agp-filter { padding: 14px; }
.agp-dates { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.agp-dates .agp-field { margin-bottom: 0; }
.agp-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.agp-chips:first-child { margin: 0 0 12px; }
.agp-chips a { font-size: 12px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--c-line); color: var(--c-muted); text-decoration: none; }
.agp-chips a.on { border-color: var(--gold); color: var(--gold-lit); background: var(--gold-glow); }
.agp-crumb { font-size: 13px; color: var(--c-muted); margin: 0 0 12px; }
.agp-crumb a { color: var(--gold-lit); }
.agp-h { font-size: 14px; font-weight: 600; color: var(--gold-lit); margin: 18px 0 8px; }
.agp-empty { text-align: center; color: var(--c-muted); padding: 26px 0; font-size: 13px; }
.agp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.agp-tbl table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.agp-tbl th, .agp-tbl td { padding: 9px 10px; border-top: 1px solid var(--c-line); text-align: left; }
.agp-tbl thead th { color: var(--c-faint); font-weight: 600; border-top: 0; }
.agp-tbl thead tr.grp th { text-align: center; color: var(--gold-lit); border-bottom: 1px solid var(--c-line); }
.agp-tbl tfoot th { color: var(--c-ink); background: var(--gold-glow); }
.agp-tbl .num { text-align: right; }
.agp-tbl .sep { border-left: 1px solid var(--c-line); }
.agp-tbl tr.off td { opacity: .5; }
.agp-tbl td a { color: var(--gold-lit); }
.agp-n.up { color: #3fb46f; }
.agp-n.down { color: #e0484f; }
@media (max-width: 420px) {
  .agp-dates { grid-template-columns: 1fr 1fr; }
  .agp-dates .agp-btn { grid-column: 1 / -1; }
}

/* Invite: the four head counts above the code */
.ref-stats { display: grid; grid-template-columns: repeat(4, 1fr); padding: 16px 6px; }
.ref-stats > div { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 6px; text-align: center; border-left: 1px solid var(--c-line); }
.ref-stats > div:first-child { border-left: 0; }
.ref-stats b { font-size: 26px; line-height: 1; font-weight: 700; color: var(--gold-lit); }
.ref-stats small { font-size: 12px; line-height: 1.3; color: var(--c-muted); }

/* Agent Centre: the 佣金钱包 strip, and the settlements under it */
.agp-wallet { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; padding: 14px 16px;
  background: var(--c-surface); border: 1px solid var(--gold-line, var(--c-line)); border-radius: 16px; text-decoration: none; }
.agp-wallet .agp-btn { flex: none; }
.agp-wallet span { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.agp-wallet small { font-size: 11px; color: var(--c-muted); }
.agp-wallet b { font-size: 20px; font-weight: 700; color: var(--gold-lit); }
.agp-wallet b.neg { color: #e0484f; }
.agp-wallet > i, .agp-list a.agp-row > i { font-size: 13px; color: var(--c-faint); }
.agp-list a.agp-row { text-decoration: none; }
.agp-amt { font-size: 13px; font-weight: 600; color: var(--c-ink); white-space: nowrap; }
.agp-btn.agp-wide { width: 100%; }
.agp-btn[disabled] { opacity: .45; pointer-events: none; }

/* Lobby: a platform under maintenance — grey, labelled, not clickable */
.plat-tile.maint, .prov-tile.maint { position: relative; cursor: default; pointer-events: none; }
.plat-tile.maint img { filter: grayscale(1) brightness(.55); }
.prov-tile.maint { filter: grayscale(1) brightness(.7); }
.plat-tile.maint .plat-maint, .prov-tile.maint .plat-maint {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 3;
  max-width: 92%; padding: 5px 10px; border-radius: 999px; background: rgba(0, 0, 0, .72); border: 1px solid rgba(255, 255, 255, .35);
  color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .02em; text-align: center; white-space: nowrap;
}

/* 已领取 on a promotion this member cannot take again. */
.promo-claimed { color: #e5484d; font-weight: 700; margin: 6px 0 12px; }
.promo-claimed .bi { margin-right: 4px; }

/* 用户验证 strip on the mobile profile: three marks, cyan tick when done. */
.m-vf-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.m-vf-icons { display: flex; gap: 20px; }
.m-vf-icons button, .m-vf-icons > span { position: relative; font-size: 21px; line-height: 1; padding: 0; border: 0; background: none; color: var(--gold-lit, #e8c77a); }
.m-vf-icons .done { color: #19c3c9; }
.m-vf-icons .done::after { content: '\f26e'; font-family: 'bootstrap-icons'; position: absolute; right: -7px; bottom: -4px; font-size: 12px; color: #19c3c9; }
.m-vf .acc-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 5px 12px; border: 0; border-radius: 999px; }
.m-vf .acc-pill.ok { background: rgba(25,195,201,.15); color: #19c3c9; }
.m-vf .acc-pill.todo { background: var(--gold-grad, #d6b25e); color: var(--on-gold, #1a1a1a); }
.m-acc-row .acc-pill { margin-left: auto; font-size: 11px; color: #19c3c9; }
