:root {
  /* Rollbooth-inspired palette: warm cream base, ember/amber accents,
     soft pastel frame colors. Lighter, cuter, more "scrapbook" than the
     old charcoal marquee look. */
  --pb-bg: #fbf3e7;
  --pb-bg-2: #ffffff;
  --pb-panel: #fffdf9;
  --pb-ink: #2c221c;
  --pb-ink-dim: #8a7a6f;
  --pb-ember: #d4541c;
  --pb-ember-deep: #b03d16;
  --pb-amber: #f0a860;
  --pb-rose: #e88ba0;
  --pb-line: rgba(44, 34, 28, 0.1);
  --pb-shadow: 0 20px 50px -20px rgba(212, 84, 28, 0.28);
  --pb-radius-lg: 26px;
  --pb-radius-md: 18px;
  --pb-radius-sm: 12px;
  --pb-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --pb-serif: "Instrument Serif", "Georgia", serif;
  --pb-script: "Shantell Sans", "Comic Sans MS", cursive;
  --pb-sans: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; overscroll-behavior: none; }

body {
  font-family: var(--pb-sans);
  background: var(--pb-bg);
  color: var(--pb-ink);
  height: 100dvh;
  height: 100vh;
  position: relative;
  overflow: hidden;
  line-height: 1.4;
  display: flex;
  flex-direction: column;
}

/* ---------- soft background + floating sparkles ---------- */
.pb-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 10%, rgba(240, 168, 96, 0.28), transparent 42%),
    radial-gradient(circle at 88% 14%, rgba(232, 139, 160, 0.22), transparent 45%),
    radial-gradient(circle at 50% 100%, rgba(212, 84, 28, 0.1), transparent 55%),
    var(--pb-bg);
}
.pb-sparkle {
  position: absolute;
  font-size: 1.1rem;
  opacity: 0.5;
  animation: pbFloat 7s ease-in-out infinite;
  filter: saturate(1.1);
}
.pb-sparkle-1 { top: 8%; left: 6%; font-size: 1.3rem; animation-delay: 0s; }
.pb-sparkle-2 { top: 18%; right: 8%; font-size: 1rem; animation-delay: 1.2s; }
.pb-sparkle-3 { top: 68%; left: 4%; font-size: 0.9rem; animation-delay: 2.4s; }
.pb-sparkle-4 { bottom: 10%; right: 6%; font-size: 1.2rem; animation-delay: 0.6s; }
.pb-sparkle-5 { top: 42%; right: 3%; font-size: 0.85rem; animation-delay: 3s; }
.pb-sparkle-6 { bottom: 22%; left: 10%; font-size: 1rem; animation-delay: 1.8s; }
@keyframes pbFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.35; }
  50% { transform: translateY(-14px) rotate(8deg); opacity: 0.7; }
}

/* =====================================================================
   CURTAIN INTRO — "step inside the photobooth"
   ===================================================================== */
