/* ==========================================================================
   MB666 真人娛樂城 — 基礎樣式 (Design Tokens / Reset / 共用元件)
   ========================================================================== */

:root {
  /* 色票 */
  --bg-0: #070a0e;
  --bg-1: #0d1117;
  --bg-2: #141b24;
  --bg-3: #1c2531;
  --line: rgba(255, 255, 255, .08);
  --line-strong: rgba(255, 255, 255, .16);

  /* 文字色階:深色底需要更高對比,三階皆通過 WCAG AA */
  --txt-1: #f7fafd;   /* 主要文字   對比 ≈ 17:1 */
  --txt-2: #ccd6e2;   /* 次要文字   對比 ≈ 11:1 */
  --txt-3: #96a3b3;   /* 輔助文字   對比 ≈  6:1 */
  --txt-4: #7a8798;   /* 最弱層級(僅用於裝飾性標籤) */

  --gold-1: #f3dfa6;
  --gold-2: #d9b45a;
  --gold-3: #a17c2f;

  --felt-1: #0f5c42;
  --felt-2: #0a3f2e;
  --felt-3: #06251b;

  --red: #e03e3e;
  --red-soft: #ff6b6b;
  --blue: #3d7ff5;
  --green: #23a06b;
  --amber: #e8a33d;

  /* 尺寸 */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 24px;
  --r-pill: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;

  --head-h: 60px;
  --maxw: 1440px;

  /* 效果 */
  --sh-1: 0 1px 2px rgba(0, 0, 0, .4);
  --sh-2: 0 6px 20px rgba(0, 0, 0, .45);
  --sh-3: 0 18px 50px rgba(0, 0, 0, .55);
  --glow-gold: 0 0 0 1px rgba(217, 180, 90, .45), 0 8px 28px rgba(217, 180, 90, .18);

  --ease: cubic-bezier(.22, .61, .36, 1);

  /* 字型:中文 Noto Sans TC(思源黑體),數字/金額 Rajdhani(等寬感、易辨識) */
  --font: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", -apple-system,
          BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-num: "Rajdhani", "DIN Alternate", "Roboto Condensed", var(--font);

  /* 字級階層(中文最小 12px,再小就糊) */
  --fs-xs: 12px;
  --fs-sm: 12.5px;
  --fs-md: 13.5px;
  --fs-bd: 14.5px;
  --fs-lg: 16px;
  --fs-xl: 20px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 700px at 50% -10%, #16202b 0%, transparent 60%),
    var(--bg-0);
  color: var(--txt-1);
  font-family: var(--font);
  font-size: var(--fs-bd);
  /* 深色底的中文用 500,400 會顯得糊 */
  font-weight: 500;
  line-height: 1.75;
  letter-spacing: .015em;
  /* 不用 antialiased:那會削細筆畫,深色底的中文反而更糊 */
  -webkit-font-smoothing: subpixel-antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* 標題:收緊字距與行高,與內文拉開層次 */
h1, h2, h3, h4 { line-height: 1.35; letter-spacing: 0; font-weight: 800; }

/* 淺色小字統一加一級字重,避免細筆畫在深底上斷掉 */
.tag, .pill, .limit-txt, .spot__amt, .msg__nm, .dcard__s,
.tcard__meta, .road-stat__l, .hist__i, .ft li, .cat, .quick button { font-weight: 500; }

/* 數字一律等寬對齊,避免金額跳動 */
.num, .wallet__amt, .road-stat__n, .timer__num, .hist__no, .hist__amt,
.betsum b, .spot__amt b, .spot__odds, .limit-txt b, .tcard__meta b, .hero__fact b {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  letter-spacing: .02em;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select { font-family: inherit; }
ul { margin: 0; padding: 0; list-style: none; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; }

/* ---------- 圖示 ---------- */
.ico {
  width: 20px; height: 20px;
  display: inline-block;
  vertical-align: middle;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.ico--sm { width: 16px; height: 16px; }
.ico--lg { width: 26px; height: 26px; }
.ico--fill { fill: currentColor; stroke: none; }

/* ---------- 版面 ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

/* ---------- 頁首 ---------- */
.hd {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--head-h);
  background: rgba(10, 14, 19, .82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hd__in {
  height: 100%;
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}
.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand__mark { width: 34px; height: 34px; }
.brand__txt { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
  font-size: 18px; font-weight: 800; letter-spacing: .06em;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 60%, var(--gold-3));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand__sub { font-size: 11px; color: var(--txt-3); letter-spacing: .22em; }

.nav { display: flex; align-items: center; gap: 2px; margin-left: var(--sp-3); }
.nav a {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-size: 14px;
  color: var(--txt-2);
  transition: .18s var(--ease);
  white-space: nowrap;
}
.nav a:hover { color: var(--txt-1); background: rgba(255,255,255,.05); }
.nav a.is-on { color: var(--bg-0); background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); font-weight: 700; }

.hd__right { margin-left: auto; display: flex; align-items: center; gap: var(--sp-3); }

.wallet {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-pill);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.01));
}
.wallet__amt { font-family: var(--font-num); font-size: 16px; font-weight: 700; color: var(--gold-1); letter-spacing: .02em; }
.wallet__cur { font-size: 12px; color: var(--txt-3); }
.wallet__add {
  width: 26px; height: 26px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2));
  color: #2b1d05;
}

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: linear-gradient(140deg, #2a3746, #16202b);
  display: grid; place-items: center;
  color: var(--txt-2);
}

