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

:root {
  --spark: #FF3366;
  --spark-glow: #FF6B8A;
  --spark-dim: rgba(255, 51, 102, 0.15);
  --night: #0A0A1A;
  --night-mid: #12122A;
  --night-light: #1C1C3A;
  --text: #E8E8F0;
  --text-dim: #8888AA;
  --accent: #7B61FF;
  --green: #4ADE80;
  --green-dim: rgba(74, 222, 128, 0.15);
  --danger: #FF4466;
}

html, body {
  height: 100%;
  font-family: 'DM Sans', sans-serif;
  background: var(--night);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; }

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

/* ===== Navbar ===== */
.app-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 26, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.app-nav .logo {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.logo-dot {
  width: 7px;
  height: 7px;
  background: var(--spark);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--spark);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.3); }
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.nav-venue-badge {
  font-size: 0.7rem;
  color: var(--green);
  background: var(--green-dim);
  padding: 0.3rem 0.6rem;
  border-radius: 100px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.nav-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.3rem;
  font-size: 1.1rem;
  transition: color 0.2s;
}
.nav-btn:hover { color: var(--text); }

/* ===== Screen container ===== */
.screen {
  padding-top: 60px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.screen-content {
  flex: 1;
  padding: 1.25rem;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

/* ===== Auth screens ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  position: relative;
  overflow: hidden;
}

.auth-glow {
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.1;
  pointer-events: none;
}

.auth-glow.pink { background: var(--spark); top: 10%; right: -50px; }
.auth-glow.purple { background: var(--accent); bottom: 20%; left: -50px; }

.auth-card {
  width: 100%;
  max-width: 380px;
  position: relative;
  z-index: 1;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.auth-header p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 0.35rem;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--night-mid);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  transition: border-color 0.2s;
  outline: none;
}

.form-input:focus {
  border-color: var(--spark);
}

.form-input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

select.form-input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238888AA' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  padding-right: 2rem;
}

.btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 10px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.btn-spark {
  background: linear-gradient(135deg, var(--spark), #CC2952);
  color: white;
  box-shadow: 0 4px 20px rgba(255, 51, 102, 0.3);
}

.btn-spark:hover {
  box-shadow: 0 4px 30px rgba(255, 51, 102, 0.5);
  transform: translateY(-1px);
}

.btn-spark:disabled {
  opacity: 0.5;
  pointer-events: none;
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-outline:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.03);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
  width: auto;
}

.btn-danger {
  background: rgba(255, 68, 102, 0.15);
  color: var(--danger);
  border: 1px solid rgba(255, 68, 102, 0.2);
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.auth-switch a {
  color: var(--spark);
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
}

.auth-switch a:hover { text-decoration: underline; }

.form-error {
  background: rgba(255, 68, 102, 0.1);
  border: 1px solid rgba(255, 68, 102, 0.2);
  color: var(--danger);
  padding: 0.6rem 0.9rem;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 1rem;
  display: none;
}

.form-error.visible { display: block; }

/* ===== Venues grid ===== */
.venues-header {
  margin-bottom: 1.25rem;
}

.venues-header h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.venues-header p {
  color: var(--text-dim);
  font-size: 0.85rem;
}

.venues-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.venue-card {
  background: var(--night-mid);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 1.1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.venue-card:hover {
  border-color: rgba(255, 51, 102, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.venue-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--spark-dim), rgba(123, 97, 255, 0.1));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.venue-info { flex: 1; }

.venue-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.venue-address {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.venue-count {
  font-size: 0.72rem;
  color: var(--spark);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  white-space: nowrap;
}

.venue-count .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--spark);
  animation: pulse 2s ease-in-out infinite;
}

/* ===== People grid ===== */
.venue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.venue-header-left h2 {
  font-size: 1.15rem;
  font-weight: 700;
}

.venue-header-left p {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.people-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.person-card {
  background: var(--night-mid);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 16px;
  padding: 1rem;
  text-align: center;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.person-card:hover {
  border-color: rgba(255, 51, 102, 0.15);
}

.person-card.spark-sent {
  border-color: rgba(123, 97, 255, 0.3);
}

.person-card.spark-received {
  border-color: rgba(255, 51, 102, 0.3);
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.08);
}

.person-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--spark), var(--accent));
  margin: 0 auto 0.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.person-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.person-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.1rem;
}

.person-meta {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.6rem;
}

.person-bio {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
  margin-bottom: 0.6rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.spark-actions {
  display: flex;
  gap: 0.4rem;
  justify-content: center;
}

.spark-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: var(--night-light);
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  position: relative;
}

.spark-btn:hover {
  border-color: var(--spark);
  background: var(--spark-dim);
  transform: scale(1.1);
}

.spark-btn.active {
  border-color: var(--spark);
  background: var(--spark);
  box-shadow: 0 0 15px rgba(255, 51, 102, 0.4);
}

