:root {
  --bg: #05070d;
  --fg: #e8f3ff;
  --accent: #29c4ff;
  --muted: #8aa0b8;
  --bar-h: 64px;
  --top-h: 44px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden; overscroll-behavior: none; }

.topbar { position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  height: calc(var(--top-h) + var(--safe-t)); padding: var(--safe-t) 14px 0;
  display: flex; align-items: center; pointer-events: none;
  background: linear-gradient(to bottom, rgba(5,7,13,.85), rgba(5,7,13,0)); }
.brand { font-size: 15px; letter-spacing: .02em; }
.brand b { color: var(--accent); letter-spacing: .08em; }
.brand span { color: var(--muted); font-size: 12px; margin-left: 6px; }

main { position: fixed; z-index: 1; inset: 0 0 calc(var(--bar-h) + var(--safe-b)) 0; }
.view { position: absolute; inset: 0; visibility: hidden; }
.view.active { visibility: visible; }

.zones-btn { pointer-events: auto; margin-left: auto; border: 1px solid #2a3a50; border-radius: 16px;
  background: rgba(11,16,25,.75); color: var(--fg); font: inherit; font-size: 13px; padding: 5px 12px; cursor: pointer; }
.zones-btn small { color: var(--muted); font-size: 10px; }
.zones { position: fixed; z-index: 40; top: 0; right: 0; bottom: 0; width: min(82vw, 320px);
  padding-top: var(--safe-t); background: rgba(8,12,20,.96); border-left: 1px solid #1b2636;
  transform: translateX(100%); transition: transform .25s ease; display: flex; flex-direction: column; }
