/* === SVG ROOM DIAGRAMS === */
.room-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

.room-container h2 {
  margin-bottom: 8px;
}

.room-container .room-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.room-container .room-image {
  display: block;
  width: 100%;
  max-width: 700px;
  margin: 0 auto 24px;
  border: 1px solid var(--accent-gold-dim);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.55);
  filter: brightness(0.92) contrast(1.04);
}

.room-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Blueprint grid pattern */
.room-svg .blueprint-grid {
  stroke: #1a2a1a;
  stroke-width: 0.5;
}

/* Room walls */
.room-svg .wall {
  fill: var(--surface);
  stroke: var(--accent-gold);
  stroke-width: 2;
}

.room-svg .wall-inner {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 4 2;
}

/* Furniture outlines */
.room-svg .furniture {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
  stroke-dasharray: 3 2;
}

.room-svg .furniture-label {
  font-family: 'Courier New', monospace;
  font-size: 9px;
  fill: var(--text-secondary);
  text-anchor: middle;
}

/* Measurement annotations */
.room-svg .measurement {
  stroke: var(--border);
  stroke-width: 0.5;
  stroke-dasharray: 2 2;
}

.room-svg .measurement-text {
  font-family: 'Courier New', monospace;
  font-size: 8px;
  fill: var(--text-secondary);
  text-anchor: middle;
}

/* Hotspots */
.room-svg .hotspot {
  cursor: pointer;
  transition: all 0.2s ease;
}

.room-svg .hotspot-circle {
  fill: var(--accent-gold);
  opacity: 0.8;
  transform-origin: center;
  transform-box: fill-box;
  animation: hotspot-pulse 2s ease-in-out infinite;
}

.room-svg .hotspot:hover .hotspot-circle {
  opacity: 1;
  filter: drop-shadow(0 0 6px var(--accent-gold));
}

.room-svg .hotspot.visited .hotspot-circle {
  fill: var(--success);
  opacity: 0.6;
  animation: none;
}

.room-svg .hotspot-label {
  font-family: var(--font-body);
  font-size: 12px;
  fill: var(--text-primary);
  text-anchor: middle;
  pointer-events: none;
}

.room-svg .hotspot.visited .hotspot-label {
  fill: var(--text-secondary);
}

@keyframes hotspot-pulse {
  0%, 100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.3);
  }
}

/* Click ripple: a transient SVG circle injected into the same <g> as
   the hotspot, fading out as it scales up. */
.room-svg .hotspot-ripple {
  fill: none;
  stroke: var(--accent-gold);
  stroke-width: 1.6;
  pointer-events: none;
  transform-origin: center;
  transform-box: fill-box;
  animation: hotspot-ripple-out 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
  opacity: 0;
}

.room-svg .hotspot-ripple.success {
  stroke: var(--success);
}

@keyframes hotspot-ripple-out {
  0%   { opacity: 0.9; transform: scale(0.55); stroke-width: 2; }
  60%  { opacity: 0.5; }
  100% { opacity: 0;   transform: scale(3.6);  stroke-width: 0.6; }
}

@media (prefers-reduced-motion: reduce) {
  .room-svg .hotspot-ripple {
    animation: none !important;
    display: none !important;
  }
}

/* Door gaps */
.room-svg .doorway {
  stroke: var(--bg);
  stroke-width: 4;
}

/* === 3D Scene Container === */
.three-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 360px;
  background: #05070a;
  border: 1px solid var(--accent-gold-dim);
  overflow: hidden;
  box-shadow:
    inset 0 0 60px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(200, 169, 110, 0.08);
}

.three-container canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.three-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  letter-spacing: 0.1em;
  pointer-events: none;
  background:
    radial-gradient(ellipse at center, rgba(200, 169, 110, 0.04), transparent 70%),
    #05070a;
  animation: three-loading-pulse 1.6s ease-in-out infinite;
}

.three-container.ready .three-loading {
  display: none;
}

.three-container.failed .three-loading {
  animation: none;
  color: var(--danger);
}

@keyframes three-loading-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@media (max-width: 700px) {
  .three-container {
    min-height: 280px;
    aspect-ratio: 4 / 3;
  }
}

/* Navigation arrows between rooms */
.room-nav-links {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.room-nav-link {
  font-family: var(--font-body);
  font-size: 0.9rem;
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.room-nav-link:hover {
  border-color: var(--accent-gold);
  color: var(--accent-gold);
}

.room-nav-link::before {
  content: '\2192 ';
}
