/* ── WC26 — Polymarket-inspired dark design system ── */

/* ── Design tokens ── */
:root {
  /* Surfaces — blue-gray undertone */
  --bg-primary: #131520;
  --bg-surface: #1C1E2D;
  --bg-surface-hover: #242638;
  --bg-surface-alt: #111320;
  --bg-elevated: #252740;
  --bg-bottom-bar: #1A1C2A;

  /* Borders */
  --border: #2A2D3A;
  --border-subtle: #1F2233;
  --border-focus: #2E5CFF;

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: #858B9B;
  --text-tertiary: #5A6070;
  --text-muted: #454B5C;

  /* Brand */
  --accent: #2E5CFF;
  --accent-hover: #1A4AE6;
  --overlay-bg: rgba(0, 0, 0, 0.7);

  /* Semantic */
  --green: #47C96B;
  --red: #FF4D4D;
  --color-yes-bg: #1B3D2E;
  --color-no-bg: #3D1B1B;
  --color-yes-border: #2A5C42;
  --color-no-border: #5C2A2A;

  /* Typography */
  --font-sans: 'DM Sans', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'SF Mono', 'Cascadia Code', 'Segoe UI Mono', Menlo, Monaco, Consolas, monospace;

  /* Layout */
  --header-h: 48px;
  --bottom-nav-h: 56px;
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  padding-bottom: var(--bottom-nav-h);
}

/* ── App header (sticky) ── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  height: var(--header-h);
  gap: 8px;
}

.app-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.app-header-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.app-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
}

.app-title {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
  cursor: pointer;
}

/* ── Header balance (centered) ── */
.header-balance-amount {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: #fff;
}

.header-balance-pnl {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.header-balance-pnl.positive { color: var(--green); }
.header-balance-pnl.negative { color: var(--red); }
.header-balance-pnl.zero { color: var(--text-tertiary); }

.header-balance-add {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.15s, border-color 0.15s;
}

/* ── User dropdown ── */
.user-dropdown {
  position: fixed;
  top: var(--header-h);
  right: 12px;
  width: 180px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  padding: 12px;
}

.user-dropdown.open { display: block; }

.user-dropdown-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.user-dropdown-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Lang toggle ── */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0;
}

.lang-btn {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lang-btn + .lang-btn { border-left: none; }

.lang-btn.active {
  color: var(--text-primary);
  border-color: var(--text-primary);
}

.lang-btn.active + .lang-btn { border-left-color: var(--text-primary); }
.lang-btn:not(.active) + .lang-btn.active { border-left: 1px solid var(--text-primary); }

/* ── Flash overlay ── */
.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background-size: cover;
  background-position: center;
  opacity: 0;
  pointer-events: none;
}

.flash-overlay.active { opacity: 1; pointer-events: auto; }
.flash-overlay.fading { transition: opacity 0.8s ease-out; opacity: 0; }