.hd__burger { display: none; }

/* ---------- 按鈕 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600;
  border: 1px solid var(--line-strong);
  color: var(--txt-1);
  background: linear-gradient(180deg, rgba(255,255,255,.07), rgba(255,255,255,.02));
  transition: .18s var(--ease);
  white-space: nowrap;
}
.btn:hover { border-color: rgba(255,255,255,.28); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn--gold {
  border-color: transparent;
  color: #2b1d05;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2) 55%, var(--gold-3));
  box-shadow: var(--sh-1);
}
.btn--gold:hover { filter: brightness(1.06); }
.btn--ghost { background: none; }
.btn--sm { height: 32px; padding: 0 13px; font-size: 13px; }
.btn--lg { height: 48px; padding: 0 26px; font-size: 15px; }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .4; pointer-events: none; }

/* ---------- 標籤 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 700; letter-spacing: .04em;
  background: rgba(255,255,255,.08); color: var(--txt-2);
}
.tag--live { background: rgba(224, 62, 62, .16); color: #ff8080; }
.tag--hot  { background: rgba(232, 163, 61, .16); color: var(--amber); }
.tag--new  { background: rgba(61, 127, 245, .18); color: #82aaff; }
.tag--vip  { background: rgba(217, 180, 90, .16); color: var(--gold-1); }

.dot-live {
  width: 6px; height: 6px; border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 0 0 rgba(255, 77, 77, .7);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px rgba(255, 77, 77, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 77, 77, 0); }
}

/* ---------- 區段標題 ---------- */
.sec-hd {
  display: flex; align-items: flex-end; gap: var(--sp-3);
  margin: var(--sp-6) 0 var(--sp-4);
}
.sec-hd__t { font-size: 20px; font-weight: 800; letter-spacing: .02em; margin: 0; }
.sec-hd__t::before {
  content: ""; display: inline-block;
  width: 4px; height: 17px; margin-right: 10px;
  border-radius: 2px; vertical-align: -2px;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-3));
}
.sec-hd__s { font-size: 13px; color: var(--txt-3); padding-bottom: 3px; }
.sec-hd__more { margin-left: auto; font-size: 13px; color: var(--txt-2); display: flex; align-items: center; gap: 4px; }
.sec-hd__more:hover { color: var(--gold-1); }

/* ---------- 頁尾 ---------- */
.ft {
  margin-top: var(--sp-7);
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.35));
  padding: var(--sp-6) 0 var(--sp-7);
}
.ft__grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: var(--sp-6);
}
.ft h4 { margin: 0 0 12px; font-size: 13px; letter-spacing: .1em; color: var(--txt-1); }
.ft li { font-size: 13px; color: var(--txt-3); padding: 4px 0; }
.ft li:hover { color: var(--txt-2); }
.ft__note { font-size: 12px; color: var(--txt-3); line-height: 1.8; max-width: 380px; }
.ft__pay { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ft__pay span {
  height: 30px; padding: 0 12px; border-radius: var(--r-sm);
  border: 1px solid var(--line); display: grid; place-items: center;
  font-size: 12px; color: var(--txt-3); letter-spacing: .06em;
}
.ft__bar {
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: var(--sp-3);
  font-size: 12px; color: var(--txt-3);
}
.ft__bar .sep { margin-left: auto; }

/* ---------- 手機底部導覽 ---------- */
.tabbar { display: none; }

/* ==========================================================================
   響應式
   ========================================================================== */

/* 平板 */
@media (max-width: 1024px) {
  .wrap { padding: 0 var(--sp-4); }
  .nav { display: none; }
  .hd__burger {
    display: grid; place-items: center;
    width: 38px; height: 38px; border-radius: var(--r-md);
    border: 1px solid var(--line); color: var(--txt-2);
  }
  .ft__grid { grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
}

/* 手機 */
@media (max-width: 640px) {
  :root { --head-h: 54px; }
  body { font-size: 13px; padding-bottom: 62px; }
  .wrap { padding: 0 12px; }
  .brand__mark { width: 30px; height: 30px; }
  .brand__name { font-size: 16px; }
  .brand__sub { display: none; }
  .wallet { padding: 4px 6px 4px 10px; }
  .wallet__amt { font-size: 14px; }
  .avatar { display: none; }
  .sec-hd { margin: var(--sp-5) 0 var(--sp-3); }
  .sec-hd__t { font-size: 17px; }
  .sec-hd__s { display: none; }

  .ft { padding-bottom: 24px; }
  .ft__grid { grid-template-columns: 1fr; gap: var(--sp-4); }

  .tabbar {
    display: flex;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    height: 58px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(10, 14, 19, .94);
    backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    font-size: 11px; color: var(--txt-3);
  }
  .tabbar a.is-on { color: var(--gold-1); }
  .tabbar .ico { width: 21px; height: 21px; }
}
