#matchModal {
  --match-primary: #6d35f2;
  --match-deep: #3e1c9a;
  --match-lilac: #d98ceb;
  --match-surface: #f6f0ff;
  --match-text: #171336;
  --match-muted: #7b739a;
  --match-border: #e8ddf9;
}

.match-modal-open .modal-backdrop.show {
  background: rgba(24, 12, 54, 0.28);
  backdrop-filter: blur(14px);
  opacity: 1;
}

#matchModal .modal-dialog {
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.match-modal {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 221, 249, 0.9);
  border-radius: 32px;
  background: linear-gradient(180deg, #ffffff 0%, #fbf8ff 100%);
  box-shadow: 0 32px 90px rgba(77, 39, 154, 0.22);
  color: var(--match-text);
  transform: scale(0.94);
  opacity: 0;
  transition:
    opacity 260ms cubic-bezier(.2, .8, .2, 1),
    transform 260ms cubic-bezier(.2, .8, .2, 1);
}

.match-modal--ready,
#matchModal.show .match-modal {
  opacity: 1;
  transform: scale(1);
}

.match-modal::before,
.match-modal::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.match-modal::before {
  width: 260px;
  height: 260px;
  left: 50%;
  top: -128px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(217, 140, 235, 0.28) 0%, rgba(109, 53, 242, 0.08) 56%, rgba(255, 255, 255, 0) 72%);
}

.match-modal::after {
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(246, 240, 255, 0.4) 100%);
}

.match-body {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 0;
  flex-direction: column;
  align-items: center;
  padding: 32px 36px;
  text-align: center;
}

.match-handle {
  display: none;
}

.match-bg-heart {
  position: absolute;
  z-index: -1;
  color: var(--match-primary);
  opacity: 0.055;
  pointer-events: none;
}

.match-bg-heart path {
  fill: currentColor;
  stroke: none;
}

.match-bg-heart--one {
  width: 94px;
  height: 94px;
  top: 122px;
  left: 38px;
  transform: rotate(-18deg);
}

.match-bg-heart--two {
  width: 132px;
  height: 132px;
  right: 24px;
  bottom: 108px;
  color: var(--match-lilac);
  opacity: 0.075;
  transform: rotate(15deg);
}

.match-bg-heart--three {
  width: 72px;
  height: 72px;
  right: 88px;
  top: 82px;
  opacity: 0.045;
  transform: rotate(22deg);
}

.match-lucide {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.match-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 5;
  display: flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 221, 249, 0.82);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 8px 22px rgba(62, 28, 154, 0.08);
  cursor: pointer;
  transition:
    background 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.match-close:hover {
  background: #f3eaff;
  box-shadow: 0 10px 24px rgba(109, 53, 242, 0.14);
  transform: translateY(-1px);
}

.match-modal .match-close .match-lucide {
  width: 16px;
  height: 16px;
  color: var(--match-primary);
}

.match-celebration {
  position: relative;
  display: flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  border: 2px solid #e5d2fa;
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 35%, #f1e5ff 100%);
  box-shadow: 0 10px 30px rgba(109, 53, 242, 0.24);
  animation: matchPulse 2200ms ease-in-out infinite;
}

.match-heart-icon {
  display: block;
  color: currentColor;
}

.match-heart-icon path {
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.match-heart-icon--top {
  width: 30px;
  height: 30px;
  color: var(--match-primary);
}

.match-copy h2 {
  margin: 0;
  color: var(--match-text);
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.12;
}

.match-copy p {
  max-width: 380px;
  margin: 8px auto 0;
  color: var(--match-muted);
  font-size: 16px;
  line-height: 1.45;
}

.match-avatars {
  display: grid;
  grid-template-columns: auto 50px auto;
  align-items: center;
  justify-content: center;
  margin-top: 30px;
}

.match-avatar-card {
  width: 140px;
  height: 140px;
  padding: 4px;
  border: 1px solid rgba(217, 140, 235, 0.72);
  border-radius: 50%;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, rgba(217, 140, 235, 0.95), rgba(109, 53, 242, 0.54)) border-box;
  box-shadow: 0 12px 32px rgba(109, 53, 242, 0.18);
  transform: translateY(8px);
  opacity: 0;
  animation: matchAvatarIn 420ms cubic-bezier(.2, .8, .2, 1) forwards;
}

.match-avatar-card--other {
  animation-delay: 90ms;
}

