:root {
  --paper: #fbf8f2;
  --card: #fffdf9;
  --ink: #2a2622;
  --muted: #877d72;
  --faint: #ddd4c7;
  --accent: #7b2f2b;      /* Bordeaux */
  --gold: #a88a52;
  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Jost", "Helvetica Neue", Arial, sans-serif;

  /* Ernährung: gedeckte Töne */
  --d-vegan: #5f7a4c;
  --d-vegetarisch: #8b8547;
  --d-fisch: #4d6878;
  --d-fleisch: #7b2f2b;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
[hidden] { display: none !important; }

.page { max-width: 820px; margin: 0 auto; padding: 30px 20px 56px; }

/* ---------- Kleinschrift ---------- */
.eyebrow, .tab, .segmented button, .btn, .more, .filter-label, .pool-note, .hint, .check,
.colophon, .tc-course, .tc-no, .tc-award, .tc-meta, .stamp, .label, .chip, .toast {
  font-family: var(--sans);
  letter-spacing: .18em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 400;
}

/* ---------- Kopf ---------- */
.masthead { text-align: center; }
.eyebrow { color: var(--muted); margin: 0 0 6px; letter-spacing: .22em; }
.brand {
  font-weight: 400; font-style: italic; letter-spacing: .02em;
  font-size: clamp(46px, 10vw, 76px); line-height: 1; margin: 0;
}
.tagline { color: var(--muted); font-style: italic; font-size: 18px; margin: 8px 0 0; line-height: 1.4; }

/* ---------- Tabs ---------- */
.tabs {
  display: flex; justify-content: center; gap: 28px;
  margin: 20px 0 18px; border-bottom: 1px solid var(--faint);
}
.tab {
  background: none; border: 0; padding: 12px 2px; color: var(--muted);
  border-bottom: 1px solid transparent; margin-bottom: -1px; font-size: 12px;
}
.tab:hover { color: var(--ink); }
.tab.is-active { color: var(--ink); border-bottom-color: var(--ink); }
.count { color: var(--accent); }

.view { display: none; }
.view.is-active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* ---------- Filter ---------- */
.filters { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 16px; }

.segmented {
  display: inline-flex; border: 1px solid var(--faint); border-radius: 999px; padding: 3px;
  background: var(--card); flex-wrap: wrap; justify-content: center;
}
.segmented button {
  border: 0; background: none; padding: 8px 16px; border-radius: 999px; color: var(--muted);
  transition: background .2s, color .2s;
}
.segmented button:hover { color: var(--ink); }
.segmented button.is-active { background: var(--ink); color: var(--paper); }
.segmented.small button { padding: 6px 12px; font-size: 10.5px; letter-spacing: .14em; }

.more { background: none; border: 0; color: var(--muted); padding: 4px 8px; }
.more:hover, .more[aria-expanded="true"] { color: var(--ink); }
.more::after { content: " ▾"; letter-spacing: 0; }
.more[aria-expanded="true"]::after { content: " ▴"; }

.more-panel {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px 12px 4px; border-top: 1px solid var(--faint); width: 100%; max-width: 640px;
  animation: fade .25s ease;
}
.filter-row { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.filter-label { color: var(--muted); font-size: 10px; letter-spacing: .24em; }

.check { display: inline-flex; align-items: center; gap: 10px; color: var(--muted); font-size: 10.5px; cursor: pointer; margin-top: 4px; }
.check em { font-family: var(--serif); font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--accent); }
.check input { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; }

.pool-note { color: var(--muted); margin: 0; text-align: center; min-height: 1.2em; font-size: 10.5px; }
.pool-note.warn { color: var(--accent); }

/* ---------- Kartenstapel ---------- */
.deck-wrap { display: flex; justify-content: center; padding: 6px 0 8px; }

.deck {
  position: relative;
  /* so groß, dass Karte und Knöpfe zusammen auf den Bildschirm passen */
  width: min(360px, 86vw, max(250px, calc((100svh - 480px) * .714)));
  aspect-ratio: 5 / 7;
  touch-action: pan-y;
  container-type: inline-size;
  user-select: none; -webkit-user-select: none;
}

.tcard {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  background: var(--card);
  border: 1px solid var(--faint);
  border-radius: 14px;
  padding: 22px 24px 20px;
  box-shadow: 0 1px 0 rgba(0,0,0,.02), 0 22px 40px -26px rgba(60,40,20,.35);
  container-type: size;     /* Schrift wächst mit der Karte (cqw = 1 % der Kartenbreite) */
  transform-origin: 50% 110%;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), opacity .35s, box-shadow .35s;
  overflow: hidden;
  --diet: var(--d-fleisch);
}
.tcard[data-diet="vegan"] { --diet: var(--d-vegan); }
.tcard[data-diet="vegetarisch"] { --diet: var(--d-vegetarisch); }
.tcard[data-diet="fisch"] { --diet: var(--d-fisch); }

