/* ── Badge toast ── */
.badge-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #14532d;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: var(--z-toast, 6000);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
}
.badge-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Page layout ── */
.profile-body {
  overflow-y: auto;
  overflow-x: hidden;
  background: #f0f4ec;
  min-height: 100vh;
}

.profile-body .logo {
  text-decoration: none;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: #a3e635;
}

.profile-main {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 20px 60px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  overflow-x: hidden;
}

/* ── Hero section ── */
/* Colonne centrée par défaut (mobile). Ligne sur desktop via min-width */
.profile-hero {
  background: linear-gradient(135deg, #1e4d14 0%, #2d6b1f 100%);
  border-radius: 20px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  box-shadow: 0 8px 32px rgba(30,77,20,0.25);
  position: relative;
  overflow: hidden;
}

@media (min-width: 769px) {
  .profile-hero {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    text-align: left;
    padding: 48px;
    min-height: 220px;
    gap: 32px;
  }
}

.profile-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.04'%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");
  pointer-events: none;
}

.avatar-ring {
  width: 130px;
  height: 130px;
  border-radius: 50%;
  border: 4px solid #a3e635;
  padding: 4px;
  flex-shrink: 0;
  transition: border-color 0.3s;
}

.avatar-big {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: 1px;
  transition: background 0.3s, color 0.3s;
}

.hero-info {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

@media (min-width: 769px) {
  .hero-info { flex: 1; align-items: flex-start; min-width: 160px; width: auto; }
}

.hero-name {
  font-size: 1.6rem;
  font-weight: 900;
  color: white;
  margin: 0;
  word-break: break-word;
  overflow-wrap: break-word;
  max-width: 100%;
}

@media (min-width: 769px) {
  .hero-name { font-size: 2.2rem; }
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  width: fit-content;
}
.role-badge.role-admin { background: #a3e635; color: #1e4d14; }
.role-badge.role-free  { background: rgba(255,255,255,0.15); color: #bbf7d0; }

.hero-since {
  color: rgba(255,255,255,0.55);
  font-size: 0.82rem;
  margin: 0;
}

.color-picker-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
}

@media (min-width: 769px) {
  .color-picker-row { margin-left: auto; align-items: flex-start; width: auto; }
}

.color-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: rgba(255,255,255,0.55);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.color-swatches {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 200px;
}

.swatch {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.swatch:hover { transform: scale(1.15); }
.swatch.active { border-color: white; transform: scale(1.15); }

/* ── Grid of cards ── */
.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  min-width: 0;
}

/* ── Card ── */
.profile-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.07);
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-width: 0;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f3f4f6;
}

.card-icon { font-size: 1.3rem; }

.card-title {
  font-size: 1rem;
  font-weight: 800;
  color: #1a2e12;
  margin: 0;
}

/* ── Profile forms ── */
.profile-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-hint {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 2px;
}

.field-hint--address {
  display: block;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 8px 10px;
  color: #166534;
  font-size: 0.78rem;
  line-height: 1.45;
  margin-top: 6px;
}

.field-why {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #e5e7eb;
  color: #6b7280;
  font-size: 0.65rem;
  font-weight: 700;
  cursor: default;
  margin-left: 4px;
  vertical-align: middle;
}

