/* ═══════════════════════════════════════════
   CRUZE — Core Design System
   Aesthetic: Dark editorial × brutal geometry
   Palette: Near-black + electric orange + bone white
════════════════════════════════════════════ */

:root {
  --bg-void: #0a0a0b;
  --bg-dark: #111113;
  --bg-surface: #18181c;
  --bg-raised: #222228;
  --accent: #c12329;
  --accent-warm: #d93b41;
  --accent-glow: rgba(193,35,41,0.18);
  --bone: #f0ece4;
  --muted: #888890;
  --muted-dim: #555560;
  --border: rgba(255,255,255,0.08);
  --border-accent: rgba(193,35,41,0.35);
  --green: #2dca7a;
  --amber: #ffaa00;
  --radius: 6px;
  --radius-lg: 12px;
  --font-display: 'Bebas Neue', sans-serif;
  --font-brand: 'Syne', sans-serif;
  --font-body: 'DM Sans', sans-serif;
  --sidebar-w: 280px;
  --topbar-h: 56px;
}

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

html, body {
  height: 100%;
  background: var(--bg-void);
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

/* ─── AGE GATE ─── */
.age-gate {
  position: fixed; inset: 0; z-index: 9999;
  background: var(--bg-void); /* fallback while the video loads */
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.6s ease;
  overflow: hidden;
}

/* Background video — fills viewport, sits behind all age-gate content */
.ag-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: 0;
  pointer-events: none;
}

/* Dark gradient overlay for text legibility over the video */
.ag-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center,
      rgba(10, 10, 10, 0.55) 0%,
      rgba(10, 10, 10, 0.75) 60%,
      rgba(10, 10, 10, 0.92) 100%);
}

.age-gate-inner {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 420px;
  padding: 0 24px;
}

.ag-logo {
  font-family: var(--font-display);
  font-size: 96px;
  letter-spacing: 8px;
  color: var(--bone);
  line-height: 1;
  margin-bottom: 4px;
  position: relative;
}

.ag-logo::after {
  content: '';
  display: block;
  width: 48px; height: 3px;
  background: var(--accent);
  margin: 12px auto 0;
}

.ag-tagline {
  font-family: var(--font-brand);
  font-size: 12px;
  letter-spacing: 4px;
  text-transform: uppercase;
  color: #ffffff;
  margin-bottom: 32px;
}

.ag-text {
  font-size: 13px;
  color: #ffffff;
  line-height: 1.7;
  margin-bottom: 32px;
}

.btn-enter {
  display: block; width: 100%;
  background: var(--accent);
  color: #fff;
  border: none; cursor: pointer;
  padding: 18px;
  font-family: var(--font-brand);
  font-size: 13px; font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  border-radius: var(--radius);
  margin-bottom: 12px;
  transition: background 0.2s, transform 0.1s;
}
.btn-enter:hover { background: var(--accent-warm); transform: translateY(-1px); }
.btn-enter:active { transform: translateY(0); }

.btn-exit {
  display: block;
  color: var(--muted-dim);
  font-size: 12px;
  text-decoration: none;
  margin-bottom: 40px;
  transition: color 0.2s;
}
.btn-exit:hover { color: var(--muted); }

.ag-features {
  display: flex; gap: 24px; justify-content: center; flex-wrap: wrap;
}

/* Social links — inline inside the main-app topbar (right side) */
.topbar-social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
  background: transparent;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease;
}
.topbar-social-link:hover,
.topbar-social-link:focus-visible {
  color: var(--bone);
  background: rgba(255, 255, 255, 0.08);
  outline: none;
}
.topbar-social-link svg { display: block; }
.ag-feat {
  font-size: 12px; color: #ffffff;
  display: flex; align-items: center; gap: 6px;
}
.feat-icon { color: var(--accent); font-size: 10px; }

/* ─── APP SHELL ─── */
.app { display: flex; height: 100vh; overflow: hidden; }
.hidden { display: none !important; }

/* ─── SIDEBAR ─── */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-dark);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
  z-index: 100;
}

.sidebar-header {
  padding: 20px 20px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--font-display);
  font-size: 32px;
  letter-spacing: 4px;
  color: var(--bone);
}

.sidebar-toggle {
  background: none; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 16px; padding: 4px;
  display: none;
}

.sidebar-nav {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 12px 20px;
  background: none; border: none; cursor: pointer;
  color: var(--muted);
  font-family: var(--font-brand);
  font-size: 13px; font-weight: 400; letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.2s, background 0.2s;
  position: relative;
}
.nav-item:hover { color: var(--bone); background: rgba(255,255,255,0.03); }
.nav-item.active {
  color: var(--bone);
  background: rgba(193,35,41,0.08);
  border-left: 2px solid var(--accent);
}
.nav-icon { font-size: 16px; width: 20px; text-align: center; }
.badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px;
  border-radius: 20px;
  font-family: var(--font-body);
}

/* ─── SIDEBAR FILTERS ─── */
.sidebar-filters {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}
.sidebar-filters::-webkit-scrollbar { width: 3px; }
.sidebar-filters::-webkit-scrollbar-track { background: transparent; }
.sidebar-filters::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.filter-title {
  font-family: var(--font-brand);
  font-size: 10px; font-weight: 700;
  letter-spacing: 3px;
  color: var(--muted-dim);
  margin-bottom: 16px;
}

.filter-group {
  margin-bottom: 20px;
}
.filter-group label {
  display: block;
  font-size: 12px; color: var(--muted);
  margin-bottom: 8px;
  font-family: var(--font-brand);
  letter-spacing: 0.5px;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%; height: 2px;
  background: var(--bg-raised);
  border-radius: 1px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
#dist-val {
  display: block;
  font-size: 12px; color: var(--accent);
  margin-top: 6px; text-align: right;
}

.range-dual {
  display: flex; align-items: center; gap: 8px;
}
.range-dual input {
  flex: 1;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  color: var(--bone);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
}
.range-dual input:focus { border-color: var(--accent); }
.range-dual span { color: var(--muted); font-size: 13px; }

