/* ============================================================
   069 Dashboard — Design System v2
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Palette (unchanged) */
  --bg:            #08070D;
  --surface:       #11101A;
  --surface-2:     #181526;
  --surface-3:     #1F1B33;
  --primary:       #8B3DFF;
  --primary-hover: #7A2FE8;
  --highlight:     #B45CFF;
  --accent-dark:   #4B1B78;
  --text:          #F3F1F7;
  --text-muted:    #9691A3;
  --border:        rgba(160, 90, 255, 0.15);
  --border-strong: rgba(160, 90, 255, 0.30);

  /* Elevation */
  --glow-soft:  0 0 24px rgba(180, 92, 255, 0.10);
  --glow-med:   0 0 32px rgba(180, 92, 255, 0.18);
  --shadow-card: 0 1px 0 rgba(255,255,255,0.03) inset, 0 20px 40px -20px rgba(0,0,0,0.5);

  /* Radii */
  --radius-lg: 18px;
  --radius:    14px;
  --radius-sm: 10px;
  --radius-xs: 6px;

  /* Spacing scale (8pt) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* Layout */
  --shell-max: 1440px;
  --shell-pad: 24px;
  --sidebar-w: 240px;
  --sidebar-gap: 24px;
  --bottom-nav-h: 72px;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
}
body {
  /* subtle radial background depth */
  background:
    radial-gradient(1200px 700px at 20% -10%, rgba(139, 61, 255, 0.06), transparent 60%),
    radial-gradient(900px 600px at 100% 100%, rgba(75, 27, 120, 0.10), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

a { color: var(--highlight); text-decoration: none; }
a:hover { text-decoration: none; }
button { font-family: inherit; }

/* ============================================================
   Shell — Centered, Fixed Max-Width
   ============================================================ */
.app {
  max-width: var(--shell-max);
  margin: 0 auto;
  padding: var(--shell-pad);
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: var(--sidebar-gap);
  min-height: 100vh;
  align-items: start;
}

/* ============================================================
   Sidebar — Floating Card
   ============================================================ */
.sidebar {
  background: linear-gradient(180deg, var(--surface), #0F0E17);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-4);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: var(--shell-pad);
  max-height: calc(100vh - (var(--shell-pad) * 2));
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.sidebar::before {
  /* subtle top-highlight */
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 92, 255, 0.30), transparent);
  pointer-events: none;
}

.sidebar .brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-2) 0 var(--space-6) 0;
}
.sidebar .brand img { width: 100%; max-width: 160px; height: auto; display: block; filter: drop-shadow(0 0 12px rgba(180, 92, 255, 0.25)); }
.sidebar .brand-sub {
  font-size: 10px; color: var(--text-muted);
  letter-spacing: 0.32em; text-transform: uppercase; font-weight: 600;
}

.nav {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: var(--space-2);
  min-height: 0;
  overflow-y: auto;
}
.nav a {
  display: flex; align-items: center; gap: var(--space-3);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 13px;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
  position: relative;
}
.nav a:hover {
  color: var(--text);
  background: rgba(139, 61, 255, 0.06);
}
.nav a.active {
  color: var(--text);
  background: linear-gradient(90deg, rgba(139, 61, 255, 0.16), rgba(139, 61, 255, 0.04));
}
.nav a.active .nav-icon { color: var(--highlight); }
.nav a.active::after {
  content: '';
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--highlight);
  box-shadow: 0 0 8px var(--highlight);
}
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.me {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  transition: background 140ms ease;
}
.me:hover { background: rgba(139, 61, 255, 0.04); }
.me-link { text-decoration: none; color: inherit; display: contents; }
.me img {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
}
.me-name { font-weight: 600; font-size: 13px; line-height: 1.2; }
.me-role { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.me .logout {
  margin-left: auto; padding: 6px 10px; border-radius: var(--radius-xs);
  background: transparent; border: 1px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-size: 11px; font-weight: 500;
  transition: all 140ms ease;
}
.me .logout:hover { color: var(--text); border-color: var(--border-strong); background: rgba(139, 61, 255, 0.06); }

/* ============================================================
   Main Content
   ============================================================ */
.main {
  min-width: 0; /* important: allow grid child to shrink */
  padding-bottom: var(--space-8);
}

/* ============================================================
   Page Header (soft hero bar)
   ============================================================ */
.page-header {
  position: relative;
  margin-bottom: var(--space-5);
  padding: var(--space-6) var(--space-8);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(600px 200px at 100% 0%, rgba(139, 61, 255, 0.10), transparent 60%),
    linear-gradient(180deg, var(--surface), var(--surface-2));
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.page-header::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 92, 255, 0.35), transparent);
}
.page-header h1 {
  margin: 0; font-size: clamp(20px, 2.6vw, 26px); font-weight: 700; letter-spacing: -0.015em;
}
.page-header .sub {
  margin-top: 4px;
  color: var(--text-muted); font-size: 13px;
}

