/* ============================================================================
   Amichemin — style.css
   Cosmic dark + magenta/blue signal palette.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,700;0,800;0,900;1,700;1,800&display=swap');

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

:root {
  /* -- Palette ------------------------------------------------------------ */
  --bg-base:        #050812;
  --bg-deep:        #07101f;
  --surface-1:      rgba(255,255,255,0.04);
  --surface-2:      rgba(255,255,255,0.07);
  --glass-fill:     rgba(255,255,255,0.06);

  --ink:            #ffffff;
  --paper:          #050812;
  --text-primary:   #ffffff;
  --text-secondary: #cbd5e1;
  --muted:          #8a96ad;
  --accent:         #ff4fd8;     /* signal-you (magenta) */
  --accent2:        #2e8cff;     /* signal-them (blue)   */
  --accent-warm:    #ffb83d;
  --accent-go:      #2ecc8b;     /* go / success         */

  --signal-you:     #ff4fd8;
  --signal-them:    #2e8cff;

  --gradient-meet:   linear-gradient(135deg,#ff3b9d 0%,#247cff 100%);
  --gradient-action: linear-gradient(135deg,#ff4fd8 0%,#2e8cff 100%);

  --border:         rgba(255,255,255,0.08);
  --border-subtle:  rgba(255,255,255,0.05);
  --border-strong:  rgba(255,255,255,0.18);

  --card:           rgba(255,255,255,0.04);

  /* -- Type --------------------------------------------------------------- */
  --sans:  'Inter', system-ui, sans-serif;
  --mono:  ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --serif: 'Inter', system-ui, sans-serif; /* italic Inter takes the place of Fraunces */

  --ease-meet: cubic-bezier(0.22, 1, 0.36, 1);

  font-family: var(--sans);
}

/* -- Cosmic background applied at body so screens inherit -- */
body {
  font-family: var(--sans);
  background:
    radial-gradient(120% 80% at 0% 0%,
       rgba(51,17,72,0.95) 0%,
       rgba(51,17,72,0.35) 22%,
       transparent 42%),
    linear-gradient(180deg, var(--bg-deep) 0%, var(--bg-base) 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  font-size: 14px;
  line-height: 1.55;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

.app { display: flex; flex-direction: column; min-height: 100vh; }

/* --- HEADER ---------------------------------------------------------------- */
header {
  padding: 1rem 1.75rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(5, 8, 18, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-family: var(--sans);
  font-size: 1.4rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  color: var(--ink);
  text-decoration: none;
}
.logo span {
  font-style: italic;
  background: var(--gradient-meet);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  background: var(--gradient-action);
  color: white;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  letter-spacing: 0.02em;
  transition: filter 0.15s;
  white-space: nowrap;
}
.header-cta:hover { filter: brightness(1.1); }

.session-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--gradient-action);
  color: white;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: none;
}

.spacer { flex: 1; }

/* --- LAYOUT ---------------------------------------------------------------- */
.main { flex: 1; display: flex; gap: 0; }

.sidebar {
  width: 360px;
  min-width: 360px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  max-height: calc(100vh - 65px);
  background: rgba(5, 8, 18, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.map-area { flex: 1; position: relative; }

#map {
  width: 100%;
  height: 100%;
  min-height: 500px;
  background: var(--bg-deep);
}

/* OSM tiles tinted to match the cosmic theme */
#map .leaflet-tile-pane {
  filter:
    invert(0.92)
    hue-rotate(180deg)
    saturate(0.55)
    brightness(0.92)
    contrast(0.95);
}

/* Magenta -> blue gradient veil over the whole map */
.map-area::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 401;
  background:
    radial-gradient(80% 60% at 0% 0%,
       rgba(255, 79, 216, 0.22) 0%,
       rgba(255, 79, 216, 0.0) 55%),
    radial-gradient(80% 60% at 100% 100%,
       rgba(46, 140, 255, 0.22) 0%,
       rgba(46, 140, 255, 0.0) 55%),
    linear-gradient(180deg, rgba(5,8,18,0.10), rgba(5,8,18,0.30));
  mix-blend-mode: screen;
}

/* --- PANELS ---------------------------------------------------------------- */
.panel {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.panel--relative { position: relative; }
.panel--flex     { flex: 1; }

.panel-title {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.85rem;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.panel-title .num {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  background: var(--gradient-meet);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}

/* --- FORMS ----------------------------------------------------------------- */
input[type="text"], input[type="number"], select, textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-family: var(--sans);
  font-size: 16px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s var(--ease-meet), background 0.15s var(--ease-meet);
  border-radius: 12px;
  -webkit-appearance: none;
          appearance: none;
}
input::placeholder { color: var(--muted); }
input:focus, select:focus {
  border-color: var(--signal-you);
  background: rgba(255,255,255,0.10);
}

.form-group { margin-bottom: 12px; }
.form-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

/* --- BUTTONS --------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border: 1px solid var(--border-strong);
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s var(--ease-meet);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-radius: 12px;
}
.btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.30); }
.btn.primary {
  background: var(--gradient-action);
  color: white;
  border-color: transparent;
}
.btn.primary:hover { filter: brightness(1.08); }
.btn.accent { background: var(--signal-you); color: white; border-color: var(--signal-you); }
.btn.accent:hover { filter: brightness(1.08); }
.btn.green { background: var(--accent-go); color: white; border-color: var(--accent-go); }
.btn.green:hover { filter: brightness(1.08); }
.btn.sm { padding: 8px 12px; font-size: 11px; min-height: 38px; }
.btn.full { width: 100%; }
.btn:disabled { opacity: 0.35; cursor: not-allowed; }
.btn:disabled:hover { background: transparent; filter: none; }
.btn.primary:disabled, .btn.accent:disabled, .btn.green:disabled { opacity: 0.4; }

/* --- SESSION CODE ---------------------------------------------------------- */
.code-display {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  background: var(--gradient-meet);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  text-align: center;
  padding: 1rem 0;
  border: 1px dashed var(--border-strong);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease-meet);
  user-select: none;
  background-color: rgba(255,255,255,0.03);
}
.code-display:hover { border-color: var(--signal-you); }
.code-display .copy-hint {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.05em;
  display: block;
  margin-top: 4px;
  text-transform: uppercase;
  -webkit-text-fill-color: var(--muted);
}

.online-count-label { margin-top: 10px; font-size: 12px; color: var(--muted); text-align: center; }
.online-count-label #online-count { color: var(--text-primary); font-weight: 700; }

/* --- PARTICIPANTS ---------------------------------------------------------- */
.user-list { display: flex; flex-direction: column; gap: 8px; }

.user-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  border-radius: 12px;
}

