/* Fotofäscht – Gestaltung (Entwurf Code, 27.11.2026).
   Idee: Fotos als Papierabzüge. Ein gewähltes Foto liegt als Abzug auf dem Tisch und «entwickelt» sich
   beim Hochladen von Grau zu Farbe. Sonst ruhig: Weiss, Nachtviolett, Blitzgelb für die eine Handlung. */

:root {
  --nacht: #241a3d;
  --nacht-70: #5b5470;
  --gelb: #ffd43b;
  --gelb-dunkel: #f2c21f;
  --pink: #f0457d;
  --mint: #1fa98b;
  --lila: #f3eefa;
  --linie: #ddd5ea;
  --rot: #b3261e;
  --weiss: #ffffff;
  --rund: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Quicksand", system-ui, "Segoe UI", sans-serif;
  --text: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mass: 4.5rem;
}

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

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

body {
  margin: 0;
  background: var(--weiss);
  color: var(--nacht);
  font: 400 1.0625rem/1.5 var(--text);
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

[hidden] { display: none !important; }

h1, h2, h3 { font-family: var(--rund); font-weight: 800; line-height: 1.08; margin: 0; letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: clamp(2.1rem, 8.5vw, 3.6rem); }
h2 { font-size: clamp(1.4rem, 4.5vw, 1.75rem); }
h3 { font-size: 1.125rem; }
p { margin: 0; max-width: 62ch; text-wrap: pretty; }

a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 0.09em; }
a:hover { text-decoration-thickness: 0.16em; }

:focus-visible { outline: 3px solid var(--nacht); outline-offset: 3px; border-radius: 4px; }
.auf-gelb :focus-visible, .knopf:focus-visible { outline-color: var(--nacht); box-shadow: 0 0 0 6px var(--weiss); }

.blatt { width: 100%; max-width: 44rem; margin: 0 auto; padding: 0 1.25rem; }

/* ---------- Kopf und Fuss ---------- */