/* ============================================================
   Cards + Grids
   ============================================================ */
.grid { display: grid; gap: var(--space-4); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.card {
  background: linear-gradient(180deg, var(--surface), #0F0E17);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  position: relative;
  box-shadow: var(--shadow-card);
  transition: border-color 200ms ease, box-shadow 200ms ease, transform 200ms ease;
}
.card::before {
  /* subtle top highlight for depth */
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 92, 255, 0.20), transparent);
  border-radius: var(--radius) var(--radius) 0 0;
  pointer-events: none;
}
.card.hoverable:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-card), var(--glow-soft);
  transform: translateY(-1px);
}
.card h2 {
  margin: 0 0 var(--space-4) 0;
  font-size: 12px; font-weight: 600; letter-spacing: 0.12em;
  color: var(--text-muted); text-transform: uppercase;
}

/* ============================================================
   Stat Cards
   ============================================================ */
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.18em; font-weight: 600; }
.stat .value { font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.stat .value.accent { color: var(--highlight); }
.stat .delta { font-size: 11px; color: var(--text-muted); }
.stat-row { display: flex; align-items: center; gap: var(--space-3); }
.stat-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(139, 61, 255, 0.12), rgba(139, 61, 255, 0.04));
  border: 1px solid var(--border);
  color: var(--highlight);
  flex-shrink: 0;
}

/* ============================================================
   Chart (bars)
   ============================================================ */
.chart {
  display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px;
  align-items: end; height: 140px;
}
.chart .bar {
  background: linear-gradient(180deg, var(--highlight), var(--primary));
  border-radius: 4px 4px 0 0;
  min-height: 4px;
  position: relative;
  opacity: 0.85;
  transition: opacity 140ms ease, box-shadow 140ms ease;
}
.chart .bar:hover { opacity: 1; box-shadow: var(--glow-soft); }
.chart .bar[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  background: var(--surface-2); border: 1px solid var(--border-strong);
  padding: 6px 10px; border-radius: var(--radius-xs); white-space: nowrap; font-size: 11px;
  color: var(--text); pointer-events: none; margin-bottom: 8px;
  box-shadow: var(--glow-soft);
  z-index: 5;
}

/* ============================================================
   Tables
   ============================================================ */
table.data {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
table.data th, table.data td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
table.data th {
  color: var(--text-muted); font-weight: 600;
  text-transform: uppercase; font-size: 10px; letter-spacing: 0.14em;
}
table.data tr:last-child td { border-bottom: none; }
table.data tr.row-clickable { cursor: pointer; transition: background 120ms ease; }
table.data tr.row-clickable:hover td { background: rgba(139, 61, 255, 0.05); }
table.data td.right, table.data th.right { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.num { font-variant-numeric: tabular-nums; color: var(--text); }

.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  vertical-align: middle; margin-right: 10px;
}
.rank {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; color: var(--text-muted); font-weight: 700;
  margin-right: 8px;
}
.rank.gold   { background: linear-gradient(135deg, #b8860b, #ffd700); color: #08070D; border-color: transparent; }
.rank.silver { background: linear-gradient(135deg, #7a7a7a, #d0d0d0); color: #08070D; border-color: transparent; }
.rank.bronze { background: linear-gradient(135deg, #7a3f1a, #cd7f32); color: #08070D; border-color: transparent; }

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 9px 16px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--border); cursor: pointer;
  font-size: 13px; font-weight: 500;
  transition: all 140ms ease;
  text-decoration: none;
}
.btn:hover {
  border-color: var(--border-strong);
  background: rgba(139, 61, 255, 0.10);
  transform: translateY(-1px);
}
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-hover));
  border-color: transparent;
  color: var(--text);
  box-shadow: 0 4px 20px -8px var(--primary), 0 0 0 1px rgba(139,61,255,0.4) inset;
}
.btn.primary:hover {
  background: linear-gradient(135deg, var(--highlight), var(--primary));
  box-shadow: 0 6px 24px -6px var(--highlight), 0 0 0 1px rgba(180,92,255,0.5) inset;
}

/* ============================================================
   Role Pills
   ============================================================ */
.role-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; color: var(--text);
  margin: 2px 4px 2px 0;
}
.role-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }

