/* ============================================
   EDGYCORE — Neon Economy
   Violet cyberpunk life simulation
   ============================================ */

:root {
  /* Surfaces — deep dark */
  --bg-0: #06050d;
  --bg-1: #0a0814;
  --bg-2: #100d1f;
  --bg-3: #181430;
  --bg-4: #211c3f;
  --bg-5: #2c2552;

  /* Borders — violet hint */
  --border: rgba(167, 139, 250, 0.08);
  --border-mid: rgba(167, 139, 250, 0.18);
  --border-strong: rgba(167, 139, 250, 0.32);

  /* Text — cool, brightened for readability */
  --text-0: #f4f1ff;
  --text-1: #d2cdf0;
  --text-2: #9590bd;
  --text-3: #8b84b3;   /* lifted from #756e9c for WCAG AA contrast on cards */
  --text-4: #4a4480;

  /* Brand violet (was amber) */
  --amber: #a78bfa;
  --amber-soft: #c4b5fd;
  --amber-deep: #6d4bd8;
  --amber-glow: rgba(167, 139, 250, 0.28);

  /* Cyan secondary */
  --violet: #22d3ee;
  --violet-soft: #67e8f9;
  --violet-glow: rgba(34, 211, 238, 0.28);

  /* Pink accent */
  --pink: #ec4899;
  --pink-soft: #f9a8d4;

  /* Currency */
  --gold: #fbbf24;
  --gold-soft: #fcd34d;

  /* Semantic */
  --success: #34d399;
  --success-bg: rgba(52, 211, 153, 0.1);
  --success-border: rgba(52, 211, 153, 0.3);

  --danger: #f43f5e;
  --danger-bg: rgba(244, 63, 94, 0.1);
  --danger-border: rgba(244, 63, 94, 0.3);

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);

  /* Effects */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 32px rgba(167, 139, 250, 0.18);

  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;

  /* Ramp endpoints used a few times raw */
  --violet-deep: #0891b2;   /* cyan-deep */
  --gold-deep: #d97706;

  /* ── Spacing scale (4px base) — single rhythm across the platform ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* ── Layout rhythm tokens (shared by every card/grid/section) ── */
  --card-pad: 24px;        /* primary card inner padding */
  --card-pad-sm: 16px;     /* nested tile padding */
  --grid-gap: 20px;        /* primary catalog/KPI grids */
  --grid-gap-dense: 12px;  /* dense tile clusters */
  --section-gap: 28px;     /* kpi-row → first content block */
  --header-mb: 18px;       /* card/section header bottom margin */

  /* Layout */
  --sidebar-w: 232px;
  --topbar-h: 80px;
  --content-max: 1440px;
  --gutter: 32px;          /* horizontal content gutter (mobile 16px) */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Accessibility: a single visible keyboard-focus ring for every interactive
   control. Mouse clicks don't trigger :focus-visible, so this only shows for
   keyboard/AT users — no visual change for pointer users. Never strip an
   `outline` without providing this. */
:focus-visible {
  outline: 2px solid var(--amber-soft);
  outline-offset: 2px;
  border-radius: 4px;
}
a:focus-visible, button:focus-visible, [role="button"]:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible,
.nav-item:focus-visible, .tab:focus-visible, .seg:focus-visible,
.cas-tab:focus-visible, .btn:focus-visible, summary:focus-visible {
  outline: 2px solid var(--amber-soft);
  outline-offset: 2px;
}

html, body {
  height: 100%;
  background: var(--bg-0);
  color: var(--text-0);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
  letter-spacing: -0.005em;
  overflow-x: hidden;
}

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--bg-5); }

/* ============================================
   APP SHELL
   ============================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 2;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  border-right: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 8, 20, 0.88) 0%, rgba(6, 5, 13, 0.92) 100%);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  z-index: 10;
  transition: transform 0.3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 8px 22px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--amber-deep) 0%, #2a1d4d 100%);
  border: 1px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 20px var(--amber-glow);
}

.brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(196, 181, 253, 0.5), transparent 60%);
}

.brand-mark svg {
  width: 18px;
  height: 18px;
  color: var(--amber-soft);
  position: relative;
  z-index: 1;
}

.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text-0);
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 9px;
  color: var(--violet);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-top: 4px;
  font-weight: 700;
}

.nav-section { margin-bottom: 16px; }

.nav-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-3);
  font-weight: 700;
  padding: 0 12px;
  margin-bottom: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-1);
  cursor: pointer;
  font-size: 14.5px;
  font-weight: 500;
  transition: all 0.15s ease;
  position: relative;
  user-select: none;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--text-0);
}

.nav-item.active {
  background: linear-gradient(90deg, rgba(167, 139, 250, 0.12), rgba(167, 139, 250, 0.04));
  color: var(--text-0);
  border: 1px solid var(--border-mid);
  box-shadow: inset 0 0 12px rgba(167, 139, 250, 0.06);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--amber-soft), var(--amber));
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--amber);
}

.nav-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.9; }
.nav-item .nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  line-height: 1;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(244, 63, 94, 0.25), 0 2px 8px rgba(244, 63, 94, 0.5);
  animation: nav-badge-pop 0.28s ease;
}
@keyframes nav-badge-pop {
  0% { transform: scale(0); }
  70% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

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

.quick-wallet {
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.08), rgba(34, 211, 238, 0.04));
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.quick-wallet::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.2), transparent 60%);
}
.quick-wallet > * { position: relative; z-index: 1; }
.quick-wallet-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-2);
  font-weight: 700;
}
.quick-wallet-amt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 17px;
  font-weight: 600;
  color: var(--gold);
  margin-top: 4px;
  letter-spacing: -0.01em;
}

.player-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.15s;
}

.player-card:hover { background: var(--bg-3); }

.player-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  color: white;
  flex-shrink: 0;
  box-shadow: 0 0 12px var(--amber-glow);
}

.player-info { flex: 1; min-width: 0; }
.player-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-status {
  font-size: 10.5px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
}
.player-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* Main */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}

