/* 灵境伙伴 20261121-art1 : 5岁向大按钮、软色彩与绘本精灵 */
:root {
  --bg1: #e8f8ef;
  --bg2: #fff4d8;
  --ink: #2b3a32;
  --muted: #5c6f64;
  --art-well: #fff6e8;
  --card: rgba(255,255,255,.88);
  --line: rgba(43,58,50,.12);
  --brand: #3fa66a;
  --brand-ink: #fff;
  --accent: #ffb84d;
  --danger: #d36b4f;
  --shadow: 0 10px 28px rgba(62, 90, 72, .16);
  --radius: 24px;
  --tap: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0;
  min-height: 100%;
  font-family: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg1) 0%, var(--bg2) 100%);
}
body { padding: max(8px, env(safe-area-inset-top)) 12px 20px; }
.app-shell { max-width: 430px; margin: 0 auto; }
.audio-status {
  min-height: 1.4em;
  margin: 0 0 8px;
  text-align: center;
  font-size: 15px;
  color: var(--muted);
}
.screen { display: none; padding-bottom: 24px; }
.screen.active { display: block; }
h1 { font-size: 2.1rem; margin: 0 0 8px; letter-spacing: .02em; }
h2 { font-size: 1.35rem; margin: 0; }
h3 { font-size: 1.2rem; margin: 0 0 8px; }
.kicker, .quiz-tip, .lead, p { line-height: 1.45; }
.kicker { margin: 0; color: #3f8f5f; font-weight: 700; }
.lead { margin: 8px 0 0; font-size: 1.05rem; color: var(--muted); }
.lead.tight { margin: 8px 0 14px; }
.home-hero, .status-panel, .notice, .quiz-card, .encounter-card, .care-panel, .privacy-copy, .scan-panel, .wallet {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.home-hero { text-align: center; margin-bottom: 14px; padding: 22px 16px 18px; }
.home-actions, .food-actions, .dex-actions, .quiz-options {
  display: grid;
  gap: 10px;
  margin: 14px 0;
}
button {
  min-height: var(--tap);
  padding: 12px 16px;
  border: 0;
  border-radius: 18px;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 4px 0 rgba(62,90,72,.18);
  cursor: pointer;
}
button.huge { min-height: 72px; font-size: 1.25rem; }
button.full { width: 100%; }
button.primary { background: var(--brand); color: var(--brand-ink); }
button.ghost {
  min-height: 48px;
  background: transparent;
  box-shadow: none;
  color: #2f6b48;
  font-size: 1rem;
}
button.listen-btn { background: #fff3c4; }
button:disabled { opacity: .5; box-shadow: none; }
button:active { transform: translateY(2px); box-shadow: none; }
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.mode-banner, .status-panel, .wallet { margin: 10px 0; font-size: 1rem; }
.mode-banner { background: #dff5e8; border-radius: 16px; padding: 12px 14px; }
.mode-banner.demo, .mode-banner.encounter { background: #ffe9c7; }
.priority-panel { margin-bottom: 12px; }
.meter {
  height: 16px;
  background: #e5efe8;
  border-radius: 999px;
  overflow: hidden;
  margin-top: 6px;
}
.meter i {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #7be3a0, #3fa66a);
  border-radius: inherit;
  transition: width .2s ease;
}
.meter.friend i { background: linear-gradient(90deg, #ffd37a, #ff9f43); }
.camera-stage {
  position: relative;
  height: 42vw;
  max-height: 280px;
  min-height: 180px;
  border-radius: 22px;
  overflow: hidden;
  background: #1d3b2d;
  margin: 12px 0;
}
.camera-stage video, .camera-stage canvas, .demo-scene {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}
.demo-scene {
  background: radial-gradient(circle at 30% 30%, #9ee7c2, #2e6b4f 55%, #163427);
  display: none;
}
.demo-scene.on { display: block; }
.scene-cards, .anchor-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 12px 0;
}
.scene-cards button, .anchor-row button { min-height: 58px; font-size: 1rem; }
.camera-settings { margin: 12px 0; color: var(--muted); }
.risk-text { color: var(--danger); min-height: 1.2em; }
.battle-stage {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "wild mine"
    "vs vs";
  gap: 6px 10px;
  align-items: start;
  text-align: center;
}
.battle-stage figure { margin: 0; }
.battle-stage figure:first-of-type { grid-area: wild; }
.battle-stage figure:last-of-type { grid-area: mine; }
.battle-stage canvas {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: var(--art-well);
  border-radius: 24px;
  box-shadow: var(--shadow);
}
.battle-stage figcaption {
  margin-top: 6px;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.3;
}
.versus {
  grid-area: vs;
  font-weight: 800;
  color: #e0892a;
  margin: 0;
  font-size: 1.05rem;
}
.battle-roster {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
  max-height: 220px;
  overflow-y: auto;
}
.battle-roster button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px; }
.battle-roster canvas {
  width: 120px;
  height: 120px;
  background: var(--art-well);
  border-radius: 18px;
}
.battle-meters { display: grid; gap: 8px; margin: 8px 0 14px; }
#cheerButton { position: sticky; bottom: 8px; z-index: 2; }
.encounter-card, .quiz-card { display: block; margin: 12px 0; }
.encounter-card canvas, .quiz-card canvas {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  height: auto;
  display: block;
  margin: 0 auto 10px;
  background: var(--art-well);
  border-radius: 24px;
}
.english-name {
  font-size: 1.3rem;
  font-weight: 800;
  color: #2d6a9f;
  margin: 6px 0;
  letter-spacing: .04em;
}
.dex-grid { display: grid; gap: 12px; }
.dex-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 12px;
  box-shadow: var(--shadow);
}
.dex-card canvas,
.dex-card .pet-art {
  width: 100%;
  max-width: 280px;
  height: auto;
  aspect-ratio: 1;
  background: var(--art-well);
  border-radius: 20px;
  justify-self: center;
}
.dex-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.stage-badge { background: #dff5e8; border-radius: 999px; padding: 4px 8px; font-size: .85rem; }
.echo-count, .stage-list { color: var(--muted); margin: 4px 0; }
.evolve-box { background: #f6fff8; border-radius: 14px; padding: 8px; margin: 8px 0; }
.sound-button { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 2px; background: #fff3c4; }
.sound-button em { font-style: normal; font-size: .95rem; color: var(--muted); }
.quiz-options button.correct { background: #8ee0a8; }
.quiz-options button.wrong { background: #ffc1b3; }
.result-text, .care-feedback { min-height: 1.5em; font-weight: 700; }
.privacy-copy p { margin: 0 0 12px; }
.privacy-copy button { background: #ffe4d9; }
.notice h2 { margin-bottom: 6px; }
@media (min-width: 500px) {
  body { padding-top: 20px; }
}

@keyframes fruit-fly { from { transform: translateY(0) scale(1); opacity: 1; } to { transform: translateY(-40px) scale(.4); opacity: 0; } }
@keyframes feed-burst { from { transform: scale(.4); opacity: 1; } to { transform: scale(1.4); opacity: 0; } }
@keyframes pet-happy { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.flying-fruit { position: absolute; animation: fruit-fly .7s ease forwards; }
