@font-face {
  font-family: Fraunces;
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url(../assets/fonts/fraunces-latin.woff2) format("woff2");
}

@font-face {
  font-family: Nunito;
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../assets/fonts/nunito-latin.woff2) format("woff2");
}

.karten {
  --seite: #fbf5e6;
  --tinte: #4a3a2a;
  --leise: rgba(74, 58, 42, .72);
  --gruen: #3d6b24;
  --rosa: #c63a62;
  --weiss: #fffdf8;
  --schleier: rgba(74, 58, 42, .14);
  --auswahl: rgba(61, 107, 36, .22);
  --schatten: drop-shadow(0 12px 20px rgba(74, 58, 42, .3));
  --neigung: -1deg;
  --lese: Fraunces, Georgia, "Times New Roman", serif;
  --rund: Nunito, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --weich: "SOFT" 100;
  --zeile: 28px;
  --schrift-text: 420 19px/var(--zeile) var(--lese);
  --schrift-klein: 600 14px/1.35 var(--rund);
  --breite: 400px;
  --rand: 26px 28px 22px;
  --spalte: 124px;
  --dreh: rotate(var(--neigung));
  --vh: 100vh;
  --vt: 0px;
  -webkit-text-size-adjust: 100%;
}

.bogen {
  position: relative;
  isolation: isolate;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: min(var(--breite), calc(100vw - 32px));
  padding: var(--rand);
  font: var(--schrift-text);
  font-variation-settings: var(--weich);
  color: var(--tinte);
}

.bogen:focus,
.bogen :focus {
  outline: none;
}

.bogen[hidden],
.bogen [hidden] {
  display: none;
}

.bogen ::selection {
  background: var(--auswahl);
}

.rahmen {
  position: absolute;
  left: 0;
  top: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.bogen > .rahmen {
  filter: var(--schatten);
}

.grund {
  fill: var(--seite);
}

.tusche {
  fill: var(--tinte);
}

.bogen button {
  position: relative;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--tinte);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.zeichen {
  display: block;
  width: 30px;
  height: 30px;
  margin: auto;
  overflow: visible;
  pointer-events: none;
}

.zeichenknopf {
  flex: none;
  width: 52px;
  height: 52px;
  margin: -8px;
  padding: 0;
  transition: transform .18s ease, opacity .18s ease;
}

.zeichenknopf:hover,
.zeichenknopf:focus-visible {
  transform: scale(1.12) rotate(-3deg);
}

.zeichenknopf:active {
  transform: scale(.94);
}

.zeichenknopf:hover .tusche,
.zeichenknopf:focus-visible .tusche,
.zu:hover .tusche,
.zu:focus-visible .tusche {
  fill: var(--gruen);
}

.zeichenknopf:disabled {
  opacity: .32;
  cursor: default;
  transform: none;
}

.bogen .zu {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  width: 52px;
  height: 52px;
  padding: 0;
  opacity: .62;
  transition: transform .18s ease, opacity .18s ease;
}

.zu .zeichen {
  width: 19px;
  height: 19px;
}

.zu:hover,
.zu:focus-visible {
  opacity: 1;
  transform: rotate(90deg);
}

.strich {
  position: absolute;
  left: 6px;
  top: calc(50% + 8px);
  width: calc(100% - 12px);
  height: 8px;
  overflow: visible;
  pointer-events: none;
}

.fuss {
  flex: none;
  display: flex;
  align-items: center;
  gap: 22px;
}

.datum {
  margin: 0;
  font: var(--schrift-klein);
  color: var(--leise);
}

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

.kanne {
  flex: none;
  width: 84px;
  height: 64px;
  margin: -6px -10px -10px;
  padding: 0;
  transform-origin: 50% 90%;
  transition: transform .2s cubic-bezier(.3, 1.45, .45, 1);
  animation: wiegen 5.5s ease-in-out 1.2s infinite;
}

.kanne img,
.kanne .zeichen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
  filter: drop-shadow(0 3px 3px rgba(74, 58, 42, .22));
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.kanne.durst {
  animation-duration: 3.2s;
}

.kanne:hover,
.kanne:focus-visible {
  animation: none;
  transform: translateY(-5px) rotate(-16deg) scale(1.08);
}

.kanne:active {
  animation: none;
  transform: translateY(-2px) rotate(-30deg) scale(1.04);
}

@keyframes wiegen {
  0%, 78%, 100% { transform: rotate(0); }
  84% { transform: translateY(-3px) rotate(-9deg); }
  90% { transform: translateY(-1px) rotate(5deg); }
  95% { transform: rotate(-3deg); }
}

.tor {
  --breite: 330px;
  --rand: 22px 26px 20px;
  position: fixed;
  left: 50%;
  top: calc(var(--vt) + var(--vh) * .74);
  z-index: 5;
  margin: 0;
  opacity: 0;
  transform: translate(-50%, -40%) rotate(calc(var(--neigung) * 3)) scale(.96);
  transition: opacity .2s ease, transform .5s cubic-bezier(.3, 1.45, .45, 1);
}

.tor.offen {
  opacity: 1;
  transform: translate(-50%, -50%) var(--dreh);
}

.frage {
  margin: 0;
  text-wrap: balance;
}

.zeile {
  display: flex;
  align-items: center;
  gap: 20px;
}

.zeile .zeichenknopf {
  margin: -4px -10px -4px -6px;
}

.los .zeichen {
  width: 34px;
  height: 34px;
}

.los .zeichen-fern,
.tor.fern .los .zeichen-pfeil {
  display: none;
}

.tor.fern .los .zeichen-fern {
  display: block;
  opacity: .55;
}

.warten {
  display: grid;
  place-items: center;
  height: 52px;
}

.warten .zeichen {
  width: 40px;
  height: 40px;
  opacity: .8;
}

.sand {
  fill: var(--tinte);
  fill-opacity: .5;
  transform-box: fill-box;
  transform-origin: 50% 100%;
}

.sand.oben {
  animation: rieseln var(--warte, 900s) linear both;
}

.sand.unten {
  animation: haeufen var(--warte, 900s) linear both;
}

@keyframes rieseln {
  from { transform: scale(1); }
  to { transform: scale(.05); }
}

@keyframes haeufen {
  from { transform: scaleY(.06); }
  to { transform: scaleY(1); }
}

.eingabe {
  position: relative;
  flex: 1;
  min-width: 0;
}

.eingabe input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 44px;
  padding: 4px 2px 6px;
  border: 0;
  border-radius: 0;
  background: none;
  font: inherit;
  font-variation-settings: inherit;
  color: inherit;
}

