/* === Reset & Base === */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a73e8;
  --primary-dark: #1557b0;
  --primary-light: #e8f0fe;
  --success: #34a853;
  --danger: #ea4335;
  --warning: #fbbc04;
  --bg: #f8f9fa;
  --bg-card: #ffffff;
  --text: #202124;
  --text-secondary: #5f6368;
  --border: #dadce0;
  --shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

html {
  font-size: 16px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

/* === Typography === */
h1, h2, h3 { font-weight: 600; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

/* === Layout === */
.app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
  padding-bottom: 80px;
}

/* === Navigation Bar === */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.navbar-brand svg {
  width: 28px;
  height: 28px;
}

.navbar-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.navbar-user {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* === Bottom Navigation === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  padding: 8px 0;
  z-index: 100;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.625rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color var(--transition);
  flex: 1;
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a svg {
  width: 22px;
  height: 22px;
  margin-bottom: 2px;
}

/* Central "New Match" nav button */
.bottom-nav a.nav-new-match {
  position: relative;
  color: var(--primary);
}

.nav-new-match-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  margin-top: -28px;
  margin-bottom: 2px;
  box-shadow: 0 2px 12px rgba(26, 115, 232, 0.4);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.nav-new-match-icon svg {
  width: 24px;
  height: 24px;
}

.bottom-nav a.nav-new-match:active .nav-new-match-icon {
  transform: scale(0.92);
}

.bottom-nav a.nav-new-match.active .nav-new-match-icon {
  box-shadow: 0 2px 16px rgba(26, 115, 232, 0.6);
}

/* === Cards === */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  opacity: 0.9;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  background: var(--bg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  padding: 8px;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
}

.btn-icon:hover {
  background: var(--bg);
}

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

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-family: inherit;
  transition: border-color var(--transition);
  background: var(--bg-card);
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235f6368' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

select.form-control option.friend-option {
  font-weight: 600;
  color: var(--primary);
}

/* === Match Display (Foosball Table) === */
.match-table {
  background: #2d8a4e;
  border-radius: var(--radius);
  padding: 20px;
  color: white;
  position: relative;
  overflow: hidden;
}

.match-table::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: rgba(255,255,255,0.3);
  transform: translateX(-50%);
}

.match-table::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
}

.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.match-team {
  text-align: center;
}

.match-team-label {
  font-size: 0.625rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  opacity: 0.8;
  margin-bottom: 8px;
}

.match-player {
  font-size: 0.8125rem;
  margin-bottom: 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.match-player-role {
  font-size: 0.625rem;
  opacity: 0.7;
  text-transform: uppercase;
}

.match-score {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.75rem;
  font-weight: 700;
}

.match-score-separator {
  font-size: 1rem;
  opacity: 0.6;
}

.match-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255,255,255,0.2);
  font-size: 0.6875rem;
  opacity: 0.8;
  position: relative;
  z-index: 1;
}

.match-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 600;
}

.match-status.pending {
  background: rgba(251, 188, 4, 0.3);
  color: #fff;
}

.match-status.validated {
  background: rgba(52, 168, 83, 0.3);
  color: #fff;
}

.match-status.disputed {
  background: rgba(234, 67, 53, 0.4);
  color: #fff;
}

.match-status.cancelled {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.6);
}

/* Pending match card */
.match-table.match-pending {
  background: #236b3c;
  border: 1.5px dashed rgba(255,255,255,0.25);
}

/* Disputed match card */
.match-table.match-disputed {
  background: #5c2a2a;
  border: 1.5px dashed rgba(234, 67, 53, 0.5);
}

/* Cancelled match card */
.match-table.match-cancelled {
  background: #3a3a3a;
  border: 1.5px solid rgba(255,255,255,0.1);
  opacity: 0.7;
}

/* Friendly match card */
.match-table.match-friendly {
  border: 1.5px solid rgba(0, 188, 212, 0.35);
}

/* Friendly match type badge */
.match-type-badge.friendly {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: rgba(0, 188, 212, 0.3);
  color: #b2ebf2;
  vertical-align: middle;
  margin-right: 4px;
}

/* Win/loss accents (symmetric left + right) */
.match-table.match-won {
  box-shadow: inset 5px 0 0 0 #ffd700, inset -5px 0 0 0 #ffd700;
}

