@font-face {
  font-family: BurnheartPixel;
  src: url('/games/burnheart/fonts/fusion-pixel-12px-proportional-zh_hans.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
:root {
  color-scheme: dark;
  --night: #171526;
  --panel: #242137;
  --raised: #302b46;
  --cream: #fff3d8;
  --ink: #2d2536;
  --muted: #c5b9cb;
  --line: #70607d;
  --coral: #ff835b;
  --coral-hover: #ff9d71;
  --yellow: #ffe08a;
  --mint: #9be7c7;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--night);
  color: var(--cream);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  accent-color: var(--coral);
  scrollbar-color: var(--line) var(--night);
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, input { font: inherit; }
button, summary, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .5; }
button, a { transition: background-color 150ms ease-out, color 150ms ease-out, border-color 150ms ease-out, transform 150ms ease-out; }
button svg, .restart-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; stroke-linejoin: miter; flex: 0 0 auto; }
a { color: inherit; text-underline-offset: .25em; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--yellow); outline-offset: 4px; }
h2:focus { outline: none; }
::selection { background: var(--yellow); color: var(--ink); }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 12px 16px; background: var(--yellow); color: var(--ink); transform: translateY(-180%); }
.skip-link:focus { transform: none; }
.game-shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.game-header { min-height: 84px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.game-name { display: flex; gap: 13px; align-items: center; }
.pot-mark { width: 38px; height: 38px; flex: 0 0 auto; color: var(--yellow); }
.game-header h1 { color: var(--yellow); margin: 0; font-family: BurnheartPixel, sans-serif; font-size: 36px; font-weight: 400; line-height: 1.25; }
.header-note { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--mint); }
.open-light { width: 6px; height: 6px; background: var(--mint); }
.statbar { display: flex; align-items: center; gap: 30px; padding: 15px 20px; margin-bottom: 18px; background: var(--panel); border-top: 2px solid var(--line); border-bottom: 2px solid var(--line); }
.balance { display: flex; align-items: baseline; gap: 12px; flex: 0 0 auto; }
.statbar span { font-size: 12px; color: var(--muted); }
.statbar strong { display: inline-block; }
.balance strong { color: var(--yellow); font-size: 25px; font-weight: 800; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.heat { flex: 1; max-width: 330px; margin: 0 auto; }
.heat > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.heat strong { color: var(--coral); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.heat-meter { height: 8px; background: #57475f; overflow: hidden; }
.heat-meter span { display: block; width: 100%; height: 100%; background: var(--coral); transform-origin: left; transform: scaleX(0); transition: transform 420ms cubic-bezier(.16,1,.3,1); }
.reputation { display: flex; align-items: baseline; gap: 12px; }
.reputation strong { color: var(--mint); font-size: 20px; font-weight: 750; font-variant-numeric: tabular-nums; }
.scene-frame { position: relative; margin: 0; aspect-ratio: 16/10; overflow: hidden; background: #352936; border: 3px solid var(--yellow); }
.scene-frame > img, .result-art img { display: block; width: 100%; height: 100%; object-fit: cover; image-rendering: pixelated; }
.scene-frame figcaption { position: absolute; right: 12px; bottom: 12px; left: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--cream); font-size: 11px; font-weight: 600; }
.scene-frame figcaption span { padding: 7px 9px; background: var(--night); }
.scene-frame figcaption span:last-child { color: var(--yellow); flex: 0 0 auto; }
.scene-frame.is-changing > img { animation: stove-light 480ms cubic-bezier(.16,1,.3,1); }
@keyframes stove-light { from { filter: brightness(.7) saturate(1.2); } to { filter: brightness(1) saturate(1); } }
.story-panel { padding: 22px 0 0; }
.story-panel h2 { margin: 0 0 15px; font-family: BurnheartPixel, sans-serif; font-size: 24px; font-weight: 400; line-height: 1.5; text-wrap: balance; }
.dialogue { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.dialogue p { background: var(--cream); color: var(--ink); margin: 0; padding: 11px 14px; border-radius: 2px 10px 10px 10px; font-size: 14px; line-height: 1.65; }
.dialogue .narrator { background: transparent; color: var(--muted); padding: 0 1px 4px; border-radius: 0; }
.speaker { font-size: 12px; font-weight: 700; margin-right: 9px; color: #6c3d54; }
.narrator .speaker { color: var(--coral); }
.choices { display: flex; flex-direction: column; gap: 10px; }
.choice-button { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; min-height: 68px; border: 2px solid var(--line); border-radius: 2px; padding: 11px 14px; background: var(--panel); color: var(--cream); }
.choice-button:hover:not(:disabled) { background: var(--raised); border-color: var(--yellow); transform: translateX(3px); }
.choice-button:active:not(:disabled) { background: var(--yellow); color: var(--ink); transform: translateX(0); }
.choice-key { display: flex; align-items: center; justify-content: center; width: 24px; height: 26px; flex: 0 0 auto; background: var(--yellow); color: var(--ink); font-size: 12px; font-weight: 800; }
.choice-copy { display: block; flex: 1; min-width: 0; }
.choice-label { display: block; font-size: 15px; font-weight: 650; line-height: 1.4; }
.choice-hint { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.choice-button:active .choice-hint { color: var(--ink); }
.choice-button svg { color: var(--coral); }
.choices.is-dealt .choice-button { animation: choices-arrive 360ms cubic-bezier(.16,1,.3,1) backwards; animation-delay: calc(var(--choice-order, 0) * 45ms); }
@keyframes choices-arrive { from { transform: translateY(7px); opacity: .8; } to { transform: translateY(0); opacity: 1; } }
.outcome-panel { padding: 21px 18px; background: var(--panel); border: 2px solid var(--coral); }
.outcome-panel h2 { color: var(--yellow); }
.outcome-panel > p { font-size: 16px; line-height: 1.75; margin: 0; }
.outcome-panel.is-ready { animation: order-served 400ms cubic-bezier(.16,1,.3,1); }
@keyframes order-served { from { transform: translateY(9px); filter: brightness(1.2); } to { transform: translateY(0); filter: brightness(1); } }
.deltas { list-style: none; padding: 0; margin: 21px 0 24px; display: flex; flex-wrap: wrap; gap: 10px 16px; }
.deltas li { font-size: 13px; color: var(--muted); }
.deltas strong { display: inline-block; margin-left: 7px; color: var(--cream); font-weight: 700; font-variant-numeric: tabular-nums; }
.deltas .benefit { color: var(--mint); }
.deltas .cost { color: var(--coral); }
.primary-button, .secondary-button { width: 100%; min-height: 54px; padding: 13px 16px; border: 2px solid transparent; border-radius: 2px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; font-size: 15px; font-weight: 750; line-height: 1.5; text-decoration: none; }
.primary-button { background: var(--coral); color: var(--ink); }
.primary-button:hover:not(:disabled) { background: var(--coral-hover); transform: translateY(-2px); }
.primary-button:active:not(:disabled) { transform: translateY(0); }
.secondary-button { border-color: var(--line); background: var(--panel); color: var(--cream); }
.secondary-button:hover:not(:disabled) { border-color: var(--mint); background: var(--raised); }
.text-button { min-height: 44px; padding: 8px 10px; border: 0; background: transparent; color: var(--yellow); font-size: 13px; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.small-button { min-height: 44px; padding: 9px 13px; background: var(--yellow); color: var(--ink); border: 0; border-radius: 2px; font-size: 13px; font-weight: 700; }
.small-button:hover { background: var(--cream); }
.resume-bar { margin-bottom: 16px; padding: 10px 14px; background: var(--raised); border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.resume-bar p { font-size: 13px; line-height: 1.5; margin: 0; }
.resume-bar > div { display: flex; align-items: center; flex: 0 0 auto; gap: 4px; }
.status { margin: 14px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.status:empty { display: none; }
.notice { margin: 20px 0; line-height: 1.7; color: var(--yellow); }
.game-footer { padding: 20px 0 max(24px, env(safe-area-inset-bottom)); color: var(--muted); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 4px 16px; font-size: 11px; line-height: 1.5; }
.game-footer > p { margin: 0; }
.game-footer > a { text-decoration: underline; min-height: 44px; display: inline-flex; align-items: center; color: var(--muted); }
.game-footer > a:hover { color: var(--cream); }
.game-footer details { font-size: 12px; }
.game-footer details[open] { order: 3; width: 100%; }
.game-footer summary { min-height: 44px; display: flex; align-items: center; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.game-footer details p { margin: 0 0 10px; }
.result-panel { max-width: 820px; margin: 0 auto; }
.result-card { background: var(--panel); border: 3px solid var(--yellow); }
.result-art { width: 100%; aspect-ratio: 16/10; margin: 0; background: #352936; border-bottom: 3px solid var(--yellow); }
.result-copy { padding: 24px 26px; }
.result-copy h2 { color: var(--yellow); font-family: BurnheartPixel, sans-serif; font-size: 36px; font-weight: 400; line-height: 1.5; margin: 0 0 12px; text-wrap: balance; }
.result-quote { font-size: 18px; line-height: 1.6; color: var(--coral); font-weight: 650; margin: 0 0 13px; }
.result-body { font-size: 15px; line-height: 1.75; margin: 0; white-space: pre-line; }
.result-stats { color: var(--mint); margin: 18px 0 0; font-size: 13px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.moments { margin: 25px 0 24px; }
.moments h3 { font-size: 17px; line-height: 1.5; margin: 0 0 16px; font-weight: 700; }
.moments ol { padding: 0; margin: 0; list-style: none; }
.moments li { padding: 0 0 17px; }
.moments li:last-child { padding-bottom: 0; }
.moments strong { display: block; font-size: 14px; font-weight: 650; line-height: 1.55; color: var(--yellow); }
.moments p { margin: 4px 0 0; font-size: 13px; line-height: 1.65; color: var(--muted); }
.result-actions { display: flex; gap: 10px; }
.result-actions > * { flex: 1; }
.collection { margin: 16px 0 0; font-size: 12px; line-height: 1.6; color: var(--muted); text-align: center; }
.restart-button { width: 100%; min-height: 52px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 0; background: transparent; color: var(--yellow); font-size: 15px; font-weight: 650; margin: 6px 0 0; padding: 14px; }
.restart-button:hover { color: var(--cream); }
.shared-note { margin: 0 0 16px; padding: 13px 16px; background: var(--raised); font-size: 14px; line-height: 1.7; }
.share-fallback { margin-top: 16px; padding: 15px; background: var(--raised); }
.share-fallback label { display: block; font-size: 13px; line-height: 1.5; }
.share-fallback input { width: 100%; min-height: 46px; border: 1px solid var(--line); background: var(--night); border-radius: 2px; padding: 10px; margin: 10px 0; color: var(--cream); font-size: 14px; caret-color: var(--coral); }
dialog { padding: 22px; background: var(--night); color: var(--cream); width: min(520px, calc(100% - 28px)); max-height: calc(100dvh - 30px); border: 2px solid var(--yellow); border-radius: 2px; overflow-y: auto; }
dialog::backdrop { background: #0b091cda; }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog-heading h2 { margin: 0; font-size: 19px; line-height: 1.5; }
dialog > p { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 6px 0 16px; }
#saved-image-area img { display: block; width: 100%; height: auto; margin-bottom: 18px; }
@media (min-width: 900px) {
  #game-panel { display: grid; grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); gap: 0 28px; align-items: start; }
  .statbar { grid-column: 1 / -1; }
  .scene-frame { grid-column: 1; position: sticky; top: 20px; }
  .story-panel { grid-column: 2; padding-top: 0; }
}
@media (max-width: 899px) {
  .game-shell { max-width: 620px; padding: 0 20px; }
  .game-header { min-height: 72px; }
  .game-header h1 { font-size: 24px; }
  .statbar { gap: 24px; padding: 13px 14px; margin-bottom: 14px; }
  .balance, .reputation { flex-direction: column; gap: 1px; align-items: flex-start; }
  .heat { max-width: 230px; }
  .reputation strong { font-size: 17px; }
}
@media (max-width: 540px) {
  .game-shell { padding: 0 12px; }
  .game-header { min-height: 64px; gap: 9px; }
  .game-name { gap: 8px; }
  .pot-mark { width: 29px; height: 29px; }
  .game-header h1 { font-size: 24px; }
  .header-note { max-width: 62px; line-height: 1.4; font-size: 10px; gap: 5px; }
  .open-light { flex: 0 0 auto; width: 5px; height: 5px; }
  .statbar { padding: 9px 10px; margin-bottom: 12px; gap: 16px; }
  .statbar span { font-size: 11px; }
  .balance { gap: 0; }
  .balance strong { font-size: 21px; line-height: 1.3; }
  .heat { max-width: 170px; }
  .heat > div:first-child { gap: 6px; margin-bottom: 6px; }
  .heat strong { font-size: 10px; }
  .heat-meter { height: 7px; }
  .reputation { text-align: right; align-items: flex-end; }
  .reputation strong { font-size: 16px; }
  .scene-frame figcaption { bottom: 8px; left: 8px; right: 8px; gap: 6px; font-size: 10px; }
  .scene-frame figcaption span { padding: 5px 6px; }
  .story-panel { padding: 17px 0 0; }
  .story-panel h2 { font-size: 24px; margin-bottom: 12px; }
  .dialogue { gap: 6px; margin-bottom: 16px; }
  .dialogue p { font-size: 13px; line-height: 1.6; padding: 8px 10px; }
  .dialogue .narrator { padding: 0 1px 2px; }
  .speaker { font-size: 11px; margin-right: 7px; }
  .choice-button { min-height: 64px; padding: 9px 10px; gap: 10px; }
  .choice-key { width: 21px; height: 24px; }
  .choice-label { font-size: 14px; }
  .choice-hint { font-size: 12px; }
  .choice-button svg { width: 17px; height: 17px; }
  .outcome-panel { padding: 18px 14px; }
  .outcome-panel > p { font-size: 15px; line-height: 1.7; }
  .deltas { margin: 18px 0 21px; gap: 8px 13px; }
  .deltas li { font-size: 12px; }
  .resume-bar { flex-wrap: wrap; gap: 5px; }
  .resume-bar > div { margin-left: auto; }
  .result-copy { padding: 21px 15px; }
  .result-quote { font-size: 17px; }
  .result-body { font-size: 14px; }
  .moments { margin: 22px 3px; }
  .result-actions { flex-direction: column; gap: 9px; }
  .shared-note { font-size: 13px; }
  .game-footer { padding-top: 18px; gap: 0 10px; font-size: 10px; }
  .game-footer > p { width: 100%; }
  .game-footer > a { margin-left: auto; }
}
@media (max-width: 350px) { .statbar { gap: 10px; } .heat strong { font-size: 9px; } }
@media (prefers-reduced-motion: reduce) { :root { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
