/* Penthouse · 360° Tour — viewer styles (no external fonts / assets) */
:root {
  --ui-bg: rgba(15, 16, 19, 0.56);
  --ui-bg-hover: rgba(36, 37, 42, 0.72);
  --ui-bg-strong: rgba(15, 16, 19, 0.86);
  --line: rgba(255, 255, 255, 0.14);
  --line-strong: rgba(255, 255, 255, 0.30);
  --text: #f3f0ea;
  --muted: rgba(243, 240, 234, 0.64);
  --accent: #d6b77f;
  --accent-soft: rgba(214, 183, 127, 0.22);
  --radius: 12px;
  --gap: 14px;
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #0d0e10;
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.35;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- stage ---------- */
.stage {
  position: fixed;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  touch-action: none;
  cursor: grab;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.stage.dragging { cursor: grabbing; }
.stage canvas { display: block; width: 100%; height: 100%; }
.stage canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }

/* ---------- hotspots ---------- */
.hotspots {
  position: absolute;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity .28s ease;
}
.hotspots.hs-hidden { opacity: 0; }
.hotspots.hs-hidden .hs { pointer-events: none; }

.hs {
  position: absolute;
  left: 0; top: 0;
  width: 88px; height: 88px;
  margin: -44px 0 0 -44px;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
  visibility: hidden;
  will-change: transform;
  border-radius: 50%;
}
.hs:focus-visible { outline: none; }
.hs-floor {
  position: absolute;
  left: 8px; top: 8px; right: 8px; bottom: 8px;
  transform-origin: 50% 50%;
}
.hs-ring {
  position: absolute;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.95);
  background: radial-gradient(circle, rgba(255,255,255,0.30) 0 30%, rgba(255,255,255,0.10) 31% 100%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.28), 0 3px 14px rgba(0,0,0,0.38), inset 0 0 0 1px rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .22s ease, background-color .22s ease, border-color .22s ease;
}
.hs-ring svg {
  width: 46%; height: 46%;
  fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.45));
}
.hs:hover .hs-ring, .hs:focus-visible .hs-ring {
  transform: scale(1.12);
  border-color: var(--accent);
  background: radial-gradient(circle, rgba(214,183,127,0.55) 0 30%, rgba(214,183,127,0.16) 31% 100%);
}
.hs:focus-visible .hs-ring { box-shadow: 0 0 0 3px rgba(214,183,127,.55), 0 3px 14px rgba(0,0,0,.38); }
.hs-lbl {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, 34px);
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: .01em;
  color: var(--text);
  padding: 5px 11px 6px;
  border-radius: 999px;
  background: var(--ui-bg-strong);
  border: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(0,0,0,.28);
  opacity: .85;
  transition: opacity .18s ease;
  pointer-events: none;
}
/* label placement is done in viewer.js (inside the viewport, apart from each other); a label that
   would cover another one is hidden until its marker is hovered or focused */
.hs:hover, .hs:focus-visible { z-index: 2; }
.hs.lbl-off .hs-lbl { opacity: 0; }
.hs.lbl-off:hover .hs-lbl, .hs.lbl-off:focus-visible .hs-lbl, .hs.lbl-off:active .hs-lbl { opacity: 1; }
@media (hover: hover) and (pointer: fine) {
  .hs:hover .hs-lbl, .hs:focus-visible .hs-lbl { opacity: 1; }
}
@media (hover: none), (pointer: coarse) {
  /* long names wrap onto two lines; width: max-content, or the label would wrap to its 88 px button */
  .hs-lbl {
    opacity: .94;
    font-size: 11.5px;
    line-height: 1.25;
    padding: 3px 8px 4px;
    white-space: normal;
    width: max-content;
    max-width: 11em;
    text-align: center;
    overflow: visible;
    text-overflow: clip;
    border-radius: 12px;
  }
}

/* ---------- progress ---------- */
.progress {
  position: fixed;
  left: 0; right: 0; top: 0;
  height: 2px;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  transition: opacity .35s ease;
}
.progress.on { opacity: 1; }
.progress > div {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, rgba(214,183,127,.25), var(--accent));
  transform-origin: 0 50%;
  transform: scaleX(0);
  transition: transform .25s ease;
}

