:root {
  --primary: #7c3aed;
  --primary-dark: #6d28d9;
  --accent: #f59e0b;
  --bg: #faf7ff;
  --surface: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --success: #10b981;
  --radius: 16px;
  --shadow: 0 4px 20px rgba(124, 58, 237, 0.08);
  --shadow-hover: 0 8px 30px rgba(124, 58, 237, 0.18);
}

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

/* Android 15 / iOS Notch: Safe-Area-Insets respektieren (Edge-to-Edge) */
.topbar { padding-top: calc(16px + env(safe-area-inset-top)); }
footer { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
@supports (padding: max(0px)) {
  body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(135deg, #faf7ff 0%, #fff5f5 100%);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo { font-size: 28px; }
.brand-name { font-weight: 800; font-size: 18px; color: var(--primary); letter-spacing: -0.02em; }
.link-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 8px;
}
.link-btn:hover { background: rgba(124, 58, 237, 0.08); color: var(--primary); }

/* ---------- Main / Screens ---------- */
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}
.screen { display: none; }
.screen.active { display: block; animation: fadeIn 0.35s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Intro ---------- */
.intro { text-align: center; padding: 40px 0 32px; }
.intro h1 {
  font-size: clamp(28px, 6vw, 42px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 16px;
}
.grad {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.sub {
  font-size: 17px;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 28px;
}
.cta {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  border: none;
  padding: 16px 32px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.badges {
  margin-top: 24px;
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Examples ---------- */
.examples { text-align: center; margin-top: 40px; }
.examples .label { color: var(--text-muted); margin-bottom: 12px; font-size: 14px; }
.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.chip {
  background: white;
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-1px); }
.chip.selected { background: var(--primary); color: white; border-color: var(--primary); }

/* ---------- Progress ---------- */
.progress {
  margin-bottom: 28px;
  position: relative;
}
.progress::before {
  content: '';
  display: block;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
}
.progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 8px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 999px;
  width: 0%;
  transition: width 0.3s;
}
.progress-text {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

/* ---------- Quiz ---------- */
#quiz-content h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
#quiz-content .quiz-sub {
  color: var(--text-muted);
  margin-bottom: 24px;
}
.options {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}
.option {
  background: white;
  border: 2px solid var(--border);
  padding: 18px 14px;
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
  font-weight: 500;
}
.option .emoji { font-size: 32px; display: block; margin-bottom: 6px; }
.option:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow); }
.option.selected {
  border-color: var(--primary);
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(245, 158, 11, 0.05));
  color: var(--primary);
}
.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.btn-primary, .btn-secondary {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); transform: translateY(-1px); }
.btn-primary:disabled { background: var(--border); color: var(--text-muted); cursor: not-allowed; }
.btn-secondary {
  background: white;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- Results ---------- */
.results-header { text-align: center; margin-bottom: 28px; }
.results-header h2 {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.results-list { display: grid; gap: 16px; margin-bottom: 32px; }
.gift-card {
  background: white;
  border-radius: var(--radius);
  padding: 20px;
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 16px;
  align-items: center;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.gift-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.gift-card .ad-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(245, 158, 11, 0.15);
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}
.gift-emoji {
  font-size: 48px;
  text-align: center;
}
.gift-info h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.gift-info p {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 8px;
}
.gift-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
}
.gift-meta span {
  background: rgba(124, 58, 237, 0.08);
  color: var(--primary);
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.gift-action {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.gift-btn {
  background: linear-gradient(135deg, #ff9900, #ff6600);
  color: white;
  border: none;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  transition: transform 0.2s;
}
.gift-btn:hover { transform: translateY(-1px); text-decoration: none; color: white; }
.gift-btn.alt {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}

@media (max-width: 540px) {
  .gift-card {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .gift-action { flex-direction: row; justify-content: center; }
}

.results-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.disclaimer {
  background: rgba(245, 158, 11, 0.08);
  border-left: 3px solid var(--accent);
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ---------- About ---------- */
#screen-about h2 { font-size: 28px; font-weight: 800; margin-bottom: 16px; letter-spacing: -0.02em; }
#screen-about h3 { font-size: 18px; font-weight: 700; margin-top: 24px; margin-bottom: 8px; }
#screen-about p { margin-bottom: 12px; color: var(--text); }

/* ---------- Footer ---------- */
footer {
  text-align: center;
  padding: 32px 20px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
footer a { color: var(--text-muted); margin: 0 4px; }
footer a:hover { color: var(--primary); }
.version-badge {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.7;
  letter-spacing: 0.02em;
}

/* ---------- Loading ---------- */
.loading {
  text-align: center;
  padding: 60px 20px;
}
.spinner {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Multi-select grid */
.options.multi .option::after {
  content: '';
  display: block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-radius: 4px;
  margin: 8px auto 0;
}
.options.multi .option.selected::after {
  content: '✓';
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  font-size: 13px;
  font-weight: 700;
  line-height: 14px;
  text-align: center;
}

/* ---------- v1.1: Saison-Banner ---------- */
.season-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(245,158,11,0.12));
  border: 1px solid rgba(124,58,237,0.2);
  border-radius: 14px;
  padding: 14px 18px;
  text-align: center;
  font-size: 15px;
  margin-bottom: 8px;
  animation: fadeIn 0.5s ease;
}
.season-cta {
  display: inline-block;
  margin-left: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 7px 16px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s;
}
.season-cta:hover { transform: translateY(-1px); }

/* ---------- Merklisten-Button (Topbar) ---------- */
.fav-btn { position: relative; font-size: 16px; }
.fav-count {
  position: absolute;
  top: 0; right: 2px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------- Skip / Mehr-Button ---------- */
.btn-skip {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 14px 12px;
  text-decoration: underline;
}
.btn-skip:hover { color: var(--primary); }
.more-wrap { text-align: center; margin-bottom: 24px; }
#btn-more { padding: 14px 28px; }

/* ---------- Budget-Switcher (Ergebnis-Seite) ---------- */
.budget-switch {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 14px;
}
.budget-switch .chip { padding: 7px 12px; font-size: 13px; }

/* ---------- Gift-Card: Badges, Herz, Bestseller, Match ---------- */
.gift-card { animation: cardIn 0.4s ease backwards; animation-delay: calc(var(--card-i, 0) * 0.05s); }
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.gift-card.is-bestseller {
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.12);
}
.card-badges {
  position: absolute;
  top: 8px;
  left: 8px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  z-index: 2;
}
.match-badge {
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.best-badge {
  background: linear-gradient(135deg, #ff9900, #ff6600);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.fav-heart {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(255,255,255,0.9);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s, background 0.2s;
  z-index: 2;
  line-height: 1;
}
.fav-heart:hover { transform: scale(1.12); }
.fav-heart.active { background: rgba(239, 68, 68, 0.12); border-color: rgba(239,68,68,0.3); animation: heartPop 0.3s ease; }
@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ---------- Kategorie-Farbkacheln hinter den Emojis ---------- */
.gift-emoji {
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 38px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ede9fe, #fce7f3);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
}
.gift-emoji[data-cat="tech"], .gift-emoji[data-cat="auto"]   { background: linear-gradient(135deg, #dbeafe, #ede9fe); }
.gift-emoji[data-cat="food"], .gift-emoji[data-cat="men"]    { background: linear-gradient(135deg, #fef3c7, #ffedd5); }
.gift-emoji[data-cat="wellness"], .gift-emoji[data-cat="eco"]{ background: linear-gradient(135deg, #d1fae5, #ecfccb); }
.gift-emoji[data-cat="book"], .gift-emoji[data-cat="office"] { background: linear-gradient(135deg, #e0e7ff, #dbeafe); }
.gift-emoji[data-cat="sport"], .gift-emoji[data-cat="travel"]{ background: linear-gradient(135deg, #cffafe, #d1fae5); }
.gift-emoji[data-cat="home"], .gift-emoji[data-cat="garden"] { background: linear-gradient(135deg, #ecfccb, #fef9c3); }
.gift-emoji[data-cat="exp"], .gift-emoji[data-cat="music"]   { background: linear-gradient(135deg, #fae8ff, #ede9fe); }
.gift-emoji[data-cat="kid"], .gift-emoji[data-cat="baby"], .gift-emoji[data-cat="game"] { background: linear-gradient(135deg, #ffe4e6, #fce7f3); }
.gift-emoji[data-cat="fashion"], .gift-emoji[data-cat="perso"] { background: linear-gradient(135deg, #fce7f3, #fae8ff); }
.gift-emoji[data-cat="univ"], .gift-emoji[data-cat="pet"]    { background: linear-gradient(135deg, #fef9c3, #ffedd5); }

/* Etwas mehr Platz, damit Badges/Herz nicht mit Text kollidieren */
.gift-card { padding-top: 26px; }
.gift-info { padding-bottom: 4px; }
@media (max-width: 540px) {
  .fav-heart { bottom: auto; top: 8px; right: 8px; }
  .gift-card { padding-top: 40px; }
}
