/* RuggedRoute Web App — design system (mirrors the Android glass + topo language) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0A0A0F;
  --surface: #1A1A24;
  --surface2: #22222E;
  --card: rgba(30, 30, 42, 0.78);
  --border: #2A2A3A;
  --cyan: #00E5FF;
  --cyan-dim: rgba(0, 229, 255, 0.12);
  --cyan-border: rgba(0, 229, 255, 0.35);
  --amber: #FFAB40;
  --green: #69F0AE;
  --red: #FF5252;
  --amp: #4CE52C;
  --text: #E8E8F0;
  --muted: #8A8A9A;
  --disabled: #4A4A5A;
  --radius: 14px;
  --sidebar-w: 230px;
}
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}
#topo { position: fixed; inset: 0; z-index: 0; pointer-events: none; }
button { font-family: inherit; }
a { color: var(--cyan); text-decoration: none; }
img { max-width: 100%; }

/* ── Auth screen ─────────────────────────────────────────────── */
#auth-screen {
  position: relative; z-index: 1;
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 18px; padding: 24px;
}
.brand { font-size: 30px; font-weight: 800; letter-spacing: 4px; text-transform: uppercase; color: var(--cyan); }
.brand span { color: var(--text); }
.auth-sub { color: var(--muted); font-size: 14px; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 10px; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px; display: flex; flex-direction: column; gap: 12px;
  backdrop-filter: blur(8px);
}
.auth-card input {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 12px 14px; border-radius: 10px; font-size: 14px; outline: none; width: 100%;
}
.auth-card input:focus { border-color: var(--cyan); }
.btn {
  border: none; border-radius: 10px; padding: 13px 18px; font-size: 14.5px; font-weight: 700;
  cursor: pointer; transition: opacity .15s, transform .1s; width: 100%;
}
.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-cyan { background: var(--cyan); color: #001318; }
.btn-google { background: #fff; color: #1f1f1f; display: flex; align-items: center; justify-content: center; gap: 10px; }
.btn-ghost { background: var(--surface2); border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: rgba(255,82,82,.12); border: 1px solid rgba(255,82,82,.4); color: var(--red); }
.auth-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-error { color: var(--red); font-size: 13px; min-height: 18px; text-align: center; }
.auth-toggle { text-align: center; font-size: 13px; color: var(--muted); cursor: pointer; }
.auth-toggle b { color: var(--cyan); }
.amp-credit { margin-top: 14px; font-size: 12px; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.amp-credit img { height: 15px; }

/* ── App shell ───────────────────────────────────────────────── */
#app-shell { position: relative; z-index: 1; display: none; min-height: 100vh; }
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  background: rgba(18, 18, 24, 0.92); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; z-index: 30; backdrop-filter: blur(8px);
}
.side-logo { display: flex; align-items: center; gap: 10px; padding: 16px 18px 13px; border-bottom: 1px solid var(--border); }
.side-logo .logo-chip { width: 34px; height: 34px; border-radius: 8px; overflow: hidden; flex: none; display: block; }
.side-logo .logo-word { font-family: 'Barlow Condensed', sans-serif; font-size: 19px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cyan); text-shadow: 0 0 18px color-mix(in srgb, var(--cyan) 45%, transparent); }
.side-logo .logo-word span { color: #E8E8F0; text-shadow: none; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 18px; color: var(--muted);
  font-size: 14.5px; font-weight: 600; cursor: pointer; border: none; background: none; width: 100%;
  text-align: left; border-left: 3px solid transparent;
}
.nav-item:hover { color: var(--text); background: var(--surface); }
.nav-item.active { color: var(--cyan); background: var(--cyan-dim); border-left-color: var(--cyan); }
.nav-item .ic { width: 22px; text-align: center; font-size: 17px; }
.nav-item .badge { margin-left: auto; background: var(--cyan); color: #001318; font-size: 11px; font-weight: 800; border-radius: 999px; padding: 1px 8px; }
.side-user { margin-top: auto; padding: 14px 18px; border-top: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.side-user img, .avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--surface2); }
.avatar-fallback { width: 34px; height: 34px; border-radius: 50%; background: var(--cyan-dim); border: 1px solid var(--cyan-border); color: var(--cyan); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 15px; flex: none; }
.side-user .nm { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .nb { font-size: 11.5px; color: var(--amber); }

.main { margin-left: var(--sidebar-w); padding: 26px 32px 90px; max-width: 1200px; }
.kicker { font-size: 11px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase; color: var(--muted); }
.page-title {
  font-family: 'Barlow Condensed', 'Segoe UI', sans-serif; font-size: 34px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase; line-height: 1.1; margin-bottom: 4px;
}
.page-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }

/* Two-column layout: main content + the pinned/tracker rail */
.page-cols { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.col-main { min-width: 0; }
.rail { position: sticky; top: 20px; }

/* ── Cards / feed ────────────────────────────────────────────── */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; margin-bottom: 14px; backdrop-filter: blur(8px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05);
}
.card.clickable { cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.card.clickable:hover {
  border-color: var(--cyan-border);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .05), 0 0 24px var(--cyan-dim);
}
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.chip { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: var(--cyan-dim); color: var(--cyan); border: 1px solid var(--cyan-border); }
.chip.amber { background: rgba(255,171,64,.12); color: var(--amber); border-color: rgba(255,171,64,.4); }
.chip.green { background: rgba(105,240,174,.12); color: var(--green); border-color: rgba(105,240,174,.4); }

.composer textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 12px 14px; font-size: 14px; font-family: inherit; resize: vertical;
  min-height: 64px; outline: none;
}
.composer textarea:focus { border-color: var(--cyan); }
.composer-bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.icon-btn {
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  border-radius: 10px; padding: 9px 12px; cursor: pointer; font-size: 15px;
}
.icon-btn:hover { color: var(--cyan); border-color: var(--cyan-border); }
.icon-btn.active { color: var(--cyan); border-color: var(--cyan-border); background: var(--cyan-dim); }

