:root {
  --ink: #1c1f1e;
  --muted: #646a67;
  --glass: rgba(255, 255, 255, 0.84);
  --accent: #0f5c55;
  --radius: 16px;
  --gap: 16px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0d0f0e; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#stage canvas.dragging { cursor: grabbing; }

.card {
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.16);
  border-radius: var(--radius);
}

.eyebrow { font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.loc { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.facts span { font-size: 12px; padding: 4px 9px; border-radius: 999px; background: rgba(15, 92, 85, 0.09); color: #24413d; font-weight: 500; }

.listing { position: fixed; top: var(--gap); left: var(--gap); padding: 16px 18px; width: 320px; }
.listing h1 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 22px; line-height: 1.15; margin: 6px 0 4px; }
.price { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; }

.modes { position: fixed; top: var(--gap); right: var(--gap); display: flex; padding: 4px; gap: 2px; }
.modes button { border: 0; background: transparent; padding: 8px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.modes button:hover { background: rgba(0, 0, 0, 0.05); }
.modes button.active { background: var(--ink); color: #fff; }
.modes .icon { display: grid; place-items: center; padding: 8px 10px; }

.minimap { position: fixed; left: var(--gap); bottom: var(--gap); padding: 8px; width: 240px; }
.minimap canvas { width: 100%; height: 160px; display: block; cursor: pointer; }
.room-now { font-size: 12px; font-weight: 600; padding: 6px 4px 0; min-height: 20px; }

.rooms {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--gap) + 2px);
  display: flex; gap: 6px; max-width: calc(100vw - 600px); overflow-x: auto; padding: 4px; scrollbar-width: none;
}
.rooms::-webkit-scrollbar { display: none; }
.rooms button, #labels button {
  flex: none; border: 1px solid rgba(255, 255, 255, 0.6); background: var(--glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}
.rooms button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
#labels { position: fixed; inset: 0; pointer-events: none; }
#labels button { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; }
#labels button:hover { background: var(--ink); color: #fff; }

.cta {
  position: fixed; right: var(--gap); bottom: var(--gap); background: var(--accent); color: #fff; text-decoration: none;
  font-weight: 600; font-size: 14px; padding: 13px 20px; border-radius: 999px; box-shadow: 0 10px 26px rgba(15, 92, 85, 0.4);
}
.cta:hover { filter: brightness(1.1); }

.tourbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 72px; display: flex; align-items: center; gap: 12px;
  padding: 8px 14px 8px 8px; width: min(460px, calc(100vw - 32px));
}
.tourbar[hidden] { display: none; }
#tour-toggle { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 12px; flex: none; }
.track { flex: 1; height: 6px; background: rgba(0, 0, 0, 0.1); border-radius: 3px; cursor: pointer; position: relative; }
#tour-fill { position: absolute; inset: 0 auto 0 0; background: var(--accent); border-radius: 3px; width: 0; }
#tour-label { font-size: 12px; font-weight: 600; min-width: 110px; text-align: right; }

#joystick {
  display: none; position: fixed; left: 24px; bottom: 200px; width: 112px; height: 112px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.22); border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); touch-action: none;
}
.knob { position: absolute; left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px; border-radius: 50%; background: rgba(255, 255, 255, 0.92); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25); }
body.touch[data-mode="walk"] #joystick { display: block; }

.hint {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, 40px); max-width: calc(100vw - 40px);
  background: rgba(20, 22, 21, 0.78); color: #fff; font-size: 13px; padding: 10px 16px; border-radius: 999px;
  opacity: 0; pointer-events: none; transition: opacity 0.4s, transform 0.4s; text-align: center;
}
.hint.on { opacity: 1; transform: translate(-50%, 60px); }
.demo-note { position: fixed; right: var(--gap); bottom: 72px; font-size: 11px; color: rgba(255, 255, 255, 0.85); text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
a.demo-note { text-decoration: none; }
a.demo-note:hover { color: #fff; text-decoration: underline; }

.contact {
  position: fixed; right: var(--gap); bottom: calc(var(--gap) + 58px); padding: 14px 18px; width: 240px;
  display: flex; flex-direction: column; gap: 4px; z-index: 5;
}
.contact[hidden] { display: none; }
.contact strong { font-size: 15px; }
.contact a { color: var(--accent); font-weight: 600; font-size: 16px; text-decoration: none; }
.contact .close { position: absolute; top: 6px; right: 8px; border: 0; background: none; font-size: 20px; line-height: 1; color: var(--muted); }

#fade { position: fixed; inset: 0; background: #0d0f0e; opacity: 0; pointer-events: none; transition: opacity 0.22s ease; }
#fade.on { opacity: 1; }
#loading { position: fixed; inset: 0; display: grid; place-items: center; background: #0d0f0e; color: #cfd6d3; font-size: 14px; }

.intro {
  position: fixed; inset: 0; display: grid; place-items: center;
  background: linear-gradient(180deg, rgba(10, 12, 11, 0.1), rgba(10, 12, 11, 0.55)); transition: opacity 0.5s;
}
.intro.hidden { opacity: 0; pointer-events: none; }
.intro-card { background: rgba(255, 255, 255, 0.94); padding: 28px; border-radius: 22px; width: min(440px, calc(100vw - 32px)); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.intro-card h2 { font-family: Fraunces, Georgia, serif; font-weight: 600; font-size: 30px; line-height: 1.1; margin: 8px 0 6px; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.intro-actions button { flex: 1 1 160px; border: 1px solid rgba(0, 0, 0, 0.12); background: #fff; padding: 13px 16px; border-radius: 999px; font-weight: 600; font-size: 14px; }
.intro-actions .primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.small { font-size: 12px; color: var(--muted); margin: 14px 0 0; }

body.intro-on .listing, body.intro-on .modes, body.intro-on .minimap, body.intro-on .rooms,
body.intro-on .cta, body.intro-on .tourbar, body.intro-on .demo-note { opacity: 0; pointer-events: none; }
.listing, .modes, .minimap, .rooms, .cta, .demo-note { transition: opacity 0.5s; }

@media (max-width: 1000px) {
  .rooms { max-width: calc(100vw - 32px); bottom: 80px; }
  .tourbar { bottom: 130px; }
  .demo-note { bottom: auto; top: 140px; }
}

@media (max-width: 760px) {
  :root { --gap: 10px; }
  .listing { width: auto; right: var(--gap); padding: 10px 14px; display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
  .listing .eyebrow, .listing .loc, .listing .facts { display: none; }
  .listing h1 { font-size: 16px; margin: 0; }
  .price { font-size: 15px; }
  .modes { top: 64px; }
  .modes button { padding: 7px 10px; font-size: 12px; }
  .minimap { width: 150px; padding: 6px; bottom: 62px; }
  .minimap canvas { height: 100px; }
  .room-now { font-size: 11px; padding-top: 4px; }
  .rooms { left: var(--gap); right: var(--gap); transform: none; max-width: none; bottom: var(--gap); }
  .cta { bottom: 66px; padding: 11px 16px; font-size: 13px; }
  .contact { bottom: 116px; }
  .tourbar { bottom: 200px; }
  #joystick { bottom: 210px; }
  .demo-note { top: 112px; right: var(--gap); }
  .intro-card h2 { font-size: 24px; }
}