.match-table.match-lost {
  box-shadow: inset 5px 0 0 0 #ef5350, inset -5px 0 0 0 #ef5350;
}

/* Win/loss result badge */
.match-result-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-right: 4px;
}

.match-result-badge.win {
  background: rgba(255,215,0,0.25);
  color: #ffd700;
}

.match-result-badge.loss {
  background: rgba(234,67,53,0.3);
  color: #ffcdd2;
}

/* Auto-validation countdown */
.match-countdown {
  display: block;
  text-align: center;
  font-size: 0.625rem;
  color: rgba(255,255,255,0.6);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.1);
  position: relative;
  z-index: 1;
}

/* === Ranking Table === */
.ranking-list {
  list-style: none;
}

.ranking-item {
  display: grid;
  grid-template-columns: 32px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.ranking-position {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.8125rem;
  font-weight: 700;
  background: var(--bg);
  color: var(--text-secondary);
}

.ranking-position.top-1 {
  background: #ffd700;
  color: #000;
}

.ranking-position.top-2 {
  background: #c0c0c0;
  color: #000;
}

.ranking-position.top-3 {
  background: #cd7f32;
  color: #fff;
}

.ranking-name {
  font-weight: 600;
  font-size: 0.9375rem;
}

.ranking-stats {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ranking-points {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--primary);
}

.ranking-details {
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

/* === Auth Pages === */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-logo {
  margin-bottom: 32px;
  text-align: center;
}

.auth-logo h1 {
  font-size: 2rem;
  color: var(--primary);
  margin-top: 12px;
}

.auth-logo p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
}

.auth-footer {
  text-align: center;
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.auth-footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.auth-legal-links {
  margin-top: 8px;
  font-size: 0.8rem;
}

/* === Terms Notice (Signup) === */
.terms-notice {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 12px 0 16px;
  line-height: 1.5;
}

.terms-notice a {
  color: var(--primary);
  text-decoration: underline;
  font-weight: 500;
}

/* === Terms Page === */
.terms-card {
  max-height: 80vh;
  overflow-y: auto;
}

.terms-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.terms-header h2 {
  font-size: 1.125rem;
  margin: 0;
}

.terms-content .terms-app-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.terms-content .terms-updated {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.terms-content h3 {
  font-size: 0.95rem;
  margin-top: 20px;
  margin-bottom: 8px;
}

.terms-content p {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 8px;
}

.terms-content ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.terms-content ul li {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
  margin-bottom: 4px;
}

/* === OTP Input === */
.otp-input {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: 8px;
  padding: 12px;
}

.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn-link:disabled {
  color: var(--text-secondary);
  cursor: default;
  text-decoration: none;
}

/* === Welcome Dashboard === */
.welcome-dashboard {
  background: linear-gradient(135deg, #1a73e8 0%, #1557b0 100%);
  border-radius: var(--radius);
  margin: 16px 0;
  padding: 20px;
  color: white;
}

.dashboard-greeting {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 16px;
}

.dashboard-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

.dashboard-wave {
  font-size: 1.125rem;
  font-weight: 500;
  opacity: 0.9;
}

.dashboard-username {
  font-size: 1.375rem;
  font-weight: 700;
}

.dashboard-stat-card {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-sm);
  padding: 12px 10px;
  text-align: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

.dashboard-stat-card:active {
  transform: scale(0.97);
}

.dashboard-stat-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
  opacity: 0.85;
}

.dashboard-stat-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.8;
  font-weight: 600;
  margin-bottom: 4px;
}

.dashboard-stat-value {
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1.2;
}

.dashboard-stat-rank {
  font-size: 0.7rem;
  opacity: 0.75;
  margin-top: 2px;
  font-weight: 500;
}

/* === Section Headers === */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 24px 0 12px;
}

.section-header h2 {
  font-size: 1.125rem;
}

/* === Badge === */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  background: var(--danger);
  color: white;
}

/* === Empty State === */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 12px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 0.875rem;
}

/* === Toast Notifications === */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* === Loading Spinner === */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 20px auto;
}

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

/* === Tabs === */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}

.tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* === Friends indicator in select === */
.select-friend {
  background-color: var(--primary-light);
}

