/* ===== RUNSTREAK - GLOBAL STYLES ===== */
/* ViPE Color Palette — Red #CC0000 · Gold #D4AF37 */

:root {
  /* ── Primary: ViPE Red ── */
  --primary: #CC0000;
  --primary-dark: #A30000;
  --primary-light: #E63333;

  /* ── Accent: ViPE Gold ── */
  --accent: #D4AF37;
  --accent-light: #F0C040;
  --accent-dark: #A07820;

  /* ── Semantic ── */
  --secondary: #1A0A0A;
  --success: #22C55E;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;

  /* ── Backgrounds ── */
  --bg-dark: #0F0505;
  --bg-card: #1A0A0A;
  --bg-card2: #200E0E;
  --bg-surface: #130808;
  --border: rgba(204,0,0,0.12);
  --border-light: rgba(204,0,0,0.2);

  /* ── Text ── */
  --text-primary: #F8F0F0;
  --text-secondary: #C4A8A8;
  --text-muted: #8A6E6E;

  /* ── Gradients ── */
  --gradient-fire: linear-gradient(135deg, #CC0000, #E63333, #D4AF37);
  --gradient-gold: linear-gradient(135deg, #D4AF37, #F0C040, #A07820);
  --gradient-dark: linear-gradient(135deg, #1A0A0A, #200E0E);
  --gradient-card: linear-gradient(145deg, #1E0E0E, #150808);

  /* ── Shadows ── */
  --shadow-glow: 0 0 30px rgba(204, 0, 0, 0.3);
  --shadow-gold: 0 0 20px rgba(212, 175, 55, 0.25);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-btn: 0 4px 20px rgba(204, 0, 0, 0.45);

  /* ── Radius ── */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --nav-height: 64px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  /* Prevent pull-to-refresh & overscroll color on mobile */
  overscroll-behavior-y: contain;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; height: auto; }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, textarea, select { font-family: inherit; outline: none; }

/* Improve tap targets */
button, a, [onclick], [role="button"] { -webkit-tap-highlight-color: transparent; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary-light); }

/* ===== TYPOGRAPHY ===== */
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.2; }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; line-height: 1.3; }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); font-weight: 600; }
h4 { font-size: 1rem; font-weight: 600; }
p { color: var(--text-secondary); }
.text-gradient {
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== NAVIGATION ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(15, 15, 26, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 1000;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  overflow: hidden;
  padding: 0 1.5rem;
  gap: 1rem;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.3rem;
  font-weight: 800;
  flex-shrink: 0;
}
.navbar-brand .logo-icon {
  width: 36px; height: 36px;
  background: var(--gradient-fire);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
  justify-content: center;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}
.nav-link:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.nav-link.active { color: var(--primary); background: rgba(204,0,0,0.12); }
.navbar-actions { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; }
.user-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  object-fit: cover;
  cursor: pointer;
  transition: var(--transition);
}
.user-avatar:hover { transform: scale(1.05); box-shadow: var(--shadow-glow); }

/* ===== MAIN LAYOUT ===== */
.main-content { padding-top: var(--nav-height); min-height: 100vh; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.container-sm { max-width: 800px; margin: 0 auto; padding: 0 1.5rem; }
.page-header { padding: 2rem 0 1rem; }
.section { padding: 1.5rem 0; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-light); }
.card-glow { box-shadow: var(--shadow-glow); border-color: rgba(204,0,0,0.3); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem; }
.card-title { font-size: 1rem; font-weight: 600; display: flex; align-items: center; gap: 0.5rem; }

/* Stat Cards */
.stat-card {
  background: var(--gradient-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-card); border-color: rgba(204,0,0,0.2); }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.stat-icon.orange { background: rgba(204,0,0,0.15); }
