/* Basis für alle Seiten: Farben (hell/dunkel), Schrift, Tasten, Felder, Hinweis-Leiste, Fußzeile.
   Alle Farben stehen als Variablen oben; Dunkel schaltet der Browser automatisch um. */
:root {
  color-scheme: light dark;
  --bg: #faf7f2;
  --ink: #1f2933;
  --muted: #6b7280;
  --line: #e5ded3;
  --card: #ffffff;
  --accent: #c2410c;
  --accent-ink: #ffffff;
  --ok: #15803d;
  --warn-bg: #fef3c7;
  --danger: #b91c1c;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17140f;
    --ink: #f3ede4;
    --muted: #a8a095;
    --line: #3a342b;
    --card: #221e17;
    --accent: #fb923c;
    --accent-ink: #1a1208;
    --ok: #4ade80;
    --warn-bg: #4a3a0b;
    --danger: #f87171;
  }
}

* {
  box-sizing: border-box;
}

/* Das hidden-Attribut muss immer gewinnen, auch gegen display: grid/flex weiter unten */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font:
    16px/1.45 system-ui,
    -apple-system,
    "Segoe UI",
    sans-serif;
}

:where(h1, h2, h3, p, ul) {
  margin: 0;
  padding: 0;
}

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

button {
  cursor: pointer;
}

#app {
  max-width: 1100px;
  margin-inline: auto;
  padding: 1rem 16px;
  overflow-wrap: anywhere;
}

#app.schmal {
  max-width: 40rem;
}

h1 {
  font-size: clamp(1.5rem, 5vw, 2rem);
  line-height: 1.15;
}

h2 {
  font-size: 1.2rem;
}

.h2 {
  font-size: 1.2rem;
}

.gedaempft {
  color: var(--muted);
}

.klein {
  font-size: 0.85rem;
}

.ok {
  font-weight: 600;
  color: var(--ok);
}

.fehler {
  font-weight: 600;
  color: var(--danger);
}

/* Sichtbarer Fokus für Tastatur-Nutzer */
:is(a, button, input, summary):focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* Tasten: mindestens 44 px hoch (2.75rem) */
.knopf,
.haupt,
.verweis,
.icon {
  min-height: 2.75rem;
  font-weight: 600;
  border-radius: 10px;
}

.knopf {
  padding: 0.5rem 1rem;
  background: var(--card);
  border: 2px solid var(--line);
}

.haupt {
  padding: 0.5rem 1rem;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--accent);
}

.verweis {
  padding: 0.25rem 0.5rem;
  text-align: left;
  text-decoration: underline;
  background: none;
  border: 0;
}

.icon {
  flex: none;
  width: 2.75rem;
  padding: 0;
  background: none;
  border: 1px solid var(--line);
}

/* Links, die wie Tasten aussehen ("Noch mal spenden") */
a.haupt,
a.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Eingabefelder mit Beschriftung */
.feld {
  display: grid;
  gap: 0.25rem;
}

.feld label {
  font-size: 0.9rem;
  font-weight: 600;
}

.feld input {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.4rem 0.7rem;
  font-size: 1rem;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 10px;
}

/* Hinweis-Leiste (z. B. "jemand anderes war schneller") */
.hinweis {
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0;
  background: var(--warn-bg);
  border-radius: 10px;
}

/* Fortschrittsbalken: grün = bezahlt, orange = in deinem Beitrag (Breiten setzt das Skript) */
.balken {
  display: flex;
  height: 0.8rem;
  overflow: hidden;
  background: var(--line);
  border-radius: 999px;
}

.balken-bezahlt {
  background: var(--ok);
}

.balken-korb {
  background: var(--accent);
}

/* Fußzeile */
.fuss {
  display: grid;
  gap: 0.4rem;
  max-width: 1100px;
  padding: 1rem 16px 2rem;
  margin-inline: auto;
  font-size: 0.85rem;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.fuss ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  list-style: none;
}
