/* Pulse Monster AR Booth — scoped for Shopify showroom */
#pmBoothRoot {
  --bg:#0a0a0c; --bg2:#121218; --fg:#f4f4f6; --muted:#9a9aad;
  --purple:#7c00f3; --purple2:#a855f7; --line:rgba(124,0,243,.55);
  --safe-b:env(safe-area-inset-bottom,0px); --safe-t:env(safe-area-inset-top,0px); --btn:56px;
  font-family:"SF Pro Display","PingFang SC","Noto Sans SC","Helvetica Neue",system-ui,sans-serif;
  position:fixed; inset:0; z-index:100000; display:none; background:var(--bg);
  color:var(--fg); overflow:hidden; user-select:none; -webkit-user-select:none;
}
#pmBoothRoot.open { display:block; }
#pmBoothRoot, #pmBoothRoot * { box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
#pmBoothRoot button { font:inherit; color:inherit; }
body.pm-booth-open { overflow:hidden !important; }
#pmBoothRoot .pm-booth-secure {
  display:none; margin:12px 20px; padding:12px 14px; border-radius:12px;
  border:1px solid rgba(124,0,243,.45); background:rgba(124,0,243,.12);
  color:#e9d5ff; font-size:13px; line-height:1.45;
}
#pmBoothRoot .pm-booth-secure.on { display:block; }
/* —— Home —— */#pmBoothRoot #pmBoothHome{
  min-height: 100%;
  padding: calc(24px + var(--safe-t)) 20px calc(28px + var(--safe-b));
  display: flex; flex-direction: column; gap: 18px;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(124,0,243,.28), transparent 55%),
    var(--bg);
  overflow-y: auto;
}#pmBoothRoot .brand{
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}#pmBoothRoot .brand-mark{
  display: flex; align-items: center; gap: 10px;
}#pmBoothRoot .brand-mark img{
  width: 42px; height: 42px; border-radius: 10px;
  border: 1px solid var(--line);
}#pmBoothRoot .brand h1{
  margin: 0; font-size: 18px; letter-spacing: .04em; font-weight: 800;
}#pmBoothRoot .brand .sub{
  margin: 2px 0 0; font-size: 11px; color: var(--muted); letter-spacing: .08em;
}#pmBoothRoot .event-pill{
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  padding: 8px 10px; border-radius: 999px;
  border: 1px solid var(--line);
  color: #e9d5ff; background: rgba(124,0,243,.15);
  white-space: nowrap;
}#pmBoothRoot .hero{
  border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(124,0,243,.35);
  background: #000;
  aspect-ratio: 16/10;
  position: relative;
}#pmBoothRoot .hero img{ width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; }#pmBoothRoot .hero .caption{
  position: absolute; left: 12px; bottom: 10px; right: 12px;
  font-size: 12px; color: #fff; text-shadow: 0 1px 8px #000;
}#pmBoothRoot .mode-grid{ display: grid; gap: 14px; }#pmBoothRoot .mode-card{
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 16px; border-radius: 18px;
  background: linear-gradient(180deg, #16161f, #101016);
  border: 1px solid rgba(255,255,255,.06);
  text-align: left; width: 100%;
  cursor: pointer;
  transition: border-color .15s, transform .1s;
}#pmBoothRoot .mode-card:active{ transform: scale(.985); }#pmBoothRoot .mode-card:focus-visible{ outline: 2px solid var(--purple2); outline-offset: 2px; }#pmBoothRoot .mode-card .ico{
  width: 64px; height: 64px; border-radius: 14px;
  display: grid; place-items: center;
  background: rgba(124,0,243,.18);
  border: 1px solid var(--line);
  font-size: 28px;
}#pmBoothRoot .mode-card h2{ margin: 0 0 4px; font-size: 17px; font-weight: 800; }#pmBoothRoot .mode-card p{ margin: 0; font-size: 13px; color: var(--muted); line-height: 1.35; }#pmBoothRoot .mode-card .chev{ color: var(--purple2); font-size: 22px; font-weight: 700; }#pmBoothRoot .tips{
  margin-top: auto;
  padding: 14px 16px; border-radius: 14px;
  background: rgba(255,255,255,.03);
  border: 1px dashed rgba(124,0,243,.35);
  font-size: 12px; color: var(--muted); line-height: 1.5;
}#pmBoothRoot .tips strong{ color: #e9d5ff; font-weight: 700; }#pmBoothRoot /* —— Stage (camera modes) —— */
.stage{
  position: fixed; inset: 0;
  display: none; flex-direction: column;
  background: #000;
  z-index: 20;
}#pmBoothRoot .stage.active{ display: flex; }#pmBoothRoot .stage-top{
  position: absolute; top: 0; left: 0; right: 0; z-index: 5;
  padding: calc(10px + var(--safe-t)) 12px 10px;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,.72), transparent);
}#pmBoothRoot .stage-top .title{
  flex: 1; font-size: 14px; font-weight: 700; letter-spacing: .04em;
  text-shadow: 0 1px 6px #000;
}#pmBoothRoot .chip-btn, #pmBoothRoot .icon-btn{
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(10,10,12,.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 999px;
  min-height: 40px;
  padding: 0 14px;
  font-size: 13px; font-weight: 600;
}#pmBoothRoot .icon-btn{
  width: 40px; padding: 0;
  display: grid; place-items: center; font-size: 18px;
}#pmBoothRoot .chip-btn.on{
  border-color: var(--purple2);
  background: rgba(124,0,243,.35);
}#pmBoothRoot .viewport{
  flex: 1; position: relative; overflow: hidden;
  background: #000;
}#pmBoothRoot #pmBoothVideo, #pmBoothRoot #pmBoothShowVideo{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transform: scaleX(-1); /* selfie mirror default; flipped off for environment */
}#pmBoothRoot #pmBoothVideo.rear, #pmBoothRoot #pmBoothShowVideo.rear{ transform: none; }#pmBoothRoot #pmBoothFrame, #pmBoothRoot #pmBoothShowFrame{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 3;
}#pmBoothRoot #pmBoothShowCanvas{
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  z-index: 2;
  touch-action: none;
}#pmBoothRoot .stage-bottom{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  padding: 12px 16px calc(18px + var(--safe-b));
  background: linear-gradient(0deg, rgba(0,0,0,.82), transparent);
  display: flex; flex-direction: column; gap: 12px;
}#pmBoothRoot .model-row{
  display: flex; gap: 8px; overflow-x: auto;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}#pmBoothRoot .model-row::-webkit-scrollbar{ display: none; }#pmBoothRoot .model-pill{
  flex: 0 0 auto;
  padding: 10px 14px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(10,10,12,.55);
  font-size: 12px; font-weight: 700;
  white-space: nowrap;
}#pmBoothRoot .model-pill.active{
  border-color: var(--purple2);
  background: rgba(124,0,243,.4);
}#pmBoothRoot .controls{
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}#pmBoothRoot .controls .side{
  display: flex; gap: 8px; align-items: center;
}#pmBoothRoot .controls .side.right{ justify-content: flex-end; }#pmBoothRoot .shutter{
  width: 74px; height: 74px; border-radius: 50%;
  border: 3px solid #fff;
  background: radial-gradient(circle at 50% 50%, #fff 0 58%, transparent 60%);
  box-shadow: 0 0 0 4px rgba(124,0,243,.45);
  padding: 0;
}#pmBoothRoot .shutter:active{ transform: scale(.94); }#pmBoothRoot .hint{
  text-align: center; font-size: 11px; color: rgba(255,255,255,.7);
}#pmBoothRoot /* Preview / share sheet */
#sheet{
  position: fixed; inset: 0; z-index: 40;
  display: none; flex-direction: column;
  background: rgba(0,0,0,.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  padding: calc(16px + var(--safe-t)) 16px calc(20px + var(--safe-b));
}#pmBoothRoot #sheet.open{ display: flex; }#pmBoothRoot #sheet .card{
  margin: auto 0 0;
  background: var(--bg2);
  border: 1px solid rgba(124,0,243,.35);
  border-radius: 22px;
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  max-height: 92%;
}#pmBoothRoot #sheetPreview{
  width: 100%; border-radius: 14px; background: #000;
  max-height: 58vh; object-fit: contain;
}#pmBoothRoot .sheet-actions{
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}#pmBoothRoot .sheet-actions .full{ grid-column: 1 / -1; }#pmBoothRoot .primary, #pmBoothRoot .secondary, #pmBoothRoot .ghost{
  min-height: var(--btn);
  border-radius: 16px;
  font-weight: 800; font-size: 15px;
  border: none;
}#pmBoothRoot .primary{
  background: linear-gradient(135deg, var(--purple), #4c1d95);
  color: #fff;
}#pmBoothRoot .secondary{
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
}#pmBoothRoot .ghost{
  background: transparent;
  color: var(--muted);
  min-height: 44px;
}#pmBoothRoot #toast{
  position: fixed; left: 50%; bottom: calc(28px + var(--safe-b));
  transform: translateX(-50%) translateY(120%);
  z-index: 60;
  background: rgba(20,20,28,.92);
  border: 1px solid var(--line);
  color: #fff;
  padding: 12px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600;
  transition: transform .25s ease;
  pointer-events: none;
  max-width: 90vw;
}#pmBoothRoot #toast.show{ transform: translateX(-50%) translateY(0); }#pmBoothRoot #loading{
  position: absolute; inset: 0; z-index: 8;
  display: none; place-items: center;
  background: rgba(0,0,0,.45);
  color: #fff; font-weight: 700; font-size: 14px;
}#pmBoothRoot #loading.on{ display: grid; }@media (min-width: 720px){#pmBoothRoot #pmBoothHome{ max-width: 480px; margin: 0 auto; }
}

