#fade {
  position: fixed;
  inset: 0;
  background: #05030a;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.42s ease;
  z-index: 20;
}
#fade.active {
  opacity: 1;
}

#hud {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  font-family: 'Courier New', monospace;
  color: #f2ecff;
}

#room-label {
  position: absolute;
  top: 22px;
  left: 24px;
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: 0.25em;
  background: rgba(10, 6, 22, 0.55);
  border: 1px solid rgba(200, 107, 255, 0.5);
  border-radius: 4px;
  text-shadow: 0 0 8px rgba(200, 107, 255, 0.8);
  backdrop-filter: blur(2px);
}

#prompt {
  position: absolute;
  bottom: 90px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 22px;
  font-size: 14px;
  letter-spacing: 0.12em;
  background: rgba(10, 6, 22, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  text-shadow: 0 0 8px rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}
#prompt.hidden {
  display: none;
}

#start-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: radial-gradient(circle at 50% 40%, rgba(123, 47, 247, 0.25), rgba(5, 3, 10, 0.85));
  cursor: pointer;
  font-family: 'Courier New', monospace;
  color: #f2ecff;
  text-align: center;
}
#start-overlay.hidden {
  display: none;
}
#start-overlay h1 {
  margin: 0;
  font-size: clamp(28px, 6vw, 52px);
  letter-spacing: 0.35em;
  text-shadow: 0 0 24px #c86bff, 0 0 48px #7b2ff7;
}
#start-overlay p {
  margin: 0;
  opacity: 0.85;
  letter-spacing: 0.08em;
}
#start-hint {
  font-size: 13px;
  opacity: 0.6;
  margin-top: 6px;
}

#gallery-link {
  position: absolute;
  bottom: 20px;
  left: 20px;
  padding: 10px 20px;
  background: #b48eff;
  color: #0a0616;
  font-weight: 700;
  text-decoration: none;
  border-radius: 5px;
  pointer-events: auto;
  letter-spacing: 0.05em;
}
#gallery-link.hidden {
  display: none;
}

#touch-pad {
  position: absolute;
  bottom: 24px;
  right: 24px;
  display: grid;
  grid-template-columns: repeat(3, 54px);
  grid-template-rows: repeat(2, 54px);
  gap: 6px;
  pointer-events: auto;
}
#touch-pad.hidden {
  display: none;
}
#touch-pad button {
  grid-column: auto;
  border-radius: 8px;
  border: 1px solid rgba(200, 107, 255, 0.5);
  background: rgba(10, 6, 22, 0.55);
  color: #f2ecff;
  font-family: 'Courier New', monospace;
  font-size: 18px;
  touch-action: none;
}
#touch-pad [data-dir="forward"] { grid-column: 2; grid-row: 1; }
#touch-pad [data-dir="left"] { grid-column: 1; grid-row: 2; }
#touch-pad [data-dir="backward"] { grid-column: 2; grid-row: 2; }
#touch-pad [data-dir="right"] { grid-column: 3; grid-row: 2; }
