:root {
  color-scheme: dark;
  --bg: #050504;
  --panel: rgba(8, 7, 6, 0.9);
  --line: rgba(244, 214, 158, 0.25);
  --line-hot: rgba(244, 214, 158, 0.72);
  --text: #f7efe1;
  --muted: rgba(247, 239, 225, 0.62);
  --gold: #e0ad63;
  --fire: #ff6a1f;
  --radius: 8px;
  --ease: cubic-bezier(0.19, 1, 0.22, 1);
  --scene-aspect: 1.7778958555;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  overflow: hidden;
}

body {
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body.is-loading {
  cursor: wait;
}

button,
a {
  color: inherit;
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100svh;
  background:
    radial-gradient(circle at 8% 8%, rgba(224, 173, 99, 0.14), transparent 28rem),
    radial-gradient(circle at 92% 92%, rgba(72, 56, 40, 0.35), transparent 34rem),
    var(--bg);
  isolation: isolate;
}

.loader {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  background: #f4f0e7;
  color: #11100d;
  opacity: 1;
  transition:
    opacity 700ms ease,
    visibility 700ms ease;
}

.loader.is-hidden {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  display: grid;
  place-items: center;
}

.loader p {
  margin: 0;
  font-size: clamp(1rem, 2.2vw, 1.7rem);
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
  animation: loader-blink 1.45s ease-in-out infinite;
}

.topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: clamp(14px, 2vw, 24px);
  pointer-events: none;
}

.topbar-actions,
.menu-panel,
.modal {
  pointer-events: auto;
}

.topbar-actions {
  display: flex;
  gap: 8px;
}

.text-button,
.modal-action,
.modal-close {
  min-height: 38px;
  border: 1px solid rgba(244, 214, 158, 0.24);
  border-radius: var(--radius);
  background: rgba(5, 5, 4, 0.5);
  color: var(--text);
  padding: 0 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.32);
  transition:
    background 220ms ease,
    border-color 220ms ease,
    transform 220ms ease;
  backdrop-filter: blur(14px);
}

.text-button:hover,
.text-button:focus-visible,
.modal-action:hover,
.modal-action:focus-visible,
.modal-close:hover,
.modal-close:focus-visible {
  border-color: rgba(244, 214, 158, 0.62);
  background: rgba(35, 27, 18, 0.76);
  outline: none;
  transform: translateY(-1px);
}

.room-shell,
.scene-stage {
  position: fixed;
  inset: 0;
}

.scene-stage {
  display: flex;
  align-items: center;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  scrollbar-width: none;
  cursor: grab;
  overscroll-behavior: contain;
  touch-action: pan-x;
}

.scene-stage.is-dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.scene-stage::-webkit-scrollbar {
  display: none;
}

.scene-frame {
  position: relative;
  flex: 0 0 auto;
  width: max(100vw, calc(100svh * var(--scene-aspect)));
  height: 100svh;
  overflow: hidden;
  background: #111;
  box-shadow: inset 0 0 90px rgba(0, 0, 0, 0.35);
  transition:
    opacity 460ms ease,
    filter 620ms ease,
    transform 820ms var(--ease);
}

.room-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.32), transparent 22%, transparent 78%, rgba(0, 0, 0, 0.34)),
    linear-gradient(0deg, rgba(0, 0, 0, 0.18), transparent 35%, rgba(0, 0, 0, 0.15)),
    radial-gradient(circle at 50% 42%, transparent 42%, rgba(0, 0, 0, 0.16) 100%);
}

.hotspot-layer {
  position: absolute;
  inset: 0;
}

.hotspot {
  position: absolute;
  z-index: 3;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0;
  translate: -50% -50%;
  animation: hotspot-arrive 700ms var(--ease) both;
}

.hotspot--modal::before {
  content: "";
  position: absolute;
  inset: 15px;
  border: 1px solid var(--line-hot);
  border-radius: inherit;
  background: rgba(8, 7, 6, 0.2);
  box-shadow:
    0 0 0 0 rgba(244, 214, 158, 0.28),
    0 0 24px rgba(244, 214, 158, 0.28);
  opacity: 0.55;
  animation: pulse 3.1s ease-in-out infinite;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    background 220ms ease;
}

.hotspot--modal::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: inherit;
  background: #fff5dd;
  box-shadow: 0 0 18px rgba(244, 214, 158, 0.95);
  translate: -50% -50%;
}

.hotspot--modal:hover::before,
.hotspot--modal:focus-visible::before,
.hotspot--modal.is-armed::before {
  background: rgba(224, 173, 99, 0.14);
  opacity: 1;
  transform: scale(1.42);
}

