/* ── Design Tokens ── */
:root {
  --bg: oklch(98% 0.002 240);
  --surface: oklch(100% 0 0);
  --fg: oklch(18% 0.012 250);
  --muted: oklch(54% 0.012 250);
  --border: oklch(92% 0.005 250);
  --accent: oklch(55% 0.2 255);
  --accent-soft: oklch(92% 0.04 255);
  --snooker: oklch(52% 0.12 30);
  --snooker-soft: oklch(93% 0.03 30);
  --football: oklch(50% 0.14 145);
  --football-soft: oklch(93% 0.03 145);
  --live: oklch(58% 0.2 25);
  --live-soft: oklch(93% 0.04 25);
  --win: oklch(52% 0.14 145);
  --lose: oklch(55% 0.18 25);
  --draw: oklch(55% 0.08 80);
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', system-ui, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, sans-serif;
  --font-mono: 'SF Mono', ui-monospace, 'Cascadia Code', Menlo, monospace;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px oklch(0% 0 0 / 0.04);
  --shadow-md: 0 2px 8px oklch(0% 0 0 / 0.06);
  --shadow-lg: 0 4px 16px oklch(0% 0 0 / 0.08);
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--fg);
  line-height: 1.5;
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: 72px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { display: block; max-width: 100%; }

/* ── Layout Shell ── */
.app { max-width: 480px; margin: 0 auto; position: relative; min-height: 100dvh; }
.screen { display: none; padding: 0 16px 24px; animation: fadeIn 0.2s ease; }
.screen.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ── Top Bar ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; position: sticky; top: 0; z-index: 50;
  background: oklch(98% 0.002 240 / 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 700;
  letter-spacing: -0.02em;
}
.topbar-title span { color: var(--accent); }

/* ── Bottom Nav ── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: oklch(100% 0 0 / 0.92);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding-bottom: env(safe-area-inset-bottom, 0);
}
.nav-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 8px 4px 6px;
  font-size: 10px; font-weight: 500;
  color: var(--muted); transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 22px; height: 22px; transition: transform 0.15s; }
.nav-item.active { color: var(--accent); }
.nav-item.active svg { transform: scale(1.08); }
.nav-badge {
  position: absolute; top: 4px; right: calc(50% - 16px);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--live); border: 2px solid var(--surface);
}

/* ── Section Headers ── */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 12px;
}
.section-title {
  font-family: var(--font-display);
  font-size: 17px; font-weight: 700;
  letter-spacing: -0.01em;
}
.section-link {
  font-size: 13px; color: var(--accent);
  font-weight: 500;
}

/* ── Tags / Pills ── */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; letter-spacing: 0.02em;
  white-space: nowrap;
}
.tag-snooker { background: var(--snooker-soft); color: var(--snooker); }
.tag-football { background: var(--football-soft); color: var(--football); }
.tag-live {
  background: var(--live-soft); color: var(--live);
  animation: livePulse 2s ease-in-out infinite;
}
@keyframes livePulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.7; } }
.tag-upcoming { background: oklch(94% 0.008 250); color: var(--muted); }
.tag-finished { background: oklch(94% 0.005 80); color: oklch(48% 0.015 80); }

