/* ============================================================
   ECO APP — Design System & Global Styles (Light Mode)
   ============================================================ */

/* --- Tokens --- */
:root {
  --bg:           #f2fbf4;
  --bg2:          #ffffff;
  --bg3:          #e8f5eb;
  --surface:      rgba(255,255,255,0.85);
  --surface2:     rgba(255,255,255,0.95);
  --surface3:     rgba(255,255,255,1.0);
  --border:       rgba(0,0,0,0.07);
  --border2:      rgba(0,0,0,0.12);

  --green:        #16a34a;
  --green-bright: #22c55e;
  --green-dark:   #15803d;
  --green-glow:   rgba(22,163,74,0.22);
  --green-glow2:  rgba(22,163,74,0.10);

  --teal:         #0d9488;
  --teal-glow:    rgba(13,148,136,0.18);

  --gold:         #d97706;
  --gold-light:   #f59e0b;
  --gold-glow:    rgba(217,119,6,0.22);

  --purple:       #7c3aed;
  --purple-glow:  rgba(124,58,237,0.18);

  --blue:         #2563eb;
  --red:          #dc2626;

  --text:         #0d1f12;
  --text2:        #1a4a25;
  --text3:        #6b7280;
  --text-muted:   #9ca3af;

  --radius-sm:    8px;
  --radius:       14px;
  --radius-lg:    20px;
  --radius-xl:    28px;
  --radius-full:  9999px;

  --shadow:       0 2px 16px rgba(0,0,0,0.10);
  --shadow-green: 0 4px 20px var(--green-glow);
  --shadow-gold:  0 4px 20px var(--gold-glow);
  --shadow-card:  0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.07);

  --transition:   all 0.25s cubic-bezier(0.4,0,0.2,1);
  --font-head:    'Outfit', sans-serif;
  --font-body:    'Inter', sans-serif;

  --nav-h:        72px;
  --top-h:        56px;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  height: 100%;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}
#app { height: 100%; position: relative; overflow: hidden; }
button { cursor: pointer; border: none; background: none; font-family: inherit; color: inherit; }
input { font-family: inherit; }
img { max-width: 100%; }
.hidden { display: none !important; }

/* ============================================================
   SPLASH
   ============================================================ */
.splash {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse at 50% 40%, #d1fae5 0%, #f2fbf4 70%);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  animation: splash-out 0.5s ease-in 2s forwards;
}
.splash-logo { text-align: center; animation: splash-in 0.6s ease-out; }
.splash-icon {
  font-size: 72px;
  animation: float 2s ease-in-out infinite;
  display: block; margin-bottom: 12px;
  filter: drop-shadow(0 4px 16px var(--green-glow));
}
.splash-title {
  font-family: var(--font-head);
  font-size: 56px; font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--teal));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -2px;
}
.splash-sub {
  color: var(--text2); font-size: 15px; margin-top: 6px;
  font-family: var(--font-head);
  opacity: 0; animation: fade-in 0.5s ease-out 0.8s forwards;
}

/* ============================================================
   ONBOARDING
   ============================================================ */
.onboarding { position: fixed; inset: 0; z-index: 1000; overflow: hidden; }
.onboard-bg {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, #d1fae5 0%, #f2fbf4 60%);
}
.onboard-content {
  position: relative; height: 100%;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 24px 28px 40px;
  gap: 0;
}
.onboard-emoji { font-size: 72px; margin-bottom: 24px;
  filter: drop-shadow(0 4px 12px var(--green-glow)); }
.auth-hero h2 {
  font-family: var(--font-head); font-size: 28px; font-weight: 800;
  color: var(--text); margin-bottom: 14px;
}
.auth-hero p { color: var(--text2); font-size: 16px; line-height: 1.7; max-width: 320px; }
.onboard-input {
  margin-top: 20px; width: 100%; max-width: 300px;
  background: var(--surface2); border: 1.5px solid var(--border2);
  border-radius: var(--radius); padding: 14px 18px;
  font-size: 16px; color: var(--text);
  outline: none; transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.onboard-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow2); }
.avatar-label { color: var(--text2); font-size: 14px; margin: 20px 0 12px; }
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(4, 52px);
  gap: 10px;
  justify-content: center;
  max-width: 238px;
}
.avatar-option {
  font-size: 32px; width: 52px; height: 52px;
  border-radius: var(--radius); cursor: pointer;
  display: grid; place-items: center;
  border: 2px solid var(--border2);
  background: var(--surface2); transition: var(--transition);
  box-shadow: var(--shadow-card);
  line-height: 1;
  padding: 0;
  text-align: center;
}
.avatar-option:hover { transform: scale(1.1); border-color: var(--green); }
.avatar-option.selected { border-color: var(--green); background: rgba(22,163,74,0.08); box-shadow: var(--shadow-green); }

