
/* ===== Profile Landing — Generated CSS ===== */
:root {
  color-scheme: dark;
  --lp-primary: #E85A7A;
  --lp-secondary: #6EC5F7;
  --lp-accent: #FF8A5B;
  --lp-bg: #1a1a2e;
  --lp-text: #e4e6eb;
  --lp-muted: #a8adb6;
  --lp-card: #262640;
  --lp-card-border: #3a3a52;
  --lp-card-shadow: rgba(0,0,0,0.25);
  --lp-online: #22c55e;
  --lp-overlay-bg: rgba(0,0,0,0.72);
  --lp-radius: 16px;
  --lp-radius-sm: 10px;
  --lp-max-w: 1100px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* Prevent iOS bounce on html when modal scroll-locks body */
  height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--lp-bg);
  color: var(--lp-text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Prevent pull-to-refresh interference with modal */
  overscroll-behavior-y: contain;
}

/* Fixed gradient via pseudo-element — GPU-composited, no scroll repaint */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 30%, color-mix(in srgb, var(--lp-primary) 6%, var(--lp-bg)) 0%, var(--lp-bg) 70%);
  will-change: transform;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; cursor: pointer; }

/* ===== Layout ===== */
.lp-container {
  width: 100%;
  max-width: var(--lp-max-w);
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Header ===== */
.lp-header {
  padding: 20px 0 12px;
  text-align: center;
}

.lp-header__logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--lp-primary);
  letter-spacing: -0.02em;
}

.lp-header__tagline {
  margin: 6px 0 0;
  font-size: 1.05rem;
  color: var(--lp-muted);
}

/* ===== Hero ===== */
.lp-hero {
  text-align: center;
  padding: 20px 0 24px;
}

.lp-hero__title {
  margin: 0;
  font-size: 2.4rem;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

@media (max-width: 899px) {
  .lp-hero__title { font-size: 1.8rem; }
}

.lp-hero__sub {
  margin: 12px 0 0;
  font-size: 1.15rem;
  color: var(--lp-muted);
  line-height: 1.5;
}

/* ===== Live Feed Notifications ===== */
.lp-live-feed {
  position: fixed;
  right: 12px;
  bottom: 14px;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.lp-live-feed__item {
  max-width: min(82vw, 320px);
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--lp-card-border) 76%, var(--lp-primary) 24%);
  background: linear-gradient(145deg, color-mix(in srgb, var(--lp-card) 90%, #1d1020 10%), color-mix(in srgb, var(--lp-card) 96%, #111 4%));
  color: var(--lp-text);
  font-size: 0.83rem;
  line-height: 1.4;
  box-shadow: 0 8px 22px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(14px) scale(0.98);
  filter: blur(0.6px);
  animation: lp-live-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

.lp-live-feed__row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-live-feed__heart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--lp-primary) 32%, transparent);
  color: #ff6b8a;
  font-size: 0.72rem;
  line-height: 1;
  flex-shrink: 0;
  animation: lp-live-heart 1.7s ease-in-out infinite;
}

.lp-live-feed__text {
  display: block;
}

.lp-live-feed__item.is-hide {
  animation: lp-live-out 0.38s ease forwards;
}

@keyframes lp-live-in {
  to { opacity: 0.97; transform: translateY(0) scale(1); filter: blur(0); }
}

@keyframes lp-live-out {
  to { opacity: 0; transform: translateY(8px) scale(0.985); }
}

@keyframes lp-live-heart {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.14); }
}

@media (max-width: 899px) {
  .lp-live-feed {
    right: 10px;
    left: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    gap: 7px;
  }

  .lp-live-feed__item {
    max-width: 100%;
    font-size: 0.79rem;
    padding: 9px 11px;
  }
}

/* ===== Profile Grid ===== */
.lp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding-bottom: 16px;
}

@media (max-width: 899px) {
  .lp-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}

@media (max-width: 359px) {
  .lp-grid { grid-template-columns: 1fr; }
}

