* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --accent: #ff2828; }
html, body { height: 100%; background: #000; overflow: hidden; }
body {
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  color: #fff;
  -webkit-user-select: none;
  user-select: none;
}

#app { position: fixed; inset: 0; overflow: hidden; }

#video, #overlay {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
#overlay { pointer-events: none; }
/* #video transform (mirror + digital zoom) is set inline by app.js */

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 18px; padding: 24px; text-align: center;
  background: rgba(0, 0, 0, 0.85);
  z-index: 3;
}
.screen h1 { font-size: 16vw; letter-spacing: 0.15em; font-weight: 900; }
.screen p { max-width: 28ch; opacity: 0.8; line-height: 1.45; font-size: 17px; }
.hidden { display: none !important; }

button { font: inherit; cursor: pointer; border: none; border-radius: 999px; color: #fff; }
.primary {
  background: var(--accent); font-weight: 700;
  padding: 14px 30px; font-size: 18px;
}
.primary:active { transform: scale(0.96); }

#controls {
  position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 28px 32px calc(28px + env(safe-area-inset-bottom));
  z-index: 2;
}
.round {
  height: 56px; width: 56px; border-radius: 50%;
  background: rgba(0, 0, 0, 0.45); font-size: 26px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.round.zoom { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.round:active { transform: scale(0.92); }
.shutter {
  height: 78px; width: 78px; border-radius: 50%;
  background: #fff; padding: 0;
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.35), 0 0 0 7px rgba(0, 0, 0, 0.35);
}
.shutter:active { transform: scale(0.92); }

#preview { background: #000; padding: 0; justify-content: center; }
#preview #shot { max-width: 100%; max-height: 76%; object-fit: contain; }
.preview-actions {
  position: absolute; bottom: 0; left: 0; right: 0;
  display: flex; gap: 16px; justify-content: center;
  padding: 24px 24px calc(24px + env(safe-area-inset-bottom));
}
.preview-actions button { padding: 14px 30px; font-size: 18px; }
#retakeBtn { background: rgba(255, 255, 255, 0.16); }

#flash {
  position: absolute; inset: 0; background: #fff;
  opacity: 0; pointer-events: none; z-index: 4;
  transition: opacity 0.14s ease-out;
}
#flash.on { opacity: 0.9; transition: opacity 0s; }
