/* === Base & Variables === */
:root {
  --primary: #2d6a4f;
  --primary-dark: #1b4332;
  --primary-light: #40916c;
  --accent: #ffd60a;
  --accent-dark: #e6c200;
  --accent-orange: #e67e22;
  --dark: #1b1b1b;
  --gray-900: #2d2d2d;
  --gray-700: #555;
  --gray-500: #888;
  --gray-300: #ccc;
  --gray-100: #e8f0e8;
  --body-bg: #dce8dc;
  --white: #fff;
  --success: #2d6a4f;
  --danger: #d32f2f;
  --warning: #f57c00;
  --pending: #ffd60a;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.14);
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--dark);
  background: var(--body-bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }

/* === Navbar === */
.navbar {
  background: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.5rem 0;
}

.navbar-content {
  display: flex;
  align-items: center;
  height: 48px;
  gap: 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
  padding: 0 0.5rem;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  font-size: 1.1rem;
  color: var(--white);
  flex-shrink: 0;
  padding-left: 0.5rem;
}
.navbar-brand:hover { color: var(--accent); }
.brand-name .brand-highlight { color: var(--accent-orange); font-style: italic; }

.brand-icon {
  font-size: 1.1rem;
  background: var(--primary);
  color: var(--white);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.75rem;
}

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

.nav-link {
  padding: 0.5rem 1rem;
  border-radius: 999px;
  color: rgba(255,255,255,0.6);
  font-weight: 600;
  font-size: 0.85rem;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-link:hover { color: var(--white); background: rgba(255,255,255,0.08); }
.nav-link.active, .nav-link-active {
  background: var(--primary);
  color: var(--white) !important;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
  padding-right: 0.5rem;
}

/* Notification bell */
.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 0.4rem;
  border-radius: 50%;
  transition: background var(--transition);
  color: rgba(255,255,255,0.75);
}

.notification-bell:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--danger);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  animation: bellPulse 2s infinite;
}

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

/* User dropdown */
.user-dropdown { position: relative; }

.user-toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  border-radius: 999px;
  padding: 0.25rem 0.6rem 0.25rem 0.25rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.8);
  background: rgba(255,255,255,0.08);
  transition: background var(--transition);
}

.user-toggle:hover { background: rgba(255,255,255,0.15); }

.user-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name-nav { font-weight: 500; }

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  min-width: 180px;
  display: none;
  overflow: hidden;
  z-index: 200;
}

.dropdown-menu.show { display: block; }

.dropdown-item {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--dark);
  font-size: 0.9rem;
  transition: background var(--transition);
}

.dropdown-item:hover { background: var(--gray-100); }
.dropdown-item-danger { color: var(--danger); }
.dropdown-divider { border: none; border-top: 1px solid var(--gray-100); margin: 0; }

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.hamburger span {
  width: 22px;
  height: 2px;
  background: var(--white);
  transition: var(--transition);
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), transform 0.1s;
  text-decoration: none;
}

.btn:active { transform: scale(0.97); }

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

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

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

.btn-outline { background: none; border: 1.5px solid var(--gray-300); color: var(--dark); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-outline-light { background: none; border: 1.5px solid rgba(255,255,255,0.6); color: var(--white); }
.btn-outline-light:hover { background: rgba(255,255,255,0.15); color: var(--white); }

.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.8rem; }
.btn-lg { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; }

/* === Alerts === */
.alert {
  max-width: 1100px;
  margin: 0.75rem auto;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}

