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

:root {
  --pink:        #FF6B9D;
  --purple:      #C651CD;
  --gradient:    linear-gradient(135deg, #FF6B9D 0%, #C651CD 100%);
  --bg:          #f7f3ff;
  --text:        #1a1a2e;
  --muted:       #9090aa;
  --border:      #ebebf0;
  --card-shadow: 0 12px 48px rgba(198, 81, 205, 0.18);
  --radius:      22px;
  --nav-h:       68px;
  --head-h:      58px;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ── Util ─────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── Views (full-screen layers) ───────────────────── */
.view {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
}
.view.active { display: flex; }

/* ── App sections ─────────────────────────────────── */
.app-section {
  position: absolute;
  inset: 0 0 var(--nav-h) 0;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.app-section.active { display: flex; }

/* ── Auth ─────────────────────────────────────────── */
#view-auth {
  background: var(--gradient);
  align-items: stretch;
  justify-content: flex-end;
}

.auth-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  text-align: center;
  padding: 40px 24px 16px;
  gap: 6px;
}
.app-logo   { font-size: 72px; line-height: 1; }
.auth-hero h1 { font-size: 40px; font-weight: 800; letter-spacing: -1px; }
.auth-hero p  { font-size: 17px; opacity: .85; }

.auth-card {
  background: #fff;
  border-radius: 28px 28px 0 0;
  padding: 28px 24px 44px;
  box-shadow: 0 -8px 40px rgba(0,0,0,.1);
}

.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 22px;
}
.tab-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  border-radius: 9px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  transition: all .2s;
}
.tab-btn.active {
  background: #fff;
  color: var(--pink);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.auth-form { display: flex; flex-direction: column; gap: 13px; }

/* ── Form elements ────────────────────────────────── */
.field-group { position: relative; }
.field-group input,
.field-group select,
.field-group textarea {
  width: 100%;
  padding: 13px 16px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .2s;
  appearance: none;
}
.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  outline: none;
  border-color: var(--pink);
}
.field-group textarea { resize: none; }

.char-count  { font-size: 11px; color: var(--muted); text-align: right; }
.error-msg   { font-size: 13px; color: #e53e3e; text-align: center; min-height: 18px; }

.btn-primary {
  width: 100%;
  padding: 15px;
  background: var(--gradient);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s, transform .1s;
}
.btn-primary:hover  { opacity: .9; }
.btn-primary:active { transform: scale(.98); }

.btn-outline {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--pink);
  border: 2px solid var(--pink);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-outline:hover { background: rgba(255,107,157,.06); }

.btn-forgot {
  width: 100%;
  padding: 10px;
  background: transparent;
  color: var(--muted);
  border: none;
  font-size: 13px;
  cursor: pointer;
  transition: color .2s;
}
.btn-forgot:hover { color: var(--pink); }

.success-msg {
  color: #15803d;
  background: #dcfce7;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  text-align: center;
}

/* ── Setup ────────────────────────────────────────── */
#view-setup {
  background: var(--bg);
  overflow-y: auto;
}

.setup-header {
  background: var(--gradient);
  color: #fff;
  text-align: center;
  padding: 52px 24px 28px;
}
.setup-header h2 { font-size: 26px; font-weight: 800; }
.setup-header p  { opacity: .85; margin-top: 5px; }

.setup-form {
  padding: 22px 20px 48px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
}

.photo-upload-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.photo-preview {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  border: 3px dashed var(--pink);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  background: rgba(255,107,157,.06);
  color: var(--pink);
  font-size: 12px;
  text-align: center;
  gap: 4px;
  transition: background .2s;
  flex-shrink: 0;
}
.photo-preview:hover { background: rgba(255,107,157,.12); }
.photo-preview img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.photo-icon { font-size: 26px; }

.url-input {
  width: 100%;
  padding: 11px 15px;
  border: 2px solid var(--border);
  border-radius: 13px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color .2s;
}
.url-input:focus { outline: none; border-color: var(--pink); }

/* ── App header ───────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 18px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  height: var(--head-h);
  flex-shrink: 0;
}
.app-title { font-size: 19px; font-weight: 800; flex: 1; }

.back-btn {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  padding: 4px 6px;
  color: var(--text);
  line-height: 1;
}

/* ── Card stack ───────────────────────────────────── */
.card-stack {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 16px 16px 0;
}

.profile-card {
  position: absolute;
  width: calc(100% - 32px);
  max-width: 380px;
  height: calc(100% - 8px);
  max-height: 540px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  background: #fff;
  cursor: grab;
  user-select: none;
  touch-action: none;
  will-change: transform;
}
.profile-card:active { cursor: grabbing; }

