/* ── Reset & base ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --golden-yellow:   #D4A017;
  --butter-yellow:   #E8C84A;
  --citrus:          #9DAF2B;
  --moss:            #6B7A2A;
  --deep-plum:       #4A2D5C;
  --eggplant:        #6B3D7A;
  --violet:          #8B5FA3;
  --soft-lavender:   #C4A8D4;
  --gold:            #D4A017;

  --bg:        #1A1408;
  --surface:   #251C0E;
  --card:      #2E2210;
  --border:    rgba(212, 160, 23, 0.2);
  --muted:     #8A7D5A;
  --off-white: #F2EDD6;

  --like-green: #9DAF2B;
  --nope-red:   #C45A6A;

  --radius-card: 20px;
  --radius-btn:  12px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  height: 100%;
  background: var(--bg);
  color: var(--off-white);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

#app {
  width: 100%;
  max-width: 430px;
  height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background: var(--bg);
  flex-shrink: 0;
}

#app::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(212,160,23,.55) 0%, transparent 100%),
    radial-gradient(1px   1px at 78% 9%,  rgba(139,95,163,.45) 0%, transparent 100%),
    radial-gradient(1px   1px at 88% 38%, rgba(157,175,43,.4)  0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 4%  62%, rgba(212,160,23,.4) 0%, transparent 100%),
    radial-gradient(1px   1px at 52% 72%, rgba(139,95,163,.5)  0%, transparent 100%),
    radial-gradient(1px   1px at 33% 88%, rgba(157,175,43,.35) 0%, transparent 100%),
    radial-gradient(1.5px 1.5px at 94% 77%, rgba(196,168,212,.4) 0%, transparent 100%),
    radial-gradient(1px   1px at 65% 44%, rgba(212,160,23,.3)  0%, transparent 100%),
    radial-gradient(1px   1px at 20% 55%, rgba(139,95,163,.3)  0%, transparent 100%);
  pointer-events: none;
  z-index: 0;
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  z-index: 1;
}
.screen.active { display: flex; }

/* ── SETUP ── */
#screen-setup {
  justify-content: center;
  align-items: center;
  padding: 2rem 1.5rem;
  overflow-y: auto;
}
.setup-inner { width: 100%; max-width: 360px; }

.setup-logo {
  font-size: 52px;
  text-align: center;
  margin-bottom: .75rem;
  animation: pulse 3s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.07); }
}

.setup-title {
  font-size: 34px;
  font-weight: 700;
  text-align: center;
  letter-spacing: -.5px;
  color: var(--butter-yellow);
  margin-bottom: .4rem;
}
.setup-sub {
  font-size: 14px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.field { margin-bottom: 1.25rem; }
.field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .5rem;
}
.field-hint { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 11px; }

.toggle-group {
  display: flex;
  gap: 5px;
  background: var(--surface);
  border-radius: var(--radius-btn);
  padding: 4px;
  border: 1px solid var(--border);
}
.toggle {
  flex: 1;
  padding: 9px 6px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.toggle.active {
  background: var(--eggplant);
  color: var(--soft-lavender);
}
.toggle:hover:not(.active) {
  background: rgba(139,95,163,.15);
  color: var(--off-white);
}

/* dual range slider */
.age-label-val {
  font-size: 12px;
  color: var(--golden-yellow);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  margin-left: 6px;
}
.range-wrap {
  position: relative;
  height: 36px;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}
.range-track {
  position: absolute;
  left: 0; right: 0;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  pointer-events: none;
}
.range-fill {
  position: absolute;
  height: 4px;
  background: linear-gradient(90deg, var(--golden-yellow), var(--citrus));
  border-radius: 2px;
  pointer-events: none;
}
.range-input {
  position: absolute;
  width: 100%;
  height: 4px;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  outline: none;
  border: none;
  padding: 0;
}
.range-input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--golden-yellow);
  border: 3px solid var(--bg);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 6px rgba(0,0,0,.4);
  transition: transform .1s;
}
.range-input::-webkit-slider-thumb:hover { transform: scale(1.15); }
.range-input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--golden-yellow);
  border: 3px solid var(--bg);
  cursor: pointer;
  pointer-events: all;
  box-shadow: 0 1px 6px rgba(0,0,0,.4);
}
.range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  padding: 0 2px;
  margin-top: 2px;
}

select {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--off-white);
  font-size: 14px;
  padding: 10px 12px;
  appearance: none;
  cursor: pointer;
}
select:focus { outline: none; border-color: var(--golden-yellow); }

