:root {
  --amber: #e7b45f;
  --amber-soft: rgba(231, 180, 95, 0.35);
  --ink: rgba(9, 12, 22, 0.72);
  --card-border: rgba(236, 198, 132, 0.25);
  --text-main: #edf1ff;
  --text-soft: #b8c5f4;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background: #050811;
  overflow: hidden;
}

.world {
  position: relative;
  width: 100vw;
  height: 100vh;
}

/* Room base layer: background GIF */
.room-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-x pan-y;
  user-select: none;
}

.room-container.dragging {
  cursor: grabbing;
}

.room-map {
  position: absolute;
  left: 0;
  top: 0;
  width: 1600px;
  height: 900px;
  will-change: transform;
}

.room-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transform: none;
  filter: brightness(1.4) contrast(1.1);
  user-select: none;
  pointer-events: none;
}

.background-layer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      circle at 50% 50%,
      rgba(74, 119, 255, 0.08),
      rgba(3, 6, 16, 0.15) 62%
    ),
    linear-gradient(to bottom, rgba(4, 7, 18, 0.06), rgba(3, 5, 12, 0.15));
}

.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, 0.04) 0.4px, transparent 0.4px);
  background-size: 3px 3px;
  mix-blend-mode: soft-light;
  opacity: 0.16;
}

.aurora {
  position: fixed;
  inset: -30%;
  pointer-events: none;
  background: conic-gradient(
    from 220deg,
    rgba(53, 109, 255, 0.22),
    rgba(231, 180, 95, 0.06),
    rgba(86, 208, 255, 0.14),
    rgba(53, 109, 255, 0.2)
  );
  filter: blur(80px);
  animation: drift 14s ease-in-out infinite alternate;
}

.discovery-hint {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 11;
  pointer-events: none;
  color: rgba(231, 180, 95, 0.92);
  font-size: 0.92rem;
  font-style: italic;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: whisperHint 2.5s ease forwards;
  animation-delay: 1.5s;
}

/* Always-visible explore text (top center) */
.explore-text {
  position: fixed;
  top: clamp(10px, 2.2vh, 18px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 11;
  pointer-events: none;
  color: rgba(231, 180, 95, 0.95);
  font-size: 0.9rem;
  font-style: italic;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.explore-text .letter {
  display: inline-block;
  animation: exploreGlitter 2.2s ease-in-out infinite;
  animation-delay: calc(var(--i) * 0.11s);
  text-shadow: 0 0 0 rgba(231, 180, 95, 0);
}

@keyframes exploreGlitter {
  0%,
  100% {
    opacity: 0.72;
    text-shadow: 0 0 0 rgba(231, 180, 95, 0);
  }
  40% {
    opacity: 1;
    text-shadow: 0 0 10px rgba(231, 180, 95, 0.55),
      0 0 22px rgba(231, 180, 95, 0.22);
  }
  70% {
    opacity: 0.78;
    text-shadow: 0 0 6px rgba(231, 180, 95, 0.35),
      0 0 14px rgba(231, 180, 95, 0.18);
  }
}

@keyframes whisperHint {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(8px);
  }
  30% {
    opacity: 0.82;
    transform: translate(-50%, -50%) translateY(0px);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) translateY(-8px);
  }
}

.scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.hotspot {
  position: absolute;
  z-index: 9999;
  isolation: isolate;
  width: clamp(20px, 2.5vw, 35px);
  height: clamp(20px, 2.5vw, 35px);
  border: none;
  border-radius: 999px;
  background: transparent;
  pointer-events: all;
  touch-action: auto;
  cursor: pointer !important;
  transform: translate(-50%, -50%);
  outline: none;
}

.hotspot::before {
  content: "";
  position: absolute;
  inset: 0%;
  border-radius: 999px;
  border: 2px solid #d4a04a;
  opacity: 0.35;
  animation: emberRipple 2.5s ease-in-out infinite;
}

.hotspot::after {
  content: "";
  position: absolute;
  inset: 0%;
  border-radius: 999px;
  opacity: 0.5;
  box-shadow: 0 0 15px rgba(212, 160, 74, 1);
  animation: candlePulse 2.5s ease-in-out infinite;
}

