.city-join-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: clamp(28px, 4vw, 44px);
  text-align: center;
  transition: opacity 0.32s var(--ease, cubic-bezier(0.22, 0.61, 0.36, 1)),
              transform 0.32s var(--ease, cubic-bezier(0.22, 0.61, 0.36, 1));
}
.city-join-wrap.is-fading { opacity: 0; transform: translateY(-6px); pointer-events: none; }

.city-join-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 30px;
  border: 0;
  border-radius: var(--btn-r, 999px);
  background: linear-gradient(135deg, var(--c-gold, #F5B800), var(--c-gold-hover, #ffc41a));
  color: var(--c-on-accent, #1a1208);
  font-family: 'SF', sans-serif;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 16px 36px rgba(var(--c-gold-rgb, 245,184,0), 0.30), 0 0 0 1px rgba(var(--c-gold-rgb, 245,184,0), 0.6);
  transition: transform 0.32s var(--ease), box-shadow 0.32s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.city-join-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 22px 50px rgba(var(--c-gold-rgb, 245,184,0), 0.42), 0 0 0 1px rgba(var(--c-gold-rgb, 245,184,0), 0.85);
}
.city-join-btn:active { transform: translateY(0) scale(0.99); }
.city-join-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.city-join-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.5) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 0.7s var(--ease);
  pointer-events: none;
  z-index: 1;
}
.city-join-btn:hover::before { transform: translateX(110%); }
.city-join-btn > * { position: relative; z-index: 2; }

.city-join-btn-glow {
  position: absolute;
  inset: -4px;
  border-radius: inherit;
  background: radial-gradient(closest-side, rgba(var(--c-gold-rgb, 245,184,0), 0.55), transparent 70%);
  opacity: 0.5;
  z-index: 0;
  filter: blur(12px);
  animation: city-join-pulse 3.2s ease-in-out infinite;
}
@keyframes city-join-pulse {
  0%, 100% { opacity: 0.45; transform: scale(1); }
  50%      { opacity: 0.75; transform: scale(1.04); }
}

/* without width/height some browsers render svg at 300x150 and the button blows up */
.city-join-btn svg { width: 18px; height: 18px; }
.city-join-btn-icon { flex-shrink: 0; width: 18px; height: 18px; }
.city-join-btn-arrow {
  transition: transform 0.32s var(--ease);
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}
.city-join-btn:hover .city-join-btn-arrow { transform: translateX(4px); }

.city-join-sub {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  max-width: 480px;
  line-height: 1.55;
  letter-spacing: 0.2px;
  text-transform: none;
}

.city-join-own { color: var(--c-gold, #F5B800); white-space: nowrap; }
.city-join-own:hover { text-decoration: underline; }

@media (max-width: 580px) {
  .city-join-btn { padding: 14px 22px; font-size: 12.5px; letter-spacing: 1.2px; gap: 10px; }
  .city-join-sub { font-size: 12px; padding: 0 8px; }
}

.cj-auth-card {
  max-width: 460px;
  text-align: center;
  padding: 0;
  position: relative;
}
.cj-auth-stage {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px;
  padding: 56px 32px 36px;
  min-height: 380px;
  justify-content: center;
}
.cj-auth-icon {
  width: 76px; height: 76px;
  border-radius: 24px;
  background: rgba(80, 165, 235, 0.12);
  border: 1px solid rgba(80, 165, 235, 0.32);
  display: inline-flex; align-items: center; justify-content: center;
  color: #88c4ff;
  margin-bottom: 4px;
  box-shadow: 0 14px 32px rgba(80, 165, 235, 0.16);
}
.cj-auth-title {
  font-family: 'SF', sans-serif;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  max-width: 22ch;
}
.cj-auth-sub {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.55;
  max-width: 36ch;
  text-transform: none;
}
.cj-auth-note {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.4);
  line-height: 1.5;
  margin-top: 4px;
  text-transform: none;
}
.cj-auth-status {
  font-size: 13px;
  color: var(--c-gold, #F5B800);
  text-transform: none;
  margin-top: 4px;
  letter-spacing: 0.2px;
}
.cj-auth-timer {
  font-family: 'SF', sans-serif;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.6px;
}

.cj-tg-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #50A5EB, #88c4ff);
  color: #0a1a2a;
  font-family: 'SF', sans-serif;
  font-size: 13.5px;
  font-weight: 900;
  border: 0;
  border-radius: var(--btn-r, 999px);
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 14px 32px rgba(80, 165, 235, 0.36);
  transition: transform 0.22s var(--ease), box-shadow 0.22s;
  -webkit-tap-highlight-color: transparent;
  margin-top: 4px;
}
.cj-tg-btn:hover { transform: translateY(-2px); box-shadow: 0 20px 40px rgba(80, 165, 235, 0.5); }
.cj-tg-btn:active { transform: translateY(0); }

.cj-qr-toggle {
  margin-top: 4px;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11.5px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.18s, background 0.18s;
}
.cj-qr-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.04); }
.cj-qr-wrap {
  margin-top: 8px;
  padding: 8px;
  background: #fff;
  border-radius: 14px;
  display: inline-block;
}
.cj-qr-wrap[hidden] { display: none; }
.cj-qr-wrap img { display: block; width: 200px; height: 200px; }