.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, var(--deep-plum), var(--eggplant));
  color: var(--soft-lavender);
  border: 1px solid rgba(196,168,212,.25);
  border-radius: var(--radius-btn);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  margin-top: 1.5rem;
}
.btn-primary:hover  { opacity: .9; }
.btn-primary:active { transform: scale(.98); }

.btn-secondary {
  display: block;
  width: 100%;
  padding: 13px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s;
  margin-top: .75rem;
}
.btn-secondary:hover { border-color: var(--golden-yellow); color: var(--off-white); }

.setup-note {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin-top: .75rem;
}

/* ── SWIPE ── */
#screen-swipe { padding: .75rem .75rem .5rem; }

.swipe-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: .6rem;
}
.progress-wrap {
  flex: 1;
  height: 4px;
  background: var(--surface);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--golden-yellow), var(--citrus));
  border-radius: 2px;
  transition: width .3s ease;
  width: 0%;
}
.swipe-count {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 44px;
  text-align: right;
}

.card-stack {
  flex: 1;
  position: relative;
  margin-bottom: .6rem;
}

.celeb-card {
  position: absolute;
  inset: 0;
  background: var(--card);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: grab;
  user-select: none;
  border: 1px solid rgba(212,160,23,.15);
  will-change: transform;
}
.celeb-card.is-dragging { cursor: grabbing; }
.celeb-card.fly-left  {
  transform: translateX(-150%) rotate(-22deg) !important;
  opacity: 0; pointer-events: none;
}
.celeb-card.fly-right {
  transform: translateX(150%) rotate(22deg) !important;
  opacity: 0; pointer-events: none;
}
.celeb-card.back-card {
  transform: scale(.96) translateY(10px);
  z-index: 0; pointer-events: none;
}
.celeb-card.top-card { z-index: 1; }

.card-img {
  width: 100%;
  height: 64%;
  object-fit: cover;
  object-position: top center;
  display: block;
  background: var(--surface);
}
.card-img-placeholder {
  width: 100%;
  height: 64%;
  background: var(--surface);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 64px;
}

.stamp {
  position: absolute;
  top: 18px;
  padding: 5px 14px;
  border-radius: 7px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .04em;
  opacity: 0;
  pointer-events: none;
  transition: opacity .08s;
}
.stamp-like { left: 16px;  border: 3px solid var(--citrus);   color: var(--citrus);   transform: rotate(-14deg); }
.stamp-nope { right: 16px; border: 3px solid var(--nope-red); color: var(--nope-red); transform: rotate(14deg);  }

.card-info { padding: .6rem 1rem .75rem; }
.card-name {
  font-size: 20px;
  font-weight: 600;
  color: var(--off-white);
  margin-bottom: 3px;
}
.card-meta { font-size: 13px; color: var(--muted); }

.action-btns {
  display: flex;
  justify-content: center;
  gap: 28px;
  padding: .25rem 0 .5rem;
}
.action-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s, border-color .15s, background .15s;
}
.action-btn:hover  { transform: scale(1.1); }
.action-btn:active { transform: scale(.96); }
.action-btn.nope  { color: var(--nope-red); }
.action-btn.nope:hover  { border-color: var(--nope-red);  background: rgba(196,90,106,.1); }
.action-btn.like  { color: var(--citrus); }
.action-btn.like:hover  { border-color: var(--citrus); background: rgba(157,175,43,.12); }

/* ── RESULTS ── */
#screen-results { overflow: hidden; }

.results-scroll {
  height: 100%;
  overflow-y: auto;
  padding: 1.25rem 1.25rem 2rem;
  -webkit-overflow-scrolling: touch;
}
.results-header { text-align: center; margin-bottom: 1.25rem; }
.results-title  { font-size: 22px; font-weight: 700; color: var(--butter-yellow); }
.results-sub    { font-size: 13px; color: var(--muted); margin-top: 4px; }

.podium { display: flex; gap: 8px; margin-bottom: 1.5rem; }
.podium-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 8px;
  text-align: center;
}
.podium-card.gold {
  background: rgba(212,160,23,.1);
  border-color: rgba(212,160,23,.45);
}
.podium-medal { font-size: 18px; margin-bottom: 5px; }
.podium-sign  { font-size: 14px; font-weight: 600; color: var(--off-white); }
.podium-type  { font-size: 10px; color: var(--muted); margin-top: 2px; }
.podium-count { font-size: 12px; font-weight: 500; margin-top: 4px; color: var(--muted); }
.podium-card.gold .podium-count { color: var(--golden-yellow); }

