﻿/* ============================================================
   澳门 / Macau — Football Betting Platform
   Design tokens + global styles — QQ tech palette
   (vibrant tech blue #009BFF / #12B7F5, white panels, lively
    yellow #FFD100 accents — clean, modern, gradient-friendly)
   ============================================================ */

:root {
  /* QQ tech palette */
  --color-primary: #009BFF;          /* QQ vibrant tech blue (primary) */
  --color-primary-hover: #007ACC;    /* deeper blue on hover */
  --color-primary-light: #E6F6FF;    /* airy blue tint for panels/fills */
  --color-primary-bright: #12B7F5;   /* lighter cyan-blue for gradients */
  --color-accent: #FFD100;           /* QQ lively yellow — highlights/active */
  --color-accent-light: #FFF8D6;     /* soft yellow tint */
  --color-red: #FF4D4F;
  --color-red-light: #FFECEC;
  --color-green: #00C566;
  --color-green-light: #E3F9EE;
  --color-yellow: #FFD100;
  --color-yellow-light: #FFF8D6;
  --color-text: #202124;
  --color-text-secondary: #5F6368;
  --color-text-tertiary: #80868B;
  --color-border: #DADCE0;
  --color-border-light: #E8EAED;
  --color-bg: #FFFFFF;
  --color-bg-soft: #F8F9FA;
  --color-bg-softer: #F1F3F4;

  --shadow-sm: 0 1px 2px 0 rgba(60,64,67,0.06), 0 1px 3px 1px rgba(60,64,67,0.04);
  --shadow-md: 0 1px 2px 0 rgba(60,64,67,0.10), 0 2px 6px 2px rgba(60,64,67,0.08);
  --shadow-lg: 0 4px 8px 3px rgba(60,64,67,0.10), 0 1px 3px 0 rgba(60,64,67,0.12);
  --shadow-elev: 0 8px 24px rgba(60,64,67,0.12);

  /* Material card / input radius: 8px is the canonical Google value. */
  --radius-sm: 8px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --radius-pill: 999px;

  --font-sans: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  --font-mono: 'SF Mono', Menlo, Consolas, monospace;

  --header-h: 64px;
  --sidebar-w: 244px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--color-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* ---------- App shell ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; background: var(--color-bg); }
.app-body { display: flex; flex: 1; min-height: 0; }
.app-main { flex: 1; min-width: 0; padding: 24px 28px 80px; background: var(--color-bg-soft); }
@media (max-width: 768px) {
  .app-main { padding: 16px 14px 100px; }
}

/* ---------- Header ---------- */
.app-header {
  height: var(--header-h);
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.header-logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 600; font-size: 17px; letter-spacing: -0.01em;
  color: var(--color-text);
}
.header-logo .logo-mark {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #009BFF 0%, #12B7F5 60%, #00D2FF 100%);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: var(--shadow-sm);
}
.header-spacer { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.header-balance {
  display: flex; flex-direction: column; align-items: flex-end;
  padding: 4px 12px;
  border-left: 1px solid var(--color-border-light);
  margin-left: 6px;
}
.header-balance .label { font-size: 11px; color: var(--color-text-secondary); }
.header-balance .value { font-size: 15px; font-weight: 600; color: var(--color-primary); font-variant-numeric: tabular-nums; }
.header-user {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 8px; border-radius: var(--radius-pill);
}
.header-user .avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--color-primary-light); color: var(--color-primary);
  display: grid; place-items: center; font-weight: 600; font-size: 13px;
}
.header-user .name { font-size: 13px; font-weight: 500; }
.header-burger {
  display: none;
  width: 40px; height: 40px; border-radius: 50%;
  border: none; background: transparent;
  align-items: center; justify-content: center;
}
.header-burger:hover { background: var(--color-bg-softer); }
@media (max-width: 900px) {
  .header-burger { display: inline-flex; }
  .header-balance { display: none; }
  .header-user .name { display: none; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: #fff;
  border-right: 1px solid var(--color-border);
  padding: 16px 12px;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.sidebar .nav-section { font-size: 11px; color: var(--color-text-tertiary); text-transform: uppercase; letter-spacing: 0.06em; padding: 16px 12px 6px; }
.sidebar .nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  border: none; background: transparent;
  width: 100%; text-align: left;
  transition: background .12s ease;
}
.sidebar .nav-item:hover { background: var(--color-bg-soft); text-decoration: none; }
.sidebar .nav-item.active { background: var(--color-primary-light); color: var(--color-primary); }
.sidebar .nav-item .icon { width: 20px; height: 20px; flex-shrink: 0; display: inline-flex; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .sidebar.mobile-open {
    display: block;
    position: fixed; left: 0; top: var(--header-h);
    height: calc(100vh - var(--header-h));
    width: 280px;
    z-index: 60;
    box-shadow: var(--shadow-elev);
  }
  .sidebar-scrim {
    display: block;
    position: fixed; inset: var(--header-h) 0 0 0;
    background: rgba(32,33,36,0.32);
    z-index: 55;
  }
}

/* ---------- Page chrome ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-title { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; margin: 0; color: var(--color-text); }
.page-subtitle { font-size: 14px; color: var(--color-text-secondary); margin: 4px 0 0; }
@media (max-width: 768px) { .page-title { font-size: 22px; } }

/* ---------- Cards ---------- */
.card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.card-pad { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 16px; font-weight: 600; margin: 0; }
.card-body { padding: 16px 20px; }

/* ---------- Stat cards grid ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card { padding: 18px 20px; position: relative; overflow: hidden; }
/* Google-style 4px accent stripe on top of every stat card.
   Each card cycles through the four Google brand colors (blue, red, yellow,
   green) using :nth-child so the stat grid visually echoes the Google logo. */
.stat-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 4px; background: var(--color-primary);
  border-top-left-radius: var(--radius-md); border-top-right-radius: var(--radius-md);
}
.stat-grid .stat-card:nth-child(4n+1)::before { background: #12B7F5; } /* Google blue */
.stat-grid .stat-card:nth-child(4n+2)::before { background: #FF4D4F; } /* Google red */
.stat-grid .stat-card:nth-child(4n+3)::before { background: #FFD100; } /* Google yellow */
.stat-grid .stat-card:nth-child(4n+4)::before { background: #00C566; } /* Google green */
.stat-card .label { font-size: 12px; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 8px; }
.stat-card .value { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat-card .delta { font-size: 12px; margin-top: 6px; }
.stat-card.accent { background: linear-gradient(135deg, #E6F6FF 0%, #f8fbff 100%); border-color: #C8EBFF; }
.stat-card.accent .value { color: var(--color-primary); }
.value-pos { color: var(--color-green); }
.value-neg { color: var(--color-red); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  height: 36px; padding: 0 16px;
  border-radius: var(--radius-pill);
  font-size: 14px; font-weight: 500;
  border: 1px solid transparent;
  background: transparent; color: var(--color-text);
  transition: background .12s ease, box-shadow .12s ease, border-color .12s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--color-bg-soft); }
.btn-primary { background: var(--color-primary); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--color-primary-hover); }
.btn-primary:disabled { background: #BBC8DE; cursor: not-allowed; box-shadow: none; }
.btn-outline { border-color: var(--color-border); color: var(--color-primary); background: #fff; }
.btn-outline:hover { background: var(--color-primary-light); border-color: #BBD0F4; }
.btn-text { color: var(--color-primary); }
.btn-text:hover { background: var(--color-primary-light); }
.btn-danger { background: var(--color-red); color: #fff; }
.btn-danger:hover { background: #d33b2c; }
.btn-ghost { color: var(--color-text-secondary); }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 44px; padding: 0 22px; font-size: 15px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label { font-size: 13px; color: var(--color-text-secondary); font-weight: 500; }
.input, .select, .textarea {
  height: 42px; padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 14px;
  color: var(--color-text);
  transition: border-color .12s ease, box-shadow .12s ease;
}
.textarea { height: auto; padding: 12px 14px; min-height: 80px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,115,232,0.18);
}
.input::placeholder { color: var(--color-text-tertiary); }

.checkbox { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--color-text); cursor: pointer; }
.checkbox input { width: 16px; height: 16px; accent-color: var(--color-primary); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--color-bg-softer);
  color: var(--color-text-secondary);
  white-space: nowrap;
}
.badge-blue { background: var(--color-primary-light); color: var(--color-primary); }
.badge-red { background: var(--color-red-light); color: var(--color-red); }
.badge-green { background: var(--color-green-light); color: var(--color-green); }
.badge-yellow { background: var(--color-yellow-light); color: #B06000; }
.badge-gray { background: var(--color-bg-softer); color: var(--color-text-secondary); }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }
.live-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-red);
  animation: pulse 1.6s ease-in-out infinite;
  display: inline-block;
}
@keyframes pulse {
  0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(234,67,53,0.5);}
  50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(234,67,53,0);}
}

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--color-border-light); background: #fff; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--color-border-light);
  white-space: nowrap;
}
.table th { font-weight: 500; color: var(--color-text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; background: var(--color-bg-soft); position: sticky; top: 0; }
.table tbody tr:hover { background: var(--color-bg-soft); }
.table tbody tr:last-child td { border-bottom: none; }
.table .num { font-variant-numeric: tabular-nums; }

/* ---------- Toolbar / filters ---------- */
.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 16px;
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
}
.toolbar .input, .toolbar .select { height: 36px; font-size: 13px; }
.toolbar .grow { flex: 1; min-width: 160px; }

/* ---------- Match list ---------- */
.matches-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1100px) {
  .matches-layout { grid-template-columns: 1fr; }
}