.cj-auth-spin {
  width: 32px; height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: var(--c-gold, #F5B800);
  border-radius: 50%;
  animation: cj-spin 0.8s linear infinite;
}
@keyframes cj-spin { to { transform: rotate(360deg); } }

.cj-switch-card {
  max-width: 480px;
  text-align: center;
  padding: 38px 32px 30px;
  position: relative;
}
.cj-switch-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: rgba(255, 138, 138, 0.10);
  border: 1px solid rgba(255, 138, 138, 0.32);
  display: inline-flex; align-items: center; justify-content: center;
  color: #ff8a8a;
  box-shadow: 0 12px 28px rgba(255, 138, 138, 0.10);
}
.cj-switch-title {
  font-family: 'SF', sans-serif;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 10px;
}
.cj-switch-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
  margin-bottom: 22px;
  text-transform: none;
  max-width: 40ch;
  margin-left: auto;
  margin-right: auto;
}
.cj-switch-pills {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
  justify-content: center;
}
.cj-switch-pill {
  display: inline-flex;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: 'SF', sans-serif;
  font-size: 12.5px;
  font-weight: 900;
  border: 1px solid;
}
.cj-switch-pill-from {
  background: rgba(255, 138, 138, 0.08);
  color: #ff8a8a;
  border-color: rgba(255, 138, 138, 0.32);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 138, 138, 0.55);
  text-decoration-thickness: 1.5px;
}
.cj-switch-pill-to {
  background: linear-gradient(135deg, var(--c-gold, #F5B800), var(--c-gold-hover, #ffc41a));
  color: var(--c-on-accent, #1a1208);
  border-color: var(--c-gold, #F5B800);
  box-shadow: 0 8px 22px rgba(var(--c-gold-rgb, 245,184,0), 0.32);
}
.cj-switch-arrow { color: rgba(255, 255, 255, 0.4); flex-shrink: 0; }

.cj-switch-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.cj-btn {
  padding: 13px 26px;
  border: 0;
  border-radius: var(--btn-r, 999px);
  font-family: 'SF', sans-serif;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.22s var(--ease), background 0.22s, color 0.22s, box-shadow 0.22s;
  -webkit-tap-highlight-color: transparent;
}
.cj-btn:hover { transform: translateY(-1px); }
.cj-btn:active { transform: translateY(0); }
.cj-btn-ghost {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.cj-btn-ghost:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.cj-btn-danger {
  background: linear-gradient(135deg, #ff6b6b, #ff8a8a);
  color: #1a0808;
  box-shadow: 0 12px 28px rgba(255, 107, 107, 0.32);
}
.cj-btn-danger:hover {
  box-shadow: 0 18px 40px rgba(255, 107, 107, 0.45);
}

@media (max-width: 720px) {
  .cj-modal { padding: 0; }
  .cj-modal .cm-card {
    width: 100vw; max-width: 100vw;
    height: 100vh; height: 100dvh;
    max-height: 100vh; max-height: 100dvh;
    border-radius: 0;
    justify-content: center;
  }
  .cj-auth-stage { padding: 80px 24px 32px; min-height: auto; gap: 16px; flex: 1; }
  .cj-switch-card { padding: 80px 22px 28px; display: flex; flex-direction: column; justify-content: center; }
  .cj-switch-actions { flex-direction: column; }
  .cj-switch-actions .cj-btn { width: 100%; }
  .cj-switch-pill { padding: 10px 16px; font-size: 11.5px; letter-spacing: 1px; }
  .cj-switch-arrow { transform: rotate(90deg); }
  .cj-tg-btn { width: 100%; justify-content: center; }
}

.city-join-toast {
  position: fixed;
  top: calc(24px + var(--top-inset, env(safe-area-inset-top, 0px)));
  left: 50%;
  transform: translate(-50%, -120%);
  z-index: 10000;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  background: linear-gradient(180deg, rgba(20, 20, 22, 0.96), rgba(15, 15, 17, 0.96));
  border: 1px solid rgba(var(--c-gold-rgb, 245,184,0), 0.28);
  border-radius: 999px;
  color: #fff;
  font-family: 'SF', sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: none;
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(var(--c-gold-rgb, 245,184,0), 0.12);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.32s ease-out;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.city-join-toast.is-show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.city-join-toast.is-error {
  border-color: rgba(255, 138, 138, 0.32);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 138, 138, 0.16);
}
.city-join-toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--c-gold, #F5B800);
  color: var(--c-on-accent, #1a1208);
  flex-shrink: 0;
}
.city-join-toast.is-error .city-join-toast-icon { background: #ff8a8a; color: #1a0808; }
.city-join-toast-text {
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 480px) {
  .city-join-toast {
    top: 12px;
    left: 12px;
    right: 12px;
    transform: translateY(-120%);
    max-width: none;
    padding: 12px 16px;
  }
  .city-join-toast.is-show { transform: translateY(0); }
}
