/* ============================================================
   COSMO PHOTOBOOTH — booth.css
   Celestial theme matching landing page (landing.css + style.css)
   ============================================================ */

/* ─── Override conflicting landing.css rules for booth ─── */
.booth-body {
  overflow: hidden;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(to bottom, #2b2f5c, #101227);
}

.booth-bg {
  background-image: url("../assets/photobooth/background.webp");
  background-position: center center;
}

.booth-body .cosmo-borders {
  z-index: 3;
}

.booth-body #starfield-canvas {
  z-index: 1;
}

/* ============================================================
   CONTROLS OVERLAY (Back & Music)
   ============================================================ */
.booth-controls-overlay {
  pointer-events: none;
  /* Let clicks pass through empty space */
}

.booth-back-btn {
  position: fixed;
  top: 36px;
  left: 36px;
  z-index: 100;
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(9, 12, 48, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 184, 122, 0.2);
  font-family: 'Chakra Petch', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(232, 223, 200, 0.65);
  text-decoration: none;
  transition: all 0.2s;
}

.booth-back-btn:hover {
  color: #E8DFC8;
  border-color: rgba(200, 184, 122, 0.4);
  background: rgba(200, 184, 122, 0.1);
}

.booth-back-btn svg {
  flex-shrink: 0;
}

.bgm-btn {
  position: fixed;
  bottom: 36px;
  left: 36px;
  z-index: 100;
  pointer-events: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 12, 48, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(200, 184, 122, 0.2);
  color: rgba(232, 223, 200, 0.65);
  cursor: pointer;
  transition: all 0.2s ease;
}

.bgm-btn:hover {
  color: #E8DFC8;
  border-color: rgba(200, 184, 122, 0.4);
  background: rgba(200, 184, 122, 0.1);
  transform: scale(1.05);
}

.bgm-btn .icon-play {
  display: none;
}

.bgm-btn[aria-pressed="false"] .icon-pause {
  display: none;
}

.bgm-btn[aria-pressed="false"] .icon-play {
  display: block;
}

/* ============================================================
   PHASE SCREEN SHARED
   ============================================================ */
.phase-screen {
  position: relative;
  z-index: 2;
  flex: 1;
  margin-top: 60px;
  /* spacing below top controls */
  padding-bottom: 40px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

.phase-screen.hidden {
  display: none !important;
}

.phase-inner {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.phase-header {
  margin-bottom: 20px;
}

.section-label {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.55rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #C8B87A;
  opacity: 0.8;
  margin-bottom: 8px;
}

.phase-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 600;
  line-height: 1.1;
  color: #E8DFC8;
  margin-bottom: 8px;
}

.phase-title em {
  font-style: italic;
  background: linear-gradient(135deg, #F0E4C0, #C8B87A);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.phase-subtitle {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 0.85rem;
  color: rgba(232, 223, 200, 0.55);
  line-height: 1.6;
}

.text-center {
  text-align: center;
}

.phase-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  padding: 0px 24px;
  margin-top: 32px;
}

/* ─── BUTTONS ─── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 32px;
  border-radius: 999px;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #0C0D2A;
  background: linear-gradient(135deg, #D4B45A 0%, #C8B06A 40%, #ECD490 70%, #C8B06A 100%);
  background-size: 200% 200%;
  border: 1px solid rgba(220, 185, 100, 0.55);
  box-shadow: 0 4px 20px rgba(200, 170, 90, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  animation: btnShimmer 5s ease infinite;
}

.btn-icon {
  display: none;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(200, 170, 90, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

@keyframes btnShimmer {

  0%,
  100% {
    background-position: 0% 50%;
  }

  50% {
    background-position: 100% 50%;
  }
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(232, 223, 200, 0.65);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(200, 184, 122, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary:hover {
  color: #E8DFC8;
  background: rgba(200, 184, 122, 0.1);
  border-color: rgba(200, 184, 122, 0.4);
}

.btn-secondary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-accent {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 36px;
  border-radius: 999px;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #0C0D2A;
  background: linear-gradient(135deg, #ECD490, #C8B87A);
  border: none;
  box-shadow: 0 4px 24px rgba(200, 184, 122, 0.5), 0 0 40px rgba(200, 184, 122, 0.2);
  cursor: pointer;
  transition: all 0.2s ease;
  animation: goldPulse 2s ease-in-out infinite;
}

.btn-accent:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 8px 40px rgba(200, 184, 122, 0.7), 0 0 60px rgba(200, 184, 122, 0.3);
}

@keyframes goldPulse {

  0%,
  100% {
    box-shadow: 0 4px 24px rgba(200, 184, 122, 0.5), 0 0 40px rgba(200, 184, 122, 0.2);
  }

  50% {
    box-shadow: 0 4px 32px rgba(200, 184, 122, 0.7), 0 0 60px rgba(200, 184, 122, 0.35);
  }
}

.btn-sm {
  padding: 8px 20px !important;
  font-size: 0.68rem !important;
}

.btn-hero {
  padding: 14px 40px !important;
  font-size: 0.82rem !important;
}

/* ============================================================
   PHASE 1 — LAYOUT SELECTION
   ============================================================ */
.layout-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.layout-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  background: rgba(13, 17, 56, 0.5);
  border: 1px solid rgba(200, 184, 122, 0.15);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s;
}

.layout-card:hover {
  border-color: rgba(200, 184, 122, 0.4);
  background: rgba(200, 184, 122, 0.05);
  transform: translateY(-2px);
}