.eingabe .strich {
  left: 0;
  top: auto;
  bottom: 1px;
  width: 100%;
}

.eingabe:focus-within .tusche {
  fill: var(--gruen);
}

.tor.falsch .eingabe .tusche {
  fill: var(--rosa);
}

.tor.wartet {
  pointer-events: none;
}

.tor.wartet .zeichenknopf {
  opacity: .4;
}

.tor.falsch {
  animation: nein .32s ease;
}

.tor.fern {
  animation: fern 1.5s ease;
}

.tor.fern .eingabe .tusche {
  fill-opacity: .4;
}

@keyframes fern {
  0%, 100% { transform: translate(-50%, -50%) var(--dreh); }
  30% { transform: translate(-50%, calc(-50% + 7px)) rotate(calc(var(--neigung) * -1.4)); }
  62% { transform: translate(-50%, calc(-50% + 3px)) rotate(calc(var(--neigung) * 1.6)); }
}

@keyframes nein {
  0%, 100% { transform: translate(-50%, -50%) var(--dreh); }
  25% { transform: translate(calc(-50% - 7px), -50%) var(--dreh); }
  50% { transform: translate(calc(-50% + 6px), -50%) var(--dreh); }
  75% { transform: translate(calc(-50% - 3px), -50%) var(--dreh); }
}

.blatt {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vt);
  height: var(--vh);
  z-index: 10;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  padding: 16px max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
  background: transparent;
  transition: background .25s ease;
  overflow: hidden;
  touch-action: none;
}

.blatt.offen {
  background: var(--schleier);
}

.blatt.weg {
  pointer-events: none;
}

.karte {
  max-width: 100%;
  max-height: calc(var(--vh) - 32px);
  opacity: 0;
  transform: translateY(22px) rotate(calc(var(--neigung) * 3)) scale(.96);
  transition: opacity .2s ease, transform .5s cubic-bezier(.3, 1.45, .45, 1);
}

.blatt.offen .karte {
  opacity: 1;
  transform: var(--dreh);
}

.blatt.weg .karte {
  transition: opacity .18s ease, transform .22s ease-in;
}