/* ===== Profile Card ===== */
.lp-card {
  position: relative;
  background: var(--lp-card);
  border: 1px solid var(--lp-card-border);
  border-radius: var(--lp-radius);
  overflow: hidden;
  box-shadow: 0 4px 16px var(--lp-card-shadow);
  transition: transform 0.2s ease;
  will-change: transform;
}

.lp-card:hover {
  transform: translateY(-2px) scale(1.01);
}

.lp-card__img-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #e8e0dc 0%, #d4dce6 100%);
}

.lp-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lp-card__status {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 600;
}

.lp-card__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lp-online);
  animation: lp-pulse 2s ease-in-out infinite;
}

@keyframes lp-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.lp-card__body {
  padding: 12px 12px 14px;
}

.lp-card__name {
  display: block;
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.lp-card__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  color: var(--lp-muted);
}

.lp-card__meta-icon {
  display: inline-flex;
  flex-shrink: 0;
}

.lp-card__btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 11px 12px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lp-card__btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
}

/* ===== Register Overlay ===== */
.lp-register {
  position: relative;
  grid-column: 1 / -1;
  padding: 40px 20px;
  text-align: center;
  background: var(--lp-card);
  border: 1px solid var(--lp-card-border);
  border-radius: var(--lp-radius);
  overflow: hidden;
}

.lp-register::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 0%, var(--lp-bg) 100%);
  opacity: 0.7;
  pointer-events: none;
}

.lp-register__text {
  position: relative;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px;
  color: var(--lp-text);
}

.lp-register__btn {
  position: relative;
  display: inline-block;
  padding: 14px 36px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lp-register__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

/* ===== Blurred Cards ===== */
.lp-card--blurred {
  pointer-events: none;
  user-select: none;
}

.lp-card--blurred .lp-card__img {
  filter: blur(12px);
}

.lp-card--blurred .lp-card__body {
  filter: blur(6px);
}

.lp-card--blurred .lp-card__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.35);
  z-index: 2;
  pointer-events: auto;
}

.lp-card--blurred .lp-card__overlay-btn {
  padding: 12px 28px;
  border: none;
  border-radius: 999px;
  background: rgba(255,255,255,0.95);
  color: var(--lp-primary);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  transition: transform 0.15s ease;
}

.lp-card--blurred .lp-card__overlay-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
}

/* ===== Unlock More Row ===== */
.lp-unlock-row {
  grid-column: 1 / -1;
  position: relative;
  overflow: hidden;
  border-radius: var(--lp-radius);
  background: var(--lp-card);
  border: 1px solid var(--lp-card-border);
}

.lp-unlock-row__cards {
  display: flex;
  gap: 8px;
  padding: 12px;
  filter: blur(14px);
  opacity: 0.6;
  pointer-events: none;
}

.lp-unlock-row__thumb {
  width: 80px;
  height: 100px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

@media (min-width: 900px) {
  .lp-unlock-row__thumb {
    width: 120px;
    height: 150px;
  }
}

.lp-unlock-row__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.25);
  z-index: 2;
}

.lp-unlock-row__text {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  text-align: center;
  padding: 0 16px;
}

.lp-unlock-row__btn {
  display: inline-block;
  padding: 14px 36px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lp-accent), var(--lp-primary));
  color: #fff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lp-unlock-row__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.3);
}

/* CTA Dock — removed (enough CTAs on page) */

/* ===== Footer ===== */
.lp-footer {
  padding: 20px 0 40px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--lp-muted);
  line-height: 1.6;
}

/* =========================================================
   QUIZ / MATCHING
   ========================================================= */

.lp-quiz {
  width: 100%;
  margin: 0 0 24px;
  padding: 0 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lp-quiz__start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 16px 44px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--lp-primary) 40%, transparent);
  transition: transform 0.15s ease, opacity 0.15s ease;
  animation: lp-quiz-glow 2.5s ease-in-out infinite;
  will-change: opacity;
}

.lp-quiz__start-btn:hover {
  transform: translateY(-2px);
  opacity: 0.92;
}

