body {
  overflow: hidden;
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 0%, rgba(200, 20, 30, 0.45), transparent 60%),
    radial-gradient(ellipse at 20% 100%, rgba(120, 0, 10, 0.5), transparent 60%),
    var(--night);
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.screen { position: absolute; inset: 0; display: none; }
.screen.active { display: flex; }

/* ---------- Start ---------- */
#start { align-items: center; justify-content: center; padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; }
#start::before, #start::after {
  content: ""; position: absolute; width: 46vw; max-width: 260px; aspect-ratio: 1; pointer-events: none; opacity: 0.55;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none' stroke='%23fff' stroke-width='.5'%3E%3Cpath d='M0 0L100 0M0 0L95 30M0 0L80 60M0 0L60 80M0 0L30 95M0 0L0 100'/%3E%3Cpath d='M20 0Q18 6 19 6Q16 12 17 17Q12 16 6 19Q6 18 0 20M40 0Q36 12 38 12Q32 24 34 34Q24 32 12 38Q12 36 0 40M62 0Q56 19 59 19Q50 38 53 53Q38 50 19 59Q19 56 0 62M84 0Q76 25 80 25Q67 51 71 71Q51 67 25 80Q25 76 0 84'/%3E%3C/svg%3E") no-repeat;
}
#start::before { top: 0; left: 0; }
#start::after { top: 0; right: 0; transform: scaleX(-1); }

.start-inner { position: relative; max-width: 420px; width: 100%; text-align: center; }
.eyebrow { letter-spacing: 0.3em; text-transform: uppercase; color: var(--gold-2); font-size: 13px; margin: 0 0 8px; }
.title { margin: 0; line-height: 0.95; display: flex; flex-direction: column; align-items: center; }
.title .gold { font-size: clamp(40px, 13vw, 64px); }
.title .red { font-size: clamp(64px, 22vw, 110px); font-weight: 400; margin-top: 4px; }
.lead { color: var(--text); font-size: 16px; line-height: 1.5; margin: 18px 0 22px; }

.steps { list-style: none; padding: 0; margin: 0 auto 26px; display: grid; gap: 10px; max-width: 300px; text-align: left; }
.steps li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: var(--gold-1); }
.steps span {
  flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid var(--gold-3); color: var(--gold-2); font-weight: 700;
  box-shadow: 0 0 12px rgba(241, 207, 114, 0.25) inset;
}
.fine { color: var(--muted); font-size: 12px; margin-top: 14px; font-family: Georgia, serif; }

.btn {
  font: inherit; font-weight: 700; letter-spacing: 0.06em; font-size: 17px; border-radius: 999px; padding: 15px 30px;
  cursor: pointer; border: 0; width: 100%; max-width: 320px;
}
.btn-primary {
  color: #fff; background: linear-gradient(180deg, #ff3a3a, #b00714);
  box-shadow: 0 0 0 1px rgba(255, 220, 150, 0.6), 0 0 28px rgba(255, 30, 30, 0.55), 0 8px 18px rgba(0, 0, 0, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.btn-primary:active { transform: translateY(1px) scale(0.99); }
.btn-ghost { color: var(--gold-1); background: rgba(0, 0, 0, 0.4); box-shadow: 0 0 0 1px var(--gold-3); }

/* ---------- Kamera ---------- */
#camera { flex-direction: column; }
.stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; padding: 10px 10px 0; }
#view {
  max-width: 100%; max-height: 100%; aspect-ratio: 3 / 4; border-radius: 12px;
  box-shadow: 0 0 0 1px rgba(241, 207, 114, 0.5), 0 0 40px rgba(255, 0, 0, 0.35);
  background: #000;
}
.countdown {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  font-family: "Creepster", serif; font-size: 40vmin; color: var(--blood);
  text-shadow: 0 0 40px rgba(255, 0, 0, 0.8), 0 6px 0 #000;
}
.countdown.pop { animation: pop 0.9s ease-out; }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(0.9); opacity: 0.2; } }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.go { animation: flash 0.5s ease-out; }
@keyframes flash { from { opacity: 0.95; } to { opacity: 0; } }
.loading {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7); color: var(--gold-1); font-size: 13px; padding: 8px 14px; border-radius: 999px; white-space: nowrap;
}

.controls { padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); }
.tabs { display: flex; gap: 8px; justify-content: center; }
.tab {
  font: inherit; font-weight: 700; font-size: 14px; flex: 1; max-width: 140px; padding: 10px 6px; border-radius: 12px; cursor: pointer;
  color: var(--gold-1); background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(241, 207, 114, 0.35);
}
.tab[aria-selected="true"] {
  background: linear-gradient(180deg, rgba(227, 20, 31, 0.9), rgba(122, 7, 16, 0.9));
  border-color: var(--gold-2); box-shadow: 0 0 16px rgba(255, 30, 30, 0.5);
}
.hint { text-align: center; color: var(--muted); font-size: 12px; margin: 8px 0 6px; min-height: 1.3em; font-family: Georgia, serif; }
.buttons { display: flex; align-items: center; justify-content: space-around; }
.btn-round {
  width: 50px; height: 50px; border-radius: 50%; font-size: 22px; cursor: pointer;
  color: var(--gold-1); background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(241, 207, 114, 0.45);
}
.btn-round[hidden] { visibility: hidden; display: block; }
.shutter {
  width: 78px; height: 78px; border-radius: 50%; padding: 6px; cursor: pointer;
  background: var(--gold-gradient); border: 0; box-shadow: 0 0 26px rgba(255, 190, 80, 0.5);
}
.shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ff5b5b, #a3000d); border: 3px solid #1a0003; }
.shutter:active span { transform: scale(0.92); }
.shutter:disabled { opacity: 0.5; }
.shutter.save span { display: grid; place-items: center; color: #fff; font-size: 13px; font-weight: 700; }

/* ---------- Ergebnis ---------- */
#result { align-items: center; justify-content: center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
.result-inner { width: 100%; max-width: 440px; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
#result-img {
  flex: 1; min-height: 0; max-width: 100%; object-fit: contain; border-radius: 10px;
  box-shadow: 0 0 0 1px rgba(241, 207, 114, 0.6), 0 0 40px rgba(255, 0, 0, 0.35);
}
.status { margin: 0; text-align: center; font-size: 15px; color: var(--gold-1); min-height: 1.4em; }
.status.ok { color: #9be39b; }
.status.err { color: #ff8a8a; }
.result-buttons { display: grid; gap: 10px; width: 100%; justify-items: center; }
