/* Booth, styled after the 26º Convívio da Família Queirós identity (shared/brand.css). */
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%; overflow: hidden; background: var(--ink); color: var(--ink);
  font-family: var(--font);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
body.hide-cursor, body.hide-cursor * { cursor: none !important; }

#camera, #frozen {
  position: fixed; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
#camera { transform: scaleX(-1); } /* mirror like a selfie */
#frozen { display: none; }
body[data-state="processing"] #frozen, body[data-state="error"] #frozen { display: block; filter: blur(10px) brightness(0.55) sepia(0.25); }

#flash { position: fixed; inset: 0; background: var(--cream-light); opacity: 0; pointer-events: none; }
#flash.on { animation: flash 0.6s ease-out; }
@keyframes flash { from { opacity: 1; } to { opacity: 0; } }

.screen { position: fixed; inset: 0; display: none; }
body[data-state="idle"] #idle,
body[data-state="countdown"] #countdown,
body[data-state="processing"] #processing,
body[data-state="result"] #result,
body[data-state="error"] #error { display: flex; }

.eyebrow {
  margin: 0; font-size: clamp(0.9rem, 1.5vw, 1.3rem); font-weight: 500;
  letter-spacing: 0.4em; text-transform: uppercase; color: var(--olive);
}

/* ---------- idle: live camera with the event logo ---------- */
#idle {
  flex-direction: column; justify-content: space-between;
  background:
    linear-gradient(to bottom, rgba(37, 32, 21, 0.55), transparent 32%),
    linear-gradient(to top, rgba(37, 32, 21, 0.85), transparent 45%);
}
.idle-brand { padding: 4vh 4vw; }
.idle-brand .brand-logo { font-size: clamp(1.1rem, 2.6vw, 2.4rem); filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.35)); }
.idle-action {
  display: flex; flex-direction: column; align-items: center; gap: 1.2vh; padding-bottom: 7vh; color: var(--cream-light);
}
.idle-action .eyebrow { color: var(--cream-light); opacity: 0.85; }
.idle-action .eyebrow, .subtitle { text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55); }
.subtitle { margin: 0 0 2.5vh; font-size: clamp(1.2rem, 2.6vw, 2.2rem); font-weight: 500; }
.big-button {
  font: inherit; font-weight: 700; font-size: clamp(1.6rem, 4vw, 3.2rem);
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--cream-light);
  padding: 0.7em 2em; border: none; border-radius: 999px; cursor: pointer;
  background: var(--olive);
  box-shadow: 0 0 0 0 rgba(180, 174, 116, 0.6), 0 12px 40px rgba(0, 0, 0, 0.35);
  animation: ring 2.2s ease-out infinite;
}
.big-button:active { transform: scale(0.96); background: var(--olive-dark); }
@keyframes ring { 70% { box-shadow: 0 0 0 1.6vh rgba(180, 174, 116, 0), 0 12px 40px rgba(0, 0, 0, 0.35); } 100% { box-shadow: 0 0 0 0 rgba(180, 174, 116, 0), 0 12px 40px rgba(0, 0, 0, 0.35); } }

/* ---------- countdown ---------- */
#countdown { align-items: center; justify-content: center; background: radial-gradient(circle, rgba(37, 32, 21, 0.25), rgba(37, 32, 21, 0.55)); }
#count {
  font-size: 42vh; font-weight: 700; line-height: 1; color: var(--cream-light);
  text-shadow: 0 0 60px rgba(0, 0, 0, 0.45);
}
#count.tick { animation: tick 1s ease-out; }
@keyframes tick { from { transform: scale(1.5); opacity: 0; } 30% { opacity: 1; } to { transform: scale(0.92); } }

/* ---------- processing + error: cream cards ---------- */
#processing, #error { align-items: center; justify-content: center; }
.card {
  position: relative; border-radius: 28px; padding: 5vh 6vw; text-align: center; min-width: min(80vw, 900px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}
#roulette { display: flex; flex-direction: column; align-items: center; margin: 2.5vh 0 1.5vh; }
#roulette-emoji { font-size: clamp(4rem, 11vw, 8rem); line-height: 1.1; }
#roulette-name { font-size: clamp(2rem, 5.2vw, 4.2rem); font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }
#roulette.landed { animation: land 0.6s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes land { from { transform: scale(0.6); } to { transform: scale(1); } }
.hint { font-size: clamp(1.1rem, 2.1vw, 1.7rem); font-weight: 500; margin: 1vh 0 3.5vh; color: var(--ink-soft); }
.title-sm { font-size: clamp(2rem, 5vw, 4rem); margin: 0; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.card-leaves { width: clamp(3rem, 6vw, 5rem); margin-bottom: 1vh; }
.bar { height: 6px; border-radius: 99px; background: var(--cream-dark); overflow: hidden; }
.bar div {
  height: 100%; width: 35%; border-radius: 99px; background: var(--olive);
  animation: slide 1.4s ease-in-out infinite;
}
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(290%); } }

/* ---------- result: the print on cream paper ---------- */
#result { flex-direction: column; align-items: center; gap: 2.5vh; padding: 4vh 4vw 0; }
.result-photo {
  flex: 1; min-height: 0; width: 100%;
  display: flex; align-items: center; justify-content: center;
}
#result-img {
  max-width: 100%; max-height: 100%; object-fit: contain;
  border: clamp(8px, 1.2vw, 18px) solid var(--cream-light);
  box-shadow: 0 2px 4px rgba(37, 32, 21, 0.12), 0 20px 50px rgba(37, 32, 21, 0.25);
  animation: reveal 0.8s ease-out;
}
@keyframes reveal { from { opacity: 0; transform: scale(1.04) rotate(-1deg); } }
.result-footer {
  width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 2vw;
  padding: 2vh 0 3vh; border-top: 2px solid var(--olive);
}
.result-footer .brand-line { font-size: clamp(0.7rem, 1.15vw, 1.05rem); }
.result-info { display: flex; flex-direction: column; align-items: center; gap: 0.3vh; text-align: center; }
#result-theme { font-size: clamp(1.2rem, 2.4vw, 2rem); font-weight: 800; letter-spacing: 0.03em; text-transform: uppercase; }
.result-tv { font-size: clamp(0.8rem, 1.3vw, 1.1rem); font-weight: 500; letter-spacing: 0.3em; text-transform: uppercase; color: var(--olive); }
.small-button {
  justify-self: end;
  font: inherit; font-weight: 700; font-size: clamp(1rem, 2vw, 1.6rem);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--cream-light);
  padding: 0.6em 1.6em; border: none; border-radius: 999px; cursor: pointer; background: var(--olive);
}
.small-button:active { background: var(--olive-dark); }