.match-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 14px;
  overflow: hidden;
  transition: box-shadow .15s ease;
}
.match-card:hover { box-shadow: var(--shadow-md); }
.match-card.suspended { opacity: 0.66; }
.match-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--color-border-light);
  background: var(--color-bg-soft);
  font-size: 12px; color: var(--color-text-secondary);
}
.match-head .league { font-weight: 500; color: var(--color-text); }
.match-head .time { font-variant-numeric: tabular-nums; }
.match-body { padding: 16px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.teams { display: flex; flex-direction: column; gap: 6px; }
.team-row { display: flex; align-items: center; gap: 10px; }
.team-crest {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--color-bg-softer);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; color: var(--color-text-secondary);
}
.team-name {
  font-size: 14.5px; font-weight: 500;
  white-space: normal;        /* allow wrap; never clip with ellipsis */
  overflow: visible; text-overflow: clip;
  min-width: 0; word-break: break-word;
}
.market-row-head {
  font-size: 12px; font-weight: 600;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
  padding: 10px 16px 4px;
  border-top: 1px solid var(--color-border-light);
  background: var(--color-bg-soft);
}
.match-card .market-row-head:first-of-type { border-top: none; }
.score-pill {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-weight: 600; font-size: 15px;
  padding: 2px 10px;
  border-radius: 6px;
  background: var(--color-red-light); color: var(--color-red);
}
.score-pill.upcoming { background: var(--color-bg-softer); color: var(--color-text-secondary); }

.market-tabs {
  display: flex; gap: 4px; padding: 0 16px;
  border-bottom: 1px solid var(--color-border-light);
  overflow-x: auto;
  scrollbar-width: thin;
}
.market-tab {
  padding: 10px 14px;
  background: transparent; border: none;
  font-size: 13px; font-weight: 500;
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.market-tab:hover { color: var(--color-text); }
.market-tab.active { color: var(--color-primary); border-bottom-color: var(--color-primary); }

.odds-grid {
  display: grid; gap: 8px;
  padding: 14px 16px;
}
.odds-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.odds-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.odds-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 540px) {
  .odds-grid.cols-3, .odds-grid.cols-4 { grid-template-columns: 1fr 1fr; }
}

