/* =============================================
   LET'S SCORE - Main CSS Design System
   RTL Arabic Football Booking Platform
   Mobile-First Responsive Design
   ============================================= */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800;900&family=Tajawal:wght@300;400;500;700;800&display=swap');

/* --- CSS Variables --- */
:root {
  /* Colors */
  --green-900: #0a2e0a;
  --green-800: #0d3d0d;
  --green-700: #145214;
  --green-600: #1a6b1a;
  --green-500: #22882a;
  --green-400: #2eaa38;
  --green-300: #4dcc57;
  --green-200: #86e38e;
  --green-100: #c3f0c7;
  --green-50: #eafbeb;

  --gold: #f5c542;
  --gold-dark: #d4a017;

  --surface-dark: #0b1e0f;
  --surface-card: rgba(15, 35, 15, 0.75);
  --surface-glass: rgba(255, 255, 255, 0.07);
  --surface-glass-hover: rgba(255, 255, 255, 0.12);

  --border-glass: rgba(255, 255, 255, 0.12);
  --border-green: rgba(46, 170, 56, 0.35);

  --text-primary: #e8f5e9;
  --text-secondary: rgba(200, 230, 200, 0.75);
  --text-muted: rgba(200, 230, 200, 0.45);

  --shadow-green: 0 8px 32px rgba(46, 170, 56, 0.25);
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(46, 170, 56, 0.5);

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #0d3d0d 0%, #0a2e0a 40%, #05180a 100%);
  --grad-card: linear-gradient(135deg, rgba(22, 60, 22, 0.9) 0%, rgba(10, 30, 12, 0.95) 100%);
  --grad-green: linear-gradient(135deg, #22882a 0%, #1a6b1a 100%);
  --grad-gold: linear-gradient(135deg, #f5c542 0%, #d4a017 100%);
  --grad-btn: linear-gradient(135deg, #2eaa38 0%, #1a8a22 100%);

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Typography */
  --font-main: 'Cairo', 'Tajawal', sans-serif;

  /* Transitions */
  --transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  direction: rtl;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-main);
  background: var(--surface-dark);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(34, 136, 42, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(10, 46, 10, 0.3) 0%, transparent 60%);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--green-900);
}

::-webkit-scrollbar-thumb {
  background: var(--green-500);
  border-radius: var(--radius-full);
}

/* =============================================
   NAVBAR
   ============================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 30, 10, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-glass);
  padding: 0 1rem;
}

.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: .75rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
  background: var(--grad-card);
  border: 1.5px solid var(--border-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  box-shadow: var(--shadow-green);
}

.nav-logo-text {
  font-weight: 800;
  font-size: 1rem;
  background: linear-gradient(135deg, #4dcc57, #f5c542);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.5px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: center;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-full);
  transition: var(--transition);
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--green-300);
  background: var(--surface-glass);
}

.nav-menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--border-glass);
  color: var(--text-primary);
  padding: 0.5rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.2rem;
  transition: var(--transition);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-menu-btn:hover {
  background: var(--surface-glass);
}

.nav-mobile {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 0 1rem;
  border-top: 1px solid var(--border-glass);
}

.nav-mobile.open {
  display: flex;
}

.nav-mobile a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 1rem;
  padding: 0.65rem 1rem;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-mobile a:hover {
  color: var(--green-300);
  background: var(--surface-glass);
}

/* =============================================
   AUTH UI
   ============================================= */
.auth-user-info {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.auth-user-link {
  display: flex;
  align-items: center;
  gap: .4rem;
  text-decoration: none;
  color: var(--text-primary);
  font-size: .8rem;
  font-weight: 600;
}

.auth-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-green);
  background: var(--green-800);
}

/* Auth page */
.auth-container {
  max-width: 420px;
  margin: 0 auto;
}

.auth-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
}

.auth-tab {
  flex: 1;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: .95rem;
  font-weight: 700;
  padding: .75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  min-height: 48px;
}