.layout-card:has(input:checked) {
  border-color: #C8B87A;
  background: rgba(200, 184, 122, 0.1);
  box-shadow: 0 0 0 1px rgba(200, 184, 122, 0.3), 0 0 20px rgba(200, 184, 122, 0.15);
}

.layout-preview {
  display: flex;
  gap: 3px;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

.layout-preview.classic {
  flex-direction: column;
}

.layout-preview.wide {
  flex-direction: column;
}

.layout-preview.grid2x2 {
  flex-wrap: wrap;
  width: 70px;
}

.layout-preview.solo {
  flex-direction: column;
}

.layout-preview.cinematic {
  flex-wrap: wrap;
  width: 80px;
  gap: 3px;
}

.lp-frame {
  background: rgba(200, 184, 122, 0.2);
  border: 1px solid rgba(200, 184, 122, 0.35);
  border-radius: 2px;
  flex-shrink: 0;
}

.layout-card:has(input:checked) .lp-frame {
  background: rgba(200, 184, 122, 0.35);
}

.layout-preview.classic .lp-frame {
  width: 50px;
  height: 16px;
}

.layout-preview.wide .lp-frame {
  width: 60px;
  height: 18px;
}

.layout-preview.grid2x2 .lp-frame {
  width: 32px;
  height: 30px;
}

.layout-preview.solo .lp-frame.big {
  width: 55px;
  height: 70px;
}

.layout-preview.cinematic .lp-frame {
  width: 36px;
  height: 22px;
}

.layout-info {
  text-align: center;
}

.layout-name {
  display: block;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 600;
  font-size: 1rem;
  color: #E8DFC8;
  margin-bottom: 2px;
}

.layout-meta {
  display: block;
  font-size: 0.68rem;
  color: rgba(232, 223, 200, 0.5);
  font-family: 'Chakra Petch', monospace;
  letter-spacing: 0.08em;
}

.frame-template-section {
  margin-top: 32px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s;
  pointer-events: none;
}

.frame-template-section.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.subsection-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #E8DFC8;
  margin-bottom: 20px;
}

.template-carousel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 40px;
  position: relative;
  width: 100%;
}