.onboard-btn {
  margin-top: 24px; width: 100%; max-width: 300px;
  padding: 16px; border-radius: var(--radius-xl);
  font-family: var(--font-head); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  min-height: 58px;
  line-height: 1;
  text-align: center;
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff;
  box-shadow: var(--shadow-green);
  transition: var(--transition);
}
.onboard-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--green-glow); }
.onboard-btn:active { transform: translateY(0); }
.auth-card {
  width: min(100%, 380px);
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(255,255,255,0.75);
  border-radius: 28px;
  box-shadow: 0 18px 60px rgba(13, 31, 18, 0.12);
  backdrop-filter: blur(16px);
  padding: 28px 22px 24px;
}
.auth-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  background: rgba(22,163,74,0.08);
  padding: 6px;
  border-radius: var(--radius-full);
  margin-top: 26px;
}
.auth-tab {
  min-height: 42px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  text-align: center;
  color: var(--text2);
  transition: var(--transition);
}
.auth-tab.active {
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff;
  box-shadow: var(--shadow-green);
}
.auth-message {
  margin-top: 16px;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}
.auth-message.error {
  background: rgba(220,38,38,0.08);
  color: #b91c1c;
  border: 1px solid rgba(220,38,38,0.18);
}
.auth-panel {
  display: none;
}
.auth-panel.active {
  display: block;
}
.auth-form {
  display: flex;
  flex-direction: column;
}
.auth-form .onboard-input {
  max-width: none;
}
.auth-submit[disabled] {
  opacity: 0.7;
  cursor: wait;
}

/* ============================================================
   MAIN APP SHELL
   ============================================================ */
.main-app {
  height: 100%; display: flex; flex-direction: column;
  background: var(--bg);
}

/* --- Topbar --- */
.topbar {
  height: var(--top-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 18px;
  background: rgba(242,251,244,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative; z-index: 10;
}
.app-logo {
  font-family: var(--font-head); font-size: 22px; font-weight: 900;
  background: linear-gradient(135deg, var(--green), var(--teal));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -1px;
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.streak-badge {
  display: flex; align-items: center; gap: 4px;
  background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.20);
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: 14px; font-weight: 600; color: #b91c1c;
}
.streak-flame { font-size: 16px; }
.xp-chip {
  display: flex; align-items: center; gap: 5px;
  background: rgba(124,58,237,0.08); border: 1px solid rgba(124,58,237,0.20);
  padding: 5px 12px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; color: var(--purple);
}
.xp-icon { font-size: 14px; }

/* --- Pages Container --- */
.pages-container {
  flex: 1; overflow: hidden; position: relative;
}
.page-view {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  display: none;
  padding: 0 0 calc(var(--nav-h) + 16px) 0;
  -webkit-overflow-scrolling: touch;
}
.page-view.active { display: block; }
.page-view::-webkit-scrollbar { display: none; }

/* --- Bottom Nav --- */
.bottom-nav {
  height: var(--nav-h);
  display: flex; align-items: center;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  flex-shrink: 0;
  padding: 0 4px;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 4px;
  padding: 8px 0; border-radius: var(--radius);
  transition: var(--transition); position: relative;
}
.nav-icon { font-size: 22px; transition: var(--transition); }
.nav-label { font-size: 10px; font-weight: 500; color: var(--text3); transition: var(--transition); }
.nav-item.active .nav-label { color: var(--green); }
.nav-item.active .nav-icon { filter: drop-shadow(0 2px 6px var(--green-glow)); transform: translateY(-1px); }
.nav-item:active { transform: scale(0.92); }

/* Scan nav special pill */
.nav-item[data-page="scan"] { position: relative; }
.nav-item[data-page="scan"] .nav-icon {
  background: linear-gradient(135deg, var(--green), var(--teal));
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; box-shadow: var(--shadow-green);
  margin-bottom: 2px;
}

/* ============================================================
   REUSABLE
   ============================================================ */
.section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 18px 10px;
}
.section-title {
  font-family: var(--font-head); font-size: 18px; font-weight: 700; color: var(--text);
}
.see-all-btn {
  font-size: 13px; color: var(--green); font-weight: 600;
  padding: 4px 10px; border-radius: var(--radius-sm);
  background: var(--green-glow2); transition: var(--transition);
}
.see-all-btn:hover { background: var(--green-glow); }
.subsection-title {
  font-family: var(--font-head); font-size: 15px; font-weight: 600;
  color: var(--text2); padding: 0 18px 10px;
}

.empty-state {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 32px 20px; color: var(--text3); font-size: 14px;
  text-align: center;
}
.empty-icon { font-size: 36px; }

/* ============================================================
   HOME PAGE
   ============================================================ */
.home-hero {
  padding: 20px 18px 24px;
  background: linear-gradient(160deg, #d1fae5 0%, #f2fbf4 100%);
  position: relative; overflow: hidden;
}
.home-hero::before {
  content: '';
  position: absolute; top: -40px; right: -40px;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(34,197,94,0.15) 0%, transparent 70%);
  pointer-events: none;
}
.hero-greeting { color: var(--text2); font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.hero-name {
  font-family: var(--font-head); font-size: 26px; font-weight: 800;
  color: var(--text); margin-bottom: 16px;
}
.level-bar-wrap { width: 100%; }
.level-info {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.level-badge {
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff; font-size: 11px; font-weight: 700;
  padding: 3px 10px; border-radius: var(--radius-full);
  font-family: var(--font-head);
}
.level-title { font-size: 13px; color: var(--text2); font-weight: 500; flex: 1; }
.level-next { font-size: 12px; color: var(--text3); font-weight: 500; }
.xp-bar-track {
  width: 100%; height: 8px; background: rgba(0,0,0,0.08);
  border-radius: var(--radius-full); overflow: hidden;
}
.xp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--teal));
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.xp-bar-fill::after {
  content: ''; position: absolute; right: 0; top: 0; bottom: 0;
  width: 20px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5));
  border-radius: var(--radius-full);
  animation: shimmer 1.5s infinite;
}