.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 8, 20, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.mobile-menu-btn {
  display: none;
  width: 36px; height: 36px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  color: var(--text-1);
  cursor: pointer;
  margin-right: 12px;
}
.mobile-menu-btn svg { width: 16px; height: 16px; }

.topbar-left h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--text-0);
  line-height: 1.1;
}
.topbar-left .crumb {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 4px;
  letter-spacing: 0.02em;
  font-weight: 500;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search {
  position: relative;
  width: 280px;
}
.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-0);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: all 0.15s;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { border-color: var(--border-strong); background: var(--bg-3); }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--text-2); }
.search kbd {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-3);
  background: var(--bg-3);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 4px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-1);
  transition: all 0.15s;
  position: relative;
}
.icon-btn:hover { background: var(--bg-3); color: var(--text-0); border-color: var(--border-mid); }
.icon-btn svg { width: 15px; height: 15px; }
.icon-btn .dot {
  position: absolute;
  top: 9px;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 6px var(--amber);
}

.prestige-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, var(--bg-3), var(--bg-2));
  border: 1px solid var(--border-mid);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-0);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.prestige-pill:hover { border-color: var(--border-strong); }
.prestige-pill .gem {
  width: 12px;
  height: 12px;
  background: linear-gradient(135deg, var(--amber-soft), var(--amber-deep));
  border-radius: 2px;
  transform: rotate(45deg);
  box-shadow: 0 0 10px var(--amber);
}

.content {
  padding: 28px 32px 64px;
  max-width: var(--content-max);
  width: 100%;
  margin: 0 auto;
}

/* ============================================
   PRIMITIVES
   ============================================ */

.card {
  background: linear-gradient(180deg, rgba(16, 13, 31, 0.7) 0%, rgba(10, 8, 20, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  position: relative;
  transition: border-color 0.15s;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.card:hover { border-color: var(--border-mid); }

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 12.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-1);
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 4px;
}

.btn {
  height: 38px;
  padding: 0 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-0);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn:hover { background: var(--bg-4); }
.btn svg { width: 13px; height: 13px; }

.btn-primary {
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  border: 1px solid var(--amber-soft);
  color: white;
  font-weight: 700;
  box-shadow: 0 4px 16px var(--amber-glow);
}
.btn-primary:hover { background: linear-gradient(135deg, var(--amber-soft) 0%, var(--amber) 100%); box-shadow: 0 4px 22px var(--amber-glow); }

.btn-violet {
  background: linear-gradient(135deg, var(--violet) 0%, #0891b2 100%);
  border: 1px solid var(--violet-soft);
  color: var(--bg-0);
  font-weight: 700;
  box-shadow: 0 4px 16px var(--violet-glow);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-2); border-color: var(--border-mid); }

.btn-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger);
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.18); }

.btn-sm { height: 30px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pill-success { background: var(--success-bg); border-color: var(--success-border); color: var(--success); }
.pill-danger { background: var(--danger-bg); border-color: var(--danger-border); color: var(--danger); }
.pill-warning { background: var(--warning-bg); border-color: rgba(245, 158, 11, 0.3); color: var(--warning); }
.pill-amber { background: var(--amber-glow); border-color: rgba(167, 139, 250, 0.3); color: var(--amber-soft); }
.pill-violet { background: var(--violet-glow); border-color: rgba(34, 211, 238, 0.3); color: var(--violet-soft); }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

.mono { font-family: 'JetBrains Mono', monospace; font-feature-settings: 'tnum'; }
.serif { font-family: 'Instrument Serif', serif; }

.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-amber, .text-violet-x { color: var(--amber-soft); }
.text-violet { color: var(--violet-soft); }
.text-gold { color: var(--gold); }
.text-1 { color: var(--text-1); }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }

/* ============================================
   SCREENS
   ============================================ */
.screen { display: none; animation: fadeIn 0.35s ease; }
.screen.active { display: block; }

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

.tagline {
  font-size: 16px;
  color: var(--text-1);
  font-style: italic;
  margin-top: -4px;
  margin-bottom: 24px;
  font-family: 'Instrument Serif', serif;
  letter-spacing: 0.01em;
}