/* ============================================================
   Podium (Top 5)
   ============================================================ */
.podium {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--space-3);
  align-items: end;
  padding: var(--space-5) 0 0 0;
  min-height: 260px;
}
.podium-slot {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; position: relative;
  text-decoration: none; color: inherit; cursor: pointer;
  transition: transform 180ms ease;
}
.podium-slot:hover { transform: translateY(-4px); }
.podium-slot.empty-slot { visibility: hidden; }

.podium-rank {
  font-size: 12px; font-weight: 700; color: var(--text-muted);
  margin-bottom: var(--space-2); letter-spacing: 0.14em;
}
.podium-avatar-wrap {
  padding: 3px; border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  margin-bottom: var(--space-3);
  transition: box-shadow 200ms ease;
}
.podium-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  display: block; background: var(--surface-2);
}
.podium-name {
  font-weight: 600; font-size: 13px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 3px;
}
.podium-msg { font-size: 11px; color: var(--text-muted); margin-bottom: var(--space-3); }
.podium-pillar {
  width: 100%;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: linear-gradient(180deg, rgba(139, 61, 255, 0.16), rgba(139, 61, 255, 0.02));
  border: 1px solid var(--border);
  border-bottom: none;
}

.podium-slot.rank-1 .podium-avatar-wrap { border-color: #ffd700; box-shadow: 0 0 24px rgba(255, 215, 0, 0.30); }
.podium-slot.rank-1 .podium-avatar { width: 88px; height: 88px; }
.podium-slot.rank-1 .podium-pillar { height: 160px; background: linear-gradient(180deg, rgba(255, 215, 0, 0.30), rgba(139, 61, 255, 0.06)); border-color: rgba(255, 215, 0, 0.35); }
.podium-slot.rank-1 .podium-rank { color: #ffd700; font-size: 16px; }

.podium-slot.rank-2 .podium-avatar-wrap { border-color: #d0d0d0; box-shadow: 0 0 20px rgba(208, 208, 208, 0.22); }
.podium-slot.rank-2 .podium-pillar { height: 120px; background: linear-gradient(180deg, rgba(208, 208, 208, 0.20), rgba(139, 61, 255, 0.04)); border-color: rgba(208, 208, 208, 0.25); }
.podium-slot.rank-2 .podium-rank { color: #d0d0d0; font-size: 14px; }

.podium-slot.rank-3 .podium-avatar-wrap { border-color: #cd7f32; box-shadow: 0 0 20px rgba(205, 127, 50, 0.25); }
.podium-slot.rank-3 .podium-pillar { height: 90px; background: linear-gradient(180deg, rgba(205, 127, 50, 0.22), rgba(139, 61, 255, 0.04)); border-color: rgba(205, 127, 50, 0.28); }
.podium-slot.rank-3 .podium-rank { color: #cd7f32; font-size: 13px; }

.podium-slot.rank-4 .podium-pillar,
.podium-slot.rank-5 .podium-pillar { height: 60px; }

/* ============================================================
   Voice Channels (live)
   ============================================================ */
.voice-channel {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: var(--space-4); background: linear-gradient(180deg, var(--surface), #0F0E17);
  box-shadow: var(--shadow-card);
}
.voice-channel .ch-name { font-weight: 600; margin-bottom: var(--space-3); color: var(--highlight); font-size: 14px; }
.voice-channel .members { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.voice-member {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 4px 10px 4px 4px; border-radius: 999px; font-size: 12px;
}
.voice-member img { width: 22px; height: 22px; border-radius: 50%; }
.voice-member .mic { font-size: 10px; color: var(--text-muted); }

/* ============================================================
   Heatmap
   ============================================================ */
.heatmap {
  display: grid;
  grid-template-columns: 32px repeat(24, 1fr);
  gap: 3px;
  padding: 4px 0;
}
.hm-corner { grid-column: 1; }
.hm-dlabel {
  font-size: 10px; color: var(--text-muted);
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: 8px;
}
.hm-hlabel { font-size: 10px; color: var(--text-muted); text-align: left; }
.hm-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  min-height: 12px;
  transition: transform 100ms ease, outline 100ms ease;
}
.hm-cell:hover {
  transform: scale(1.5); z-index: 2; position: relative;
  outline: 1px solid var(--border-strong);
}

/* ============================================================
   Achievements / Badges
   ============================================================ */
.badges { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.badge {
  display: inline-flex; align-items: center; gap: var(--space-2);
  padding: 7px 12px; border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 12px; font-weight: 500;
  transition: transform 140ms ease;
}
.badge:hover { transform: translateY(-1px); }
.badge-icon { font-size: 15px; line-height: 1; }
.badge.badge-bronze { border-color: rgba(205, 127, 50, 0.35); }
.badge.badge-silver { border-color: rgba(208, 208, 208, 0.30); }
.badge.badge-gold   { border-color: rgba(255, 215, 0, 0.40); background: linear-gradient(180deg, rgba(255,215,0,0.10), rgba(255,215,0,0.02)); }
.badge.badge-purple { border-color: var(--border-strong); background: linear-gradient(180deg, rgba(139,61,255,0.14), rgba(139,61,255,0.04)); box-shadow: var(--glow-soft); }

/* ============================================================
   Profile
   ============================================================ */
.profile-hero {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: var(--space-5);
  align-items: center;
}
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  border: 2px solid var(--border-strong);
  background: var(--surface-2);
}
.profile-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.profile-name { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }
.profile-username { font-size: 12px; }
.profile-roles { display: flex; flex-wrap: wrap; margin-top: 4px; }

.profile-level {
  display: flex; flex-direction: column; gap: var(--space-2);
  min-width: 240px;
}
.level-badge {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--highlight), var(--primary));
  color: var(--bg);
  font-weight: 800; font-size: 13px;
  padding: 5px 14px; border-radius: 999px;
  box-shadow: 0 4px 20px -4px rgba(139, 61, 255, 0.45);
  letter-spacing: 0.02em;
}
.xp-bar {
  height: 8px; border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--border);
}
.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--highlight));
  transition: width 500ms ease;
  box-shadow: 0 0 12px var(--highlight);
}
.xp-text { font-size: 11px; text-align: right; color: var(--text-muted); }

/* ============================================================
   Login Page
   ============================================================ */
.login-wrap {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: var(--space-6);
  background:
    radial-gradient(800px 500px at 30% 20%, rgba(139, 61, 255, 0.14), transparent 60%),
    radial-gradient(600px 400px at 80% 80%, rgba(75, 27, 120, 0.18), transparent 60%),
    var(--bg);
}
.login-card {
  background: linear-gradient(180deg, var(--surface), #0F0E17);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-10) var(--space-8);
  width: min(420px, 100%);
  text-align: center;
  box-shadow: var(--shadow-card), var(--glow-med);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; inset: 0 0 auto 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(180, 92, 255, 0.40), transparent);
}
.login-logo {
  width: 100%; max-width: 240px; height: auto;
  display: block; margin: 0 auto var(--space-2) auto;
  filter: drop-shadow(0 0 20px rgba(180, 92, 255, 0.35));
}
.login-card .tag {
  color: var(--text-muted); letter-spacing: 0.32em; text-transform: uppercase;
  font-size: 10px; font-weight: 600;
  margin-bottom: var(--space-6);
}
.login-card p { color: var(--text-muted); font-size: 13px; margin-bottom: var(--space-5); }

/* ============================================================
   Empty States
   ============================================================ */
.empty {
  padding: 40px 20px; text-align: center; color: var(--text-muted);
  display: flex; flex-direction: column; align-items: center; gap: var(--space-3);
}
.empty img { width: 96px; height: auto; opacity: 0.4; }

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(180, 92, 255, 0.25);
  border-top-color: var(--highlight);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Utilities
   ============================================================ */
.spacer { flex: 1; }
.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 12px; }
.muted { color: var(--text-muted); }
.center { text-align: center; }
.hidden { display: none !important; }

