/* MAN PHOTO BOOTH — cute photo-sticker booth (pastel + neon), plus its
   lobby card theme. Kept separate from the JARVIS stylesheet. */

.jv-gc--photo {
  --gc-bg: linear-gradient(155deg, #fff0e6 0%, #ffe3f1 55%, #e3f4ff 100%); --gc-ink: #4a2150; --gc-sub: #7a5a80;
  --gc-accent: #ff6fa8; --gc-accent-ink: #fff; --gc-glow: rgba(255, 111, 168, 0.5);
  --gc-art-bg: radial-gradient(circle at 40% 40%, #fffaf3, #ffe9f3);
  border-color: rgba(255, 111, 168, 0.4);
}
.jv-gc--photo .jv-gc-badge { background: #22c3e6; color: #fff; }

.pb-root { --pink: #ff6fa8; --gold: #ffd84d; --cyan: #22e3ff; --ink: #f8fafc; max-width: 980px; margin: 0 auto; padding: 2px 0 24px; color: var(--ink); font-family: ui-rounded, 'SF Pro Rounded', 'Noto Sans Thai', system-ui, sans-serif; }
.pb-head { text-align: center; margin-bottom: 14px; }
.pb-logo { font-size: 24px; font-weight: 900; letter-spacing: 0.1em; }
.pb-logo b { color: var(--pink); text-shadow: 0 0 16px rgba(255, 111, 168, 0.45); }
.pb-privacy { margin: 6px auto 0; font-size: 12.5px; color: #a7f3d0; background: rgba(16, 185, 129, 0.1); border: 1px solid rgba(16, 185, 129, 0.35); border-radius: 999px; padding: 5px 12px; display: inline-block; }
.pb-h { font-size: 14px; margin: 18px 0 10px; color: #cbd5e1; letter-spacing: 0.04em; }

.pb-btn { font: inherit; font-size: 14px; font-weight: 700; background: #10141c; border: 1px solid #2c323c; color: var(--ink); padding: 10px 16px; border-radius: 999px; cursor: pointer; touch-action: manipulation; }
.pb-btn:hover:not(:disabled) { border-color: var(--pink); }
.pb-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.pb-primary { background: linear-gradient(135deg, #ff6fa8, #ff9a6b); border-color: transparent; color: #fff; font-weight: 900; letter-spacing: 0.06em; box-shadow: 0 6px 20px rgba(255, 111, 168, 0.35); }
.pb-mini { font-size: 12px; padding: 7px 12px; }
.pb-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 18px; }

/* setup */
.pb-layouts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.pb-opt { font: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border-radius: 18px; border: 2px solid #2c323c; background: #0f131b; color: var(--ink); cursor: pointer; }
.pb-opt.on { border-color: var(--pink); box-shadow: 0 0 18px rgba(255, 111, 168, 0.35); }
.pb-opt small { color: #94a3b8; font-size: 11.5px; }
.pb-lay { display: grid; gap: 3px; padding: 5px; background: #fff; border-radius: 6px; }
.pb-lay i { display: block; background: #ffc6e5; border-radius: 2px; }
.pb-lay-strip { grid-template-columns: 22px; } .pb-lay-strip i { height: 12px; }
.pb-lay-grid { grid-template-columns: 22px 22px; } .pb-lay-grid i { height: 22px; }
.pb-lay-square i { width: 44px; height: 44px; }
.pb-lay-portrait i { width: 36px; height: 46px; }
.pb-frames { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
.pb-frame { font: inherit; font-size: 12px; font-weight: 700; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 16px; border: 2px solid #2c323c; background: #0f131b; color: var(--ink); cursor: pointer; }
.pb-frame span { width: 100%; height: 40px; border-radius: 10px; background: linear-gradient(135deg, var(--a) 55%, var(--b) 55%); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.5); }
.pb-frame.on { border-color: var(--gold); box-shadow: 0 0 16px rgba(255, 216, 77, 0.35); }

/* camera */
.pb-cam { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pb-stage { position: relative; width: min(100%, 720px); aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; background: #000; border: 3px solid var(--pink); box-shadow: 0 0 30px rgba(255, 111, 168, 0.3); }
.pb-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-video.mirror { transform: scaleX(-1); }
.pb-count { position: absolute; inset: 0; display: grid; place-items: center; font-size: clamp(90px, 22vw, 180px); font-weight: 900; color: #fff; text-shadow: 0 0 30px rgba(255, 111, 168, 0.9), 0 6px 0 rgba(0, 0, 0, 0.3); pointer-events: none; }
.pb-count.pop { animation: pb-pop 0.8s ease-out; }
@keyframes pb-pop { from { transform: scale(1.6); opacity: 0; } 30% { transform: scale(1); opacity: 1; } to { opacity: 0.2; } }
.pb-flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.pb-flash.go { animation: pb-flash 0.45s ease-out; }
@keyframes pb-flash { from { opacity: 0.95; } to { opacity: 0; } }
.pb-shotno { position: absolute; top: 10px; left: 12px; font-size: 13px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); }
.pb-shotno:empty { display: none; }
.pb-thumbs { display: flex; gap: 8px; }
.pb-thumb { position: relative; width: 64px; height: 48px; border-radius: 8px; border: 2px dashed #3a414c; display: grid; place-items: center; font-size: 13px; color: #94a3b8; overflow: hidden; }
.pb-thumb.done { border-style: solid; border-color: var(--gold); }
.pb-thumb.cur { border-color: var(--pink); }
.pb-thumb canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.pb-status { font-size: 12.5px; color: #94a3b8; min-height: 18px; text-align: center; }
.pb-error { width: min(100%, 620px); padding: 18px; border-radius: 18px; border: 1px solid rgba(255, 111, 168, 0.45); background: rgba(255, 111, 168, 0.08); line-height: 1.6; }
.pb-error b { font-size: 16px; }
.pb-error ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: #e2e8f0; }
.pb-error p { margin: 6px 0 0; font-size: 13px; color: #cbd5e1; }

/* review */
.pb-review { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pb-rv { display: flex; flex-direction: column; gap: 8px; align-items: center; }
.pb-rv canvas { width: 100%; border-radius: 12px; border: 2px solid #2c323c; }

/* decorate */
.pb-deco { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.pb-canvas-wrap { display: flex; justify-content: center; }
/* Height-driven with the layout's aspect ratio, capped by available width, so it never distorts. */
.pb-board { position: relative; height: min(72vh, 900px, calc((min(100vw, 980px) - 380px) * var(--ar))); max-width: 100%; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); touch-action: none; }
.pb-composed { width: 100%; height: 100%; display: block; }
.pb-items { position: absolute; inset: 0; }
.pb-item { position: absolute; line-height: 1; white-space: nowrap; cursor: grab; user-select: none; -webkit-user-select: none; touch-action: none; padding: 0.08em 0.12em; border-radius: 8px; }
.pb-item.sticker .pb-item-c { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.pb-item.text .pb-item-c { font-weight: 900; font-family: ui-rounded, 'SF Pro Rounded', 'Noto Sans Thai', system-ui, sans-serif; -webkit-text-stroke: 0.18em var(--stroke); paint-order: stroke fill; }
.pb-item.sel { outline: 2px dashed rgba(255, 255, 255, 0.9); outline-offset: 2px; z-index: 2; }
.pb-del, .pb-handle { position: absolute; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 800 14px system-ui; line-height: 1; border: 2px solid #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35); touch-action: none; }
.pb-del { top: -16px; left: -16px; background: #ff4d6d; color: #fff; cursor: pointer; padding: 0; }
.pb-handle { bottom: -16px; right: -16px; background: var(--cyan); color: #04202b; cursor: nwse-resize; }
.pb-tools { display: flex; flex-direction: column; gap: 14px; padding: 16px; border-radius: 20px; background: #0f131b; border: 1px solid #262c36; }
.pb-tool > span { display: block; font-size: 12px; font-weight: 800; letter-spacing: 0.08em; color: #94a3b8; margin-bottom: 8px; }
.pb-stickers { display: flex; flex-wrap: wrap; gap: 6px; }
.pb-stickers button { font-size: 26px; width: 48px; height: 48px; border-radius: 14px; border: 1px solid #2c323c; background: #151a24; cursor: pointer; touch-action: manipulation; }
.pb-stickers button:hover { border-color: var(--pink); transform: scale(1.05); }
.pb-textrow { display: flex; gap: 6px; }
.pb-text { flex: 1; min-width: 0; font: inherit; font-size: 14px; background: #151a24; border: 1px solid #2c323c; color: var(--ink); padding: 9px 12px; border-radius: 12px; }
.pb-colors { display: flex; gap: 8px; margin-top: 8px; }
.pb-colors button { width: 28px; height: 28px; border-radius: 50%; background: var(--c); border: 2px solid #3a414c; cursor: pointer; }
.pb-colors button.on { outline: 3px solid var(--pink); outline-offset: 2px; }
.pb-tip { margin: 0; font-size: 12px; color: #94a3b8; }
.pb-actions-grid { margin-top: 0; justify-content: stretch; }
.pb-actions-grid .pb-btn { flex: 1 1 45%; }

@media (max-width: 860px) {
  .pb-deco { grid-template-columns: 1fr; }
  .pb-board { height: min(62vh, calc((100vw - 40px) * var(--ar))); }
  .pb-layouts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pb-frames { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .pb-logo { font-size: 20px; }
  .pb-stage { aspect-ratio: 3 / 4; }
}
@media (prefers-reduced-motion: reduce) {
  .pb-count.pop, .pb-flash.go { animation-duration: 0.01s; }
}

/* ชุดย้อนยุค 6 ประเทศ (man-costume.js) */
.pb-costume { background: linear-gradient(135deg, #ffd84d, #ff9cc7); color: #2a1240; border-color: transparent; font-weight: 900; }
.pc-root { max-width: 980px; margin: 0 auto; padding: 4px 4px 24px; color: var(--ink, #f8fafc); font-family: ui-rounded, 'SF Pro Rounded', 'Noto Sans Thai', system-ui, sans-serif; }
.pc-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.pc-title { font-weight: 900; font-size: 18px; }
.pc-hint, .pc-note, .pc-status { color: #b9c2d6; font-size: 13px; margin: 8px 0; text-align: center; }
.pc-err { color: #ff8080; text-align: center; }
.pc-missbox { margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 216, 77, 0.5); background: rgba(255, 216, 77, 0.08); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.pc-missbox code, .pc-card code { font-size: 11.5px; color: #ffd84d; }
.pc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pc-card { display: flex; flex-direction: column; gap: 2px; padding: 8px; border-radius: 16px; border: 1.5px solid rgba(255, 255, 255, 0.12); background: #121722; color: inherit; font: inherit; cursor: pointer; text-align: center; }
.pc-card:hover:not(:disabled) { border-color: #ffd84d; box-shadow: 0 0 18px rgba(255, 216, 77, 0.25); }
.pc-card b { font-size: 14px; } .pc-card small { color: #b9c2d6; }
.pc-thumb { display: grid; place-items: center; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden; background: #0b0e14; margin-bottom: 4px; }
.pc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pc-thumb span { color: #8f9ab0; font-size: 12px; padding: 8px; }
.pc-missing { opacity: 0.55; cursor: not-allowed; }
.pc-cam { position: relative; width: min(100%, 420px); aspect-ratio: 3 / 4; margin: 0 auto; border-radius: 18px; overflow: hidden; background: #000; }
.pc-cam video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pc-oval { position: absolute; left: 50%; top: 44%; width: 52%; height: 50%; transform: translate(-50%, -50%); border: 3px dashed rgba(255, 216, 77, 0.85); border-radius: 50%; pointer-events: none; }
.pc-camhint { position: absolute; left: 0; right: 0; bottom: 8px; margin: 0; text-align: center; font-size: 13px; color: #fff; text-shadow: 0 1px 4px #000; }
.pc-actions, .pc-tune { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.pc-upload { cursor: pointer; }
.pc-stage { display: flex; justify-content: center; }
.pc-view { width: min(100%, 520px); height: auto; aspect-ratio: auto; max-height: 64vh; object-fit: contain; border-radius: 16px; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45); touch-action: none; cursor: grab; background: #0b0e14; }
@media (max-width: 480px) { .pc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pc-actions .pb-btn, .pc-tune .pb-btn { flex: 1 1 40%; } }
@media (orientation: landscape) and (max-height: 520px) { .pc-cam { width: min(60vh, 100%); } .pc-view { max-height: 78vh; } }
