/* Match Celebration Modal */
.match-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 12, 16, 0.92);
  backdrop-filter: blur(16px);
  padding: 24px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.match-modal.active {
  display: flex;
  opacity: 1;
}

.match-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
  max-width: 360px;
  animation: matchZoom 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes matchZoom {
  0% { transform: scale(0.7); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.match-heading {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.match-subtitle {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* Match Avatars Intersecting */
.match-avatars-row {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 28px;
}

.match-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  position: relative;
  background: var(--surface-card);
}

.match-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.match-avatar-left {
  margin-right: -16px;
  z-index: 1;
}

.match-avatar-right {
  margin-left: -16px;
  z-index: 1;
}

.match-heart-badge {
  position: absolute;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

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

/* Empty Feed State */
.empty-feed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 380px;
  margin: auto;
  padding: 24px 20px;
  box-sizing: border-box;
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 14px;
}

.empty-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--tg-text);
  margin-bottom: 8px;
}

.empty-text {
  font-size: 14px;
  color: var(--tg-hint);
  line-height: 1.5;
  margin-bottom: 24px;
  max-width: 280px;
}

/* Phantom UI Skeleton & Overlay Loading System */
:root {
  --phantom-shimmer-bg: rgba(255, 255, 255, 0.08);
  --phantom-shimmer-color: rgba(255, 255, 255, 0.18);
  --phantom-duration: 1.4s;
  --phantom-reveal: 0.22s;
}

[data-theme="light"] {
  --phantom-shimmer-bg: rgba(0, 0, 0, 0.06);
  --phantom-shimmer-color: rgba(0, 0, 0, 0.13);
}

phantom-ui {
  display: block;
  position: relative;
  --shimmer-bg: var(--phantom-shimmer-bg);
  --shimmer-color: var(--phantom-shimmer-color);
  --shimmer-duration: var(--phantom-duration);
  --reveal-duration: var(--phantom-reveal);
}

/* Ensure shimmer overlay never intercepts touch or pointer events */
phantom-ui .shimmer-overlay,
phantom-ui::part(overlay) {
  pointer-events: none !important;
}

/* Card Skeleton Template matching real .card */
.card-skeleton-host {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card, 24px);
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}

.card-skeleton-host.next {
  z-index: 1;
  transform: scale(0.94) translateY(16px);
  opacity: 0.7;
  filter: brightness(0.85);
}

.skeleton-card-inner {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card, 24px);
  background-color: var(--surface-card);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.skeleton-media-ph {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-card, 24px);
  background: var(--surface-card);
}

.skeleton-info-ph {
  position: relative;
  z-index: 2;
  padding: 18px 16px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.4) 40%, rgba(0, 0, 0, 0.82) 100%);
}

.skeleton-line-title {
  width: 55%;
  height: 24px;
  border-radius: 8px;
  background: var(--border-subtle);
}

.skeleton-line-city {
  width: 35%;
  height: 16px;
  border-radius: 6px;
  background: var(--border-subtle);
}

.skeleton-line-bio {
  width: 85%;
  height: 18px;
  border-radius: 6px;
  background: var(--border-subtle);
  margin-top: 4px;
}

/* Profile Screen Skeleton & Overlay */
.profile-phantom-wrap {
  width: 100%;
  border-radius: var(--radius-card, 24px);
  overflow: hidden;
}

/* Gallery Photo Placeholder in detail sheet */
.gallery-phantom-wrap {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: 20px;
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  phantom-ui {
    --shimmer-duration: 0s !important;
  }
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: calc(var(--safe-top) + 60px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: var(--surface-glass);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  animation: toastFade 2.5s forwards;
}

@keyframes toastFade {
  0% { opacity: 0; transform: translateY(-10px) scale(0.9); }
  10% { opacity: 1; transform: translateY(0) scale(1); }
  85% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

/* =========================================================
   Telegram Gate Overlay (Opened Outside Mini App)
   ========================================================= */
.telegram-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 20px;
  background: var(--app-bg);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-spring);
}

.telegram-gate-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.telegram-gate-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: none;
}

.telegram-gate-card {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 340px;
  border-radius: var(--radius-card);
  background: var(--glass-card-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-card);
  padding: 32px 24px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s var(--ease-spring);
}

.telegram-gate-overlay.active .telegram-gate-card {
  transform: scale(1);
}

.gate-animation-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gate-glow-halo {
  display: none;
}

.gate-animated-sticker {
  position: relative;
  z-index: 2;
  width: 72px;
  height: 72px;
  object-fit: contain;
}

.gate-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
  line-height: 1.3;
  margin: 0 0 8px 0;
}

.gate-description {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
}

.gate-description b {
  color: var(--text-primary);
}

.gate-feature-chips {
  display: none;
}

.gate-actions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-gate-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s var(--ease-spring), opacity 0.18s var(--ease-spring);
}

.btn-gate-primary:active {
  transform: scale(0.98);
  opacity: 0.92;
}

.btn-gate-secondary {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  padding: 4px 0;
}

.btn-gate-secondary:hover, .btn-gate-secondary:active {
  color: var(--text-primary);
}