/* ============================================================
   Mobile Bottom-Nav (shown < 900px)
   ============================================================ */
.mobile-topbar { display: none; }
.mobile-bottom-nav { display: none; }

@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  :root { --shell-pad: 16px; }
  .app {
    grid-template-columns: 1fr;
    padding-bottom: calc(var(--bottom-nav-h) + 24px);
  }
  /* Hide desktop sidebar */
  .sidebar { display: none; }

  /* Mobile top-bar: brand + avatar */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(180deg, var(--surface), rgba(17, 16, 26, 0.9));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: var(--space-4);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-card);
  }
  .mobile-topbar .brand-mini {
    font-weight: 900; font-size: 18px; letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--highlight), var(--primary));
    -webkit-background-clip: text; background-clip: text; color: transparent;
  }
  .mobile-topbar img {
    width: 32px; height: 32px; border-radius: 50%;
    border: 1px solid var(--border-strong);
  }
  .mobile-topbar .logout {
    padding: 6px 12px; border-radius: var(--radius-xs);
    background: transparent; border: 1px solid var(--border);
    color: var(--text-muted); font-size: 11px; cursor: pointer;
    margin-left: 10px;
  }

  /* Mobile bottom-nav (floating pill) */
  .mobile-bottom-nav {
    display: flex; justify-content: space-around; align-items: center;
    position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: linear-gradient(180deg, var(--surface), #0F0E17);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 8px 10px;
    box-shadow: var(--shadow-card), var(--glow-med);
    z-index: 100;
    width: min(400px, calc(100vw - 32px));
    backdrop-filter: blur(10px);
  }
  .mobile-bottom-nav a {
    display: flex; flex-direction: column; align-items: center;
    padding: 8px 12px; border-radius: 999px;
    color: var(--text-muted); font-size: 10px; font-weight: 600;
    text-decoration: none;
    transition: all 140ms ease;
    gap: 3px;
  }
  .mobile-bottom-nav a.active {
    color: var(--text);
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    box-shadow: 0 4px 16px -4px var(--primary);
  }
  .mobile-bottom-nav a:not(.active):hover { color: var(--text); }
  .mobile-bottom-nav .nav-icon { width: 20px; height: 20px; }
  .mobile-bottom-nav .nav-label { display: none; }
  .mobile-bottom-nav a.active .nav-label { display: block; }

  /* Layout tweaks on mobile */
  .page-header { padding: var(--space-5) var(--space-4); }
  .card { padding: var(--space-4); }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .profile-hero { grid-template-columns: 1fr; text-align: center; gap: var(--space-3); }
  .profile-avatar { margin: 0 auto; }
  .profile-roles { justify-content: center; }
  .profile-level { align-items: center; min-width: 0; }
  .level-badge { align-self: center; }
  .heatmap { grid-template-columns: 20px repeat(24, 1fr); gap: 2px; }
  .hm-cell { min-height: 8px; }
  .hm-dlabel { padding-right: 4px; }
  .hm-hlabel { display: none; }
  .podium { grid-template-columns: 1fr; min-height: auto; gap: var(--space-2); }
  .podium-slot { flex-direction: row; gap: var(--space-3); text-align: left; align-items: center; }
  .podium-slot .podium-pillar { display: none; }
  .podium-slot .podium-rank { margin-bottom: 0; }
  .podium-slot .podium-avatar-wrap { margin-bottom: 0; }
  .podium-slot.rank-1 .podium-avatar { width: 64px; height: 64px; }
  .podium-name { font-size: 14px; margin-bottom: 0; }
  .podium-msg { margin-bottom: 0; }
}
