:root {
  font-family: Inter, ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--tg-theme-text-color, #251f26);
  background: var(--tg-theme-secondary-bg-color, #f5edf2);
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(circle at 90% 5%, color-mix(in srgb, #ff4d82 18%, transparent), transparent 36%),
    radial-gradient(circle at 5% 95%, color-mix(in srgb, #ffb45c 16%, transparent), transparent 38%),
    var(--tg-theme-secondary-bg-color, #f5edf2);
}

button { font: inherit; }
.hidden { display: none !important; }

.shell {
  width: min(100%, 520px);
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.eyebrow {
  margin: 0 0 2px;
  color: #e3376f;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(22px, 6vw, 30px); line-height: 1.05; }

.heart-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 17px;
  color: white;
  background: linear-gradient(145deg, #ff6392, #d92062);
  box-shadow: 0 10px 26px rgb(217 32 98 / 28%);
  font-size: 24px;
  transform: rotate(-7deg);
}

.state-card {
  display: grid;
  min-height: min(68dvh, 560px);
  padding: 34px;
  place-content: center;
  justify-items: center;
  border: 1px solid color-mix(in srgb, var(--tg-theme-text-color, #251f26) 9%, transparent);
  border-radius: 30px;
  text-align: center;
  background: color-mix(in srgb, var(--tg-theme-bg-color, #fff) 92%, transparent);
  box-shadow: 0 22px 60px rgb(74 28 49 / 10%);
}

.state-card h2 { margin-bottom: 8px; font-size: 25px; }
.state-card p { max-width: 300px; margin-bottom: 20px; color: var(--tg-theme-hint-color, #756a70); line-height: 1.5; }
.state-icon { margin-bottom: 16px; color: #e3376f; font-size: 54px; font-weight: 800; }

.spinner {
  width: 42px;
  height: 42px;
  margin-bottom: 20px;
  border: 4px solid rgb(227 55 111 / 18%);
  border-top-color: #e3376f;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

.profile-card {
  overflow: hidden;
  border-radius: 32px;
  background: #332831;
  box-shadow: 0 24px 62px rgb(60 23 42 / 25%);
}

.photo-wrap { position: relative; aspect-ratio: 4 / 5.35; overflow: hidden; }
.photo-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }

.photo-fallback {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, #f5a365, #df3c75 58%, #672c71);
  font-size: clamp(80px, 28vw, 132px);
  font-weight: 800;
}

.photo-shade { position: absolute; inset: 48% 0 0; background: linear-gradient(transparent, rgb(21 10 17 / 82%)); }
.identity { position: absolute; right: 24px; bottom: 24px; left: 24px; color: white; }
.identity h2 { margin-bottom: 5px; font-size: clamp(29px, 8vw, 40px); line-height: 1; text-shadow: 0 2px 14px rgb(0 0 0 / 35%); }
.identity p { margin: 0; color: rgb(255 255 255 / 78%); font-weight: 650; }

.actions { display: flex; justify-content: center; gap: 28px; padding: 22px 0 12px; }
.action-button {
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--tg-theme-bg-color, white);
  box-shadow: 0 12px 28px rgb(60 23 42 / 15%);
  font-size: 35px;
  font-weight: 500;
  transition: transform .14s ease, opacity .14s ease;
}
.action-button:active { transform: scale(.91); }
.action-button:disabled { opacity: .45; }
.skip { color: #7a6e76; }
.like { color: white; background: linear-gradient(145deg, #ff6392, #dc2365); }
.hint { margin: 0; color: var(--tg-theme-hint-color, #756a70); text-align: center; font-size: 13px; }

.primary-button, .secondary-button {
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 15px;
  font-weight: 750;
}
.primary-button { color: white; background: #df2c68; }
.secondary-button { color: var(--tg-theme-button-text-color, white); background: var(--tg-theme-button-color, #df2c68); }

.match-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  padding: 24px;
  place-items: center;
  background: rgb(33 11 23 / 70%);
  backdrop-filter: blur(12px);
}
.match-card {
  width: min(100%, 380px);
  padding: 38px 28px 28px;
  border-radius: 28px;
  color: #2b1d26;
  text-align: center;
  background: #fff9fc;
  box-shadow: 0 30px 80px rgb(0 0 0 / 25%);
  animation: appear .32s cubic-bezier(.2, .9, .3, 1.25);
}
.match-card h2 { margin-bottom: 8px; font-size: 34px; }
.match-card p { color: #76646e; line-height: 1.45; }
.match-hearts { margin-bottom: 14px; color: #e22d69; font-size: 40px; letter-spacing: -.25em; transform: translateX(-.12em); }
@keyframes appear { from { opacity: 0; transform: scale(.75) rotate(-3deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
