/* BananaBooth kiosk styles (PRD §9).
   Dark background, large friendly type, one accent color (amber), generous but
   short motion (<=300ms). Touch-first: >=64px targets, no hover states, no
   scrolling on any screen. */

:root {
  --bg: #0d0d12;
  --bg-2: #17171f;
  --card: #1d1d27;
  --fg: #f4f4f7;
  --muted: #9a9aa8;
  --accent: #ffcf3f;      /* single accent color */
  --accent-ink: #16161d;
  --premium: #c69bff;     /* Premium ✨ distinct but not nagging */
  --danger: #ff6b6b;
  --tap-min: 64px;        /* §9 minimum tap target */
  --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* The hidden attribute must always win: any element with its own display rule
   (e.g. .camera-error's display:grid) would otherwise override the UA's
   [hidden]{display:none} and stay visible — .camera-error covered the live
   camera feed with its black overlay until this rule was added. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;                 /* §9 no scrolling on any screen */
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  /* Kiosk hardening (§9): no text selection, no touch callout, no double-tap
     zoom. Pinch-zoom is also blocked via the viewport meta. */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

#app {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 20%, #1c1c2a 0%, var(--bg) 70%);
}

/* ---- screens ---- */
.screen {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vmin, 56px);
}
.screen.active {
  display: flex;
  animation: fade 220ms ease both;   /* <=300ms motion (§9) */
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---- shared buttons ---- */
.btn {
  min-height: var(--tap-min);
  min-width: 200px;
  padding: 0 34px;
  border: none;
  border-radius: 999px;
  font-size: clamp(1.1rem, 2.4vmin, 1.5rem);
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, filter 140ms ease;
}
.btn:active { transform: scale(0.96); }   /* no hover states — active only */
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost {
  background: transparent; color: var(--muted);
  border: 2px solid #34343f;
}
.btn[disabled] { opacity: 0.4; filter: grayscale(0.4); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: clamp(28px, 5vmin, 56px);
  max-width: 720px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

/* ---- ATTRACT ---- */
.attract-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.logo-emoji { font-size: clamp(72px, 16vmin, 160px); display: inline-block; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-10px) rotate(3deg); } }
.event-name { font-size: clamp(2rem, 6vmin, 4rem); font-weight: 800; letter-spacing: -0.02em; }
.tagline { color: var(--muted); font-size: clamp(1rem, 2.4vmin, 1.4rem); letter-spacing: 0.35em; text-transform: uppercase; }
.tap-pulse { margin-top: 40px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
.tap-dot {
  width: 26px; height: 26px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 rgba(255, 207, 63, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 207, 63, 0.55); }
  70% { box-shadow: 0 0 0 34px rgba(255, 207, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 207, 63, 0); }
}
.tap-hint { color: var(--fg); font-size: clamp(1.1rem, 3vmin, 1.8rem); font-weight: 600; }

/* ---- CONSENT ---- */
.consent-card h2 { font-size: clamp(1.8rem, 4.5vmin, 2.8rem); margin-bottom: 22px; }
.consent-body { font-size: clamp(1.05rem, 2.5vmin, 1.5rem); line-height: 1.55; color: #dcdce4; margin-bottom: 34px; }
.consent-actions { display: flex; flex-direction: column; gap: 16px; align-items: center; }

/* ---- CAPTURE ---- */
#screen-capture { padding: 0; }
.camera-feed {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1);            /* mirror the LIVE preview only (§9) */
  background: #000;
}
.capture-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  padding-bottom: clamp(40px, 8vmin, 90px);
  pointer-events: none;
}
.capture-overlay > * { pointer-events: auto; }
.capture-btn {
  width: 108px; height: 108px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 5px solid #fff; cursor: pointer;
  display: grid; place-items: center;
  transition: transform 140ms ease;
}
.capture-btn:active { transform: scale(0.92); }
.capture-ring { width: 78px; height: 78px; border-radius: 50%; background: #fff; }
.capture-hint {
  margin-top: 22px; color: #fff; font-size: clamp(1rem, 2.6vmin, 1.4rem);
  font-weight: 600; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}
.countdown {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  font-size: clamp(140px, 34vmin, 360px); font-weight: 900; color: #fff;
  text-shadow: 0 8px 40px rgba(0, 0, 0, 0.6); line-height: 1;
}
.countdown.tick { animation: pop 800ms ease both; }
@keyframes pop { 0% { transform: translate(-50%, -50%) scale(0.4); opacity: 0; } 30% { opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1.4); opacity: 0; } }
.flash {
  position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none;
}
.flash.fire { animation: flash 260ms ease-out; }  /* <=300ms (§9) */
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.camera-error {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: #000; color: var(--fg); text-align: center;
  font-size: clamp(1.2rem, 3vmin, 1.8rem); line-height: 1.6; padding: 24px;
}