/* Challenges */
.challenges-list { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.challenge-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: var(--transition);
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-card);
}
.challenge-card.completed { border-color: rgba(22,163,74,0.25); background: rgba(22,163,74,0.05); }
.challenge-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: linear-gradient(180deg, var(--green), var(--teal));
  border-radius: 2px 0 0 2px;
}
.challenge-card.completed::before { background: var(--green); }
.ch-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ch-icon { font-size: 24px; }
.ch-info { flex: 1; }
.ch-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.ch-desc { font-size: 12px; color: var(--text3); }
.ch-reward {
  background: rgba(124,58,237,0.08); color: var(--purple);
  border: 1px solid rgba(124,58,237,0.18);
  font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: var(--radius-full); font-family: var(--font-head);
}
.ch-progress-track {
  width: 100%; height: 6px; background: rgba(0,0,0,0.08);
  border-radius: var(--radius-full); overflow: hidden;
}
.ch-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green), var(--teal));
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}
.ch-progress-label {
  font-size: 11px; color: var(--text3); margin-top: 4px; text-align: right;
}
.ch-done-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 600; color: var(--green);
  margin-top: 4px; justify-content: flex-end;
}

/* Recent scans */
.recent-scans { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.scan-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  transition: var(--transition); box-shadow: var(--shadow-card);
}
.scan-item-icon { font-size: 28px; }
.scan-item-info { flex: 1; }
.scan-item-name { font-size: 14px; font-weight: 600; color: var(--text); }
.scan-item-cat { font-size: 12px; color: var(--text3); }
.scan-item-xp {
  font-size: 13px; font-weight: 700; color: var(--green);
  font-family: var(--font-head);
}
.scan-item-time { font-size: 11px; color: var(--text-muted); }

/* Trophy shelf */
.trophy-shelf { display: flex; gap: 10px; padding: 0 16px 8px; overflow-x: auto; }
.trophy-shelf::-webkit-scrollbar { display: none; }
.trophy-chip {
  flex-shrink: 0; display: flex; flex-direction: column; align-items: center;
  gap: 4px; padding: 12px 16px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); width: 80px;
  transition: var(--transition); box-shadow: var(--shadow-card);
}
.trophy-chip.unlocked { border-color: rgba(217,119,6,0.30); background: rgba(245,158,11,0.06); }
.trophy-chip-icon { font-size: 28px; }
.trophy-chip.locked .trophy-chip-icon { filter: grayscale(1); opacity: 0.3; }
.trophy-chip-name { font-size: 10px; color: var(--text3); text-align: center; line-height: 1.3; font-weight: 500; }
.trophy-chip.unlocked .trophy-chip-name { color: var(--gold); }

/* Refresh timer */
.refresh-timer { font-size: 12px; color: var(--text3); font-weight: 500; font-family: var(--font-head); }

/* ============================================================
   SCAN PAGE
   ============================================================ */
.scan-header { padding: 20px 18px 12px; }
.scan-title {
  font-family: var(--font-head); font-size: 22px; font-weight: 800; color: var(--text);
}
.scan-sub { color: var(--text2); font-size: 13px; margin-top: 4px; }