.card-photo {
  width: 100%;
  height: 68%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  background: linear-gradient(135deg, #f0e0ff, #ffe0f0);
}
.card-photo-placeholder {
  width: 100%;
  height: 68%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
}

.card-info { padding: 16px 20px; }
.card-name { font-size: 22px; font-weight: 800; }
.card-age  { font-size: 17px; font-weight: 400; color: var(--muted); }
.card-bio  {
  font-size: 14px;
  color: var(--muted);
  margin-top: 6px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-indicator {
  position: absolute;
  top: 22px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: 2px;
  padding: 6px 14px;
  border-radius: 8px;
  border: 3px solid;
  opacity: 0;
  pointer-events: none;
}
.card-indicator.like    { left: 18px;  color: #3cb963; border-color: #3cb963; transform: rotate(-12deg); }
.card-indicator.dislike { right: 18px; color: #e53e3e; border-color: #e53e3e; transform: rotate(12deg); }

/* ── Action buttons ───────────────────────────────── */
.action-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 14px 20px 20px;
  flex-shrink: 0;
}
.action-btn {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  font-size: 26px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.14);
  transition: transform .15s, box-shadow .15s;
}
.action-btn:hover  { transform: scale(1.1); box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.action-btn:active { transform: scale(.95); }
.action-btn.dislike { background: #fff; color: #e53e3e; }
.action-btn.like    { background: var(--gradient); color: #fff; }

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.empty-icon { font-size: 56px; margin-bottom: 14px; }
.empty-state h3 { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p  { margin-bottom: 20px; }

/* ── Matches list ─────────────────────────────────── */
.matches-list { flex: 1; overflow-y: auto; }

.match-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 18px;
  cursor: pointer;
  transition: background .15s;
  border-bottom: 1px solid var(--border);
}
.match-item:hover { background: rgba(255,107,157,.04); }

.match-item-avatar {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}
.match-item-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.match-item-info { flex: 1; min-width: 0; }
.match-item-name    { font-weight: 700; font-size: 15px; }
.match-item-preview {
  font-size: 13px;
  color: var(--muted);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  margin-top: 2px;
}
.match-item-time { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ── Chat ─────────────────────────────────────────── */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-partner-info {
  display: flex;
  align-items: center;
  gap: 9px;
}
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: #fff;
  overflow: hidden;
  flex-shrink: 0;
}
.chat-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
#chat-partner-name { font-weight: 700; font-size: 15px; }

.messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg);
}

.message {
  max-width: 76%;
  padding: 9px 14px;
  border-radius: 18px;
  font-size: 15px;
  line-height: 1.45;
  word-break: break-word;
}
.message.mine   { background: var(--gradient); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.message.theirs { background: #fff; color: var(--text); align-self: flex-start; border-bottom-left-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,.07); }
.msg-time { font-size: 11px; opacity: .6; margin-top: 3px; text-align: right; }
.message.theirs .msg-time { text-align: left; }

.message-input-area {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 10px 14px;
  background: #fff;
  border-top: 1px solid var(--border);
}
.message-input {
  flex: 1;
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 10px 15px;
  font-size: 15px;
  font-family: inherit;
  resize: none;
  max-height: 96px;
  overflow-y: auto;
  transition: border-color .2s;
}
.message-input:focus { outline: none; border-color: var(--pink); }
.send-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gradient);
  color: #fff;
  border: none;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform .1s, opacity .2s;
}
.send-btn:active { transform: scale(.94); }
.send-btn:disabled { opacity: .5; cursor: default; }

/* ── Profile view ─────────────────────────────────── */
.profile-view {
  flex: 1;
  overflow-y: auto;
  padding: 18px 18px 32px;
}
.profile-card-view {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,.07);
  margin-bottom: 18px;
}
.profile-photo-wrap {
  width: 100%;
  height: 260px;
  overflow: hidden;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 80px;
  color: #fff;
}
.profile-photo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.profile-body { padding: 18px 20px; }
.profile-name { font-size: 24px; font-weight: 800; }
.profile-meta { color: var(--muted); font-size: 14px; margin-top: 5px; }
.profile-bio  { margin-top: 12px; font-size: 15px; line-height: 1.6; color: #444; }

.profile-actions { display: flex; flex-direction: column; gap: 11px; }

/* ── Bottom nav ───────────────────────────────────── */
.bottom-nav {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: var(--nav-h);
  background: #fff;
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 20;
}
.nav-btn {
  flex: 1;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 0;
  position: relative;
  color: var(--muted);
  transition: color .2s;
}
.nav-btn.active { color: var(--pink); }
.nav-icon  { font-size: 22px; line-height: 1; }
.nav-label { font-size: 11px; font-weight: 600; }

.badge {
  position: absolute;
  top: 7px;
  right: calc(50% - 18px);
  background: #e53e3e;
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ── Modals ───────────────────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.58);
  backdrop-filter: blur(5px);
}
.modal-content {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 26px;
  padding: 28px 22px;
  width: calc(100% - 44px);
  max-width: 370px;
  box-shadow: 0 24px 64px rgba(0,0,0,.28);
  animation: popIn .4s cubic-bezier(.34,1.56,.64,1) both;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes popIn {
  from { transform: scale(.72) translateY(20px); opacity: 0; }
  to   { transform: scale(1)   translateY(0);    opacity: 1; }
}

/* Match modal */
.match-modal-content {
  background: var(--gradient);
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.match-hearts-anim { font-size: 52px; animation: pulse 1s ease infinite; }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.15); } }
.match-modal-content h2 { font-size: 30px; font-weight: 800; }
.match-modal-content p  { font-size: 15px; opacity: .9; }

.match-avatars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 6px 0;
}
.match-avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: 3px solid #fff;
  overflow: hidden;
  background: rgba(255,255,255,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
}
.match-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.match-heart-icon { font-size: 26px; }

