/* ============================================
   星际打字特工 - 样式表
   米黄色卡通风，适合小学生的圆润温暖主题
   ============================================ */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-bg-dark: #fef9e7;
  --color-bg-mid: #fdf2d5;
  --color-primary: #ff7b3a;
  --color-primary-dark: #e06320;
  --color-success: #4ade80;
  --color-danger: #f87171;
  --color-warning: #fbbf24;
  --color-text: #3d2b1f;
  --color-text-dim: #8b7355;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-sm: 10px;
  --shadow-glow: 0 4px 26px rgba(0,0,0,0.08);
}

html {
  font-size: 100%;
}
html, body {
  height: 100%;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--color-bg-dark);
  color: var(--color-text);
  overflow-x: hidden;
}
body {
  overflow-y: auto;
}

/* ============ 装饰背景点（替代星空） ============ */
.starfield {
  display: none;
}

/* ============ 屏幕切换 ============ */
.screen {
  display: none;
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 18px;
}
.screen.active {
  display: block;
  opacity: 1 !important;
  animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ 通用组件 ============ */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto 40px;
  padding: 20px 28px;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-md);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.top-bar h2 {
  font-size: 1.6rem;
}
.icon-btn {
  background: rgba(0,0,0,0.05);
  border: none;
  color: var(--color-text);
  padding: 12px 28px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.2rem;
  transition: background 0.2s;
}
.icon-btn:hover { background: rgba(0,0,0,0.1); }

.screen-help {
  text-align: center;
  font-size: 1.2rem;
  color: var(--color-text-dim);
  background: rgba(255,123,58,0.08);
  border-radius: var(--radius-sm);
  padding: 18px 30px;
  margin: 0 auto 34px;
  max-width: 910px;
}

.stat-chip {
  background: rgba(0,0,0,0.05);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 1rem;
  white-space: nowrap;
  cursor: default;
}
.reset-chip {
  cursor: pointer;
  transition: 0.2s;
  padding: 8px 12px;
  font-size: 1.1rem;
}
.reset-chip:hover {
  background: rgba(255,0,0,0.12);
}
.novice-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: rgba(0,0,0,0.05);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 1.1rem;
  color: var(--color-text);
  transition: background 0.2s;
}
.novice-toggle:hover {
  background: rgba(0,0,0,0.1);
}
.novice-toggle input {
  display: none;
}
.novice-slider {
  display: inline-block;
  width: 36px;
  height: 20px;
  background: rgba(0,0,0,0.12);
  border-radius: 10px;
  position: relative;
  transition: 0.25s;
}
.novice-slider::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  transition: 0.25s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.novice-toggle input:checked + .novice-slider {
  background: rgba(74,222,128,0.5);
}
.novice-toggle input:checked + .novice-slider::after {
  left: 19px;
}

.game-stats {
  display: flex;
  gap: 14px;
}

.big-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: none;
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  width: 100%;
}
.big-btn:hover { transform: translateY(-4px); }
.big-btn:active { transform: translateY(0); }
.btn-icon { font-size: 2.8rem; }
.btn-desc { font-size: 0.9rem; font-weight: 400; opacity: 0.85; }

