:root {
  --stage-w: 1920;
  --stage-h: 1080;
  --stage-scale: 1;

  --safe: 44px;
  --radius: 84px;

  --bg0: #050607;
  --bg1: #0a0b0e;
  --glass0: rgba(30, 30, 32, 0.55);
  --glass1: rgba(255, 255, 255, 0.12);
  --glass2: rgba(255, 255, 255, 0.08);

  --text0: rgba(255, 255, 255, 0.92);
  --text1: rgba(255, 255, 255, 0.7);

  --accent: #ffd60a; /* iOS-ish camera yellow */
  --danger: #ff3b30; /* iOS red */

  --zoom: 1;
  /* Simulated content (your vertical videos) looks a bit too tight at pure cover. */
  --content-video-zoom: 0.88;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: radial-gradient(1200px 800px at 50% 25%, #11131a, var(--bg0) 60%);
  color: var(--text0);
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Display",
    "SF Pro Text",
    "Helvetica Neue",
    Arial,
    sans-serif;
}

.stage-wrap {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.stage {
  position: absolute;
  left: 50%;
  top: 50%;
  width: calc(var(--stage-w) * 1px);
  height: calc(var(--stage-h) * 1px);
  transform: translate(-50%, -50%) scale(var(--stage-scale));
  transform-origin: center;
}

.camera {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  box-shadow:
    0 30px 120px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.camera.snap .feed {
  animation: snapFeed 260ms ease-out 1;
}

@keyframes snapFeed {
  0% {
    transform: scale(1);
    filter: none;
  }
  32% {
    transform: scale(0.988);
    filter: blur(0.6px) brightness(0.92);
  }
  100% {
    transform: scale(1);
    filter: none;
  }
}

.feed {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(var(--zoom));
  filter: contrast(1.04) saturate(1.1) brightness(0.98);
  opacity: 0;
  transition: opacity 220ms ease;
  z-index: 1;
}

.camera.has-stream .camera-video {
  opacity: 1;
}

.camera.sim-feed .camera-video {
  opacity: 0 !important;
}

.fake-feed {
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 650px at 30% 35%, #1f2735, #0a0b0f 55%, #000 100%);
  opacity: 1;
  transition: opacity 220ms ease;
  z-index: 0;
}

.fake-feed[data-hidden="true"] {
  opacity: 0;
  pointer-events: none;
}

.content-layer {
  position: absolute;
  inset: 0;
  z-index: 2; /* keep still-frame above video during shutter */
  opacity: 0;
  transition: opacity 180ms ease;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: contrast(1.02) saturate(1.08);
}

.camera.has-content .content-layer {
  opacity: 1;
}

/* When firing the shutter, don't "fade in" the frozen frame. */
.camera.capturing .content-layer {
  transition: none;
}

.content-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* fill width; vertical videos will crop top/bottom */
  object-position: center;
  transform: scale(var(--content-video-zoom));
  transform-origin: center;
  z-index: 1;
  opacity: 0;
  transition: opacity 180ms ease;
  filter: contrast(1.02) saturate(1.08);
}

.camera.has-video .content-video {
  opacity: 1;
}

.side-bars {
  position: absolute;
  inset: 0;
  z-index: 4; /* under HUD (10), above feed (0-3) */
  pointer-events: none;
}

.side-bar {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 320px; /* cover under the side controls */
  background: #000;
}

.side-bar.left {
  left: 0;
}

.side-bar.right {
  right: 0;
}

.capture-black {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}

.camera.capturing .capture-black {
  animation: captureBlack 340ms ease-out 1;
}

@keyframes captureBlack {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  60% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

.fake-grid {
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 120px 120px;
  background-position: -40px -20px;
  mask-image: radial-gradient(900px 700px at 50% 50%, #000 50%, transparent 82%);
}

.fake-glow {
  position: absolute;
  inset: -20%;
  background: radial-gradient(closest-side at 60% 50%, rgba(255, 214, 10, 0.12), transparent 65%);
  animation: drift 6.5s ease-in-out infinite;
  opacity: 0.8;
  filter: blur(10px);
}

@keyframes drift {
  0% {
    transform: translate3d(-10px, -6px, 0) scale(1.02);
  }
  50% {
    transform: translate3d(14px, 10px, 0) scale(1);
  }
  100% {
    transform: translate3d(-10px, -6px, 0) scale(1.02);
  }
}

.vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(1200px 800px at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.62) 100%),
    radial-gradient(900px 600px at 50% 20%, rgba(0, 0, 0, 0.55), transparent 55%);
  pointer-events: none;
  z-index: 2;
}

.brand-overlay {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe) + 120px);
  transform: translateX(-50%);
  z-index: 9;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: auto;
  text-align: center;
}

