/* 游戏中心样式 */

.page-title {
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
  text-align: center;
  margin: 30px 0;
}

/* 游戏网格 */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.game-card {
  background: white;
  border-radius: 16px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s;
  border-top: 4px solid #667eea;
}

.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.game-icon {
  font-size: 4rem;
  margin-bottom: 20px;
}

.game-card h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 10px;
}

.game-card p {
  color: #7f8c8d;
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

/* 游戏区域 */
.game-area {
  background: white;
  border-radius: 16px;
  padding: 30px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #f0f0f0;
}

.game-header h2 {
  font-size: 1.5rem;
  color: #2c3e50;
  margin: 0;
}

.game-score {
  font-size: 1.2rem;
  font-weight: 600;
  color: #667eea;
}

.game-score span {
  font-size: 1.5rem;
  font-weight: 700;
}

.game-content {
  min-height: 300px;
  margin-bottom: 20px;
}

.game-controls {
  text-align: center;
}

/* 记忆翻牌 */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 15px;
  max-width: 600px;
  margin: 0 auto;
}

.memory-card {
  aspect-ratio: 1;
  perspective: 1000px;
  cursor: pointer;
}

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

.memory-card.flipped .card-inner,
.memory-card.matched .card-inner {
  transform: rotateY(180deg);
}

.card-front,
.card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1.5rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.card-front {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.card-back {
  background: white;
  color: #2c3e50;
  transform: rotateY(180deg);
}

.memory-card.matched .card-back {
  background: #6BCB77;
  color: white;
}

/* 拼写挑战 */
.spelling-container {
  max-width: 500px;
  margin: 0 auto;
  text-align: center;
}

.hint {
  font-size: 5rem;
  margin-bottom: 30px;
}

.word-display {
  min-height: 60px;
  margin-bottom: 30px;
}

.display-letters {
  display: flex;
  gap: 15px;
  justify-content: center;
}

.display-letter {
  width: 50px;
  height: 50px;
  background: #667eea;
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
}

.letters-grid {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.letter-btn {
  width: 50px;
  height: 50px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #2c3e50;
}

.letter-btn:hover:not(:disabled) {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-2px);
}

.letter-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* 单词接龙 */
.word-chain-container {
  max-width: 500px;
  margin: 0 auto;
}

.last-letter {
  font-size: 1.2rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 20px;
}

.word-input {
  width: 100%;
  padding: 15px 20px;
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  font-size: 1.1rem;
  margin-bottom: 15px;
  transition: border-color 0.3s;
}

.word-input:focus {
  outline: none;
  border-color: #667eea;
}

.word-history {
  margin-top: 30px;
  max-height: 200px;
  overflow-y: auto;
}

.history-item {
  padding: 10px 15px;
  background: #f8f9ff;
  border-radius: 8px;
  margin-bottom: 10px;
  font-size: 1rem;
  color: #2c3e50;
}

/* 响应式 */
@media (max-width: 768px) {
  .games-grid {
    grid-template-columns: 1fr;
  }

  .memory-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .letter-btn {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }

  .display-letter {
    width: 45px;
    height: 45px;
    font-size: 1.3rem;
  }
}
