/* ==========================================================================
   booth.css - the Camera app's photo booth. Shared by both shells.
   ========================================================================== */

.booth {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 12px 16px 18px;
  box-sizing: border-box;
  background: #000;
  color: #fff;
  outline: none;
}

/* Square, as big as fits under the controls. */
.booth-stage {
  position: relative;
  width: min(100%, calc(100dvh - 300px), 640px);
  aspect-ratio: 1;
  overflow: hidden;
  background: #111;
  flex: none;
  transition: box-shadow 200ms var(--ease-out), padding 200ms var(--ease-out), background 200ms;
}
/* The booth frame previewed live, at the print's exact proportions: the
   print is a square photo s wide with a 0.05s border and a 0.17s foot, so it
   is 1.10s wide by 1.22s tall. Padding is sized off --side (the stage's own
   width, set from JS) rather than %, because percentage padding resolves
   against the parent's width, not the element's. */
.booth-stage.is-framed {
  aspect-ratio: 1.10 / 1.22;
  /* Taller than square, so narrower for the same height budget, which
     keeps the shutter on screen. */
  width: min(100%, calc((100dvh - 300px) * 0.902), 640px);
  background: #f6f3ec;
  padding:
    calc(var(--side, 600px) * 0.04545)
    calc(var(--side, 600px) * 0.04545)
    calc(var(--side, 600px) * 0.15455);
  box-sizing: border-box;
}
/* Same words, same places as the print the capture will produce. */
.booth-stage.is-framed::before,
.booth-stage.is-framed::after {
  position: absolute;
  bottom: calc(var(--side, 600px) * 0.046);
  line-height: 1;
  pointer-events: none;
}
.booth-stage.is-framed::before {
  content: attr(data-label);
  left: calc(var(--side, 600px) * 0.04545);
  font-family: var(--font-light);
  font-weight: 200;
  font-size: calc(var(--side, 600px) * 0.044);
  color: #2a2a2a;
}
.booth-stage.is-framed::after {
  content: attr(data-date);
  right: calc(var(--side, 600px) * 0.04545);
  font-size: calc(var(--side, 600px) * 0.03);
  color: #7a7a7a;
}

/* Reviewing a shot: the stage takes the photo's own shape, so a framed print
   (taller than square) isn't cropped, and the live frame styling steps
   aside because the print already contains it. */
.booth-stage.is-review {
  aspect-ratio: auto;
  padding: 0;
  background: transparent;
}
.booth-stage.is-review::before,
.booth-stage.is-review::after { content: none; }
.booth-stage.is-review .booth-result {
  position: static;
  height: auto;
  object-fit: contain;
}

.booth-video,
.booth-result {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.booth-video.is-mirrored { transform: scaleX(-1); }
/* The capture already contains the frame, so it fills the stage edge to edge. */

.booth-count {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--font-light);
  font-weight: 200;
  font-size: clamp(90px, 28vw, 180px);
  color: #fff;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.booth-count.is-tick { animation: booth-tick 750ms var(--ease-out); }
@keyframes booth-tick {
  from { transform: scale(1.5); opacity: 0; }
  30%  { transform: scale(1); opacity: 1; }
  to   { transform: scale(0.92); opacity: 0.2; }
}

.booth-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.booth-flash.is-on { animation: booth-flash 520ms ease-out; }
@keyframes booth-flash { from { opacity: 1; } to { opacity: 0; } }

.booth-message {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  font-size: 15px;
  line-height: 1.5;
  background: #111;
}

/* -- live controls --------------------------------------------------------- */

.booth-live,
.booth-after {
  width: min(100%, 640px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.booth-filters {
  display: flex;
  gap: 8px;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px;
}
.booth-filters::-webkit-scrollbar { display: none; }
.booth-chip {
  flex: none;
  height: 30px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  cursor: pointer;
}
.booth-chip.is-on { color: #fff; background: var(--accent); border-color: var(--accent); }

.booth-bar {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}
.booth-bar > :first-child { justify-self: start; }
.booth-bar > :last-child { justify-self: end; }

.booth-shutter {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--accent);
  box-shadow: inset 0 0 0 4px #000;
  cursor: pointer;
  transition: transform 120ms var(--ease-out);
}
.booth-shutter:active { transform: scale(0.92); }
.booth-shutter:disabled { opacity: 0.35; cursor: default; }

.booth-tool {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  font: inherit;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
}
.booth-tool.is-on { color: #fff; border-color: var(--accent); background: rgba(255, 255, 255, 0.06); }

/* -- after the shot -------------------------------------------------------- */

.booth-after { flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 10px; }
.booth-action {
  height: 38px;
  padding: 0 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  cursor: pointer;
}
.booth-action.is-ghost { background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); }

@media (prefers-reduced-motion: reduce) {
  .booth-count.is-tick, .booth-flash.is-on { animation: none; }
}

/* -- hosts ----------------------------------------------------------------- */
.booth-host { padding: 0 !important; height: 100%; }
.wp-booth { background: #000; }
.wp-booth .booth { padding-top: 16px; }
