/* ============================================================
   Top Dog In My Hood — game.css
   Visual identity: dark urban, premium, street-status
   ============================================================ */

/* ---------- Custom Properties ---------- */
:root {
  --bg:          #0a0508;
  --surface:     #130b0e;
  --surface2:    #1c1013;
  --surface3:    #251519;
  --accent:      #ff3b5c;
  --accent-dim:  #cc2f4a;
  --accent2:     #ff8c00;
  --accent2-dim: #cc7000;
  --text:        #f0e8ea;
  --muted:       #6b5560;
  --muted2:      #3d2830;
  --border:      #2a1820;
  --radius:      12px;
  --radius-sm:   8px;
  --radius-pill: 999px;
  --topbar-h:    60px;
  --panel-w:     300px;
  --transition:  0.22s ease;
  --shadow-glow-accent:  0 0 24px rgba(255,59,92,0.35);
  --shadow-glow-gold:    0 0 32px rgba(255,140,0,0.45);
  --shadow-surface:      0 4px 24px rgba(0,0,0,0.5);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; outline: none; }
input  { font-family: inherit; outline: none; border: none; }
a { color: inherit; text-decoration: none; }

/* ---------- Layout Shell ---------- */
#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ---------- Top Bar ---------- */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  z-index: 100;
  backdrop-filter: blur(12px);
}

#topbar .logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--accent);
  text-transform: uppercase;
  flex-shrink: 0;
}
#topbar .logo span { color: var(--text); }

#topbar .spacer { flex: 1; }

/* Reputation chip in topbar */
#rep-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  font-size: 13px;
}
#rep-chip .rep-value {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
#rep-chip .rep-label { color: var(--muted); font-size: 12px; }
#rep-chip .tier-badge { font-weight: 700; font-size: 12px; }

/* Tier badge colors */
.tier-badge.tier-pup        { color: var(--muted); }
.tier-badge.tier-streetdog  { color: var(--accent); }
.tier-badge.tier-alpha      { color: var(--accent); text-shadow: 0 0 8px rgba(255,59,92,0.6); }
.tier-badge.tier-topdog     { color: var(--accent2); text-shadow: 0 0 8px rgba(255,140,0,0.7); }

/* Avatar button in topbar */
#topbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--muted2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition);
  border: 2px solid var(--border);
}
#topbar-avatar:hover { border-color: var(--accent); }

#logout-btn {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  transition: var(--transition);
  flex-shrink: 0;
}
#logout-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Main Content ---------- */
#main {
  display: flex;
  flex: 1;
  margin-top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

/* ---------- Left Panel (Avatar) ---------- */
#left-panel {
  width: var(--panel-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 24px;
  gap: 20px;
  overflow-y: auto;
}
#left-panel::-webkit-scrollbar { width: 4px; }
#left-panel::-webkit-scrollbar-track { background: transparent; }
#left-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ---------- Avatar Display ---------- */
.avatar-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  /* size is controlled per tier */
}

.avatar-circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--text);
  position: relative;
  transition: all 0.4s ease;
  background: var(--surface2);
}

/* --- Tier: Pup --- */
.tier-pup .avatar-circle {
  width: 100px;
  height: 100px;
  font-size: 36px;
  border: 3px solid var(--muted2);
  box-shadow: none;
  opacity: 0.75;
}

/* --- Tier: Street Dog --- */
.tier-streetdog .avatar-circle {
  width: 130px;
  height: 130px;
  font-size: 46px;
  border: 3px solid var(--accent);
  box-shadow: 0 0 14px rgba(255,59,92,0.2);
}

/* --- Tier: Alpha --- */
.tier-alpha .avatar-circle {
  width: 155px;
  height: 155px;
  font-size: 56px;
  border: 3px solid var(--accent);
  box-shadow:
    0 0 0 6px rgba(255,59,92,0.12),
    0 0 28px rgba(255,59,92,0.45),
    0 0 60px rgba(255,59,92,0.15);
}

/* --- Tier: Top Dog --- */
.tier-topdog .avatar-circle {
  width: 170px;
  height: 170px;
  font-size: 62px;
  border: 3px solid var(--accent2);
  box-shadow:
    0 0 0 8px rgba(255,140,0,0.12),
    0 0 36px rgba(255,140,0,0.55),
    0 0 80px rgba(255,140,0,0.2);
  animation: topdog-pulse 2.8s ease-in-out infinite;
}