/* Dashboard */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
}

.balance-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
}

.balance-card::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.12), transparent 60%);
  pointer-events: none;
}

.balance-amount {
  font-family: 'Instrument Serif', serif;
  font-size: 64px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 8px 0 4px;
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-0);
}

.balance-amount .ccy {
  font-size: 36px;
  color: var(--gold);
  font-weight: 400;
  margin-right: 4px;
  text-shadow: 0 0 18px rgba(251, 191, 36, 0.4);
}

.balance-delta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-1);
  margin-top: 8px;
  flex-wrap: wrap;
}

.balance-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.balance-tile { display: flex; flex-direction: column; gap: 4px; }

.balance-tile-label {
  font-size: 10.5px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}
.balance-tile-label svg { width: 12px; height: 12px; opacity: 0.5; }

.balance-tile-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
  margin-top: 2px;
}

.balance-tile-meta {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

.level-bar { margin-top: 24px; }

.level-bar-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.level-bar-label {
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-2);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.level-bar-label .lvl {
  color: var(--amber-soft);
  font-weight: 700;
}

.level-bar-progress {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-1);
}

.progress {
  height: 6px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--amber-deep) 0%, var(--amber-soft) 100%);
  border-radius: 999px;
  position: relative;
  box-shadow: 0 0 12px var(--amber-glow);
}

.progress-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  animation: shimmer 2.5s linear infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.progress-violet .progress-fill {
  background: linear-gradient(90deg, #0891b2 0%, var(--violet-soft) 100%);
  box-shadow: 0 0 12px var(--violet-glow);
}

.rail { display: flex; flex-direction: column; gap: 20px; }

.quick-money .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.quick-money .row:last-child { border-bottom: none; }
.quick-money .row .label {
  font-size: 12.5px;
  color: var(--text-1);
  font-weight: 500;
}
.quick-money .row .cooldown {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-2);
}

.claim-btn {
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  color: white;
  border: 1px solid var(--amber-soft);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 0 14px var(--amber-glow);
  font-family: inherit;
}
.claim-btn:disabled { cursor: not-allowed; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.action-tile {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  transition: all 0.15s;
}
.action-tile:hover { background: var(--bg-4); transform: translateY(-1px); border-color: var(--border-mid); }
.action-tile svg { width: 16px; height: 16px; color: var(--amber-soft); }
.action-tile .name { font-size: 11px; font-weight: 600; color: var(--text-1); }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.stat-tile {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.stat-tile .label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-2);
  font-weight: 700;
}

.stat-tile .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-0);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.txn-row {
  display: grid;
  grid-template-columns: 38px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.txn-row:last-child { border-bottom: none; }

.txn-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success);
}
.txn-icon.out {
  background: var(--danger-bg);
  border-color: var(--danger-border);
  color: var(--danger);
}
.txn-icon.neutral {
  background: var(--violet-glow);
  border-color: rgba(34, 211, 238, 0.3);
  color: var(--violet-soft);
}
.txn-icon svg { width: 14px; height: 14px; }

.txn-details .name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-0);
}
.txn-details .meta {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
}

.txn-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
}
.txn-amount.out { color: var(--danger); }

.section-grid-2 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-top: 20px;
}

.chart-wrap { position: relative; height: 180px; margin-top: 8px; }
.chart { width: 100%; height: 100%; display: block; }

.chart-legend {
  display: flex;
  gap: 16px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-1);
}
.chart-legend .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}

/* Education */
.edu-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 20px;
}

.skill-tree {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  margin-top: 18px;
}

.skill-node {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-pad-sm);
  position: relative;
  transition: all 0.15s;
  cursor: pointer;
}
.skill-node:hover { border-color: var(--border-mid); transform: translateY(-1px); }
.skill-node.completed { border-color: var(--success-border); }
.skill-node.active {
  border-color: var(--border-strong);
  background: linear-gradient(180deg, var(--bg-4), var(--bg-3));
  box-shadow: 0 0 24px var(--amber-glow);
}
.skill-node.locked { opacity: 0.4; cursor: not-allowed; }

.skill-node .ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--amber-soft);
  margin-bottom: 10px;
}
.skill-node .ico svg { width: 14px; height: 14px; }

.skill-node .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-0);
}
.skill-node .level {
  font-size: 10.5px;
  color: var(--text-2);
  margin-top: 2px;
  font-family: 'JetBrains Mono', monospace;
}

.skill-node .skill-progress { margin-top: 10px; }

.skill-node .check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--success);
  color: var(--bg-0);
  display: flex;
  align-items: center;
  justify-content: center;
}
.skill-node .check svg { width: 9px; height: 9px; }

.degree-row {
  display: grid;
  grid-template-columns: 40px 1fr auto auto;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.degree-row:last-child { border-bottom: none; }
.degree-row .ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  color: var(--amber-soft);
}
.degree-row .ico svg { width: 15px; height: 15px; }
.degree-row .name { font-size: 13.5px; font-weight: 600; color: var(--text-0); }
.degree-row .meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.degree-row .stat { font-size: 11.5px; color: var(--text-1); font-family: 'JetBrains Mono', monospace; }