.foto {
  position: relative;
  isolation: isolate;
  flex: none;
  align-self: center;
  max-width: 100%;
  box-sizing: border-box;
  margin: 2px 0 4px;
  padding: 8px;
  opacity: 0;
  transform: rotate(1.3deg);
  transition: opacity .25s ease;
}

.foto.da {
  opacity: 1;
}

.foto .grund {
  fill: var(--weiss);
}

.foto img {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: min(calc(var(--vh) * .46), 380px);
}

.inhalt {
  display: grid;
  align-content: start;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 58, 42, .3) transparent;
}

.text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  hyphens: auto;
  hyphenate-limit-chars: 11 4 4;
  -webkit-hyphenate-limit-before: 4;
  -webkit-hyphenate-limit-after: 4;
}

.gemalt {
  position: absolute;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}

.karte-flower.mit-bild {
  --breite: 480px;
  min-height: 216px;
  padding-left: calc(28px + var(--spalte));
}

.karte-flower.mit-bild .inhalt {
  flex: 1 1 auto;
}

.karte-flower .gemalt {
  left: -22px;
  bottom: -6px;
  width: calc(var(--spalte) + 40px);
  height: calc(100% + 30px);
  max-height: 330px;
  object-fit: contain;
  object-position: 50% 100%;
}

.karte-lily.mit-bild {
  padding-top: 76px;
}

.karte-lily .gemalt {
  left: 22px;
  top: -30px;
  width: 132px;
  height: 96px;
  object-fit: contain;
  object-position: 0 100%;
}

.wahl,
.schreiben {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
}

.karte-beet[data-schritt="wahl"] {
  --breite: 500px;
}

.arten {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(98px, 1fr));
  gap: 10px 8px;
  min-height: 0;
  padding: 6px 0 2px;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 58, 42, .3) transparent;
}

.art {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 48px;
  padding: 6px 0 4px;
  transition: transform .2s cubic-bezier(.3, 1.45, .45, 1);
}

.arten .art:hover,
.arten .art:focus-visible {
  transform: translateY(-4px) rotate(-2deg) scale(1.06);
}

.arten .art:active {
  transform: scale(.96);
}

.bild.leer {
  border-radius: 50%;
  background: var(--farbe, var(--rosa));
  opacity: .5;
  transform: scale(.5);
}

.bild {
  display: block;
  width: 84px;
  height: 84px;
}

.bild img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: 50% 100%;
}

.kringel {
  position: absolute;
  left: 50%;
  top: -1px;
  width: 98px;
  height: 98px;
  margin-left: -49px;
  overflow: visible;
  opacity: 0;
  pointer-events: none;
}

.art:hover .kringel {
  opacity: .28;
}

.art:focus-visible .kringel {
  opacity: 1;
}

.art:focus-visible .kringel .tusche {
  fill: var(--gruen);
}

.art[aria-pressed="true"] .kringel {
  opacity: 1;
}

.art[aria-pressed="true"] .kringel .tusche {
  fill: var(--rosa);
}

.karte-beet[data-schritt="text"] {
  --breite: 480px;
  min-height: 272px;
  padding-left: calc(28px + var(--spalte));
}

.schreiben {
  flex: 1 1 auto;
}

.art.gewaehlt {
  position: absolute;
  left: -4px;
  bottom: 10px;
  width: calc(var(--spalte) + 24px);
  height: calc(100% + 6px);
  justify-content: flex-end;
  padding: 0;
  transform-origin: 50% 100%;
}

.art.gewaehlt:hover,
.art.gewaehlt:focus-visible {
  transform: rotate(-3deg) scale(1.03);
}

.gewaehlt .bild {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  height: auto;
  min-height: 0;
}

.gewaehlt .bild img {
  position: absolute;
  left: 0;
  bottom: 0;
  max-height: 310px;
}

.zeilen {
  position: relative;
  flex: 1 1 auto;
  height: calc(var(--zeile) * 6);
  min-height: calc(var(--zeile) * 2);
  overflow: hidden;
}

.linien {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: calc(var(--zeile) * 16);
  pointer-events: none;
}

.linien .tusche {
  fill-opacity: .17;
}

.feld {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0 2px;
  border: 0;
  border-radius: 0;
  background: none;
  font: inherit;
  font-variation-settings: inherit;
  color: inherit;
  resize: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(74, 58, 42, .3) transparent;
}

.setzen .zeichen {
  width: 40px;
  height: 40px;
}

