:root {
  --bg-deep: #1a0f12;
  --bg-mid: #2a141c;
  --bg-soft: #3a1a24;
  --surface: #0f0f10;
  --card: #161618;
  --text: #f5f5f7;
  --muted: #9a9aa2;
  --line: rgba(255, 255, 255, 0.08);
  --flame-a: #fd267a;
  --flame-b: #ff6036;
  --nope: #fd5068;
  --like: #2ee59d;
  --super: #3ca4ff;
  --rewind: #f5c451;
  --boost: #a855f7;
  --radius-card: 14px;
  --safe-top: max(12px, env(safe-area-inset-top));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--text);
}

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

html,
body {
  height: 100%;
  overflow: hidden;
  background: var(--bg-deep);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  user-select: none;
}

body {
  background:
    radial-gradient(1200px 700px at 50% -10%, #5a2034 0%, transparent 55%),
    radial-gradient(900px 500px at 80% 110%, #3a1840 0%, transparent 50%),
    linear-gradient(165deg, #12080c 0%, #1a0f14 40%, #0c0c10 100%);
}

.stage {
  width: 100%;
  height: 100%;
  min-height: 100dvh;
}

.phone {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, #1c1c1e 0%, #121214 48%, #0d0d0f 100%);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 8px) 18px 8px;
  position: relative;
  z-index: 5;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-text {
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--flame-a), var(--flame-b));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.icon-btn {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6e6e76;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.icon-btn:hover {
  color: #cfcfd4;
}

.icon-btn:active {
  transform: scale(0.92);
}

.deck-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin: 4px 12px 0;
}

.filterbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px 6px;
  z-index: 4;
}

.filter-label {
  font-family: "Nunito", sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.85);
  flex-shrink: 0;
}

.country-select {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 12, 14, 0.75);
  color: var(--text);
  padding: 10px 14px;
  font: inherit;
  font-weight: 600;
  outline: none;
}

.country-select:focus {
  border-color: rgba(255, 255, 255, 0.22);
}

.deck-area {
  position: relative;
  flex: 1;
  min-height: 0;
}

.deck {
  position: relative;
  width: 100%;
  height: 100%;
}

.card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
  will-change: transform;
  cursor: grab;
  touch-action: none;
}

.card:active {
  cursor: grabbing;
}

.card.is-top {
  z-index: 3;
}

.card.is-next {
  z-index: 2;
  transform: scale(0.97) translateY(8px);
}

.card.is-third {
  z-index: 1;
  transform: scale(0.94) translateY(16px);
  opacity: 0.85;
}

.card-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #121214;
}

.card-photos {
  position: absolute;
  inset: 0;
  background: #121214;
}

.card-photos .card-photo {
  position: absolute;
  inset: 0;
}

.card-side {
  display: none;
}

.card-photo-empty {
  background:
    radial-gradient(circle at 30% 25%, #3a3a42 0%, transparent 45%),
    #2a2a2e;
}

@media (min-width: 900px) {
  .card-photos.has-sides {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 3px;
    padding: 0;
  }

  .card-photos.has-sides .card-photo {
    position: relative;
    inset: auto;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #0c0c0e;
  }

  .card-photos.has-sides .card-side {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    background: #0c0c0e;
    opacity: 0.95;
  }

  .card-photos.has-sides .card-side.is-empty {
    background:
      linear-gradient(180deg, #1a1a1e 0%, #121214 100%);
  }
}

.card-gradient {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, transparent 22%),
    linear-gradient(0deg, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.35) 32%, transparent 55%);
  pointer-events: none;
}

.photo-dots {
  position: absolute;
  top: 12px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  z-index: 2;
  pointer-events: none;
}

.photo-dots span {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
  transition: background 0.15s ease, transform 0.15s ease;
}

.photo-dots span.on {
  background: rgba(255, 255, 255, 0.95);
  transform: scale(1.15);
}

.card-profile-link {
  display: inline-flex;
  align-items: center;
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  pointer-events: auto;
}

.card-profile-link:hover {
  background: rgba(253, 38, 122, 0.55);
}

.like-tile-link {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 36px;
  z-index: 2;
}

.like-tile-link .card-profile-link {
  margin-top: 0;
  width: 100%;
  justify-content: center;
  font-size: 0.68rem;
  padding: 6px 8px;
}

.card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px 18px 22px;
  z-index: 2;
}

.card-name {
  font-family: "Nunito", sans-serif;
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.card-name span {
  font-weight: 700;
  opacity: 0.95;
}

.card-meta {
  margin-top: 6px;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.88);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-bio {
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.78);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stamp {
  position: absolute;
  top: 56px;
  padding: 8px 12px;
  border: 4px solid;
  border-radius: 8px;
  font-family: "Nunito", sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-18deg) scale(0.9);
  pointer-events: none;
  z-index: 4;
}

