/* ============================================================================
   AP TOURNAMENTS — SHARED UI DESIGN SYSTEM & TOKENS
   Esports Dark Obsidian & Radiant Amber/Gold Aesthetic
   Engineered for Mobile-First, Responsive Continuum & Low-End Androids
   ============================================================================ */

:root {
  /* STEP 21 — Core Design Tokens */
  --bg: #0E0F13;
  --surface: #16181F;
  --raised: #1E212A;
  --primary-hover: #FF7A45;
  --primary-press: #E8430A;
  --danger: #F0454F;
  --text: #F2F3F5;
  --muted: #8B91A0;
  --radius: 12px;

  /* Surfaces: Ink & Obsidian Ramp (Clean, purposeful neutrals) */
  --bg-main: #0b0e13;
  --bg-surface: #121722;
  --bg-elevated: #191f2b;
  --bg-card: #121722;
  --bg-card-hover: #171d28;

  /* Primary Accent: Tournament Gold/Amber (Single crisp, refined accent) */
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-subtle: rgba(245, 158, 11, 0.12);

  --gold: #f59e0b;
  --gold-hover: #d97706;
  --gold-subtle: rgba(245, 158, 11, 0.12);

  --cyan: #0284c7;
  --cyan-subtle: rgba(2, 132, 199, 0.12);

  /* Text & Structural Hierarchy */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --border: #273043;
  --border-light: #344057;
  --border-gold: rgba(245, 158, 11, 0.3);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #0284c7;
  --info-bg: rgba(2, 132, 199, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-full: 9999px;

  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 150ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* Keep every surface scrollable without showing native scrollbars. */
html,
body,
* {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar,
*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

html:has(.modal-overlay.active),
body:has(.modal-overlay.active) {
  overflow: hidden !important;
  overscroll-behavior: none;
}

.modal-overlay {
  overscroll-behavior: contain;
}

/* Numbers tabular formatting */
.metric-value, .balance-amount, .vault-val, .tnum, table td {
  font-variant-numeric: tabular-nums;
}

/* Reset & Box Sizing */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  min-height: 100%;
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Typography Hierarchy */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

/* Tabular numbers for financial stats and clocks */
.tnum {
  font-feature-settings: "tnum";
  font-variant-numeric: tabular-nums;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  min-height: 44px; /* Touch Target Compliance */
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  user-select: none;
  touch-action: manipulation;
  line-height: 1.2;
  text-align: center;
  white-space: normal;
}

.btn:focus-visible,
.modal-close:focus-visible,
.form-input:focus-visible,
.form-select:focus-visible,
.form-textarea:focus-visible {
  outline: 3px solid rgba(255, 170, 0, 0.72);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #0a0d14;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.2px;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-main);
  border: 1px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-light);
}

.btn-gold {
  background: var(--primary);
  color: #0a0d14;
  font-family: var(--font-sans);
  font-weight: 600;
  box-shadow: none;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.btn-gold:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-google {
  background: #ffffff;
  color: #1f2937;
  font-weight: 600;
  border: 1px solid #e5e7eb;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.btn-google:hover:not(:disabled) {
  background: #f9fafb;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  transform: translateY(-1px);
}

.btn-google-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #ffffff;
  color: #0f172a;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 100%;
  text-transform: none;
  text-decoration: none;
  min-height: 42px;
}

.btn-google-action:hover {
  background: #f8fafc;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

.btn-google-action:active {
  transform: translateY(0);
}

.btn-google-action svg {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  min-height: 18px;
  margin: 0 !important;
  flex-shrink: 0;
  display: block;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  font-weight: 600;
}

.btn-danger:hover:not(:disabled) {
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
}

.btn-outline:hover:not(:disabled) {
  background: var(--primary-subtle);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-sm {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 13px;
}

#active-pay-retry[hidden] {
  display: none;
}

.btn-block {
  width: 100%;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.badge-upcoming { background: var(--info-bg); color: var(--info); border: 1px solid rgba(2, 132, 199, 0.25); }
.badge-open { background: var(--success-bg); color: var(--success); border: 1px solid rgba(16, 185, 129, 0.25); }
.badge-full { background: var(--warning-bg); color: var(--warning); border: 1px solid rgba(245, 158, 11, 0.25); }
.badge-live { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-completed { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); border: 1px solid var(--border); }
.badge-cancelled { background: var(--danger-bg); color: var(--danger); border: 1px solid rgba(239, 68, 68, 0.25); }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 150ms ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transform: translateY(8px);
  transition: transform 150ms ease;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

@media (max-width: 600px) {
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }
  .modal-card {
    max-width: 100%;
    max-height: 88vh;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: var(--transition);
  min-width: 44px;
  min-height: 44px;
}

.modal-close:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.08);
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Forms & Inputs */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 15px;
  font-family: inherit;
  transition: var(--transition);
}

/* Prevent auto-zooming on mobile iOS and Android */
@media (max-width: 768px) {
  .form-input, .form-select, .form-textarea {
    font-size: 16px;
  }
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-subtle);
}

.form-hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 72px;
  right: 24px;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 2000;
  pointer-events: none;
}

