/* 基础样式 */

body {
  background-image: linear-gradient(to bottom right, #e0f7fa, #bbdefb);
  min-height: 100vh;
  /* font-family: "Noto Sans SC", "Microsoft YaHei", "微软雅黑", "PingFang SC", */
  /* "苹方", "Hiragino Sans GB", "STHeiti", "华文黑体", sans-serif; */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

/* 卡片样式 */
.card {
  perspective: 1000px;
  cursor: pointer;
  height: 100px;
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card-front {
  background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
  color: #fff;
  font-size: 2.5rem;
  font-weight: bold;
  /* font-family: "Ma Shan Zheng", "Microsoft YaHei", "微软雅黑", "PingFang SC",
    "苹方", "STHeiti", "华文黑体", cursive; */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

.card-back {
  background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
  color: #333;
  transform: rotateY(180deg);
  font-size: 1.8rem;
  font-weight: bold;
  font-family: "Noto Sans SC", "Microsoft YaHei", "微软雅黑", "PingFang SC",
    "苹方", sans-serif;
}

/* 匹配和不匹配的卡片样式 */
.selected {
  box-shadow: 0 0 0 3px #4caf50;
}

.matched {
  animation: matched 1s;
  visibility: hidden;
}

.not-matched {
  animation: notMatched 0.5s;
}

/* 动画效果 */
@keyframes matched {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(0);
    opacity: 0;
  }
}

@keyframes notMatched {
  0%,
  100% {
    transform: translateX(0);
  }
  20%,
  60% {
    transform: translateX(-10px);
  }
  40%,
  80% {
    transform: translateX(10px);
  }
}

/* 分数增加动画 */
.score-animation {
  position: absolute;
  color: #4caf50;
  font-weight: bold;
  animation: scoreUp 1s forwards;
  pointer-events: none;
}

@keyframes scoreUp {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-50px);
  }
}

/* 关卡完成动画 */
.level-complete {
  animation: levelComplete 1s;
}

@keyframes levelComplete {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* 按钮动画 */
.btn-bounce {
  animation: bounce 0.5s;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 响应式调整 */
@media (max-width: 640px) {
  .card {
    height: 80px;
  }
  .card-front {
    font-size: 2rem;
  }
  .card-back {
    font-size: 1.5rem;
  }
}
