/*
 * Circular Quest — Brand-Design nach circularquest.ch
 * Farben/Typo extrahiert von der Live-Site (Juli 2026):
 *   Hintergrund #FAFAFA, Grün #72BE89, Orange #E69F5C, Pink #D9848F,
 *   Border-Dunkelblau #203152, Text #121415, Montserrat 800 für Titel,
 *   Pill-Buttons mit 2px Border, 3D-Disc- und Punktkreis-Motive.
 */

:root {
  --bg: #FAFAFA;
  --ink: #121415;
  --green: #72BE89;
  --green-dark: #4d9c68;
  --orange: #E69F5C;
  --pink: #D9848F;
  --border-dark: #203152;
  --card: #ffffff;
  --muted: #5c5f61;
  --ok: #2e7d32;
  --bad: #c0392b;
  --radius: 20px;
  --shadow: 0 2px 0 var(--ink);
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding-bottom: env(safe-area-inset-bottom);
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 16px;
  padding-top: max(16px, env(safe-area-inset-top));
  overflow-x: hidden;
}

.loading { text-align: center; color: var(--muted); margin-top: 48px; font-weight: 600; }

/* ---------- typography ---------- */

h1, h2, h3, .xbold { font-weight: 800; letter-spacing: -0.02em; }
h1 { font-size: clamp(2rem, 9vw, 2.9rem); line-height: 1.05; margin: 0 0 10px; }
h2 { font-size: 1.35rem; line-height: 1.15; margin: 0 0 10px; }
h3 { font-size: 1.02rem; margin: 0 0 8px; }
p  { line-height: 1.55; margin: 0 0 10px; }
.small { font-size: 0.82rem; color: var(--muted); }

/* Hand-drawn-style highlight (green ellipse underline, wie auf der Website) */
.hl {
  background: linear-gradient(transparent 62%, rgba(114,190,137,0.55) 62%, rgba(114,190,137,0.55) 92%, transparent 92%);
  padding: 0 2px;
}

/* ---------- buttons: pills with dark border (brand) ---------- */