.stat-icon.gold { background: rgba(255,215,0,0.15); }
.stat-icon.green { background: rgba(34,197,94,0.15); }
.stat-icon.blue { background: rgba(59,130,246,0.15); }
.stat-value { font-size: 1.6rem; font-weight: 800; line-height: 1; color: var(--text-primary); }
.stat-label { font-size: 0.78rem; color: var(--text-secondary); margin-top: 0.2rem; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: var(--gradient-fire);
  color: white;
  box-shadow: var(--shadow-btn);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px rgba(204,0,0,0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: rgba(255,255,255,0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-light);
}
.btn-secondary:hover { background: rgba(255,255,255,0.13); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.25); }
.btn-success:hover { background: rgba(34,197,94,0.25); }
.btn-lg { padding: 0.85rem 2rem; font-size: 1rem; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-icon { width: 38px; height: 38px; padding: 0; border-radius: var(--radius-md); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-loading { position: relative; pointer-events: none; }
.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== FORMS ===== */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.form-control {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 0.7rem 1rem;
  color: var(--text-primary);
  font-size: 0.9rem;
  transition: var(--transition);
  /* Prevent iOS zoom on focus */
  font-size: max(16px, 0.9rem);
  -webkit-appearance: none;
}
.form-control:focus {
  border-color: var(--primary);
  background: rgba(204,0,0,0.04);
  box-shadow: 0 0 0 3px rgba(204,0,0,0.1);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control-lg { padding: 0.9rem 1.25rem; font-size: 1rem; }
.input-group { position: relative; display: flex; align-items: center; }
.input-group .form-control { padding-left: 2.75rem; }
.input-group-icon {
  position: absolute; left: 0.9rem;
  color: var(--text-muted); font-size: 0.95rem;
  pointer-events: none;
}
.input-group-right { position: absolute; right: 0.9rem; cursor: pointer; color: var(--text-muted); }
.input-group-right:hover { color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.4rem; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 0.4rem; }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-primary { background: rgba(204,0,0,0.15); color: var(--primary); }
.badge-success { background: rgba(34,197,94,0.15); color: var(--success); }
.badge-warning { background: rgba(245,158,11,0.15); color: var(--warning); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-info { background: rgba(59,130,246,0.15); color: var(--info); }
.badge-gold { background: rgba(255,215,0,0.15); color: var(--accent); }

/* Level badges */
.level-badge {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}
.level-newbie { background: rgba(107,114,128,0.2); color: #9CA3AF; }
.level-runner { background: rgba(59,130,246,0.2); color: #60A5FA; }
.level-elite { background: rgba(168,85,247,0.2); color: #C084FC; }
.level-champion { background: rgba(255,215,0,0.2); color: var(--accent); }

/* ===== STREAK FLAME ===== */
.streak-display {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.streak-flame {
  font-size: 1.5rem;
  animation: flicker 1.5s ease-in-out infinite alternate;
}
.streak-count {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #CC0000, #D4AF37);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.streak-label { font-size: 0.75rem; color: var(--text-muted); }

/* ===== CALENDAR HEATMAP ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.calendar-cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}
.calendar-cell.has-run { background: rgba(204,0,0,0.25); border-color: rgba(204,0,0,0.4); }
.calendar-cell.has-run.good { background: rgba(204,0,0,0.5); }
.calendar-cell.has-run.great { background: var(--primary); }
.calendar-cell.today { border-color: var(--accent); box-shadow: 0 0 8px rgba(255,215,0,0.3); }
.calendar-cell.future { opacity: 0.3; cursor: default; }
.calendar-cell:hover:not(.future) { transform: scale(1.15); z-index: 1; }

/* ===== LEADERBOARD ===== */
.leaderboard-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border-radius: var(--radius-md);
  transition: var(--transition);
  border: 1px solid transparent;
}
.leaderboard-item:hover { background: rgba(255,255,255,0.04); border-color: var(--border); }
.leaderboard-item.rank-1 { background: linear-gradient(135deg, rgba(212,175,55,0.1), rgba(204,0,0,0.05)); border-color: rgba(212,175,55,0.2); }
.leaderboard-item.rank-2 { background: rgba(192,192,192,0.05); border-color: rgba(192,192,192,0.15); }
.leaderboard-item.rank-3 { background: rgba(205,127,50,0.05); border-color: rgba(205,127,50,0.15); }
.rank-badge {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 0.85rem;
  flex-shrink: 0;
}
.rank-1 .rank-badge { background: var(--accent); color: #000; }
.rank-2 .rank-badge { background: #C0C0C0; color: #000; }
.rank-3 .rank-badge { background: #CD7F32; color: #000; }
.rank-other .rank-badge { background: rgba(255,255,255,0.08); color: var(--text-secondary); }
.leaderboard-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; border: 2px solid var(--border-light); }
.leaderboard-info { flex: 1; min-width: 0; }
.leaderboard-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leaderboard-sub { font-size: 0.75rem; color: var(--text-secondary); }
.leaderboard-km { font-size: 1.1rem; font-weight: 800; color: var(--primary); }
.leaderboard-streak { font-size: 0.75rem; color: var(--text-muted); text-align: right; }

/* ===== ACTIVITY FEED ===== */
.feed-item {
  display: flex;
  gap: 0.85rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}
.feed-item:last-child { border-bottom: none; }
.feed-avatar { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.feed-content { flex: 1; }
.feed-header { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 0.3rem; }
.feed-name { font-weight: 600; font-size: 0.875rem; }
.feed-action { font-size: 0.875rem; color: var(--text-secondary); }
.feed-km { color: var(--primary); font-weight: 700; }
.feed-time { font-size: 0.75rem; color: var(--text-muted); margin-left: auto; }
.feed-note { font-size: 0.82rem; color: var(--text-secondary); margin-top: 0.25rem; font-style: italic; }
.feed-cheer-btn {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-full);
  background: rgba(204,0,0,0.08);
  border: 1px solid rgba(204,0,0,0.15);
  color: var(--text-secondary);
  font-size: 0.78rem; font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 0.5rem;
}
.feed-cheer-btn:hover, .feed-cheer-btn.cheered {
  background: rgba(204,0,0,0.18);
  border-color: var(--primary);
  color: var(--primary);
}

/* ===== PROGRESS BAR ===== */
.progress-wrap { margin: 0.5rem 0; }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 0.4rem; font-size: 0.78rem; color: var(--text-secondary); }
.progress-bar {
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gradient-fire);
  border-radius: var(--radius-full);
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-fill.over { background: linear-gradient(90deg, var(--success), #4ADE80); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 480px;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-overlay.active .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 680px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.modal-title { font-size: 1.2rem; font-weight: 700; }
.modal-close {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1.1rem;
  transition: var(--transition);
}
.modal-close:hover { background: rgba(255,255,255,0.12); }

/* ===== SCREENSHOT CARD ===== */
#screenshot-card {
  background: linear-gradient(135deg, #0F0505, #1A0808);
  border: 1px solid rgba(204,0,0,0.3);
  border-radius: var(--radius-xl);
  padding: 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
#screenshot-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--gradient-fire);
}
.screenshot-brand {
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  font-size: 1rem; font-weight: 800; color: var(--text-secondary);
  margin-bottom: 1.5rem;
}
.screenshot-km {
  font-size: 4rem;
  font-weight: 900;
  background: var(--gradient-fire);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}
.screenshot-unit { font-size: 1.5rem; font-weight: 700; color: var(--text-secondary); }
.screenshot-date { font-size: 0.9rem; color: var(--text-muted); margin: 0.5rem 0; }
.screenshot-user { font-size: 1.1rem; font-weight: 700; margin: 1rem 0 0.25rem; }
.screenshot-streak { font-size: 0.9rem; color: var(--text-secondary); }
.screenshot-deco {
  position: absolute; font-size: 5rem; opacity: 0.03;
  top: -1rem; right: -1rem; transform: rotate(15deg);
  pointer-events: none;
}

/* ===== TABS ===== */
.tabs { display: flex; gap: 0.25rem; background: rgba(255,255,255,0.04); padding: 0.3rem; border-radius: var(--radius-lg); margin-bottom: 1.5rem; }
.tab-btn {
  flex: 1; padding: 0.6rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  transition: var(--transition);
  cursor: pointer;
}
.tab-btn.active { background: var(--primary); color: white; font-weight: 600; }
.tab-btn:hover:not(.active) { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  display: flex; flex-direction: column; gap: 0.75rem;
  z-index: 9999;
}
.toast {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  min-width: 280px; max-width: 360px;
  box-shadow: var(--shadow-card);
  animation: slideInRight 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  font-size: 0.875rem;
}
.toast.hiding { animation: slideOutRight 0.3s ease forwards; }
.toast-icon { font-size: 1.2rem; flex-shrink: 0; }
.toast-msg { flex: 1; color: var(--text-primary); }
.toast-close { cursor: pointer; color: var(--text-muted); font-size: 1rem; flex-shrink: 0; }
.toast-close:hover { color: var(--text-primary); }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--info); }
.toast.warning { border-left: 3px solid var(--warning); }

/* ===== LOADING ===== */
.loading-overlay {
  position: fixed; inset: 0;
  background: var(--bg-dark);
  z-index: 9998;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 1.5rem;
  transition: opacity 0.5s ease;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }
.loading-logo { font-size: 3rem; animation: bounce 0.8s ease-in-out infinite alternate; }
.loading-spinner {
  width: 48px; height: 48px;
  border: 3px solid rgba(204,0,0,0.2);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-text { color: var(--text-secondary); font-size: 0.9rem; }
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ===== DIVIDER ===== */
.divider { height: 1px; background: var(--border); margin: 1.25rem 0; }
.divider-text {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-muted); font-size: 0.8rem;
  margin: 1.25rem 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 3rem 1.5rem;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state h3 { color: var(--text-primary); margin-bottom: 0.5rem; }
.empty-state p { font-size: 0.875rem; max-width: 320px; margin: 0 auto 1.5rem; }

/* ===== AVATARS ===== */
.avatar { border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.avatar-sm { width: 32px; height: 32px; }
.avatar-md { width: 48px; height: 48px; }
.avatar-lg { width: 64px; height: 64px; }
.avatar-xl { width: 96px; height: 96px; }
.avatar-placeholder {
  background: var(--gradient-fire);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700;
  border-radius: 50%;
}

/* ===== RULE ALERT ===== */
.rule-card {
  background: rgba(239,68,68,0.06);
  border: 1px solid rgba(239,68,68,0.2);
  border-radius: var(--radius-md);
  padding: 0.85rem 1rem;
  display: flex; align-items: flex-start; gap: 0.75rem;
}
.rule-card.ok { background: rgba(34,197,94,0.06); border-color: rgba(34,197,94,0.2); }
.rule-card.warn { background: rgba(245,158,11,0.06); border-color: rgba(245,158,11,0.2); }

/* ===== ANIMATIONS ===== */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes flicker {
  0% { transform: scale(1) rotate(-2deg); filter: brightness(1); }
  100% { transform: scale(1.1) rotate(2deg); filter: brightness(1.2); }
}
@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes slideOutRight {
  to { transform: translateX(120%); opacity: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(204,0,0,0.3); }
  50% { box-shadow: 0 0 25px rgba(204,0,0,0.6); }
}
.animate-fade { animation: fadeIn 0.4s ease forwards; }
.animate-pulse-glow { animation: pulse-glow 2s ease-in-out infinite; }

/* ===== UTILS ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.color-primary { color: var(--primary); }
.color-success { color: var(--success); }
.color-warning { color: var(--warning); }
.color-danger { color: var(--danger); }
.color-gold { color: var(--accent); }
.color-muted { color: var(--text-muted); }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

/* ===== MOBILE NAV (hidden on desktop) ===== */
.mobile-nav { display: none; }

/* ===== MOBILE FAB CENTER BUTTON ===== */
.mobile-nav-fab {
  width: 54px; height: 54px;
  background: var(--gradient-fire);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(204,0,0,0.6);
  margin-top: -22px;
  flex-shrink: 0;
  transition: var(--transition);
  border: 3px solid rgba(15,5,5,0.8);
}
.mobile-nav-fab:active { transform: scale(0.91); box-shadow: 0 2px 12px rgba(204,0,0,0.5); }
.mobile-nav-fab i { color: white; font-size: 1.25rem; }

/* ===== PAGE HEADER MOBILE ===== */
.page-header { padding: 1.5rem 0 1rem; }

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 768px) {
  :root {
    --nav-height: 56px;
    --mobile-nav-h: 66px;
  }

  /* ---- Navbar ---- */
  .navbar { padding: 0 1rem; height: var(--nav-height); }
  .navbar-nav { display: none; }
  .navbar-brand { font-size: 1.1rem; }
  .navbar-brand .logo-icon { width: 30px; height: 30px; font-size: 1rem; }
  .navbar-actions { gap: 0.5rem; }
  .user-avatar { width: 32px; height: 32px; }

  /* ---- Bottom Mobile Nav ---- */
  .mobile-nav {
    display: flex;
    position: fixed; bottom: 0; left: 0; right: 0;
    height: var(--mobile-nav-h);
    background: rgba(10, 10, 20, 0.98);
    backdrop-filter: blur(28px);
    -webkit-backdrop-filter: blur(28px);
    border-top: 1px solid rgba(255,255,255,0.07);
    align-items: center; justify-content: space-around;
    z-index: 999;
    padding: 0 0.5rem;
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
  }
  .mobile-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 0.3rem 0.6rem;
    border-radius: var(--radius-md);
    font-size: 0.58rem; font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    cursor: pointer;
    min-width: 50px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    flex: 1;
  }
  .mobile-nav-item i { font-size: 1.2rem; transition: var(--transition); }
  .mobile-nav-item.active { color: var(--primary); }
  .mobile-nav-item.active i {
    filter: drop-shadow(0 0 6px rgba(204,0,0,0.8));
    transform: translateY(-1px);
  }

  /* ---- Layout ---- */
  .main-content {
    padding-bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0px) + 10px);
  }
  .container, .container-sm { padding: 0 0.875rem; }
  .page-header { padding: 1rem 0 0.75rem; }

  /* ---- Grids ---- */
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .grid-2 { grid-template-columns: 1fr; gap: 0.75rem; }

  /* ---- Cards ---- */
  .card { padding: 1rem; border-radius: var(--radius-lg); }
  .card-header { margin-bottom: 0.875rem; }
  .card-title { font-size: 0.9rem; }

  /* ---- Stat Cards ---- */
  .stat-card { padding: 0.875rem 1rem; gap: 0.75rem; border-radius: var(--radius-md); }
  .stat-icon { width: 40px; height: 40px; font-size: 1.1rem; }
  .stat-value { font-size: 1.3rem; }
  .stat-label { font-size: 0.68rem; }

  /* ---- Leaderboard ---- */
  .leaderboard-item { padding: 0.65rem 0.75rem; gap: 0.65rem; }
  .leaderboard-avatar { width: 34px; height: 34px; }
  .leaderboard-name { font-size: 0.82rem; }
  .leaderboard-km { font-size: 1rem; }

  /* ---- Feed ---- */
  .feed-item { padding: 0.75rem 0; gap: 0.65rem; }
  .feed-name { font-size: 0.82rem; }
  .feed-action { font-size: 0.82rem; }
  .feed-km { font-size: 0.85rem; }
  .feed-time { font-size: 0.7rem; }
  .feed-cheer-btn { font-size: 0.75rem; padding: 0.25rem 0.65rem; }

  /* ---- Buttons ---- */
  .btn { font-size: 0.82rem; padding: 0.55rem 1rem; }
  .btn-lg { font-size: 0.95rem; padding: 0.85rem 1.5rem; }
  .btn-sm { font-size: 0.73rem; padding: 0.32rem 0.7rem; }
  .btn-icon { width: 36px; height: 36px; }

  /* ---- Modal - bottom sheet on mobile ---- */
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    padding: 1.5rem 1.25rem 1.75rem;
    max-width: 100%;
    max-height: 93vh;
    width: 100%;
    transform: translateY(100%);
  }
  .modal-overlay.active .modal { transform: translateY(0); }
  .modal-lg { max-width: 100%; }
  /* Drag indicator for bottom sheet */
  .modal::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
    margin: -0.75rem auto 1.25rem;
  }

  /* ---- Typography ---- */
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1rem; }
  p { font-size: 0.875rem; }

  /* ---- Toast ---- */
  .toast-container {
    bottom: calc(var(--mobile-nav-h) + 8px);
    right: 0.75rem;
    left: 0.75rem;
  }
  .toast { min-width: unset; max-width: 100%; font-size: 0.83rem; }

  /* ---- Progress bar ---- */
  .progress-header { font-size: 0.72rem; }
  .progress-bar { height: 7px; }

  /* ---- Badges ---- */
  .badge { font-size: 0.68rem; padding: 0.18rem 0.48rem; }
  .level-badge { font-size: 0.68rem; padding: 0.18rem 0.55rem; }

  /* ---- Streak ---- */
  .streak-count { font-size: 1.5rem; }
  .streak-flame { font-size: 1.25rem; }
  .streak-label { font-size: 0.7rem; }

  /* ---- Empty state ---- */
  .empty-state { padding: 2rem 1rem; }
  .empty-state .empty-icon { font-size: 2.5rem; }
  .empty-state h3 { font-size: 1rem; }
  .empty-state p { font-size: 0.82rem; }

  /* ---- Divider ---- */
  .divider-text { font-size: 0.75rem; }
}

/* Small phones */
@media (max-width: 390px) {
  :root { --mobile-nav-h: 62px; }
  .container, .container-sm { padding: 0 0.75rem; }
  .stat-value { font-size: 1.15rem; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .stat-card { padding: 0.7rem 0.875rem; }
  .stat-icon { width: 34px; height: 34px; }
  .card { padding: 0.875rem; }
  .card-title { font-size: 0.85rem; }
  h2 { font-size: 1.15rem; }
  .btn { font-size: 0.8rem; }
  .modal { padding: 1.25rem 1rem 1.5rem; }
}

/* Very small phones */
@media (max-width: 340px) {
  .stat-value { font-size: 1rem; }
  .stat-icon { width: 30px; height: 30px; font-size: 0.95rem; }
  .card { padding: 0.75rem; }
}

/* ===== DASHBOARD GRID ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 960px) {
  .dashboard-grid {
    grid-template-columns: 1fr !important;
  }
}