.lp-quiz__start-btn:active { transform: scale(0.97); }

/* Animate opacity instead of box-shadow — GPU-composited, zero repaints */
@keyframes lp-quiz-glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.82; }
}

.lp-quiz__modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--lp-overlay-bg);
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.lp-quiz__modal.is-open { display: flex; }

.lp-quiz__box {
  width: 100%;
  max-width: 400px;
  background: var(--lp-card);
  border-radius: var(--lp-radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.3);
  animation: lp-quiz-in 0.3s ease;
}

@keyframes lp-quiz-in {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.lp-quiz__question {
  font-size: 1.2rem;
  font-weight: 800;
  margin: 0 0 20px;
  color: var(--lp-text);
}

.lp-quiz__answers {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.lp-quiz__answer {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--lp-card-border);
  border-radius: 999px;
  background: transparent;
  color: var(--lp-text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.lp-quiz__answer:hover {
  border-color: var(--lp-primary);
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Quiz result / loading state */
.lp-quiz__loading {
  display: none;
}

.lp-quiz__loading.is-visible { display: block; }

.lp-quiz__spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border: 4px solid var(--lp-card-border);
  border-top-color: var(--lp-primary);
  border-radius: 50%;
  animation: lp-spin 0.8s linear infinite;
}

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

.lp-quiz__loading-text {
  font-size: 0.95rem;
  color: var(--lp-muted);
  font-weight: 600;
}

.lp-quiz__result {
  display: none;
}

.lp-quiz__result.is-visible { display: block; }

.lp-quiz__found {
  font-size: 1.3rem;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--lp-text);
}

.lp-quiz__avatars {
  display: flex;
  justify-content: center;
  gap: 0;
  margin: 0 0 20px;
}

.lp-quiz__avatar-thumb {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--lp-card);
  margin-left: -10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.lp-quiz__avatar-thumb:first-child { margin-left: 0; }

.lp-quiz__see-btn {
  display: inline-block;
  padding: 16px 44px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px rgba(0,0,0,0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.lp-quiz__see-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.25);
}

.lp-quiz__free-note {
  margin: 12px 0 0;
  font-size: 0.85rem;
  color: var(--lp-muted);
  font-weight: 600;
}

/* =========================================================
   PROFILE PAGE
   ========================================================= */

.lp-profile {
  padding: 20px 0 calc(180px + env(safe-area-inset-bottom));
}

.lp-profile__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--lp-muted);
  transition: color 0.15s ease;
}

.lp-profile__back:hover { color: var(--lp-text); }

.lp-profile__photo-wrap {
  position: relative;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 20px;
  aspect-ratio: 3 / 4;
  border-radius: var(--lp-radius);
  overflow: hidden;
  box-shadow: 0 8px 32px var(--lp-card-shadow);
}

.lp-profile__photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.lp-profile__status {
  position: absolute;
  bottom: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
}

.lp-profile__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lp-online);
  animation: lp-pulse 2s ease-in-out infinite;
}

.lp-profile__info {
  text-align: center;
}

.lp-profile__name {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 800;
}

.lp-profile__age {
  font-weight: 400;
  color: var(--lp-muted);
}

.lp-profile__distance {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--lp-muted);
}

.lp-profile__bio {
  margin: 14px 0;
  padding: 16px;
  background: var(--lp-card);
  border: 1px solid var(--lp-card-border);
  border-radius: var(--lp-radius-sm);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--lp-text);
}

.lp-profile__verified {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 12px 0 20px;
  font-size: 0.82rem;
  color: var(--lp-online);
  font-weight: 600;
}

.lp-profile__chat-btn {
  display: block;
  width: 100%;
  max-width: 320px;
  margin: 0 auto 24px;
  padding: 16px;
  border: none;
  border-radius: var(--lp-radius);
  background: linear-gradient(180deg, var(--lp-accent), var(--lp-primary));
  color: #fff;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  transition: transform 0.12s ease;
}

.lp-profile__chat-btn:active { transform: scale(0.98); }