/* ── USA pala overlay ── */
.pala-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.pala-overlay img {
  max-width: 100vw;
  max-height: 100vh;
  animation: palaRotateIn 1.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
@keyframes palaRotateIn {
  0%   { transform: rotate(-720deg) scale(0); opacity: 0; }
  15%  { opacity: 1; }
  100% { transform: rotate(0deg) scale(1); opacity: 1; }
}
.pala-overlay.fade-out {
  transition: opacity 3s ease-out;
  opacity: 0;
}

/* ── Notification bell ── */
.notif-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  font-size: 18px;
  line-height: 1;
  transition: color 0.15s;
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notif-badge.hidden { display: none; }

.notif-dropdown {
  position: fixed;
  top: var(--header-h);
  right: 12px;
  width: 300px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
}

.notif-dropdown.open { display: block; }

.notif-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.notif-item.unread { color: var(--text-primary); }
.notif-item:last-child { border-bottom: none; }
.notif-empty { padding: 20px 12px; text-align: center; color: var(--text-tertiary); font-size: 13px; }

/* ── User area ── */
.user-area {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.user-display-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.sign-in-btn {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

/* ── Avatars ── */
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar-sm { width: 24px; height: 24px; font-size: 11px; }
.avatar-lg { width: 40px; height: 40px; font-size: 16px; }

.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Bottom navigation ── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--bottom-nav-h);
  background: var(--bg-bottom-bar);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nav-tab.active { color: var(--accent); }

.nav-tab-icon {
  width: 22px;
  height: 22px;
}

.nav-tab-label {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ── Tab panels ── */
.tab-panels {
  position: relative;
}

.tab-panel {
  display: none;
  min-height: calc(100dvh - var(--header-h) - var(--bottom-nav-h));
}

.tab-panel.active { display: block; }

/* ── Flags ── */
.flag {
  width: 20px;
  height: 14px;
  flex-shrink: 0;
  display: block;
  object-fit: cover;
  border-radius: 2px;
}

.flag-sm { width: 16px; height: 11px; }
.flag-lg { width: 64px; height: 45px; }

/* ── Team highlights ── */
.team-gold { color: #D4A843; }
.team-blue { color: #4A90D9; }

/* ── Clickable team names ── */
.team-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 500;
}

.team-link {
  cursor: pointer;
  transition: color 0.15s ease;
}

/* ── Locale modal ── */
.locale-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.locale-overlay.hidden { display: none; }

.locale-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 32px 28px;
  max-width: 320px;
  width: 90%;
  border-radius: 8px;
}

.locale-card h2 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-align: center;
}

.locale-hint {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 24px;
}

.locale-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 16px;
  margin-bottom: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 8px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.locale-btn:last-child { margin-bottom: 0; }

.locale-btn img {
  width: 24px;
  height: 17px;
  object-fit: cover;
  border-radius: 2px;
}

/* ══════════════════════════════════════════
   MATCHES TAB
   ══════════════════════════════════════════ */

/* ── Date headers (sticky) ── */
.date-header {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: var(--bg-surface);
  padding: 14px 12px;
  scroll-margin-top: var(--header-h);
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.date-header-text {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
}

.date-header-meta {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--text-secondary);
  margin-left: auto;
}

/* ── Badges ── */
.badge {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: 100px;
  flex-shrink: 0;
}

.badge-today { background: var(--accent); color: #fff; }
.badge-next { background: var(--bg-surface-hover); color: var(--text-secondary); border: 1px solid var(--border); }

/* ── Match cards ── */
.match-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 8px 12px;
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
}

.match-card-teams {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.match-card-team {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.match-card-team.away { justify-content: flex-end; text-align: right; }
.match-card-team.away .team-name { order: -1; }

.match-card-center {
  text-align: center;
  flex-shrink: 0;
  position: relative;
}

.match-card-vs {
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
  position: absolute;
  left: 0;
  right: 0;
}

.match-card-score {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  min-width: 60px;
  flex-shrink: 0;
}

.match-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-secondary);
}

.match-card-time {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.match-card-venue {
  font-size: 12px;
  color: var(--text-tertiary);
}

.match-card-group {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.match-card-countdown {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.match-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

/* Match card states */
.match-card.live {
  border-color: var(--green);
  border-width: 2px;
}

.match-card.live .match-card-score { font-size: 40px; }

.match-card.completed {
  opacity: 0.6;
}

/* Pulsing dot for live */
.pulsing-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

/* Quick-bet buttons on match cards */
.quick-bet-buttons {
  display: flex;
  gap: 6px;
}

.quick-bet-btn {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.match-card-bet-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  background: rgba(46,92,255,0.12);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 100px;
}

/* Back to Today button */
.back-to-today {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  transition: transform 0.15s, opacity 0.15s;
}

.back-to-today.hidden { display: none; }

/* Knockout rows */
.knockout-row {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 14px;
  color: var(--text-secondary);
  font-style: italic;
}

/* No results */
.no-results {
  padding: 40px 12px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* ══════════════════════════════════════════
   TOURNAMENT TAB
   ══════════════════════════════════════════ */

/* ── Breadcrumb ── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  background: var(--bg-primary);
  overflow-x: auto;
  white-space: nowrap;
}

.breadcrumb-item {
  cursor: pointer;
  transition: color 0.15s;
  flex-shrink: 0;
}

.breadcrumb-item.active { color: var(--text-primary); font-weight: 700; cursor: default; }
.breadcrumb-sep { color: var(--text-tertiary); flex-shrink: 0; }

/* ── Search bar ── */
.tournament-search {
  position: sticky;
  top: var(--header-h);
  z-index: 10;
  padding: 8px 12px;
  background: var(--bg-primary);
}

.tournament-search input {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  border: 1px solid var(--border);
  padding: 8px 12px;
  background: var(--bg-surface-alt);
  color: var(--text-primary);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}

.tournament-search input::placeholder { color: var(--text-tertiary); }
.tournament-search input:focus { border-color: var(--border-focus); }

/* ── Groups grid (2-col) ── */
.groups-list {
  padding: 0 0 20px;
}

.group-section {
  margin-bottom: 8px;
}

.group-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  cursor: pointer;
}

.group-section-title {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.group-section-expand {
  font-size: 20px;
  color: var(--text-tertiary);
  font-weight: 300;
}

.group-section-table-header {
  display: flex;
  align-items: center;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-tertiary);
}

.group-section-th-team {
  flex: 1;
}

.group-section-th {
  width: 48px;
  text-align: center;
}

.group-section-row {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.group-section-row.qualifying {
  background: rgba(71, 201, 107, 0.08);
}

.group-section-row.qualifying::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #2A5C42;
}

.group-section-row:not(.qualifying) .team-name,
.group-section-row:not(.qualifying) .group-section-stat {
  opacity: 0.5;
}

.group-section-team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
}

.group-section-stat {
  width: 48px;
  text-align: center;
  font-family: var(--font-mono, monospace);
  font-size: 14px;
  color: var(--text-secondary);
}

/* ── Standings table (group detail) ── */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.standings-table th {
  text-align: left;
  padding: 6px 6px 6px 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--text-tertiary);
  font-size: 11px;
  border-bottom: 1px solid var(--border);
}

.standings-table th:first-child,
.standings-table td:first-child { width: 100%; }

.standings-table th:not(:first-child) {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
  width: 32px;
  min-width: 32px;
}

.standings-table td {
  padding: 7px 6px 7px 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.standings-table td:not(:first-child) {
  text-align: center;
  padding-left: 4px;
  padding-right: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
}

.standings-team {
  display: flex;
  align-items: center;
  gap: 6px;
}

.standings-team .flag { width: 18px; height: 13px; }
.standings-team .team-name { font-size: 13px; font-weight: 500; }
.standings-team .team-name.bold { font-weight: 700; }

.standings-team-cell {
  cursor: pointer;
  transition: color 0.15s ease;
}

.standings-table tbody tr:nth-child(-n+2) td:first-child {
  box-shadow: inset 3px 0 0 #2A5C42;
}

.standings-table tbody tr:nth-child(n+3) td { color: var(--text-tertiary); }
.standings-table tbody tr:nth-child(n+3) td:first-child .team-name { opacity: 0.5; }

.col-w, .col-d, .col-l, .col-gf { display: none; }

/* ── Group detail fixtures ── */
.group-fixtures-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.group-fixture-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s;
  overflow: hidden;
}

.group-fixture-date {
  font-family: var(--font-mono);
  color: var(--text-secondary);
  font-size: 11px;
}

.group-fixture-teams {
  display: flex;
  align-items: center;
  gap: 5px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
}

.group-fixture-city {
  color: var(--text-tertiary);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.match-v {
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Team page ── */
.team-page-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 12px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

/* ── Portugal chad easter egg ── */
.por-chad-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.6s ease-out;
}
.por-chad-overlay img {
  max-width: 80vw;
  max-height: 70vh;
}
.por-chad-overlay.por-chad-out { transition: opacity 1.5s ease-out; }
.por-chad-header {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  height: 82px;
  width: auto;
  border-radius: 6px;
  opacity: 0;
  transition: opacity 0.6s ease-out;
  pointer-events: none;
}
.por-chad-visible { opacity: 1; }

/* ── South Africa cecil ── */
.rsa-cecil {
  position: absolute;
  top: 4px;
  right: 12px;
  height: 72px;
  width: auto;
  border-radius: 6px;
}

.team-page-flag {
  width: 64px;
  height: 45px;
  object-fit: cover;
  flex-shrink: 0;
  border-radius: 2px;
}

.team-page-name {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 700;
}

.team-page-group {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.team-page-section {
  border-bottom: 1px solid var(--border);
}

.team-page-pos-header {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.player-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  font-size: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.player-row:nth-child(odd) { background: var(--bg-surface-alt); }

.player-number {
  width: 24px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 12px;
  flex-shrink: 0;
}

.player-name { font-weight: 500; }

/* ══════════════════════════════════════════
   BETS TAB
   ══════════════════════════════════════════ */

/* ── Podium ── */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 8px;
  padding: 20px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.podium-place {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.podium-place.first {
  order: 0;
}

.podium-place.second {
  order: -1;
}

.podium-place.third {
  order: 1;
}

.podium-bar {
  width: 72px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px 6px 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 4px;
}

.podium-place.first .podium-bar { height: 100px; border-color: var(--accent); }
.podium-place.second .podium-bar { height: 76px; }
.podium-place.third .podium-bar { height: 56px; }

.podium-rank {
  font-family: var(--font-sans);
  font-size: 24px;
  font-weight: 700;
  color: var(--text-tertiary);
}

.podium-place.first .podium-rank { color: var(--accent); }

.podium-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

.podium-profit {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
}

.podium-profit.positive { color: var(--green); }
.podium-profit.negative { color: var(--red); }

/* ── Segmented control ── */
.segmented-control {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 12px 16px;
  overflow: hidden;
}

.segmented-btn {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  color: var(--text-tertiary);
  transition: all 0.15s;
  position: relative;
}

.segmented-btn.active {
  color: var(--text-primary);
  background: var(--bg-surface-hover);
}

.segmented-btn + .segmented-btn {
  border-left: 1px solid var(--border);
}

.segmented-count {
  font-family: var(--font-mono);
  font-size: 10px;
  background: var(--border);
  color: var(--text-secondary);
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 4px;
}

/* ── Balance hero ── */
.balance-hero {
  padding: 24px 16px 20px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.balance-amount {
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.balance-pnl {
  font-family: var(--font-mono);
  font-size: 14px;
  margin-top: 4px;
}

.balance-pnl.positive { color: var(--green); }
.balance-pnl.negative { color: var(--red); }
.balance-pnl.zero { color: var(--text-tertiary); }

.balance-actions {
  margin-top: 12px;
  display: flex;
  justify-content: center;
  gap: 8px;
}

.balance-teaser {
  font-size: 14px;
  color: var(--text-tertiary);
  padding: 24px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

/* ── Bet cards (compact list) ── */
.bet-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin: 0 16px 10px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
  animation: slideIn 0.3s ease-out;
}

.bet-card-match {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.bet-card-match-v { color: var(--text-tertiary); }

.bet-card-match-group {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.bet-card-question {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.bet-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
}

.bet-card-creator { font-weight: 600; font-size: 12px; color: var(--text-primary); }

.bet-card-odds {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--accent);
  background: rgba(46,92,255,0.1);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.bet-card-stake {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 12px;
}

.bet-card-deadline-text {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-tertiary);
}

.bet-card-fill-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}

.bet-card-fill-bar-inner {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.bet-card-outcome {
  position: absolute;
  top: 12px;
  right: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
}

.bet-card-outcome.yes { background: rgba(71,201,107,0.12); color: var(--green); }
.bet-card-outcome.no { background: rgba(255,77,77,0.12); color: var(--red); }

.bet-card.resolved { opacity: 0.6; }

/* Settled bet colors */
.bet-card.settled-win { border-color: var(--green); }
.bet-card.settled-loss { border-color: var(--red); opacity: 0.7; }

/* ── Leaderboard list (4th onward) ── */
.leaderboard-list {
  padding: 0 16px 12px;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
}

.leaderboard-table th {
  text-align: left;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}

.leaderboard-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 13px;
}

.leaderboard-table td:first-child {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  width: 32px;
}

.leaderboard-user {
  display: flex;
  align-items: center;
  gap: 8px;
}

.leaderboard-profit {
  font-family: var(--font-mono);
  font-weight: 600;
  text-align: right;
}

.leaderboard-profit.positive { color: var(--green); }
.leaderboard-profit.negative { color: var(--red); }

.leaderboard-row-me td { background: rgba(46,92,255,0.08); }

/* ── Section dividers ── */
.section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  padding: 16px 16px 8px;
}

/* ── Bet detail (inside popup) ── */
.bet-detail {
  flex-shrink: 0;
}

.bet-detail-top {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border);
  padding: 16px;
}

.bet-detail-question {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 12px;
}

.bet-detail-event {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-tertiary);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 12px;
}

.bet-detail-matchup {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 4px 0 16px;
}

.bet-detail-team-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  cursor: pointer;
}

.bet-detail-team-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.flag-bet { width: 42px; height: 30px; }

.bet-detail-vs {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
}

.bet-detail-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 100px;
  white-space: nowrap;
}

.bet-detail-pill.pick {
  background: rgba(46,92,255,0.15);
  color: var(--accent);
}

.bet-detail-pill.open {
  background: rgba(255,255,255,0.06);
  color: var(--text-tertiary);
}

.bet-detail-terms {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.bet-detail-terms-top {
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.bet-detail-terms-divider {
  height: 1px;
  background: var(--border-subtle);
}

.bet-detail-terms-bottom {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.bet-detail-payout {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  color: var(--green);
}

.bet-detail-deadline-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.bet-detail-fill {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.bet-detail-fill-bar {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.bet-detail-fill-bar-inner {
  height: 100%;
  background: var(--green);
  border-radius: 2px;
}

.bet-detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Inline cancel confirmation ── */
.cancel-bet-wrap {
  position: relative;
  display: flex;
  gap: 8px;
}

.cancel-bet-trigger,
.cancel-bet-confirm {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cancel-bet-trigger.hidden {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  position: absolute;
}

.cancel-bet-confirm {
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  position: absolute;
}
.cancel-bet-confirm.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
  position: relative;
}

/* ── Timeline ── */
.timeline {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.timeline-item {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
}

.timeline-item-time {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

.timeline-event-created { background: rgba(255,255,255,0.05); }
.timeline-event-taken { background: rgba(175,255,175,0.15); }
.timeline-event-counter { background: rgba(255,255,175,0.15); }
.timeline-event-counter-accepted { background: rgba(175,255,175,0.1); }
.timeline-event-counter-rejected { background: rgba(255,175,175,0.1); }

.timeline-msg {
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--bg-primary);
  max-width: 85%;
}

.timeline-msg-author { font-size: 12px; font-weight: 600; margin-bottom: 2px; }
.timeline-msg-text { font-size: 13px; line-height: 1.4; word-break: break-word; }

.timeline-msg-image {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 6px;
  margin-top: 6px;
  display: block;
  cursor: pointer;
}

.timeline-msg-time { font-size: 10px; color: var(--text-tertiary); margin-top: 4px; }

/* ── Image lightbox ── */
.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.image-lightbox.active { opacity: 1; }

.image-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 8px;
  object-fit: contain;
}

/* ── Resolution banner ── */
.resolution-banner {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  margin: 12px 0;
}

.resolution-banner.yes { border-color: var(--green); }
.resolution-banner.no { border-color: var(--red); }

.resolution-label {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.resolution-label.yes { color: var(--green); }
.resolution-label.no { color: var(--red); }

.resolution-players { margin-top: 8px; font-size: 14px; }
.resolution-winner { color: var(--text-primary); font-weight: 700; }
.resolution-loser { color: var(--text-tertiary); opacity: 0.5; }

/* ── Settlement animation ── */
.settled-stamp {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-15deg);
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0;
  pointer-events: none;
  animation: stampIn 0.5s ease-out forwards;
}

.settled-stamp.win { color: var(--green); }
.settled-stamp.loss { color: var(--red); }

@keyframes stampIn {
  0% { opacity: 0; transform: translate(-50%, -50%) rotate(-15deg) scale(2); }
  60% { opacity: 1; transform: translate(-50%, -50%) rotate(-15deg) scale(0.95); }
  100% { opacity: 0.7; transform: translate(-50%, -50%) rotate(-15deg) scale(1); }
}

/* ── Chat input (bottom of popup) ── */
.chat-input-bar {
  flex-shrink: 0;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-input {
  flex: 1;
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 8px;
  outline: none;
}

.chat-input::placeholder { color: var(--text-tertiary); }
.chat-input:focus { border-color: var(--border-focus); }

.chat-img-btn,
.chat-send-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  font-size: 18px;
  transition: color 0.15s;
}

.chat-send-btn { color: var(--accent); }

.chat-preview {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 58px);
  left: 16px;
  right: 16px;
  z-index: 81;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  display: none;
}

.chat-preview.active { display: block; }
.chat-preview img { max-width: 100%; max-height: 200px; border-radius: 4px; }

.chat-preview-close {
  position: absolute;
  top: 4px;
  right: 4px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ══════════════════════════════════════════
   SHARED UI COMPONENTS
   ══════════════════════════════════════════ */

/* ── Buttons ── */
.btn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-green { background: var(--green); color: #fff; border-color: var(--green); }
.btn-red { background: var(--red); color: #fff; border-color: var(--red); }
.btn-outline { background: transparent; color: var(--text-secondary); }
.btn-sm { font-size: 11px; padding: 5px 10px; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-add-funds {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  right: 16px;
  z-index: 90;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, box-shadow 0.15s;
}

.fab.hidden { display: none; }

/* ── Popup overlay (70%) ── */
.popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: none;
}

.popup-overlay.active { display: flex; align-items: center; justify-content: center; }

.popup-overlay.active .popup-backdrop { animation: popupBgIn 0.2s ease-out both; }
.popup-overlay.closing .popup-backdrop { animation: popupBgOut 0.2s ease-in both; }

.popup-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
}

.popup-content {
  position: relative;
  background: var(--bg-surface);
  border-radius: 12px;
  max-height: 80vh;
  width: 90%;
  max-width: 500px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.popup-overlay.active .popup-content { animation: popupFadeIn 0.2s ease-out both; }
.popup-overlay.closing .popup-content { animation: popupFadeOut 0.2s ease-in both; }

@keyframes popupFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes popupFadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.95); }
}
@keyframes popupBgIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes popupBgOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* ── Bottom sheet (85%) ── */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  display: none;
}

.bottom-sheet-overlay.active { display: flex; flex-direction: column; justify-content: flex-end; }

.bottom-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay-bg);
}

.bottom-sheet {
  position: relative;
  background: var(--bg-surface);
  border-radius: 12px 12px 0 0;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease-out;
  -webkit-overflow-scrolling: touch;
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: 2px;
  margin: 8px auto;
  flex-shrink: 0;
}

.bottom-sheet-content {
  padding: 0 0 16px;
  min-height: 200px;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

@keyframes slideDown {
  from { transform: translateY(0); }
  to { transform: translateY(100%); }
}

/* ── Modals (dynamically injected) ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease-out;
}

.modal-overlay.hidden { display: none; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  width: 90%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 20px;
  padding: 0;
  line-height: 1;
}

/* ── Form elements ── */
.form-group { margin-bottom: 14px; }

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 14px;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus { border-color: var(--border-focus); }

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: var(--font-sans);
}

.form-input.error { border-color: var(--red); }
.form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--red); margin-top: 4px; }

.form-inline {
  display: flex;
  gap: 8px;
  align-items: center;
}

.form-inline .form-input { width: auto; flex: 1; }

.payout-preview {
  background: var(--bg-surface-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 14px;
}

.payout-preview strong { color: var(--text-primary); }

/* ── Odds presets ── */
.odds-presets {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.odds-preset {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
}

.odds-preset.active { color: var(--text-primary); border-color: var(--accent); }

/* ── Amount chips (flex row of pills) ── */
.amount-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.amount-chip {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.amount-chip.active {
  color: var(--text-primary);
  border-color: var(--accent);
  background: rgba(46,92,255,0.1);
}

.amount-chip-custom {
  font-family: var(--font-sans);
}

.amount-display {
  font-family: var(--font-mono);
  font-size: 32px;
  font-weight: 700;
  text-align: center;
  padding: 16px 0;
  color: var(--text-primary);
  margin-bottom: 4px;
}

/* ── Numpad grid (3-col compact) ── */
.numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 8px;
  margin-bottom: 4px;
}


.numpad-key {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.numpad-key:active {
  background: var(--bg-surface-hover);
}

.numpad-backspace {
  font-size: 20px;
}

.numpad-confirm {
  grid-column: 1 / -1;
  font-size: 13px;
  padding: 10px 0;
}

/* ── Match selector (searchable) ── */
.match-selector-wrapper { position: relative; }

.match-selector-results {
  max-height: 200px;
  overflow-y: auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 4px;
  display: none;
}

#bet-question-matches {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 10;
  margin-top: 0;
  border-radius: 0 0 8px 8px;
}

.match-selector-results.open { display: block; }

.match-selector-item {
  padding: 10px 12px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--border);
}

.match-selector-item:last-child { border-bottom: none; }

/* ── Swipe to confirm ── */
.swipe-to-confirm {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  height: 48px;
  overflow: hidden;
  user-select: none;
  touch-action: pan-x;
}

.swipe-track {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.02em;
}

.swipe-thumb {
  position: absolute;
  left: 2px;
  top: 2px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
  cursor: grab;
  transition: left 0.1s;
  z-index: 1;
}

.swipe-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: rgba(46,92,255,0.15);
  border-radius: 8px;
  transition: width 0.1s;
}

/* ── Toast ── */
.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 2000;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
}

.toast.active {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── Activity ticker ── */
.activity-ticker {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.activity-ticker::-webkit-scrollbar { display: none; }

.ticker-item {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.15s;
}

.ticker-item strong { color: var(--text-primary); font-weight: 600; }

/* ── Active bets row ── */
.active-bets-section {
  padding: 12px 0 12px 16px;
  border-bottom: 1px solid var(--border);
}

.active-bets-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.active-bets-row {
  display: flex;
  overflow-x: auto;
  gap: 10px;
  padding-right: 16px;
  scrollbar-width: none;
}

.active-bets-row::-webkit-scrollbar { display: none; }

.active-bet-chip {
  flex-shrink: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  max-width: 200px;
  cursor: pointer;
  transition: border-color 0.15s;
}

.active-bet-chip-q {
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.active-bet-chip-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}

/* ── Multi-step create flow ── */
.create-step { display: none; }
.create-step.active { display: block; }

.create-step-header {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.create-step-number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.create-step-nav {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.create-step-nav .btn { flex: 1; text-align: center; }

/* ── Bet summary card ── */
.bet-summary {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.bet-summary-question {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 10px;
}

.bet-summary-match {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.bet-summary-amounts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.bet-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}

.bet-summary-row strong {
  color: var(--text-primary);
}


/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (min-width: 640px) {
  .groups-list { max-width: 640px; margin: 0 auto; }
  .col-w, .col-d { display: table-cell; }

  .match-card { max-width: 600px; margin-left: auto; margin-right: auto; }
  .bet-card { margin: 0 auto 10px; max-width: 600px; }
  .section-label { max-width: 640px; margin-left: auto; margin-right: auto; display: block; }
  .balance-hero { max-width: 640px; margin: 0 auto; }
  .podium { max-width: 640px; margin: 0 auto; }
  .segmented-control { max-width: 640px; margin: 12px auto; }
  .timeline { max-width: 640px; margin: 0 auto; }
  .chat-input-bar { max-width: 640px; left: 50%; transform: translateX(-50%); }
  .modal { max-width: 440px; }

  .date-header { padding: 14px 20px; }
  .group-fixture-row { grid-template-columns: 100px 1fr auto; }
}

@media (min-width: 1024px) {
  .app-header { padding: 0 24px; }
  .date-header { padding: 14px 24px; }
  .flag { width: 26px; height: 19px; }
  .standings-team .flag { width: 20px; height: 15px; }
  .groups-list { max-width: 800px; }
  .col-l, .col-gf { display: table-cell; }
  .knockout-row { padding: 14px 24px; }
}

/* ── Hover states ── */
@media (hover: hover) {
  .header-balance-add:hover { color: var(--accent); border-color: var(--accent); }
  .notif-btn:hover { color: var(--text-primary); }
  .notif-item:hover { background: var(--bg-surface-hover); }
  .sign-in-btn:hover { color: var(--text-primary); border-color: var(--text-primary); }
  .team-link:hover { color: var(--accent); text-decoration: none; }
  .locale-btn:hover {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 8%, var(--bg-primary));
  }
  .match-card:hover { border-color: var(--accent); }
  .quick-bet-btn:hover { color: var(--accent); border-color: var(--accent); }
  .back-to-today:hover { transform: translateX(-50%) scale(1.05); }
  .breadcrumb-item:hover { color: var(--text-primary); }
  .group-section-row:hover { background: var(--bg-surface-hover); }
  .standings-team-cell:hover .team-name { color: var(--accent); }
  .group-fixture-row:hover { background: var(--bg-surface-hover); }
  .standings-table tr:hover td { background: var(--bg-surface-hover); }
  .nav-tab:hover { color: var(--text-secondary); }
  .lang-btn:not(.active):hover { color: var(--text-primary); }
  .bet-card:hover { border-color: var(--accent); }
  .chat-img-btn:hover,
  .chat-send-btn:hover { color: var(--text-primary); }
  .btn-primary:hover { filter: brightness(1.1); }
  .btn-outline:hover { color: var(--text-primary); border-color: var(--text-primary); }
  .btn-add-funds:hover { color: var(--text-primary); border-color: var(--text-primary); }
  .fab:hover { transform: scale(1.08); box-shadow: 0 6px 20px rgba(0,0,0,0.5); }
  .modal-close:hover { color: var(--text-primary); }
  .odds-preset:hover { color: var(--text-primary); border-color: var(--accent); }
  .amount-chip:hover { color: var(--text-primary); border-color: var(--accent); }
  .numpad-key:hover { background: var(--bg-surface-hover); }
  .match-selector-item:hover { background: var(--bg-surface-hover); }
  .ticker-item:hover { color: var(--text-primary); }
  .active-bet-chip:hover { border-color: var(--accent); }
}

/* ── Animations ── */
@keyframes slideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ── Misc ── */
.hidden { display: none !important; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-accent { color: var(--accent); }
.text-muted { color: var(--text-tertiary); }
.mono { font-family: var(--font-mono); }

/* Loading spinner */
.loading {
  padding: 40px;
  text-align: center;
  color: var(--text-tertiary);
}
