:root { color-scheme: dark; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; width: 100%; height: 100%; background: #050505; }
body { overflow: hidden; }
button, input { font: inherit; }
.player { position: relative; width: 100%; height: 100%; min-height: 320px; overflow: hidden; background: #050505; isolation: isolate; }
.poster, .viewer-host, .shade, .gate { position: absolute; inset: 0; }
.poster {
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #101010;
  transition: opacity 500ms ease;
  pointer-events: none;
}
.viewer-host {
  z-index: 1;
  opacity: 0;
  transition: opacity 450ms ease;
  touch-action: none;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}

.viewer-host .sse-viewer { width: 100% !important; height: 100% !important; }
.viewer-host canvas {
  width: 100%;
  height: 100%;
  display: block;
  outline: 0;
  touch-action: none;
}

.player.loaded .viewer-host { opacity: 1; }
.player.loaded .poster { opacity: 0; pointer-events: none; }
.shade { z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(0,0,0,.08), transparent 24%, transparent 72%, rgba(0,0,0,.22)); opacity: 0; transition: opacity 250ms ease; }
.player.loaded .shade { opacity: 1; }
.gate { z-index: 7; display: grid; place-items: center; padding: 24px; background: linear-gradient(180deg, rgba(0,0,0,.16), rgba(0,0,0,.45)); transition: opacity 350ms ease, visibility 350ms ease; }
.player.loaded .gate { opacity: 0; visibility: hidden; pointer-events: none; }
.gate-card { max-width: 420px; padding: 24px 26px 26px; border: 1px solid rgba(255,255,255,.18); border-radius: 18px; background: rgba(12,12,12,.78); backdrop-filter: blur(14px); box-shadow: 0 18px 55px rgba(0,0,0,.25); text-align: center; }
.eyebrow { margin-bottom: 7px; font-size: 11px; font-weight: 800; letter-spacing: .16em; opacity: .72; }
h1 { margin: 0 0 10px; font-size: clamp(24px, 4vw, 34px); line-height: 1.05; }
.gate p { margin: 0 0 18px; color: rgba(255,255,255,.78); line-height: 1.45; }
.primary, .pill-button, .text-button { border: 1px solid rgba(255,255,255,.2); color: white; background: rgba(255,255,255,.12); border-radius: 999px; min-height: 42px; padding: 0 16px; cursor: pointer; }
.primary { background: white; color: #111; border-color: white; font-weight: 700; }
.progress { display: inline-flex; align-items: center; gap: 10px; color: rgba(255,255,255,.82); font-size: 14px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); border-top-color: white; animation: spin 850ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.compat { position: absolute; left: 50%; bottom: 72px; z-index: 9; transform: translateX(-50%); max-width: min(560px, calc(100% - 32px)); padding: 10px 14px; border-radius: 10px; background: rgba(0,0,0,.78); font-size: 13px; text-align: center; }
.controls { position: absolute; z-index: 6; left: 14px; right: 14px; bottom: 14px; display: flex; justify-content: space-between; align-items: flex-end; pointer-events: none; opacity: 0; transform: translateY(5px); transition: opacity 200ms ease, transform 200ms ease; }
.player.loaded .controls.visible { opacity: 1; transform: translateY(0); }
.controls-left, .controls-right { display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.icon-button, .pill-button { border: 1px solid rgba(255,255,255,.16); background: rgba(16,16,16,.66); color: white; backdrop-filter: blur(10px); }
.icon-button { width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border-radius: 50%; cursor: pointer; }
.icon-button:hover, .pill-button:hover, .icon-button:focus-visible, .pill-button:focus-visible { background: rgba(38,38,38,.86); border-color: rgba(255,255,255,.34); }
.icon { width: 21px; height: 21px; fill: currentColor; }
.play-icon { display: none; }
.player.paused .pause-icon { display: none; }
.player.paused .play-icon { display: block; }
.exit-fullscreen { display: none; }
.player.fullscreen .enter-fullscreen { display: none; }
.player.fullscreen .exit-fullscreen { display: block; }
.floating-panel { position: absolute; z-index: 8; right: 14px; bottom: 68px; border: 1px solid rgba(255,255,255,.16); border-radius: 14px; background: rgba(14,14,14,.88); backdrop-filter: blur(14px); color: white; box-shadow: 0 16px 44px rgba(0,0,0,.28); }
.help { max-width: 390px; padding: 14px 15px; }
.help p { margin: 7px 0 0; color: rgba(255,255,255,.73); font-size: 13px; line-height: 1.5; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.text-button { min-height: 32px; padding: 0 11px; font-size: 12px; }
.settings-panel { width: min(380px, calc(100% - 28px)); max-height: min(78vh, 720px); overflow: auto; padding: 15px; overscroll-behavior: contain; }
.settings-panel h2 { margin: 0 0 10px; font-size: 13px; font-weight: 750; color: rgba(255,255,255,.88); }
.meta-line { margin-top: 7px; color: rgba(255,255,255,.58); font-size: 11px; line-height: 1.4; }
.settings-section { margin-top: 14px; padding-top: 13px; border-top: 1px solid rgba(255,255,255,.12); }
.setting-row { margin: 10px 0 12px; }
.setting-row label { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: rgba(255,255,255,.78); font-size: 12px; }
.setting-row output { color: white; font-variant-numeric: tabular-nums; }
.setting-row input[type="range"] { width: 100%; accent-color: white; }
.setting-switch { margin: 8px 0; color: rgba(255,255,255,.78); font-size: 12px; }
.setting-switch input { vertical-align: -1px; margin-right: 7px; accent-color: white; }
.setting-row.unsupported, .setting-switch.unsupported { opacity: .35; }
.subtle { font-weight: 500; color: rgba(255,255,255,.45); }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.settings-actions .pill-button { min-height: 36px; padding: 0 12px; font-size: 12px; }
.settings-note { margin: 12px 0 0; color: rgba(255,255,255,.48); font-size: 10.5px; line-height: 1.45; }
.status-stack { position: absolute; z-index: 5; right: 15px; top: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; pointer-events: none; opacity: 0; transition: opacity 250ms ease; }
.player.loaded .status-stack { opacity: 1; }
.version-badge, .perf-badge { padding: 4px 7px; border-radius: 7px; background: rgba(0,0,0,.38); color: rgba(255,255,255,.62); font-size: 10px; line-height: 1.2; letter-spacing: .02em; font-variant-numeric: tabular-nums; backdrop-filter: blur(7px); }
.perf-badge { color: rgba(255,255,255,.78); }
.noscript { position: fixed; inset: auto 12px 12px; padding: 12px; background: #111; color: white; z-index: 20; }
@media (pointer: coarse), (max-width: 760px) {
  .desktop-only { display: none !important; }
  .gate-card { padding: 21px 20px 22px; }

  /* Mobile keeps the essential transport UI permanently available:
     Play/Pause + tour selector + scrubber + fullscreen. */
  .controls {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    gap: 8px;
    align-items: flex-end;
  }
  .controls-left {
    min-width: 0;
    flex: 1 1 auto;
  }
  .controls-right {
    flex: 0 0 auto;
  }
  .transport-block {
    min-width: 0 !important;
    width: 100%;
  }
  .transport-main {
    width: 100%;
    min-width: 0;
  }
  .transport-path {
    flex: 1 1 auto;
    min-width: 0;
  }
  .transport-path select {
    width: 100%;
    max-width: none !important;
    min-width: 0;
    font-size: 12px;
  }
  .tour-scrubber {
    width: 100%;
    padding-right: 1px;
  }

  .floating-panel { right: 10px; bottom: 64px; }
  .settings-panel { width: calc(100% - 20px); max-height: 62vh; }
  .status-stack { right: 10px; top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

.postfx-defs { position: fixed; width: 0; height: 0; overflow: hidden; pointer-events: none; }
.settings-section-first { border-top: 0; padding-top: 0; }
.setting-select { display: grid; gap: 6px; margin: 10px 0 12px; }
.setting-select label { color: rgba(255,255,255,.78); font-size: 12px; }
.setting-select select { width: 100%; min-height: 36px; border: 1px solid rgba(255,255,255,.14); border-radius: 9px; background: rgba(255,255,255,.07); color: white; padding: 0 10px; }
.setting-select select option { background: #1b1b1b; color: white; }
.setting-hint { color: rgba(255,255,255,.46); font-size: 10.5px; line-height: 1.35; }
.setting-switch.emphasized { padding: 8px 9px; border: 1px solid rgba(255,255,255,.10); border-radius: 10px; background: rgba(255,255,255,.035); }
.backend-settings[hidden], [hidden] { display: none !important; }

/* v0.21 interaction hint + isolated prototypes */
.control-hint {
  position: absolute; z-index: 5; left: 50%; bottom: 76px; transform: translateX(-50%);
  max-width: calc(100% - 40px); padding: 8px 12px; border-radius: 999px;
  background: rgba(0,0,0,.52); border: 1px solid rgba(255,255,255,.13);
  color: rgba(255,255,255,.83); font-size: 12px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .35s ease, transform .35s ease;
  backdrop-filter: blur(8px);
}
.player.loaded .control-hint { opacity: 1; }
.control-hint.soft { opacity: .38 !important; transform: translateX(-50%) translateY(3px); }
.control-hint.dismissed { opacity: 0 !important; }
.experimental-section { border-top-color: rgba(150,190,255,.22); }
.experiment-intro { margin-bottom: 10px; }
.experiment-card { margin: 9px 0; padding: 10px; border: 1px dashed rgba(160,195,255,.18); border-radius: 10px; background: rgba(100,145,220,.035); }
.experiment-card > strong { display: block; margin-bottom: 5px; font-size: 12px; color: rgba(220,234,255,.92); }
.experiment-card .setting-row { margin-bottom: 7px; }
.photo-spots { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.photo-spots .pill-button { min-height: 32px; padding: 0 10px; font-size: 11px; }
@media (pointer: coarse), (max-width:760px) {
  .control-hint { bottom: 68px; font-size: 11px; white-space: normal; text-align: center; }
}

/* v26.19 UI cleanup */
.sr-only { position:absolute!important; width:1px!important; height:1px!important; padding:0!important; margin:-1px!important; overflow:hidden!important; clip:rect(0,0,0,0)!important; white-space:nowrap!important; border:0!important; }
.transport-path select { min-height: 40px; max-width: min(300px, 42vw); border:1px solid rgba(255,255,255,.16); border-radius:22px; background:rgba(16,16,16,.66); color:#fff; backdrop-filter:blur(10px); padding:0 34px 0 14px; font:inherit; cursor:pointer; }
.transport-path select:hover,.transport-path select:focus-visible { background:rgba(38,38,38,.86); border-color:rgba(255,255,255,.34); outline:none; }
.settings-panel .settings-section:first-of-type { border-top:0; padding-top:2px; }
.settings-panel .emphasized-note { margin:6px 0 10px; }
@media (max-width: 700px) { .transport-path select { max-width: 48vw; font-size:12px; } }

/* v26.20 transport scrubber */
.transport-block { display:flex; flex-direction:column; align-items:stretch; gap:5px; min-width:min(390px,55vw); }
.transport-main { display:flex; align-items:center; gap:8px; }
.tour-scrubber { display:grid; grid-template-columns:minmax(120px,1fr) auto; align-items:center; gap:8px; padding:0 4px 0 5px; }
.tour-scrubber input[type="range"] { width:100%; height:12px; margin:0; accent-color:white; cursor:pointer; }
.tour-scrubber output { min-width:66px; color:rgba(255,255,255,.64); font-size:10px; font-variant-numeric:tabular-nums; text-align:right; }
@media (max-width:700px) {
  .transport-block { min-width:min(310px,68vw); }
  .tour-scrubber output { display:none; }
  .tour-scrubber { grid-template-columns:1fr; }
}


/* v26.23 poster-first lazy launch */
.launch-gate {
  background: linear-gradient(180deg, rgba(0,0,0,.08), rgba(0,0,0,.30));
}
.launch-card {
  width: min(440px, calc(100% - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.launch-title {
  padding: 12px 18px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: rgba(0,0,0,.38);
  backdrop-filter: blur(8px);
  text-shadow: 0 2px 14px rgba(0,0,0,.55);
}
.launch-title h1 { margin-bottom: 0; }

.launch-play {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(255,255,255,.92);
  border-radius: 50%;
  background: rgba(0,0,0,.48);
  color: white;
  box-shadow: 0 12px 38px rgba(0,0,0,.38);
  backdrop-filter: blur(10px);
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.launch-play svg {
  width: 42px;
  height: 42px;
  fill: currentColor;
  transform: translateX(3px);
}
.launch-play:hover,
.launch-play:focus-visible {
  transform: scale(1.07);
  background: rgba(0,0,0,.68);
  box-shadow: 0 15px 46px rgba(0,0,0,.46);
}
.launch-play:active { transform: scale(.98); }

.launch-label {
  margin-top: 12px;
  padding: 6px 11px;
  border-radius: 999px;
  background: rgba(0,0,0,.45);
  color: white;
  font-weight: 700;
  font-size: 14px;
  backdrop-filter: blur(8px);
}
.launch-copy {
  max-width: 390px;
  margin-top: 12px !important;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(0,0,0,.34);
  font-size: 12px;
  backdrop-filter: blur(8px);
}
.launch-gate.launching .launch-card {
  padding: 24px 26px 26px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 18px;
  background: rgba(12,12,12,.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 55px rgba(0,0,0,.25);
}
.launch-gate.launching .launch-title { background: transparent; padding: 0; margin-bottom: 10px; }
.launch-gate.launching .launch-copy { background: transparent; padding: 0; margin-top: 0 !important; }

@media (max-width: 600px) {
  .launch-play { width: 82px; height: 82px; }
  .launch-play svg { width: 37px; height: 37px; }
  .launch-title { margin-bottom: 14px; }
}


/* v26.26: robust compact controls for touch/mobile iframe embeds.
   JS adds .mobile-ui so this does not depend on iframe media-query quirks. */
.player.mobile-ui.loaded .controls {
  opacity: 1 !important;
  transform: none !important;
  display: flex !important;
  visibility: visible !important;
  left: 8px;
  right: 8px;
  bottom: max(8px, env(safe-area-inset-bottom));
  gap: 8px;
  align-items: flex-end;
}

.player.mobile-ui .desktop-only {
  display: none !important;
}

.player.mobile-ui .controls-left {
  min-width: 0;
  flex: 1 1 auto;
}

.player.mobile-ui .controls-right {
  flex: 0 0 auto;
}

.player.mobile-ui .transport-block {
  min-width: 0 !important;
  width: 100%;
}

.player.mobile-ui .transport-main {
  width: 100%;
  min-width: 0;
}

.player.mobile-ui .transport-path {
  flex: 1 1 auto;
  min-width: 0;
}

.player.mobile-ui .transport-path select {
  width: 100%;
  max-width: none !important;
  min-width: 0;
  font-size: 12px;
}

.player.mobile-ui .tour-scrubber {
  width: 100%;
  padding-right: 1px;
}

/* Keep the essential mobile controls comfortably tappable. */
.player.mobile-ui #play-button,
.player.mobile-ui #fullscreen-button {
  flex: 0 0 44px;
}

.player.mobile-ui #tour-progress {
  min-height: 22px;
  touch-action: pan-x;
}


/* v26.27: portrait/short-iframe correction.
   The player used to enforce 320px minimum height, which made a ~200px-tall
   16:9 iframe on a portrait phone clip its bottom controls. */
.player.mobile-ui {
  min-height: 0 !important;
  height: 100% !important;
}

@media (max-width: 760px), (pointer: coarse), (any-pointer: coarse) {
  .player {
    min-height: 0 !important;
  }
}

/* Compact launch/loading card for very short portrait embeds. */
@media (max-height: 300px) {
  .gate { padding: 6px; }

  .gate-card,
  .launch-card {
    max-width: min(350px, calc(100% - 12px));
    padding: 8px 12px 9px;
    border-radius: 12px;
  }

  .launch-title .eyebrow {
    margin-bottom: 2px;
    font-size: 8px;
  }

  .launch-title h1,
  .gate h1 {
    margin-bottom: 4px;
    font-size: 18px;
  }

  .launch-play {
    width: 48px;
    height: 48px;
  }

  .launch-play svg {
    width: 22px;
    height: 22px;
  }

  .launch-label {
    margin-top: 3px;
    font-size: 10px;
  }

  .launch-copy,
  .gate p {
    margin-top: 4px;
    margin-bottom: 5px;
    font-size: 10px;
    line-height: 1.2;
  }

  .progress {
    gap: 6px;
    font-size: 10px;
  }

  .spinner {
    width: 12px;
    height: 12px;
  }
}

/* Mobile movement thumbstick. Hidden everywhere except the active touch UI. */
.move-stick {
  display: none;
  position: absolute;
  z-index: 7;
  left: 10px;
  top: 10px;
  width: 82px;
  height: 82px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: auto;
}

.player.mobile-ui.loaded .move-stick {
  display: block;
}

.move-stick-base {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.24);
  background: rgba(12,12,12,.30);
  backdrop-filter: blur(5px);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}

.move-stick-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34px;
  height: 34px;
  margin-left: -17px;
  margin-top: -17px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.40);
  background: rgba(245,245,245,.68);
  box-shadow: 0 3px 12px rgba(0,0,0,.28);
  transform: translate(0,0);
  will-change: transform;
}

/* Leave a little more breathing room around the bottom controls in short embeds. */
@media (max-height: 300px) {
  .player.mobile-ui.loaded .controls {
    left: 5px;
    right: 5px;
    bottom: 4px;
    gap: 5px;
  }

  .player.mobile-ui .icon-button {
    width: 38px;
    height: 38px;
  }

  .player.mobile-ui #play-button,
  .player.mobile-ui #fullscreen-button {
    flex-basis: 38px;
  }

  .player.mobile-ui .transport-path select {
    height: 38px;
    font-size: 11px;
  }

  .player.mobile-ui .tour-scrubber {
    margin-top: 1px;
  }

  .player.mobile-ui #tour-progress {
    min-height: 16px;
  }

  .player.mobile-ui #tour-time-label {
    font-size: 9px;
  }

  .move-stick {
    left: 7px;
    top: 7px;
    width: 68px;
    height: 68px;
  }

  .move-stick-knob {
    width: 28px;
    height: 28px;
    margin-left: -14px;
    margin-top: -14px;
  }
}