/* === Responsive === */
@media (min-width: 768px) {
  .app {
    max-width: 600px;
  }

  .bottom-nav {
    max-width: 600px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius) var(--radius) 0 0;
  }
}

/* === Page Transitions === */
.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Friend Request Items === */
.friend-request-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.friend-request-item:last-child {
  border-bottom: none;
}

/* === Assessment Page === */
.assessment-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px 6px 8px;
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-back:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-light);
}

.btn-back:active {
  transform: scale(0.95);
}

.assessment-steps {
  display: flex;
  justify-content: center;
  flex: 1;
  gap: 12px;
}

.assessment-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  background: var(--bg);
  color: var(--text-secondary);
  border: 2px solid var(--border);
  transition: all var(--transition);
}

.assessment-step.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.assessment-step.completed {
  background: var(--success);
  color: white;
  cursor: pointer;
  border-color: var(--success);
}

.assessment-question {
  display: none;
  animation: fadeIn 0.3s ease;
}

.assessment-question.active {
  display: block;
}

.assessment-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.assessment-option {
  padding: 12px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.875rem;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition);
  text-align: left;
}

.assessment-option:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}

.assessment-option.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* === Rating Result Display === */
.rating-result-container {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin: 16px 0;
}

.rating-result-item {
  text-align: center;
}

.rating-result-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

.rating-result-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
}

.rating-result-sub {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* === Rating Deltas === */
.player-rating-info {
  font-size: 0.625rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.75);
  margin-left: 4px;
}

.rating-delta {
  font-size: 0.625rem;
  font-weight: 700;
  margin-left: 2px;
  padding: 1px 5px;
  border-radius: 4px;
}
.delta-positive {
  color: #fff;
  background: rgba(255,255,255,0.22);
}
.delta-negative {
  color: #ffcdd2;
  background: rgba(234,67,53,0.35);
}
.delta-neutral {
  color: rgba(255, 255, 255, 0.5);
  background: none;
  padding: 0;
  margin-left: 0;
}

/* === Player Profile Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 360px;
  padding: 24px;
  animation: fadeIn 0.2s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-size: 1.125rem;
}

.player-name-link {
  cursor: pointer;
  color: var(--primary);
  font-weight: 600;
}

.player-name-link:hover {
  text-decoration: underline;
}

.match-table .player-name-link {
  color: white;
  font-size: 0.9375rem;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* === Profile Modal Matches === */
.profile-matches-title {
  font-size: 0.9375rem;
  font-weight: 700;
  margin: 20px 0 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.profile-match-card {
  margin-bottom: 12px;
  padding: 14px;
  font-size: 0.8125rem;
}

.profile-match-card .match-teams {
  gap: 8px;
}

.profile-match-card .match-team-label {
  font-size: 0.625rem;
}

.profile-match-card .match-player {
  font-size: 0.75rem;
}

.profile-match-card .match-player-role {
  font-size: 0.625rem;
}

.profile-match-card .match-score span {
  font-size: 1.25rem;
}

.profile-match-card .match-meta {
  font-size: 0.6875rem;
  padding-top: 8px;
  margin-top: 10px;
}

/* === Stats Cards === */
.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 16px 0;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 14px 8px;
  border-radius: var(--radius);
  background: var(--bg);
  border: 1px solid var(--border);
  gap: 4px;
  position: relative;
}

.stat-info-btn {
  position: absolute;
  top: 6px;
  right: 6px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 2px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}
.stat-info-btn:hover {
  opacity: 1;
}
.stat-info-tooltip {
  display: none;
  position: absolute;
  top: -32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  font-size: 0.6875rem;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
  z-index: 10;
  pointer-events: none;
}
.stat-info-tooltip.visible {
  display: block;
}

.stat-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-bottom: 2px;
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.6875rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Stat color variants */
.stat-record .stat-icon {
  background: rgba(26, 115, 232, 0.1);
  color: var(--primary);
}
.stat-record .stat-value {
  color: var(--primary);
}

.stat-streak .stat-icon {
  background: rgba(251, 188, 4, 0.12);
  color: #f59e0b;
}
.stat-streak .stat-value {
  color: #f59e0b;
}

.stat-crushing .stat-icon {
  background: rgba(52, 168, 83, 0.1);
  color: var(--success);
}
.stat-crushing .stat-value {
  color: var(--success);
}

