/* mache-eine-freude.de – Website */

@font-face { font-family: "Lora"; src: url("../fonts/lora-var.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("../fonts/lora-italic-var.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-light.woff") format("woff"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("../fonts/poppins-medium.woff") format("woff"); font-weight: 500; font-display: swap; }

:root {
  --ink: #2b2340;
  --ink-soft: #6a6280;
  --paper: #fbf8f4;
  --paper-2: #f3ede6;
  --line: #e6ddd3;
  --accent: #e46a7e;
  --accent-2: #f2a65a;
  --plum: #3b2f5c;
  --glass: rgba(255, 255, 255, .14);
  --glass-hover: rgba(255, 255, 255, .24);
  --glass-line: rgba(255, 255, 255, .28);
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --sans: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  grid-template-columns: minmax(0, 1fr);
  overflow-x: hidden;
  font-family: var(--sans);
  font-weight: 400;
  color: #fff;
  background: #2a2440;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
.icon { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid #fff; outline-offset: 3px; border-radius: 999px; }

/* ---------- Hintergrund ---------- */
.stage { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #2a2440; }
.bg { position: absolute; inset: 0; opacity: 0; transition: opacity 1.4s var(--ease); }
.bg.is-on { opacity: 1; }
.bg picture, .bg img { display: block; width: 100%; height: 100%; }
.bg img { object-fit: cover; object-position: center; }
.anim .bg.is-on img { animation: drift 26s ease-out both; }
@keyframes drift { from { transform: scale(1.07); } to { transform: scale(1); } }
.shade {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(18, 14, 34, .38) 0%, rgba(18, 14, 34, 0) 22%, rgba(18, 14, 34, 0) 70%, rgba(18, 14, 34, .42) 100%),
    radial-gradient(ellipse 85% 60% at 50% 48%, rgba(18, 14, 34, .42) 0%, rgba(18, 14, 34, .26) 55%, rgba(18, 14, 34, .18) 100%);
}

/* ---------- Kopfzeile ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(14px + var(--safe-t)) clamp(16px, 4vw, 36px) 8px;
}
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.logo-mark { width: 30px; height: 30px; flex: none; }
.lm-ring { fill: none; stroke: currentColor; stroke-width: 1.4; opacity: .75; }
.lm-heart { fill: currentColor; }
.logo-text { font-weight: 500; font-size: 15px; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 8px rgba(0,0,0,.25); }
.top-actions { display: flex; gap: 8px; flex: none; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 13px;
  border-radius: 999px; border: 1px solid var(--glass-line); background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font-size: 13.5px; font-weight: 500; transition: background .2s;
}
.chip .icon { width: 18px; height: 18px; }
.chip:hover { background: var(--glass-hover); }
.chip-icon { padding: 0 12px; position: relative; }
.fav-count {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fff; color: var(--ink);
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 500;
}

/* ---------- Spruch ---------- */
.center {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: clamp(16px, 4vh, 48px) clamp(20px, 6vw, 64px);
  text-align: center;
}
.quote { margin: 0; width: 100%; max-width: 880px; overflow-wrap: break-word; transition: opacity .55s var(--ease), transform .7s var(--ease), filter .55s var(--ease); }
.quote blockquote { margin: 0; }
.quote p {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.34;
  letter-spacing: -.005em;
  text-wrap: balance;
  text-shadow: 0 2px 22px rgba(10, 8, 25, .38), 0 1px 3px rgba(10, 8, 25, .28);
  hyphens: manual;
}
.len-s p { font-size: clamp(2rem, 1.1rem + 3.8vw, 4.3rem); line-height: 1.22; }
.len-m p { font-size: clamp(1.7rem, 1.05rem + 2.7vw, 3.35rem); line-height: 1.28; }
.len-l p { font-size: clamp(1.45rem, 1rem + 1.95vw, 2.65rem); }
.len-xl p { font-size: clamp(1.25rem, .95rem + 1.45vw, 2.15rem); line-height: 1.4; }
.quote figcaption {
  margin-top: 1.1rem; font-family: var(--serif); font-style: italic; font-size: clamp(1rem, .9rem + .4vw, 1.25rem); opacity: .88;
  text-shadow: 0 1px 10px rgba(0,0,0,.3);
}
.quote::after {
  content: ""; display: block; width: 44px; height: 2px; margin: clamp(22px, 3.5vh, 34px) auto 0;
  border-radius: 2px; background: rgba(255,255,255,.55);
}
.quote.is-out { opacity: 0; transform: translateY(10px); filter: blur(6px); }
.anim .quote.is-in { animation: rise .9s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); filter: blur(8px); } to { opacity: 1; transform: none; filter: none; } }

.gift-wrap { margin-top: clamp(22px, 4vh, 36px); }
.btn-gift {
  display: inline-flex; align-items: center; gap: 10px; border: 0; border-radius: 999px;
  padding: 14px 26px 14px 22px; background: rgba(255,255,255,.94); color: var(--ink);
  font-weight: 500; font-size: 15.5px; letter-spacing: .005em;
  box-shadow: 0 10px 30px rgba(15, 10, 30, .25), 0 1px 0 rgba(255,255,255,.6) inset;
  transition: transform .25s var(--ease), box-shadow .25s, background .2s;
}
.btn-gift .icon { color: var(--accent); stroke-width: 2; }
.btn-gift:hover { transform: translateY(-2px); background: #fff; box-shadow: 0 14px 36px rgba(15, 10, 30, .3); }
.btn-gift:active { transform: translateY(0) scale(.98); }
.btn-gift:disabled { opacity: .6; pointer-events: none; }

/* ---------- Aktionsleiste ---------- */
.dock {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 6px 16px 10px;
}
.ic, .btn-next {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--glass-line); background: var(--glass);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  transition: background .2s, transform .2s var(--ease);
}
.ic { width: 48px; height: 48px; border-radius: 50%; padding: 0; }
.ic:hover, .btn-next:hover { background: var(--glass-hover); }
.ic:active, .btn-next:active { transform: scale(.94); }
.ic[aria-pressed="true"] .icon { fill: #fff; }
.ic.pop .icon { animation: pop .45s var(--ease); }
@keyframes pop { 40% { transform: scale(1.35); } }
.btn-next {
  gap: 9px; height: 52px; padding: 0 24px 0 20px; border-radius: 999px; text-decoration: none;
  font-weight: 500; font-size: 15px; background: rgba(255,255,255,.2);
}
.btn-next.spin .icon { animation: spin .7s var(--ease); }
@keyframes spin { to { transform: rotate(360deg); } }

.legal {
  display: flex; justify-content: center; gap: 10px; padding: 4px 16px calc(12px + var(--safe-b));
  font-size: 12px; opacity: .72;
}
.legal a { text-decoration: none; }
.legal a:hover { text-decoration: underline; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(96px + var(--safe-b)); z-index: 50;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 999px; background: rgba(30, 24, 48, .88); color: #fff;
  font-size: 14px; box-shadow: 0 8px 28px rgba(0,0,0,.25); transition: opacity .25s, transform .3s var(--ease);
  max-width: calc(100vw - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Dialoge ---------- */
.sheet {
  border: 0; padding: 0; color: var(--ink); background: var(--paper);
  width: min(520px, calc(100% - 28px)); max-height: min(88vh, 760px); max-height: min(88dvh, 760px);
  border-radius: 26px; box-shadow: 0 30px 80px rgba(20, 14, 40, .35);
  overflow: auto; overscroll-behavior: contain;
}
.sheet::backdrop { background: rgba(22, 16, 38, .48); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.sheet[open] { animation: sheet-in .38s var(--ease); }
.sheet[open]::backdrop { animation: fade-in .3s ease; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }
@keyframes fade-in { from { opacity: 0; } }
.sheet-inner { position: relative; padding: 28px 26px 24px; margin: 0; }
.sheet h2 { margin: 0 44px 6px 0; font-family: var(--serif); font-weight: 600; font-size: 1.5rem; line-height: 1.25; }
.sheet-sub { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; line-height: 1.5; }
.sheet-note { margin: 16px 0 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.5; }
.sheet-close {
  position: absolute; top: 18px; right: 18px; width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--paper-2); display: grid; place-items: center; color: var(--ink);
}
.sheet-close:hover { background: var(--line); }
.sheet-close .icon { width: 18px; height: 18px; }
.sheet :focus-visible { outline-color: var(--plum); }

.gift-preview {
  border-radius: 18px; padding: 20px 22px; margin-bottom: 16px;
  background: linear-gradient(135deg, #3b2f5c 0%, #8b5a86 55%, #e9967a 100%); color: #fff;
}
.gift-quote { margin: 0; font-family: var(--serif); font-size: 1.08rem; line-height: 1.5; font-weight: 500; text-wrap: pretty; }
.field { display: block; margin: 0 0 16px; }
.field span { display: block; font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.field em { font-style: normal; color: var(--ink-soft); font-weight: 400; }
.field textarea {
  width: 100%; resize: vertical; min-height: 64px; border-radius: 14px; border: 1px solid var(--line);
  background: #fff; padding: 11px 14px; font-size: 15px; line-height: 1.45; color: var(--ink);
}
.field textarea:focus { outline: 2px solid var(--plum); outline-offset: 0; border-color: transparent; }

.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 50px; padding: 0 22px;
  border-radius: 999px; border: 0; text-decoration: none; font-weight: 500; font-size: 15px;
  transition: transform .2s var(--ease), background .2s;
}
.btn-primary { background: var(--plum); color: #fff; }
.btn-primary:hover { background: #4a3c72; }
.btn-ghost { background: var(--paper-2); color: var(--ink); }
.btn-ghost:hover { background: var(--line); }
.btn-primary:active, .btn-ghost:active { transform: scale(.97); }
.btn-primary .icon, .btn-ghost .icon { width: 20px; height: 20px; }
.share-native { margin-bottom: 12px; }
.share-native .btn-primary { width: 100%; }

.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  min-height: 78px; padding: 10px 4px; border-radius: 16px; border: 1px solid var(--line); background: #fff;
  text-decoration: none; font-size: 12.5px; font-weight: 500; color: var(--ink); transition: background .15s, transform .15s;
}
.share-btn:hover { background: var(--paper-2); }
.share-btn:active { transform: scale(.96); }
.share-btn .icon { width: 24px; height: 24px; color: var(--plum); }
.share-btn[hidden] { display: none; }

.format-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 14px 0; border-radius: 999px; background: var(--paper-2); }
.format-switch button { border: 0; border-radius: 999px; background: transparent; min-height: 40px; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.format-switch button small { font-weight: 400; opacity: .7; margin-left: 2px; }
.format-switch button[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(43, 35, 64, .1); }
.image-preview {
  position: relative; margin: 0 auto 16px; border-radius: 16px; overflow: hidden; background: var(--paper-2);
  aspect-ratio: 4 / 5; height: min(46vh, 420px); height: min(46dvh, 420px); max-width: 100%;
}
.image-preview[data-format="story"] { aspect-ratio: 9 / 16; }
.image-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .4s; }
.image-preview.ready img { opacity: 1; }
.image-preview.ready .spinner { display: none; }
.spinner { position: absolute; inset: 0; margin: auto; width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--plum); animation: spin .8s linear infinite; }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-actions > * { flex: 1 1 180px; }

.fav-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fav-item { display: flex; align-items: flex-start; gap: 6px; padding: 14px 10px 14px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.fav-open { flex: 1; text-align: left; border: 0; background: none; padding: 0; font-family: var(--serif); font-size: 1rem; line-height: 1.5; color: var(--ink); }
.fav-open:hover { color: var(--plum); text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.fav-del { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; color: var(--ink-soft); display: grid; place-items: center; flex: none; }
.fav-del:hover { background: var(--paper-2); color: var(--accent); }
.fav-del .icon { width: 18px; height: 18px; }
.empty { margin: 8px 0 4px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.6; }
.empty[hidden] { display: none; }

.cat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.cat-btn {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; text-align: left;
  min-height: 54px; padding: 10px 16px; border-radius: 16px; border: 1px solid var(--line); background: #fff;
  font-size: 14.5px; font-weight: 500; color: var(--ink);
}
.cat-btn small { color: var(--ink-soft); font-weight: 400; font-size: 12px; }
.cat-btn:hover { background: var(--paper-2); }
.cat-btn[aria-checked="true"] { background: var(--plum); color: #fff; border-color: var(--plum); }
.cat-btn[aria-checked="true"] small { color: rgba(255,255,255,.75); }
.cat-btn.all { grid-column: 1 / -1; }

.radios { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.radios label { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line); background: #fff; font-size: 14.5px; cursor: pointer; }
.radios input { accent-color: var(--plum); width: 18px; height: 18px; margin: 0; }
.radios label:has(input:checked) { border-color: var(--plum); box-shadow: 0 0 0 1px var(--plum) inset; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Rechtliche Seiten ---------- */
.page-legal { background: var(--paper); color: var(--ink); grid-template-rows: auto 1fr auto; }
.top-solid { color: var(--ink); }
.top-solid .logo-text { text-shadow: none; }
.legal-page { width: min(760px, 100%); margin: 0 auto; padding: 24px clamp(20px, 5vw, 40px) 48px; }
.legal-page h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(2rem, 1.5rem + 2vw, 2.8rem); margin: 18px 0 24px; }
.prose { font-size: 15.5px; line-height: 1.7; }
.prose h2 { font-family: var(--serif); font-size: 1.35rem; font-weight: 600; margin: 2em 0 .5em; }
.prose h3 { font-size: 1.05rem; font-weight: 500; margin: 1.6em 0 .4em; }
.prose p, .prose ul { margin: 0 0 1em; }
.prose a { color: var(--plum); }
.back { margin-top: 40px; }
.back a { color: var(--plum); font-weight: 500; }
.back a.btn-primary { color: #fff; }
.legal-static { color: var(--ink-soft); opacity: 1; }
.page-msg { place-items: center; }
.msg { text-align: center; }
.msg p { color: var(--ink-soft); }

/* ---------- Kleine Bildschirme ---------- */
@media (max-width: 600px) {
  .sheet {
    width: 100%; max-width: none; margin: auto 0 0; border-radius: 26px 26px 0 0;
    max-height: 92vh; max-height: 92dvh;
  }
  .sheet[open] { animation: sheet-up .42s var(--ease); }
  @keyframes sheet-up { from { transform: translateY(40%); opacity: .4; } }
  .sheet-inner { padding: 24px 20px calc(22px + var(--safe-b)); }
  .sheet-inner::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--line); }
  .share-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .share-btn { min-height: 72px; font-size: 11.5px; border-radius: 14px; }
  .chip-label { display: none; }
  .chip { padding: 0 12px; }
  .logo-text { font-size: 14px; }
  .dock { gap: 6px; padding: 6px 10px 8px; }
  .ic { width: 42px; height: 42px; }
  .ic .icon { width: 20px; height: 20px; }
  .btn-next { height: 50px; padding: 0 16px 0 14px; font-size: 14px; gap: 7px; }
  .top { padding-left: 14px; padding-right: 14px; }
  .btn-gift { padding: 13px 22px 13px 18px; font-size: 15px; }
}
@media (max-width: 374px) {
  .logo-text { font-size: 13px; }
  .btn-next span { display: none; }
  .btn-next { width: 50px; padding: 0; }
  .cat-list { grid-template-columns: 1fr; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .gift-wrap { margin-top: 14px; }
  .quote::after { display: none; }
}

/* ---------- Bewegung reduzieren ---------- */
.no-anim *, .no-anim *::before, .no-anim *::after { animation: none !important; transition-duration: .01ms !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
