* { box-sizing: border-box; }
:root { color-scheme: dark; font-family: Arial, sans-serif; background: #151d1b; color: #edf2e9; }
body { margin: 0; }
[hidden] { display: none !important; }
.viewer { height: 100vh; height: 100svh; display: grid; grid-template-rows: minmax(0, 1fr) auto; overflow: hidden; }
.stage { position: relative; min-height: 0; overflow: hidden; background: #1c2522; }
.stage::after { content: ''; position: absolute; inset: 0 0 auto; height: 165px; background: linear-gradient(#101c1870, transparent); pointer-events: none; }
#canvas-host, #fallback { position: absolute; inset: 0; }
canvas { display: block; width: 100%; height: 100%; }
.tour-heading { position: absolute; top: 32px; left: 36px; max-width: calc(100% - 225px); pointer-events: none; z-index: 1; text-shadow: 0 2px 12px #102018; }
.tour-heading > span { font-size: 10px; letter-spacing: .18em; color: #b3c2b9; }
.tour-heading h1 { font-size: 42px; font-weight: 400; margin: 10px 0 7px; letter-spacing: -.04em; }
.tour-heading p { color: #bac8bf; font-size: 13px; margin: 0; line-height: 1.5; }
.controls { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 16px 24px max(16px, env(safe-area-inset-bottom)); background: #101713; }
.controls button, .controls a { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 48px; padding: 12px 20px; border: 1px solid #4b5b4b; border-radius: 6px; color: #e7eee2; background: #202b21; font: 500 14px Arial, sans-serif; text-decoration: none; white-space: nowrap; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.controls button:hover, .controls a:hover { background: #2d3b2c; border-color: #849b79; }
.controls button:focus-visible, .controls a:focus-visible, #seek:focus-visible { outline: 2px solid #b9ee73; outline-offset: 4px; }
.controls button:disabled, #seek:disabled { opacity: .4; cursor: default; }
.controls svg { width: 18px; height: 18px; fill: currentColor; }
#play { min-width: 112px; background: #b9ee73; color: #17220f; border-color: #b9ee73; }
#play:hover { background: #cbff8f; }
#order, #exit { position: fixed; right: max(20px, env(safe-area-inset-right)); z-index: 20; box-shadow: 0 8px 18px #0004; }
#order { top: max(16px, env(safe-area-inset-top)); }
#exit { top: calc(max(16px, env(safe-area-inset-top)) + 56px); background: #172019; border-color: #667766; }
#seek { flex: 1; max-width: 720px; min-width: 0; height: 48px; margin: 0; accent-color: #b9ee73; cursor: pointer; }
.scene-note { position: absolute; right: 32px; bottom: 24px; display: flex; align-items: center; gap: 16px; max-width: min(470px, calc(100% - 40px)); background: #17231feF; padding: 15px 20px; border: 1px solid #81948930; border-radius: 8px; font-size: 17px; line-height: 1.45; pointer-events: none; }
#scene-note-title, #scene-note-detail { display: block; text-wrap: balance; }
#scene-note-detail { color: #b1beb4; font-size: 13px; margin-top: 5px; }
.note-line { width: 30px; height: 1px; flex: 0 0 30px; background: #9daa9b; }
.note-line::before { content: ''; display: block; width: 5px; height: 5px; border-radius: 50%; background: #b9ee73; transform: translateY(-2px); }
#fallback { display: grid; place-items: center; background: #151d1b; }
#fallback img { width: 85%; height: 70%; object-fit: contain; }
#fallback p, .no-script { position: absolute; bottom: 20px; margin: 16px; padding: 16px; background: #172019; }
@media (max-width: 600px) {
  .tour-heading { top: 22px; left: 18px; max-width: calc(100% - 140px); }
  .tour-heading h1 { font-size: 30px; margin-top: 8px; }
  .tour-heading > span { font-size: 8px; letter-spacing: .12em; }
  .tour-heading p { font-size: 11px; }
  .controls { gap: 12px; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); }
  .controls button, .controls a { padding: 12px 10px; font-size: 12px; }
  #play { min-width: 78px; }
  #order, #exit { right: max(12px, env(safe-area-inset-right)); }
  #order { top: max(10px, env(safe-area-inset-top)); }
  #exit { top: calc(max(10px, env(safe-area-inset-top)) + 56px); }
  .scene-note { left: 12px; right: 12px; bottom: 18px; max-width: none; padding: 12px; font-size: 14px; gap: 10px; }
  #scene-note-detail { font-size: 12px; }
  .note-line { width: 18px; flex-basis: 18px; }
}
@media (max-height: 500px) and (min-width: 601px) {
  .tour-heading { top: 16px; left: 20px; }
  .tour-heading h1 { font-size: 26px; margin: 5px 0; }
  .scene-note { max-width: 350px; right: 20px; bottom: 12px; font-size: 14px; padding: 10px 14px; }
  #scene-note-detail { font-size: 11px; }
  .controls { padding-block: 6px; }
}
