/* Swipe onboarding — Gradient Glass */
html[data-page="swipe"]:not(.ob-white-surface) {
  background-color: var(--ob-gradient-top);
  background-image: var(--ob-gradient);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

html[data-page="swipe"],
html[data-page="swipe"] body {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
  min-height: 100dvh;
}

html[data-page="swipe"] body {
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  align-items: stretch;
  margin: 0;
  background-color: var(--ob-gradient-bottom);
  background-image: var(--ob-gradient);
  background-repeat: no-repeat;
  background-size: 100% 100%;
  background-attachment: scroll;
  color: var(--ob-text);
  -webkit-font-smoothing: antialiased;
}

html[data-page="swipe"].ob-white-surface,
html[data-page="swipe"].ob-white-surface body,
html[data-page="swipe"] body.swipe-deck-mode {
  background-color: #ffffff !important;
  background-image: none !important;
}

html[data-page="swipe"] .app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  html[data-page="swipe"] body { align-items: center; }
  html[data-page="swipe"] .app { max-height: 880px; }
}

/* Intro / gender */
html[data-page="swipe"] .intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 18px;
  padding: 24px;
  text-align: center;
  position: relative;
}

html[data-page="swipe"] .intro h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  max-width: 320px;
}

html[data-page="swipe"] .intro p {
  margin: 0;
  color: var(--ob-muted-strong);
  max-width: 300px;
  font-size: 15px;
  line-height: 1.5;
}

html[data-page="swipe"] .back-home {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  left: 16px;
  color: var(--ob-muted);
  text-decoration: none;
  font-size: 24px;
  line-height: 1;
  padding: 8px;
}

html[data-page="swipe"] .gender-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 28px;
  width: 100%;
  max-width: 340px;
}

html[data-page="swipe"] .gender-btn {
  width: 100%;
  padding: 22px 20px;
  background: var(--ob-glass-strong);
  backdrop-filter: var(--ob-blur);
  -webkit-backdrop-filter: var(--ob-blur);
  border: 1px solid var(--ob-glass-border-strong);
  border-radius: 16px;
  color: var(--ob-text);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.12s ease;
  font-family: inherit;
}

html[data-page="swipe"] .gender-btn:active { transform: scale(0.97); }

/* Header / progress */
html[data-page="swipe"] .header,
html[data-page="preview"] .header {
  padding: 12px 20px 8px;
  text-align: center;
  flex-shrink: 0;
}

html[data-page="swipe"] .progress-track,
html[data-page="preview"] .progress-track {
  height: 4px;
  background: var(--ob-progress-track);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}

html[data-page="swipe"] .progress-fill,
html[data-page="preview"] .progress-fill {
  height: 100%;
  background: var(--ob-progress-fill);
  width: 0%;
  transition: width 0.25s ease-out;
}

html[data-page="swipe"] .progress-label,
html[data-page="preview"] .progress-label {
  font-size: 12px;
  color: var(--ob-muted);
  letter-spacing: 0.06em;
}

/* Deck */
html[data-page="swipe"] .swipe-screen,
html[data-page="preview"] .swipe-screen {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

html[data-page="swipe"] .deck-wrap,
html[data-page="preview"] .deck-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  margin: 0 16px;
  display: flex;
}

html[data-page="swipe"] .deck,
html[data-page="preview"] .deck {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
}

