/* Aperol-o-Meter – niedlich-schrilles Sticker-Design:
   knallige Flächen, dicke Tinten-Outlines, harte Schlagschatten. */

:root {
  color-scheme: light;

  --ink: #2a0f4a;
  --ink-soft: #6a4c8c;
  --cream: #fff6e5;
  --white: #fff;
  --orange: #ff4f00;
  --orange-soft: #ffd3bd;
  --sun: #ffd60a;
  --pink: #ff3d9a;
  --pink-soft: #ffc9e6;
  --mint: #2ee6c5;
  --lilac: #c4adff;
  --sky: #9ad8ff;
  --lime: #c6f25a;
  --peach: #ffb98f;
  --danger: #ff8f8f;

  /* Monatsansicht: eine Farbe, von hell nach dunkel – je dunkler, desto mehr Aperol. */
  --heat-0: #f1e7db;
  --heat-1: #ff9455;
  --heat-2: #f87423;
  --heat-3: #e25a05;
  --heat-4: #ad3d00;
  --heat-5: #7a2800;

  --line: 3.5px;
  --shadow: 5px 6px 0 var(--ink);
  --shadow-sm: 3px 4px 0 var(--ink);
  --bounce: cubic-bezier(.3, 1.6, .5, 1);
  --font: "Fredoka", ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", system-ui, 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: 500 1.0625rem/1.4 var(--font);
  color: var(--ink);
  background: var(--pink);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

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

ul {
  list-style: none;
}

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

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px dashed var(--ink);
  outline-offset: 3px;
}

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

/* ---------- Hintergrund ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(rgba(255, 255, 255, .32) 2.5px, transparent 3px) 0 0 / 26px 26px,
    linear-gradient(165deg, #ff3d9a 0%, #ff5a1f 52%, #ffc21a 100%);
}

.backdrop i {
  position: absolute;
  left: var(--x);
  bottom: -60px;
  width: var(--s);
  height: var(--s);
  border: 3px solid rgba(255, 255, 255, .6);
  border-radius: 50%;
  animation: rise var(--d) linear var(--delay) infinite;
}

@keyframes rise {
  to {
    transform: translate(18px, -125vh);
  }
}

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

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

.logo {
  margin: 2px 0 14px;
  font-size: clamp(2rem, 10vw, 2.8rem);
  font-weight: 700;
  line-height: 1.05;
  text-align: center;
  color: var(--cream);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
  text-shadow: 4px 5px 0 var(--ink);
  rotate: -2.5deg;
}

.logo span {
  color: var(--sun);
}

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

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

.card {
  padding: 16px 18px;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.eyebrow {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}

.sticker {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  width: fit-content;
  padding: 3px 16px 5px;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  background: var(--tone, var(--sun));
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  rotate: -2deg;
}

.sticker span {
  font-size: .9rem;
  font-weight: 600;
}

.empty {
  padding: 18px;
  text-align: center;
  background: var(--cream);
  border: var(--line) dashed var(--ink);
  border-radius: 20px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px 9px;
  font-weight: 600;
  line-height: 1.2;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  transition: translate .08s, box-shadow .08s;
}

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

.btn--sun {
  background: var(--sun);
}

.btn--pink {
  background: var(--pink);
}

.btn--danger {
  background: var(--danger);
}

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

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

.meter {
  display: block;
  height: 18px;
  overflow: hidden;
  background: var(--orange-soft);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
}

.meter > span {
  display: block;
  width: var(--p, 0%);
  height: 100%;
  background: var(--orange);
  border-radius: 999px;
  transition: width .5s var(--bounce);
}

.meter.has-value > span {
  min-width: 11px;
}

/* ---------- Zählen ---------- */

.hero {
  padding: 4px 16px 12px;
  text-align: center;
}

.hero__num {
  font-size: clamp(4.4rem, 24vw, 6.8rem);
  font-weight: 700;
  line-height: 1.05;
  color: var(--orange);
  -webkit-text-stroke: 9px var(--ink);
  paint-order: stroke fill;
  text-shadow: 5px 6px 0 var(--ink);
}

.hero__num.is-pop {
  animation: pop .45s var(--bounce);
}

.hero__label {
  font-size: 1.1rem;
  font-weight: 600;
}

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

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