.odds-btn {
  display: flex; flex-direction: column; align-items: stretch; justify-content: center;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: all .12s ease;
  text-align: left;
  min-height: 58px;
}
.odds-btn:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.odds-btn.selected { border-color: var(--color-primary); background: var(--color-primary-light); box-shadow: inset 0 0 0 1px var(--color-primary); }
.odds-btn .label { font-size: 12px; color: var(--color-text-secondary); display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.odds-btn .odds { font-size: 16px; font-weight: 600; color: var(--color-text); font-variant-numeric: tabular-nums; }
.odds-btn.up .odds { color: var(--color-green); }
.odds-btn.down .odds { color: var(--color-red); }
.odds-btn.locked {
  background: var(--color-bg-softer); color: var(--color-text-tertiary);
  cursor: not-allowed; border-style: dashed;
}
.odds-btn.locked:hover { border-color: var(--color-border); background: var(--color-bg-softer); }
.odds-btn.locked .odds { color: var(--color-text-tertiary); }

.odds-meta {
  padding: 8px 16px 14px;
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
  font-size: 11.5px; color: var(--color-text-tertiary);
}
.odds-meta .dot-sep::before { content: '·'; margin: 0 6px; }

/* ---------- Bet slip ---------- */
.betslip {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}
.betslip-card { padding: 0; }
.betslip-header {
  padding: 14px 18px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--color-border-light);
}
.betslip-header h3 { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.betslip-count {
  background: var(--color-primary); color: #fff;
  font-size: 11px; font-weight: 600;
  border-radius: var(--radius-pill); padding: 2px 8px;
}
.betslip-body { padding: 16px 18px; }
.betslip-empty { text-align: center; padding: 36px 20px; color: var(--color-text-tertiary); font-size: 13px; }
.betslip-empty .icon { font-size: 32px; margin-bottom: 10px; opacity: 0.5; }

.betslip-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--color-border-light);
}
.betslip-item:last-child { border-bottom: none; }
.betslip-item .top-line { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.betslip-item .selection { font-size: 14px; font-weight: 600; }
.betslip-item .meta { font-size: 12px; color: var(--color-text-secondary); margin-top: 2px; }
.betslip-item .odds-pill { font-weight: 600; color: var(--color-primary); font-size: 14px; font-variant-numeric: tabular-nums; }
.betslip-item .remove { color: var(--color-text-tertiary); background: none; border: none; cursor: pointer; font-size: 18px; padding: 0 4px; }
.betslip-item .remove:hover { color: var(--color-red); }

.betslip-stake { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.betslip-stake .input { flex: 1; height: 38px; }
.stake-presets { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.stake-preset {
  font-size: 12px; padding: 4px 10px;
  border-radius: var(--radius-pill); border: 1px solid var(--color-border);
  background: #fff; cursor: pointer; color: var(--color-text-secondary);
}
.stake-preset:hover { border-color: var(--color-primary); color: var(--color-primary); }

.betslip-summary {
  border-top: 1px solid var(--color-border-light);
  padding: 14px 18px;
  font-size: 13px;
}
.betslip-row { display: flex; justify-content: space-between; padding: 4px 0; }
.betslip-row .label { color: var(--color-text-secondary); }
.betslip-row .value { font-variant-numeric: tabular-nums; font-weight: 500; }
.betslip-row.total .value { color: var(--color-primary); font-size: 16px; font-weight: 600; }

.betslip-actions { padding: 0 18px calc(18px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }

.betslip-warning { font-size: 12px; color: var(--color-text-tertiary); padding: 8px 18px; line-height: 1.5; }
.betslip-error { font-size: 12.5px; color: var(--color-red); padding: 6px 18px; }

/* ---------- Mobile bet-slip drawer ---------- */
.betslip-fab {
  display: none;
}
@media (max-width: 1100px) {
  .betslip-desktop { display: none; }
  .betslip-fab {
    display: inline-flex; align-items: center; gap: 8px;
    /* Float ABOVE the fixed mobile bottom nav. On iOS the nav grows by
       env(safe-area-inset-bottom) (~34px on notched iPhones), so a bottom:16px
       FAB sat hidden BEHIND the (later-in-DOM, equal z-index) nav and was not
       tappable — betting was impossible on Apple devices. Clear the nav height
       + safe area and sit above it in the stack (nav is z-index 40). */
    position: fixed; right: 16px; bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: 50;
    height: 52px; padding: 0 20px;
    border-radius: var(--radius-pill);
    background: var(--color-primary); color: #fff;
    box-shadow: var(--shadow-elev);
    border: none; font-weight: 600;
  }
  .betslip-fab .count {
    background: #fff; color: var(--color-primary);
    border-radius: var(--radius-pill);
    padding: 2px 8px; font-size: 12px;
  }
  .betslip-drawer {
    position: fixed; left: 0; right: 0; bottom: 0;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 24px rgba(60,64,67,0.18);
    z-index: 70;
    max-height: 86vh; overflow-y: auto;
    transform: translateY(100%);
    transition: transform .25s ease;
  }
  .betslip-drawer.open { transform: translateY(0); }
}

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(32,33,36,0.5);
  z-index: 80; display: grid; place-items: center; padding: 20px;
  animation: fadeIn .15s ease;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-elev);
  animation: scaleIn .18s ease;
  max-height: 90vh; overflow-y: auto;
}
.modal-header { padding: 18px 22px; border-bottom: 1px solid var(--color-border-light); display: flex; justify-content: space-between; align-items: center; }
.modal-header h3 { margin: 0; font-size: 17px; font-weight: 600; }
.modal-close { border: none; background: transparent; font-size: 22px; color: var(--color-text-secondary); cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 50%; }
.modal-close:hover { background: var(--color-bg-soft); }
.modal-body { padding: 20px 22px; }
.modal-footer { padding: 14px 22px; border-top: 1px solid var(--color-border-light); display: flex; justify-content: flex-end; gap: 8px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: scale(1); } }

.confirm-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--color-border-light); font-size: 14px; }
.confirm-row:last-child { border-bottom: none; }
.confirm-row .label { color: var(--color-text-secondary); }
.confirm-row .value { font-weight: 500; }