/* Posts get the Elevated treatment: accent hairline, avatar ring, mosaic */
.card[data-post] { position: relative; overflow: hidden; }
.card[data-post]::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--cyan-border), transparent 60%);
}
.post-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.post-head .avatar, .post-head .avatar-fallback { border: 2px solid var(--cyan-border); box-shadow: 0 0 12px var(--cyan-dim); }
.post-head .nm { font-weight: 700; font-size: 14.5px; }
.post-head .tm { color: var(--muted); font-size: 12px; }
.post-text { font-size: 14.5px; white-space: pre-wrap; word-wrap: break-word; }
.post-photos { display: grid; grid-template-columns: 2fr 1fr; grid-auto-rows: 220px; gap: 8px; margin-top: 12px; }
.post-photos img { border-radius: 12px; width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.post-photos img:only-child { grid-column: 1 / -1; }
.post-actions { display: flex; gap: 8px; margin-top: 12px; }
.pa-btn {
  background: var(--surface2); border: 1px solid var(--border); color: var(--muted);
  font-size: 13px; font-weight: 600; cursor: pointer; padding: 7px 14px; border-radius: 999px;
  display: flex; align-items: center; gap: 6px;
}
.pa-btn:hover { color: var(--text); border-color: var(--cyan-border); }
.pa-btn.liked { color: var(--cyan); background: var(--cyan-dim); border-color: var(--cyan-border); box-shadow: 0 0 12px var(--cyan-dim); }
.pa-btn.pinned { color: var(--amber); background: rgba(255, 171, 64, .12); border-color: rgba(255, 171, 64, .4); }
.comments { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; display: none; }
.comment { display: flex; gap: 9px; margin-bottom: 9px; font-size: 13.5px; }
.comment .cb { background: var(--surface2); border-radius: 10px; padding: 7px 11px; }
.comment .cn { font-weight: 700; font-size: 12.5px; }
.comment-input { display: flex; gap: 8px; margin-top: 6px; }
.comment-input input { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; color: var(--text); padding: 9px 14px; font-size: 13px; outline: none; }
.comment-input input:focus { border-color: var(--cyan); }

/* ── Chat / DM ───────────────────────────────────────────────── */
.chat-box { display: flex; flex-direction: column; height: calc(100vh - 210px); min-height: 380px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 6px 2px; }
.msg { max-width: 78%; margin-bottom: 10px; }
.msg .bubble { background: var(--surface2); border: 1px solid var(--border); border-radius: 14px; padding: 9px 13px; font-size: 14px; word-wrap: break-word; }
.msg .meta { font-size: 11px; color: var(--muted); margin-top: 3px; padding: 0 6px; }
.msg.mine { margin-left: auto; }
.msg.mine .bubble { background: var(--cyan-dim); border-color: var(--cyan-border); }
.msg.mine .meta { text-align: right; }
.msg img.chat-img { border-radius: 12px; max-height: 240px; }
.chat-input { display: flex; gap: 9px; padding-top: 12px; }
.chat-input input { flex: 1; background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; color: var(--text); padding: 12px 16px; font-size: 14px; outline: none; }
.chat-input input:focus { border-color: var(--cyan); }
.chat-input .btn { width: auto; padding: 12px 20px; }

/* ── Tabs / lists ────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tab { background: none; border: none; color: var(--muted); font-size: 14px; font-weight: 700; padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.empty { text-align: center; color: var(--muted); padding: 44px 20px; font-size: 14px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border); border-top-color: var(--cyan); border-radius: 50%; animation: spin .7s linear infinite; margin: 34px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Forms / planner ─────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 11.5px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); padding: 11px 13px; font-size: 14px; font-family: inherit; outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--cyan); }
#planner-map, #event-map { height: 300px; border-radius: 12px; border: 1px solid var(--border); }
.map-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* ── Toast ───────────────────────────────────────────────────── */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--surface); border: 1px solid var(--cyan-border); color: var(--text);
  padding: 12px 22px; border-radius: 999px; font-size: 13.5px; z-index: 100;
  transition: transform .25s ease; max-width: 90vw; box-shadow: 0 10px 34px rgba(0,0,0,.5);
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* ── Store / Garage ──────────────────────────────────────────── */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.store-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s;
}
.store-card.equipped { border-color: var(--cyan); }
.store-card .preview {
  height: 108px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--surface2), var(--surface));
  position: relative;
}
.store-card .swatch { width: 52px; height: 52px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); }
.store-card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.store-card .nm { font-weight: 700; font-size: 14px; }
.store-card .price { font-size: 12.5px; color: var(--amber); font-weight: 700; }
.store-card .gate { font-size: 11.5px; color: var(--muted); }
.store-card .btn { padding: 9px 12px; font-size: 13px; margin-top: auto; }
.equipped-badge {
  position: absolute; top: 8px; right: 8px; background: var(--cyan); color: #001318;
  font-size: 10px; font-weight: 800; letter-spacing: 1px; padding: 3px 8px; border-radius: 999px;
}
.owned-check { position: absolute; top: 8px; left: 8px; color: var(--green); font-size: 16px; }