.user-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  flex-shrink: 0;
}
.user-dot.located { background: var(--accent-go); box-shadow: 0 0 0 4px rgba(46,204,139,0.16); }
.user-dot.me      { background: var(--signal-you); box-shadow: 0 0 0 4px rgba(255,79,216,0.18); }

.user-name { flex: 1; font-size: 13px; font-weight: 600; color: var(--text-primary); }
.user-loc  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* --- LOCATION PANEL -------------------------------------------------------- */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.loc-status { margin-top: 10px; font-size: 12px; color: var(--muted); }

/* --- FILTERS --------------------------------------------------------------- */
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-tag {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: all 0.15s var(--ease-meet);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  border-radius: 999px;
}
.filter-tag:hover { border-color: var(--border-strong); color: var(--text-primary); }
.filter-tag.active {
  background: var(--gradient-action);
  color: white;
  border-color: transparent;
}
.filter-tag .icon { font-size: 14px; }

/* --- RESULT PANEL ---------------------------------------------------------- */
.result-card {
  border: 1px solid var(--accent-go);
  background: rgba(46, 204, 139, 0.08);
  padding: 1.1rem 1.2rem;
  margin-bottom: 8px;
  border-radius: 16px;
}

.result-name {
  font-family: var(--sans);
  font-size: 1.2rem;
  font-weight: 800;
  font-style: italic;
  background: var(--gradient-meet);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.result-addr  { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.result-dist  { font-size: 12px; color: var(--signal-you); font-weight: 700; margin-bottom: 4px; }
.result-votes { font-size: 12px; color: var(--muted); margin-bottom: 1rem; }

.result-maps-btn { text-decoration: none; display: flex; }
.result-timestamp {
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

/* --- SHARE BUTTON ---------------------------------------------------------- */
.share-btn {
  background: var(--accent-go);
  color: white;
  border-color: var(--accent-go);
  margin-top: 2px;
}
.share-btn:hover { filter: brightness(1.08); }

/* --- RADIUS SLIDER --------------------------------------------------------- */
.radius-row { margin: 8px 0 4px; }
.radius-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.radius-label span {
  color: var(--text-primary);
  font-weight: 800;
}
#radius-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border);
  outline: none;
  border-radius: 2px;
  cursor: pointer;
  accent-color: var(--signal-you);
  background-image: linear-gradient(90deg, #ff3b9d, #247cff);
}
#radius-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--signal-you);
  box-shadow: 0 2px 8px rgba(255,79,216,0.45);
  cursor: pointer;
}
#radius-slider::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--signal-you);
  box-shadow: 0 2px 8px rgba(255,79,216,0.45);
  cursor: pointer;
}
.radius-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--muted);
  margin-top: 4px;
}

