:root {
  --bg: #08080a;
  --bg-elevated: #101014;
  --panel: #16161b;
  --panel-hover: #1c1c22;
  --border: #262630;
  --accent: #ff3b3b;
  --accent-dim: rgba(255, 59, 59, 0.16);
  --accent-glow: 0 0 28px rgba(255, 59, 59, 0.28);
  --text: #f5f5f7;
  --text-dim: #96969f;
  --text-faint: #5c5c66;
  --success: #34d399;
  --gold: #f5b942;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Rajdhani", var(--font);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(255, 59, 59, 0.08), transparent 45%),
    radial-gradient(circle at 85% 20%, rgba(255, 59, 59, 0.05), transparent 40%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(10px);
  background: rgba(8, 8, 10, 0.75);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  white-space: nowrap;
}

.brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: block;
  flex-shrink: 0;
}

.nav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

/* Buttons */
.btn {
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 11px 20px;
  border-radius: 999px;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 20px rgba(255, 59, 59, 0.35);
}
.btn-primary:hover { background: #ff5252; }

.btn-ghost {
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--panel-hover); }

.btn-sm { padding: 7px 14px; font-size: 13px; }

/* Hero */
.hero {
  padding: 88px 0 64px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-dim);
  border: 1px solid rgba(255, 59, 59, 0.3);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.02;
  margin: 0 0 18px;
  letter-spacing: -0.01em;
}

.hero h1 span { color: var(--accent); }

.hero p {
  color: var(--text-dim);
  font-size: 17px;
  max-width: 520px;
  margin: 0 auto 34px;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-actions .btn { padding: 14px 28px; font-size: 15px; }

/* Top-level views (Play / Ranked / Endless / Leaderboard / Settings) — only
   one visible at a time, switched via hash-based routing in home.js. */
.view {
  display: none;
  animation: view-fade-in 0.15s ease;
}

.view.active {
  display: block;
}

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

.nav-actions a.nav-active {
  background: var(--accent);
  color: #fff;
}

/* Section headings */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 26px;
  margin: 0;
}

.section-head p {
  color: var(--text-dim);
  font-size: 14px;
  margin: 4px 0 0;
}

/* Level grid */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px;
}

.level-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--panel);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  font-family: var(--font-display);
}

.level-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--panel-hover);
}

.level-tile .num {
  font-size: 20px;
  font-weight: 700;
}

.level-tile .stars {
  font-size: 10px;
  color: var(--gold);
  margin-top: 2px;
  min-height: 12px;
}

/* Partial-fill stars (js/stars.js): a ☆ outline base with a ★ overlay
   clipped to the earned fraction. Inherits color/font-size from the
   container, so the same markup works in tiles and the results screen. */
.pstars {
  display: inline-flex;
  letter-spacing: 0;
}

.pstar {
  position: relative;
  display: inline-block;
}

.pstar + .pstar {
  margin-left: 0.12em;
}

.pstar-fill {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  white-space: nowrap;
  pointer-events: none;
}

.level-tile.locked {
  color: var(--text-faint);
  cursor: pointer;
}

.level-tile.locked .num { color: var(--text-faint); }

.level-tile.locked::after {
  content: "\1F512";
  position: absolute;
  top: 6px;
  right: 6px;
  font-size: 10px;
  opacity: 0.7;
}

.level-tile.completed {
  border-color: rgba(52, 211, 153, 0.5);
}

.level-tile.completed .num { color: var(--success); }

/* Pro banner */
.pro-banner {
  margin-top: 24px;
  padding: 22px 24px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--accent-dim), transparent 60%), var(--panel);
  border: 1px solid rgba(255, 59, 59, 0.35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.pro-banner h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
}

.pro-banner p {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
}

.pro-banner .price {
  color: var(--accent);
  font-weight: 700;
}

/* Settings panel */
.settings-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 20px;
}

@media (max-width: 760px) {
  .settings-grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.field {
  margin-bottom: 20px;
}

.field:last-child { margin-bottom: 0; }

.field label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.field label .val {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  height: 4px;
}

.swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
}

.swatch.active {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px currentColor;
}

.style-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.style-option {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.12s ease;
}

.style-option.active { border-color: var(--accent); }

.target-style-options {
  grid-template-columns: repeat(3, 1fr);
}

.target-style-options .style-option {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
}

