:root {
  --bg: #05080f;
  --fg: #eaf2ff;
  --accent: #78dcff;
  --muted: #7e93a8;
  --error: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
#app { position: fixed; inset: 0; overflow: hidden; }

.screen { position: absolute; inset: 0; display: none; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px; text-align: center; }
.screen.active { display: flex; }

/* Portrait-only gate. Touch devices in landscape get an opaque "rotate" overlay
   over everything. Scoped to coarse pointers so desktop landscape (testing) is
   unaffected. Output is portrait regardless; this only fixes the on-screen UX. */
.rotate-prompt { display: none; }
@media (orientation: landscape) and (pointer: coarse) {
  .rotate-prompt { position: fixed; inset: 0; z-index: 100; display: flex;
    flex-direction: column; align-items: center; justify-content: center; gap: 18px;
    background: var(--bg); color: var(--fg); text-align: center; padding: 24px; }
  .rotate-prompt p { color: var(--fg); font-weight: 600; font-size: 1.2rem; }
}

h1 { font-size: 2.6rem; margin: 0 0 12px; letter-spacing: 0.04em; }
h2 { font-size: 1.5rem; margin: 0 0 16px; }
p { color: var(--muted); line-height: 1.5; margin: 8px 0; }
.fine { font-size: 0.8rem; color: var(--muted); }
.error { color: var(--error); min-height: 1.2em; font-size: 0.9rem; }
.suggest { color: var(--accent); min-height: 1.2em; font-size: 0.9rem; margin: 0; }
.suggest-link { background: none; border: none; padding: 0; color: var(--accent);
  font: inherit; text-decoration: underline; cursor: pointer; }

button { font: inherit; border: none; border-radius: 999px; padding: 16px 28px;
  cursor: pointer; }
.primary { background: var(--accent); color: #042; font-weight: 700; font-size: 1.1rem; }
.ghost { background: transparent; color: var(--muted); }
button:active { transform: scale(0.98); }

.hero, .form, .status { max-width: 380px; width: 100%; display: flex;
  flex-direction: column; gap: 14px; align-items: center; }

input[type="email"], input[type="file"] { width: 100%; padding: 14px;
  border-radius: 12px; border: 1px solid #1d2a3d; background: #0b1320;
  color: var(--fg); font-size: 1rem; }

/* capture stage */
.stage { position: absolute; inset: 0; }
#preview { width: 100%; height: 100%; object-fit: cover; background: #000; }
#guide { position: absolute; inset: 0; width: 100%; height: 100%; }
#guide .silhouette { fill: none; stroke: rgba(120,220,255,0.85);
  stroke-width: 1.2; stroke-dasharray: 3 2; }

/* supplied beam-area guide PNG; matches the live preview's cover-crop.
   alpha comes from the PNG itself, so semi-transparency is baked into the asset. */
.align-guide { display: none; position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; pointer-events: none; }
.align-guide.show { display: block; }

/* pod framing ovals (overhead ring + floor pad); geometry from /api/guide */
.guide-oval { position: absolute; border: 2.5px dashed #78dcff; border-radius: 50%;
  pointer-events: none; filter: drop-shadow(0 0 6px rgba(120,220,255,0.7)); }
.capture-hint { position: absolute; bottom: 140px; left: 0; right: 0;
  color: #fff; text-shadow: 0 1px 4px #000; font-weight: 600; }

/* full-stage tap target: anywhere on the preview starts the countdown */
.tap-start { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.tap-start span { color: rgba(255,255,255,0.55); font-size: 1.9rem; font-weight: 800;
  letter-spacing: 0.18em; text-shadow: 0 2px 12px rgba(0,0,0,0.8);
  animation: tap-pulse 2.2s ease-in-out infinite; }
.tap-start.hidden { display: none; }
@keyframes tap-pulse { 50% { opacity: 0.45; } }

/* pre-roll "get ready" countdown — big, centered over the preview */
.countdown.getready { position: fixed; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 7rem; font-weight: 800;
  color: #fff; background: rgba(0,0,0,0.3); text-shadow: 0 2px 16px #000; }

/* recording indicator + bottom progress bar (shown only while recording) */
.rec-indicator { position: absolute; top: 24px; left: 0; right: 0; text-align: center;
  color: #fff; font-weight: 700; letter-spacing: 0.1em; display: none;
  text-shadow: 0 1px 4px #000; }
.rec-indicator.show { display: block; }
.rec-indicator .dot { color: #ff3b3b; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0.25; } }

.rec-progress { position: absolute; bottom: 0; left: 0; right: 0; height: 8px;
  background: rgba(255,255,255,0.18); display: none; }
.rec-progress.show { display: block; }
.rec-progress-fill { height: 100%; width: 0%; background: #ff3b3b; }

/* upload + done */
.bar { width: 100%; height: 8px; background: #142235; border-radius: 999px; overflow: hidden; }
.bar-fill { width: 0%; height: 100%; background: var(--accent); transition: width 0.2s; }
.spinner { width: 46px; height: 46px; border: 4px solid #1d2a3d;
  border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.check { width: 64px; height: 64px; border-radius: 50%; background: var(--accent);
  color: #042; font-size: 2rem; display: flex; align-items: center; justify-content: center; }

/* event gate */
.blocked-icon { font-size: 3rem; }


/* --- show-feel scenes (landing / done / blocked): transporter-room backdrop --- */
.scene { background:
    linear-gradient(180deg, rgba(3,6,12,0.35) 0%, rgba(3,6,12,0.55) 55%, rgba(3,6,12,0.82) 100%),
    url("bg_room.jpg") center / cover no-repeat #05080f; }
.brand { width: min(78%, 420px); height: auto; margin-bottom: 6px;
  filter: drop-shadow(0 4px 18px rgba(0,0,0,0.6)); }
.brand-sm { width: min(60%, 300px); }
.tagline { color: #cfe6f5; font-size: 0.95rem; letter-spacing: 0.14em;
  text-transform: uppercase; text-shadow: 0 1px 8px rgba(0,0,0,0.8); }

/* --- ENERGIZE button: gold core, pulsing halo, shimmer sweep, tactile press --- */
.energize { position: relative; overflow: hidden; border: none; cursor: pointer;
  margin-top: 10px; padding: 18px 54px; border-radius: 999px;
  background: linear-gradient(180deg, #ffd98a 0%, #f0b64f 55%, #c98a2e 100%);
  box-shadow: 0 0 0 1px rgba(255,215,140,0.55), 0 0 24px rgba(240,182,79,0.45),
              0 6px 22px rgba(0,0,0,0.55);
  animation: energize-pulse 2.4s ease-in-out infinite;
  transition: transform 0.08s ease, filter 0.08s ease;
  -webkit-tap-highlight-color: transparent; }
.energize span { position: relative; z-index: 2; color: #241503; font-weight: 800;
  font-size: 1.15rem; letter-spacing: 0.22em; text-transform: uppercase; }
.energize::after { content: ""; position: absolute; top: 0; bottom: 0;
  left: -80%; width: 55%; z-index: 1; transform: skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), transparent);
  animation: energize-shimmer 2.8s ease-in-out infinite; }
.energize:active { transform: scale(0.95); filter: brightness(1.25); }
.energize:disabled { opacity: 0.6; animation: none; }
@keyframes energize-pulse {
  0%, 100% { box-shadow: 0 0 0 1px rgba(255,215,140,0.55), 0 0 22px rgba(240,182,79,0.4),
             0 6px 22px rgba(0,0,0,0.55); }
  50% { box-shadow: 0 0 0 1px rgba(255,225,160,0.9), 0 0 44px rgba(240,182,79,0.75),
        0 6px 22px rgba(0,0,0,0.55); } }
@keyframes energize-shimmer {
  0%, 55% { left: -80%; } 90%, 100% { left: 130%; } }