@keyframes topdog-pulse {
  0%, 100% {
    box-shadow:
      0 0 0 8px rgba(255,140,0,0.12),
      0 0 36px rgba(255,140,0,0.55),
      0 0 80px rgba(255,140,0,0.2);
  }
  50% {
    box-shadow:
      0 0 0 14px rgba(255,140,0,0.08),
      0 0 56px rgba(255,140,0,0.75),
      0 0 110px rgba(255,140,0,0.28);
  }
}

/* Alpha secondary glow ring */
.tier-alpha .avatar-circle::after {
  content: '';
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1px solid rgba(255,59,92,0.25);
  pointer-events: none;
}

/* Top Dog crown indicator */
.tier-topdog .avatar-wrap::before {
  content: '♔';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 18px;
  color: var(--accent2);
  filter: drop-shadow(0 0 6px rgba(255,140,0,0.7));
  animation: crown-float 3s ease-in-out infinite;
}

@keyframes crown-float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-4px); }
}

/* ---------- Profile Info ---------- */
.profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  letter-spacing: -0.3px;
}

.rename-btn {
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  padding: 3px 6px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  border: 1px solid transparent;
  line-height: 1;
}
.rename-btn:hover {
  color: var(--text);
  border-color: var(--border);
  background: var(--surface2);
}

.weekly-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent2);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  text-align: center;
  padding: 4px 12px;
  background: rgba(255,140,0,0.08);
  border: 1px solid rgba(255,140,0,0.2);
  border-radius: var(--radius-pill);
  width: fit-content;
  margin: 0 auto;
}

.tier-name-display {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  padding: 4px 14px;
  border-radius: var(--radius-pill);
}
.tier-name-display.tier-pup       { color: var(--muted); background: rgba(107,85,96,0.1); border: 1px solid var(--muted2); }
.tier-name-display.tier-streetdog { color: var(--accent); background: rgba(255,59,92,0.08); border: 1px solid rgba(255,59,92,0.2); }
.tier-name-display.tier-alpha     { color: var(--accent); background: rgba(255,59,92,0.1); border: 1px solid rgba(255,59,92,0.3); text-shadow: 0 0 8px rgba(255,59,92,0.4); }
.tier-name-display.tier-topdog    { color: var(--accent2); background: rgba(255,140,0,0.1); border: 1px solid rgba(255,140,0,0.3); text-shadow: 0 0 8px rgba(255,140,0,0.5); }

.rep-score-big {
  text-align: center;
  line-height: 1;
}
.rep-score-big .rep-number {
  font-size: 48px;
  font-weight: 900;
  letter-spacing: -2px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  display: block;
}
.rep-score-big .rep-unit {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-top: 4px;
  display: block;
}

.zone-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zone-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
}
.zone-item .zone-level {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  font-size: 10px;
}
.zone-item .zone-name {
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
  text-align: right;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  flex-shrink: 0;
}

/* ---------- Right Panel ---------- */
#right-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---------- Tab System ---------- */
.tab-bar {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  flex-shrink: 0;
}

.tab-btn {
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 16px 18px;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  transition: var(--transition);
  position: relative;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.tab-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}
.tab-content::-webkit-scrollbar { width: 6px; }
.tab-content::-webkit-scrollbar-track { background: transparent; }
.tab-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---------- Zone Tab ---------- */
.zone-cards {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.zone-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  transition: var(--transition);
}
.zone-card:hover { border-color: var(--muted2); }
.zone-card.active-zone { border-color: rgba(255,59,92,0.25); }

.zone-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.zone-card-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.zone-card-level {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.zone-card-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}
.zone-rank-badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.zone-rank-badge .rank-pos {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.zone-rank-badge .rank-label {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.zone-rank-badge.rank-1 { border-color: rgba(255,140,0,0.4); background: rgba(255,140,0,0.06); }
.zone-rank-badge.rank-1 .rank-pos { color: var(--accent2); }
.zone-rank-badge.rank-top { border-color: rgba(255,59,92,0.3); background: rgba(255,59,92,0.06); }
.zone-rank-badge.rank-top .rank-pos { color: var(--accent); }

.zone-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--muted);
}
.zone-meta span { display: flex; align-items: center; gap: 4px; }
.zone-meta .dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--muted2);
  display: inline-block;
}

