:root {
  color-scheme: light dark;
  --bg: #f8f4ee;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #fffdf9;
  --surface-soft: #f2ebe2;
  --text: #27221f;
  --muted: #756b64;
  --line: rgba(66, 50, 42, .13);
  --accent: #9e5d64;
  --accent-strong: #7f4149;
  --accent-soft: #f2dfe1;
  --success: #367257;
  --success-soft: #e7f3ec;
  --shadow: 0 20px 55px rgba(71, 47, 37, .12);
  --shadow-soft: 0 8px 24px rgba(71, 47, 37, .08);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --max: 1180px;
  font-family: Inter, ui-rounded, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  --bg: #121110;
  --surface: rgba(29, 27, 25, .82);
  --surface-solid: #1d1b19;
  --surface-soft: #26221f;
  --text: #f8f1ea;
  --muted: #b7aca4;
  --line: rgba(255, 255, 255, .1);
  --accent: #d58c93;
  --accent-strong: #eba2a9;
  --accent-soft: #3a272a;
  --success: #75bb94;
  --success-soft: #1c3026;
  --shadow: 0 24px 70px rgba(0, 0, 0, .38);
  --shadow-soft: 0 8px 24px rgba(0, 0, 0, .22);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg: #121110;
    --surface: rgba(29, 27, 25, .82);
    --surface-solid: #1d1b19;
    --surface-soft: #26221f;
    --text: #f8f1ea;
    --muted: #b7aca4;
    --line: rgba(255, 255, 255, .1);
    --accent: #d58c93;
    --accent-strong: #eba2a9;
    --accent-soft: #3a272a;
    --success: #75bb94;
    --success-soft: #1c3026;
    --shadow: 0 24px 70px rgba(0, 0, 0, .38);
    --shadow-soft: 0 8px 24px rgba(0, 0, 0, .22);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.ambient {
  position: fixed;
  width: 34rem;
  height: 34rem;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .2;
  pointer-events: none;
  z-index: -1;
}
.ambient-one { top: -15rem; right: -12rem; background: #d99da3; }
.ambient-two { bottom: -18rem; left: -14rem; background: #ddc09f; }

.topbar {
  width: min(var(--max), calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
  letter-spacing: -.02em;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: white;
  background: var(--accent);
  border-radius: 50% 50% 46% 54%;
  box-shadow: var(--shadow-soft);
}
.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--text);
  background: var(--surface);
  backdrop-filter: blur(12px);
  cursor: pointer;
}
.icon-button:hover { border-color: var(--accent); }
.theme-icon { font-size: 1.2rem; }

main {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 64px;
}
.hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, .85fr);
  align-items: center;
  gap: clamp(30px, 7vw, 90px);
  padding: clamp(44px, 8vw, 100px) 0 72px;
}
.eyebrow, .section-kicker {
  margin: 0 0 12px;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: .17em;
  font-size: .75rem;
  font-weight: 850;
}
h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3rem, 7vw, 6.7rem);
  line-height: .94;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.lead {
  max-width: 680px;
  margin: 28px 0 24px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.27rem);
  line-height: 1.65;
}
.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 28%, transparent);
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 750;
}
.hero-art { position: relative; min-height: 420px; }
.photo-stack {
  position: absolute;
  inset: 50% auto auto 50%;
  width: min(330px, 85%);
  aspect-ratio: 4 / 5;
  border: 10px solid var(--surface-solid);
  border-bottom-width: 48px;
  border-radius: 8px;
  box-shadow: var(--shadow);
}
.photo-back {
  background: linear-gradient(145deg, #d7b4a7, #8a645e);
  transform: translate(-60%, -51%) rotate(-9deg);
}
.photo-front {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: white;
  background: linear-gradient(145deg, #bf7c83, #72454a);
  transform: translate(-39%, -48%) rotate(5deg);
  text-align: center;
}
.photo-front > span { font-size: 4rem; }
.photo-front small { max-width: 180px; font-size: 1rem; font-weight: 700; }

.content-section {
  padding: clamp(28px, 5vw, 60px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}
h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 4vw, 3.5rem);
  line-height: 1;
  letter-spacing: -.035em;
}
.count-badge {
  flex: none;
  margin: 0;
  padding: 9px 13px;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 750;
}
.notice {
  display: flex;
  align-items: center;
  gap: 11px;
  margin-bottom: 24px;
  padding: 14px 16px;
  color: var(--success);
  background: var(--success-soft);
  border: 1px solid color-mix(in srgb, var(--success) 24%, transparent);
  border-radius: var(--radius-md);
  line-height: 1.4;
}
.notice-icon {
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  color: var(--surface-solid);
  background: var(--success);
  border-radius: 50%;
  font-weight: 900;
}
.challenge-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  min-height: 230px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  overflow: hidden;
}
.card::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -55px;
  bottom: -60px;
  background: var(--accent-soft);
  border-radius: 50%;
}
.card-number {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 28px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 12px;
  font-size: .88rem;
  font-weight: 850;
}
.card strong { margin-bottom: 8px; font-size: 1.2rem; line-height: 1.25; }
.card-description { color: var(--muted); font-size: .95rem; line-height: 1.5; }
.card-action {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding-top: 18px;
  color: var(--accent-strong);
  font-weight: 850;
}
.skeleton-card {
  min-height: 230px;
  border-radius: var(--radius-lg);
  background: linear-gradient(100deg, var(--surface-soft) 30%, var(--surface-solid) 50%, var(--surface-soft) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s infinite;
}
.error-state {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: var(--muted);
  background: var(--surface-soft);
  border-radius: var(--radius-lg);
}

footer {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 36px;
  display: flex;
  justify-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: .88rem;
}

dialog {
  width: min(620px, calc(100% - 28px));
  max-height: min(92dvh, 820px);
  padding: 0;
  color: var(--text);
  background: var(--surface-solid);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: 0 30px 100px rgba(0, 0, 0, .38);
  overflow: auto;
}
dialog::backdrop { background: rgba(18, 13, 12, .7); backdrop-filter: blur(7px); }
form { padding: clamp(22px, 5vw, 36px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.close { flex: none; font-size: 1.7rem; }
.dialog-description { margin: 16px 0 0; color: var(--muted); line-height: 1.55; }
.filebox {
  min-height: 165px;
  margin: 24px 0 16px;
  padding: 24px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  text-align: center;
  color: var(--text);
  background: var(--surface-soft);
  border: 2px dashed color-mix(in srgb, var(--accent) 55%, var(--line));
  border-radius: var(--radius-lg);
  cursor: pointer;
}
.filebox:hover { background: var(--accent-soft); }
.filebox input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.filebox > span:last-of-type { color: var(--muted); font-size: .84rem; }
.camera-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: white;
  background: var(--accent);
  border-radius: 15px;
  font-size: 1.8rem;
}
.preview:empty { display: none; }
.preview { position: relative; margin-bottom: 16px; }
.preview img { width: 100%; max-height: 360px; display: block; object-fit: contain; background: #000; border-radius: var(--radius-lg); }
.preview-meta { margin: 8px 2px 0; color: var(--muted); font-size: .82rem; }
.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.5;
}
.consent input { flex: 0 0 auto; width: 20px; height: 20px; margin-top: 2px; accent-color: var(--accent); }
.primary {
  width: 100%;
  min-height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: white;
  background: var(--accent-strong);
  border: 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
  font-weight: 850;
  cursor: pointer;
}
.primary:hover { filter: brightness(1.06); }
.primary:disabled { opacity: .58; cursor: wait; }
#status { min-height: 1.4em; margin: 14px 0 0; text-align: center; font-weight: 750; }
#status.success { color: var(--success); }
#status.error { color: #c34f58; }

@keyframes shimmer { to { background-position-x: -300%; } }
@media (prefers-reduced-motion: no-preference) {
  .card, .icon-button, .primary, .filebox { transition: transform .18s ease, border-color .18s ease, background .18s ease, filter .18s ease; }
  .card:hover { transform: translateY(-5px); border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
  .card:active, .primary:active { transform: scale(.985); }
  dialog[open] { animation: dialog-in .22s ease-out; }
  @keyframes dialog-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 52px; }
  .hero-copy { text-align: center; }
  .lead { margin-left: auto; margin-right: auto; }
  .hero-art { min-height: 330px; }
  .photo-stack { width: min(260px, 67%); }
  .challenge-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .topbar, main, footer { width: min(100% - 24px, var(--max)); }
  .topbar { min-height: 64px; }
  .brand { font-size: .95rem; }
  .hero { padding: 36px 0 48px; gap: 18px; }
  h1 { font-size: clamp(2.75rem, 15vw, 4.4rem); }
  .lead { margin-top: 20px; font-size: 1rem; }
  .privacy-pill { font-size: .8rem; }
  .hero-art { min-height: 285px; }
  .photo-stack { width: min(215px, 69%); border-width: 7px; border-bottom-width: 38px; }
  .content-section { padding: 22px 16px 18px; border-radius: 24px; }
  .section-heading { align-items: flex-start; }
  .section-heading h2 { font-size: 2.25rem; }
  .count-badge { margin-top: 2px; white-space: nowrap; }
  .notice { align-items: flex-start; font-size: .86rem; }
  .challenge-grid { grid-template-columns: 1fr; gap: 12px; }
  .card { min-height: 190px; padding: 19px; }
  .card-number { margin-bottom: 20px; }
  dialog { width: 100%; max-width: none; max-height: 94dvh; margin: auto 0 0; border-radius: 26px 26px 0 0; }
  form { padding: 22px 18px max(24px, env(safe-area-inset-bottom)); }
  .filebox { min-height: 145px; padding: 18px; }
}

@media (max-width: 390px) {
  .section-heading { display: block; }
  .count-badge { display: inline-block; margin-top: 12px; }
}

/* Personal score and completion state */
.section-stats { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.score-card { display: flex; align-items: center; gap: 9px; min-height: 42px; padding: 7px 13px; border: 1px solid var(--line); border-radius: 999px; background: color-mix(in srgb, var(--surface) 88%, transparent); box-shadow: var(--shadow-soft); }
.score-label { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.score-card strong { color: var(--accent); font-variant-numeric: tabular-nums; }
.card-points { display: inline-flex; align-items: center; align-self: flex-start; margin: 12px 0 2px; padding: 5px 9px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 11%, transparent); color: var(--accent); font-size: .8rem; font-weight: 800; }
.card.completed { border-color: color-mix(in srgb, #3c9b67 45%, var(--line)); }
.card.completed::before { content: '✓ Erledigt'; position: absolute; top: 18px; right: 18px; padding: 5px 8px; border-radius: 999px; background: color-mix(in srgb, #3c9b67 15%, var(--surface)); color: #278253; font-size: .75rem; font-weight: 800; }
.card.completed .card-action { color: var(--muted); }
.dialog-points { display: inline-flex; width: fit-content; margin: 0 0 16px; padding: 6px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); font-weight: 800; }
.score-pop { animation: scorePop .55s ease; }
@keyframes scorePop { 0% { transform: scale(1); } 45% { transform: scale(1.18); } 100% { transform: scale(1); } }
@media (max-width: 620px) { .section-heading { align-items: flex-start; } .section-stats { justify-content: flex-start; } .score-card { order: -1; } }

.leaderboard {
  margin: 1rem 0 1.4rem;
  padding: clamp(1rem, 2.5vw, 1.4rem);
  border: 1px solid var(--border);
  border-radius: 24px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  box-shadow: var(--shadow-sm);
}
.leaderboard-head { display:flex; align-items:end; justify-content:space-between; gap:1rem; margin-bottom:.9rem; }
.leaderboard-head h3 { margin:.1rem 0 0; font-size:clamp(1.25rem, 3vw, 1.65rem); }
.leaderboard-privacy { font-size:.78rem; font-weight:800; padding:.4rem .65rem; border-radius:999px; background:var(--surface-strong); color:var(--muted); border:1px solid var(--border); }
.leaderboard-list { display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:.7rem; }
.leaderboard-row { min-height:84px; display:flex; flex-direction:column; justify-content:center; gap:.35rem; padding:.9rem; border-radius:18px; background:var(--surface-strong); border:1px solid var(--border); }
.leaderboard-row span { color:var(--muted); font-size:.84rem; font-weight:700; }
.leaderboard-row strong { font-size:clamp(1.15rem, 4vw, 1.55rem); }
.leaderboard-row:first-child { transform:translateY(-3px); }
.leaderboard-row.placeholder { opacity:.65; }
@media (max-width: 620px) {
  .leaderboard-list { grid-template-columns:1fr; }
  .leaderboard-row { min-height:58px; flex-direction:row; align-items:center; justify-content:space-between; }
  .leaderboard-row:first-child { transform:none; }
}

.cookie-gate{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:20px;background:rgba(10,9,9,.78);backdrop-filter:blur(12px)}
.cookie-gate[hidden]{display:none}.cookie-card{width:min(560px,100%);padding:28px;border:1px solid var(--border,#493d3d);border-radius:28px;background:var(--surface,#211d1b);box-shadow:0 28px 80px rgba(0,0,0,.4);display:grid;gap:18px}.cookie-card h2{margin:0 0 8px}.cookie-card p{margin:0;line-height:1.6}.cookie-icon{font-size:2rem}.cookie-card .primary{width:100%}.consent-saved{padding:14px 16px;border-radius:16px;background:rgba(63,168,112,.15);border:1px solid rgba(63,168,112,.35);color:#75d6a0;font-weight:700}
