:root {
  --bg: #0f1114;
  --panel: #171a1f;
  --card: #1d2128;
  --ink: #f4efe6;
  --muted: #9a9286;
  --line: rgba(244, 239, 230, 0.1);
  --accent: #c45c3e;
  --accent-2: #e8b89a;
  --pass: #8a8378;
  --like: #c45c3e;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  --radius: 28px;
  --serif: "Cormorant Garamond", Georgia, serif;
  --sans: "Outfit", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
}

body {
  font-family: var(--sans);
  background:
    radial-gradient(900px 420px at 80% -10%, rgba(196, 92, 62, 0.22), transparent 55%),
    radial-gradient(700px 380px at 0% 110%, rgba(232, 184, 154, 0.12), transparent 50%),
    var(--bg);
  color: var(--ink);
  display: flex;
  justify-content: center;
  min-height: 100dvh;
}

body[dir="rtl"] {
  direction: rtl;
}

.app {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background: var(--panel);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 8px;
  gap: 10px;
}

.brand {
  font-family: var(--serif);
  font-size: 28px;
  letter-spacing: 0.18em;
  font-weight: 600;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang {
  appearance: none;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-family: inherit;
}

.register-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  color: #1a120e;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  cursor: pointer;
}

.register-btn[disabled] {
  opacity: 0.38;
  cursor: not-allowed;
  filter: grayscale(0.4);
}

.register-btn[hidden],
.user-chip[hidden] {
  display: none;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-2);
  background: rgba(196, 92, 62, 0.16);
  border: 1px solid rgba(232, 184, 154, 0.28);
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7dffb0;
  flex-shrink: 0;
}

.hero {
  padding: 4px 22px 10px;
}

.hero h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
}

.hero p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.progress-wrap {
  margin: 6px 22px 10px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.bar {
  height: 4px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.25s ease;
}

.stage {
  flex: 1;
  position: relative;
  margin: 0 16px;
  min-height: 420px;
}

.stack {
  position: absolute;
  inset: 0;
}

.card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: #111;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  touch-action: none;
  will-change: transform;
}

.card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(10, 10, 12, 0.92) 100%);
}

.meta {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;
}

.chip {
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 8px;
}

.meta h2 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 600;
}

.meta .city {
  color: rgba(244, 239, 230, 0.78);
  font-size: 13px;
  margin: 4px 0 10px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tags span {
  border: 1px solid rgba(244, 239, 230, 0.2);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
}

.stamp {
  position: absolute;
  top: 28px;
  padding: 6px 14px;
  border: 3px solid;
  border-radius: 8px;
  font-weight: 800;
  letter-spacing: 0.18em;
  font-size: 18px;
  opacity: 0;
  z-index: 3;
}

.stamp.like {
  left: 18px;
  color: #7dffb0;
  border-color: #7dffb0;
  transform: rotate(-12deg);
}

.stamp.nope {
  right: 18px;
  color: #ff8a8a;
  border-color: #ff8a8a;
  transform: rotate(12deg);
}

.actions {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 16px 16px 10px;
}

.act {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #12151a;
  color: var(--ink);
  font-size: 22px;
  cursor: pointer;
}

.act.like {
  width: 74px;
  height: 74px;
  background: var(--accent);
  border: 0;
  color: #fff;
  font-size: 26px;
}

.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
  padding: 0 28px 18px;
}

.overlay {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 10, 0.62);
  display: none;
  align-items: flex-end;
  z-index: 20;
}

.overlay.open {
  display: flex;
}

.age-gate {
  z-index: 40;
  align-items: center;
  justify-content: center;
  background: #0a0a0c;
  padding: 24px 18px;
}

.age-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.age-scrim {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 8, 10, 0.35) 0%, rgba(8, 8, 10, 0.72) 55%, rgba(8, 8, 10, 0.88) 100%),
    rgba(8, 8, 10, 0.28);
}

.age-sheet {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 360px;
  border-radius: 24px;
  background: rgba(23, 26, 31, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(244, 239, 230, 0.08);
  text-align: center;
  padding: 28px 22px 24px;
}

.age-brand {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.22em;
  margin-bottom: 14px;
  color: var(--accent-2);
}

.age-sheet h3 {
  margin-bottom: 10px;
}

.age-sheet .primary {
  margin-top: 18px;
}

.ghost {
  width: 100%;
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px;
  font-family: inherit;
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.ghost:active {
  color: var(--ink);
}

.hidden {
  display: none !important;
}

.age-loading p {
  color: var(--ink);
}

.age-loading .loading-title {
  margin: 16px 0 8px;
  font-size: 15px;
  font-weight: 500;
}

.loading-tip {
  min-height: 44px;
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--accent-2);
  transition: opacity 0.35s ease;
}

.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(244, 239, 230, 0.15);
  border-top-color: var(--accent-2);
  animation: spin 0.85s linear infinite;
}

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

.loading-bar {
  height: 4px;
  border-radius: 999px;
  background: rgba(244, 239, 230, 0.1);
  overflow: hidden;
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width 0.1s linear;
}

.sheet {
  width: 100%;
  background: #1b1e24;
  border-radius: 24px 24px 0 0;
  padding: 22px 20px 28px;
  max-height: 88%;
  overflow: auto;
}

.sheet h3 {
  font-family: var(--serif);
  font-size: 28px;
  margin-bottom: 8px;
}

.sheet p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.hint {
  margin: 14px 0 18px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(232, 184, 154, 0.1);
  color: var(--accent-2);
  font-size: 13px;
  line-height: 1.5;
}

.primary {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 14px;
  font-family: inherit;
  font-weight: 600;
  font-size: 15px;
  color: #1a120e;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  cursor: pointer;
}

.dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 14px;
}

.dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3b3f47;
  display: block;
}

.dots i.on {
  background: var(--accent);
}

.form label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin: 12px 0 6px;
}

.form input {
  width: 100%;
  border: 1px solid var(--line);
  background: #12151a;
  color: var(--ink);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15px;
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 110px;
  transform: translateX(-50%) translateY(12px);
  background: #2a241e;
  color: var(--accent-2);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: 0.25s ease;
  z-index: 30;
  width: max-content;
  max-width: 86%;
  text-align: center;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.detail-photo {
  width: 100%;
  height: 280px;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 14px;
}

.matches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0 18px;
}

.matches img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  border-radius: 12px;
}

.empty {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  text-align: center;
  padding: 24px;
}