.camera-wrap {
  position: relative; width: 100%;
  max-width: 640px; margin: 0 auto;
  aspect-ratio: 4 / 3; max-height: 60vh;
  background: #111; overflow: hidden;
  border-radius: var(--radius);
}
#camera-feed {
  width: 100%; height: 100%; object-fit: cover;
}
.is-mirrored {
  transform: scaleX(-1);
}
.scan-frame { position: absolute; inset: 16px; border-radius: var(--radius-lg); }
.scan-corner {
  position: absolute; width: 24px; height: 24px;
  border-color: var(--green-bright); border-style: solid;
  border-radius: 3px;
}
.scan-corner.tl { top: 0; left: 0; border-width: 3px 0 0 3px; }
.scan-corner.tr { top: 0; right: 0; border-width: 3px 3px 0 0; }
.scan-corner.bl { bottom: 0; left: 0; border-width: 0 0 3px 3px; }
.scan-corner.br { bottom: 0; right: 0; border-width: 0 3px 3px 0; }
.scan-line {
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--green-bright), transparent);
  animation: scan-sweep 2s ease-in-out infinite;
}
.camera-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
}
.scanning-spinner {
  width: 56px; height: 56px; border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--green-bright);
  border-right-color: var(--teal);
  animation: spin 0.9s linear infinite;
}
.scanning-text { color: #fff; font-size: 16px; font-weight: 600; }
.captured-preview { position: absolute; inset: 0; }
.captured-preview img { width: 100%; height: 100%; object-fit: cover; }

.scan-controls {
  display: flex; align-items: center; justify-content: center;
  gap: 28px; padding: 20px 0 8px;
}
.scan-btn-secondary {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 56px; height: 56px;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 50%; font-size: 20px;
  justify-content: center; transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.scan-btn-secondary small { font-size: 9px; color: var(--text3); }
.scan-btn-secondary:hover { background: var(--surface3); }
.scan-btn-main {
  width: 76px; height: 76px; border-radius: 50%;
  position: relative; display: flex; align-items: center; justify-content: center;
  background: none;
}
.capture-ring {
  position: absolute; inset: 0; border-radius: 50%;
  border: 3px solid var(--green);
  box-shadow: var(--shadow-green);
  animation: pulse-ring 2s ease-in-out infinite;
}
.capture-inner {
  width: 58px; height: 58px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green), var(--teal));
  box-shadow: var(--shadow-green);
  transition: var(--transition);
}
.scan-btn-main:active .capture-inner { transform: scale(0.9); }

/* Result Panel */
.result-panel {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg2);
  border-top: 1px solid var(--border2);
  border-radius: 28px 28px 0 0;
  padding: 12px 18px 100px;
  z-index: 200;
  animation: slide-up-panel 0.4s cubic-bezier(0.4,0,0.2,1);
  max-height: 80vh; overflow-y: auto;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.10);
}
.result-drag-handle {
  width: 40px; height: 4px; background: var(--border2);
  border-radius: 2px; margin: 0 auto 16px;
}
.result-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 16px;
}
.result-icon { font-size: 40px; }
.result-title-wrap { flex: 1; }
.result-item-name {
  font-family: var(--font-head); font-size: 20px; font-weight: 800; color: var(--text);
}
.result-category-badge {
  display: inline-block; margin-top: 4px;
  background: var(--green-glow2); color: var(--green);
  border: 1px solid rgba(22,163,74,0.20); font-size: 12px;
  font-weight: 600; padding: 2px 10px; border-radius: var(--radius-full);
}
.result-xp-gain {
  font-family: var(--font-head); font-size: 20px; font-weight: 800;
  color: var(--purple);
  animation: pop-in 0.4s cubic-bezier(0.4,0,0.2,1);
}

/* Result Tabs */
.result-tabs {
  display: flex; gap: 6px; margin-bottom: 14px;
  background: var(--bg3); border-radius: var(--radius);
  padding: 4px;
}
.result-tab {
  flex: 1; padding: 8px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text3);
  transition: var(--transition);
}
.result-tab.active {
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff; box-shadow: var(--shadow-green);
}

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

.material-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg3); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: var(--radius-full);
  font-size: 13px; font-weight: 500; margin: 4px 3px;
}
.material-pct {
  font-size: 11px; color: var(--text3); margin-left: 2px;
}

.recycle-step {
  display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 12px;
}
.recycle-step-num {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--green), var(--teal));
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
}
.recycle-step-text { font-size: 14px; color: var(--text2); line-height: 1.6; padding-top: 2px; }

.facility-search-card {
  margin-top: 16px;
  padding: 14px;
  background: linear-gradient(160deg, #d1fae5 0%, #f2fbf4 100%);
  border: 1px solid rgba(22,163,74,0.16);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.facility-search-title {
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
}
.facility-search-copy {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text2);
}
.facility-search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.facility-search-btn,
.facility-location-btn {
  flex: 1 1 180px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  transition: var(--transition);
}
.facility-search-btn {
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff;
  box-shadow: var(--shadow-green);
}
.facility-search-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px var(--green-glow);
}
.facility-location-btn {
  background: var(--surface2);
  color: var(--text2);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}
.facility-location-btn:hover {
  background: var(--surface3);
}
.facility-search-meta {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text3);
}

.impact-fact {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg3); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 10px;
}
.impact-icon { font-size: 22px; }
.impact-text { font-size: 13px; color: var(--text2); line-height: 1.6; }

.result-actions {
  display: flex; gap: 10px; margin-top: 18px;
}
.result-confirm-btn {
  flex: 1; padding: 14px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: var(--shadow-green); transition: var(--transition);
  font-family: var(--font-head);
}
.result-confirm-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--green-glow); }
.result-discard-btn {
  padding: 14px 20px; border-radius: var(--radius);
  background: var(--bg3); color: var(--text2);
  font-size: 15px; font-weight: 600; transition: var(--transition);
  border: 1px solid var(--border);
}

