:root {
  --bg: #faf6f1;
  --ink: #3a2e26;
  --accent: #b08968;
  --accent-dark: #8a6a4f;
  --ok: #2e7d4f;
  --warn: #c1574a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  padding: env(safe-area-inset-top) 1rem 6rem;
  max-width: 640px;
  margin-inline: auto;
}
header { text-align: center; padding: 1.5rem 0 0.5rem; }
h1 { font-size: 1.6rem; margin: 0.2rem 0; }
.tagline { color: var(--accent-dark); margin: 0.2rem 0 1rem; }

.capture-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 1.4rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 14px rgba(176, 137, 104, 0.4);
}
.capture-btn:active { transform: scale(0.98); }

.optional { margin: 1rem 0; }
.optional summary { cursor: pointer; color: var(--accent-dark); }
.optional input {
  display: block;
  width: 100%;
  margin: 0.6rem 0;
  padding: 0.7rem;
  border: 1px solid #ddd0c4;
  border-radius: 10px;
  font-size: 1rem;
}
.privacy { font-size: 0.8rem; color: #8a7d72; text-align: center; }

#gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; margin-top: 1rem; }
.card {
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
/* 2:3 frame matches the 4x6 print so guests see the printed crop. */
.thumb { aspect-ratio: 2 / 3; width: 100%; object-fit: cover; display: block; background: #eee; }
.status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.6rem;
  font-size: 0.85rem;
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.dot.pending  { background: #c9a227; }
.dot.uploaded { background: #2f80ed; }
.dot.printing { background: #9b51e0; animation: pulse 1s infinite; }
.dot.printed  { background: var(--ok); }
.dot.failed, .dot.error { background: var(--warn); }
.dot.archived { background: #8a7d72; }
@keyframes pulse { 50% { opacity: 0.3; } }

.banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  padding: 0.9rem 1rem calc(0.9rem + env(safe-area-inset-bottom));
  background: var(--accent-dark);
  color: #fff;
  font-size: 0.95rem;
}
.banner.hidden { display: none; }
.banner button {
  background: #fff;
  color: var(--accent-dark);
  border: none;
  border-radius: 8px;
  padding: 0.5rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.hidden { display: none; }

/* Gate shown until a valid wedding QR is verified */
.gate { text-align: center; padding: 3rem 1rem; color: var(--accent-dark); }
.gate-emoji { font-size: 3rem; margin: 0 0 0.5rem; }
#gate-msg { font-size: 1.1rem; }