.zones.open { transform: none; }
.zones-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; font-size: 15px; border-bottom: 1px solid #1b2636; }
.zones-head button { border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
.zones ul { list-style: none; margin: 0; padding: 6px 0; overflow-y: auto; }
.zones li { padding: 11px 16px; border-bottom: 1px solid #111a28; cursor: pointer; display: grid; grid-template-columns: 1fr auto; row-gap: 2px; }
.zones li b { font-weight: 500; }
.zones li small { grid-column: 1; color: var(--muted); font-size: 11px; }
.zones li span { grid-column: 2; grid-row: 1 / span 2; align-self: center; color: var(--accent); font-size: 11px; }
.zones li:active { background: #111a28; }
.zones li .zone-hd { grid-column: 1 / span 2; justify-self: start; margin-top: 6px; padding: 4px 10px;
  border: 1px solid rgba(41,196,255,.6); border-radius: 12px; background: rgba(41,196,255,.12);
  color: #bfe9ff; font-size: 12px; cursor: pointer; }

/* magnifier pins on lightboxes that have full-res artwork */
.detail-pin { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: rgba(5,7,13,.72); border: 1.5px solid rgba(41,196,255,.85); color: #fff;
  font-size: 18px; line-height: 1; cursor: pointer; box-shadow: 0 0 0 0 rgba(41,196,255,.6);
  animation: pin-pulse 2.4s infinite; }
@keyframes pin-pulse { 0% { box-shadow: 0 0 0 0 rgba(41,196,255,.55); } 70%, 100% { box-shadow: 0 0 0 10px rgba(41,196,255,0); } }

/* "view panels" button shown after framing a wall with artwork */
#detail-btn { position: fixed; z-index: 25; left: 50%; bottom: 118px; transform: translate(-50%, 12px);
  padding: 10px 18px; border-radius: 22px; border: 1px solid rgba(41,196,255,.8);
  background: rgba(8,20,36,.9); color: #fff; font-size: 14px; cursor: pointer; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#detail-btn.show { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#detail-btn b { color: var(--accent); margin-right: 4px; }
#detail-btn small { color: var(--muted); font-size: 11px; margin-left: 4px; }
body.lb-open #detail-btn { opacity: 0; pointer-events: none; }

/* full-res detail viewer */
#lightbox { position: fixed; inset: 0; z-index: 60; background: #04060b; display: flex; flex-direction: column; }
#lightbox[hidden] { display: none; }
.lb-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); color: #fff; }
.lb-top b { font-weight: 500; font-size: 15px; }
.lb-top span { color: var(--muted); font-size: 12px; }
.lb-top button { margin-left: auto; border: 0; background: none; color: #fff; font-size: 22px; cursor: pointer; padding: 4px 8px; }
.lb-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: zoom-in; }
.lb-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain;
  transform-origin: center; user-select: none; -webkit-user-select: none; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 64px; border: 0;
  background: rgba(5,7,13,.6); color: #fff; font-size: 30px; cursor: pointer; border-radius: 8px;
  border: 1px solid rgba(255,255,255,.2); }
#lb-prev { left: 8px; } #lb-next { right: 8px; }
.lb-thumbs { display: flex; gap: 6px; padding: 8px 10px; overflow-x: auto; justify-content: center; }
.lb-thumbs button { flex: none; padding: 0; border: 2px solid transparent; border-radius: 4px; background: none; cursor: pointer; opacity: .55; }
.lb-thumbs button.on { border-color: var(--accent); opacity: 1; }
.lb-thumbs img { display: block; height: 58px; width: auto; border-radius: 2px; }
.lb-hint { text-align: center; color: var(--muted); font-size: 11px; padding: 0 10px calc(8px + env(safe-area-inset-bottom)); }

.zones-btn + .zones-btn { margin-left: 8px; }

/* opening screen: the invitation poster over a blurred copy of itself (fits any screen shape) */
.intro { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; padding: max(16px, env(safe-area-inset-top)) 12px max(20px, env(safe-area-inset-bottom));
  background: #040c22; overflow: hidden; transition: opacity .45s ease, visibility .45s; }
.intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-bg { position: absolute; inset: -60px; background: url(intro/poster.webp) center / cover no-repeat;
  filter: blur(28px) brightness(.45) saturate(1.2); }
.intro-poster { position: relative; display: block; max-width: min(100%, 760px); max-height: calc(100% - 96px); width: auto; height: auto;
  object-fit: contain; border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.6), 0 0 0 1px rgba(95,212,255,.35); }
.intro-enter { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 12px 34px; border: 1px solid rgba(160,230,255,.9); border-radius: 30px; cursor: pointer;
  background: linear-gradient(180deg, #2fb8ff, #0b6fd6); color: #fff; font-size: 17px; font-weight: 600; letter-spacing: 1px;
  box-shadow: 0 0 0 0 rgba(41,196,255,.6), 0 6px 20px rgba(11,111,214,.5); animation: enter-pulse 2.2s infinite; }
.intro-enter small { font-size: 11px; font-weight: 400; opacity: .85; letter-spacing: 0; }
@keyframes enter-pulse { 0% { box-shadow: 0 0 0 0 rgba(41,196,255,.55), 0 6px 20px rgba(11,111,214,.5); }
  70%, 100% { box-shadow: 0 0 0 16px rgba(41,196,255,0), 0 6px 20px rgba(11,111,214,.5); } }
@media (orientation: landscape) and (max-height: 500px) {
  .intro { flex-direction: row; gap: 24px; }
  .intro-poster { max-height: 100%; max-width: calc(100% - 220px); }
}
@media (max-width: 480px) {
  .brand span, .zones-btn small { display: none; }
  .plan-head { flex-wrap: wrap; row-gap: 2px; }
  .plan-legend { order: 3; width: 100%; }
}

/* floor plan panel (slides down under the top bar) */
.plan { position: fixed; z-index: 19;  /* under the top bar (20) so its buttons stay usable */ left: 0; right: 0; top: 0; padding-top: 44px;
  background: radial-gradient(ellipse at 50% 35%, #0e2c62 0%, #08193f 55%, #040c22 100%);
  border-bottom: 1px solid rgba(80,200,255,.5); box-shadow: 0 10px 30px rgba(0,0,0,.55), 0 1px 14px rgba(41,170,255,.35);
  transform: translateY(-105%); transition: transform .3s ease; }
.plan.open { transform: none; }
.plan-head { display: flex; align-items: center; gap: 12px; padding: 8px 14px; font-size: 14px; color: #fff; }
.plan-legend { color: var(--muted); font-size: 11px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.plan-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 6px; }
.plan-legend i.in { background: #29c4ff; } .plan-legend i.out { background: #ffb547; }
.plan-legend i.cone { border-radius: 0; width: 0; height: 0; border: 6px solid transparent; border-left: 11px solid rgba(41,196,255,.7); }
.plan-head button { margin-left: auto; border: 0; background: none; color: var(--muted); font-size: 18px; cursor: pointer; }
/* hall-map look: deep blue panel, faint grid, glowing cyan frame with corner brackets */
.plan-map { --ar: 1.84; --c: #5fd4ff; position: relative; width: min(calc(100% - 16px), calc(62vh * var(--ar))); aspect-ratio: var(--ar); margin: 0 auto;
  background:
    linear-gradient(rgba(90,170,255,.07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(90,170,255,.07) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(160deg, #0b2a5e 0%, #071c45 60%, #061637 100%);
  border: 1px solid rgba(95,212,255,.55); border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 16px rgba(41,170,255,.45), inset 0 0 34px rgba(41,170,255,.22); }
.plan-map::after { content: ''; position: absolute; inset: 3px; pointer-events: none; z-index: 2;
  background:
    linear-gradient(var(--c), var(--c)) top left / 22px 2px no-repeat, linear-gradient(var(--c), var(--c)) top left / 2px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) top right / 22px 2px no-repeat, linear-gradient(var(--c), var(--c)) top right / 2px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom left / 22px 2px no-repeat, linear-gradient(var(--c), var(--c)) bottom left / 2px 22px no-repeat,
    linear-gradient(var(--c), var(--c)) bottom right / 22px 2px no-repeat, linear-gradient(var(--c), var(--c)) bottom right / 2px 22px no-repeat;
  filter: drop-shadow(0 0 4px var(--c)); }
.booth-badge { display: inline-flex; align-items: baseline; gap: 4px; padding: 2px 9px; border-radius: 7px;
  background: linear-gradient(180deg, #ffae2e, #f07a12); color: #fff; font-weight: 700; font-size: 13px;
  box-shadow: 0 0 12px rgba(255,150,40,.6); letter-spacing: .5px; }
.booth-badge small { font-weight: 500; font-size: 10px; opacity: .9; }
.plan-map img, .plan-map svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.plan-map img { object-fit: contain; }
.plan-map img.missing { display: none; }
.plan-tip { margin: 6px 0 10px; text-align: center; color: var(--muted); font-size: 11px; }
#plan-svg .pt { cursor: pointer; }
#plan-svg .pt circle { stroke: #fff; stroke-width: 90; }
#plan-svg .pt.in circle { fill: #29c4ff; } #plan-svg .pt.out circle { fill: #ffb547; }
#plan-svg .pt.cur circle { stroke: #fff; stroke-width: 160; }
#plan-svg .pt text { fill: #fff; font-size: 620px; text-anchor: middle; paint-order: stroke; stroke: rgba(0,0,0,.75); stroke-width: 160; }
#plan-svg .zn { cursor: pointer; }
#plan-svg .zn text { fill: #d9f3ff; font-size: 520px; text-anchor: middle; dominant-baseline: middle; paint-order: stroke; stroke: rgba(4,14,40,.9); stroke-width: 150; }
#plan-svg .zn text.v { writing-mode: vertical-rl; letter-spacing: 40px; }
@media (max-width: 480px) {
  #plan-svg .zn text { font-size: 600px; stroke-width: 170; }
  #plan-svg .pt text { font-size: 660px; stroke-width: 180; }
}
#plan-svg .zn rect { fill: rgba(41,196,255,.9); }
#plan-svg .dt { cursor: pointer; }
#plan-svg .dt circle { fill: rgba(5,7,13,.85); stroke: #29c4ff; stroke-width: 70; }
#plan-svg .dt text { fill: #fff; font-size: 460px; text-anchor: middle; }
#plan-svg .cone { fill: rgba(41,196,255,.32); stroke: rgba(41,196,255,.9); stroke-width: 60; pointer-events: none; }
#plan-svg .fallback { fill: none; stroke: #2a3a50; stroke-width: 80; }

/* zone labels inside panoramas */
.zone-tag { display: inline-flex; flex-direction: column; align-items: center; padding: 4px 10px 5px;
  border-radius: 12px; background: rgba(5,7,13,.7); border: 1px solid rgba(41,196,255,.55);
  color: #fff; font-size: 13px; line-height: 1.2; white-space: nowrap; cursor: pointer; position: relative; }
.zone-tag small { font-size: 10px; color: #9fdcff; }
.zone-tag i { position: absolute; left: 50%; bottom: -9px; width: 1px; height: 8px; background: rgba(41,196,255,.8); }

/* PSV: keep the navbar above our tab bar and readable */
#tour .psv-navbar { background: rgba(5,7,13,.6); }

.tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0;
  height: calc(var(--bar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: 1fr 1fr; background: #0b1019;
  border-top: 1px solid #1b2636; }
/* Host badge (Netlify free plan injects "Powered by Netlify" bottom-right, above everything).
   Lay out around it instead of under it: wide screens keep the tabs left of it,
   narrow screens lift the tab bar (and what sits on it) above a strip for the badge. */
:root { --host-w: 0px; --host-h: 0px; }
body.has-host-badge .tabs { padding-right: var(--host-w); }
body.has-host-badge .lb-thumbs, body.has-host-badge .lb-hint { padding-right: calc(10px + var(--host-w)); }
@media (max-width: 700px) {
  body.has-host-badge .tabs { padding-right: 0; bottom: var(--host-h); }
  body.has-host-badge main { bottom: calc(var(--bar-h) + var(--safe-b) + var(--host-h)); }
  body.has-host-badge #lightbox { bottom: var(--host-h); }
  body.has-host-badge .lb-thumbs, body.has-host-badge .lb-hint { padding-right: 10px; }
  body.has-host-badge #detail-btn { bottom: calc(118px + var(--host-h)); }
}

.tabs button { appearance: none; border: 0; background: none; color: var(--muted);
  font: inherit; font-size: 14px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 1px; cursor: pointer; }
.tabs button small { font-size: 10px; opacity: .8; }
.tabs .ico { font-size: 18px; line-height: 1; }
.tabs button.active { color: var(--accent); }

/* Orbit viewer */
#orbit { background: radial-gradient(ellipse at center, #111a28 0%, var(--bg) 70%);
  touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#orbit.dragging { cursor: grabbing; }
#orbit-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

#toast { position: fixed; left: 50%; top: 64px; transform: translate(-50%, -8px); z-index: 30;
  max-width: calc(100% - 32px); padding: 8px 14px; border-radius: 18px; background: rgba(5,7,13,.85);
  border: 1px solid rgba(41,196,255,.5); color: #fff; font-size: 13px; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.loading { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: min(70vw, 280px); text-align: center; color: var(--muted); font-size: 13px; }
.loading .bar { height: 3px; background: #1b2636; border-radius: 2px; overflow: hidden; }
.loading .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.loading.done { display: none; }
.hint { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  padding: 6px 14px; border-radius: 16px; background: rgba(5,7,13,.6);
  color: var(--fg); font-size: 12px; white-space: nowrap; transition: opacity .6s; }
.hint.gone { opacity: 0; }
.hint em { display: none; font-style: normal; color: var(--muted); font-size: 11px; margin-top: 2px; }
@media (orientation: portrait) { .hint { text-align: center; } .hint em { display: block; } }
