/* 盖广播塔 · 草原风格 */
:root { --cream: #fff6e5; --pink: #ff8fb3; --gold: #ffd54f; --choco: #6b4a2b; --ink: #3a2e1f; --green: #6ec96e; }
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: linear-gradient(180deg, #aee3ff 0%, #e8f7e8 55%, #9ed29e 100%);
  color: var(--ink); user-select: none; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
#app { max-width: 820px; margin: 0 auto; padding: 12px; min-height: 100vh; }
.screen { display: none; }
.screen.active { display: block; }
.title { text-align: center; font-size: 2rem; margin: 18px 0 4px; text-shadow: 2px 2px 0 rgba(255,255,255,.6); }
.subtitle { text-align: center; font-size: 1.02rem; margin-bottom: 18px; color: #3a6b3a; }

.level-picker { display: flex; flex-direction: column; gap: 14px; align-items: center; margin-top: 24px; }
.level-btn {
  width: 260px; font-size: 1.2rem; font-weight: 900; padding: 18px 24px;
  border-radius: 20px; border: 4px solid var(--choco); cursor: pointer;
  background: #fff; box-shadow: 0 4px 10px rgba(0,0,0,.18);
  transition: transform .12s;
}
.level-btn:active { transform: scale(.96); }
.level-btn small { display: block; font-size: .85rem; color: #5a6a4f; font-weight: 700; margin-top: 4px; }
.level-btn:nth-child(1) { border-color: #6ec96e; }
.level-btn:nth-child(2) { border-color: #ff8a50; }
.level-btn:nth-child(3) { border-color: #e5484d; }
.record-line { text-align: center; margin-top: 18px; font-size: .95rem; color: #5a6a4f; font-weight: 700; }

.game-header { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.animal-face { font-size: 2.4rem; background: #fff; border-radius: 50%; width: 62px; height: 62px;
  display: flex; align-items: center; justify-content: center; border: 4px solid var(--choco); }
.header-info { flex: 1; }
.hint { font-size: 1.05rem; font-weight: 700; }
.status-line { display: flex; gap: 10px; align-items: center; margin-top: 4px; font-size: .9rem; flex-wrap: wrap; }

.mission {
  text-align: center; background: #fff3cd; border: 3px solid #ffd54f;
  border-radius: 16px; padding: 8px 14px; margin: 6px auto; font-weight: 800;
  font-size: 1.02rem; color: #8a6a1f; max-width: 560px;
}

/* 村庄地图 */
.village-map {
  background: linear-gradient(180deg, #d9f2d9, #b8e6b8);
  border: 4px solid #8a9a6a; border-radius: 18px;
  min-height: 120px; padding: 14px; margin: 8px 0;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; align-items: center;
}
.village {
  width: 54px; height: 54px; border-radius: 50%; background: #fff;
  border: 3px solid var(--choco); display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; box-shadow: 0 3px 6px rgba(0,0,0,.15); position: relative;
  transition: transform .2s, background .3s;
}
.village.covered { background: #d9f2d9; border-color: var(--green); }
.village.covered::after {
  content: '📶'; position: absolute; top: -8px; right: -6px; font-size: .8rem;
}
.village.flash { animation: village-flash .6s ease; }
@keyframes village-flash {
  0% { transform: scale(1); }
  40% { transform: scale(1.4); background: #fff3b8; }
  100% { transform: scale(1); }
}

/* 塔按钮 */
.tower-zone { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 10px 0; }
.tower-btn {
  min-width: 92px; padding: 12px 14px; border-radius: 16px;
  border: 4px solid #5c9cff; background: #fff; cursor: pointer;
  box-shadow: 0 4px 8px rgba(0,0,0,.15); position: relative;
  transition: transform .12s;
  font-family: inherit; font-weight: 800; font-size: .95rem;
}
.tower-btn:active { transform: scale(.94); }
.tower-btn .tower-face { font-size: 1.6rem; display: block; }
.tower-btn .tower-badge {
  position: absolute; top: -8px; right: -8px; background: #ff8a50; color: #fff;
  border-radius: 12px; font-size: .72rem; font-weight: 900; padding: 1px 8px;
}
.tower-btn.built { background: #eaf3ff; border-color: var(--green); }
.tower-btn.built .tower-badge { background: var(--green); }

.action-line { text-align: center; margin: 6px 0; }
.btn-undo {
  font-size: 1rem; padding: 10px 22px; border-radius: 16px;
  border: 3px solid #9aa5b1; background: #fff; cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,.12);
}

.feedback { text-align: center; font-size: 1.3rem; font-weight: 800; min-height: 2rem; margin: 6px 0; }
.feedback.ok { color: #2e7d32; }
.feedback.no { color: #d32f2f; }

.btn-reset, .btn-home, .btn-next {
  display: block; margin: 8px auto; padding: 12px 24px; font-size: 1.02rem;
  border-radius: 18px; border: 3px solid var(--choco); cursor: pointer;
  background: #fff; box-shadow: 0 4px 8px rgba(0,0,0,.18);
}
.btn-home { background: #ffe9d6; }
.btn-next { background: #fff3cd; border-color: #ffd54f; font-weight: 900; }

.stats-title { text-align: center; margin: 20px 0 10px; }
.stats-box { background: rgba(255,255,255,.85); border-radius: 18px; padding: 16px; margin: 12px 0; font-size: 1.02rem; line-height: 1.9; }
.stats-box .big { font-size: 1.35rem; font-weight: 800; }
.race-card {
  background: #fff; border: 4px solid #5c9cff; border-radius: 18px;
  padding: 14px; margin: 10px auto; max-width: 480px; font-size: 1.05rem; line-height: 1.9;
}

@keyframes celebrate-pop { 0% { transform: scale(0) rotate(-20deg); } 70% { transform: scale(1.4) rotate(10deg); } 100% { transform: scale(1) rotate(0); } }
.celebrate { animation: celebrate-pop .6s ease; display: inline-block; }

.fast * { animation: none !important; transition: none !important; }

@media (max-width: 480px) {
  .level-btn { width: 220px; }
  .title { font-size: 1.5rem; }
}

/* 结算迷你地图：三重对比可视化 */
.mini-map {
  background: linear-gradient(180deg, #d9f2d9, #b8e6b8);
  border: 3px solid #8a9a6a; border-radius: 16px;
  padding: 12px; margin: 8px auto; max-width: 520px;
}
.mini-map .mm-villages { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 10px; }
.mini-map .mm-village {
  width: 40px; height: 40px; border-radius: 50%; background: #fff;
  border: 3px solid var(--choco); display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; opacity: .45;
}
.mini-map .mm-village.covered { opacity: 1; background: #d9f2d9; border-color: var(--green); }
.mini-map .mm-towers { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mm-tower {
  min-width: 72px; padding: 8px 10px; border-radius: 12px; background: #fff;
  border: 3px solid #c8c2b4; font-weight: 800; font-size: .85rem; text-align: center;
}
.mm-tower.mine { border-color: var(--green); background: #e8f5e9; }
.mm-tower.greedy { border-color: #ff8a50; border-style: dashed; background: #fff3e6; }
.mm-tower.optimal { border-color: #ffd54f; box-shadow: 0 0 12px rgba(255,213,79,.9); background: #fffbe6; }
.mm-legend { font-size: .8rem; font-weight: 700; color: #5a6a4f; margin-top: 8px; text-align: center; }

.tower-btn.hint { border-color: #ffd54f; box-shadow: 0 0 14px rgba(255,213,79,.9); animation: hint-bob 1s ease infinite; }
@keyframes hint-bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.btn-hint {
  font-size: 1rem; padding: 10px 22px; border-radius: 16px;
  border: 3px solid #ffd54f; background: #fffbe6; cursor: pointer;
  box-shadow: 0 3px 6px rgba(0,0,0,.12);
}

/* 家长折叠区 + 生活任务 */
.dad-note {
  max-width: 600px; margin: 8px auto; background: #fff8e7;
  border: 3px dashed #b08968; border-radius: 14px; padding: 8px 14px;
}
.dad-note summary { font-weight: 900; color: #8a6a4f; cursor: pointer; font-size: .98rem; }
.dad-text { font-size: .92rem; color: #5a4a35; line-height: 1.7; margin: 4px 0; }
.life-task {
  text-align: center; font-size: 1rem; font-weight: 900; color: #2e7d32;
  background: #e8f5e9; border: 2px solid #6ec96e; border-radius: 12px;
  padding: 8px 12px; margin: 8px auto; max-width: 600px;
}