/* ── Date Pills ── */
.date-strip {
  display: flex; gap: 8px; overflow-x: auto;
  padding: 4px 0 12px; scrollbar-width: none;
  -ms-overflow-style: none;
}
.date-strip::-webkit-scrollbar { display: none; }
.date-pill {
  flex: 0 0 auto; display: flex; flex-direction: column;
  align-items: center; gap: 2px; padding: 8px 14px;
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--surface); transition: all 0.15s;
  min-width: 56px;
}
.date-pill-label { font-size: 10px; color: var(--muted); font-weight: 500; text-transform: uppercase; }
.date-pill-num { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.date-pill.active {
  background: var(--accent); color: white; border-color: var(--accent);
}
.date-pill.active .date-pill-label { color: oklch(95% 0.02 255); }

/* ── Match Card ── */
.match-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 14px 16px;
  margin-bottom: 10px; transition: box-shadow 0.15s;
}
.match-card:hover { box-shadow: var(--shadow-md); }
.match-meta {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px; font-size: 12px; color: var(--muted);
}
.match-teams {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 12px;
}
.match-player {
  display: flex; flex-direction: column; gap: 2px;
}
.match-player.left { text-align: left; }
.match-player.right { text-align: right; }
.match-player-name {
  font-size: 15px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.match-player-score {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.match-vs {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 4px 8px;
}
.match-vs .score-big {
  font-family: var(--font-mono);
  font-size: 22px; font-weight: 700;
  color: var(--fg); display: block;
  font-variant-numeric: tabular-nums;
}
.match-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid var(--border);
}
.match-time {
  font-family: var(--font-mono);
  font-size: 13px; color: var(--muted);
  font-variant-numeric: tabular-nums;
}
/* ── Follow / Unfollow Buttons ── */
.match-follow-btn {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: var(--radius-full);
  border: 1.5px solid var(--border); background: var(--surface);
  transition: all 0.15s; flex-shrink: 0;
}
.match-follow-btn svg { width: 16px; height: 16px; }
.match-follow-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.match-follow-btn.active {
  background: var(--accent); border-color: var(--accent); color: white;
}
.match-follow-btn.active:hover { opacity: 0.85; }

.match-unfollow-btn {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 12px; border-radius: var(--radius-full);
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: 12px; font-weight: 600; color: var(--muted);
  transition: all 0.15s;
}
.match-unfollow-btn svg { width: 14px; height: 14px; }
.match-unfollow-btn:hover { border-color: var(--lose); color: var(--lose); background: var(--live-soft); }

/* ── Lottery / Betting ── */
.bet-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px;
}
.bet-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.bet-teams-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600;
}
.bet-teams-row .vs { color: var(--muted); font-weight: 400; font-size: 13px; }
.bet-league { font-size: 12px; color: var(--muted); }
.bet-play-tabs {
  display: flex; gap: 4px; margin-bottom: 10px;
}
.bet-play-tab {
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: 12px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface);
  transition: all 0.15s;
}
.bet-play-tab.active { background: var(--fg); color: var(--surface); border-color: var(--fg); }
.bet-odds-grid {
  display: grid; gap: 8px;
}
.bet-odds-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.bet-odds-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.bet-odd-cell {
  padding: 10px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  text-align: center; transition: all 0.15s;
  cursor: pointer; position: relative;
}
.bet-odd-cell:hover { border-color: var(--accent); }
.bet-odd-cell.selected {
  border-color: var(--accent); background: var(--accent-soft);
}
.bet-odd-cell .check-mark {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: white;
  display: none; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.bet-odd-cell.selected .check-mark { display: flex; }
.bet-odd-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.bet-odd-value {
  font-family: var(--font-mono);
  font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Bet Float Bar ── */
.bet-float-bar {
  position: fixed; bottom: 72px; left: 16px; right: 16px;
  max-width: 448px; margin: 0 auto;
  background: var(--fg); color: var(--surface);
  border-radius: var(--radius-md); padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 80; cursor: pointer;
  animation: slideUpBar 0.25s ease;
  box-shadow: var(--shadow-lg);
}
@keyframes slideUpBar { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
.bet-float-count { font-size: 14px; font-weight: 700; }
.bet-float-odds {
  font-family: var(--font-mono); font-size: 13px;
  opacity: 0.8; font-variant-numeric: tabular-nums;
}

/* ── Bet Panel ── */
.bet-panel-overlay {
  position: fixed; inset: 0; background: oklch(0% 0 0 / 0.5);
  z-index: 200; display: flex; align-items: flex-end; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
}
.bet-panel-overlay.open { opacity: 1; pointer-events: auto; }
.bet-panel {
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 448px;
  transform: translateY(100%); transition: transform 0.25s ease;
  max-height: 75dvh; overflow-y: auto;
}
.bet-panel.open { transform: translateY(0); }
.bet-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; border-bottom: 1px solid var(--border);
}
.bet-panel-title { font-size: 16px; font-weight: 700; }
.bet-panel-close {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); transition: all 0.15s;
}
.bet-panel-close:hover { background: var(--border); transform: rotate(90deg); }
.bet-panel-close:active { transform: rotate(90deg) scale(0.92); }
.bet-panel-close svg { width: 18px; height: 18px; }
.bet-panel-mode {
  display: flex; gap: 4px; padding: 12px 16px;
  background: var(--bg); margin: 0;
}
.bet-panel-items { padding: 0 16px; }
.bet-panel-item {
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.bet-panel-item:last-child { border-bottom: none; }
.bet-item-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.bet-item-match { font-size: 14px; font-weight: 600; }
.bet-item-play { font-size: 11px; color: var(--muted); background: var(--bg); padding: 2px 8px; border-radius: var(--radius-full); }
.bet-item-remove {
  width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: all 0.15s;
  background: var(--bg);
}
.bet-item-remove:hover { background: oklch(93% 0.04 25); color: var(--lose); transform: rotate(90deg); }
.bet-item-remove svg { width: 14px; height: 14px; }
.bet-item-pick {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.bet-item-pick-label { font-size: 13px; color: var(--muted); }
.bet-item-pick-odds {
  font-family: var(--font-mono); font-size: 16px; font-weight: 700;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.bet-item-amount {
  margin-top: 4px;
}
.bet-item-stepper {
  display: flex; align-items: center; gap: 0;
  border-radius: var(--radius-sm); overflow: hidden;
  border: 1.5px solid var(--border); background: var(--bg);
}
.stepper-btn {
  width: 44px; height: 40px; border: none;
  font-size: 18px; font-weight: 500;
  background: transparent; color: var(--fg);
  cursor: pointer; transition: all 0.15s;
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; justify-content: center;
}
.stepper-btn:hover { background: var(--accent-soft); color: var(--accent); }
.stepper-btn:active { background: var(--border); transform: scale(0.92); }
.stepper-input {
  flex: 1; height: 40px; border: none;
  text-align: center; font-size: 15px; font-weight: 600;
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  outline: none; background: transparent; color: var(--fg);
}
.stepper-input::placeholder { color: oklch(75% 0.005 250); font-weight: 400; }
.stepper-input::-webkit-outer-spin-button,
.stepper-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input[type=number] { -moz-appearance: textfield; }
.bet-item-return {
  font-size: 12px; color: var(--muted); margin-top: 6px;
  text-align: right;
}
.btn-primary {
  padding: 10px 20px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), oklch(50% 0.22 260));
  color: white; font-weight: 600; font-size: 14px;
  box-shadow: 0 1px 4px oklch(0% 0 0 / 0.1);
  transition: all 0.15s;
}
.btn-primary:hover { opacity: 0.9; box-shadow: 0 2px 8px oklch(0% 0 0 / 0.15); }
.btn-primary:active { transform: scale(0.97); }

/* ── Bet Panel Footer ── */
.bet-panel-footer {
  padding: 16px 16px 20px; border-top: 1px solid var(--border);
  background: var(--bg);
}
.bet-panel-summary {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px;
}
.bet-summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 0;
}
.bet-summary-label { font-size: 13px; color: var(--muted); }
.bet-summary-value { font-size: 15px; font-weight: 700; }

/* ── Bet Confirm Overlay ── */
.bet-confirm-overlay {
  position: fixed; inset: 0; background: oklch(0% 0 0 / 0.5);
  z-index: 200; display: none;
  align-items: flex-end; justify-content: center;
  animation: fadeInOverlay 0.2s ease;
}
.bet-confirm-overlay.show { display: flex; }
@keyframes fadeInOverlay { from { opacity: 0; } to { opacity: 1; } }
.bet-confirm-dialog {
  background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  width: 100%; max-width: 448px; padding: 24px 20px 20px;
  animation: slideUpDialog 0.25s ease;
}
@keyframes slideUpDialog { from { transform: translateY(100%); } to { transform: translateY(0); } }
.bet-confirm-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 16px; }
.bet-confirm-body { font-size: 14px; color: var(--muted); line-height: 1.6; margin-bottom: 20px; }
.bet-confirm-actions { display: flex; gap: 12px; }
.bet-confirm-cancel {
  flex: 1; height: 48px; border: 1.5px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface); font-size: 15px; font-weight: 600; color: var(--muted);
  cursor: pointer; transition: all 0.15s;
}
.bet-confirm-cancel:hover { background: var(--bg); }
.bet-confirm-btn {
  flex: 1; height: 48px; border: none; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), oklch(50% 0.22 260));
  color: white; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.bet-confirm-btn:hover { opacity: 0.9; }