/* Jobs / KPIs */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grid-gap);
}

.kpi {
  background: linear-gradient(180deg, rgba(16, 13, 31, 0.7) 0%, rgba(10, 8, 20, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.kpi-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-1);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kpi-label svg { width: 12px; height: 12px; opacity: 0.7; }

.kpi-value {
  font-family: 'Instrument Serif', serif;
  font-size: 30px;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin-top: 8px;
  color: var(--text-0);
}
.kpi-value .ccy { color: var(--gold); margin-right: 2px; font-size: 24px; }

.kpi-delta {
  font-size: 12.5px;
  color: var(--text-1);
  margin-top: 4px;
}

.job-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.15s;
}
.job-card:hover { background: var(--bg-4); border-color: var(--border-mid); }

.job-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.job-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--bg-4), var(--bg-2));
  border: 1px solid var(--border-mid);
  display: flex; align-items: center; justify-content: center;
  color: var(--amber-soft);
}
.job-icon svg { width: 16px; height: 16px; }

.job-card .title { font-size: 13.5px; font-weight: 600; color: var(--text-0); }
.job-card .company { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.job-card .pay {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 8px;
}
.job-card .pay-meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }

.job-card .reqs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.job-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  margin-top: 18px;
}

/* Properties / Businesses */
.prop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  margin-top: 18px;
}

.prop-card {
  background: linear-gradient(180deg, rgba(16, 13, 31, 0.7) 0%, rgba(10, 8, 20, 0.7) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.15s;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.prop-card:hover { border-color: var(--border-mid); transform: translateY(-2px); }

.prop-img {
  height: 140px;
  position: relative;
  overflow: hidden;
}

.prop-img-1 { background: linear-gradient(135deg, #2c1f4d 0%, #4a3580 50%, #1a1430 100%); }
.prop-img-2 { background: linear-gradient(135deg, #1f2c4d 0%, #2e457a 50%, #14182a 100%); }
.prop-img-3 { background: linear-gradient(135deg, #4d1f3a 0%, #7a2e5e 50%, #2a1420 100%); }
.prop-img-4 { background: linear-gradient(135deg, #1f4d4a 0%, #2e7a7a 50%, #142a2a 100%); }
.prop-img-5 { background: linear-gradient(135deg, #2e1f4d 0%, #5a3580 50%, #1a142a 100%); }
.prop-img-6 { background: linear-gradient(135deg, #4d2c2c 0%, #7a4545 50%, #2a1414 100%); }

.prop-img::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at top right, rgba(255,255,255,0.1), transparent 60%),
    linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5));
}

.prop-img-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}
.prop-img-content svg {
  width: 60px; height: 60px;
  opacity: 0.4;
  color: var(--text-0);
}

.prop-status {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.prop-fav {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-1);
  z-index: 2;
  cursor: pointer;
}
.prop-fav svg { width: 12px; height: 12px; }

.prop-body { padding: 16px 18px; }

.prop-name { font-size: 14px; font-weight: 600; color: var(--text-0); }
.prop-loc { font-size: 11.5px; color: var(--text-2); margin-top: 2px; display: flex; align-items: center; gap: 4px; }
.prop-loc svg { width: 11px; height: 11px; }

.prop-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  gap: 6px;
}
.prop-stat .lab { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-3); font-weight: 700; }
.prop-stat .val { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 700; color: var(--text-0); margin-top: 4px; }
.prop-stat .val.up { color: var(--success); }
.prop-stat .val.dn { color: var(--danger); }

/* Banking */
.bank-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--grid-gap);
}

.bank-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--bg-1) 100%);
  cursor: pointer;
  transition: all 0.15s;
}
.bank-card:hover { transform: translateY(-2px); border-color: var(--border-mid); }

.bank-card-amber {
  background: linear-gradient(135deg, #2c1f4d 0%, #1a1430 60%, #0a0814 100%);
  border-color: var(--border-mid);
}
.bank-card-amber::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.24), transparent 60%);
}

.bank-card-violet {
  background: linear-gradient(135deg, #1f2c4d 0%, #14182a 60%, #0a0814 100%);
}
.bank-card-violet::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 80%;
  height: 200%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.22), transparent 60%);
}

.bank-card-content { position: relative; z-index: 1; }

.bank-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
}

.bank-name {
  font-family: 'Instrument Serif', serif;
  font-size: 17px;
  color: var(--text-0);
}
.bank-tier {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-2);
  font-weight: 700;
  margin-top: 2px;
}

.bank-balance {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
}
.bank-balance .ccy { color: var(--gold); margin-right: 2px; }

.bank-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  gap: 8px;
}
.bank-meta .label { color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700; font-size: 9.5px; }
.bank-meta .val { color: var(--text-1); font-family: 'JetBrains Mono', monospace; margin-top: 4px; }