.stat {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: flex-end;
  padding: 7px 4px 8px;
  text-align: center;
  border: var(--line) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.stat:nth-child(1) {
  background: var(--pink-soft);
  rotate: -1.5deg;
}

.stat:nth-child(2) {
  background: var(--sun);
  rotate: 1deg;
}

.stat:nth-child(3) {
  background: var(--mint);
  rotate: -1deg;
}

.stat dt {
  font-size: .84rem;
  line-height: 1.2;
}

.stat dd {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.15;
}

.stat dd small {
  font-size: .9rem;
  font-weight: 500;
}

.stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(78vw, 42svh, 320px);
  aspect-ratio: 1;
  margin: 4px auto 0;
}

/* Die Strahlen drehen sich in einem festen, abgeschnittenen Rahmen –
   eine rotierende Box würde die Seite sonst breiter als den Bildschirm machen. */
.sunburst {
  position: absolute;
  inset: -8%;
  overflow: hidden;
  border-radius: 50%;
  -webkit-mask: radial-gradient(closest-side, #000 62%, transparent);
  mask: radial-gradient(closest-side, #000 62%, transparent);
}

.sunburst::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-conic-gradient(var(--sun) 0 15deg, rgba(255, 255, 255, .6) 0 30deg);
  animation: spin 36s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

.tap {
  position: relative;
  display: grid;
  justify-items: center;
  width: 66%;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 28px;
  -webkit-user-select: none;
  user-select: none;
}

.tap__glass {
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(5px 6px 0 var(--ink));
  transform-origin: 50% 100%;
  animation: bob 3.2s ease-in-out infinite;
}

.tap.is-hit .tap__glass {
  animation: squish .55s var(--bounce);
}

@keyframes bob {
  50% {
    transform: translateY(-6px) rotate(1.5deg);
  }
}

@keyframes squish {
  25% {
    transform: scale(1.12, .84);
  }
  55% {
    transform: scale(.94, 1.1) translateY(-10px);
  }
}

.eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4.5s infinite;
}

@keyframes blink {
  0%, 94%, 100% {
    transform: scaleY(1);
  }
  97% {
    transform: scaleY(.1);
  }
}

.fizz {
  animation: fizz 2.6s ease-in infinite;
}

.fizz:nth-of-type(2) {
  animation-delay: -.9s;
}

.fizz:nth-of-type(3) {
  animation-delay: -1.7s;
}

@keyframes fizz {
  from {
    opacity: .8;
  }
  to {
    transform: translateY(-58px);
    opacity: 0;
  }
}

.face--happy,
.face--nope,
.tap.is-hit .face--idle,
.tap.is-nope .face--idle {
  display: none;
}

.tap.is-hit .face--happy,
.tap.is-nope .face--nope {
  display: inline;
}

/* Schummel-Schutz sagt nein: Das Glas schüttelt den Kopf. */
.tap.is-nope .tap__glass {
  animation: nope .5s ease-in-out;
}

@keyframes nope {
  20% {
    transform: translateX(-9px) rotate(-4deg);
  }
  40% {
    transform: translateX(8px) rotate(4deg);
  }
  60% {
    transform: translateX(-6px) rotate(-3deg);
  }
  80% {
    transform: translateX(4px) rotate(2deg);
  }
}

.tap__label {
  margin-top: -10px;
  padding: 5px 22px 7px;
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .02em;
  white-space: nowrap;
  color: var(--cream);
  -webkit-text-stroke: 5px var(--ink);
  paint-order: stroke fill;
  background: var(--pink);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
  rotate: -3deg;
  transition: translate .08s, box-shadow .08s;
}

.tap:active .tap__label {
  translate: 3px 4px;
  box-shadow: 2px 2px 0 var(--ink);
}

.speech {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin: 6px auto 0;
  padding: 8px 16px 9px;
  text-align: center;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
}

.speech::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 15px;
  height: 15px;
  background: inherit;
  border: solid var(--ink);
  border-width: var(--line) 0 0 var(--line);
  transform: translateX(-50%) rotate(45deg);
}

.quick {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: -4px;
}

.quick button {
  padding: 4px 14px 5px;
  font-size: .9rem;
  font-weight: 600;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
}

.road {
  display: grid;
  gap: 6px;
}

.hint {
  font-size: .92rem;
  line-height: 1.35;
}

.hint strong {
  font-weight: 700;
}

.footnote {
  font-size: .85rem;
  font-weight: 600;
  text-align: center;
}

.tour-open {
  justify-self: center;
  padding: 4px 14px 5px;
  font-size: .9rem;
  font-weight: 600;
  background: var(--cream);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
}

/* ---------- Erfolge ---------- */

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

.summary h2 {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}

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

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

/* Farbe je Erfolgs-Kategorie */
.tone-total {
  --tone: var(--sun);
}

