* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "SF Pro Text", "Helvetica Neue", system-ui, -apple-system, sans-serif;
}

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  background: radial-gradient(circle at 20% 20%, #ff9a62 0, rgba(255, 122, 105, 0.65) 20%, transparent 35%),
    radial-gradient(circle at 80% 0%, #ff5fad 0, rgba(253, 38, 125, 0.5) 25%, transparent 40%),
    #0c0c0f;
  min-height: 100vh;
  color: #f8f8fa;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  overflow: hidden;
}

.page {
  width: min(1200px, 100%);
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: center;
  margin: 0 auto;
}

.intro-panel {
  background: rgba(17, 17, 17, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 28px;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.eyebrow {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #ffb49a;
  margin-bottom: 8px;
}

.intro-panel h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin-bottom: 10px;
}

.lede {
  line-height: 1.5;
  color: rgba(248, 248, 250, 0.86);
  margin-bottom: 14px;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 600;
  font-size: 0.92rem;
}

.pill-like {
  border-color: rgba(0, 230, 118, 0.7);
  color: #9ef3be;
}

.pill-nope {
  border-color: rgba(255, 23, 68, 0.7);
  color: #ffc0c0;
}

.pill-ghost {
  border-style: dashed;
  color: rgba(248, 248, 250, 0.7);
}

.pill-count {
  background: linear-gradient(45deg, #ff7854, #fd267d);
  border: none;
  color: #fff;
  margin-top: 6px;
  width: fit-content;
}

/* App container (like a phone screen) */
.app {
  width: 100%;
  max-width: 480px;
  height: min(82vh, 820px);
  min-height: 520px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.45), #111);
  border-radius: 32px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.7);
  padding: 12px 12px 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

/* Top bar similar to Tinder */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 4px 8px;
}

.top-title {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  /* make the title a bit like tinder, with a fire emoji and stuff */
  font-family: "SF Pro Display", system-ui, -apple-system, sans-serif;
  font-style: italic;
  font-variant: small-caps;
  /* text-transform: lowercase; */
}

.top-icon {
  font-size: 1.3rem;
  opacity: 0.9;
}

.avatar-btn {
  border: none;
  background: transparent;
  padding: 2px;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.avatar-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
}

/* Main card area */
main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  padding: 4px 6px 10px;
  overflow: hidden;
}

/* Stack of cards */
.tinder-cards {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 620px;
  min-height: 460px;
  touch-action: none;
  z-index: 1;
}

/* Each card */
.tinder-card {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  transform-origin: center bottom;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
  touch-action: none;
}

/* Slight stacking effect */
.tinder-card:nth-child(1) { transform: translateY(0) scale(1); opacity: 1; }
.tinder-card:nth-child(2) { transform: translateY(12px) scale(0.97); opacity: 1; }
.tinder-card:nth-child(3) { transform: translateY(20px) scale(0.95); opacity: 1; }

.tinder-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

.card-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85), transparent);
}

.card-name {
  font-size: 1.6rem;
  font-weight: 700;
}

.card-distance {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin-left: 4px;
}

.card-age {
  font-size: 1.4rem;
  opacity: 0.9;
  margin-left: 4px;
}

.card-bio {
  margin-top: 4px;
  font-size: 0.9rem;
  opacity: 0.9;
}

.card-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
}

/* Like / nope labels during swipe */
.label {
  position: absolute;
  top: 20px;
  padding: 6px 16px;
  border: 4px solid;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: 700;
  text-transform: uppercase;
  opacity: 0;
  transform: rotate(-20deg);
}

.label-like {
  left: 20px;
  border-color: #00e676;
  color: #00e676;
}

.label-nope {
  right: 20px;
  border-color: #ff1744;
  color: #ff1744;
  transform: rotate(20deg);
}

/* Bottom button bar */
.bottom-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  gap: 10px;
  position: relative;
  z-index: 20;
  background: linear-gradient(180deg, rgba(12, 12, 15, 0) 0%, rgba(12, 12, 15, 0.9) 45%, rgba(12, 12, 15, 1) 100%);
  padding: 14px 10px 6px;
  border-radius: 18px;
}

/* Circle buttons */
.circle-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: #222;
  color: #fff;
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s;
  flex: 0 0 auto;
}

.circle-btn.small {
  max-width: 54px;
  min-width: 44px;
  height: 44px;
  font-size: 1.3rem;
}

.circle-btn.big {
  max-width: 76px;
  min-width: 64px;
  height: 64px;
  font-size: 1.6rem;
}

.circle-btn.nope {
  background: #2c1015;
}

.circle-btn.like {
  background: #123122;
}

.circle-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.circle-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* End card / summary */
.end-card {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.9);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  z-index: 30;
}

.end-card h2 {
  margin-bottom: 8px;
}

.liked-summary {
  margin: 12px 0;
  text-align: left;
  max-height: 50%;
  overflow-y: auto;
  font-size: 0.9rem;
}

.restart-btn {
  margin-top: 8px;
  width: 100%;
  padding: 10px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(45deg, #ff7854, #fd267d);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

/* Generic state helpers */
.hidden {
  display: none;
}

/* While dragging */
.tinder-card.moving {
  transition: none;
}

/* Layout adjustments */
@media (max-width: 640px) {
  body {
    padding: 8px;
  }

  .page {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .intro-panel {
    display: none;
  }

  .app {
    max-width: 100%;
    height: calc(100vh - 16px);
    min-height: 0;
    border-radius: 22px;
  }

  .circle-btn.big {
    min-width: 60px;
    height: 60px;
  }

  .tinder-card img {
    height: 68%;
  }

  .tinder-cards {
    min-height: 360px;
  }
}

@media (max-height: 750px) {
  body {
    padding: 8px;
  }

  .app {
    height: calc(100vh - 14px);
    min-height: 0;
  }

  main {
    padding: 0 2px 4px;
  }

  .tinder-cards {
    min-height: 360px;
  }
}

/* Match overlay */
.match-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 60;
}

.match-overlay.show {
  display: flex;
}

.match-box {
  position: relative;
  width: min(520px, 100%);
  background: linear-gradient(180deg, rgba(20, 20, 24, 0.95), rgba(10, 10, 12, 0.95));
  border-radius: 26px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.65);
}

.match-close {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  font-size: 1.1rem;
}

.match-people {
  display: flex;
  justify-content: center;
  margin: 10px 0 14px;
}

.match-people img {
  width: 150px;
  height: 150px;
  border-radius: 22px;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.match-messages {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  padding: 12px;
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 12px;
}

.bubble {
  padding: 10px 12px;
  border-radius: 16px;
  margin-bottom: 8px;
  max-width: 90%;
  line-height: 1.35;
}

.bubble.them {
  background: rgba(255, 255, 255, 0.08);
  color: #f8f8fa;
  border-top-left-radius: 4px;
}

.bubble.you {
  background: linear-gradient(45deg, #ff7854, #fd267d);
  color: #fff;
  margin-left: auto;
  border-top-right-radius: 4px;
}

.match-overlay .restart-btn {
  margin-top: 4px;
}

body.modal-open {
  overflow: hidden;
}

/* Profile modal card look */
.profile-card {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  background: #000;
  height: 360px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
}

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

.profile-info {
  position: absolute;
  inset: auto 0 0 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.35), transparent);
}

.profile-info .card-bio {
  color: rgba(255, 255, 255, 0.9);
}

@media (min-width: 900px) {
  .page {
    grid-template-columns: 1.05fr 0.95fr;
    justify-items: center;
  }

  .intro-panel {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
  }

  .app {
    justify-self: center;
    width: 100%;
  }
}
