/* ============================================
   SHOOTING CONTEST - MILITARY CAMO THEME
   ============================================ */

:root {
  /* Military Camo Palette */
  --camo-dark: #1a1f16;
  --camo-base: #2d3328;
  --camo-mid: #3d4a35;
  --camo-light: #4a5d3e;
  --camo-accent: #5c7a45;
  --camo-highlight: #6b8f50;

  /* Sand / Tan accents */
  --sand: #c4a96a;
  --sand-light: #d4be8a;
  --sand-dark: #a08040;

  /* UI Colors */
  --bg-primary: #111410;
  --bg-secondary: #1a1f16;
  --bg-card: #222920;
  --bg-card-hover: #2a332a;
  --bg-input: #1e2419;

  --text-primary: #e8e4d8;
  --text-secondary: #b0a890;
  --text-muted: #7a7560;

  --border-color: #3a4030;
  --border-light: #4a5440;

  --gold: #ffd700;
  --silver: #c0c0c0;
  --bronze: #cd7f32;

  --success: #4a8c3f;
  --warning: #c4a020;
  --danger: #8c3f3f;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.5);

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Tajawal', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  direction: rtl;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Camo background pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% 30%, rgba(74,93,62,0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 70%, rgba(45,51,40,0.2) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 50% 50%, rgba(92,122,69,0.08) 0%, transparent 50%),
    url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 20 Q60 10 80 40 T120 50 Q150 30 170 60 T140 90 Q110 80 90 100 T50 80 Q20 60 30 20Z' fill='rgba(74,93,62,0.06)'/%3E%3Cpath d='M100 120 Q130 100 160 130 T180 170 Q160 190 130 180 T90 160 Q70 140 100 120Z' fill='rgba(45,51,40,0.08)'/%3E%3Cpath d='M10 140 Q40 120 60 150 T50 180 Q30 190 20 170 T10 140Z' fill='rgba(92,122,69,0.05)'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
}

/* Floating particles */
.particles {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: var(--camo-accent);
  border-radius: 50%;
  opacity: 0;
  animation: particleFloat 8s infinite;
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  20% { opacity: 0.3; }
  80% { opacity: 0.1; }
  100% { transform: translateY(-20vh) scale(1); opacity: 0; }
}

/* ============================================
   HEADER
   ============================================ */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 31, 22, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  color: var(--sand);
  animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.logo-section h1 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--sand-light);
  letter-spacing: -0.5px;
}

.logo-section .subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 400;
}

.main-nav {
  display: flex;
  gap: 4px;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.nav-btn:hover {
  color: var(--text-primary);
  background: rgba(92,122,69,0.15);
}

.nav-btn.active {
  color: var(--sand-light);
  background: rgba(196,169,106,0.12);
}

.nav-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--sand);
  border-radius: 2px;
}

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.mobile-menu-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--sand);
  transition: var(--transition);
  border-radius: 2px;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: rgba(26, 31, 22, 0.98);
  backdrop-filter: blur(20px);
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  padding: 1rem;
  gap: 4px;
  z-index: 99;
  border-bottom: 1px solid var(--border-color);
  transform: translateY(-100%);
  opacity: 0;
  transition: var(--transition);
}

.mobile-nav.open {
  transform: translateY(0);
  opacity: 1;
}

.mobile-nav .nav-btn {
  text-align: right;
  padding: 12px 16px;
  font-size: 1.05rem;
}

@media (max-width: 768px) {
  .main-nav { display: none; }
  .mobile-menu-btn { display: flex; }
  .mobile-nav { display: flex; }
}

/* ============================================
   CONTAINER & PAGES
   ============================================ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  position: relative;
  z-index: 1;
}

.page {
  display: none;
  animation: pageIn 0.4s ease-out;
}

.page.active {
  display: block;
}

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

/* ============================================
   HERO
   ============================================ */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background: linear-gradient(135deg, rgba(45,51,40,0.5) 0%, rgba(74,93,62,0.3) 50%, rgba(45,51,40,0.5) 100%);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(196,169,106,0.05) 0%, transparent 50%);
  animation: heroGlow 6s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  0% { transform: translate(0, 0); }
  100% { transform: translate(5%, 5%); }
}

.hero-badge {
  display: inline-block;
  padding: 6px 20px;
  background: rgba(196,169,106,0.12);
  border: 1px solid rgba(196,169,106,0.25);
  border-radius: 50px;
  font-size: 0.85rem;
  color: var(--sand);
  margin-bottom: 1.5rem;
  position: relative;
}

