/* ============ Türchen-Seite: ein Papierbogen ============ */
body[data-view='door'], body[data-view='collection'] { background-color: var(--wine-900); }

.door {
  position: relative;
  width: min(100%, 520px);
  margin: 0 auto;
  min-height: 100svh;
  padding: calc(env(safe-area-inset-top) + 10px) 20px calc(env(safe-area-inset-bottom) + 34px);
  font-variation-settings: 'SOFT' 50, 'WONK' 0, 'opsz' 14;
}
@media (min-width: 560px) {
  .door { margin: 24px auto; min-height: auto; border-radius: 2px; box-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
}
.door.is-entering { animation: sheet-in .5s var(--ease-out); }
@keyframes sheet-in { from { transform: translateY(26px); opacity: 0; } }

.door__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; }
.door__back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-right: 8px; text-decoration: none; color: var(--wine-700); font-weight: 560; font-size: 16px; }
.door__back .arrow { width: 24px; }
.door__date { font-size: 14px; color: var(--ink-2); font-style: italic; text-align: right; }

.door__head { position: relative; margin: 18px 0 22px; }
.door__num {
  position: absolute; right: -4px; top: -14px; z-index: 0;
  font-weight: 700; font-size: 132px; line-height: 1; color: var(--paper-3);
  font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144; font-variant-numeric: oldstyle-nums;
  opacity: .8;
}
.door__title {
  position: relative; z-index: 1; margin: 0; max-width: 11em;
  font-weight: 600; font-size: clamp(32px, 9vw, 42px); line-height: 1.02; letter-spacing: -.01em;
  color: var(--wine-700); font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 144;
  text-wrap: balance;
}
.door__kicker { position: relative; z-index: 1; margin: 10px 0 0; color: var(--ink-2); font-size: 17px; max-width: 26em; }

/* ---------- Ding Nr. X ---------- */
.ding {
  position: relative; margin: 6px 4px 30px;
  padding: 22px 20px 18px;
  background: #FBF6EC; color: var(--ink);
  transform: rotate(-1.1deg);
  box-shadow: 0 1px 0 rgba(43, 27, 24, .12), 0 6px 14px -10px rgba(43, 27, 24, .45);
  background-image: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--wine-700) 14%, transparent) 31px 32px);
  background-position: 0 14px;
}
.ding__label { display: block; font-family: var(--serif); font-size: 13px; letter-spacing: .03em; color: var(--wine-600); font-weight: 600; margin-bottom: 4px; font-variant-numeric: oldstyle-nums; }
.ding__label span { font-weight: 400; color: var(--ink-2); }
.ding__text { font-family: var(--hand); font-size: 27px; line-height: 32px; margin: 0; color: var(--wine-900); }
.tape {
  position: absolute; left: 50%; top: -11px; width: 92px; height: 24px; translate: -50% 0; rotate: 3deg;
  background: color-mix(in srgb, var(--pine) 50%, transparent);
  -webkit-mask: linear-gradient(90deg, transparent 0 2px, #000 2px calc(100% - 2px), transparent 0) , none;
  clip-path: polygon(2% 0, 98% 6%, 100% 50%, 97% 100%, 3% 94%, 0 45%);
}

/* ---------- Blöcke ---------- */
.door__blocks { display: grid; gap: 26px; }
.block { position: relative; }
.b-h { margin: 0 0 8px; font-size: 22px; line-height: 1.15; color: var(--wine-700); font-weight: 600; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 48; }
.b-text p { margin: 0 0 .8em; }
.b-text p:last-child { margin-bottom: 0; }
.b-text em, .b-letter em { font-style: italic; }

.b-note { margin: 0; padding: 4px 4px 0 14px; border-left: 2px solid var(--wine-600); font-family: var(--hand); font-size: 25px; line-height: 1.2; color: var(--wine-700); transform: rotate(var(--r, -1deg)); }
.b-note p { margin: 0 0 .3em; }
.b-note .tape { display: none; }

.b-hint { display: grid; grid-template-columns: 38px 1fr; gap: 12px; align-items: start; padding: 14px 14px 14px 12px; border: 1.5px dashed var(--wine-600); border-radius: 3px; color: var(--ink); }
.b-hint__paw { width: 34px; color: var(--wine-600); transform: rotate(-12deg); }
.b-hint strong { display: block; color: var(--wine-700); font-size: 18px; margin-bottom: 2px; }
.b-hint p { margin: 0; }

.b-fact { padding: 16px 16px 14px; background: var(--paper-2); border-radius: 2px; transform: rotate(.5deg); }
.b-fact__label { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--pine); font-size: 15px; letter-spacing: .02em; margin-bottom: 6px; }
.b-fact__cat { width: 30px; color: var(--pine); --cut: var(--paper-2); }
.b-fact p { margin: 0 0 .5em; }
.b-fact p:last-of-type { margin: 0; }
.b-fact__src { display: block; margin-top: 8px; font-size: 13px; color: var(--ink-2); font-style: italic; }