/* --- PLACE CARDS ----------------------------------------------------------- */
.place-list { display: flex; flex-direction: column; gap: 8px; }

.place-card {
  border: 1px solid var(--border);
  background: var(--surface-1);
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease-meet), background 0.15s var(--ease-meet);
  position: relative;
  border-radius: 14px;
}
.place-card:hover { border-color: var(--border-strong); background: var(--surface-2); }
.place-card.voted  { border-color: var(--signal-you); background: rgba(255,79,216,0.08); }
.place-card.winner {
  border-color: var(--accent-go);
  background: rgba(46,204,139,0.08);
}

.place-name { font-family: var(--sans); font-size: 0.95rem; font-weight: 700; margin-bottom: 2px; color: var(--text-primary); }
.place-meta { font-size: 12px; color: var(--muted); }
.place-dist { font-size: 11px; color: var(--signal-you); font-weight: 700; margin-top: 4px; }

.place-extra {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.place-info-item {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.place-info-item a { color: var(--signal-them); text-decoration: none; }
.place-info-item a:hover { text-decoration: underline; }

.vote-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
  gap: 10px;
}
.vote-bar-wrap { flex: 1; height: 4px; background: var(--border); border-radius: 999px; overflow: hidden; }
.vote-bar { height: 100%; background: var(--gradient-action); transition: width 0.3s var(--ease-meet); }
.vote-count { font-size: 11px; color: var(--muted); white-space: nowrap; font-weight: 700; }

.winner-crown {
  position: absolute;
  top: -1px;
  right: 10px;
  background: var(--accent-go);
  color: white;
  font-size: 10px;
  padding: 3px 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: var(--sans);
  font-weight: 800;
  border-radius: 0 0 8px 8px;
}

/* --- SCREENS --------------------------------------------------------------- */
.screen { display: none; flex-direction: column; flex: 1; }
.screen.active { display: flex; }

/* --- WELCOME SCREEN -------------------------------------------------------- */
.welcome-screen {
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0 2rem 4rem;
  gap: 0;
}

.welcome-screen header {
  align-self: stretch;
  margin-left: -2rem;
  margin-right: -2rem;
  padding: 1rem 2rem;
}

.welcome-hero {
  text-align: center;
  max-width: 640px;
  margin-top: 4rem;
  margin-bottom: 3rem;
}

.hero-title {
  font-family: var(--sans);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1.0;
  letter-spacing: -0.04em;
  margin-bottom: 1.2rem;
  color: var(--text-primary);
}
.hero-title em {
  font-style: italic;
  background: var(--gradient-meet);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.hero-sub {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 1.75rem;
  max-width: 44ch;
  margin-left: auto;
  margin-right: auto;
}

.tagline-pills { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.pill {
  padding: 5px 14px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  color: var(--text-secondary);
  border-radius: 999px;
}

/* --- ACTION CARDS ---------------------------------------------------------- */
.welcome-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  width: 100%;
  max-width: 760px;
  margin-bottom: 2rem;
}

.action-card {
  border: 1px solid var(--border);
  background: var(--glass-fill);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  transition: border-color 0.2s var(--ease-meet), transform 0.2s var(--ease-meet), box-shadow 0.2s var(--ease-meet);
}
.action-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: 0 20px 60px -20px rgba(255, 79, 216, 0.18);
}
.action-card.is-active {
  border-color: var(--signal-you);
  box-shadow: 0 20px 60px -20px rgba(255, 79, 216, 0.35);
}

/* The "Start" card stays elevated -- gradient border via outer treatment */
.card--dark {
  background:
    linear-gradient(rgba(10,15,29,0.85), rgba(10,15,29,0.85)),
    var(--gradient-action);
  background-clip: padding-box, border-box;
  border: 1px solid transparent;
  position: relative;
}
.card--dark::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-action);
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
          mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
}

.card-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: var(--gradient-meet);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  display: block;
  margin-bottom: 0.7rem;
}
.card--dark .card-eyebrow {
  background: var(--gradient-action);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}

.card-title {
  font-family: var(--sans);
  font-size: 1.6rem;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 0.7rem;
  color: var(--text-primary);
}

.card-sub {
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 1.5rem;
  flex: 1;
}

