:root {
  --glass-bg: rgba(15, 20, 28, 0.72);
  --glass-bg-hover: rgba(24, 32, 44, 0.86);
  --glass-border: rgba(255, 255, 255, 0.14);
  --glass-border-strong: rgba(255, 255, 255, 0.28);
  --text-primary: #f5f7fa;
  --text-secondary: rgba(235, 240, 248, 0.74);
  --accent: #e5c68e;
  --accent-soft: rgba(229, 198, 142, 0.2);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.34);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.22);
  --radius-pill: 999px;
  --radius-card: 18px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Inter, Roboto, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #141a24;
  color: var(--text-primary);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

#viewport {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#viewport.is-dragging {
  cursor: grabbing;
}

#viewport.is-hover-interactive {
  cursor: pointer;
}

#viewport canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
}

.hidden {
  display: none !important;
}

/* ---------- Loading Screen ---------- */
.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 35%, #202b3c 0%, #10151e 100%);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 36px 44px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
}

.loading-logo {
  height: 44px;
  width: auto;
  object-fit: contain;
}

.loading-unit {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--accent);
  font-weight: 600;
}

.loading-bar-track {
  width: 220px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  margin-top: 6px;
}

.loading-bar-fill {
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, #b6d4f0, var(--accent));
  border-radius: 3px;
  transition: width 0.25s ease;
}

.loading-status {
  font-size: 12px;
  color: var(--text-secondary);
}

/* ---------- Top HUD ---------- */
.hud-top {
  position: fixed;
  top: 16px;
  left: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.hud-top > * {
  pointer-events: auto;
}

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.brand-logo {
  height: 22px;
  width: auto;
  display: block;
}

.brand-divider {
  width: 1px;
  height: 16px;
  background: var(--glass-border-strong);
}

.brand-unit {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--accent);
}

/* Mode Segmented Control */
.mode-switch {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: var(--shadow-sm);
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.mode-btn svg {
  width: 16px;
  height: 16px;
}

.mode-btn:hover {
  color: var(--text-primary);
}

.mode-btn.active {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* Right Action Pills */
.hud-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
}

.icon-pill svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.icon-pill:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
}

.icon-pill.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

.icon-pill.icon-only {
  padding: 8px 9px;
}

.ar-hidden-thumb {
  display: none;
}

/* ---------- Crosshair (FPS Pointer Lock) ---------- */
.crosshair {
  position: fixed;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: rgba(229, 198, 142, 0.35);
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  z-index: 25;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.crosshair.active-target {
  transform: translate(-50%, -50%) scale(1.65);
  border-color: var(--accent);
  background: rgba(229, 198, 142, 0.65);
}

/* ---------- Floating Interaction Tooltip (Clean Text Over Background) ---------- */
.interaction-tip {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  padding: 2px 6px;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.62), 0 0 2px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  white-space: nowrap;
}

/* ---------- Persistent Device-Aware Teleport Cue (Floor Plan Mode) ---------- */
.teleport-cue {
  position: fixed;
  bottom: 92px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 23;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 2px 8px;
  color: rgba(255, 252, 245, 0.92);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.58), 0 0 2px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  white-space: nowrap;
  transition: color 0.18s ease, transform 0.2s ease;
}

.teleport-cue-icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.5));
}

.teleport-cue.is-active {
  color: #ffffff;
}

@keyframes teleportCuePulse {
  0%, 100% {
    opacity: 0.85;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.045);
  }
}

.teleport-cue.is-intro-pulse {
  animation: teleportCuePulse 1.6s ease-in-out infinite;
}

/* ---------- Bottom HUD ---------- */
.hud-bottom {
  position: fixed;
  bottom: 16px;
  left: 18px;
  right: 18px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  pointer-events: none;
}

/* Non-clickable architectural room indicator (flat muted taupe dovetail ribbon flag, no dot) */
.room-indicator {
  display: inline-flex;
  align-items: center;
  padding: 6px 20px 6px 12px;
  border-radius: 0;
  background: rgba(110, 88, 62, 0.84);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  clip-path: polygon(0 0, 100% 0, calc(100% - 9px) 50%, 100% 100%, 0 100%);
  pointer-events: none;
  cursor: default;
}