.bet-confirm-btn:active { transform: scale(0.97); }

/* ── Utility ── */
.stats-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 20px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 14px; text-align: center;
}
.stat-value {
  font-family: var(--font-mono);
  font-size: 24px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.stat-card.accent .stat-value { color: var(--accent); }
.stat-card.win .stat-value { color: var(--win); }
.stat-card.lose .stat-value { color: var(--lose); }

/* ── Record List ── */
.record-list { margin-top: 4px; }
.record-item {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 12px 14px;
  margin-bottom: 8px;
}
.record-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.record-icon.snooker { background: var(--snooker-soft); }
.record-icon.football { background: var(--football-soft); }
.record-info { flex: 1; min-width: 0; }
.record-title { font-size: 14px; font-weight: 600; line-height: 1.4; }
.record-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.record-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.record-meta-item { font-size: 11px; color: var(--muted); background: oklch(96% 0.005 250); padding: 2px 6px; border-radius: 4px; font-family: var(--font-mono); }
.record-time { font-size: 11px; color: var(--muted); margin-top: 4px; }
.record-item.record-empty { display: block; }
.record-result {
  font-size: 12px; font-weight: 600; padding: 3px 10px;
  border-radius: var(--radius-full); flex-shrink: 0;
}
.record-result.win { background: oklch(93% 0.03 145); color: var(--win); }
.record-result.lose { background: oklch(93% 0.04 25); color: var(--lose); }
.record-result.draw { background: oklch(94% 0.015 80); color: var(--draw); }

.record-item.record-clickable { transition: all 0.15s; }
.record-item.record-clickable:hover { box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
.record-item.record-clickable:active { transform: scale(0.99); }

/* ── Filter Tabs ── */
.filter-tabs {
  display: flex; gap: 6px; margin-bottom: 16px;
  overflow-x: auto; scrollbar-width: none;
}
.filter-tabs::-webkit-scrollbar { display: none; }
.filter-tab {
  padding: 7px 16px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--surface);
  white-space: nowrap; transition: all 0.15s;
}
.filter-tab.active {
  background: var(--fg); color: var(--surface);
  border-color: var(--fg);
}

/* ── User Center ── */
.profile-header {
  text-align: center; padding: 32px 16px 24px;
}
.profile-avatar {
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 700;
  margin: 0 auto 12px; border: 3px solid var(--surface);
  box-shadow: var(--shadow-md);
}
.profile-name { font-size: 20px; font-weight: 700; }
.profile-id {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted); margin-top: 2px;
}
.profile-stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px; background: var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
  margin: 20px 0;
}
.profile-stat {
  background: var(--surface); padding: 16px; text-align: center;
}
.profile-stat-val {
  font-family: var(--font-mono);
  font-size: 20px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.profile-stat-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.menu-section { margin-bottom: 16px; }
.menu-section-title {
  font-size: 12px; color: var(--muted);
  padding: 0 4px 8px; font-weight: 500;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.menu-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden;
}
.menu-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; transition: background 0.15s;
}
.menu-item + .menu-item { border-top: 1px solid var(--border); }
.menu-item:hover { background: var(--bg); }
.menu-icon {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; flex-shrink: 0;
}
.menu-icon.blue { background: var(--accent-soft); }
.menu-icon.green { background: oklch(93% 0.03 145); }
.menu-icon.orange { background: oklch(93% 0.04 40); }
.menu-icon.purple { background: oklch(93% 0.04 300); }
.menu-text { flex: 1; font-size: 15px; font-weight: 500; }
.menu-arrow { color: var(--muted); font-size: 14px; }

