/* Clever Stempel – Grundlayout. Farben kommen pro Café als CSS-Variablen. */
:root {
  --bg: #F7F3EA; --fg: #48382B; --strip: #48382B; --accent: #70C34E;
  --radius: 22px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background: color-mix(in srgb, var(--bg) 82%, #000 6%);
  color: var(--fg);
  line-height: 1.45;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}
a { color: inherit; }
.hidden { display: none !important; }
.muted { opacity: .68; font-size: .92em; }
.center { text-align: center; }
.wrap { max-width: 440px; margin: 0 auto; }
.wrap--wide { max-width: 980px; }
h1 { font-size: 1.7rem; line-height: 1.15; margin: .4em 0 .3em; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0; }

/* Buttons & Formulare */
.btn {
  appearance: none; border: 2px solid var(--fg); background: transparent; color: var(--fg);
  font: inherit; font-weight: 650; padding: .7em 1.1em; border-radius: 14px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  transition: transform .08s ease, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn-accent { background: var(--fg); color: var(--bg); }
.btn-reward { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost { border-color: transparent; text-decoration: underline; font-weight: 500; }
.btn-big { width: 100%; padding: 1em; font-size: 1.08rem; }
.btn-small { padding: .35em .7em; font-size: .9rem; }
input, select {
  font: inherit; color: var(--fg); background: #fff; width: 100%;
  border: 1.5px solid color-mix(in srgb, var(--fg) 30%, transparent); border-radius: 12px; padding: .75em .9em;
}
input:focus { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 1px; }
input[type=color] { padding: 4px; height: 46px; }
label { display: grid; gap: .35em; font-weight: 600; font-size: .95rem; }
label .muted { font-weight: 400; }
.alert { background: #FBE9E6; color: #8A2A1B; border-radius: 12px; padding: .75em 1em; }
.alert-ok { background: #E7F4E4; color: #24561B; }

/* Beitritt / Login */
.join { max-width: 420px; margin: 4vh auto 0; text-align: center; }
.join-logo { width: 140px; height: 110px; object-fit: contain; margin: 0 auto; display: block; }
.join-lead { font-size: 1.05rem; margin: 0 0 1.6em; }
.join-form { display: grid; gap: 1em; text-align: left; background: var(--bg); padding: 22px; border-radius: var(--radius);
  box-shadow: 0 1px 2px rgba(0,0,0,.05), 0 8px 30px rgba(0,0,0,.06); }
.fineprint { font-size: .8rem; opacity: .6; margin-top: 1.6em; text-align: center; }

/* Die Karte */
.pass {
  background: var(--bg); border-radius: var(--radius); overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 14px 40px rgba(0,0,0,.10);
}
.pass-head { display: flex; align-items: center; gap: 12px; padding: 18px 20px; }
.cafe-logo { width: 64px; height: 44px; object-fit: contain; flex: none; }
.cafe-logo--empty { display: grid; place-items: center; }
.cafe-logo--empty .bean { width: 26px; }
.pass-title { font-weight: 750; font-size: 1.08rem; line-height: 1.2; flex: 1; }
.pass-count { text-align: right; line-height: 1.1; }
.pass-count strong { font-size: 1.5rem; display: block; }
.label { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; opacity: .75; }
.pass-strip { background: var(--strip); padding: 22px 18px; }
.beans { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--cols, 5), 1fr); gap: 14px 6px; }
.beans li { display: grid; place-items: center; }
.bean { width: 34px; height: auto; }
.bean-body { fill: none; stroke: color-mix(in srgb, var(--bg) 55%, var(--strip)); stroke-width: 3; }
.bean-line { fill: none; stroke: color-mix(in srgb, var(--bg) 55%, var(--strip)); stroke-width: 3; stroke-linecap: round; }
.bean.is-on .bean-body { fill: var(--accent); stroke: var(--accent); }
.bean.is-on .bean-line { stroke: var(--strip); }
.bean.pop { animation: pop .55s cubic-bezier(.2,1.6,.4,1); }
@keyframes pop { 0% { transform: scale(.3); } 100% { transform: scale(1); } }
.pass-ready { background: var(--accent); color: #fff; font-weight: 700; text-align: center; padding: .8em 1em; }
.pass-fields { display: flex; justify-content: space-between; gap: 12px; padding: 16px 20px 4px; }
.pass-fields strong { font-size: 1.05rem; }
.pass-fields .right { text-align: right; }
.pass-qr { text-align: center; padding: 14px 20px 22px; }
.pass-qr img { background: #fff; padding: 12px; border-radius: 16px; width: 220px; height: 220px; }
.pass-qr .code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; font-weight: 700; margin-top: 6px; }
.save-hint { margin: 18px 4px 0; background: var(--bg); border-radius: 16px; padding: 12px 16px; }
.save-hint summary { font-weight: 650; cursor: pointer; }

/* Personal */
.staff-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.staff-head > div { flex: 1; }
.reader { border-radius: var(--radius); overflow: hidden; background: #000; min-height: 260px; }
.reader video { width: 100% !important; display: block; }
.manual { display: flex; gap: 8px; margin-top: 14px; }
.manual input { text-transform: uppercase; letter-spacing: .1em; }
.pass--staff { margin-bottom: 14px; }
.actions { display: grid; gap: 10px; margin-top: 14px; }
.actions-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* Aufsteller zum Ausdrucken */
.poster-body { background: #fff; }
.poster { max-width: 520px; margin: 0 auto; text-align: center; background: var(--bg); padding: 40px 32px; border-radius: 28px; }
.poster-logo { width: 200px; height: 140px; object-fit: contain; display: block; margin: 0 auto; }
.poster h1 { font-size: 2.2rem; }
.poster-reward { font-size: 1.3rem; font-weight: 750; color: var(--fg); background: color-mix(in srgb, var(--accent) 25%, transparent); display: inline-block; padding: .3em .8em; border-radius: 999px; }
.poster-qr { width: 260px; height: 260px; display: block; margin: 24px auto; background: #fff; padding: 14px; border-radius: 18px; }
.poster-steps { text-align: left; display: inline-block; margin: 0 0 1em; font-size: 1.05rem; }
.poster-foot { opacity: .7; }
@media print {
  .no-print { display: none !important; }
  body { padding: 0; background: #fff; }
  .poster { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Admin */
.admin-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel { background: #fff; border-radius: 18px; padding: 20px; margin-top: 16px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.table-wrap { overflow-x: auto; margin-top: 12px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid #eee; vertical-align: top; }
th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; opacity: .7; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.links a { margin-right: 12px; white-space: nowrap; }
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row.colors { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 520px) { .form-row.colors { grid-template-columns: 1fr 1fr; } }
.prose { background: #fff; padding: 24px; border-radius: 18px; }