.auth-tab:hover {
  border-color: var(--border-green);
  color: var(--green-300);
}

.auth-tab.active {
  background: rgba(46, 170, 56, 0.2);
  border-color: var(--green-400);
  color: var(--green-300);
}

.auth-card {
  text-align: center;
}

.auth-icon {
  font-size: 3.5rem;
  margin-bottom: .75rem;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: .35rem;
}

.auth-subtitle {
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 1.75rem;
}

/* =============================================
   HERO SECTION
   ============================================= */
.hero {
  position: relative;
  padding: 4rem 1.25rem 3rem;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(46, 170, 56, 0.18) 0%, transparent 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(46, 170, 56, 0.15);
  border: 1px solid rgba(46, 170, 56, 0.3);
  color: var(--green-300);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  margin-bottom: 1.25rem;
  letter-spacing: 0.5px;
}

.hero-title {
  font-size: clamp(2.2rem, 8vw, 4.5rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, #fff 30%, #4dcc57 70%, #f5c542 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-tagline {
  font-size: clamp(0.9rem, 3vw, 1.2rem);
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

/* =============================================
   GLASS CARD
   ============================================= */
.glass-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 1.5rem;
  transition: var(--transition);
}

.glass-card:hover {
  border-color: var(--border-green);
  box-shadow: var(--shadow-green);
}

/* =============================================
   SECTION TITLES
   ============================================= */
.section-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: clamp(1.3rem, 4vw, 1.8rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.section-title span {
  background: var(--grad-green);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.section-divider {
  width: 60px;
  height: 3px;
  background: var(--grad-green);
  border-radius: var(--radius-full);
  margin: 0.75rem auto 0;
}

/* =============================================
   MATCH INFO CARDS
   ============================================= */
.match-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.stats-grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.5rem;
}

.meta-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem .75rem;
  text-align: center;
  transition: var(--transition);
}

.meta-card:hover {
  border-color: var(--border-green);
  transform: translateY(-2px);
}

.meta-icon {
  font-size: 1.4rem;
  margin-bottom: 0.4rem;
}

.meta-value {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green-300);
  line-height: 1.2;
  word-break: normal;
}

.meta-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* =============================================
   COUNTDOWN TIMER
   ============================================= */
.countdown-wrap {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1.25rem 0;
  flex-wrap: nowrap;
}

.countdown-unit {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.countdown-num {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--green-300);
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.7rem;
  min-width: 55px;
  text-align: center;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  font-weight: 600;
}

/* =============================================
   PLAYERS PROGRESS BAR
   ============================================= */
.players-progress {
  margin: 1.25rem 0;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
}

.progress-count {
  font-size: 1rem;
  color: var(--green-300);
}

.progress-bar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  height: 10px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--grad-green);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px rgba(46, 170, 56, 0.5);
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  border-radius: var(--radius-full);
  font-family: var(--font-main);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: normal;
  /* Allow text wrap on small screens */
  word-break: break-word;
  min-height: 44px;
  max-width: 100%;
  /* Prevent overflow */
  touch-action: manipulation;
}

.btn-primary {
  background: var(--grad-btn);
  color: #fff;
  box-shadow: 0 4px 20px rgba(46, 170, 56, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(46, 170, 56, 0.55);
  filter: brightness(1.1);
}

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

.btn-secondary {
  background: var(--surface-glass);
  color: var(--text-primary);
  border: 1px solid var(--border-glass);
}

.btn-secondary:hover {
  background: var(--surface-glass-hover);
  border-color: var(--border-green);
}

.btn-gold {
  background: var(--grad-gold);
  color: #1a0a00;
  box-shadow: 0 4px 20px rgba(245, 197, 66, 0.3);
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(245, 197, 66, 0.5);
}

.btn-danger {
  background: rgba(220, 38, 38, 0.15);
  color: #f87171;
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: rgba(220, 38, 38, 0.5);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
  min-height: 36px;
}

.btn-lg {
  padding: 0.9rem 2rem;
  font-size: 1.05rem;
}

.btn-block {
  width: 100%;
}

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

/* =============================================
   PLAYER CARD
   ============================================= */
.players-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.player-card {
  background: var(--grad-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1rem .75rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}

.player-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--grad-green);
  opacity: 0;
  transition: var(--transition);
}