.brand-name {
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.78);
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.65);
}

.brand-ca {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px) saturate(160%);
  border-radius: 999px;
  height: 34px;
  padding: 0 14px;
  color: rgba(255, 255, 255, 0.74);
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 50px rgba(0, 0, 0, 0.38);
}

.brand-ca:active {
  transform: scale(0.99);
}

.brand-ca:focus-visible {
  outline: 2px solid rgba(255, 214, 10, 0.8);
  outline-offset: 3px;
}

.flash-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.95);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms ease;
  z-index: 3;
}

.camera.flash .flash-overlay {
  opacity: 1;
}

.hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10; /* keep UI above capture black flash */
}

.hud button {
  pointer-events: auto;
}

.safe-top {
  position: absolute;
  left: var(--safe);
  right: var(--safe);
  top: var(--safe);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.top-left,
.top-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auto-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(18px) saturate(160%);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.32);
  font-weight: 900;
  letter-spacing: 0.14em;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
}

.auto-sub {
  letter-spacing: 0.06em;
  font-weight: 800;
  color: rgba(255, 214, 10, 0.88);
}

.privacy-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #30d158;
  box-shadow: 0 0 0 6px rgba(48, 209, 88, 0.15);
}

.top-pill {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 999px;
  background: var(--glass0);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 14px 40px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sound-tip {
  position: absolute;
  right: 100%;
  top: 50%;
  transform: translate3d(-12px, -50%, 0);
  padding: 9px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px) saturate(160%);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.sound-tip::after {
  content: "";
  position: absolute;
  right: -7px;
  top: 50%;
  width: 12px;
  height: 12px;
  transform: translateY(-50%) rotate(45deg);
  background: rgba(0, 0, 0, 0.62);
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 46px;
  height: 42px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--text0);
  border-radius: 999px;
  cursor: pointer;
}

.pill-btn:focus-visible {
  outline: 2px solid rgba(255, 214, 10, 0.8);
  outline-offset: 3px;
}

.pill-txt {
  font-weight: 700;
  letter-spacing: 0.01em;
  opacity: 0.9;
}

.pill-divider {
  width: 1px;
  height: 26px;
  background: rgba(255, 255, 255, 0.12);
}