.tag-select { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-brand); letter-spacing: 0.5px;
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}
.tag.active {
  background: var(--accent-glow);
  border-color: var(--border-accent);
  color: var(--accent-warm);
}

/* Toggle switch */
.switch { position: relative; display: inline-block; width: 38px; height: 20px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: var(--bg-raised);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s;
}
.slider::before {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  left: 3px; top: 3px;
  background: var(--muted);
  border-radius: 50%;
  transition: transform 0.2s, background 0.2s;
}
.switch input:checked + .slider { background: var(--accent-glow); }
.switch input:checked + .slider::before { transform: translateX(18px); background: var(--accent); }

/* ─── SIDEBAR FOOTER ─── */
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.my-thumb {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 12px; cursor: pointer;
}
.my-thumb img {
  width: 40px; height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
}
.my-name { font-family: var(--font-brand); font-size: 13px; font-weight: 700; }
.my-status { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; }

.btn-upgrade {
  display: block; width: 100%;
  background: linear-gradient(135deg, #c12329, #d93b41);
  color: #fff; border: none; cursor: pointer;
  padding: 11px;
  font-family: var(--font-brand);
  font-size: 12px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  border-radius: var(--radius);
  transition: opacity 0.2s, transform 0.1s;
}
.btn-upgrade:hover { opacity: 0.9; transform: translateY(-1px); }

/* ─── MAIN CONTENT ─── */
.main-content {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ─── TOPBAR ─── */
.topbar {
  height: var(--topbar-h);
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 16px; gap: 12px;
  flex-shrink: 0;
  z-index: 50;
}
.menu-btn {
  background: none; border: none; color: var(--muted);
  font-size: 20px; cursor: pointer;
  display: none; padding: 4px;
}
.topbar-logo {
  font-family: var(--font-display);
  font-size: 24px; letter-spacing: 4px;
  color: var(--bone);
  display: none;
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.online-count { font-size: 12px; color: var(--green); font-family: var(--font-brand); letter-spacing: 0.5px; }
.notif-btn {
  background: none; border: none; color: var(--muted);
  cursor: pointer; font-size: 14px; position: relative;
  padding: 4px;
}
.badge-sm {
  position: absolute; top: -4px; right: -6px;
  background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 700;
  padding: 1px 4px; border-radius: 10px;
  font-family: var(--font-body);
}

/* ─── VIEWS ─── */
.view {
  display: none; flex: 1; overflow: hidden; position: relative;
}
.view.active { display: flex; flex-direction: column; }

.view-header {
  padding: 20px 24px 16px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.view-header h2 {
  font-family: var(--font-display);
  font-size: 28px; letter-spacing: 2px;
  color: var(--bone);
}

/* ─── MAP ─── */
#view-map { flex: 1; }

#map {
  width: 100%; height: 100%;
  background: #111;
}

/* Force dark leaflet tiles */
.leaflet-tile-pane { filter: brightness(0.7) saturate(0.5) hue-rotate(180deg) invert(1) hue-rotate(180deg); }

.map-controls {
  position: absolute; right: 16px; top: 16px; z-index: 400;
  display: flex; flex-direction: column; gap: 6px;
}
.map-controls button {
  width: 36px; height: 36px;
  background: var(--bg-dark); border: 1px solid var(--border);
  border-radius: var(--radius); color: var(--muted); cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.2s, border-color 0.2s;
}
.map-controls button:hover { color: var(--bone); border-color: var(--border-accent); }

.map-legend {
  position: absolute; bottom: 24px; left: 16px; z-index: 400;
  background: rgba(17,17,19,0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  display: flex; gap: 14px;
  font-size: 11px; color: var(--muted);
  font-family: var(--font-brand);
  letter-spacing: 0.5px;
}
.map-legend span { display: flex; align-items: center; gap: 5px; }

/* ─── MAP HOVER CARD ─── */
.map-hover-card {
  position: absolute; bottom: 70px; left: 50%; transform: translateX(-50%);
  z-index: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex; align-items: center; gap: 12px;
  min-width: 280px;
  animation: slideUp 0.25s ease;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
}
.map-hover-card img {
  width: 52px; height: 52px;
  border-radius: var(--radius);
  object-fit: cover;
  border: 1px solid var(--border);
}
.mhc-info { flex: 1; min-width: 0; }
.mhc-name { font-family: var(--font-brand); font-weight: 700; font-size: 14px; }
.mhc-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mhc-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.mhc-tags .tag { padding: 2px 8px; font-size: 10px; }
.mhc-view {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  padding: 8px 14px;
  font-family: var(--font-brand);
  font-size: 11px; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.2s;
}
.mhc-view:hover { background: var(--accent-warm); }

/* ─── PROFILES GRID ─── */
.sort-bar { display: flex; gap: 6px; }
.sort-btn {
  background: none; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  padding: 6px 14px; border-radius: 20px;
  font-family: var(--font-brand); font-size: 11px; letter-spacing: 1px;
  text-transform: uppercase;
  transition: all 0.2s;
}
.sort-btn.active, .sort-btn:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-glow);
}

.profiles-grid {
  display: grid;
  /* Fluid: as many square cards as fit, scaling with the screen */
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  padding: 2px;
  background: var(--bg-void);
}
.profiles-grid::-webkit-scrollbar { width: 4px; }
.profiles-grid::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ─── PROFILE CARD ─── */
.profile-card {
  position: relative;
  width: 100%;
  /* Square at any width: percentage padding resolves against the
     card's width, so height always equals width (robust everywhere,
     unlike aspect-ratio inside this grid/flex scroll container). */
  height: 0;
  padding-top: 100%;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-surface);
}
.profile-card img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.profile-card:hover img { transform: scale(1.05); }

.profile-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 50%);
  padding: 12px;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.pc-status {
  position: absolute; top: 10px; right: 10px;
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid var(--bg-dark);
}
.pc-status.online { background: var(--green); }
.pc-status.away { background: var(--amber); }
.pc-status.offline { background: var(--muted-dim); }