/* ---------- shared UI ---------- */
.glass {
  background: var(--ui-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid var(--line);
}
.btn {
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--ui-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  color: var(--text);
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color .18s ease, border-color .18s ease, color .18s ease;
}
.btn:hover { background: var(--ui-bg-hover); border-color: var(--line-strong); }
.btn[aria-pressed="true"] { color: var(--accent); border-color: rgba(214,183,127,.45); }
.btn-ghost { background: transparent; border-color: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn-ghost:hover { background: rgba(255,255,255,.08); border-color: transparent; }
.btn-sm { height: 30px; min-width: 30px; padding: 0 6px; border-radius: 8px; }
svg.i {
  width: 18px; height: 18px;
  flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed;
  left: 0; right: 0; top: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: calc(var(--gap) + var(--sat)) calc(var(--gap) + var(--sar)) 0 calc(var(--gap) + var(--sal));
  pointer-events: none;
  transition: opacity .3s ease;
}
.topbar > * { pointer-events: auto; }
.brand {
  min-width: 0;
  max-width: min(60vw, 560px);
  padding: 9px 16px 10px;
  border-radius: var(--radius);
  background: var(--ui-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid var(--line);
}
.t-title {
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand h1 {
  margin: 2px 0 0;
  font-size: 19px;
  font-weight: 400;
  letter-spacing: .01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tools { display: flex; gap: 8px; align-items: center; flex: none; }

.seg {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: var(--ui-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
}
.seg:empty { display: none; }
.seg button {
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 0 11px;
  border-radius: 8px;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: rgba(255,255,255,.15); color: var(--text); }
.seg button[aria-pressed="true"] svg { color: var(--accent); }

/* ---------- rooms panel ---------- */
.panel {
  position: fixed;
  z-index: 9;
  top: calc(var(--gap) + var(--sat) + 50px);
  right: calc(var(--gap) + var(--sar));
  width: 300px;
  max-height: calc(100% - var(--sat) - var(--sab) - 2 * var(--gap) - 64px);
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  background: var(--ui-bg-strong);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0,0,0,.4);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.panel.open {
  visibility: visible;
  opacity: 1;
  transform: none;
  transition: opacity .2s ease, transform .2s ease, visibility 0s;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 6px 16px;
  border-bottom: 1px solid var(--line);
}
.panel-title { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.room-list { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 6px 10px; overscroll-behavior: contain; }
.room-group { padding: 10px 10px 4px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.room {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 14.5px;
  color: var(--text);
}
.room::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  flex: none;
  border: 1px solid var(--line-strong);
}
.room:hover { background: rgba(255,255,255,.07); }
.room[aria-current="true"] { background: var(--accent-soft); }
.room[aria-current="true"]::before { background: var(--accent); border-color: var(--accent); }
.backdrop {
  position: fixed;
  inset: 0;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 8;
  background: rgba(0,0,0,.35);
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s ease, visibility 0s linear .2s;
}

/* ---------- mini map ---------- */
.map {
  position: fixed;
  z-index: 5;
  left: calc(var(--gap) + var(--sal));
  bottom: calc(var(--gap) + var(--sab));
  width: 300px;
  border-radius: var(--radius);
  background: var(--ui-bg);
  -webkit-backdrop-filter: blur(14px) saturate(1.15);
  backdrop-filter: blur(14px) saturate(1.15);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: width .28s ease, opacity .3s ease, background-color .25s ease, border-color .25s ease;
}
/* a hotspot lies under the small map (never set on .map.big): the plan fades and clicks go through to
   the hotspot everywhere except on the map's own buttons and the plan dots, which stay clickable */
.map.hs-under {
  pointer-events: none;
  background-color: transparent;
  border-color: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.map.hs-under .map-head, .map.hs-under .map-body, .map.hs-under .plan-dots { pointer-events: none; }
.map.hs-under .map-head > button, .map.hs-under .dot { pointer-events: auto; }
/* a button or dot right over a marker's centre yields to the marker (set per control by viewer.js) */
.map.hs-under .map-head > button.hs-yield, .map.hs-under .dot.hs-yield { pointer-events: none; opacity: .55; }
.map.hs-under .map-head > button.hs-yield { background: transparent; }
.map.hs-under .map-title { background: var(--ui-bg-strong); }
.map.hs-under .plan-wrap { background: transparent; }
.map.hs-under .plan-wrap img, .map.hs-under .plan-cone { opacity: .3; }
.plan-cone { transition: opacity .25s ease; }
.map.big { width: min(680px, calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar) - 70px)); }
.map.no-plan { display: none; }
.map-head { display: flex; align-items: center; justify-content: space-between; padding: 3px 4px 3px 4px; }
.map-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.map-title:hover { color: var(--text); background: rgba(255,255,255,.07); }
.map-title .chev { width: 15px; height: 15px; transition: transform .2s ease; }
.map.collapsed .map-title .chev { transform: rotate(180deg); }
.map.collapsed { width: auto; }
.map.collapsed .map-body, .map.collapsed #btnMapBig { display: none; }
.map-body { padding: 0 6px 6px; }
.plan-wrap {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 70%;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0,0,0,.25);
}
.plan-wrap img {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  object-fit: fill;
  display: block;
  -webkit-user-drag: none;
  user-select: none;
  transition: opacity .3s ease;
}
.plan-dots, .plan-cone { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.plan-dots { pointer-events: none; }
.plan-cone { pointer-events: none; }
.plan-cone svg {
  position: absolute;
  width: 88px; height: 88px;
  margin: -44px 0 0 -44px;
  left: 0; top: 0;
  overflow: visible;
  transform-origin: 50% 50%;
}
.plan-cone path { fill: rgba(214,183,127,.55); stroke: rgba(15,16,19,.85); stroke-width: 1.2; stroke-linejoin: round; }
.map.big .plan-cone svg { width: 120px; height: 120px; margin: -60px 0 0 -60px; }
.dot {
  position: absolute;
  width: 26px; height: 26px;
  margin: -13px 0 0 -13px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}
.dot::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: rgba(20,21,24,.85);
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.35);
  transition: transform .18s ease, background-color .18s ease;
}
.dot:hover::after { transform: scale(1.35); background: var(--accent); }
.dot.active::after { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--accent); border-color: #fff; }
.dot .dot-tip {
  position: absolute;
  left: 50%; bottom: 100%;
  transform: translate(-50%, -2px);
  white-space: nowrap;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--ui-bg-strong);
  border: 1px solid var(--line);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.dot:hover .dot-tip, .dot:focus-visible .dot-tip { opacity: 1; }

/* ---------- dock (bottom right) ---------- */
.dock {
  position: fixed;
  z-index: 5;
  right: calc(var(--gap) + var(--sar));
  bottom: calc(var(--gap) + var(--sab));
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: opacity .3s ease;
}
#btnFull .i-exit { display: none; }
#btnFull[aria-pressed="true"] .i-enter { display: none; }
#btnFull[aria-pressed="true"] .i-exit { display: block; }

/* ---------- hint / toast / message ---------- */
.hint {
  position: fixed;
  z-index: 4;
  left: 50%; top: 38%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px 12px;
  border-radius: 999px;
  background: var(--ui-bg-strong);
  border: 1px solid var(--line);
  font-size: 14px;
  pointer-events: none;
  opacity: 0;
  transition: opacity .6s ease;
}
.hint.on { opacity: 1; }
.hint svg.i { width: 22px; height: 22px; color: var(--accent); }
.toast {
  position: fixed;
  z-index: 12;
  left: 50%;
  bottom: calc(var(--gap) + var(--sab) + 6px);
  transform: translate(-50%, 8px);
  max-width: min(520px, calc(100vw - 32px));
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--ui-bg-strong);
  border: 1px solid var(--line);
  font-size: 13.5px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.msg {
  position: fixed;
  z-index: 30;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(460px, calc(100vw - 32px));
  padding: 20px 22px;
  border-radius: 14px;
  background: var(--ui-bg-strong);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line-strong);
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  text-align: center;
}
.msg[hidden] { display: none; }
.msg p { margin: 0; font-size: 15px; line-height: 1.5; }
.msg .btn { margin-top: 14px; padding: 0 16px; }
.msg .btn[hidden] { display: none; }

/* ---------- immersive fallback (no Fullscreen API, e.g. iPhone) ---------- */
body.immersive .topbar,
body.immersive .map,
body.immersive .dock > :not(#btnFull) { opacity: 0; pointer-events: none; }
body.immersive .topbar > * { pointer-events: none; }

/* ---------- responsive ---------- */
@media (max-width: 640px) {
  :root { --gap: 10px; }
  .brand { padding: 7px 12px 8px; max-width: none; flex: 1 1 auto; }
  .brand h1 { font-size: 15px; line-height: 1.2; white-space: normal; }
  .t-title { font-size: 9.5px; letter-spacing: .13em; }
  .seg { height: 38px; }
  .seg button { padding: 0 9px; height: 30px; }
  .seg .seg-txt, .btn-txt { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .btn { height: 38px; min-width: 38px; padding: 0 9px; }
  .tools { gap: 6px; }
  .desk-only { display: none; }
  .map { width: min(46vw, 220px); }
  .map.big { width: calc(100vw - 2 * var(--gap) - var(--sal) - var(--sar) - 54px); }
  .plan-cone svg { width: 64px; height: 64px; margin: -32px 0 0 -32px; }
  .dot { width: 18px; height: 18px; margin: -9px 0 0 -9px; }
  .dot .dot-tip { display: none; }

  /* rooms as a bottom sheet */
  .panel {
    top: auto;
    left: 0; right: 0; bottom: 0;
    width: auto;
    max-height: 72vh;
    border-radius: 18px 18px 0 0;
    border-bottom: 0;
    padding-bottom: var(--sab);
    transform: translateY(100%);
    opacity: 1;
    transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s linear .28s;
  }
  .panel.open { transform: none; transition: transform .28s cubic-bezier(.2,.8,.2,1), visibility 0s; }
  .panel-head { padding: 12px 8px 8px 18px; position: relative; }
  .panel-head::before {
    content: "";
    position: absolute;
    left: 50%; top: 5px;
    width: 36px; height: 4px;
    margin-left: -18px;
    border-radius: 2px;
    background: rgba(255,255,255,.25);
  }
  .room { padding: 12px 12px; font-size: 15.5px; }
  .backdrop.open { opacity: 1; visibility: visible; transition: opacity .2s ease, visibility 0s; }
}
@media (max-width: 380px) {
  .t-title { display: none; }
}
@media (max-height: 460px) and (orientation: landscape) {
  .map { width: 200px; }
  .desk-only { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}