html[data-page="swipe"] .card,
html[data-page="preview"] .card {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: 24px;
  background: linear-gradient(180deg, #f8f6f1 0%, #ebe7df 100%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  will-change: transform, opacity;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

html[data-page="swipe"] .card.no-anim,
html[data-page="preview"] .card.no-anim { transition: none !important; }

html[data-page="swipe"] .card.animate,
html[data-page="preview"] .card.animate {
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s;
}

html[data-page="swipe"] .card .figure,
html[data-page="preview"] .card .figure {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 22px;
  min-height: 0;
}

html[data-page="swipe"] .card .figure img,
html[data-page="preview"] .card .figure img {
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
  pointer-events: none;
}

html[data-page="swipe"] .badge,
html[data-page="preview"] .badge {
  position: absolute;
  top: 32px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 3px solid;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.08em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s linear;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

html[data-page="swipe"] .badge.like,
html[data-page="preview"] .badge.like {
  left: 18px;
  color: #2da55e;
  border-color: #2da55e;
  transform: rotate(-18deg);
}

html[data-page="swipe"] .badge.nope,
html[data-page="preview"] .badge.nope {
  right: 18px;
  color: #d94e4e;
  border-color: #d94e4e;
  transform: rotate(18deg);
}

/* Controls */
html[data-page="swipe"] .controls,
html[data-page="preview"] .controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  flex-shrink: 0;
  padding: 12px 0 14px;
  touch-action: manipulation;
}

html[data-page="swipe"] .ctrl,
html[data-page="preview"] .ctrl {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--ob-glass-border-strong);
  background: var(--ob-glass-strong);
  backdrop-filter: var(--ob-blur);
  -webkit-backdrop-filter: var(--ob-blur);
  touch-action: manipulation;
  color: var(--ob-text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s ease;
  font-family: inherit;
}

html[data-page="swipe"] .ctrl:active,
html[data-page="preview"] .ctrl:active { transform: scale(0.92); }

html[data-page="swipe"] .ctrl.nope,
html[data-page="preview"] .ctrl.nope { color: #d94e4e; }

html[data-page="swipe"] .ctrl.like,
html[data-page="preview"] .ctrl.like { color: #2da55e; }

html[data-page="swipe"] .ctrl svg,
html[data-page="preview"] .ctrl svg { width: 28px; height: 28px; }

html[data-page="swipe"] .ctrl.small,
html[data-page="preview"] .ctrl.small {
  width: 48px;
  height: 48px;
}

html[data-page="swipe"] .ctrl.small svg,
html[data-page="preview"] .ctrl.small svg { width: 20px; height: 20px; }

html[data-page="swipe"] .ctrl[disabled],
html[data-page="preview"] .ctrl[disabled] { opacity: 0.35; cursor: not-allowed; }

html[data-page="swipe"] body.swipe-deck-mode,
html[data-page="preview"] body.swipe-deck-mode {
  background: #ffffff;
  color: #171719;
}

html[data-page="swipe"] body.swipe-deck-mode .progress-track,
html[data-page="preview"] body.swipe-deck-mode .progress-track {
  background: #e8e8ec;
}

html[data-page="swipe"] body.swipe-deck-mode .progress-fill,
html[data-page="preview"] body.swipe-deck-mode .progress-fill {
  background: #6d3fb0;
}

html[data-page="swipe"] body.swipe-deck-mode .progress-label,
html[data-page="preview"] body.swipe-deck-mode .progress-label {
  color: #6b6b75;
}

html[data-page="swipe"] body.swipe-deck-mode .header,
html[data-page="preview"] body.swipe-deck-mode .header {
  padding: 10px 16px 6px;
}

html[data-page="swipe"] body.swipe-deck-mode .progress-track,
html[data-page="preview"] body.swipe-deck-mode .progress-track {
  margin-bottom: 7px;
}

html[data-page="swipe"] body.swipe-deck-mode .deck-wrap,
html[data-page="preview"] body.swipe-deck-mode .deck-wrap {
  margin: 0 15px;
}

html[data-page="swipe"] body.swipe-deck-mode .controls,
html[data-page="preview"] body.swipe-deck-mode .controls {
  padding: 10px 0 12px;
  gap: 27px;
}

@media (min-width: 600px) {
  html[data-page="swipe"] body.swipe-deck-mode .app,
  html[data-page="preview"] body.swipe-deck-mode .app {
    max-height: none;
    height: 100%;
  }
}

html[data-page="swipe"] body.swipe-deck-mode .ctrl,
html[data-page="preview"] body.swipe-deck-mode .ctrl {
  background: #f5f5f7;
  border-color: #e0e0e5;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Result */
html[data-page="swipe"] .result {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 30px;
  gap: 12px;
  overflow-y: auto;
}

html[data-page="swipe"] .result h2 {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.25;
}

html[data-page="swipe"] .result .sub {
  color: var(--ob-muted);
  font-size: 13px;
  margin: 0;
}

html[data-page="swipe"] .top-tag {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 6px;
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.18) !important;
  border: 1px solid var(--ob-glass-border-strong) !important;
  color: var(--ob-text) !important;
}

html[data-page="swipe"] .bars {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 12px;
}

html[data-page="swipe"] .bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

html[data-page="swipe"] .bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--ob-text);
}

html[data-page="swipe"] .bar-pct { font-weight: 500; color: var(--ob-text); }

html[data-page="swipe"] .bar-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  overflow: hidden;
}

html[data-page="swipe"] .bar-fill {
  height: 100%;
  border-radius: 5px;
  background: #ffffff !important;
  transition: width 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

html[data-page="swipe"] .bar-fill.dim { background: rgba(255, 255, 255, 0.6) !important; }

html[data-page="swipe"] .result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  width: 100%;
}

html[data-page="swipe"] .result-actions button {
  width: 100%;
  border-radius: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease;
}

html[data-page="swipe"] .result-actions button:active { transform: scale(0.98); }

html[data-page="swipe"] .result-actions button.primary {
  padding: 20px 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #ffffff;
  color: var(--ob-primary);
  border: none;
}

html[data-page="swipe"] .result-actions button.secondary {
  padding: 11px 0;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: none;
}

html[data-page="swipe"] .hidden { display: none !important; }

/* Preview looks (beta flow) — same Gradient Glass shell as swipe */
html[data-page="preview"],
html[data-page="preview"] body {
  overflow: hidden;
  overscroll-behavior: none;
  height: 100%;
  min-height: 100dvh;
}

html[data-page="preview"] body {
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
  align-items: stretch;
  margin: 0;
  background: var(--ob-gradient);
  color: var(--ob-text);
  -webkit-font-smoothing: antialiased;
}

html[data-page="preview"] .app {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}

@media (min-width: 600px) {
  html[data-page="preview"] body { align-items: center; }
  html[data-page="preview"] .app { max-height: 880px; }
}

html[data-page="preview"] .intro {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 24px;
  text-align: center;
}

html[data-page="preview"] .intro h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.2;
  max-width: 320px;
}

html[data-page="preview"] .intro p {
  margin: 0;
  color: var(--ob-muted-strong);
  max-width: 320px;
  font-size: 15px;
  line-height: 1.5;
}

html[data-page="preview"] .result {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 28px 24px 30px;
  gap: 12px;
  overflow-y: auto;
}

html[data-page="preview"] .result h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
}

html[data-page="preview"] .result .sub {
  color: var(--ob-muted);
  font-size: 13px;
  margin: 0;
}

html[data-page="preview"] .result .result-lead {
  margin: 0;
  color: var(--ob-muted-strong);
  font-size: 15px;
  line-height: 1.5;
  max-width: 340px;
}

html[data-page="preview"] .result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  width: 100%;
}

html[data-page="preview"] .result-actions button {
  width: 100%;
  border-radius: 16px;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s ease;
}

html[data-page="preview"] .result-actions button:active { transform: scale(0.98); }

html[data-page="preview"] .result-actions button.primary {
  padding: 20px 0;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: #ffffff;
  color: var(--ob-primary);
  border: none;
}

html[data-page="preview"] .result-actions button.secondary {
  padding: 11px 0;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  border: none;
}

html[data-page="preview"] .hidden { display: none !important; }