.pc-name { font-family: var(--font-brand); font-weight: 700; font-size: 14px; line-height: 1.2; }
.pc-meta { font-size: 11px; color: rgba(240,236,228,0.7); margin-top: 3px; }
.pc-distance {
  position: absolute; top: 10px; left: 10px;
  background: rgba(0,0,0,0.6);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 10px; color: var(--bone);
  font-family: var(--font-brand); letter-spacing: 0.5px;
}
.pc-online-tag {
  position: absolute; bottom: 48px; left: 12px;
  background: var(--green);
  color: #fff;
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 9px; font-family: var(--font-brand); font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
}

/* ─── MESSAGES ─── */
.messages-layout {
  display: flex; flex: 1; overflow: hidden;
}

.convo-list {
  width: 300px; flex-shrink: 0;
  border-right: 1px solid var(--border);
  overflow-y: auto;
}
.convo-list::-webkit-scrollbar { width: 3px; }
.convo-list::-webkit-scrollbar-thumb { background: var(--border); }

.convo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  cursor: pointer; border-bottom: 1px solid var(--border);
  transition: background 0.15s;
  position: relative;
}
.convo-item:hover, .convo-item.active { background: var(--bg-surface); }
.convo-item img {
  width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.convo-info { flex: 1; min-width: 0; }
.convo-name { font-family: var(--font-brand); font-weight: 700; font-size: 13px; }
.convo-preview { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.convo-time { font-size: 10px; color: var(--muted-dim); margin-top: 2px; }
.convo-unread {
  background: var(--accent); color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-body);
}

.convo-panel {
  flex: 1; display: flex; flex-direction: column; overflow: hidden;
}
.no-convo {
  flex: 1; display: flex; align-items: center; justify-content: center;
  color: var(--muted-dim); font-size: 14px;
}

.chat-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.chat-header img {
  width: 38px; height: 38px; border-radius: 50%;
  object-fit: cover;
}
.chat-header-info .chat-name { font-family: var(--font-brand); font-weight: 700; }
.chat-header-info .chat-status { font-size: 11px; color: var(--muted); }
.chat-view-profile {
  margin-left: auto;
  background: none; border: 1px solid var(--border);
  color: var(--muted); cursor: pointer;
  padding: 6px 14px;
  border-radius: var(--radius); font-size: 12px;
  font-family: var(--font-brand); letter-spacing: 0.5px;
  transition: all 0.2s;
}
.chat-view-profile:hover { border-color: var(--accent); color: var(--accent); }

.messages-area {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 12px;
}
.messages-area::-webkit-scrollbar { width: 4px; }
.messages-area::-webkit-scrollbar-thumb { background: var(--border); }

.msg-bubble {
  max-width: 65%; display: flex; flex-direction: column;
}
.msg-bubble.mine { align-self: flex-end; align-items: flex-end; }
.msg-bubble.theirs { align-self: flex-start; align-items: flex-start; }

.msg-text {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  font-size: 14px; line-height: 1.5;
}
.msg-bubble.mine .msg-text {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bubble.theirs .msg-text {
  background: var(--bg-raised);
  color: var(--bone);
  border-bottom-left-radius: 4px;
}
.msg-time { font-size: 10px; color: var(--muted-dim); margin-top: 3px; padding: 0 4px; }

/* Chat input area now wraps two rows:
     Row 1 (.chat-input-main): the text area + send button.
     Row 2 (.chat-actions-row): photo / search / location / GIF buttons. */
.chat-input-area {
  padding: 14px 20px 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 10px;
  flex-shrink: 0;
}
.chat-input-main {
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input {
  flex: 1;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 22px; padding: 10px 16px;
  color: var(--bone); font-family: var(--font-body); font-size: 14px;
  outline: none; resize: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: var(--accent); }
.chat-send {
  background: var(--accent); border: none; border-radius: 50%;
  width: 40px; height: 40px;
  color: #fff; cursor: pointer; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background 0.2s, transform 0.1s;
}
.chat-send:hover { background: var(--accent-warm); transform: scale(1.05); }

/* Secondary actions row — sits under the text input. */
.chat-actions-row {
  display: flex; gap: 8px; align-items: center;
  flex-wrap: wrap;
}
.chat-action {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.chat-action:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--bg-raised);
}
.chat-action svg { display: block; }
.chat-action span { line-height: 1; }
.chat-action-gif {
  padding: 4px 10px;
}
.chat-action-gif .gif-badge {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 1px;
  padding: 3px 7px;
  border-radius: 4px;
  background: linear-gradient(135deg, #ff6ac1 0%, #b15cff 50%, #4ae0ff 100%);
  color: #fff;
  line-height: 1;
}

/* Inline search bar inside the chat header — toggles visible via .open */
.chat-searchbar {
  display: none;
  position: absolute;
  top: 100%; left: 0; right: 0;
  margin-top: 0;
  padding: 8px 16px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
  align-items: center;
  gap: 8px;
  z-index: 5;
}
.chat-searchbar.open { display: flex; }
.chat-header { position: relative; }
.chat-searchinput {
  flex: 1;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 18px;
  padding: 8px 14px;
  color: var(--bone); font-size: 13px;
  outline: none;
}
.chat-searchinput:focus { border-color: var(--accent); }
.chat-searchclose {
  background: transparent; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 18px; padding: 4px 8px;
}
.chat-searchclose:hover { color: var(--accent); }

/* Message highlights when search is active */
.msg-text mark {
  background: var(--accent);
  color: #fff;
  padding: 0 2px;
  border-radius: 2px;
}

/* Location message bubble */
.msg-location {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-width: 260px;
  max-width: 320px;
}
.msg-location-map {
  display: block;
  width: 100%;
  height: 140px;
  object-fit: cover;
}
.msg-location-body {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}
.msg-location-pin { font-size: 20px; }
.msg-location-title { font-size: 13px; font-weight: 700; color: var(--bone); }
.msg-location-sub   { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* GIF credit + picker styles */
.msg-gif { max-height: 280px; }
.msg-gif-credit {
  display: inline-block;
  margin-top: 4px;
  font-size: 10px;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.5px;
}
.msg-gif-credit:hover { color: var(--accent); }

/* GIF picker — slides up from the bottom of the chat panel */
.gif-picker {
  display: none;
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 70%;
  max-height: 560px;
  min-height: 340px;
  background: var(--bg-dark);
  border-top: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  z-index: 10;
  flex-direction: column;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.4);
}
.gif-picker.open { display: flex; }
.gif-picker-top {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.gif-search {
  flex: 1;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 18px; padding: 8px 14px;
  color: var(--bone); font-size: 13px;
  outline: none;
}
.gif-search:focus { border-color: var(--accent); }
.gif-close {
  background: transparent; border: none;
  color: var(--muted); cursor: pointer;
  font-size: 18px; padding: 4px 8px;
}
.gif-close:hover { color: var(--accent); }
.gif-grid {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 160px;   /* force tall, uniform rows so thumbs are actually visible */
  gap: 8px;
}
.gif-thumb {
  background: none; border: none; padding: 0; cursor: pointer;
  border-radius: 6px; overflow: hidden;
  transition: transform 0.1s;
  height: 100%;
}
.gif-thumb:hover { transform: scale(1.03); }
.gif-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
.gif-loading, .gif-empty {
  grid-column: 1/-1;
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
.gif-footer {
  padding: 6px 14px 10px;
  text-align: center;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1px;
  border-top: 1px solid var(--border);
}

/* The convo panel needs to be position:relative so the GIF picker and
   search bar absolute-positioning anchor to it. */
.convo-panel { position: relative; }

/* Image message content — the photo fills most of the bubble */
.msg-image {
  display: block;
  max-width: 260px;
  max-height: 320px;
  width: 100%;
  border-radius: var(--radius-lg);
  cursor: zoom-in;
  object-fit: cover;
}
.msg-bubble.mine .msg-image { border-bottom-right-radius: 4px; }
.msg-bubble.theirs .msg-image { border-bottom-left-radius: 4px; }
/* If a text caption follows the image, give it a little breathing room */
.msg-bubble .msg-image + .msg-text { margin-top: 6px; }
/* (Full-screen lightbox styles live in index.html — shared with profile photos.) */

/* ─── STORIES ─── */
.stories-bar {
  padding: 20px 24px;
  display: flex; gap: 16px; overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}
.stories-bar::-webkit-scrollbar { height: 3px; }
.stories-bar::-webkit-scrollbar-thumb { background: var(--border); }

.story-thumb {
  flex-shrink: 0; cursor: pointer; text-align: center;
}
.story-ring {
  width: 64px; height: 64px; border-radius: 50%;
  padding: 3px;
  background: conic-gradient(var(--accent), var(--accent-warm), var(--accent));
  margin-bottom: 6px;
}
.story-ring.seen { background: var(--bg-raised); }
.story-ring img {
  width: 100%; height: 100%; border-radius: 50%;
  object-fit: cover; border: 2px solid var(--bg-dark);
  display: block;
}
.story-thumb span { font-size: 10px; color: var(--muted); font-family: var(--font-brand); letter-spacing: 0.5px; white-space: nowrap; }

.story-viewer {
  position: absolute; inset: 0; z-index: 900;
  background: #000;
  display: flex; align-items: center; justify-content: center;
}
.story-img {
  max-height: 100%; max-width: 100%;
  object-fit: contain;
}
.story-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
  padding: 40px 24px 24px;
}
.story-user { font-family: var(--font-brand); font-weight: 700; font-size: 16px; }
.story-time { font-size: 12px; color: rgba(255,255,255,0.6); margin-top: 4px; }

.story-progress {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; gap: 4px; padding: 12px;
  z-index: 10;
}
.sp-bar {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255,255,255,0.3);
  overflow: hidden;
}
.sp-fill {
  height: 100%; background: #fff;
  border-radius: 2px; width: 0%;
  transition: width linear;
}
.sp-fill.done { width: 100%; }
.sp-fill.active { animation: progressFill 5s linear forwards; }

.story-close {
  position: absolute; top: 16px; right: 16px; z-index: 20;
  background: rgba(0,0,0,0.5); border: none; border-radius: 50%;
  width: 32px; height: 32px;
  color: #fff; cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}
.story-prev, .story-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.4); border: none; border-radius: 50%;
  width: 44px; height: 44px;
  color: #fff; cursor: pointer; font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  z-index: 20;
  transition: background 0.2s;
}
.story-prev { left: 16px; }
.story-next { right: 16px; }
.story-prev:hover, .story-next:hover { background: rgba(0,0,0,0.7); }

/* ─── PROFILE PAGE ─── */
.profile-page {
  overflow-y: auto; flex: 1;
}
.profile-page::-webkit-scrollbar { width: 4px; }
.profile-page::-webkit-scrollbar-thumb { background: var(--border); }

.profile-hero {
  position: relative; height: 320px;
  overflow: hidden;
}
.profile-hero-img {
  width: 100%; height: 100%; object-fit: cover;
}
.profile-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg-void) 0%, transparent 60%);
}

