/* StravaChallenge — Main Stylesheet */
/* Strava-inspired: orange #FC4C02, dark navy #1A1A2E, white */

:root {
  --orange:     #FC4C02;
  --orange-dk:  #d93e00;
  --orange-lt:  #ff7043;
  --navy:       #1A1A2E;
  --navy-lt:    #16213E;
  --dark:       #0F3460;
  --gray-100:   #f8f9fa;
  --gray-200:   #e9ecef;
  --gray-400:   #ced4da;
  --gray-600:   #6c757d;
  --gray-800:   #343a40;
  --white:      #ffffff;
  --success:    #28a745;
  --danger:     #dc3545;
  --warning:    #ffc107;
  --info:       #17a2b8;
  --radius:     12px;
  --radius-sm:  6px;
  --shadow:     0 4px 20px rgba(0,0,0,.12);
  --shadow-lg:  0 8px 40px rgba(0,0,0,.2);
  --transition: .2s ease;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: var(--orange); text-decoration: none; }
a:hover { color: var(--orange-dk); }

/* ── Nav ─────────────────────────────────────────────────────────────────── */
.navbar {
  background: var(--navy);
  padding: .75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.3);
}
.navbar-brand {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.navbar-brand span { color: var(--orange); }
.nav-links { display: flex; align-items: center; gap: .25rem; }
.nav-link {
  color: rgba(255,255,255,.75);
  padding: .45rem .85rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
}
.nav-link:hover, .nav-link.active { color: var(--white); background: rgba(255,255,255,.1); }
.nav-link .badge {
  background: var(--orange);
  color: #fff;
  border-radius: 999px;
  font-size: .65rem;
  padding: .1rem .4rem;
  margin-left: .3rem;
}
.nav-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--orange);
}
.nav-user { display: flex; align-items: center; gap: .6rem; color: var(--white); font-size: .9rem; }
.nav-hamburger { display: none; background: none; border: none; color: #fff; font-size: 1.5rem; cursor: pointer; }

/* ── Layout ──────────────────────────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.25rem; }
.page-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--dark) 100%);
  color: #fff;
  padding: 2.5rem 0;
  margin-bottom: 2rem;
}
.page-header h1 { font-size: 2rem; font-weight: 800; }
.page-header p { color: rgba(255,255,255,.7); margin-top: .4rem; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-body { padding: 1.5rem; }
.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-100);
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-dk); color: #fff; }
.btn-secondary { background: var(--gray-200); color: var(--gray-800); }
.btn-secondary:hover { background: var(--gray-400); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #218838; color: #fff; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover  { background: #c82333; color: #fff; }
.btn-dark      { background: var(--navy); color: #fff; }
.btn-dark:hover    { background: var(--dark); color: #fff; }
.btn-outline   { background: transparent; border: 2px solid var(--orange); color: var(--orange); }
.btn-outline:hover { background: var(--orange); color: #fff; }
.btn-sm { padding: .35rem .8rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* ── Forms ───────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-weight: 600; font-size: .875rem; margin-bottom: .4rem; color: var(--gray-800); }
.form-control {
  width: 100%;
  padding: .6rem .9rem;
  border: 1.5px solid var(--gray-400);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  transition: var(--transition);
  background: #fff;
  color: var(--gray-800);
}
.form-control:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(252,76,2,.15); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 100px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}
.badge-orange  { background: rgba(252,76,2,.12); color: var(--orange); }
.badge-success { background: rgba(40,167,69,.12); color: var(--success); }
.badge-danger  { background: rgba(220,53,69,.12); color: var(--danger); }
.badge-info    { background: rgba(23,162,184,.12); color: var(--info); }
.badge-gray    { background: var(--gray-200); color: var(--gray-600); }

/* ── Alert ───────────────────────────────────────────────────────────────── */
.alert {
  padding: .9rem 1.25rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: .9rem;
  border-left: 4px solid;
}
.alert-success { background: #d4edda; color: #155724; border-color: var(--success); }
.alert-danger  { background: #f8d7da; color: #721c24; border-color: var(--danger); }
.alert-info    { background: #d1ecf1; color: #0c5460; border-color: var(--info); }
.alert-warning { background: #fff3cd; color: #856404; border-color: var(--warning); }

/* ── Swipe UI ────────────────────────────────────────────────────────────── */
.swipe-arena {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  min-height: 70vh;
}
.swipe-stack {
  position: relative;
  width: 360px;
  max-width: 100%;
  height: 520px;
}
.swipe-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: var(--white);
  cursor: grab;
  user-select: none;
  transition: transform .15s ease, box-shadow .15s ease;
  will-change: transform;
}
.swipe-card:nth-child(2) { transform: rotate(-2deg) translateY(8px); z-index: 1; }
.swipe-card:nth-child(3) { transform: rotate(2deg)  translateY(16px); z-index: 0; }
.swipe-card.top-card { z-index: 10; }
.swipe-card.swiping-left  { transform: rotate(-25deg) translateX(-120%); opacity: 0; transition: transform .4s ease, opacity .4s ease; }
.swipe-card.swiping-right { transform: rotate(25deg)  translateX(120%);  opacity: 0; transition: transform .4s ease, opacity .4s ease; }

.swipe-card-photo {
  width: 100%;
  height: 55%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--navy), var(--dark));
}
.swipe-card-photo-placeholder {
  width: 100%; height: 55%;
  background: linear-gradient(135deg, var(--navy), var(--dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
}
.swipe-card-body { padding: 1rem 1.25rem; }
.swipe-card-name { font-size: 1.3rem; font-weight: 800; color: var(--navy); }
.swipe-card-location { font-size: .85rem; color: var(--gray-600); margin-top: .15rem; }
.swipe-card-compat {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  background: linear-gradient(90deg, var(--orange), var(--orange-lt));
  color: #fff;
  padding: .25rem .7rem;
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  margin-top: .5rem;
}
.swipe-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .5rem;
  margin-top: .75rem;
}
.swipe-stat { font-size: .78rem; color: var(--gray-600); }
.swipe-stat strong { display: block; font-size: .95rem; color: var(--navy); }
.swipe-label {
  position: absolute;
  top: 1.5rem;
  font-size: 2rem;
  font-weight: 900;
  border: 4px solid;
  border-radius: 8px;
  padding: .2rem .8rem;
  transform: rotate(-15deg);
  opacity: 0;
  transition: opacity .15s;
}
.swipe-label.like  { left: 1.5rem; color: var(--success); border-color: var(--success); transform: rotate(-15deg); }
.swipe-label.nope  { right: 1.5rem; color: var(--danger); border-color: var(--danger); transform: rotate(15deg); }

.swipe-actions {
  display: flex;
  gap: 1.5rem;
  margin-top: 2rem;
  align-items: center;
}
.swipe-btn {
  width: 64px; height: 64px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.swipe-btn:hover { transform: scale(1.1); box-shadow: var(--shadow-lg); }
.swipe-btn-nope  { background: #fff; color: var(--danger); border: 2px solid var(--danger); }
.swipe-btn-like  { background: var(--orange); color: #fff; width: 72px; height: 72px; font-size: 1.75rem; }
.swipe-btn-super { background: #fff; color: var(--info); border: 2px solid var(--info); }

/* ── Profile card (browse) ───────────────────────────────────────────────── */
.athlete-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}
.athlete-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.athlete-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.athlete-card-photo {
  width: 100%; height: 180px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--navy), var(--dark));
}
.athlete-card-photo-placeholder {
  width: 100%; height: 180px;
  background: linear-gradient(135deg, var(--navy), var(--dark));
  display: flex; align-items: center; justify-content: center;
  font-size: 4rem;
}
.athlete-card-body { padding: 1rem; }
.athlete-card-name { font-weight: 700; font-size: 1rem; }
.athlete-card-meta { font-size: .8rem; color: var(--gray-600); margin-top: .2rem; }
.athlete-card-compat {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  background: rgba(252,76,2,.1);
  color: var(--orange);
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  margin-top: .5rem;
}
.athlete-card-footer {
  padding: .75rem 1rem;
  border-top: 1px solid var(--gray-200);
  display: flex;
  gap: .5rem;
}

/* ── Leaderboard ─────────────────────────────────────────────────────────── */
.leaderboard-table { width: 100%; min-width: 480px; border-collapse: collapse; }
.leaderboard-table th {
  background: var(--navy);
  color: #fff;
  padding: .75rem 1rem;
  text-align: left;
  font-size: .85rem;
  font-weight: 600;
}
.leaderboard-table td {
  padding: .85rem 1rem;
  border-bottom: 1px solid var(--gray-200);
  font-size: .9rem;
}
.leaderboard-table tr:hover td { background: var(--gray-100); }
.rank-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .85rem;
}
.rank-1 { background: #FFD700; color: #333; }
.rank-2 { background: #C0C0C0; color: #333; }
.rank-3 { background: #CD7F32; color: #fff; }
.rank-n { background: var(--gray-200); color: var(--gray-600); }

/* ── Challenge cards ─────────────────────────────────────────────────────── */
.challenge-list { display: flex; flex-direction: column; gap: 1rem; }
.challenge-item {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: box-shadow .2s;
}
.challenge-item:hover { box-shadow: var(--shadow-lg); }
.challenge-vs {
  display: flex; align-items: center; gap: .75rem; flex: 1;
}
.challenge-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gray-200);
}
.challenge-vs-text { font-size: 1.1rem; font-weight: 800; color: var(--orange); padding: 0 .5rem; }
.challenge-meta { flex: 1; }
.challenge-dist { font-weight: 700; font-size: .95rem; }
.challenge-info { font-size: .8rem; color: var(--gray-600); margin-top: .2rem; }
.challenge-status { margin-left: auto; }

/* ── Dashboard 2-col grid ───────────────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
/* ── Points page grid ────────────────────────────────────────────────────── */
.points-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}
/* ── Athlete page layout ─────────────────────────────────────────────────── */
.athlete-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}
/* ── Profile page layout ─────────────────────────────────────────────────── */
.profile-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 1.5rem;
}

/* ── Stats grid ──────────────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
}
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
  text-align: center;
}
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--orange); }
.stat-card .stat-label { font-size: .8rem; color: var(--gray-600); margin-top: .25rem; }

/* ── Points ──────────────────────────────────────────────────────────────── */
.points-balance {
  background: linear-gradient(135deg, var(--orange), var(--orange-lt));
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
}
.points-balance .balance-val { font-size: 3.5rem; font-weight: 900; }
.points-balance .balance-label { font-size: 1rem; opacity: .85; }
.tx-row { display: flex; justify-content: space-between; align-items: center; padding: .75rem 0; border-bottom: 1px solid var(--gray-200); font-size: .9rem; }
.tx-amount.pos { color: var(--success); font-weight: 700; }
.tx-amount.neg { color: var(--danger); font-weight: 700; }

/* ── Social share ────────────────────────────────────────────────────────── */
.share-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1rem; }
.share-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
}
.share-fb   { background: #1877F2; color: #fff; }
.share-fb:hover   { background: #1565d8; color: #fff; }
.share-tw   { background: #000; color: #fff; }
.share-tw:hover   { background: #333; color: #fff; }
.share-ig   { background: linear-gradient(45deg,#f09433,#e6683c,#dc2743,#cc2366,#bc1888); color: #fff; }
.share-copy { background: var(--gray-200); color: var(--gray-800); }
.share-copy:hover { background: var(--gray-400); }

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs { display: flex; border-bottom: 2px solid var(--gray-200); margin-bottom: 1.5rem; gap: .25rem; }
.tab-btn {
  padding: .65rem 1.25rem;
  border: none;
  background: none;
  font-size: .9rem;
  font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
}
.tab-btn:hover { color: var(--orange); }
.tab-btn.active { color: var(--orange); border-bottom-color: var(--orange); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ── Progress bar ────────────────────────────────────────────────────────── */
.progress { height: 8px; background: var(--gray-200); border-radius: 999px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--orange), var(--orange-lt)); border-radius: 999px; transition: width .5s ease; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: var(--radius);
  width: 90%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  background: var(--navy);
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
}
.modal-close { background: none; border: none; color: #fff; font-size: 1.4rem; cursor: pointer; }
.modal-body { padding: 1.5rem; }
.modal-footer { padding: 1rem 1.5rem; border-top: 1px solid var(--gray-200); display: flex; gap: .75rem; justify-content: flex-end; }

/* ── Hero (landing) ──────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--dark) 60%, #1a3a5c 100%);
  min-height: 90vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.hero-content { position: relative; z-index: 1; color: #fff; max-width: 600px; }
.hero-title { font-size: 3.5rem; font-weight: 900; line-height: 1.1; }
.hero-title span { color: var(--orange); }
.hero-subtitle { font-size: 1.2rem; opacity: .8; margin: 1.25rem 0 2rem; line-height: 1.6; }
.hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }
.hero-features { display: flex; gap: 2rem; margin-top: 3rem; flex-wrap: wrap; }
.hero-feature { display: flex; align-items: center; gap: .5rem; font-size: .9rem; opacity: .8; }
.hero-feature span { font-size: 1.3rem; }

/* ── Invite / Referral page ────────────────────────────────────────────────── */
.invite-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}
.challenge-detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.5rem;
}
.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .55rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  white-space: nowrap;
}
.share-btn-sms      { background: #34c759; color: #fff; }
.share-btn-sms:hover { background: #28a745; color: #fff; }
.share-btn-email    { background: var(--navy); color: #fff; }
.share-btn-email:hover { background: var(--dark); color: #fff; }
.share-btn-whatsapp { background: #25d366; color: #fff; }
.share-btn-whatsapp:hover { background: #1ebe5d; color: #fff; }
.share-btn-twitter  { background: #000; color: #fff; }
.share-btn-twitter:hover { background: #333; color: #fff; }
.how-step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--gray-200);
}
.how-step:last-child { border-bottom: none; }
.how-num {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--orange);
  color: #fff;
  font-weight: 800;
  font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ref-row {
  display: flex;
  align-items: center;
  gap: .85rem;
  padding: .85rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}
.ref-row:last-child { border-bottom: none; }
.ref-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--orange);
  flex-shrink: 0;
}
.ref-avatar-placeholder {
  background: var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,.6);
  text-align: center;
  padding: 1.5rem;
  font-size: .85rem;
  margin-top: 3rem;
}
.footer a { color: var(--orange); }

/* ── Admin ───────────────────────────────────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }
.admin-sidebar {
  width: 240px;
  background: var(--navy);
  flex-shrink: 0;
  padding: 1.5rem 0;
}
.admin-sidebar .brand {
  padding: 0 1.5rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.1);
  margin-bottom: 1rem;
}
.admin-sidebar .brand span { color: var(--orange); }
.admin-nav-link {
  display: flex; align-items: center; gap: .6rem;
  padding: .65rem 1.5rem;
  color: rgba(255,255,255,.7);
  font-size: .9rem;
  font-weight: 500;
  transition: var(--transition);
}
.admin-nav-link:hover, .admin-nav-link.active {
  background: rgba(255,255,255,.08);
  color: #fff;
}
.admin-nav-link.active { border-left: 3px solid var(--orange); }
.admin-main { flex: 1; padding: 2rem; background: var(--gray-100); overflow-y: auto; }
.admin-header { margin-bottom: 2rem; }
.admin-header h1 { font-size: 1.75rem; font-weight: 800; color: var(--navy); }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--navy); padding: 1rem; z-index: 200; }
  .nav-links.open { display: flex; }
  .nav-hamburger { display: block; }
  .navbar { position: relative; }
  .swipe-stack { width: 320px; height: 480px; }
  .admin-sidebar { display: none; }
  .admin-layout { flex-direction: column; }
  .challenge-item { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* Dashboard: single column on mobile */
  .dash-grid { grid-template-columns: 1fr; }

  /* Points page: stack on mobile */
  .points-grid { grid-template-columns: 1fr; }

  /* Athlete page: stack on mobile */
  .athlete-layout { grid-template-columns: 1fr; }

  /* Profile page: stack on mobile */
  .profile-layout { grid-template-columns: 1fr; }

  /* Invite page: stack on mobile */
  .invite-layout { grid-template-columns: 1fr; }

  /* Challenge detail page: stack on mobile */
  .challenge-detail-layout { grid-template-columns: 1fr; }

  /* Card header: allow wrapping so buttons don't get cut off */
  .card-header { flex-wrap: wrap; gap: .5rem; }

  /* Tables: prevent overflow, allow text to wrap */
  table { width: 100%; table-layout: fixed; }
  table th, table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: .4rem .5rem; font-size: .82rem; }

  /* Best efforts table: give Distance more space */
  table th:first-child, table td:first-child { width: 55%; }
  table th:last-child, table td:last-child { width: 45%; }

  /* Page header: stack vertically */
  .page-header .container { flex-direction: column; align-items: flex-start !important; }

  /* Athlete grid: single column */
  .athlete-grid { grid-template-columns: 1fr; }

  /* Leaderboard table: scrollable on mobile */
  .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* Tabs: scrollable on mobile */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; white-space: nowrap; }

  /* Points balance: smaller font */
  .points-balance .balance-val { font-size: 2.5rem; }

  /* Swipe arena padding */
  .swipe-arena { padding: 1rem .5rem; }

  /* Hero: reduce padding */
  .hero { min-height: auto; padding: 3rem 0; }
  .hero-features { gap: 1rem; }

  /* Admin main: reduce padding */
  .admin-main { padding: 1rem; }
}

@media (max-width: 480px) {
  .dash-grid { gap: 1rem; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .stat-card .stat-value { font-size: 1.5rem; }
  .card-body { padding: 1rem; }
  .card-header { padding: 1rem; font-size: .9rem; }
  .btn { font-size: .82rem; padding: .45rem 1rem; }
  .btn-sm { font-size: .75rem; padding: .3rem .65rem; }
  .hero-title { font-size: 1.8rem; }
  .hero-subtitle { font-size: 1rem; }
  .page-header h1 { font-size: 1.4rem; }
  .swipe-stack { width: 290px; height: 440px; }
  .swipe-btn { width: 52px; height: 52px; font-size: 1.2rem; }
  .swipe-btn-like { width: 60px; height: 60px; font-size: 1.5rem; }
}