.pb-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pb-intro-stage {
  position: relative;
  z-index: 5;
  text-align: center;
  padding: 32px;
  max-width: 420px;
  animation: pbStageIdle 4s ease-in-out infinite;
}
@keyframes pbStageIdle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.pb-intro-marquee {
  background: var(--pb-panel);
  border-radius: 28px;
  padding: 38px 30px 32px;
  box-shadow: 0 30px 70px -20px rgba(44, 34, 28, 0.4);
  border: 3px solid var(--pb-bg-2);
  position: relative;
}
.pb-intro-bulbs {
  position: absolute;
  top: -14px;
  left: 14px;
  right: 14px;
  height: 14px;
  background-image: radial-gradient(circle, var(--pb-amber) 0 3px, transparent 3.5px);
  background-size: 22px 14px;
  background-repeat: repeat-x;
  animation: pbBulbGlow 1.6s ease-in-out infinite;
}
@keyframes pbBulbGlow {
  0%, 100% { opacity: 0.55; filter: drop-shadow(0 0 2px rgba(240, 168, 96, 0.4)); }
  50% { opacity: 1; filter: drop-shadow(0 0 6px rgba(240, 168, 96, 0.9)); }
}
.pb-intro-eyebrow {
  margin: 0 0 6px;
  color: var(--pb-ember);
  font-family: var(--pb-script);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.02em;
}
.pb-intro-title {
  margin: 0 0 8px;
  font-family: var(--pb-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 9vw, 3rem);
  line-height: 1.05;
  color: var(--pb-ink);
}
.pb-intro-title em {
  font-style: italic;
  color: var(--pb-ember);
}
.pb-intro-sub {
  margin: 0 0 22px;
  color: var(--pb-ink-dim);
  font-size: 0.92rem;
  font-family: var(--pb-script);
}
.pb-enter-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 14px 26px;
  font-family: var(--pb-sans);
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  background: linear-gradient(135deg, var(--pb-ember) 0%, var(--pb-ember-deep) 100%);
  box-shadow: 0 16px 34px -12px rgba(212, 84, 28, 0.6);
  transition: transform 0.18s var(--pb-ease), box-shadow 0.18s var(--pb-ease);
  animation: pbBtnPulse 2.2s ease-in-out infinite;
}
.pb-enter-btn svg { transition: transform 0.18s var(--pb-ease); }
.pb-enter-btn:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 20px 40px -12px rgba(212, 84, 28, 0.7); }
.pb-enter-btn:hover svg { transform: translateX(3px); }
.pb-enter-btn:active { transform: translateY(0) scale(0.98); }
@keyframes pbBtnPulse {
  0%, 100% { box-shadow: 0 16px 34px -12px rgba(212, 84, 28, 0.6); }
  50% { box-shadow: 0 16px 34px -12px rgba(212, 84, 28, 0.85), 0 0 0 6px rgba(212, 84, 28, 0.08); }
}

/* the curtains themselves — velvet stripes with a scalloped valance */
.pb-curtain {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 52%;
  z-index: 2;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(0, 0, 0, 0.1) 0px,
      rgba(0, 0, 0, 0.1) 2px,
      transparent 2px,
      transparent 26px
    ),
    linear-gradient(180deg, #e8672c 0%, var(--pb-ember) 12%, var(--pb-ember-deep) 100%);
  box-shadow: inset -14px 0 40px rgba(0, 0, 0, 0.25);
  transition: transform 0.95s cubic-bezier(0.65, 0, 0.35, 1);
  animation: pbCurtainSway 4.5s ease-in-out infinite;
}
.pb-curtain::before {
  /* scalloped valance along the top */
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 34px;
  background:
    radial-gradient(circle at 10px 0, transparent 12px, var(--pb-ember-deep) 12.5px) repeat-x;
  background-size: 20px 34px;
  opacity: 0.85;
}
.pb-curtain-left {
  left: 0;
  border-radius: 0 6px 6px 0;
  transform-origin: left center;
}
.pb-curtain-right {
  right: 0;
  border-radius: 6px 0 0 6px;
  transform-origin: right center;
  animation-delay: 0.3s;
}
@keyframes pbCurtainSway {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.04); }
}
.pb-curtain-rope {
  position: absolute;
  top: 20%;
  width: 5px;
  height: 55%;
  background: linear-gradient(180deg, var(--pb-amber), var(--pb-ember-deep));
  border-radius: 3px;
  opacity: 0.7;
}
.pb-curtain-left .pb-curtain-rope { right: 14%; }
.pb-curtain-right .pb-curtain-rope { left: 14%; }

.pb-intro-flash {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}

/* open state: curtains part, marquee zooms toward viewer and fades */
.pb-intro.pb-intro-opening .pb-curtain { animation: none; }
.pb-intro.pb-intro-opening .pb-curtain-left { transform: translateX(-105%) rotate(-2deg); }
.pb-intro.pb-intro-opening .pb-curtain-right { transform: translateX(105%) rotate(2deg); }
.pb-intro.pb-intro-opening .pb-intro-stage {
  animation: none;
  transition: transform 0.6s var(--pb-ease), opacity 0.6s var(--pb-ease);
  transform: scale(1.15);
  opacity: 0;
}
.pb-intro.pb-intro-opening .pb-intro-flash {
  animation: pbIntroFlash 0.7s ease-out 0.55s;
}
@keyframes pbIntroFlash {
  0% { opacity: 0; }
  35% { opacity: 0.95; }
  100% { opacity: 0; }
}
.pb-intro.pb-intro-done { display: none; }

/* main app is hidden + slightly zoomed until the curtains open, then it
   "steps forward" into place — like walking into the booth. */
