/* 小小抗战者 —— 剪纸 / Q 版配色，移动优先，触控目标 ≥ 48px */
:root {
  --paper: #f6ead6;
  --card: #fffaf0;
  --ink: #3a2f2a;
  --ink2: #6b5a50;
  --line: #e3d3b6;
  --accent: #c8622a;
  --gold: #dfa13a;
  --green: #4f7d4a;
  --blue: #3f6a8a;
  --shadow: 0 6px 0 rgba(180, 150, 110, .28);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.85 "PingFang SC", "HarmonyOS Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

#app { max-width: 640px; margin: 0 auto; padding: 0 14px 64px; }
.screen { position: relative; }
.bg, .hero {
  display: block; width: calc(100% + 28px); margin-left: -14px;
  border-radius: 0 0 26px 26px;
  aspect-ratio: 16 / 9; object-fit: cover;
}
.hero { border-radius: 0 0 30px 30px; margin-bottom: 18px; }

.card {
  position: relative; margin-top: -22px;
  background: var(--card); border: 2px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 18px 16px 22px;
}

/* ---------- 顶部进度 + 数值 ---------- */
.top { margin-bottom: 12px; }
.prog { font-size: 13px; color: var(--ink2); letter-spacing: .04em; margin-bottom: 8px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.stat { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.sk { width: 2.6em; color: var(--ink2); }
.sbar { flex: 1; height: 8px; background: #eadcc4; border-radius: 99px; overflow: hidden; }
.sbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--accent)); transition: width .35s ease; }
.sv { width: 1.6em; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink2); }
.stat.zero .sv { color: var(--accent); font-weight: 700; }
.stat.zero .sbar i { background: var(--accent); }

/* ---------- 文本 ---------- */
h1 { font-size: 30px; line-height: 1.35; margin: 4px 0 10px; letter-spacing: .06em; }
h2 { font-size: 22px; line-height: 1.5; margin: 4px 0 8px; }
h3 { font-size: 15px; margin: 0 0 6px; letter-spacing: .1em; }
h4 { font-size: 16px; margin: 2px 0 4px; color: var(--blue); }
p { margin: 0 0 12px; }
.sub { color: var(--ink2); }
.sub2 { color: var(--ink2); font-size: 15px; }
.ep { font-size: 16px; }
.tip { font-size: 13px; color: var(--ink2); margin-top: 14px; }
.fine { font-size: 12px; color: var(--ink2); margin-top: 18px; line-height: 1.7; }
.rng { font-size: 13px; color: var(--accent); letter-spacing: .08em; margin-bottom: 8px; }
.big { font-size: 19px; line-height: 1.9; border-left: 4px solid var(--accent); padding-left: 12px; }

.date {
  display: inline-block; font-size: 13px; letter-spacing: .08em;
  background: var(--accent); color: #fff; border-radius: 99px; padding: 3px 12px; margin-bottom: 8px;
}
.atitle { margin-bottom: 10px; }
.abody { font-size: 16.5px; }
.chose { font-size: 14px; color: var(--ink2); margin-bottom: 6px; }
.rbody { font-size: 16.5px; }

