/* 数学乐园子应用样式 */

.mode-select {
  text-align: center;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}

@media (max-width: 480px) {
  .mode-grid {
    grid-template-columns: 1fr;
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 768px) {
  .mode-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.mode-card {
  background: linear-gradient(135deg, #FFE66D, #FFF5CC);
  border: none;
  border-radius: var(--radius);
  padding: 20px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
  font-family: inherit;
}

.mode-card:nth-child(2) { background: linear-gradient(135deg, #4ECDC4, #A8E6E0); }
.mode-card:nth-child(3) { background: linear-gradient(135deg, #A29BFE, #DDD6FE); }

.mode-card:active {
  transform: scale(0.95);
}

.mode-icon {
  font-size: 2.4rem;
}

.mode-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text);
}

.mode-desc {
  font-size: 0.75rem;
  color: #666;
}

.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.score {
  font-size: 1rem;
  font-weight: bold;
  color: var(--primary);
  background: #fff;
  padding: 4px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.question {
  text-align: center;
  font-size: 1.4rem;
  font-weight: bold;
  color: var(--primary);
  margin: 16px 0;
}

.count-stage,
.compare-stage,
.shape-stage {
  text-align: center;
}

.count-objects {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  min-height: 80px;
  margin: 16px 0;
}

.count-objects .obj {
  font-size: 2.6rem;
  animation: pop 0.3s ease;
}

.count-answer {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.count-answer .option {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  border: none;
  background: #fff;
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
  font-family: inherit;
}

.count-answer .option:active {
  transform: scale(0.9);
}

.compare-stage {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 16px 0;
}

.compare-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.compare-group {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  max-width: 120px;
  justify-content: center;
  gap: 6px;
  min-height: 80px;
}

.compare-group .obj {
  font-size: 1.8rem;
}

.compare-label {
  font-size: 0.9rem;
  color: #666;
}

.compare-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin: 20px 0;
}

.shape-display {
  width: 120px;
  height: 120px;
  margin: 20px auto;
  animation: pop 0.3s ease;
}

.shape-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 16px 0;
}

.shape-options .option {
  padding: 10px 20px;
  border-radius: 14px;
  border: none;
  background: #fff;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s;
  font-family: inherit;
}

.shape-options .option:active {
  transform: scale(0.9);
}

.feedback {
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  min-height: 32px;
  margin-top: 8px;
}

.feedback.ok { color: var(--secondary); }
.feedback.no { color: var(--primary); }

/* SVG 形状颜色 */
.shape-svg {
  width: 100%;
  height: 100%;
}

.shape-svg .fill { fill: var(--secondary); }
.shape-svg .fill-red { fill: #FF6B6B; }
.shape-svg .fill-yellow { fill: #FFE66D; }
.shape-svg .fill-purple { fill: #A29BFE; }
.shape-svg .fill-green { fill: #55EFC4; }

/* ===== 题目进度条 ===== */
.q-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0;
  font-size: 0.9rem;
  color: #666;
}

.q-dots {
  display: flex;
  gap: 6px;
}

.q-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ddd;
  transition: background 0.3s, transform 0.3s;
}

.q-dot.current { background: var(--primary); transform: scale(1.3); }
.q-dot.correct { background: var(--secondary); }
.q-dot.wrong { background: #FF6B6B; }

/* 选项对错动画 */
.count-answer .option.correct {
  background: var(--secondary) !important;
  color: #fff;
  animation: bounce 0.5s ease;
}
.count-answer .option.wrong {
  background: var(--primary) !important;
  color: #fff;
  animation: wiggle 0.4s ease;
}
.shape-options .option.correct {
  background: var(--secondary) !important;
  color: #fff;
  animation: bounce 0.5s ease;
}
.shape-options .option.wrong {
  background: var(--primary) !important;
  color: #fff;
  animation: wiggle 0.4s ease;
}

/* ===== 通关庆祝 ===== */
.celebration {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.celebration-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow);
  max-width: 360px;
  width: 100%;
  animation: pop 0.5s ease;
}

.celebration-emoji {
  font-size: 4rem;
  animation: bounce 1s ease infinite;
}

.celebration-title {
  font-size: 1.8rem;
  color: var(--primary);
  margin: 12px 0 8px;
}

.celebration-text {
  font-size: 1rem;
  color: #666;
  margin-bottom: 12px;
}

.celebration-stars {
  font-size: 2rem;
  letter-spacing: 8px;
  margin: 12px 0;
}

.celebration-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}

/* 加一加专用 */
#addQuestion {
  font-size: 2rem !important;
}
