/* ============================================================
   CSS VARIABLES & RESET
   ============================================================ */
:root {
  --bg: #0d0f14;
  --bg2: #13161e;
  --bg3: #1a1e2a;
  --card: #1e2330;
  --card2: #252b3b;
  --border: #2e3448;
  --accent: #7c6af7;
  --accent2: #a78bfa;
  --accent3: #c4b5fd;
  --green: #34d399;
  --red: #f87171;
  --yellow: #fbbf24;
  --orange: #fb923c;
  --text: #e8eaf0;
  --text2: #9aa0b8;
  --text3: #636a82;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --glow: 0 0 24px rgba(124,106,247,0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  min-height: 100vh;
  overflow-x: hidden;
}

h1,h2,h3,h4 { font-family: 'Syne', sans-serif; }

/* ============================================================
   LAYOUT
   ============================================================ */
#app { display: flex; flex-direction: column; min-height: 100vh; }

.topnav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,15,20,0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.topnav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.2rem;
  color: var(--accent3); letter-spacing: -0.5px;
}
.topnav-logo span { color: var(--text3); font-weight: 400; font-size: 0.75rem; display: block; letter-spacing: 0; }
.topnav-xp {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px;
  font-size: 0.875rem; font-weight: 500;
}
.xp-icon { font-size: 1rem; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(13,15,20,0.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; align-items: center;
  height: 64px; padding: 0 8px;
}
.nav-btn {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem; font-weight: 500;
  padding: 8px 12px; border-radius: var(--radius-sm);
  transition: all 0.2s; flex: 1; min-width: 0;
}
.nav-btn .nav-icon { font-size: 1.3rem; }
.nav-btn.active { color: var(--accent2); }
.nav-btn.active .nav-icon { filter: drop-shadow(0 0 6px rgba(167,139,250,0.6)); }
.nav-btn:hover { color: var(--text); background: var(--bg3); }

.main { flex: 1; padding: 20px 16px 80px; max-width: 680px; margin: 0 auto; width: 100%; }

/* ============================================================
   SCREENS
   ============================================================ */
.screen { display: none; }
.screen.screen-active { display: block; animation: fadeUp 0.3s ease; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   COMPONENTS
   ============================================================ */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; margin-bottom: 12px;
}
.card-sm { padding: 14px 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-weight: 500;
  transition: all 0.15s; text-align: center;
}
.btn-primary {
  background: var(--accent); color: #fff;
  padding: 14px 24px; font-size: 1rem;
  width: 100%; margin-top: 8px;
  box-shadow: var(--glow);
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
  background: var(--bg3); color: var(--text2);
  border: 1px solid var(--border);
  padding: 12px 20px; font-size: 0.9rem;
  width: 100%; margin-top: 8px;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent2); }
.btn-icon {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); padding: 10px 14px;
  border-radius: var(--radius-sm); font-size: 0.875rem;
}

.prog-bar { height: 8px; background: var(--bg3); border-radius: 999px; overflow: hidden; }
.prog-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 999px; transition: width 0.5s ease;
}

.badge {
  display: inline-block;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); font-size: 0.75rem; font-weight: 500;
  padding: 3px 10px; border-radius: 999px;
}
.badge-purple { background: rgba(124,106,247,0.15); border-color: rgba(124,106,247,0.4); color: var(--accent3); }
.badge-green  { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.3); color: var(--green); }
.badge-red    { background: rgba(248,113,113,0.12); border-color: rgba(248,113,113,0.3); color: var(--red); }
.badge-yellow { background: rgba(251,191,36,0.12); border-color: rgba(251,191,36,0.3); color: var(--yellow); }

