.world-room-view {
  position: relative;
  width: 100%;
  min-height: 390px;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  isolation: isolate;
  contain: layout paint;
  border: 1px solid rgba(192, 175, 224, 0.24);
  border-radius: 1.15rem;
  background: #151729;
  box-shadow:
    0 1.4rem 3.5rem rgba(8, 7, 20, 0.28),
    inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.world-canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  background: #151729;
  outline: none;
  touch-action: pan-y;
}

.world-object-controls {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
}

.world-object-button {
  position: absolute;
  min-width: 3.55rem;
  min-height: 2.95rem;
  padding: 0.42rem 0.72rem;
  border: 1px solid rgba(255, 220, 152, 0.35);
  border-radius: 10px;
  color: #fff6dd;
  background: transparent;
  box-shadow: 0 0 10px rgba(255, 211, 127, 0.12);
  font:
    600 0.77rem/1.1 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transform: translate3d(-50%, -50%, 0);
  pointer-events: auto;
  cursor: pointer;
  transition:
    opacity 160ms ease,
    border-color 160ms ease,
    box-shadow 180ms ease,
    background-color 160ms ease;
}

.world-object-button[data-active="true"] {
  border-color: rgba(255, 231, 169, 0.96);
  background: rgba(105, 72, 47, 0.82);
  box-shadow:
    0 0 0 0.16rem rgba(255, 208, 115, 0.14),
    0 0 0.9rem rgba(255, 201, 108, 0.3),
    0 0.45rem 1.15rem rgba(4, 3, 16, 0.34);
}

.world-object-button:hover:not(:disabled) {
  transform: translate3d(-50%, -50%, 0);
  background: rgba(255, 211, 127, 0.1);
}

.world-object-connector {
  position: absolute;
  left: 50%;
  top: 50%;
  height: 1px;
  background: #e6c38a99;
  transform-origin: left center;
  pointer-events: none;
  z-index: -1;
}

.world-object-number {
  position: absolute;
  top: -7px;
  left: -5px;
  display: grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #18252ddd;
  border: 1px solid #d0ae78;
  color: #f4daa6;
  font-size: 10px;
  pointer-events: none;
}
.world-object-name {
  position: absolute;
  top: calc(100% + 3px);
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 5px;
  border-radius: 5px;
  background: #111b23cc;
  font-size: 10px;
  color: #f5e7cb;
  white-space: nowrap;
  pointer-events: none;
}

.world-object-button:focus-visible,
.world-error-retry:focus-visible {
  outline: 2px solid #c4e5ff;
  outline-offset: 3px;
}

.world-object-button:disabled {
  opacity: 0.34;
  border-color: rgba(214, 213, 233, 0.32);
  color: rgba(239, 236, 255, 0.62);
  background: rgba(30, 28, 53, 0.54);
  box-shadow: none;
  cursor: default;
  pointer-events: none;
}

.world-object-button[data-answered="true"] .world-object-number {
  color: rgba(208, 236, 214, 0.9);
  font-weight: 700;
}

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

.world-error-panel {
  position: absolute;
  z-index: 7;
  inset: 1rem;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.65rem;
  padding: 1.25rem;
  border: 1px solid rgba(255, 218, 175, 0.42);
  border-radius: 0.9rem;
  color: #fff3dd;
  background: rgba(19, 18, 37, 0.94);
  box-shadow: 0 1rem 2rem rgba(3, 2, 12, 0.42);
  text-align: center;
  font-family:
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}

.world-error-panel strong {
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.world-error-panel span {
  max-width: 32rem;
  color: rgba(255, 243, 221, 0.78);
  font-size: 0.88rem;
}

.world-error-retry {
  min-height: 2.35rem;
  padding: 0.48rem 0.85rem;
  border: 1px solid rgba(255, 221, 170, 0.72);
  border-radius: 999px;
  color: #251a26;
  background: #ffe0a0;
  font:
    700 0.84rem/1 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  cursor: pointer;
}

@media (max-width: 720px) {
  .world-room-view {
    width: 100%;
    min-height: 520px;
    aspect-ratio: 4 / 5;
    border-radius: 0.85rem;
  }

  .world-object-button {
    min-width: 44px;
    width: 18%;
    max-width: 76px;
    min-height: 2.9rem;
    padding-inline: 3px;
    font-size: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  .world-object-button {
    transition: none;
  }
}