.profile-identity {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px;
  display: flex; align-items: flex-end; gap: 16px;
}
.profile-avatar {
  width: 80px; height: 80px; border-radius: var(--radius-lg);
  border: 3px solid var(--accent);
  object-fit: cover; flex-shrink: 0;
}
.profile-name-block {}
.profile-username {
  font-family: var(--font-display);
  font-size: 36px; letter-spacing: 2px;
  line-height: 1;
}
.profile-status-line {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  margin-top: 4px;
  font-family: var(--font-brand);
}

.profile-actions {
  padding: 16px 24px;
  display: flex; gap: 10px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
}

.btn-primary {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  padding: 10px 20px;
  font-family: var(--font-brand); font-size: 12px; font-weight: 700;
  letter-spacing: 1.5px; text-transform: uppercase;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover { background: var(--accent-warm); transform: translateY(-1px); }

.btn-secondary {
  background: var(--bg-raised); color: var(--bone);
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  padding: 10px 20px;
  font-family: var(--font-brand); font-size: 12px;
  letter-spacing: 1px; text-transform: uppercase;
  transition: border-color 0.2s;
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* ─── PROFILE BANNER SLOT ─── */
.profile-banner-slot {
  border-bottom: 1px solid var(--border);
}
.profile-banner-ad {
  display: block;
  width: 100%;
}
.profile-banner-ad img {
  width: 100%;
  display: block;
  max-height: 160px;
  object-fit: cover;
}
.profile-banner-promo {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: linear-gradient(135deg, rgba(193,35,41,0.07), rgba(193,35,41,0.04));
}
.profile-banner-promo-icon {
  font-size: 28px;
  flex-shrink: 0;
}
.profile-banner-promo-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.profile-banner-promo-text strong {
  font-family: var(--font-brand);
  font-size: 13px;
  color: var(--fg);
  letter-spacing: 0.5px;
}
.profile-banner-promo-text span {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
}
.btn-accent-sm {
  background: linear-gradient(135deg, #c12329, #d93b41);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  padding: 8px 16px;
  font-family: var(--font-brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity 0.2s;
}
.btn-accent-sm:hover { opacity: 0.85; }

.profile-body {
  padding: 24px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
}

.profile-section { margin-bottom: 0; }
.section-label {
  font-family: var(--font-brand);
  font-size: 10px; font-weight: 700;
  letter-spacing: 3px; text-transform: uppercase;
  color: var(--muted-dim);
  margin-bottom: 12px;
}

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.stat-value { font-family: var(--font-display); font-size: 22px; letter-spacing: 1px; }
.stat-key { font-size: 10px; color: var(--muted); font-family: var(--font-brand); letter-spacing: 1px; margin-top: 2px; }

.looking-for-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lf-tag {
  padding: 5px 14px;
  border: 1px solid var(--border-accent);
  background: var(--accent-glow);
  color: var(--accent-warm);
  border-radius: 20px;
  font-size: 12px; font-family: var(--font-brand);
}

.about-text { font-size: 14px; color: rgba(240,236,228,0.8); line-height: 1.7; }

.interests-list { display: flex; flex-wrap: wrap; gap: 6px; }
.interest-chip {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 11px; color: var(--muted);
  font-family: var(--font-brand); letter-spacing: 0.5px;
}

/* Photos grid */
.photos-section { grid-column: 1 / -1; }
.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 6px;
}
.photo-thumb {
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: var(--radius);
  cursor: pointer; position: relative;
}
.photo-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s;
}
.photo-thumb:hover img { transform: scale(1.08); }

.private-photo {
  filter: blur(12px) brightness(0.4);
}
.private-lock {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: var(--muted); font-size: 20px;
  pointer-events: none;
}
.private-lock span { font-size: 10px; margin-top: 4px; font-family: var(--font-brand); letter-spacing: 1px; }

/* Edits my profile */
.edit-profile-form {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  grid-column: 1 / -1;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label {
  font-size: 11px; color: var(--muted);
  font-family: var(--font-brand); letter-spacing: 1px; text-transform: uppercase;
}
.form-field input, .form-field textarea, .form-field select {
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 12px;
  color: var(--bone); font-family: var(--font-body); font-size: 14px;
  outline: none; transition: border-color 0.2s;
}
.form-field input:focus, .form-field textarea:focus { border-color: var(--accent); }
.form-field textarea { resize: vertical; min-height: 80px; }
.form-field select option { background: var(--bg-dark); }

/* ─── X (TWITTER) VIDEO EMBEDS ─── */
/* Wrapper around the 3 embedded tweet cards on a profile. Tweets render at
   a max width of 550px by themselves; we stack them with some vertical gap
   and constrain width so the section doesn't sprawl on wide screens. */
.x-videos-section { }
.x-videos-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  max-width: 550px;
}
.x-videos-grid .twitter-tweet {
  margin: 0 !important;
  width: 100% !important;
}

/* Fallback card rendered *inside* each <blockquote class="twitter-tweet">.
   widgets.js replaces the blockquote with an <iframe> when the embed
   hydrates successfully — until then (or if it never does, e.g. sensitive
   content / blocked scripts) the user sees this styled card. Clicking the
   card follows the <a href> inside the blockquote to the X post. */
.x-videos-grid .twitter-tweet {
  background: #16181c;
  border: 1px solid var(--border, #2f3336);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  color: #e7e9ea;
  position: relative;
}
.x-videos-grid .twitter-tweet > a {
  position: absolute; inset: 0;
  text-indent: -9999px;
  overflow: hidden;
  z-index: 2;
}
.x-fallback-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  pointer-events: none; /* let the overlay <a> capture clicks */
}
.x-fallback-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #000;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.x-fallback-icon svg { display: block; }
.x-fallback-body {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.x-fallback-title {
  font-weight: 700;
  font-size: 15px;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-fallback-sub {
  font-size: 13px;
  color: #8b98a5;
  line-height: 1.2;
}
.x-fallback-cta {
  font-size: 13px;
  font-weight: 600;
  color: #1d9bf0;
  padding: 6px 12px;
  border: 1px solid rgba(29,155,240,0.35);
  border-radius: 999px;
  flex: 0 0 auto;
}

/* ─── PROFILE MODAL ─── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}

.profile-modal {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalIn 0.25s ease;
}
.profile-modal::-webkit-scrollbar { width: 4px; }
.profile-modal::-webkit-scrollbar-thumb { background: var(--border); }

.modal-close {
  position: sticky; top: 16px;
  float: right; margin: 16px 16px 0 0;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: 50%; width: 32px; height: 32px;
  color: var(--muted); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: all 0.2s;
}
.modal-close:hover { color: var(--bone); border-color: var(--accent); }

/* ─── UPGRADE MODAL ─── */
.upgrade-modal {
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 400px;
  padding: 40px 32px;
  text-align: center;
  position: relative;
  animation: modalIn 0.25s ease;
}

.upgrade-logo {
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center; gap: 12px;
}
.upgrade-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
}
.premium-badge {
  background: linear-gradient(135deg, #c12329, #d93b41);
  color: #fff;
  font-size: 11px; padding: 4px 10px;
  border-radius: 20px;
  font-family: var(--font-brand); font-weight: 700;
  letter-spacing: 2px;
  vertical-align: middle;
}
.upgrade-modal h2 {
  font-family: var(--font-brand); font-size: 18px; font-weight: 700;
  margin-bottom: 24px; color: var(--muted);
}
.upgrade-features { margin-bottom: 28px; text-align: left; }
.uf-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.uf-check { color: var(--green); font-weight: 700; }
.upgrade-price {
  font-family: var(--font-display);
  font-size: 56px; letter-spacing: 2px;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 4px;
}
.upgrade-price span { font-size: 20px; color: var(--muted); }
.btn-upgrade-now {
  display: block; width: 100%;
  background: linear-gradient(135deg, #c12329, #d93b41);
  color: #fff; border: none; cursor: pointer;
  padding: 16px;
  font-family: var(--font-brand);
  font-size: 14px; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase;
  border-radius: var(--radius);
  margin: 20px 0 12px;
  transition: opacity 0.2s;
}
.btn-upgrade-now:hover { opacity: 0.9; }
.upgrade-fine { font-size: 11px; color: var(--muted-dim); }

/* ─── CUSTOM MAP MARKERS ─── */
.map-marker {
  cursor: pointer;
}
.marker-pulse {
  width: 44px; height: 44px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.marker-img {
  width: 36px; height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent);
  position: relative; z-index: 2;
}
.marker-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(193,35,41,0.5);
  animation: markerPulse 2s infinite;
}

/* ─── DOT INDICATORS ─── */
.dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  flex-shrink: 0;
}
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.gray { background: var(--muted-dim); }

/* ─── ANIMATIONS ─── */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes modalIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes markerPulse { 0%, 100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.5); opacity: 0; } }
@keyframes progressFill { from { width: 0%; } to { width: 100%; } }

/* ─── LEAFLET POPUP CUSTOM ─── */
.leaflet-popup-content-wrapper {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-lg) !important;
  color: var(--bone) !important;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6) !important;
  padding: 0 !important;
}
.leaflet-popup-content {
  margin: 0 !important;
  width: 200px !important;
}
.leaflet-popup-tip { background: var(--bg-surface) !important; }
.leaflet-popup-close-button { color: var(--muted) !important; padding: 8px !important; }

