/* Erwachsene Fassung (Panel 05.10.): Buchschrift Lora statt Kritzelschrift, ein Papier für beide
   Kartenseiten, Karte liegt auf einem ruhigen Tisch-Ton, Farben aus dem Bild nur als Akzent. */
@font-face { font-family: "Lora"; src: url("fonts/lora.woff") format("woff"); font-weight: 400 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Lora"; src: url("fonts/lora-italic.woff") format("woff"); font-weight: 400 700; font-style: italic; font-display: swap; }

:root {
  --tisch: #ebe4d6;      /* Seitenhintergrund, dunkler als das Kartenpapier */
  --papier: #fcf8eb;     /* Papier im Bild, gemessen; beide Kartenseiten */
  --feld: #fffdf7;       /* Eingabefelder, eine Spur heller als das Papier */
  --tinte: #2b2622;
  --tinte-leise: #5f564e;
  --blau: #1d3557;       /* Tintenblau wie die Schrift im Bild, 11:1 auf Papier */
  --pink: #9c3d46;       /* Rosé für die Anrede, aus dem Strich im Bild abgedunkelt, 6,3:1 */
  --pink-stift: #c06868; /* Strichfarbe im Bild, gemessen */
  --gelb: #c9a46a;       /* Buchenholz */
  --blau-stift: #3d6a9e;
  --gruen: #3f6a2c;
  --rahmen: #948462;     /* Feldrahmen, 3:1 */
  --linie: #e0d4ba;      /* Haarlinien */
  --papier-hell: var(--feld); /* Kacheln auf links.html */
  --serif: "Lora", Georgia, "Times New Roman", serif;
  --hand: var(--serif);  /* früher Kritzelschrift; Klasse .hand heißt jetzt: kursive Buchschrift */
  --text: var(--serif);
  color-scheme: only light; /* Android „Websites abdunkeln“ soll die Karte nicht grau färben */
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* sonst schlägt z. B. .knopf { display } das hidden-Attribut */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  min-height: 100svh;
  display: flex; flex-direction: column;
  background: var(--tisch) radial-gradient(ellipse 90% 60% at 50% 0, #f4ecdb 0, transparent 70%) no-repeat;
  color: var(--tinte);
  font: 1.0625rem/1.65 var(--text);
  font-variant-numeric: lining-nums;
}
main { flex: 1 0 auto; }

.hand { font-family: var(--serif); font-style: italic; font-weight: 500; }

h1.hand, h2.hand { line-height: 1.2; margin: 0 0 .9rem; }
h1.hand { font-size: 2.1rem; color: var(--blau); }
h2.hand { font-size: 1.5rem; color: var(--blau); text-align: center; text-wrap: balance; }

a { color: var(--blau); text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: var(--rahmen); }

:focus-visible { outline: 3px solid var(--blau-stift); outline-offset: 3px; }
.bestaetigt:focus, .hinten:focus, .anrede:focus { outline: none; }

.nur-vorleser {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.zusammen { white-space: nowrap; }

.schmal { max-width: 34rem; margin: 0 auto; padding: 0 1.25rem; }
.mitte { text-align: center; padding-top: 18vh; }

/* ---------- Karte: vorne das Bild, hinten die ganze Einladung ---------- */
/* Breite so gedeckelt, dass Bild plus Knopf ohne Scrollen passen */
/* Breite so gedeckelt, dass Bild plus Knopf ohne Scrollen passen; beide Seiten gleich breit,
   im Querformat aber nie schmaler als 300 Pixel. Bild 1122x1402 = 0,8 */
.buehne { width: min(35rem, calc(100% - 2rem), max(18.75rem, calc((100vh - 10.5rem) * 0.8))); margin: clamp(.75rem, 4vh, 2.5rem) auto 0; }
.buehne { width: min(35rem, calc(100% - 2rem), max(18.75rem, calc((100svh - 10.5rem) * 0.8))); }
.vorne { width: 100%; }
.seite {
  border-radius: 3px;
  background: var(--papier);
  /* Kontakt-, Nah- und Streuschatten, warm wie Licht auf Karton */
  box-shadow: 0 1px 1px rgba(80, 60, 30, .10), 0 3px 8px rgba(80, 60, 30, .10), 0 18px 40px -12px rgba(80, 60, 30, .28);
}
.vorne img { display: block; width: 100%; height: auto; border-radius: 3px; }
.hinten { padding: 2rem 1.35rem 1.75rem; outline: none; }
@media (min-width: 30rem) { .hinten { padding: 2.5rem 2.25rem 2.25rem; } }

/* Drehung in zwei Hälften (Vorder- und Rückseite sind verschieden hoch), gesteuert von einladung.js */
.buehne { perspective: 1400px; perspective-origin: 50% min(50%, 45vh); }
.drehung { transform-origin: 50% 0; }
.buehne.dreht .drehung { will-change: transform; }

/* Mit JavaScript: immer nur eine Seite sichtbar */
.js .buehne:not(.offen) .hinten { display: none; }
.js .buehne.offen .vorne { display: none; }
/* Ohne JavaScript: Vorder- und Rückseite untereinander, alles bedienbar */
html:not(.js) .hinten { margin-top: 1rem; }
html:not(.js) .umdrehen { display: none; }

.umdrehen { text-align: center; margin: 1.5rem auto 0; padding: 0 1rem; transition: opacity .16s; }
.buehne.dreht ~ .umdrehen { opacity: 0; } /* Knopf wechselt seine Gestalt unsichtbar */
.buehne.offen ~ .umdrehen .knopf:active { transform: none; }
.umdrehen .knopf { text-decoration: none; min-width: 15rem; margin: 0; -webkit-appearance: none; appearance: none; }
.umdrehen-zeile { display: block; margin-top: .6rem; color: var(--tinte-leise); font-style: italic; }
.buehne.offen ~ .umdrehen .knopf {
  background: none; color: var(--blau); box-shadow: none; min-width: 0; min-height: 2.75rem;
  font-size: 1rem; font-weight: 400; font-style: italic;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--rahmen);
}
.buehne.offen ~ .umdrehen .umdrehen-zeile { display: none; }

/* ---------- Brief (oben auf der Rückseite) ---------- */
.brief p { margin: 0 0 1rem; }
.anrede { font-size: 1.75rem; line-height: 1.25; color: var(--blau); margin-bottom: .6rem !important; text-wrap: balance; }
.hinten p, .eckdaten dd, .ablauf-punkt { text-wrap: pretty; }
.eckdaten { margin: 1.25rem 0; display: grid; gap: .55rem; }
.eckdaten div { display: grid; grid-template-columns: 4.1rem 1fr; gap: .5rem; align-items: baseline; }
.eckdaten dt { font-size: .9rem; letter-spacing: .08em; text-transform: uppercase; color: var(--tinte-leise); }
.eckdaten dd { margin: 0; }
.eckdaten a { color: var(--tinte); }

/* Ablauf: Uhrzeit und Programmpunkt, links je eine kleine Zeichnung */
.ablauf { list-style: none; margin: 1.5rem 0 1.25rem; padding: 0; }
.ablauf li { position: relative; padding: 0 0 1rem 2.75rem; min-height: 2.2rem; }
.ablauf li:last-child { padding-bottom: 0; }
/* Kleine Strichzeichnungen statt Punkte, in Tintenblau wie die Schrift im Bild */
.ablauf-symbol {
  position: absolute; left: 0; top: .05rem; width: 1.9rem; height: 1.9rem;
  fill: none; stroke: var(--blau); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}
.ablauf-symbol .voll { fill: var(--blau); stroke: none; }
.ablauf-zeit { display: block; font-style: italic; color: var(--blau); line-height: 1.3; }
.ablauf-punkt { display: block; }

.gut-zu-wissen { color: var(--tinte-leise); font-style: italic; }
.gruss-ende { margin: 1.5rem 0 0 !important; text-align: right; }
.unterschrift { display: block; font-size: 1.3rem; color: var(--blau); margin-top: .35rem; }

/* ---------- Abschnitte: Haarlinie mit Herz statt Strichellinie ---------- */
.rueckmeldung { margin-top: 2.25rem; }
.bescheid { margin: -.4rem 0 1.25rem !important; text-align: center; }
.eckdaten .leise { display: block; font-size: .82rem; font-style: italic; color: var(--tinte-leise); }
.heiraten { color: var(--tinte); font-weight: 700; }
/* Ablauf links, gezeichnete Spiele aus dem Kartenbild direkt daneben (Panel Runde 6) */
.ablauf-rahmen { display: grid; grid-template-columns: minmax(0, max-content) auto; justify-content: start; align-items: center; column-gap: clamp(.75rem, 4vw, 1.5rem); }
.ablauf-rahmen .ablauf { margin: 1.5rem 0 1.25rem; }
.ablauf-bild { width: clamp(4rem, 18vw, 5.5rem); height: auto; } /* schrumpft am Handy, damit nichts über den Kartenrand ragt */
@media (max-width: 22.5rem) { .ablauf-rahmen { display: block; } .ablauf-bild { display: none; } } /* unter 360 px zu eng */
.rueckmeldung::before {
  content: ""; display: block; width: 4rem; margin: 0 auto 1.75rem; border-top: 1px solid var(--rahmen);
}

/* ---------- Rückmeldung als eingelegte Antwortkarte ---------- */
.aendern { margin: 0; }
.aendern > summary {
  cursor: pointer; color: var(--blau); font-style: italic; list-style: none;
  display: flex; align-items: center; justify-content: center; min-height: 2.75rem;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--rahmen);
}
.aendern > summary::-webkit-details-marker { display: none; }
.aendern[open] > summary { margin-bottom: 1rem; }
.aendern .formular { border: 0; box-shadow: none; padding: 0; background: none; }

.wahl { border: 0; padding: 0; margin: 0 0 1.25rem; display: grid; gap: .6rem; }
.wahl-feld {
  display: flex; align-items: center; gap: .8rem;
  min-height: 3.25rem; padding: .7rem 1rem;
  background: var(--feld);
  border: 1px solid var(--rahmen);
  border-radius: 3px;
  cursor: pointer;
  line-height: 1.3;
  transition: border-color .16s, background-color .16s;
}
/* Eigener Kreis statt Browser-Radio */
.wahl-feld input, .chip input {
  -webkit-appearance: none; appearance: none; margin: 0; flex: none;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  border: 1.5px solid var(--rahmen); background: var(--feld);
  display: grid; place-content: center;
}
.wahl-feld input::before { content: ""; width: .65rem; height: .65rem; border-radius: 50%; background: var(--blau); transform: scale(0); transition: transform .14s; }
.wahl-feld input:checked { border-color: var(--blau); }
.wahl-feld input:checked::before { transform: scale(1); }
.wahl-feld:has(input:checked) { border-color: var(--blau); }
.wahl-feld.nein:has(input:checked) { border-color: var(--tinte-leise); }
.wahl-feld.nein input:checked { border-color: var(--tinte-leise); }
.wahl-feld.nein input::before { background: var(--tinte-leise); }

.feld { margin-bottom: 1.25rem; }
.feld > label, .feld > .feld-titel { display: block; font-weight: 600; margin-bottom: .3rem; }
.optional { font-weight: 400; color: var(--tinte-leise); }

/* Personenzahl als antippbare Zahlen statt Auswahlliste */
.chips-feld { border: 0; padding: 0; margin: 0 0 1.25rem; min-width: 0; }
.chips-feld legend { padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; border: 0; padding: 0; margin: 0; }
.chip { position: relative; flex: 1 1 2.6rem; max-width: 3.75rem; } /* fünf passen auch bei 320 px in eine Reihe */
.chip span { min-width: 0 !important; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.chip span {
  display: grid; place-content: center; min-width: 2.9rem; min-height: 2.9rem; padding: 0 .6rem;
  border: 1px solid var(--rahmen); border-radius: 3px; background: var(--feld); font-size: 1.1rem;
  transition: background-color .14s, color .14s;
}
.chip input:checked + span { background: var(--blau); border-color: var(--blau); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--blau-stift); outline-offset: 2px; }

textarea, input[type="text"], input[type="number"], input[type="password"], select {
  width: 100%;
  font: inherit; font-size: 1rem; /* 16px: iOS zoomt sonst beim Antippen */
  color: var(--tinte);
  background: var(--feld);
  border: 1px solid var(--rahmen); border-radius: 3px;
  padding: .65rem .8rem;
}
select { width: auto; min-width: 6rem; }
textarea { resize: none; min-height: 5.5rem; field-sizing: content; }

.knopf {
  display: inline-block;
  font-family: var(--serif); font-size: 1.1rem; font-weight: 600; letter-spacing: .01em; line-height: 1.2;
  color: #fff; background: var(--blau);
  border: 0; border-radius: 3px;
  padding: .9rem 1.6rem; min-height: 3.25rem;
  cursor: pointer;
  box-shadow: 0 2px 6px -2px rgba(80, 60, 30, .35); /* warm wie der Kartenschatten */
  transition: background-color .12s, transform .08s;
}
@media (hover: hover) { .knopf:hover { background: #173c64; } }
.knopf:active { transform: translateY(1px); }
.knopf[disabled] { opacity: .7; cursor: default; }
.formular .knopf { width: 100%; text-align: center; text-decoration: none; padding-top: 1rem; }
.ohne-skript { text-align: center; }
.js .ohne-skript { display: none; }

/* Vorschau der Nachricht, die per WhatsApp oder Mail rausgeht */
.vorschau-nachricht { margin: 0 0 1.25rem; }
.vorschau-nachricht .feld-titel { font-weight: 600; margin: 0 0 .4rem; }
.sprechblase {
  margin: 0; padding: .75rem .95rem; white-space: pre-line;
  background: var(--feld); border: 1px solid var(--linie); border-radius: 3px; color: var(--tinte); line-height: 1.5;
}

.klein { font-size: .95rem; color: var(--tinte-leise); margin: .75rem 0 0; text-align: center; }
.feld-hilfe { font-size: .95rem; color: var(--tinte-leise); margin: 0 0 .45rem; }
.kontakt { margin-top: 1.5rem; text-align: center; color: var(--tinte-leise); }
.kontakt a { display: inline-block; padding: .4rem 0; white-space: nowrap; }
.wa-hinweis { margin: .6rem 0 0; }
.vorschau-nachricht { margin-top: .6rem !important; }
.senden-wa + .wa-hinweis + .vorschau-nachricht { margin-top: 1.25rem; }

.bestaetigt, .stand, .fehler, .hinweis { padding: .9rem 1rem; border-radius: 3px; margin: 0 0 1.25rem; }
.bestaetigt { color: var(--blau); font-size: 1.15rem; line-height: 1.45; text-align: center; padding: 0; }
.stand { padding: 0; text-align: center; color: var(--tinte-leise); }
.fehler { background: #fbe9ee; color: #8f1d40; border: 1px solid #efc3d0; }
.hinweis { background: var(--feld); border: 1px solid var(--linie); }

/* ---------- Würfel ---------- */
.wuerfel-bereich { text-align: center; margin: 0 0 1.5rem; }
.wuerfel-bereich .feld-titel { font-weight: 600; margin: 0 auto .3rem; } /* auto: sonst sitzt die 24rem-Box links und die Zeile wirkt verschoben */
.wuerfel-bereich > p { max-width: 24rem; margin: 0 auto; }
/* Bei „Nein“ hat der Würfel keinen Sinn */
.formular:has(input[name="kommt"][value="nein"]:checked) .wuerfel-bereich { display: none; }

.wuerfel {
  width: 5.25rem; height: 5.25rem; padding: 0; margin: .75rem auto 0; /* Würfelgröße */
  display: block; background: none; border: 0; cursor: pointer;
}
.wuerfel svg { width: 100%; height: 100%; overflow: visible; }
.w-flaeche { fill: var(--feld); stroke: #23324a; stroke-width: 3.5; }
.w-augen circle { fill: #23324a; }
.wuerfel:active svg { transform: scale(.95); }

.wuerfel.rollt svg { animation: rollen .8s cubic-bezier(.2, .8, .2, 1); }
@keyframes rollen {
  0%   { transform: rotate(0) scale(1); }
  30%  { transform: translateY(-12px) rotate(160deg) scale(.85); }
  70%  { transform: rotate(330deg) scale(1.06); }
  85%  { transform: rotate(355deg) scale(.97, 1.02); }
  100% { transform: rotate(360deg) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .wuerfel.rollt svg { animation: none; }
  .wahl-feld, .chip span, .knopf { transition: none; }
}

.wuerfel-ergebnis { font-size: 1.05rem; line-height: 1.4; color: var(--tinte-leise); min-height: 3.6rem; margin: .9rem 0 0; font-style: italic; }
.wuerfel-ergebnis strong { display: block; font-weight: 500; font-size: 1.25rem; color: var(--blau); }

/* ---------- Textseiten und Fuß ---------- */
.text { padding-top: 2.5rem; padding-bottom: 2rem; }
.text h2 { font-size: 1.15rem; margin: 1.75rem 0 .35rem; }
.entwurf { background: #fff2c9; padding: .5rem .8rem; border-radius: 8px; display: inline-block; }

.fuss { text-align: center; padding: 2.5rem 1rem 1.5rem; font-size: .85rem; }
.fuss a { color: var(--tinte-leise); }

/* ---------- Gästeliste (nur für das Brautpaar) ---------- */
.admin { max-width: 46rem; margin: 0 auto; padding: 1.5rem 1rem 3rem; }
.admin-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.admin-login { text-align: left; margin-top: 1.5rem; }
.klein-meldung { font-size: 1.1rem; }

.link-knopf {
  font: inherit; font-size: .95rem; color: var(--blau);
  background: var(--papier-hell); border: 1px solid #cdbf9f; border-radius: 8px;
  padding: .5rem .8rem; min-height: 2.5rem; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center;
}
.link-knopf.gefahr { color: #8f1d40; border-color: #e3b3c2; margin-top: .5rem; }

.zahlen { display: grid; grid-template-columns: repeat(2, 1fr); gap: .5rem; margin: 1rem 0 1.5rem; }
@media (min-width: 36rem) { .zahlen { grid-template-columns: repeat(3, 1fr); } }
/* Wer kommt, wer nicht, wer fehlt: kurze Namenslisten über der ausführlichen Liste */
.uebersicht { display: grid; gap: .5rem; margin: 0 0 1.5rem; }
@media (min-width: 36rem) { .uebersicht { grid-template-columns: repeat(3, 1fr); align-items: start; } }
.uebersicht-teil { background: var(--papier-hell); border-radius: 12px; padding: .7rem .9rem; border-left: 5px solid #cdbf9f; }
.uebersicht-teil.status-zu { border-left-color: var(--gruen); }
.uebersicht-teil.status-ab { border-left-color: var(--pink-stift); }
.uebersicht-teil h2 { font-size: 1rem; margin: 0 0 .4rem; }
.uebersicht-teil ul { list-style: none; margin: 0; padding: 0; font-size: .95rem; line-height: 1.5; }
.zahlen div { background: var(--papier-hell); border-radius: 12px; padding: .7rem .9rem; }
.zahlen dt { font-size: .85rem; color: var(--tinte-leise); }
.zahlen dd { margin: 0; font-family: var(--hand); font-size: 2rem; line-height: 1.1; color: var(--blau); }
.zahlen small { font-size: 1rem; color: var(--tinte-leise); }

.neu, .bearbeiten { margin: 0 0 1rem; }
.neu summary, .bearbeiten summary { cursor: pointer; color: var(--blau); font-weight: 600; padding: .4rem 0; }
.neu { background: var(--papier-hell); border-radius: 12px; padding: .5rem 1rem; }
.reihe { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-top: .5rem; }
.reihe .feld { margin-bottom: 0; width: 6rem; }
.reihe .feld.breit { flex: 1 1 14rem; }
.reihe .knopf { font-size: 1.2rem; padding: .6rem 1.2rem; min-height: 2.9rem; }

.gaeste { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.gast { background: var(--papier-hell); border-radius: 12px; padding: .9rem 1rem; border-left: 5px solid #cdbf9f; }
.gast.status-zu { border-left-color: var(--gruen); }
.gast.status-ab { border-left-color: var(--pink-stift); }
.gast-kopf { display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap; }
.marke { font-size: .9rem; color: var(--tinte-leise); }
.status-zu .marke { color: var(--gruen); font-weight: 600; }
.gast-info { font-size: .9rem; color: var(--tinte-leise); }
.gast blockquote { margin: .5rem 0; padding: .4rem .8rem; border-left: 3px solid var(--gelb); background: var(--papier); }
.gast-link { display: flex; gap: .4rem; margin-top: .6rem; flex-wrap: wrap; }
.gast-link input { flex: 1 1 12rem; width: auto; font-size: 1rem; padding: .4rem .6rem; }

/* Antwort per WhatsApp: großer Knopf, darunter der normale Weg als schlichter Textlink */
.formular .ohne-wa {
  display: block; margin: 1rem auto 0; min-height: 2.75rem;
  background: none; border: 0; color: var(--blau); font-style: italic;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: var(--rahmen);
}