.alert-success { background: #e8f5e9; color: #2e7d32; }
.alert-error { background: #ffebee; color: #c62828; }
.alert-info { background: #e3f2fd; color: #1565c0; }

/* === Hero === */
.hero {
  background:
    repeating-linear-gradient(110deg,
      rgba(255,255,255,0.03) 0px, rgba(255,255,255,0.03) 2px,
      transparent 2px, transparent 30px),
    linear-gradient(160deg, #0d2818 0%, #1b4332 30%, #2d6a4f 60%, #1b4332 100%);
  color: var(--white);
  padding: 3rem 2rem;
  position: relative;
  overflow: hidden;
  min-height: 400px;
  border-radius: var(--radius);
  margin: 1rem auto;
  max-width: 1100px;
  display: flex;
  align-items: center;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 80% at 90% 50%, rgba(64,145,108,0.3) 0%, transparent 70%),
    radial-gradient(ellipse 40% 60% at 10% 80%, rgba(0,0,0,0.2) 0%, transparent 60%);
  z-index: 0;
}

.hero::after { display: none; }

.hero-content {
  position: relative;
  z-index: 3;
  text-align: left;
  max-width: 600px;
}
.hero-subtitle {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  opacity: 0.7;
  margin-bottom: 1rem;
}
.hero-title {
  font-size: 3.5rem;
  font-weight: 900;
  line-height: 1.05;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: -1px;
}
.hero-title-line2 {
  display: block;
  font-size: 2.8rem;
  color: var(--white);
}
.hero-accent {
  color: var(--accent);
}
.hero-accent-orange {
  color: var(--accent-orange);
  font-style: italic;
}
.hero-tagline {
  font-size: 1.05rem;
  opacity: 0.85;
  margin-bottom: 2rem;
  font-weight: 400;
}
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Pickleball decorative elements */
.hero-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.hero-ball {
  position: absolute;
  border-radius: 50%;
  border: 2px solid rgba(255,214,10,0.25);
  background: radial-gradient(circle at 35% 35%, rgba(255,214,10,0.15), rgba(255,214,10,0.05));
  box-shadow: inset -3px -3px 8px rgba(0,0,0,0.1), 0 0 20px rgba(255,214,10,0.1);
}

/* Ball hole pattern (pickleball dots) */
.hero-ball::before {
  content: '';
  position: absolute;
  inset: 20%;
  background:
    radial-gradient(circle 3px at 30% 25%, rgba(0,0,0,0.2) 100%, transparent 100%),
    radial-gradient(circle 3px at 60% 20%, rgba(0,0,0,0.2) 100%, transparent 100%),
    radial-gradient(circle 3px at 45% 50%, rgba(0,0,0,0.2) 100%, transparent 100%),
    radial-gradient(circle 3px at 25% 65%, rgba(0,0,0,0.2) 100%, transparent 100%),
    radial-gradient(circle 3px at 70% 55%, rgba(0,0,0,0.2) 100%, transparent 100%),
    radial-gradient(circle 3px at 50% 80%, rgba(0,0,0,0.2) 100%, transparent 100%),
    radial-gradient(circle 3px at 75% 35%, rgba(0,0,0,0.2) 100%, transparent 100%);
  border-radius: 50%;
}

.hero-ball-1 { width: 90px; height: 90px; top: -15px; left: 5%; animation: ballFloat1 20s ease-in-out infinite; }
.hero-ball-2 { width: 60px; height: 60px; bottom: 10%; right: 8%; animation: ballFloat2 16s ease-in-out infinite; }
.hero-ball-3 { width: 40px; height: 40px; top: 20%; right: 15%; animation: ballFloat3 22s ease-in-out infinite; opacity: 0.6; }
.hero-ball-4 { width: 50px; height: 50px; bottom: 5%; left: 12%; animation: ballFloat2 18s ease-in-out infinite reverse; opacity: 0.5; }

@keyframes ballFloat1 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25%      { transform: translate(30px, 20px) rotate(90deg); }
  50%      { transform: translate(10px, 40px) rotate(180deg); }
  75%      { transform: translate(-20px, 15px) rotate(270deg); }
}
@keyframes ballFloat2 {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  33%      { transform: translate(-20px, -25px) rotate(120deg); }
  66%      { transform: translate(15px, -10px) rotate(240deg); }
}
@keyframes ballFloat3 {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  50%      { transform: translate(-25px, 30px) rotate(180deg) scale(1.2); }
}

/* Paddle silhouette */
.hero-paddle {
  position: absolute;
  width: 120px;
  height: 180px;
  opacity: 0.06;
}

.hero-paddle-1 {
  top: 5%;
  right: 3%;
  transform: rotate(25deg);
  animation: paddleSwing 8s ease-in-out infinite;
}
.hero-paddle-2 {
  bottom: 0;
  left: 2%;
  transform: rotate(-15deg);
  animation: paddleSwing 10s ease-in-out infinite reverse;
}

@keyframes paddleSwing {
  0%, 100% { transform: rotate(25deg); }
  50%      { transform: rotate(35deg) translateY(-8px); }
}

/* Net line */
.hero-net {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: repeating-linear-gradient(90deg,
    rgba(255,255,255,0.15) 0px, rgba(255,255,255,0.15) 8px,
    transparent 8px, transparent 16px);
  z-index: 2;
}
.hero-net::before {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 0;
  right: 0;
  height: 40px;
  background: repeating-linear-gradient(90deg,
    transparent 0px, transparent 15px,
    rgba(255,255,255,0.03) 15px, rgba(255,255,255,0.03) 17px);
  mask-image: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
}

/* Floating avatar bubbles */
.hero-avatars {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.hero-avatar-bubble {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2.5px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 15px rgba(0,0,0,0.25), 0 0 20px rgba(255,214,10,0.1);
  opacity: 0.35;
  animation: floatBubble 18s ease-in-out infinite;
  animation-delay: calc(var(--i) * -1.4s);
  left: calc(5% + (var(--i) / var(--total)) * 85%);
  top: calc(10% + sin(var(--i) * 2.4) * 30%);
  transition: opacity 0.4s, transform 0.4s, box-shadow 0.4s;
}

.hero-avatar-bubble:hover {
  opacity: 1;
  transform: scale(1.3);
  box-shadow: 0 6px 25px rgba(0,0,0,0.4), 0 0 30px rgba(255,214,10,0.3);
  z-index: 10;
}

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

.hero-avatar-bubble:nth-child(3n+1) { width: 64px; height: 64px; top: 8%; opacity: 0.4; }
.hero-avatar-bubble:nth-child(3n+2) { width: 48px; height: 48px; top: 55%; opacity: 0.3; }
.hero-avatar-bubble:nth-child(3n)   { width: 56px; height: 56px; top: 30%; opacity: 0.35; }
.hero-avatar-bubble:nth-child(4n+1) { top: 65%; }
.hero-avatar-bubble:nth-child(5n+2) { top: 15%; }
.hero-avatar-bubble:nth-child(7n)   { width: 72px; height: 72px; opacity: 0.45; border-color: rgba(255,214,10,0.3); }

@keyframes floatBubble {
  0%, 100% { transform: translate(0, 0) rotate(0deg) scale(1); }
  20%      { transform: translate(12px, -18px) rotate(5deg) scale(1.05); }
  40%      { transform: translate(-8px, -30px) rotate(-3deg) scale(0.95); }
  60%      { transform: translate(15px, -12px) rotate(4deg) scale(1.08); }
  80%      { transform: translate(-10px, -24px) rotate(-5deg) scale(0.98); }
}

/* === Ticker === */
.ticker-wrap {
  max-width: 1100px;
  margin: 1rem auto;
  background: var(--white);
  border-radius: 999px;
  display: flex;
  align-items: center;
  overflow: hidden;
  box-shadow: var(--shadow);
  height: 48px;
}
.ticker-label {
  flex-shrink: 0;
  background: linear-gradient(135deg, #ff6b35, #e63946);
  color: var(--white);
  font-weight: 800;
  font-size: 0.8rem;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  border-radius: 999px;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.ticker-track {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, black 3%, black 97%, transparent 100%);
}
.ticker-content {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScroll 30s linear infinite;
  gap: 0;
}
.ticker-item {
  font-size: 0.88rem;
  color: var(--gray-700);
  padding: 0 0.75rem;
}
.ticker-item strong { color: var(--dark); }
.ticker-sep {
  color: var(--gray-300);
  font-size: 1.2rem;
  padding: 0 0.25rem;
}

@keyframes tickerScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* === Sections === */
.main-content { flex: 1; }

.section { padding: 2rem 0; }
.section-alt { background: transparent; }
.section-title { font-size: 1.3rem; font-weight: 800; margin-bottom: 1.25rem; text-align: left; text-transform: uppercase; letter-spacing: 0.5px; }

/* === Info Cards === */
.info-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }

.info-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  border-top: 4px solid var(--primary);
  position: relative;
}
.info-card:nth-child(2) { border-top-color: var(--danger); }
.info-card:nth-child(3) { border-top-color: #1565c0; }
.info-card:nth-child(4), .info-card-fund { border-top-color: #e67e22; }
.info-card:nth-child(4) .info-card-value, .info-card-fund .info-card-value { color: #e67e22; }

.info-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.info-card-icon { display: none; }
.info-card h3 { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gray-500); margin-bottom: 0.5rem; font-weight: 600; }
.info-card-value { font-size: 2rem; font-weight: 900; color: var(--primary); }
.info-card:nth-child(2) .info-card-value { color: var(--danger); }
.info-card:nth-child(3) .info-card-value { color: #1565c0; }
.info-card-label { font-size: 0.8rem; color: var(--gray-500); margin-top: 0.25rem; }
.info-card-label a { color: var(--primary); }

/* === Stats === */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--primary);
}

.stat-value { font-size: 2rem; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: var(--gray-500); margin-top: 0.25rem; }

/* === Cards === */
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.card-warning { border-left: 4px solid var(--warning); }

/* === Page headers === */
.page-header { margin: 2rem 0 1.5rem; }
.page-header h1 { font-size: 1.75rem; font-weight: 800; }
.page-header-with-action { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }

/* === Members grid === */
.members-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 1.25rem; }

.member-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  display: block;
  color: var(--dark);
}

.member-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); color: var(--dark); }