/* =========================================================
   CHAT UI
   ========================================================= */

.lp-chat {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--lp-bg);
  flex-direction: column;
}

.lp-chat.is-open { display: flex; }

.lp-chat__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--lp-card);
  border-bottom: 1px solid var(--lp-card-border);
  flex-shrink: 0;
}

.lp-chat__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.lp-chat__header-info { flex: 1; min-width: 0; }

.lp-chat__header-name {
  font-size: 0.95rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lp-chat__header-status {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--lp-online);
  font-weight: 600;
}

.lp-chat__header-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lp-online);
}

.lp-chat__close {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--lp-muted);
  font-size: 1.3rem;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
  flex-shrink: 0;
}

.lp-chat__close:hover { background: var(--lp-card-border); }

.lp-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  -webkit-overflow-scrolling: touch;
}

.lp-chat__system {
  text-align: center;
  font-size: 0.78rem;
  color: var(--lp-muted);
  padding: 8px 0;
}

.lp-chat__bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 0.9rem;
  line-height: 1.45;
  word-break: break-word;
}

.lp-chat__bubble--user {
  align-self: flex-end;
  background: var(--lp-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.lp-chat__bubble--bot {
  align-self: flex-start;
  background: var(--lp-card);
  border: 1px solid var(--lp-card-border);
  color: var(--lp-text);
  border-bottom-left-radius: 4px;
}

.lp-chat__typing {
  align-self: flex-start;
  display: none;
  gap: 4px;
  padding: 12px 18px;
  background: var(--lp-card);
  border: 1px solid var(--lp-card-border);
  border-radius: 18px;
  border-bottom-left-radius: 4px;
}

.lp-chat__typing.is-visible { display: flex; }

.lp-chat__typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lp-muted);
  animation: lp-typing 1.4s ease-in-out infinite;
}

.lp-chat__typing-dot:nth-child(2) { animation-delay: 0.2s; }
.lp-chat__typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes lp-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-4px); }
}

.lp-chat__input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--lp-card);
  border-top: 1px solid var(--lp-card-border);
  flex-shrink: 0;
}

.lp-chat__input {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--lp-card-border);
  border-radius: 999px;
  background: var(--lp-bg);
  color: var(--lp-text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

.lp-chat__input:focus { border-color: var(--lp-primary); }

.lp-chat__send {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: var(--lp-primary);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s ease;
}

.lp-chat__send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== Name Modal ===== */
.lp-name-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--lp-overlay-bg);
  place-items: center;
}

.lp-name-modal.is-open { display: grid; }

.lp-name-modal__box {
  width: 90%;
  max-width: 340px;
  padding: 28px 24px;
  background: var(--lp-card);
  border-radius: var(--lp-radius);
  text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,0.25);
}

.lp-name-modal__title {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
}

.lp-name-modal__input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--lp-card-border);
  border-radius: var(--lp-radius-sm);
  background: var(--lp-bg);
  color: var(--lp-text);
  font-size: 0.95rem;
  text-align: center;
  outline: none;
}

.lp-name-modal__input:focus { border-color: var(--lp-primary); }

.lp-name-modal__btn {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px;
  border: none;
  border-radius: var(--lp-radius-sm);
  background: var(--lp-primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
}

/* ===== Blocked Modal — bottom sheet on mobile, centered on desktop =====
   Rationale: na mobile klawiatura + dynamiczny viewport psują flex-center
   (box się centruje poza viewportem). Bottom sheet pozycjonuje box od dołu,
   nad safe-area — zawsze widoczny, niezależnie od keyboarda. */

.lp-blocked {
  position: fixed;
  inset: 0;
  z-index: 9999;
  /* Always rendered in DOM — toggle via opacity/visibility (better animation than display swap) */
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  background: var(--lp-overlay-bg);
  transition: opacity 0.2s ease, visibility 0s linear 0.2s;
}

.lp-blocked.is-open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.2s ease, visibility 0s linear 0s;
}

