/* =============================================================
   Ascend · Shared Design Tokens + Base
   Single source of truth. Used by ascend.html and design.html.
   Komponenten-Styles leben weiterhin in den jeweiligen HTML-Dateien.
   ============================================================= */

/* ── Self-hosted Fonts (DSGVO: keine Google-Fonts-Requests) ─────────────────── */
/* Alfa Slab One · Display */
@font-face {
  font-family: 'Alfa Slab One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/alfa-slab-one-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Alfa Slab One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/alfa-slab-one-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* JetBrains Mono · Tabular / Mono — ein Subset deckt 400 + 600 ab */
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ── Themes (Farben) ──
   Nur zwei echte Themes plus "system" (= matched prefers-color-scheme).
   Frueher gab's default/neon/forest/dark — sind raus, weil die Pflege
   der Komponenten in 4 Varianten den Mehrwert nicht rechtfertigte. Light
   ist neu und folgt einer dezenten Off-White-Palette mit Violet als
   Akzent (Konsistenz zur Brand). */

/* Default = Dark (semantisch unchanged fuer alle vorhandenen User). */
:root, [data-theme="dark"], [data-theme="default"] {
  --bg:          #0c0c14;
  --surface:     #13131f;
  --surface2:    #1c1c2e;
  --surface3:    #24243a;
  --border:      #252538;
  --border-strong: #3a3a54;
  --primary:     #7c3aed;
  --accent:      #ec4899;
  --xp:          #a855f7;
  --text:        #f1f5f9;
  --muted:       #8a8aa8;
  --muted-deep:  #4a4a6a;
  --success:     #22c55e;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --info:        #3b82f6;
  --c-fit:       #ef4444;
  --c-hab:       #f59e0b;
  --c-hom:       #22c55e;
  --c-ler:       #3b82f6;
}

/* Light: warmes Off-White als Basis (#f8f6f2), gleiche Akzentfarben.
   Surface-Hierarchie ist hier umgekehrt — Light braucht etwas mehr
   Kontrast in den Schichten, damit Karten sich vom Background absetzen. */
[data-theme="light"] {
  --bg:          #f7f5f0;
  --surface:     #ffffff;
  --surface2:    #efece4;
  --surface3:    #e4e0d4;
  --border:      #d8d3c4;
  --border-strong: #b8b0a0;
  --primary:     #6d28d9;
  --accent:      #db2777;
  --xp:          #7c3aed;
  --text:        #18181b;
  --muted:       #57534e;
  --muted-deep:  #a8a298;
  --success:     #16a34a;
  --warning:     #d97706;
  --danger:      #dc2626;
  --info:        #2563eb;
  --c-fit:       #dc2626;
  --c-hab:       #d97706;
  --c-hom:       #16a34a;
  --c-ler:       #2563eb;
  /* Light-Mode-Feinschliff: dunklere Status-Texte + dunkler Pace-Marker, damit
     die Crew-Pace-Pillen/Marker auf hellem Grund nicht verblassen. Dark laesst
     diese Variablen ungesetzt → Komponenten nutzen ihre Original-Fallbacks. */
  --pace-ok-fg: #047857;  --pace-ok-bg: color-mix(in srgb, #10b981 24%, transparent);
  --pace-warn-fg: #b45309; --pace-warn-bg: color-mix(in srgb, #f59e0b 34%, transparent);
  --pace-bad-fg: #b91c1c;  --pace-bad-bg: color-mix(in srgb, #ef4444 24%, transparent);
  --pace-marker: rgba(60, 48, 30, 0.8); --pace-marker-glow: rgba(0, 0, 0, 0.18);
  /* Leerer Fortschritts-Track: auf weissen Karten braucht er mehr Kontrast als
     --surface2, sonst "verschwindet" eine 0%-Leiste (siehe Ziele). */
  --track-empty: #ddd6c6;
}

/* System-Mode: Wert wird per [data-theme="system"] gesetzt; effektives
   Farbset entscheidet die OS-Praeferenz. Wir spiegeln einfach jeweils
   die dark/light-Variablen. */
@media (prefers-color-scheme: dark) {
  [data-theme="system"] {
    --bg: #0c0c14; --surface: #13131f; --surface2: #1c1c2e; --surface3: #24243a;
    --border: #252538; --border-strong: #3a3a54;
    --primary: #7c3aed; --accent: #ec4899; --xp: #a855f7;
    --text: #f1f5f9; --muted: #8a8aa8; --muted-deep: #4a4a6a;
    --success: #22c55e; --warning: #f59e0b; --danger: #ef4444; --info: #3b82f6;
    --c-fit: #ef4444; --c-hab: #f59e0b; --c-hom: #22c55e; --c-ler: #3b82f6;
  }
}
@media (prefers-color-scheme: light) {
  [data-theme="system"] {
    --bg: #f7f5f0; --surface: #ffffff; --surface2: #efece4; --surface3: #e4e0d4;
    --border: #d8d3c4; --border-strong: #b8b0a0;
    --primary: #6d28d9; --accent: #db2777; --xp: #7c3aed;
    --text: #18181b; --muted: #57534e; --muted-deep: #a8a298;
    --success: #16a34a; --warning: #d97706; --danger: #dc2626; --info: #2563eb;
    --c-fit: #dc2626; --c-hab: #d97706; --c-hom: #16a34a; --c-ler: #2563eb;
    --pace-ok-fg: #047857;  --pace-ok-bg: color-mix(in srgb, #10b981 24%, transparent);
    --pace-warn-fg: #b45309; --pace-warn-bg: color-mix(in srgb, #f59e0b 34%, transparent);
    --pace-bad-fg: #b91c1c;  --pace-bad-bg: color-mix(in srgb, #ef4444 24%, transparent);
    --pace-marker: rgba(60, 48, 30, 0.8); --pace-marker-glow: rgba(0, 0, 0, 0.18);
    --track-empty: #ddd6c6;
  }
}

/* Legacy-Themes (forest/neon) leiten auf Dark um, damit alte User-States
   sich nicht verschlucken — wer "neon" gespeichert hat, bekommt jetzt das
   Standard-Dark-Theme statt eines undefined-Look. */
[data-theme="neon"], [data-theme="forest"] {
  --bg: #0c0c14; --surface: #13131f; --surface2: #1c1c2e; --surface3: #24243a;
  --border: #252538; --border-strong: #3a3a54;
  --primary: #7c3aed; --accent: #ec4899; --xp: #a855f7;
  --text: #f1f5f9; --muted: #8a8aa8; --muted-deep: #4a4a6a;
  --success: #22c55e; --warning: #f59e0b; --danger: #ef4444; --info: #3b82f6;
  --c-fit: #ef4444; --c-hab: #f59e0b; --c-hom: #22c55e; --c-ler: #3b82f6;
}

/* ── Typografie ── */
:root {
  --font-display: 'Alfa Slab One', Georgia, serif;
  --font-body:    -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --fs-display: clamp(44px, 7vw, 72px);
  --fs-h1: 36px;
  --fs-h2: 28px;
  --fs-h3: 20px;
  --fs-h4: 16px;
  --fs-body-lg: 17px;
  --fs-body: 15px;
  --fs-small: 13px;
  --fs-micro: 11px;

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-normal: 1.5;

  --tracking-tight: -0.01em;
  --tracking-normal: 0;
  --tracking-wide:  0.06em;
  --tracking-wider: 0.1em;

  /* Spacing (4px base, nicht-linear) */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 20px;
  --s-6: 24px; --s-8: 32px; --s-10: 40px; --s-14: 56px; --s-20: 80px;

  /* Radius */
  --r-sm: 6px; --r-md: 10px; --r-lg: 14px; --r-xl: 18px; --r-full: 999px;

  /* Borders */
  --border-w: 1px;

  /* Elevation — bewusst minimal */
  --shadow-lift: 0 1px 0 rgba(255,255,255,0.02) inset, 0 8px 24px -12px rgba(0,0,0,0.6);
  --shadow-pop:  0 10px 40px -10px rgba(0,0,0,0.7), 0 0 0 1px var(--border);

  /* Motion */
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Abgeleitet */
  --primary-soft: color-mix(in srgb, var(--primary) 14%, transparent);
  --accent-soft:  color-mix(in srgb, var(--accent) 14%, transparent);
}

/* =============================================================
   RESET + BASE
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  /* Gleiches Hoehen-Schema wie body. html { height:100% } resolved auf iOS-
     PWA-Standalone manchmal zu klein (Safe-Area-exklusiver Viewport), und
     weil hier overflow:hidden gilt, wuerde ein hoeherer Body am unteren
     Rand abgeschnitten — sichtbare Luecke unter der Navbar. Mit der JS-
     gefuetterten --app-height stimmt's verlaesslich. */
  height: 100%;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  /* overflow:hidden auf html + body verhindert das iOS-Rubberband-Bouncing
     der gesamten Seite, das auf manchen iOS-Versionen position:fixed-Elemente
     waehrend des Bouncings mitziehen kann. */
  overflow: hidden;
  background: var(--bg);
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  background: var(--bg);
  color: var(--text);
  /* App-Shell-Layout: body ist Flex-Column, Topbar + Page-Content + Bottomnav
     sind reale Flex-Children. Damit sitzt die Navbar physisch am Ende des
     Body = Ende des Viewports — unabhaengig von iOS-PWA-Quirks mit
     position:fixed (die nach Body-Scroll oder app-resume das fixierte
     Element kurzzeitig falsch positionieren). Gescrollt wird ausschliesslich
     im #page-content, der zwischen Top- und Bottom-Bar als flex:1 sitzt. */
  /* Hoehe ueber drei Stufen:
     - 100vh: harter Fallback fuer alte Browser ohne dvh.
     - 100dvh: dynamic viewport height (incl. Safe-Areas) fuer Browser, die's koennen.
     - var(--app-height): per JS aus visualViewport.height / window.innerHeight
       gesetzt (siehe inline-script in ascend.html). Loest den iOS-PWA-Bug, bei
       dem 100dvh im Standalone-Modus beim ersten Paint zu klein resolved und
       die Navbar (letzte Flex-Row) eine sichtbare Luecke zur Geraete-Kante
       hat — nach Orientation-Change rechnet iOS neu und es passt, weshalb
       wir das gleiche Verhalten manuell erzwingen. */
  height: 100vh;
  height: 100dvh;
  height: var(--app-height, 100dvh);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  /* Doppelklick-Zoom deaktivieren (Pinch-Zoom bleibt fuer Accessibility erhalten). */
  /* Entfernt nebenbei den 300 ms-Tap-Delay auf Mobile.                            */
  touch-action: manipulation;
  /* Feine Grain-Textur — subtile Flächentrennung statt Gradient-Blobs */
  background-image:
    radial-gradient(1px 1px at 25% 30%, rgba(255,255,255,0.015) 1px, transparent 0),
    radial-gradient(1px 1px at 75% 70%, rgba(255,255,255,0.012) 1px, transparent 0);
  background-size: 140px 140px, 200px 200px;
}
::selection { background: var(--accent); color: #fff; }
button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); }