.mode-hint {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 12px;
  color: var(--text-secondary);
  box-shadow: var(--shadow-sm);
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
}

/* ---------- Bird's-Eye Projected Room Labels ---------- */
.room-labels {
  position: fixed;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

/* Non-clickable Floor Plan Room Labels (flat muted taupe dovetail ribbon flags, no dot, no lift) */
.room-label-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  display: inline-flex;
  align-items: center;
  padding: 3.5px 14px 3.5px 8px;
  border-radius: 0;
  background: rgba(110, 88, 62, 0.84);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
  clip-path: polygon(0 0, 100% 0, calc(100% - 6px) 50%, 100% 100%, 0 100%);
  pointer-events: none;
  cursor: default;
}

/* ---------- Mobile Touch Joystick ---------- */
.touch-joystick {
  position: fixed;
  bottom: 72px;
  left: 22px;
  z-index: 25;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  background: rgba(15, 20, 28, 0.48);
  border: 1.5px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  touch-action: none;
}

.touch-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  margin-top: -22px;
  border-radius: 50%;
  background: rgba(229, 198, 142, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  pointer-events: none;
  transition: transform 0.06s linear;
}

/* ---------- White Frosted Slide-In Unit Details Drawer ---------- */
.details-scrim {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: rgba(10, 12, 16, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.unit-details-panel {
  position: fixed;
  top: 76px;
  left: 0;
  z-index: 26;
  width: 282px;
  max-height: calc(100vh - 154px);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-left: none;
  backdrop-filter: blur(20px) saturate(1.18);
  -webkit-backdrop-filter: blur(20px) saturate(1.18);
  box-shadow: 0 14px 38px rgba(34, 24, 12, 0.24);
  color: #14161a;
  transform: translateX(-100%);
  transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: visible;
}

.unit-details-panel.is-open {
  transform: translateX(0);
}

/* Very short attached right-edge chevron handle (Desktop) */
.details-handle {
  position: absolute;
  top: 50%;
  right: -24px;
  transform: translateY(-50%);
  width: 24px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-left: none;
  border-radius: 0 11px 11px 0;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  color: #181c22;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 6px 4px 16px rgba(34, 24, 12, 0.18);
  transition: background 0.18s ease, color 0.18s ease, width 0.16s ease, right 0.16s ease;
}

.details-handle:hover {
  background: rgba(255, 255, 255, 0.96);
  color: #000000;
}

.handle-chevron {
  width: 15px;
  height: 15px;
  display: block;
  /* Default SVG points LEFT (close when open); rotate 180deg to point RIGHT when collapsed */
  transform: rotate(180deg);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.unit-details-panel.is-open .handle-chevron {
  transform: rotate(0deg);
}

.details-body {
  max-height: calc(100vh - 156px);
  overflow-y: auto;
  padding: 16px 17px 17px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 22, 26, 0.18) transparent;
}

.details-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.details-eyebrow {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.13em;
  color: #7c5c30;
}

.details-title {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #111317;
}

.details-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(20, 22, 26, 0.08);
}

.stat-val {
  font-size: 13.5px;
  font-weight: 700;
  color: #111317;
  letter-spacing: -0.01em;
}

.stat-lbl {
  font-size: 10px;
  font-weight: 500;
  color: #4f5662;
  line-height: 1.25;
}

.details-dev-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(138, 102, 52, 0.11);
  border: 1px solid rgba(138, 102, 52, 0.22);
  font-size: 11.5px;
}

.details-dev-lbl {
  color: #4a505c;
  font-weight: 500;
}

.details-dev-val {
  color: #6b4d24;
  font-weight: 700;
}

.details-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.details-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #555c68;
}

.details-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-tag {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(20, 22, 26, 0.075);
  border: 1px solid rgba(20, 22, 26, 0.11);
  color: #16191f;
  font-size: 11px;
  font-weight: 600;
}

.detail-tag.tag-subtle {
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(20, 22, 26, 0.12);
  color: #232730;
  font-weight: 500;
}

