/* Stempelheft · Café Madrid. Mobil zuerst, große Touch-Flächen. Farben wie im Tischbuch. */
:root {
  --bg: #f5f0e6; --karte: #fffdf9; --text: #2a2320; --leise: #6e625b; --linie: #e3d9c9;
  --akzent: #8a2b1f; --akzent-dunkel: #6f2218; --gold: #c8962e; --gold-hell: #f6ead0;
  --ok: #2f6b3a; --ok-bg: #e5f2e7; --warn: #8a5a00; --warn-bg: #fff3d6; --rot: #b3261e; --rot-bg: #fbe4e2;
  --info-bg: #eef1f5;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
main { max-width: 560px; margin: 0 auto; padding: 14px 14px 24px; }
h1 { font-size: 1.45rem; margin: 0 0 .6rem; font-family: Georgia, "Times New Roman", serif; }
h2 { font-size: 1.15rem; margin: 0 0 .6rem; font-family: Georgia, "Times New Roman", serif; }
h3 { font-size: 1rem; margin: 1rem 0 .4rem; }
a { color: var(--akzent); }
code { background: #eee6d8; padding: 1px 4px; border-radius: 3px; }
.leise { color: var(--leise); font-weight: normal; font-size: .92rem; }
.nowrap { white-space: nowrap; }
.inline { display: inline; }

.kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 12px 16px;
  padding-top: max(12px, env(safe-area-inset-top)); background: var(--akzent); color: #fff;
  border-bottom: 4px solid var(--gold); }
.kopf a, .kopf button.link { color: #fff; text-decoration: none; }
.kopf nav { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-left: auto; align-items: center; font-size: .95rem; }
.marke { font-family: Georgia, "Times New Roman", serif; font-weight: 700; font-size: 1.25rem; letter-spacing: .02em; }
body[class*="umgebung-"] .kopf { background: #1f4e79; }
.hinweis-umgebung { background: #ffd23f; color: #222; border-radius: 10px; padding: 1px 8px; font-size: .8rem; font-weight: 700; }
button.link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: 14px; padding: 16px; margin: 0 0 14px;
  box-shadow: 0 1px 2px rgba(60, 30, 10, .05); }
details.karte > summary { cursor: pointer; font-weight: 600; min-height: 32px; display: flex; align-items: center; }
details.karte[open] > summary { margin-bottom: 10px; }

button, .knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--linie); background: #fff; color: var(--text);
  cursor: pointer; text-decoration: none; min-height: 48px; touch-action: manipulation; }
.haupt { background: var(--akzent); border-color: var(--akzent); color: #fff; }
.haupt:active, .haupt:hover { background: var(--akzent-dunkel); }
.gefahr { color: var(--rot); border-color: var(--rot); }
.gross { width: 100%; min-height: 56px; font-size: 1.1rem; margin-top: 4px; }
.riesig { width: 100%; min-height: 76px; font-size: 1.3rem; margin: 10px 0 6px; border-radius: 14px; }
.klein { min-height: 40px; padding: 6px 12px; font-size: .95rem; }
.knopfreihe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }

input, select, textarea { font: inherit; padding: 10px 12px; border: 1px solid #cfc3b0; border-radius: 10px; background: #fff;
  width: 100%; min-height: 48px; color: var(--text); }
textarea { min-height: 120px; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; flex: none; accent-color: var(--akzent); }
input.kurz { width: 7.5em; }
label { display: block; font-size: .95rem; color: var(--leise); margin-bottom: 12px; }
label input, label select, label textarea { margin-top: 4px; }
label.haken { display: flex; gap: 10px; align-items: flex-start; color: var(--text); }
.code-feld { font-size: 1.3rem; letter-spacing: .08em; text-transform: uppercase; font-family: ui-monospace, Menlo, Consolas, monospace; }
.pin-feld { font-size: 2rem; letter-spacing: .5em; text-align: center; }
.falle { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.meldung { padding: 12px 14px; border-radius: 10px; margin: 0 0 14px; background: var(--info-bg); }
.meldung.ok { background: var(--ok-bg); color: var(--ok); font-weight: 600; }
.meldung.fehler { background: var(--rot-bg); color: var(--rot); font-weight: 600; }
.meldung.warn { background: var(--warn-bg); color: var(--warn); }
.ok-text { color: var(--ok); font-weight: 600; }
.gross-text { font-size: 1.2rem; }
.hinweis { background: var(--gold-hell); border-radius: 10px; padding: 10px 12px; }

/* Stempelfeld: 4 je Reihe, Stufen golden umrandet */
.stand { font-size: 1.2rem; margin: 0 0 10px; }
.stempel { list-style: none; padding: 0; margin: 0 0 12px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stempel li { aspect-ratio: 1; border-radius: 50%; border: 2px dashed #d5c7b2; display: flex; align-items: center;
  justify-content: center; color: #b3a48e; font-weight: 700; font-size: 1.1rem; }
.stempel li.stufe { border: 3px solid var(--gold); color: var(--gold); }
.stempel li.voll { background: var(--akzent); border: 3px solid var(--akzent); color: #fff; font-size: 1.5rem;
  transform: rotate(-8deg); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .25); }
.stempel li.voll.stufe { border-color: var(--gold); }
.stufen { list-style: none; padding: 0; margin: 0 0 10px; }
.stufen li { padding: 6px 0; border-bottom: 1px dotted var(--linie); }
.stufen li b { display: inline-block; min-width: 2.2em; color: var(--gold); }
.stufen li.erreicht { color: var(--leise); }

.liste { list-style: none; padding: 0; margin: 0; }
.liste > li { padding: 10px 0; border-bottom: 1px solid var(--linie); }
.liste > li:last-child { border-bottom: 0; }
.zeile { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.zeile-link { display: block; padding: 4px 0; text-decoration: none; color: var(--text); }
.belohnungen { border-color: var(--gold); background: linear-gradient(#fffdf9, var(--gold-hell)); }

.zeigen { text-align: center; }
.qr { max-width: 280px; margin: 6px auto 10px; }
.qr svg { width: 100%; height: auto; display: block; border-radius: 8px; }
.code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 1.6rem; font-weight: 700; letter-spacing: .08em; margin: 6px 0; }

#scanner { margin: 8px 0 12px; }
#scanner video { width: 100%; border-radius: 12px; background: #000; margin-bottom: 8px; }

.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; margin-bottom: 10px; }
.zahlen div { background: var(--bg); border-radius: 10px; padding: 10px; text-align: center; }
.zahlen b { display: block; font-size: 1.5rem; color: var(--akzent); }
.zahlen span { font-size: .85rem; color: var(--leise); }
.balken { list-style: none; padding: 0; margin: 0; }
.balken li { display: grid; grid-template-columns: 3.5em 1fr 2.5em; gap: 8px; align-items: center; padding: 2px 0; }
.balken progress { width: 100%; height: 14px; accent-color: var(--akzent); }
.balken b { text-align: right; }

.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabelle th, .tabelle td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.breit { overflow-x: auto; }
.text ul { padding-left: 1.2em; }

.fuss { text-align: center; padding: 10px 0 max(20px, env(safe-area-inset-bottom)); font-size: .9rem; color: var(--leise); }
.fuss a { color: var(--leise); }

dialog.frage { border: 0; border-radius: 14px; padding: 18px; max-width: 420px; width: calc(100% - 32px); }
dialog.frage::backdrop { background: rgba(40, 20, 10, .45); }
dialog.frage p { font-size: 1.1rem; margin-top: 0; }
dialog.frage .knopfreihe { justify-content: flex-end; margin: 0; }

@media (min-width: 700px) { main { max-width: 640px; padding-top: 24px; } }