/* ---------- 「与此同时」世界大事面板 ---------- */
.world {
  border: 2px dashed #b9cfe0; background: #f2f8fc; border-radius: 16px;
  padding: 12px 14px; margin: 14px 0;
}
.world h3 { color: var(--blue); }
.witem + .witem { margin-top: 10px; padding-top: 10px; border-top: 1px solid #d8e7f1; }
.wr { font-size: 12px; color: var(--blue); letter-spacing: .06em; }
.witem p { font-size: 14.5px; margin: 0; color: #3d5568; }

/* ---------- 选择 ---------- */
.choices { display: grid; gap: 10px; margin-top: 16px; }
.ch {
  min-height: 56px; padding: 12px 16px; text-align: left;
  font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 2px solid var(--line); border-radius: 16px;
  box-shadow: 0 4px 0 rgba(180, 150, 110, .25); cursor: pointer;
}
.ch:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(180, 150, 110, .25); }
.go {
  display: block; width: 100%; min-height: 52px; margin-top: 14px;
  font: inherit; font-size: 17px; letter-spacing: .1em;
  color: #fff; background: var(--accent); border: 0; border-radius: 16px;
  box-shadow: 0 4px 0 #a04d1f; cursor: pointer;
}
.go:active { transform: translateY(2px); box-shadow: 0 2px 0 #a04d1f; }

/* ---------- 结果 / 没能坚持 ---------- */
.delta { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.dl { font-size: 13px; border-radius: 99px; padding: 3px 11px; border: 1px solid; }
.dl.up { color: var(--green); border-color: #b9d3b6; background: #eef6ec; }
.dl.down { color: var(--accent); border-color: #e3bf9f; background: #fdf1e6; }
.setback { border-left: 4px solid var(--gold); background: #fdf6e6; border-radius: 0 12px 12px 0; padding: 10px 12px; font-size: 15px; }
.setback b { display: block; color: var(--accent); font-size: 14px; margin-bottom: 2px; }
.setback-note { font-size: 14px; color: var(--ink2); margin-top: 8px; }

/* ---------- 结算 / 终章 ---------- */
.tally { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 14px; color: var(--ink2); margin: 10px 0 4px; }
.tally b { color: var(--accent); font-size: 16px; }
.title, .final { text-align: left; padding-top: 0; }
.title h1, .final h1 { margin-top: 0; }

/* ---------- 世界大事归档 ---------- */
.arc { margin-top: 14px; font-size: 13.5px; color: var(--ink2); }
.arc summary { min-height: 40px; display: flex; align-items: center; cursor: pointer; color: var(--blue); }
.arc ul { margin: 0; padding-left: 18px; }
.arc li { margin-bottom: 4px; }
.arc b { color: var(--accent); font-weight: 600; margin-right: 6px; }

@media (max-width: 380px) {
  html, body { font-size: 16px; }
  h1 { font-size: 26px; }
  .stats { grid-template-columns: 1fr; }
  #app { padding: 0 10px 48px; }
  .bg, .hero { width: calc(100% + 20px); margin-left: -10px; }
}

/* ── 화면 전환 애니메이션 (아이의 흥미 유지) ── */
.screen { animation: fadeUp .45s ease both; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
.bg, .hero { animation: heroIn .8s ease both; }
@keyframes heroIn {
  from { opacity: 0; transform: scale(1.04); }
  to { opacity: 1; transform: scale(1); }
}
.ch { transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease; }
.ch:hover { border-color: var(--accent); }
.ch:active { transform: translateY(3px) scale(.99); box-shadow: 0 1px 0 rgba(180,150,110,.25); }
.go { transition: transform .12s ease, box-shadow .12s ease, filter .12s ease; }
.go:hover { filter: brightness(1.06); }
.go:active { transform: translateY(3px); box-shadow: 0 1px 0 #a04d1f; }

/* ── 여정 진행 점 (막 진행 시각화) ── */
.journey { display: flex; gap: 6px; margin: 8px 0 12px; }
.jdot { width: 10px; height: 10px; border-radius: 99px; background: #e3d3b6; transition: background .3s ease, transform .3s ease; }
.jdot.done { background: var(--accent); }
.jdot.now { background: var(--gold); transform: scale(1.35); box-shadow: 0 0 0 3px rgba(223,161,58,.3); }

/* ── 세계 패널 강조 ── */
.world { animation: fadeUp .5s ease .15s both; }
.wimg { display: block; width: 100%; border-radius: 12px; margin-bottom: 8px; aspect-ratio: 16/9; object-fit: cover; }

/* ── 모바일 안전 영역 + 스크롤 개선 ── */
#app {
  padding-left: max(14px, env(safe-area-inset-left));
  padding-right: max(14px, env(safe-area-inset-right));
  padding-bottom: max(64px, env(safe-area-inset-bottom));
}
html { overscroll-behavior-y: none; }
body { -webkit-overflow-scrolling: touch; }
@media (max-width: 640px) {
  .card { padding: 16px 14px 20px; border-radius: 18px; }
  h2 { font-size: 20px; }
  .abody, .rbody { font-size: 16px; line-height: 1.9; }
  .ch { font-size: 16px; padding: 14px; }
  .world { padding: 10px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .screen, .bg, .hero, .world { animation: none; }
  .ch, .go { transition: none; }
}