:root {
  --stage-pad: 34px;
  --wine: #8f1f36;
  --yellow: #f4ca52;
}

html, body { width: 100%; min-width: 0; overflow: hidden; }
body { background: #f7f2ef; }

.booth {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  overflow: hidden;
  isolation: isolate;
}

.scene {
  position: absolute;
  inset: 0;
  display: none;
  min-width: 0;
  overflow: hidden;
}

.scene.active { display: block; animation: scene-in 420ms cubic-bezier(.2,.75,.2,1) both; }

.start-scene {
  background-color: #f7f2ef;
  color: var(--ink);
}

.start-scene::before {
  content: "";
  position: absolute;
  inset: 18px;
  border: 1px solid rgba(143,31,54,.22);
  pointer-events: none;
}

.start-copy {
  position: relative;
  z-index: 4;
  width: min(720px, calc(100% - 150px));
  margin: 0 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 54px 0;
}

.start-kicker, .eyebrow {
  margin: 0 0 16px;
  color: var(--cherry);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .12em;
}

.start-copy h1 {
  margin: 0;
  color: var(--cherry);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 76px;
  font-style: italic;
  line-height: .95;
  letter-spacing: 0;
}

.start-lead {
  max-width: 620px;
  margin: 22px 0 8px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.08;
}

.start-note { margin: 6px 0 0; color: var(--muted); font-size: 15px; }
.start-button { min-width: 210px; margin-top: 12px; padding: 15px 24px; }

.film-edge {
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  width: 54px;
  background-color: #231b1c;
  background-image: repeating-linear-gradient(to bottom, transparent 0 16px, #f7f2ef 16px 30px, transparent 30px 46px);
}
.film-edge-left { left: 0; }
.film-edge-right { right: 0; }

.start-sticker { position: absolute; z-index: 3; width: 150px; pointer-events: none; }
.sticker-bow { top: 5%; left: 7%; transform: rotate(-11deg); animation: float-a 5s ease-in-out infinite; }
.sticker-flower { right: 6%; bottom: 5%; transform: rotate(12deg); animation: float-b 6s ease-in-out infinite; }

.strip-teaser {
  position: absolute;
  left: 9%;
  bottom: -84px;
  z-index: 1;
  width: 108px;
  padding: 9px;
  background: var(--cherry);
  transform: rotate(8deg);
  box-shadow: 0 20px 45px rgba(80,20,30,.22);
}
.strip-teaser div { height: 70px; margin-bottom: 7px; background: #f3cbd3; }

.shoot-scene { background: #080808; }
.camera-stage { position: absolute; inset: 0; overflow: hidden; background: #080808; }
.camera-stage video { width: 100%; height: 100%; object-fit: cover; display: block; }
.shoot-scene.mirror video { transform: scaleX(-1); }

.flash { position: absolute; inset: 0; background: white; opacity: 0; pointer-events: none; transition: opacity 160ms ease; }
.flash.on { opacity: 1; transition: none; }

.shoot-topbar {
  position: absolute;
  top: 24px;
  left: 24px;
  right: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: white;
}
.shoot-brand { font-family: Georgia, serif; font-size: 24px; font-style: italic; font-weight: 700; }
.camera-info, .shot-label {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(15,15,15,.62);
  color: white;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  backdrop-filter: blur(8px);
}

.shoot-counter {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  pointer-events: none;
}
.timer {
  color: white;
  font-family: Arial, sans-serif;
  font-size: 180px;
  font-weight: 950;
  line-height: .85;
  text-shadow: 0 4px 34px rgba(0,0,0,.34);
  font-variant-numeric: tabular-nums;
  animation: count-pop 1s ease both;
}

.shoot-progress {
  position: absolute;
  left: 50%;
  bottom: 25px;
  display: flex;
  gap: 9px;
  transform: translateX(-50%);
}
.shoot-progress i { width: 44px; height: 5px; background: rgba(255,255,255,.35); }
.shoot-progress i.done { background: white; }

.scene-header {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 var(--stage-pad);
  border-bottom: 1px solid rgba(143,31,54,.14);
}
.scene-brand { color: var(--cherry); font-family: Georgia, serif; font-size: 22px; font-style: italic; font-weight: 700; }
.scene-index { color: var(--muted); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; }

.review-scene { background: #ece4dc; }
.review-layout {
  height: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(240px, 420px);
  gap: 50px;
  align-items: center;
  max-width: 1050px;
  margin: 0 auto;
  padding: 100px var(--stage-pad) 28px;
}
.review-copy { min-width: 0; }
.review-copy h2, .studio-controls h2, .center-stage h2, .done-layout h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  line-height: 1.02;
  letter-spacing: 0;
}
.review-copy > p:not(.eyebrow), .done-layout p { max-width: 520px; color: #75676a; font-size: 17px; line-height: 1.55; }

.strip-display {
  position: relative;
  min-width: 0;
  margin: auto;
  padding: 8px;
  background: white;
  box-shadow: 0 22px 58px rgba(45,25,28,.22);
}
.strip-display img { width: 100%; height: 100%; object-fit: contain; display: block; }
.raw-strip { width: min(300px, 100%); height: min(76vh, 650px); }

.scene-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.customize-scene { background: #f7f2ef; overflow-y: auto; }
.studio-layout {
  min-height: 100%;
  display: grid;
  grid-template-columns: minmax(280px, 43%) minmax(0, 1fr);
  gap: 34px;
  padding: 94px var(--stage-pad) 26px;
}
.studio-preview-wrap { position: sticky; top: 90px; align-self: start; min-width: 0; text-align: center; }
.styled-strip { width: min(290px, 100%); height: min(73vh, 620px); }
.zoom-open {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(143,31,54,.2);
  border-radius: 6px;
  background: white;
  color: var(--wine);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}
.zoom-open:disabled { cursor: wait; opacity: .45; }
.render-status { display: block; min-height: 20px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.studio-controls { min-width: 0; align-self: center; padding: 8px 0; }
.studio-controls h2 { font-size: 39px; }

.choice-group { min-width: 0; margin: 22px 0 0; padding: 0; border: 0; }
.choice-group legend { margin-bottom: 10px; color: var(--ink); font-size: 13px; font-weight: 900; }
.template-picker, .filter-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  gap: 9px;
  min-width: 0;
}
.choice-card {
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(143,31,54,.16);
  border-radius: 7px;
  background: rgba(255,255,255,.78);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.choice-card:hover { border-color: var(--pink); }
.choice-card.active { border-color: var(--cherry); box-shadow: 0 0 0 2px rgba(217,56,94,.16); }
.choice-card b { display: block; overflow: hidden; margin-top: 6px; font-size: 11px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.template-swatch, .filter-thumb { display: block; width: 100%; height: 45px; overflow: hidden; border-radius: 4px; background-color: white; }
.filter-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.swatch-minimal { border: 1px solid #dedede; }
.swatch-velvet { background-color: #8f1f36; background-image: repeating-linear-gradient(105deg, transparent 0 10px, rgba(255,255,255,.09) 10px 14px); }
.swatch-orchid { background-color: #f4c6d3; background-image: radial-gradient(circle at 30% 35%, #d9385e 0 5px, transparent 6px), radial-gradient(circle at 72% 64%, #fff 0 6px, transparent 7px); }
.swatch-hibiscus { background: #f7d6d7 url('/assets/stickers/hibiscus.png') center/54px no-repeat; }
.swatch-gold { background-color: #f6edda; background-image: repeating-linear-gradient(45deg, transparent 0 8px, rgba(173,126,38,.32) 8px 10px); }
.swatch-sketch { background-color: white; background-image: repeating-linear-gradient(0deg, transparent 0 9px, rgba(20,20,20,.18) 10px); }

.studio-actions { padding-top: 4px; }

.copies-scene { overflow-y: auto; background-color: #f3ccd5; }
.copies-scene::before { content: ""; position: absolute; inset: 20px; border: 2px solid rgba(143,31,54,.24); pointer-events: none; }
.center-stage {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 40px));
  min-height: 100%;
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 46px 0;
}
.center-stage h2 { max-width: 620px; }
.copies { display: grid; grid-template-columns: 58px minmax(100px, 160px) 58px; gap: 10px; align-items: center; margin: 26px 0 18px; }
.copies input { height: 58px; border-color: rgba(143,31,54,.24); text-align: center; font-size: 28px; font-weight: 900; }
.icon-button { width: 58px; height: 58px; border: 0; border-radius: 50%; background: var(--wine); color: white; cursor: pointer; font-size: 28px; }
.mini-strip { width: 58px; min-height: 130px; transform: rotate(5deg); box-shadow: 0 12px 30px rgba(80,20,30,.18); }
.mini-strip img { width: 100%; display: block; }
.upload-progress { width: min(420px, 100%); margin: 8px 0 2px; }
.upload-progress-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; color: var(--wine); font-size: 12px; font-weight: 800; }
.upload-progress-track { height: 10px; overflow: hidden; border: 1px solid rgba(143,31,54,.18); border-radius: 5px; background: rgba(255,255,255,.58); }
.upload-progress-track i { display: block; width: var(--upload-progress, 0%); height: 100%; background: var(--cherry); transition: width 120ms linear; }
.centered-actions { justify-content: center; }

.done-scene { background: #171314; color: white; }
.done-layout {
  position: relative;
  z-index: 2;
  width: min(900px, calc(100% - 64px));
  min-height: 100%;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 64px;
  align-items: center;
}
.done-layout h2 { color: white; font-size: 66px; }
.done-layout p { color: #c7babc; }
.done-sun { position: absolute; right: -45px; top: -55px; width: 270px; opacity: .78; animation: slow-spin 28s linear infinite; }
.final-code { margin: 18px 0; color: var(--yellow); font-size: 54px; font-weight: 950; letter-spacing: .16em; }
.qr { width: 230px; height: 230px; border: 10px solid white; border-radius: 6px; background: white; object-fit: contain; }
.bot-photo-button {
  width: 230px;
  min-height: 230px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  border: 2px solid var(--yellow);
  border-radius: 8px;
  background: var(--yellow);
  color: #171314;
  text-align: center;
  text-decoration: none;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.2;
  box-shadow: 0 16px 42px rgba(0,0,0,.28);
}
.bot-photo-button[hidden] { display: none; }

.error-message { min-height: 20px; margin: 10px 0 0; color: var(--wine); font-size: 14px; font-weight: 700; }

.strip-zoom-dialog {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #111;
  color: white;
  overflow: hidden;
}
.strip-zoom-dialog::backdrop { background: rgba(0,0,0,.88); }
.strip-zoom-dialog[open] { display: grid; grid-template-rows: 64px minmax(0, 1fr); }
.zoom-toolbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  background: #1c191a;
  border-bottom: 1px solid rgba(255,255,255,.12);
}
.zoom-toolbar button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  background: #2a2527;
  color: white;
  cursor: pointer;
  font-size: 25px;
}
.zoom-toolbar output { width: 66px; text-align: center; font-size: 13px; font-weight: 800; }
#closeStripZoom { position: absolute; right: 16px; }
.zoom-viewport { min-height: 0; overflow: auto; display: grid; place-items: start center; padding: 24px; }
.zoom-viewport img {
  display: block;
  width: auto;
  height: calc(100vh - 112px);
  max-width: none;
  transform: scale(var(--zoom, 1));
  transform-origin: top center;
  box-shadow: 0 18px 60px rgba(0,0,0,.55);
}

@keyframes scene-in { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: scale(1); } }
@keyframes count-pop { 0% { opacity: .3; transform: scale(.72); } 22% { opacity: 1; transform: scale(1.08); } 45%,100% { transform: scale(1); } }
@keyframes float-a { 0%,100% { transform: rotate(-11deg) translateY(0); } 50% { transform: rotate(-7deg) translateY(10px); } }
@keyframes float-b { 0%,100% { transform: rotate(12deg) translateY(0); } 50% { transform: rotate(8deg) translateY(-12px); } }
@keyframes slow-spin { to { transform: rotate(360deg); } }

@media (max-width: 900px) {
  :root { --stage-pad: 24px; }
  .start-copy h1 { font-size: 58px; }
  .start-lead { font-size: 28px; }
  .start-sticker { width: 110px; }
  .review-layout { gap: 26px; }
  .review-copy h2, .center-stage h2 { font-size: 39px; }
  .studio-layout { grid-template-columns: minmax(220px, 36%) minmax(0, 1fr); gap: 24px; }
  .done-layout { gap: 34px; }
}

@media (max-width: 680px) {
  :root { --stage-pad: 16px; }
  html, body { overflow: hidden; }
  .film-edge { width: 26px; }
  .start-scene::before { inset: 10px; }
  .start-copy { width: calc(100% - 70px); padding: 38px 0; }
  .start-copy h1 { font-size: 44px; }
  .start-lead { font-size: 23px; }
  .start-kicker { font-size: 10px; }
  .start-sticker { width: 80px; opacity: .82; }
  .sticker-bow { left: 7%; top: 3%; }
  .sticker-flower { right: 5%; bottom: 2%; }
  .strip-teaser { display: none; }
  .shoot-topbar { top: 14px; left: 14px; right: 14px; }
  .shoot-brand { font-size: 19px; }
  .camera-info { font-size: 10px; }
  .timer { font-size: 120px; }
  .scene-header { height: 58px; }
  .review-scene, .customize-scene, .copies-scene, .done-scene { overflow-y: auto; }
  .review-layout { min-height: 100%; grid-template-columns: 1fr; padding-top: 78px; text-align: center; }
  .review-copy { order: 2; }
  .review-copy h2 { font-size: 34px; }
  .review-copy > p:not(.eyebrow) { margin-left: auto; margin-right: auto; }
  .raw-strip { width: 150px; height: 340px; }
  .scene-actions { justify-content: center; margin-top: 20px; }
  .studio-layout { min-height: 100%; grid-template-columns: 1fr; padding-top: 74px; }
  .studio-preview-wrap { position: static; }
  .styled-strip { width: 130px; height: 292px; }
  .studio-controls { text-align: center; }
  .studio-controls h2 { font-size: 31px; }
  .choice-group { text-align: left; }
  .template-picker, .filter-picker { display: flex; overflow-x: auto; padding: 2px 2px 10px; scroll-snap-type: x mandatory; }
  .choice-card { flex: 0 0 84px; scroll-snap-align: start; }
  .studio-actions { padding-bottom: 20px; }
  .center-stage h2 { font-size: 34px; }
  .done-layout { width: calc(100% - 40px); grid-template-columns: 1fr; gap: 26px; padding: 65px 0 34px; text-align: center; }
  .done-layout h2 { font-size: 48px; }
  .done-layout p { margin-left: auto; margin-right: auto; }
  .done-layout .btn { margin: auto; }
  .qr { width: 190px; height: 190px; margin: auto; }
  .final-code { font-size: 38px; overflow-wrap: anywhere; }
  .done-sun { width: 180px; }
}

@media (max-height: 620px) and (min-width: 681px) {
  .start-copy h1 { font-size: 54px; }
  .start-lead { font-size: 25px; }
  .start-copy { padding: 28px 0; }
  .review-layout { padding-top: 82px; }
  .review-copy h2 { font-size: 38px; }
  .styled-strip { width: 220px; height: 470px; }
  .studio-controls h2 { font-size: 31px; }
  .choice-group { margin-top: 14px; }
  .template-swatch, .filter-thumb { height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  .scene.active, .start-sticker, .done-sun, .timer { animation: none; }
}