#pmBoothRoot .stage {height:100%;height:100dvh;align-items:center;justify-content:center;padding:0 10px;gap:8px;}
#pmBoothRoot .stage-top,#pmBoothRoot .stage-bottom {position:relative;inset:auto;width:100%;flex:0 0 auto;background:none;max-width:640px;}
#pmBoothRoot .stage-top {padding:calc(8px + var(--safe-t)) 0 0;}
#pmBoothRoot .stage-bottom {padding:0 0 calc(10px + var(--safe-b));gap:6px;}
#pmBoothRoot .viewport {flex:none;width:min(100%,calc((100dvh - 240px - var(--safe-t) - var(--safe-b)) * .8));aspect-ratio:4/5;min-height:0;}
#pmBoothRoot .hint {margin:0;}
#pmBoothRoot .shutter {width:58px;height:58px;}
#pmBoothRoot #pmBoothShowFrame[hidden],#pmBoothRoot #pmBoothFrame[hidden] {display:none;}
#pmBoothRoot #pmBoothHome {height:100%;min-height:0;}
#pmBoothRoot button:focus-visible {outline:2px solid #be90ff;outline-offset:3px;}
#pmBoothRoot button:disabled {opacity:.4;cursor:wait;}
@media (orientation:landscape) and (max-height:600px) {
 #pmBoothRoot .stage {padding:0 180px 0 90px;}
 #pmBoothRoot .viewport {width:auto;height:calc(100dvh - 16px);}
 #pmBoothRoot .stage-top {position:absolute;left:8px;top:8px;width:76px;flex-direction:column;}
 #pmBoothRoot .stage-bottom {position:absolute;right:8px;left:auto;bottom:8px;width:160px;}
 #pmBoothRoot .controls {display:flex;flex-wrap:wrap;justify-content:center;}
}
#pmBoothRoot #sheet .card {overflow-y:auto;}
@media (orientation:landscape) and (max-height:600px) {
 #pmBoothRoot #sheet .card {display:grid;grid-template-columns:minmax(0,1fr) minmax(240px,1fr);align-items:center;margin:auto;max-width:800px;width:100%;}
 #pmBoothRoot #sheetPreview {max-height:70dvh;}
 #pmBoothRoot .sheet-actions {gap:6px;}
 #pmBoothRoot .sheet-actions button {min-height:44px;}
}

#pmBoothRoot .stage {justify-content:flex-start;}
#pmBoothRoot .viewport {flex:1 1 0;width:100%;height:auto;aspect-ratio:auto;min-height:0;}
#pmBoothRoot .stage-top,#pmBoothRoot .stage-bottom {max-width:none;}
@media (orientation:landscape) and (max-height:600px) {
 #pmBoothRoot .viewport {flex:1 1 0;width:100%;height:calc(100dvh - 16px);margin:8px 0;}
}
#pmBoothRoot .stage-top {gap:6px;}
@media (max-width:380px) {#pmBoothRoot .stage-top .chip-btn {padding:0 10px;}}

#pmBoothRoot .pm-booth-options {display:flex;justify-content:center;gap:8px;flex-wrap:wrap;}
#pmBoothRoot .stage-top {flex-wrap:wrap;}
#pmBoothRoot .stage-top .title {min-width:45px;}
#pmBoothRoot .hint {line-height:1.4;}
#pmBoothRoot .viewport {cursor:grab;}
#pmBoothRoot .viewport:active {cursor:grabbing;}