/* ============================================================
   PROFILE PAGE
   ============================================================ */
.profile-hero {
  padding: 24px 18px 20px;
  background: linear-gradient(160deg, #d1fae5 0%, #f2fbf4 100%);
  display: flex; gap: 18px; align-items: center;
}
.profile-avatar-wrap { position: relative; flex-shrink: 0; cursor: pointer; }
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--surface2); border: 3px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  font-size: 40px; box-shadow: var(--shadow-green);
  overflow: hidden; position: relative;
}
.profile-avatar img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 50%;
}
.profile-avatar-edit {
  position: absolute; inset: 0; border-radius: 50%;
  background: rgba(0,0,0,0.38);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; opacity: 0; transition: var(--transition);
}
.profile-avatar-wrap:hover .profile-avatar-edit { opacity: 1; }
.profile-level-ring {
  position: absolute; bottom: -2px; right: -2px;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #fff; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg2);
  font-family: var(--font-head);
}
.profile-info { flex: 1; }
.profile-name {
  font-family: var(--font-head); font-size: 22px; font-weight: 800; color: var(--text);
}
.profile-handle { font-size: 13px; color: var(--green); font-weight: 500; margin-top: 2px; }
.profile-joined { font-size: 12px; color: var(--text3); margin-top: 6px; }

.stats-grid {
  display: grid; grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 10px; padding: 16px 16px 4px;
}
.stat-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 8px;
  text-align: center; box-shadow: var(--shadow-card);
}
.stat-num {
  display: block; font-family: var(--font-head); font-size: 22px; font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--teal));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-label { display: block; font-size: 10px; color: var(--text3); margin-top: 2px; font-weight: 500; }

/* Featured Trophies section */
.featured-trophies-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 0 16px 8px;
}
.featured-trophy-slot {
  background: var(--surface2); border: 2px dashed var(--border2);
  border-radius: var(--radius); padding: 14px 10px;
  text-align: center; cursor: pointer; transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.featured-trophy-slot.filled {
  border-style: solid; border-color: rgba(217,119,6,0.3);
  background: rgba(245,158,11,0.06);
  box-shadow: var(--shadow-gold);
}
.featured-trophy-slot:hover { border-color: var(--green); transform: translateY(-2px); }
.fts-icon { font-size: 30px; margin-bottom: 5px; }
.fts-name { font-size: 10px; font-weight: 600; color: var(--text3); line-height: 1.3; }
.fts-name.filled-name { color: var(--gold); }
.fts-empty { font-size: 22px; color: var(--text-muted); font-weight: 300; }

/* Trophy Grid */
.trophy-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 0 16px;
}
.trophy-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 10px;
  text-align: center; transition: var(--transition); position: relative;
  box-shadow: var(--shadow-card); cursor: pointer;
}
.trophy-card.unlocked {
  border-color: rgba(217,119,6,0.30);
  background: rgba(245,158,11,0.06);
  box-shadow: var(--shadow-gold);
}
.trophy-card.unlocked:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--gold-glow); }
.trophy-card.featured-active {
  border-color: var(--green); border-width: 2px;
  background: rgba(22,163,74,0.06);
  box-shadow: var(--shadow-green);
}
.trophy-card-icon { font-size: 32px; margin-bottom: 6px; }
.trophy-card.locked .trophy-card-icon { filter: grayscale(1); opacity: 0.22; }
.trophy-card-name {
  font-size: 11px; font-weight: 600; color: var(--text3); line-height: 1.3;
}
.trophy-card.unlocked .trophy-card-name { color: var(--gold); }
.trophy-card.featured-active .trophy-card-name { color: var(--green-dark); }
.trophy-card-desc { font-size: 10px; color: var(--text-muted); margin-top: 3px; line-height: 1.4; }
.trophy-card.unlocked .trophy-card-desc { color: var(--text3); }
.trophy-lock-icon {
  position: absolute; top: 8px; right: 8px;
  font-size: 12px; opacity: 0.25;
}
.trophy-featured-badge {
  position: absolute; top: 6px; left: 6px;
  font-size: 10px; background: var(--green); color: #fff;
  border-radius: var(--radius-full); padding: 1px 6px;
  font-weight: 700; opacity: 0; transition: var(--transition);
}
.trophy-card.featured-active .trophy-featured-badge { opacity: 1; }

/* History list */
.history-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.history-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow-card);
}
.history-icon { font-size: 26px; }
.history-info { flex: 1; }
.history-name { font-size: 14px; font-weight: 600; color: var(--text); }
.history-date { font-size: 11px; color: var(--text3); margin-top: 2px; }
.history-xp {
  font-size: 13px; font-weight: 700; color: var(--purple);
  font-family: var(--font-head);
}
.profile-actions {
  padding: 12px 16px 28px;
}
.profile-logout-btn {
  width: 100%;
  min-height: 52px;
  border-radius: var(--radius-xl);
  background: rgba(220,38,38,0.08);
  border: 1px solid rgba(220,38,38,0.18);
  color: #b91c1c;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 700;
}
.profile-logout-btn[disabled] {
  opacity: 0.7;
}