/* ---- REVIEW ---- */
.review-inner { display: flex; flex-direction: column; align-items: center; gap: 28px; max-height: 100%; }
.review-image {
  max-width: min(78vw, 620px); max-height: 64vh; width: auto; height: auto;
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  /* NOT mirrored — this is the captured still (§9). */
}
.review-actions { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; }

/* ---- STYLE SELECT ---- */
.style-inner { display: flex; flex-direction: column; align-items: center; gap: clamp(20px, 3.5vmin, 40px); width: 100%; max-width: 1000px; }
.style-title { font-size: clamp(1.6rem, 4vmin, 2.6rem); font-weight: 800; }
.style-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(14px, 2.5vmin, 26px);
  width: 100%;
}
.style-card {
  position: relative; aspect-ratio: 3 / 4; border-radius: var(--radius);
  border: 4px solid transparent; overflow: hidden; cursor: pointer;
  min-height: var(--tap-min);
  display: flex; flex-direction: column; justify-content: flex-end;
  transition: transform 160ms ease, border-color 160ms ease;
  color: #fff;
}
.style-card:active { transform: scale(0.97); }
.style-card.is-selected { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 207, 63, 0.25); }
/* Phase 4 will drop pre-baked thumbnails into public/assets/thumb-<id>.jpg
   (§9 / Phase 4). Until then each card shows a themed gradient placeholder. */