.match-avatar-card img {
  width: 100%;
  height: 100%;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: var(--match-surface);
  object-fit: cover;
  object-position: 50% 50%;
}

.match-link-heart {
  position: relative;
  z-index: 2;
  display: flex;
  width: 62px;
  height: 62px;
  align-items: center;
  justify-content: center;
  margin: 0 -7px;
  border: 4px solid #ffffff;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b3dff 0%, #d98ceb 100%);
  box-shadow: 0 12px 32px rgba(109, 53, 242, 0.28);
  transform: scale(0.86);
  opacity: 0;
  animation: matchHeartIn 360ms cubic-bezier(.2, .8, .2, 1) 180ms forwards;
}

.match-heart-icon--center {
  width: 27px;
  height: 27px;
  color: #ffffff;
}

.match-message {
  max-width: 380px;
  margin: 26px auto 0;
  color: var(--match-muted);
  font-size: 15px;
  line-height: 1.5;
}

.match-actions {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}

.match-actions .next-btn,
.match-actions .skip-btn {
  display: inline-flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: 17px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.match-actions .next-btn {
  border: none;
  background: linear-gradient(135deg, var(--match-primary) 0%, #9d4dff 100%);
  box-shadow: 0 14px 32px rgba(109, 53, 242, 0.28);
  color: #ffffff;
}

.match-actions .next-btn:hover {
  background: linear-gradient(135deg, #7440f4 0%, #a35bff 100%);
  box-shadow: 0 14px 32px rgba(109, 53, 242, 0.28);
  color: #ffffff;
  transform: none;
}

.match-actions .next-btn.is-loading {
  pointer-events: none;
  opacity: 0.82;
}

.match-actions .skip-btn {
  border: 1px solid var(--match-border);
  background: #ffffff;
  color: var(--match-primary);
}

.match-actions .skip-btn:hover {
  border-color: #e0cdf9;
  background: #f6f0ff;
  color: var(--match-primary);
  transform: translateY(-1px);
}

.match-send-icon {
  width: 18px;
  height: 18px;
  color: #ffffff;
}

@keyframes matchPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.045);
  }
}

@keyframes matchAvatarIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes matchHeartIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (max-width: 575.98px) {
  .match-modal-open .modal-backdrop.show {
    background: rgba(24, 12, 54, 0.32);
    backdrop-filter: blur(12px);
  }

  #matchModal .modal-dialog {
    position: fixed;
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: 390px;
    margin: 0 auto;
    align-items: flex-end;
    transform: translateY(18px);
  }

  #matchModal.show .modal-dialog {
    transform: translateY(0);
  }

  .match-modal {
    max-height: calc(100vh - 32px);
    border-radius: 30px;
  }

  .match-body {
    overflow-y: auto;
    padding: 18px 22px 24px;
  }

  .match-handle {
    display: block;
    width: 42px;
    height: 4px;
    margin-bottom: 16px;
    border-radius: 999px;
    background: #e0d4f5;
  }

  .match-close {
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
  }

  .match-celebration {
    width: 56px;
    height: 56px;
    margin-top: 2px;
    margin-bottom: 16px;
  }

  .match-heart-icon--top {
    width: 27px;
    height: 27px;
  }

  .match-copy h2 {
    font-size: 25px;
  }

  .match-copy p {
    max-width: 300px;
    font-size: 14px;
    line-height: 1.4;
  }

  .match-avatars {
    grid-template-columns: auto 42px auto;
    margin-top: 20px;
  }

  .match-avatar-card {
    width: 100px;
    height: 100px;
    padding: 3px;
  }

  .match-avatar-card img {
    border-width: 3px;
  }

  .match-link-heart {
    width: 50px;
    height: 50px;
    margin: 0 -5px;
    border-width: 3px;
  }

  .match-heart-icon--center {
    width: 22px;
    height: 22px;
  }

  .match-message {
    max-width: 300px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.45;
  }

  .match-actions {
    gap: 10px;
    margin-top: 20px;
  }

  .match-actions .next-btn,
  .match-actions .skip-btn {
    min-height: 50px;
    border-radius: 16px;
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  #matchModal .modal-dialog {
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .match-body {
    padding-right: 18px;
    padding-left: 18px;
  }

  .match-avatars {
    grid-template-columns: auto 38px auto;
  }

  .match-avatar-card {
    width: 92px;
    height: 92px;
  }

  .match-link-heart {
    width: 46px;
    height: 46px;
  }
}