.bars-section { margin-bottom: 1.25rem; }
.bars-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  margin-top: 1rem;
}
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.bar-label { font-size: 13px; color: var(--off-white); min-width: 90px; }
.bar-track  { flex: 1; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.bar-fill   { height: 100%; border-radius: 3px; transition: width .7s ease; }
.bar-fill.sun-bar  { background: linear-gradient(90deg, var(--golden-yellow), var(--butter-yellow)); }
.bar-fill.moon-bar { background: linear-gradient(90deg, var(--eggplant), var(--soft-lavender)); }
.bar-fill.rise-bar { background: linear-gradient(90deg, var(--moss), var(--citrus)); }
.bar-count { font-size: 12px; color: var(--muted); min-width: 18px; text-align: right; }

.expand-btn {
  display: block;
  width: 100%;
  padding: 9px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  margin-top: .75rem;
  transition: border-color .15s, color .15s;
}
.expand-btn:hover { border-color: var(--golden-yellow); color: var(--off-white); }

.share-row { display: flex; align-items: center; gap: 10px; margin-bottom: 1.5rem; }
.btn-share {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--off-white);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-share:hover { border-color: var(--golden-yellow); background: rgba(212,160,23,.08); }
.share-copied { font-size: 12px; color: var(--citrus); opacity: 0; transition: opacity .2s; }
.share-copied.visible { opacity: 1; }

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 1.5rem 0 1.25rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.divider span { font-size: 12px; color: var(--muted); white-space: nowrap; }

.soulmate-intro { font-size: 13px; color: var(--muted); margin-bottom: 1.25rem; line-height: 1.6; }
.sm-fields { display: flex; flex-direction: column; gap: 1rem; }
.sm-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--off-white);
  font-size: 14px;
  padding: 10px 12px;
}
.sm-input:focus { outline: none; border-color: var(--golden-yellow); }
.sm-input[type="date"] { color-scheme: dark; }
.sm-btn { margin-top: 1.25rem; }

.sm-aspect-pill {
  font-size: 11px;
  color: var(--golden-yellow);
  background: rgba(212,160,23,.1);
  border: 1px solid rgba(212,160,23,.25);
  border-radius: 20px;
  padding: 4px 12px;
  display: inline-block;
  margin: .6rem 0 .85rem;
  line-height: 1.5;
}

.soulmate-result {
  margin-top: 1.25rem;
  background: var(--surface);
  border: 1px solid rgba(212,160,23,.3);
  border-radius: 14px;
  padding: 1.25rem;
}
.soulmate-result.hidden { display: none; }

.sm-result-headline {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--golden-yellow);
  margin-bottom: .85rem;
}
.sm-result-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1rem;
}
.sm-result-item { display: flex; flex-direction: column; gap: 3px; }
.sm-result-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sm-result-value { font-size: 16px; font-weight: 600; color: var(--off-white); }
.sm-result-value .highlight { color: var(--butter-yellow); }

.sm-result-breakdown {
  border-top: 1px solid var(--border);
  padding-top: .85rem;
  margin-top: .85rem;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.sm-breakdown-row { font-size: 13px; line-height: 1.5; }
.sm-breakdown-label { display: inline-block; min-width: 60px; color: var(--muted); font-weight: 500; }
.sm-breakdown-value { color: var(--off-white); }

.sm-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: .85rem;
  line-height: 1.6;
  border-top: 1px solid var(--border);
  padding-top: .75rem;
}

.btn-swipe-more {
  display: block;
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--deep-plum), var(--eggplant));
  color: var(--soft-lavender);
  border: 1px solid rgba(196,168,212,.25);
  border-radius: var(--radius-btn);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  margin-bottom: .5rem;
  text-align: center;
}
.btn-swipe-more:hover { opacity: .9; }
.btn-swipe-more:active { transform: scale(.98); }
.btn-swipe-more:disabled { opacity: .4; cursor: default; transform: none; }
.swipe-more-note { font-size: 12px; color: var(--muted); text-align: center; margin-bottom: .75rem; }

/* ── Utilities ── */
.hidden { display: none !important; }

::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

@media (min-width: 480px) {
  html { overflow: hidden; }
  body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
  }
  #app {
    height: min(100dvh, 900px);
    border-radius: 36px;
    border: 1px solid rgba(212,160,23,.18);
    box-shadow: 0 0 80px rgba(74,45,92,.25), 0 0 200px rgba(74,45,92,.1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .setup-logo { animation: none; }
  .progress-fill, .bar-fill, .celeb-card { transition: none; }
}
