#camera {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
  background: #080809;
}
#camera::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, #0007, #0003 32%, #0001 50%),
    #100e0e url('assets/cinema-square/entrance.webp') 54% 50% / cover;
}
.ready #camera::before {
  inset: -30px;
  filter: blur(30px) brightness(0.27);
}
.plate {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  isolation: isolate;
  transform-origin: 0 0;
  visibility: hidden;
  background: #090a0a;
}
.ready .plate {
  visibility: visible;
}
.scenic-layer {
  position: absolute;
  pointer-events: none;
  filter: url('#projector-exposure');
}
#room-layer {
  z-index: 1;
}
#hand-layer {
  z-index: 2;
}
.plate .phone {
  z-index: 3;
}
#viewer-layer {
  z-index: 4;
}
#screen-plane {
  position: absolute;
  left: 0;
  top: 0;
  width: 800px;
  height: 450px;
  transform-origin: 0 0;
  --screen-black: #05090a;
  overflow: hidden;
  background: var(--screen-black);
  box-shadow: 0 0 0 16px var(--screen-black);
}
#trailer {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.045);
  filter: brightness(0.88) contrast(0.95) saturate(0.89) blur(var(--optical-blur, 0.6px));
}
#screen-plane::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse farthest-side at 50% 42%,
    transparent 35%,
    #17110d1b 85%,
    #0b0b0c35 100%
  );
  box-shadow:
    inset 0 0 3px 1px var(--screen-black),
    inset 0 0 calc(6px + var(--optical-blur, .6px)) 2px var(--screen-black);
}
/* Feather the edge of the photographed field when a portrait crop reveals the top or bottom. */
.plate {
  mask-image: linear-gradient(
    to bottom,
    transparent,
    black var(--fade-top, 0px),
    black calc(100% - var(--fade-bottom, 0px)),
    transparent
  ), linear-gradient(to right, transparent, black var(--fade-side, 0px), black calc(100% - var(--fade-side, 0px)), transparent);
  mask-composite: intersect;
}
.phone-display {
  filter: brightness(var(--oled-gain, 1));
}
/* Keep the controls usable if the connection fails before a photographic plate arrives. */
.camera-unavailable .plate {
  visibility: visible;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
  mask: none;
  background: transparent;
}
.camera-unavailable .scenic-layer {
  display: none;
}
.camera-unavailable #screen-plane {
  left: 50%;
  top: 28%;
  width: min(70vw, 75vh);
  height: auto;
  aspect-ratio: 16 / 9;
  transform: translate(-50%, -50%) !important;
  overflow: hidden;
}
.camera-unavailable .phone {
  visibility: hidden;
}
.camera-unavailable.is-close .phone {
  visibility: visible;
  left: 50%;
  top: 46%;
  transform: translate(-50%, -50%) scale(var(--fallback-scale, 0.55)) !important;
  box-shadow: 0 0 0 5px #08090a;
}
@media (max-height: 625px) {
  .camera-unavailable {
    --fallback-scale: 0.39;
  }
}
@media (max-height: 450px) {
  .camera-unavailable {
    --fallback-scale: 0.24;
  }
}