.popup-card { padding: 12px; }
.popup-card img {
  width: 100%; height: 120px; object-fit: cover;
  border-radius: var(--radius); margin-bottom: 10px;
}
.popup-name { font-family: var(--font-brand); font-weight: 700; font-size: 14px; }
.popup-meta { font-size: 11px; color: var(--muted); margin-top: 3px; }
.popup-view {
  display: block; width: 100%; margin-top: 10px;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  padding: 8px; font-family: var(--font-brand);
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; text-align: center;
  transition: background 0.2s;
}
.popup-view:hover { background: var(--accent-warm); }

/* ─── PROFILE BANNER AD ─── */
.profile-banner-ad {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.profile-banner-ad img {
  width: 100%;
  display: block;
  max-height: 120px;
  object-fit: cover;
  object-position: center;
}

.banner-ad-label {
  position: absolute;
  top: 8px;
  right: 10px;
  background: rgba(0,0,0,0.65);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 9px;
  font-family: var(--font-brand);
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--muted);
  pointer-events: none;
}

.banner-ad-link-wrap {
  display: block;
  cursor: pointer;
  transition: opacity 0.2s;
}
.banner-ad-link-wrap:hover { opacity: 0.92; }

/* ─── BANNER UPLOAD PANEL (My Profile) ─── */
.banner-upload-section {
  grid-column: 1 / -1;
}