.hotspot:hover::before,
.hotspot:focus-visible::before,
.hotspot.is-active::before {
  opacity: 0.75;
}

.hotspot:hover::after,
.hotspot:focus-visible::after,
.hotspot.is-active::after {
  opacity: 1;
  animation: candlePulseBright 2.5s ease-in-out infinite;
}

.hotspot:hover,
.hotspot:focus-visible,
.hotspot.is-active {
  backdrop-filter: blur(0.5px);
  cursor: pointer !important;
}

.whisper-card {
  position: fixed;
  z-index: 10;
  right: clamp(16px, 3.5vw, 36px);
  bottom: clamp(16px, 4vh, 36px);
  width: min(540px, calc(100vw - 22px));
  max-height: min(75vh, 680px);
  padding: 22px 22px 20px;
  border-radius: 22px;
  background: linear-gradient(
    130deg,
    rgba(13, 18, 34, 0.78),
    rgba(13, 16, 30, 0.58)
  );
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 50px rgba(6, 8, 18, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(12px);
  overflow: auto;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 260ms ease, transform 260ms ease;
}

.whisper-card.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.whisper-glow {
  position: absolute;
  top: -30%;
  right: -16%;
  width: 50%;
  aspect-ratio: 1/1;
  border-radius: 999px;
  filter: blur(30px);
  background: radial-gradient(circle at center, rgba(231, 180, 95, 0.24), rgba(231, 180, 95, 0));
  pointer-events: none;
}

.close-card {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text-soft);
  background: rgba(7, 10, 19, 0.6);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.card-eyebrow {
  margin: 0;
  color: rgba(231, 180, 95, 0.9);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  font-size: 0.7rem;
}

.card-title {
  margin: 8px 0 14px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 600;
}

.card-content {
  color: var(--text-soft);
  font-size: 0.97rem;
  line-height: 1.58;
}

.card-content p {
  margin: 0 0 10px;
}

.card-content ul {
  margin: 0;
  padding-left: 18px;
}

.card-content a {
  color: #ffd089;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 208, 137, 0.4);
}

.dock {
  position: fixed;
  z-index: 9;
  left: clamp(14px, 2.6vw, 26px);
  bottom: clamp(14px, 2.4vw, 24px);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dock a {
  text-decoration: none;
  color: rgba(219, 231, 255, 0.9);
  background: rgba(8, 13, 24, 0.45);
  border: 1px solid rgba(183, 196, 240, 0.26);
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 0.82rem;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(231, 180, 95, 0.55);
  }
  70% {
    box-shadow: 0 0 0 18px rgba(231, 180, 95, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(231, 180, 95, 0);
  }
}

@keyframes drift {
  from {
    transform: translate3d(-3%, -1%, 0) rotate(0deg);
  }
  to {
    transform: translate3d(4%, 2%, 0) rotate(15deg);
  }
}

@keyframes candlePulse {
  0%,
  100% {
    opacity: 0.5;
    box-shadow: 0 0 15px rgba(212, 160, 74, 1);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 15px rgba(212, 160, 74, 1);
  }
}

@keyframes candlePulseBright {
  0%,
  100% {
    opacity: 0.85;
    box-shadow: 0 0 15px rgba(212, 160, 74, 1);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 15px rgba(212, 160, 74, 1);
  }
}

@keyframes emberRipple {
  0% {
    transform: scale(1);
    opacity: 0.55;
  }
  70% {
    transform: scale(1.45);
    opacity: 0.1;
  }
  100% {
    transform: scale(1.55);
    opacity: 0.02;
  }
}

@media (max-width: 768px) {
  .background-layer {
    background-size: contain;
    background-position: center;
    background-color: #05050f;
    transform: none;
  }

  .whisper-card {
    left: 10px;
    right: 10px;
    width: auto;
    bottom: 10px;
    max-height: 56vh;
    padding: 18px 16px 16px;
  }

  .close-card {
    top: 8px;
    right: 8px;
  }
}