.zone-top3 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.zone-top3-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 2px;
}
.zone-player-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.zone-player-row .pos {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  width: 18px;
  text-align: center;
}
.zone-player-row .pos.gold   { color: var(--accent2); }
.zone-player-row .pos.silver { color: #94a3b8; }
.zone-player-row .pos.bronze { color: #b97d4b; }
.zone-player-row .pname { flex: 1; font-weight: 600; color: var(--text); }
.zone-player-row .prep  { font-weight: 700; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.zone-player-row.is-me  { background: rgba(255,59,92,0.08); border: 1px solid rgba(255,59,92,0.2); }

/* ---------- Actions Tab ---------- */
.actions-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 560px;
}

.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: var(--transition);
}
.action-card:hover { border-color: var(--muted2); }

.action-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.action-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.action-card-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  line-height: 1.6;
}
.rep-gain {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(255,59,92,0.1);
  border: 1px solid rgba(255,59,92,0.2);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  white-space: nowrap;
}

/* Primary action button */
.btn-action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 15px 24px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.btn-action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.06);
  opacity: 0;
  transition: opacity 0.15s;
}
.btn-action:hover::before { opacity: 1; }
.btn-action:active { transform: scale(0.98); }

.btn-claim {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255,59,92,0.35);
}
.btn-claim:hover { box-shadow: 0 6px 28px rgba(255,59,92,0.5); }

.btn-boost {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-boost:hover { border-color: var(--accent); color: var(--accent); }

.btn-location {
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-location:hover { border-color: var(--accent); color: var(--text); }

/* Cooldown state */
.btn-action.on-cooldown,
.btn-action:disabled {
  background: var(--surface2) !important;
  color: var(--muted) !important;
  box-shadow: none !important;
  cursor: not-allowed;
}
.btn-action.on-cooldown::before { display: none; }

/* Countdown display */
.countdown {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 8px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--muted);
}
.countdown.visible { display: flex; }
.countdown .countdown-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5px;
}
.countdown-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: blink 1.4s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

