:root {
  --cream: #f4ecd8;
  --brown-dark: #2b1e14;
  --brown: #4a3222;
  --accent: #b5482f;
  --accent-dark: #8a3320;
  --font-ui: 'Inter', system-ui, sans-serif;
  --font-heading: 'Petrona', Georgia, serif;
  --font-script: 'Ballet', cursive;
  font-family: var(--font-ui);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
}

body {
  margin: 0;
  color: var(--cream);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 12px;
  background-color: #1a1108;
  background-image: linear-gradient(rgba(10, 6, 3, 0.6), rgba(10, 6, 3, 0.6)), url('images/wood-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.page-flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 9999;
  transition: opacity 0.08s ease-out;
}

.page-flash.flash-active {
  opacity: 0.95;
  transition: opacity 0.02s ease-in;
}

.app {
  width: auto;
  max-width: 480px;
}

.app-header {
  text-align: center;
  margin-bottom: 10px;
}

.app-header h1 {
  margin: 0;
  font-size: 1.8rem;
  letter-spacing: 0.05em;
}

.site-name-script {
  font-family: var(--font-script);
  /* Fallback before JS measures and takes over (syncTitleSize in app.js) —
     JS shrinks this to guarantee it never wraps or exceeds the booth's width. */
  font-size: clamp(2.1rem, 11vw, 4rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  vertical-align: middle;
  white-space: nowrap;
  display: inline-block;
  max-width: 100%;
}

.subtitle {
  color: #cbb99a;
  margin: 4px 0 0;
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

.header-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 16px;
  margin-top: 2px;
}

.booth {
  padding-left: 10px;
  padding-right: 10px;
  background-color: var(--brown-dark);
  background-image: url('images/booth-bg.jpg');
  background-size: cover;
  background-position: center;
  border: 2px solid #000;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 0 0 6px var(--brown);
  max-height: calc(100vh - 30px);
  overflow-y: auto;
}

.stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.hidden {
  display: none !important;
}

.video-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #000;
  border-radius: 10px;
  overflow: hidden;
  border: 4px solid #111;
  position: relative;
}

.video-frame video,
.video-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.4) contrast(1.1) brightness(1.02) saturate(1.05);
}

.video-frame video {
  transform: scaleX(-1);
}

.camera-select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 2px solid #6b5540;
  background: #1c1410;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.9rem;
}

.strip-color-toggle {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.toggle-btn {
  flex: 1;
  min-width: 100px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 2px solid #6b5540;
  /* solid fill (not transparent) — same reasoning as .btn.secondary: sits
     directly on the booth's textured background, unreadable without one. */
  background: rgba(20, 13, 8, 0.72);
  color: var(--cream);
  font-family: inherit;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.option-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.option-label {
  color: #cbb99a;
  font-size: 0.8rem;
  font-weight: bold;
  letter-spacing: 0.03em;
  font-family: var(--font-heading);
}

/* .booth sits directly on the light silver texture (no dark overlay) — the
   cream/tan text used elsewhere (on dark backgrounds) is illegible there,
   so labels and hints inside it are black instead. */
.stage .option-label,
.stage .hint,
.stage .error {
  color: #111;
}

.swatch-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #6b5540;
  cursor: pointer;
  padding: 0;
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2);
}

.swatch.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent);
}

.swatch-polka {
  background-color: #f4f4f2;
  background-image: radial-gradient(circle, #111 22%, transparent 24%);
  background-size: 10px 10px;
  background-position: 0 0, 5px 5px;
}

.swatch-premium {
  position: relative;
  opacity: 0.45;
  cursor: not-allowed;
}

.swatch-lock {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.swatch-group.premium-unlocked .swatch-premium {
  opacity: 1;
  cursor: pointer;
}

.swatch-group.premium-unlocked .swatch-lock {
  display: none;
}

.premium-badge {
  display: inline-block;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: bold;
  margin-left: 4px;
}

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.25);
}

.countdown-overlay #countdown-number {
  font-size: 5rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  animation: countdown-pop 1s ease-out;
}

