:root {
  --bg: #1B1420;
  --surface: #261B2C;
  --surface-raised: #302239;
  --border: #3D2E45;
  --text: #F3EAEE;
  --text-muted: #B8A6BC;
  --accent: #FF6B4A;
  --accent-soft: #4A2A28;
  --gold: #F2B84B;
  --danger: #E85C5C;
  --success: #6FBF8B;
  --radius: 16px;
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  height: 100%;
}

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

#content {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 500; margin: 0; }
p { line-height: 1.6; color: var(--text-muted); margin: 0; }
button { font-family: var(--font-body); cursor: pointer; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 2px; }
.brand .mark { font-size: 20px; font-family: var(--font-display); font-weight: 600; }
.brand .dot { color: var(--accent); }
.topbar .badge {
  font-size: 11px;
  background: var(--surface-raised);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 20px;
  border: 1px solid var(--border);
}
.icon-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 6px;
  font-size: 18px;
}

/* ---------- Bottom nav ---------- */
.tabbar {
  display: flex;
  border-top: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  bottom: 0;
  z-index: 10;
}
.tabbar button {
  flex: 1;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 4px 12px;
  color: var(--text-muted);
  font-size: 11px;
}
.tabbar button .ic { font-size: 20px; line-height: 1; }
.tabbar button.active { color: var(--accent); }

/* ---------- Discover / Swipe (Tinder-style, echtes Vollbild) ---------- */
.discover-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 8px 8px 0;
}
.deck {
  position: relative;
  flex: 1;
  min-height: 0;
}
.swipe-card {
  position: absolute;
  inset: 0;
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 34px rgba(0,0,0,0.5);
}
.swipe-card .photo-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  background: var(--surface-raised);
}
.swipe-card .photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.swipe-card .gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15,10,18,0.95) 0%, rgba(15,10,18,0.55) 32%, rgba(15,10,18,0) 60%);
}
.swipe-card .overlay-info {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 18px;
}
.swipe-card .overlay-info h3 { font-size: 24px; color: #fff; }
.swipe-card .overlay-info .sub {
  color: rgba(255,255,255,0.85);
  font-size: 13px;
  margin: 4px 0 8px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.swipe-card .overlay-info .dot-sep::before { content: '·'; margin-right: 8px; }
.swipe-card .overlay-info .tagline {
  color: #fff;
  font-size: 14px;
  font-style: italic;
  margin-bottom: 10px;
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  backdrop-filter: blur(2px);
}
.badge-source {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 20px;
}
.badge-fake {
  position: absolute;
  top: 14px;
  left: 14px;
  background: var(--accent);
  color: #1B1420;
  font-size: 10px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
}

.swipe-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  padding: 18px 4px 6px;
}
.round-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.round-btn:active { transform: scale(0.94); }
.round-btn.like { background: var(--accent); border-color: var(--accent); color: #1B1420; }

.loading-state, .error-state, .empty-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 8px;
}
.error-state button, .empty-state button {
  margin-top: 10px;
  background: var(--accent);
  color: #1B1420;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
}

/* ---------- Matches list ---------- */
.screen { padding: 1rem 1.1rem 1.5rem; flex: 1; overflow-y: auto; min-height: 0; }
.screen h2 { font-size: 20px; margin-bottom: 12px; }
.match-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  margin-bottom: 10px;
}
.match-row .avatar {
  width: 50px; height: 50px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-raised);
}
.match-row .avatar img { width: 100%; height: 100%; object-fit: cover; }
.match-row .body { flex: 1; min-width: 0; }
.match-row .name { font-weight: 500; font-size: 14px; }
.match-row .preview { font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-row .unread-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
}
.matches-empty { text-align: center; color: var(--text-muted); padding: 3rem 1rem; }

/* ---------- Chat ---------- */
.chat-screen { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.chat-header .avatar { width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--surface-raised); }
.chat-header .avatar img { width: 100%; height: 100%; object-fit: cover; }
.chat-header h3 { font-size: 16px; }
.chat-header .meta { font-size: 11px; color: var(--text-muted); }
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.bubble { max-width: 78%; padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.4; }
.bubble.theirs { align-self: flex-start; background: var(--surface-raised); }
.bubble.mine { align-self: flex-end; background: var(--accent); color: #1B1420; }
.typing-indicator { align-self: flex-start; color: var(--text-muted); font-size: 12px; font-style: italic; }
.chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 1.1rem calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
}
.chat-input input {
  flex: 1;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 10px 16px;
  font-size: 14px;
}
.chat-input input:focus { outline: none; border-color: var(--accent); }
.chat-input button {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  color: #1B1420;
  font-size: 16px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  top: 16px; left: 50%;
  transform: translateX(-50%);
  background: var(--accent);
  color: #1B1420;
  padding: 12px 20px;
  border-radius: 14px;
  font-weight: 600;
  z-index: 999;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

/* ---------- Intro / disclaimer ---------- */
.intro {
  padding: 1.5rem 1.1rem 0.5rem;
  text-align: center;
}
.intro h1 { font-size: 26px; }
.intro h1 span { color: var(--accent); }
.intro p { font-size: 13px; margin-top: 6px; }