.member-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 0.75rem;
  border: 3px solid var(--gray-100);
}

.member-name { font-size: 1rem; font-weight: 600; }
.member-username { font-size: 0.8rem; color: var(--gray-500); }

/* === Teams === */
.teams-list { display: grid; gap: 1rem; }

.team-card {
  display: block;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  color: var(--dark);
}

.team-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); color: var(--dark); }

.team-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.team-name { font-weight: 700; font-size: 1.05rem; }
.team-members-avatars { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.team-member-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--gray-100);
  padding: 0.25rem 0.7rem 0.25rem 0.25rem;
  border-radius: 999px;
}
.team-member-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--white);
}
.team-member-name { font-size: 0.85rem; font-weight: 500; }
.team-card-footer { margin-top: 0.75rem; }

.team-members-list { display: flex; flex-direction: column; gap: 0.75rem; }
.team-member-row { display: flex; align-items: center; gap: 0.75rem; }
.team-member-info { flex: 1; display: flex; align-items: center; gap: 0.5rem; }
.team-member-name { font-weight: 500; }

/* === Badges === */
.badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge-pending { background: #fff3cd; color: #856404; }
.badge-accepted, .badge-scheduled, .badge-active { background: #d4edda; color: #155724; }
.badge-declined { background: #f8d7da; color: #721c24; }
.badge-disputed { background: #ffe0b2; color: #e65100; }
.badge-completed { background: #e0e0e0; color: #424242; }
.badge-captain { background: var(--accent); color: var(--dark); font-size: 0.7rem; }
.badge-lg { font-size: 0.85rem; padding: 0.35rem 1rem; }

.badge-type-male { background: #bbdefb; color: #1565c0; }
.badge-type-female { background: #f8bbd0; color: #c2185b; }
.badge-type-mixed { background: #e1bee7; color: #7b1fa2; }

/* === Challenges === */
.challenge-list, .challenge-history { display: flex; flex-direction: column; gap: 0.75rem; }

.challenge-list { display: flex; flex-direction: column; gap: 0.6rem; }

.challenge-card-mini {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  color: var(--dark);
  text-decoration: none;
}

.challenge-card-mini:hover { transform: translateX(4px); box-shadow: var(--shadow-md); color: var(--dark); }

.challenge-teams { display: flex; align-items: center; gap: 0.5rem; }
.team-name { font-weight: 700; font-size: 0.95rem; }
.vs { font-weight: 800; color: var(--primary); font-size: 0.8rem; padding: 0.15rem 0.5rem; background: rgba(45,106,79,0.08); border-radius: 4px; }
.challenge-meta { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; }
.challenge-date { color: var(--gray-500); }
.challenge-winner { font-weight: 700; color: var(--primary); }
.challenge-score-mini { font-weight: 600; color: var(--gray-700); font-size: 0.85rem; }
.challenge-reward { font-size: 0.85rem; }

.challenge-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.75rem;
}

.challenge-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.challenge-card-top .challenge-teams { gap: 0.75rem; }
.challenge-team { font-size: 0.95rem; }
.challenge-vs { font-weight: 800; color: var(--primary); font-size: 0.85rem; }

.challenge-card-details { display: flex; gap: 1.25rem; font-size: 0.85rem; color: var(--gray-700); margin-bottom: 0.75rem; }
.challenge-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }

/* Challenge detail */
.challenge-matchup {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 1.5rem 0;
  text-align: center;
}

.challenge-team-big h2 { font-size: 1.3rem; }
.challenge-vs-big { font-size: 1.5rem; font-weight: 800; color: var(--primary); }
.challenge-detail-meta { text-align: center; padding-bottom: 0.5rem; }
.challenge-response-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

/* Score form */
.score-sets { display: flex; flex-direction: column; gap: 0.75rem; }
.score-set label { font-size: 0.85rem; margin-bottom: 0.25rem; }
.score-inputs { display: flex; align-items: center; gap: 0.5rem; }
.score-input { width: 70px; text-align: center; }
.score-dash { font-weight: 700; font-size: 1.2rem; color: var(--gray-500); }

/* Results */
.result-display { display: flex; flex-direction: column; gap: 0.75rem; }
.result-scores { display: flex; gap: 1rem; flex-wrap: wrap; }
.result-set { background: var(--gray-100); padding: 0.5rem 1rem; border-radius: var(--radius-sm); text-align: center; }
.result-set-label { display: block; font-size: 0.75rem; color: var(--gray-500); }
.result-set-score { font-size: 1.1rem; font-weight: 700; }
.result-winner { font-size: 1rem; }
.result-reward { font-size: 0.95rem; color: var(--gray-700); }

/* === Detail grid === */
.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; margin-bottom: 2rem; }
.detail-main { display: flex; flex-direction: column; gap: 1rem; }

.info-list { display: grid; grid-template-columns: auto 1fr; gap: 0.4rem 0.75rem; font-size: 0.9rem; }
.info-list dt { color: var(--gray-500); font-weight: 500; }
.info-list dd { font-weight: 600; }

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

.tab {
  padding: 0.75rem 1.25rem;
  background: none;
  border: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-500);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color var(--transition), border-color var(--transition);
}

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

.tab-content { display: none; }
.tab-content.active { display: block; }

/* === Forms === */
.form-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  max-width: 640px;
  margin-bottom: 2rem;
}

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 0.4rem; }
.form-hint { font-size: 0.8rem; color: var(--gray-500); margin: 0.5rem 0 0.3rem; }

.form-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: var(--white);
}

.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.1); }
.form-textarea { resize: vertical; }

