/* Einwegkamera – Gästeansicht. Aufbau an Event-Kamera-Apps angelehnt,
   Farben/Schriften aus dem Hochzeits-Designsystem (Onyx, Neutralweiß, Silber). */
html, body { height: 100%; background: var(--onyx-3); overscroll-behavior: none; }
body { overflow: hidden; }
[hidden] { display: none !important; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.screen { position: fixed; inset: 0; height: 100vh; height: 100dvh; }

/* ---------- Start ---------- */
.start { display: grid; grid-template-rows: 1fr auto; }
.hero { position: absolute; inset: 0; background: #060605 url("/static/hero.jpg") center 42% / cover no-repeat; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(6,6,5,0) 55%, rgba(6,6,5,.85) 85%, #060605 100%); }
.start-bottom { position: relative; grid-row: 2; display: grid; gap: 12px; padding: 0 20px max(18px, env(safe-area-inset-bottom)); max-width: 520px; width: 100%; margin: 0 auto; }
.start-meta { text-align: center; }
.start-meta .label { color: var(--silver-4); }
.start-loading { position: absolute; left: 0; right: 0; bottom: 120px; text-align: center; color: var(--muted); margin: 0; }
.btn.big { width: 100%; min-height: 58px; border-radius: 18px; font-size: 14px; }
.btn.primary { border-radius: 18px; }
.btn.glass { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: var(--ink); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.btn.dark { background: var(--onyx-3); color: var(--white-1); border: 0; gap: 10px; }
.btn.dark:hover { color: var(--white-1); }
.btn.dark svg { width: 18px; height: 18px; }
.linkbtn { background: none; border: 0; min-height: 40px; padding: 6px; color: var(--silver-2); font-size: 12px; text-decoration: underline; text-underline-offset: 4px; }
.linkbtn:hover { border: 0; color: var(--white-1); }
.fine { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.fine a { color: var(--muted); }
.pill { border-radius: 999px; background: rgba(16,16,16,.72); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.1); }
.pill.status { position: absolute; top: max(14px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); padding: 9px 16px;
  font: 600 11px/1.2 var(--sans); text-transform: uppercase; font-feature-settings: "lnum" 1; color: var(--silver-2); white-space: nowrap; z-index: 2; }

/* ---------- Runde Knöpfe ---------- */
.round { width: 46px; height: 46px; min-height: 0; padding: 0; border-radius: 50%; border: 0; display: grid; place-items: center;
  background: rgba(16,16,16,.55); color: var(--white-1); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.round:hover { color: var(--white-1); border: 0; }
.round.on { background: var(--white-1); color: var(--onyx-3); }
.round.lg { width: 56px; height: 56px; background: var(--onyx-1); }

/* ---------- Kamera ---------- */
.cam { background: var(--onyx-2); display: flex; flex-direction: column; user-select: none; -webkit-user-select: none; touch-action: none; }
.finder { position: relative; flex: 0 1 auto; width: 100%; aspect-ratio: 3 / 4; max-height: calc(100dvh - 236px); min-height: 260px;
  border-radius: 0 0 34px 34px; overflow: hidden; background: #000; margin: 0 auto; }
@media (min-aspect-ratio: 3/5) { .finder { width: auto; height: calc(100dvh - 236px); border-radius: 34px; margin-top: 8px; } }
.finder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.finder video.mirror { transform: scaleX(-1); }
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; z-index: 3; }
.flash.on { animation: flash .5s ease-out; }
.flash.hold { opacity: 1; transition: none; }
@keyframes flash { 0% { opacity: .95; } 100% { opacity: 0; } }
.tl { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 12px; z-index: 2; }
.side { position: absolute; top: max(12px, env(safe-area-inset-top)); right: 12px; display: grid; gap: 2px; padding: 4px; border-radius: 999px;
  background: rgba(16,16,16,.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); z-index: 2; }
.side .round { background: transparent; width: 42px; height: 42px; }
.who-pop { position: absolute; top: calc(max(12px, env(safe-area-inset-top)) + 58px); right: 12px; left: 72px; z-index: 4;
  background: rgba(16,16,16,.92); border-radius: 18px; padding: 6px 16px; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.who-pop .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 48px; }
.who-pop .label { color: var(--white-1); }
.who-pop .linkbtn { text-decoration: none; display: inline-flex; gap: 8px; align-items: center; font: 400 17px var(--serif); text-transform: none; color: var(--white-1); }
.who-pop svg { width: 16px; height: 16px; }
.finder-bottom { position: absolute; left: 12px; right: 12px; bottom: 14px; display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; z-index: 2; }
.finder-bottom #flip { grid-column: 3; }
.finder-bottom #torch { grid-column: 1; }
.zoom { grid-column: 2; justify-self: center; display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(16,16,16,.55); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.zoom button { min-height: 0; width: 44px; height: 38px; padding: 0; border: 0; border-radius: 999px; font: 600 13px var(--sans); color: var(--white-1); background: transparent; text-transform: none; }
.zoom button.on { background: rgba(255,255,255,.16); color: var(--silver-hi); }
.msg { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; text-align: center; padding: 28px; color: var(--ink); background: rgba(6,6,5,.82); }
.msg div { display: grid; gap: 16px; justify-items: center; max-width: 22em; }
.msg p { margin: 0; }

.controls { flex: 1; display: grid; grid-template-rows: auto auto auto; align-content: center; justify-items: center; gap: 14px; padding: 10px 22px max(14px, env(safe-area-inset-bottom)); }
.counter { display: flex; align-items: baseline; gap: 8px; padding: 6px 16px; border-radius: 14px; border: 1px solid rgba(255,255,255,.08); background: var(--onyx-3); }
.counter .num { font-size: 28px; line-height: 1.1; color: var(--white-1); }
.counter .of { font-size: 15px; color: var(--muted); }
.row3 { width: 100%; max-width: 420px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; }
.row3 #pick2 { justify-self: start; }
.shutter { width: 88px; height: 88px; min-height: 0; padding: 0; border: 0; border-radius: 50%; background: var(--chrome); background-size: 220% 100%;
  display: grid; place-items: center; transition: transform .12s; }
.shutter span { width: 70px; height: 70px; border-radius: 50%; background: var(--white-1); box-shadow: 0 0 0 4px var(--onyx-2); }
.shutter:active { transform: scale(.93); }
.shutter:disabled { opacity: .35; }
.stack { justify-self: end; position: relative; width: 66px; height: 66px; min-height: 0; padding: 0; border: 0; background: none; }
.stack:hover { border: 0; }
.stack i { position: absolute; left: 12px; top: 8px; width: 40px; height: 48px; background: var(--white-2); border-radius: 3px; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
.stack i::after { content: ""; position: absolute; left: 4px; right: 4px; top: 4px; height: 32px; background: linear-gradient(135deg, #3a3b3c, #1b1b1a 60%, #545556); }
.stack i:nth-child(1) { transform: rotate(-12deg) translate(-4px, 2px); }
.stack i:nth-child(2) { transform: rotate(7deg) translate(5px, 0); }
.stack i:nth-child(3) { transform: rotate(-2deg); }
.stack.empty i { opacity: .35; }
.badge { position: absolute; right: 0; top: -2px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; background: var(--white-1); color: var(--onyx-3);
  font: 600 11px/22px var(--sans); font-feature-settings: "lnum" 1, "tnum" 1; text-align: center; }
.cam-status { margin: 0; min-height: 1.3em; font: 600 11px/1.3 var(--sans); text-transform: uppercase; font-feature-settings: "lnum" 1; color: var(--muted); text-align: center; }

/* Polaroid fliegt nach dem Auslösen in den Stapel */
.fly { position: fixed; z-index: 30; pointer-events: none; background: var(--white-2); border-radius: 4px; padding: 6% 6% 22%; box-shadow: 0 10px 30px rgba(0,0,0,.6); opacity: 0; }
.fly::after { content: ""; display: block; width: 100%; height: 100%; background: linear-gradient(135deg, #3a3b3c, #1b1b1a 60%, #545556); }

/* ---------- Galerie ---------- */
.gal { background: var(--onyx-3); overflow-y: auto; -webkit-overflow-scrolling: touch; touch-action: pan-y; }
.gal-top { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: 46px 1fr 46px; align-items: center; text-align: center;
  padding: max(10px, env(safe-area-inset-top)) 12px 10px; background: rgba(6,6,5,.85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.gal .grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 0 3px max(20px, env(safe-area-inset-bottom)); }
.gal .grid button { padding: 0; border: 0; min-height: 0; aspect-ratio: 1; background: var(--onyx-1); display: block; }
.gal .grid img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Blätter ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.5); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 86dvh; overflow-y: auto; display: grid; gap: 16px; align-content: start;
  padding: 28px 22px max(22px, env(safe-area-inset-bottom)); border-radius: 30px 30px 0 0; background: var(--onyx-2); color: var(--ink);
  max-width: 560px; margin: 0 auto; animation: up .28s cubic-bezier(.2,.8,.2,1); touch-action: pan-y; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet.light { background: var(--white-1); color: var(--onyx-3); }
.sheet h2 { font: 500 30px/1.15 var(--serif); margin: 0; }
.sheet .sub { margin: -6px 0 0; color: var(--muted); font-size: 16px; }
.sheet.light .sub { color: #5f5f5e; }
.sheet form { display: grid; gap: 12px; }
.field-round { border: 1.5px solid var(--onyx-3); border-radius: 18px; padding: 16px 18px; font-size: 18px; color: var(--onyx-3); background: #fff; }
.field-round:focus { border-color: var(--onyx-3); box-shadow: 0 0 0 3px rgba(6,6,5,.12); }
.field-round::placeholder { color: #9a9a98; }
.sheet .err { color: #a3392f; }
.fine.dark { text-align: left; color: #6d6d6b; font-size: 14px; }
.fine.dark a { color: var(--onyx-3); }
.grab { width: 40px; height: 4px; border-radius: 2px; background: rgba(255,255,255,.2); justify-self: center; margin: -14px 0 0; }

.summary { display: grid; gap: 10px; }
.summary .row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.bar { height: 3px; border-radius: 2px; background: rgba(255,255,255,.08); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--chrome); transition: width .3s; }
.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.item { display: grid; grid-template-columns: 46px 1fr auto; gap: 14px; align-items: center; padding: 6px 0; }
.item .th { width: 46px; height: 46px; border-radius: 8px; background: var(--onyx-1); object-fit: cover; display: block; }
.item .th.film-th { display: grid; place-items: center; font: 600 14px var(--sans); font-feature-settings: "lnum" 1; color: var(--silver-4); }
.item .meta { min-width: 0; display: grid; gap: 6px; }
.item .nm { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #cfcfcd; }
.item .st { font-size: 11px; color: var(--muted); }
.item.done .st { color: var(--ok); }
.item.err .st { color: var(--err); }
.item .btn { min-height: 36px; padding: 8px 6px; font-size: 11px; }

/* ---------- Großansicht ---------- */
.lb { position: fixed; inset: 0; background: var(--onyx-3); z-index: 50; display: grid; grid-template-rows: auto 1fr auto; }
.lb .top, .lb .bot { display: flex; justify-content: space-between; align-items: center; padding: max(10px, env(safe-area-inset-top)) 12px 10px; gap: 8px; }
.lb .bot { padding: 10px 12px max(14px, env(safe-area-inset-bottom)); }
.lb .stage { display: grid; place-items: center; min-height: 0; padding: 0 8px; touch-action: pan-y; }
.lb .stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
/* Gesperrter Hauptknopf (vor dem Fest / Film voll) wirkt wie ein Hinweis, nicht wie ein Knopf */
.btn.big:disabled, .btn.big.primary:disabled { background: rgba(255,255,255,.07); color: var(--silver-2); border: 1px solid rgba(255,255,255,.1); opacity: 1; }