/* --- Mobile-first: bottom sheet --- */
.lp-blocked__box {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  background: var(--lp-card);
  border-top: 1px solid var(--lp-card-border);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Never taller than safe viewport */
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.lp-blocked.is-open .lp-blocked__box {
  transform: translateY(0);
}

/* Drag handle indicator (subtle — users recognize it as dismissible sheet) */
.lp-blocked__box::before {
  content: '';
  display: block;
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--lp-card-border);
  margin: 0 auto 6px;
  flex-shrink: 0;
}

.lp-blocked__text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--lp-text);
  text-align: center;
}

.lp-blocked__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;            /* HIG: 48-56px comfortable tap target */
  padding: 14px 20px;
  margin: 0;
  border: none;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  letter-spacing: 0.01em;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-sizing: border-box;
  flex-shrink: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.lp-blocked__btn:active {
  transform: scale(0.98);
  box-shadow: 0 3px 12px rgba(0,0,0,0.3);
}

/* --- Desktop / tablet: centered dialog (≥640px) --- */
@media (min-width: 640px) {
  .lp-blocked__box {
    position: absolute;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    width: calc(100% - 40px);
    max-width: 400px;
    padding: 28px 28px 30px;
    border: 1px solid var(--lp-card-border);
    border-radius: var(--lp-radius);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    transform: translate(-50%, -50%) scale(0.92);
    opacity: 0;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease;
    max-height: calc(100dvh - 80px);
  }
  .lp-blocked.is-open .lp-blocked__box {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
  }
  .lp-blocked__box::before { display: none; }
}

/* =========================================================
   PROFILE MODAL (inline on main page)
   ---------------------------------------------------------
   Responsive strategy:
   - Mobile (<640px): full-screen sheet. Card = 100svh/dvh
     (with 100% fallback for in-app browsers like Facebook/Instagram
     that don't support svh/dvh). Single-scroll body — only the
     body area scrolls, header/footer never clipped.
   - Desktop (≥640px): floating card, max 520×94dvh, centered.
   - Layout: header (fixed height) → body (flex:1, scrolls) → footer (fixed height, when applicable)
   ========================================================= */

.lp-pm {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 150;
  background: var(--lp-overlay-bg);
  /* Safe-area padding for notched devices on desktop dialog mode (overridden on mobile) */
  padding: 0;
}

.lp-pm.is-open { display: flex; }

.lp-pm__card {
  position: relative;
  width: 100%;
  height: 100%;                 /* Fallback for very old browsers */
  height: 100vh;                /* Classic mobile (can be too tall with address bar, ok) */
  max-height: 100vh;
  background: var(--lp-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,0.4);
  animation: lp-pm-in 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  /* Full-screen on mobile — no border-radius */
  border-radius: 0;
}
/* Modern mobile viewport units — dvh = dynamic (browser chrome resizes),
   svh = small (always smallest). Use svh as conservative baseline. */
@supports (height: 100svh) {
  .lp-pm__card {
    height: 100svh;
    max-height: 100svh;
  }
}

@keyframes lp-pm-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Close button — fixed on card, always tappable */
.lp-pm__close {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 20;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.15s ease;
}

.lp-pm__close:hover { background: rgba(0,0,0,0.75); }
.lp-pm__close:active { transform: scale(0.92); }

/* Profile hero photo — main visual, fixed ratio on mobile,
   but card enforces overall height via flex */
.lp-pm__header {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--lp-card-border);
  /* Mobile: hero takes ~45% of card height via aspect ratio on content */
  aspect-ratio: 4 / 5;
  max-height: 48svh;
  transition: max-height 0.3s ease, aspect-ratio 0.3s ease;
}
@supports (height: 100dvh) {
  .lp-pm__header { max-height: 48dvh; }
}

/* When any "chat" or "locked" state is active, shrink hero to free body space */
.lp-pm__card.is-chatting .lp-pm__header,
.lp-pm__card.is-locked .lp-pm__header {
  aspect-ratio: auto;
  height: 30svh;
  max-height: 30svh;
}
@supports (height: 100dvh) {
  .lp-pm__card.is-chatting .lp-pm__header,
  .lp-pm__card.is-locked .lp-pm__header { height: 30dvh; max-height: 30dvh; }
}