.player-card:hover {
  border-color: var(--border-green);
  transform: translateY(-4px);
  box-shadow: var(--shadow-green);
}

.player-card:hover::before {
  opacity: 1;
}

.player-card.waiting {
  border-color: rgba(245, 197, 66, 0.3);
  opacity: 0.75;
}

.player-card.waiting::before {
  background: var(--grad-gold);
  opacity: 1;
}

.player-card.confirmed {
  border-color: rgba(46, 170, 56, 0.5);
}

.player-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-green);
  margin: 0 auto 0.6rem;
  display: block;
  background: var(--green-800);
}

.player-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player-position-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.18rem 0.5rem;
  border-radius: var(--radius-full);
  background: rgba(46, 170, 56, 0.15);
  border: 1px solid rgba(46, 170, 56, 0.25);
  color: var(--green-300);
  margin-bottom: 0.5rem;
}

.player-stats {
  display: flex;
  justify-content: space-around;
  width: 100%;
  padding-top: 0.6rem;
  border-top: 1px solid var(--border-glass);
}

.player-withdraw-btn {
  width: 100%;
  margin-top: 0.6rem;
  padding: 0.45rem;
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #f87171;
  border-radius: var(--radius-sm);
  font-family: var(--font-main);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  min-height: 36px;
}

.player-withdraw-btn:hover {
  background: rgba(220, 38, 38, 0.25);
  border-color: #f87171;
}

.player-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.05rem;
}

.player-stat-val {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.player-stat>div:last-child {
  font-size: 0.6rem;
  color: var(--text-muted);
}

.player-status-badge {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-full);
  background: rgba(46, 170, 56, 0.2);
  border: 1px solid var(--border-green);
  color: var(--green-300);
}

.player-status-badge.confirmed {
  background: rgba(46, 170, 56, 0.3);
  color: #4dcc57;
}

.player-status-badge.waiting {
  background: rgba(245, 197, 66, 0.15);
  border-color: rgba(245, 197, 66, 0.35);
  color: var(--gold);
}

/* =============================================
   TEAM CARDS
   ============================================= */
.teams-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.team-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1rem;
}

.team-card.team-a {
  border-color: rgba(46, 170, 56, 0.4);
}

.team-card.team-b {
  border-color: rgba(245, 197, 66, 0.4);
}

.team-header {
  text-align: center;
  margin-bottom: 0.75rem;
}

.team-name {
  font-size: 1.1rem;
  font-weight: 800;
}

.team-a .team-name {
  color: var(--green-300);
}

.team-b .team-name {
  color: var(--gold);
}

.team-players {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.team-player-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.45rem 0.65rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
}

.team-player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-green);
  flex-shrink: 0;
  background: var(--green-800);
}

.team-player-name {
  font-size: 0.85rem;
  font-weight: 600;
}

/* =============================================
   MODAL
   ============================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 5000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: linear-gradient(135deg, #0d2e0f 0%, #08180a 100%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 1.5rem;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 -10px 60px rgba(0, 0, 0, 0.6);
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

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

.modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-primary);
}

.modal-close {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
  flex-shrink: 0;
}

.modal-close:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #f87171;
}

/* =============================================
   FORM ELEMENTS
   ============================================= */
.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  outline: none;
  transition: var(--transition);
  direction: rtl;
  min-height: 48px;
}

.form-control:focus {
  border-color: var(--green-400);
  box-shadow: 0 0 0 3px rgba(46, 170, 56, 0.15);
}

.form-control::placeholder {
  color: var(--text-muted);
}

