.video-box {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #111;
  border-radius: 12px;
  overflow: hidden;
}
.video-box img { width: 100%; height: 100%; object-fit: contain; display: block; }
.overlay-msg {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #fff; background: rgba(0, 0, 0, .6);
}
.overlay-msg.d-none { display: none !important; }
.notice {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  background: rgba(255, 193, 7, .95); color: #222;
  padding: 8px 12px; border-radius: 8px; font-size: .9rem; text-align: center;
}
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
}
.dress-item {
  border: 2px solid transparent; background: #f4f4f4; border-radius: 10px;
  padding: 6px; cursor: pointer; text-align: center; font-size: .8rem;
  transition: transform .1s, border-color .1s;
}
.dress-item:hover { transform: translateY(-2px); }
.dress-item.active { border-color: #0d6efd; background: #e8f0ff; }
.dress-item img { width: 100%; height: 110px; object-fit: contain; }

/* ---------- Full screen mode (native fullscreen or CSS fallback for iOS) ---------- */
.fs-btn, .fs-snap {
  position: absolute; z-index: 5; border: 0; border-radius: 50%;
  width: 42px; height: 42px; font-size: 20px; line-height: 1;
  background: rgba(0, 0, 0, .55); color: #fff; cursor: pointer;
}
.fs-btn { top: 10px; right: 10px; }
.fs-snap, .fs-name, .fs-strip { display: none; }

.video-box.is-fs {
  position: fixed; inset: 0; z-index: 2000;
  width: 100vw; height: 100vh; height: 100dvh;
  aspect-ratio: auto; border-radius: 0;
}
.video-box.is-fs .fs-name {
  display: block; position: absolute; top: 14px; left: 0; right: 60px; z-index: 5;
  text-align: center; color: #fff; font-weight: 600; text-shadow: 0 1px 4px #000;
}
.video-box.is-fs .fs-snap { display: block; right: 14px; bottom: 96px; width: 52px; height: 52px; font-size: 24px; }
.video-box.is-fs .fs-strip {
  display: flex; gap: 10px; overflow-x: auto; z-index: 5;
  position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, rgba(0, 0, 0, .65));
}
.fs-thumb {
  flex: 0 0 auto; width: 68px; height: 68px; padding: 4px; border-radius: 50%;
  border: 3px solid transparent; background: rgba(255, 255, 255, .85); cursor: pointer;
}
.fs-thumb.active { border-color: #0d6efd; }
.fs-thumb img { width: 100%; height: 100%; object-fit: contain; }
.video-box.is-fs .notice { bottom: 100px; }

/* ---------- Photo mode ---------- */
#stage video, #stage img { width: 100%; height: 100%; object-fit: contain; display: block; }
#stage video { transform: scaleX(-1); }          /* mirror preview like a selfie camera */
#stage .d-none { display: none !important; }
.countdown {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 7rem; font-weight: 700; color: #fff; text-shadow: 0 2px 12px rgba(0, 0, 0, .7);
  pointer-events: none;
}
.flash { animation: flash .35s ease-out; }
@keyframes flash { from { box-shadow: inset 0 0 0 999px rgba(255, 255, 255, .9); } to { box-shadow: none; } }

.guide { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.guide ellipse, .guide path { fill: none; stroke: rgba(255, 255, 255, .8); stroke-width: 2.5; stroke-dasharray: 8 7; }
.guide text { fill: #fff; font-size: 11px; paint-order: stroke; stroke: rgba(0, 0, 0, .6); stroke-width: 3px; }
#stage .guide.d-none { display: none !important; }

/* ---------- Photo mode without live video ---------- */
.idle {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 18px; z-index: 4;
  text-align: center; color: #fff; font-size: .95rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, .75));
}
#stage .idle.d-none, #stage .guide.d-none { display: none !important; }

/* ---------- Photo mode: full screen ---------- */
.fs-actions { display: none; }
.video-box.is-fs .fs-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  position: absolute; left: 0; right: 0; bottom: 104px; z-index: 6;
}
.video-box.is-fs .idle { bottom: 170px; background: none; text-shadow: 0 1px 4px #000; }
.video-box.is-fs .notice { bottom: 170px; }
.video-box.is-fs .countdown { font-size: 12rem; }
#stage .fs-actions .d-none { display: none !important; }

/* guide: half-body outline by default, full-length outline for full-body outfits */
.guide .fullbody { display: none; }
.guide.full .fullbody { display: inline; }
.guide.full .half { display: none; }
.guide .fullbody ellipse, .guide .fullbody path { fill: none; stroke: rgba(255, 255, 255, .8); stroke-width: 2.5; stroke-dasharray: 8 7; }