.section-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.section-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 700; }
.section-sub { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-hero {
  background: linear-gradient(135deg, rgba(124,106,247,0.2), rgba(167,139,250,0.08));
  border: 1px solid rgba(124,106,247,0.3);
  border-radius: var(--radius); padding: 24px 20px;
  margin-bottom: 16px; position: relative; overflow: hidden;
}
.dash-hero::before {
  content: '🧠';
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  font-size: 3.5rem; opacity: 0.15;
}
.dash-hero h2 { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.dash-hero p  { color: var(--text2); font-size: 0.875rem; }
.dash-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.stat-label { font-size: 0.75rem; color: var(--text3); }
.stat-value { font-family: 'Syne', sans-serif; font-size: 1.5rem; font-weight: 800; }
.stat-value.purple { color: var(--accent2); }
.stat-value.green  { color: var(--green); }
.stat-value.yellow { color: var(--yellow); }
.stat-value.orange { color: var(--orange); }

.topic-pill {
  display: flex; align-items: center; gap: 10px;
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 14px;
  margin-bottom: 8px; cursor: pointer; transition: border-color 0.2s;
}
.topic-pill:hover { border-color: var(--accent); }
.topic-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.topic-name { font-size: 0.875rem; font-weight: 500; flex: 1; }
.topic-pct  { font-size: 0.8rem; color: var(--text3); }

/* ============================================================
   MODULE SCREEN
   ============================================================ */
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.module-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: all 0.2s; text-align: left;
  display: flex; flex-direction: column; gap: 8px;
  position: relative; overflow: hidden;
}
.module-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.module-icon { font-size: 1.8rem; }
.module-title { font-family: 'Syne', sans-serif; font-size: 0.9rem; font-weight: 700; line-height: 1.3; }
.module-count { font-size: 0.75rem; color: var(--text3); }
.module-bar { height: 4px; background: var(--bg3); border-radius: 999px; margin-top: 4px; overflow: hidden; }
.module-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--accent2)); }

.module-detail-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.back-btn {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--text2); padding: 8px 12px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: 0.875rem; font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent2); }

.theory-block {
  background: var(--bg2); border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 16px; margin-bottom: 12px;
}
.theory-block p { font-size: 0.875rem; color: var(--text2); line-height: 1.7; }

.merksatz {
  background: rgba(52,211,153,0.08); border: 1px solid rgba(52,211,153,0.25);
  border-radius: var(--radius-sm); padding: 12px 16px;
  font-size: 0.875rem; color: var(--green); line-height: 1.6; margin-bottom: 8px;
}
.merksatz::before { content: '💡 Merksatz: '; font-weight: 600; }

/* ============================================================
   QUIZ SCREEN
   ============================================================ */
.quiz-header { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.quiz-progress-wrap { flex: 1; }
.quiz-count { font-size: 0.75rem; color: var(--text3); margin-bottom: 4px; }

.question-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin-bottom: 14px;
}
.question-afb {
  font-size: 0.7rem; font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
  color: var(--accent3); margin-bottom: 10px;
}
.question-text {
  font-family: 'Syne', sans-serif; font-size: 1.05rem; font-weight: 600;
  line-height: 1.5; margin-bottom: 6px;
}
.question-scenario {
  background: var(--bg3); border-radius: var(--radius-sm);
  padding: 12px; font-size: 0.85rem; color: var(--text2);
  line-height: 1.6; margin: 10px 0 0; font-style: italic;
}

