/* Camera island: the complete source frame is visible and captured, never CSS-cropped. */
#camera-screen:has(.react-viewfinder) {
  gap: 0;
}
.react-viewfinder {
  background: #11130f;
  flex: 1;
  min-height: 0;
  border-radius: 16px;
  isolation: isolate;
}
.react-viewfinder #live-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  max-height: none;
}
.react-viewfinder:not([data-state="live"]) #live-video {
  visibility: hidden;
}
.camera-caption {
  position: absolute;
  bottom: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #f6f3e8;
  font:
    9px/1.3 Arial,
    sans-serif;
  letter-spacing: 0.08em;
  pointer-events: none;
  text-shadow: 0 1px 3px #000;
}
.camera-caption span {
  background: #10130cb3;
  padding: 5px 7px;
  border-radius: 8px;
}
.react-controls {
  flex: none;
  padding-top: 10px;
}
.react-controls .visual-filters {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 4px;
  overflow-x: auto;
  scrollbar-width: none;
}
.guest .react-controls .visual-filters button {
  flex: 0 0 60px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 0 0 4px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  border-radius: 0;
  min-height: 64px;
}
.guest .react-controls .visual-filters button::before {
  display: none;
}
.guest .react-controls .visual-filters button[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 600;
}
.filter-sample {
  display: block;
  width: 42px;
  height: 42px;
  background: linear-gradient(
    145deg,
    #eee6cf 0 36%,
    #8e997f 36% 65%,
    #3b4939 65%
  );
  border: 3px solid transparent;
  outline: 1px solid var(--line);
  border-radius: 50%;
  box-sizing: border-box;
  background-clip: padding-box;
}
.filter-sample span {
  display: block;
  background: #f4ead3;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 7px 0 0 8px;
}
[aria-pressed="true"] .filter-sample {
  outline: 2px solid var(--ink);
}
[data-filter="Noir"] {
  filter: grayscale(1);
}
[data-filter="Candlelight"] {
  filter: sepia(0.24) saturate(0.78) brightness(1.06);
}
[data-filter="Vintage"] {
  filter: sepia(0.3) saturate(0.5) contrast(0.9) brightness(1.08);
}
.filter-hint {
  font:
    9px/1.3 Arial,
    sans-serif;
  color: var(--muted);
  text-align: center;
  margin: 2px 0 6px;
}
.react-controls .capture-row {
  grid-template-columns: 1fr 84px 1fr;
  align-items: center;
  padding: 0 12px 6px;
}
.guest .react-controls .shutter {
  width: 70px;
  height: 70px;
  border: 2px solid var(--ink);
  padding: 5px;
  display: grid;
  place-items: center;
}
.react-controls .shutter-core {
  width: 100%;
  height: 100%;
  border-radius: 50%;
}
.react-controls .control-button {
  min-width: 56px;
  min-height: 56px;
  justify-self: center;
}
.recent-button img {
  width: 36px;
  height: 42px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
}
@media (max-height: 680px) {
  .react-controls {
    padding-top: 5px;
  }
  .filter-sample {
    width: 32px;
    height: 32px;
  }
  .guest .react-controls .visual-filters button {
    min-height: 52px;
  }
  .guest .react-controls .shutter {
    width: 60px;
    height: 60px;
  }
  .filter-hint {
    margin-bottom: 2px;
  }
}
@media (max-height: 440px) {
  .react-controls .visual-filters {
    gap: 6px;
  }
  .filter-sample,
  .filter-hint {
    display: none;
  }
  .guest .react-controls .visual-filters button {
    min-height: 32px;
    padding: 8px;
  }
  .react-controls .capture-row {
    padding-bottom: 0;
  }
  .guest .react-controls .shutter {
    width: 46px;
    height: 46px;
  }
}
/* Replace inherited grid tracks from the previous camera controls. */
.camera-controls.react-controls {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.camera-controls.react-controls[hidden] {
  display: none;
}
.guest .react-controls .shutter-core {
  position: absolute;
  inset: 5px;
  width: auto;
  height: auto;
}
.react-controls .visual-filters {
  justify-content: flex-start;
}
@media (orientation: landscape) and (max-height: 600px) {
  .camera-controls.react-controls {
    align-self: center;
    width: 100%;
  }
}

/* Floating camera composition. Full source framing is preserved behind the UI. */
.camera-app[data-view="camera"] {
  position: relative;
  padding: 0;
  display: block;
  overflow: hidden;
  border-radius: 0;
}
.camera-app[data-view="camera"] .camera-top {
  position: absolute;
  z-index: 5;
  inset: calc(env(safe-area-inset-top, 0px) + 12px) 16px auto;
  height: 48px;
  padding: 0;
  gap: 10px;
}
.camera-app[data-view="camera"] #camera-screen {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
}
.camera-app[data-view="camera"] .camera-frame {
  position: absolute;
  inset: 0;
  border-radius: 0;
}
.camera-app[data-view="camera"] .camera-intro {
  padding: 80px 24px 100px;
}
.camera-app[data-view="camera"] .camera-controls.react-controls {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 86px);
  padding: 60px 24px 0;
  gap: 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.45));
  width: auto;
}
.camera-app[data-view="camera"] .react-viewfinder:before {
  display: none;
}
.camera-app[data-view="camera"] .camera-frame[data-state="live"]:after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(#0008, transparent 18%, transparent 64%, #0007);
}
.guest .camera-nav {
  border: 1px solid var(--line);
  border-radius: 32px;
  width: 260px;
  max-width: calc(100% - 32px);
  justify-self: center;
  margin: 8px auto;
  height: 52px;
  min-height: 52px;
  padding: 4px;
  gap: 4px;
  box-shadow: 0 8px 30px #0001;
}
.guest .camera-nav button {
  border: 0;
  border-radius: 24px;
  min-height: 42px;
  height: 42px;
  gap: 7px;
  font-size: 12px;
  padding: 8px 14px;
}
.guest .camera-nav button[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}
.camera-nav button:before,
.camera-nav button:after {
  display: none !important;
}
.camera-app[data-view="camera"] .camera-nav {
  position: absolute;
  z-index: 5;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}