/* Utility-Klassen */
.slab { font-family: var(--font-display); font-weight: 400; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* =============================================================
   FRIENDS-SECTION (Profile)
   Markup wird von app/profile-friends.js erzeugt; Styles hier weil
   neue Komponenten ab jetzt aus der Inline-<style>-Sektion in
   ascend.html in app.css wandern.
   ============================================================= */

.friends-subhead {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--muted);
  margin: var(--s-4) 0 var(--s-2);
}
.friends-subhead:first-child { margin-top: 0; }

.friends-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.friend-card,
.friend-request-row {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  text-align: left;
  color: var(--text);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}
.friend-card:hover { background: var(--surface3); border-color: var(--border-strong); }
.friend-card:active { transform: translateY(1px); }

.friend-avatar {
  width: 40px; height: 40px;
  border-radius: var(--r-full);
  background: var(--surface3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.friend-avatar-pending { opacity: 0.55; }

.friend-meta {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.friend-name {
  font-size: var(--fs-body);
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.friend-sub,
.friend-stats-inline {
  font-size: var(--fs-micro);
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  font-variant-numeric: tabular-nums;
}

.friend-arrow {
  font-size: 24px;
  color: var(--muted-deep);
  flex-shrink: 0;
  padding-right: var(--s-1);
}

/* Friend-Card-Upgrade: Online-Punkt am Avatar + Chip-Stats. */
.friend-avatar-wrap2 { position: relative; flex-shrink: 0; }
.friend-online-dot {
  position: absolute; right: -1px; bottom: -1px;
  width: 12px; height: 12px; border-radius: var(--r-full);
  background: #22c55e; border: 2px solid var(--surface2);
}
.friend-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 3px; }
.friend-chip {
  font-size: 11px; font-variant-numeric: tabular-nums;
  background: var(--surface3); color: var(--muted);
  padding: 2px 8px; border-radius: var(--r-full);
}
.friend-chip-streak { color: #f97316; background: color-mix(in srgb, #f97316 12%, var(--surface3)); }

.friend-actions { display: flex; gap: var(--s-2); flex-shrink: 0; }
.friend-btn {
  padding: 8px 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--surface3);
  color: var(--text);
  transition: background var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease);
}
.friend-btn:hover { border-color: var(--border-strong); }
.friend-btn-accept { background: var(--primary); color: #fff; border-color: transparent; }
.friend-btn-accept:hover { filter: brightness(1.1); }
.friend-btn-decline { background: transparent; color: var(--muted); }
.friend-btn-decline:hover { color: var(--text); border-color: var(--danger); }

.friends-empty {
  font-size: var(--fs-small);
  color: var(--muted);
  padding: var(--s-3) 0;
  text-align: center;
}

.friends-add-btn {
  width: 100%;
  margin-top: var(--s-4);
  padding: 12px;
  border-radius: var(--r-md);
  font-size: var(--fs-small);
  font-weight: 700;
}

/* =============================================================
   CREW-SECTION (Work-in-Progress-Stub)
   ============================================================= */
.crew-card.wip {
  display: flex; align-items: center; gap: var(--s-3);
  width: 100%;
  background: var(--surface2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--s-3);
  text-align: left;
  color: var(--text);
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease);
}
.crew-card.wip:hover { background: var(--surface3); }
.crew-card-main { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.crew-card-title { font-size: var(--fs-body); font-weight: 600; }
.crew-card-sub { font-size: var(--fs-micro); color: var(--muted); }
.crew-wip-badge {
  font-family: var(--font-display);
  font-size: var(--fs-micro);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  background: var(--warning);
  color: #1a1a1a;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  flex-shrink: 0;
}

/* =============================================================
   FRIENDS / CREW MODALS (eigenes .modal-overlay-Pattern, getrennt
   von den IDs der bestehenden Modale in ascend.html)
   ============================================================= */
.modal-overlay {
  position: fixed; inset: 0; z-index: 120;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center; justify-content: center;
  padding: var(--s-5);
}
.modal-overlay.show { display: flex; }
.modal-overlay .modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-5);
  max-width: 380px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: modal-drop 320ms var(--ease-spring);
}
.modal-overlay .modal-title {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-snug);
  margin-bottom: var(--s-2);
}
.modal-overlay .modal-desc {
  font-size: var(--fs-small);
  color: var(--muted);
  line-height: var(--lh-normal);
  margin-bottom: var(--s-4);
}
.modal-overlay .modal-actions {
  display: flex; gap: var(--s-2);
  margin-top: var(--s-5);
}
.modal-overlay .modal-actions > * { flex: 1; padding: 12px; border-radius: var(--r-sm); font-size: var(--fs-small); font-weight: 700; }

