/* ---------- Grundlagen ----------
   Farben und Schriften kommen aus dem gewählten Design (public/themen/*.css),
   das der Server unter /thema.css ausliefert. Die Werte hier sind nur ein Notfall-Standard. */
:root {
  --papier: #f6f0e6;
  --flaeche: #fffdf9;
  --tinte: #2b2118;
  --gedaempft: #7a6a5a;
  --linie: #e3d8c8;
  --akzent: #c4532d;
  --akzent-tief: #a3401f;
  --akzent-hell: #f6e1d6;
  --akzent-text: #c4532d;
  --auf-akzent: #ffffff;
  --erfolg: #3d7a4f;
  --fehler: #b3261e;

  --titel-schrift: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --titel-gewicht: 600;
  --titel-sperrung: 0;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --hand: "Bradley Hand", "Segoe Print", "Marker Felt", "Noteworthy", "Comic Sans MS", cursive;
  --hand-groesse: 1.15em;
  --kicker-transform: uppercase;
  --kicker-sperrung: 0.14em;

  --radius: 14px;

  --karte: #fbf8f2;
  --karte-tinte: #2b2118;
  --karte-gedaempft: #85776a;
  --karte-radius: 3px;
  --karte-polster: 12px 12px 16px;
  --karte-schatten: 0 1px 2px rgba(0, 0, 0, 0.18), 0 10px 28px rgba(0, 0, 0, 0.22);
  --foto-radius: 1px;
  --foto-hg: #e9e3d9;
  --zettel: #fdf6e3;
  --klebeband: rgba(214, 196, 160, 0.72);
  --drehung-faktor: 1;

  --leinwand-hg: #fffdf8;
  --leinwand-linie: #ece4d6;

  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--papier);
  color: var(--tinte);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
}

img {
  display: block;
  max-width: 100%;
}

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

.titel-schrift {
  font-family: var(--titel-schrift);
  font-weight: var(--titel-gewicht);
  letter-spacing: var(--titel-sperrung);
}

.versteckt {
  display: none !important;
}

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

/* ---------- Knöpfe ---------- */
.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 20px;
  border: 1.5px solid var(--linie);
  border-radius: 999px;
  background: var(--flaeche);
  color: var(--tinte);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.knopf:hover {
  border-color: var(--gedaempft);
}

.knopf:active {
  transform: scale(0.98);
}

.knopf:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--akzent);
  outline-offset: 2px;
}

.knopf-haupt {
  background: var(--akzent);
  border-color: var(--akzent);
  color: var(--auf-akzent);
}

.knopf-haupt:hover {
  background: var(--akzent-tief);
  border-color: var(--akzent-tief);
}

.knopf-klein {
  min-height: 38px;
  padding: 6px 14px;
  font-size: 15px;
}

.knopf[disabled] {
  opacity: 0.55;
  cursor: progress;
}

/* ---------- Karte (Wand, Export, Verwaltung) ---------- */
.karte {
  position: relative;
  background: var(--karte);
  color: var(--karte-tinte);
  padding: var(--karte-polster);
  border-radius: var(--karte-radius);
  box-shadow: var(--karte-schatten);
  transform: rotate(calc(var(--drehung, 0deg) * var(--drehung-faktor)));
}

.karte .foto {
  width: 100%;
  border-radius: var(--foto-radius);
  background: var(--foto-hg);
}

.karte .zeichnung {
  margin-top: 10px;
  background: var(--leinwand-hg);
  border-radius: var(--foto-radius);
}

.karte .foto + .zeichnung {
  margin-top: 12px;
}

.karte .zeichnung:first-child {
  margin-top: 0;
}

.karte .text {
  margin: 14px 4px 0;
  font-family: var(--hand);
  font-size: var(--hand-groesse);
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.karte .fuss {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 10px 4px 0;
  font-size: 0.82em;
  color: var(--karte-gedaempft);
}

.karte .name {
  font-family: var(--hand);
  font-size: var(--hand-groesse);
  color: var(--karte-tinte);
}

.karte .zeit {
  margin-left: auto;
  white-space: nowrap;
}

/* Nur-Text-Karten sehen aus wie ein Zettel mit Klebestreifen */
.karte.nur-text {
  padding-top: 26px;
  background: var(--zettel);
}

.karte.nur-text .text {
  margin-top: 0;
  font-size: calc(var(--hand-groesse) * 1.17);
}

.karte.nur-text::before {
  content: "";
  position: absolute;
  top: -11px;
  left: 50%;
  width: 92px;
  height: 24px;
  transform: translateX(-50%) rotate(-2deg);
  background: var(--klebeband);
}
