/* ─── Room hotspots ─── */
.room-hotspot {
  position: absolute;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .25s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.room-hotspot .room-label {
  display: none;
  /* floor plan images already show room numbers */
}

.room-hotspot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-sm);
  background: rgba(255, 95, 5, .12);
  transition: background .25s;
}

.room-hotspot:hover {
  border-color: var(--accent);
  box-shadow: 0 0 24px var(--accent-glow), inset 0 0 20px rgba(255, 95, 5, .1);
}

.room-hotspot:hover::after {
  background: rgba(255, 95, 5, .25);
}

/* ─── Coral flagpole branches ─── */
@keyframes gentle-sway {

  0%,
  100% {
    transform: rotate(-1.5deg);
  }

  50% {
    transform: rotate(1.5deg);
  }
}

@keyframes flagpole-in {
  from {
    opacity: 0;
    transform: translateX(-50%) scaleY(0);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) scaleY(1);
  }
}

/* ── Compact chip (default view) ── */
.domain-chip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(10, 35, 75, 0.78);
  border: 1px solid rgba(80, 180, 255, 0.3);
  backdrop-filter: blur(4px);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 2;
}

.domain-chip-emojis {
  font-size: 14px;
  letter-spacing: 1px;
  line-height: 1;
}

.domain-chip-count {
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1;
}

/* hide chip when expanded */
.room-hotspot.expanded .domain-chip {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.8);
  pointer-events: none;
}

/* ── Flagpole (expanded view) ── */
.coral-flagpole {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
}

.room-hotspot.expanded .coral-flagpole,
.room-hotspot.coral-auto .coral-flagpole {
  opacity: 1;
  pointer-events: auto;
}

.coral-branches {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding-bottom: 4px;
}

.coral-col {
  display: flex;
  flex-direction: column-reverse;
  gap: 3px;
}

.coral-col-left {
  align-items: flex-end;
}

.coral-col-right {
  align-items: flex-start;
}

.coral-branch {
  animation: gentle-sway 5s ease-in-out infinite;
}

.coral-tag {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(10, 35, 75, 0.85);
  border: 1px solid rgba(80, 180, 255, 0.35);
  border-radius: 4px;
  padding: 2px 7px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(6px);
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}

/* ── Z-index layering: expanded room on top of neighbors ── */
.room-hotspot.expanded,
.room-hotspot.selected {
  z-index: 50 !important;
}

.room-hotspot.expanded .coral-flagpole {
  z-index: 60;
}

/* Dim neighboring chips when any room on the floor is expanded */
.floor-layer.has-expanded .room-hotspot:not(.expanded):not(.selected) .domain-chip {
  opacity: 0.15;
  transition: opacity .3s ease;
}

.room-hotspot.selected {
  border-color: var(--teal);
  box-shadow: 0 0 30px rgba(29, 88, 167, .35), inset 0 0 20px rgba(29, 88, 167, .1);
}

.room-hotspot.selected::after {
  background: rgba(29, 88, 167, .2);
}