.friend-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  outline: none;
  transition: border-color var(--dur-fast) var(--ease);
}
.friend-input:focus { border-color: var(--primary); }
.friend-input-err {
  font-size: var(--fs-micro);
  color: var(--danger);
  min-height: 16px;
  margin-top: var(--s-2);
}

/* Friend-Detail-Modal */
.friend-detail-card { padding: var(--s-6) var(--s-5); }
.friend-detail-hero {
  display: flex; flex-direction: column; align-items: center; gap: var(--s-2);
  margin-bottom: var(--s-5);
}
.friend-detail-avatar {
  width: 72px; height: 72px;
  border-radius: var(--r-full);
  background: var(--surface3);
  border: 2px solid var(--border-strong);
  display: flex; align-items: center; justify-content: center;
  font-size: 36px;
}
.friend-detail-name {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  line-height: var(--lh-tight);
}
.friend-detail-stage {
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--primary);
}
.friend-detail-status {
  font-size: var(--fs-micro); color: var(--muted);
  display: inline-flex; align-items: center; gap: 6px; margin-top: 2px;
}
.friend-detail-status.is-online { color: #22c55e; }
.friend-status-dot { width: 8px; height: 8px; border-radius: var(--r-full); background: #22c55e; }

/* Streak-Stat-Affordance: kleiner Pfeil oben rechts zeigt "antippbar". */
.friend-detail-stats .stat-box-streak { position: relative; }
.friend-detail-stats .stat-box-streak::after {
  content: '↗'; position: absolute; top: 5px; right: 7px;
  font-size: 12px; color: var(--primary); opacity: 0.75;
}

/* Crew-Status-Zeile im Friend-Detail. */
.friend-detail-crew {
  display: flex; align-items: center; gap: var(--s-3);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s-3); margin-bottom: var(--s-4);
}
.friend-detail-crew.is-empty { opacity: 0.7; }
.friend-detail-crew-icon {
  width: 36px; height: 36px; border-radius: var(--r-full);
  background: var(--surface3); border: 1px solid var(--border);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
}
.friend-detail-crew-meta { min-width: 0; }
.friend-detail-crew-name { font-size: var(--fs-small); font-weight: 600; }
.friend-detail-crew-sub { font-size: var(--fs-micro); color: var(--muted); }

.friend-detail-stats {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s-2);
  margin-bottom: var(--s-4);
}
.friend-detail-stats .stat-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-3);
  text-align: center;
}
.friend-detail-stats .stat-num {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  font-variant-numeric: tabular-nums;
}
.friend-detail-stats .stat-lbl {
  font-size: var(--fs-micro);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: 2px;
}
.friend-detail-xp {
  margin-bottom: var(--s-2);
}
.friend-detail-xp-label {
  font-size: var(--fs-micro);
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.friend-detail-xp-bar {
  width: 100%; height: 6px;
  background: var(--surface3);
  border-radius: var(--r-full);
  overflow: hidden;
}
.friend-detail-xp-fill {
  height: 100%;
  background: var(--xp);
  transition: width var(--dur-base) var(--ease);
}
.friend-detail-loading {
  text-align: center;
  color: var(--muted);
  padding: var(--s-10) 0;
  font-size: var(--fs-h2);
}

/* Toast */
.friends-toast {
  position: fixed;
  left: 50%;
  bottom: 80px;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  padding: 10px 16px;
  border-radius: var(--r-full);
  font-size: var(--fs-small);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease), transform var(--dur-base) var(--ease);
  box-shadow: var(--shadow-pop);
  max-width: calc(100vw - 32px);
}
.friends-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@keyframes modal-drop {
  from { transform: translateY(-30px) scale(0.94); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}