.stamp.like {
  left: 18px;
  color: var(--like);
  border-color: var(--like);
  transform: rotate(-18deg) scale(0.9);
}

.stamp.nope {
  right: 18px;
  color: var(--nope);
  border-color: var(--nope);
  transform: rotate(18deg) scale(0.9);
}

.stamp.super {
  left: 50%;
  top: 40%;
  transform: translateX(-50%) rotate(-8deg) scale(0.9);
  color: var(--super);
  border-color: var(--super);
}

.empty-state {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  gap: 10px;
  padding: 24px;
}

.empty-state[hidden] {
  display: none;
}

.empty-orb {
  width: 72px;
  height: 72px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--flame-a), var(--flame-b));
  opacity: 0.85;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
    filter: brightness(1);
  }
  50% {
    transform: scale(1.06);
    filter: brightness(1.15);
  }
}

.empty-state h2 {
  font-family: "Nunito", sans-serif;
  font-size: 1.35rem;
}

.empty-state p {
  color: var(--muted);
  font-size: 0.95rem;
}

.reload-btn {
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(90deg, var(--flame-a), var(--flame-b));
  cursor: pointer;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px 12px 10px;
  z-index: 5;
}

.action {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: #1a1a1c;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s, background 0.2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.action:active:not(:disabled) {
  transform: scale(0.9);
}

.action:disabled {
  opacity: 0.35;
  cursor: default;
}

.action.rewind {
  width: 44px;
  height: 44px;
  color: var(--rewind);
}
.action.nope {
  width: 60px;
  height: 60px;
  color: var(--nope);
}
.action.super {
  width: 44px;
  height: 44px;
  color: var(--super);
}
.action.like {
  width: 60px;
  height: 60px;
  color: var(--like);
}
.action.boost {
  width: 44px;
  height: 44px;
  color: var(--boost);
}

.action:hover:not(:disabled) {
  background: #222226;
}

.tabbar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  padding: 6px 8px var(--safe-bottom);
  border-top: 1px solid var(--line);
  background: rgba(12, 12, 14, 0.92);
  backdrop-filter: blur(12px);
  z-index: 6;
}

.tab {
  position: relative;
  height: 48px;
  border: 0;
  background: transparent;
  color: #5c5c64;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}

.tab.active {
  color: var(--flame-a);
}

.tab:active {
  transform: scale(0.94);
}

.badge {
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--flame-a), var(--flame-b));
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s, transform 0.2s;
}

.badge.show {
  opacity: 1;
  transform: scale(1);
}

.panel {
  position: absolute;
  inset: 0;
  top: calc(var(--safe-top) + 56px);
  bottom: calc(56px + var(--safe-bottom));
  z-index: 8;
  background: #121214;
  padding: 8px 20px 20px;
  overflow: auto;
  animation: rise 0.28s ease;
}

.panel[hidden] {
  display: none;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel h2 {
  font-family: "Nunito", sans-serif;
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.panel > p,
.muted {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.publish-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 16px;
}

.publish-mode-tab {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
}

.publish-mode-tab.is-active {
  border-color: rgba(253, 38, 122, 0.65);
  background: rgba(253, 38, 122, 0.12);
}

.publish-signin {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.owner-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid rgba(253, 38, 122, 0.35);
  border-radius: 12px;
  background: rgba(253, 38, 122, 0.08);
}

.owner-banner p {
  margin: 0;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.88);
}

.owner-banner .publish-cancel-pay {
  padding: 0;
  flex-shrink: 0;
}

.edit-code-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid rgba(46, 229, 157, 0.35);
  border-radius: 14px;
  background: rgba(46, 229, 157, 0.08);
}

.edit-code-panel[hidden],
.publish-signin[hidden],
.owner-banner[hidden],
.publish-mode-tabs[hidden],
#account-fields[hidden] {
  display: none;
}

.auth-footer-links {
  margin: 0;
  text-align: center;
}

button.linkish {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px;
}

button.linkish:hover {
  color: var(--text);
}

.publish-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 24px;
}

.publish-form[hidden] {
  display: none;
}

#publish-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#publish-details[hidden],
#publish-submit[hidden] {
  display: none;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.88);
}

.field em {
  font-style: normal;
  font-weight: 500;
  color: var(--muted);
  font-size: 0.78rem;
}

.field-row {
  display: grid;
  grid-template-columns: 0.35fr 1fr;
  gap: 10px;
}