.balance-hero { display: flex; align-items: baseline; gap: 10px; }
.balance-hero .num { font-size: 40px; font-weight: 300; color: var(--amber); }
.bundle-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 14px; }
.bundle {
  background: var(--surface2); border: 1px solid var(--border); border-radius: 12px;
  padding: 16px 14px; text-align: center; cursor: pointer; transition: border-color .15s;
}
.bundle:hover { border-color: var(--amber); }
.bundle .amt { font-size: 20px; font-weight: 800; color: var(--amber); }
.bundle .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tx-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.tx-row:last-child { border-bottom: none; }
.tx-amt { font-weight: 700; }
.tx-amt.pos { color: var(--green); }
.tx-amt.neg { color: var(--red); }
.pro-badge { background: rgba(212,168,83,.15); border: 1px solid rgba(212,168,83,.5); color: #D4A853; }

/* ── Leaderboards ────────────────────────────────────────────── */
.lb-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 10px; margin-bottom: 4px; }
.lb-row.me { background: var(--cyan-dim); border: 1px solid var(--cyan-border); }
.lb-rank { width: 34px; font-weight: 800; color: var(--muted); text-align: center; }
.lb-rank.top { color: var(--amber); }
.lb-val { font-weight: 700; color: var(--cyan); }

/* ── Achievements ────────────────────────────────────────────── */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.ach-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 15px; }
.ach-card.unlocked { border-color: rgba(255,171,64,.5); }
.ach-card .nm { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; }
.ach-card .desc { font-size: 12.5px; color: var(--muted); margin-top: 4px; min-height: 32px; }
.prog { height: 5px; background: var(--surface2); border-radius: 999px; margin-top: 10px; overflow: hidden; }
.prog > div { height: 100%; background: var(--cyan); border-radius: 999px; }
.pin-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 8px; font-size: 11.5px; padding: 5px 10px; cursor: pointer; margin-top: 10px; }
.pin-btn.pinned { color: var(--amber); border-color: rgba(255,171,64,.5); }