.hero h2 {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 1rem;
  position: relative;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.8;
  position: relative;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--camo-accent), var(--camo-highlight));
  color: #fff;
  box-shadow: 0 2px 12px rgba(92,122,69,0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--camo-highlight), #7aa55a);
  box-shadow: 0 4px 20px rgba(92,122,69,0.4);
  transform: translateY(-1px);
}

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

.btn-outline:hover {
  background: rgba(196,169,106,0.1);
  border-color: var(--sand);
}

.btn-warning {
  background: linear-gradient(135deg, #8a7a20, #a09030);
  color: #fff;
}

.btn-warning:hover {
  background: linear-gradient(135deg, #a09030, #b0a040);
}

.btn-danger {
  background: linear-gradient(135deg, #6a2020, #8c3f3f);
  color: #fff;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #8c3f3f, #a05050);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1.05rem;
}

.btn-full {
  width: 100%;
  justify-content: center;
}

/* ============================================
   STATS GRID
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.stat-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 0.75rem;
  padding: 10px;
  border-radius: 50%;
  background: rgba(92,122,69,0.15);
  color: var(--camo-highlight);
}

.stat-icon.men { background: rgba(100,149,237,0.15); color: #6495ed; }
.stat-icon.women { background: rgba(218,112,147,0.15); color: #da7093; }
.stat-icon.rounds { background: rgba(196,169,106,0.15); color: var(--sand); }

.stat-icon svg {
  width: 100%;
  height: 100%;
}

.stat-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 4px;
}

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

/* Registration status banner */
.reg-status-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 1rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.status-dot.open {
  background: var(--success);
  box-shadow: 0 0 8px rgba(74,140,63,0.5);
  animation: dotPulse 2s infinite;
}

.status-dot.closed {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(140,63,63,0.5);
}

@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ============================================
   PAGE HEADERS
   ============================================ */
.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--sand-light);
  margin-bottom: 0.5rem;
}

.page-header p {
  color: var(--text-secondary);
  font-size: 1rem;
}

/* ============================================
   FORMS
   ============================================ */
.register-form {
  max-width: 560px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
  direction: rtl;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--camo-accent);
  box-shadow: 0 0 0 3px rgba(92,122,69,0.2);
}

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

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 1rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 150px;
}

/* Gender selector */
.gender-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.gender-option {
  cursor: pointer;
}

.gender-option input {
  display: none;
}

.gender-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  transition: var(--transition);
}

.gender-card svg {
  width: 40px;
  height: 40px;
}

.gender-card span {
  font-weight: 700;
  font-size: 1rem;
}

.gender-card.men {
  color: var(--text-secondary);
}

.gender-card.women {
  color: var(--text-secondary);
}

.gender-option input:checked + .gender-card.men {
  border-color: #6495ed;
  background: rgba(100,149,237,0.1);
  color: #6495ed;
  box-shadow: 0 0 20px rgba(100,149,237,0.15);
}

.gender-option input:checked + .gender-card.women {
  border-color: #da7093;
  background: rgba(218,112,147,0.1);
  color: #da7093;
  box-shadow: 0 0 20px rgba(218,112,147,0.15);
}

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

/* Success message */
.success-message {
  text-align: center;
  padding: 3rem 2rem;
  max-width: 500px;
  margin: 0 auto;
}

.success-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 1.5rem;
  color: var(--success);
  animation: successPop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.success-icon svg {
  width: 100%;
  height: 100%;
}

@keyframes successPop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.success-message h3 {
  font-size: 1.5rem;
  color: var(--success);
  margin-bottom: 0.75rem;
}

.success-message p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

/* Alert */
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 500;
}

.alert svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.alert-warning {
  background: rgba(196,160,32,0.1);
  border: 1px solid rgba(196,160,32,0.3);
  color: var(--warning);
}

/* ============================================
   LEADERBOARD
   ============================================ */
.leaderboard-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 2rem;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
}

.tab-btn svg {
  width: 20px;
  height: 20px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.tab-btn.active {
  background: rgba(92,122,69,0.2);
  color: var(--sand-light);
}

.leaderboard-content {
  display: none;
}

.leaderboard-content.active {
  display: block;
  animation: pageIn 0.3s ease-out;
}

/* Podium */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 2rem;
  min-height: 50px;
}

.podium-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.podium-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--bg-primary);
  position: relative;
}