/* ============================================================
   LEADERBOARD PAGE
   ============================================================ */
.lb-header {
  padding: 20px 18px 16px;
  display: flex; align-items: center; justify-content: space-between;
}
.lb-title {
  font-family: var(--font-head); font-size: 22px; font-weight: 800;
}
.lb-tabs {
  display: flex; gap: 6px;
  background: var(--bg3); border-radius: var(--radius);
  padding: 3px;
}
.lb-tab {
  padding: 6px 14px; border-radius: 10px;
  font-size: 13px; font-weight: 600; color: var(--text3);
  transition: var(--transition);
}
.lb-tab.active {
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff;
}

/* Podium */
.lb-podium {
  display: flex; align-items: flex-end; justify-content: center;
  gap: 8px; padding: 24px 18px 16px;
  background: linear-gradient(160deg, #d1fae5 0%, #f2fbf4 80%);
}
.podium-slot {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.podium-rank-label {
  font-family: var(--font-head); font-size: 22px; font-weight: 900;
}
.podium-avatar-wrap { position: relative; }
.podium-avatar {
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  border: 3px solid transparent; font-size: 28px;
  background: var(--surface2);
}
.podium-slot:nth-child(2) .podium-avatar { /* 1st */
  width: 70px; height: 70px;
  border-color: var(--gold);
  box-shadow: var(--shadow-gold);
}
.podium-slot:nth-child(1) .podium-avatar { /* 2nd */
  width: 58px; height: 58px;
  border-color: #9ca3af;
}
.podium-slot:nth-child(3) .podium-avatar { /* 3rd */
  width: 52px; height: 52px;
  border-color: #b45309;
}
.podium-name { font-size: 12px; font-weight: 600; color: var(--text2); text-align: center; max-width: 70px; }
.podium-xp { font-size: 11px; color: var(--text3); }
.podium-plinth {
  border-radius: 6px 6px 0 0;
  width: 60px;
  background: var(--surface2); border: 1px solid var(--border);
}
.podium-slot:nth-child(2) .podium-plinth { height: 60px; background: rgba(245,158,11,0.10); border-color: rgba(217,119,6,0.25); }
.podium-slot:nth-child(1) .podium-plinth { height: 42px; background: rgba(156,163,175,0.10); border-color: rgba(156,163,175,0.25); }
.podium-slot:nth-child(3) .podium-plinth { height: 30px; background: rgba(180,87,9,0.08); border-color: rgba(180,87,9,0.2); }

/* LB list */
.lb-list { padding: 0 16px; display: flex; flex-direction: column; gap: 8px; }
.lb-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px;
  transition: var(--transition); box-shadow: var(--shadow-card);
}
.lb-card.me { border-color: rgba(22,163,74,0.3); background: rgba(22,163,74,0.05); }
.lb-rank {
  width: 28px; text-align: center;
  font-family: var(--font-head); font-size: 15px; font-weight: 800;
  color: var(--text2);
}
.lb-avatar { font-size: 28px; }
.lb-info { flex: 1; }
.lb-name { font-size: 14px; font-weight: 600; color: var(--text); }
.lb-sub { font-size: 12px; color: var(--text3); }
.lb-score {
  font-family: var(--font-head); font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, var(--green), var(--teal));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   FRIENDS PAGE
   ============================================================ */
.friends-header {
  padding: 20px 18px 16px;
}
.friends-title {
  font-family: var(--font-head); font-size: 22px; font-weight: 800; margin-bottom: 12px;
}
.add-friend-wrap { display: flex; gap: 8px; }
.add-friend-input {
  flex: 1; background: var(--surface2); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px;
  font-size: 14px; color: var(--text); outline: none; transition: var(--transition);
  box-shadow: var(--shadow-card);
}
.add-friend-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-glow2); }
.add-friend-btn {
  padding: 10px 20px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff; font-size: 14px; font-weight: 700;
  transition: var(--transition);
}
.add-friend-btn:hover { opacity: 0.9; }

.friends-activity { padding: 0 0 8px; }
.activity-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  transition: var(--transition);
}
.activity-avatar { font-size: 24px; }
.activity-text { font-size: 13px; color: var(--text2); flex: 1; line-height: 1.5; }
.activity-text strong { color: var(--text); }
.activity-time { font-size: 11px; color: var(--text3); }