.camera-app:has(#camera-screen[data-state="live"]) {
  background: #111;
  --camera-white: #fbfaf5;
}
.camera-app:has(#camera-screen[data-state="live"]) .camera-top {
  color: var(--camera-white);
}
.camera-app:has(#camera-screen[data-state="live"]) #event-title {
  color: #eee9d9cc;
  font-size: 9px;
  letter-spacing: 0.1em;
}
.camera-app:has(#camera-screen[data-state="live"]) .camera-top .wordmark {
  font-size: 24px;
}
.camera-app:has(#camera-screen[data-state="live"]) .queue-status,
.camera-app:has(#camera-screen[data-state="live"]) #info,
.camera-app:has(#camera-screen[data-state="live"]) .camera-nav {
  color: var(--camera-white);
  background: #1a1b19a8;
  border: 1px solid #ffffff25;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 4px 20px #0002;
}
.camera-app:has(#camera-screen[data-state="live"]) .queue-status {
  border-radius: 24px;
  padding: 8px 12px;
  min-height: 36px;
  font-size: 10px;
  max-width: 135px;
}
.camera-app:has(#camera-screen[data-state="live"]) .camera-nav button {
  color: #fff9;
}
.camera-app:has(#camera-screen[data-state="live"])
  .camera-nav
  button[aria-current="page"] {
  color: #191b17;
  background: #faf8ee;
}
.camera-controls.react-controls .visual-filters {
  width: fit-content;
  max-width: 100%;
  align-self: center;
  padding: 8px 14px;
  gap: 12px;
  border-radius: 40px;
  background: #161815a8;
  border: 1px solid #ffffff25;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.guest .react-controls .visual-filters button {
  flex-basis: 46px;
  min-height: 56px;
  color: #fffc;
  font-size: 9px;
  gap: 6px;
}
.guest .react-controls .visual-filters button[aria-pressed="true"] {
  color: #fff;
}
.react-controls .filter-sample {
  width: 34px;
  height: 34px;
  outline-color: #fff5;
}
.react-controls [aria-pressed="true"] .filter-sample {
  outline-color: #fff;
}
.react-controls .filter-hint {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.react-controls .capture-row {
  padding: 0;
  grid-template-columns: 1fr 82px 1fr;
  width: 100%;
  gap: 0;
}
.guest .react-controls .control-button {
  height: 48px;
  width: 48px;
  min-height: 48px;
  min-width: 48px;
  border-radius: 50%;
  border: 1px solid #ffffff35;
  background: #1a1b1977;
  color: #faf8ef;
  padding: 11px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.react-controls .control-button > span,
.react-controls #shutter-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.guest .react-controls .shutter {
  height: 76px;
  width: 76px;
  background: transparent;
  border: 2px solid #fff;
  box-shadow: 0 3px 16px #0002;
}
.guest .react-controls .shutter-core {
  background: #faf8ef;
  inset: 6px;
  transition:
    transform 0.15s,
    opacity 0.15s;
}
.guest .react-controls .shutter:active .shutter-core {
  transform: scale(0.9);
}
.react-controls .recent-button:has(img) {
  padding: 3px;
  border-radius: 15px;
}
.react-controls .recent-button img {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 11px;
}
@media (max-height: 650px) and (orientation: portrait) {
  .camera-app[data-view="camera"] .camera-controls.react-controls {
    bottom: 76px;
    gap: 10px;
    padding-top: 30px;
  }
  .guest .react-controls .shutter {
    width: 64px;
    height: 64px;
  }
  .camera-controls.react-controls .visual-filters {
    padding: 6px 12px;
  }
  .guest .react-controls .visual-filters button {
    min-height: 48px;
  }
  .react-controls .filter-sample {
    width: 28px;
    height: 28px;
  }
}
@media (orientation: landscape) and (max-height: 600px) {
  .camera-app[data-view="camera"] .camera-controls.react-controls {
    left: auto;
    right: 16px;
    top: 72px;
    bottom: 74px;
    width: 230px;
    justify-content: center;
    padding: 10px;
    background: none;
    gap: 16px;
  }
  .camera-app[data-view="camera"] .react-viewfinder #live-video {
    width: calc(100% - 250px);
  }
  .camera-controls.react-controls .visual-filters {
    padding: 4px 8px;
    gap: 4px;
  }
  .guest .react-controls .visual-filters button {
    flex-basis: 42px;
    min-height: 36px;
    padding: 8px 0;
  }
  .guest .react-controls .shutter {
    width: 62px;
    height: 62px;
  }
  .camera-app[data-view="camera"] .camera-nav {
    left: calc((100% - 250px) / 2);
  }
}
@media (prefers-reduced-motion: reduce) {
  .guest .react-controls .shutter-core {
    transition: none;
  }
}
.camera-top .queue-status #upload-status {
  display: inline;
}
.guest .react-controls .visual-filters button {
  min-width: 0;
}
.react-viewfinder:not([data-state="live"]) {
  background: var(--paper);
}
.camera-app[data-view="camera"] .event-identity {
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.guest .camera-nav {
  width: 280px;
}
.guest .camera-nav button {
  white-space: nowrap;
}
#photo-total {
  font-size: 10px;
  opacity: 0.7;
}
/* Mechanical shutter feedback is UI only; it never changes the captured pixels. */
.mechanical-shutter {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  overflow: hidden;
}
.guest .mechanical-shutter svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: center;
  animation: shutter-twist 680ms cubic-bezier(0.45, 0, 0.25, 1) both;
}
.iris-blade {
  fill: #11130f;
  stroke: #2e3029;
  stroke-width: 0.35;
  animation: shutter-iris 680ms cubic-bezier(0.45, 0, 0.25, 1) both;
}
/* A short wind, fast close, closed beat, then a relaxed spring return. */
@keyframes shutter-twist {
  0% {
    transform: rotate(-7deg) scale(1.45);
  }
  18% {
    transform: rotate(-4deg) scale(1.45);
  }
  42%,
  47% {
    transform: rotate(7deg) scale(1.45);
  }
  76% {
    transform: rotate(3deg) scale(1.45);
  }
  100% {
    transform: rotate(0deg) scale(1.45);
  }
}
@keyframes shutter-iris {
  0%,
  100% {
    transform: translateX(240px);
  }
  18% {
    transform: translateX(65px);
  }
  42%,
  47% {
    transform: translateX(-1px);
  }
  66% {
    transform: translateX(28px);
  }
  80% {
    transform: translateX(82px);
  }
}
.capture-feedback {
  position: absolute;
  z-index: 3;
  top: calc(env(safe-area-inset-top, 0px) + 84px);
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.capture-feedback span {
  background: #151713d9;
  border: 1px solid #ffffff35;
  border-radius: 22px;
  color: #fff;
  padding: 10px 16px;
  font:
    12px/1.4 Arial,
    sans-serif;
  box-shadow: 0 5px 24px #0002;
  backdrop-filter: blur(12px);
}
.guest .react-controls .shutter[aria-busy="true"] {
  opacity: 1;
}
.guest .react-controls .shutter[aria-busy="true"] .shutter-core {
  transform: scale(0.86);
  opacity: 0.65;
}
@media (prefers-reduced-motion: reduce) {
  .mechanical-shutter {
    display: none;
  }
  .guest .react-controls .shutter-core {
    transition: none;
  }
}

.storage-status {
  position: absolute;
  z-index: 6;
  top: calc(env(safe-area-inset-top, 0px) + 70px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  padding: 10px 16px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 5px 18px #0003;
  background: #23261fde;
  color: #fff;
  font:
    11px/1.4 Arial,
    sans-serif;
  white-space: nowrap;
  pointer-events: none;
}
.camera-app:has(.storage-status:not([hidden])) .capture-feedback {
  top: calc(env(safe-area-inset-top, 0px) + 130px);
}

.storage-status[hidden] {
  display: none;
}
.storage-status > svg {
  width: 24px;
  height: 24px;
  flex: none;
}
.storage-status small {
  display: block;
  font-size: 10px;
  opacity: 0.75;
  margin-top: 2px;
}

/* GPU preview overlays the untouched, full-frame camera; shutter remains above it. */
.pixi-view {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
}
.pixi-view[data-ready="true"] {
  opacity: 1;
  background: #11130f;
}
.pixi-view canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.effects-fallback {
  position: absolute;
  top: 150px;
  left: 15%;
  right: 15%;
  text-align: center;
  color: #fff;
  background: #111b;
  border-radius: 12px;
  padding: 5px;
  font-size: 11px;
}
.guest .filter-strength {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: min(310px, 90vw);
  margin: 8px auto;
  padding: 8px 14px;
  border-radius: 25px;
  background: #191b17e8;
  color: #fff;
  font-size: 11px;
}
.filter-strength input {
  min-width: 60px;
  width: 120px;
  accent-color: #f5f0dc;
  padding: 0;
}
.filter-strength output {
  min-width: 30px;
}
.filter-sample img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* Quiet camera controls: the photo gets the space, strength is revealed on demand. */
.pixi-view {
  z-index: 1;
}
.react-viewfinder:has(.pixi-view[data-ready="true"]) #live-video {
  opacity: 0;
}
.camera-app[data-view="camera"] .camera-controls.react-controls {
  padding: 12px 18px 0;
  gap: 8px;
  background: linear-gradient(transparent, #0003);
}
.camera-controls.react-controls .visual-filters {
  padding: 5px 9px;
  gap: 8px;
  border-radius: 24px;
  max-width: 290px;
  background: #16181580;
}
.guest .react-controls .visual-filters button {
  flex-basis: 43px;
  min-height: 44px;
  gap: 3px;
  font-size: 9px;
}
.react-controls .filter-sample {
  width: 25px;
  height: 25px;
}
.guest .react-controls .strength-toggle {
  align-self: center;
  width: auto;
  min-height: 28px;
  padding: 4px 12px;
  border: 0;
  border-radius: 16px;
  background: #17191599;
  color: #fff;
  font-size: 10px;
}
.guest .filter-strength {
  margin: 0 auto 4px;
  padding: 5px 12px;
}
.capture-feedback {
  top: auto;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 250px);
}
.capture-feedback span {
  padding: 5px 10px;
  font-size: 11px;
  background: #151713aa;
  border: 0;
}
.camera-app:has(.storage-status:not([hidden])) .capture-feedback {
  top: auto;
}
.camera-app:has(#camera-screen[data-state="live"]) .queue-status {
  max-width: 155px;
  font-size: 10px;
  padding: 6px 9px;
  background: #1a1b1966;
}

/* Keep complete filter names in their own touch targets; scroll instead of squeezing. */
.guest .react-controls .visual-filters button {
  flex: 0 0 68px;
  width: 68px;
  min-width: 68px;
  max-width: 68px;
  font-size: 10px;
}
.guest .react-controls .visual-filters button .filter-name {
  display: block;
  width: 100%;
  white-space: normal;
  overflow-wrap: normal;
  line-height: 1.2;
  min-height: 24px;
  text-align: center;
}