.bank-acct-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-2);
  letter-spacing: 0.1em;
  margin-top: 24px;
}

/* Tables */
.table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

.table thead th {
  text-align: left;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-3);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

.table tbody td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-1);
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--bg-2); }

.table .name { font-weight: 600; color: var(--text-0); }

/* Crime */
.risk-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--grid-gap);
  margin-top: 18px;
}

.risk-card {
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--card-pad);
  cursor: pointer;
  transition: all 0.15s;
}
.risk-card:hover { background: var(--bg-4); border-color: var(--danger-border); }

.risk-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.risk-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--danger);
}
.risk-icon svg { width: 15px; height: 15px; }

.risk-card .title { font-size: 14px; font-weight: 600; color: var(--text-0); }
.risk-card .desc { font-size: 11.5px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }

.risk-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.risk-stat .lab { font-size: 9.5px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--text-3); font-weight: 700; }
.risk-stat .val { font-family: 'JetBrains Mono', monospace; font-size: 13px; font-weight: 700; color: var(--text-0); margin-top: 4px; }

.warn-banner {
  background: linear-gradient(180deg, rgba(244, 63, 94, 0.06), transparent);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

.warn-banner .ico {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--danger-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--danger);
  flex-shrink: 0;
}
.warn-banner .ico svg { width: 14px; height: 14px; }

.warn-banner .text { flex: 1; }
.warn-banner .title { font-size: 13px; font-weight: 600; color: var(--text-0); }
.warn-banner .body { font-size: 11.5px; color: var(--text-1); margin-top: 2px; }

/* Chat */
.chat-layout {
  display: grid;
  grid-template-columns: 280px 1fr 280px;
  gap: 16px;
  height: calc(100vh - var(--topbar-h) - 90px);
  height: calc(100dvh - var(--topbar-h) - 90px);
}

.chat-list {
  background: linear-gradient(180deg, rgba(20, 16, 38, 0.85) 0%, rgba(12, 9, 24, 0.85) 100%);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  padding: 16px;
  overflow-y: auto;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(167,139,250,0.06);
}

.chat-list-search {
  position: relative;
  margin-bottom: 12px;
}
.chat-list-search input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-0);
  font-size: 12.5px;
  outline: none;
  font-family: inherit;
}
.chat-list-search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px; color: var(--text-3);
}

.chat-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  transition: background 0.15s;
}
.chat-row:hover { background: var(--bg-3); }
.chat-row.active { background: var(--bg-3); border: 1px solid var(--border-mid); padding: 9px; }