.b-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.b-list li { padding-left: 22px; position: relative; }
.b-list li::before { content: ''; position: absolute; left: 2px; top: .55em; width: 9px; height: 9px; background: var(--wine-600); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.b-list li span { display: block; font-weight: 560; }
.b-list li small { display: block; color: var(--ink-2); font-size: 15px; line-height: 1.35; }
.b-list__after { margin: 12px 0 0; font-family: var(--hand); font-size: 23px; color: var(--wine-700); }

.b-recipe__intro { margin: 0 0 12px; }
.b-recipe h3 { margin: 10px 0 6px; font-size: 15px; letter-spacing: .03em; color: var(--pine); font-weight: 600; }
.b-recipe__ing { list-style: none; padding: 0; margin: 0; }
.b-recipe__ing button { text-align: left; width: 100%; padding: 7px 0 7px 30px; position: relative; min-height: 40px; border-bottom: 1px dotted color-mix(in srgb, var(--ink) 25%, transparent); }
.b-recipe__ing button::before { content: ''; position: absolute; left: 2px; top: 10px; width: 17px; height: 17px; border: 1.5px solid var(--wine-700); border-radius: 2px 3px 2px 4px; }
.b-recipe__ing button.is-done { color: var(--ink-2); text-decoration: line-through; text-decoration-color: var(--wine-600); }
.b-recipe__ing button.is-done::after { content: ''; position: absolute; left: 5px; top: 9px; width: 8px; height: 14px; border: solid var(--wine-600); border-width: 0 2.5px 2.5px 0; rotate: 40deg; }
.b-recipe__steps { margin: 0; padding-left: 1.4em; display: grid; gap: 8px; }
.b-recipe__steps li::marker { font-weight: 600; color: var(--wine-700); font-variant-numeric: oldstyle-nums; }
.b-recipe__tip { margin: 14px 0 0; font-family: var(--hand); font-size: 23px; line-height: 1.2; color: var(--wine-700); }

.b-question p { margin: 0 0 10px; }
.b-question textarea {
  width: 100%; resize: vertical; min-height: 96px; padding: 12px 14px; margin-bottom: 12px;
  font: 24px/1.25 var(--hand); color: var(--wine-900); background: #FBF6EC;
  border: 1.5px solid color-mix(in srgb, var(--wine-700) 40%, transparent); border-radius: 2px;
  -webkit-user-select: text; user-select: text;
}
.b-question textarea:focus { outline: 2px dashed var(--wine-600); outline-offset: 2px; }
.b-question__status { font-family: var(--hand); font-size: 22px; color: var(--pine); margin: 8px 0 0; min-height: 1em; }

.b-divider { display: flex; justify-content: center; gap: 18px; color: var(--wine-600); --cut: var(--paper); }
.b-divider .art { width: 12px; }
.b-divider .art:nth-child(2) { width: 16px; margin-top: -2px; }

.b-game .game { position: relative; }
.b-game__after { margin-top: 18px; display: grid; gap: 22px; animation: sheet-in .5s var(--ease-out); }

/* ---------- Gutschein (Ticket) ---------- */
.coupon {
  position: relative; display: grid; grid-template-columns: 1fr 74px;
  background: var(--paper); color: var(--ink);
  border: 1.5px solid var(--wine-700); border-radius: 3px;
  transform: rotate(-.6deg);
  background-image: var(--fibers);
}
.coupon__body { padding: 14px 14px 14px 16px; border-right: 2px dashed color-mix(in srgb, var(--wine-700) 55%, transparent); }
.coupon__kicker { font-family: var(--hand); font-size: 21px; color: var(--wine-600); line-height: 1; }
.coupon__title { margin: 2px 0 6px; font-size: 23px; line-height: 1.08; color: var(--wine-700); font-weight: 600; font-variation-settings: 'SOFT' 100, 'WONK' 1, 'opsz' 72; }
.coupon__text { margin: 0 0 8px; font-size: 16px; line-height: 1.4; }
.coupon__small { margin: 0; font-size: 13px; color: var(--ink-2); font-style: italic; }
.coupon__stub { display: grid; place-items: center; }
.coupon__redeem {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-weight: 600; font-size: 16px; letter-spacing: .05em; color: var(--wine-700);
  min-width: 52px; min-height: 120px; padding: 8px;
}
.coupon__stamp {
  position: absolute; right: 70px; top: 50%; translate: 0 -50%; rotate: -14deg;
  font: 700 22px/1 var(--serif); letter-spacing: .06em; text-transform: uppercase;
  color: var(--wine-600); border: 3px double var(--wine-600); padding: 6px 10px; border-radius: 4px;
  opacity: 0; transform: scale(1.4); transition: opacity .2s, transform .25s var(--ease-out);
  pointer-events: none; mix-blend-mode: multiply;
}
.coupon.is-redeemed .coupon__stamp { opacity: .8; transform: scale(1); }
.coupon.is-redeemed .coupon__redeem { color: var(--ink-2); font-weight: 400; }
.coupon-wrap { display: grid; gap: 6px; }
.coupon-from { font-family: var(--hand); font-size: 20px; color: var(--ink-2); padding-left: 4px; }

/* ---------- Öffnen, wenn … ---------- */
.b-openwhen ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.b-openwhen__intro { margin: 0 0 14px; }
.env {
  position: relative; width: 100%; min-height: 96px; text-align: left; overflow: hidden;
  padding: 44px 18px 16px; color: var(--paper);
  background: var(--wine-700); border-radius: 3px; transform: rotate(var(--r));
  background-image: var(--grain);
}
.env__flap { position: absolute; left: 0; right: 0; top: 0; height: 40px; background: var(--wine-600); clip-path: polygon(0 0, 100% 0, 50% 100%); transition: transform .4s var(--ease-out); transform-origin: top; }
.env.is-open .env__flap { transform: scaleY(-1); }
.env__when { display: block; font-size: 13px; letter-spacing: .04em; color: var(--gold-2); }
.env__title { display: block; font-family: var(--hand); font-size: 28px; line-height: 1.1; }
.env.is-read:not(.is-open)::after { content: 'gelesen'; position: absolute; right: 12px; bottom: 10px; font-size: 12px; font-style: italic; color: var(--paper-3); }
.env__letter { padding: 18px 18px 6px; margin: -6px 6px 0; background: #FBF6EC; font-family: var(--hand); font-size: 25px; line-height: 1.25; color: var(--wine-900); box-shadow: 0 6px 12px -10px rgba(43, 27, 24, .5); }
.env__letter p { margin: 0 0 .6em; }

/* ---------- Brief (24) ---------- */
.b-letter {
  padding: 26px 20px 22px; background: #FBF6EC; color: var(--wine-900);
  font-family: var(--hand); font-size: 25px; line-height: 32px;
  background-image: repeating-linear-gradient(transparent 0 31px, color-mix(in srgb, var(--wine-700) 12%, transparent) 31px 32px);
  background-position: 0 20px;
  box-shadow: 0 1px 0 rgba(43, 27, 24, .1), 0 10px 20px -16px rgba(43, 27, 24, .6);
  transform: rotate(.4deg);
}
.b-letter__title { margin: 0 0 8px; font-family: var(--hand); font-size: 34px; font-weight: 600; line-height: 1.1; }
.b-letter p { margin: 0 0 32px; }
.b-letter__sign { font-family: var(--sign); font-size: 22px; text-align: right; margin: 8px 6px 0 !important; }

/* ---------- Rückblick (24) ---------- */
.b-recap ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 4px; }
.b-recap li { display: grid; grid-template-columns: 34px 1fr; align-items: baseline; padding: 6px 0; border-bottom: 1px dotted color-mix(in srgb, var(--ink) 20%, transparent); opacity: 0; animation: recap .5s var(--ease-out) forwards; animation-delay: calc(var(--i) * 90ms); }
.b-recap__n { font-weight: 600; color: var(--wine-600); font-variant-numeric: oldstyle-nums; }
.b-recap__after { margin: 16px 0 0; font-family: var(--hand); font-size: 26px; line-height: 1.2; color: var(--wine-700); }
@keyframes recap { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }

/* ---------- Abschluss ---------- */
.door__sign { margin: 30px 8px 0; text-align: right; font-family: var(--sign); font-size: 21px; color: var(--wine-700); }
.door__foot { display: grid; justify-items: center; gap: 10px; margin-top: 40px; }
.door__foot-cat { width: 86px; color: var(--wine-700); --cut: var(--paper); opacity: .85; }

/* ---------- gesperrt ---------- */
.door--locked .door__lockedbody { display: grid; justify-items: center; text-align: center; gap: 18px; padding-top: 18vh; }
.door__guard { width: 150px; color: var(--wine-700); --cut: var(--paper); }
.door__lockedmsg { font-family: var(--hand); font-size: 30px; line-height: 1.15; color: var(--wine-700); max-width: 12em; margin: 0; }

@media (prefers-reduced-motion: reduce) {
  .b-recap li { opacity: 1; animation: none; }
}

body[data-view='door'] .snow, body[data-view='collection'] .snow { display: none; }

/* ---------- Wunschzettel ---------- */
.wishlist {
  padding: 22px 18px 18px; background: #FBF6EC; color: var(--wine-900);
  box-shadow: 0 1px 0 rgba(43, 27, 24, .1), 0 10px 20px -16px rgba(43, 27, 24, .6);
  transform: rotate(-.5deg);
}
.wishlist__head { margin: 0 0 6px; font-family: var(--hand); font-size: 24px; line-height: 1.2; color: var(--wine-700); }
.wishlist ol { margin: 0; padding-left: 1.6em; }
.wishlist li { font-family: var(--serif); color: var(--wine-600); font-weight: 600; font-variant-numeric: oldstyle-nums; }
.wishlist input {
  width: 100%; border: 0; border-bottom: 1px solid color-mix(in srgb, var(--wine-700) 25%, transparent);
  background: transparent; padding: 6px 2px 4px; margin: 2px 0;
  font: 25px/1.2 var(--hand); color: var(--wine-900);
  -webkit-user-select: text; user-select: text; border-radius: 0;
}
.wishlist input:focus { outline: none; border-bottom-color: var(--wine-600); background: color-mix(in srgb, var(--blush) 18%, transparent); }
.wishlist__sign { margin: 14px 4px 0; text-align: right; font-family: var(--sign); font-size: 18px; color: var(--wine-700); }
.wishlist__actions { display: grid; justify-items: start; gap: 6px; }