.podium-item:nth-child(1) .podium-avatar { /* 2nd place - displayed first */
  background: linear-gradient(135deg, #a0a0a0, #d0d0d0);
  width: 56px;
  height: 56px;
  font-size: 1.3rem;
}

.podium-item:nth-child(2) .podium-avatar { /* 1st place - center */
  background: linear-gradient(135deg, #d4a020, #ffd700);
  width: 72px;
  height: 72px;
  font-size: 1.8rem;
  box-shadow: 0 0 30px rgba(255,215,0,0.3);
}

.podium-item:nth-child(3) .podium-avatar { /* 3rd place */
  background: linear-gradient(135deg, #a06020, #cd7f32);
  width: 52px;
  height: 52px;
  font-size: 1.2rem;
}

.podium-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-primary);
  text-align: center;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.podium-points {
  font-size: 0.8rem;
  color: var(--sand);
  font-weight: 600;
}

.podium-bar {
  width: 90px;
  border-radius: 8px 8px 0 0;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-bottom: none;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  transition: var(--transition);
}

.podium-item:nth-child(1) .podium-bar { height: 100px; }
.podium-item:nth-child(2) .podium-bar {
  height: 140px;
  background: linear-gradient(to top, var(--bg-card), rgba(255,215,0,0.08));
  border-color: rgba(255,215,0,0.2);
}
.podium-item:nth-child(3) .podium-bar { height: 75px; }

.podium-rank {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--text-muted);
}

.podium-item:nth-child(2) .podium-rank { color: var(--gold); font-size: 1.8rem; }

/* Leaderboard table */
.leaderboard-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  overflow: hidden;
}

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

.leaderboard-table thead {
  background: rgba(92,122,69,0.1);
}

.leaderboard-table th {
  padding: 14px 16px;
  text-align: right;
  font-weight: 700;
  color: var(--sand);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--border-color);
}

.leaderboard-table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(58,64,48,0.5);
  font-size: 0.95rem;
}

.leaderboard-table tr {
  transition: var(--transition);
}

.leaderboard-table tbody tr:hover {
  background: rgba(92,122,69,0.06);
}

.leaderboard-table .rank-cell {
  font-weight: 800;
  color: var(--text-muted);
  width: 60px;
}

.leaderboard-table .rank-1 { color: var(--gold); }
.leaderboard-table .rank-2 { color: var(--silver); }
.leaderboard-table .rank-3 { color: var(--bronze); }

.leaderboard-table .name-cell {
  font-weight: 600;
}

.leaderboard-table .points-cell {
  font-weight: 800;
  color: var(--sand);
  font-size: 1.05rem;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 800;
}

.rank-badge.gold {
  background: linear-gradient(135deg, rgba(255,215,0,0.2), rgba(255,215,0,0.1));
  color: var(--gold);
  border: 1px solid rgba(255,215,0,0.3);
}

.rank-badge.silver {
  background: linear-gradient(135deg, rgba(192,192,192,0.2), rgba(192,192,192,0.1));
  color: var(--silver);
  border: 1px solid rgba(192,192,192,0.3);
}

.rank-badge.bronze {
  background: linear-gradient(135deg, rgba(205,127,50,0.2), rgba(205,127,50,0.1));
  color: var(--bronze);
  border: 1px solid rgba(205,127,50,0.3);
}

/* Winner row highlight */
.winner-row {
  position: relative;
}

.winner-row td:first-child::before {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.winner-row.gold-row td:first-child::before { background: var(--gold); }
.winner-row.silver-row td:first-child::before { background: var(--silver); }
.winner-row.bronze-row td:first-child::before { background: var(--bronze); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--text-muted);
}

.empty-state svg {
  width: 60px;
  height: 60px;
  margin-bottom: 1rem;
  opacity: 0.3;
}

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

/* ============================================
   ADMIN
   ============================================ */
.admin-login {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 380px;
  text-align: center;
}

.login-icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 1.5rem;
  color: var(--sand);
}

.login-icon svg {
  width: 100%;
  height: 100%;
}

.login-card h3 {
  margin-bottom: 1.5rem;
  color: var(--sand-light);
  font-size: 1.3rem;
}

/* Admin controls */
.admin-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .admin-controls { grid-template-columns: 1fr; }
}

.control-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
}

.control-card h4 {
  color: var(--sand);
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

.control-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.control-card.danger {
  border-color: rgba(140,63,63,0.3);
}

/* Admin section */
.admin-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-header h3 {
  color: var(--sand-light);
  font-size: 1.15rem;
}

.filter-group {
  display: flex;
  gap: 4px;
  background: var(--bg-input);
  padding: 3px;
  border-radius: var(--radius-sm);
}

.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Tajawal', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
}

