/* 猜猜它是谁 · 森林侦探风格 */
: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;
}

/* 特征图 */
.plot-zone { margin: 8px 0; }
.plot {
  background: linear-gradient(180deg, #f5fbf0, #e4f3e4);
  border: 4px solid #8a9a6a; border-radius: 16px; position: relative;
  min-height: 320px;
}
.plot svg { width: 100%; height: auto; display: block; }
.axis-labels { display: flex; justify-content: space-between; font-size: .8rem; color: #5a6a4f; font-weight: 700; margin-top: 4px; }
.known-animal { cursor: pointer; }
.known-animal circle { stroke-width: 3; }
.known-animal text { font-size: 20px; text-anchor: middle; dominant-baseline: central; }
.known-animal.selected circle { stroke: var(--gold); stroke-width: 4; filter: drop-shadow(0 0 6px rgba(255,213,79,.9)); }
.target-animal { pointer-events: none; }
.target-animal circle { stroke: #e5484d; stroke-width: 3; fill: #fff3e6; }
.target-animal text { font-size: 22px; text-anchor: middle; dominant-baseline: central; }
.knn-line { stroke: #5c9cff; stroke-width: 2.5; stroke-dasharray: 5 4; }
.knn-dist { font-size: 11px; font-weight: 900; fill: #5c9cff; paint-order: stroke; stroke: #fff; stroke-width: 3px; }

/* K 选择 */
.k-zone { display: flex; gap: 10px; justify-content: center; margin: 8px 0; }
.k-btn {
  min-width: 64px; padding: 10px; border-radius: 14px; border: 3px solid #5c9cff;
  background: #fff; cursor: pointer; font-size: 1.05rem; font-weight: 900;
  font-family: inherit;
}
.k-btn.active { background: #eaf3ff; border-color: var(--gold); box-shadow: 0 0 10px rgba(255,213,79,.7); }

/* 投票 */
.vote-zone { display: flex; gap: 12px; justify-content: center; margin: 8px 0; }
.vote-btn {
  min-width: 92px; padding: 12px; border-radius: 16px; border: 4px solid var(--choco);
  background: #fff; cursor: pointer; font-size: 1.05rem; font-weight: 900;
  box-shadow: 0 4px 8px rgba(0,0,0,.15); font-family: inherit;
}
.vote-btn:active { transform: scale(.94); }

.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 #9b7bff; 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; }
}

.vote-bars { display: flex; flex-direction: column; gap: 4px; margin: 8px 0; }
.vote-bar { display: flex; align-items: center; gap: 8px; }
.vb-face { font-size: 1.1rem; width: 26px; }
.vb-track { flex: 1; height: 14px; background: #eee; border-radius: 7px; overflow: hidden; }
.vb-fill { height: 100%; background: linear-gradient(90deg, #ffd54f, #ff8a50); border-radius: 7px; transition: width .5s; }
.vb-count { font-size: .85rem; font-weight: 900; color: #5a6a4f; width: 44px; }

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