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

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  /* Звёздное небо по всему фону страницы */
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255, 255, 255, 0.9) 0, transparent 50%),
    radial-gradient(1px 1px at 30% 80%, rgba(255, 255, 255, 0.8) 0, transparent 50%),
    radial-gradient(1px 1px at 70% 30%, rgba(255, 255, 255, 0.9) 0, transparent 50%),
    radial-gradient(1px 1px at 90% 60%, rgba(255, 255, 255, 0.7) 0, transparent 50%),
    radial-gradient(2px 2px at 20% 50%, rgba(255, 255, 255, 0.4) 0, transparent 60%),
    radial-gradient(2px 2px at 60% 10%, rgba(255, 255, 255, 0.5) 0, transparent 60%),
    radial-gradient(circle at top, #1a2340 0, #05060f 55%);
  color: #f5f5f5;
  overflow: hidden;
}

.app-root {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(5, 5, 15, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
}

.logo {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 14px;
  color: #ff8a65;
}

.hint {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.main-area {
  flex: 1;
  position: relative;
}

.viewport {
  position: absolute;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  background: transparent;
}

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

.house-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  will-change: transform;
}

.house-image {
  display: block;
  max-width: none; /* показываем в натуральном размере */
  height: auto;
  user-select: none;
  pointer-events: none;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.8);
  border-radius: 16px;
}

.room-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(5, 5, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 11px;
  color: #ffffff;
  white-space: nowrap;
  pointer-events: auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.7);
}

.room-tag:hover {
  background: rgba(255, 138, 101, 0.9);
  border-color: #ffab91;
  transform: translate(-50%, -50%) scale(1.05);
}

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

.room-link {
  position: absolute;
  pointer-events: auto;
  border-radius: 10px;
  text-decoration: none;
  /* невидимая область поверх белого квадратика */
}

.room-link::before {
  content: none;
}

.room-link:hover::before {
  opacity: 0;
}

.room-link::after {
  content: attr(data-tag);
  position: absolute;
  left: 50%;
  top: -6px;
  transform: translate(-50%, -100%);
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(5, 5, 15, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.8);
  font-size: 10px;
  color: #ffffff;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform-origin: center bottom;
  transition:
    opacity 0.12s ease,
    transform 0.12s ease;
}

.room-link:hover::after {
  opacity: 1;
  transform: translate(-50%, -115%);
}

.footer {
  position: fixed;
  right: 16px;
  bottom: 12px;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.creator-tag {
  color: #ffab91;
  font-weight: 600;
}

.creator-link {
  color: #ffab91;
  font-weight: 600;
  text-decoration: none;
}

.creator-link:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .hint {
    display: none;
  }
}