.stat-under .stat-icon {
  background: rgba(234, 67, 53, 0.1);
  color: var(--error);
}
.stat-under .stat-value {
  color: var(--error);
}

/* === Admin Delete Match Button === */
.btn-delete-match {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
  vertical-align: middle;
}

.btn-delete-match:hover {
  background: rgba(234,67,53,0.85);
  color: white;
}

/* === New Match: Position Scores & Swap === */
.player-position-score {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 4px;
  min-height: 1.125rem;
}

.swap-btn-container {
  display: flex;
  justify-content: center;
  margin: -2px 0 4px;
}

.btn-swap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-swap:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.btn-swap:active {
  transform: scale(0.9);
}

/* === Large Modal variant === */
.modal-card-lg {
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.modal-card-lg .modal-body {
  overflow-y: auto;
  flex: 1;
  padding-top: 4px;
}

/* === FAQ Accordion === */
.faq-item {
  border-bottom: 1px solid var(--border);
}

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

.faq-toggle {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  line-height: 1.4;
}

.faq-toggle:hover {
  color: var(--primary);
}

.faq-chevron {
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.open .faq-content {
  max-height: 600px;
}

.faq-content p,
.faq-content ul,
.faq-content ol {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 10px;
}

.faq-content ul,
.faq-content ol {
  padding-left: 20px;
}

.faq-content li {
  margin-bottom: 4px;
}

.faq-content p:last-child,
.faq-content ul:last-child,
.faq-content ol:last-child {
  margin-bottom: 14px;
}

/* === Dispute Info Banner === */
.dispute-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  margin-top: 10px;
  background: rgba(234, 67, 53, 0.2);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(234, 67, 53, 0.3);
  font-size: 0.6875rem;
  position: relative;
  z-index: 1;
}

.dispute-info-label {
  font-weight: 600;
  color: #ffcdd2;
}

.dispute-info-reason {
  color: rgba(255, 255, 255, 0.9);
}

.dispute-info-note {
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
}

/* === Dispute countdown === */
.disputed-countdown {
  color: rgba(234, 67, 53, 0.8) !important;
}

/* === Match action buttons in match card === */
.btn-dispute {
  border-color: rgba(234, 67, 53, 0.5) !important;
  color: #ffcdd2 !important;
}

.btn-dispute:hover {
  background: rgba(234, 67, 53, 0.3) !important;
}

.btn-edit-match {
  border-color: rgba(255, 255, 255, 0.3) !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

.btn-edit-match:hover {
  background: rgba(255, 255, 255, 0.1) !important;
}

.btn-cancel-match {
  border-color: transparent !important;
  color: white !important;
  background: rgba(234, 67, 53, 0.75) !important;
}

.btn-cancel-match:hover {
  background: rgba(234, 67, 53, 0.95) !important;
}

/* === Toggle Switch === */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 12px;
}

.toggle-label {
  font-weight: 500;
  font-size: 0.875rem;
}

.toggle-input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.toggle-input:checked + .toggle-switch {
  background: #00bcd4;
}

.toggle-input:checked + .toggle-switch::after {
  transform: translateX(18px);
}

/* === Textarea in modals === */
textarea.form-control {
  resize: vertical;
  min-height: 60px;
}

/* === Utility === */
.text-center { text-align: center; }
.text-muted { color: var(--text-secondary); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* === Password Requirements === */
.password-requirements {
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.password-req-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.password-requirements ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.password-requirements li {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 2px 0;
  padding-left: 20px;
  position: relative;
}

.password-requirements li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
}

.password-requirements li.met {
  color: var(--success);
}

.password-requirements li.met::before {
  border-color: var(--success);
  background: var(--success);
}

.password-requirements li.unmet {
  color: var(--danger);
}

.password-requirements li.unmet::before {
  border-color: var(--danger);
}

/* === Pro User Gold Shiny Effect === */
@keyframes pro-shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

.pro-username {
  background: linear-gradient(
    90deg,
    #b8860b 0%,
    #ffd700 25%,
    #fff8a8 50%,
    #ffd700 75%,
    #b8860b 100%
  );
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pro-shimmer 3s linear infinite;
  font-weight: 700;
}