.template-grid {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 16px;
  padding: 16px 24px;
  width: 80%;
  max-width: none;
  min-width: 0;
  /* Critical for flex items to allow overflow */
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.template-grid::-webkit-scrollbar {
  display: none;
}

.carousel-nav {
  background: rgba(13, 17, 56, 0.6);
  border: 1px solid rgba(200, 184, 122, 0.3);
  color: #C8B87A;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
  z-index: 10;
}

.carousel-nav:hover {
  background: rgba(200, 184, 122, 0.2);
}

.template-card {
  cursor: pointer;
}

.template-preview {
  border-radius: 8px;
  height: 70px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-bottom: 8px;
  border: 2px solid transparent;
  transition: all 0.25s;
  overflow: hidden;
}

.template-preview span {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  color: white;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.template-card:has(input:checked) .template-preview {
  border-color: #C8B87A;
  box-shadow: 0 0 0 2px rgba(200, 184, 122, 0.4), 0 0 20px rgba(200, 184, 122, 0.2);
  transform: scale(1.05);
}

.stellar {
  background: linear-gradient(135deg, #0a0e2e, #1a1a40);
  border: 1px solid rgba(200, 184, 122, 0.3);
}

.xavier-tmpl {
  background: linear-gradient(135deg, #1a0a35, #C4B5FD);
}

.zayne-tmpl {
  background: linear-gradient(135deg, #0a1525, #93C5FD);
}

.rafayel-tmpl {
  background: linear-gradient(135deg, #1a0a35, #C084FC);
}

.sylus-tmpl {
  background: linear-gradient(135deg, #1a0505, #F87171);
}

.caleb-tmpl {
  background: linear-gradient(135deg, #1a0d00, #FB923C);
}

.valko-tmpl {
  background: linear-gradient(135deg, #001a0d, #34D399);
}

.allstars-tmpl {
  background: linear-gradient(135deg, #7C3AED, #F43F5E);
}

.film-tmpl {
  background: linear-gradient(135deg, #0a0a0a, #333);
}

.polaroid-tmpl {
  background: linear-gradient(135deg, #f0ebe0, #ddd);
}

.polaroid-tmpl span {
  color: #333;
  text-shadow: none;
}

.template-card-dynamic {
  flex: 0 0 auto;
  /* adapts to image width so 6x4 and 6x2 have the same height */
  scroll-snap-align: center;
  cursor: pointer;
}

.template-preview-wrap {
  position: relative;
  height: clamp(220px, calc(100dvh - 440px), 460px);
  overflow: visible;
  transition: all 0.25s;
  display: flex;
  justify-content: center;
  /* Removed border and background */
}

.template-card-dynamic:hover .template-preview-wrap img {
  transform: scale(1.03);
}

.template-card-dynamic:has(input:checked) .template-preview-wrap img {
  box-shadow: 0 0 0 3px #C8B87A, 0 0 20px rgba(200, 184, 122, 0.4);
  border-radius: 4px;
  transform: scale(1.03);
}

.template-preview-wrap img {
  width: auto;
  height: 100%;
  object-fit: contain;
  transition: all 0.25s;
  background-color: #d1d5db;
  /* silver/grey background */
}

.template-info {
  margin-top: 10px;
  text-align: center;
}

.t-name {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1rem;
  font-weight: 600;
  color: #E8DFC8;
  margin-bottom: 4px;
}

.t-meta {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.65rem;
  color: rgba(232, 223, 200, 0.5);
  letter-spacing: 0.05em;
  line-height: 1.4;
  text-transform: uppercase;
}

.layout-preview-dynamic {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
}

/* ============================================================
   PHASE 2 — STORYBOARD
   ============================================================ */
.phase-2-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  max-width: 900px;
  padding-top: 32px;
  align-items: start;
}

.storyboard-preview-panel {
  position: sticky;
  top: 32px;
}

.panel-label {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(200, 184, 122, 0.7);
  margin-bottom: 12px;
}

.storyboard-strip {
  position: relative;
  display: inline-block;
  margin: 0 auto;
}

.sb-frame {
  position: absolute;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.2);
  border: 2px dashed rgba(200, 184, 122, 0.8);
  box-sizing: border-box;
  /* Fix for offset */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.sb-frame:hover {
  background: rgba(255, 255, 255, 0.4);
}

.sb-frame.selected {
  border: 2px solid #D4B45A;
  background: rgba(212, 180, 90, 0.3);
}

.sb-frame-num {
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 0 4px rgba(0, 0, 0, 0.8), 0 0 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.sb-frame-badge {
  font-size: 0.65rem;
  color: #fff;
  text-align: center;
  line-height: 1.2;
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 4px;
  border-radius: 4px;
  pointer-events: none;
}

.sb-frame-chars {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: center;
  pointer-events: none;
}

.sb-char-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.sb-char-dot.xavier {
  background: #C4B5FD;
}

.sb-char-dot.zayne {
  background: #93C5FD;
}

.sb-char-dot.rafayel {
  background: #C084FC;
}

.sb-char-dot.sylus {
  background: #F87171;
}

.sb-char-dot.caleb {
  background: #FB923C;
}

.sb-char-dot.valko {
  background: #34D399;
}

.storyboard-hint {
  font-size: 0.72rem;
  color: rgba(232, 223, 200, 0.35);
  text-align: center;
  margin-top: 12px;
  font-style: italic;
}

.storyboard-config-panel {
  background: rgba(9, 12, 48, 0.6);
  border: 1px solid rgba(200, 184, 122, 0.15);
  border-radius: 14px;
  padding: 24px;
  height: 400px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  overflow-x: hidden;
  backdrop-filter: blur(12px);
}

.config-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: rgba(232, 223, 200, 0.3);
  text-align: center;
  padding: 32px;
}

.config-empty-state svg {
  opacity: 0.4;
}

.config-empty-state p {
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 220px;
  color: rgba(232, 223, 200, 0.45);
}

.config-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: #E8DFC8;
  margin-bottom: 20px;
}

.config-section {
  margin-bottom: 20px;
}

.config-section-label {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(200, 184, 122, 0.65);
  margin-bottom: 12px;
}

.char-select-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.char-select-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  cursor: pointer;
  transition: all 0.2s;
}

.char-select-card input[type="checkbox"] {
  display: none;
}

.char-select-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.char-select-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(232, 223, 200, 0.7);
  transition: color 0.2s;
}

.char-select-card:has(input:checked) .char-select-name {
  color: #111;
  font-weight: 600;
}

#char-none-card:has(input:checked) {
  background: #E8DFC8;
  border-color: #E8DFC8;
}

.xavier-card:has(input:checked) {
  background: #C4B5FD;
  border-color: #C4B5FD;
}

.zayne-card:has(input:checked) {
  background: #93C5FD;
  border-color: #93C5FD;
}

.rafayel-card:has(input:checked) {
  background: #C084FC;
  border-color: #C084FC;
}

.sylus-card:has(input:checked) {
  background: #F87171;
  border-color: #F87171;
}

.caleb-card:has(input:checked) {
  background: #FB923C;
  border-color: #FB923C;
}

.valko-card:has(input:checked) {
  background: #34D399;
  border-color: #34D399;
}

.pose-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.pose-thumb {
  width: 60px;
  height: 80px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.pose-label {
  font-size: 0.7rem;
  color: rgba(232, 223, 200, 0.6);
  font-weight: 500;
  transition: color 0.2s;
}

.phase-2-actions {
  padding: 16px 24px;
  justify-content: space-between;
}

/* ============================================================
   PHASE 3 — PHOTOSHOOT
   ============================================================ */
#phase-3 {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 52px - 16px);
  overflow: hidden;
}

.shoot-left-panel {
  background: rgba(9, 12, 48, 0.7);
  border-right: 1px solid rgba(200, 184, 122, 0.15);
  padding: 24px 16px;
  overflow: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(12px);
  box-sizing: border-box;
}

.captured-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.15rem;
  font-style: italic;
  color: #C8B87A;
  margin-bottom: 4px;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

.captured-count {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.9rem;
  font-weight: 700;
  color: #C8B87A;
  text-align: center;
  width: 100%;
  display: block;
}

.captured-moments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.captured-slot {
  width: 100%;
  max-width: 120px;
  aspect-ratio: 4/3;
  border-radius: 8px;
  border: 2px dashed rgba(200, 184, 122, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.8rem;
  font-style: italic;
  color: rgba(200, 184, 122, 0.5);
  transition: all 0.3s;
  background-size: cover;
  background-position: center;
  background-clip: padding-box;
}

.captured-slot.active {
  border: 2px solid #C8B87A;
  color: transparent;
  background-color: rgba(200, 184, 122, 0.1);
}

.captured-slot.done {
  border: 2px solid transparent;
  color: transparent;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.shoot-main {
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  padding: 0 16px;
  height: 100%;
  overflow: hidden;
}

.shoot-left-panel {
  width: 220px;
  height: 100%;
  max-height: 600px;
  flex-shrink: 0;
  background: rgba(9, 12, 48, 0.5);
  border: 1px solid rgba(200, 184, 122, 0.15);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(12px);
}

.shoot-side-panel {
  width: 280px;
  height: 100%;
  max-height: 600px;
  flex-shrink: 0;
  background: rgba(9, 12, 48, 0.5);
  border: 1px solid rgba(200, 184, 122, 0.15);
  border-radius: 12px;
  padding: 16px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  backdrop-filter: blur(12px);
}

.camera-area {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  min-width: 0;
  min-height: 0;
  max-width: 840px;
  /* slightly larger than viewport max-width to allow padding if needed */
}

.camera-viewport {
  position: relative;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid rgba(200, 184, 122, 0.35);
  box-shadow: 0 0 0 1px rgba(200, 184, 122, 0.1), 0 0 40px rgba(200, 184, 122, 0.12);
  width: 100%;
  max-width: 640px;
  aspect-ratio: 4/3;
  min-width: 0;
  min-height: 0;
}

#camera-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-upload-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(9, 12, 48, 0.9);
  color: rgba(232, 223, 200, 0.6);
  padding: 24px;
  text-align: center;
  z-index: 10;
}

.char-overlay-container {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.char-overlay {
  position: absolute;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: grab;
  pointer-events: auto;
  user-select: none;
  touch-action: none;
  transition: filter 0.2s;
}

.char-overlay:active {
  cursor: grabbing;
}

.char-overlay:hover {
  filter: drop-shadow(0 0 12px rgba(200, 184, 122, 0.5));
}

.char-overlay-body {
  border-radius: 6px 6px 0 0;
  width: var(--char-w, 100px);
  height: var(--char-h, 200px);
}

.char-overlay-label {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.52rem;
  letter-spacing: 0.1em;
  color: #E8DFC8;
  background: rgba(0, 0, 0, 0.6);
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 2px;
}

.camera-flash {
  position: absolute;
  inset: 0;
  z-index: 999999;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.05s;
}

.camera-flash.flash {
  opacity: 1;
  transition: opacity 0.4s ease;
}

.frame-guide {
  position: absolute;
  inset: 10px;
  pointer-events: none;
}

.fg-corner {
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: rgba(200, 184, 122, 0.5);
  border-style: solid;
}

.fg-corner.tl {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}

.fg-corner.tr {
  top: 0;
  right: 0;
  border-width: 2px 2px 0 0;
}

.fg-corner.bl {
  bottom: 0;
  left: 0;
  border-width: 0 0 2px 2px;
}

.fg-corner.br {
  bottom: 0;
  right: 0;
  border-width: 0 2px 2px 0;
}

.camera-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.shoot-btn {
  padding: 14px 36px !important;
  font-size: 0.9rem !important;
  font-weight: 700 !important;
}

.shoot-btn-circle {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: transparent;
  border: 4px solid #E8DFC8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.shoot-btn-circle:active .shoot-inner-circle {
  transform: scale(0.9);
}

.shoot-btn-circle:hover {
  border-color: #fff;
}

.shoot-inner-circle {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: #D33654;
  transition: transform 0.1s ease;
}

/* Character Accordion */
.shoot-char-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shoot-char-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shoot-char-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(200, 184, 122, 0.08);
  border: 1px solid rgba(200, 184, 122, 0.2);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Cormorant Garamond', Georgia, serif;
}

.mobile-char-pills {
  display: none;
}

.mobile-char-poses {
  display: none;
}

.char-filter-pill {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(196, 169, 106, 0.3);
  color: #C4A96A;
  border-radius: 20px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.char-filter-pill:hover {
  background: rgba(196, 169, 106, 0.1);
}

.char-filter-pill.open {
  border-color: #C4A96A;
  background: rgba(196, 169, 106, 0.2);
}

.char-filter-pill.active {
  background: #C4A96A;
  color: #0a0818;
}

.desktop-char-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.shoot-char-toggle:hover {
  border-color: rgba(200, 184, 122, 0.4);
  background: rgba(200, 184, 122, 0.15);
}

.shoot-char-toggle.active,
.shoot-char-toggle.open {
  border-color: #C8B87A;
  background: rgba(200, 184, 122, 0.25);
}

.shoot-char-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #E8DFC8;
  text-align: center;
  width: 100%;
}

.shoot-char-poses {
  display: none;
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  border: 1px inset rgba(200, 184, 122, 0.1);
}

.shoot-char-poses.open {
  display: block;
}

.poses-horizontal-scroll {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 12px;
  padding-bottom: 8px;
}

.poses-horizontal-scroll::-webkit-scrollbar {
  height: 4px;
}

.poses-horizontal-scroll::-webkit-scrollbar-thumb {
  background: rgba(200, 184, 122, 0.5);
  border-radius: 4px;
}

.pose-card-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  flex-shrink: 0;
}

.pose-thumb-small {
  width: 50px;
  height: 60px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.pose-card-btn.selected .pose-thumb-small {
  border-color: #C8B87A;
  background: rgba(200, 184, 122, 0.2);
}

.pose-card-btn:hover .pose-thumb-small {
  border-color: rgba(200, 184, 122, 0.5);
}

.pose-label-small {
  font-size: 0.65rem;
  color: rgba(232, 223, 200, 0.6);
  font-weight: 500;
  transition: color 0.2s;
}

.pose-card-btn.selected .pose-label-small {
  color: #E8DFC8;
  font-weight: 700;
}

.shoot-side-hint {
  font-size: 0.7rem;
  color: rgba(232, 223, 200, 0.35);
  line-height: 1.5;
  font-style: italic;
  margin-top: auto;
}

.developing-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 24px;
  background: rgba(9, 12, 48, 0.96);
  backdrop-filter: blur(24px);
}

.developing-overlay.hidden {
  display: none !important;
}

.developing-inner {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.developing-strip {
  width: 200px;
  height: 6px;
  background: rgba(200, 184, 122, 0.15);
  border-radius: 999px;
  overflow: hidden;
}

.dev-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #C8B87A, #ECD490);
  border-radius: 999px;
  transition: width 3s ease;
  box-shadow: 0 0 12px rgba(200, 184, 122, 0.6);
}

.developing-text {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-style: italic;
  color: rgba(232, 223, 200, 0.7);
  animation: twinkle 1.5s ease-in-out infinite;
}

@keyframes twinkle {

  0%,
  100% {
    opacity: 0.7;
  }

  50% {
    opacity: 1;
  }
}

/* ============================================================
   PHASE 4 — DECORATION STUDIO
   ============================================================ */
#phase-4 {
  display: flex;
  flex-direction: column;
  height: calc(100dvh - 52px - 16px);
  overflow: hidden;
}

.studio-layout {
  flex: 1;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
  gap: 16px;
  padding: 0 16px;
  height: 100%;
  overflow: hidden;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.studio-canvas-panel {
  overflow: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.studio-canvas-panel::before,
.studio-canvas-panel::after {
  content: '';
  flex: 1;
  min-height: 0;
}

.studio-strip-wrap {
  position: relative;
  flex-shrink: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 1px rgba(200, 184, 122, 0.2), 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 60px rgba(200, 184, 122, 0.08);
  border-radius: 10px;
}

#studio-canvas {
  display: block;
  border-radius: 10px;
}

.overlay-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.studio-history-bar {
  display: flex;
  gap: 12px;
}

.icon-btn {
  display: flex;
  align-items: center;
  gap: 4px;
}

.studio-tool-panel {
  width: 320px;
  flex-shrink: 0;
  background: rgba(9, 12, 48, 0.75);
  border: 1px solid rgba(200, 184, 122, 0.15);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.studio-tabs {
  display: flex;
  border-bottom: 1px solid rgba(200, 184, 122, 0.15);
  flex-shrink: 0;
  margin: 0 2%;
}

.studio-tab {
  flex: 1;
  padding: 12px 8px;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(232, 223, 200, 0.3);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
  background: transparent;
  border-top: none;
  border-left: none;
  border-right: none;
}

.studio-tab:hover {
  color: rgba(232, 223, 200, 0.65);
}

.studio-tab.active {
  color: #C8B87A;
  border-bottom-color: #C8B87A;
}

.tab-panel {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.filter-option {
  cursor: pointer;
  position: relative;
}

.filter-option input[type="radio"],
.sr-only {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  pointer-events: none;
}

.filter-preview {
  border-radius: 8px;
  height: 70px;
  display: flex;
  align-items: flex-end;
  padding: 8px;
  border: 2px solid transparent;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.filter-preview span {
  font-size: 0.62rem;
  font-weight: 700;
  font-family: 'Chakra Petch', monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 4px;
  color: white;
  position: relative;
  z-index: 1;
}

.filter-option:has(input:checked) .filter-preview,
.filter-option input[type="radio"]:checked + .filter-preview {
  border-color: #C8B87A;
  box-shadow: 0 0 12px rgba(200, 184, 122, 0.4);
}

.none-filter {
  background: linear-gradient(135deg, #0a0e2e, #1a1a40);
}

.bloom-filter {
  background: linear-gradient(135deg, #ffd6e7, #ffb3c6);
}

.vintage-filter {
  background: linear-gradient(135deg, #8B6914, #C49A2E);
}

.cool-filter {
  background: linear-gradient(135deg, #1e3a5f, #4a90d9);
}

.rose-filter {
  background: linear-gradient(135deg, #7a1f3d, #d63384);
}

.bw-filter {
  background: linear-gradient(135deg, #444, #888);
}

.noir-filter {
  background: linear-gradient(135deg, #111, #333);
}

.tool-hint {
  font-size: 0.78rem;
  color: rgba(232, 223, 200, 0.4);
  font-style: italic;
  margin-bottom: 16px;
  line-height: 1.5;
}

.tool-placeholder {
  font-size: 0.85rem;
  color: rgba(232, 223, 200, 0.3);
}

.mobile-sticker-layout {
  display: none;
}

.desktop-sticker-layout {
  display: block;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.sticker-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200, 184, 122, 0.05);
  border: 1px solid rgba(200, 184, 122, 0.12);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.5rem;
}

.sticker-btn:hover {
  background: rgba(200, 184, 122, 0.12);
  border-color: rgba(200, 184, 122, 0.4);
  transform: scale(1.1);
}

.text-tool {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tool-label {
  font-family: 'Chakra Petch', monospace;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(200, 184, 122, 0.7);
}

.text-tool-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(200, 184, 122, 0.05);
  border: 1px solid rgba(200, 184, 122, 0.2);
  border-radius: 8px;
  color: #E8DFC8;
  font-size: 0.9rem;
  font-family: 'Inter', sans-serif;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.text-tool-input:focus {
  outline: none;
  border-color: #C8B87A;
  box-shadow: 0 0 0 2px rgba(200, 184, 122, 0.15);
}

.text-tool-select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(200, 184, 122, 0.05);
  border: 1px solid rgba(200, 184, 122, 0.2);
  border-radius: 8px;
  color: #E8DFC8;
  font-size: 0.85rem;
  cursor: pointer;
}

.text-tool-range {
  width: 100%;
  accent-color: #C8B87A;
}

.text-color-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.text-inputs-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.text-inputs-row>div {
  flex: 1;
}

.text-color-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}

.text-color-btn.active,
.text-color-btn:hover {
  border-color: #C8B87A;
  transform: scale(1.15);
}

/* ============================================================
   PHASE 5 — EXPORT
   ============================================================ */
#phase-5 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100dvh - 52px - 16px);
}

.export-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 5% 5%;
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}

.export-content-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  width: 100%;
  padding-bottom: 2rem;
}

@media (min-width: 768px) {
  #phase-4.phase-screen {
    overflow-y: hidden;
  }
  
  .export-layout {
    overflow-y: hidden;
    padding-bottom: 0;
    justify-content: center;
  }
  
  .export-content-row {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding-bottom: 0;
    width: 100%;
    max-width: 900px;
  }
  
  .export-content-row > * {
    flex: 1 1 50%;
    width: 50%;
  }
  
  .export-printer-wrap {
    display: flex;
    justify-content: center;
  }
  
  .export-buttons-wrap {
    align-items: flex-start;
    justify-content: center;
    max-width: none;
    padding-left: 20px;
  }
}

.export-buttons-wrap {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  max-width: 320px;
}

.export-actions-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
}

/* === Printer in export screen === */
.export-printer-wrap {
  margin: 12px 0 20px;
  width: 100%;
  display: flex;
  justify-content: center;
}

/* Reuse printer styles from index but wider for 6x4 */
.export-printer-wrap .printer-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.export-printer-wrap .printer-body {
  width: 280px;
  background: linear-gradient(180deg, #1a1830 0%, #12102a 100%);
  border: 1px solid rgba(196, 169, 106, 0.35);
  border-radius: 14px 14px 4px 4px;
  padding: 10px 16px 14px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.5), 0 0 0 1px rgba(196,169,106,0.08);
}

.export-printer-wrap .printer-arch {
  margin-bottom: 4px;
}

.export-printer-wrap .arch-deco {
  width: 100%;
  height: 22px;
}

.export-printer-wrap .printer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.export-printer-wrap .printer-brand {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: #C4A96A;
  opacity: 0.85;
}

.export-printer-wrap .printer-status-led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 6px #4ade80;
  animation: ledPulse 2s ease-in-out infinite;
}

.export-printer-wrap .printer-orbital {
  margin-bottom: 8px;
}

.export-printer-wrap .printer-orbital svg {
  width: 100%;
  height: 22px;
}

.export-printer-wrap .printer-slot-row {
  display: flex;
  align-items: center;
  gap: 4px;
}

.export-printer-wrap .printer-slot-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(196,169,106,0.4), transparent);
}

.export-printer-wrap .printer-slot-opening {
  width: 140px;
  height: 5px;
  background: #0a0818;
  border-radius: 2px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.8);
}

/* 6x4 Desktop Width Adjustments */
.export-printer-wrap.printer-6x4 .printer-body {
  width: 420px;
}
.export-printer-wrap.printer-6x4 .strip-output {
  width: 420px;
}
.export-printer-wrap.printer-6x4 .strip-clip-window {
  width: 280px;
}
.export-printer-wrap.printer-6x4 .printer-slot-opening {
  width: 280px;
}

.export-printer-wrap .strip-output {
  width: 280px;
  display: flex;
  justify-content: center;
}

/* === Printer strip tray — dynamic height via JS-set var === */
.export-printer-wrap .strip-clip-window {
  width: 140px;
  height: var(--strip-tray-h, 200px);
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

@keyframes stripEmergeOnce {
  from { transform: translateY(-100%); }
  to   { transform: translateY(0); }
}

.export-printer-wrap .strip-animate {
  animation: stripEmergeOnce 2s cubic-bezier(0.22,1,0.36,1) forwards;
  animation-fill-mode: forwards;
}

.export-printer-wrap #export-canvas {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6), 0 0 0 1px rgba(196,169,106,0.2);
}

.export-printer-wrap .printer-caption {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.6rem;
  color: rgba(196,169,106,0.6);
  letter-spacing: 0.1em;
  margin-top: 8px;
}

/* === Pill buttons === */
.btn-pill {
  border-radius: 999px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-ghost {
  background: transparent;
  border: 1px solid rgba(200, 184, 122, 0.3);
  color: rgba(232, 223, 200, 0.65);
  font-family: 'Chakra Petch', monospace;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  padding: 10px 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 6px;
  text-transform: uppercase;
}

.btn-ghost:hover {
  border-color: rgba(200, 184, 122, 0.6);
  color: #C8B87A;
  background: rgba(200, 184, 122, 0.06);
}

.export-btn-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
  width: 100%;
  max-width: 360px;
}

.export-btn-row {
  display: flex;
  gap: 10px;
}

.export-btn-row .btn-pill {
  flex: 1;
}

/* === Hashtag copy block === */
.share-prompt {
  color: rgba(232, 223, 200, 0.5);
  font-size: 0.82rem;
  line-height: 1.6;
  text-align: center;
  width: 100%;
}

.hashtag-copy-block {
  display: inline-flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 8px;
  padding: 12px 16px;
  background: rgba(200, 184, 122, 0.07);
  border: 1px solid rgba(200, 184, 122, 0.2);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.75rem;
  color: #C8B87A;
  letter-spacing: 0.03em;
  line-height: 1.7;
  text-align: left;
  width: 100%;
  max-width: 400px;
  word-break: break-word;
}

.hashtag-copy-block:hover {
  background: rgba(200, 184, 122, 0.13);
  border-color: rgba(200, 184, 122, 0.4);
  color: #e2d49a;
}

.hashtag-copy-block:active {
  transform: scale(0.99);
}

.hashtag-copy-icon {
  flex-shrink: 0;
  opacity: 0.6;
  padding-top: 2px;
}

/* === Share Modal === */
.share-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 6, 20, 0.75);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.share-modal-backdrop.hidden {
  display: none;
}

.share-modal {
  background: linear-gradient(160deg, #13112c 0%, #0d0b24 100%);
  border: 1px solid rgba(200, 184, 122, 0.25);
  border-radius: 20px;
  padding: 32px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7), 0 0 0 1px rgba(200,184,122,0.08);
  position: relative;
  animation: overlayFadeIn 0.25s ease;
}

@keyframes overlayFadeIn {
  from { opacity: 0; transform: translateY(12px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.share-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: rgba(232,223,200,0.6);
  transition: all 0.2s ease;
}

.share-modal-close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.share-modal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 1.5rem;
  font-style: italic;
  color: #E8DFC8;
  margin: 4px 0 20px;
}

.share-modal-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.share-platform-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 8px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  cursor: pointer;
  color: rgba(232,223,200,0.75);
  font-family: 'Chakra Petch', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.share-platform-btn:hover {
  background: rgba(200,184,122,0.1);
  border-color: rgba(200,184,122,0.3);
  color: #C8B87A;
  transform: translateY(-2px);
}

.share-icon {
  width: 28px;
  height: 28px;
}

.share-modal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(232,223,200,0.25);
  font-size: 0.75rem;
  font-family: 'Chakra Petch', monospace;
  margin-bottom: 16px;
}

.share-modal-divider::before,
.share-modal-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.08);
}

.share-copy-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.share-copy-field {
  flex: 1;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.7rem;
  color: rgba(232,223,200,0.5);
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.share-copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: rgba(200,184,122,0.12);
  border: 1px solid rgba(200,184,122,0.3);
  border-radius: 8px;
  cursor: pointer;
  color: #C8B87A;
  font-family: 'Chakra Petch', monospace;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.share-copy-btn:hover {
  background: rgba(200,184,122,0.22);
  border-color: rgba(200,184,122,0.55);
}

.share-modal-note {
  font-size: 0.72rem;
  color: rgba(232,223,200,0.3);
  font-family: 'Chakra Petch', monospace;
  line-height: 1.5;
  text-align: center;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) and (orientation: portrait),
(max-width: 767px) {


  .phase-2-inner {
    grid-template-columns: 1fr;
  }

  .storyboard-preview-panel {
    position: static;
    text-align: center;
  }

  #phase-3,
  #phase-4 {
    height: calc(100dvh - 52px - 8px);
  }

  .shoot-main {
    flex-direction: column;
    justify-content: flex-start;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px 0;
    gap: 16px;
    margin: 0 16px;
    width: auto;
  }

  .shoot-left-panel {
    width: 100%;
    height: auto;
    background: rgba(9, 12, 48, 0.75);
    border: 1px solid rgba(200, 184, 122, 0.15);
    border-radius: 12px;
    padding: 16px;
    flex-direction: row;
    gap: 12px;
    align-items: stretch;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
    order: 1;
  }

  .captured-moments-header {
    text-align: center;
    min-width: 105px;
    width: 105px;
    height: 75px;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    flex-shrink: 0;
    padding: 4px;
  }

  .captured-moments-header .captured-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.15;
    white-space: normal;
  }

  .captured-moments-header .captured-count {
    font-size: 0.95rem;
    margin-top: 4px;
  }

  .captured-moments-list {
    flex-direction: row;
    align-items: center;
    width: 100%;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
  }

  .captured-moments-list::-webkit-scrollbar {
    display: none;
  }

  .captured-slot {
    width: 100px;
    height: 75px;
    max-width: none;
    font-size: 1.2rem;
    border-radius: 4px;
    flex-shrink: 0;
  }

  .shoot-side-panel {
    width: 100%;
    height: auto;
    background: rgba(9, 12, 48, 0.75);
    border: 1px solid rgba(200, 184, 122, 0.15);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    max-height: none;
    flex-shrink: 0;
    order: 3;
  }

  .mobile-char-pills {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 12px;
    scrollbar-width: none;
  }
  .mobile-char-pills::-webkit-scrollbar {
    display: none;
  }

  .mobile-char-poses {
    display: block;
    margin-bottom: 16px;
  }

  .desktop-char-accordion {
    display: none;
  }

  .shoot-char-toggle {
    border-radius: 99px;
    padding: 6px 16px;
    background: rgba(0, 0, 0, 0.5);
  }

  .shoot-char-name {
    font-size: 0.8rem;
  }

  .shoot-char-poses {
    margin-top: 8px;
    background: rgba(0, 0, 0, 0.3);
    border: none;
    padding: 8px;
  }

  .panel-label {
    display: none;
  }

  /* Hide 'Companions' label to save space */

  .camera-area {
    width: 100%;
    padding: 0;
    max-width: none;
    flex: 0 0 auto;
    order: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }

  .camera-viewport {
    aspect-ratio: 4/3;
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 0 auto;
  }

  .studio-layout { flex-direction: column; overflow: hidden; padding: 12px 0; gap: 16px; height: 100%; margin: 0 16px; width: auto; }
  .studio-canvas-panel { flex: 1; overflow: auto; min-height: 0; padding: 0; display: flex; flex-direction: column; }
  .studio-canvas-panel::before, .studio-canvas-panel::after { content: ''; flex: 1; min-height: 0; }
  .studio-strip-wrap { flex-shrink: 0; margin: 0 auto; display: flex; justify-content: center; align-items: center; }

  .studio-tool-panel {
    height: auto;
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    border: none;
    border-top: 1px solid rgba(200, 184, 122, 0.15);
    border-radius: 0;
  }

  .tab-panel {
    flex: 0 0 auto;
    overflow-y: visible;
    overflow-x: hidden;
    padding: 12px 16px;
  }

  .filter-grid::-webkit-scrollbar,
  .text-color-row::-webkit-scrollbar,
  .sticker-nav::-webkit-scrollbar,
  .sticker-scroll-content::-webkit-scrollbar {
    display: none;
  }

  .filter-grid,
  .text-color-row,
  .sticker-nav,
  .sticker-scroll-content {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }

  .filter-grid {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
  }

  .filter-option {
    flex: 0 0 100px;
  }

  .text-inputs-row {
    flex-direction: row;
  }

  .text-color-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 8px;
    gap: 12px;
  }

  .text-color-btn {
    flex-shrink: 0;
  }

  #studio-actions {
    margin-top: 0;
    padding: 12px 16px;
  }

  #studio-actions .btn-primary,
  #studio-actions .btn-secondary {
    padding: 8px 16px;
  }

  .sticker-nav {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
    margin-bottom: 12px;
  }

  .sticker-nav-btn {
    flex-shrink: 0;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(200, 184, 122, 0.1);
    border: 1px solid rgba(200, 184, 122, 0.3);
    color: #E8DFC8;
    font-family: 'Chakra Petch', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s;
  }

  .sticker-nav-btn.active {
    background: #C8B87A;
    color: #11152c;
    font-weight: 700;
  }

  .sticker-scroll-content {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    padding-bottom: 8px;
  }

  .sticker-scroll-content .sticker-btn {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
  }

  .mobile-sticker-layout {
    display: block;
  }

  .desktop-sticker-layout {
    display: none;
  }

  .export-layout {
    padding: 16px 16px 40px;
    overflow-y: auto;
  }

  .export-content-row {
    flex-direction: column;
    align-items: center;
    padding-bottom: 2rem;
    gap: 32px;
  }

  .export-content-row > * {
    flex: none;
    width: 100%;
  }

  .export-buttons-wrap {
    align-items: center;
    padding-left: 0;
    max-width: 100%;
  }

  .export-printer-wrap .printer-body {
    width: 240px;
  }

  .export-printer-wrap .strip-output {
    width: 240px;
  }

  .export-btn-group {
    max-width: 100%;
  }

  .hashtag-copy-block {
    max-width: 100%;
  }


  .shoot-btn {
    padding: 10px 24px !important;
    font-size: 0.85rem !important;
  }

  .shoot-btn-circle {
    width: 52px;
    height: 52px;
    border-width: 3px;
  }

  .shoot-inner-circle {
    width: 44px;
    height: 44px;
  }

  .shoot-controls .icon-btn {
    width: 40px;
    height: 40px;
    font-size: 1.1rem;
  }

  .phase-actions {
    padding: 12px 16px;
  }

  #shoot-actions {
    margin-top: 0;
  }

  #shoot-actions .btn-secondary {
    width: 52px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  #shoot-actions .btn-icon {
    display: block;
    font-size: 1.2rem;
  }

  #shoot-actions .btn-text {
    display: none;
  }
}

@media (max-width: 480px) {
  .layout-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .char-select-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .phase-inner {
    padding: 12px 16px 20px;
  }

  .carousel-nav {
    display: none;
  }

  /* hide arrows on small mobile, rely on scroll */
  .template-grid {
    width: 100%;
  }

  /* full width since nav arrows are hidden */
  .template-carousel-wrap {
    margin-bottom: 20px;
  }

  .phase-header {
    margin-bottom: 12px;
  }
}

#mirror-camera svg,
#toggle-flash svg {
  stroke-width: 2;
  transition: color 0.2s;
}

#mirror-camera.active svg,
#toggle-flash.active svg {
  color: #C8B87A;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 8px 0 8px;
  cursor: ne-resize;
  font-size: 16px;
  z-index: 10;
}



.text-tool-select option {
  background-color: #0b0e14;
  color: #E8DFC8;
}