/* ---------- Toast ---------- */
.toast-container { position: fixed; top: 80px; right: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--color-text);
  color: #fff;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 13.5px;
  display: flex; align-items: center; gap: 10px;
  min-width: 240px; max-width: 360px;
  animation: slideIn .25s ease;
}
.toast.success { background: var(--color-green); }
.toast.error { background: var(--color-red); }
.toast.info { background: var(--color-text); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ---------- Login ---------- */
.auth-screen {
  min-height: 100vh; display: grid; place-items: center;
  background: linear-gradient(180deg, #F8F9FA 0%, #fff 100%);
  padding: 24px;
  position: relative;
}
.auth-top {
  position: absolute; top: 20px; left: 0; right: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 24px;
}
.auth-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%; max-width: 420px;
}
.auth-card h1 { font-size: 26px; font-weight: 600; margin: 0 0 6px; letter-spacing: -0.01em; }
.auth-card .subtitle { font-size: 14px; color: var(--color-text-secondary); margin: 0 0 26px; }
.auth-card .brand-mark {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, #009BFF 0%, #12B7F5 60%, #00D2FF 100%);
  color: #fff; font-weight: 700; font-size: 22px;
  display: grid; place-items: center; margin: 0 auto 16px;
  box-shadow: var(--shadow-md);
}
.auth-card .auth-row { display: flex; justify-content: space-between; align-items: center; margin: -4px 0 18px; font-size: 13px; }
.auth-foot { text-align: center; font-size: 12px; color: var(--color-text-tertiary); margin-top: 22px; }
.auth-error {
  display: flex; align-items: center; gap: 8px;
  background: var(--color-red-light); color: var(--color-red);
  padding: 10px 14px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 14px;
}
.auth-demo {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--color-bg-soft);
  border-radius: var(--radius-sm);
  font-size: 12px; color: var(--color-text-secondary);
  text-align: center;
}
.auth-demo code { background: #fff; padding: 1px 6px; border-radius: 4px; font-family: var(--font-mono); font-size: 11.5px; color: var(--color-text); border: 1px solid var(--color-border-light); }

/* ---------- Language switcher — Google-style pill toggle ---------- */
.lang-switch {
  display: inline-flex;
  background: #F1F3F4;
  padding: 3px;
  border-radius: 999px;
  gap: 2px;
}
.lang-switch button {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: color .15s ease, background .15s ease, box-shadow .15s ease;
}
.lang-switch button:hover { color: var(--color-text); }
.lang-switch button.active {
  background: #fff;
  color: var(--color-primary);
  box-shadow: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
}

/* ---------- Quick actions ---------- */
.quick-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.quick-action {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: all .12s ease;
}
.quick-action:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.quick-action .icon { width: 32px; height: 32px; border-radius: 8px; background: var(--color-primary-light); color: var(--color-primary); display: grid; place-items: center; }
.quick-action .label { font-size: 14px; font-weight: 500; }
.quick-action .sub { font-size: 12px; color: var(--color-text-secondary); }

/* ---------- Wallet ---------- */
.wallet-balance {
  background: linear-gradient(135deg, #009BFF 0%, #12B7F5 60%, #009BFF 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 26px;
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.wallet-balance::after {
  content: ''; position: absolute; right: -40px; top: -40px;
  width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,0.08);
}
.wallet-balance .small-label { font-size: 12px; opacity: 0.85; text-transform: uppercase; letter-spacing: 0.06em; }
.wallet-balance .big-value { font-size: 38px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0; }
.wallet-balance .row { display: flex; gap: 24px; margin-top: 16px; }
.wallet-balance .row .col .l { font-size: 11px; opacity: 0.78; text-transform: uppercase; letter-spacing: 0.05em;}
.wallet-balance .row .col .v { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* ---------- Misc ---------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; } .mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; }
.mt-8 { margin-top: 8px; } .mt-16 { margin-top: 16px; }
.text-center { text-align: center; }
.text-sm { font-size: 12px; }
.text-secondary { color: var(--color-text-secondary); }
.muted { color: var(--color-text-tertiary); }
.bold { font-weight: 600; }

/* Bottom mobile nav */
.mobile-bottom-nav {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-top: 1px solid var(--color-border-light);
  box-shadow: 0 -2px 12px rgba(60,64,67,0.08);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  z-index: 40;
  justify-content: space-around;
}
/* NOTE: items are <a> tags, not <button> — style the anchors. */
.mobile-bottom-nav a {
  position: relative;
  flex: 1 1 0; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  text-decoration: none;
  padding: 7px 2px 4px;
  color: var(--color-text-tertiary);
  font-size: 10.5px; font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease;
}
.mobile-bottom-nav a .mbn-label {
  max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mobile-bottom-nav a .mbn-icon {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%;
}
.mobile-bottom-nav a svg { width: 23px; height: 23px; transition: transform .18s ease; }
/* Material-3 style "pill" highlight behind the active icon */
.mobile-bottom-nav a::before {
  content: ''; position: absolute; top: 3px; left: 50%; transform: translateX(-50%) scaleX(.6);
  width: 46px; height: 26px; border-radius: 999px;
  background: var(--color-primary-light);
  opacity: 0; transition: opacity .18s ease, transform .18s ease;
  z-index: 0;
}
.mobile-bottom-nav a.active { color: var(--color-primary); font-weight: 600; }
.mobile-bottom-nav a.active::before { opacity: 1; transform: translateX(-50%) scaleX(1); }
.mobile-bottom-nav a.active svg { transform: translateY(-1px); }
@media (max-width: 768px) {
  .mobile-bottom-nav { display: flex; }
  .app-main { padding-bottom: 96px; }
}

/* Spinner */
.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
.spinner.lg { width: 32px; height: 32px; border-width: 3px; }
.spinner.on-primary { border-color: rgba(255,255,255,0.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.processing-modal { text-align: center; padding: 30px 22px; }
.processing-modal .spinner { margin: 0 auto 16px; }
.processing-modal .title { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.processing-modal .sub { font-size: 13px; color: var(--color-text-secondary); }
.processing-modal .countdown { font-size: 36px; font-weight: 600; color: var(--color-primary); margin: 14px 0 4px; font-variant-numeric: tabular-nums; }

/* ---------- Admin ---------- */
.admin-shell { background: #fff; }
.admin-shell .sidebar { background: #fff; }
.admin-shell .app-header { background: #fff; }
.admin-shell .header-logo .logo-mark {
  background: linear-gradient(135deg, #202124 0%, #5F6368 100%);
}
.admin-tag {
  font-size: 10px; font-weight: 600;
  background: var(--color-text); color: #fff;
  padding: 2px 6px; border-radius: 4px; margin-left: 6px;
  letter-spacing: 0.05em;
}

/* Charts placeholder */
.chart-placeholder {
  height: 220px;
  background: linear-gradient(to top, var(--color-primary-light) 0%, transparent 100%);
  border-radius: var(--radius-md);
  position: relative;
  padding: 18px;
  display: flex; align-items: flex-end; justify-content: space-around;
  gap: 6px;
}
.chart-placeholder .bar {
  flex: 1; background: var(--color-primary);
  border-radius: 4px 4px 0 0; opacity: 0.85;
  position: relative;
}
.chart-placeholder .bar:hover { opacity: 1; }
.chart-placeholder .label-line {
  position: absolute; left: 0; right: 0;
  border-top: 1px dashed var(--color-border);
}

/* Score grid for Correct Score market */
.cs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 14px 16px; }
@media (max-width: 540px) { .cs-grid { grid-template-columns: repeat(3, 1fr); } }
.cs-cell {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  background: #fff;
}
.cs-cell:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.cs-cell.selected { border-color: var(--color-primary); background: var(--color-primary-light); }
.cs-cell .s { font-size: 13px; font-weight: 600; }
.cs-cell .o { font-size: 12px; color: var(--color-primary); font-variant-numeric: tabular-nums; margin-top: 2px; }
.cs-cell:disabled { opacity: 0.5; cursor: not-allowed; }

/* "More markets" panel — Crown extra markets (BTTS / Odd-Even / HT-Result /
   Team totals). Full-width row below the main card, grid of labelled blocks. */
.more-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 14px 16px;
  background: #F8FAFE;
  border-top: 1px solid #E6F6FF;
}
.more-mkt { display: flex; flex-direction: column; gap: 6px; }
.more-mkt-title {
  font-size: 12px; font-weight: 700; color: #009BFF; text-align: center;
  padding-bottom: 5px; border-bottom: 1px solid #E6F6FF;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.more-mkt-pills { display: flex; flex-direction: column; gap: 4px; }
.more-toggle { border-color: #FFD100 !important; color: #B8860B !important; }

/* Market-type tab bar — full-width strip above the market columns (hga050 style) */
.mkt-tabbar {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  background: #F8FAFE;
  border-top: 1px solid #E6F6FF;
}
.mkt-tab {
  font-size: 12px; font-weight: 600; line-height: 1;
  color: #5F6368; background: #fff;
  border: 1px solid #DADCE0; border-radius: 14px;
  padding: 5px 14px; cursor: pointer; white-space: nowrap;
  transition: color .12s, border-color .12s, background .12s;
}
.mkt-tab:hover { border-color: var(--color-primary); color: var(--color-primary); }
.mkt-tab.active { color: var(--color-primary); border-color: var(--color-primary);
                  background: var(--color-primary-light); font-weight: 700; }

/* Multi-line HDP & O/U panel (hga050 让球&大/小): FULL TIME + 1ST HALF groups,
   each a Handicap + Goals O/U block with rows of line pills. */
.mix-grid {
  grid-column: 1 / -1;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px; padding: 14px 16px; background: #F8FAFE; border-top: 1px solid #E6F6FF;
}
.mix-grp-title {
  font-size: 12px; font-weight: 700; color: #202124; text-align: center;
  padding: 4px 0 8px; letter-spacing: .04em;
}
.mix-mkt { margin-bottom: 10px; }
.mix-mkt-title { font-size: 11px; font-weight: 700; color: #009BFF; margin-bottom: 4px; }
.mix-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.mix-pill { min-width: 128px; flex: 0 0 auto; }
.mix-pill .lbl { font-size: 11px; max-width: 44%; }
.mix-pill .water { font-size: 9.5px; margin-left: 4px; }
/* Cards carrying the tab bar need extra height for that top strip. */
.match-row.has-tabs { max-height: 178px; }
.cs-toggle {
  margin-top: 6px; padding: 2px 8px; font-size: 12px; cursor: pointer;
  border: 1px solid var(--color-border); border-radius: var(--radius-sm);
  background: #fff; color: var(--color-primary); white-space: nowrap; align-self: flex-start;
}
.cs-toggle:hover { border-color: var(--color-primary); background: var(--color-primary-light); }

/* small responsive helpers */
.hide-mobile { }
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
}
.show-mobile { display: none; }
@media (max-width: 768px) {
  .show-mobile { display: block; }
}

/* ===== Milestone 2: brand block (logo + dual-language name) ===== */
.brand-block { display: inline-flex; align-items: center; gap: 12px; }
.brand-logo { width: 40px; height: 40px; flex-shrink: 0; }
.brand-mark-img { width: 64px; height: 64px; display: block; margin: 0 auto 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name-cn { font-size: 17px; font-weight: 700; color: var(--color-text); letter-spacing: 0.5px; }
/* QQ logo style — each character of 澳门 gets its own tech-palette color, weight 700 */
.brand-name-cn.brand-google { letter-spacing: 1px; }
.brand-name-cn.brand-google > span { font-weight: 700; }
.brand-name-en { font-size: 11px; font-weight: 500; color: var(--color-text-secondary); letter-spacing: 0.4px; }
/* Optional multi-color accents for a brand subtitle, if ever split per-word
   into .g1–.g4 spans. Currently the EN brand ("Macau") renders as plain text. */
.brand-name-en .g1 { color: #12B7F5; }
.brand-name-en .g2 { color: #FF4D4F; }
.brand-name-en .g3 { color: #FFD100; }
.brand-name-en .g4 { color: #00C566; }
@media (max-width: 600px) {
  .brand-logo { width: 32px; height: 32px; }
  .brand-name-cn { font-size: 15px; }
  .brand-name-en { font-size: 10px; }
}

/* ===== Milestone 2: match filter tabs (Upcoming / Live / Completed / Historical) ===== */
.filter-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filter-tabs button {
  padding: 8px 14px; border-radius: 999px; border: 1px solid var(--color-border);
  background: #fff; color: var(--color-text-secondary); font-size: 13px; font-weight: 500;
  cursor: pointer; transition: all 0.15s ease;
}
.filter-tabs button:hover { background: #f5f7fa; }
.filter-tabs button.active { background: var(--color-primary, #009BFF); color: #fff; border-color: var(--color-primary, #009BFF); }
.filter-tabs button.active-green  { background: #00C566; color: #fff; border-color: #00C566;  }
.filter-tabs button.active-yellow { background: #FFD100; color: #202124; border-color: #FFD100; }
.filter-tabs button.active-red    { background: #FF4D4F; color: #fff; border-color: #FF4D4F;  }

/* ===== Milestone 2: force-bet / force-edit warning banner ===== */
.admin-warning {
  margin: 12px 0; padding: 12px 14px; border-radius: 10px;
  background: #FFF8D6; color: #6B5314; border: 1px solid #FFD100;
  font-size: 13px; line-height: 1.5; display: flex; gap: 10px; align-items: flex-start;
}
.admin-warning .dot { width: 8px; height: 8px; border-radius: 50%; background: #FFD100; margin-top: 6px; flex-shrink: 0; }

/* ===== Milestone 2: order-no monospace pill ===== */
.order-no {
  font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12.5px;
  background: #F1F3F4; color: #202124; padding: 2px 8px; border-radius: 6px;
}

/* ===== M4-S9: Agent UI + mobile responsiveness for new tables ===== */
.agent-shell .sidebar { width: 200px; }

/* On narrow screens, force tables to scroll horizontally instead of crushing
   columns. The .table-wrap parent already overflows; tighten typography too. */
@media (max-width: 900px) {
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table th, .table td { white-space: nowrap; font-size: 13px; padding: 8px 10px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .stat-card .value { font-size: 18px; }
  .stat-card .label { font-size: 11px; }
}

@media (max-width: 540px) {
  .stat-grid { grid-template-columns: 1fr; }
  /* Stack the inline create-agent form into one column */
  .card-pad form[onsubmit] { grid-template-columns: 1fr !important; }
  .filter-tabs { flex-wrap: wrap; }
  .filter-tabs button { flex: 1 1 calc(50% - 4px); font-size: 13px; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar > label { flex: 1 1 100%; }
}

/* Notification badges */
.badge-blue   { background: #E6F6FF; color: #009BFF; }


/* ============================================================
   Horizontal-row MatchCard — 2026-06-03 layout overhaul
   Single flat row per match. 6 columns: meta · AH · 1X2 · O/U · 1H AH · 1H O/U
   ============================================================ */
.match-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) repeat(5, minmax(120px, 1fr));
  gap: 1px;
  background: #DADCE0;           /* visible inter-column hairlines */
  border: 1px solid #DADCE0;
  border-left: 4px solid #009BFF; /* Google blue accent on the left */
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 12px;
  min-height: 120px;
  max-height: 140px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.match-row:hover { box-shadow: 0 2px 8px rgba(26,115,232,0.10);
                   border-color: #009BFF; }
.match-row.suspended { opacity: 0.55; }
/* When the Correct Score panel is expanded, lift the uniform height cap so the
   full-width .cs-grid (which flows onto a new grid row) is visible, not clipped. */
.match-row.cs-open { max-height: none; overflow: visible; }

.match-row .mkt-col {
  background: #FFFFFF;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

/* Column 1: meta — league name, kickoff, team names stacked */
.mkt-col.mkt-meta {
  background: #F8FAFE;          /* soft Google blue tint */
  border-right: 2px solid #E6F6FF;
}
.mkt-meta .meta-top {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11.5px; color: #5F6368;
  letter-spacing: 0.01em;
}
.mkt-meta .meta-top .lg {
  font-weight: 600; color: #202124;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 60%;
}
.mkt-meta .meta-top .kt {
  font-weight: 600; color: #009BFF;
  font-variant-numeric: tabular-nums;
}
.mkt-meta .teams-stack {
  display: flex; flex-direction: column; gap: 4px;
  margin: 6px 0;
}
.mkt-meta .t-row { display: flex; align-items: center; gap: 8px; }
.mkt-meta .t-name {
  font-size: 14px; font-weight: 600; color: #202124;
  white-space: normal; word-break: break-word; line-height: 1.2;
  flex: 1; min-width: 0;
}
.mkt-meta .t-score {
  font-variant-numeric: tabular-nums;
  font-weight: 700; color: #FF4D4F;
  background: #FFECEC;
  padding: 1px 8px; border-radius: 4px; font-size: 13px;
}
.mkt-meta .meta-bot {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto;
}
.mkt-meta .live-mini {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; color: #FF4D4F; font-weight: 700;
}

/* Generic market columns (AH, 1X2, O/U, 1H AH, 1H O/U) */
.mkt-col .mkt-line {
  font-size: 11px; font-weight: 700;
  color: #009BFF;
  letter-spacing: 0.02em;
  text-align: center;
  padding-bottom: 6px;
  border-bottom: 1px solid #E6F6FF;
  margin-bottom: 6px;
  text-transform: none;
}
.mkt-col.mkt-2row,
.mkt-col.mkt-3row {
  gap: 4px;
}

.mkt-pill {
  display: flex; align-items: center; justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid #DADCE0;
  border-radius: 6px;
  padding: 5px 9px;
  font: inherit; cursor: pointer;
  transition: background .12s, border-color .12s, box-shadow .12s;
  min-height: 30px;
}
.mkt-pill:hover:not(:disabled) {
  background: #F1F7FE;
  border-color: #009BFF;
}
.mkt-pill.selected {
  background: #E6F6FF;
  border-color: #009BFF;
  box-shadow: inset 0 0 0 1px #009BFF;
}
.mkt-pill:disabled { cursor: not-allowed; opacity: 0.45; }
.mkt-pill .lbl {
  font-size: 11.5px; font-weight: 500; color: #5F6368;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 60%;
}
.mkt-pill .num {
  font-size: 13.5px; font-weight: 700; color: #202124;
  font-variant-numeric: tabular-nums;
}
.mkt-pill.selected .num { color: #009BFF; }
/* 水位 (Hong Kong water) shown as secondary text beside the decimal odds */
.mkt-pill .lbl { flex: 1 1 auto; min-width: 0; max-width: none; }
.mkt-pill .num { flex: 0 0 auto; }
.mkt-pill .water {
  flex: 0 0 auto; margin-left: 5px;
  font-size: 10px; font-weight: 600; color: #80868B;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mkt-pill.selected .water { color: #009BFF; }

.mkt-col.mkt-empty {
  display: grid; place-items: center;
  color: #BBC0C4; font-size: 18px; font-weight: 500;
  background: #FAFBFC;
}

/* ===== Completed-match card ===== */
/* No interactive markets — show the final score + outcome instead. */
.match-row.match-row-completed {
  grid-template-columns: minmax(220px, 1.4fr) 1fr;
  border-left-color: #00C566;       /* Google green = settled */
}
.match-row-completed .teams-stack .t-row.winner .t-name {
  color: #202124; font-weight: 700;
}
.match-row-completed .teams-stack .t-row.winner .t-score {
  color: #00C566; font-weight: 700;
}
.completed-summary {
  background: linear-gradient(180deg, #F3FCF5 0%, #FFFFFF 70%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; padding: 12px 16px; text-align: center;
}
.completed-summary .cs-ft {
  font-size: 10px; font-weight: 700; letter-spacing: 0.09em;
  text-transform: uppercase; color: #00C566;
}
.completed-summary .completed-final {
  display: flex; align-items: baseline; gap: 12px;
  font-variant-numeric: tabular-nums; line-height: 1;
  font-size: 34px; font-weight: 800; color: #3C4043; letter-spacing: -0.01em;
}
.completed-summary .completed-final .num.win { color: #00C566; }
.completed-summary .completed-final .sep {
  color: #DADCE0; font-weight: 500; font-size: 22px;
}
.completed-summary .cs-outcome {
  font-size: 13px; font-weight: 700; color: #009BFF;
}
.completed-summary .cs-chips {
  display: flex; gap: 6px; margin-top: 1px; flex-wrap: wrap; justify-content: center;
}
.completed-summary .cs-chip {
  font-size: 11px; font-weight: 600; color: #5F6368;
  background: #F1F3F4; border: 1px solid #E8EAED; border-radius: 999px;
  padding: 2px 10px; font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* Mobile fallback — stack into two rows when narrow */
@media (max-width: 900px) {
  .match-row {
    grid-template-columns: 1fr 1fr 1fr;
    max-height: none;
  }
  .mkt-col.mkt-meta {
    grid-column: 1 / -1;
    border-right: none;
    border-bottom: 2px solid #E6F6FF;
  }
}
@media (max-width: 520px) {
  .match-row { grid-template-columns: 1fr 1fr; }
}

/* Sharper typography across the whole site (Google Material) */
.page-title { color: #202124; font-weight: 700; letter-spacing: -0.01em; }
.page-subtitle { color: #5F6368; }
.card-title { color: #202124; font-weight: 600; letter-spacing: -0.005em; }
.form-label { color: #202124; font-weight: 600; }
.muted { color: #5F6368 !important; }

/* Sharper card border accent */
.card {
  border-color: #DADCE0 !important;
}
.card:hover { border-color: #C6CCD4; }


/* ==================== Agent dashboard polish ==================== */
.agent-hero {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  background: linear-gradient(120deg, var(--color-primary) 0%, #4f8ef0 55%, #6aa6f5 100%);
  color: #fff; border-radius: 14px; padding: 22px 24px; margin-bottom: 20px;
  box-shadow: var(--shadow-md);
}
.agent-hero-id { display: flex; align-items: center; gap: 16px; min-width: 0; }
.agent-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255,255,255,0.18); border: 2px solid rgba(255,255,255,0.45);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700; color: #fff;
}
.agent-hero-title { font-size: 24px; font-weight: 700; margin: 0; color: #fff; letter-spacing: -0.01em; }
.agent-hero-sub { font-size: 13px; opacity: 0.94; margin-top: 4px; }
.agent-hero-sub .bold { font-weight: 700; }
.agent-hero-sub .badge { background: rgba(255,255,255,0.22) !important; color: #fff !important; border-color: transparent !important; }
.agent-hero-tiles { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-tile {
  background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.22);
  border-radius: 10px; padding: 10px 16px; min-width: 110px;
}
.ht-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; opacity: 0.88; }
.ht-value { font-size: 20px; font-weight: 700; margin-top: 2px; color: #fff; }
.hero-tile .ht-value.value-pos { color: #c6f6d5; }
.hero-tile .ht-value.value-neg { color: #ffd2cd; }

.agent-view-head { margin-bottom: 14px; }
.agent-view-title { font-size: 20px; font-weight: 650; margin: 0; color: var(--color-text); letter-spacing: -0.01em; }
.agent-view-sub { font-size: 13px; color: var(--color-text-secondary); margin: 3px 0 0; }

/* richer stat cards + sidebar accents within the agent shell */
.agent-shell .stat-card { transition: box-shadow .15s ease, transform .15s ease; }
.agent-shell .stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.agent-shell .sidebar .nav-item.active { font-weight: 600; box-shadow: inset 3px 0 0 var(--color-primary); }

@media (max-width: 640px) {
  .agent-hero { padding: 18px; }
  .agent-hero-tiles { width: 100%; }
  .hero-tile { flex: 1 1 30%; min-width: 90px; }
}

/* ==================== Mobile header fix ==================== */
/* The sticky app-header is a fixed-height flex row. Without nowrap the brand
   text and language toggle wrap on narrow phones and overflow the header
   (e.g. a long EN brand stacking, "中文" splitting). Keep all header
   text on one line, let the brand shrink, and drop the EN sub-line on phones. */
.brand-name-cn, .brand-name-en { white-space: nowrap; }
.lang-switch { flex-shrink: 0; }
.lang-switch button { white-space: nowrap; }
.admin-tag { white-space: nowrap; flex-shrink: 0; }
.app-header { overflow: hidden; }
.app-header .header-logo { min-width: 0; }
.app-header .brand-text { min-width: 0; overflow: hidden; }

@media (max-width: 600px) {
  .app-header { padding: 0 12px; gap: 10px; }
  .app-header .brand-name-en { display: none; }   /* keep CN brand + logo only */
  .app-header .brand-logo { width: 30px; height: 30px; }
  .app-header .brand-name-cn { font-size: 15px; }
  .app-header .admin-tag { display: none; }        /* free space on phones */
}
@media (max-width: 360px) {
  .app-header .brand-text { display: none; }        /* very narrow: logo only */
}

/* ============================================================
   QQ-style split-screen auth (member / agent / admin logins)
   A full redesign vs the old centered .auth-card — a branded
   gradient hero on the left, a clean form panel on the right.
   Role is themed via .is-member / .is-agent / .is-admin.
   ============================================================ */
.qq-auth {
  --hero-a: #009BFF;   /* hero gradient start */
  --hero-b: #12B7F5;   /* hero gradient mid   */
  --hero-c: #007ACC;   /* hero gradient end   */
  --hero-accent: #FFD100;
  min-height: 100vh;
  display: flex;
  background: var(--color-bg);
  position: relative;
}
.qq-auth.is-agent  { --hero-a: #00C2C7; --hero-b: #12B7F5; --hero-c: #0072CE; }
.qq-auth.is-admin  { --hero-a: #0B3A66; --hero-b: #0072CE; --hero-c: #00131F; }

/* ---- Left hero ---- */
.qq-auth__hero {
  position: relative;
  flex: 0 0 46%;
  max-width: 620px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(150deg, var(--hero-a) 0%, var(--hero-b) 48%, var(--hero-c) 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 56px 48px;
}
/* glossy decorative blobs */
.qq-auth__hero::before,
.qq-auth__hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.45), rgba(255,255,255,0) 70%);
  pointer-events: none;
}
.qq-auth__hero::before { width: 340px; height: 340px; top: -90px; right: -80px; }
.qq-auth__hero::after  { width: 260px; height: 260px; bottom: -70px; left: -60px; opacity: 0.7; }
.qq-auth__hero-glow {
  position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: var(--hero-accent); filter: blur(80px); opacity: 0.35;
  top: 40%; left: 30%; pointer-events: none;
}
.qq-auth__hero-inner { position: relative; z-index: 1; max-width: 420px; }
.qq-auth__brand { display: flex; align-items: center; gap: 14px; margin-bottom: 30px; }
.qq-auth__brand img { width: 56px; height: 56px; filter: drop-shadow(0 6px 14px rgba(0,0,0,0.22)); }
.qq-auth__brand .cn { font-size: 30px; font-weight: 800; letter-spacing: 4px; line-height: 1; }
.qq-auth__brand .en { font-size: 13px; font-weight: 600; letter-spacing: 3px; text-transform: uppercase; opacity: 0.85; }
.qq-auth__headline { font-size: 30px; font-weight: 800; line-height: 1.25; margin: 0 0 14px; letter-spacing: -0.01em; }
.qq-auth__headline em { font-style: normal; color: var(--hero-accent); }
.qq-auth__tag { font-size: 15px; line-height: 1.7; opacity: 0.92; margin: 0 0 28px; }
.qq-auth__features { list-style: none; margin: 0; padding: 0; display: grid; gap: 13px; }
.qq-auth__features li { display: flex; align-items: center; gap: 11px; font-size: 14px; font-weight: 500; }
.qq-auth__features .tick {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 14px; font-weight: 800;
  background: rgba(255,255,255,0.18); color: var(--hero-accent);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.qq-auth__hero-foot { position: relative; z-index: 1; margin-top: 40px; font-size: 12px; opacity: 0.72; }

/* ---- Right form panel ---- */
.qq-auth__panel {
  flex: 1; min-width: 0;
  display: grid; place-items: center;
  padding: 40px 28px;
  background:
    radial-gradient(1100px 480px at 110% -10%, var(--color-primary-light) 0%, rgba(230,246,255,0) 60%),
    var(--color-bg);
}
.qq-auth__card { width: 100%; max-width: 392px; }
.qq-auth__role {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 13px; border-radius: var(--radius-pill);
  background: var(--color-primary-light); color: var(--color-primary);
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  margin-bottom: 18px;
}
.qq-auth.is-admin .qq-auth__role { background: #0B3A66; color: var(--hero-accent); }
.qq-auth.is-agent .qq-auth__role { background: #E0FAFB; color: #008B8F; }
.qq-auth__title { font-size: 26px; font-weight: 700; margin: 0 0 6px; letter-spacing: -0.01em; }
.qq-auth__sub { font-size: 14px; color: var(--color-text-secondary); margin: 0 0 26px; }
.qq-auth__card .input {
  height: 46px;
  border-radius: 6px;
  background: var(--color-bg-soft);
  border: 1.5px solid var(--color-border);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.qq-auth__card .input:focus {
  background: #fff;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px rgba(0,155,255,0.14);
  outline: none;
}
/* "Remember me" + "Forgot password?" row — checkbox left, link right */
.qq-auth__card .auth-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin: 4px 0 20px; font-size: 13px;
}
.qq-auth__card .auth-row .checkbox { color: var(--color-text-secondary); font-size: 13px; }
.qq-auth__card .auth-row > a {
  color: var(--color-primary); font-weight: 600; white-space: nowrap; text-decoration: none;
}
.qq-auth__card .auth-row > a:hover { text-decoration: underline; }
.qq-auth__card .btn-lg { height: 48px; border-radius: 12px; font-weight: 700; font-size: 15px; }
.qq-auth__card .btn-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-bright) 100%);
  box-shadow: 0 8px 20px rgba(0,155,255,0.28);
}
.qq-auth__card .btn-primary:hover { filter: brightness(1.04); }
.qq-auth.is-admin .qq-auth__card .btn-primary { background: linear-gradient(135deg, #0072CE 0%, #0B3A66 100%); box-shadow: 0 8px 20px rgba(11,58,102,0.3); }
.qq-auth.is-agent .qq-auth__card .btn-primary { background: linear-gradient(135deg, #00C2C7 0%, #12B7F5 100%); box-shadow: 0 8px 20px rgba(0,194,199,0.28); }

.qq-auth__lang { position: absolute; top: 22px; right: 24px; z-index: 3; }
.qq-auth__lang .lang-switch { background: rgba(255,255,255,0.85); box-shadow: var(--shadow-sm); backdrop-filter: blur(6px); }

/* ---- Responsive: collapse hero into a top banner ---- */
@media (max-width: 880px) {
  .qq-auth { flex-direction: column; }
  .qq-auth__hero {
    flex: none; max-width: none; width: 100%;
    padding: 30px 24px 26px; justify-content: flex-start;
  }
  .qq-auth__hero::before { width: 220px; height: 220px; top: -70px; right: -50px; }
  .qq-auth__features, .qq-auth__hero-foot { display: none; }
  .qq-auth__headline { font-size: 22px; margin-bottom: 6px; }
  .qq-auth__tag { font-size: 13px; margin-bottom: 4px; }
  .qq-auth__brand { margin-bottom: 18px; }
  .qq-auth__brand .cn { font-size: 24px; }
  .qq-auth__panel { padding: 28px 18px 48px; place-items: start center; }
  .qq-auth__card { margin-top: 26px; }
}
@media (max-width: 420px) {
  .qq-auth__hero { padding: 24px 18px 20px; }
  .qq-auth__headline { font-size: 20px; }
}

/* "Install Google Authenticator" notice — sits in the branded hero (white-on-blue) */
.qq-auth__note {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px; padding: 12px 14px; margin-top: 24px;
  max-width: 420px;
  font-size: 13px; line-height: 1.55; color: #fff;
}
.qq-auth__note .ga-ico { flex-shrink: 0; color: #fff; opacity: 0.95; margin-top: 1px; }
.qq-auth__note-body { min-width: 0; }
.qq-auth__note-links { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
/* Typical black App Store / Google Play download badges */
.store-badge {
  display: inline-flex; align-items: center; gap: 9px;
  padding: 7px 13px; border-radius: 9px; text-decoration: none;
  background: #000; color: #fff; border: 1px solid #000;
}
.store-badge:hover { background: #1f1f1f; text-decoration: none; }
.store-badge svg { width: 20px; height: 20px; flex-shrink: 0; }
.store-badge .store-txt { display: flex; flex-direction: column; line-height: 1.05; }
.store-badge .store-sub { font-size: 9px; letter-spacing: 0.4px; opacity: 0.9; text-transform: uppercase; }
.store-badge .store-name { font-size: 14px; font-weight: 700; }

/* ===== World Cup page (fixtures grouped by match-day) ===== */
.wc-day-block { margin-bottom: 20px; }
.wc-day-head {
  font-size: 13px; font-weight: 700; color: var(--color-primary);
  letter-spacing: 0.3px; padding: 2px 2px 10px;
  border-bottom: 2px solid var(--color-primary-light); margin-bottom: 12px;
}
