:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --ink: #1c1b19;
  --ink-soft: #6f6b64;
  --line: #e2ded6;
  --like: #2f6b4f;
  --nope: #a1453a;
  --radius: 18px;
  --display: "SF Pro Display", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --sans: "SF Pro Text", -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

body { overflow: hidden; position: fixed; inset: 0; }

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; -webkit-user-select: none; user-select: none; }

/* ---------- Screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: max(env(safe-area-inset-top), 16px) 20px max(env(safe-area-inset-bottom), 20px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), visibility 0s linear .5s;
}
.screen.is-active {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .5s var(--ease), transform .5s var(--ease), visibility 0s;
}

/* ---------- Typography ---------- */
.eyebrow {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(38px, 11.5vw, 60px);
  line-height: 1.04;
  letter-spacing: -.035em;
  margin: 18px 0 20px;
}
.title-sm { font-size: clamp(34px, 10vw, 52px); margin-bottom: 12px; }
.lead { font-size: 16px; line-height: 1.55; color: var(--ink-soft); max-width: 32ch; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 28px; letter-spacing: .02em; }

/* ---------- Buttons ---------- */
.btn {
  display: block;
  width: 100%;
  height: 56px;
  border-radius: 999px;
  font-size: 15px;
  letter-spacing: .04em;
  transition: transform .2s var(--ease), background-color .2s, opacity .2s;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-outline { border: 1px solid var(--ink); }
.btn-text { color: var(--ink-soft); font-size: 14px; height: auto; min-height: 48px; padding: 8px 12px; line-height: 1.4; }

/* ---------- Start ---------- */
.start-inner {
  margin: auto 0;
  width: 100%;
  max-width: 420px;
  align-self: center;
}
.partner-choice { display: grid; gap: 12px; margin-top: 40px; }

/* ---------- Intro ---------- */
#screen-intro { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.intro-inner {
  margin: auto 0;
  width: 100%;
  max-width: 420px;
  align-self: center;
}
.steps {
  list-style: none;
  margin: 32px 0 40px;
  border-top: 1px solid var(--line);
}
.steps li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink-soft);
}
.steps strong { color: var(--ink); font-weight: 500; }
.step-icon {
  flex: none;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(30,25,20,.06), 0 6px 16px -8px rgba(30,25,20,.25);
  color: var(--ink);
}
.step-like { color: var(--like); }
.step-nope { color: var(--nope); }

/* gestaffeltes Einblenden */
.intro-inner > *, .steps li {
  opacity: 0;
  transform: translateY(10px);
}
#screen-intro.is-active .intro-inner > *,
#screen-intro.is-active .steps li {
  animation: rise .7s var(--ease) forwards;
}
#screen-intro.is-active .intro-inner > :nth-child(2) { animation-delay: .08s; }
#screen-intro.is-active .intro-inner > :nth-child(3) { animation-delay: .16s; }
#screen-intro.is-active .steps { animation-delay: .24s; }
#screen-intro.is-active .steps li:nth-child(1) { animation-delay: .3s; }
#screen-intro.is-active .steps li:nth-child(2) { animation-delay: .38s; }
#screen-intro.is-active .steps li:nth-child(3) { animation-delay: .46s; }
#screen-intro.is-active .intro-inner > :nth-child(5) { animation-delay: .56s; }
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- Swipe ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 48px;
  flex: none;
}
.icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--ink);
  flex: none;
  transition: opacity .2s, background-color .2s;
}
.icon-btn:active { background: rgba(0,0,0,.05); }
.icon-btn:disabled { opacity: .25; cursor: default; }

.progress { flex: 1; text-align: center; }
.progress-label {
  display: block;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  margin: 8px auto 0;
  max-width: 180px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width .45s var(--ease);
}

.deck {
  position: relative;
  flex: 1;
  margin: 16px 0 12px;
  width: 100%;
  max-width: 480px;
  align-self: center;
  min-height: 0;
}

.card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  background: #e9e5de;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(30,25,20,.06), 0 12px 40px -12px rgba(30,25,20,.22);
  touch-action: none;
  will-change: transform;
  transform: translate3d(0,0,0);
  -webkit-user-select: none;
  user-select: none;
  cursor: grab;
}
.card:active { cursor: grabbing; }
.card.is-behind {
  transform: translate3d(0, 10px, 0) scale(.95);
  box-shadow: 0 1px 2px rgba(30,25,20,.04);
  pointer-events: none;
}
.card.is-animating { transition: transform .38s var(--ease); }
.card.is-behind.is-animating { transition: transform .38s var(--ease), box-shadow .38s; }

.card img {
  position: relative;
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
  opacity: 0;
  transition: opacity .35s;
}
.card img.is-loaded { opacity: 1; }
.card-fallback {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  font-family: var(--display);
  font-weight: 200;
  font-size: 72px;
  letter-spacing: -.04em;
  color: rgba(28,27,25,.18);
}

/* „Wusstest du schon?“-Karten */
.card-info {
  background: var(--ink);
  color: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 28px 26px;
}
.info-body { margin: auto 0; }
.info-label {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(245,243,239,.55);
}
.info-title {
  font-family: var(--display);
  font-weight: 300;
  font-size: clamp(30px, 9vw, 42px);
  line-height: 1.08;
  letter-spacing: -.03em;
  margin: 16px 0 18px;
}
.info-text {
  font-size: 16px;
  line-height: 1.55;
  color: rgba(245,243,239,.75);
  max-width: 30ch;
}
.info-hint {
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: rgba(245,243,239,.4);
  text-align: center;
}