/* Doppelrahmen wie bei einer gedruckten Karte */
.tcard::before {
  content: ""; position: absolute; inset: 9px; border: 1px solid var(--faint); border-radius: 9px;
  pointer-events: none;
}
/* farbige Kante je Ernährung */
.tcard::after {
  content: ""; position: absolute; left: 9px; right: 9px; top: 9px; height: 3px;
  background: var(--diet); border-radius: 9px 9px 0 0; opacity: .85; pointer-events: none;
}

.deck .tcard:not(.is-top) { pointer-events: none; }
.deck .tcard.depth-1 { transform: translateY(12px) scale(.955); }
.deck .tcard.depth-2 { transform: translateY(24px) scale(.91); opacity: .7; }
.deck .tcard.depth-1, .deck .tcard.depth-2 { box-shadow: 0 10px 24px -20px rgba(60,40,20,.3); }
.deck .tcard.depth-1 > :not(.stamp), .deck .tcard.depth-2 > :not(.stamp) { opacity: .55; }
.deck .tcard.is-top { cursor: grab; z-index: 3; }
.deck .tcard.is-dragging { transition: none; cursor: grabbing; }
.deck .tcard.enter { animation: rise .45s cubic-bezier(.2,.8,.2,1); }
@keyframes rise { from { transform: translateY(12px) scale(.955); } to { transform: none; } }

.tc-top { display: flex; justify-content: space-between; align-items: baseline; position: relative; z-index: 1; margin-top: 4px; }
.tc-course { color: var(--accent); font-size: max(8.5px, 3.33cqw); }
.tc-no { color: var(--muted); font-size: max(8.5px, 3.1cqw); letter-spacing: .12em; }