.form-row { display: flex; gap: 1rem; }
.form-group-half { flex: 1; }

.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 1.5rem; }

/* Radio group */
.radio-group { display: flex; gap: 1.25rem; flex-wrap: wrap; }

.radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  font-size: 0.95rem;
}

.radio-label input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; }

/* Reward options */
.reward-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.6rem; }

.reward-option { cursor: pointer; }
.reward-option input { display: none; }

.reward-card {
  display: block;
  text-align: center;
  padding: 0.75rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  transition: border-color var(--transition), background var(--transition);
}

.reward-option input:checked + .reward-card { border-color: var(--primary); background: #e8f5e9; }
.reward-card:hover { border-color: var(--primary-light); }

/* Search autocomplete */
.search-input-wrapper { position: relative; }

.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: none;
  z-index: 50;
  max-height: 200px;
  overflow-y: auto;
}

.search-results.show { display: block; }

.search-result-item {
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
  transition: background var(--transition);
}

.search-result-item:hover { background: var(--gray-100); }

.selected-teammate {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-100);
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  margin-top: 0.5rem;
  font-size: 0.9rem;
}

.btn-remove {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--gray-500);
  line-height: 1;
}

.btn-remove:hover { color: var(--danger); }

/* === Auth === */
.auth-wrapper { display: flex; justify-content: center; align-items: center; min-height: 60vh; padding: 2rem 0; }