.left-rail {
  position: absolute;
  left: var(--safe);
  bottom: var(--safe);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.right-rail {
  position: absolute;
  right: var(--safe);
  top: var(--safe);
  bottom: var(--safe);
  display: grid;
  grid-template-rows: 1fr auto 1fr;
  align-items: center;
  justify-items: center;
  gap: 16px;
}

.rail-top,
.rail-mid,
.rail-bot {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 20px;
}

.rail-mid {
  gap: 16px;
}

.rail-top {
  align-content: start;
  padding-top: 8px;
}

.rail-bot {
  align-content: end;
  padding-bottom: 8px;
}

.round-btn {
  width: 72px;
  height: 72px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  color: var(--text0);
  cursor: pointer;
  box-shadow:
    0 18px 50px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.round-btn:active {
  transform: scale(0.98);
}

.round-btn:focus-visible {
  outline: 2px solid rgba(255, 214, 10, 0.8);
  outline-offset: 4px;
}

.thumb {
  position: relative;
  overflow: hidden;
}

.thumb-inner {
  position: absolute;
  inset: 9px;
  border-radius: 14px;
  background: radial-gradient(70px 70px at 30% 30%, rgba(255, 214, 10, 0.16), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  background-size: cover;
  background-position: center;
}

.start {
  border-color: rgba(255, 214, 10, 0.28);
}

.zoom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.zoom-chip {
  min-width: 56px;
  height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--text0);
  font-size: 20px;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.zoom-chip.is-selected {
  background: rgba(0, 0, 0, 0.55);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.shutter {
  width: 132px;
  height: 132px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  cursor: pointer;
  position: relative;
  filter: drop-shadow(0 18px 42px rgba(0, 0, 0, 0.55));
}

.shutter.is-firing {
  animation: shutterTap 180ms ease-out 1;
}

@keyframes shutterTap {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(0.976);
  }
  100% {
    transform: scale(1);
  }
}

.shutter:focus-visible {
  outline: 2px solid rgba(255, 214, 10, 0.8);
  outline-offset: 8px;
  border-radius: 999px;
}

.shutter-ring {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 10px rgba(255, 255, 255, 0.24),
    inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.shutter-core {
  position: absolute;
  inset: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.22);
}

.shutter:active {
  transform: scale(0.98);
}

.mode-stack {
  position: relative;
  width: 132px;
  padding: 10px;
  border-radius: 26px;
  background: rgba(20, 20, 22, 0.55);
  backdrop-filter: blur(18px) saturate(160%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
}

.mode-btn {
  position: relative;
  z-index: 2;
  height: 52px;
  border-radius: 18px;
  border: 0;
  background: transparent;
  color: var(--text1);
  font-weight: 700;
  letter-spacing: 0.12em;
  font-size: 16px;
  cursor: pointer;
  text-transform: uppercase;
}

.mode-btn.is-selected {
  color: var(--accent);
}

.mode-btn[data-tab="pump"],
.mode-btn[data-tab="dex"],
.mode-btn[data-tab="x"] {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 900;
  font-size: 16px;
}

.mode-highlight {
  position: absolute;
  left: 10px;
  right: 10px;
  top: 10px;
  height: 52px;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.mode-base {
  width: 132px;
  height: 16px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  margin-top: -6px;
}

.camera[data-tab="pump"] .mode-highlight {
  transform: translateY(0);
}
.camera[data-tab="x"] .mode-highlight {
  transform: translateY(60px);
}
.camera[data-tab="dex"] .mode-highlight {
  transform: translateY(120px);
}
.camera[data-tab="photo"] .mode-highlight {
  transform: translateY(180px);
}

.menu-sheet {
  position: absolute;
  top: calc(var(--safe) + 64px);
  right: var(--safe);
  width: 330px;
  padding: 14px;
  border-radius: 30px;
  background: rgba(10, 12, 16, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(22px) saturate(170%);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}

.sheet-title {
  padding: 10px 10px 12px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
}

.sheet-item {
  width: 100%;
  height: 62px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.26);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-weight: 800;
  letter-spacing: 0.02em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    inset 0 -14px 26px rgba(255, 255, 255, 0.02);
}

.sheet-item + .sheet-item {
  margin-top: 12px;
}

.sheet-item:focus-visible {
  outline: 2px solid rgba(255, 214, 10, 0.8);
  outline-offset: 3px;
}

.capture-canvas {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

.gallery,
.viewer {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(10px) saturate(120%);
  display: flex;
  flex-direction: column;
  animation: overlayIn 180ms ease-out 1;
}

@keyframes overlayIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.gallery-header,
.viewer-header {
  height: 86px;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 120px 1fr 120px;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(10, 10, 12, 0.55);
  backdrop-filter: blur(22px) saturate(170%);
}

.gallery-title,
.viewer-meta {
  justify-self: center;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.92);
}

.gallery-btn {
  justify-self: start;
  height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
}

.gallery-btn.danger {
  justify-self: end;
  border-color: rgba(255, 59, 48, 0.35);
  color: rgba(255, 59, 48, 0.92);
}

.gallery-btn:focus-visible {
  outline: 2px solid rgba(255, 214, 10, 0.8);
  outline-offset: 3px;
}

.gallery-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  overflow: auto;
}

.gallery-tile {
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-empty {
  padding: 40px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.viewer-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 18px;
}

.viewer-img {
  max-width: 520px;
  max-height: 100%;
  width: min(520px, 72vw);
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
  object-fit: contain;
  background: rgba(255, 255, 255, 0.04);
}

.viewer-video {
  max-width: 520px;
  max-height: 100%;
  width: min(520px, 72vw);
  border-radius: 18px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
  background: rgba(255, 255, 255, 0.04);
  display: none;
  object-fit: contain;
}

.viewer.is-video .viewer-video {
  display: block;
}

.viewer.is-video .viewer-img {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .fake-glow {
    animation: none;
  }
  .mode-highlight {
    transition: none;
  }
  .flash-overlay {
    transition: none;
  }
  .gallery,
  .viewer {
    animation: none;
  }
}