.chat-row .avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 12.5px;
  color: white;
  position: relative;
}
.avatar.av-1 { background: linear-gradient(135deg, #a78bfa, #6d4bd8); box-shadow: 0 0 12px rgba(167, 139, 250, 0.4); }
.avatar.av-2 { background: linear-gradient(135deg, #22d3ee, #0891b2); box-shadow: 0 0 12px rgba(34, 211, 238, 0.4); }
.avatar.av-3 { background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 0 12px rgba(52, 211, 153, 0.4); }
.avatar.av-4 { background: linear-gradient(135deg, #f43f5e, #be123c); box-shadow: 0 0 12px rgba(244, 63, 94, 0.4); }
.avatar.av-5 { background: linear-gradient(135deg, #fbbf24, #d97706); box-shadow: 0 0 12px rgba(251, 191, 36, 0.4); }
.avatar.av-6 { background: linear-gradient(135deg, #ec4899, #be185d); box-shadow: 0 0 12px rgba(236, 72, 153, 0.4); }

.chat-row .info { min-width: 0; }
.chat-row .name { font-size: 12.5px; font-weight: 600; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-row .preview { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.chat-row .time { font-size: 10px; color: var(--text-3); }
.chat-row .unread {
  margin-top: 4px;
  background: var(--amber);
  color: white;
  font-size: 9.5px;
  padding: 1px 6px;
  border-radius: 999px;
  font-weight: 700;
  display: inline-block;
}

.chat-main {
  background:
    radial-gradient(140% 80% at 50% 0%, rgba(167, 139, 250, 0.08) 0%, transparent 60%),
    linear-gradient(180deg, rgba(20, 16, 38, 0.85) 0%, rgba(12, 9, 24, 0.85) 100%);
  border: 1px solid var(--border-mid);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), inset 0 1px 0 rgba(167,139,250,0.06);
}

.chat-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(180deg, rgba(167, 139, 250, 0.04), transparent);
}
/* Conversations toggle lives only on mobile — desktop shows the list permanently. */
.chat-list-toggle { display: none; padding: 0; width: 36px; min-width: 36px; justify-content: center; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.msg {
  max-width: 72%;
  padding: 11px 15px;
  border-radius: var(--radius-lg);
  font-size: 13.5px;
  line-height: 1.5;
  word-wrap: break-word;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  animation: msg-pop 0.18s ease-out;
}
@keyframes msg-pop {
  from { opacity: 0; transform: translateY(4px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.msg.in {
  background: linear-gradient(135deg, rgba(34, 27, 61, 0.95), rgba(22, 16, 41, 0.95));
  border: 1px solid rgba(167, 139, 250, 0.18);
  color: var(--text-0);
  border-bottom-left-radius: 4px;
  backdrop-filter: blur(8px);
}
.msg.out {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--amber) 0%, var(--amber-deep) 100%);
  color: white;
  border: 1px solid var(--amber-glow);
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 16px var(--amber-glow), inset 0 1px 0 rgba(255,255,255,0.1);
}

.msg .time { font-size: 9.5px; color: var(--text-2); margin-top: 4px; font-family: 'JetBrains Mono', monospace; opacity: 0.7; }
.msg.out .time { color: rgba(255, 255, 255, 0.75); }

.msg-system {
  align-self: center;
  background: var(--violet-glow);
  border: 1px solid rgba(34, 211, 238, 0.3);
  color: var(--violet-soft);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.chat-input {
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(180deg, transparent, rgba(167, 139, 250, 0.03));
}

.chat-input input {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  background: rgba(34, 27, 61, 0.6);
  border: 1px solid rgba(167, 139, 250, 0.15);
  border-radius: 12px;
  color: var(--text-0);
  font-size: 13.5px;
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-input input:focus {
  border-color: rgba(167, 139, 250, 0.5);
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.1);
}
.chat-input #chat-send {
  height: 42px;
  padding: 0 18px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--amber), var(--amber-deep));
  border: 1px solid var(--border-strong);
  box-shadow: 0 4px 14px var(--amber-glow);
  font-weight: 600;
}
.chat-input #chat-send:hover { box-shadow: 0 4px 20px var(--amber-glow); }

.lb-row {
  display: grid;
  grid-template-columns: 28px 36px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  transition: background 0.15s;
}
.lb-row:hover { background: var(--bg-3); }

.lb-rank {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
}
.lb-rank.top1 { color: var(--gold); }
.lb-rank.top2 { color: #c0c0c0; }
.lb-rank.top3 { color: #cd7f32; }

.lb-row .name { font-size: 12.5px; font-weight: 600; color: var(--text-0); }
.lb-row .meta { font-size: 10.5px; color: var(--text-2); margin-top: 2px; }
.lb-row .nw { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: var(--gold); }

/* Loans */
.loan-row {
  display: grid;
  grid-template-columns: 40px 2fr 1fr 1fr 1fr 140px;
  gap: 14px;
  align-items: center;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.loan-row > button { white-space: nowrap; min-width: 0; padding: 0 14px; }
.loan-row:last-child { border-bottom: none; }
.loan-row .ico {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--amber-soft);
}
.loan-row .ico svg { width: 14px; height: 14px; }
.loan-row .name { font-size: 13.5px; font-weight: 600; color: var(--text-0); }
.loan-row .meta { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.loan-row .val { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--text-0); }

.credit-card-vis {
  position: relative;
  border-radius: var(--radius-lg);
  padding: 22px;
  height: 200px;
  background: linear-gradient(135deg, #2c1f4d 0%, #1a1430 50%, #0a0814 100%);
  border: 1px solid var(--border-mid);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.credit-card-vis::before {
  content: '';
  position: absolute;
  top: -100%; right: -50%;
  width: 200%; height: 300%;
  background: conic-gradient(from 180deg at 50% 50%, rgba(167, 139, 250, 0.24), transparent 30%, rgba(34, 211, 238, 0.14) 60%, transparent 90%);
}
.credit-card-vis-content { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; justify-content: space-between; }

/* Chips */
.tab-bar {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  width: fit-content;
}

.tab {
  padding: 6px 14px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--text-1);
  cursor: pointer;
  border-radius: 7px;
  transition: all 0.15s;
}
.tab:hover { color: var(--text-0); }
.tab.active { background: var(--bg-4); color: var(--text-0); }

/* Helpers */
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-5 { margin-top: 20px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }

.spark { width: 100%; height: 36px; display: block; }

.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-svg { width: 130px; height: 130px; flex-shrink: 0; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.donut-legend-row { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }
.donut-legend-row .lab { display: flex; align-items: center; gap: 8px; color: var(--text-1); }
.donut-legend-row .dot { width: 8px; height: 8px; border-radius: 2px; }
.donut-legend-row .val { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--text-0); }

/* Extended profile modal — recent transactions + peer-loan rows */
.modal-section-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-2);
  margin-bottom: 8px;
}
.profile-txn, .p2p-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.profile-txn:last-child, .p2p-row:last-child { border-bottom: 0; }
.profile-txn-main, .p2p-main { min-width: 0; }
.profile-txn-name, .p2p-name { font-size: 12.5px; font-weight: 600; color: var(--text-0); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.profile-txn-meta, .p2p-meta { font-size: 10.5px; color: var(--text-2); margin-top: 1px; }
.profile-txn-amt { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; font-weight: 700; flex-shrink: 0; }
.profile-txn-amt.pos { color: #34d399; }
.profile-txn-amt.neg { color: var(--danger); }
.lb-clickable { cursor: pointer; }
.lb-clickable:hover { background: var(--bg-3); border-radius: 10px; }
.loan-rate-slider { accent-color: var(--amber); margin: 6px 0 4px; }

.section { margin-top: 28px; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.collect-all-btn { flex-shrink: 0; }

/* Manager (auto-collect) controls on property & business cards */
.mgr-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.mgr-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  border: 1px solid rgba(52, 211, 153, 0.32);
  padding: 4px 10px;
  border-radius: 999px;
}
.mgr-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 8px #34d399;
  animation: mgr-pulse 1.8s ease-in-out infinite;
}
@keyframes mgr-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.mgr-hire { color: var(--amber-soft); }

/* Upgrade (level 1–5) controls */
.pill-lvl {
  background: rgba(167, 139, 250, 0.18);
  color: var(--amber-soft);
  border: 1px solid rgba(167, 139, 250, 0.45);
  font-weight: 800;
  letter-spacing: 0.03em;
}
.upg-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.upg-btn { color: var(--amber-soft); }
.upg-max { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: #fbbf24; }

/* ============================================
   COSMETICS — equippable name/frame/badge/banner effects
   ============================================ */
/* Badges and pills must render in their own colour even inside gradient-text names. */
.cz-badge { margin-left: 4px; font-size: 0.95em; color: initial; -webkit-text-fill-color: initial; background: none; -webkit-background-clip: initial; background-clip: initial; filter: drop-shadow(0 0 3px rgba(255,255,255,0.25)); }
.pill { -webkit-text-fill-color: initial; }

/* --- Name effects --- */
.fx-glow {
  color: #fbbf24 !important;
  animation: fxGlow 2s ease-in-out infinite;
}
@keyframes fxGlow {
  0%, 100% { text-shadow: 0 0 5px rgba(251,191,36,0.65); }
  50% { text-shadow: 0 0 13px rgba(251,191,36,1), 0 0 22px rgba(251,191,36,0.55); }
}
.fx-neon {
  color: #22d3ee !important;
  text-shadow: 0 0 6px rgba(34,211,238,0.9), 0 0 14px rgba(34,211,238,0.55);
}
.fx-gold {
  background: linear-gradient(90deg, #fde68a, #f59e0b, #fff7d6, #d97706);
  -webkit-background-clip: text; background-clip: text;
  color: transparent !important; -webkit-text-fill-color: transparent;
}
.fx-rainbow {
  background: linear-gradient(90deg, #f43f5e, #fb923c, #fbbf24, #34d399, #22d3ee, #a78bfa, #f43f5e);
  background-size: 200% auto;
  -webkit-background-clip: text; background-clip: text;
  color: transparent !important; -webkit-text-fill-color: transparent;
  animation: fxRainbow 3s linear infinite;
}
@keyframes fxRainbow { to { background-position: 200% center; } }
.fx-fire {
  background: linear-gradient(0deg, #fbbf24, #f97316 55%, #ef4444);
  -webkit-background-clip: text; background-clip: text;
  color: transparent !important; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 6px rgba(249,115,22,0.45));
}
.fx-glitch {
  color: #ece9ff !important;
  animation: fxGlitch 1.1s steps(2) infinite;
}
@keyframes fxGlitch {
  0%, 100% { text-shadow: 1.5px 0 #22d3ee, -1.5px 0 #f43f5e; }
  50% { text-shadow: -1.5px 0 #22d3ee, 1.5px 0 #f43f5e; }
}

/* --- Avatar frames (added to .avatar / .profile-hero-avatar) --- */
.frame-amber  { box-shadow: 0 0 0 2px #f59e0b, 0 0 10px rgba(245,158,11,0.55) !important; }
.frame-violet { box-shadow: 0 0 0 2px #a78bfa, 0 0 10px rgba(167,139,250,0.55) !important; }
.frame-gold   { box-shadow: 0 0 0 2px #fbbf24, 0 0 13px rgba(251,191,36,0.7) !important; }
.frame-holo   { animation: holoRing 3s linear infinite; }
@keyframes holoRing {
  0%   { box-shadow: 0 0 0 2px #22d3ee, 0 0 12px rgba(34,211,238,0.7); }
  33%  { box-shadow: 0 0 0 2px #a78bfa, 0 0 12px rgba(167,139,250,0.7); }
  66%  { box-shadow: 0 0 0 2px #f43f5e, 0 0 12px rgba(244,63,94,0.7); }
  100% { box-shadow: 0 0 0 2px #22d3ee, 0 0 12px rgba(34,211,238,0.7); }
}

/* --- Profile banners (added to .profile-hero) --- */
.profile-hero.banner-neon,
.profile-hero.banner-sunset,
.profile-hero.banner-matrix { background-size: 200% 200%; animation: bannerShift 9s ease infinite; }
.profile-hero.banner-neon   { background-image: linear-gradient(120deg, rgba(167,139,250,0.28), rgba(34,211,238,0.20), rgba(244,63,94,0.20)); }
.profile-hero.banner-sunset { background-image: linear-gradient(120deg, rgba(251,146,60,0.30), rgba(244,63,94,0.22), rgba(167,139,250,0.18)); }
.profile-hero.banner-matrix { background-image: linear-gradient(120deg, rgba(16,185,129,0.26), rgba(6,78,59,0.34)); }
@keyframes bannerShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }

/* Equipped indicator in the store */
.store-equipped { border-color: var(--amber-soft) !important; box-shadow: 0 0 0 1px var(--amber-glow); }
.section-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-0);
  letter-spacing: -0.01em;
}
.section-sub { font-size: 11.5px; color: var(--text-2); margin-top: 2px; }

button:disabled { cursor: not-allowed; }

/* Number flash */
.flash-up { animation: flashUp 0.6s ease; }
.flash-down { animation: flashDown 0.6s ease; }
@keyframes flashUp {
  0% { color: var(--text-0); }
  30% { color: var(--success); }
  100% { color: var(--text-0); }
}
@keyframes flashDown {
  0% { color: var(--text-0); }
  30% { color: var(--danger); }
  100% { color: var(--text-0); }
}


/* === STATUS BARS (sidebar) === */
.status-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.status-bar { display: flex; flex-direction: column; gap: 3px; }
.status-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
}
.status-head .lab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-1);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.status-head .lab svg { width: 11px; height: 11px; opacity: 0.8; }
.status-head .val { color: var(--gold); font-size: 11.5px; }
.status-track {
  height: 6px;
  background: rgba(0,0,0,0.4);
  border-radius: 999px;
  overflow: hidden;
}
.status-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
  box-shadow: 0 0 6px currentColor;
}
.status-fill.happy {
  background: linear-gradient(90deg, #fbbf24, #f59e0b);
  color: #fbbf24;
}
.status-fill.hunger {
  background: linear-gradient(90deg, #34d399, #10b981);
  color: #34d399;
}
.status-fill.hunger.warn {
  background: linear-gradient(90deg, #f59e0b, #f43f5e);
  color: #f59e0b;
}
.status-fill.hunger.crit {
  background: linear-gradient(90deg, #f43f5e, #be123c);
  color: #f43f5e;
  animation: hungerPulse 1.4s ease-in-out infinite;
}
@keyframes hungerPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.status-fill.health {
  background: linear-gradient(90deg, #34d399, #22d3ee);
  color: #34d399;
}
.status-fill.health.crit {
  background: linear-gradient(90deg, #f43f5e, #be123c);
  color: #f43f5e;
  animation: hungerPulse 1.4s ease-in-out infinite;
}
.status-bar[data-bar="health"].sick { cursor: pointer; }
.status-bar[data-bar="health"].sick #status-health-val { color: #f87171; font-weight: 800; }
.status-fill.credit {
  background: linear-gradient(90deg, var(--violet), var(--violet-soft));
  color: var(--violet);
}

/* Life-event modals (random expense / illness) */
.event-icon {
  width: 52px; height: 52px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 4px auto 14px;
}
.event-icon svg { width: 26px; height: 26px; }
.event-icon.expense { background: rgba(167,139,250,0.16); color: var(--amber-soft); border: 1px solid rgba(167,139,250,0.4); }
.event-icon.disease { background: rgba(244,63,94,0.14); color: #f87171; border: 1px solid rgba(244,63,94,0.4); }
#expense-modal h3, #disease-modal h3 { text-align: center; }
#expense-modal .modal-sub, #disease-modal .modal-sub { text-align: center; }
.event-amt {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  font-size: 30px; font-weight: 800;
  color: var(--amber-soft);
  margin-top: 14px;
}
.event-amt.danger { color: #f87171; }
.status-fill.rep {
  background: linear-gradient(90deg, var(--amber-deep), var(--amber-soft));
  color: var(--amber);
}

/* === ANNOUNCEMENT BANNER === */
.announce-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.12), rgba(167, 139, 250, 0.08));
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-md);
  position: relative;
  animation: announceShimmer 0.6s ease;
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.2);
}
@keyframes announceShimmer {
  from { transform: translateY(-4px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.announce-icon {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, var(--gold), #d97706);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bg-0);
  flex-shrink: 0;
}
.announce-icon svg { width: 18px; height: 18px; }
.announce-body { flex: 1; }
.announce-title {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
}
.announce-text {
  font-size: 14.5px;
  color: var(--text-0);
  margin-top: 2px;
  font-weight: 500;
}
.announce-close {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-2);
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.announce-close:hover { color: var(--text-0); border-color: var(--border-mid); }

/* === SFX TOGGLE === */
.sfx-toggle {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--amber-soft);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.sfx-toggle:hover { background: var(--bg-3); border-color: var(--border-mid); }
.sfx-toggle svg { width: 17px; height: 17px; }
.sfx-toggle.off { color: var(--text-3); position: relative; }
.sfx-toggle.off::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 4px;
  right: 4px;
  height: 2px;
  background: var(--danger);
  transform: translateY(-50%) rotate(-30deg);
  border-radius: 2px;
}