@media (max-width: 600px) {
  .toast-container {
    top: auto;
    bottom: 76px;
    left: 14px;
    right: 14px;
    max-width: none;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-surface);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm);
  box-shadow: 0 10px 30px rgba(0,0,0,0.7), 0 0 1px rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  animation: slideDown 250ms ease;
  transition: opacity 250ms ease, transform 250ms ease;
}

.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-info { border-left-color: var(--info); }
.toast-warning { border-left-color: var(--warning); }

.toast.fade-out {
  opacity: 0;
  transform: translateY(-8px);
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loaders & Skeletons */
.loader-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 85, 0, 0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================================
   CONTEST DETAILS & TOURNAMENT MODAL UPGRADES (Khiladi Style)
   ============================================================ */
.match-modal-hero {
  position: relative;
  height: 110px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid var(--border);
}

.match-modal-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.match-modal-hero .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2) 0%, rgba(15, 21, 35, 0.95) 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 12px 14px;
  align-items: center;
  text-align: center;
}

.match-modal-hero .hero-tag-badge {
  align-self: center;
  background: rgba(255, 85, 0, 0.25);
  color: #ffaa55;
  border: 1px solid rgba(255, 85, 0, 0.45);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 800;
  margin-bottom: 4px;
}

.match-modal-hero h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  margin: 0;
  line-height: 1.2;
}

/* Live Countdown Box */
.match-modal-countdown {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #34d399;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 14px;
}

.match-modal-countdown.imminent {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

/* Match Specifications 2x3 Grid */
.specs-table-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.spec-cell {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  text-align: center;
}

.spec-cell .cell-label {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 2px;
}

.spec-cell .cell-value {
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
}

/* Rank-wise Prize Table */
.prize-breakdown-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 14px;
}

.prize-box-title {
  font-size: 12px;
  font-weight: 800;
  color: #ffaa55;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.prize-ranks-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.prize-rank-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.prize-rank-row:last-child {
  border-bottom: none;
}

.prize-rank-row .rank-name {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.prize-rank-row .rank-payout {
  font-weight: 800;
  color: #34d399;
}

/* Detailed Rules & Prohibited Items Box */
.rules-container-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.rules-container-box h4 {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--primary-hover);
  margin: 0 0 8px 0;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rules-specs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.rule-chip-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  color: var(--text-main);
  font-weight: 600;
}

.ban-alert-strip {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 11px;
  color: #fca5a5;
  margin-top: 8px;
  line-height: 1.4;
}

/* View Joinings & Confirm Buttons Group */
.match-actions-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#match-details-modal .modal-card {
  position: relative;
}

.match-details-loading {
  min-height: 220px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 12px;
}

.join-confirm-sheet[hidden] {
  display: none;
}

.join-confirm-sheet {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  align-items: flex-end;
  background: rgba(5, 8, 13, 0.72);
  opacity: 0;
  transition: opacity 150ms ease;
}

.join-confirm-sheet.active {
  opacity: 1;
}

.join-confirm-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  background: transparent;
  cursor: default;
}

.join-confirm-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -18px 40px rgba(0, 0, 0, 0.45);
}

.join-confirm-handle {
  width: 38px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.join-confirm-heading,
.join-player-card,
.join-payment-summary > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.join-confirm-heading {
  align-items: flex-start;
  margin-bottom: 12px;
}

.join-confirm-heading span,
.join-player-card span,
.join-payment-summary span {
  color: var(--text-muted);
  font-size: 11px;
}

.join-confirm-heading h3 {
  margin: 2px 0 0;
  color: var(--text-main);
  font-size: 16px;
}

.join-confirm-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  color: var(--text-main);
  font-size: 21px;
  cursor: pointer;
}