.pb-main {
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 0.55s var(--pb-ease) 0.45s, transform 0.55s var(--pb-ease) 0.45s;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.pb-main.pb-main-visible { opacity: 1; transform: scale(1); }

/* ---------- home button ---------- */
.pb-home-btn {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px 8px 10px;
  border-radius: 999px;
  background: var(--pb-panel);
  color: var(--pb-ink-dim);
  border: 1px solid var(--pb-line);
  box-shadow: var(--pb-shadow);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.18s ease;
}
.pb-home-btn svg { width: 14px; height: 14px; }
.pb-home-btn:hover { color: var(--pb-ember); border-color: rgba(212, 84, 28, 0.35); transform: translateX(-2px); }
@media (max-width: 640px) {
  .pb-home-btn { padding: 6px 10px 6px 7px; font-size: 0.7rem; }
  .pb-home-btn span { display: none; }
}

/* ---------- header ---------- */
.pb-header {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 10px 20px 4px;
  flex: none;
}
.pb-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pb-brand-icon { font-size: 1.3rem; }
.pb-brand-text {
  font-family: var(--pb-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  letter-spacing: 0.01em;
  margin: 0;
  color: var(--pb-ink);
}
.pb-tagline {
  margin: 2px 0 0;
  color: var(--pb-ember);
  font-family: var(--pb-script);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ---------- app shell: fills remaining viewport, never scrolls ---------- */
.pb-app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 6px 16px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1 1 auto;
  min-height: 0;
}
/* On desktop the app was pinned to a fixed 70% width regardless of how wide
   the window actually was — fine at 1000px, cramped-in-the-middle at
   1600px+. clamp() keeps the same comfortable minimum but lets it use more
   of very wide screens instead of just adding empty margin on both sides. */
@media (min-width: 860px) {
  .pb-app { width: clamp(70%, 78vw, 1100px); }
}

/* ---------- step dots ---------- */
.pb-steps {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px;
  flex: none;
}
.pb-step-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(44, 34, 28, 0.14);
  transition: all 0.25s var(--pb-ease);
}
.pb-step-dot.done { background: var(--pb-ember); }
.pb-step-dot.active { background: var(--pb-ember); width: 20px; border-radius: 5px; }

/* ---------- panel / card ---------- */
.pb-panel {
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  background: var(--pb-panel);
  border-radius: var(--pb-radius-lg);
  border: 1px solid var(--pb-line);
  box-shadow: var(--pb-shadow);
  padding: 18px 22px;
  text-align: center;
  animation: pbIn 0.32s var(--pb-ease) both;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow: hidden;
}
@keyframes pbIn { from { opacity: 0; transform: translateY(10px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.pb-h2 {
  font-family: var(--pb-serif);
  font-style: italic;
  font-size: clamp(1.4rem, 4vw, 1.8rem);
  letter-spacing: 0.01em;
  margin: 0 0 4px;
  color: var(--pb-ink);
  flex: none;
}
.pb-sub {
  color: var(--pb-ink-dim);
  font-size: 0.82rem;
  line-height: 1.45;
  max-width: 380px;
  margin: 0 auto 14px;
  flex: none;
}

/* ---------- layout choice (strip / 2x2 / 2x3) ---------- */
.pb-layout-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}
.pb-layout-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vh, 20px);
  padding: clamp(16px, 4vh, 40px) 14px;
  border-radius: var(--pb-radius-md);
  border: 2px solid var(--pb-line);
  background: var(--pb-bg-2);
  color: var(--pb-ink);
  cursor: pointer;
  font-family: var(--pb-sans);
  transition: all 0.18s var(--pb-ease);
}
.pb-layout-btn.active { border-color: var(--pb-ember); background: rgba(212, 84, 28, 0.07); }
.pb-layout-icon { color: var(--pb-ember); display: flex; width: clamp(38px, 8vh, 84px); height: clamp(38px, 8vh, 84px); }
.pb-layout-icon svg { width: 100%; height: 100%; }
.pb-layout-label { font-size: clamp(1.05rem, 2.6vh, 1.6rem); font-weight: 700; }
.pb-layout-btn small { color: var(--pb-ink-dim); font-weight: 500; font-size: clamp(0.82rem, 1.7vh, 1.05rem); }
.pb-layout-btn:hover { border-color: var(--pb-ember); background: rgba(212, 84, 28, 0.05); transform: translateY(-2px); }
@media (max-width: 560px) {
  .pb-layout-grid { grid-template-columns: 1fr; gap: 10px; }
  .pb-layout-btn { flex-direction: row; justify-content: flex-start; padding: 14px 18px; gap: 16px; }
  .pb-layout-icon { width: 34px; height: 34px; }
  .pb-layout-label { font-size: 1.05rem; }
  .pb-layout-btn small { display: block; margin-top: 2px; }
}

/* ---------- mode choice ---------- */
.pb-mode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}
.pb-mode-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px;
  border-radius: var(--pb-radius-md);
  border: 1.5px solid var(--pb-line);
  background: var(--pb-bg-2);
  color: var(--pb-ink);
  cursor: pointer;
  font-family: var(--pb-sans);
  font-size: 0.92rem;
  font-weight: 600;
  transition: all 0.18s var(--pb-ease);
}
.pb-mode-btn .pb-mode-icon { font-size: 1.6rem; }
.pb-mode-btn:hover { border-color: var(--pb-ember); background: rgba(212, 84, 28, 0.05); transform: translateY(-2px); }
.pb-mode-btn small { color: var(--pb-ink-dim); font-weight: 400; font-size: 0.72rem; }