@keyframes countdown-pop {
  from {
    transform: scale(1.4);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.booth-layout {
  /* full-width now — video-frame grows to fill it (width-driven sizing),
     so there's no dead space flanking the preview row inside .app. */
  width: 100%;
  max-width: 100%;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.booth-layout .video-frame {
  /* Width now grows to fill available row space; height follows from the
     3:4 aspect-ratio via aspect-ratio (not the reverse, as before) so the
     preview scales with .app's actual width instead of a fixed vh, closing
     the gaps that used to sit left/right of it. strip slots + ready-sign
     recompute off videoFrame's live rendered rect (syncStripSlotSize), so
     they track this automatically. */
  flex: 1 1 auto;
  width: auto;
  height: auto;
}

/* Ready sign — sits beside the push-to-start button, below the 1-2-3-4
   strip slots. #ready-light is the functional dot (see updateReadyLight()
   in the script). */
.ready-sign {
  position: relative;
  flex: 0 0 auto;
  align-self: center;
  margin-left: auto;
  aspect-ratio: 496 / 854;
  display: flex;
}

/* Source photo (uploads/sign.png), embedded as base64 the same way every
   other image in this export is — swap for a real public/images/sign.png
   <img src> when this goes back into the site. Already cropped/transparent,
   so object-fit: contain shows it as-is, no cropping needed here. */
.ready-sign-img {
  width: auto;
  height: 100%;
  max-width: none;
  object-fit: contain;
  display: block;
  filter: brightness(1.12) saturate(1.35);
}

/* Transparent overlay sitting exactly on top of the photo's own indicator
   bulb (~54%/48% of the frame). Off = fully invisible, so the photo's real
   (dark) bulb shows through untouched; screen-blend green glow when active. */
.ready-light {
  position: absolute;
  left: 51%;
  top: 49%;
  width: 17%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: transparent;
  box-shadow: none;
  mix-blend-mode: screen;
  pointer-events: none;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Green = a valid code with strips remaining is applied (same condition
   that enables #capture-btn) — toggled by updateReadyLight(). */
.ready-light.active {
  background: radial-gradient(circle, rgba(110, 255, 150, 0.95), rgba(40, 200, 90, 0.6) 60%, transparent 78%);
  box-shadow: 0 0 18px 6px rgba(60, 220, 110, 0.8);
}

@media (max-width: 640px) {
  .ready-sign {
    order: -1;
    align-self: center;
    height: 60px;
  }
  .ready-sign-img {
    height: 100%;
  }
}

.strip-preview {
  /* width/height of each slot is set inline by JS (syncStripSlotSize) to
     exactly match the live camera preview's rendered aspect ratio. */
  width: auto;
  flex-shrink: 0;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.strip-slot {
  position: relative;
  flex: 0 0 auto;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  border: 2px dashed #6b5540;
  background: rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.strip-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: sepia(0.4) contrast(1.1) brightness(1.02) saturate(1.05);
}

.strip-slot .slot-number {
  color: #fff;
  font-weight: bold;
  font-size: 1.1rem;
}

.strip-slot.filled {
  border-style: solid;
  border-color: var(--accent);
}

.strip-slot.filled .slot-number {
  display: none;
}

/* Lives outside .booth (see index.html) — its own little wood-textured tray
   next to the camera window, not part of the camera window itself. top/left
   are set in JS (positionDevelopingStrip in app.js) since .booth's own
   width/offset varies by breakpoint; this just handles the tray's look and
   its own internal layout. */
.developing-strip {
  position: fixed;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border-radius: 10px;
  background-image: url('images/wood-bg.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

/* Set by positionDevelopingStrip() when there's no room to the booth's
   right (narrow/mobile viewports) — sits below it instead, laid out as a
   horizontal row so it reads as a strip rather than a tall stack. */
.developing-strip.stacked-below {
  flex-direction: row;
}

.dev-section {
  flex: 0 0 auto;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  border: 2px solid var(--accent);
  overflow: hidden;
  background: linear-gradient(100deg, #2b1e14 20%, #6b4a2f 40%, #cbb99a 50%, #6b4a2f 60%, #2b1e14 80%);
  background-size: 250% 100%;
  animation: dev-shimmer 1.8s ease-in-out infinite;
}

.dev-section:nth-child(2) { animation-delay: 0.15s; }
.dev-section:nth-child(3) { animation-delay: 0.3s; }
.dev-section:nth-child(4) { animation-delay: 0.45s; }

@keyframes dev-shimmer {
  0% { background-position: 0% 0; }
  100% { background-position: -250% 0; }
}

.dev-label {
  text-align: center;
  color: #f4ecd8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
}

.developing-strip.stacked-below .dev-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

.manual-capture {
  width: 100%;
}

.spinner-sm {
  width: 20px;
  height: 20px;
  border-width: 3px;
}

.toggle-row {
  width: 100%;
  display: flex;
  gap: 8px;
}

.compact-btn {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.collapsible {
  animation: collapsible-open 0.15s ease-out;
}

@keyframes collapsible-open {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.job-status {
  cursor: pointer;
  text-decoration: underline;
}

.below-booth-controls {
  width: 100%;
  max-width: 480px;
  margin: 16px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  box-sizing: border-box;
}

.push-start-btn {
  position: relative;
  width: 100%;
  max-width: 260px;
  min-width: 0;
  aspect-ratio: 1490 / 1136;
  background-image: url('images/push-start-white.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  background-color: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: filter 0.2s ease;
}

.push-start-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('images/push-start-red.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.push-start-btn.code-ready::after {
  opacity: 1;
}

.push-start-btn:active::after {
  transform: translateY(1px) scale(0.98);
}

.push-start-btn-label {
  position: absolute;
  left: 18%;
  right: 18%;
  top: 68%;
  transform: translateY(-50%);
  color: #7a1f1f;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: clamp(0.5rem, 2.6vw, 0.75rem);
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.1;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.push-start-btn.code-ready .push-start-btn-label {
  opacity: 0;
}

.controls.push-controls {
  display: grid;
  grid-template-columns: 0px 1fr minmax(0, 1fr);
  align-items: center;
  column-gap: 0;
}

.push-controls .push-start-btn {
  grid-column: 2;
  justify-self: center;
}

.push-controls .ready-sign {
  grid-column: 3;
  justify-self: end;
  margin-left: 24px;
  margin-right: 16px;
  width: auto;
  height: 100%;
  min-width: 0;
  max-width: 100%;
}

.start-hint-popup {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  background: #7a1f1f;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 0.85rem;
  padding: 8px 16px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  animation: hint-pop 0.25s ease-out;
}

@keyframes hint-pop {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  /* Desktop hugs its content width (no dead space) — on mobile there's no
     excess to trim, so use the available width instead of shrinking to
     whatever the narrowest child needs (was rendering as a skinny column). */
  .app {
    width: 100%;
  }

  .booth-layout {
    flex-direction: column;
  }

  .strip-preview {
    width: 100%;
    flex-direction: row;
  }
}

/* Short viewports (small phones in portrait) — the 40vh video cap and
   normal spacing add up to more than fits; tighten both so nothing gets
   clipped by html/body's overflow:hidden. */
@media (max-height: 700px) {
  .booth-layout .video-frame {
    height: 30vh;
  }
  .app-header {
    margin-bottom: 6px;
  }
  .stage {
    gap: 6px;
  }
  .booth {
    padding: 10px;
  }
  body {
    padding: 8px;
  }
  .subtitle {
    display: none;
  }
}

.film-frame {
  width: 62%;
  max-width: 260px;
  margin: 0 auto;
  padding: 14px 14px 30px;
  background: #efe6d2;
  border-radius: 4px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.45);
  position: relative;
}

.film-frame img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 2px;
}

.film-frame::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 10px;
  height: 6px;
  background: repeating-linear-gradient(90deg, #d8cba9 0 4px, transparent 4px 10px);
  opacity: 0.6;
}

.controls {
  display: flex;
  gap: 12px;
  width: 100%;
}

.btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-weight: bold;
  font-size: 0.95rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  transition: transform 0.1s ease, opacity 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}

.btn.primary:hover {
  background: var(--accent-dark);
}

.btn.secondary {
  /* solid fill (not transparent) — sits directly on the booth's textured
     background image, which otherwise makes the text hard to read. */
  background: rgba(20, 13, 8, 0.72);
  color: var(--cream);
  border: 2px solid #6b5540;
}

.btn.link {
  background: rgba(20, 13, 8, 0.55);
  color: var(--cream);
  text-decoration: underline;
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
}

.btn.link.active {
  background: var(--accent);
  text-decoration: none;
}

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

#lightbox-loading,
#lightbox-error,
#lightbox-done {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 100%;
}

.spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #5a4530;
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hint {
  color: #cbb99a;
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}

.token-counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.token-icon {
  width: 22px;
  height: 22px;
  flex: none;
}

.unlock-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.unlock-form input {
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid #6b5540;
  background: #1c1410;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.95rem;
}

.error {
  color: #ff8a75;
  font-size: 0.85rem;
  text-align: center;
  margin: 0;
}

/* --- Review Strips: corkboard view, strips tacked directly to the page's
   wood background (this view is transparent so it shows through), freely
   draggable with collision avoidance (no momentum — a strip only ever sits
   exactly where it's dropped). Shown/hidden with a fade, not a slide: a
   transform would still be mid-transition when strip positions are first
   measured against the preview window, throwing that math off. */

.review-view {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: transparent;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.review-view.open {
  opacity: 1;
}

.hide-strips-btn,
.review-import-btn {
  max-width: calc(50% - 24px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* .btn compounded onto the selector (not just .hide-strips-btn) so this
   beats the later, equal-specificity ".btn, .toggle-btn, ... { position:
   relative }" hover-effect rule instead of losing to it by source order. */
.btn.hide-strips-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 3001;
  width: auto;
  flex: none;
}

@media (max-width: 480px) {
  .hide-strips-btn,
  .review-import-btn {
    padding: 10px 12px;
    font-size: 0.8rem;
  }
}

.review-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Full Gallery page: the canvas fills the whole viewport on its own,
   independent of body's flex-centering (which is meant for the .app card). */
.gallery-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
}

.review-empty-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: var(--cream);
  text-align: center;
  width: 80%;
  max-width: 320px;
}

.btn.review-import-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 3001;
  width: auto;
  flex: none;
}

#import-file-input {
  width: 100%;
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 0.85rem;
}

#import-modal code {
  font-size: 0.8em;
  background: rgba(0, 0, 0, 0.3);
  padding: 1px 5px;
  border-radius: 4px;
  word-break: break-all;
}

.tacked-strip {
  position: absolute;
  width: 92px;
  border: 6px solid #000;
  border-bottom-width: 18px;
  border-radius: 2px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
  cursor: grab;
  touch-action: none;
  user-select: none;
  display: block;
}

.tacked-delete-btn {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(20, 13, 8, 0.9);
  color: var(--cream);
  border: 2px solid #000;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
}

.strip-delete-confirm {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.strip-delete-confirm-box {
  background: var(--brown-dark);
  border: 2px solid #000;
  border-radius: 14px;
  padding: 20px;
  max-width: 300px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.strip-delete-confirm-box p {
  margin: 0;
  color: var(--cream);
}

.tacked-strip.dragging {
  cursor: grabbing;
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.75);
  z-index: 10;
}

.tacked-pin {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.3rem;
  pointer-events: none;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

/* Simple single-strip preview — a slight dim, not a separate modal window. */
.strip-peek {
  position: fixed;
  inset: 0;
  z-index: 4000;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
}

.strip-peek img {
  max-width: min(70vw, 420px);
  max-height: 70vh;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

.strip-peek-hide-btn {
  width: auto;
  flex: none;
}

/* #import-modal is opened from inside .review-view (z-index 3000) — without
   its own higher z-index, review-canvas sits on top and swallows every
   click meant for the modal, including its own close button. */
#import-modal {
  z-index: 3500;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.8);
}

.lightbox-content {
  position: relative;
  width: 100%;
  max-width: 360px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--brown-dark);
  border: 2px solid #000;
  border-radius: 18px;
  padding: 40px 20px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

#tokens-modal .lightbox-content {
  background-image: linear-gradient(rgba(15, 9, 5, 0.72), rgba(15, 9, 5, 0.72)), url('images/wood-bg.jpg');
  background-size: cover;
  background-position: center;
}

.lightbox-close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: none;
  color: var(--cream);
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: 2px solid #6b5540;
  color: var(--cream);
  font-size: 1.6rem;
  line-height: 1;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-nav:disabled {
  opacity: 0.25;
  cursor: not-allowed;
}

.lightbox-prev {
  left: -14px;
}

.lightbox-next {
  right: -14px;
}

@media (max-width: 460px) {
  .lightbox-prev {
    left: 4px;
  }
  .lightbox-next {
    right: 4px;
  }
}

.modal-title {
  margin: 0;
  font-size: 1.4rem;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 600;
}

.tier-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 2px solid #6b5540;
  background: #1c1410;
  color: var(--cream);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
}

.tier-card.active {
  border-color: var(--accent);
  background: rgba(181, 72, 47, 0.15);
}

.tier-card .tier-name {
  font-weight: bold;
  font-size: 0.95rem;
}

.tier-card .tier-price {
  font-weight: bold;
  color: var(--accent);
}

.tier-card .tier-per {
  color: #cbb99a;
  font-size: 0.75rem;
}

.code-display {
  width: 100%;
  text-align: center;
  padding: 14px;
  border-radius: 10px;
  border: 2px dashed #6b5540;
  background: #1c1410;
  color: var(--cream);
  font-family: 'Courier New', Courier, monospace;
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  word-break: break-all;
}

.quantity-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-btn {
  flex: none;
  width: 40px;
  padding: 8px 0;
}

#quantity-input {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 2px solid #6b5540;
  background: #1c1410;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.95rem;
}

.checkbox-row {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  color: var(--cream);
  font-size: 0.9rem;
}

.checkbox-row input {
  margin-top: 3px;
  flex: none;
}

.tier-mini-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tier-mini-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 8px;
  border: 2px solid #6b5540;
  background: #1c1410;
  color: var(--cream);
  font-family: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.tier-mini-btn.active {
  border-color: var(--accent);
  background: rgba(181, 72, 47, 0.15);
}

.consent-notice {
  text-align: left;
  line-height: 1.4;
}

/* ==== visual polish pass: tactile buttons, hover lift + shine, focus states ==== */

.btn,
.toggle-btn,
.tier-card,
.tier-mini-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1),
    box-shadow 0.25s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn.primary {
  box-shadow: 0 4px 0 var(--accent-dark), 0 6px 14px rgba(0, 0, 0, 0.35);
}

.btn.primary:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--accent-dark), 0 12px 22px rgba(181, 72, 47, 0.45);
}