/* ── Chat extras (emoji / GIF / photo) ───────────────────────── */
.chat-tools { display: flex; gap: 6px; align-items: center; }
.chat-tools .icon-btn { padding: 10px 12px; border-radius: 999px; }
.chat-pop {
  position: absolute; bottom: 64px; left: 0; right: 0; max-height: 260px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  padding: 12px; overflow-y: auto; z-index: 40; box-shadow: 0 14px 40px rgba(0,0,0,.5);
}
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 2px; }
.emoji-grid button {
  background: none; border: none; font-size: 22px; padding: 5px; cursor: pointer;
  border-radius: 8px; line-height: 1;
}
.emoji-grid button:hover { background: var(--surface2); }
.gif-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.gif-grid img { width: 100%; height: 90px; object-fit: cover; border-radius: 10px; cursor: pointer; border: 1px solid var(--border); }
.gif-grid img:hover { border-color: var(--cyan); }
.gif-search { width: 100%; background: var(--surface2); border: 1px solid var(--border); border-radius: 999px; color: var(--text); padding: 9px 14px; font-size: 13px; outline: none; margin-bottom: 10px; }
.chat-input-wrap { position: relative; }
.upload-note { font-size: 11.5px; color: var(--muted); text-align: center; padding: 6px 0 0; }