.tc-center {
  flex: 1 1 auto; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 6px 4px; min-height: 0;
}
.tc-orn { color: var(--gold); font-size: 4.14cqw; letter-spacing: .6em; margin-left: .6em; flex-shrink: 0; }
.tc-title {
  font-weight: 500; font-size: 9.2cqw; line-height: 1.14; margin: 3.79cqw 0 3.22cqw; flex-shrink: 0;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
  text-wrap: balance;
}
.tc-title.long { font-size: 7.7cqw; }
.tc-orig {
  margin: 0; font-style: italic; color: var(--muted); font-size: 5.06cqw; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.tc-sig {
  display: inline-block; margin-top: 3.79cqw; color: var(--gold); border: 1px solid var(--gold); flex-shrink: 0;
  border-radius: 999px; padding: .58cqw 3.22cqw; font-family: var(--sans); font-size: max(8px, 2.99cqw);
  letter-spacing: .2em; text-transform: uppercase;
}

.tc-foot { text-align: center; border-top: 1px solid var(--faint); padding-top: 3.79cqw; position: relative; z-index: 1; flex-shrink: 0; }
.tc-award { color: var(--gold); font-size: max(8px, 3.22cqw); letter-spacing: .22em; }
.tc-award .stars { font-size: 4.14cqw; letter-spacing: .25em; }
.tc-rest { font-size: 6.67cqw; font-weight: 500; line-height: 1.15; margin: .92cqw 0 .35cqw; }
.tc-place { color: var(--muted); font-style: italic; font-size: 4.83cqw; }
.tc-meta {
  display: flex; justify-content: center; gap: .69cqw 4.48cqw; flex-wrap: wrap; color: var(--muted);
  font-size: max(8px, 3.05cqw); letter-spacing: .16em; margin-top: 3.22cqw;
}
.tc-meta .diet { color: var(--diet); }
.dots { letter-spacing: .1em; color: var(--ink); }
.dots .off { color: var(--faint); }

/* Stempel beim Wischen */
.stamp {
  position: absolute; top: 14.95cqw; padding: 1.84cqw 4.48cqw; border: 2px solid currentColor; border-radius: 4px;
  font-size: 4.83cqw; letter-spacing: .24em; opacity: 0; pointer-events: none; z-index: 2;
  background: rgba(255,253,249,.85);
}
.stamp.keep { left: 8.05cqw; color: var(--accent); transform: rotate(-12deg); }
.stamp.skip { right: 8.05cqw; color: var(--muted); transform: rotate(12deg); }

@container (max-width: 290px) {
  .tc-orig { -webkit-line-clamp: 2; }
  .tc-title { -webkit-line-clamp: 4; }
}

/* leerer Stapel */
.deck-empty {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 30px; border: 1px dashed var(--faint); border-radius: 14px; color: var(--muted);
}
.deck-empty .big { font-size: 26px; font-style: italic; color: var(--ink); margin-bottom: 8px; }
.deck-empty p { margin: 0 0 18px; }

/* ---------- Knöpfe ---------- */
.deck-actions { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 22px; }
.round {
  width: 62px; height: 62px; border-radius: 50%; border: 1px solid var(--faint); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center; padding: 0;
  transition: border-color .2s, background .2s, color .2s, transform .15s;
  box-shadow: 0 8px 18px -14px rgba(60,40,20,.4);
}
.round svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.round.small { width: 46px; height: 46px; color: var(--muted); }
.round.small svg { width: 19px; height: 19px; }
.round:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.round:active:not(:disabled) { transform: scale(.94); }
.round.accent { color: var(--accent); }
.round.accent:hover { background: var(--accent); border-color: var(--accent); color: var(--paper); }
.round:disabled { opacity: .35; cursor: default; }

.hint { color: var(--muted); text-align: center; font-size: 10px; letter-spacing: .14em; margin: 18px auto 0; max-width: 420px; line-height: 1.8; }

.btn {
  border: 1px solid var(--ink); background: none; padding: 13px 24px; border-radius: 0;
  transition: background .2s, color .2s, border-color .2s; text-decoration: none; color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn.ghost:hover { background: var(--ink); color: var(--paper); }
.btn.is-saved { border-color: var(--accent); color: var(--accent); }

/* ---------- Sammlung ---------- */
.coll-head { text-align: center; margin-bottom: 8px; }
.coll-head h2 { font-weight: 400; font-style: italic; font-size: 36px; margin: 0; }
.coll-head p { color: var(--muted); margin: 2px 0 0; font-family: var(--sans); font-size: 11px; letter-spacing: .2em; text-transform: uppercase; }
.coll-group h3 {
  text-align: center; font-family: var(--sans); font-weight: 400; font-size: 11px; letter-spacing: .3em;
  text-transform: uppercase; color: var(--accent); margin: 34px 0 14px;
  display: flex; align-items: center; gap: 16px;
}
.coll-group h3::before, .coll-group h3::after { content: ""; flex: 1; height: 1px; background: var(--faint); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 16px; }
.grid .tcard {
  position: relative; inset: auto; aspect-ratio: 5 / 7; padding: 16px 15px 14px; cursor: pointer;
  border-radius: 10px; text-align: left; font: inherit; color: inherit; width: 100%;
}
.grid .tcard::before { inset: 6px; border-radius: 6px; }
.grid .tcard::after { left: 6px; right: 6px; top: 6px; height: 2px; }
.grid .tcard:hover { transform: translateY(-3px); box-shadow: 0 22px 34px -24px rgba(60,40,20,.45); }
.grid .tc-title { font-size: 12.07cqw; -webkit-line-clamp: 5; margin: 4.6cqw 0 0; }
.grid .tc-title.long { font-size: 10.35cqw; }
.grid .tc-orig, .grid .tc-meta, .grid .tc-sig { display: none; }
.grid .tc-rest { font-size: 9.66cqw; }
.grid .tc-place { font-size: 8.05cqw; }
.grid .tc-foot { padding-top: 4.6cqw; }
.grid .tc-course, .grid .tc-no, .grid .tc-award { font-size: max(8px, 5.29cqw); }
.grid .tc-award .stars { font-size: 6.9cqw; }

.empty { text-align: center; color: var(--muted); padding: 40px 0; }
.empty .big { font-size: 28px; font-style: italic; color: var(--ink); display: block; margin-bottom: 6px; }

/* ---------- Detail / Prompt ---------- */
.sheet {
  width: min(680px, 100vw); max-height: min(92vh, 1000px); border: 1px solid var(--faint); padding: 0;
  background: var(--card); color: var(--ink); border-radius: 14px;
  box-shadow: 0 30px 80px -30px rgba(40,25,10,.5);
}
.sheet::backdrop { background: rgba(42,38,34,.38); backdrop-filter: blur(2px); }
.sheet[open] { animation: sheet-in .35s cubic-bezier(.2,.8,.2,1); }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.sheet-close { position: sticky; top: 0; display: flex; justify-content: flex-end; height: 0; z-index: 2; }
.sheet-close button {
  margin: 12px 12px 0 0; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--faint);
  background: var(--card); font-size: 22px; line-height: 1; color: var(--muted); padding: 0;
}
.sheet-close button:hover { color: var(--ink); border-color: var(--ink); }

.sh { padding: 44px 48px 36px; }
.sh-head { text-align: center; }
.sh-head .tc-course { display: block; margin-bottom: 14px; }
.sh-title { font-weight: 500; font-size: clamp(28px, 5vw, 36px); line-height: 1.15; margin: 0 auto 10px; max-width: 520px; text-wrap: balance; }
.sh-orig { font-style: italic; color: var(--muted); margin: 0 auto; max-width: 520px; font-size: 18px; }
.sh-orig::before {
  content: "Auf der Karte"; display: block; font-style: normal; font-family: var(--sans); font-size: 10px;
  letter-spacing: .2em; text-transform: uppercase; margin-bottom: 2px;
}
.sh-rest { margin: 22px 0 0; }
.sh-rest .tc-rest { font-size: 23px; }
.sh-facts {
  display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 20px; margin: 16px 0 0;
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.sh-facts a { color: var(--accent); }
.sh hr { border: 0; height: 1px; background: var(--faint); margin: 30px auto; width: 120px; }

.sh-prompt h3 { text-align: center; font-weight: 400; font-style: italic; font-size: 28px; margin: 0 0 4px; }
.sh-prompt .lead { text-align: center; color: var(--muted); margin: 0 0 22px; font-size: 17px; }
.opt { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-bottom: 16px; }
.label { color: var(--muted); font-size: 10px; letter-spacing: .24em; }
.stepper { display: inline-flex; align-items: center; gap: 14px; font-size: 22px; }
.stepper button {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--faint); background: none;
  font-family: var(--sans); font-size: 16px; line-height: 1; padding: 0;
}
.stepper button:hover { border-color: var(--ink); }
.stepper output { min-width: 26px; text-align: center; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.chip {
  border: 1px solid var(--faint); background: none; border-radius: 999px; padding: 6px 13px; font-size: 10.5px;
  letter-spacing: .12em; color: var(--muted);
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.prompt-box { margin-top: 20px; }
.prompt-box summary {
  cursor: pointer; text-align: center; font-family: var(--sans); font-size: 10.5px; letter-spacing: .2em;
  text-transform: uppercase; color: var(--muted); list-style: none;
}
.prompt-box summary::-webkit-details-marker { display: none; }
.prompt-box summary::after { content: " ▾"; }
.prompt-box[open] summary::after { content: " ▴"; }
.prompt-box pre {
  white-space: pre-wrap; font-family: var(--serif); font-size: 15.5px; line-height: 1.45; background: var(--paper);
  border: 1px solid var(--faint); padding: 18px 20px; margin: 12px 0 0; max-height: 300px; overflow: auto;
}
.sh-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 24px; }
.sh-note { text-align: center; color: var(--muted); font-size: 14.5px; margin: 16px auto 0; max-width: 460px; font-style: italic; }

/* ---------- Über ---------- */
.about { max-width: 640px; margin: 0 auto; }
.about h2 { font-weight: 400; font-style: italic; font-size: 34px; text-align: center; margin: 0 0 20px; }
.about h3 { font-family: var(--sans); font-weight: 400; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); margin: 30px 0 8px; }
.fineprint { color: var(--muted); font-size: 15px; margin-top: 30px; }

.colophon { text-align: center; color: var(--muted); margin-top: 52px; }
.colophon span { color: var(--gold); margin: 0 10px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 10;
  background: var(--ink); color: var(--paper); padding: 10px 20px; letter-spacing: .12em; font-size: 11.5px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsiv ---------- */
@media (max-width: 680px) {
  body { font-size: 18px; }
  .page { padding: 16px 12px 32px; }
  .eyebrow { font-size: 9.5px; margin-bottom: 2px; }
  .brand { font-size: 44px; }
  .tagline { display: none; }
  .tabs { gap: 22px; margin: 10px 0 12px; }
  .tab { padding: 9px 2px; font-size: 11px; }
  .segmented { flex-wrap: nowrap; }
  .segmented button { padding: 7px 10px; font-size: 10px; letter-spacing: .07em; white-space: nowrap; }
  .eyebrow, .pool-note:not(.warn) { display: none; }
  .deck { width: min(360px, 88vw, max(250px, calc((100svh - 290px) * .714))); }
  .deck-actions { margin-top: 18px; }
  .round { width: 56px; height: 56px; }
  .round.small { width: 44px; height: 44px; }
  .hint { display: none; }
  .segmented.small { flex-wrap: wrap; border-radius: 18px; }
  .segmented.small button { padding: 6px 9px; font-size: 10px; letter-spacing: .08em; }
  .sh { padding: 40px 22px 28px; }
  .sheet { max-height: 94vh; border-radius: 14px 14px 0 0; margin-bottom: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .deck-actions { gap: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .tcard, .view.is-active, .sheet[open] { transition: none !important; animation: none !important; }
}

/* ---------- Rechtliches ---------- */
.colophon p { margin: 0; }
.legal-links { margin-top: 12px; letter-spacing: .16em; }
.legal-links a { color: var(--muted); text-decoration: none; }
.legal-links a:hover { color: var(--ink); text-decoration: underline; }
.legal p { font-size: 17.5px; }
.missing { color: var(--accent); font-family: var(--sans); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; border: 1px dashed var(--accent); padding: 1px 6px; }
.sh-allergy { text-align: center; color: var(--muted); font-size: 14.5px; font-style: italic; margin: 10px auto 0; max-width: 460px; }

.install {
  margin-top: 16px; background: none; border: 1px solid var(--faint); border-radius: 999px; padding: 8px 18px;
  font-family: var(--sans); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink);
}
.install:hover { border-color: var(--ink); }