select.form-control option {
  background: #0d2e0f;
  color: var(--text-primary);
}

.avatar-preview-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 1.15rem;
}

.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-green);
  background: var(--green-800);
}

.file-input-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--green-300);
  border: 1px dashed var(--border-green);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.9rem;
  transition: var(--transition);
  min-height: 40px;
}

.file-input-label:hover {
  background: rgba(46, 170, 56, 0.1);
}

input[type="file"] {
  display: none;
}

/* =============================================
   TOAST NOTIFICATIONS
   ============================================= */
.toast-container {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  align-items: center;
}

.toast {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  background: rgba(10, 30, 12, 0.95);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.15rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(12px);
  animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  pointer-events: all;
  font-size: 0.85rem;
  font-weight: 500;
}

.toast.success {
  border-color: rgba(46, 170, 56, 0.4);
}

.toast.error {
  border-color: rgba(220, 38, 38, 0.4);
}

.toast.info {
  border-color: rgba(59, 130, 246, 0.4);
}

.toast-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* =============================================
   BADGE / CHIP
   ============================================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

.badge-green {
  background: rgba(46, 170, 56, 0.15);
  border: 1px solid rgba(46, 170, 56, 0.3);
  color: var(--green-300);
}

.badge-gold {
  background: rgba(245, 197, 66, 0.15);
  border: 1px solid rgba(245, 197, 66, 0.3);
  color: var(--gold);
}

.badge-red {
  background: rgba(220, 38, 38, 0.15);
  border: 1px solid rgba(220, 38, 38, 0.3);
  color: #f87171;
}

/* =============================================
   LEADERBOARD TABLE
   ============================================= */
.leaderboard-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  min-height: 56px;
}

.lb-row:hover {
  border-color: var(--border-green);
  transform: translateX(-3px);
}

.lb-rank {
  font-size: 1rem;
  font-weight: 900;
  min-width: 28px;
  text-align: center;
  color: var(--text-muted);
}

.lb-rank.rank-1 {
  color: var(--gold);
}

.lb-rank.rank-2 {
  color: #c0c0c0;
}

.lb-rank.rank-3 {
  color: #cd7f32;
}

.lb-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border-green);
  background: var(--green-800);
  flex-shrink: 0;
}

.lb-info {
  flex: 1;
  min-width: 0;
}

