/* Farben, Schriften und Rundungen aus der App (web/app/tokens.css). */
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-400.woff') format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-600.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Inter'; src: url('/fonts/Inter-700.woff') format('woff'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Anton'; src: url('/fonts/Anton-400.woff') format('woff'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --grund: #1b1815;
  --flaeche: #25211d;
  --flaeche-tief: #141210;
  --rahmen: #857b70;
  --text: #f4eee7;
  --text-2: #bdb3a8;
  --glut: #e8703f;
  --glut-druck: #d15f30;
  --fehler: #f4a3a0;
  --papier: #f3ece2;
  --papier-text: #2a2520;
  --papier-text-2: #5f564d;
  --papier-linie: #d3c7b8;
  --fokus: 0 0 0 2px #1b1815, 0 0 0 4px #a9bde8;
  --rand: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--grund); color: var(--text); font: 400 16px/24px 'Inter', system-ui, sans-serif; -webkit-text-size-adjust: 100%; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: 4px; }
h1:focus-visible { box-shadow: none; }

.seite { min-height: 100dvh; display: flex; flex-direction: column; }
.foto { display: block; width: 100%; height: 230px; object-fit: cover; object-position: 50% 38%; }
.inhalt { flex: 1; display: flex; flex-direction: column; gap: 28px; width: 100%; max-width: 560px; margin: 0 auto;
  padding: 24px var(--rand) max(24px, env(safe-area-inset-bottom)); }
.marke { display: inline-flex; align-items: center; gap: 12px; align-self: flex-start; min-height: 44px; font-weight: 600; text-decoration: none; }

h1 { font: 400 44px/1.06 'Anton', 'Impact', 'Arial Narrow', sans-serif; text-transform: uppercase; text-wrap: balance; }
.einleitung { margin-top: 12px; color: var(--text-2); }

form { display: grid; gap: 20px; margin-top: 28px; }
.felder { display: grid; grid-template-columns: 3fr 2fr; gap: 12px; }
label { display: grid; gap: 8px; min-width: 0; font-size: 15px; font-weight: 600; }
input { width: 100%; height: 56px; padding: 0 16px; border: 1.5px solid var(--rahmen); border-radius: 10px; background: var(--flaeche-tief);
  color: var(--text); font: 600 20px/1 'Inter', system-ui, sans-serif; font-variant-numeric: tabular-nums; }
input::placeholder { color: #8d8378; font-weight: 400; }
input:focus-visible { border-radius: 10px; }
input[aria-invalid='true'] { border-color: var(--fehler); }
.meldung { color: var(--fehler); }

.knopf { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px;
  background: var(--glut); color: var(--grund); font: 700 16px/20px 'Inter', system-ui, sans-serif; text-decoration: none; cursor: pointer; transition: transform 120ms, background-color 120ms; }
.knopf:active { background: var(--glut-druck); transform: scale(.98); }
.knopf:focus-visible, .kopieren:focus-visible { border-radius: 999px; }
.knopf[aria-busy='true'] { background: var(--flaeche); color: var(--text); cursor: progress; }
.textknopf { align-self: flex-start; min-height: 44px; margin-top: 20px; padding: 0; border: 0; background: none; color: var(--text);
  font: 600 15px/20px 'Inter', system-ui, sans-serif; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }

#gruppen { display: grid; gap: 36px; margin-top: 28px; }
.gruppe { display: grid; gap: 12px; }
.gruppe h2 { font: 700 18px/24px 'Inter', system-ui, sans-serif; }
.frei { display: flex; align-items: center; gap: 14px; color: var(--text-2); font-size: 15px; line-height: 22px; }
.frei img { width: 40px; height: 57px; object-fit: cover; border-radius: 3px; }

/* Ein Code ist ein Blatt Papier, wie die Zugangskarte im Buch. */
.karte { display: grid; grid-template-columns: 96px minmax(0, 1fr); min-height: 164px; overflow: hidden; border-radius: 6px; background: var(--papier); color: var(--papier-text); }
.bild { position: relative; display: grid; place-items: center; background: var(--flaeche-tief); }
.bild img { position: absolute; width: 62px; height: 88px; object-fit: cover; border-radius: 3px; }
.bild--zwei img:first-child { transform: translate(-9px, -14px); }
.bild--zwei img:last-child { transform: translate(9px, 14px); box-shadow: 0 0 0 2px var(--flaeche-tief); }
.bild img.logo { width: 46px; height: 70px; object-fit: contain; border-radius: 0; }
.daten { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px 10px 14px 16px; }
.daten h3 { font: 700 17px/22px 'Inter', system-ui, sans-serif; }
.code { font: 700 clamp(14px, 4vw, 16px)/24px 'Inter', system-ui, sans-serif; font-variant-numeric: tabular-nums; user-select: all; overflow-wrap: anywhere; }
.status { color: var(--papier-text-2); font-size: 15px; line-height: 22px; }
.aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: auto; padding-top: 6px; }
.kopieren { min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--papier-text); color: var(--papier); font: 700 15px/20px 'Inter', system-ui, sans-serif; cursor: pointer; }
.aktionen a { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 600; text-underline-offset: 4px; }
.karte :focus-visible { box-shadow: 0 0 0 2px var(--papier), 0 0 0 4px #2b3f73; }
.karte--aus .bild { filter: grayscale(1); }
.karte--aus .code { color: var(--papier-text-2); font-weight: 400; text-decoration: line-through; }

footer { display: flex; flex-wrap: wrap; gap: 0 24px; margin-top: auto; color: var(--text-2); font-size: 14px; }
footer a { display: inline-flex; align-items: center; min-height: 44px; text-underline-offset: 4px; }
.nur-vorlesen { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Mit Codes zählt der Platz: Am Handy rückt das Foto aus dem Weg. */
body.mit-codes .foto { height: 96px; }

@media (max-width: 359px) {
  .felder { grid-template-columns: 1fr; }
  .karte { grid-template-columns: 76px minmax(0, 1fr); }
  .daten { padding-left: 12px; }
  .bild img { width: 48px; height: 68px; }
  .code { font-size: 14px; }
}

@media (min-width: 900px) {
  .seite { --abstand: clamp(20px, 2.5vw, 40px); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--abstand); padding: var(--abstand); }
  .foto, body.mit-codes .foto { order: 2; position: sticky; top: var(--abstand); height: calc(100dvh - 2 * var(--abstand)); border-radius: 22px; object-position: 50% 45%; }
  .inhalt { max-width: 520px; min-height: calc(100dvh - 2 * var(--abstand)); padding: 0; }
  #suche { margin-block: auto; }
  #ergebnis { padding-block: 24px; }
  h1 { font-size: clamp(52px, 4.6vw, 72px); }
  .karte { grid-template-columns: 124px minmax(0, 1fr); min-height: 176px; }
  .bild img { width: 78px; height: 111px; }
  .code { font-size: 19px; }
}

@media (hover: hover) {
  .knopf:not([aria-busy='true']):hover { background: #f07f50; }
  .kopieren:hover { background: #453d35; }
}
@media (prefers-reduced-motion: reduce) { .knopf { transition: none; } }