.friends-list-wrap { padding: 8px 0; }
.friend-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; cursor: pointer;
  transition: var(--transition); border-bottom: 1px solid var(--border);
}
.friend-item:hover { background: var(--bg3); }
.friend-avatar { font-size: 32px; }
.friend-info { flex: 1; }
.friend-name { font-size: 15px; font-weight: 600; color: var(--text); }
.friend-sub { font-size: 12px; color: var(--text3); margin-top: 2px; }
.friend-level {
  background: var(--green-glow2); color: var(--green-dark);
  font-size: 12px; font-weight: 700; padding: 4px 10px;
  border-radius: var(--radius-full); font-family: var(--font-head);
  border: 1px solid rgba(22,163,74,0.15);
}
.friend-chevron { color: var(--text3); font-size: 18px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px); z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fade-in 0.2s ease;
}

/* Trophy Modal */
.trophy-modal-card {
  background: var(--bg2);
  border: 1px solid rgba(217,119,6,0.25);
  border-radius: var(--radius-xl);
  padding: 36px 28px;
  text-align: center; width: 100%; max-width: 320px;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-gold), 0 0 60px rgba(245,158,11,0.12);
  animation: pop-in 0.4s cubic-bezier(0.4,0,0.2,1);
}
.trophy-modal-icon { font-size: 72px; animation: trophy-bounce 0.6s ease 0.2s both; }
.trophy-modal-label {
  font-size: 13px; font-weight: 600; color: var(--gold);
  text-transform: uppercase; letter-spacing: 2px;
  margin: 12px 0 6px;
}
.trophy-modal-name {
  font-family: var(--font-head); font-size: 24px; font-weight: 800;
  color: var(--text); margin-bottom: 8px;
}
.trophy-modal-desc { font-size: 14px; color: var(--text2); line-height: 1.6; margin-bottom: 24px; }
.trophy-modal-close {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  color: #fff; font-size: 16px; font-weight: 800;
  border-radius: var(--radius); font-family: var(--font-head);
  box-shadow: var(--shadow-gold); transition: var(--transition);
}
.trophy-modal-close:hover { transform: translateY(-2px); }

/* Confetti */
.trophy-confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti-piece {
  position: absolute; width: 8px; height: 8px; border-radius: 2px;
  animation: confetti-fall 1.2s ease-out forwards;
}