.spark-btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  color: var(--text-dim);
  white-space: nowrap;
  background: var(--night);
  padding: 2px 6px;
  border-radius: 4px;
}

.sent-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.6rem;
  background: rgba(123, 97, 255, 0.2);
  color: var(--accent);
  padding: 2px 6px;
  border-radius: 100px;
  font-weight: 500;
}

.received-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.6rem;
  background: var(--spark-dim);
  color: var(--spark);
  padding: 2px 6px;
  border-radius: 100px;
  font-weight: 500;
  animation: pulse 2s ease-in-out infinite;
}

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-dim);
}

.empty-state .emoji {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.empty-state p {
  font-size: 0.85rem;
  line-height: 1.6;
}

/* ===== Matches & Chat ===== */
.matches-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.match-card {
  background: var(--night-mid);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.match-card:hover {
  border-color: rgba(255, 51, 102, 0.15);
  background: var(--night-light);
}

.match-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--spark), var(--accent));
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.match-info { flex: 1; min-width: 0; }

.match-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.match-venue {
  font-size: 0.68rem;
  color: var(--text-dim);
}

.match-preview {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 0.15rem;
}

.match-intent {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 100px;
  background: var(--spark-dim);
  color: var(--spark-glow);
  white-space: nowrap;
}

/* Chat screen */
.chat-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.chat-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  backdrop-filter: blur(20px);
  background: rgba(10, 10, 26, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-back {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 0.2rem;
}

.chat-header-info { flex: 1; }
.chat-header-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
}
.chat-header-venue {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.chat-messages {
  flex: 1;
  padding: 70px 1rem 80px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chat-msg {
  max-width: 80%;
  padding: 0.65rem 0.9rem;
  border-radius: 16px;
  font-size: 0.88rem;
  line-height: 1.5;
  word-break: break-word;
}

.chat-msg.mine {
  align-self: flex-end;
  background: linear-gradient(135deg, var(--spark), #CC2952);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-msg.theirs {
  align-self: flex-start;
  background: var(--night-light);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom-left-radius: 4px;
}

.chat-msg .time {
  font-size: 0.62rem;
  opacity: 0.6;
  margin-top: 0.2rem;
  display: block;
}

.chat-match-banner {
  text-align: center;
  padding: 1rem;
  margin: 0.5rem 0;
}

.chat-match-banner .emoji { font-size: 2rem; }
.chat-match-banner p {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 0.3rem;
}

.chat-input-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 0.75rem 1rem;
  background: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.65rem 0.9rem;
  background: var(--night-mid);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.88rem;
  outline: none;
}

.chat-input:focus { border-color: var(--spark); }

.chat-send {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--spark), #CC2952);
  border: none;
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}

.chat-send:hover { box-shadow: 0 0 20px rgba(255, 51, 102, 0.4); }

/* ===== Bottom tabs ===== */
.bottom-tabs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  display: flex;
  background: rgba(10, 10, 26, 0.9);
  backdrop-filter: blur(20px);
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding: 0.5rem 0 calc(0.5rem + env(safe-area-inset-bottom));
}

.tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.65rem;
  transition: color 0.2s;
  position: relative;
}

.tab-btn .tab-icon { font-size: 1.2rem; }

.tab-btn.active { color: var(--spark); }

.tab-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 16px);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--spark);
  color: white;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--night-light);
  border: 1px solid rgba(255, 51, 102, 0.3);
  color: var(--text);
  padding: 0.7rem 1.25rem;
  border-radius: 12px;
  font-size: 0.85rem;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.toast.match-toast {
  border-color: rgba(74, 222, 128, 0.4);
  background: linear-gradient(135deg, rgba(74, 222, 128, 0.15), rgba(10, 10, 26, 0.95));
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Spark sent animation ===== */
@keyframes sparkSent {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.spark-sent-anim { animation: sparkSent 0.4s ease-out; }

/* ===== Loading spinner ===== */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--spark);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin: 2rem auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Profile screen ===== */
.profile-section {
  text-align: center;
  padding: 1rem 0 1.5rem;
}

.profile-avatar-lg {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--spark), var(--accent));
  margin: 0 auto 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
}

.profile-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.profile-meta {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 0.2rem;
}

/* ===== Descriptor tags / chips ===== */
.descriptor-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  justify-content: center;
  margin-top: 0.4rem;
}

.descriptor-tag {
  font-size: 0.62rem;
  padding: 2px 8px;
  border-radius: 100px;
  background: rgba(123, 97, 255, 0.12);
  color: var(--accent);
  border: 1px solid rgba(123, 97, 255, 0.2);
  white-space: nowrap;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.descriptor-tag.location-tag {
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.2);
}

/* Find me section on venue header */
.findme-section {
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--night-mid);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
}

.findme-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.findme-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-dim);
}

.findme-edit-btn {
  background: none;
  border: none;
  color: var(--spark);
  font-size: 0.72rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  padding: 2px 6px;
}