.btn-blue { background: linear-gradient(160deg, #ff9a5c, #ff7b3a); box-shadow: 0 6px 0 #e06320, 0 8px 16px rgba(255,123,58,0.4); }
.btn-green { background: linear-gradient(160deg, #6ee7a3, #22c55e); box-shadow: 0 6px 0 #16833c, 0 8px 16px rgba(34,197,94,0.4); }
.btn-yellow { background: linear-gradient(160deg, #ffd76a, #f5a623); box-shadow: 0 6px 0 #c17c0f, 0 8px 16px rgba(245,166,35,0.4); }
.btn-red { background: linear-gradient(160deg, #ff8a8a, #ef4444); box-shadow: 0 6px 0 #b02a2a, 0 8px 16px rgba(239,68,68,0.4); }

.big-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* ============ 主菜单 ============ */
.home-wrap {
  max-width: 780px;
  margin: 4vh auto 0;
}
.home-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 4px;
  position: relative;
  min-height: 60px;
}
.home-topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
  z-index: 2;
}
.home-topbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  z-index: 1;
}
.home-topbar-right {
  flex-shrink: 0;
  z-index: 2;
}
.chip-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-title {
  font-size: 2.6rem;
  margin: 0;
  text-shadow: 0 2px 12px rgba(255,123,58,0.3);
}
.game-subtitle {
  display: none;
}
.home-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-bottom: 52px;
}
.home-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 24px;
  margin-bottom: 36px;
  max-width: 910px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 600px) {
  .screen {
    padding: 12px;
  }
  .home-buttons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .home-buttons .big-btn {
    min-width: 0;
    padding: 24px 10px;
  }
  .home-buttons .btn-desc {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
}
.home-help {
  margin-bottom: 28px;
  font-size: 1.25rem;
  color: var(--color-text-dim);
  background: rgba(255,255,255,0.5);
  border-radius: 22px;
  padding: 22px 40px;
}
/* 打字姿势图 */
.home-posture {
  margin: 60px auto 40px;
  width: 100%;
  max-width: 820px;
}
.posture-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.posture-icon {
  font-size: 1.6rem;
}
.posture-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-primary);
}
.posture-content {
  display: flex;
  align-items: flex-start;
  gap: 48px;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 16px;
}
.posture-img {
  max-width: 500px;
  width: 100%;
  border-radius: 16px;
  cursor: zoom-in;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  transition: transform 0.3s;
  max-height: 580px;
  object-fit: contain;
  margin-bottom: 12px;
}
.posture-img.zoomed {
  cursor: zoom-out;
  transform: scale(1.5);
  max-height: none;
}
.posture-tips {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  min-width: 200px;
}
.posture-tip {
  font-size: 0.95rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.tip-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  background: var(--color-primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}
.posture-note {
  text-align: center;
  margin-top: 20px;
  color: var(--color-text-dim);
  font-size: 1rem;
}
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.home-reset {
  margin-top: 48px;
  text-align: center;
}
.btn-reset {
  background: rgba(255,107,107,0.12);
  border: 1px solid rgba(255,107,107,0.35);
  color: rgba(255,107,107,0.85);
  padding: 10px 32px;
  border-radius: 14px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-reset:hover {
  background: rgba(255,107,107,0.22);
  border-color: rgba(255,107,107,0.6);
  color: #ff6b6b;
}

/* ============ 指法训练营 ============ */
.training-wrap {
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
.mission-text {
  font-size: 1.25rem;
  margin-bottom: 18px;
  padding: 18px 28px;
  background: rgba(255,255,255,0.6);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--color-primary);
}

.hands-stage {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-bottom: 18px;
}
.hand {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.finger-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.finger {
  border-radius: 22px 22px 8px 8px;
  background: #adb5bd;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
}
.finger.pinky  { height: 73px; width: 39px; }
.finger.ring   { height: 96px; width: 39px; }
.finger.middle { height: 109px; width: 39px; }
.finger.index  { height: 99px; width: 39px; }
.finger.thumb  { height: 62px; width: 52px; border-radius: 24px 24px 8px 8px; }

.finger[data-finger="L-pinky"]  { background: #ff6b6b; }
.finger[data-finger="L-ring"]   { background: #ffa94d; }
.finger[data-finger="L-middle"] { background: #ffd43b; }
.finger[data-finger="L-index"]  { background: #69db7c; }
.finger[data-finger="R-index"]  { background: #4dd0e1; }
.finger[data-finger="R-middle"] { background: #748ffc; }
.finger[data-finger="R-ring"]   { background: #cc5de8; }
.finger[data-finger="R-pinky"]  { background: #f783ac; }
.finger[data-finger="thumb"]    { background: #adb5bd; }

.palm {
  width: 240px;
  height: 39px;
  margin-top: 6px;
  background: rgba(0,0,0,0.06);
  border-radius: 0 0 32px 32px;
}
.hand-label {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--color-text-dim);
}
.hand-label.top-label {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
}

/* 手指 + 标签列（一一对齐） */
.finger-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 39px;
}
.finger-col.thumb-col {
  min-width: 52px;
}
.finger-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  text-align: center;
  white-space: nowrap;
}

.finger.active {
  transform: scale(1.18) translateY(-8px);
  filter: brightness(1.3);
  box-shadow: 0 0 26px rgba(255,123,58,0.6);
}
.finger.correct {
  filter: brightness(1.4) saturate(1.3);
  box-shadow: 0 0 20px rgba(74,222,128,0.9);
}
.finger.wrong {
  filter: grayscale(0.4) brightness(0.8);
  box-shadow: 0 0 20px rgba(248,113,113,0.9);
  animation: shake 0.3s;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* ============ 虚拟键盘 ============ */
.keyboard-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  margin-bottom: 22px;
}
.kb-row {
  display: flex;
  gap: 8px;
}
.kb-key {
  min-width: 80px;
  height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 2px solid #e0d5c5;
  border-radius: var(--radius-sm);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--color-text);
  transition: background 0.15s, transform 0.1s;
  position: relative;
}
.kb-key.wide-space { min-width: 460px; font-size: 1.1rem; }
.kb-key.home-key::after {
  content: "";
  position: absolute;
  bottom: 8px;
  width: 28px;
  height: 8px;
  border-radius: 4px;
  background: var(--color-warning);
}
.kb-key.active {
  background: var(--color-primary);
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}
.kb-key.correct { background: var(--color-success) !important; }
.kb-key.wrong { background: var(--color-danger) !important; }

/* 手指分区配色：整块底色 + 强调边框，与双手示意图的手指颜色一一对应 */
.kb-key[data-finger="L-pinky"]  { background: #ff6b6b; color: #fff; }
.kb-key[data-finger="L-ring"]   { background: #ffa94d; color: #fff; }
.kb-key[data-finger="L-middle"] { background: #ffd43b; color: #222; }
.kb-key[data-finger="L-index"]  { background: #69db7c; color: #222; }
.kb-key[data-finger="R-index"]  { background: #4dd0e1; color: #222; }
.kb-key[data-finger="R-middle"] { background: #748ffc; color: #fff; }
.kb-key[data-finger="R-ring"]   { background: #cc5de8; color: #fff; }
.kb-key[data-finger="R-pinky"]  { background: #f783ac; color: #fff; }
.kb-key[data-finger="thumb"]    { background: #6c757d; color: #fff; }

.prompt-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  padding: 18px 26px;
  background: rgba(255,255,255,0.6);
  border-radius: 20px;
  border: 2px dashed var(--color-primary);
}
.prompt-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  font-size: 1.9rem;
  color: var(--color-text-dim);
}
.prompt-line .prompt-key {
  display: inline-block;
  min-width: 110px;
  padding: 14px 42px;
  background: var(--color-primary);
  border-radius: 20px;
  font-size: 3.2rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 0 36px rgba(255,123,58,0.4);
}
.prompt-hint {
  display: block;
  margin-top: 16px;
  font-size: 1.5rem;
  color: var(--color-warning);
}
.feedback-msg {
  min-height: 42px;
  font-size: 1.3rem;
  margin-bottom: 26px;
  color: var(--color-warning);
}

.training-progress {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
}
.progress-bar-outer {
  width: 312px;
  height: 16px;
  background: rgba(0,0,0,0.06);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar-inner {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-success));
  transition: width 0.3s;
}

/* ============ 关卡地图 ============ */
.planet-map {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 200px);
  justify-content: center;
  gap: 22px;
  padding: 24px 0;
}
.planet-card {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 3px solid #e0d5c5;
  color: #fff;
  font-weight: 700;
  transition: transform 0.2s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
.planet-card:hover:not(.locked) { transform: scale(1.06); }
.planet-card .planet-name { font-size: 1.2rem; margin-top: 6px; }
.planet-card .planet-stars { font-size: 1rem; margin-top: 6px; }
.planet-card.locked {
  filter: grayscale(1) brightness(0.5);
  cursor: not-allowed;
}
.planet-card .lock-icon { font-size: 2.2rem; }

/* 陨石雨挑战卡片：方形+警示配色，和圆形行星区分开来，一眼看出是"进阶模式" */
.meteor-card {
  border-radius: var(--radius-lg);
  background: linear-gradient(160deg, #ffd699, #fef9e7 90%);
  border: 2px solid #f87171;
}
.meteor-card.locked { border-color: rgba(255,255,255,0.15); }

/* ============ 陨石雨挑战（进阶模式） ============ */
.meteor-wrap {
  max-width: 1300px;
  margin: 0 auto;
  text-align: center;
}
.meteor-setup .mission-text {
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}
.difficulty-buttons {
  display: flex;
  justify-content: center;
  gap: 22px;
  margin: 32px 0;
  flex-wrap: wrap;
}
.diff-btn {
  background: rgba(0,0,0,0.03);
  border: 2px solid rgba(0,0,0,0.1);
  color: var(--color-text);
  border-radius: var(--radius-md);
  padding: 30px 40px;
  font-size: 1.35rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s;
  min-width: 260px;
}
.diff-btn:hover { transform: translateY(-2px); background: rgba(0,0,0,0.06); }
.diff-btn.selected {
  border-color: var(--color-primary);
  background: rgba(255,123,58,0.15);
  box-shadow: var(--shadow-glow);
}
.diff-desc {
  display: block;
  font-size: 1rem;
  font-weight: 400;
  color: var(--color-text-dim);
  margin-top: 8px;
}

.meteor-play {
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  padding: 26px;
}
.meteor-sky {
  position: relative;
  height: 470px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.5);
  margin-bottom: 26px;
}
.meteor-item {
  position: absolute;
  top: -70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translateX(-50%);
}
.meteor-img {
  width: 62px;
  height: 62px;
  filter: drop-shadow(0 0 8px rgba(248,113,113,0.6));
  animation: meteor-spin 3s linear infinite;
}
@keyframes meteor-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.meteor-word {
  font-family: "Consolas", monospace;
  font-size: 1.3rem;
  font-weight: 700;
  background: rgba(255,255,255,0.85);
  padding: 3px 14px;
  border-radius: 8px;
  white-space: nowrap;
  color: var(--color-text);
}
.meteor-item.meteor-exploding {
  animation: meteor-explode 0.25s ease forwards;
}
@keyframes meteor-explode {
  from { opacity: 1; transform: translateX(-50%) scale(1); }
  to { opacity: 0; transform: translateX(-50%) scale(1.8); }
}

/* ============ 打字游戏关卡 ============ */
.game-wrap {
  max-width: 1300px;
  margin: 0 auto;
  text-align: center;
}
.ship-track {
  height: 78px;
  position: relative;
  margin-bottom: 16px;
  background: linear-gradient(90deg, rgba(255,123,58,0.1), rgba(255,123,58,0.2));
  border-radius: 999px;
}
.ship-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 62px;
  transition: left 0.4s ease;
}

.typing-stage {
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
}
.text-display {
  font-size: 2.2rem;
  letter-spacing: 3px;
  margin-bottom: 32px;
  min-height: 3em;
  font-family: "Consolas", monospace;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
}
.text-display .char, .meteor-word .char {
  transition: color 0.15s, background 0.15s;
  border-radius: 4px;
  padding: 0 1px;
}
.text-display .char.done-correct, .meteor-word .char.done-correct { color: var(--color-success); }
.text-display .char.done-wrong, .meteor-word .char.done-wrong { color: var(--color-danger); text-decoration: underline wavy; }
.text-display .char.current, .meteor-word .char.current { background: var(--color-primary); color: #fff; border-radius: 4px; }

.mini-keyboard { transform: scale(0.95); transform-origin: top center; }

/* ============ 结算界面 ============ */
.result-wrap {
  max-width: 780px;
  margin: 8vh auto 0;
  text-align: center;
  background: rgba(255,255,255,0.7);
  border-radius: var(--radius-lg);
  padding: 52px 40px;
}
.result-wrap h2 { font-size: 2.2rem; margin-bottom: 40px; }
.result-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-bottom: 26px;
}
.result-item {
  background: rgba(255,255,255,0.5);
  border-radius: var(--radius-md);
  padding: 18px;
}
.result-label { display: block; font-size: 1rem; color: var(--color-text-dim); }
.result-value { display: block; font-size: 1.8rem; font-weight: 700; margin-top: 6px; }
.result-stars-display { font-size: 2rem; margin-bottom: 40px; letter-spacing: 8px; }
.result-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

/* ============ 自由练习 ============ */
.fp-modes .mode-btn {
  background: rgba(0,0,0,0.04);
  border: 2px solid transparent;
  color: var(--color-text-dim);
  padding: 14px 32px;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}
.fp-modes .mode-btn:hover {
  background: rgba(0,0,0,0.08);
  color: var(--color-text);
}
.fp-modes .mode-btn.active {
  background: rgba(255,123,58,0.12);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* 自由练习 - 文本字符样式 */
.fp-text-display-char {
  transition: color 0.15s;
}
.fp-text-display-char.current {
  color: var(--color-warning);
  background: rgba(251,191,36,0.2);
  border-radius: 4px;
  padding: 0 2px;
}
.fp-text-display-char.done {
  color: var(--color-success);
}
.fp-text-display-char.wrong-char {
  color: var(--color-danger);
  text-decoration: underline;
}

/* 自由练习 - 按键统计 */
.fp-key-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.5);
  border-radius: 10px;
  padding: 8px 14px;
  margin: 6px;
  font-family: 'Courier New', monospace;
}
.fp-key-stat-item .key-name {
  font-weight: bold;
  font-size: 1.1rem;
  min-width: 26px;
  text-align: center;
}
.fp-key-stat-item .key-correct {
  color: var(--color-success);
}
.fp-key-stat-item .key-wrong {
  color: var(--color-danger);
}

/* 自由练习 - 红色停止按钮 */
.btn-red {
  background: linear-gradient(135deg, var(--color-danger), #e85454);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 22px 44px;
  font-size: 1.25rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.btn-red:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 18px rgba(248,113,113,0.4);
}

/* 自由练习 - 紫色按钮（主菜单） */
.btn-purple {
  background: linear-gradient(135deg, #a855f7, #7c3aed);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 28px 40px;
  font-size: 1.3rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.btn-purple:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 18px rgba(168,85,247,0.4);
  transform: translateY(-2px);
}

.btn-orange {
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 22px 32px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.btn-orange:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 18px rgba(249,115,22,0.4);
  transform: translateY(-2px);
}

/* ============ 打地鼠打字游戏 ============ */
.whac-wrap {
  max-width: 870px;
  margin: 0 auto;
  text-align: center;
}

.whac-setup .mission-text {
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.whac-game-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-bottom: 26px;
  flex-wrap: wrap;
}

.whac-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 680px;
  margin: 0 auto 28px;
  padding: 30px;
  background: linear-gradient(145deg, rgba(139,92,246,0.08), rgba(255,123,58,0.06));
  border-radius: var(--radius-lg);
  border: 2px solid rgba(139,92,246,0.15);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.whac-grid-wrong {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 30px rgba(248,113,113,0.5) !important;
  animation: gridShake 0.3s ease;
}
@keyframes gridShake {
  0%,100%{transform:translateX(0)}
  25%{transform:translateX(-4px)}
  75%{transform:translateX(4px)}
}

.whac-hole {
  position: relative;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0,0,0,0.7) 30%, rgba(0,0,0,0.25) 100%);
  border: 3px solid rgba(139,92,246,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  transition: background 0.3s, border-color 0.3s, transform 0.15s;
  overflow: hidden;
  cursor: default;
}

.whac-hole.whac-active {
  background: radial-gradient(ellipse at center, rgba(139,92,246,0.5), rgba(255,123,58,0.3), rgba(0,0,0,0.4));
  border-color: rgba(255,123,58,0.7);
  box-shadow: 0 0 24px rgba(255,123,58,0.5), inset 0 0 20px rgba(139,92,246,0.3);
  animation: whac-pop 0.2s cubic-bezier(0.34,1.56,0.64,1);
}

@keyframes whac-pop {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

.whac-hole.whac-hit {
  border-color: var(--color-success) !important;
  background: radial-gradient(ellipse at center, rgba(74,222,128,0.6), rgba(74,222,128,0.2)) !important;
  box-shadow: 0 0 40px rgba(74,222,128,0.8), 0 0 80px rgba(74,222,128,0.4) !important;
  animation: whac-hit-pop 0.35s ease;
}

@keyframes whac-hit-pop {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); }
  60% { transform: scale(0.9); }
  100% { transform: scale(1); }
}

.whac-hole.whac-hit::after {
  content: '💥';
  position: absolute;
  font-size: 2.5rem;
  animation: hitParticle 0.5s ease-out forwards;
  pointer-events: none;
}
@keyframes hitParticle {
  0% { transform: scale(0.5); opacity: 1; }
  100% { transform: scale(2); opacity: 0; }
}

.whac-hole.whac-miss {
  border-color: var(--color-danger) !important;
  box-shadow: 0 0 20px rgba(248,113,113,0.6);
}

.whac-mole-char {
  font-size: 3.2rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 20px rgba(139,92,246,0.9), 0 0 40px rgba(168,85,247,0.5);
  font-family: "Consolas", "Courier New", monospace;
  line-height: 1;
  user-select: none;
  pointer-events: none;
  animation: moleBounce 0.6s ease-out infinite alternate;
}
@keyframes moleBounce {
  0% { transform: translateY(0); }
  100% { transform: translateY(-4px); }
}

.whac-timer-bar {
  position: absolute;
  bottom: 8px;
  left: 16px;
  right: 16px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  overflow: hidden;
}

.whac-timer-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-danger), var(--color-warning));
  border-radius: 2px;
  transition: width 0.05s linear;
}

.whac-result .result-wrap {
  margin-top: 0;
}

/* ============ 字母飞行 ============ */
.fighter-wrap {
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 28px;
}

.fighter-setup {
  text-align: center;
}

.fighter-speed-btn {
  min-width: 156px;
}

.fighter-play {
  position: relative;
}

.fighter-game-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 26px;
  margin-bottom: 16px;
}

.fighter-sky {
  position: relative;
  width: 100%;
  height: 650px;
  background: linear-gradient(180deg, rgba(254,249,231,0.95) 0%, rgba(253,242,213,0.8) 60%, rgba(255,220,180,0.6) 100%);
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid #e0d5c5;
  box-shadow: inset 0 0 60px rgba(255,200,150,0.15);
}

.fighter-sky-hint {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(61,43,31,0.2);
  font-size: 1.1rem;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.fighter-letter {
  position: absolute;
  width: 78px;
  height: 78px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 50%;
  text-shadow: 0 0 16px rgba(255,255,255,0.5);
  box-shadow: 0 0 20px rgba(0,0,0,0.2), inset 0 0 16px rgba(255,255,255,0.15);
  user-select: none;
  pointer-events: none;
  z-index: 10;
  font-family: "Consolas", "Courier New", monospace;
  transition: transform 0.15s;
  animation: fighter-letter-glow 1.5s ease-in-out infinite alternate;
}

@keyframes fighter-letter-glow {
  from { box-shadow: 0 0 20px rgba(0,0,0,0.2), inset 0 0 16px rgba(255,255,255,0.15); }
  to { box-shadow: 0 0 30px rgba(0,0,0,0.3), inset 0 0 22px rgba(255,255,255,0.25); }
}

.fighter-letter-hit {
  transform: scale(2.5) !important;
  opacity: 0 !important;
  transition: all 0.2s ease-out;
}

.fighter-bullet {
  position: absolute;
  font-size: 1.4rem;
  color: var(--color-success);
  text-shadow: 0 0 12px rgba(74,222,128,0.8);
  user-select: none;
  pointer-events: none;
  z-index: 5;
  animation: fighter-bullet-flash 0.1s ease;
}

@keyframes fighter-bullet-flash {
  0% { opacity: 1; transform: scale(1.2); }
  100% { opacity: 0.6; transform: scale(1); }
}

.fighter-shake {
  animation: fighter-shake-anim 0.3s ease;
}

@keyframes fighter-shake-anim {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

.fighter-result .result-wrap {
  margin-top: 0;
}

/* ============ btn-cyan (主菜单英文句子段落按钮) ============ */
.btn-cyan {
  background: linear-gradient(135deg, #22d3ee, #06b6d4);
  color: #fff;
  border: none;
  border-radius: var(--radius-lg);
  padding: 22px 32px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.btn-cyan:hover {
  filter: brightness(1.15);
  box-shadow: 0 0 18px rgba(34,211,238,0.4);
  transform: translateY(-2px);
}


/* 遮罩抖动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* ============ Toggle Switch (新手模式) ============ */
.toggle-switch input:checked + .toggle-slider {
  background: var(--color-primary) !important;
}
.toggle-switch .toggle-slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