.filter-btn.active {
  background: rgba(92,122,69,0.2);
  color: var(--sand-light);
}

.filter-btn:hover:not(.active) {
  color: var(--text-secondary);
}

/* Shooters list */
.shooters-list {
  display: grid;
  gap: 8px;
}

.shooter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: var(--transition);
}

.shooter-item:hover {
  border-color: var(--border-color);
}

.shooter-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.shooter-badge {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.shooter-badge.men {
  background: rgba(100,149,237,0.12);
  color: #6495ed;
}

.shooter-badge.women {
  background: rgba(218,112,147,0.12);
  color: #da7093;
}

.shooter-name {
  font-weight: 600;
  font-size: 0.95rem;
}

.shooter-delete {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  transition: var(--transition);
}

.shooter-delete:hover {
  color: var(--danger);
  background: rgba(140,63,63,0.15);
}

/* Round creator */
.round-creator {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Rounds list */
.rounds-list {
  display: grid;
  gap: 10px;
}

.round-card {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  transition: var(--transition);
}

.round-card:hover {
  border-color: var(--border-light);
}

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

.round-title {
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.round-tag {
  display: inline-flex;
  padding: 2px 10px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
}

.round-tag.normal {
  background: rgba(92,122,69,0.15);
  color: var(--camo-highlight);
}

.round-tag.tiebreaker {
  background: rgba(196,160,32,0.15);
  color: var(--warning);
}

.round-tag.men-tag {
  background: rgba(100,149,237,0.12);
  color: #6495ed;
}

.round-tag.women-tag {
  background: rgba(218,112,147,0.12);
  color: #da7093;
}

.round-tag.pending {
  background: rgba(196,169,106,0.15);
  color: var(--sand);
}

.round-tag.completed {
  background: rgba(92,122,69,0.2);
  color: var(--camo-highlight);
}

.round-actions {
  display: flex;
  gap: 6px;
}

.round-scores {
  display: grid;
  gap: 4px;
}

.score-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 10px;
  background: rgba(0,0,0,0.15);
  border-radius: 6px;
  font-size: 0.9rem;
}

.score-points {
  font-weight: 700;
  color: var(--sand);
}

/* ============================================
   MODAL
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.open {
  display: flex;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  color: var(--sand-light);
  font-size: 1.1rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}

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

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border-color);
}

/* Shooter selector in modal */
.shooter-selector {
  margin-bottom: 1.5rem;
}

.shooter-selector h4 {
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.shooter-checkboxes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  max-height: 200px;
  overflow-y: auto;
  padding: 4px;
}

.shooter-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.9rem;
}

.shooter-checkbox:hover {
  border-color: var(--camo-accent);
}

.shooter-checkbox input {
  accent-color: var(--camo-accent);
  width: 16px;
  height: 16px;
}

.shooter-checkbox.selected {
  border-color: var(--camo-accent);
  background: rgba(92,122,69,0.1);
}

/* Scores entry */
.scores-entry {
  display: grid;
  gap: 10px;
}

.score-entry-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.score-entry-name {
  flex: 1;
  font-weight: 600;
  font-size: 0.95rem;
}

.score-entry-input {
  width: 100px;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-family: 'Tajawal', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  direction: ltr;
  transition: var(--transition);
}

.score-entry-input:focus {
  outline: none;
  border-color: var(--sand);
  box-shadow: 0 0 0 3px rgba(196,169,106,0.2);
}

/* ============================================
   TOAST
   ============================================ */
.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.95rem;
  pointer-events: auto;
  animation: toastIn 0.3s ease-out;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.toast.success {
  background: var(--success);
  color: #fff;
}

.toast.error {
  background: var(--danger);
  color: #fff;
}

.toast.warning {
  background: #8a7a20;
  color: #fff;
}

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

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

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
  position: relative;
  z-index: 1;
}

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

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--border-light);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 640px) {
  .hero { padding: 2.5rem 1.5rem; }
  .hero h2 { font-size: 1.8rem; }
  .hero p { font-size: 1rem; }

  .page-header h2 { font-size: 1.5rem; }

  .podium-bar { width: 70px; }
  .podium-item:nth-child(1) .podium-bar { height: 80px; }
  .podium-item:nth-child(2) .podium-bar { height: 110px; }
  .podium-item:nth-child(3) .podium-bar { height: 60px; }

  .container { padding: 1rem; }
}