.hotspot:focus-visible {
  outline: none;
}

.hotspot-label {
  position: absolute;
  left: 50%;
  bottom: calc(100% - 1px);
  width: max-content;
  max-width: min(260px, 48vw);
  border: 1px solid rgba(244, 214, 158, 0.3);
  border-radius: var(--radius);
  background: rgba(6, 5, 4, 0.78);
  color: var(--text);
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 220ms ease,
    transform 220ms ease;
  backdrop-filter: blur(12px);
}

.hotspot-label small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.63rem;
  font-weight: 650;
  text-transform: none;
}

.hotspot:hover .hotspot-label,
.hotspot:focus-visible .hotspot-label,
.hotspot.is-armed .hotspot-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.hotspot--room::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(244, 214, 158, 0.44), transparent);
  opacity: 0;
  transform: translate(-50%, 14px) scaleX(0.4);
  transform-origin: center;
  transition:
    opacity 320ms ease,
    transform 520ms var(--ease);
}

.hotspot-arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 31px;
  height: 20px;
  --arrow-rotation: 0deg;
  opacity: 0.82;
  transform: translate(-50%, -50%) rotate(var(--arrow-rotation));
  transition:
    opacity 260ms ease,
    transform 520ms var(--ease),
    filter 520ms var(--ease);
}

.hotspot-arrow::before {
  content: "";
  position: absolute;
  top: 9px;
  left: 1px;
  width: 28px;
  height: 2px;
  border-radius: 999px;
  background: #fff5dd;
  transform-origin: right center;
  box-shadow: 0 0 18px rgba(244, 214, 158, 0.78);
  transition: transform 520ms var(--ease);
}

.hotspot-arrow::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-top: 2px solid #fff5dd;
  border-right: 2px solid #fff5dd;
  transform: rotate(45deg);
  box-shadow: 4px -4px 12px rgba(244, 214, 158, 0.18);
}

.hotspot--dir-left .hotspot-arrow {
  --arrow-rotation: 180deg;
}

.hotspot--dir-up .hotspot-arrow {
  --arrow-rotation: -90deg;
}

.hotspot--dir-down .hotspot-arrow {
  --arrow-rotation: 90deg;
}

.hotspot--room:hover::before,
.hotspot--room:focus-visible::before,
.hotspot--room.is-armed::before {
  opacity: 1;
  transform: translate(-50%, 14px) scaleX(1);
}

.hotspot--room:hover .hotspot-arrow,
.hotspot--room:focus-visible .hotspot-arrow,
.hotspot--room.is-armed .hotspot-arrow {
  opacity: 1;
  filter: drop-shadow(0 0 14px rgba(244, 214, 158, 0.56));
  transform: translate(-50%, -50%) rotate(var(--arrow-rotation)) translateX(8px);
}

.hotspot--room:hover .hotspot-arrow::before,
.hotspot--room:focus-visible .hotspot-arrow::before,
.hotspot--room.is-armed .hotspot-arrow::before {
  transform: scaleX(1.22);
}

.hotspot--fire::before {
  background: linear-gradient(90deg, transparent, rgba(255, 106, 31, 0.7), transparent);
  box-shadow: 0 0 22px rgba(255, 106, 31, 0.32);
}

.hotspot--modal.hotspot--fire::after {
  width: 10px;
  height: 14px;
  border-radius: 10px 10px 10px 2px;
  background: linear-gradient(180deg, #ffe2a3, #ff8d2a 55%, #f04418);
  box-shadow: 0 0 28px rgba(255, 106, 31, 0.95);
  transform: rotate(42deg);
  animation: flame 1.2s ease-in-out infinite alternate;
}

.hotspot--fire .hotspot-arrow {
  filter: drop-shadow(0 0 12px rgba(255, 106, 31, 0.82));
}

.hotspot--fire .hotspot-arrow::before {
  background: #ffe2a3;
  box-shadow: 0 0 20px rgba(255, 106, 31, 0.95);
}

.hotspot--fire .hotspot-arrow::after {
  border-color: #ffe2a3;
}

.room-changing .scene-frame {
  opacity: 0;
  filter: blur(18px) brightness(0.72);
  transform: scale(1.018);
}

.menu-panel {
  position: fixed;
  z-index: 44;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(380px, calc(100vw - 46px));
  border-left: 1px solid rgba(244, 214, 158, 0.16);
  background: rgba(5, 5, 4, 0.88);
  box-shadow: -30px 0 95px rgba(0, 0, 0, 0.5);
  transform: translateX(104%);
  visibility: hidden;
  transition:
    transform 620ms var(--ease),
    visibility 620ms var(--ease);
  backdrop-filter: blur(22px);
}

.menu-panel.is-open {
  transform: translateX(0);
  visibility: visible;
}

.menu-panel-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 92px 28px 28px;
}

