@charset "utf-8";

/* ==========================================================================
   Der Kult der Ewigen Erdnuss — Stilblatt für das Bild zum Teilen

   Diese Seite wird nicht gedruckt. Das Flugblatt selbst entsteht auf einem
   <canvas> in js/teilbild.js — hier steht nur, was der Bildschirm braucht:
   die Schriften (damit der Browser sie lädt und das Skript sie auf dem
   Canvas benutzen darf), die Werkzeugleiste und der Rahmen um die Vorschau.

   Die Werkzeugleiste ist Zeile für Zeile dieselbe wie bei spickzettel.css
   und plakat.css — gleiche Klassen, gleiche Farben, gleiche Maße.

   Aufbau:
     1. Schriften
     2. Farben und Grundwerte
     3. Werkzeugleiste
     4. Fehlermeldung
     5. Bühne und Vorschau
   ========================================================================== */

/* ==========================================================================
   1. Schriften — selbst ausgeliefert (OFL, siehe assets/fonts/LIZENZ.txt)
   ------------------------------------------------------------------------
   Wichtig für das Canvas: Eine Schrift steht dort erst zur Verfügung, wenn
   sie wirklich geladen ist. Das Skript holt sie deshalb vorher mit
   document.fonts.load() — die @font-face-Regeln hier sind die Grundlage
   dafür. „font-display: block“ ist Absicht: kein Blitzer mit Ersatzschrift.
   ========================================================================== */
@font-face { font-family: "IM Fell English"; font-style: normal; font-weight: 400; font-display: block; src: url("../assets/fonts/im-fell-english.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English"; font-style: italic; font-weight: 400; font-display: block; src: url("../assets/fonts/im-fell-english-italic.woff2") format("woff2"); }
@font-face { font-family: "IM Fell English SC"; font-style: normal; font-weight: 400; font-display: block; src: url("../assets/fonts/im-fell-english-sc.woff2") format("woff2"); }
@font-face { font-family: "Pirata One"; font-style: normal; font-weight: 400; font-display: block; src: url("../assets/fonts/pirata-one.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Pirata One"; font-style: normal; font-weight: 400; font-display: block; src: url("../assets/fonts/pirata-one-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ==========================================================================
   2. Farben und Grundwerte
   ========================================================================== */
:root {
  --papier:        #fbf6ea;
  --tinte:         #2a1f14;

  --font-kapitel: "IM Fell English SC", "Pirata One", Georgia, serif;
  --font-text:    "IM Fell English", Georgia, "Times New Roman", serif;
}

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

body {
  margin: 0;
  padding: 0 0 4rem;
  font-family: var(--font-text);
  color: var(--tinte);
  background: #4a3a28;
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(255, 248, 230, .18), rgba(255, 248, 230, 0) 60%);
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   3. Werkzeugleiste
   ========================================================================== */
.werkzeugleiste {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .9rem 1.4rem;
  position: sticky;
  top: 0;
  z-index: 10;
  margin: 0 0 2rem;
  padding: .9rem 1.2rem;
  background: #2a1f14;
  color: #f3e6c8;
  box-shadow: 0 6px 20px -10px rgba(0, 0, 0, .9);
}
.werkzeugleiste a,
.werkzeugleiste p,
.werkzeugleiste button,
.werkzeugleiste select {
  font-family: var(--font-kapitel);
  margin: 0;
}
.wz-zurueck { color: #e6d3ac; text-decoration: none; font-size: 1.05rem; }
.wz-zurueck:hover, .wz-zurueck:focus-visible { color: #fff; text-decoration: underline; }
.wz-status { flex: 1 1 12rem; color: #f3e6c8; font-size: 1.05rem; letter-spacing: .04em; }

/* Das Motiv steht in einer Klappliste: fünf Zeilen wären als Knopfreihe
   eine halbe Leiste lang und auf dem Handy nicht mehr zu bedienen. */
.wz-feld {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
}
.wz-feld-name {
  font-family: var(--font-kapitel);
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #c9b894;
}
.wz-feld select {
  min-height: 40px;
  padding: .3em .7em;
  font-size: 1.05rem;
  color: #f3e6c8;
  background: #3a2c1d;
  border: 1px solid #6b3f18;
  border-radius: 4px;
  cursor: pointer;
}

.wz-wahl {
  display: flex;
  align-items: center;
  gap: .2rem 1rem;
  margin: 0;
  padding: .2rem .9rem .4rem;
  border: 1px solid #6b3f18;
  border-radius: 4px;
}
.wz-wahl legend {
  padding: 0 .4rem;
  font-family: var(--font-kapitel);
  font-size: .85rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #c9b894;
}
.wz-wahl label {
  display: flex;
  align-items: center;
  gap: .4rem;
  min-height: 40px;
  font-family: var(--font-kapitel);
  font-size: 1.05rem;
  color: #f3e6c8;
  cursor: pointer;
}
.wz-wahl input { width: 1.1rem; height: 1.1rem; accent-color: #a5652c; cursor: pointer; }

.wz-schalter {
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  font-family: var(--font-kapitel);
  font-size: 1.05rem;
  color: #f3e6c8;
  cursor: pointer;
}
.wz-schalter input { width: 1.1rem; height: 1.1rem; accent-color: #a5652c; cursor: pointer; }

.wz-knopf {
  min-height: 44px;
  padding: .5em 1.3em;
  font-size: 1.05rem;
  letter-spacing: .06em;
  color: #fbfaf4;
  background: linear-gradient(180deg, #a5652c, #6b3f18);
  border: 2px solid #c98a4b;
  border-radius: 4px;
  cursor: pointer;
}
.wz-knopf:hover:not(:disabled), .wz-knopf:focus-visible:not(:disabled) { background: #a5652c; }
.wz-knopf:disabled { opacity: .5; cursor: default; }

.wz-hinweis { flex: 1 1 100%; font-size: .9rem; line-height: 1.45; color: #c9b894; }
.wz-hinweis code { font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; color: #e6d3ac; }

:focus-visible { outline: 3px solid #c98a4b; outline-offset: 3px; }

/* ==========================================================================
   4. Fehlermeldung
   ========================================================================== */
.teil-fehler:not([hidden]) {
  display: block;
  max-width: 46rem;
  margin: 0 auto 2rem;
  padding: 1rem 1.2rem;
  font-size: 1.05rem;
  line-height: 1.5;
  color: #fbe9e3;
  background: #8c3b24;
  border: 2px solid #c07a63;
  border-radius: 4px;
}

/* ==========================================================================
   5. Bühne und Vorschau
   ------------------------------------------------------------------------
   Das Canvas hat feste Pixelmaße (1080 breit), die Vorschau zeigt es nur
   kleiner an. Die Geräteauflösung ist dabei egal: Heruntergeladen wird
   immer das Canvas selbst, nicht das, was der Bildschirm zeigt.
   ========================================================================== */
.teil-buehne {
  display: flex;
  justify-content: center;
  padding: 0 1rem;
}

.teil-bild {
  display: block;
  width: 100%;
  max-width: 540px;
  height: auto;
  background: var(--papier);
  box-shadow: 0 14px 34px -18px rgba(0, 0, 0, .95);
}