/* Referral section */
.referral-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.referral-card .card-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 14px;
}
.referral-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.referral-code {
  flex: 1;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 2px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.btn-copy {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-copy:hover { border-color: var(--accent); color: var(--accent); }
.btn-copy.copied { border-color: #22c55e; color: #22c55e; }

.referral-bonus {
  font-size: 13px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.referral-bonus strong { color: var(--accent2); font-weight: 700; }

/* Location card */
.location-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.location-card .loc-info { flex: 1; }
.location-card .loc-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.location-card .loc-desc {
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Rankings Tab ---------- */
.rankings-container { display: flex; flex-direction: column; gap: 16px; }

.rankings-toggle {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.rankings-toggle .toggle-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--transition);
}
.rankings-toggle .toggle-btn:hover { color: var(--text); border-color: var(--muted); }
.rankings-toggle .toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 2px 12px rgba(255,59,92,0.3);
}

.leaderboard-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.leaderboard-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.leaderboard-header .lb-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.leaderboard-header .lb-count {
  font-size: 11px;
  color: var(--muted);
}

.leaderboard-list {
  list-style: none;
  max-height: 440px;
  overflow-y: auto;
}
.leaderboard-list::-webkit-scrollbar { width: 4px; }
.leaderboard-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.lb-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.lb-item:last-child { border-bottom: none; }
.lb-item:hover { background: var(--surface2); }

.lb-item.is-me {
  background: rgba(255,59,92,0.07);
  border-left: 3px solid var(--accent);
}

.lb-rank {
  width: 28px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.lb-rank.gold   { color: var(--accent2); font-size: 15px; }
.lb-rank.silver { color: #94a3b8; }
.lb-rank.bronze { color: #b97d4b; }

/* Tier color indicator strip */
.lb-tier-bar {
  width: 3px;
  height: 28px;
  border-radius: 2px;
  flex-shrink: 0;
}
.lb-tier-bar.tier-pup       { background: var(--muted2); }
.lb-tier-bar.tier-streetdog { background: var(--accent); opacity: 0.7; }
.lb-tier-bar.tier-alpha     { background: var(--accent); }
.lb-tier-bar.tier-topdog    { background: var(--accent2); }

.lb-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.lb-avatar.tier-streetdog { border: 1.5px solid rgba(255,59,92,0.4); }
.lb-avatar.tier-alpha     { border: 1.5px solid var(--accent); box-shadow: 0 0 8px rgba(255,59,92,0.3); }
.lb-avatar.tier-topdog    { border: 1.5px solid var(--accent2); box-shadow: 0 0 10px rgba(255,140,0,0.4); }

.lb-info { flex: 1; min-width: 0; }
.lb-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lb-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}
.lb-sub .weekly-badge {
  color: var(--accent2);
  font-weight: 600;
}

.lb-rep {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
  flex-shrink: 0;
}

/* Narrative position message */
.rank-narrative {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 12px 18px;
  background: var(--surface2);
  border-top: 1px solid var(--border);
}
.rank-narrative strong { color: var(--accent); }

/* ---------- Loading & Empty ---------- */
.skeleton-row {
  height: 52px;
  background: linear-gradient(90deg, var(--surface2) 0%, var(--surface3) 50%, var(--surface2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: var(--radius-sm);
  margin-bottom: 6px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.empty-state p { font-size: 14px; line-height: 1.6; }

/* ---------- Toast Notifications ---------- */
#toast-container {
  position: fixed;
  bottom: 28px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-surface);
  animation: toast-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  min-width: 240px;
  max-width: 360px;
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.toast.toast-success { border-left: 3px solid #22c55e; }
.toast.toast-error   { border-left: 3px solid var(--accent); }
.toast.toast-info    { border-left: 3px solid #3b82f6; }
.toast.toast-gold    { border-left: 3px solid var(--accent2); }
.toast.toast-out     { animation: toast-out 0.25s ease forwards; }

@keyframes toast-in {
  from { opacity: 0; transform: translateX(40px) scale(0.92); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toast-out {
  from { opacity: 1; transform: translateX(0) scale(1); }
  to   { opacity: 0; transform: translateX(40px) scale(0.92); }
}

/* ---------- Modal (Rename) ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  backdrop-filter: blur(6px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fade-in 0.18s ease;
}
.modal-overlay.hidden { display: none; }

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-surface);
  animation: modal-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modal-in {
  from { transform: scale(0.9) translateY(16px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}
.modal-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 20px;
}
.modal-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
  transition: border-color 0.15s;
}
.modal-input:focus { border-color: var(--accent); }
.modal-input::placeholder { color: var(--muted); font-weight: 400; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}
.btn-modal-cancel {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: var(--transition);
}
.btn-modal-cancel:hover { color: var(--text); border-color: var(--muted); }
.btn-modal-save {
  background: var(--accent);
  color: #fff;
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 700;
  transition: var(--transition);
  box-shadow: 0 2px 12px rgba(255,59,92,0.3);
}
.btn-modal-save:hover { background: var(--accent-dim); }

/* ---------- Utility ---------- */
.hidden { display: none !important; }
.text-accent  { color: var(--accent); }
.text-gold    { color: var(--accent2); }
.text-muted   { color: var(--muted); }

/* ---------- Responsive — Mobile ---------- */
@media (max-width: 700px) {
  :root { --panel-w: 100%; }

  #main { flex-direction: column; overflow-y: auto; height: auto; }

  #left-panel {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--border);
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 16px;
    gap: 14px;
    overflow: visible;
  }

  /* Collapse avatar to smaller strip on mobile */
  .avatar-wrap { order: 0; }
  .tier-pup .avatar-circle      { width: 60px; height: 60px; font-size: 22px; }
  .tier-streetdog .avatar-circle { width: 64px; height: 64px; font-size: 24px; }
  .tier-alpha .avatar-circle     { width: 68px; height: 68px; font-size: 26px; }
  .tier-topdog .avatar-circle    { width: 72px; height: 72px; font-size: 28px; }
  .tier-topdog .avatar-wrap::before { top: -12px; font-size: 13px; }

  .profile-name-row { justify-content: flex-start; order: 1; flex: 1; flex-wrap: wrap; }
  .profile-name { font-size: 16px; }

  .weekly-title { order: 2; }
  .tier-name-display { order: 3; }

  .rep-score-big { order: 4; flex: 0 0 auto; }
  .rep-score-big .rep-number { font-size: 32px; }

  .zone-info { order: 5; width: 100%; flex-direction: row; overflow-x: auto; }
  .zone-item { flex-shrink: 0; }
  .divider { display: none; }

  #right-panel { flex: 1; min-height: 0; }
  body, html { overflow: auto; }
  #app { height: auto; min-height: 100vh; }
}

@media (max-width: 400px) {
  #topbar { padding: 0 12px; gap: 10px; }
  #topbar .logo { font-size: 15px; }
  #rep-chip { padding: 5px 10px; }
  .tab-btn { padding: 14px 12px; font-size: 11px; }
  .tab-content { padding: 16px; }
}
