/* ====== 幼儿学习工具统一层（学数字 / 学拼音 / 学单词）======
 * 面向幼儿 · 手机紧凑布局 · 在 common.css + kids.css 之后加载
 * 统一：页面容器 / 标题 / 菜单按钮 / 顶栏 / 进度条 / 答题按钮 / 结算页
 * 各工具保留自己的功能结构与难度/模式配色（按钮渐变只统一样式，不覆盖语义色）
 */

/* ===== 页面容器统一：卡片式，紧凑 ===== */
body {
  margin: 0;
  padding: 0;
  background: linear-gradient(180deg, #FFF6EC 0%, #FFE9F0 100%);
  font-family: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', 'PingFang SC', sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  overflow-y: auto;
  min-height: 100vh;
}
#game, .game-wrap {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 12px 12px 24px;
  background: #FFFFFF;
  border-radius: 0;
  box-shadow: none;
}

/* ===== 屏幕容器紧凑 ===== */
.screen {
  padding: 12px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
/* 各工具原有全屏渐变/毛玻璃底统一去掉，落到白色卡片上（保证整体一致） */
#menu-screen, #game-screen, #gameScreen, .header {
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
/* 菜单屏去掉内边距，让模式网格与 学单词 一致地撑满（#game 自身有 12px padding） */
#menu-screen { padding: 0; }

/* ===== 标题统一 ===== */
.menu-title, .game-title {
  font-size: 26px;
  font-weight: 800;
  color: #E55A5A;
  -webkit-text-fill-color: #E55A5A;
  background: none;
  text-shadow: none;
  letter-spacing: 1px;
  margin-bottom: 4px;
  text-align: center;
}
.menu-subtitle, .game-subtitle {
  font-size: 14px;
  color: #8B95A5;
  margin-bottom: 10px;
  text-align: center;
  text-shadow: none;
}
.menu-mascot, .menu-bunny { font-size: 4em; margin-bottom: 8px; }

/* ===== 学单词 头部紧凑 ===== */
.header { margin-bottom: 8px; }
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 2px;
}
.star-display { font-size: 18px; font-weight: 700; color: #F1C40F; }
.star-display .star-count { font-size: 22px; }
.level-display { font-size: 14px; font-weight: 600; color: #636E72; background: rgba(78,205,196,.15); padding: 4px 12px; border-radius: 999px; }

/* ===== 菜单按钮统一（难度/模式，保留语义渐变）===== */
.level-grid, .mode-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}
.level-btn, .mode-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  border: none;
  border-radius: 18px;
  font-size: 22px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.14);
  cursor: pointer;
  min-height: 100px;
}
.level-btn:hover, .mode-btn:hover { transform: scale(1.02); }
.level-btn:active, .mode-btn:active { transform: scale(0.97); }
/* 图标加浅色圆底，避免与按钮渐变底色同色看不清 */
.level-btn .lvl-emoji, .mode-btn .mode-emoji {
  font-size: 2em;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.32);
  border-radius: 50%;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.15));
}
.level-btn .lvl-desc, .mode-btn .mode-desc { font-size: 15px; opacity: .92; font-weight: normal; display: block; }

/* ===== 游戏顶栏统一 ===== */
.game-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--border-light);
}
.back-btn {
  font-size: 1.4em;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 12px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.game-level-label, .game-mode-label {
  font-size: 13px;
  font-weight: bold;
  color: #636E72;
  padding: 4px 12px;
  border-radius: 10px;
  background: rgba(0,0,0,0.05);
}
.game-stats {
  margin-left: auto;
  display: flex;
  gap: 10px;
  font-size: 1em;
}
.game-stats span { display: flex; align-items: center; gap: 4px; }

/* ===== 进度条统一 =====
 * 注意：学数字/学拼音用 .progress-wrap(外) + .progress-bar(内)；
 * 学单词用 .progress-bar(外) + .progress-fill(内)。按容器区分，避免同名冲突。
 */
#game .progress-wrap, .game-wrap .progress-bar {
  width: 100%;
  height: 8px;
  background: #F0F1F3;
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}
#game .progress-bar, .game-wrap .progress-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary, #FF6B6B);
  transition: width .4s ease;
}
.progress-text { display: none; }

/* ===== 内容区紧凑 ===== */
.question-area, .game-content {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  min-height: 0;
}
.mascot-area { min-height: 54px; margin-bottom: 6px; }
.mascot { font-size: 2.8em; }
.speech-bubble {
  background: #fff;
  border-radius: 14px;
  padding: 6px 14px;
  font-size: .9em;
  font-weight: bold;
  color: #636E72;
}

/* ===== 大图/大字展示区 ===== */
.emoji-area { margin: 8px 0; text-align: center; }
.emoji-big { font-size: 72px; line-height: 1.2; }
.emoji-hint { font-size: 14px; color: #8B95A5; margin-top: 2px; }

/* ===== 答题按钮统一 ===== */
.answer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin: 10px 0;
}
.answer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 12px 10px;
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 20px;
  font-weight: 700;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-family: inherit;
}
.answer-btn:not(.disabled):active { transform: scale(.95); }

/* ===== 反馈紧凑 ===== */
.feedback-area, .feedback { min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 2px 0; }
.feedback-msg { font-size: 18px; font-weight: 700; padding: 4px 20px; border-radius: 999px; }

/* ===== 重新开始/操作按钮 ===== */
.restart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 26px;
  border: none;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--primary, #FF6B6B);
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
}

/* ===== 结算页统一 ===== */
.final-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  min-height: 60vh;
}
.final-screen.show { display: flex; }
.final-trophy { font-size: 56px; margin-bottom: 8px; }
.final-title { font-size: 24px; font-weight: 800; color: var(--text); margin-bottom: 4px; }
.final-subtitle { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }
.final-score { font-size: 20px; font-weight: 700; color: #F1C40F; margin-bottom: 8px; }
.final-message { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }

/* ===== 移动端收紧 ===== */
@media (max-width: 400px) {
  #game, .game-wrap { padding: 10px 10px 20px; }
  .menu-title, .game-title { font-size: 23px; }
  .level-btn, .mode-btn { min-height: 100px; padding: 12px 16px; gap: 12px; font-size: 20px; }
  .answer-btn { min-height: 52px; font-size: 18px; }
  .emoji-big { font-size: 62px; }
}
