:root {
  color-scheme: dark;
  --ink: #0d0e12;
  --nav: #12141a;
  --nav-button: #1e212a;
  --card: #181b23;
  --line: #2d313c;
  --soft-line: #484d5a;
  --muted: #bec5cf;
  --soft-text: #848c99;
  --red: #ff3e3e;
  --red-dark: #d93434;
  --teal: #14bdc3;
  --white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-shell {
  width: min(100vw, 480px);
  height: 100dvh;
  margin: 0 auto;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  border-left: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.screen {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 20px max(18px, env(safe-area-inset-bottom));
}

.screen.with-bars {
  padding: 0;
}

.topbar {
  height: 76px;
  padding: max(10px, env(safe-area-inset-top)) 16px 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--ink);
  flex: 0 0 auto;
}

.avatar-alert {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 3px solid transparent;
  position: relative;
  background: var(--nav-button);
  display: grid;
  place-items: center;
  overflow: visible;
}

.avatar-alert.has-alert {
  border-color: var(--red);
}

.avatar-alert img,
.avatar-alert .avatar-fallback,
.small-avatar img,
.small-avatar .avatar-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}

.avatar-fallback {
  background: radial-gradient(circle at 50% 35%, #fff 0 14%, transparent 15%), linear-gradient(135deg, var(--red), var(--teal));
}

.badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.brand-name {
  flex: 1;
  font-size: 21px;
  font-weight: 900;
}

.status-pill {
  font-size: 10px;
  font-weight: 900;
  color: var(--teal);
}

.heart-top {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--nav-button);
  border: 1px solid var(--line);
  font-size: 24px;
  font-weight: 900;
}

.bottom-nav {
  height: 66px;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  background: var(--nav);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  flex: 0 0 auto;
}

.nav-item {
  border-radius: 18px;
  background: var(--nav-button);
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  display: grid;
  place-items: center;
  gap: 2px;
}

.nav-icon {
  width: 28px;
  height: 24px;
}

.card-panel,
.auth-card {
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
}

.auth-wrap {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.auth-logo {
  width: min(100%, 340px);
  margin: 0 auto 10px;
  display: block;
  border-radius: 8px;
  background: #fff;
}

.auth-card {
  padding: 20px;
}

.eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  margin: 0 0 8px;
}

.title {
  font-size: 42px;
  line-height: 0.95;
  font-weight: 950;
  margin: 0 0 14px;
}

.copy {
  color: var(--muted);
  line-height: 1.5;
  margin: 0 0 16px;
}

.field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

.field span,
.timer {
  color: var(--soft-text);
  font-size: 12px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101219;
  color: var(--white);
  padding: 14px;
  outline: none;
}

textarea {
  min-height: 46px;
  max-height: 120px;
  resize: vertical;
}

input:focus,
textarea:focus {
  border-color: var(--red);
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.row > * {
  flex: 1;
}

.primary,
.secondary,
.ghost {
  width: 100%;
  min-height: 50px;
  border-radius: 8px;
  padding: 0 18px;
  font-weight: 900;
}

.primary {
  color: #fff;
  background: var(--red);
}

.primary:active {
  background: var(--red-dark);
}

.secondary {
  color: #fff;
  background: var(--nav-button);
  border: 1px solid var(--line);
}

.ghost {
  color: var(--muted);
  background: transparent;
}

.error {
  border: 1px solid rgba(255, 62, 62, 0.5);
  background: rgba(255, 62, 62, 0.12);
  color: #ffdede;
  border-radius: 8px;
  padding: 12px;
  margin: 10px 0;
}

.pool-scroll {
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y proximity;
  padding: 14px 14px 22px;
}

.pull-indicator {
  height: 0;
  overflow: visible;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.spinner {
  width: 34px;
  height: 34px;
  margin-top: 10px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--red);
  animation: spin 760ms linear infinite;
  opacity: 0;
}

.pulling .spinner,
.refreshing .spinner {
  opacity: 1;
}

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

.profile-card {
  min-height: calc(100dvh - 166px);
  scroll-snap-align: start;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
}

.profile-photo {
  height: min(62dvh, 520px);
  background: #111;
  position: relative;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-fallback {
  width: 100%;
  height: 100%;
  background:
    radial-gradient(circle at 50% 32%, #fff 0 8%, transparent 9%),
    linear-gradient(135deg, var(--red), #2e183f 50%, var(--teal));
}

.heart-burst {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 96px;
  font-weight: 900;
  opacity: 0;
  transform: scale(0.2);
  pointer-events: none;
}

.profile-card.liking .heart-burst {
  animation: heart-pop 520ms ease both;
}

.profile-card.fly-liked {
  animation: fly-liked 620ms cubic-bezier(.2,.7,.15,1) forwards;
}

@keyframes heart-pop {
  0% { opacity: 0; transform: scale(0.2); }
  45% { opacity: 1; transform: scale(1.05); }
  100% { opacity: 0; transform: scale(1.7); }
}

@keyframes fly-liked {
  to {
    opacity: 0.08;
    transform: translate(42vw, -36vh) scale(0.18);
  }
}

.profile-info {
  padding: 16px;
}

.profile-name {
  font-size: 28px;
  font-weight: 950;
  margin: 0;
}

.meta {
  color: var(--muted);
  margin: 6px 0;
}

.verify {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  border: 1px solid rgba(20, 189, 195, 0.35);
  background: rgba(20, 189, 195, 0.12);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.empty {
  margin: 20px;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--card);
}

.list-screen {
  padding: 16px;
}

.list-title {
  font-size: 34px;
  font-weight: 950;
  margin: 0 0 12px;
}

.person-row,
.match-row,
.alert-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  margin-bottom: 10px;
}

.small-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--nav-button);
  overflow: hidden;
}

.match-photos {
  width: 88px;
  height: 64px;
  position: relative;
}

.match-photos .small-avatar {
  position: absolute;
  width: 54px;
  height: 54px;
}

.match-photos .mine {
  left: 0;
  bottom: 0;
  border: 3px solid var(--teal);
}

.match-photos .theirs {
  right: 0;
  top: 0;
  border: 3px solid var(--red);
}

.chat {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.chat-head {
  padding: max(12px, env(safe-area-inset-top)) 14px 10px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

.messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bubble {
  max-width: 78%;
  border-radius: 18px;
  padding: 10px 12px;
  line-height: 1.35;
  background: var(--nav-button);
  align-self: flex-start;
}

.bubble.mine {
  background: var(--red);
  align-self: flex-end;
}

.chat-compose {
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  background: var(--nav);
}

.chat-compose button {
  width: 72px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-weight: 900;
}

.preview-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--nav-button);
}

.hidden {
  display: none !important;
}

@media (min-width: 740px) {
  body {
    background:
      radial-gradient(circle at 20% 0%, rgba(255, 62, 62, 0.14), transparent 28rem),
      radial-gradient(circle at 80% 10%, rgba(20, 189, 195, 0.12), transparent 26rem),
      #090a0d;
  }
}
