:root {
  --bg: #1a0f14;
  --card-bg: #241620;
  --field-bg: rgba(255,255,255,0.06);
  --accent: #ff5d8f;
  --accent-dim: rgba(255, 93, 143, 0.16);
  --gold: #e8c07d;
  --text: #fdf2f4;
  --text-dim: rgba(253, 242, 244, 0.6);
  --danger: #ff6b6b;
  --radius: 18px;
  --display-font: "Playfair Display", serif;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background:
    radial-gradient(60vw 60vh at 10% -10%, rgba(255,93,143,0.22), transparent 60%),
    radial-gradient(50vw 50vh at 100% 100%, rgba(232,192,125,0.14), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

.app {
  max-width: 440px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 22px calc(env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
}

.app-header {
  padding: 24px 0 8px;
  text-align: center;
}
.brand-name {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.01em;
}
.brand-name em {
  font-style: italic;
  color: var(--accent);
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 20px 0 40px;
  animation: rise 0.35s ease both;
}
.screen.hidden { display: none; }
@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.screen h1 {
  font-family: var(--display-font);
  font-size: 28px;
  font-weight: 800;
  margin: 0 0 6px;
}
.screen .sub {
  color: var(--text-dim);
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0 0 22px;
}

.screen label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 6px;
}

input, select, textarea {
  width: 100%;
  background: var(--field-bg);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 12px;
  padding: 13px 15px;
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  resize: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input::placeholder, textarea::placeholder { color: rgba(253,242,244,0.35); }
select option { background: #2a1a24; color: var(--text); }

.msg {
  min-height: 18px;
  font-size: 13px;
  color: var(--danger);
  margin-top: 10px;
}

.btn-primary {
  margin-top: 18px;
  width: 100%;
  padding: 15px;
  border-radius: 999px;
  border: none;
  background: radial-gradient(circle at 32% 28%, #ff8fb0, var(--accent) 70%);
  color: #2a0d18;
  font-weight: 700;
  font-size: 15.5px;
  cursor: pointer;
  box-shadow: 0 10px 24px -6px rgba(255, 93, 143, 0.5);
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn-link {
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 13.5px;
  text-decoration: underline;
  cursor: pointer;
  align-self: center;
}

#homeName { color: var(--gold); font-weight: 700; }

.screen.home { padding-top: 20px; }

.home-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.home-greeting { font-family: var(--display-font); font-size: 19px; font-weight: 700; }
.btn-link.small { margin: 0; font-size: 12px; }

.my-photo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.my-photo-preview {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--field-bg);
  border: 1px solid rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-dim);
  flex-shrink: 0;
  overflow: hidden;
}
.my-photo-preview img { width: 100%; height: 100%; object-fit: cover; }
.my-photo-status { font-size: 12.5px; color: var(--text-dim); margin-bottom: 2px; }
.my-photo-info .btn-link { margin: 0; }

.card-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  object-fit: cover;
  margin-bottom: 10px;
  background: var(--field-bg);
}
.card-photo-placeholder {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--field-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: var(--text-dim);
}

.tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.14);
  background: transparent;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
}
.tab-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--text);
}

.match-banner {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  color: #2a0d18;
  font-weight: 700;
  text-align: center;
  padding: 10px;
  border-radius: 12px;
  margin-bottom: 14px;
}
.match-banner.hidden { display: none; }

.card-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 10px;
}

.profile-card {
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.profile-card .p-name {
  font-family: var(--display-font);
  font-size: 18px;
  font-weight: 700;
}
.profile-card .p-name .p-age { color: var(--text-dim); font-family: inherit; font-weight: 400; }
.profile-card .p-location { font-size: 12.5px; color: var(--gold); margin: 3px 0 8px; }
.profile-card .p-bio { font-size: 13.5px; color: var(--text-dim); line-height: 1.5; margin-bottom: 12px; }

.card-actions { display: flex; gap: 10px; }
.card-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.btn-like { background: var(--accent); color: #2a0d18; }
.btn-favorite { background: rgba(232,192,125,0.18); color: var(--gold); }
.card-actions button:disabled { opacity: 0.5; }

.empty-msg {
  text-align: center;
  color: var(--text-dim);
  font-size: 14px;
  padding: 40px 20px;
}

.conversation-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
}
.conversation-photo {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--field-bg);
  flex-shrink: 0;
}
.conversation-photo-placeholder {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--field-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.conversation-info { min-width: 0; }
.conversation-name { font-weight: 700; font-size: 14.5px; }
.conversation-preview {
  font-size: 12.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.screen.chat { padding: 10px 0 0; }
.chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.chat-header .btn-link.small { margin: 0; }
.chat-with-name { font-family: var(--display-font); font-weight: 700; font-size: 17px; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0;
}
.chat-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14.5px;
  line-height: 1.4;
}
.chat-bubble.mine {
  align-self: flex-end;
  background: var(--accent);
  color: #2a0d18;
  border-bottom-right-radius: 4px;
}
.chat-bubble.theirs {
  align-self: flex-start;
  background: var(--card-bg);
  border: 1px solid rgba(255,255,255,0.08);
  border-bottom-left-radius: 4px;
}

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 0 4px;
}
.chat-input-row input { flex: 1; }
.chat-send { margin: 0; width: auto; padding: 0 20px; }
.chat-input-row.hidden { display: none; }

.chat-upgrade {
  text-align: center;
  padding: 30px 10px;
}
.chat-upgrade.hidden { display: none; }
.chat-upgrade p { color: var(--text-dim); font-size: 14px; margin: 0 0 8px; }
.chat-upgrade-price { font-weight: 700; color: var(--gold) !important; }
.chat-upgrade .btn-primary { max-width: 220px; margin: 14px auto 0; }

.home-header-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}
.home-header-actions .btn-link.hidden { display: none; }

.sub-status {
  font-size: 12px;
  color: var(--gold);
  margin: -10px 0 14px;
}
.sub-status.hidden { display: none; }
