:root {
  --navy: #081a30;
  --navy-soft: #0d2542;
  --gold-1: #8a6a1f;
  --gold-2: #d9b64e;
  --gold-3: #fdf3c4;
  --gold-4: #e8c766;
  --ink: #f6f8fb;
  --muted: #aebdd2;
  --red: #ff5d5d;
  --line: rgba(217, 182, 78, 0.38);
  --radius: 22px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--navy);
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-color: #34608f;
  background-image: url("bg-mobil.jpg");
  background-size: auto 142%;
  background-position: center 6%;
  background-repeat: no-repeat;
  background-blend-mode: multiply;
}

.bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(5, 15, 30, 0.62) 0%,
    rgba(5, 15, 30, 0.12) 30%,
    rgba(5, 15, 30, 0.35) 62%,
    rgba(5, 15, 30, 0.93) 100%
  );
}

@media (min-width: 720px) {
  .bg {
    background-image: url("bg.jpg");
    background-position: center;
  }
}

main {
  max-width: 520px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 18px calc(14px + env(safe-area-inset-bottom));
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.head { text-align: center; padding-top: 10px; }

.kicker {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.names {
  margin: 0 0 12px;
  font-family: "Didot", "Bodoni 72", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(38px, 10.5vw, 62px);
  line-height: 1.02;
  letter-spacing: -0.015em;
  text-align: center;
}

.gold span {
  background-image: linear-gradient(
    100deg,
    var(--gold-1) 0%,
    var(--gold-2) 16%,
    var(--gold-3) 33%,
    var(--gold-4) 48%,
    var(--gold-1) 63%,
    var(--gold-3) 82%,
    var(--gold-2) 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45));
  animation: shine 9s ease-in-out infinite;
}

@keyframes shine {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .gold span { animation: none; }
}

.date {
  margin: 0;
  font-size: 14px;
  letter-spacing: 0.3em;
  color: var(--gold-2);
}

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-2);
}

.textfield,
.pinfield {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: rgba(4, 14, 28, 0.55);
  border: 1px solid rgba(217, 182, 78, 0.45);
  border-radius: 14px;
}

.pinfield {
  text-align: center;
  letter-spacing: 0.32em;
  font-size: 26px;
}

.textfield::placeholder { color: rgba(174, 189, 210, 0.5); }

.textfield:focus,
.pinfield:focus {
  outline: 2px solid var(--gold-2);
  outline-offset: 1px;
}

.textfield.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(255, 93, 93, 0.16);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 2px;
}

.btn {
  appearance: none;
  font: inherit;
  font-weight: 600;
  font-size: 17px;
  min-height: 56px;
  padding: 15px 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}

.btn:active { transform: scale(0.985); }

.btn.primary {
  color: #241a05;
  background: linear-gradient(180deg, #f3dc93 0%, #d9b64e 46%, #b8902f 100%);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 26px rgba(217, 182, 78, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.btn.ghost {
  color: var(--gold-3);
  background: rgba(4, 14, 28, 0.28);
  border-color: var(--line);
}

.btn.small {
  min-height: 44px;
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 500;
}

.hint {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.namehint {
  margin: 0;
  font-size: 13px;
  color: var(--red);
  text-align: center;
}

.disclaimer {
  margin: 0 2px;
  font-size: 13.5px;
  line-height: 1.5;
  font-weight: 500;
  text-align: center;
  color: var(--red);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

#queue {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 5px 12px;
  padding: 11px 14px;
  border: 1px solid rgba(217, 182, 78, 0.22);
  border-radius: 14px;
  background: rgba(4, 14, 28, 0.42);
  font-size: 14px;
}

.name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.bar {
  grid-column: 1 / -1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-3));
  transition: width 0.2s ease;
}

li.done .state { color: var(--gold-3); }
li.error .state { color: var(--red); }
li.error .bar { display: none; }

.summary {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.queue-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  padding: 14px 0;
}

.thanks {
  margin: 0;
  font-family: "Didot", "Bodoni 72", Georgia, "Times New Roman", serif;
  font-size: clamp(44px, 14vw, 66px);
  line-height: 1;
}

.donecount {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
}

footer {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 14px;
}

.counter {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(203, 214, 230, 0.88);
}

.copyright {
  margin: 0;
  font-size: 11px;
  color: rgba(203, 214, 230, 0.78);
  white-space: nowrap;
}

.gate {
  margin: auto;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-align: center;
  padding-bottom: 8vh;
}

.pinform {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.error {
  margin: 0;
  color: var(--red);
  font-size: 14px;
}

@media (min-width: 480px) {
  .actions { flex-direction: row; }
  .actions .btn { flex: 1; }
}

/* Handy: alles eine Stufe dichter, damit Fotos wählen, Disclaimer, Zähler und
   Copyright ohne Scrollen im sichtbaren Bereich liegen - auch wenn die
   Adressleiste des Browsers Platz wegnimmt. */
@media (max-width: 430px) {
  main { gap: 12px; padding-top: max(14px, env(safe-area-inset-top)); }
  .head { padding-top: 2px; }
  .kicker { font-size: 10.5px; margin-bottom: 10px; }
  .names { font-size: clamp(30px, 8.6vw, 52px); margin-bottom: 8px; }
  .date { font-size: 13px; letter-spacing: 0.24em; }
  .card { padding: 13px 14px; gap: 10px; }
  .textfield, .pinfield { min-height: 50px; padding: 12px 15px; }
  .btn { min-height: 50px; padding: 12px 18px; }
  .hint, .namehint { font-size: 12.5px; }
  .disclaimer { font-size: 12px; line-height: 1.36; }
  footer { padding-top: 8px; }
}

/* Sehr kurze Displays (kleine Geräte, geteilter Bildschirm) */
@media (max-height: 660px) {
  main { gap: 10px; }
  .names { font-size: clamp(27px, 7.6vw, 42px); }
  .date { font-size: 12px; }
  .card { padding: 12px; gap: 8px; }
  .label { font-size: 11px; }
  .textfield, .pinfield { min-height: 46px; }
  .btn { min-height: 46px; font-size: 16px; }
  .hint, .namehint, .disclaimer { font-size: 11.5px; line-height: 1.35; }
  footer { padding-top: 8px; }
  .counter { font-size: 11px; }
  .copyright { font-size: 10.5px; }
}

@media (hover: none) {
  .btn:hover { filter: none; }
}
