/* ===============================
   Mapping ページ全体設定
   =============================== */

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
}

/* ===============================
   Mapping レイアウト
   =============================== */

#mappingWrapper {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;
  height: 100%;
  gap: 10px;
  box-sizing: border-box;
  background: transparent;
}

/* ===============================
   フロアマップ（Leaflet）
   =============================== */

#floor-map {
  position: fixed;
  top: 12px;
  left: 12px;
  width: 300px;
  height: 300px;
  transform: scale(0.3);
  transform-origin: top left;
  border-radius: 12px;
  z-index: 9999;
  opacity: 0.6;
  overflow: visible;
}

#floor-map::after {
  content: "クリックで拡大";
  position: absolute;
  bottom: -32px;
  left: 0;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  opacity: 0;
  transform: scale(3.33) translateY(5px);
  transform-origin: top left;
  transition: 0.2s;
  pointer-events: none;
}

#floor-map:hover::after {
  transform: scale(3.33) translateY(0);
  opacity: 1;
}

#floor-map.expanded {
  transform: scale(1);
  transform-origin: top left;
  width: 300px;
  height: 300px;
  opacity: 1;
}

#floor-map.expanded::after {
  display: none;
}

.leaflet-image-layer {
  opacity: 1;
}

.leaflet-container {
  background: transparent !important;
}

#floor-map:not(.expanded) .leaflet-interactive {
  pointer-events: none;
}

/* ===============================
   PSV Viewer（Mapping用）
   =============================== */

#viewer {
  flex: 1;
  height: 100%;
  position: relative;
  background: transparent;
  border-radius: 8px;
  overflow: hidden;
}

/* ===============================
   レスポンシブ（モバイル）
   =============================== */

@media (max-width: 768px) {
  #mappingWrapper {
    flex-direction: column;
    min-height: 100dvh;
  }

  #floor-map {
    transform: scale(0.2);
  }

  #viewer {
    width: 100%;
    height: 100%;
  }
}

/* ===============================
   Overlay（Mapping用）
   =============================== */

#overlayImage,
#overlayVideo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
  z-index: 999;

  border-radius: 8px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  object-fit: contain;

  max-width: 100%;
  max-height: 100%;
}

/* ===============================
   現在の部屋表示（アンティークブラウン版）
   =============================== */
#room-title {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);

  background: rgba(101, 67, 33, 0.6); /* アンティークブラウン半透明 */
  color: #f5f5dc; /* ベージュ文字 */

  padding: 6px 14px;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;

  z-index: 500;
  pointer-events: none; /* マーカーなどの操作を妨げない */

  /* 文字を少しシャドウで読みやすく */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}
