body {
  background: radial-gradient(circle at 50% 20%, var(--ink-soft), var(--ink) 70%);
  color: var(--parchment);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

#app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
}

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px calc(48px + env(safe-area-inset-bottom));
  gap: 20px;
  text-align: center;
}
.screen[hidden] { display: none; }

/* ---------- Unlock ---------- */

.unlock-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.15;
  margin: 0 0 8px;
}

#unlock-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 280px;
}

#unlock-input {
  font-family: var(--font-body);
  font-size: 20px;
  text-align: center;
  padding: 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--ink-soft);
  background: var(--ink-soft);
  color: var(--parchment);
  outline: none;
}
#unlock-input:focus { border-color: var(--marigold); }

.install-steps {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}
.install-steps[hidden] { display: none; }
.install-steps .status-text {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--parchment);
  text-align: left;
}
.install-steps strong { color: var(--marigold); }

.role-choices {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 280px;
}
.role-btn {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 600;
  padding: 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--marigold);
  color: var(--ink);
  cursor: pointer;
}
.role-btn:active { background: var(--marigold-deep); }

.btn-primary {
  font-size: 18px;
  font-weight: 600;
  padding: 16px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--marigold);
  color: var(--ink);
  cursor: pointer;
}
.btn-primary:active { background: var(--marigold-deep); }

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

/* ---------- Home / the button ---------- */

.shutter-button {
  position: relative;
  width: min(62vw, 260px);
  height: min(62vw, 260px);
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 35% 30%, var(--marigold) 0%, var(--marigold-deep) 78%);
  box-shadow: var(--shadow-deep), inset 0 -8px 20px rgba(0, 0, 0, 0.25), inset 0 8px 16px rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 120ms ease;
}
.shutter-button:active { transform: scale(0.96); }
.shutter-button.is-loading { animation: pulse 1.1s ease-in-out infinite; }
.shutter-button:disabled { cursor: default; }

.shutter-ring {
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 2px solid rgba(43, 42, 46, 0.25);
}

.status-text {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--mist);
  min-height: 18px;
  margin: 0;
}

@keyframes pulse {
  0%, 100% { box-shadow: var(--shadow-deep), inset 0 -8px 20px rgba(0,0,0,0.25), inset 0 8px 16px rgba(255,255,255,0.25); }
  50% { box-shadow: 0 24px 60px -14px rgba(232,163,61,0.55), inset 0 -8px 20px rgba(0,0,0,0.25), inset 0 8px 16px rgba(255,255,255,0.25); }
}

/* ---------- Reveal / polaroid ---------- */

.polaroid {
  background: var(--parchment);
  padding: 18px 18px 26px;
  border-radius: 4px;
  width: min(80vw, 320px);
  box-shadow: var(--shadow-deep);
  transform: rotate(-2deg);
  animation: polaroid-drop 520ms cubic-bezier(0.2, 0.8, 0.2, 1);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

@keyframes polaroid-drop {
  from { opacity: 0; transform: translateY(24px) rotate(-6deg) scale(0.96); }
  to { opacity: 1; transform: translateY(0) rotate(-2deg) scale(1); }
}

/* Swiping to the next/previous photo: the outgoing polaroid slides off,
   the incoming one slides in from the opposite side. */
.polaroid.swiping-out-left { animation: swipe-out-left 220ms ease-in forwards; }
.polaroid.swiping-out-right { animation: swipe-out-right 220ms ease-in forwards; }
.polaroid.swiping-in-left { animation: swipe-in-left 220ms ease-out; }
.polaroid.swiping-in-right { animation: swipe-in-right 220ms ease-out; }
@keyframes swipe-out-left {
  to { opacity: 0; transform: translateX(-60px) rotate(-6deg); }
}
@keyframes swipe-out-right {
  to { opacity: 0; transform: translateX(60px) rotate(2deg); }
}
@keyframes swipe-in-left {
  from { opacity: 0; transform: translateX(60px) rotate(2deg); }
  to { opacity: 1; transform: translateX(0) rotate(-2deg); }
}
@keyframes swipe-in-right {
  from { opacity: 0; transform: translateX(-60px) rotate(-6deg); }
  to { opacity: 1; transform: translateX(0) rotate(-2deg); }
}

.swipe-hint {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--mist);
  opacity: 0.7;
  margin: 0;
}

.react-btn {
  background: none;
  border: none;
  font-size: 40px;
  line-height: 1;
  padding: 8px;
  cursor: pointer;
  transition: transform 150ms ease;
}
.react-btn:active { transform: scale(1.15); }
.react-btn[aria-pressed="true"] { animation: react-pop 320ms ease; }
@keyframes react-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.polaroid-photo-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  overflow: hidden;
  border-radius: 2px;
}
.polaroid-photo-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: grayscale(1) contrast(0.8) brightness(0.7);
  opacity: 0;
  animation: develop 2600ms ease-out 260ms forwards;
}
.developing-veil {
  position: absolute;
  inset: 0;
  background: var(--parchment-dim);
  animation: veil-lift 2600ms ease-out 260ms forwards;
}
@keyframes develop {
  0% { opacity: 0; filter: grayscale(1) contrast(0.8) brightness(0.7); }
  30% { opacity: 1; }
  100% { opacity: 1; filter: grayscale(0) contrast(1) brightness(1); }
}
@keyframes veil-lift {
  0% { opacity: 0.95; }
  40% { opacity: 0.6; }
  100% { opacity: 0; }
}

.polaroid-caption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 16px;
  color: var(--charcoal);
  margin: 16px 4px 2px;
  min-height: 20px;
}
.polaroid-time {
  font-family: var(--font-mono);
  font-size: 11px;
  color: #8a8578;
  margin: 0 4px;
}

.btn-ghost {
  margin-top: 8px;
  background: none;
  border: none;
  color: var(--mist);
  font-family: var(--font-body);
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
  padding: 10px;
}
