/* 全局样式 */
html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  background-color: #001f3f00; /* 深蓝色背景 */
  font-family: Arial, sans-serif;
}

/* 粒子容器样式 */
#particles-js {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  background-color: #181828; /* 深蓝色背景 */
  z-index: -1; /* 确保粒子背景位于标题后 */
}

/* 标题样式 */
.title {
  font-family: 'KaiTi', 'SimKai', serif; /* 正楷字体 */
  font-size: 100px;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3); /* 轻微阴影效果 */
  margin-top: 5px;
  position: relative;
  z-index: 1; /* 使标题位于雪花效果之上 */
  text-align: center;
}

/* 游戏容器样式 */
.game-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  width: 80%;
  max-width: 1200px;
  z-index: 1; /* 让游戏项层级高于粒子背景 */
}

/* 游戏项样式 */
.game-item {
  position: relative;
  width: 100%;
  height: 150px;
  background-color: #1d326d8e;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

/* 悬停效果 */
.game-item:hover {
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  transform: scale(1.05); /* 悬停时放大效果 */
}

/* 点击效果 */
.game-item:active {
  transform: scale(0.95); /* 点击时缩小效果 */
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* 游戏图标样式 */
.game-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.game-item:hover .game-icon {
  opacity: 0.8;
}

/* 游戏名称样式 */
.game-name {
  position: absolute;
  bottom: 10px;
  left: 10px;
  right: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 16px;
  color: #ffffff;
  background-color: rgba(0, 0, 0, 0.6); /* 背景透明度 */
  padding: 5px;
  border-radius: 5px;
  text-align: center;
}

/* 鼠标点击的动画效果 */
@keyframes click-feedback {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }

  50% {
    transform: scale(0.95);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  }

  100% {
    transform: scale(1);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
}

.game-item:active {
  animation: click-feedback 0.2s ease;
}

/* 媒体查询，针对小屏幕设备的样式调整 */
@media (max-width: 768px) {
  .title {
    font-size: 60px; /* 缩小标题字体大小 */
  }

  .game-container {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); /* 调整游戏项的最小宽度 */
  }

  .game-item {
    height: 120px; /* 缩小游戏项的高度 */
  }

  .game-name {
    font-size: 14px; /* 调整游戏名称字体大小 */
  }
}

@media (max-width: 480px) {
  .title {
    font-size: 40px; /* 更小的设备上进一步缩小标题 */
  }

  .game-item {
    height: 100px; /* 更小设备上的游戏项高度 */
  }

  .game-name {
    font-size: 12px; /* 更小设备上的游戏名称字体大小 */
  }
}