button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--green);
  color: var(--ink);
  border: 2px solid var(--border-dark);
  border-radius: 300px;
  padding: 13px 26px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--border-dark);
  transition: transform .08s ease, box-shadow .08s ease;
  -webkit-tap-highlight-color: transparent;
}
button:active { transform: translateY(3px); box-shadow: 0 0 0 var(--border-dark); }
button.secondary { background: #fff; }
button.orange { background: var(--orange); }
button.tiny { padding: 6px 12px; font-size: .85rem; box-shadow: 0 2px 0 var(--border-dark); }
button:disabled { opacity: .45; cursor: default; }
button.block { width: 100%; }

/* ---------- cards ---------- */

.card {
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 3px 0 var(--ink);
  animation: cardIn .35s ease both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.card.green  { background: var(--green); }
.card.orange { background: var(--orange); }
.card.pink   { background: var(--pink); }
.card .meta { color: var(--muted); font-size: .8rem; }

/* ---------- landing ---------- */

.landing-hero { position: relative; padding: 26px 0 10px; }
.landing-hero .logo { width: 190px; height: auto; display: block; margin-bottom: 26px; }

.hero-discs {
  position: absolute;
  top: -10px; right: -70px;
  width: 220px; height: 230px;
  z-index: -1;
  opacity: .95;
}

.fact-row { display: flex; gap: 10px; margin: 18px 0 6px; flex-wrap: wrap; }
.fact {
  flex: 1 1 30%;
  min-width: 96px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 3px 0 var(--ink);
  padding: 12px 10px;
  text-align: center;
}
.fact .num { font-weight: 800; font-size: 1.35rem; display: block; }
.fact .lbl { font-size: .72rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

.steps { margin: 10px 0 4px; }
.step { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 14px; }
.step .n {
  flex: 0 0 40px; height: 40px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.05rem;
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
}
.step:nth-child(1) .n { background: var(--green); }
.step:nth-child(2) .n { background: var(--orange); }
.step:nth-child(3) .n { background: var(--pink); }
.step p { margin: 0; font-size: .92rem; }
.step b { display: block; }

input[type="text"], input[type="number"] {
  width: 100%;
  padding: 13px 16px;
  border-radius: 300px;
  border: 2px solid var(--ink);
  margin-bottom: 12px;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
}
input:focus { outline: 3px solid rgba(114,190,137,.5); }

.footer-note { text-align: center; margin: 22px 0 8px; }
.footer-note a { color: var(--muted); font-size: .78rem; text-decoration: none; font-weight: 600; }

/* ---------- app header ---------- */

header.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  gap: 10px;
}
header.app-header .logo-mini { height: 40px; width: auto; }
.points-badge {
  background: var(--ink);
  color: #fff;
  border-radius: 300px;
  padding: 7px 16px;
  font-weight: 800;
  font-size: .95rem;
  white-space: nowrap;
  transition: transform .15s ease;
}
.points-badge.bump { animation: bump .45s ease; }
@keyframes bump { 30% { transform: scale(1.25) rotate(-3deg); background: #4d9c68; } }

.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }

/* ---------- quest path (overview) ---------- */

.path { position: relative; margin: 8px 0 20px; padding-left: 6px; }
.path::before {
  content: "";
  position: absolute;
  left: 33px; top: 30px; bottom: 30px;
  border-left: 3px dotted var(--ink);
  opacity: .4;
}
.path-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.path-item .disc {
  flex: 0 0 56px;
  height: 56px;
  position: relative;
  z-index: 1;
}
/* 3D disc: colored top on black extruded side (brand motif) */
.path-item .disc .top {
  position: absolute; inset: 0 0 8px 0;
  border-radius: 50%;
  border: 2px solid var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
  background: var(--green);
}
.path-item .disc::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0; height: 22px;
  border-radius: 50%;
  background: var(--ink);
  z-index: -1;
}
.path-item:nth-child(3n+2) .disc .top { background: var(--orange); }
.path-item:nth-child(3n+0) .disc .top { background: var(--pink); }

.path-item .info { flex: 1; min-width: 0; }
.path-item .info .name { font-weight: 800; font-size: 1.02rem; line-height: 1.2; }
.path-item .info .status { font-size: .78rem; color: var(--muted); font-weight: 600; }
.path-item .chev { font-size: 1.5rem; font-weight: 800; opacity: .5; }
.path-item.done .disc .top { background: var(--green); }
.path-item.done .disc .top::after { content: "✓"; position: absolute; right: -2px; top: -6px; background: var(--ink); color: #fff; width: 20px; height: 20px; border-radius: 50%; font-size: .75rem; display: flex; align-items: center; justify-content: center; }
.path-item.current .info .name { text-decoration: underline 3px var(--green); text-underline-offset: 4px; }
.path-item.current .disc { animation: floaty 2.4s ease-in-out infinite; }
@keyframes floaty { 50% { transform: translateY(-5px); } }

/* ---------- posten screen ---------- */

.posten-title { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; }
.posten-title .idx {
  background: var(--orange);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; flex: 0 0 42px;
}

.gpass { border: 2px solid var(--ink); border-radius: var(--radius); overflow: hidden; margin-bottom: 14px; box-shadow: 0 3px 0 var(--ink); animation: cardIn .35s ease both; }
.gpass .gpass-head { background: var(--ink); color: #fff; padding: 10px 16px; font-weight: 800; letter-spacing: .05em; font-size: .85rem; text-transform: uppercase; }
.gpass .gpass-body { background: #fff; padding: 14px 16px; }
.gpass .row { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #d8d8d8; font-size: .9rem; }
.gpass .row:last-child { border-bottom: none; }
.gpass .row .ico { flex: 0 0 26px; text-align: center; }

.block-label {
  display: inline-block;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: 3px 10px;
  border-radius: 300px;
  border: 1.5px solid var(--ink);
  margin-bottom: 8px;
  background: var(--bg);
}
.block-label.q { background: var(--green); }
.block-label.challenge { background: var(--orange); }
.block-label.booklet { background: var(--pink); }

/* ---------- questions ---------- */

.option-row {
  display: flex; align-items: center; gap: 10px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  padding: 11px 14px;
  margin-bottom: 8px;
  background: #fff;
  cursor: pointer;
  font-weight: 600;
  font-size: .92rem;
  transition: background .12s ease;
}
.option-row.on { background: var(--green); }
.option-row input { display: none; }

.tf-row { display: flex; gap: 10px; }
.tf-row button { flex: 1; }
.tf-row button.on { background: var(--green); }
.tf-row button.on.false { background: var(--pink); }

.sort-item {
  display: flex; align-items: center; justify-content: space-between;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  padding: 9px 9px 9px 14px;
  margin-bottom: 8px;
  font-weight: 600; font-size: .9rem;
  gap: 8px;
}
.sort-item .btns { display: flex; gap: 6px; flex: 0 0 auto; }

.match-row {
  display: flex; flex-direction: column; gap: 6px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  padding: 11px 14px;
  margin-bottom: 8px;
  font-weight: 600; font-size: .9rem;
}
.match-row select {
  font-family: inherit; font-weight: 600;
  padding: 8px 12px;
  border-radius: 300px;
  border: 2px solid var(--ink);
  background: var(--bg);
  font-size: .88rem;
}

.feedback { font-weight: 800; margin-top: 10px; font-size: 1rem; }
.feedback.correct { color: var(--ok); }
.feedback.incorrect { color: var(--bad); }

.actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* photo challenge */
.photo-drop {
  border: 2px dashed var(--ink);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  background: #fff;
  margin-top: 6px;
}
.photo-drop img { max-width: 100%; border-radius: 12px; margin-top: 10px; }

/* media */
.media img, .media video { width: 100%; border-radius: 14px; border: 2px solid var(--ink); }
.media audio { width: 100%; }

/* ---------- unlock screen ---------- */

.unlock-hero { text-align: center; padding: 8px 0 4px; }
.unlock-hero .pin {
  font-size: 3rem; display: inline-block;
  animation: floaty 2s ease-in-out infinite;
}
#unlock-status { min-height: 1.3em; font-weight: 600; margin: 10px 0; }
#unlock-status.err { color: var(--bad); }

/* ---------- confetti ---------- */

.confetti {
  position: fixed;
  width: 10px; height: 14px;
  top: -20px;
  z-index: 999;
  pointer-events: none;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .7; }
}

.points-fly {
  position: fixed;
  z-index: 999;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--green-dark);
  pointer-events: none;
  animation: flyUp 1s ease-out forwards;
}
@keyframes flyUp { to { transform: translateY(-70px); opacity: 0; } }

/* ---------- maps (Leaflet) ---------- */

.route-map, .unlock-map {
  height: 300px;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 3px 0 var(--ink);
  margin-bottom: 14px;
  z-index: 0;
}
.unlock-map { height: 220px; margin: 12px 0; }

.map-num-icon {
  background: var(--green);
  border: 2px solid var(--ink);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 14px; color: var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  font-family: "Montserrat", sans-serif;
}
.map-num-icon.done { background: #cfcfcf; }

/* completion banner */
.done-banner {
  background: var(--green);
  border: 2px solid var(--ink);
  box-shadow: 0 3px 0 var(--ink);
  border-radius: var(--radius);
  text-align: center;
  padding: 22px 16px;
  margin-bottom: 14px;
}
.done-banner .big { font-size: 2.2rem; }