.eyebrow {
  margin: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
}

.menu-room-list {
  display: grid;
  gap: 2px;
  margin-top: 18px;
}

.menu-room-link {
  display: block;
  position: relative;
  min-height: 56px;
  border: 0;
  border-bottom: 1px solid rgba(247, 239, 225, 0.09);
  background: transparent;
  color: rgba(247, 239, 225, 0.54);
  padding: 0 0 0 22px;
  text-align: left;
  font-size: 1.5rem;
  font-weight: 820;
  line-height: 0.98;
  transition:
    color 220ms ease,
    transform 220ms ease;
}

.menu-room-link::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 0;
  width: 9px;
  height: 9px;
  background: #e0ad63;
  transform: scale(0.78);
  transition:
    transform 260ms var(--ease),
    background 260ms ease;
}

.menu-room-link:nth-child(2)::before {
  background: #b83b31;
}

.menu-room-link:nth-child(3)::before {
  background: #d7b947;
}

.menu-room-link:nth-child(4)::before {
  background: #315c86;
}

.menu-room-link:hover,
.menu-room-link:focus-visible,
.menu-room-link.is-active {
  color: var(--text);
  outline: none;
  transform: translateX(-4px);
}

.menu-room-link:hover::before,
.menu-room-link:focus-visible::before,
.menu-room-link.is-active::before {
  transform: scale(1);
}

.menu-foot {
  max-width: 250px;
  color: var(--muted);
  font-size: 0.86rem;
}

.menu-foot p {
  margin: 0;
}

.menu-foot a {
  display: inline-block;
  margin-top: 8px;
}

.modal-backdrop {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.48);
  opacity: 0;
  transition: opacity 260ms ease;
  backdrop-filter: blur(12px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop.is-open {
  opacity: 1;
}

.modal {
  position: relative;
  width: min(470px, 100%);
  border: 1px solid rgba(244, 214, 158, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(31, 25, 18, 0.96), rgba(7, 6, 5, 0.96));
  padding: 30px;
  box-shadow:
    0 38px 110px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  transform: translateY(18px) scale(0.98);
  transition: transform 320ms var(--ease);
}

.modal::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 22px;
  width: 34px;
  height: 8px;
  background:
    linear-gradient(90deg, #b83b31 0 28%, transparent 28% 38%, #d7b947 38% 66%, transparent 66% 76%, #315c86 76%);
  opacity: 0.9;
}

.modal-backdrop.is-open .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  min-height: 32px;
  padding: 0 10px;
  box-shadow: none;
}

.modal h2 {
  margin: 18px 0 12px;
  font-size: clamp(1.85rem, 6vw, 3rem);
  line-height: 0.94;
}

.modal p {
  margin: 0;
  color: var(--muted);
  white-space: pre-line;
}

.modal-action {
  display: none;
  margin-top: 22px;
  background: rgba(224, 173, 99, 0.12);
}

.modal-action.is-visible {
  display: inline-flex;
  align-items: center;
}

@keyframes pulse {
  0%,
  100% {
    box-shadow:
      0 0 0 0 rgba(244, 214, 158, 0.25),
      0 0 24px rgba(244, 214, 158, 0.28);
  }
  50% {
    box-shadow:
      0 0 0 16px rgba(244, 214, 158, 0),
      0 0 34px rgba(244, 214, 158, 0.38);
  }
}

@keyframes hotspot-arrive {
  from {
    opacity: 0;
    transform: scale(0.72);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes flame {
  from {
    transform: rotate(36deg) scale(0.9);
  }
  to {
    transform: rotate(47deg) scale(1.08);
  }
}

@keyframes loader-blink {
  0%,
  100% {
    opacity: 0.28;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 760px) {
  .text-button {
    min-height: 36px;
    padding: 0 12px;
  }

  .scene-stage {
    scroll-behavior: auto;
  }

  .scene-frame {
    width: max(100vw, calc(100svh * var(--scene-aspect)));
    height: 100svh;
  }

  .hotspot {
    width: 54px;
    height: 54px;
  }

  .hotspot-label {
    max-width: 190px;
  }

  .menu-panel {
    width: min(360px, calc(100vw - 32px));
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
