/* Etappe – Weg & Gipfel: Kartenpapier mit Höhenlinien, warme Morgenfarben,
   Wegweiser-Gelb und Schrift wie auf Wanderschildern. */

:root {
  color-scheme: light;

  --ink: #25304a;
  --ink-soft: #55607b;
  --paper: #fbf6ec;
  --card: #fffdf8;
  --sand: #efe5d2;
  --line: #d9cbb3;
  --sign: #f7c84a;
  --sign-deep: #d9a521;
  --dawn: #ffd9a8;
  --glow: #ffb48c;
  --lake: #2a7f89;
  --lake-soft: #cfe8e9;
  --rose: #f6c6cf;
  --lilac: #d9d3f3;
  --sky: #cfe3f7;

  --radius: 18px;
  --edge: 1.5px;
  --ease: cubic-bezier(.3, 1.4, .5, 1);
  /* Schilder-Schrift, wie sie die Geräte mitbringen – so lädt die App nichts von fremden Servern. */
  --font-sign: "DIN Condensed", "DIN Alternate", Bahnschrift, "Roboto Condensed", "sans-serif-condensed", "Arial Narrow", system-ui, sans-serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Basis ---------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100svh;
  overflow-x: clip;
  font: 400 1.03rem/1.45 var(--font);
  color: var(--ink);
  /* Höhenlinien wie auf einer Wanderkarte */
  background: var(--paper) url("karte.svg") 0 0 / 480px 480px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, p, dl, dd, ul, figure, fieldset, legend {
  margin: 0;
  padding: 0;
}

ul {
  list-style: none;
}

fieldset {
  min-width: 0;
  border: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid var(--lake);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* ---------- Grundgerüst ---------- */

.app {
  width: min(100%, 30rem);
  margin-inline: auto;
  padding: calc(env(safe-area-inset-top) + 12px) 16px calc(env(safe-area-inset-bottom) + 96px);
}

.top {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 1.9rem/1 var(--font-sign);
  letter-spacing: .09em;
  text-transform: uppercase;
}

.logo__mark {
  width: 30px;
  height: 30px;
}

.view {
  display: grid;
  gap: 14px;
}

.view > * {
  min-width: 0;
}

.card {
  padding: 16px 18px;
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
}

.card h2,
.card h3,
.sheet h2,
.tour h2 {
  font: 700 1.45rem/1.15 var(--font-sign);
  letter-spacing: .01em;
}

.eyebrow {
  font: 700 .85rem/1.2 var(--font-sign);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.empty {
  padding: 16px;
  text-align: center;
  color: var(--ink-soft);
  background: var(--card);
  border: var(--edge) dashed var(--line);
  border-radius: var(--radius);
}

/* ---------- Buttons ---------- */

/* Wie ein Emailleschild: feiner Rand, eine harte Kante nach unten. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 13px;
  box-shadow: 0 3px 0 var(--ink);
  transition: translate .08s, box-shadow .08s;
}

.btn:active {
  translate: 0 2px;
  box-shadow: 0 1px 0 var(--ink);
}

/* Wegweiser-Gelb trägt die wichtigsten Knöpfe. */
.btn--sign {
  background: var(--sign);
}

.btn--small {
  min-height: 38px;
  padding: 5px 13px;
  font-size: .95rem;
}

/* Löschen ist endgültig: dunkel statt bunt. */
.btn--danger {
  color: var(--paper);
  background: var(--ink);
  box-shadow: 0 3px 0 var(--ink-soft);
}

.btn--danger:active {
  box-shadow: 0 1px 0 var(--ink-soft);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

/* ---------- Fortschrittsbalken ---------- */

.meter {
  display: block;
  height: 10px;
  overflow: hidden;
  background: var(--sand);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
}

.meter > span {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  background: var(--sign);
  transition: width .6s var(--ease);
}

.meter.has-value > span {
  min-width: 8px;
  border-right: var(--edge) solid var(--ink);
}

/* ---------- Heute ---------- */

/* Der Weg zum nächsten Etappenziel: Morgenhimmel, Berge, die Marke auf dem Pfad. */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 22px;
}

.hero__scene {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 360 / 170;
}

.hero__marker {
  transition: transform .9s var(--ease);
}

.hero__count {
  position: absolute;
  top: 12px;
  left: 16px;
}

.hero__num {
  font: 700 clamp(4.4rem, 23vw, 6rem)/.82 var(--font-sign);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  padding-top: .12em;
}

.hero__num.is-pop {
  animation: pop .5s var(--ease);
}

@keyframes pop {
  35% {
    transform: scale(1.22) rotate(-4deg);
  }
}

/* --fit setzt app.js, wenn die Zeile sonst in den Weg oder den Berg hineinliefe. */
.hero__label {
  font: 700 1.05rem/1.2 var(--font-sign);
  font-size: calc(1.05rem * var(--fit, 1));
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero__label.is-tight {
  letter-spacing: .03em;
}

.hero__strip {
  display: grid;
  gap: 7px;
  padding: 10px 16px 13px;
  border-top: var(--edge) solid var(--ink);
}

.hero__goal {
  font-size: .95rem;
}

.hero__goal strong {
  font-weight: 700;
}

/* Nach einem Ausrutscher: was bleibt. */
.hero__kept {
  width: fit-content;
  padding: 2px 11px 3px;
  font-size: .88rem;
  font-weight: 600;
  background: var(--lake-soft);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
}

/* Die tägliche Frage – oder wie es um den heutigen Tag steht. */
.checkin {
  display: grid;
  gap: 4px;
}

.checkin h3 {
  font-size: 1.6rem;
}

.checkin p:not(.eyebrow) {
  margin-top: 2px;
}

.checkin.is-asking {
  background: #fff7dc;
}

.checkin__actions {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.checkin__actions .btn--sign {
  min-height: 54px;
  font-size: 1.15rem;
  font-weight: 700;
}

/* Die Rast: immer in Reichweite, wenn das Verlangen kommt. */
.rast-open {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 13px 16px;
  text-align: left;
  background: linear-gradient(100deg, var(--dawn), var(--glow));
  border: var(--edge) solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 3px 0 var(--ink);
  transition: translate .08s, box-shadow .08s;
}

.rast-open:active {
  translate: 0 2px;
  box-shadow: 0 1px 0 var(--ink);
}

.rast-open__icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  font-size: 1.7rem;
  line-height: 1;
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
}

.rast-open__text {
  display: grid;
  gap: 1px;
}

.rast-open strong {
  font: 700 1.4rem/1.1 var(--font-sign);
  letter-spacing: .01em;
  text-wrap: balance;
}

.rast-open small {
  font-size: .9rem;
  line-height: 1.3;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stat {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  gap: 1px;
  padding: 9px 10px 10px;
  background: var(--card);
  border: var(--edge) solid var(--line);
  border-radius: 14px;
}

.stat dt {
  font-size: .78rem;
  line-height: 1.2;
  color: var(--ink-soft);
}

.stat dd {
  font: 700 1.75rem/1 var(--font-sign);
  font-variant-numeric: tabular-nums;
  padding-top: .1em;
}

.stat dd small {
  font: 600 .82rem/1 var(--font);
  color: var(--ink-soft);
}

/* Der Ausrutscher: klein und ruhig, aber immer da. Keine Warnfarbe. */
.slip {
  justify-self: center;
  padding: 7px 14px;
  font-size: .9rem;
  color: var(--ink-soft);
  background: none;
  border: var(--edge) dashed var(--ink-soft);
  border-radius: 999px;
}

.hint {
  font-size: .92rem;
  line-height: 1.35;
  border-color: var(--line);
}

.hint strong {
  font-weight: 700;
}

.footnote {
  font: 700 .9rem/1.2 var(--font-sign);
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.extras {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
}

.extras button {
  padding: 6px 2px;
  font-size: .92rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
}

/* ---------- Wegmarken ---------- */

.summary {
  display: grid;
  gap: 7px;
}

.summary__note,
.kept-note {
  font-size: .85rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.kept-note {
  margin-top: -6px;
  text-align: center;
}

.badge-sections,
.badges {
  display: grid;
  gap: 12px;
}

.badges {
  margin-top: 6px;
}

.badges h3 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font: 700 1.3rem/1.2 var(--font-sign);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.badges h3 span {
  font: 600 .85rem/1 var(--font);
  letter-spacing: 0;
  color: var(--ink-soft);
}

/* Stempelfarbe je Kategorie */
.tone-streak {
  --tone: var(--glow);
}

.tone-total {
  --tone: var(--sign);
}

.tone-week {
  --tone: var(--lake-soft);
}

.tone-calendar {
  --tone: var(--rose);
}

.tone-season {
  --tone: var(--dawn);
}

.tone-habit {
  --tone: var(--lilac);
}

.tone-rest {
  --tone: var(--sand);
}

.tone-special {
  --tone: var(--sky);
}

.badge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
  gap: 10px;
}

.badge {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 4px;
  padding: 14px 10px 12px;
  text-align: center;
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 16px;
}

/* Ein Stempel wie im Tourenpass: runder Abdruck mit innerem Ring, leicht schief gesetzt. */
.stamp {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 3px;
  font-size: 1.8rem;
  line-height: 1;
  background: var(--tone, var(--sign));
  border: 2px solid var(--ink);
  border-radius: 50%;
  outline: 1.5px dashed var(--ink);
  outline-offset: -7px;
  rotate: -7deg;
}

.badge:nth-child(even) .stamp {
  rotate: 6deg;
}

.stamp--small {
  width: 48px;
  height: 48px;
  margin: 0;
  font-size: 1.4rem;
  outline-offset: -6px;
}

.badge__name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
  -webkit-hyphens: auto;
  hyphens: auto;
}

.badge__desc {
  font-size: .84rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

/* Die Auflösung: wofür es die Wegmarke gab. */
.badge__need {
  font-size: .78rem;
  font-weight: 600;
  line-height: 1.25;
}

.badge__date {
  margin-top: 4px;
  padding: 1px 9px 2px;
  font-size: .76rem;
  font-weight: 600;
  background: var(--tone);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
}

.badge--locked {
  background: none;
  border: var(--edge) dashed var(--line);
}

.badge--locked .badge__name {
  font-weight: 600;
}

.badge--locked .stamp {
  font: 700 1.5rem/1 var(--font-sign);
  color: var(--ink-soft);
  background: none;
  border: 2px dashed var(--line);
  outline: none;
  rotate: none;
}

/* ---------- Tourenbuch ---------- */

/* Monatsansicht: ein Kalenderblatt. Zwischen den Tagen trennt nur ein Spalt, kein Rahmen. */
.cal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cal__head strong {
  font: 700 1.35rem/1.2 var(--font-sign);
  letter-spacing: .04em;
  text-align: center;
}

.cal__nav {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0 0 3px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
}

.cal__nav:disabled {
  cursor: default;
  opacity: .25;
}

.cal__grid {
  width: 100%;
  margin-top: 8px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 4px;
}

.cal__grid th {
  padding: 0 0 2px;
  font-size: .78rem;
  font-weight: 500;
  color: var(--ink-soft);
}

.cal__grid abbr {
  text-decoration: none;
}

.cal__grid td {
  padding: 0;
}

.cal__day {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  font-size: .9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: none;
  border: 0;
  border-radius: 10px;
}

/* Klar: die Farbe eines Bergsees, Ziffern in Weiß. */
.is-clear {
  color: #fff;
  background: var(--lake);
}

/* Ein Punkt: An dem Tag wurde ein Steilstück gemeistert. */
.has-wins::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  background: var(--sign);
  border: 1px solid var(--ink);
  border-radius: 50%;
}

/* Der Aufbruch */
.is-start {
  background: var(--sign);
  box-shadow: inset 0 0 0 var(--edge) var(--ink);
}

/* Tage mit Ausrutscher: neutraler Sand mit feiner Schraffur – erkennbar, aber kein Alarm. */
.is-slip {
  background: repeating-linear-gradient(135deg, var(--sand) 0 5px, #f8f1e3 5px 9px);
}

/* Offen: noch nicht abgehakt. */
.is-open {
  outline: var(--edge) dashed var(--ink-soft);
  outline-offset: -1.5px;
}

/* Vor dem Aufbruch und in der Zukunft bleibt das Blatt leer. */
.cal__day.is-off {
  font-weight: 400;
  color: var(--ink-soft);
  opacity: .55;
}

.cal__day.is-today {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--ink);
}

.cal__day.is-active {
  box-shadow: 0 0 0 2px var(--card), 0 0 0 4.5px var(--glow);
}

.cal__readout {
  min-height: 1.45em;
  margin-top: 10px;
  font-weight: 600;
  text-align: center;
}

.cal__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  margin-top: 8px;
  font-size: .8rem;
  color: var(--ink-soft);
}

.cal__key {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cal__key i {
  position: relative;
  width: 14px;
  height: 14px;
  border-radius: 4px;
}

.cal__key i.has-wins::after {
  top: -3px;
  right: -3px;
  width: 6px;
  height: 6px;
}

.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 6px;
}

.log-head h3 {
  font: 700 1.3rem/1.2 var(--font-sign);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.log-list,
.month,
.days {
  display: grid;
  gap: 8px;
}

.log-list {
  gap: 16px;
}

.month__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font: 700 1.05rem/1.2 var(--font-sign);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.month__title span {
  font: 500 .85rem/1 var(--font);
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
}

.day {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 11px 13px;
  background: var(--card);
  border: var(--edge) solid var(--line);
  border-radius: 16px;
}

.day__wd {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font: 700 1.2rem/1 var(--font-sign);
  padding-top: .12em;
  background: var(--sand);
  border: var(--edge) solid var(--ink);
  border-radius: 12px;
}

.day--weekend .day__wd {
  background: var(--dawn);
}

.day__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  line-height: 1.25;
}

.day__title strong {
  font-weight: 700;
}

.pill {
  padding: 0 8px 1px;
  font-size: .74rem;
  font-weight: 600;
  background: var(--lake-soft);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chips li {
  max-width: 100%;
}

/* Ein Eintrag: Uhrzeit, Art, Notizen und der Stift – die ganze Pille öffnet das Bearbeiten. */
.chip {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 6px;
  max-width: 100%;
  min-height: 34px;
  padding: 3px 10px 3px 12px;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: left;
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 17px;
}

.chip__kind {
  font-weight: 600;
}

/* Ausrutscher: derselbe Sand wie im Kalender. */
.chip--slip {
  background: var(--sand);
}

.chip--late {
  border-style: dashed;
}

/* Lange Notizen rutschen in eine eigene Zeile, statt sich neben die Uhrzeit zu quetschen. */
.chip__note {
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.chip__edit {
  margin-left: auto;
  color: var(--ink-soft);
}

.log-more {
  justify-self: center;
}

.remind p,
.data p {
  margin-top: 4px;
  font-size: .95rem;
}

.data__start + .data__start {
  margin-top: 2px;
}

.data__start strong {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.remind .actions,
.data .actions {
  justify-content: flex-start;
  margin-top: 12px;
}

/* ---------- Navigation ---------- */

.tabbar {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: 0;
  translate: -50% 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: min(100%, 30rem);
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-bottom: 0;
  border-radius: 20px 20px 0 0;
}

.tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 4px 4px 3px;
  font: 700 .82rem/1.15 var(--font-sign);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: none;
  border: 0;
  border-radius: 12px;
}

.tab svg {
  width: 44px;
  height: 30px;
  padding: 3px 10px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  border-radius: 999px;
}

.tab[aria-current] {
  color: var(--ink);
}

.tab[aria-current] svg {
  background: var(--sign);
  box-shadow: inset 0 0 0 var(--edge) var(--ink);
}

/* ---------- Effekte, Toast, Dialoge ---------- */

.fx {
  position: fixed;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}

.fx span,
.unlock__fx span {
  position: absolute;
  font-size: 1.6rem;
  line-height: 1;
}

.toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  translate: -50% 16px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 9px 16px 10px;
  font-size: .95rem;
  text-align: center;
  color: var(--paper);
  background: var(--ink);
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, translate .2s;
}

.toast.is-on {
  translate: -50% 0;
  opacity: 1;
}

.sheet {
  width: min(calc(100% - 32px), 23rem);
  max-height: calc(100% - 32px);
  padding: 22px 20px 20px;
  color: var(--ink);
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink);
}

.sheet--wide {
  width: min(calc(100% - 24px), 26rem);
}

.sheet[open] {
  animation: rise .28s ease-out;
}

.sheet::backdrop,
.unlock::backdrop {
  background: rgba(37, 48, 74, .58);
}

.sheet h2 {
  font-size: 1.6rem;
}

.sheet h3 {
  margin-top: 16px;
  font: 700 1.15rem/1.2 var(--font-sign);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sheet p {
  margin-top: 6px;
}

.field {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  font-size: .95rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  font-size: 1.03rem;
  font-weight: 400;
  background: #fff;
  border: var(--edge) solid var(--ink);
  border-radius: 12px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: .9rem;
}

.check input {
  width: 20px;
  height: 20px;
  accent-color: var(--lake);
}

/* Nachtragen: die Art des Eintrags als Umschalter aus zwei Feldern. */
.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.choice legend {
  margin-bottom: 5px;
  font-size: .95rem;
  font-weight: 600;
}

/* Die Frage, worum es geht: drei Felder untereinander, bequem zu treffen. */
.choice--stack {
  grid-template-columns: 1fr;
}

.choice--stack span {
  min-height: 52px;
  font-size: 1.05rem;
}

.choice label {
  position: relative;
  display: grid;
}

.choice input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.choice span {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 6px 8px;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  background: #fff;
  border: var(--edge) solid var(--ink);
  border-radius: 12px;
}

.choice input:checked + span {
  background: var(--lake-soft);
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.choice input:focus-visible + span {
  outline: 3px solid var(--lake);
  outline-offset: 2px;
}

.sheet .field__error {
  margin-top: 10px;
  padding: 8px 12px;
  font-size: .9rem;
  font-weight: 600;
  background: #fff1c9;
  border: var(--edge) solid var(--ink);
  border-radius: 12px;
}

.sheet .field__note {
  margin-top: 8px;
  font-size: .82rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

/* Erinnerung: zwei Wege, untereinander. */
.ways {
  display: grid;
  margin-top: 16px;
}

.ways .btn {
  margin-top: 12px;
}

.ways .btn:first-child {
  margin-top: 0;
}

/* Hilfsangebote: im Hilfe-Dialog und im letzten Schritt der Tour. */
.offers {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.offers li {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 12px 12px;
  background: #fff;
  border: var(--edge) solid var(--ink);
  border-radius: 14px;
}

.offers strong {
  flex: 1 0 100%;
  font-weight: 700;
  line-height: 1.2;
}

.offers li > span {
  flex: 1 0 100%;
  font-size: .86rem;
  line-height: 1.35;
  color: var(--ink-soft);
}

.offers a {
  margin-top: 4px;
  padding: 4px 12px 5px;
  font-size: .95rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  background: var(--lake-soft);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
}

.facts {
  display: grid;
  gap: 7px;
  margin-top: 8px;
  font-size: .92rem;
  line-height: 1.35;
}

.facts li,
.tour__points li {
  display: grid;
  grid-template-columns: 1.5em minmax(0, 1fr);
}

.facts li::before,
.tour__points li::before {
  content: "⛰️";
  font-size: .85em;
}

@keyframes rise {
  from {
    transform: translateY(14px);
    opacity: 0;
  }
}

/* ---------- Rast ---------- */

.rast {
  display: grid;
  gap: 4px;
  width: min(calc(100% - 20px), 27rem);
}

.rast:not([open]) {
  display: none;
}

.rast__hint {
  color: var(--ink-soft);
}

.rast__box {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-height: 250px;
  align-content: center;
  margin-top: 12px;
}

.rast__meta {
  font: 700 .9rem/1.2 var(--font-sign);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rast__result {
  display: grid;
  gap: 2px;
  margin-top: 14px;
}

.rast .rast__result h3 {
  margin-top: 0;
  font-size: 1.5rem;
  letter-spacing: .01em;
  text-transform: none;
}

.rast__choices {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.rast__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 10px;
  margin-top: 16px;
  padding-top: 10px;
  border-top: var(--edge) solid var(--line);
}

.rast__link {
  padding: 6px 2px;
  font-size: .9rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
}

.is-wrong {
  animation: wobble .3s ease-in-out;
}

@keyframes wobble {
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Durchatmen: Der Kreis wächst beim Einatmen und sinkt beim Ausatmen. */
.atem {
  position: relative;
  display: grid;
  place-items: center;
  width: 210px;
  height: 210px;
}

.atem__ring {
  position: absolute;
  inset: 0;
  background: radial-gradient(var(--dawn), var(--glow));
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
  transform: scale(.55);
  transition: transform 1s ease-in-out;
}

.atem__ring.is-in,
.atem__ring.is-hold {
  transform: scale(1);
  transition-duration: 4s;
}

.atem__ring.is-out {
  transform: scale(.55);
  transition-duration: 6s;
}

.atem__word {
  position: relative;
  font: 700 1.5rem/1 var(--font-sign);
  letter-spacing: .06em;
}

/* Zahlenfeld */
.zahlen {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(100%, 280px);
}

.zahlen button,
.paare button {
  aspect-ratio: 1;
  padding: 0;
  font: 700 1.5rem/1 var(--font-sign);
  background: #fff;
  border: var(--edge) solid var(--ink);
  border-radius: 12px;
}

.zahlen button:disabled {
  color: var(--ink-soft);
  background: var(--lake-soft);
  border-style: dashed;
  opacity: .6;
}

/* Paare finden */
.paare {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: min(100%, 290px);
}

.paare button {
  color: var(--ink-soft);
  background: var(--sand);
}

.paare button.is-up {
  font-size: 1.7rem;
  background: #fff;
}

.paare button:disabled {
  background: var(--lake-soft);
}

/* Rückwärts rechnen */
.rechnen__frage {
  font: 700 2.6rem/1 var(--font-sign);
  font-variant-numeric: tabular-nums;
}

.rechnen__wahl {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  width: min(100%, 290px);
}

.rechnen__wahl button {
  min-height: 62px;
  font: 700 1.7rem/1 var(--font-sign);
  background: #fff;
  border: var(--edge) solid var(--ink);
  border-radius: 12px;
  box-shadow: 0 3px 0 var(--ink);
}

.rechnen__wahl button:disabled {
  color: var(--ink-soft);
  background: var(--sand);
  box-shadow: none;
  opacity: .6;
}

/* Buchstabensalat */
.wort__antwort,
.wort__kacheln {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}

.wort__antwort button,
.wort__kacheln button {
  width: 36px;
  height: 44px;
  padding: 0;
  font: 700 1.5rem/1 var(--font-sign);
  background: #fff;
  border: var(--edge) solid var(--ink);
  border-radius: 9px;
}

.wort__antwort button {
  background: var(--sign);
}

.wort__antwort button:disabled {
  background: none;
  border-style: dashed;
  border-color: var(--line);
}

.wort__antwort.is-right button {
  color: #fff;
  background: var(--lake);
}

.wort__kacheln button:disabled {
  visibility: hidden;
}

/* Fünf Sinne und kleiner Auftrag */
.sinne,
.auftrag {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.sinne__frage,
.auftrag__text {
  font: 700 1.6rem/1.2 var(--font-sign);
  letter-spacing: .01em;
}

.sinne__punkte {
  display: flex;
  gap: 10px;
}

.sinne__punkte i {
  width: 22px;
  height: 22px;
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
}

.sinne__punkte i.is-on {
  background: var(--lake);
}

.sinne .btn,
.auftrag .btn {
  min-width: 160px;
  min-height: 54px;
  font-size: 1.1rem;
}

/* ---------- Tour ---------- */

/* Das Guckloch: ein Rahmen über dem Ziel, dessen riesiger Schatten den Rest abdunkelt. */
.tour-spot {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  border-radius: 20px;
  box-shadow: 0 0 0 4px var(--sign), 0 0 0 200vmax rgba(37, 48, 74, .74);
  transition: top .3s, left .3s, width .3s, height .3s;
}

.tour-spot--none {
  box-shadow: 0 0 0 200vmax rgba(37, 48, 74, .74);
}

/* Damit sich auch Ziele ganz unten über die Tour-Karte schieben lassen. */
.is-touring .app {
  padding-bottom: 85vh;
}

.tour {
  width: min(calc(100% - 20px), 27rem);
  max-height: calc(100% - 20px);
  margin: 0 auto;
  padding: 14px 18px 16px;
  color: var(--ink);
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 20px;
  box-shadow: 0 5px 0 var(--ink);
}

.tour::backdrop {
  background: none;
}

.tour--bottom {
  top: auto;
  bottom: max(12px, env(safe-area-inset-bottom));
}

.tour--top {
  top: max(12px, env(safe-area-inset-top));
  bottom: auto;
}

.tour--center {
  margin: auto;
}

.tour__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.tour__icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  font-size: 1.4rem;
  line-height: 1;
  background: var(--sign);
  border: var(--edge) solid var(--ink);
  border-radius: 50%;
}

.tour p {
  margin-top: 4px;
  font-size: .98rem;
  line-height: 1.4;
}

.tour__points {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: .95rem;
  line-height: 1.35;
}

/* In der Tour stehen die Hilfsangebote knapper da; die ganze Auskunft gibt der Hilfe-Dialog. */
.tour .offers {
  gap: 6px;
  margin-top: 8px;
}

.tour .offers li {
  padding: 7px 10px 9px;
}

.tour .offers li > span {
  font-size: .82rem;
}

.tour .offers__more {
  display: none;
}

.tour .offers a {
  margin-top: 2px;
  padding: 2px 10px 3px;
  font-size: .9rem;
}

/* Die Knöpfe bleiben am unteren Rand der Karte stehen, auch wenn ihr Inhalt rollt. */
.tour__actions {
  position: sticky;
  bottom: -16px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 8px -18px -16px;
  padding: 8px 18px 19px;
  background: var(--card);
}

.tour__skip {
  margin-right: auto;
  padding: 6px 2px;
  font-size: .9rem;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  background: none;
  border: 0;
}

/* ---------- Wegmarke erreicht ---------- */

/* Der Dialog füllt den ganzen Bildschirm, damit das Konfetti über der Karte fliegen kann. */
.unlock {
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 20px;
  overflow: hidden;
  color: var(--ink);
  background: none;
  border: 0;
}

.unlock[open] {
  display: grid;
  place-items: center;
}

.unlock__fx {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.unlock__card {
  display: grid;
  justify-items: center;
  width: min(100%, 21rem);
  padding: 0 20px 22px;
  text-align: center;
  background: var(--card);
  border: var(--edge) solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 5px 0 var(--ink);
  animation: rise .3s ease-out;
}

.unlock__eyebrow {
  margin-top: -16px;
  padding: 5px 16px 3px;
  font: 700 1.1rem/1.2 var(--font-sign);
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--sign);
  border: var(--edge) solid var(--ink);
  border-radius: 999px;
}

/* Der Stempel saust aufs Papier. */
.unlock__icon {
  width: 126px;
  height: 126px;
  margin: 20px 0 12px;
  font-size: 3.6rem;
  outline-offset: -11px;
  animation: stamp .5s cubic-bezier(.2, .9, .3, 1.2) .12s backwards;
}

@keyframes stamp {
  from {
    transform: scale(2.1) rotate(14deg);
    opacity: 0;
  }
  70% {
    transform: scale(.94);
    opacity: 1;
  }
}

/* Einzelne Wegmarke: Stempel, Name und Text liegen direkt im Raster der Karte. */
.unlock__single {
  display: contents;
}

/* Mehrere auf einmal: kompakte Liste statt großem Stempel. */
.unlock__list {
  display: grid;
  gap: 10px;
  width: 100%;
  max-height: 46vh;
  margin: 20px 0 18px;
  overflow-y: auto;
  text-align: left;
}

.unlock__item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.unlock__item strong {
  display: block;
  font-weight: 700;
  line-height: 1.2;
}

.unlock__item small {
  display: block;
  font-size: .84rem;
  line-height: 1.3;
  color: var(--ink-soft);
}

.unlock__name {
  font: 700 1.9rem/1.1 var(--font-sign);
  letter-spacing: .01em;
}

.unlock__desc {
  margin-top: 6px;
}

.unlock__need {
  margin: 10px 0 18px;
  padding: 4px 12px 5px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.3;
  background: var(--paper);
  border: var(--edge) dashed var(--ink);
  border-radius: 12px;
}

/* Niedrige Bildschirme: Das Bild wird flacher und alles rückt zusammen, damit die tägliche
   Frage und die Rast ohne Scrollen erreichbar bleiben. */
@media (max-height: 700px) {
  .top {
    margin-bottom: 6px;
  }

  .logo {
    font-size: 1.6rem;
  }

  .logo__mark {
    width: 26px;
    height: 26px;
  }

  .view {
    gap: 10px;
  }

  .hero__scene {
    aspect-ratio: 360 / 120;
  }

  .hero__count {
    top: 8px;
    left: 14px;
  }

  .hero__num {
    font-size: 3.3rem;
  }

  .hero__label {
    font-size: calc(.92rem * var(--fit, 1));
  }

  .hero__strip {
    gap: 5px;
    padding: 6px 14px 8px;
  }

  /* Die Marke auf dem Weg zeigt den Fortschritt schon. */
  .hero .meter {
    display: none;
  }

  .checkin {
    padding: 11px 14px 13px;
  }

  .checkin h3 {
    font-size: 1.4rem;
  }

  .checkin p:not(.eyebrow) {
    font-size: .96rem;
    line-height: 1.35;
  }

  .checkin__actions {
    gap: 8px;
    margin-top: 9px;
  }

  .checkin__actions .btn--sign {
    min-height: 48px;
    font-size: 1.08rem;
  }

  .rast-open {
    gap: 12px;
    padding: 9px 14px;
  }

  .rast-open__icon {
    width: 42px;
    height: 42px;
    font-size: 1.4rem;
  }

  .rast-open strong {
    font-size: 1.25rem;
  }

  .rast-open small {
    font-size: .84rem;
  }
}

/* Sehr niedrige Bildschirme: ohne Bild – die Zahl steht als schmale Leiste über der Frage. */
@media (max-height: 600px) {
  .hero__scene {
    display: none;
  }

  .hero__count {
    position: static;
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 6px 14px 0;
  }

  .hero__num {
    font-size: 2.6rem;
  }

  .hero__strip {
    padding-top: 2px;
    border-top: 0;
  }

  .rast-open small {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