/* ── Modal ───────────────────────────────────────────────────── */
.modal-back {
  position: fixed; inset: 0; background: rgba(5,5,8,.7); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal {
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px;
  padding: 24px; width: 100%; max-width: 420px; max-height: 80vh; overflow-y: auto;
}
.modal h3 { margin-bottom: 14px; font-size: 18px; }

/* ── Right rail widgets ──────────────────────────────────────── */
.rail .card { padding: 15px 16px; margin-bottom: 12px; }
.rw-title { font-size: 10.5px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 11px; display: flex; align-items: center; }
.rw-title a { margin-left: auto; font-size: 10.5px; letter-spacing: 1px; }
.daily-dots { display: flex; gap: 6px; margin: 10px 0 12px; }
.daily-dot {
  width: 26px; height: 26px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 800; color: var(--muted);
  background: var(--surface2); border: 1px solid var(--border);
}
.daily-dot.hit { background: var(--cyan-dim); border-color: var(--cyan-border); color: var(--cyan); }
.daily-dot.today { border-color: var(--cyan); box-shadow: 0 0 10px var(--cyan-dim); }
.streak-line { font-size: 12.5px; color: var(--muted); }
.streak-line b { color: var(--amber); }
.rail-balance { font-family: 'Barlow Condensed', sans-serif; font-size: 30px; font-weight: 700; color: var(--amber); line-height: 1; }
.rail-delta { font-size: 12px; margin-top: 4px; }
.rail-delta .pos { color: var(--green); font-weight: 700; }
.rail-delta .neg { color: #FF6E6E; font-weight: 700; }
.rail-item { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.rail-item:last-child { border-bottom: none; }
.rail-item .ri-body { flex: 1; min-width: 0; }
.rail-item .ri-t { font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item .ri-s { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rail-item .ri-x { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 5px; }
.rail-item .ri-x:hover { color: #FF6E6E; }
.ri-date {
  width: 40px; height: 42px; border-radius: 10px; flex: none; text-align: center;
  background: var(--cyan-dim); border: 1px solid var(--cyan-border);
  display: flex; flex-direction: column; justify-content: center;
}
.ri-date .mo { font-size: 9px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--cyan); }
.ri-date .dy { font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-weight: 700; line-height: 1; }
.rail-ach { padding: 6px 0; }
.rail-ach .ra-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.rail-ach .ra-row b { font-weight: 700; }
.rail-ach .ra-row .pct { color: var(--cyan); font-weight: 700; }
.rail-ach .prog { height: 5px; margin: 0 0 4px; }

/* ── Club cards + HQ banner ──────────────────────────────────── */
.club-card { position: relative; overflow: hidden; }
.club-card .club-wm {
  position: absolute; right: 6px; top: -26px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 92px; font-weight: 700; color: var(--cyan); opacity: .07; pointer-events: none;
  text-transform: uppercase; line-height: 1;
}
.club-banner {
  position: relative; overflow: hidden; border-radius: 16px 16px 0 0; height: 120px;
  margin: -18px -18px 0; padding: 16px 20px;
  background:
    repeating-radial-gradient(circle at 85% 160%, transparent 0 40px, rgba(255, 255, 255, .04) 40px 41px),
    repeating-radial-gradient(circle at 10% -60%, transparent 0 34px, rgba(255, 255, 255, .03) 34px 35px),
    linear-gradient(120deg, var(--cyan-dim), transparent 65%);
  border-bottom: 1px solid var(--cyan-border);
}
.club-banner .bn-wm {
  position: absolute; right: 14px; bottom: -34px; font-family: 'Barlow Condensed', sans-serif;
  font-size: 130px; font-weight: 700; color: var(--cyan); opacity: .08; line-height: 1; pointer-events: none;
}
.club-banner .bn-kicker { font-size: 10px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cyan); opacity: .85; }
.club-crest-row { display: flex; align-items: flex-end; gap: 14px; margin-top: -34px; position: relative; }
.club-crest-row .avatar, .club-crest-row .avatar-fallback {
  border: 3px solid var(--cyan-border); box-shadow: 0 8px 22px rgba(0, 0, 0, .5), 0 0 16px var(--cyan-dim);
  background: var(--surface);
}
.club-name-lg { font-family: 'Barlow Condensed', sans-serif; font-size: 30px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; line-height: 1.05; }

/* ── Lighting panel (Garage → Lighting) ──────────────────────── */
.light-grid { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.light-card .sec-label { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.wheel-wrap { display: flex; justify-content: center; padding: 6px 0 14px; }
.color-wheel {
  position: relative; width: 200px; height: 200px; border-radius: 50%; touch-action: none; cursor: crosshair;
  background:
    radial-gradient(circle closest-side, #fff 0%, transparent 72%),
    conic-gradient(from 0deg, red, yellow, lime, cyan, blue, magenta, red);
  box-shadow: 0 0 30px rgba(0, 0, 0, .45), inset 0 0 18px rgba(0, 0, 0, .25);
}
.wheel-thumb {
  position: absolute; width: 18px; height: 18px; border-radius: 50%; pointer-events: none;
  border: 3px solid #fff; box-shadow: 0 0 8px rgba(0, 0, 0, .6); background: transparent;
}
.wheel-lock {
  position: absolute; inset: 0; border-radius: 50%; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; cursor: default;
  background: rgba(8, 8, 12, .6); backdrop-filter: blur(3px); border: 1px solid rgba(212, 168, 83, .4);
}
.lock-chip {
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px; color: #D4A853;
  background: rgba(212, 168, 83, .15); border: 1px solid rgba(212, 168, 83, .5);
  border-radius: 999px; padding: 4px 12px;
}
.btn-gold { background: rgba(212, 168, 83, .15); color: #D4A853; border: 1px solid rgba(212, 168, 83, .5); }
.btn-gold:hover { background: rgba(212, 168, 83, .25); }
.hex-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.hex-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .35); flex: none; }
.hex-val { font-family: Consolas, monospace; font-size: 14px; letter-spacing: 1px; }
.ab-toggle { display: inline-flex; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
.ab-btn { background: transparent; border: none; color: var(--muted); font-weight: 800; font-size: 12px; padding: 4px 12px; cursor: pointer; }
.ab-btn.active { background: var(--cyan-dim); color: var(--cyan); }
.preset-row { display: flex; gap: 9px; flex-wrap: wrap; margin-bottom: 12px; }
.preset-dot {
  width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0;
  transition: transform .12s, border-color .12s;
}
.preset-dot:hover { transform: scale(1.15); }
.preset-dot.active { border-color: #fff; box-shadow: 0 0 10px var(--cyan-border); }
.preset-dot.locked { opacity: .35; filter: saturate(.6); }
.mode-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.mode-pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); color: var(--text);
  font-weight: 700; font-size: 13px; padding: 8px 15px;
}
.mode-pill .mi { opacity: .8; }
.mode-pill:hover { border-color: var(--cyan-border); }
.mode-pill.active { background: var(--cyan-dim); border-color: var(--cyan-border); color: var(--cyan); box-shadow: 0 0 14px var(--cyan-border); }
.mode-pill.pro-locked { opacity: .6; }
.pro-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 1px; color: #D4A853;
  background: rgba(212, 168, 83, .15); border: 1px solid rgba(212, 168, 83, .5);
  border-radius: 999px; padding: 1px 6px;
}
.light-slider { display: grid; grid-template-columns: 120px 1fr 52px; align-items: center; gap: 12px; margin-bottom: 14px; }
.light-slider label { font-size: 11px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.light-slider input[type="range"] { width: 100%; accent-color: var(--cyan); }
.light-slider .lv { text-align: right; font-weight: 700; color: var(--cyan); font-size: 13px; }
.light-status { display: flex; align-items: center; gap: 14px; margin-top: 14px; border-color: var(--cyan-border); }
.status-swatch { width: 34px; height: 34px; border-radius: 50%; flex: none; animation: rrPulse 6s ease-in-out infinite; }
@keyframes rrPulse {
  0%, 100% { box-shadow: 0 0 18px var(--cyan-border); }
  50% { box-shadow: 0 0 30px var(--cyan); }
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 780px) {
  .sidebar { top: auto; width: 100%; height: 62px; flex-direction: row; border-right: none; border-top: 1px solid var(--border); overflow-x: auto; }
  .side-logo, .side-user { display: none; }
  .nav-item { flex-direction: column; gap: 2px; justify-content: center; font-size: 9px; padding: 6px 4px; border-left: none; border-top: 3px solid transparent; min-width: 62px; flex: none; }
  .bundle-row { grid-template-columns: 1fr; }
  .nav-item.active { border-left: none; border-top-color: var(--cyan); }
  .nav-item .badge { position: absolute; margin: 0; top: 4px; right: 18%; }
  .main { margin-left: 0; padding: 18px 14px 96px; }
  .chat-box { height: calc(100vh - 250px); }
  .light-grid { grid-template-columns: 1fr; }
  .light-slider { grid-template-columns: 90px 1fr 46px; }
}
@media (max-width: 1100px) {
  .page-cols { grid-template-columns: 1fr; }
  .rail { position: static; }
}

/* ═══ Elevated phase 2 — showroom · podium · medals · messages · rail ═══ */

.sec-label { font-size: 11px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 4px 0 12px; }

/* Garage — Your Loadout strip + showroom cards */
.loadout-strip { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px 18px; margin-bottom: 18px; backdrop-filter: blur(8px); }
.loadout-swatch { width: 58px; height: 58px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); animation: rrPulse 6s ease-in-out infinite; flex: none; }
.loadout-strip .lo-label { font-size: 10.5px; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.loadout-strip .lo-name { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 700; line-height: 1.1; }
.loadout-strip .lo-balance { margin-left: auto; font-family: 'Barlow Condensed', sans-serif; font-size: 26px; font-weight: 700; color: var(--amber); }
.store-sec { margin: 20px 0 10px; }
.store-card .preview { height: 130px; position: relative; }
.store-card .preview::after { content: ''; position: absolute; left: 50%; bottom: 12px; width: 66px; height: 12px; transform: translateX(-50%); background: radial-gradient(ellipse at center, rgba(0,0,0,.5), transparent 70%); border-radius: 50%; }
.store-card .swatch { width: 58px; height: 58px; position: relative; z-index: 1; }
.store-card.equipped { border-color: color-mix(in srgb, var(--cyan) 60%, transparent); }
.store-card.equipped .equipped-badge { animation: rrPulse 6s ease-in-out infinite; }

/* Ranks — podium + rank plates */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 14px; margin: 18px 0 22px; }
.podium-slot { flex: 1; max-width: 170px; text-align: center; min-width: 0; }
.podium-slot .p-ava { display: flex; justify-content: center; }
.podium-slot .p-name { font-weight: 700; font-size: 13.5px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.podium-slot .p-val { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 700; color: var(--cyan); }
.podium-base { border-radius: 12px 12px 0 0; display: flex; align-items: center; justify-content: center; margin-top: 10px; border: 1px solid var(--border); border-bottom: none; }
.podium-base.gold { height: 128px; background: linear-gradient(180deg, rgba(255,171,64,.30), rgba(122,78,28,.10)); border-color: rgba(255,171,64,.45); }
.podium-base.silver { height: 96px; background: linear-gradient(180deg, rgba(220,225,235,.22), rgba(120,128,140,.08)); border-color: rgba(220,225,235,.35); }
.podium-base.bronze { height: 78px; background: linear-gradient(180deg, rgba(205,127,50,.24), rgba(90,50,20,.08)); border-color: rgba(205,127,50,.4); }
.podium-base.gold .medal-disc { box-shadow: 0 6px 16px rgba(255,171,64,.3), inset 0 -3px 6px rgba(0,0,0,.35), 0 0 26px rgba(255,171,64,.35); }
.medal-disc { border-radius: 50%; display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: #3A2A08; background: radial-gradient(circle at 35% 30%, #FFE9B8, #FFAB40 48%, #7A4E1C 100%); border: 1px solid rgba(255,171,64,.6); box-shadow: 0 6px 16px rgba(255,171,64,.3), inset 0 -3px 6px rgba(0,0,0,.35); }
.medal-disc.silver { background: radial-gradient(circle at 35% 30%, #F4F6FA, #B9C1CE 48%, #5A6270 100%); border-color: rgba(220,225,235,.6); box-shadow: 0 6px 16px rgba(220,225,235,.22), inset 0 -3px 6px rgba(0,0,0,.35); color: #242A33; }
.medal-disc.bronze { background: radial-gradient(circle at 35% 30%, #F1C9A0, #CD7F32 48%, #5E3616 100%); border-color: rgba(205,127,50,.6); box-shadow: 0 6px 16px rgba(205,127,50,.25), inset 0 -3px 6px rgba(0,0,0,.35); color: #2E1B08; }
.medal-disc.locked { background: linear-gradient(180deg, var(--surface2), var(--card)); filter: grayscale(1); opacity: .75; color: var(--muted); box-shadow: none; border-color: var(--border); }
.medal-64 { width: 64px; height: 64px; font-size: 24px; flex: none; }
.medal-52 { width: 52px; height: 52px; font-size: 17px; flex: none; }
.rank-plate { width: 34px; height: 26px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 14px; color: var(--muted); flex: none; }
.lb-row.me { box-shadow: 0 0 18px color-mix(in srgb, var(--cyan) 14%, transparent); }

/* Awards — medal discs + tick-mask progress + pill pin */
.ach-head { display: flex; align-items: center; gap: 12px; }
.ach-card .prog { height: 8px; position: relative; }
.ach-card .prog > div { background: linear-gradient(90deg, color-mix(in srgb, var(--cyan) 70%, transparent), var(--cyan)); box-shadow: 0 0 12px color-mix(in srgb, var(--cyan) 45%, transparent); }
.ach-card .prog::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 23px, rgba(10,10,15,.55) 23px 25px); pointer-events: none; }
.pin-btn { border-radius: 999px; padding: 6px 14px; }
.pin-btn.pinned { background: rgba(255,171,64,.14); }

/* Messages — unread glow + DM glass header + day divider */
.conv-row.unread { border-color: color-mix(in srgb, var(--cyan) 25%, var(--border)); }
.conv-row.unread .conv-prev { color: inherit; font-weight: 600; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); flex: none; }
.dm-head { display: flex; align-items: center; gap: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 12px 16px; margin-bottom: 14px; backdrop-filter: blur(8px); }
.dm-head .presence { font-size: 11.5px; color: var(--muted); }
.day-divider { display: flex; align-items: center; gap: 10px; margin: 14px 0 10px; color: var(--muted); font-size: 10.5px; font-weight: 800; letter-spacing: 2px; }
.day-divider::before, .day-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* Rail — Next Ride hero + Top Riders + Showcase */
.rail-hero { position: relative; overflow: hidden; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--cyan) 25%, var(--border)); padding: 14px; margin-bottom: 10px; cursor: pointer; background: repeating-radial-gradient(circle at 85% 160%, transparent 0 40px, rgba(255,255,255,.04) 40px 41px), repeating-radial-gradient(circle at 10% -40%, transparent 0 34px, rgba(255,255,255,.035) 34px 35px), linear-gradient(135deg, color-mix(in srgb, var(--cyan) 14%, #10101a), #10101a); }
.rail-hero .rh-kicker { font-size: 10px; font-weight: 800; letter-spacing: 2.5px; text-transform: uppercase; color: var(--cyan); }
.rail-hero .rh-title { font-family: 'Barlow Condensed', sans-serif; font-size: 22px; font-weight: 700; line-height: 1.15; margin: 2px 0; }
.rail-hero .rh-sub { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }
.rail-top3 .tr-row { display: flex; align-items: center; gap: 9px; padding: 6px 0; }
.rail-top3 .tr-nm { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rail-top3 .tr-val { margin-left: auto; font-family: 'Barlow Condensed', sans-serif; font-weight: 700; color: var(--cyan); flex: none; }
.rail-show { display: flex; gap: 10px; }
.rail-show .medal-52 { width: 44px; height: 44px; font-size: 15px; }

/* Trip planner — waypoint route builder */
#planner-map { height: 380px; }
.wp-marker { width: 24px; height: 24px; border-radius: 50%; background: var(--cyan); color: #001318; font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; border: 2px solid rgba(255,255,255,.85); box-shadow: 0 2px 10px rgba(0,0,0,.5), 0 0 12px color-mix(in srgb, var(--cyan) 40%, transparent); cursor: pointer; }
.route-bar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.route-bar .route-stats { font-size: 12px; color: var(--muted); margin-left: 4px; }
