* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; }
body {
  font-family: -apple-system, "SF Pro Text", Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  background: #0b0d12; color: #e8eaed;
  overscroll-behavior: none;
}
#app { height: 100dvh; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.hidden { display: none !important; }

.stage {
  flex: 1; position: relative; min-height: 0;
  background: #000; display: flex; align-items: center; justify-content: center; overflow: hidden;
}
#video, #preview { width: 100%; height: 100%; object-fit: cover; display: block; }

.hint {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.55); color: #fff; font-size: 14px;
  padding: 8px 14px; border-radius: 999px; backdrop-filter: blur(6px); white-space: nowrap;
}

.controls {
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  background: #0b0d12; display: flex; align-items: center; justify-content: center; gap: 14px;
}
.controls.two { display: grid; grid-template-columns: 1fr 1fr; }

.shutter {
  width: 74px; height: 74px; border-radius: 50%;
  background: #fff; border: 5px solid #2f6feb; cursor: pointer;
  box-shadow: 0 0 0 4px rgba(47,111,235,0.25);
}
.shutter:active { transform: scale(0.94); }

button { font: inherit; cursor: pointer; border-radius: 12px; padding: 15px 18px; font-weight: 600; border: 1px solid #2a3142; background: #1c2230; color: #e8eaed; }
button:disabled { opacity: 0.55; }
button.primary { background: #2f6feb; border-color: #2f6feb; color: #fff; }
button.ghost { background: #161a22; }
button:active { transform: scale(0.98); }

.form { padding: 18px 20px calc(18px + env(safe-area-inset-bottom)); background: #0b0d12; display: flex; flex-direction: column; gap: 12px; }
.form label { font-size: 13px; color: #98a2b3; }
.form input {
  width: 100%; padding: 16px; font-size: 18px; border-radius: 12px;
  border: 1px solid #2a3142; background: #11151d; color: #fff;
}
.form input:focus { outline: none; border-color: #2f6feb; }

.done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
.done .check { width: 92px; height: 92px; border-radius: 50%; background: #16321f; color: #6bdc97; font-size: 48px; display: flex; align-items: center; justify-content: center; }
.done h1 { margin: 6px 0 0; font-size: 22px; }
.muted { color: #98a2b3; margin: 0 0 14px; }
.done button { width: 100%; max-width: 320px; }

.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(12px);
  background: #1c2230; border: 1px solid #2a3142; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; opacity: 0; transition: all .2s ease; pointer-events: none; z-index: 50; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { border-color: #c93030; }

.uploading { position: relative; }
.uploading::after {
  content: ""; position: absolute; inset: 0; border-radius: 12px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  background-size: 200% 100%; animation: shimmer 1.1s infinite;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