/* ---------- Centered Photo Gallery Launcher ---------- */
.floorplan-cta-row {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 24;
  display: inline-flex;
  align-items: center;
}

.gallery-launcher {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 10px 22px 10px 15px;
  border-radius: 999px;
  background: rgba(16, 21, 29, 0.88);
  border: 1.5px solid rgba(229, 198, 142, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: var(--text-primary);
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34), 0 0 0 1px rgba(229, 198, 142, 0.14) inset;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, background 0.2s ease, box-shadow 0.22s ease;
}

.gallery-launcher:hover {
  transform: translateY(-3px);
  background: rgba(22, 28, 38, 0.96);
  border-color: var(--accent);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.44), 0 0 20px rgba(229, 198, 142, 0.24);
}

.launcher-stack {
  position: relative;
  width: 58px;
  height: 42px;
  flex-shrink: 0;
}

.launcher-card {
  position: absolute;
  top: 3px;
  left: 6px;
  width: 46px;
  height: 34px;
  object-fit: cover;
  border-radius: 7px;
  border: 1.5px solid rgba(255, 255, 255, 0.72);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.42);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.launcher-card-back {
  transform: rotate(-10deg) translate(-5px, 1px);
  opacity: 0.75;
}

.launcher-card-mid {
  transform: rotate(7deg) translate(5px, -1px);
  opacity: 0.88;
}

.launcher-card-front {
  transform: rotate(-1deg);
  border-color: var(--accent);
}

.gallery-launcher:hover .launcher-card-back {
  transform: rotate(-16deg) translate(-8px, 1px);
}

.gallery-launcher:hover .launcher-card-mid {
  transform: rotate(12deg) translate(8px, -2px);
}

.gallery-launcher:hover .launcher-card-front {
  transform: scale(1.05);
}

.launcher-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #ffffff;
  white-space: nowrap;
}

/* ---------- Frameless 3D Cover Flow Photo Gallery Carousel ---------- */
.gallery-modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 24px 20px 28px;
  background: radial-gradient(circle at 50% 48%, rgba(16, 20, 28, 0.72) 0%, rgba(8, 11, 16, 0.88) 100%);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  overflow: hidden;
}