/* ---------- camera settings: countdown + filters ---------- */
.pb-cam-settings {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 8px;
  flex: none;
}
.pb-select-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--pb-ink-dim);
}
.pb-select {
  font-family: var(--pb-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--pb-ink);
  background: var(--pb-bg-2);
  border: 1.5px solid var(--pb-line);
  border-radius: 999px;
  padding: 6px 12px;
  cursor: pointer;
}
.pb-select:focus { outline: none; border-color: var(--pb-ember); }

.pb-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  width: 100%;
  margin-bottom: 10px;
  flex: none;
}
.pb-filter-chip {
  font-family: var(--pb-sans);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--pb-ink-dim);
  background: var(--pb-bg-2);
  border: 1.5px solid var(--pb-line);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.15s var(--pb-ease);
}
.pb-filter-chip:hover { border-color: rgba(212, 84, 28, 0.35); }
.pb-filter-chip.active { border-color: var(--pb-ember); background: rgba(212, 84, 28, 0.09); color: var(--pb-ember-deep); }

/* ---------- camera stage ---------- */
.pb-cam-wrap {
  position: relative;
  width: auto;
  height: 100%;
  flex: 1 1 auto;
  min-height: 0;
  aspect-ratio: 3 / 4;
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto 12px;
  border-radius: var(--pb-radius-md);
  overflow: hidden;
  background: #000;
  box-shadow: 0 0 0 3px var(--pb-line);
}
/* settings-screen preview: modest size, filters/countdown share the panel */
.pb-cam-wrap-preview { max-width: 320px; }
/* booth-screen stage: the whole point of this screen, so it gets almost
   all of the panel — no filter/countdown chrome competing for space. */
.pb-panel-booth { padding-top: 14px; }
.pb-cam-wrap-large {
  max-width: 640px;
  box-shadow: 0 0 0 4px var(--pb-line), 0 24px 60px -24px rgba(44, 34, 28, 0.35);
}
.pb-cam-wrap video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  display: block;
}
.pb-cam-wrap.pb-mirror-off video { transform: none; }
.pb-flash {
  position: absolute;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
}
.pb-flash.pb-flash-go { animation: pbFlash 0.32s ease-out; }
@keyframes pbFlash { 0% { opacity: 0.9; } 100% { opacity: 0; } }
.pb-countdown {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--pb-serif);
  font-size: 5rem;
  color: #fff;
  text-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
}
.pb-shot-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.pb-cam-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex: none;
}
.pb-shutter-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--pb-ember);
  border: 3px solid rgba(212, 84, 28, 0.25);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all 0.15s var(--pb-ease);
  box-shadow: 0 12px 28px -10px rgba(212, 84, 28, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.pb-shutter-btn:hover { transform: scale(1.05); }
.pb-shutter-btn:active { transform: scale(0.96); }
.pb-shutter-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.pb-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--pb-bg-2);
  border: 1px solid var(--pb-line);
  color: var(--pb-ink-dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex: none;
}
.pb-icon-btn svg { width: 17px; height: 17px; }
.pb-icon-btn:hover { border-color: var(--pb-ember); color: var(--pb-ember); }
.pb-cam-error {
  background: rgba(232, 139, 160, 0.12);
  border: 1px solid rgba(232, 139, 160, 0.35);
  border-radius: var(--pb-radius-sm);
  padding: 12px;
  color: var(--pb-ink);
  font-size: 0.82rem;
  margin-bottom: 10px;
  text-align: left;
  line-height: 1.4;
  flex: none;
}

