* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #000;
  color: #fff;
  font: 16px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none;
}

#preview {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.guide, .hint { display: none; }
body.ready .guide, body.ready .hint { display: block; }

.guide {
  position: fixed;
  inset: 12% 7%;
  border: 2px dashed #ffffff59;
  border-radius: 12px;
  pointer-events: none;
}

.hint {
  position: fixed;
  inset: auto 0 calc(env(safe-area-inset-bottom, 0px) + 40px) 0;
  margin: 0;
  text-align: center;
  font-size: 15px;
  text-shadow: 0 1px 6px #000c;
  pointer-events: none;
  animation: fade 5s 2s forwards;
}
@keyframes fade { to { opacity: 0; } }

.start {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 190px;
  height: 190px;
  margin: -95px 0 0 -95px;
  border: 0;
  border-radius: 50%;
  background: #2f81f7;
  color: #fff;
  font: inherit;
  font-size: 19px;
  font-weight: 600;
  cursor: pointer;
  animation: pulse 1.9s ease-in-out infinite;
}
.start[hidden] { display: none; }
@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 #2f81f766; }
  50% { transform: scale(1.05); box-shadow: 0 0 0 34px #2f81f700; }
}

.busy {
  position: fixed;
  inset: 0;
  background: #000000c4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.busy[hidden] { display: none; }

.spinner {
  width: 54px;
  height: 54px;
  border: 4px solid #ffffff33;
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 90px);
  transform: translateX(-50%);
  max-width: 86%;
  margin: 0;
  padding: 11px 16px;
  border-radius: 11px;
  background: #21262de6;
  font-size: 14px;
  text-align: center;
}
.toast[hidden] { display: none; }