.auth-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2.5rem;
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 400px;
}

.auth-header { text-align: center; margin-bottom: 1.5rem; }
.auth-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.auth-header h1 { font-size: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 0; }

/* === Leaderboard === */
.leaderboard-title { font-size: 2rem; }

.leaderboard-table-wrapper { overflow-x: auto; margin-bottom: 2rem; }

.leaderboard-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.leaderboard-table th {
  background: var(--primary);
  color: var(--white);
  padding: 0.85rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.leaderboard-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--gray-100); }
.leaderboard-table tr:last-child td { border-bottom: none; }

.col-rank { text-align: center; width: 60px; }
.col-stat { text-align: center; width: 100px; }

.rank-medal { font-size: 1.3rem; }
.rank-number { font-weight: 700; color: var(--gray-500); }

.top-1 td { background: #fffde7; }
.top-2 td { background: #fafafa; }
.top-3 td { background: #fff3e0; }

.stat-wins { color: var(--success); font-weight: 700; }
.stat-losses { color: var(--danger); font-weight: 700; }
.stat-breakfasts { font-weight: 700; color: var(--primary); }

.members-cell { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.member-tag-sm { background: var(--gray-100); padding: 0.15rem 0.5rem; border-radius: 999px; font-size: 0.8rem; }

/* === Footer === */
.footer {
  background: var(--dark);
  color: var(--gray-300);
  padding: 2.5rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 2rem; margin-bottom: 1.5rem; }
.footer-brand { color: var(--white); font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.footer-desc { font-size: 0.85rem; color: var(--gray-500); }

.footer h4 { color: var(--white); font-size: 0.9rem; margin-bottom: 0.75rem; }
.footer p { font-size: 0.85rem; margin-bottom: 0.3rem; }
.footer-link { color: var(--accent); font-weight: 500; }
.footer-link:hover { color: var(--accent-dark); }

.footer-links { list-style: none; }
.footer-links li { margin-bottom: 0.4rem; }
.footer-links a { color: var(--gray-300); font-size: 0.85rem; }
.footer-links a:hover { color: var(--white); }

.footer-bottom { border-top: 1px solid var(--gray-900); padding-top: 1rem; text-align: center; }
.footer-bottom p { font-size: 0.8rem; color: var(--gray-500); }

/* === Empty state === */
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--gray-500); }

/* === Utilities === */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.challenge-score { font-weight: 700; font-size: 0.85rem; }

/* === Responsive === */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .nav-links {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--dark);
    flex-direction: column;
    padding: 0.75rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    border-radius: 0 0 var(--radius) var(--radius);
  }

  .nav-links.show { display: flex; }
  .nav-link { padding: 0.75rem 1rem; border-radius: var(--radius-sm); }
  .user-name-nav { display: none; }

  .hero-title { font-size: 1.75rem; }
  .hero { padding: 2.5rem 0; }
  .hero-avatar-bubble { width: 40px !important; height: 40px !important; }

  .detail-grid { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; gap: 0; }

  .challenge-matchup { flex-direction: column; gap: 0.75rem; }
  .challenge-card-top { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .challenge-card-details { flex-wrap: wrap; gap: 0.75rem; }

  .leaderboard-table th, .leaderboard-table td { padding: 0.6rem 0.5rem; font-size: 0.8rem; }
  .col-stat { width: 70px; }

  .page-header-with-action { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .info-cards { grid-template-columns: repeat(2, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .members-grid { grid-template-columns: repeat(2, 1fr); }
  .reward-options { grid-template-columns: repeat(2, 1fr); }
}

/* === Admin === */
/* Fund total card */
.fund-total-card {
  background: linear-gradient(135deg, #e67e22, #f39c12);
  color: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 2rem;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 4px 20px rgba(230,126,34,0.3);
}
.fund-total-label { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; opacity: 0.9; margin-bottom: 0.5rem; }
.fund-total-value { font-size: 3rem; font-weight: 900; }
.fund-total-unit { font-size: 1.2rem; font-weight: 400; opacity: 0.85; }

.stat-points { font-size: 1.1rem; font-weight: 800; }
.points-positive { color: var(--primary); }
.points-negative { color: var(--danger); }

.nav-link-admin { color: var(--accent) !important; font-weight: 600; }
.nav-link-admin:hover { color: var(--white) !important; background: rgba(255,214,10,0.15); }

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}
.admin-stat-card.accent { border-left-color: var(--accent); }
.admin-stat-card.success { border-left-color: var(--success); }
.admin-stat-card.danger { border-left-color: var(--danger); }
.admin-stat-value { font-size: 2rem; font-weight: 800; color: var(--dark); }
.admin-stat-label { font-size: 0.85rem; color: var(--gray-500); margin-top: 0.25rem; }

.admin-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.admin-nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: var(--transition);
  text-align: center;
  border: 2px solid transparent;
}
.admin-nav-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--dark);
}
.admin-nav-icon { font-size: 2rem; }
.admin-nav-title { font-weight: 700; font-size: 1.05rem; }
.admin-nav-desc { font-size: 0.85rem; color: var(--gray-500); }

.admin-table-wrap { overflow-x: auto; margin-bottom: 2rem; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.admin-table th {
  background: var(--primary-dark);
  color: var(--white);
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.admin-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: rgba(45,106,79,0.03); }
.admin-table .row-disputed { background: rgba(245,124,0,0.06); }
.admin-table .row-disputed:hover { background: rgba(245,124,0,0.1); }
.admin-table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.admin-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.vs-badge {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.9rem;
}

.text-sm { font-size: 0.8rem; }

.admin-match-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.admin-match-teams {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}
.admin-match-team { text-align: center; flex: 1; min-width: 150px; }
.admin-match-vs { text-align: center; flex-shrink: 0; }
.vs-big {
  display: block;
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 0.5rem;
}
.admin-match-meta { font-size: 0.9rem; color: var(--gray-700); line-height: 1.8; margin-bottom: 0.5rem; }
.admin-match-avatars { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 0.75rem; }
.admin-match-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-light);
}

.admin-result-row {
  padding: 0.75rem;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}
.admin-score {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.05rem;
}

.alert { padding: 1rem; border-radius: var(--radius-sm); }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffc107; }
.alert-success { background: #d4edda; color: #155724; border: 1px solid #28a745; }

.admin-finalize {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
  border-left: 4px solid var(--primary);
}
.admin-winner-options { display: flex; gap: 1rem; flex-wrap: wrap; }
.admin-winner-option { flex: 1; min-width: 140px; }
.admin-winner-option input { display: none; }
.admin-winner-card {
  display: block;
  padding: 1rem;
  text-align: center;
  border: 2px solid var(--gray-300);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}
.admin-winner-option input:checked + .admin-winner-card {
  border-color: var(--primary);
  background: rgba(45,106,79,0.08);
  box-shadow: 0 0 0 2px var(--primary);
}
.admin-winner-card:hover { border-color: var(--primary-light); }
.admin-winner-name { font-weight: 700; }

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.95rem;
}
.admin-checkbox input { width: 18px; height: 18px; accent-color: var(--primary); }

.admin-status-form { display: flex; gap: 0.75rem; align-items: center; }
.admin-actions-cell { white-space: nowrap; }
.admin-actions-cell form + form { margin-left: 0.5rem; }

.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.8rem; }

.badge-type-male { background: #e3f2fd; color: #1565c0; }
.badge-type-female { background: #fce4ec; color: #c62828; }
.badge-type-mixed { background: #f3e5f5; color: #7b1fa2; }

.log-time { font-size: 0.8rem; white-space: nowrap; color: var(--gray-500); }
.log-action {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--gray-100);
  color: var(--gray-700);
}
.log-action-login { background: #e3f2fd; color: #1565c0; }
.log-action-create { background: #e8f5e9; color: #2e7d32; }
.log-action-submit { background: #fff3e0; color: #e65100; }
.log-action-admin { background: #fce4ec; color: #c62828; }
.log-action-change { background: #f3e5f5; color: #7b1fa2; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.pagination-info { font-size: 0.85rem; color: var(--gray-500); }

@media (max-width: 768px) {
  .admin-stats { grid-template-columns: repeat(2, 1fr); }
  .admin-match-teams { flex-direction: column; }
}