/* ---------- upload dropzone ---------- */
.pb-dropzone {
  width: 100%;
  border: 2px dashed rgba(212, 84, 28, 0.3);
  border-radius: var(--pb-radius-md);
  padding: 16px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s var(--pb-ease);
  background: var(--pb-bg-2);
  flex: none;
}
.pb-dropzone:hover, .pb-dropzone.pb-drag-over { border-color: var(--pb-ember); background: rgba(212, 84, 28, 0.05); }
.pb-dropzone-icon { font-size: 1.6rem; display: block; margin-bottom: 4px; }
.pb-dropzone p { margin: 0; color: var(--pb-ink-dim); font-size: 0.82rem; }
.pb-dropzone strong { color: var(--pb-ink); }
.pb-upload-input { display: none; }

/* ---------- thumbnail strip (review) ---------- */
.pb-thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
  margin: 10px 0;
  flex: 1 1 auto;
  min-height: 0;
}
.pb-thumbs-1 { grid-template-columns: repeat(4, minmax(0, 90px)); justify-content: center; }
.pb-thumbs-2 { grid-template-columns: repeat(2, minmax(0, 140px)); justify-content: center; }
.pb-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--pb-radius-sm);
  overflow: hidden;
  background: var(--pb-bg-2);
  border: 1px solid var(--pb-line);
  max-height: 100%;
}
.pb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-thumb-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pb-ink-dim);
  font-size: 1.4rem;
  height: 100%;
}
.pb-thumb-retake {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(44, 34, 28, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pb-thumb-retake:hover { background: var(--pb-ember); color: #fff; }
.pb-thumb-num {
  position: absolute;
  top: 4px;
  left: 6px;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* ---------- arrange screen: tap two to swap ---------- */
/* big live strip/grid preview — the actual final product, front and
   center, so the user is arranging against what they'll actually get. */
.pb-panel-arrange { padding-bottom: 14px; }
.pb-strip-preview-wrap-arrange {
  flex: 1 1 auto;
  width: 100%;
  max-width: 460px;
  margin: 0 auto 12px;
}

/* compact thumbnail rail below the preview: tap two to swap, retake icon
   per thumb. Wraps instead of overlapping on small screens. */
.pb-arrange-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  width: 100%;
  margin: 0 0 14px;
  flex: none;
}
.pb-arrange-thumb {
  position: relative;
  width: 64px;
  aspect-ratio: 3 / 4;
  border-radius: var(--pb-radius-sm);
  overflow: hidden;
  background: var(--pb-bg-2);
  border: 2px solid var(--pb-line);
  cursor: pointer;
  transition: all 0.15s var(--pb-ease);
  flex: none;
}
.pb-arrange-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-arrange-thumb:hover { border-color: rgba(212, 84, 28, 0.4); transform: translateY(-2px); }
.pb-arrange-thumb.selected { border-color: var(--pb-ember); box-shadow: 0 0 0 3px rgba(212, 84, 28, 0.2); }
.pb-arrange-num {
  position: absolute;
  top: 3px;
  left: 4px;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
  background: rgba(44, 34, 28, 0.45);
  padding: 0 5px;
  border-radius: 999px;
  line-height: 1.5;
}
.pb-arrange-retake {
  position: absolute;
  bottom: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: rgba(44, 34, 28, 0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 0.78rem;
  cursor: pointer;
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.pb-arrange-retake:hover { background: var(--pb-ember); color: #fff; }
@media (max-width: 480px) {
  .pb-arrange-thumb { width: 52px; }
}

/* ---------- frame picker: category tabs (Colors / Stickers) ---------- */
.pb-frame-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex: none;
}
.pb-frame-tab {
  font-family: var(--pb-sans);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--pb-ink-dim);
  background: var(--pb-bg-2);
  border: 1.5px solid var(--pb-line);
  border-radius: 999px;
  padding: 6px 16px;
  cursor: pointer;
  transition: all 0.15s var(--pb-ease);
}
.pb-frame-tab:hover { border-color: rgba(212, 84, 28, 0.35); }
.pb-frame-tab.active { border-color: var(--pb-ember); background: rgba(212, 84, 28, 0.09); color: var(--pb-ember-deep); }

/* ---------- frame picker: preview left, color choices right ---------- */
.pb-frame-layout {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 20px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}
.pb-strip-preview-wrap {
  background: var(--pb-bg-2);
  border-radius: var(--pb-radius-md);
  padding: 14px;
  border: 1px solid var(--pb-line);
  flex: 1 1 62%;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pb-strip-preview-wrap canvas {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  border-radius: 4px;
  box-shadow: 0 16px 40px -16px rgba(44, 34, 28, 0.35);
}
.pb-frame-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 38%;
  min-width: 0;
  overflow-y: auto;
  justify-content: center;
}
.pb-frame-chip {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--pb-radius-sm);
  border: 1.5px solid var(--pb-line);
  background: var(--pb-bg-2);
  cursor: pointer;
  transition: all 0.15s var(--pb-ease);
  width: 100%;
  text-align: left;
}
.pb-frame-chip:hover { border-color: rgba(212, 84, 28, 0.35); transform: translateX(-2px); }
.pb-frame-chip.active { border-color: var(--pb-ember); background: rgba(212, 84, 28, 0.07); }
.pb-frame-swatch {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(44, 34, 28, 0.12);
  flex: none;
}
.pb-frame-chip span { font-size: 0.85rem; font-weight: 600; color: var(--pb-ink-dim); line-height: 1.2; }
.pb-frame-chip.active span { color: var(--pb-ink); }
@media (max-width: 700px) {
  .pb-frame-layout { flex-direction: column; }
  .pb-frame-chips { flex-direction: row; flex-wrap: wrap; overflow-y: visible; }
  .pb-frame-chip { width: auto; flex: 1 1 auto; justify-content: center; padding: 8px 10px; }
  .pb-frame-chip span { font-size: 0.72rem; }
  .pb-frame-swatch { width: 20px; height: 20px; }
}

/* ---------- buttons ---------- */
.pb-btn {
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-family: var(--pb-sans);
  font-weight: 700;
  transition: all 0.18s var(--pb-ease);
  padding: 11px 22px;
  font-size: 0.86rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: none;
}
.pb-btn-primary {
  background: linear-gradient(135deg, var(--pb-ember) 0%, var(--pb-ember-deep) 100%);
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(212, 84, 28, 0.5);
}
.pb-btn-primary:hover { transform: translateY(-2px); }
.pb-btn-primary:active { transform: translateY(0); }
.pb-btn-primary:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.pb-btn-ghost {
  background: var(--pb-bg-2);
  color: var(--pb-ink-dim);
  border: 1px solid var(--pb-line);
}
.pb-btn-ghost:hover { border-color: var(--pb-ember); color: var(--pb-ember); }
.pb-btn-row { display: flex; gap: 10px; width: 100%; margin-top: 4px; flex-wrap: wrap; justify-content: center; flex: none; }
.pb-btn-full { width: 100%; }

/* ---------- toast ---------- */
.pb-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--pb-panel);
  border: 1px solid rgba(212, 84, 28, 0.3);
  color: var(--pb-ink);
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--pb-shadow);
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 50;
  pointer-events: none;
}
.pb-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- footer ---------- */
.pb-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 4px 20px;
  color: var(--pb-ink-dim);
  font-size: 0.66rem;
  opacity: 0.7;
  flex: none;
}
.pb-footer .pb-fine { font-size: 0.62rem; margin-top: 1px; }
.pb-footer a { color: var(--pb-ember); text-decoration: none; }
.pb-footer a:hover { text-decoration: underline; }

@media (max-width: 480px) {
  .pb-panel { padding: 14px 16px; }
  .pb-intro-marquee { padding: 30px 22px 26px; }
}
@media (max-height: 700px) {
  .pb-header { padding: 6px 20px 2px; }
  .pb-brand-text { font-size: 1.3rem; }
  .pb-tagline { display: none; }
  .pb-footer { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .pb-curtain, .pb-intro-stage, .pb-sparkle, .pb-intro-bulbs, .pb-enter-btn { animation: none !important; }
}