.coverflow-topbar {
  position: relative;
  width: min(920px, 100%);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.gallery-title {
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.015em;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  padding: 0 44px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.coverflow-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* 3D Cover Flow Stage */
.coverflow-stage {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1450px;
  perspective-origin: 50% 48%;
  overflow: visible;
  touch-action: pan-y;
}

.coverflow-track {
  position: relative;
  width: min(640px, 64vw);
  height: min(440px, 54vh);
  transform-style: preserve-3d;
}

.coverflow-card {
  position: absolute;
  inset: 0;
  padding: 0;
  border: none;
  background: transparent;
  transform-style: preserve-3d;
  transition:
    transform 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.48s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.42s ease;
  will-change: transform, filter, opacity;
  outline: none;
}

.coverflow-frame {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  background: #10141c;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 26px 64px rgba(0, 0, 0, 0.62);
}

.coverflow-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.coverflow-card-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px 16px 12px;
  background: linear-gradient(transparent, rgba(8, 11, 16, 0.82));
  color: rgba(245, 247, 250, 0.92);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

/* 5-Card Album Rack Positions */
.coverflow-card[data-slot="0"] {
  transform: translate3d(0, 0, 140px) rotateY(0deg) scale(1);
  filter: saturate(1.04) blur(0px) brightness(1);
  opacity: 1;
  z-index: 10;
  cursor: default;
}

.coverflow-card[data-slot="0"] .coverflow-frame {
  border-color: rgba(229, 198, 142, 0.65);
  box-shadow: 0 32px 74px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(229, 198, 142, 0.22);
}

.coverflow-card[data-slot="-1"] {
  transform: translate3d(-52%, 0, -50px) rotateY(34deg) scale(0.84);
  filter: saturate(0.55) blur(1.8px) brightness(0.82);
  opacity: 0.92;
  z-index: 6;
  cursor: pointer;
}

.coverflow-card[data-slot="1"] {
  transform: translate3d(52%, 0, -50px) rotateY(-34deg) scale(0.84);
  filter: saturate(0.55) blur(1.8px) brightness(0.82);
  opacity: 0.92;
  z-index: 6;
  cursor: pointer;
}

.coverflow-card[data-slot="-1"]:hover,
.coverflow-card[data-slot="1"]:hover {
  filter: saturate(0.76) blur(0.8px) brightness(0.94);
}

.coverflow-card[data-slot="-1"]:hover .coverflow-card-label,
.coverflow-card[data-slot="1"]:hover .coverflow-card-label,
.coverflow-card[data-slot="-2"]:hover .coverflow-card-label,
.coverflow-card[data-slot="2"]:hover .coverflow-card-label {
  opacity: 1;
}

.coverflow-card[data-slot="-2"] {
  transform: translate3d(-88%, 0, -190px) rotateY(46deg) scale(0.68);
  filter: saturate(0.38) blur(3.4px) brightness(0.64);
  opacity: 0.72;
  z-index: 3;
  cursor: pointer;
}

.coverflow-card[data-slot="2"] {
  transform: translate3d(88%, 0, -190px) rotateY(-46deg) scale(0.68);
  filter: saturate(0.38) blur(3.4px) brightness(0.64);
  opacity: 0.72;
  z-index: 3;
  cursor: pointer;
}

.coverflow-card[data-slot="-2"]:hover,
.coverflow-card[data-slot="2"]:hover {
  filter: saturate(0.62) blur(1.6px) brightness(0.82);
  opacity: 0.88;
}

.coverflow-card[data-slot="hidden-left"] {
  transform: translate3d(-115%, 0, -320px) rotateY(56deg) scale(0.54);
  filter: saturate(0.25) blur(5px) brightness(0.45);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

.coverflow-card[data-slot="hidden-right"],
.coverflow-card[data-slot="hidden"] {
  transform: translate3d(115%, 0, -320px) rotateY(-56deg) scale(0.54);
  filter: saturate(0.25) blur(5px) brightness(0.45);
  opacity: 0;
  z-index: 1;
  pointer-events: none;
}

/* Stacked Teleport CTA + Left/Right Controls (matched exact width) */
.coverflow-controls-stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: max-content;
  min-width: 280px;
  z-index: 20;
}

.gallery-teleport-btn {
  width: 100%;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1.5px solid rgba(235, 208, 158, 0.85);
  background: linear-gradient(135deg, rgba(229, 198, 142, 0.95) 0%, rgba(206, 169, 108, 0.95) 100%);
  color: #141820;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.36), 0 0 18px rgba(229, 198, 142, 0.22);
  transition: transform 0.16s ease, box-shadow 0.18s ease, filter 0.16s ease;
}

.gallery-teleport-btn:hover {
  transform: translateY(-1.5px);
  filter: brightness(1.06);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.44), 0 0 24px rgba(229, 198, 142, 0.35);
}

.coverflow-bottombar {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  background: rgba(15, 20, 28, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.coverflow-arrow {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.coverflow-arrow svg {
  width: 18px;
  height: 18px;
}

.coverflow-arrow:hover {
  background: rgba(229, 198, 142, 0.22);
  border-color: var(--accent);
  color: var(--accent);
}

.gallery-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.gallery-dot {
  width: 8px;
  height: 8px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: width 0.26s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
}

.gallery-dot:hover {
  background: rgba(255, 255, 255, 0.6);
}

.gallery-dot.active {
  width: 24px;
  background: var(--accent);
}

/* ---------- Help Modal ---------- */
.help-modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(8, 12, 18, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.help-card {
  width: 100%;
  max-width: 600px;
  padding: 24px 28px;
  border-radius: var(--radius-card);
  background: rgba(18, 24, 34, 0.94);
  border: 1px solid var(--glass-border-strong);
  box-shadow: var(--shadow-lg);
}

.help-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.help-header h2 {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.help-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.help-close:hover {
  background: rgba(255, 255, 255, 0.16);
}

.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.help-section h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 10px;
}

.help-section ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.help-section strong {
  color: var(--text-primary);
}

/* Mobile / Tablet Slide-Up Bottom Drawer for Unit Details */
@media (max-width: 920px) {
  .unit-details-panel {
    top: auto;
    left: 10px;
    right: 10px;
    bottom: 0;
    width: auto;
    max-height: 74vh;
    z-index: 42;
    border-radius: 20px 20px 0 0;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-bottom: none;
    background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 -10px 40px rgba(24, 18, 10, 0.32);
    transform: translateY(100%);
  }

  .unit-details-panel.is-open {
    transform: translateY(0);
  }

  .details-body {
    max-height: 72vh;
    padding: 16px 18px 22px;
  }

  /* Short top-edge chevron handle peeking flush at bottom-center when collapsed */
  .details-handle {
    top: -26px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: 60px;
    height: 26px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 16px rgba(24, 18, 10, 0.18);
  }

  /* Default SVG points LEFT: +90deg points UP (open when collapsed), -90deg points DOWN (close when open) */
  .handle-chevron {
    transform: rotate(90deg);
  }

  .unit-details-panel.is-open .handle-chevron {
    transform: rotate(-90deg);
  }

  /* Position Photo Gallery & persistent teleport cue cleanly above the 26px peeking bottom drawer handle */
  .floorplan-cta-row {
    bottom: 42px;
  }

  .teleport-cue {
    bottom: 104px;
    font-size: 12px;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .hud-top {
    top: 10px;
    left: 10px;
    right: 10px;
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .brand-pill {
    padding: 6px 12px;
  }

  .brand-logo {
    height: 18px;
  }

  .btn-label {
    display: none;
  }

  .icon-pill {
    padding: 8px 10px;
  }

  .mode-btn {
    padding: 6px 12px;
    font-size: 12px;
  }

  .hud-bottom {
    bottom: 12px;
    left: 12px;
    right: 12px;
  }

  .mode-hint {
    display: none;
  }

  .help-grid {
    grid-template-columns: 1fr;
  }

  .room-label-tag {
    font-size: 8.5px;
    padding: 2.5px 11px 2.5px 6px;
    clip-path: polygon(0 0, 100% 0, calc(100% - 5px) 50%, 100% 100%, 0 100%);
  }

  body.mode-floorplan .room-indicator {
    display: none;
  }

  .floorplan-cta-row {
    bottom: 40px;
  }

  .gallery-launcher {
    padding: 8px 18px 8px 12px;
    gap: 11px;
  }

  .launcher-stack {
    width: 46px;
    height: 34px;
  }

  .launcher-card {
    width: 38px;
    height: 28px;
  }

  .launcher-title {
    font-size: 13px;
  }

  .gallery-modal {
    padding: 16px 12px 22px;
  }

  .gallery-title {
    font-size: 17px;
  }

  .coverflow-track {
    width: min(440px, 78vw);
    height: min(320px, 44vh);
  }

  .coverflow-card[data-slot="-1"] {
    transform: translate3d(-44%, 0, -50px) rotateY(32deg) scale(0.82);
  }

  .coverflow-card[data-slot="1"] {
    transform: translate3d(44%, 0, -50px) rotateY(-32deg) scale(0.82);
  }

  .coverflow-card[data-slot="-2"] {
    transform: translate3d(-74%, 0, -170px) rotateY(44deg) scale(0.66);
  }

  .coverflow-card[data-slot="2"] {
    transform: translate3d(74%, 0, -170px) rotateY(-44deg) scale(0.66);
  }

  .coverflow-controls-stack {
    min-width: 248px;
    gap: 8px;
  }

  .gallery-teleport-btn {
    padding: 10px 18px;
    font-size: 13px;
  }
}

@media (max-width: 520px) {
  .coverflow-track {
    width: 82vw;
    height: min(290px, 42vh);
  }

  .coverflow-card[data-slot="-2"],
  .coverflow-card[data-slot="2"] {
    opacity: 0;
    pointer-events: none;
  }
}