.lp-pm__avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Dark gradient at bottom for text readability */
.lp-pm__header::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.85) 100%);
  pointer-events: none;
}

/* Info overlay on top of photo */
.lp-pm__overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 16px 20px;
  z-index: 2;
  color: #fff;
}

.lp-pm__name {
  font-size: clamp(1.35rem, 5.5vw, 1.7rem);
  font-weight: 800;
  margin: 0;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  line-height: 1.15;
}

.lp-pm__age {
  font-weight: 400;
  opacity: 0.9;
}

.lp-pm__meta {
  font-size: 0.88rem;
  color: rgba(255,255,255,0.95);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-weight: 600;
}

.lp-pm__status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0,0,0,0.4);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  font-size: 0.8rem;
  font-weight: 600;
}

.lp-pm__status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lp-online);
  animation: lp-pulse 2s ease-in-out infinite;
}

.lp-pm__verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.75rem;
  color: #fff;
  font-weight: 600;
  margin-top: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(34,197,94,0.7);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* ============================================================
   BODY — single flex:1 container that hosts all step-screens.
   Only element that ever scrolls internally on mobile.
   ============================================================ */
.lp-pm__body {
  flex: 1 1 auto;
  min-height: 0;              /* critical: lets flex children scroll */
  display: flex;
  flex-direction: column;
  overflow: hidden;           /* individual step-screens own their scroll */
}

/* When chat is active, collapse body (its steps are hidden) so chat gets all space */
.lp-pm__card.is-chatting .lp-pm__body { flex: 0 0 0; display: none; }

/* ============ Step 0: Bio + Start button ============ */
.lp-pm__bio-step {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.lp-pm__bio {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  font-size: 0.98rem;
  color: var(--lp-text);
  line-height: 1.55;
  padding-right: 4px;         /* breathing space for scrollbar */
}

.lp-pm__start-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  font-size: clamp(1rem, 4vw, 1.1rem);
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-sizing: border-box;
  transition: transform 0.15s ease;
}

.lp-pm__start-btn:active { transform: scale(0.98); }

/* ============ Step 1: Name input ============ */
.lp-pm__name-step {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  box-sizing: border-box;
  justify-content: center;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: lp-pm-step-in 0.25s ease;
}

@keyframes lp-pm-step-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lp-pm__name-prompt {
  margin: 0;
  font-size: clamp(0.98rem, 3.8vw, 1.05rem);
  font-weight: 600;
  text-align: center;
}

.lp-pm__name-input {
  width: 100%;
  padding: 14px 18px;
  border: 2px solid var(--lp-card-border);
  border-radius: 999px;
  background: transparent;
  color: var(--lp-text);
  font-size: 1rem;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
}

.lp-pm__name-input:focus { border-color: var(--lp-primary); }

.lp-pm__name-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 14px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  font-size: clamp(1rem, 4vw, 1.1rem);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-sizing: border-box;
  transition: transform 0.15s ease;
}

.lp-pm__name-btn:active { transform: scale(0.98); }

/* ============ Step 2: Chat ============ */
.lp-pm__chat {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
}

.lp-pm__chat.is-active { display: flex; }

.lp-pm__messages {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lp-pm__bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.94rem;
  line-height: 1.4;
  word-break: break-word;
}