.banner-upload-box {
  border: 1.5px dashed var(--border-accent);
  border-radius: var(--radius-lg);
  background: var(--accent-glow);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  position: relative;
  overflow: hidden;
}
.banner-upload-box:hover {
  background: rgba(193,35,41,0.12);
  border-color: var(--accent);
}
.banner-upload-box.has-banner { padding: 0; border-style: solid; cursor: default; }

.bub-icon { font-size: 28px; margin-bottom: 8px; }
.bub-title {
  font-family: var(--font-brand);
  font-size: 14px; font-weight: 700;
  color: var(--accent-warm);
  margin-bottom: 4px;
}
.bub-sub { font-size: 12px; color: var(--muted); line-height: 1.5; }
.bub-spec {
  display: inline-block;
  margin-top: 10px;
  font-size: 10px; color: var(--muted-dim);
  font-family: var(--font-brand); letter-spacing: 1px;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}

.banner-preview-wrap {
  position: relative;
  width: 100%;
}
.banner-preview-wrap img {
  width: 100%; max-height: 130px;
  object-fit: cover; display: block;
  border-radius: calc(var(--radius-lg) - 2px);
}
.banner-preview-actions {
  position: absolute;
  top: 10px; right: 10px;
  display: flex; gap: 6px;
}
.bpa-btn {
  background: rgba(0,0,0,0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--bone); cursor: pointer;
  font-size: 11px; font-family: var(--font-brand);
  letter-spacing: 0.5px;
  padding: 5px 10px;
  transition: border-color 0.2s;
}
.bpa-btn:hover { border-color: var(--accent); color: var(--accent); }
.bpa-btn.danger:hover { border-color: #e24b4a; color: #e24b4a; }

.banner-url-row {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-surface);
  border-radius: 0 0 calc(var(--radius-lg) - 2px) calc(var(--radius-lg) - 2px);
}
.banner-url-row input {
  flex: 1;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 7px 10px;
  color: var(--bone); font-family: var(--font-body); font-size: 12px;
  outline: none;
}
.banner-url-row input:focus { border-color: var(--accent); }
.banner-url-row label {
  font-size: 11px; color: var(--muted);
  white-space: nowrap;
  font-family: var(--font-brand); letter-spacing: 0.5px;
}
.banner-url-save {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius); cursor: pointer;
  padding: 7px 14px;
  font-family: var(--font-brand); font-size: 11px; font-weight: 700;
  letter-spacing: 1px; white-space: nowrap;
  transition: background 0.2s;
}
.banner-url-save:hover { background: var(--accent-warm); }

