* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 20px/1.35 var(--font-body);
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  overflow: hidden;
}
#app { height: 100%; display: flex; flex-direction: column; }
button { font: inherit; color: inherit; border: 0; cursor: pointer; }
input { font: inherit; }

.center {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 32px; gap: 18px; overflow-y: auto;
}
.center h1 { font-size: clamp(38px, 7vw, 72px); margin: 0; color: var(--text-strong); }
.logo { height: 34px; width: auto; }
.center p { margin: 0; color: var(--muted); max-width: 32em; font-size: 1.05em; }
.center .error { color: var(--danger); font-weight: 600; }
.center .small { font-size: .8em; }

.btn {
  background: var(--accent); color: var(--accent-ink);
  padding: 16px 32px; border-radius: 999px; font-weight: 600; min-height: 56px; font-size: .8em;
  transition: background-color .2s;
  text-transform: uppercase; letter-spacing: .1em;
}
.btn:active { background: var(--accent-hover); color: var(--text-strong); }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--accent); font-weight: 500; }

.field {
  width: min(360px, 90vw); padding: 14px 18px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  user-select: text; -webkit-user-select: text; text-align: center;
}

/* Hauptbildschirm: Personen wählen + Karte anlegen */
.main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.main .head { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 22px 24px 4px; text-align: center; }
.main h1 { font-size: clamp(34px, 6vw, 60px); margin: 0; color: var(--text-strong); }
.main .head p { margin: 0; color: var(--muted); font-size: .9em; }
.body { flex: 1; display: grid; grid-template-columns: 1fr; gap: 20px; padding: 14px 24px 24px; align-content: center; overflow-y: auto; }
@media (min-width: 900px) and (min-aspect-ratio: 1/1) { .body { grid-template-columns: 1.25fr 1fr; align-items: center; } }

.choose { display: flex; flex-direction: column; gap: 18px; }
.group { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; }
.group h2 { margin: 0 0 12px; font-size: 1.1em; letter-spacing: .12em; color: var(--accent); }
.chips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.chip {
  min-height: 72px; border-radius: 16px; background: var(--panel-2); border: 1px solid var(--line);
  font-size: 30px; font-weight: 700; color: var(--text-strong);
}
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip:active { background: var(--accent-hover); }

.tap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 8px; }
.summary { font-family: var(--font-head); text-transform: uppercase; font-size: clamp(26px, 4vw, 38px); color: var(--text-strong); min-height: 1.1em; }
.tap p { margin: 0; color: var(--muted); max-width: 20em; }
.tap .error { color: var(--danger); font-weight: 600; }
.tap.waiting .nfc-ring { opacity: .35; animation: none; }
.tap.ready .tapnow { color: var(--text-strong); font-weight: 600; }

.nfc-ring {
  width: 150px; height: 150px; border-radius: 50%;
  border: 4px solid var(--accent);
  display: grid; place-items: center;
  animation: pulse 2.4s ease-in-out infinite;
}
.nfc-ring svg { width: 72px; height: 72px; stroke: var(--accent); fill: none; stroke-width: 1.8; stroke-linecap: round; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(201, 168, 130, .45); }
  50% { box-shadow: 0 0 0 26px rgba(201, 168, 130, 0); }
}
@media (prefers-reduced-motion: reduce) { .nfc-ring { animation: none; } }
@media (max-height: 700px) {
  .chip { min-height: 56px; font-size: 26px; }
  .nfc-ring { width: 100px; height: 100px; }
  .nfc-ring svg { width: 50px; height: 50px; }
}

/* Bestätigung */
.check {
  width: 120px; height: 120px; border-radius: 50%; background: var(--accent); color: var(--accent-ink);
  display: grid; place-items: center; font-size: 64px; font-weight: 700;
}
.actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

.testbanner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  background: var(--danger); color: var(--accent-ink);
  text-align: center; padding: 6px 12px; font-size: .7em; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase;
}
.testbanner[hidden] { display: none; }
.testbanner:not([hidden]) + #app { padding-top: 30px; }
