:root {
  --pink: #ff4d6d;
  --pink-dark: #c9184a;
  --pink-light: #ffe5ec;
  --green: #06d6a0;
  --red: #ef476f;
  --dark: #1a1a2e;
  --dark-2: #16213e;
  --card-bg: #fff;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--dark);
  color: #fff;
  min-height: 100vh;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
}
.logo { display: flex; align-items: center; gap: 8px; }
.logo-icon { font-size: 28px; }
.logo-text { font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.lang-switch { font-size: 14px; }
.lang-switch a { color: rgba(255,255,255,0.5); text-decoration: none; }
.lang-switch a.lang-active { color: var(--pink); font-weight: 600; }
.lang-sep { color: rgba(255,255,255,0.2); margin: 0 4px; }

/* Hero */
.hero { text-align: center; padding: 40px 0 32px; }
.hero h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.hero-accent { color: var(--pink); }
.hero-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  max-width: 480px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

.input-row {
  display: flex;
  gap: 8px;
  max-width: 420px;
  margin: 0 auto;
}
.input-group {
  flex: 1;
  display: flex;
  align-items: center;
  background: var(--dark-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  overflow: hidden;
}
.input-group:focus-within {
  border-color: var(--pink);
}
.input-prefix {
  padding: 0 4px 0 14px;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
}
#username-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-size: 16px;
  padding: 14px 14px 14px 4px;
  font-family: inherit;
}
#username-input::placeholder { color: rgba(255,255,255,0.25); }

.btn-primary {
  background: var(--pink);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-primary:hover { background: var(--pink-dark); }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.try-hint {
  margin-top: 16px;
  font-size: 13px;
  color: rgba(255,255,255,0.35);
}
.try-hint a {
  color: var(--pink);
  text-decoration: none;
  cursor: pointer;
}
.try-hint a:hover { text-decoration: underline; }

/* Loading */
.loading { text-align: center; padding: 60px 0; }
.swipe-animation {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}
.card-stack {
  position: relative;
  width: 80px;
  height: 100px;
}
.swipe-card {
  position: absolute;
  width: 80px;
  height: 100px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  animation: swipe 1.5s ease-in-out infinite;
}
.card-1 { background: var(--pink-light); animation-delay: 0s; }
.card-2 { background: #e0e7ff; animation-delay: 0.2s; }
.card-3 { background: #fef3c7; animation-delay: 0.4s; }
@keyframes swipe {
  0% { transform: translateX(-20px) rotate(-10deg); opacity: 0.5; }
  50% { transform: translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateX(20px) rotate(10deg); opacity: 0.5; }
}
.loading-text {
  color: rgba(255,255,255,0.5);
  font-size: 15px;
}

/* Error */
.error-box {
  text-align: center;
  padding: 40px 20px;
  background: rgba(239,71,111,0.1);
  border-radius: var(--radius);
  margin-top: 20px;
}
.error-box p { color: var(--red); font-size: 15px; }

/* Result Card */
.dating-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  margin-top: 24px;
}

.card-photo-section {
  position: relative;
  height: 280px;
  background: var(--dark-2);
  overflow: hidden;
}
.card-avatar {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.card-photo-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 0 12px 8px;
}
.match-badge {
  background: var(--pink);
  color: #fff;
  padding: 6px 14px;
  border-radius: 10px;
  text-align: center;
  font-size: 11px;
  line-height: 1.2;
}
.match-percent { font-size: 20px; font-weight: 800; }
.match-label { font-size: 9px; opacity: 0.8; text-transform: uppercase; letter-spacing: 1px; }

.card-info { padding: 20px; color: var(--text); }
.card-name { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.card-handle { color: var(--text-muted); font-size: 14px; margin-top: 2px; }

.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.meta-dot { color: #d1d5db; }

.card-bio-section { margin-top: 20px; }
.bio-label, .section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #9ca3af;
  margin-bottom: 8px;
}
.card-bio {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
}

.card-section { margin-top: 20px; }

.lang-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.lang-tag {
  background: var(--pink-light);
  color: var(--pink-dark);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.card-flags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}
.flags-label { font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.flags-label.green { color: var(--green); }
.flags-label.red { color: var(--red); }
.flags-list { list-style: none; }
.flags-list li {
  font-size: 13px;
  color: var(--text-muted);
  padding: 2px 0;
  line-height: 1.4;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.stat {
  text-align: center;
  background: #f9fafb;
  border-radius: 10px;
  padding: 12px 4px;
}
.stat-num { font-size: 22px; font-weight: 800; color: var(--text); }
.stat-label { font-size: 11px; color: #9ca3af; margin-top: 2px; }

/* Actions */
.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.btn-secondary {
  flex: 1;
  background: var(--dark-2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-secondary:hover { background: #1f2940; }
.btn-secondary:active { transform: scale(0.97); }

/* Premium */
.premium-box {
  margin-top: 20px;
  background: var(--dark-2);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: var(--radius);
  padding: 20px;
}
.premium-header {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  color: #ffd700;
}
.premium-list {
  list-style: none;
  margin-bottom: 16px;
}
.premium-list li {
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  padding: 4px 0;
  padding-left: 20px;
  position: relative;
  line-height: 1.5;
}
.premium-list li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--pink);
}

.payment-info {
  background: rgba(0,0,0,0.3);
  border-radius: 10px;
  padding: 12px;
}
.payment-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
}
.payment-label { color: rgba(255,255,255,0.5); min-width: 80px; flex-shrink: 0; }
.payment-val { color: rgba(255,255,255,0.8); }
.wallet-addr {
  color: var(--pink);
  font-family: monospace;
  font-size: 12px;
  word-break: break-all;
  flex: 1;
}
.btn-copy {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 2px 4px;
}

/* Footer */
.footer {
  text-align: center;
  padding: 40px 0 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.3);
}
.footer a { color: var(--pink); text-decoration: none; }

.hidden { display: none !important; }

/* Gallery */
.gallery-hero {
  text-align: center;
  padding: 32px 0 24px;
}
.gallery-hero h1 {
  font-size: 28px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -1px;
  margin-bottom: 12px;
}
.gallery-hero .hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  max-width: 520px;
  margin: 0 auto 20px;
  line-height: 1.5;
}
.gallery-cta-row {
  text-align: center;
  margin: 16px 0;
}
.gallery-cta-row.bottom {
  padding: 32px 0 16px;
}
.gallery-cta-row .btn-primary {
  display: inline-block;
  text-decoration: none;
  padding: 14px 28px;
}
.gallery-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 8px 0;
}
.gallery-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 16px;
  color: var(--text);
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.gallery-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}
.gallery-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  flex-shrink: 0;
}
.gallery-card-info {
  flex: 1;
  min-width: 0;
}
.gallery-card-info h3 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gallery-handle {
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
}
.gallery-handle:hover { color: var(--pink); }
.gallery-score {
  text-align: center;
  flex-shrink: 0;
}
.gallery-score-num {
  font-size: 24px;
  font-weight: 800;
  color: var(--pink);
}
.gallery-score-label {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.gallery-bio {
  font-size: 14px;
  line-height: 1.5;
  margin: 12px 0 8px;
  color: var(--text);
}
.gallery-langs {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
}
.gallery-flags {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.gallery-flags-col ul {
  list-style: none;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.gallery-flags-title {
  font-size: 11px;
  font-weight: 700;
  display: block;
  margin-bottom: 4px;
}
.gallery-flags-title.green { color: var(--green); }
.gallery-flags-title.red { color: var(--red); }
.gallery-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.gallery-cta {
  display: block;
  text-align: center;
  background: var(--pink-light);
  color: var(--pink-dark);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s;
}
.gallery-cta:hover { background: var(--pink); color: #fff; }

@media (min-width: 640px) {
  .gallery-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
  #app { max-width: 800px; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .input-row { flex-direction: column; }
  .card-flags { grid-template-columns: 1fr; }
  .card-actions { flex-direction: column; }
}
