* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #14101f; color: #fff; font-family: system-ui, sans-serif; }
.screen { display: none; min-height: 100%; padding: 24px; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; }
.screen.active { display: flex; }
h1 { margin: 0; font-size: 2rem; }
p { max-width: 460px; line-height: 1.5; margin: 0; }
.small { font-size: .85rem; opacity: .7; word-break: break-all; }
.erro { color: #ff8080; }
button, a.primary { font: inherit; border: 0; border-radius: 999px; padding: 14px 32px; cursor: pointer; background: #333; color: #fff; text-decoration: none; }
button.primary, a.primary { background: #ff5ca8; font-weight: 700; font-size: 1.1rem; }

.stage { position: relative; width: min(100%, 480px); aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; background: #000; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.stage #overlay-preview { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 9rem; font-weight: 800; text-shadow: 0 4px 20px rgba(0,0,0,.6); }

#foto-final { max-width: 100%; max-height: 48vh; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 12px; }
.spinner { width: 48px; height: 48px; border: 5px solid #444; border-top-color: #ff5ca8; border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Tela de resultado */
#result { gap: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
a.primary.secondary { background: transparent; border: 2px solid #ff5ca8; color: #ff5ca8; padding: 12px 30px; }
.thanks { margin: 10px 0 0; font-size: 1.5rem; }
.thanks-text { opacity: .85; }
.again { margin-top: 4px; }