/* Locked banner teaser for free users */
.banner-locked-teaser {
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  padding: 24px 20px;
  text-align: center;
  opacity: 0.7;
  position: relative;
}
.blt-icon { font-size: 22px; margin-bottom: 8px; color: var(--muted-dim); }
.blt-title {
  font-family: var(--font-brand); font-size: 13px; font-weight: 700;
  color: var(--muted); margin-bottom: 6px;
}
.blt-sub { font-size: 12px; color: var(--muted-dim); margin-bottom: 14px; }

/* Banner stats strip */
.banner-stats-strip {
  display: flex; gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 12px;
}
.bss-item {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
}
.bss-item:last-child { border-right: none; }
.bss-val {
  font-family: var(--font-display);
  font-size: 18px; letter-spacing: 1px;
  color: var(--accent);
}
.bss-key {
  font-size: 9px; color: var(--muted-dim);
  font-family: var(--font-brand); letter-spacing: 1px;
  margin-top: 2px; text-transform: uppercase;
}

/* Premium pill badge in section label */
.premium-pill {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(135deg, rgba(193,35,41,0.2), rgba(193,35,41,0.2));
  border: 1px solid var(--border-accent);
  border-radius: 20px;
  padding: 2px 8px;
  font-size: 9px;
  color: var(--accent-warm);
  font-family: var(--font-brand); letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-left: 8px;
  vertical-align: middle;
}

/* ─── STORIES LIST ─── */
.stories-list {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.story-item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.story-item:last-child { border-bottom: none; }
.story-item:hover { opacity: 0.85; }
.story-cover {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.story-info { flex: 1; }
.story-title {
  font-family: var(--font-brand);
  font-size: 17px;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}
.story-excerpt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
}
.story-read-tag {
  display: inline-block;
  background: linear-gradient(135deg, #c12329, #d93b41);
  color: #fff;
  font-size: 10px;
  font-family: var(--font-brand);
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 20px;
  vertical-align: middle;
  margin-left: 8px;
}

/* ─── STORY READER MODAL ─── */
.story-reader-modal {
  background: var(--bg-card);
  border-radius: 12px;
  width: 90%;
  max-width: 720px;
  max-height: 88vh;
  overflow-y: auto;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.story-reader-inner {
  padding: 0 0 32px;
}
.story-reader-header {
  position: relative;
  text-align: center;
}
.story-reader-cover {
  width: 100%;
  display: block;
  border-radius: 12px 12px 0 0;
}
.story-reader-title {
  font-family: var(--font-brand);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 2px;
  padding: 20px 32px 8px;
  color: var(--fg);
}
.story-reader-body {
  padding: 0 32px;
}
.story-reader-body p {
  font-size: 15px;
  line-height: 1.85;
  color: var(--fg);
  margin-bottom: 20px;
}
.story-reader-img {
  width: 100%;
  border-radius: 8px;
  margin: 8px 0 24px;
  display: block;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
    /* Leaflet's internal panes/controls go up to z-index 1000, so the
       slide-over menu must sit above them or the map covers it. */
    z-index: 1100;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: flex !important; }
  .menu-btn { display: flex !important; }
  .topbar-logo { display: block !important; }

  .profile-body { grid-template-columns: 1fr; }
  .edit-profile-form { grid-template-columns: 1fr; }
  .photos-section { grid-column: auto; }

  .messages-layout { flex-direction: column; }
  .convo-list { width: 100%; height: 200px; border-right: none; border-bottom: 1px solid var(--border); }

  .map-hover-card { left: 16px; right: 16px; transform: none; bottom: 20px; min-width: auto; }
}

@media (max-width: 480px) {
  /* Phones: always exactly two square cards per row */
  .profiles-grid { grid-template-columns: repeat(2, 1fr); }
  .photos-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ═══ STORIES — real story list + full-text reader ═══ */
.story-list {
  flex: 1;
  overflow-y: auto;   /* .view clips overflow — the list itself must scroll */
  max-width: 760px;
  width: 100%;
  padding: 20px 28px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.story-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.story-item:hover {
  border-color: var(--border-accent);
  transform: translateY(-1px);
}
.story-item-cover {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.story-item-title {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 17px;
  color: var(--bone);
  margin-bottom: 6px;
  letter-spacing: 0.5px;
}
.story-read-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid var(--border-accent);
  border-radius: 3px;
  padding: 1px 6px;
  margin-left: 8px;
  vertical-align: 2px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.story-item-excerpt {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}
.story-reader {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg-void);
  display: flex;
  flex-direction: column;
}
.story-reader.hidden { display: none; }
.story-reader-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-dark);
  flex-shrink: 0;
}
.story-reader-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--bone);
  font-size: 14px;
  padding: 6px 14px;
  cursor: pointer;
}
.story-reader-close:hover { border-color: var(--border-accent); color: var(--accent); }
.story-reader-bartitle {
  font-family: var(--font-brand);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 1px;
  color: var(--bone);
}
.story-reader-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 32px 20px 80px;
}
.story-reader-cover {
  display: block;
  max-width: 420px;
  width: 100%;
  margin: 0 auto 28px;
  border-radius: var(--radius);
}
.story-reader-body {
  max-width: 680px;
  margin: 0 auto;
}
.story-reader-heading {
  font-family: var(--font-brand);
  font-size: 30px;
  color: var(--bone);
  letter-spacing: 1px;
  margin-bottom: 18px;
}
.story-reader-body p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--bone);
  opacity: 0.92;
  margin-bottom: 18px;
}
.story-reader-body .m-story-inline-img {
  display: block;
  max-width: 420px;
  width: 100%;
  margin: 24px auto;
  border-radius: var(--radius);
}