.lb-name {
  font-weight: 700;
  font-size: 0.88rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lb-pos {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.05rem;
}

.lb-value {
  font-size: 1rem;
  font-weight: 900;
  color: var(--green-300);
  white-space: nowrap;
}

/* =============================================
   MATCH HISTORY
   ============================================= */
.history-card {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
}

.history-card:hover {
  border-color: var(--border-green);
}

.history-card-header {
  background: rgba(0, 0, 0, 0.25);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.history-date {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.history-card-body {
  padding: 1rem;
}

/* =============================================
   ADMIN TABLE & DATA VIEWS
   ============================================= */
.admin-table-wrap {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
  background: var(--surface-glass);
  overflow: hidden;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
  padding: 0.8rem 0.9rem;
  text-align: right;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.admin-table th {
  background: rgba(0, 0, 0, 0.4);
  font-weight: 700;
  color: var(--text-secondary);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.admin-table tr:hover td {
  background: rgba(46, 170, 56, 0.04);
}

/* =============================================
   ADMIN SIDEBAR TABS
   ============================================= */
.admin-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.admin-tab {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
  min-height: 40px;
}

.admin-tab:hover {
  color: var(--green-300);
  border-color: var(--border-green);
}

.admin-tab.active {
  background: rgba(46, 170, 56, 0.2);
  border-color: var(--green-400);
  color: var(--green-300);
}

/* =============================================
   MAP EMBED
   ============================================= */
.map-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-glass);
  box-shadow: var(--shadow-card);
}

.map-wrap iframe {
  width: 100%;
  height: 250px;
  border: none;
  display: block;
}

.map-address {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

/* =============================================
   SPINNER / EMPTY STATE
   ============================================= */
.spinner {
  width: 40px;
  height: 40px;
  margin: 2rem auto;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--green-400);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* =============================================
   IMAGE LIGHTBOX (ZOOM)
   ============================================= */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  padding: 1rem;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.open {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  border: 3px solid var(--border-green);
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(46, 170, 56, 0.3);
  object-fit: contain;
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.lightbox.open img {
  transform: scale(1);
}

.zoomable {
  cursor: zoom-in;
  transition: transform 0.2s ease;
}

.zoomable:hover {
  transform: scale(1.05);
}

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

/* Privacy Modal Content */
.privacy-content {
  text-align: right;
  line-height: 1.8;
}

.privacy-content h1 {
  font-size: 1.5rem;
  color: var(--green-300);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border-green);
  padding-bottom: 0.5rem;
}

.privacy-content h2 {
  font-size: 1.1rem;
  color: var(--green-200);
  margin: 1.5rem 0 1rem;
}

.privacy-content hr {
  border: 0;
  border-top: 1px solid var(--border-glass);
  margin: 1.5rem 0;
}

.privacy-content ul {
  padding-right: 1.25rem;
  margin-bottom: 1rem;
}

.privacy-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: var(--transition);
}

.privacy-link:hover {
  color: var(--green-300);
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 0.65rem;
}

.empty-state-text {
  font-size: 0.92rem;
}

/* =============================================
   RATING STARS
   ============================================= */
.stars {
  display: inline-flex;
  gap: 0.15rem;
  color: var(--gold);
  font-size: 0.85rem;
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  text-align: center;
  padding: 1.75rem 1.25rem;
  border-top: 1px solid var(--border-glass);
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 3rem;
  line-height: 1.6;
}

footer p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}

@media (min-width: 481px) {
  footer p {
    flex-direction: row;
    justify-content: center;
    gap: 0.35rem;
  }
}

footer span {
  color: var(--green-300);
}

/* =============================================
   LAYOUT UTILITIES
   ============================================= */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section {
  padding: 2rem 0;
}

.flex {
  display: flex;
}

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

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

.gap-1 {
  gap: 0.5rem;
}

.gap-2 {
  gap: 1rem;
}

.gap-3 {
  gap: 1.5rem;
}

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

.text-muted {
  color: var(--text-muted);
}

.mt-1 {
  margin-top: 0.5rem;
}

.mt-2 {
  margin-top: 1rem;
}

.mt-3 {
  margin-top: 1.5rem;
}

.mt-4 {
  margin-top: 2rem;
}

.mb-1 {
  margin-bottom: 0.5rem;
}

.mb-2 {
  margin-bottom: 1rem;
}

.mb-3 {
  margin-bottom: 1.5rem;
}

/* =============================================
   RESPONSIVE — TABLET & UP
   ============================================= */
@media (min-width: 481px) {
  .players-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .player-avatar {
    width: 64px;
    height: 64px;
  }

  .player-name {
    font-size: 0.9rem;
  }

  .player-stats {
    padding-top: 0.75rem;
  }

  .countdown-num {
    font-size: 2.2rem;
    min-width: 65px;
    padding: 0.45rem 0.8rem;
  }

  .match-meta-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .map-wrap iframe {
    height: 320px;
  }

  .modal-overlay {
    align-items: center;
    padding: 1rem;
  }

  .modal {
    border-radius: var(--radius-xl);
    padding: 2rem;
  }

  .teams-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .toast-container {
    left: auto;
    align-items: flex-end;
  }
}

@media (min-width: 769px) {
  .nav-links {
    display: flex;
  }

  .nav-menu-btn {
    display: none;
  }

  .nav-inner {
    height: 65px;
  }

  .hero {
    padding: 5rem 1.5rem 4rem;
  }

  .glass-card {
    padding: 1.75rem;
  }

  .section {
    padding: 3rem 0;
  }
}

/* Mobile overrides (hidden nav links, show mobile btn) */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-menu-btn {
    display: flex;
  }
}

/* Responsive admin table on mobile */
@media (max-width: 640px) {
  .admin-table-wrap {
    border: none;
    background: none;
  }

  .admin-table thead {
    display: none;
  }

  .admin-table,
  .admin-table tbody,
  .admin-table tr,
  .admin-table td {
    display: block;
    width: 100%;
  }

  .admin-table tr {
    background: var(--surface-glass);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    margin-bottom: 0.75rem;
    padding: 0.65rem;
    position: relative;
    box-shadow: var(--shadow-card);
  }

  .admin-table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.55rem 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: left;
    white-space: normal;
  }

  .admin-table td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.72rem;
    text-transform: uppercase;
    margin-left: 0.75rem;
  }

  .admin-table td:last-child {
    border-bottom: none;
    justify-content: center;
    padding-top: 0.75rem;
    gap: 0.4rem;
  }
}