.btn-save {
  padding: 12px;
  background: #1e4d14;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  margin-top: 4px;
}
.btn-save:hover:not(:disabled) { background: #2d6b1f; transform: translateY(-1px); }
.btn-save:disabled { background: #9ca3af; cursor: not-allowed; transform: none; }

/* ── Stats card ── */
.card-stats { grid-column: 1 / -1; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.stat-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: #f8faf5;
  border: 1px solid #e2e8da;
  border-radius: 12px;
  padding: 20px 12px;
}

.stat-num {
  font-size: 2rem;
  font-weight: 900;
  color: #1e4d14;
  line-height: 1;
}

.stat-lbl {
  font-size: 0.78rem;
  color: #6b7280;
  font-weight: 600;
  text-align: center;
}

/* ── Account card ── */
.account-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-action {
  display: block;
  width: 100%;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  border: none;
  transition: all 0.15s;
}

.btn-map    { background: #f0f7ec; color: #1e4d14; }
.btn-map:hover { background: #dcfce7; }
.btn-routes { background: #eff6ff; color: #1d4ed8; }
.btn-routes:hover { background: #dbeafe; }
.btn-logout { background: #f3f4f6; color: #374151; }
.btn-logout:hover { background: #e5e7eb; }
.btn-export { background: #eef2ff; color: #3730a3; }
.btn-export:hover { background: #e0e7ff; }
.btn-delete { background: #fee2e2; color: #991b1b; margin-top: 6px; }
.btn-delete:hover { background: #fecaca; }

.account-gdpr-note {
  margin-top: 14px;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-muted, #6b7280);
}
.account-gdpr-note a { color: inherit; text-decoration: underline; }

/* ── Delete confirmation modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-overlay.hidden { display: none; }

.modal-box {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 24px 64px rgba(0,0,0,0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: #991b1b;
  margin: 0;
}

.modal-body {
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.6;
  margin: 0;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.btn-modal-cancel {
  flex: 1;
  padding: 11px;
  background: #f3f4f6;
  color: #374151;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.btn-modal-cancel:hover { background: #e5e7eb; }

.btn-modal-confirm {
  flex: 1;
  padding: 11px;
  background: #dc2626;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.btn-modal-confirm:hover { background: #b91c1c; }

/* ── Mobile ── */
@media (max-width: 640px) {
  .profile-grid { grid-template-columns: 1fr; }
  .card-stats { grid-column: 1; }
  .card-progress { grid-column: 1; }
  .stats-grid { grid-template-columns: 1fr 1fr 1fr; }
  .stat-num { font-size: 1.5rem; }
}

@media (max-width: 768px) {
  .color-swatches { justify-content: center; max-width: 100%; }
}

/* ── Card: Plan & Progression ── */
.card-progress { grid-column: span 2; }

.plan-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.plan-pill {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
}
.plan-pill.plan-free   { background: #ecfdf5; color: #166534; }
.plan-pill.plan-silver { background: #e5e7eb; color: #374151; }
.plan-pill.plan-gold   { background: #fef3c7; color: #92400e; }

.plan-upgrade-link {
  color: #1e4d14;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}
.plan-upgrade-link:hover { text-decoration: underline; }

.level-block {
  margin-bottom: 22px;
  padding: 16px;
  background: #f9fafb;
  border-radius: 12px;
}
.level-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
.level-num { font-weight: 800; color: #1e4d14; }
.level-xp  { color: #6b7280; font-weight: 600; }
.xp-bar {
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, #84cc16, #1e4d14);
  transition: width 0.4s;
  border-radius: 999px;
}

.badges-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #374151;
  margin-bottom: 12px;
}
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.15s, box-shadow 0.15s;
}
.badge-item.earned {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b;
  box-shadow: 0 2px 8px rgba(245,158,11,0.15);
}
.badge-item.locked { opacity: 0.4; filter: grayscale(0.6); }
.badge-icon { font-size: 1.6rem; line-height: 1; }
.badge-label { font-size: 0.7rem; font-weight: 600; color: #374151; }
.badge-desc {
  display: none;
  font-size: 0.65rem;
  color: #6b7280;
  line-height: 1.3;
  margin-top: 2px;
}
.badge-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.1); cursor: default; }
.badge-item:hover .badge-desc { display: block; }
.badge-date {
  font-size: 0.6rem;
  color: #6b7280;
  margin-top: 3px;
  font-style: italic;
}

@media (max-width: 760px) {
  .card-progress { grid-column: 1; }
  .card-silvergold { grid-column: 1 !important; }
  .card-gold-only { grid-column: 1 !important; }
  .card-premium { grid-column: 1 !important; }
}

@media (max-width: 768px) {
  .profile-main {
    padding-top: 16px;
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 380px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  /* On very narrow phones the weather column is too tight for the nowrap
     "suitability" pill — let the row wrap and the pill text reflow. */
  .weather-current { flex-wrap: wrap; }
  .weather-suit { white-space: normal; }
}

/* ── Animated avatar rings by plan ── */
.avatar-ring.ring-silver {
  position: relative;
  border-width: 4px !important;
  box-shadow: 0 0 0 2px #c0c0c0, 0 0 20px rgba(192,192,192,0.5);
}
.avatar-ring.ring-gold {
  position: relative;
  border-width: 4px !important;
  background: linear-gradient(135deg, #fef3c7, #fde68a, #f59e0b);
  box-shadow: 0 0 0 3px #fbbf24, 0 0 30px rgba(251,191,36,0.6);
  animation: ring-pulse 2.5s ease-in-out infinite;
}
@keyframes ring-pulse {
  0%, 100% { box-shadow: 0 0 0 3px #fbbf24, 0 0 30px rgba(251,191,36,0.6); }
  50%      { box-shadow: 0 0 0 3px #f59e0b, 0 0 45px rgba(245,158,11,0.85); }
}

/* ── Locked badges by tier ── */
.badge-item.tier-silver.earned { background: linear-gradient(135deg, #f3f4f6, #d1d5db); border-color: #6b7280; }
.badge-item.tier-gold.earned   { background: linear-gradient(135deg, #fef3c7, #fde68a); border-color: #f59e0b; box-shadow: 0 4px 12px rgba(245,158,11,0.25); animation: badge-gold-glow 2.5s ease-in-out infinite; }

@keyframes badge-gold-glow {
  0%, 100% { box-shadow: 0 4px 12px rgba(245,158,11,0.25); }
  50%      { box-shadow: 0 6px 22px rgba(245,158,11,0.55); }
}

/* Exclusive wheel badge — stronger shimmer */
.badge-item.badge-exclusive.earned {
  background: linear-gradient(135deg, #fef9c3, #fde68a, #fbbf24);
  border-color: #d97706;
  animation: badge-exclusive-shine 1.8s ease-in-out infinite;
}
@keyframes badge-exclusive-shine {
  0%, 100% { box-shadow: 0 4px 16px rgba(245,158,11,0.35); filter: brightness(1); }
  50%      { box-shadow: 0 6px 30px rgba(245,158,11,0.75); filter: brightness(1.08); }
}

.badges-locked-hint {
  margin-top: 12px;
  padding: 10px 14px;
  background: #f9fafb;
  border-radius: 10px;
  font-size: 0.82rem;
  color: #6b7280;
  text-align: center;
}
.badges-locked-hint a { color: #1e4d14; font-weight: 700; text-decoration: none; }
.badges-locked-hint a:hover { text-decoration: underline; }

/* ── Premium feature cards ── */
.card-silvergold {
  grid-column: span 2;
  background: linear-gradient(135deg, #ffffff, #f9fafb);
  border: 1.5px solid #d1d5db;
}
.card-gold-only {
  grid-column: span 2;
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border: 1.5px solid #f59e0b;
}
.card-premium {
  grid-column: span 2;
  background: linear-gradient(135deg, #fffbeb, #f0fdf4);
  border: 1.5px solid #d1fae5;
}

.feature-block {
  padding: 16px;
  background: white;
  border-radius: 12px;
  margin-bottom: 14px;
  border: 1px solid #e5e7eb;
}
.feature-block:last-child { margin-bottom: 0; }

.feature-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e4d14;
  margin-bottom: 10px;
}

/* ── Canvas roulette wheel ──────────────────────────────────────────────────── */
.wheel-container {
  display: flex;
  justify-content: center;
  margin: 4px 0 14px;
}
.wheel-pointer-wrap {
  position: relative;
  display: inline-block;
}
/* Downward-pointing triangle fixed at top-centre of the wheel */
.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid #14532d;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.35));
}
#wheelCanvas {
  display: block;
  border-radius: 50%;
  box-shadow: 0 6px 28px rgba(0,0,0,0.18);
}
.wheel-result {
  font-size: 0.92rem;
  color: #1a2e12;
  text-align: center;
  padding: 10px 12px;
  background: #f0fdf4;
  border-radius: 10px;
  margin-bottom: 10px;
  min-height: 42px;
}
.wheel-text { font-size: 0.9rem; color: #1a2e12; }

/* Prize list */
.wheel-prizes-list { margin-top: 14px; }
.prizes-title { font-size: 0.78rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; }
.prizes-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.prize-chip {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 20px;
  background: #f3f4f6; border: 1px solid #e5e7eb;
  font-size: 0.8rem; color: #374151;
}
.prize-chip.prize-rare {
  background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8;
}
.prize-chip.prize-epic {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border-color: #f59e0b; color: #92400e; font-weight: 700;
}
.prize-icon { font-size: 1rem; }
.prize-label { font-size: 0.8rem; }
.prize-rarity { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; margin-left: 2px; }

.weather-card {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.weather-current {
  display: flex;
  align-items: center;
  gap: 14px;
}
.weather-icon { font-size: 3rem; flex-shrink: 0; }
.weather-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.weather-main strong { font-size: 1.6rem; color: #1e3a8a; line-height: 1; }
.weather-main span:first-of-type { font-size: 0.9rem; color: #1e40af; font-weight: 600; }
.weather-main span:last-of-type { font-size: 0.78rem; color: #64748b; }
.weather-suit {
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  flex-shrink: 0;
}
.weather-suit--great  { background: #dcfce7; color: #15803d; }
.weather-suit--ok     { background: #fef9c3; color: #a16207; }
.weather-suit--bad    { background: #fee2e2; color: #dc2626; }
.weather-details {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.weather-details span {
  background: rgba(255,255,255,0.7);
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.78rem;
  color: #1e40af;
}
.weather-forecast {
  display: flex;
  gap: 8px;
}
.weather-day {
  flex: 1;
  background: rgba(255,255,255,0.65);
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 8px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.weather-day-name { font-size: 0.7rem; font-weight: 700; color: #1e40af; text-transform: uppercase; }
.weather-day-icon { font-size: 1.4rem; }
.weather-day-temps { font-size: 0.72rem; color: #374151; text-align: center; }
.weather-day-temps b { color: #1e3a8a; }
.weather-day-rain { font-size: 0.68rem; color: #2563eb; }

.btn-discord {
  display: inline-block;
  background: linear-gradient(135deg, #5865f2, #7289da);
  color: white;
  text-decoration: none;
  padding: 11px 22px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.15s;
}
.btn-discord:hover { transform: translateY(-2px); }

/* ── btn-save variants ── */
.btn-save--compact {
  width: auto;
  padding: 10px 18px;
}
.btn-save--inline {
  display: inline-block;
  text-decoration: none;
  font-size: var(--fs-xs);
  padding: 9px 18px;
}
.btn-save--small {
  display: inline-block;
  font-size: var(--fs-xs);
  text-decoration: none;
  padding: 7px 14px;
}

/* ── Goal input row ── */
.goal-input-row {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.goal-input-row .input-field { flex: 1; }


/* ── Feature descriptive text ── */
.feature-desc {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin-bottom: 10px;
}
.feature-desc--mt { margin-top: 6px; }

/* ── Push alerts setup panel ── */
.push-status {
  font-size: var(--fs-xs);
  margin-bottom: var(--space-2);
}
.push-setup-box {
  background: #f8fafc;
  border-radius: var(--radius-xs);
  padding: var(--space-3);
  margin-bottom: 10px;
}
.push-setup-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 6px;
}
.ntfy-channel {
  display: block;
  background: var(--silver-200);
  border-radius: var(--radius-xs);
  padding: 8px 10px;
  font-size: 0.85rem;
  color: #1e293b;
  word-break: break-all;
  font-family: var(--font-mono);
}
.push-setup-instructions {
  font-size: var(--fs-xs);
  color: var(--text-muted);
  margin: var(--space-3) 0 6px;
}

/* ── Dark mode (toggled via [data-theme="dark"] on <html>) ── */
[data-theme="dark"] .profile-body                { background: #0e1a11; }

[data-theme="dark"] .profile-card                { background: #16201a; box-shadow: 0 2px 12px rgba(0,0,0,0.4); }
[data-theme="dark"] .card-header                 { border-bottom-color: #2a3a30; }
[data-theme="dark"] .card-title                  { color: #d4edbc; }

[data-theme="dark"] .stat-block                  { background: #1c2a20; border-color: #2a3a30; }
[data-theme="dark"] .stat-num                    { color: #a3e635; }
[data-theme="dark"] .stat-lbl                    { color: #8fa887; }

[data-theme="dark"] .level-block                 { background: #1c2a20; }
[data-theme="dark"] .level-num                   { color: #a3e635; }
[data-theme="dark"] .level-xp                    { color: #8fa887; }
[data-theme="dark"] .xp-bar                      { background: #2a3a30; }

[data-theme="dark"] .badges-title                { color: #c8dcc0; }
[data-theme="dark"] .badge-item                  { background: #1c2a20; border-color: #2a3a30; }
[data-theme="dark"] .badge-item.earned           { background: linear-gradient(135deg, #3a2600, #512f00); }
[data-theme="dark"] .badge-item.tier-silver.earned { background: linear-gradient(135deg, #1e2a24, #2d3f38); border-color: #475569; }
[data-theme="dark"] .badge-label                 { color: #c8dcc0; }
[data-theme="dark"] .badge-desc                  { color: #8fa887; }
[data-theme="dark"] .badge-date                  { color: var(--text-faint); }
[data-theme="dark"] .badges-locked-hint          { background: #1c2a20; color: #8fa887; }
[data-theme="dark"] .badges-locked-hint a        { color: #a3e635; }

[data-theme="dark"] .plan-pill.plan-free         { background: #1c3020; color: #a3e635; }
[data-theme="dark"] .plan-pill.plan-silver       { background: #2a3a30; color: #c8dcc0; }
[data-theme="dark"] .plan-pill.plan-gold         { background: #3d2a00; color: #fcd34d; }
[data-theme="dark"] .plan-upgrade-link           { color: #a3e635; }

[data-theme="dark"] .card-silvergold             { background: linear-gradient(135deg, #16201a, #1c2a20); border-color: #2a3a30; }
[data-theme="dark"] .card-gold-only              { background: linear-gradient(135deg, #2a1f00, #3d2a00); border-color: #b45309; }
[data-theme="dark"] .card-premium                { background: linear-gradient(135deg, #1a2a00, #162018); border-color: #2d5c30; }

[data-theme="dark"] .feature-block               { background: #1c2a20; border-color: #2a3a30; }
[data-theme="dark"] .feature-title               { color: #d4edbc; }

[data-theme="dark"] .field-hint                  { color: #8fa887; }
[data-theme="dark"] .field-hint--address         { background: #1a2e1c; border-color: #2d5c30; color: #a8d4a0; }
[data-theme="dark"] .field-why                   { background: #2a3a30; color: #8fa887; }

[data-theme="dark"] .btn-save                    { background: #2d6b1f; }
[data-theme="dark"] .btn-save:hover:not(:disabled) { background: #3a8428; }
[data-theme="dark"] .btn-save:disabled           { background: #334d3b; }

[data-theme="dark"] .btn-map                     { background: #1c3020; color: #a3e635; }
[data-theme="dark"] .btn-map:hover               { background: #233828; }
[data-theme="dark"] .btn-routes                  { background: #1a2240; color: #93c5fd; }
[data-theme="dark"] .btn-routes:hover            { background: #1e2a50; }
[data-theme="dark"] .btn-logout                  { background: #2a3a30; color: #c8dcc0; }
[data-theme="dark"] .btn-logout:hover            { background: #334d3b; }
[data-theme="dark"] .btn-export                  { background: #1e2440; color: #c7d2fe; }
[data-theme="dark"] .btn-export:hover            { background: #28305a; }
[data-theme="dark"] .btn-delete                  { background: #3d1515; color: #fca5a5; }
[data-theme="dark"] .btn-delete:hover            { background: #4d1a1a; }

[data-theme="dark"] .modal-box                   { background: #16201a; }
[data-theme="dark"] .modal-body                  { color: #c8dcc0; }
[data-theme="dark"] .btn-modal-cancel            { background: #2a3a30; color: #c8dcc0; }
[data-theme="dark"] .btn-modal-cancel:hover      { background: #334d3b; }

[data-theme="dark"] .wheel-result                { background: #1c3020; color: #d4edbc; }
[data-theme="dark"] .wheel-text                  { color: #d4edbc; }
[data-theme="dark"] .wheel-pointer               { border-top-color: #a3e635; }
[data-theme="dark"] .prize-chip                  { background: #2a3a30; border-color: #334d3b; color: #c8dcc0; }
[data-theme="dark"] .prize-chip.prize-rare       { background: #1a2240; border-color: #3b5bdb; color: #93c5fd; }
[data-theme="dark"] .prizes-title                { color: #8fa887; }

[data-theme="dark"] .weather-card                { background: linear-gradient(135deg, #101d36 0%, #152040 100%); }
[data-theme="dark"] .weather-main strong         { color: #93c5fd; }
[data-theme="dark"] .weather-main span:first-of-type { color: #60a5fa; }
[data-theme="dark"] .weather-main span:last-of-type  { color: #8fa8c8; }
[data-theme="dark"] .weather-details span        { background: rgba(30,42,80,0.6); border-color: #334d8b; color: #60a5fa; }
[data-theme="dark"] .weather-day                 { background: rgba(20,34,70,0.7); border-color: #334d8b; }
[data-theme="dark"] .weather-day-name            { color: #60a5fa; }
[data-theme="dark"] .weather-day-temps           { color: #c8d8f0; }
[data-theme="dark"] .weather-day-temps b         { color: #93c5fd; }
[data-theme="dark"] .weather-day-rain            { color: #60a5fa; }
[data-theme="dark"] .weather-suit--great         { background: #1a3020; color: #4ade80; }
[data-theme="dark"] .weather-suit--ok            { background: #3d2a00; color: #fcd34d; }
[data-theme="dark"] .weather-suit--bad           { background: #3d1515; color: #fca5a5; }

[data-theme="dark"] .push-setup-box              { background: #1c2a20; }
[data-theme="dark"] .push-setup-label            { color: #c8dcc0; }
[data-theme="dark"] .ntfy-channel                { background: #2a3a30; color: #c8dcc0; }

/* ═══════════════════════════════════════════════════════════════════════════
   Engagement gadgets: streak banner, activity heatmap, records,
   monthly challenge, recent routes, trail health
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Streak banner ── */
.streak-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff7ed, #ffedd5);
  border: 1.5px solid #fdba74;
  color: #9a3412;
  font-size: 0.92rem;
  line-height: 1.35;
}
.streak-banner strong { color: #c2410c; }
.streak-flame {
  font-size: 1.5rem;
  flex-shrink: 0;
  animation: streak-pulse 1.8s ease-in-out infinite;
}
@keyframes streak-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.18); }
}

/* ── Activity card (full width) ── */
.card-activity { grid-column: span 2; }

.heat-wrap {
  overflow-x: auto;
  padding-bottom: 6px;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  min-width: 0;
}
.heat-grid {
  display: flex;
  gap: 3px;
  min-width: min-content;
}
.heat-col {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.heat-cell {
  width: 11px;
  height: 11px;
  border-radius: 2px;
  background: #ebedf0;
  display: inline-block;
}
.heat-l0 { background: #ebedf0; }
.heat-l1 { background: #c6e8b9; }
.heat-l2 { background: #7bc96f; }
.heat-l3 { background: #45a045; }
.heat-l4 { background: #1e4d14; }
.heat-future { background: transparent; }

.heat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 0.75rem;
  color: #6b7280;
}
.heat-legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.heat-legend .heat-cell { margin: 0 1px; }
.heat-empty {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #6b7280;
  font-style: italic;
}

/* ── Personal records ── */
.records-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}
.record-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 12px 8px;
  background: #f8faf5;
  border-radius: 12px;
  text-align: center;
}
.record-icon { font-size: 1.3rem; }
.record-num  { font-size: 1.15rem; font-weight: 700; color: #1e4d14; }
.record-lbl  { font-size: 0.72rem; color: #6b7280; }

/* ── Monthly challenge ── */
.challenge-block { margin: 18px 0 4px; }
.challenge-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e4d14;
  margin: 0 0 10px;
}
.challenge-card {
  padding: 14px;
  border-radius: 14px;
  background: #f8faf5;
  border: 1.5px solid #e5edda;
}
.challenge-card.is-done {
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-color: #86efac;
}
.challenge-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.challenge-emoji { font-size: 1.7rem; flex-shrink: 0; }
.challenge-info  { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.challenge-name  { font-size: 0.92rem; color: #1e293b; }
.challenge-target { font-size: 0.76rem; color: #6b7280; }
.challenge-medal {
  flex-shrink: 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: #15803d;
  background: #bbf7d0;
  padding: 3px 9px;
  border-radius: 999px;
}
.challenge-prog {
  margin: 8px 0 0;
  font-size: 0.78rem;
  color: #6b7280;
}

/* ── Recent saved routes (full width) ── */
.card-recent-routes { grid-column: span 2; }
.card-header-link {
  margin-left: auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: #1e4d14;
  text-decoration: none;
}
.card-header-link:hover { text-decoration: underline; }
.recent-routes-list { display: flex; flex-direction: column; gap: 8px; }
.recent-route {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f8faf5;
  text-decoration: none;
  transition: background 0.15s;
}
.recent-route:hover { background: #eef4e6; }
.rr-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rr-main { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.rr-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rr-meta { font-size: 0.76rem; color: #6b7280; }
.rr-go   { font-size: 1.1rem; color: #9ca3af; flex-shrink: 0; }
.rr-empty {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
  text-align: center;
  padding: 8px 0;
}
.rr-empty a { color: #1e4d14; font-weight: 600; }

/* ── Forest trail health (Gold) ── */
.th-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.th-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  background: rgba(255,255,255,0.6);
  border-radius: 12px;
}
.th-stat strong { font-size: 1.3rem; color: #1e4d14; }
.th-stat span   { font-size: 0.72rem; color: #6b7280; text-align: center; }
.th-list { display: flex; flex-wrap: wrap; gap: 8px; }
.th-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #fde68a;
  font-size: 0.8rem;
  color: #92400e;
}
.th-chip strong { color: #b45309; }
.th-ok {
  margin: 0;
  font-size: 0.88rem;
  color: #15803d;
  font-weight: 600;
}
.th-empty { margin: 0; font-size: 0.82rem; color: #6b7280; }

@media (max-width: 600px) {
  .card-activity      { grid-column: 1; }
  .card-recent-routes { grid-column: 1; }
  .records-grid       { grid-template-columns: repeat(2, 1fr); }
}

/* ── Dark mode for engagement gadgets ── */
[data-theme="dark"] .streak-banner {
  background: linear-gradient(135deg, #2a1a08, #3d2410);
  border-color: #b45309;
  color: #fdba74;
}
[data-theme="dark"] .streak-banner strong { color: #fb923c; }

[data-theme="dark"] .heat-cell, [data-theme="dark"] .heat-l0 { background: #1c2a20; }
[data-theme="dark"] .heat-l1 { background: #1e5e2a; }
[data-theme="dark"] .heat-l2 { background: #2d8a3e; }
[data-theme="dark"] .heat-l3 { background: #4ade80; }
[data-theme="dark"] .heat-l4 { background: #a3e635; }
[data-theme="dark"] .heat-future { background: transparent; }
[data-theme="dark"] .heat-foot, [data-theme="dark"] .heat-empty { color: #8fa887; }

[data-theme="dark"] .record-block { background: #1c2a20; }
[data-theme="dark"] .record-num   { color: #a3e635; }
[data-theme="dark"] .record-lbl   { color: #8fa887; }

[data-theme="dark"] .challenge-heading { color: #d4edbc; }
[data-theme="dark"] .challenge-card    { background: #1c2a20; border-color: #2a3a30; }
[data-theme="dark"] .challenge-card.is-done {
  background: linear-gradient(135deg, #16201a, #1a3020);
  border-color: #2d6b1f;
}
[data-theme="dark"] .challenge-name   { color: #e2e8f0; }
[data-theme="dark"] .challenge-target,
[data-theme="dark"] .challenge-prog   { color: #8fa887; }
[data-theme="dark"] .challenge-medal  { background: #1a3020; color: #4ade80; }

[data-theme="dark"] .card-header-link { color: #a3e635; }
[data-theme="dark"] .recent-route     { background: #1c2a20; }
[data-theme="dark"] .recent-route:hover { background: #233828; }
[data-theme="dark"] .rr-name          { color: #e2e8f0; }
[data-theme="dark"] .rr-meta          { color: #8fa887; }
[data-theme="dark"] .rr-empty         { color: #8fa887; }
[data-theme="dark"] .rr-empty a       { color: #a3e635; }

[data-theme="dark"] .th-stat        { background: rgba(20,32,24,0.6); }
[data-theme="dark"] .th-stat strong { color: #a3e635; }
[data-theme="dark"] .th-stat span   { color: #8fa887; }
[data-theme="dark"] .th-chip        { background: #2a1f00; border-color: #b45309; color: #fcd34d; }
[data-theme="dark"] .th-chip strong { color: #fdba74; }
[data-theme="dark"] .th-ok          { color: #4ade80; }
[data-theme="dark"] .th-empty       { color: #8fa887; }