/* Level Up Modal */
.levelup-modal-card {
  background: var(--bg2); border: 1px solid rgba(124,58,237,0.25);
  border-radius: var(--radius-xl); padding: 36px 28px;
  text-align: center; width: 100%; max-width: 320px;
  position: relative; overflow: hidden;
  box-shadow: 0 0 60px var(--purple-glow);
  animation: pop-in 0.4s cubic-bezier(0.4,0,0.2,1);
}
.levelup-rays {
  position: absolute; inset: 0;
  background: conic-gradient(
    from 0deg, transparent 0%, rgba(124,58,237,0.05) 10%,
    transparent 20%, rgba(124,58,237,0.03) 30%,
    transparent 40%, rgba(124,58,237,0.05) 50%,
    transparent 60%, rgba(124,58,237,0.03) 70%,
    transparent 80%, rgba(124,58,237,0.05) 90%, transparent 100%
  );
  animation: spin 10s linear infinite;
}
.levelup-emoji { font-size: 64px; position: relative; }
.levelup-label {
  font-size: 13px; font-weight: 600; color: var(--purple);
  text-transform: uppercase; letter-spacing: 2px; margin: 12px 0 4px;
  position: relative;
}
.levelup-num {
  font-family: var(--font-head); font-size: 40px; font-weight: 900;
  background: linear-gradient(135deg, var(--purple), #a855f7);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}
.levelup-title {
  font-size: 16px; color: var(--text2); margin-bottom: 24px; position: relative;
}
.levelup-close {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--purple), #a855f7);
  color: #fff; font-size: 16px; font-weight: 800;
  border-radius: var(--radius); font-family: var(--font-head);
  transition: var(--transition); position: relative;
  box-shadow: 0 4px 20px var(--purple-glow);
}
.levelup-close:hover { transform: translateY(-2px); }

/* Friend Modal */
.friend-modal-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-xl); padding: 28px;
  text-align: center; width: 100%; max-width: 320px;
  position: relative;
  animation: pop-in 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow);
}
.friend-modal-close-x {
  position: absolute; top: 14px; right: 16px;
  color: var(--text3); font-size: 18px;
}
.friend-modal-avatar {
  font-size: 64px; margin: 0 auto 12px;
  width: 90px; height: 90px; border-radius: 50%;
  background: var(--bg3); display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--green); overflow: hidden;
}
.friend-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.friend-modal-name {
  font-family: var(--font-head); font-size: 22px; font-weight: 800; color: var(--text);
}
.friend-modal-handle { font-size: 13px; color: var(--green); margin-top: 3px; }
.friend-modal-stats {
  display: flex; gap: 0; margin: 18px 0;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.fms {
  flex: 1; padding: 12px 8px; text-align: center;
  border-right: 1px solid var(--border);
}
.fms:last-child { border-right: none; }
.fms-num {
  display: block; font-family: var(--font-head); font-size: 20px; font-weight: 800;
  background: linear-gradient(135deg, var(--green), var(--teal));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.fms-label { display: block; font-size: 11px; color: var(--text3); margin-top: 2px; }
.friend-modal-trophies {
  display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-bottom: 18px;
}
.fmtrophy { font-size: 22px; }
.friend-modal-remove {
  width: 100%; padding: 12px;
  background: rgba(220,38,38,0.07); border: 1px solid rgba(220,38,38,0.18);
  color: var(--red); border-radius: var(--radius);
  font-size: 14px; font-weight: 600; transition: var(--transition);
}
.friend-modal-remove:hover { background: rgba(220,38,38,0.14); }

/* XP Toast */
.xp-toast {
  position: fixed; top: 70px; right: 16px; z-index: 600;
  background: linear-gradient(135deg, var(--purple), #a855f7);
  color: #fff; font-family: var(--font-head);
  font-size: 18px; font-weight: 800;
  padding: 8px 18px; border-radius: var(--radius-full);
  box-shadow: 0 4px 20px var(--purple-glow);
  animation: toast-fly 2s ease-out forwards;
}

/* Trophy picker modal */
.trophy-picker-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: var(--radius-xl); padding: 24px 20px;
  width: 100%; max-width: 380px;
  position: relative;
  animation: pop-in 0.3s cubic-bezier(0.4,0,0.2,1);
  box-shadow: var(--shadow);
  max-height: 88vh; overflow-y: auto;
}
.trophy-picker-card::-webkit-scrollbar { display: none; }
.trophy-picker-title {
  font-family: var(--font-head); font-size: 18px; font-weight: 800;
  color: var(--text); margin-bottom: 4px;
}
.trophy-picker-sub { font-size: 13px; color: var(--text3); margin-bottom: 16px; }
.trophy-picker-close-x {
  position: absolute; top: 14px; right: 16px;
  color: var(--text3); font-size: 18px;
}
.trophy-picker-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 8px; margin-bottom: 16px;
}
.tp-item {
  background: var(--bg3); border: 2px solid var(--border);
  border-radius: var(--radius); padding: 12px 8px;
  text-align: center; cursor: pointer; transition: var(--transition);
  position: relative;
}
.tp-item.tp-selected {
  border-color: var(--green); background: rgba(22,163,74,0.07);
  box-shadow: var(--shadow-green);
}
.tp-item.tp-locked { opacity: 0.4; cursor: not-allowed; }
.tp-item-icon { font-size: 28px; margin-bottom: 4px; }
.tp-item.tp-locked .tp-item-icon { filter: grayscale(1); }
.tp-item-name { font-size: 10px; font-weight: 600; color: var(--text3); }
.tp-item.tp-selected .tp-item-name { color: var(--green-dark); }
.tp-check {
  position: absolute; top: 5px; right: 5px;
  font-size: 12px; opacity: 0; transition: var(--transition);
}
.tp-item.tp-selected .tp-check { opacity: 1; }
.trophy-picker-save {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--green), var(--teal));
  color: #fff; font-size: 15px; font-weight: 700;
  border-radius: var(--radius); font-family: var(--font-head);
  box-shadow: var(--shadow-green); transition: var(--transition);
}
.trophy-picker-save:hover { transform: translateY(-2px); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes splash-in {
  from { opacity: 0; transform: scale(0.8) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes splash-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(1.05); pointer-events: none; visibility: hidden; }
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slide-up-panel {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0%   { opacity: 0.5; }
  50%  { opacity: 1; }
  100% { opacity: 0.5; }
}
@keyframes scan-sweep {
  0%   { top: 0; opacity: 1; }
  90%  { top: calc(100% - 2px); opacity: 1; }
  100% { top: calc(100% - 2px); opacity: 0; }
}
@keyframes pulse-ring {
  0%,100% { box-shadow: 0 0 0 0 var(--green-glow); }
  50%      { box-shadow: 0 0 0 12px transparent; }
}
@keyframes pop-in {
  0%   { opacity: 0; transform: scale(0.7); }
  70%  { transform: scale(1.05); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes trophy-bounce {
  0%   { transform: scale(0) rotate(-10deg); }
  60%  { transform: scale(1.2) rotate(5deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes confetti-fall {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(200px) rotate(360deg); opacity: 0; }
}
@keyframes toast-fly {
  0%   { opacity: 0; transform: translateX(40px); }
  15%  { opacity: 1; transform: translateX(0); }
  75%  { opacity: 1; transform: translateX(0); }
  100% { opacity: 0; transform: translateX(40px); }
}

/* ============================================================
   RESPONSIVE TWEAKS
   ============================================================ */
@media (min-width: 430px) {
  .stats-grid { grid-template-columns: 1fr 1fr 1fr 1fr; }
}
@media (max-width: 360px) {
  .trophy-grid { grid-template-columns: repeat(3, 1fr); }
  .featured-trophies-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: 1fr 1fr; }
}