.tone-day {
  --tone: var(--pink-soft);
}

.tone-streak {
  --tone: var(--mint);
}

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

.tone-week {
  --tone: var(--lime);
}

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

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

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

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

.badge {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 4px;
  padding: 14px 10px 12px;
  text-align: center;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.badge--unlocked:nth-child(odd) {
  rotate: -1deg;
}

.badge--unlocked:nth-child(even) {
  rotate: 1deg;
}

.badge__icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 2px;
  font-size: 2rem;
  line-height: 1;
  background: var(--tone);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
}

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

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

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

.badge--locked {
  background: #f4eefb;
  border-style: dashed;
  box-shadow: none;
}

.badge--locked .badge__icon {
  font-weight: 700;
  color: var(--ink-soft);
  background: #e4dbef;
  border-style: dashed;
}

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

/* ---------- Logbuch ---------- */

/* Monatsansicht: ein Kalenderblatt als Heatmap. 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-size: 1.2rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.cal__nav {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0 0 4px;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
  background: var(--sun);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  transition: translate .08s, box-shadow .08s;
}

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

.cal__nav:disabled {
  cursor: default;
  background: none;
  box-shadow: none;
  opacity: .3;
}

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

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

.cal__grid abbr {
  text-decoration: none;
}

.cal__grid td {
  padding: 0;
}

.cal__day {
  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: var(--heat-0);
  border: 0;
  border-radius: 10px;
}

.heat-1 {
  background: var(--heat-1);
}

.heat-2 {
  background: var(--heat-2);
}

.heat-3 {
  background: var(--heat-3);
}

.heat-4 {
  background: var(--heat-4);
}

.heat-5 {
  background: var(--heat-5);
}

/* Auf den dunklen Stufen bleibt die Tageszahl nur in Weiß lesbar. */
.cal__day:is(.heat-4, .heat-5) {
  color: var(--white);
}

.cal__day.heat-0 {
  font-weight: 500;
  color: var(--ink-soft);
}

.cal__day.is-future {
  font-weight: 500;
  color: var(--ink-soft);
  background: none;
  opacity: .45;
}

.cal__day.is-today {
  box-shadow: inset 0 0 0 2.5px var(--ink), inset 0 0 0 4.5px var(--cream);
}

.cal__day.is-active {
  outline: 3px solid var(--pink);
  outline-offset: 1px;
}

button.cal__day:hover {
  filter: brightness(1.07);
}

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

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

.cal__key {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-variant-numeric: tabular-nums;
}

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

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

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

.log-list {
  gap: 18px;
}

.month__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: fit-content;
  padding: 1px 12px 2px;
  font-size: 1.05rem;
  font-weight: 700;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 12px;
}

.month__title span {
  font-size: .85rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.day {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
}

.day__wd {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  font-size: 1.15rem;
  font-weight: 700;
  background: var(--sun);
  border: var(--line) solid var(--ink);
  border-radius: 16px;
  rotate: -5deg;
}

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

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

.day__title strong {
  font-weight: 700;
}

.day__count {
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 50px;
}

.pill {
  padding: 0 8px 1px;
  font-size: .75rem;
  font-weight: 600;
  background: var(--mint);
  border: 2px 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, Notizen und der Stift – die ganze Pille öffnet das Bearbeiten. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-height: 34px;
  padding: 2px 10px 3px 12px;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
  text-align: left;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 17px;
}

.chip:hover {
  background: var(--pink-soft);
}

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

.chip__note {
  min-width: 0;
  overflow-wrap: anywhere;
}

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

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

.data h3 {
  font-size: 1.2rem;
  font-weight: 700;
}

.data p {
  font-size: .95rem;
}

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

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

.tabbar {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(12px, env(safe-area-inset-bottom));
  translate: -50% 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  width: min(calc(100% - 24px), 27rem);
  padding: 5px;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
}

.tab {
  display: grid;
  justify-items: center;
  padding: 3px 4px 5px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.15;
  background: none;
  border: var(--line) solid transparent;
  border-radius: 999px;
}

.tab__icon {
  font-size: 1.35rem;
  line-height: 1.25;
}

.tab[aria-current] {
  background: var(--sun);
  border-color: 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.7rem;
  line-height: 1;
}

.fx .plus {
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--sun);
  -webkit-text-stroke: 7px var(--ink);
  paint-order: stroke fill;
}

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(max(12px, env(safe-area-inset-bottom)) + 88px);
  translate: -50% 16px;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 8px 16px 9px;
  text-align: center;
  color: var(--cream);
  background: var(--ink);
  border-radius: 18px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, translate .2s;
}

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