.field input,
.field textarea {
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: rgba(12, 12, 14, 0.85);
  color: var(--text);
  padding: 12px 14px;
  font: inherit;
  font-weight: 500;
  outline: none;
  width: 100%;
}

.field input:focus,
.field textarea:focus {
  border-color: rgba(253, 38, 122, 0.55);
}

.field input[type="file"] {
  padding: 10px;
  font-size: 0.82rem;
}

.publish-previews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.publish-previews img {
  width: 100%;
  aspect-ratio: 0.72;
  object-fit: cover;
  border-radius: 10px;
  background: #222;
}

.publish-status {
  margin: 0;
  font-size: 0.9rem;
}

.publish-status[hidden] {
  display: none;
}

.publish-pay {
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(90deg, var(--flame-a), var(--flame-b));
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(253, 38, 122, 0.28);
}

.publish-pay:disabled {
  opacity: 0.55;
  cursor: default;
  box-shadow: none;
}

.publish-pay-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: rgba(12, 12, 14, 0.55);
}

.publish-pay-panel[hidden] {
  display: none;
}

.crypto-chain-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.crypto-chain-tab {
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
}

.crypto-chain-tab.is-active {
  border-color: rgba(253, 38, 122, 0.65);
  background: rgba(253, 38, 122, 0.12);
}

.crypto-quote {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.crypto-row {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 8px;
  align-items: start;
  font-size: 0.86rem;
}

.crypto-row span {
  color: var(--muted);
  padding-top: 4px;
}

.crypto-row strong,
.crypto-row code {
  word-break: break-all;
  font-weight: 600;
  line-height: 1.35;
}

.crypto-row code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.92);
}

.crypto-copy {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 6px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.publish-cancel-pay {
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  padding: 8px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.likes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.like-tile {
  position: relative;
  aspect-ratio: 0.72;
  border-radius: 12px;
  overflow: hidden;
  background: #222;
}

.like-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #121214;
  filter: brightness(0.92) saturate(1.05);
  transition: filter 0.25s ease;
}

.like-tile:hover img {
  filter: brightness(1) saturate(1.1);
}

.like-tile span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  right: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.chat-row {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.chat-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 2px solid color-mix(in srgb, var(--flame-a) 60%, transparent);
}

.chat-meta strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 2px;
}

.chat-meta p {
  color: var(--muted);
  font-size: 0.88rem;
}

.chat-meta .card-profile-link {
  margin-top: 8px;
  font-size: 0.75rem;
  padding: 6px 12px;
}

.match-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-content: center;
  text-align: center;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 30%, rgba(253, 38, 122, 0.35), transparent 55%),
    rgba(8, 6, 10, 0.92);
  backdrop-filter: blur(8px);
  animation: matchIn 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.match-overlay[hidden] {
  display: none;
}

@keyframes matchIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.match-glow {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 96, 54, 0.35), transparent 70%);
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  animation: pulse 2s ease-in-out infinite;
  pointer-events: none;
}

.match-eyebrow {
  font-size: 1.1rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 4px;
}

.match-title {
  font-family: "Nunito", sans-serif;
  font-size: 3.4rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fff 10%, #ffd0c0 45%, var(--flame-a) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.03em;
  animation: titlePop 0.5s cubic-bezier(0.2, 1.2, 0.3, 1);
}

@keyframes titlePop {
  from {
    transform: scale(0.7);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.match-faces {
  display: flex;
  justify-content: center;
  margin: 28px 0 18px;
  position: relative;
  height: 110px;
}

.match-faces img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  border: 3px solid #fff;
  position: absolute;
  top: 0;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  animation: faceIn 0.55s cubic-bezier(0.2, 1.1, 0.3, 1) both;
}

.match-faces img:first-child {
  left: calc(50% - 90px);
  animation-delay: 0.05s;
}

.match-faces img:last-child {
  left: calc(50% - 10px);
  animation-delay: 0.15s;
}

@keyframes faceIn {
  from {
    transform: translateY(20px) scale(0.8);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.match-sub {
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 28px;
  font-size: 1.05rem;
}

.match-primary,
.match-secondary {
  width: min(280px, 100%);
  margin: 0 auto 10px;
  border: 0;
  border-radius: 999px;
  padding: 14px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.match-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--flame-a), var(--flame-b));
  box-shadow: 0 8px 24px rgba(253, 38, 122, 0.35);
}

.match-secondary {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(30, 30, 34, 0.95);
  border: 1px solid var(--line);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 600;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  white-space: nowrap;
  display: block;
}

.toast[hidden] {
  display: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