/* ─── LOGIN PANEL (2026 front end, members only) ─── */
.auth-gate { background: var(--bg-void); }
.auth-inner { max-width: 380px; width: 100%; }
.auth-form { text-align: left; margin-top: 8px; }
.auth-form label {
  display: block; font-family: var(--font-brand); font-size: 11px; letter-spacing: 2px;
  text-transform: uppercase; color: var(--muted); margin: 14px 0 6px;
}
.auth-form input[type="email"], .auth-form input[type="password"] {
  width: 100%; padding: 14px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--bg-surface); color: var(--bone); font-family: var(--font-body); font-size: 15px;
}
.auth-form input:focus { outline: none; border-color: var(--accent); }
.auth-form .btn-enter { margin-top: 22px; }
.auth-links { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; font-size: 13px; }
.auth-links a { color: var(--muted); text-decoration: none; }
.auth-links a:hover { color: var(--bone); }
.auth-links .auth-join { color: var(--accent); font-weight: 500; }
.auth-flash {
  background: rgba(193,35,41,0.12); border: 1px solid var(--border-accent); color: var(--bone);
  border-radius: var(--radius); padding: 10px 14px; font-size: 13px; margin-bottom: 8px; text-align: left;
}
.auth-flash.ok { background: rgba(45,202,122,0.12); border-color: rgba(45,202,122,0.4); }

/* ─── SIDEBAR LINK ITEMS (admin, classic, logout) ─── */
.nav-divider { height: 1px; background: var(--border); margin: 8px 20px; }
a.nav-link-item { text-decoration: none; padding: 9px 20px; font-size: 12px; }

/* ─── ARCADE ─── */
.arcade-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; padding: 20px;
}
.arcade-empty { color: var(--muted); padding: 20px; }
.arcade-card {
  background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; cursor: pointer; transition: transform 0.15s, border-color 0.15s;
}
.arcade-card:hover { transform: translateY(-2px); border-color: var(--border-accent); }
.arcade-card img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; background: var(--bg-raised); }
.arcade-card-body { padding: 14px 16px 16px; }
.arcade-card-title { font-family: var(--font-brand); font-weight: 700; font-size: 15px; color: var(--bone); }
.arcade-card-desc { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }
.arcade-card-play {
  display: inline-block; margin-top: 12px; background: var(--accent); color: #fff; font-family: var(--font-brand);
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase; padding: 8px 14px; border-radius: var(--radius);
}
.arcade-player { position: absolute; inset: 0; background: #000; display: flex; flex-direction: column; z-index: 5; }
.arcade-player-bar {
  display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
}
.arcade-newtab { margin-left: auto; color: var(--muted); font-size: 12px; text-decoration: none; }
.arcade-newtab:hover { color: var(--bone); }
#arcade-frame { flex: 1; width: 100%; border: 0; background: #000; }
#view-arcade { position: relative; }

/* ─── PRO AD PANEL (My Profile) ─── */
.proad-panel {
  grid-column: 1/-1; background: var(--bg-surface); border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg); padding: 18px 20px;
}
.proad-panel p { color: var(--muted); font-size: 13px; line-height: 1.6; margin: 6px 0 12px; }
.proad-panel img { width: 100%; max-width: 1000px; height: auto; border-radius: var(--radius); display: block; margin: 8px 0; }
.proad-status { font-family: var(--font-brand); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--accent); }

a.btn-secondary, a.btn-primary, a.btn-accent-sm { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }

/* ─── AGE GATE + LOGIN (one screen) ─── */
.age-gate { overflow-y: auto; }
.age-gate .age-gate-inner { max-width: 400px; width: 100%; margin: auto; padding: 32px 24px; }
.age-gate .ag-text { margin-bottom: 18px; }
.age-gate .auth-form label { text-align: left; }
.age-gate .auth-form input[type="email"], .age-gate .auth-form input[type="password"] { background: rgba(24,24,28,0.85); }
.age-gate .auth-form .btn-enter { margin-top: 18px; margin-bottom: 0; }
.age-gate .auth-links { margin: 16px 0 28px; }
.age-gate .auth-links .btn-exit { margin: 6px 0 0; }
.profile-card-me { outline: 2px solid var(--accent); }
.profile-card-me .pc-distance { color: var(--accent); font-weight: 700; }
.profile-hero-ad { object-fit: cover; }
.hero-ad-label { position: absolute; top: 10px; right: 12px; z-index: 3; }
.profile-hero a { display: block; }
.profile-hero a { display: block; height: 100%; }
/* Pro ad in the hero must be clickable: the gradient and identity strip no longer swallow clicks on the banner */
.profile-hero-overlay { pointer-events: none; }
.profile-identity { pointer-events: none; }
.profile-identity * { pointer-events: auto; }
.profile-hero a { position: relative; z-index: 1; cursor: pointer; }
.hero-ad-label { pointer-events: none; }
/* ─── PRO AD STRIP above every profile ─── */
.profile-ad-strip { display: block; width: 100%; position: relative; background: var(--bg-dark); }
.profile-ad-strip.has-ad img { width: 100%; aspect-ratio: 5/1; object-fit: cover; display: block; }
.profile-ad-strip.has-ad a { display: block; cursor: pointer; }
.profile-ad-strip .banner-ad-label { position: absolute; top: 8px; right: 10px; pointer-events: none; }
.profile-ad-strip.upsell {
  aspect-ratio: 10/1; min-height: 44px; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-brand); font-size: 12px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase;
  color: var(--bone); text-decoration: none; background: linear-gradient(90deg, var(--accent), var(--accent-warm));
}
.profile-ad-strip.upsell:hover { filter: brightness(1.1); }