/* ── Sport Tab Switch ── */
.sport-tabs {
  display: flex; gap: 4px; padding: 3px;
  background: var(--surface); border-radius: var(--radius-full);
  border: 1px solid var(--border);
  margin-top: 4px; margin-bottom: 16px;
}
.sport-tab {
  flex: 1; padding: 8px 0; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; text-align: center;
  transition: all 0.15s; color: var(--muted);
}
.sport-tab.active { background: var(--surface); color: var(--fg); box-shadow: var(--shadow-sm); }

/* ── Empty State ── */
.empty-state {
  text-align: center; padding: 48px 24px;
  color: var(--muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-text { font-size: 14px; }

/* ── Match Detail Page ── */
.detail-back-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius-full);
  background: var(--bg); border: 1px solid var(--border);
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: all 0.15s;
}
.detail-back-btn:hover { background: var(--accent-soft); color: var(--accent); }
.detail-back-btn svg { width: 16px; height: 16px; }

.detail-header {
  padding: 20px 0 24px; text-align: center;
}
.detail-sport-tag { margin-bottom: 12px; }
.detail-league {
  font-size: 14px; color: var(--muted); margin-bottom: 20px;
}
.detail-teams {
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 16px; margin-bottom: 16px;
}
.detail-team {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px;
}
.detail-team-name {
  font-size: 18px; font-weight: 700;
  text-align: center;
}
.detail-team-country {
  font-size: 12px; color: var(--muted); font-weight: 500;
}
.detail-score-block {
  display: flex; flex-direction: column; align-items: center;
  gap: 4px;
}
.detail-score-main {
  font-family: var(--font-mono);
  font-size: 36px; font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.detail-score-sub {
  font-size: 13px; color: var(--muted);
  font-family: var(--font-mono);
}
.detail-status {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600;
}
.detail-status.live { background: var(--live-soft); color: var(--live); }
.detail-status.upcoming { background: oklch(94% 0.008 250); color: var(--muted); }
.detail-status.finished { background: oklch(94% 0.005 80); color: oklch(48% 0.015 80); }

.detail-divider {
  height: 8px; background: var(--bg); margin: 0 -16px;
}
.detail-section {
  padding: 16px 0;
}
.detail-section.bet-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 16px; margin-bottom: 12px;
}
.detail-section-title {
  font-size: 15px; font-weight: 700;
  margin-bottom: 12px; display: flex;
  align-items: center; gap: 8px;
}
.detail-section-title::after {
  content: ''; flex: 1; height: 1px;
  background: var(--border);
}
.detail-stat-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
}
.detail-stat-row + .detail-stat-row { border-top: 1px solid var(--border); }
.detail-stat-label { font-size: 13px; color: var(--muted); }
.detail-stat-values {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.detail-stat-bar-wrap {
  width: 80px; height: 4px;
  background: var(--border); border-radius: 2px;
  overflow: hidden; position: relative;
}
.detail-stat-bar-left {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--accent); border-radius: 2px;
}
.detail-stat-bar-right {
  position: absolute; right: 0; top: 0; bottom: 0;
  background: var(--muted); border-radius: 2px;
}
.detail-history-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0;
}
.detail-history-item + .detail-history-item { border-top: 1px solid var(--border); }
.detail-history-date {
  font-size: 12px; color: var(--muted);
  font-family: var(--font-mono);
  min-width: 70px;
}
.detail-history-score {
  font-family: var(--font-mono);
  font-size: 14px; font-weight: 600;
  min-width: 50px; text-align: center;
}
.detail-history-event {
  font-size: 13px; color: var(--muted);
  flex: 1;
}
.detail-lineup-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-lineup-team {
  font-size: 13px; font-weight: 600;
  margin-bottom: 8px; color: var(--muted);
}
.detail-lineup-player {
  font-size: 14px; padding: 4px 0;
  display: flex; align-items: center; gap: 6px;
}
.detail-lineup-num {
  font-family: var(--font-mono);
  font-size: 12px; color: var(--muted);
  min-width: 20px;
}
.detail-actions {
  display: flex; gap: 10px; padding: 20px 0;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
  position: sticky; bottom: 0; background: var(--bg);
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.btn-outline-lg {
  flex: 1; padding: 14px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border); background: var(--surface);
  font-weight: 600; font-size: 14px; text-align: center;
  transition: all 0.15s;
}
.btn-outline-lg:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.btn-outline-lg:active { transform: scale(0.97); }
.btn-primary-lg {
  flex: 2; padding: 14px; border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent), oklch(50% 0.22 260));
  color: white; font-weight: 700; font-size: 15px; text-align: center;
  box-shadow: 0 2px 8px oklch(0% 0 0 / 0.12), 0 1px 2px oklch(0% 0 0 / 0.06);
  transition: all 0.15s; letter-spacing: 0.01em;
}
.btn-primary-lg:hover {
  box-shadow: 0 4px 16px oklch(0% 0 0 / 0.18), 0 2px 4px oklch(0% 0 0 / 0.08);
  transform: translateY(-1px);
}
.btn-primary-lg:active { transform: translateY(0) scale(0.98); opacity: 0.95; }

