body {
  margin: 0;
  background: black;
  overflow-x: hidden; /* กันล้นแนวนอน */
  position: relative;
}

#matrixCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.grid-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  position: relative;
  z-index: 1;
  padding: 20px;
  box-sizing: border-box;
}

.grid-item {
  cursor: pointer;
  text-align: center;
  flex: 0 0 calc(20% - 10px); /* เริ่มต้น 5 คนต่อแถว */
}

.grid-item img {
  height: 200px;
  width: auto;
  display: block;
  border-radius: 8px;
  animation: pulse 2s infinite ease-in-out;
}

.caption {
  color: white;
  margin-top: 5px;
  font-size: 14px;
}

/* เอฟเฟกต์เด้งเข้าออก */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

/* จอเล็ก: 2 คนต่อแถว */
@media (max-width: 768px) {
  .grid-item {
    flex: 0 0 calc(50% - 10px);
  }
}
