:root {
  --bg: #0b0b12;
  --bg-alt: #14141f;
  --card: #191926;
  --border: #2b2b3d;
  --text: #f2f0f7;
  --text-dim: #a29fb5;
  --accent: #ff3fa4;
  --accent2: #7c5cff;
  --accent3: #29e0c9;
  --danger: #ff5470;
  --gradient: linear-gradient(135deg, var(--accent2), var(--accent));
  font-family: "Space Grotesk", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% -10%, #241a3a 0%, var(--bg) 45%) fixed;
  color: var(--text);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

h1, h2, h3 {
  font-family: "Unbounded", "Space Grotesk", sans-serif;
  margin: 0 0 8px;
}

.brand {
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 1px;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  border-radius: 12px;
  font-weight: 600;
}

input, textarea, select {
  font-family: inherit;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 15px;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  outline: 2px solid var(--accent2);
}

/* ---------- Auth screen ---------- */
.auth-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 32px 24px;
  gap: 20px;
}
.auth-screen .brand {
  font-size: 42px;
  text-align: center;
}
.tagline {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 8px;
}
.tabs {
  display: flex;
  background: var(--bg-alt);
  border-radius: 12px;
  padding: 4px;
  gap: 4px;
}
.tabs button {
  flex: 1;
  padding: 10px;
  background: transparent;
  color: var(--text-dim);
}
.tabs button.active {
  background: var(--gradient);
  color: white;
}
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--text-dim); }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 44px; }
.password-wrap .toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  padding: 6px 8px;
  font-size: 16px;
  color: var(--text-dim);
}

.btn-primary {
  background: var(--gradient);
  color: white;
  padding: 14px;
  font-size: 15px;
  box-shadow: 0 8px 24px -8px rgba(255, 63, 164, 0.6);
}
.btn-secondary {
  background: var(--bg-alt);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px;
}
.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  padding: 8px;
  text-decoration: underline;
}

.error-msg {
  color: var(--danger);
  font-size: 13px;
  background: rgba(255, 84, 112, 0.1);
  border: 1px solid rgba(255, 84, 112, 0.3);
  padding: 10px 12px;
  border-radius: 10px;
}
.info-msg {
  color: var(--accent3);
  font-size: 13px;
  background: rgba(41, 224, 201, 0.08);
  border: 1px solid rgba(41, 224, 201, 0.3);
  padding: 10px 12px;
  border-radius: 10px;
}

/* ---------- Tag picker ---------- */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-chip {
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
}
.tag-chip.selected {
  background: var(--gradient);
  color: white;
  border-color: transparent;
}
.tag-chip.readonly {
  cursor: default;
}

/* ---------- App shell ---------- */
.app-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 70px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  position: sticky;
  top: 0;
  background: rgba(11,11,18,0.85);
  backdrop-filter: blur(8px);
  z-index: 5;
  border-bottom: 1px solid var(--border);
}
.topbar .brand { font-size: 22px; }

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  z-index: 10;
}
.bottom-nav button {
  flex: 1;
  background: transparent;
  color: var(--text-dim);
  padding: 14px 0;
  font-size: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.bottom-nav button .icon { font-size: 20px; }
.bottom-nav button.active { color: var(--accent); }

.view { padding: 16px 20px; flex: 1; }

/* ---------- Discover / swipe ---------- */
.card-stack {
  position: relative;
  height: 68vh;
  max-height: 560px;
}
.swipe-card {
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: 24px;
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  touch-action: none;
  user-select: none;
}
.swipe-card .photo {
  height: 60%;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-size: 48px;
}
.swipe-card .info {
  padding: 16px 18px;
  overflow-y: auto;
}
.swipe-card .name-age {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}
.swipe-card .bio {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 10px;
}
.swipe-card .tag-grid .tag-chip { font-size: 11px; padding: 5px 10px; }

.swipe-badge {
  position: absolute;
  top: 24px;
  padding: 6px 16px;
  border: 3px solid;
  border-radius: 8px;
  font-family: "Unbounded", sans-serif;
  font-weight: 800;
  font-size: 20px;
  transform: rotate(-15deg);
  opacity: 0;
  pointer-events: none;
}
.swipe-badge.like { left: 20px; color: var(--accent3); border-color: var(--accent3); }
.swipe-badge.nope { right: 20px; color: var(--danger); border-color: var(--danger); transform: rotate(15deg); }

.swipe-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 20px;
}
.swipe-actions button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  font-size: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
}
.swipe-actions .like-btn { color: var(--accent3); border-color: var(--accent3); }
.swipe-actions .nope-btn { color: var(--danger); border-color: var(--danger); }
.swipe-actions .undo-btn {
  width: 46px;
  height: 46px;
  align-self: center;
  color: var(--accent2);
  border-color: var(--accent2);
  font-size: 20px;
}
.swipe-actions .undo-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.empty-state {
  text-align: center;
  color: var(--text-dim);
  padding: 60px 20px;
}
.empty-state .emoji { font-size: 40px; margin-bottom: 12px; }

/* ---------- Matches list ---------- */
.match-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 10px;
}
.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--bg-alt);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  flex-shrink: 0;
  font-weight: 700;
}
.match-row .name { font-weight: 700; }
.match-row .preview { font-size: 13px; color: var(--text-dim); }

/* ---------- Chat ---------- */
.chat-view { display: flex; flex-direction: column; height: calc(100vh - 60px); padding: 0; }
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.4;
}
.msg.mine {
  align-self: flex-end;
  background: var(--gradient);
  color: white;
  border-bottom-right-radius: 4px;
}
.msg.theirs {
  align-self: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.chat-input {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}
.chat-input input { flex: 1; }
.chat-input button {
  background: var(--gradient);
  color: white;
  padding: 0 18px;
  border-radius: 10px;
}

/* ---------- Profile ---------- */
.profile-photo-upload {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--bg-alt);
  background-size: cover;
  background-position: center;
  border: 2px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: var(--text-dim);
  margin: 0 auto 20px;
  cursor: pointer;
  position: relative;
}
.section-title {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin: 24px 0 10px;
}

.match-toast {
  position: fixed;
  inset: 0;
  background: rgba(11,11,18,0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 100;
  text-align: center;
  padding: 24px;
}
.match-toast .brand { font-size: 30px; }
.match-toast .avatars { display: flex; gap: -20px; }
.match-toast .avatar { width: 90px; height: 90px; border: 3px solid var(--accent); margin: 0 -14px; font-size: 28px; }

.loading {
  text-align: center;
  color: var(--text-dim);
  padding: 40px;
}

/* ---------- Melden / Blockieren ---------- */
.card-menu-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(11,11,18,0.55);
  color: white;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255,255,255,0.25);
  z-index: 3;
}
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11,11,18,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}
.sheet-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px 20px;
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.sheet-box h3 {
  text-align: center;
  margin-bottom: 4px;
}