.style-card[data-style="vintage"] { background: linear-gradient(150deg, #6b5330, #2b2016 70%); }
.style-card[data-style="cyberpunk"] { background: linear-gradient(150deg, #10bfd0, #6a1a8a 60%, #12030f); }
.style-card[data-style="cartoon"] { background: linear-gradient(150deg, #ff9d5c, #ff5c9d 55%, #7a3bd6); }
.style-card .thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.style-card .style-emoji { position: absolute; top: 12%; left: 0; right: 0; text-align: center; font-size: clamp(38px, 8vmin, 78px); }
.style-card .style-name {
  position: relative; z-index: 1; padding: 16px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.72));
  font-size: clamp(1rem, 2.3vmin, 1.4rem); font-weight: 700; text-align: center;
}
.tier-toggle { display: flex; gap: 14px; }
.tier-btn {
  min-height: var(--tap-min); min-width: 180px; padding: 12px 26px;
  border-radius: 16px; border: 2px solid #34343f; background: var(--bg-2);
  color: var(--fg); cursor: pointer; display: flex; flex-direction: column; gap: 2px;
  transition: transform 140ms ease, border-color 140ms ease;
}
.tier-btn:active { transform: scale(0.96); }
.tier-btn .tier-label { font-size: clamp(1.05rem, 2.4vmin, 1.35rem); font-weight: 700; }
.tier-btn .tier-sub { font-size: 0.85rem; color: var(--muted); }
.tier-btn[data-tier="standard"].is-selected { border-color: var(--accent); }
.tier-btn[data-tier="premium"].is-selected { border-color: var(--premium); }
.tier-btn[data-tier="premium"] .tier-label { color: var(--premium); }
.btn-generate { min-width: 260px; }

/* ---- PIN (Phase 5.5 daily-quota bypass) ---- */
.pin-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: clamp(14px, 2.6vmin, 26px); width: 100%; max-width: 480px; text-align: center;
}
.pin-title { font-size: clamp(1.6rem, 4vmin, 2.6rem); font-weight: 800; }
.pin-sub {
  color: var(--muted); font-size: clamp(1rem, 2.3vmin, 1.3rem);
  line-height: 1.5; max-width: 420px;
}
.pin-dots { display: flex; gap: clamp(12px, 2vmin, 18px); }
.pin-dot {
  width: clamp(18px, 2.4vmin, 24px); height: clamp(18px, 2.4vmin, 24px);
  border-radius: 50%; border: 2px solid #44444f; background: transparent;
  transition: background 140ms ease, border-color 140ms ease;
}
.pin-dot.filled { background: var(--accent); border-color: var(--accent); }
.pin-error {
  color: var(--danger); font-size: clamp(0.95rem, 2.2vmin, 1.25rem);
  font-weight: 600; min-height: 1.5em; line-height: 1.3;
}
.pin-keypad {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: clamp(10px, 1.8vmin, 16px); width: 100%;
}
.pin-key {
  min-height: var(--tap-min); height: clamp(64px, 8.5vmin, 84px);
  border-radius: 16px; border: 2px solid #34343f; background: var(--bg-2);
  color: var(--fg); font-size: clamp(1.4rem, 3.2vmin, 2rem); font-weight: 700;
  cursor: pointer; transition: transform 120ms ease, border-color 120ms ease;
}
.pin-key:active { transform: scale(0.95); }
.pin-key-alt { font-size: clamp(1rem, 2.3vmin, 1.3rem); color: var(--muted); }
.pin-key[disabled] { opacity: 0.4; }

/* ---- GENERATING ---- */
.gen-inner { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 26px; }
.spinner { display: flex; gap: 14px; }
.spinner span {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
  animation: bounce 1.1s infinite ease-in-out both;
}
.spinner span:nth-child(1) { animation-delay: -0.24s; }
.spinner span:nth-child(2) { animation-delay: -0.12s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(0.4); opacity: 0.5; } 40% { transform: scale(1); opacity: 1; } }
.gen-copy { font-size: clamp(1.5rem, 4vmin, 2.6rem); font-weight: 800; min-height: 1.4em; }
.gen-sub { color: var(--muted); font-size: clamp(1rem, 2.4vmin, 1.35rem); }

/* ---- RESULT ---- */
.result-inner {
  display: flex; align-items: center; justify-content: center;
  gap: clamp(24px, 5vmin, 64px); flex-wrap: wrap; width: 100%; max-width: 1100px;
}
.result-image {
  max-width: min(60vw, 560px); max-height: 78vh; width: auto; height: auto;
  border-radius: var(--radius); box-shadow: 0 20px 70px rgba(0, 0, 0, 0.55);
}
.result-side { display: flex; flex-direction: column; align-items: center; gap: 22px; }
.qr-wrap { background: #fff; padding: 16px; border-radius: 18px; }
.qr-image { width: clamp(240px, 30vmin, 300px); height: auto; display: block; }
.result-caption { color: #dcdce4; font-size: clamp(1rem, 2.4vmin, 1.35rem); text-align: center; max-width: 320px; }

/* ---- ERROR ---- */
.error-card { max-width: 620px; }
.error-emoji { font-size: clamp(56px, 12vmin, 110px); margin-bottom: 16px; }
.error-card h2 { font-size: clamp(1.5rem, 3.6vmin, 2.4rem); margin-bottom: 30px; line-height: 1.35; }

/* ---- staff escape hotspot (invisible) ---- */
.staff-hotspot {
  position: fixed; top: 0; left: 0; width: 72px; height: 72px;
  z-index: 50; background: transparent;
}

/* Landscape: keep everything letterboxed inside the viewport (§9 degrade to
   1920x1080). No scrolling; sizes already use vmin/clamp so they fit. */
@media (orientation: landscape) {
  .style-cards { max-width: 820px; }
}
