/* booth.css: the Hero Booth, a full-screen camera page (on top of camera.css).
 * A comic-book stage: the camera fills the screen, the director's caption floats in a speech bubble, the figures
 * are picked from a row of badges at the bottom. Phones, tablets and big kiosk screens alike. */

:root {
  --booth-ink: #121212;
  --booth-night: #0d0b1f;
  --booth-paper: #ffffff;
  --booth-pop: #ffe14d;
  --booth-hot: #ff3b5c;
  --booth-sky: #4cc9ff;
  --booth-display: 'Bangers', Impact, 'Arial Black', sans-serif;
  --booth-text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --booth-gutter: clamp(12px, 2.4vw, 28px);
  --booth-bubble: clamp(16px, 1.6vw, 24px);
}

body.booth { background: var(--booth-night); font-family: var(--booth-text); }
.booth .cq-camera { font-family: var(--booth-text); }
.booth-media { background: radial-gradient(circle at 50% 40%, #2a1f5c, var(--booth-night) 70%); }
.booth-media video { opacity: 0; }                       /* the canvas shows the camera, with the heroes */
.booth-media::after { display: none; }                   /* the canvas has its own shading */
.booth [hidden] { display: none !important; }

/* buttons over the camera */
.booth .cq-camera-button { font-family: var(--booth-text); font-weight: 600; min-height: 44px; }
.booth .cq-camera-button.is-primary { background: var(--booth-pop); color: var(--booth-ink); box-shadow: 0 0 0 3px var(--booth-ink), 4px 4px 0 3px var(--booth-ink); }
.booth .cq-camera-button.is-primary:hover { background: var(--booth-paper); }
.booth button:focus-visible, .booth a:focus-visible { outline: 3px solid var(--booth-sky); outline-offset: 3px; }

/* ---------- top bar ---------- */
.booth-top {
  position: absolute; z-index: 3; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: max(var(--booth-gutter), env(safe-area-inset-top)) var(--booth-gutter) 0;
}
.booth-logo {
  font-family: var(--booth-display); font-size: clamp(26px, 3.4vw, 46px); letter-spacing: 1px; line-height: 1;
  color: var(--booth-pop); text-decoration: none; transform: rotate(-3deg);
  -webkit-text-stroke: 2px var(--booth-ink); text-shadow: 3px 3px 0 var(--booth-ink);
}
.booth-logo:hover { color: var(--booth-paper); }
.booth-count {
  padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .45); color: var(--booth-paper);
  font-size: 14px; font-weight: 600; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.booth-tools { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.booth-tools .cq-camera-button { min-height: 38px; padding: 0 14px; font-size: 13px; }
.booth-tools [aria-pressed='false'] { opacity: .65; text-decoration: line-through; }

/* ---------- the director: a megaphone and its speech bubble, top left, clear of the heads ---------- */
.booth-director {
  position: absolute; z-index: 3; left: var(--booth-gutter); top: calc(max(var(--booth-gutter), env(safe-area-inset-top)) + 64px);
  display: flex; align-items: flex-start; gap: 10px; max-width: min(480px, 38vw); pointer-events: none;
}
.booth-director-icon {
  flex: 0 0 auto; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  background: var(--booth-pop); color: var(--booth-ink); border: 3px solid var(--booth-ink); box-shadow: 3px 3px 0 var(--booth-ink);
}
.booth-caption {
  position: relative; margin: 6px 0 0; padding: 12px 18px; border-radius: 18px; border: 3px solid var(--booth-ink);
  background: var(--booth-paper); color: var(--booth-ink); box-shadow: 5px 5px 0 var(--booth-ink);
  font-size: var(--booth-bubble); font-weight: 700; line-height: 1.25;
}
.booth-caption:empty { display: none; }
.booth-caption::before {
  content: ''; position: absolute; left: -13px; top: 12px; width: 14px; height: 18px;
  background: var(--booth-ink); clip-path: polygon(100% 0, 0 50%, 100% 100%);
}
.booth-caption.is-new { animation: booth-pop .35s cubic-bezier(.2, 1.6, .5, 1); transform-origin: left top; }
.booth-director:has(.booth-caption:empty) .booth-director-icon { opacity: .7; }

.booth-hint {
  position: absolute; z-index: 3; left: 50%; transform: translateX(-50%); bottom: calc(var(--booth-picker-h, 220px) + 16px);
  margin: 0; padding: 8px 16px; border-radius: 999px; background: var(--booth-hot); color: var(--booth-paper);
  font-weight: 700; font-size: clamp(14px, 1.6vw, 18px); border: 3px solid var(--booth-ink); white-space: nowrap;
  animation: booth-bounce 1.2s ease-in-out infinite;
}

/* ---------- the countdown ---------- */
.booth-countdown {
  position: absolute; z-index: 5; inset: 0; margin: 0; display: grid; place-items: center; pointer-events: none;
  font-family: var(--booth-display); font-size: clamp(120px, 28vw, 360px); line-height: 1; color: var(--booth-pop);
  -webkit-text-stroke: 6px var(--booth-ink); text-shadow: 10px 10px 0 var(--booth-ink); text-align: center;
}
.booth-countdown.is-pop { animation: booth-count .9s cubic-bezier(.2, 1.4, .4, 1) both; }
.booth-flash { position: absolute; z-index: 6; inset: 0; background: var(--booth-paper); opacity: 0; pointer-events: none; }
.booth-flash.is-on { animation: booth-flash .7s ease-out; }

/* ---------- the picker ---------- */
.booth-picker {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  padding: 12px var(--booth-gutter) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(to top, rgba(8, 6, 22, .92), rgba(8, 6, 22, .55) 70%, transparent);
  display: flex; flex-direction: column; gap: 10px;
}
.booth-heroes { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.booth-heroes:empty { display: none; }
.booth-hero {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 14px 4px 4px; cursor: pointer;
  border: 2px solid rgba(255, 255, 255, .35); border-radius: 999px; background: rgba(0, 0, 0, .5); color: var(--booth-paper);
  font: 600 14px var(--booth-text);
}
.booth-hero.is-active { background: var(--booth-paper); color: var(--booth-ink); border-color: var(--booth-ink); box-shadow: 3px 3px 0 var(--fig-trim, var(--booth-pop)); }
.booth-hero-number {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--fig-trim, var(--booth-pop)); color: var(--booth-ink); font: 20px var(--booth-display); border: 2px solid var(--booth-ink);
}
.booth-figures {
  display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 8px; scroll-snap-type: x proximity;
  justify-content: safe center; scrollbar-width: thin;
}
.booth-figure {
  flex: 0 0 auto; scroll-snap-align: center; width: clamp(104px, 10.5vw, 136px); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 8px 10px;
  border: 3px solid transparent; border-radius: 16px; background: rgba(255, 255, 255, .1); color: var(--booth-paper);
  font-family: var(--booth-text); transition: transform .15s, background-color .15s;
}
.booth-figure:hover { transform: translateY(-3px); background: rgba(255, 255, 255, .18); }
.booth-figure.is-active { background: var(--booth-paper); color: var(--booth-ink); border-color: var(--booth-ink); box-shadow: 4px 4px 0 var(--fig-trim); transform: translateY(-4px) rotate(-1.5deg); }
.booth-figure-badge { width: clamp(52px, 5.5vw, 72px); height: auto; aspect-ratio: 1; }
.booth-figure-name { font: clamp(17px, 1.7vw, 22px)/1 var(--booth-display); letter-spacing: .5px; text-align: center; }
.booth-figure-line { font-size: 11px; font-weight: 500; opacity: .8; text-align: center; line-height: 1.2; }
.booth-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.booth-shoot { font-size: 16px !important; padding: 0 28px !important; min-height: 50px !important; }

/* ---------- the start screen ---------- */
.booth-start {
  position: absolute; z-index: 7; inset: 0; display: grid; place-items: center; padding: var(--booth-gutter); overflow: auto;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 59, 92, .55), transparent 40%),
    radial-gradient(circle at 80% 30%, rgba(76, 201, 255, .5), transparent 42%),
    radial-gradient(circle at 50% 90%, rgba(255, 225, 77, .4), transparent 45%),
    var(--booth-night);
}
.booth-start::before {
  content: ''; position: absolute; inset: -50%; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, rgba(255, 255, 255, .06) 0 6deg, transparent 6deg 18deg);
  animation: booth-spin 60s linear infinite;
}
.booth-start-inner { position: relative; max-width: 760px; text-align: center; color: var(--booth-paper); }
.booth-kicker { margin: 0 0 8px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; font-size: 14px; color: var(--booth-pop); }
.booth-title {
  margin: 0; font-family: var(--booth-display); font-weight: 400; font-size: clamp(72px, 15vw, 190px); line-height: .9;
  color: var(--booth-pop); transform: rotate(-4deg); -webkit-text-stroke: 4px var(--booth-ink); text-shadow: 8px 8px 0 var(--booth-ink);
}
.booth-lead { margin: 28px auto 28px; max-width: 600px; font-size: clamp(16px, 2vw, 21px); line-height: 1.5; color: rgba(255, 255, 255, .92); }
.booth-start-button {
  min-height: 64px; padding: 0 44px; cursor: pointer; border: 4px solid var(--booth-ink); border-radius: 999px;
  background: var(--booth-hot); color: var(--booth-paper); font: 34px var(--booth-display); letter-spacing: 1px;
  box-shadow: 6px 6px 0 var(--booth-ink); animation: booth-bounce 1.6s ease-in-out infinite;
}
.booth-start-button:hover { background: var(--booth-pop); color: var(--booth-ink); }
.booth-start-button:disabled { opacity: .6; cursor: default; animation: none; }
.booth-loading { margin: 16px 0 0; font-weight: 600; color: var(--booth-pop); animation: booth-blink 1s steps(2) infinite; }
.booth-note { margin: 22px 0 0; font-size: 13px; color: rgba(255, 255, 255, .7); }
.booth-error { margin: 14px 0 0; font-weight: 600; color: #ffb4a8; }
.booth-error:empty { display: none; }

/* ---------- the reveal ---------- */
.booth-reveal {
  position: absolute; z-index: 8; inset: 0; display: grid; place-items: center; overflow: auto;
  padding: var(--booth-gutter); background: rgba(8, 6, 22, .82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: booth-fade .35s ease-out;
}
.booth-reveal-inner { display: flex; gap: clamp(16px, 3vw, 40px); align-items: center; max-width: 1200px; width: 100%; }
.booth-reveal-figure { margin: 0; flex: 1 1 60%; min-width: 0; display: grid; place-items: center; }
.booth-reveal-figure img {
  max-width: 100%; max-height: calc(100vh - 2 * var(--booth-gutter)); border-radius: 18px; border: 4px solid var(--booth-ink);
  box-shadow: 10px 10px 0 var(--booth-ink); animation: booth-drop .7s cubic-bezier(.2, 1.4, .4, 1);
}
.booth-reveal-side { flex: 1 1 40%; min-width: 0; color: var(--booth-paper); }
.booth-reveal-title { margin: 0 0 8px; font: clamp(34px, 4vw, 54px)/1 var(--booth-display); color: var(--booth-pop); -webkit-text-stroke: 1.5px var(--booth-ink); text-shadow: 3px 3px 0 var(--booth-ink); }
.booth-reveal-text { margin: 0 0 16px; font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, .9); }
.booth-share { display: flex; gap: 14px; align-items: center; margin: 0 0 16px; padding: 12px; border-radius: 14px; background: var(--booth-paper); color: var(--booth-ink); }
.booth-qr canvas { display: block; width: 132px; height: 132px; image-rendering: pixelated; }
.booth-share-link { color: var(--booth-ink); font-weight: 600; font-size: 14px; word-break: break-all; }
.booth-factory { margin: 0 0 16px; }
.booth-factory-status { margin: 0 0 10px; font-weight: 600; color: var(--booth-pop); }
.booth-collectible { display: block; max-width: 100%; max-height: 40vh; border-radius: 14px; border: 3px solid var(--booth-ink); }
/* the booth needs an operator to save (the picture stays on screen) */
.booth-operator-needed { margin: 0 0 16px; padding: 16px; border-radius: 14px; background: var(--booth-paper); color: var(--booth-ink); box-shadow: 5px 5px 0 var(--booth-ink); }
.booth-operator-title { margin: 0 0 8px; font: 26px/1 var(--booth-display); letter-spacing: .5px; }
.booth-operator-text { margin: 0 0 14px; font-size: 15px; line-height: 1.45; }
.booth-operator-needed .cq-camera-button { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.booth-reveal-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.booth-reveal-actions .cq-camera-button { flex: 1 1 calc(50% - 8px); }

.booth-operator {
  position: absolute; z-index: 4; right: var(--booth-gutter); bottom: 4px; font-size: 11px;
  color: rgba(255, 255, 255, .45); text-decoration: none;
}
.booth-stage.is-on .booth-operator { bottom: auto; top: calc(max(var(--booth-gutter), env(safe-area-inset-top)) + 48px); }
.booth-operator:hover { color: var(--booth-paper); }

/* ---------- motion ---------- */
@keyframes booth-pop { 0% { transform: scale(.85); } 100% { transform: scale(1); } }
@keyframes booth-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.booth-hint { animation-name: booth-hint; }
@keyframes booth-hint { 0%, 100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -6px); } }
@keyframes booth-count { 0% { transform: scale(2.4) rotate(-12deg); opacity: 0; } 30% { transform: scale(1) rotate(-4deg); opacity: 1; } 100% { transform: scale(.9) rotate(-4deg); opacity: .9; } }
@keyframes booth-flash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes booth-spin { to { transform: rotate(360deg); } }
@keyframes booth-blink { 50% { opacity: .4; } }
@keyframes booth-fade { from { opacity: 0; } }
@keyframes booth-drop { 0% { transform: translateY(-40px) rotate(-6deg) scale(.9); opacity: 0; } 100% { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .booth *, .booth *::before { animation: none !important; transition: none !important; }
}

/* ---------- phones and portrait tablets ---------- */
@media (max-width: 767px) {
  .booth-tools .cq-camera-button { min-height: 34px; padding: 0 10px; font-size: 12px; }
  .booth-tools #fullscreen { display: none; }
  .booth-director { top: auto; bottom: calc(var(--booth-picker-h, 0px) + 58px); max-width: calc(100vw - 2 * var(--booth-gutter)); }
  .booth-director-icon { width: 40px; height: 40px; }
  .booth-caption { font-size: 16px; padding: 10px 14px; }
  .booth-figures { justify-content: flex-start; }
  .booth-reveal-inner { flex-direction: column; }
  .booth-reveal-figure img { max-height: 52vh; }
  .booth-hint { white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); }
}
