/* 蚂蚁找食物 · 草地风格 */
: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;
}

/* 地图 */
.map { position: relative; min-height: 320px; margin: 8px 0; }
.map svg { width: 100%; height: auto; display: block; }
.map-line { stroke: #b08968; stroke-width: 3.5; }
.map-line.rash { stroke: #9aa5b1; stroke-width: 3; stroke-dasharray: 7 5; opacity: .85; }
.map-line.opt { stroke: #ffd54f; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 12 8;
  filter: drop-shadow(0 0 6px rgba(255,213,79,.9)); animation: path-flow 1s linear infinite; }
@keyframes path-flow { to { stroke-dashoffset: -20; } }
.edge-label {
  font-size: 14px; font-weight: 900; fill: #8a5a2b;
  paint-order: stroke; stroke: #fff; stroke-width: 4px;
}
.node text.face { font-size: 22px; text-anchor: middle; dominant-baseline: central; }
.node circle { stroke: #6b4a2b; stroke-width: 3; fill: #fff; }
.node text.sign { font-size: 11px; font-weight: 900; fill: #8a5a2b; text-anchor: middle;
  paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.node.light circle { fill: #fff3b8; stroke: var(--gold); stroke-width: 4;
  animation: light-glow 1s ease infinite alternate; }
.node.light { cursor: pointer; }
.node.done circle { fill: #d9f2d9; stroke: var(--green); }
.node.pickable { cursor: pointer; }
@keyframes light-glow {
  from { filter: drop-shadow(0 0 3px rgba(255,213,79,.6)); }
  to { filter: drop-shadow(0 0 14px rgba(255,213,79,1)); }
}

.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 #9aa5b1; border-radius: 18px;
  padding: 14px; margin: 10px auto; max-width: 480px; font-size: 1.05rem; line-height: 1.9;
}
.race-card .rash { color: #6b7280; font-weight: 800; }
.race-card .smart { color: #b8860b; font-weight: 800; }

@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; }
}

.node.light-min circle { fill: #fff3b8; stroke: #ff7043; stroke-width: 5; }

/* 家长折叠区 + 生活任务 */
.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;
}