.crosshair-preview {
  height: 160px;
  border-radius: var(--radius-md);
  background:
    repeating-linear-gradient(0deg, transparent, transparent 19px, rgba(255,255,255,0.03) 20px),
    repeating-linear-gradient(90deg, transparent, transparent 19px, rgba(255,255,255,0.03) 20px),
    #050506;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

/* Stats */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.stat-card .num {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
}

.stat-card .label {
  color: var(--text-dim);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Ranked hero */
.ranked-hero-section {
  border-top: none;
  padding: 64px 0 48px;
}

.ranked-hero {
  text-align: center;
  max-width: 640px;
  margin: 0 auto;
}

.ranked-hero-icon {
  font-size: 46px;
  margin-bottom: 18px;
  filter: drop-shadow(0 0 22px rgba(255, 59, 59, 0.45));
}

.ranked-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 46px);
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.ranked-hero p {
  color: var(--text-dim);
  font-size: 16px;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto 30px;
}

.ranked-find-btn {
  padding: 16px 36px;
  font-size: 16px;
}

.ranked-steps {
  display: flex;
  justify-content: center;
  gap: 30px;
  row-gap: 14px;
  margin-top: 44px;
  flex-wrap: wrap;
}

.ranked-step {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
  max-width: 160px;
  text-align: left;
}

.step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-dim);
  border: 1px solid rgba(255, 59, 59, 0.4);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0 40px;
  text-align: center;
  color: var(--text-faint);
  font-size: 13px;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 4, 6, 0.72);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 20px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  padding: 28px;
  text-align: center;
}

.modal .lock-icon {
  font-size: 34px;
  margin-bottom: 12px;
}

.modal h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin: 0 0 10px;
}

.modal p {
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 22px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 20px;
  cursor: pointer;
}

.modal { position: relative; }

/* Toggle switch (e.g. 2FA on/off in Account Security) */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 16px;
}

.toggle-row .toggle-label {
  font-size: 14px;
  color: var(--text);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--border);
  border-radius: 999px;
  transition: background 0.15s ease;
}

.switch .slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: var(--text);
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.switch input:checked + .slider {
  background: var(--success);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
  background: #08080a;
}

.switch input:disabled + .slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Sub-tabs (e.g. Endless leaderboard difficulty picker) */
.tabs {
  display: flex;
  gap: 6px;
  margin: -6px 0 16px;
  flex-wrap: wrap;
}

.tab {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 18px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.tab:hover { color: var(--text); }

.tab.active {
  color: var(--bg);
  background: var(--accent);
  border-color: var(--accent);
}

/* Leaderboard */
.lb-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.lb-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.lb-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.lb-table td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.lb-table tr:last-child td { border-bottom: none; }

.lb-rank {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--text-dim);
  width: 40px;
}

.lb-name { display: flex; align-items: center; gap: 8px; }
.lb-flag { font-size: 16px; }
.lb-level { color: var(--text-dim); font-size: 13px; }
.lb-score { font-family: var(--font-display); font-weight: 700; text-align: right; }

.lb-top1 .lb-rank { color: var(--gold); }
.lb-top2 .lb-rank { color: #c9c9d4; }
.lb-top3 .lb-rank { color: #c9884a; }

.lb-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 32px 18px;
}

.lb-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

/* Pro-locked settings option */
.style-option.locked {
  position: relative;
  opacity: 0.55;
}

.style-option.locked::after {
  content: "\1F512";
  position: absolute;
  top: -5px;
  right: -3px;
  font-size: 10px;
  opacity: 0.9;
}

/* Endless Mode difficulty cards */
.endless-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.endless-card {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 20px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.endless-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--panel-hover);
}

.endless-card .name {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.endless-card .best {
  color: var(--text-dim);
  font-size: 13px;
}

.endless-card.locked .name { color: var(--text-faint); }
.endless-card.locked .best { color: var(--text-faint); }

.endless-card.locked::after {
  content: "\1F512";
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 13px;
  opacity: 0.8;
}

/* Pricing modal */
.pricing-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.pricing-option {
  position: relative;
  appearance: none;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 12px 16px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
  font-family: inherit;
  color: var(--text);
}

.pricing-option:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--panel-hover);
}

.pricing-badge {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  white-space: nowrap;
}

.pricing-name {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
}

@media (max-width: 480px) {
  .pricing-options { grid-template-columns: 1fr; }
}

/* Item Shop */
.wallet-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.wallet-pill {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.wallet-buy-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text-dim);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.wallet-buy-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.shop-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
}

.shop-card.equipped { border-color: var(--accent); }