/* ── 顶部成功提示 ── */
.toast-success {
  position: fixed; top: 0; left: 50%; transform: translateX(-50%) translateY(-100%);
  z-index: 300;
  display: flex; align-items: center; gap: 8px;
  background: oklch(35% 0.12 145); color: oklch(98% 0.01 145);
  padding: 12px 20px; border-radius: 0 0 var(--radius-md) var(--radius-md);
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 12px oklch(0% 0 0 / 0.15);
  transition: transform 0.3s ease;
  max-width: 480px; width: calc(100% - 32px);
  justify-content: center;
}
.toast-success.show { transform: translateX(-50%) translateY(0); }

/* ── Detail Page Bet Entry Point (compact bar that opens the shared bet panel) ── */
.detail-bet-float {
  position: fixed; bottom: 72px; left: 16px; right: 16px;
  max-width: 448px; margin: 0 auto;
  background: var(--fg); color: var(--surface);
  border-radius: var(--radius-md);
  z-index: 80; cursor: pointer;
  animation: slideUpBar 0.25s ease;
  box-shadow: var(--shadow-lg);
  padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.detail-bet-float-count { font-size: 14px; font-weight: 700; }
.detail-bet-float-odds {
  font-family: var(--font-mono); font-size: 13px;
  opacity: 0.8; font-variant-numeric: tabular-nums;
}

/* ── Detail Page Bet Panel (shared with lottery) ── */
.detail-play-tabs {
  display: flex; gap: 4px; margin-bottom: 10px;
}
.detail-play-tab {
  padding: 6px 14px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface);
  transition: all 0.15s;
}
.detail-play-tab.active { background: var(--fg); color: var(--surface); border-color: var(--fg); }
.detail-odds-grid {
  display: grid; gap: 8px;
}
.detail-odds-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.detail-odds-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.detail-odds-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.detail-odd-cell {
  padding: 10px 8px; border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  text-align: center; transition: all 0.15s;
  cursor: pointer; position: relative;
}
.detail-odd-cell:hover { border-color: var(--accent); }
.detail-odd-cell.selected {
  border-color: var(--accent); background: var(--accent-soft);
}
.detail-odd-cell .check-mark {
  position: absolute; top: -6px; right: -6px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--accent); color: white;
  display: none; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
}
.detail-odd-cell.selected .check-mark { display: flex; }
.detail-odd-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.detail-odd-value {
  font-family: var(--font-mono);
  font-size: 17px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ── Utility ── */
.sr-only { position: absolute; width: 1px; height: 1px; clip: rect(0,0,0,0); overflow: hidden; }