.kopf { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1rem; }
.marke { font: 800 1.25rem/1 var(--rund); text-decoration: none; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.marke img { width: 30px; height: 30px; border-radius: 8px; }
.sprache { font: 600 0.9375rem/1 var(--text); background: none; border: 0; color: inherit; padding: 0.75rem 0.25rem; min-height: 44px; cursor: pointer; text-decoration: underline; text-underline-offset: 0.18em; }

.fuss { margin-top: auto; padding-block: 2.5rem 2rem; font-size: 0.9375rem; color: var(--nacht-70); display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.fuss a { display: inline-block; padding-block: 0.6rem; }

.testmodus { background: var(--nacht); color: var(--weiss); font-size: 0.9375rem; padding: 0.6rem 1.25rem; text-align: center; }

/* ---------- Bausteine ---------- */

.knopf {
  appearance: none; border: 0; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3.25rem; padding: 0.75rem 1.5rem; border-radius: 999px;
  background: var(--gelb); color: var(--nacht);
  font: 800 1.125rem/1.1 var(--rund);
  box-shadow: 0 3px 0 var(--nacht);
  transition: transform 0.08s ease, box-shadow 0.08s ease, background-color 0.15s ease;
}
.knopf:hover { background: var(--gelb-dunkel); }
.knopf:active { transform: translateY(3px); box-shadow: 0 0 0 var(--nacht); }
.knopf[disabled] { opacity: 0.55; cursor: default; box-shadow: none; }
.knopf.gross { width: 100%; min-height: 4rem; font-size: 1.3125rem; }
.knopf.still { background: var(--weiss); box-shadow: inset 0 0 0 2px var(--nacht); font-size: 1rem; min-height: 2.875rem; padding: 0.5rem 1.125rem; }
.knopf.still:hover { background: var(--lila); }
.knopf.still:active { transform: none; }
.knopf.ernst { background: var(--weiss); color: var(--rot); box-shadow: inset 0 0 0 2px var(--rot); font-size: 1rem; min-height: 2.875rem; }
.knopf.ernst:hover { background: #fdecea; }
.knopf.ernst:active { transform: none; }

.reihe { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.feld { display: grid; gap: 0.375rem; }
.feld label, .feld legend { font: 700 1rem/1.3 var(--text); padding: 0; }
.feld .hinweis { font-size: 0.9375rem; color: var(--nacht-70); }
.feld input[type="text"], .feld input[type="date"], .feld input[type="password"], .feld textarea {
  width: 100%; font: inherit; font-size: 1.0625rem; color: var(--nacht);
  background: var(--weiss); border: 2px solid var(--nacht); border-radius: 12px;
  padding: 0.7rem 0.875rem; min-height: 3.125rem;
}
.feld textarea { min-height: 7rem; resize: vertical; }
.feld input:focus-visible, .feld textarea:focus-visible { outline-offset: 2px; }
fieldset.feld { border: 0; margin: 0; padding: 0; min-width: 0; }
.wahl { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; }
.wahl label { font-weight: 400; display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; }
.wahl input { width: 1.25rem; height: 1.25rem; accent-color: var(--nacht); }

.meldung { border-radius: 12px; padding: 0.875rem 1rem; background: var(--lila); font-weight: 500; }
.meldung.gut { background: #e3f6f0; }
.meldung.schlecht { background: #fdecea; color: #7a1712; }
.meldung.warnung { background: #fff4c7; }
.fehlertext { color: var(--rot); font-weight: 600; font-size: 0.9375rem; }

.stapel { display: grid; gap: 1rem; }
.stapel.weit { gap: 1.5rem; }

/* ---------- Startseite ---------- */

.auftakt { background: var(--gelb); padding-block: 0.5rem 3.5rem; position: relative; overflow: hidden; }
.auftakt h1 { margin-top: 1.5rem; max-width: 12ch; }
.auftakt .vorspann { margin-top: 1.25rem; font-size: 1.1875rem; max-width: 34ch; font-weight: 500; }
.auftakt .abzuege { position: absolute; right: max(-1.5rem, calc(50% - 26rem)); bottom: -2.25rem; width: 11.5rem; height: 12rem; pointer-events: none; }
.auftakt .abzuege span { position: absolute; background: var(--weiss); padding: 0.5rem 0.5rem 1.75rem; box-shadow: 0 6px 16px rgba(36, 26, 61, 0.18); }
.auftakt .abzuege span::before { content: ""; display: block; width: 100%; height: 100%; }
.auftakt .abzuege span:nth-child(1) { width: 6.5rem; height: 8rem; left: 0; top: 2rem; transform: rotate(-9deg); }
.auftakt .abzuege span:nth-child(1)::before { background: var(--mint); }
.auftakt .abzuege span:nth-child(2) { width: 7rem; height: 8.5rem; right: 0; top: 0; transform: rotate(7deg); }
.auftakt .abzuege span:nth-child(2)::before { background: var(--pink); }
@media (max-width: 30rem) { .auftakt .abzuege { opacity: 0.9; width: 8.5rem; right: -1.75rem; transform: scale(0.8); transform-origin: bottom right; } .auftakt .vorspann { max-width: 26ch; } }

.abschnitt { padding-block: 2.75rem 0; }
.abschnitt > h2 { margin-bottom: 1.25rem; }

.schritte { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.875rem; counter-reset: schritt; }
.schritte li { counter-increment: schritt; display: grid; grid-template-columns: 2.25rem 1fr; gap: 0.75rem; align-items: start; font-weight: 500; }
.schritte li::before { content: counter(schritt); width: 2.25rem; height: 2.25rem; border-radius: 50%; background: var(--nacht); color: var(--gelb); font: 800 1.0625rem/2.25rem var(--rund); text-align: center; }
.schritte li span { padding-top: 0.3rem; }
.randnotiz { color: var(--nacht-70); font-size: 0.9375rem; }

.formular { background: var(--lila); border-radius: 20px; padding: 1.5rem 1.25rem; display: grid; gap: 1.25rem; }
@media (min-width: 40rem) { .formular { padding: 2rem; } }

.albenliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }
.albenliste li { border: 2px solid var(--linie); border-radius: 14px; padding: 0.75rem 1rem; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; }
.albenliste strong { font-family: var(--rund); font-weight: 800; }
.albenliste small { display: block; color: var(--nacht-70); font-size: 0.9375rem; }
.textknopf { background: none; border: 0; padding: 0.6rem 0; min-height: 44px; font: inherit; font-size: 0.9375rem; color: var(--nacht-70); text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer; }

/* ---------- Verwaltung ---------- */

.titelblock { padding-block: 1rem 0.5rem; }
.titelblock h1 { font-size: clamp(1.9rem, 7vw, 2.75rem); overflow-wrap: anywhere; }
.titelblock p { margin-top: 0.5rem; color: var(--nacht-70); font-weight: 500; }

.kasten { border-top: 2px solid var(--nacht); padding-block: 1.5rem 0.5rem; display: grid; gap: 1rem; }
.kasten.hervor { border: 0; background: var(--gelb); border-radius: 20px; padding: 1.5rem 1.25rem; }
.kasten > h2 { font-size: 1.375rem; }

.linkfeld { font: 500 0.9375rem/1.4 ui-monospace, "SF Mono", Menlo, Consolas, monospace; background: var(--lila); border-radius: 12px; padding: 0.75rem 0.875rem; overflow-wrap: anywhere; user-select: all; }

.qrzeile { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 36rem) { .qrzeile { grid-template-columns: 11rem 1fr; } }
.qrbild { width: 11rem; height: 11rem; border: 2px solid var(--nacht); border-radius: 12px; padding: 0.375rem; background: var(--weiss); image-rendering: pixelated; }

.zaehler { font: 800 clamp(1.75rem, 7vw, 2.5rem)/1.1 var(--rund); font-variant-numeric: tabular-nums; }
.balken { height: 0.75rem; border-radius: 999px; background: var(--lila); overflow: hidden; }
.balken span { display: block; height: 100%; width: 100%; background: var(--nacht); border-radius: 999px; transform-origin: left; transform: scaleX(var(--anteil, 0)); transition: transform 0.4s ease; }

.meldeliste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.meldeliste li { background: var(--lila); border-radius: 12px; padding: 0.75rem 1rem; }
.meldeliste time, .meldeliste small { display: block; font-size: 0.875rem; color: var(--nacht-70); }

dialog { border: 0; border-radius: 20px; padding: 1.5rem 1.25rem; width: min(30rem, calc(100vw - 2rem)); color: var(--nacht); }
dialog::backdrop { background: rgba(36, 26, 61, 0.55); }
dialog form { display: grid; gap: 1rem; }

/* ---------- Hochladen (Gäste) ---------- */

.gast-kopf { background: var(--gelb); padding-block: 0.25rem 2rem; }
.gast-kopf h1 { margin-top: 1rem; font-size: clamp(1.9rem, 8vw, 3rem); overflow-wrap: anywhere; }
.gast-kopf .datum { margin-top: 0.5rem; font-weight: 600; }
.gast-kopf .vorspann { margin-top: 0.75rem; font-weight: 500; }
.gast-haupt { padding-top: 1.5rem; display: grid; gap: 1.25rem; }

.dateiwahl { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.dateiwahl:focus-visible + .knopf { outline: 3px solid var(--nacht); outline-offset: 3px; }

.fortschritt { font: 800 1.1875rem/1.2 var(--rund); font-variant-numeric: tabular-nums; }

.abzuege-liste { list-style: none; margin: 0; padding: 0.5rem 0.25rem 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr)); gap: 1.125rem 0.875rem; }
.abzug { position: relative; background: var(--weiss); padding: 0.375rem 0.375rem 1.875rem; box-shadow: 0 2px 10px rgba(36, 26, 61, 0.2), 0 0 0 1px rgba(36, 26, 61, 0.06); transform: rotate(var(--dreh, 0deg)); }
.abzug:nth-child(3n + 1) { --dreh: -1.6deg; }
.abzug:nth-child(3n + 2) { --dreh: 1.1deg; }
.abzug:nth-child(4n) { --dreh: -0.6deg; }
.abzug .bild { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--linie); filter: grayscale(calc(1 - var(--stand, 0))) brightness(calc(1.25 - 0.25 * var(--stand, 0))); transition: filter 0.3s linear; }
.abzug .stand { position: absolute; left: 0.375rem; right: 0.375rem; bottom: 0.3rem; font-size: 0.75rem; line-height: 1.25rem; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abzug .lauf { position: absolute; left: 0.375rem; right: 0.375rem; bottom: 1.75rem; height: 4px; background: var(--gelb); transform-origin: left; transform: scaleX(var(--stand, 0)); transition: transform 0.2s linear; }
.abzug[data-zustand="fertig"] .lauf { background: var(--mint); }
.abzug[data-zustand="fertig"] .stand { color: #0b6b56; }
.abzug[data-zustand="fehler"] .stand { color: var(--rot); }
.abzug[data-zustand="fehler"] .bild { filter: grayscale(1) brightness(1.1); }
.abzug[data-zustand="fehler"] .lauf { background: var(--rot); transform: scaleX(1); }
.abzug .nochmal { position: absolute; inset: 0; width: 100%; background: rgba(255, 255, 255, 0.82); border: 0; font: 700 0.8125rem/1.2 var(--text); color: var(--nacht); cursor: pointer; padding: 0.5rem; text-decoration: underline; }
.abzug .grund { position: absolute; inset: 0.375rem 0.375rem 1.875rem; display: grid; place-items: center; padding: 0.25rem; background: rgba(255, 255, 255, 0.9); font-size: 0.6875rem; line-height: 1.25; text-align: center; color: #7a1712; }

.kleingedrucktes { font-size: 0.9375rem; color: var(--nacht-70); display: grid; gap: 0.25rem; }
.kleingedrucktes .reihe { gap: 0 1.5rem; }
.kleingedrucktes a, .kleingedrucktes .textknopf { color: var(--nacht); }

/* Rechtstexte (Entwurf) */
.fliesstext { padding-block: 1rem 0; display: grid; gap: 1rem; }
.fliesstext h1 { font-size: clamp(1.9rem, 7vw, 2.75rem); }
.fliesstext h2 { font-size: 1.25rem; margin-top: 0.75rem; }
.fliesstext ul { margin: 0; padding-left: 1.25rem; max-width: 62ch; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  .abzug { transform: none; }
}

.fliesstext ul.meldeliste { padding-left: 0; max-width: none; }
