:root {
  --paper: #faf5ec;
  --paper-2: #f4ead9;
  --ink: #44382c;
  --ink-soft: #7c6b58;
  --line: #e6d9c2;
  --card: #fffdf7;
  --amber: #c98d5a;
  --amber-deep: #a96f3e;
  --sage: #7d9b76;
  --rose: #c97b84;
  --sky: #7fa3b8;
  --violet: #9b83ad;
  --gold: #d9a441;
  --good: #5f9666;
  --bad: #c05b4d;
  --shadow: 0 10px 30px rgba(96, 74, 45, 0.12);
  --shadow-sm: 0 4px 14px rgba(96, 74, 45, 0.10);
  --radius: 18px;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", STSong, "SimSun", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 15% -5%, #fdf8ee 0%, rgba(253,248,238,0) 60%),
    radial-gradient(900px 520px at 105% 10%, #f3e7d3 0%, rgba(243,231,211,0) 55%),
    linear-gradient(160deg, #fbf6ee 0%, #f3e8d6 100%);
  min-height: 100vh;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(120, 90, 50, 0.08) 1px, transparent 1px);
  background-size: 26px 26px;
  z-index: 0;
}
#app { position: relative; z-index: 1; min-height: 100vh; }

.screen { display: none; animation: fadeIn 0.5s ease both; }
.screen.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes popIn { 0% { opacity: 0; transform: scale(0.94) translateY(6px); } 100% { opacity: 1; transform: none; } }
@keyframes flashUp { 0% { background: rgba(95,150,102,0.35); } 100% { background: transparent; } }
@keyframes flashDown { 0% { background: rgba(192,91,77,0.32); } 100% { background: transparent; } }
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pulse { 0% { transform: scale(1); } 50% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes fallDown { to { transform: translateY(110vh) rotate(720deg); opacity: 0.2; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }

.hidden { display: none !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  box-shadow: var(--shadow-sm);
  font-family: var(--sans);
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(135deg, var(--amber), var(--amber-deep));
  border-color: transparent;
  color: #fff;
}
.btn-soft { background: #f1e6d2; border-color: transparent; color: var(--ink); }
.btn-danger { background: #f6e2de; border-color: transparent; color: var(--bad); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-lg { padding: 16px 36px; font-size: 17px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.serif { font-family: var(--serif); }

/* ============ 主页 ============ */
.home-wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 42px 22px 70px;
  text-align: center;
}
.hero-badge {
  display: inline-block;
  font-size: 13px;
  letter-spacing: 4px;
  color: var(--amber-deep);
  background: #f4e7d3;
  border-radius: 999px;
  padding: 6px 16px;
  margin-bottom: 20px;
}
.hero-title {
  font-family: var(--serif);
  font-size: clamp(40px, 8vw, 68px);
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--ink);
  text-shadow: 0 2px 0 rgba(255,255,255,0.6);
}
.hero-title em { font-style: normal; color: var(--amber-deep); }
.hero-sub {
  font-family: var(--serif);
  color: var(--ink-soft);
  font-size: 16px;
  margin: 14px auto 10px;
  max-width: 520px;
  line-height: 1.9;
}
.hero-quote {
  font-family: var(--serif);
  color: var(--ink-soft);
  font-size: 14px;
  font-style: italic;
  margin: 6px auto 34px;
}
.hero-btns { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 44px; }

.slots-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 18px;
  margin-bottom: 14px;
  letter-spacing: 2px;
}
.save-slots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 40px;
}
.save-slot {
  position: relative;
  text-align: left;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.save-slot:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.save-slot .slot-name { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.save-slot .slot-meta { font-size: 13px; color: var(--ink-soft); line-height: 1.7; }
.slot-delete {
  position: absolute;
  top: 10px;
  right: 10px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 15px;
  padding: 4px;
  border-radius: 8px;
}
.slot-delete:hover { color: var(--bad); background: #f6e2de; }
.slot-empty { opacity: 0.55; border-style: dashed; display: flex; align-items: center; justify-content: center; min-height: 96px; color: var(--ink-soft); font-size: 14px; }

.guide {
  text-align: left;
  max-width: 720px;
  margin: 0 auto;
}
.guide h3 {
  font-family: var(--serif);
  letter-spacing: 2px;
  font-size: 17px;
  margin-bottom: 12px;
  color: var(--amber-deep);
}
.guide p { font-size: 14px; line-height: 2; color: var(--ink-soft); }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.guide-item { background: #f6efdf; border-radius: 12px; padding: 10px 14px; font-size: 13px; line-height: 1.7; }
.guide-item b { display: block; margin-bottom: 2px; color: var(--ink); }

/* ============ 创建流程 ============ */
.create-wrap { max-width: 760px; margin: 0 auto; padding: 30px 20px 70px; }
.step-dots { display: flex; gap: 10px; justify-content: center; margin: 6px 0 26px; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #e4d7c2; transition: all 0.25s ease; }
.dot.active { background: var(--amber); transform: scale(1.25); box-shadow: 0 0 0 4px rgba(201,141,90,0.2); }
.dot.done { background: var(--sage); }
.step-card { animation: fadeUp 0.4s ease both; }
.step-title { font-family: var(--serif); font-size: 26px; font-weight: 700; letter-spacing: 2px; margin-bottom: 6px; }
.step-sub { color: var(--ink-soft); font-size: 14px; line-height: 1.9; margin-bottom: 20px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.field { flex: 1; min-width: 150px; }
.field label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; }
.field input, .field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 15px;
  color: var(--ink);
  font-family: var(--sans);
  outline: none;
}
.field input:focus, .field select:focus { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(201,141,90,0.15); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.choice-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: all 0.16s ease;
  text-align: left;
}
.choice-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: #d8c4a2; }
.choice-card.selected { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(201,141,90,0.2); background: #fdf8ee; }
.choice-card .cc-emoji { font-size: 30px; margin-bottom: 8px; display: block; }
.choice-card .cc-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.choice-card .cc-desc { font-size: 13px; line-height: 1.8; color: var(--ink-soft); }
.choice-card .cc-bonus { display: inline-block; margin-top: 10px; font-size: 12px; color: var(--amber-deep); background: #f7ead6; padding: 3px 10px; border-radius: 999px; }
.wizard-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 26px; }
.name-preview { margin-top: 14px; padding: 14px 16px; background: #f6efdf; border-radius: 12px; font-family: var(--serif); font-size: 15px; line-height: 2; color: var(--ink); }
.name-preview b { color: var(--amber-deep); }
.confirm-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 18px 0; }
.confirm-item { background: #f6efdf; border-radius: 12px; padding: 12px 14px; font-size: 13px; line-height: 1.8; }
.confirm-item b { display: block; color: var(--amber-deep); margin-bottom: 2px; font-size: 12px; letter-spacing: 1px; }

/* ============ 游戏主界面 ============ */
.game-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(250, 245, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.gh-name { font-family: var(--serif); font-weight: 700; font-size: 17px; }
.age-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  background: var(--ink);
  color: #f7eeda;
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 13px;
}
.age-pill .age-num { font-size: 21px; font-weight: 800; transition: transform 0.3s ease; }
.age-pill.pop .age-num { animation: pulse 0.6s ease; }
.stage-badge { font-size: 13px; padding: 5px 12px; border-radius: 999px; background: #f1e6d2; color: var(--amber-deep); }
.gh-spacer { flex: 1; }
.gh-flow { display: inline-flex; background: #efe3cd; border-radius: 999px; padding: 3px; }
.gh-flow button { border: none; background: transparent; padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer; color: var(--ink-soft); }
.gh-flow button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

.game-shell {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 18px 80px;
  align-items: start;
}
.side-panel { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 84px; }
.panel-title { font-family: var(--serif); font-weight: 700; font-size: 15px; letter-spacing: 2px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.panel-title .pt-extra { font-size: 12px; color: var(--ink-soft); letter-spacing: 0; font-family: var(--sans); }
.stat-row { margin-bottom: 11px; }
.stat-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.stat-head .stat-val { font-weight: 700; }
.stat-bar { height: 9px; border-radius: 99px; background: #eee2cd; overflow: hidden; position: relative; }
.bar-fill { height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--amber), #e0b37e); transition: width 0.8s cubic-bezier(0.22, 1, 0.36, 1); }
.stat-row.flash-up .stat-bar { animation: flashUp 1s ease; }
.stat-row.flash-down .stat-bar { animation: flashDown 1s ease; }
.wealth-line { display: flex; justify-content: space-between; align-items: center; font-size: 14px; padding: 8px 0; border-top: 1px dashed var(--line); }
.wealth-line:first-of-type { border-top: none; }
.wealth-line b { font-size: 16px; color: var(--gold); }
.meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.meta-cell { background: #f6efdf; border-radius: 10px; padding: 8px 10px; font-size: 12px; line-height: 1.7; }
.meta-cell b { display: block; font-size: 13px; }
.meta-cell .mc-label { color: var(--ink-soft); font-size: 11px; }
.ach-preview { display: flex; flex-wrap: wrap; gap: 6px; }
.ach-mini { font-size: 12px; background: #f1e6d2; border-radius: 999px; padding: 3px 9px; color: var(--amber-deep); }
.ach-mini.locked { background: #efe7da; color: #b3a691; opacity: 0.7; }

.main-panel { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.year-intro { border-left: 4px solid var(--amber); }
.year-intro .yi-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.yi-year { font-family: var(--serif); font-size: 22px; font-weight: 800; }
.yi-season { font-size: 13px; color: var(--sage); background: #edf3e9; padding: 3px 10px; border-radius: 999px; }
.yi-stage { font-size: 13px; color: var(--rose); background: #f8eaec; padding: 3px 10px; border-radius: 999px; }
.yi-era { font-size: 14px; color: var(--ink-soft); line-height: 1.9; margin-top: 4px; }
.yi-flavor { font-family: var(--serif); font-size: 15px; line-height: 2; margin-top: 8px; color: var(--ink); }

.event-card { animation: popIn 0.4s ease both; border-left: 4px solid var(--sage); }
.event-card.love-line { border-left-color: var(--rose); }
.event-card.career-line { border-left-color: var(--sky); }
.event-card.family-line { border-left-color: var(--violet); }
.event-kind { font-size: 12px; letter-spacing: 2px; color: var(--ink-soft); margin-bottom: 6px; }
.event-title { font-family: var(--serif); font-size: 23px; font-weight: 700; margin-bottom: 10px; letter-spacing: 1px; }
.event-prose { font-family: var(--serif); font-size: 15px; line-height: 2.1; color: #4f4234; margin-bottom: 16px; }
.option-list { display: flex; flex-direction: column; gap: 10px; }
.option-btn {
  text-align: left;
  background: #fbf7ee;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 16px;
  cursor: pointer;
  transition: all 0.16s ease;
  font-size: 14px;
  color: var(--ink);
  line-height: 1.7;
}
.option-btn:hover { transform: translateX(4px); border-color: var(--amber); box-shadow: var(--shadow-sm); }
.option-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.opt-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.opt-text { font-weight: 600; }
.opt-persona { font-size: 11px; color: var(--amber-deep); background: #f7ead6; border-radius: 999px; padding: 2px 8px; }
.opt-persona.miss { color: var(--ink-soft); background: #eee5d5; }
.preview-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.preview-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #edf3e9; color: var(--good); }
.preview-chip.down { background: #f8eaec; color: var(--bad); }
.preview-chip.unknown { background: #eee5d5; color: var(--ink-soft); }
.result-panel { background: #f6f2e7; border-radius: 14px; padding: 16px 18px; margin-top: 14px; animation: fadeUp 0.45s ease both; }
.result-panel .rp-label { font-size: 12px; color: var(--amber-deep); letter-spacing: 2px; margin-bottom: 8px; }
.result-panel .rp-text { font-family: var(--serif); font-size: 15px; line-height: 2.1; }
.result-panel .rp-deltas { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.parallel-note { margin-top: 12px; padding: 12px 14px; border: 1px dashed #cbb38f; border-radius: 12px; background: #fbf5ea; font-size: 13px; color: #8a6a45; line-height: 1.9; animation: fadeUp 0.5s ease both; }
.parallel-note b { color: var(--amber-deep); }
.continue-row { display: flex; justify-content: flex-end; margin-top: 14px; }

.actions-panel { border-left: 4px solid var(--sky); }
.actions-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 12px; }
.energy-line { font-size: 13px; color: var(--ink-soft); }
.energy-line b { color: var(--sky); font-size: 15px; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.action-btn {
  background: #fbf7ee;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
}
.action-btn:hover { transform: translateY(-2px); border-color: var(--sky); box-shadow: var(--shadow-sm); }
.action-btn.disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.action-btn .ab-emoji { font-size: 24px; display: block; margin-bottom: 6px; }
.action-btn .ab-name { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.action-btn .ab-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.action-btn .ab-req { font-size: 11px; color: var(--bad); margin-top: 5px; line-height: 1.5; }
.end-year-row { display: flex; justify-content: center; margin-top: 16px; }

.timeline-mini { max-height: 260px; overflow-y: auto; }
.tl-item { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px dashed #eee2cd; font-size: 13px; line-height: 1.7; }
.tl-item:last-child { border-bottom: none; }
.tl-year { color: var(--amber-deep); font-weight: 700; white-space: nowrap; min-width: 52px; }
.tl-item.memory .tl-text { font-family: var(--serif); color: #5f4a32; }

.summary-card { border-left: 4px solid var(--gold); }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 14px 0; }
.sc-cell { background: #f6efdf; border-radius: 12px; padding: 10px 12px; text-align: center; }
.sc-cell .sc-num { font-size: 20px; font-weight: 800; color: var(--amber-deep); }
.sc-cell .sc-label { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ============ 死亡与总结 ============ */
.death-wrap { max-width: 860px; margin: 0 auto; padding: 30px 20px 80px; }
.death-scene { text-align: center; padding: 46px 26px; border-radius: 22px; background: linear-gradient(170deg, #2f2a26 0%, #4a4036 100%); color: #efe6d4; box-shadow: var(--shadow); animation: fadeIn 0.8s ease both; }
.death-scene .ds-kicker { font-size: 13px; letter-spacing: 5px; color: #c9b393; }
.death-scene .ds-title { font-family: var(--serif); font-size: 30px; margin: 12px 0 8px; }
.death-scene .ds-meta { font-size: 14px; color: #b8a98f; margin-bottom: 18px; }
.death-scene .ds-text { font-family: var(--serif); font-size: 16px; line-height: 2.3; max-width: 560px; margin: 0 auto; }
.montage { margin-top: 24px; }
.montage h3 { font-family: var(--serif); text-align: center; letter-spacing: 4px; margin-bottom: 16px; color: var(--amber-deep); }
.quote { border-left: 3px solid var(--amber); background: #fdf8ee; border-radius: 12px; padding: 12px 16px; margin-bottom: 10px; font-family: var(--serif); font-size: 14px; line-height: 2; animation: fadeUp 0.5s ease both; }
.quote .q-meta { display: block; font-size: 12px; color: var(--ink-soft); font-family: var(--sans); margin-top: 4px; }

.grade-banner { display: flex; align-items: center; gap: 20px; background: linear-gradient(135deg, #fff8e8, #f8ecd6); border: 1px solid #e6d3ae; border-radius: 20px; padding: 24px; margin-top: 24px; flex-wrap: wrap; }
.grade-big { font-size: 74px; font-weight: 800; color: var(--amber-deep); font-family: var(--serif); line-height: 1; }
.grade-info { flex: 1; min-width: 220px; }
.grade-info h3 { font-family: var(--serif); font-size: 20px; margin-bottom: 6px; }
.grade-info p { font-size: 14px; line-height: 1.9; color: var(--ink-soft); }
.score-bars { margin-top: 18px; }
.score-bar-row { display: grid; grid-template-columns: 74px 1fr 42px; align-items: center; gap: 10px; margin-bottom: 9px; font-size: 13px; }
.score-bar-row .sb-track { height: 8px; border-radius: 99px; background: #eee2cd; overflow: hidden; }
.score-bar-row .sb-fill { height: 100%; background: linear-gradient(90deg, var(--amber), var(--gold)); border-radius: 99px; transition: width 1s ease; }
.timeline-full { margin-top: 26px; }
.timeline-full h3 { font-family: var(--serif); letter-spacing: 3px; margin-bottom: 14px; color: var(--amber-deep); }
.tl-line { position: relative; padding-left: 26px; margin-left: 8px; border-left: 2px solid #e2d2b8; }
.tl-node { position: relative; margin-bottom: 14px; }
.tl-node::before { content: ""; position: absolute; left: -33px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 3px #f6ead6; }
.tl-node .tln-year { font-size: 12px; color: var(--amber-deep); font-weight: 700; }
.tl-node .tln-text { font-size: 14px; line-height: 1.9; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.ach-tile { background: #fdf8ee; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.6; }
.ach-tile .at-emoji { font-size: 18px; margin-right: 6px; }
.ach-tile.locked { opacity: 0.4; }
.epitaph-box { margin-top: 26px; padding: 26px; text-align: center; background: #f4e9d5; border-radius: 20px; font-family: var(--serif); }
.epitaph-box .eb-label { font-size: 12px; letter-spacing: 4px; color: var(--ink-soft); margin-bottom: 12px; }
.epitaph-box .eb-text { font-size: 18px; line-height: 2.2; color: var(--ink); }
.death-actions { display: flex; gap: 12px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }

/* ============ 弹窗 / Toast ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(60, 45, 30, 0.42);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease both;
}
.modal { width: 100%; max-width: 460px; animation: popIn 0.3s ease both; }
.modal h3 { font-family: var(--serif); letter-spacing: 2px; margin-bottom: 12px; }
.modal p { font-size: 14px; line-height: 1.9; color: var(--ink-soft); margin-bottom: 16px; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

#toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.toast {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 12px 20px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: center;
  animation: popIn 0.4s ease both;
  pointer-events: auto;
  width: 100%;
}
.toast .t-emoji { font-size: 22px; }
.toast .t-text b { display: block; }
.toast .t-text span { font-size: 12px; color: var(--ink-soft); }

.confetti { position: fixed; top: -20px; z-index: 130; width: 9px; height: 14px; border-radius: 2px; pointer-events: none; animation: fallDown linear both; }

/* ============ 响应式 ============ */
@media (max-width: 940px) {
  .game-shell { grid-template-columns: 1fr; }
  .side-panel { position: static; flex-direction: row; flex-wrap: wrap; }
  .side-panel > .card { flex: 1 1 260px; }
  .game-header { gap: 8px; }
  .gh-name { width: 100%; order: -1; }
}
@media (max-width: 560px) {
  .btn-lg { padding: 13px 26px; font-size: 15px; }
  .card { padding: 16px; }
  .event-title { font-size: 20px; }
  .option-btn { padding: 11px 13px; }
  .action-grid { grid-template-columns: repeat(2, 1fr); }
  .grade-big { font-size: 56px; }
  .death-scene { padding: 34px 16px; }
}

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #dcc9a8; border-radius: 99px; }
::-webkit-scrollbar-track { background: transparent; }
