:root {
  --bg: #0f1115;
  --fg: #f4f4f5;
  --accent: #22c55e;
  --muted: #9ca3af;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", sans-serif;
  background: var(--bg);
  color: var(--fg);
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100vh;
}

h1 {
  font-size: 1.25rem;
  text-align: center;
  margin: 8px 0 0;
}

.status {
  text-align: center;
  color: var(--muted);
  min-height: 1.4em;
  margin: 0;
}

.stage {
  position: relative;
  aspect-ratio: 4 / 3; /* landscape — matches the strip frame framing */
  background: #000;
  border-radius: 12px;
  overflow: hidden;
}

#video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* mirror the live preview */
}

.countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
  background: rgba(0, 0, 0, 0.18);
}

/* Color 3-photo strip preview — tall, scales to width, page scrolls. */
.strip {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  background: #fff;
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

button {
  flex: 1;
  padding: 16px;
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  background: var(--accent);
  color: #04120a;
  cursor: pointer;
}

button:disabled {
  opacity: 0.5;
  cursor: default;
}

#retake {
  background: #374151;
  color: var(--fg);
}

.code-step {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  background: #171a21;
  border-radius: 12px;
}

.code-step label {
  color: var(--muted);
  font-size: 0.95rem;
}

#code {
  padding: 14px;
  font-size: 1.6rem;
  letter-spacing: 0.4em;
  text-align: center;
  border: 1px solid #374151;
  border-radius: 10px;
  background: #0b0d11;
  color: var(--fg);
}