.btn.secondary {
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
}

.btn.secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.btn.link {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.btn.link:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.btn:disabled {
  transform: none;
}

@keyframes btn-sparkle {
  0%, 100% { opacity: 0; transform: scale(0.4) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(45deg); }
}

.btn.primary::after {
  content: '';
}

.toggle-btn {
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.toggle-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.toggle-btn.active {
  box-shadow: 0 3px 10px rgba(181, 72, 47, 0.4);
}

.toggle-btn:active {
  transform: translateY(1px) scale(0.98);
}

.swatch {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.swatch:hover:not(.swatch-premium) {
  transform: scale(1.14);
  box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(181, 72, 47, 0.4);
}

.swatch:active:not(.swatch-premium) {
  transform: scale(1.02);
}

.tier-card {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.tier-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.4);
}

.tier-card.active {
  box-shadow: 0 0 0 2px var(--accent), 0 8px 18px rgba(181, 72, 47, 0.3);
}

.tier-card:active {
  transform: translateY(0) scale(0.99);
}

.tier-mini-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.lightbox-close,
.lightbox-nav,
.tacked-delete-btn {
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease;
}

.lightbox-close:hover {
  transform: scale(1.15);
  color: var(--accent);
}

.lightbox-nav:hover:not(:disabled) {
  transform: translateY(-50%) scale(1.15);
  background: var(--accent);
  border-color: var(--accent);
}

.tacked-delete-btn:hover {
  transform: scale(1.15);
  background: var(--accent);
}

.btn:focus-visible,
.toggle-btn:focus-visible,
.swatch:focus-visible,
.tier-card:focus-visible,
.tier-mini-btn:focus-visible,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible,
.tacked-delete-btn:focus-visible {
  outline: 2px solid var(--cream);
  outline-offset: 2px;
}

.site-name-script {
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.booth {
  transition: box-shadow 0.3s ease;
}