.join-player-card {
  padding: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.join-player-card > div {
  min-width: 0;
}

.join-player-card > div:last-child {
  text-align: right;
}

.join-player-card span,
.join-player-card strong {
  display: block;
}

.join-player-card strong {
  max-width: 150px;
  overflow: hidden;
  color: var(--text-main);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.join-payment-summary {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 0 2px;
}

.join-payment-summary strong {
  color: var(--text-main);
  font-size: 13px;
}

.join-payment-summary .join-balance-after {
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.join-payment-summary .join-balance-after strong {
  color: var(--success);
}

.join-confirm-note {
  margin: 0 0 12px;
  color: var(--text-dim);
  font-size: 11px;
  line-height: 1.45;
}

.match-detail-tabs {
  position: sticky;
  top: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 12px;
  padding: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.match-detail-tab {
  min-width: 0;
  min-height: 36px;
  padding: 6px 4px;
  background: transparent;
  border: 0;
  border-radius: 7px;
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.match-detail-tab.active {
  background: var(--primary);
  color: #0a0d14;
}

#match-details-modal [data-match-detail-panel][hidden] {
  display: none;
}

.match-detail-panel {
  min-height: 150px;
}

.match-players-summary {
  display: grid;
  gap: 14px;
  padding: 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 14px;
}

.match-players-summary strong,
.match-players-summary span {
  display: block;
}

.match-players-summary strong {
  color: var(--text-main);
  font-size: 15px;
}

.match-players-summary span {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.btn-gold-view {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-gold-view:hover {
  background: #f59e0b;
  color: #0b0e14;
}

/* Match details behaves like a native inner screen on mobile. */
@media (max-width: 700px) {
  #match-details-modal {
    align-items: stretch;
    padding: 0;
    background: var(--bg-main);
    backdrop-filter: none;
  }

  #match-details-modal .modal-card {
    width: 100%;
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    transform: translateX(100%);
    transition: transform 140ms cubic-bezier(0.2, 0, 0, 1);
    will-change: transform;
  }

  #match-details-modal.active .modal-card {
    transform: translateX(0);
  }

  #match-details-modal .modal-header {
    min-height: 46px;
    padding: calc(5px + env(safe-area-inset-top, 0px)) 10px 5px;
    flex: 0 0 auto;
    background: var(--bg-surface);
    z-index: 5;
  }

  #match-details-modal .modal-header h3 {
    font-size: 16px;
  }

  #match-details-modal .modal-close {
    order: -1;
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    font-size: 22px;
    color: var(--text-main);
  }

  #match-details-modal .modal-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px 10px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  #match-details-modal .match-modal-hero {
    height: 88px;
    border-radius: 10px;
  }

  #match-details-modal .match-actions-group {
    position: sticky;
    bottom: calc(-12px - env(safe-area-inset-bottom, 0px));
    z-index: 4;
    margin: 0 -10px -10px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
    background: rgba(11, 14, 20, 0.98);
    border-top: 1px solid var(--border);
  }
}

/* ============================================================
   REFER & EARN SYSTEM (VIRAL GROWTH MODAL)
   ============================================================ */
.refer-card-header {
  text-align: center;
  padding: 10px 0 16px 0;
}

.refer-gift-icon {
  width: 58px;
  height: 58px;
  background: radial-gradient(circle, rgba(255, 85, 0, 0.25) 0%, rgba(15, 21, 35, 0.9) 100%);
  border: 2px solid var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px auto;
  color: var(--primary);
  box-shadow: 0 0 20px rgba(255, 85, 0, 0.3);
}

.refer-code-box {
  background: rgba(147, 51, 234, 0.1);
  border: 2px dashed rgba(168, 85, 247, 0.5);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
  margin: 14px 0;
}

.refer-code-label {
  font-size: 11px;
  text-transform: uppercase;
  color: #c084fc;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.refer-code-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 6px;
}

.refer-code-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 2px;
}

.btn-copy-code {
  background: rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(168, 85, 247, 0.6);
  color: #e9d5ff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  cursor: pointer;
  font-weight: 700;
}

.btn-copy-code:hover {
  background: #9333ea;
  color: #fff;
}

.social-share-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.btn-social-share {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease;
}

.btn-social-share:hover {
  transform: translateY(-2px);
}

.share-whatsapp {
  background: #25D366;
  color: #fff;
}

.share-telegram {
  background: #0088cc;
  color: #fff;
}

.share-facebook {
  background: #1877F2;
  color: #fff;
}

/* ============================================================
   CATEGORIZED FAQ & POLICY ACCORDION
   ============================================================ */
.faq-filter-strip {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  margin-bottom: 14px;
  scrollbar-width: none;
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.faq-filter-strip::-webkit-scrollbar {
  display: none;
}

.faq-pill {
  flex: 0 0 auto;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  scroll-snap-align: start;
}

.faq-modal-header {
  min-height: 74px;
}

.faq-modal-title span {
  display: block;
  margin-bottom: 3px;
  color: var(--primary);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.faq-modal-title h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.2;
}

.faq-pill.active {
  background: var(--primary);
  color: #0b0e14;
  border-color: var(--primary);
}

.faq-accordion-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-accordion-item:hover {
  border-color: rgba(255, 85, 0, 0.4);
}

.faq-accordion-header {
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  user-select: none;
}

.faq-accordion-header .faq-arrow {
  transition: transform 0.2s ease;
  color: var(--text-dim);
}

.faq-accordion-item.open .faq-arrow {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-accordion-body {
  display: none;
  padding: 0 14px 14px 14px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: 4px;
  padding-top: 10px;
}

.faq-accordion-item.open .faq-accordion-body {
  display: block;
}