/* Ja/Nein-Fragen */
.card-question {
  background: var(--surface);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 28px 26px;
}
.card-question .info-label { color: var(--ink-soft); }
.card-question .info-title { font-size: clamp(30px, 9vw, 40px); margin-bottom: 0; }
.question-hint {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.question-hint span:first-child { color: var(--nope); }
.question-hint span:last-child { color: var(--like); }
.card-question .stamp { top: 24px; }

/* Persönlicher Link: keine Auswahl nötig */
body.is-personal #btn-intro-back { display: none; }

.card-num {
  position: absolute;
  left: 16px; bottom: 14px;
  font-size: 11px;
  letter-spacing: .18em;
  color: #fff;
  text-shadow: 0 1px 8px rgba(0,0,0,.35);
  font-variant-numeric: tabular-nums;
}

.stamp {
  position: absolute;
  top: 28px;
  padding: 6px 14px;
  border: 2px solid currentColor;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  background: rgba(255,255,255,.85);
  opacity: 0;
  will-change: opacity;
}
.stamp-like { left: 22px; color: var(--like); transform: rotate(-12deg); }
.stamp-nope { right: 22px; color: var(--nope); transform: rotate(12deg); }

.actions {
  display: flex;
  justify-content: center;
  gap: 36px;
  flex: none;
  padding-bottom: 4px;
}
.action {
  width: 68px; height: 68px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(30,25,20,.06), 0 8px 24px -10px rgba(30,25,20,.25);
  transition: transform .2s var(--ease);
}
.action:active { transform: scale(.9); }
.action-nope { color: var(--nope); }
.action-like { color: var(--like); }

/* ---------- Abschlussfolie: Stiltyp ---------- */
#screen-result, #screen-thanks { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.result-inner {
  width: 100%;
  max-width: 480px;
  align-self: center;
  margin: auto 0;
  padding-top: 24px;
}
.result-inner .title { margin-bottom: 8px; }
.result-tagline {
  font-size: 18px;
  font-weight: 300;
  color: var(--ink-soft);
  letter-spacing: -.01em;
}
.result-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 28px 0 24px;
}
.result-strip img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 12px;
  background: #e9e5de;
  display: block;
}
.result-inner > .lead { margin-top: 20px; }
.result-strip + .lead { margin-top: 0; }
.result-mix { margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--line); }
.bar-row { margin-top: 16px; }
.bar-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.bar-head span:last-child { color: var(--ink-soft); }
.bar-track { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--ink); transition: width 1.1s var(--ease) .3s; }
.bar-row + .bar-row .bar-fill { opacity: .55; }
.bar-row + .bar-row + .bar-row .bar-fill { opacity: .3; }

.result-inner .end-actions { margin-top: 36px; }

/* Einblenden der Abschlussfolie */
.result-inner > * { opacity: 0; transform: translateY(10px); }
#screen-result.is-active .result-inner > * { animation: rise .7s var(--ease) forwards; }
#screen-result.is-active .result-inner > :nth-child(2) { animation-delay: .15s; }
#screen-result.is-active .result-inner > :nth-child(3) { animation-delay: .3s; }
#screen-result.is-active .result-inner > :nth-child(4) { animation-delay: .45s; }
#screen-result.is-active .result-inner > :nth-child(5) { animation-delay: .6s; }
#screen-result.is-active .result-inner > :nth-child(6) { animation-delay: .75s; }
#screen-result.is-active .result-inner > :nth-child(7) { animation-delay: .9s; }

/* ---------- Danke ---------- */
.thanks-icon {
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  color: var(--like);
  box-shadow: 0 1px 2px rgba(30,25,20,.06), 0 8px 24px -10px rgba(30,25,20,.25);
}
.thanks-actions { margin-top: 40px; }
#screen-thanks .intro-inner > * { opacity: 0; transform: translateY(10px); }
#screen-thanks.is-active .intro-inner > * { animation: rise .7s var(--ease) forwards; }
#screen-thanks.is-active .intro-inner > :nth-child(2) { animation-delay: .1s; }
#screen-thanks.is-active .intro-inner > :nth-child(3) { animation-delay: .2s; }
#screen-thanks.is-active .intro-inner > :nth-child(4) { animation-delay: .3s; }

/* ---------- End ---------- */
#screen-end { overflow-y: auto; -webkit-overflow-scrolling: touch; }
.end-inner {
  width: 100%;
  max-width: 480px;
  align-self: center;
  padding-top: 24px;
  margin: auto 0;
}
.liked-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 28px 0 32px;
}
.liked-item {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: #e9e5de;
}
.liked-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.liked-item span {
  position: absolute; left: 6px; bottom: 5px;
  font-size: 11px; color: #fff;
  text-shadow: 0 1px 6px rgba(0,0,0,.5);
  font-variant-numeric: tabular-nums;
}
.liked-empty { grid-column: 1 / -1; color: var(--ink-soft); font-size: 14px; }
.end-actions { display: grid; gap: 6px; }

@media (min-height: 780px) {
  .action { width: 76px; height: 76px; }
}

@media (prefers-reduced-motion: reduce) {
  .screen, .card.is-animating, .progress-fill { transition-duration: .01s !important; }
  #screen-intro.is-active .intro-inner > *, #screen-intro.is-active .steps li,
  #screen-result.is-active .result-inner > *, #screen-thanks.is-active .intro-inner > * { animation-duration: .01s; animation-delay: 0s !important; }
  .bar-fill { transition-duration: .01s; }
}