/* Specific overrides for very small screens */
@media (max-width: 480px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .glass-card {
    padding: 1rem 0.75rem;
  }

  .countdown-num {
    font-size: 1.4rem;
    min-width: 45px;
    padding: 0.3rem 0.5rem;
  }

  .countdown-unit {
    min-width: 50px;
  }

  .match-meta-grid {
    gap: 0.5rem;
  }

  .meta-value {
    font-size: 1rem;
  }

  .players-grid {
    gap: 0.5rem;
  }

  .player-avatar {
    width: 48px;
    height: 48px;
  }

  .player-card {
    padding: 0.85rem 0.5rem;
  }

  .player-name {
    font-size: 0.78rem;
  }

  .player-position-badge {
    font-size: 0.62rem;
    padding: 0.15rem 0.4rem;
  }

  .player-stat-val {
    font-size: 0.75rem;
  }

  .lb-row {
    padding: 0.6rem 0.75rem;
  }

  .lb-name {
    font-size: 0.82rem;
  }

  .lb-rank {
    font-size: 0.85rem;
    min-width: 22px;
  }
}

/* =============================================
   FOOTER
   ============================================= */
footer {
  text-align: center;
  padding: 4rem 1rem 3rem;
  margin-top: 5rem;
  border-top: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  position: relative;
  z-index: 10;
}

@media (max-width: 480px) {
  footer {
    padding-bottom: 11rem;
    /* Space for floating social buttons */
  }
}

/* =============================================
   SAFE AREA (iOS notch)
   ============================================= */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  footer {
    padding-bottom: calc(3rem + env(safe-area-inset-bottom));
  }

  @media (max-width: 480px) {
    footer {
      padding-bottom: calc(11rem + env(safe-area-inset-bottom));
    }
  }

  .toast-container {
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }
}

/* =============================================
   MATCH HISTORY META (inline)
   ============================================= */
.match-history-meta {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--text-muted);
}

/* =============================================
   WHATSAPP QUICK BUTTON
   ============================================= */
/* SOCIAL BUTTONS */
.whatsapp-btn-quick {
  position: fixed;
  bottom: 1.5rem;
  left: 1.5rem;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #25d366;
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(37, 211, 102, 0.4);
  transition: var(--transition);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  animation: float-btn 3s ease-in-out infinite;
}

.instagram-btn-quick {
  position: fixed;
  bottom: 5.2rem;
  left: 1.5rem;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  color: #fff;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(220, 39, 67, 0.4);
  transition: var(--transition);
  border: 1.5px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  animation: float-btn 3s ease-in-out infinite 0.5s;
}

.whatsapp-btn-quick:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 35px rgba(37, 211, 102, 0.6);
  background: #1faf54;
}

.instagram-btn-quick:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 15px 35px rgba(220, 39, 67, 0.6);
  filter: brightness(1.1);
}

.social-btn-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.footer-socials {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1rem;
}