.options-grid { display: flex; flex-direction: column; gap: 8px; }
.option-btn {
  background: var(--bg3); border: 2px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 14px 16px; text-align: left; cursor: pointer;
  font-family: 'DM Sans', sans-serif; font-size: 0.9rem; line-height: 1.4;
  transition: all 0.15s; display: flex; align-items: flex-start; gap: 10px;
}
.option-btn:hover:not(:disabled) { border-color: var(--accent); background: rgba(124,106,247,0.1); }
.option-btn.correct { border-color: var(--green); background: rgba(52,211,153,0.1); color: var(--green); }
.option-btn.wrong   { border-color: var(--red);   background: rgba(248,113,113,0.1); color: var(--red); }
.option-btn.dimmed  { opacity: 0.35; }
.option-letter {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--border); display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; flex-shrink: 0; margin-top: 1px;
}
.option-btn.correct .option-letter { background: var(--green); color: #000; }
.option-btn.wrong   .option-letter { background: var(--red);   color: #fff; }

.feedback-card {
  border-radius: var(--radius); padding: 16px; margin-bottom: 12px; display: none;
}
.feedback-card.correct { background: rgba(52,211,153,0.1); border: 1px solid rgba(52,211,153,0.3); }
.feedback-card.wrong   { background: rgba(248,113,113,0.1); border: 1px solid rgba(248,113,113,0.3); }
.feedback-card.show    { display: block; animation: fadeUp 0.2s ease; }
.feedback-title { font-family: 'Syne', sans-serif; font-size: 0.95rem; font-weight: 700; margin-bottom: 6px; }
.feedback-text  { font-size: 0.875rem; color: var(--text2); line-height: 1.6; }

.match-wrap { display: flex; flex-direction: column; gap: 8px; }
.match-row { display: flex; align-items: stretch; gap: 8px; }
.match-term {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px 12px;
  font-size: 0.85rem; flex: 0 0 120px; display: flex; align-items: center; font-weight: 500;
}
.match-select {
  flex: 1; background: var(--bg3); border: 2px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem; cursor: pointer; appearance: none;
}
.match-select:focus { outline: none; border-color: var(--accent); }
.match-select.correct-match { border-color: var(--green); }
.match-select.wrong-match   { border-color: var(--red); }

/* ============================================================
   AFB SCREEN
   ============================================================ */
.afb-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.afb-tab {
  flex: 1; padding: 10px; border-radius: var(--radius-sm);
  border: 2px solid var(--border); background: var(--bg3);
  cursor: pointer; font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem; font-weight: 600; text-align: center;
  transition: all 0.15s; color: var(--text2);
}
.afb-tab.active { border-color: var(--accent); color: var(--accent2); background: rgba(124,106,247,0.1); }
.afb-tab:hover:not(.active) { border-color: var(--text3); color: var(--text); }

.afb-level-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 14px;
}
.afb-level-title { font-family: 'Syne', sans-serif; font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.afb-level-desc { font-size: 0.8rem; color: var(--text3); margin-bottom: 14px; }

/* ============================================================
   PRÜFUNGSMODUS
   ============================================================ */
.exam-timer-card {
  background: linear-gradient(135deg, rgba(248,113,113,0.15), rgba(251,146,60,0.08));
  border: 1px solid rgba(248,113,113,0.3);
  border-radius: var(--radius); padding: 20px; margin-bottom: 16px; text-align: center;
}
.exam-timer-label { font-size: 0.75rem; color: var(--text3); margin-bottom: 6px; letter-spacing: 1px; text-transform: uppercase; }
.exam-timer-value {
  font-family: 'Syne', sans-serif; font-size: 3rem; font-weight: 800;
  color: var(--yellow); letter-spacing: -2px;
}
.exam-timer-value.urgent { color: var(--red); animation: pulse 1s infinite; }
.exam-stats { display: flex; justify-content: space-around; margin-top: 12px; }
.exam-stat { text-align: center; }
.exam-stat-v { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 1.1rem; }
.exam-stat-l { font-size: 0.7rem; color: var(--text3); }

@keyframes pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

.result-hero {
  text-align: center; padding: 32px 20px;
  background: linear-gradient(135deg, rgba(52,211,153,0.12), rgba(124,106,247,0.08));
  border: 1px solid rgba(52,211,153,0.2);
  border-radius: var(--radius); margin-bottom: 16px;
}
.result-score {
  font-family: 'Syne', sans-serif; font-size: 4rem; font-weight: 800;
  color: var(--green); margin-bottom: 4px;
}
.result-label { color: var(--text2); font-size: 0.875rem; }

/* ============================================================
   FOCUS MODE
   ============================================================ */
.focus-empty { text-align: center; padding: 48px 20px; color: var(--text3); }
.focus-empty .focus-icon { font-size: 3rem; margin-bottom: 12px; }

/* ============================================================
   MODAL
   ============================================================ */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.overlay.open { display: flex; }
.modal {
  background: var(--card2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; width: 100%; max-width: 480px;
  animation: fadeUp 0.25s ease;
}
.modal h3 { font-family: 'Syne', sans-serif; font-size: 1.2rem; margin-bottom: 8px; }
.modal p  { font-size: 0.875rem; color: var(--text2); line-height: 1.6; margin-bottom: 16px; }

/* ============================================================
   MISC
   ============================================================ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.empty-state { text-align: center; padding: 32px 20px; color: var(--text3); font-size: 0.875rem; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.flex-row { display: flex; gap: 8px; }
.flex-row .btn { flex: 1; }
.text-small { font-size: 0.8rem; color: var(--text3); }

::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* ============================================================
   FALLBEISPIELE
   ============================================================ */
.case-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 12px;
  cursor: pointer; transition: all 0.2s; display: block; width: 100%; text-align: left;
}
.case-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.case-card-top { display: flex; align-items: flex-start; gap: 14px; }
.case-icon-wrap {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; flex-shrink: 0;
}
.case-meta { flex: 1; }
.case-nummer { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 1px; color: var(--text3); margin-bottom: 3px; }
.case-titel { font-family: 'Syne', sans-serif; font-weight: 700; font-size: 0.95rem; line-height: 1.3; margin-bottom: 4px; }
.case-kontext { font-size: 0.78rem; color: var(--text3); }
.case-footer { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.difficulty-stars { font-size: 0.75rem; letter-spacing: 2px; }
.case-progress-wrap { margin-top: 10px; }

.falltext-card {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px;
  font-size: 0.85rem; color: var(--text2); line-height: 1.8;
  max-height: 220px; overflow-y: auto;
}
.falltext-card.expanded { max-height: none; }
.falltext-toggle {
  background: none; border: none; color: var(--accent2);
  font-size: 0.8rem; cursor: pointer; font-family: 'DM Sans', sans-serif;
  padding: 6px 0; display: block; width: 100%; text-align: center;
}

.theory-tag {
  display: inline-block;
  background: rgba(124,106,247,0.12); border: 1px solid rgba(124,106,247,0.3);
  color: var(--accent3); font-size: 0.72rem; font-weight: 500;
  padding: 3px 9px; border-radius: 999px; margin-top: 8px;
}

.case-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.case-detail-title { font-family: 'Syne', sans-serif; font-size: 1.1rem; font-weight: 800; }
.case-detail-sub { font-size: 0.78rem; color: var(--text3); margin-top: 2px; }

.q-nav { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.q-dot {
  width: 32px; height: 32px; border-radius: 8px;
  border: 2px solid var(--border); background: var(--bg3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 600; cursor: pointer;
  transition: all 0.15s; color: var(--text3);
}
.q-dot.active        { border-color: var(--accent); color: var(--accent2); background: rgba(124,106,247,0.1); }
.q-dot.answered-ok   { border-color: var(--green); background: rgba(52,211,153,0.15); color: var(--green); }
.q-dot.answered-err  { border-color: var(--red);   background: rgba(248,113,113,0.15); color: var(--red); }

.case-result-breakdown {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 12px;
}
.case-result-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 0.82rem;
}
.case-result-row:last-child { border-bottom: none; }
.case-result-icon { font-size: 1rem; flex-shrink: 0; margin-top: 1px; }
.case-result-q { flex: 1; color: var(--text2); line-height: 1.5; }
.case-result-afb { flex-shrink: 0; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 400px) {
  .topnav-logo span { display: none; }
}
@media (min-width: 600px) {
  .module-grid { grid-template-columns: 1fr 1fr 1fr; }
}

/* ============================================================
   AUTH SCREEN
   ============================================================ */
#auth-screen {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

#auth-container { width: 100%; max-width: 420px; }

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 28px;
  box-shadow: var(--shadow), var(--glow);
  display: flex; flex-direction: column; gap: 14px;
  animation: authFadeIn 0.3s ease;
}

@keyframes authFadeIn {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.auth-brand {
  font-family: 'Syne', sans-serif;
  font-weight: 800; font-size: 1.6rem;
  color: var(--accent3); letter-spacing: -1px;
  margin-bottom: 4px;
}

.auth-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700; font-size: 1.2rem;
  color: var(--text);
}

.auth-sub {
  font-size: 0.875rem; color: var(--text2);
  line-height: 1.5; margin-bottom: 4px;
}

.auth-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9375rem;
  padding: 12px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.auth-input:focus { border-color: var(--accent); }
.auth-input::placeholder { color: var(--text3); }

.auth-error {
  font-size: 0.8rem;
  color: var(--red);
  min-height: 18px;
}

.auth-switch {
  background: none; border: none; cursor: pointer;
  color: var(--accent2); font-size: 0.8rem;
  text-align: center; padding: 4px 0;
  font-family: 'DM Sans', sans-serif;
  transition: color 0.2s;
}
.auth-switch:hover { color: var(--accent3); }

/* ============================================================
   TOPNAV – USER AREA
   ============================================================ */
.topnav-right {
  display: flex; align-items: center; gap: 10px;
}

.topnav-user {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 999px; padding: 5px 12px 5px 6px;
  font-size: 0.8rem; color: var(--text2);
}

.user-avatar {
  width: 26px; height: 26px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

.logout-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 0.9rem;
  padding: 2px 0 2px 6px;
  transition: color 0.2s;
  line-height: 1;
}
.logout-btn:hover { color: var(--red); }

@media (max-width: 400px) {
  #nav-username { display: none; }
}
