/* 09-statistik-profil.css — Statistik-Seite + Profil-Seite. Teil der geordneten Kaskade: in index.html in Nummern-Reihenfolge geladen; Regeln NICHT zwischen Dateien verschieben, ohne die Reihenfolge zu bedenken. */
/* ── Stats-Redesign: jede Sektion mit eigenem Charakter ──
   Gerichte = Ranking (Platz-Chip + Thumbnail + Häufigkeits-Balken),
   Einkaufsliste = KPI-Kacheln, Pro Laden = farbige Balken. */
.stat-row--ranked { gap: 10px; }
.stat-rank {
  width: 26px; height: 26px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  border: 1px solid rgba(255,255,255,0.10);
  font-size: 12px; font-weight: var(--fw-heavy);
  color: var(--text-muted, #9aa3b2);
  font-variant-numeric: tabular-nums;
}
.stat-rank--1 { background: linear-gradient(135deg, rgba(255,215,0,0.40), rgba(255,215,0,0.14)); border-color: rgba(255,215,0,0.45); color: #ffe9a3; }
.stat-rank--2 { background: linear-gradient(135deg, rgba(200,205,215,0.35), rgba(200,205,215,0.10)); border-color: rgba(200,205,215,0.40); color: #e8ecf2; }
.stat-rank--3 { background: linear-gradient(135deg, rgba(205,127,50,0.38), rgba(205,127,50,0.12)); border-color: rgba(205,127,50,0.45); color: #f0c49a; }
.stat-thumb {
  width: 38px; height: 38px; flex-shrink: 0;
  border-radius: 12px;
  object-fit: cover;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  filter: saturate(1.2) brightness(1.06);
}
.stat-thumb--sm { width: 30px; height: 30px; border-radius: 10px; }
.stat-thumb--ph {
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; opacity: 0.6; filter: none;
}
.stat-meal-block { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.stat-meal-block .stat-meal { flex: none; }
.stat-bar {
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.stat-bar span {
  display: block; height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(var(--cell-glow-rgb), 0.9), rgba(var(--cell-glow-rgb), 0.45));
}
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-top: 2px;
}
.kpi-tile {
  padding: 12px 8px 10px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.02) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}
.kpi-tile--wide { grid-column: span 2; }
.kpi-tile--accent {
  background:
    radial-gradient(circle at 20% 0%, rgba(var(--cell-glow-rgb), 0.35) 0%, transparent 70%),
    linear-gradient(135deg, rgba(var(--cell-glow-rgb), 0.20), rgba(var(--cell-glow-rgb), 0.06));
  border-color: rgba(var(--cell-glow-rgb), 0.35);
}
.kpi-num {
  font-size: 24px;
  font-weight: var(--fw-heavy);
  color: var(--text);
  letter-spacing: var(--ls-tight);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.kpi-label {
  margin-top: 3px;
  font-size: 11px;
  font-weight: var(--fw-bold);
  color: var(--text-muted, #9aa3b2);
  letter-spacing: var(--ls-snug);
}
.store-row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.store-row:last-child { border-bottom: none; padding-bottom: 2px; }
.store-name {
  flex: 0 0 36%;
  min-width: 0;
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-body); font-weight: var(--fw-bold); color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.store-dot {
  width: 9px; height: 9px; flex-shrink: 0;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
}
.store-bar {
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: rgba(255,255,255,0.07);
  overflow: hidden;
}
.store-bar span {
  display: block; height: 100%;
  border-radius: 3px;
  opacity: 0.85;
}
.stat-count {
  font-size: 12px;
  font-weight: var(--fw-heavy);
  color: var(--text);
  background: linear-gradient(135deg,
    rgba(255,255,255,0.12) 0%,
    rgba(255,255,255,0.04) 100%);
  border: 1px solid rgba(255,255,255,0.10);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}

/* ─── PROFILE PAGE ──────────────────────────────────────────────────────── */
#profilePage { display: none; flex-direction: column; min-height: 100vh; }
/* .profile-header übernimmt den shared Liquid-Glass-Stil.
   Avatar wird kompakter (52px) als Eyebrow zum Hero-Title. */
.profile-avatar-big {
  width: 52px;
  height: 52px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, rgba(255,255,255,0.20), rgba(255,255,255,0.06));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--text);
  border: 1px solid rgba(255,255,255,0.16);
  flex-shrink: 0;
  overflow: hidden;
}
.profile-avatar-big svg { width: 44px; height: 44px; }
.profile-name {
  /* Aliased to .hero-title now — alte Klasse bleibt für JS-Selectors */
}
.profile-body {
  contain: layout paint;   /* FPS: Scroll-Reflow/Repaint auf den Kind-Baum begrenzen */
  padding: var(--sp-5) var(--sp-4);
  /* eigener Scroll + Platz für die schwebende Bottom-Nav (+ Safe-Area) — wie .shop-body/
     .stats-body; verhindert Clip/Nav-Überlappung bei langem Profil (z. B. Abmelden-Button). */
  padding-bottom: max(100px, calc(40px + env(safe-area-inset-bottom)));
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}
/* Gruppen-Überschrift über den Profil-Karten (Konto · Darstellung · Daten · Entwickler) */
.profile-gruppe-titel {
  margin: var(--sp-2) var(--sp-2) var(--sp-2);
  font-size: 12px; font-weight: var(--fw-heavy);
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-muted, #9aa3b2);
}
.profile-gruppe-titel:first-child { margin-top: 0; }
/* Entwickler-Karte ohne Entwicklermodus: nur der Schalter ist sichtbar → keine Trennlinie darunter */
html:not(.dev-mode-on) #devModeItem { border-bottom: none; }
.profile-card {
  background: var(--card-tint);
  border: 1px solid var(--card-border-tint);
  border-radius: var(--r-md);
  margin-bottom: var(--sp-4);
  overflow: hidden;
}
.profile-item {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  transition: background 0.15s;
  border-bottom: 1px solid var(--card-border-tint);
}
.profile-item:last-child { border-bottom: none; }
.profile-item:active { background: rgba(255,255,255,0.04); }
.profile-item-icon {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  background: rgba(var(--cell-glow-rgb), 0.14);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.profile-item-label {
  flex: 1;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  color: var(--text);
  letter-spacing: var(--ls-snug);
}
.profile-item-arrow {
  font-size: 22px;
  color: var(--text-muted);
  font-weight: var(--fw-med);
  line-height: 1;
}
/* Toggle-Schalter (z.B. Developer-Modus) */
.profile-switch {
  width: 44px; height: 26px; border-radius: 13px; flex-shrink: 0;
  background: rgba(255,255,255,0.18); position: relative; transition: background 0.18s;
}
.profile-switch-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: transform 0.18s; box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
#devModeItem[aria-pressed="true"] .profile-switch { background: var(--btn-grad, var(--blue, #22c55e)); }
#devModeItem[aria-pressed="true"] .profile-switch-knob { transform: translateX(18px); }
/* Developer-Modus: .dev-only-Einträge nur sichtbar, wenn html.dev-mode-on gesetzt ist */
.dev-only { display: none; }
html.dev-mode-on .dev-only { display: flex; }

.logout-btn {
  width: 100%;
  margin-top: var(--sp-3);
  padding: 14px;
  border-radius: var(--r-pill);
  border: 1px solid rgba(248,113,113,0.30);
  background: rgba(248,113,113,0.06);
  color: var(--danger);
  font-family: inherit;
  font-size: var(--fs-callout);
  font-weight: var(--fw-bold);
  cursor: pointer;
  letter-spacing: var(--ls-snug);
  transition: background 0.15s;
}
.logout-btn:active { background: rgba(248,113,113,0.14); }