.footer-social-link {
  color: var(--text-secondary);
  font-size: 1.5rem;
  transition: var(--transition);
}

.footer-social-link:hover {
  color: var(--green-300);
  transform: scale(1.2);
}

@keyframes float-btn {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-8px);
  }
}

@media (max-width: 480px) {
  .whatsapp-btn-quick {
    bottom: 1rem;
    left: 1rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    gap: 0.4rem;
  }

  .instagram-btn-quick {
    bottom: 4.2rem;
    left: 1rem;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    gap: 0.4rem;
  }
}

/* =============================================
   HERO MINI (For sub-pages)
   ============================================= */
.hero-mini {
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
  background: var(--grad-hero);
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--border-glass);
}

/* =============================================
   LEADERBOARD STYLES (Modern)
   ============================================= */
/* --- Leaderboard Tabs --- */
/* --- Leaderboard Tabs --- */
.leaderboard-tabs-container {
  position: relative;
  margin: 1rem 0;
  display: flex;
  align-items: center;
}

/* Indicators that there is more content to scroll */
.leaderboard-tabs-container::before,
.leaderboard-tabs-container::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40px;
  z-index: 2;
  pointer-events: none;
  transition: opacity 0.3s;
}

.leaderboard-tabs-container::before {
  left: 0;
  background: linear-gradient(to right, var(--surface-dark), transparent);
}

.leaderboard-tabs-container::after {
  right: 0;
  background: linear-gradient(to left, var(--surface-dark), transparent);
}

.leaderboard-tabs-scroll {
  overflow-x: auto;
  width: 100%;
  scrollbar-width: none;
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}

.leaderboard-tabs-scroll::-webkit-scrollbar {
  display: none;
}

.leaderboard-tabs {
  display: flex;
  gap: 0.75rem;
  padding: 0 1.5rem; /* Space for the fade effect */
  min-width: max-content;
}

.tab-btn {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-family: var(--font-main);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.tab-btn:hover {
  border-color: var(--border-green);
  color: var(--green-300);
}
.tab-btn.active {
  background: var(--green-600);
  border-color: var(--green-400);
  color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* --- Leaderboard Row Layout --- */
.leaderboard-list-full {
  display: flex;
  flex-direction: column;
}
.leaderboard-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-glass);
  transition: var(--transition);
  gap: 1rem;
}
.leaderboard-row:last-child {
  border-bottom: none;
}
.leaderboard-row:hover {
  background: rgba(255, 255, 255, 0.03);
}
.leaderboard-row.is-me {
  background: rgba(46, 170, 56, 0.1);
  border-right: 4px solid var(--green-400);
}

.rank-col {
  width: 40px;
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--text-muted);
  text-align: center;
  flex-shrink: 0;
}
.rank-1 { color: var(--gold); font-size: 1.4rem; }
.rank-2 { color: #d1d5db; font-size: 1.25rem; }
.rank-3 { color: #d97706; font-size: 1.2rem; }

.player-col {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}
.row-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1.5px solid var(--border-green);
  background: var(--green-800);
  flex-shrink: 0;
}
.player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.row-name {
  font-weight: 700;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-name small {
  color: var(--green-300);
  font-size: 0.7rem;
  margin-right: 0.2rem;
}
.row-pos {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.score-col {
  width: 80px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}
.score-val {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--green-300);
  line-height: 1;
}
.score-unit {
  font-size: 0.6rem;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 1px;
}

/* Spinner */
.spinner-container {
  padding: 3rem;
  display: flex;
  justify-content: center;
}

/* Mobile Adjustments */
@media (max-width: 480px) {
  .leaderboard-row {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }
  .player-col {
    gap: 0.65rem;
  }
  .row-avatar {
    width: 38px;
    height: 38px;
  }
  .row-name {
    font-size: 0.85rem;
  }
  .score-val {
    font-size: 1.1rem;
  }
  .score-col {
    width: 70px;
  }
}