/* 识字大冒险 - 样式 */

/* ===== 进度总览 ===== */
.progress-overview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

.progress-bar-bg {
  flex: 1;
  height: 16px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary), #FF8E8E);
  border-radius: 10px;
  transition: width 0.5s ease;
}

.progress-text {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--primary);
  white-space: nowrap;
}

/* ===== 关卡网格 ===== */
.level-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 12px;
}

@media (min-width: 768px) {
  .level-grid { grid-template-columns: repeat(3, 1fr); }
}

.level-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.level-card:active {
  transform: scale(0.95);
}

.level-card.locked {
  opacity: 0.5;
  cursor: not-allowed;
}

.level-card.locked:active {
  transform: none;
}

.level-icon {
  font-size: 2.6rem;
  display: block;
  margin-bottom: 8px;
}

.level-name {
  font-size: 1.1rem;
  font-weight: bold;
  color: var(--text);
  margin-bottom: 4px;
}

.level-desc {
  font-size: 0.78rem;
  color: #888;
}

.level-stars {
  margin-top: 8px;
  font-size: 0.9rem;
  letter-spacing: 2px;
}

.level-lock {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.2rem;
}

/* 关卡配色 */
.level-card:nth-child(1) { background: linear-gradient(135deg, #FFE66D, #FFF5CC); }
.level-card:nth-child(2) { background: linear-gradient(135deg, #4ECDC4, #A8E6E0); }
.level-card:nth-child(3) { background: linear-gradient(135deg, #FF8A9E, #FFD4DC); }
.level-card:nth-child(4) { background: linear-gradient(135deg, #A29BFE, #DDD6FE); }
.level-card:nth-child(5) { background: linear-gradient(135deg, #55EFC4, #B8F5E0); }

/* ===== 游戏区域 ===== */
.game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.game-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stage-badge {
  background: var(--primary);
  color: #fff;
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 0.9rem;
  font-weight: bold;
}

.score {
  font-size: 1rem;
  font-weight: bold;
  color: var(--primary);
  background: #fff;
  padding: 4px 14px;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

/* ===== 题目进度 ===== */
.question-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;
}

.q-dot.current { background: var(--primary); transform: scale(1.3); }
.q-dot.correct { background: var(--secondary); }
.q-dot.wrong { background: #FF6B6B; }

/* ===== 题目内容 ===== */
.question-content {
  text-align: center;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.question-prompt {
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--primary);
  margin-bottom: 16px;
}

/* 看图认字 - 图片展示 */
.big-emoji {
  font-size: 5rem;
  margin: 12px 0;
  animation: pop 0.4s ease;
}

.speak-hint {
  font-size: 0.85rem;
  color: #aaa;
  margin-top: 4px;
}

/* 选项按钮 */
.char-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
}

.char-option {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  border: none;
  background: #fff;
  font-size: 2.2rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, background 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.char-option:active {
  transform: scale(0.9);
}

.char-option.correct {
  background: var(--secondary);
  color: #fff;
  animation: bounce 0.5s ease;
}

.char-option.wrong {
  background: var(--primary);
  color: #fff;
  animation: wiggle 0.4s ease;
}

.char-option.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* 选字配图 - 四张图片选 */
.pic-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 16px;
  max-width: 320px;
}

.pic-option {
  aspect-ratio: 1;
  border-radius: 16px;
  border: none;
  background: #fff;
  font-size: 3rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, background 0.2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pic-option:active {
  transform: scale(0.92);
}

.pic-option.correct {
  background: var(--secondary);
  animation: bounce 0.5s ease;
}

.pic-option.wrong {
  background: var(--primary);
  opacity: 0.6;
  animation: wiggle 0.4s ease;
}

/* 汉字拼写 - 拼字游戏 */
.spell-target {
  font-size: 1.2rem;
  color: #666;
  margin-bottom: 8px;
}

.spell-display {
  display: flex;
  gap: 8px;
  margin: 12px 0;
  min-height: 70px;
  align-items: center;
  justify-content: center;
}

.spell-slot {
  width: 60px;
  height: 60px;
  border: 3px dashed #ccc;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary);
  background: rgba(255,255,255,0.5);
  transition: border-color 0.2s, background 0.2s;
}

.spell-slot.filled {
  border-style: solid;
  border-color: var(--secondary);
  background: #fff;
}

.spell-pool {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.spell-tile {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), #FFF5CC);
  font-size: 1.8rem;
  font-weight: bold;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s, opacity 0.2s;
  font-family: inherit;
}

.spell-tile:active {
  transform: scale(0.9);
}

.spell-tile.used {
  opacity: 0.2;
  pointer-events: none;
}

/* ===== 反馈 ===== */
.feedback {
  text-align: center;
  font-size: 1.3rem;
  font-weight: bold;
  min-height: 32px;
  margin-top: 12px;
}

.feedback.ok { color: var(--secondary); }
.feedback.no { color: var(--primary); }

/* ===== 下一题 ===== */
.next-area {
  text-align: center;
  margin-top: 16px;
}

.btn-next {
  font-size: 1.1rem;
  padding: 12px 32px;
}

/* ===== 通关庆祝 ===== */
.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;
}

.btn-back.center {
  display: block;
  margin: 12px auto 0;
}

/* TV 端适配 */
@media (min-width: 1600px) {
  .level-grid {
    grid-template-columns: repeat(5, 1fr);
    max-width: 1000px;
  }

  .level-icon { font-size: 3.5rem; }
  .level-name { font-size: 1.4rem; }
  .big-emoji { font-size: 7rem; }
  .char-option { width: 110px; height: 110px; font-size: 3rem; }
  .pic-option { font-size: 4rem; }
  .spell-slot { width: 80px; height: 80px; font-size: 2.8rem; }
  .spell-tile { width: 76px; height: 76px; font-size: 2.4rem; }
}

/* TV 焦点 */
.level-card:focus-visible,
.char-option:focus-visible,
.pic-option:focus-visible,
.spell-tile:focus-visible {
  outline: 4px solid var(--primary);
  outline-offset: 4px;
}