/* Form inside card -- hidden until card is activated */
.card-form {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.32s var(--ease-meet), opacity 0.25s var(--ease-meet);
}
.action-card.is-active .card-form {
  max-height: 480px; /* bumped for 3 fields */
  opacity: 1;
}
.action-card.is-active .card-cta { display: none; }

/* Share step -- shown after session is created, replaces the form */
.card-share {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.32s var(--ease-meet), opacity 0.25s var(--ease-meet);
}
.action-card.is-shared .card-form { max-height: 0; opacity: 0; pointer-events: none; }
.action-card.is-shared .card-share { max-height: 320px; opacity: 1; }
.action-card.is-shared .card-cta   { display: none; }

.share-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.share-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.6rem;
}
.share-code-val {
  flex: 1;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: var(--text-primary);
  font-family: var(--mono);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 16px;
  text-align: center;
}
.share-hint {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 1rem;
  line-height: 1.5;
}

/* CTA button (pre-expansion) */
.card-cta {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.10em;
  cursor: pointer;
  padding: 12px 18px;
  border: 0;
  background: var(--gradient-action);
  color: white;
  border-radius: 12px;
  transition: filter 0.15s var(--ease-meet), transform 0.15s var(--ease-meet);
  align-self: flex-start;
}
.card-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }

.card--dark .card-cta {
  background: white;
  color: var(--bg-base);
}
.card--dark .card-cta:hover { background: var(--text-secondary); }

.welcome-note {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.7;
  text-align: center;
  max-width: 560px;
}

/* --- SITE FOOTER ----------------------------------------------------------- */
.site-footer {
  text-align: center;
  padding: 1rem 2rem;
  border-top: 1px solid var(--border);
  background: rgba(5,8,18,0.6);
}
.site-footer-link {
  font-size: 12px;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer-link:hover { color: var(--text-secondary); }

/* --- TOAST ----------------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: rgba(12, 19, 34, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
  padding: 12px 22px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  transition: transform 0.25s var(--ease-meet);
  z-index: 9999;
  pointer-events: none;
  white-space: nowrap;
  font-family: var(--sans);
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* --- STATUS BAR ------------------------------------------------------------ */
.status-bar {
  padding: 8px 1.5rem;
  background: rgba(5, 8, 18, 0.7);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-go);
  animation: pulse 2s infinite;
  flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(46,204,139,0.25);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }

/* --- MAP LOADING ----------------------------------------------------------- */
.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 18, 0.78);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  gap: 12px;
}
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--signal-you);
  border-right-color: var(--signal-them);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* --- EMPTY STATE ----------------------------------------------------------- */
.empty-state {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  border: 1px dashed var(--border);
  border-radius: 14px;
}

/* --- ADDRESS ROW ----------------------------------------------------------- */
.addr-row { display: flex; gap: 8px; margin-bottom: 8px; }
.addr-row input { flex: 1; }

/* --- AUTOCOMPLETE ---------------------------------------------------------- */
.suggestion-list {
  border: 1px solid var(--border-strong);
  background: rgba(12, 19, 34, 0.96);
  backdrop-filter: blur(12px);
  max-height: 200px;
  overflow-y: auto;
  display: none;
  position: absolute;
  z-index: 500;
  width: calc(100% - 3rem);
  left: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.45);
}
.suggestion-item {
  padding: 10px 14px;
  font-size: 12px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  line-height: 1.4;
  font-family: var(--sans);
  color: var(--text-primary);
}
.suggestion-item:hover { background: var(--surface-2); }
.suggestion-item:last-child { border-bottom: none; }

/* --- JOIN CODE INPUT ------------------------------------------------------- */
#join-code-input {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 1.2rem;
  font-weight: 800;
  font-family: var(--mono);
  text-align: center;
  padding: 14px;
  background: var(--surface-2);
}

/* --- FAB / SHEET HANDLE (mobile only) ------------------------------------- */
.fab          { display: none; }
.sheet-handle { display: none; }

/* --- LEAFLET CONTROL TWEAKS ------------------------------------------------ */
.leaflet-control-zoom {
  border: 1px solid var(--border-strong) !important;
  border-radius: 12px !important;
  overflow: hidden;
  background: rgba(12, 19, 34, 0.85) !important;
  backdrop-filter: blur(10px);
  box-shadow: none !important;
}
.leaflet-control-zoom a {
  background: transparent !important;
  color: var(--text-secondary) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--border) !important;
  font-family: var(--sans) !important;
  font-weight: 700 !important;
}
.leaflet-control-zoom a:last-child { border-bottom: 0 !important; }
.leaflet-control-zoom a:hover {
  background: rgba(255,255,255,0.06) !important;
  color: white !important;
}
.leaflet-control-attribution {
  background: rgba(5, 8, 18, 0.55) !important;
  color: var(--muted) !important;
  border: 1px solid var(--border-subtle) !important;
  border-radius: 999px !important;
  padding: 4px 10px !important;
  backdrop-filter: blur(8px);
  font-family: var(--sans) !important;
  font-size: 11px !important;
}
.leaflet-control-attribution a { color: var(--text-secondary) !important; }

