/* PURE 360 viewer — skin modelled on the group's existing Pano2VR tour layout */
:root {
  --p360-ui: #ffffff;
  --p360-box-bg: rgba(0, 0, 0, 0.5);
  --p360-box-border: rgba(255, 255, 255, 0.5);
  --p360-font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --p360-icon: 50px;
  --p360-icon-gap: -10px;
  --p360-safe-b: env(safe-area-inset-bottom, 0px);
  --p360-safe-t: env(safe-area-inset-top, 0px);
  --p360-safe-l: env(safe-area-inset-left, 0px);
  --p360-safe-r: env(safe-area-inset-right, 0px);
}
html, body { height: 100%; }
body.p360-body { margin: 0; background: #000; color: var(--p360-ui); font-family: var(--p360-font); overflow: hidden; -webkit-text-size-adjust: 100%; }
.p360 { position: fixed; inset: 0; background: #000; overflow: hidden; touch-action: none; }
.p360 * { box-sizing: border-box; }
.p360 [hidden] { display: none !important; }
.p360 #panorama { position: absolute; inset: 0; }
.p360 .pnlm-container { background: #000; }
/* Pannellum's own chrome is replaced by the skin below */
.p360 .pnlm-load-box, .p360 .pnlm-controls-container, .p360 .pnlm-compass, .p360 .pnlm-panorama-info { display: none !important; }
.p360 .pnlm-info-box, .p360 .pnlm-error-msg { font-family: var(--p360-font); font-size: 13px; border-radius: 10px; }

.p360-ui { position: absolute; inset: 0; pointer-events: none; }
.p360-ui > * { pointer-events: auto; }
.p360-ui button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.p360-ui button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 50%; }

/* Logo (top-left, links to the official website) */
.p360-logo { position: absolute; top: calc(var(--p360-safe-t) + 18px); left: calc(var(--p360-safe-l) + 20px); display: block; padding: 14px 17px; line-height: 0; text-decoration: none; background: transparent; }
.p360-logo .pure-brandmark { --brand-size: 108px; }
.p360-logo:hover { opacity: .9; }
.p360-logo:focus-visible { outline: 2px solid #bd9a69; outline-offset: 3px; }

/* Top-right: scene pill + sound toggle */
.p360-topright { position: absolute; top: calc(var(--p360-safe-t) + 12px); right: calc(var(--p360-safe-r) + 12px); display: flex; align-items: center; gap: 8px; }
.p360-ui .p360-pill { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px 0 14px; border-radius: 16px; background: var(--p360-box-bg); border: 1px solid var(--p360-box-border); color: #fff; font-size: 13px; letter-spacing: .02em; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); white-space: nowrap; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }
.p360-pill .p360-num { font-variant-numeric: tabular-nums; opacity: .85; }
.p360-pill .p360-caret { width: 10px; height: 10px; transition: transform .2s; flex: none; }
.p360-pill[aria-expanded="true"] .p360-caret { transform: rotate(180deg); }
.p360-ui .p360-iconbtn { width: 32px; height: 32px; border-radius: 50%; background: var(--p360-box-bg); border: 1px solid var(--p360-box-border); display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.p360-iconbtn svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Scene thumbnails (hidden until the pill is tapped) */
.p360-thumbs { position: absolute; left: 0; right: 0; bottom: calc(var(--p360-safe-b) + 15px + 60px + 10px); display: flex; gap: 10px; padding: 8px 16px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; justify-content: safe center; -webkit-overflow-scrolling: touch; }
.p360-thumbs::-webkit-scrollbar { display: none; }
.p360-ui .p360-thumb { flex: none; width: 128px; border-radius: 8px; overflow: hidden; background: #111; border: 2px solid transparent; opacity: .82; transition: opacity .15s, border-color .15s, transform .15s; text-align: left; }
.p360-thumb img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.p360-thumb span { display: block; padding: 5px 8px 6px; font-size: 12px; line-height: 1.2; color: #fff; background: rgba(0,0,0,.6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p360-thumb:hover { opacity: 1; }
.p360-thumb[aria-current="true"] { opacity: 1; border-color: #fff; }

/* Bottom control bar — same 8 buttons and geometry as the reference skin */
.p360-bar { position: absolute; left: 50%; bottom: calc(var(--p360-safe-b) + 15px); transform: translateX(-50%); height: 60px; display: flex; align-items: center; padding: 0 8px; }
.p360-bar .p360-btn { width: var(--p360-icon); height: var(--p360-icon); margin-right: var(--p360-icon-gap); position: relative; display: inline-flex; align-items: center; justify-content: center; transition: transform .12s; }
.p360-bar .p360-btn:last-child { margin-right: 0; }
.p360-bar .p360-btn svg { width: 100%; height: 100%; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 1.5px rgba(0,0,0,.65)) drop-shadow(0 0 1px rgba(0,0,0,.35)); }
.p360-bar .p360-btn svg .fill { fill: #fff; stroke: none; }
.p360-bar .p360-btn:hover, .p360-bar .p360-btn:active { transform: scale(1.1); }
.p360-bar .p360-btn[aria-pressed="true"] svg circle.ring { fill: rgba(255,255,255,.22); }
.p360-bar .p360-btn[disabled] { opacity: .35; cursor: default; transform: none; }
.p360-tip { position: absolute; left: 50%; top: 100%; transform: translateX(-50%); margin-top: -4px; font-size: 12px; line-height: 18px; white-space: nowrap; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000, 0 1px 2px rgba(0,0,0,.8); opacity: 0; transition: opacity .15s; pointer-events: none; }
.p360-tip.show { opacity: 1; }

/* Boxes: loading + info — black 50% with a white 50% border, 10px radius */
.p360-box { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--p360-box-bg); border: 2px solid var(--p360-box-border); border-radius: 10px; color: #fff; }
.p360-loading { width: 210px; height: 60px; padding: 12px 15px 0 16px; margin-top: -0px; }
.p360-loading .p360-ltext { font-size: 13px; font-weight: 700; line-height: 18px; white-space: nowrap; }
.p360-loading .p360-lbar { margin-top: 5px; height: 12px; width: 181px; }
.p360-loading .p360-lbar-fill { height: 100%; width: 100%; background: #fff; border: 1px solid #808080; border-radius: 5px; transform-origin: 0 50%; transform: scaleX(0.02); transition: transform .15s linear; }
.p360-info { width: min(300px, calc(100vw - 32px)); min-height: 140px; margin-top: -10px; padding: 10px 12px 12px; cursor: pointer; }
.p360-info .p360-title { font-weight: 700; font-size: 15px; line-height: 20px; margin: 0 0 4px; }
.p360-info .p360-row { font-size: 13px; line-height: 20px; opacity: .95; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p360-info .p360-row.wrap { white-space: normal; }
.p360-info .p360-copy { margin-top: 10px; font-size: 12px; line-height: 16px; opacity: .8; }
.p360-info a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }

/* Move-mode capture layer */
.p360-movelayer { position: absolute; inset: 0; cursor: crosshair; }

/* Passcode gate */
.p360-gate { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.72); }
.p360-gate form { width: min(320px, calc(100vw - 32px)); background: var(--p360-box-bg); border: 2px solid var(--p360-box-border); border-radius: 10px; padding: 18px 18px 16px; display: grid; gap: 10px; }
.p360-gate h2 { margin: 0; font-size: 16px; font-weight: 700; }
.p360-gate p { margin: 0; font-size: 13px; opacity: .85; }
.p360-gate input { width: 100%; height: 40px; border-radius: 8px; border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.4); color: #fff; padding: 0 12px; font: inherit; font-size: 16px; letter-spacing: .1em; }
.p360-gate button { height: 40px; border-radius: 8px; background: #fff; color: #000; font-weight: 700; }
.p360-gate .p360-err { color: #ffb4a8; font-size: 13px; min-height: 18px; }

/* Start overlay used when the browser blocks autoplay of music */
.p360-hint { position: absolute; left: 50%; bottom: calc(var(--p360-safe-b) + 90px); transform: translateX(-50%); font-size: 12px; color: #fff; background: var(--p360-box-bg); border: 1px solid var(--p360-box-border); border-radius: 14px; padding: 4px 12px; opacity: 0; transition: opacity .3s; pointer-events: none; white-space: nowrap; }
.p360-hint.show { opacity: 1; }

@media (max-width: 640px) {
  :root { --p360-icon: 44px; --p360-icon-gap: -8px; }
  .p360-logo { top: calc(var(--p360-safe-t) + 12px); left: calc(var(--p360-safe-l) + 12px); padding: 10px 12px; }
  .p360-logo .pure-brandmark { --brand-size: 78px; }
  .p360-bar { bottom: calc(var(--p360-safe-b) + 12px); }
  .p360-thumbs { bottom: calc(var(--p360-safe-b) + 12px + 60px + 4px); }
  .p360-ui .p360-thumb { width: 108px; }
  .p360-tip { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .p360 * { transition: none !important; }
}

.p360-pill .p360-name { overflow: hidden; text-overflow: ellipsis; }
@media (max-width:640px) { .p360-topright { top: calc(var(--p360-safe-t) + 14px); } }

.p360 #panorama { cursor: grab; }
.p360 #panorama:active { cursor: grabbing; }
.p360-gesture-help { position:absolute; bottom:calc(var(--p360-safe-b) + 73px); left:50%; transform:translateX(-50%); font-size:12px; color:#fff; text-shadow:0 1px 3px #000; opacity:.8; white-space:nowrap; pointer-events:none; }
@media (pointer:coarse) { .p360-gesture-help {display:none;} }