.setzen:not(:disabled) {
  animation: wachsen 3.6s ease-in-out infinite;
}

.setzen:not(:disabled) .tusche {
  fill: var(--gruen);
}

@keyframes wachsen {
  0%, 70%, 100% { transform: none; }
  80% { transform: translateY(-4px) scale(1.1); }
  90% { transform: translateY(0) scale(.98); }
}

.vorschau {
  flex: none;
  width: 52px;
  height: 52px;
  margin: -8px;
  padding: 0;
  transition: transform .18s ease;
}

.vorschau img {
  display: block;
  box-sizing: border-box;
  width: 46px;
  height: 46px;
  margin: 3px;
  border: 3px solid var(--weiss);
  object-fit: cover;
  transform: rotate(1.3deg);
  box-shadow: 0 2px 5px rgba(74, 58, 42, .28);
}

.vorschau .zeichen {
  position: absolute;
  right: -5px;
  top: -5px;
  width: 20px;
  height: 20px;
  padding: 2px;
  border-radius: 50%;
  background: var(--seite);
}

.vorschau:hover,
.vorschau:focus-visible {
  transform: rotate(-4deg) scale(1.08);
}

.vorschau:hover .tusche,
.vorschau:focus-visible .tusche {
  fill: var(--rosa);
}

.karte.wartet {
  pointer-events: none;
}

.karte.wartet .zeichenknopf {
  opacity: .4;
  animation: none;
}

.karte.wackelt {
  animation: ruck .32s ease;
}

@keyframes ruck {
  0%, 100% { transform: var(--dreh); }
  25% { transform: translateX(-7px) var(--dreh); }
  50% { transform: translateX(6px) var(--dreh); }
  75% { transform: translateX(-3px) var(--dreh); }
}

@media (max-width: 520px) {
  .karten {
    --rand: 24px 24px 20px;
    --spalte: 84px;
  }

  .karte-flower.mit-bild {
    padding-left: calc(22px + var(--spalte));
  }

  .karte-flower.mit-bild.lang {
    min-height: 0;
    padding-left: 24px;
  }

  .karte-flower .gemalt {
    left: -8px;
    width: calc(var(--spalte) + 22px);
  }

  .karte-flower.lang .gemalt {
    display: none;
  }

  .karte-flower .gemalt {
    max-height: 250px;
  }

  .karte-beet[data-schritt="text"] {
    padding-left: calc(22px + var(--spalte));
  }
}

@media (max-height: 480px) and (orientation: landscape) {
  .karten {
    --rand: 20px 26px 18px;
  }

  .tor {
    top: calc(var(--vt) + var(--vh) * .7);
  }

  .karte.mit-foto {
    --breite: 640px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 12px 22px;
  }

  .mit-foto .foto {
    grid-row: 1 / 3;
    align-self: center;
    margin: 0;
  }

  .mit-foto .foto img {
    max-width: min(300px, 42vw);
    max-height: calc(var(--vh) - 96px);
  }

  .karte-flower.mit-bild,
  .karte-beet[data-schritt="text"] {
    min-height: 0;
  }

  .karte-flower .gemalt {
    max-height: calc(var(--vh) - 40px);
  }

  .karte-lily.mit-bild {
    padding-top: 62px;
  }

  .karte-lily .gemalt {
    top: -22px;
    height: 76px;
  }

  .karte-beet[data-schritt="wahl"] {
    --breite: 680px;
  }

  .arten {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 6px 4px;
  }

  .bild {
    width: 68px;
    height: 68px;
  }

  .kringel {
    top: -6px;
    width: 80px;
    height: 80px;
    margin-left: -40px;
  }

  .zeilen {
    height: calc(var(--zeile) * 5);
  }
}

@media (prefers-reduced-motion: reduce) {
  .tor,
  .karte,
  .blatt.weg .karte {
    transition: opacity .2s ease;
  }

  .kanne,
  .setzen:not(:disabled),
  .tor.fern {
    animation: none;
  }

  .zeichenknopf,
  .zu,
  .art,
  .vorschau,
  .kanne {
    transition: none;
  }

  .tor,
  .tor.offen {
    transform: translate(-50%, -50%) var(--dreh);
  }

  .karte,
  .blatt.offen .karte {
    transform: var(--dreh);
  }

  .tor.falsch,
  .karte.wackelt {
    animation: none;
  }
}