/* --- DROP-PIN FEATURE ------------------------------------------------------ */
#map.map--pin-mode { cursor: crosshair; }

.pin-drop-marker {
  position: relative;
  width: 32px;
  height: 32px;
}
.pin-drop-marker::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 14px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  rotate: -45deg;
  background: var(--accent);
  box-shadow: 0 0 0 2px rgba(255,79,216,0.4);
}
.pin-drop-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0;
  animation: pin-pulse 1.4s ease-out infinite;
}
@keyframes pin-pulse {
  0%   { transform: translate(-50%,-50%) scale(0.4); opacity: 0.9; }
  100% { transform: translate(-50%,-50%) scale(1.6); opacity: 0;   }
}

.pin-drop-hint {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5rem;
  letter-spacing: 0.01em;
}

/* --- RESPONSIVE ------------------------------------------------------------ */
@media (max-width: 768px) {
  /* Prevent iOS zoom -- already 16px above */
  .btn.sm { padding: 12px 14px; min-height: 44px; }
  .filter-tag { padding: 12px 14px; min-height: 44px; }
  .suggestion-item { padding: 14px; min-height: 44px; }

  /* Welcome screen */
  .welcome-screen { padding: 0 1.2rem 2.5rem; }
  .welcome-screen header { margin-left: -1.2rem; margin-right: -1.2rem; gap: 0.5rem; padding: 0.75rem 1.2rem; }
  .logo { font-size: 1.15rem; }
  .welcome-hero { text-align: left; margin-top: 6rem; margin-bottom: 2rem; }
  .tagline-pills { justify-content: flex-start; }
  .welcome-cards { grid-template-columns: 1fr; }
  .hero-title { font-size: 2.6rem; margin-top: 2rem;}

  /* Session layout -- full-bleed map */
  header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    z-index: 300;
    padding: 0 1rem;
    padding-top: max(0px, env(safe-area-inset-top, 0px));
  }

  .main {
    position: fixed;
    top: 56px; bottom: 0; left: 0; right: 0;
    flex-direction: row;
  }

  .map-area { position: absolute; inset: 0; z-index: 1; }
  #map { height: 100% !important; min-height: unset; }

  /* Bottom sheet */
  .sidebar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 200;
    width: 100%;
    min-width: unset;
    background: rgba(5, 8, 18, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    max-height: calc(85vh - env(safe-area-inset-bottom, 0px));
    border-right: none;
    border-top: 1px solid var(--border-strong);
    border-radius: 24px 24px 0 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateY(calc(100% - 68px - env(safe-area-inset-bottom, 0px)));
    transition: transform 0.35s var(--ease-meet);
    box-shadow: 0 -12px 40px rgba(0,0,0,0.55);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .sidebar.is-open { transform: translateY(0); }

  /* Sheet handle */
  .sheet-handle {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 16px 10px;
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    background: rgba(5, 8, 18, 0.92);
    backdrop-filter: blur(18px);
    z-index: 1;
    border-radius: 24px 24px 0 0;
    min-height: 52px;
  }
  .sheet-handle-bar {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border-strong);
    margin-bottom: 6px;
    flex-shrink: 0;
  }
  .sheet-handle-label {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
  }

  /* Floating action button */
  .fab {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    right: 16px;
    z-index: 250;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--gradient-action);
    color: #fff;
    border: 0;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(255, 79, 216, 0.45);
    font-size: 22px;
    transition: filter 0.2s var(--ease-meet), transform 0.2s var(--ease-meet);
  }
  .fab:active { transform: scale(0.96); filter: brightness(1.1); }

  .status-bar { display: none; }
}

/* ── Language switcher ─────────────────────────────────────── */
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 3px 10px;
}

.lang-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 10px;
  transition: color 0.15s;
}

.lang-btn:hover { color: var(--text-primary); }

.lang-btn.active {
  color: var(--accent);
}

.lang-sep {
  color: var(--border-strong);
  font-size: 10px;
  user-select: none;
}