.findme-edit-btn:hover { text-decoration: underline; }

.findme-empty {
  font-size: 0.75rem;
  color: var(--text-dim);
  opacity: 0.6;
  cursor: pointer;
}

.findme-empty:hover { color: var(--spark); }

/* Descriptor editor modal */
.descriptor-editor {
  background: var(--night-mid);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 1.25rem;
  margin-top: 0.75rem;
}

.descriptor-editor h3 {
  font-size: 0.9rem;
  margin-bottom: 0.15rem;
}

.descriptor-editor p {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-bottom: 0.75rem;
}

.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}

.preset-tag {
  font-size: 0.72rem;
  padding: 0.35rem 0.7rem;
  border-radius: 100px;
  background: var(--night-light);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'DM Sans', sans-serif;
}

.preset-tag:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.preset-tag.selected {
  background: rgba(123, 97, 255, 0.15);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 500;
}

.preset-tag.location {
  /* Location presets get green tint when selected */
}

.preset-tag.location.selected {
  background: rgba(74, 222, 128, 0.12);
  border-color: var(--green);
  color: var(--green);
}

.custom-tag-input {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.custom-tag-input input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  background: var(--night);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 100px;
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.8rem;
  outline: none;
}

.custom-tag-input input:focus { border-color: var(--spark); }

.custom-tag-input input::placeholder {
  color: var(--text-dim);
  opacity: 0.5;
}

.custom-tag-add {
  padding: 0.5rem 0.9rem;
  border-radius: 100px;
  background: var(--night-light);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}

.custom-tag-add:hover {
  border-color: var(--spark);
  color: var(--spark);
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
  min-height: 28px;
}

.selected-tag {
  font-size: 0.72rem;
  padding: 0.3rem 0.6rem;
  border-radius: 100px;
  background: rgba(123, 97, 255, 0.15);
  color: var(--accent);
  border: 1px solid rgba(123, 97, 255, 0.25);
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 500;
}

.selected-tag.location {
  background: rgba(74, 222, 128, 0.1);
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.2);
}

.selected-tag .remove-tag {
  cursor: pointer;
  opacity: 0.6;
  font-size: 0.8rem;
  line-height: 1;
}

.selected-tag .remove-tag:hover { opacity: 1; }

.descriptor-actions {
  display: flex;
  gap: 0.5rem;
}

.descriptor-actions .btn { font-size: 0.8rem; padding: 0.55rem 1rem; }

/* Match card descriptor tags */
.match-descriptors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}

.match-descriptors .descriptor-tag {
  font-size: 0.58rem;
  padding: 1px 6px;
}

/* Safe area padding for bottom tabs */
.screen-content { padding-bottom: 80px; }

/* ===== Match celebration overlay ===== */
.match-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 10, 26, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.match-overlay .match-emoji { font-size: 4rem; }
.match-overlay h2 {
  font-size: 1.8rem;
  color: var(--spark);
}
.match-overlay p {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 280px;
  text-align: center;
}

/* ===== Selfie Camera Capture ===== */
.selfie-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(10, 10, 26, 0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
  padding: 1rem;
}

.selfie-modal {
  width: 100%;
  max-width: 380px;
}

.selfie-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.selfie-header h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}

.selfie-header p {
  font-size: 0.85rem;
  color: var(--text-dim);
}

.selfie-header strong {
  color: var(--spark);
}

.selfie-viewfinder {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  max-width: 320px;
  margin: 0 auto 1.25rem;
  border-radius: 24px;
  overflow: hidden;
  background: var(--night-mid);
  border: 2px solid rgba(255, 51, 102, 0.3);
}

.selfie-viewfinder video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* Mirror for selfie */
  display: none;
}

.selfie-frame {
  position: absolute;
  inset: 0;
  border: 3px solid transparent;
  border-radius: 24px;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 51, 102, 0.2), rgba(123, 97, 255, 0.2)) border-box;
  -webkit-mask: linear-gradient(#fff 0 0) padding-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
}

.selfie-preview {
  width: 100%;
  height: 100%;
}

.selfie-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 22px;
}

.selfie-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--text-dim);
  font-size: 0.82rem;
}

.selfie-actions {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
}

.selfie-actions .btn-spark {
  flex: 1;
  max-width: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}

.selfie-shutter {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid white;
  display: inline-block;
  background: transparent;
  flex-shrink: 0;
}

/* ===== Selfie badge on person cards ===== */
.selfie-badge {
  display: inline-block;
  font-size: 0.58rem;
  background: rgba(74, 222, 128, 0.15);
  color: var(--green);
  padding: 2px 6px;
  border-radius: 100px;
  border: 1px solid rgba(74, 222, 128, 0.2);
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.person-avatar.has-selfie {
  border: 2px solid var(--green);
  box-shadow: 0 0 12px rgba(74, 222, 128, 0.2);
}

.person-avatar .selfie-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