.lp-pm__bubble--user {
  align-self: flex-end;
  background: var(--lp-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.lp-pm__bubble--bot {
  align-self: flex-start;
  background: var(--lp-card-border);
  color: var(--lp-text);
  border-bottom-left-radius: 4px;
}

.lp-pm__bubble--bot-blurred {
  align-self: flex-start;
  background: var(--lp-card-border);
  color: var(--lp-text);
  border-bottom-left-radius: 4px;
  filter: blur(5px);
  user-select: none;
  pointer-events: none;
}

.lp-pm__bubble--system {
  align-self: center;
  font-size: 0.8rem;
  color: var(--lp-muted);
  font-style: italic;
}

.lp-pm__typing {
  display: none;
  align-self: flex-start;
  padding: 10px 16px;
  background: var(--lp-card-border);
  border-radius: 16px;
  gap: 4px;
}

.lp-pm__typing.is-visible { display: flex; }

.lp-pm__typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--lp-muted);
  animation: lp-type-bounce 1.2s ease-in-out infinite;
}
.lp-pm__typing-dot:nth-child(2) { animation-delay: 0.15s; }
.lp-pm__typing-dot:nth-child(3) { animation-delay: 0.3s; }

@keyframes lp-type-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-4px); }
}

.lp-pm__input-wrap {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--lp-card-border);
  background: var(--lp-card);
  box-sizing: border-box;
}

.lp-pm__input {
  flex: 1;
  min-width: 0;
  padding: 12px 16px;
  border: 2px solid var(--lp-card-border);
  border-radius: 999px;
  background: transparent;
  color: var(--lp-text);
  font-size: 16px;              /* 16px prevents iOS auto-zoom on focus */
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
}

.lp-pm__input:focus { border-color: var(--lp-primary); }

.lp-pm__send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: var(--lp-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.12s ease;
}
.lp-pm__send:active { transform: scale(0.92); }
.lp-pm__send:disabled { opacity: 0.5; cursor: not-allowed; }

/* ============ Step 3: Registration panel (when chat is locked) ============ */
.lp-pm__reg {
  display: none;
  flex-shrink: 0;
  padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--lp-card-border);
  background: color-mix(in srgb, var(--lp-primary) 6%, var(--lp-card));
  animation: lp-pm-slide-in 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-sizing: border-box;
}

@keyframes lp-pm-slide-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lp-pm__reg.is-visible {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  text-align: center;
}

.lp-pm__reg-text {
  margin: 0;
  font-size: clamp(0.98rem, 3.8vw, 1.1rem);
  font-weight: 700;
  color: var(--lp-text);
  line-height: 1.4;
}

.lp-pm__reg-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 54px;
  padding: 14px 24px;
  margin: 0;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--lp-primary), var(--lp-accent));
  color: #fff;
  font-size: clamp(1rem, 4vw, 1.15rem);
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: transform 0.15s ease;
}

.lp-pm__reg-btn:hover { transform: translateY(-1px); }
.lp-pm__reg-btn:active { transform: scale(0.98); }

.lp-pm__reg-micro {
  margin: 0;
  font-size: 0.85rem;
  color: var(--lp-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

/* ============ Locked state cleanup (legacy — kept for compat) ============ */
.lp-pm__card.is-locked .lp-pm__input-wrap { display: none !important; }
.lp-pm__card.is-locked .lp-pm__messages { flex: 0 1 auto; }
.lp-pm__card.is-locked .lp-pm__reg.is-visible {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============ Desktop: floating dialog ============ */
@media (min-width: 640px) {
  .lp-pm {
    padding: 20px;
    align-items: center;
    justify-content: center;
  }
  .lp-pm__card {
    width: 100%;
    max-width: 520px;
    height: auto;
    max-height: 94vh;
    border-radius: var(--lp-radius);
  }
  @supports (height: 100dvh) {
    .lp-pm__card { max-height: 94dvh; }
  }
  .lp-pm__close {
    top: 12px;
    right: 12px;
  }
}

/* ============ Facebook/Instagram in-app browser quirks ============
   These browsers often lie about viewport height; force minimum body layout
   via flex and let overflow handle any odd reports. No :root hack needed
   because our card layout is flex-based from the root element. */
@media (max-width: 639px) {
  .lp-pm__card {
    /* Ensure card never exceeds what the browser thinks is visible */
    max-height: 100vh;
    max-height: 100svh;
    max-height: 100dvh;
  }
}

/* ===== Utility ===== */
.lp-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