.sheet {
  width: min(calc(100% - 40px), 22rem);
  padding: 22px 20px 20px;
  text-align: center;
  color: var(--ink);
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 28px;
  box-shadow: 7px 8px 0 var(--ink);
}

.sheet[open] {
  animation: pop-in .4s var(--bounce);
}

.sheet::backdrop,
.unlock::backdrop {
  background: rgba(42, 15, 74, .6);
}

.sheet h2 {
  font-size: 1.4rem;
  font-weight: 700;
  line-height: 1.2;
}

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

.field {
  display: grid;
  gap: 6px;
  margin-top: 14px;
  font-weight: 600;
  text-align: left;
}

.field input {
  width: 100%;
  min-height: 46px;
  padding: 8px 12px;
  font-weight: 500;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: 14px;
}

.sheet .field__error {
  margin-top: 10px;
  padding: 8px 12px;
  font-size: .9rem;
  font-weight: 600;
  text-align: left;
  background: var(--pink-soft);
  border: 2.5px solid var(--ink);
  border-radius: 14px;
}

.sheet .field__note {
  margin-top: 10px;
  font-size: .82rem;
  line-height: 1.3;
  text-align: left;
  color: var(--ink-soft);
}

@keyframes pop-in {
  from {
    transform: scale(.7) rotate(-6deg);
    opacity: 0;
  }
}

/* ---------- 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(--sun), 0 0 0 200vmax rgba(42, 15, 74, .74);
  transition: top .3s, left .3s, width .3s, height .3s;
}

.tour-spot--none {
  box-shadow: 0 0 0 200vmax rgba(42, 15, 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% - 24px), 27rem);
  max-height: calc(100% - 24px);
  margin: 0 auto;
  padding: 14px 18px 16px;
  color: var(--ink);
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 26px;
  box-shadow: 6px 7px 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: 46px;
  height: 46px;
  font-size: 1.5rem;
  line-height: 1;
  background: var(--sun);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  rotate: -6deg;
}

.tour h2 {
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
}

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

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

.tour__points li {
  padding-left: 1.5em;
  text-indent: -1.5em;
}

.tour__points li::before {
  content: "🍊 ";
}

.tour__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

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

/* 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(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 30px;
  box-shadow: 8px 9px 0 var(--ink);
  animation: pop-in .5s var(--bounce);
}

.unlock__eyebrow {
  margin-top: -18px;
  padding: 2px 16px 4px;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--pink);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  rotate: -3deg;
}

.unlock__icon {
  display: grid;
  place-items: center;
  width: 124px;
  height: 124px;
  margin: 18px 0 12px;
  font-size: 3.8rem;
  line-height: 1;
  background: var(--tone, var(--sun));
  border: var(--line) solid var(--ink);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  animation: wiggle 1.8s ease-in-out infinite;
}

/* Einzelner Erfolg: Icon, Name und Text liegen direkt im Raster der Karte. */
.unlock__single {
  display: contents;
}

/* Mehrere Erfolge auf einmal: kompakte Liste statt großem Icon. */
.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-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  font-size: 1.6rem;
  line-height: 1;
  background: var(--tone);
  border: var(--line) solid var(--ink);
  border-radius: 50%;
}

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

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

.unlock__name {
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.15;
}

.unlock__desc {
  margin-top: 6px;
}

.unlock__need {
  margin: 10px 0 18px;
  padding: 3px 12px 4px;
  font-size: .88rem;
  font-weight: 600;
  line-height: 1.3;
  background: var(--white);
  border: 2px dashed var(--ink);
  border-radius: 14px;
}

@keyframes wiggle {
  25% {
    transform: rotate(-7deg) scale(1.04);
  }
  75% {
    transform: rotate(7deg) scale(1.04);
  }
}

/* Niedrige Bildschirme: Zähler kompakt neben die Beschriftung,
   damit Glas und „Prost!“-Knopf ohne Scrollen erreichbar bleiben. */
@media (max-height: 700px) {
  .logo {
    margin-bottom: 8px;
    font-size: clamp(1.8rem, 8.5vw, 2.4rem);
  }

  .view {
    gap: 12px;
  }

  .hero {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 0 16px 4px;
  }

  .hero__num {
    font-size: 3.6rem;
  }

  .hero__label {
    max-width: 5.5em;
    line-height: 1.15;
    text-align: left;
  }
}

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