/* ═══════════════════════════════════════════════════════════════════════════
   Phone camera panorama — full-screen capture page (phones only; the button is hidden elsewhere)
   ═══════════════════════════════════════════════════════════════════════════ */
.capture-btn { display: none; }

@media (max-width: 900px) {
  html.cam-ok .capture-btn { display: flex; align-items: center; justify-content: center; gap: 8px; order: 3; width: auto; align-self: stretch; margin: 0 14px 10px; }
}

body.cam-open { overflow: hidden; position: fixed; left: 0; right: 0; width: 100%; }   /* frozen: only the camera page scrolls */

.cam-capture {
  position: fixed; inset: 0; z-index: 2000;
  height: 100vh; height: 100dvh;                 /* the visible height, not the height behind the browser's toolbars */
  height: var(--cam-h, 100dvh);                  /* measured in JS (Chrome on iPhone reports dvh too large, which pushed the round button off screen) */
  display: flex; flex-direction: column;
  background: #05070a; color: #e8ecf3;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  font-family: var(--font-ui, 'Space Grotesk', sans-serif);
}
.cam-capture[hidden], .cam-capture [hidden] { display: none !important; }

.cam-top { display: flex; align-items: center; gap: 12px; padding: 10px 14px; flex-shrink: 0; }
.cam-x { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font-size: 1rem; }
.cam-title { flex: 1; font-weight: 600; font-size: .95rem; }
.cam-count { font-family: var(--font-mono, monospace); font-size: .8rem; color: #fbbf24; }

/* intro + review */
.cam-panel { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 8px 20px calc(150px + env(safe-area-inset-bottom));   /* the buttons stay well clear of a phone's bottom bar */ display: flex; flex-direction: column; gap: 14px; }
.cam-panel h2 { font-size: 1.15rem; margin: 6px 0 0; }
.cam-panel ol { margin: 0; padding-left: 20px; line-height: 1.5; font-size: .95rem; }
.cam-panel li { margin-bottom: 8px; }
.cam-note { font-size: .82rem; color: #9aa4b5; margin: 0; line-height: 1.45; }
.cam-adv { font-size: .82rem; color: #9aa4b5; }
.cam-adv summary { padding: 6px 0; cursor: pointer; }
.cam-adv label { display: block; margin: 6px 0; }
.cam-adv input[type=range] { width: 100%; margin-top: 8px; }
.cam-link { background: none; border: 0; color: #fbbf24; padding: 4px 0; font: inherit; text-decoration: underline; }
.cam-go { min-height: 52px; font-size: 1rem; margin-top: 12px; }   /* right under the text, never at the screen edge */
.cam-err { white-space: pre-line; color: #f87171; font-size: .85rem; min-height: 1.2em; line-height: 1.4; }
#cam-result { width: 100%; height: auto; aspect-ratio: 2 / 1; border-radius: 8px; border: 1px solid rgba(255,255,255,.2); background: #111; }
.cam-review-actions { display: flex; gap: 10px; margin-top: 8px; }
.cam-review-actions .action-btn { flex: 1; min-height: 50px; }

/* shooting */
.cam-shoot { flex: 1; display: flex; flex-direction: column; align-items: center; min-height: 0; }
.cam-stage { position: relative; background: #000; overflow: hidden; flex-shrink: 0; border-radius: 6px; }
.cam-stage video, .cam-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.cam-stage video { position: absolute; inset: auto; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }   /* only a source: the picture is drawn on #cam-view */
.cam-rot { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fbbf24; font-size: 1.2rem; }
.cam-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; transition: opacity .25s ease-out; }
.cam-flash.on { opacity: .75; transition: none; }
.cam-rotate { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 24px; background: rgba(0,0,0,.8); font-weight: 600; }
.cam-rotate.on { display: flex; }

.cam-hint { min-height: 44px; padding: 8px 16px; text-align: center; font-size: .9rem; line-height: 1.3; display: flex; align-items: center; justify-content: center; }
.cam-hint.warn { color: #fbbf24; }

.cam-mini-wrap { position: relative; width: min(64%, 300px); }
#cam-mini { display: block; width: 100%; aspect-ratio: 2 / 1; border: 1px solid rgba(255,255,255,.25); border-radius: 4px; background: #111; }
.cam-cov { position: absolute; right: 6px; top: 4px; font-family: var(--font-mono, monospace); font-size: .68rem; color: #fff; text-shadow: 0 1px 3px #000; }

.cam-bar { width: 100%; margin-top: auto; padding: 10px 16px calc(56px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; }
.cam-lens { font-family: var(--font-mono, monospace); font-size: .68rem; color: #9aa4b5; line-height: 1.3; }
.cam-shutter { width: 68px; height: 68px; border-radius: 50%; border: 4px solid #fff; background: rgba(255,255,255,.2); box-shadow: inset 0 0 0 5px #05070a, inset 0 0 0 40px rgba(255,255,255,.9); }
html.cam-chrome-ios .cam-bar { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }   /* Chrome on iPhone keeps a toolbar over the page bottom */
html.cam-chrome-ios .cam-panel { padding-bottom: calc(210px + env(safe-area-inset-bottom)); }
.cam-shutter:active { transform: scale(.94); }
.cam-finish { justify-self: end; min-height: 46px; padding: 0 18px; }
.cam-aligned { position: absolute; right: 6px; bottom: 4px; font-family: var(--font-mono, monospace); font-size: .62rem; color: #cbd5e1; text-shadow: 0 1px 3px #000; }
.cam-embed { background: rgba(251,191,36,.12); border: 1px solid rgba(251,191,36,.45); border-radius: 8px; padding: 10px 12px; font-size: .84rem; line-height: 1.45; color: #fde68a; }
.cam-embed-link { display: block; margin-top: 8px; color: #fbbf24; font-weight: 600; }
.cam-progress { height: 10px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; margin-top: 6px; }
#cam-progress-bar { height: 100%; width: 0; background: #fbbf24; transition: width .25s ease; }
.cam-stats { font-family: var(--font-mono, monospace); font-size: .7rem; color: #cbd5e1; min-height: 1.2em; }
.cam-lenses { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 3; display: flex; gap: 6px; padding: 4px; border-radius: 22px; background: rgba(0,0,0,.45); }
.cam-lenses:empty { display: none; }
.cam-lens-btn { min-width: 40px; height: 32px; padding: 0 10px; border-radius: 16px; border: 1px solid rgba(255,255,255,.3); background: rgba(0,0,0,.35); color: #fff; font: 600 .78rem var(--font-mono, monospace); }
.cam-lens-btn.on { background: #fbbf24; border-color: #fbbf24; color: #111; }
.cam-lens-btn.locked:not(.on) { opacity: .35; }
.cam-lenses.busy { opacity: .5; pointer-events: none; }
#cam-err:empty { display: none; }                      /* no empty line between Start camera and the lens settings */
.cam-go + .cam-err + .cam-adv, .cam-go + .cam-adv { margin-top: -4px; }

/* Light mode: every capture page (intro, shooting, blending, review) follows the site's theme. The live camera picture itself stays on black. */
body.light-mode .cam-capture { background: #f8fafc; color: #0f172a; }
body.light-mode .cam-x, body.light-mode .cam-rot { border-color: rgba(15,23,42,.25); background: rgba(15,23,42,.06); color: #0f172a; }
body.light-mode .cam-rot { color: #b45309; }
body.light-mode .cam-count, body.light-mode .cam-link { color: #b45309; }
body.light-mode .cam-note, body.light-mode .cam-adv, body.light-mode .cam-lens, body.light-mode .cam-stats { color: #475569; }
body.light-mode .cam-hint.warn { color: #b45309; }
body.light-mode .cam-err { color: #dc2626; }
body.light-mode #cam-result, body.light-mode #cam-mini { border-color: rgba(15,23,42,.2); background: #e2e8f0; }
body.light-mode .cam-progress { background: rgba(15,23,42,.12); }
body.light-mode #cam-progress-bar { background: #d97706; }
body.light-mode .cam-embed { background: rgba(245,158,11,.14); border-color: rgba(180,83,9,.45); color: #78350f; }
body.light-mode .cam-embed-link { color: #b45309; }
body.light-mode .cam-shutter { border-color: #0f172a; box-shadow: inset 0 0 0 5px #f8fafc, inset 0 0 0 40px rgba(15,23,42,.9); }