.shop-card-media {
  width: 100%;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.shop-card-media img {
  width: 68%;
  height: 68%;
  object-fit: contain;
}

.shop-card-media-bg {
  aspect-ratio: 16 / 9;
}

.shop-card-media-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-card-name {
  font-size: 13px;
  font-weight: 600;
}

.shop-card-owned {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: -6px;
}

.shop-card-equipped { color: var(--accent); font-weight: 600; }

.shop-card-action { width: 100%; justify-content: center; }

.tab-disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Shared text input (page-level inputs outside JS-built modals — search
   boxes, chat composer, suggestion textarea) */
.text-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

textarea.text-input { resize: vertical; }

.hidden { display: none !important; }

.form-error {
  color: var(--accent);
  font-size: 13px;
  margin: 8px 0 0;
}

/* ---------- Friends ---------- */
.friends-panel { margin-top: 4px; }

.friend-request-row,
.friend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.friend-request-row:last-child,
.friend-row:last-child { border-bottom: none; }

.friend-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.friend-name {
  font-weight: 600;
  cursor: pointer;
}

.friend-name:hover { color: var(--accent); }

.presence-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
  flex-shrink: 0;
}

.presence-dot.online { background: var(--success); }
.presence-dot.in-match { background: var(--gold); }

.friend-status-label {
  font-size: 12px;
  color: var(--text-dim);
}

.friend-actions { display: flex; gap: 8px; flex-shrink: 0; }

#friend-requests-block:empty { display: none; }

.friend-requests-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
}

.friend-requests-panel .friend-requests-head {
  padding: 12px 18px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
}

#friend-search-results .lb-panel { margin-top: 14px; }

/* Leaderboard / friend-search rows with a clickable username + relationship button */
.lb-name-btn {
  background: none;
  border: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.lb-name-btn:hover { color: var(--accent); text-decoration: underline; }

.rel-btn { white-space: nowrap; }

/* ---------- Chat ---------- */
.chat-panel { margin-top: 4px; }

.chat-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 16px;
  height: 560px;
}

@media (max-width: 760px) {
  .chat-layout { grid-template-columns: 1fr; height: auto; }
  .chat-thread { height: 480px; }
}

.chat-sidebar {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-dim);
}

.chat-conversation-list {
  flex: 1;
  overflow-y: auto;
}

.chat-convo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease;
}

.chat-convo-item:hover { background: var(--panel-hover); }
.chat-convo-item.active { background: var(--accent-dim); }

.chat-convo-name {
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.chat-convo-name span.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-convo-preview {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-unread-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  flex-shrink: 0;
}

.chat-muted-icon { opacity: 0.5; font-size: 12px; }

.chat-thread {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-thread-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 14px;
}

.chat-thread-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.chat-thread-title { font-weight: 700; font-family: var(--font-display); font-size: 16px; }

.chat-thread-actions { display: flex; gap: 8px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-message {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  font-size: 14px;
  line-height: 1.45;
  word-wrap: break-word;
}

.chat-message.own {
  align-self: flex-end;
  background: var(--accent-dim);
  border-color: rgba(255, 59, 59, 0.35);
}

.chat-message .chat-message-from {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.chat-message .chat-message-time {
  font-size: 10px;
  color: var(--text-faint);
  margin-top: 4px;
}

.chat-composer {
  display: flex;
  gap: 8px;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}

.chat-composer .text-input { flex: 1; }

.group-friend-checklist {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px;
}

.group-friend-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 13px;
}

/* ---------- Suggestions ---------- */
.suggestions-panel { text-align: left; }
.suggestions-panel h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 20px; }
.suggestions-sub { color: var(--text-dim); font-size: 14px; margin: 0 0 16px; }
.suggestions-status { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }
.suggestions-status.ok { color: var(--success); }

/* ---------- Notifications ---------- */
.notif-bell { position: relative; }

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

.notif-modal-inner { max-width: 420px; text-align: left; }

.notif-list {
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notif-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 13px;
}

.notif-item.unread { border-color: var(--accent); }
.notif-item .notif-title { font-weight: 600; margin-bottom: 2px; }
.notif-item .notif-body { color: var(--text-dim); }
.notif-item .notif-time { color: var(--text-faint); font-size: 11px; margin-top: 4px; }

/* ---------- Profile ---------- */
.profile-modal-inner { max-width: 460px; }

.profile-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  text-align: left;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 2px solid var(--border);
  flex-shrink: 0;
}

.profile-avatar img { width: 100%; height: 100%; border-radius: 50%; display: block; }

.profile-name { font-family: var(--font-display); font-size: 20px; font-weight: 700; }
.profile-country { color: var(--text-dim); font-size: 13px; }

.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.profile-stats-grid .stat-card { padding: 12px 14px; }
.profile-stats-grid .stat-card .num { font-size: 20px; }

.pfp-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.pfp-option {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  overflow: hidden;
  background: var(--bg-elevated);
  transition: border-color 0.12s ease;
}

.pfp-option img { width: 100%; height: 100%; display: block; }

.pfp-option.active { border-color: var(--accent); }

.equip-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}

.equip-item {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.equip-item .equip-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; }
.equip-item .equip-value { font-size: 13px; font-weight: 600; margin-top: 2px; }