.btn-white {
  width: 100%;
  padding: 14px;
  background: #fff;
  color: var(--pink);
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity .2s;
}
.btn-white:hover { opacity: .9; }

.btn-outline-white {
  width: 100%;
  padding: 12px;
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,.6);
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-outline-white:hover { background: rgba(255,255,255,.1); }

/* Edit modal */
.edit-modal-content { padding: 22px 20px 28px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.modal-header h3 { font-size: 19px; font-weight: 800; }
.close-btn { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--muted); padding: 2px 6px; }
.edit-form { padding: 0 !important; }

/* ── Konto löschen ───────────────────────────────── */
.btn-delete-account {
  width: 100%;
  padding: 13px;
  background: transparent;
  color: #e53e3e;
  border: 2px solid #fca5a5;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
}
.btn-delete-account:hover { background: #fef2f2; }

/* ── Unmatch ──────────────────────────────────────── */
.unmatch-btn {
  padding: 6px 12px;
  background: transparent;
  color: #e53e3e;
  border: 1.5px solid #fca5a5;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s;
  margin-left: auto;
}
.unmatch-btn:hover { background: #fef2f2; }

/* ── Report buttons ───────────────────────────────── */
.card-report-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0,0,0,.45);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 15px;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s;
}
.profile-card:hover .card-report-btn { opacity: 1; }

.msg-report-btn {
  background: none;
  border: none;
  font-size: 12px;
  cursor: pointer;
  opacity: 0;
  margin-left: 4px;
  vertical-align: middle;
  transition: opacity .2s;
  padding: 0;
}
.message:hover .msg-report-btn { opacity: 0.6; }
.msg-report-btn:hover { opacity: 1 !important; }

/* ── CAPTCHA ──────────────────────────────────────── */
.captcha-box {
  background: #f9f9fb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
}
.captcha-label {
  display: block;
  font-size: 13px;
  color: #374151;
  margin-bottom: 8px;
}
.captcha-row {
  display: flex;
  gap: 8px;
}
.captcha-row input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: #fff;
}
.captcha-row input:focus { border-color: #C651CD; }
.captcha-refresh {
  background: none;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 16px;
  cursor: pointer;
  color: #6b7280;
}
.captcha-refresh:hover { background: #f3f4f6; }

/* ── Satire notices ───────────────────────────────── */
.satire-banner {
  background: #fff8e1;
  border: 1px solid #ffe082;
  color: #5d4037;
  font-size: 12px;
  line-height: 1.5;
  padding: 10px 16px;
  border-radius: 10px;
  margin: 0 16px 12px;
  text-align: center;
}
.satire-footer {
  font-size: 11px;
  color: #aaa;
  text-align: center;
  padding: 4px 0 2px;
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d0d0e0; border-radius: 2px; }

/* ── Desktop centering ────────────────────────────── */
@media (min-width: 500px) {
  #view-app {
    max-width: 480px;
    margin: 0 auto;
    height: 100vh;
    box-shadow: 0 0 60px rgba(0,0,0,.12);
    position: relative;
  }
}
