:root {
  color-scheme: light;
  --ink: #435653;
  --paper: #fffdf3;
  --sky: #d7f1f4;
  --grass: #80af81;
  --pink: #f5aeb7;
  --orange: #ef9d58;
  --line: #435653;
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--sky);
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100svh; background: radial-gradient(ellipse at 50% 20%, #eefafb 0%, var(--sky) 80%); padding: 28px 24px 12px; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: none; }
button:focus-visible, canvas:focus-visible { outline: 3px solid #2a7e91; outline-offset: 5px; }
button:disabled { opacity: .4; cursor: default; }
button:active, button.is-held { transform: translateY(3px); box-shadow: none; }
.game-shell { width: min(1120px, 100%); margin: 0 auto; }
.site-home-link { position: static; min-height: 44px; margin-bottom: 14px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 0 8px 21px; }
.brand { display: flex; align-items: center; gap: 14px; }
h1 { margin: 0; font-family: "HanziPen SC", "STKaiti", "KaiTi", "PingFang SC", sans-serif; font-weight: 900; font-size: 31px; letter-spacing: 1px; }
h1 > span { display: inline-block; color: #cf7b5f; transform: rotate(10deg); margin-left: 4px; }
.brand p { margin: 4px 0 0; font-size: 12px; color: #6b8581; letter-spacing: 2px; }
.pig-mark { position: relative; width: 48px; height: 44px; display: grid; place-items: center; background: #f5b6bd; border: 2px solid #a37478; border-radius: 47%; transform: rotate(-8deg); }
.pig-mark::before,.pig-mark::after { content: ""; width: 14px; height: 14px; border: 2px solid #a37478; background: #f5b6bd; border-radius: 4px 13px 2px 8px; position: absolute; top: -6px; left: 1px; z-index: -1; }
.pig-mark::after { left: auto; right: 0; transform: scaleX(-1); }
.pig-mark b { font-size: 9px; word-spacing: 7px; align-self: start; margin-top: 9px; }
.pig-mark i { width: 25px; height: 15px; border-radius: 50%; background: #eb909e; position: absolute; bottom: 7px; }
.pig-mark i::after { content: "• •"; display: block; font-size: 13px; text-align: center; color: #9d636e; line-height: 13px; }
.toolbar { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.score { display: flex; align-items: baseline; gap: 8px; padding: 10px 18px; margin-right: 7px; border-radius: 18px; background: var(--paper); border: 2px solid #b4caca; white-space: nowrap; }
.score > span,.score small { font-size: 13px; }
.score strong { font-family: "Avenir Next", "Trebuchet MS", sans-serif; font-size: 28px; line-height: 1; color: #4b805f; min-width: 20px; text-align: center; }
.icon-button { width: 44px; height: 44px; flex-shrink: 0; background: #ffffff75; border: 2px solid #b2cbca; border-radius: 50%; font-size: 23px; box-shadow: 0 3px 0 #bfd4d2; }
.icon-button[aria-pressed="false"] { color: #8b9491; text-decoration: line-through; }
.playfield { position: relative; height: min(58vw, 560px, calc(100svh - 305px)); min-height: 300px; border: 3px solid #5c8277; border-radius: 27px; overflow: hidden; background: #c9eced; box-shadow: 0 7px 0 #81a49a, 0 14px 24px #497b6710; isolation: isolate; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.scene-label { position: absolute; left: 26px; top: 21px; color: #608e85; font-size: 12px; letter-spacing: 1px; pointer-events: none; }
.scene-label span { font-size: 18px; vertical-align: -1px; margin-right: 5px; color: #dba853; }
.overlay { position: absolute; inset: 0; display: flex; align-items: center; justify-content: flex-end; padding: 32px 7% 85px; pointer-events: none; }
.overlay[hidden] { display: none; }
.welcome-card { width: 340px; max-width: 100%; padding: 26px 30px 22px; border: 2px solid #a5bba2; border-radius: 24px 24px 34px 24px; background: #fffdf3f5; box-shadow: 6px 8px 0 #6a987223; transform: rotate(1deg); pointer-events: auto; }
.paper-tag { display: inline-block; color: #78966d; font-size: 12px; font-weight: 700; letter-spacing: 1px; }
h2 { font-family: "HanziPen SC", "STKaiti", "KaiTi", sans-serif; margin: 13px 0; font-size: 35px; line-height: 1.35; letter-spacing: 2px; color: #455f51; }
h2 em { color: #bf7754; font-style: normal; }
.welcome-card p { font-size: 14px; line-height: 1.9; color: #758477; margin: 0 0 21px; }
.start-button { background: #f8cb70; border: 2px solid #a77d45; border-radius: 14px; box-shadow: 0 4px 0 #d4a152; padding: 13px 16px; width: 100%; font-size: 17px; font-weight: 800; display: flex; justify-content: space-between; align-items: center; }
.start-button > span { font-size: 24px; }
.welcome-note { display: block; text-align: center; margin-top: 15px; color: #8e9787; font-size: 11px; }
.ground-hud { position: absolute; left: 24px; right: 24px; bottom: 17px; display: flex; justify-content: space-between; align-items: center; gap: 15px; pointer-events: none; }
.health { display: flex; align-items: center; gap: 9px; background: #fffdf3e8; padding: 8px 13px; border: 2px solid #98b38b; border-radius: 15px; width: 214px; }
.health-icon { color: #d58891; font-size: 26px; }
.health-body { flex: 1; }
.health-body > span { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 5px; gap: 12px; }
.health-body strong { font-size: 12px; font-family: "Avenir Next", sans-serif; }
.health-track { height: 9px; border-radius: 6px; background: #e3e7d1; overflow: hidden; }
.health-track i { display: block; height: 100%; width: 100%; background: #85b982; border-radius: inherit; transition: width .15s; }
.health[data-low="true"] .health-track i { background: #d4a054; }
.ground-hud > p { font-size: 12px; color: #506f48; font-weight: 600; padding: 9px 12px; background: #eaf2cfb5; border-radius: 12px; margin: 0; }
.controls { display: flex; justify-content: space-between; align-items: center; gap: 22px; padding: 27px 14px 0; }
.move-controls { display: flex; align-items: center; gap: 10px; }
.move-button { height: 62px; width: 70px; border: 2px solid #719488; border-radius: 18px; box-shadow: 0 5px 0 #9cbcb1; background: var(--paper); font-family: system-ui, sans-serif; font-size: 30px; }
.keyboard-note { display: grid; gap: 5px; margin-left: 7px; white-space: nowrap; }
.keyboard-note strong { font-size: 13px; }
.keyboard-note span { font-size: 11px; color: #7a9790; }
.control-tip { font-size: 12px; line-height: 1.8; text-align: center; color: #769188; margin: 0; }
.control-tip strong { color: #557b6b; font-weight: 500; }
.fire-button { display: flex; align-items: center; justify-content: center; gap: 17px; min-width: 265px; min-height: 66px; padding: 9px 20px; border: 2px solid #ad764e; border-radius: 20px; background: #f3b47c; box-shadow: 0 5px 0 #c78e61; }
.net-icon { font-size: 37px; color: #755a49; }
.fire-button > span:nth-child(2) { display: grid; gap: 4px; text-align: left; }
.fire-button strong { font-size: 18px; }
.fire-button small { font-size: 10px; color: #916747; }
.fire-button b { font-size: 27px; font-weight: 400; }
footer { font-size: 10px; color: #89a59b; text-align: center; margin: 25px 0 0; letter-spacing: 1px; }
footer > span { margin: 0 9px; color: #8da89b; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 700px) {
  body { padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .site-home-link { margin-bottom: 10px; }
  .topbar { padding: 0 2px 16px; gap: 8px; }
  .brand { gap: 9px; }
  h1 { font-size: 23px; letter-spacing: 0; }
  .brand p { font-size: 9px; letter-spacing: 1px; }
  .pig-mark { width: 37px; height: 35px; }
  .pig-mark i { width: 20px; height: 12px; bottom: 5px; }
  .pig-mark b { font-size: 7px; margin-top: 7px; word-spacing: 4px; }
  .pig-mark::before,.pig-mark::after { width: 12px; height: 12px; }
  .toolbar { gap: 6px; }
  .score { padding: 8px 9px; gap: 4px; margin-right: 0; border-radius: 13px; }
  .score > span { font-size: 10px; }
  .score strong { font-size: 23px; }
  .score small { display: none; }
  .icon-button { width: 44px; height: 44px; font-size: 19px; }
  .playfield { height: clamp(300px, calc(100svh - 275px - env(safe-area-inset-top) - env(safe-area-inset-bottom)), 570px); min-height: 300px; border-radius: 23px; }
  .scene-label { font-size: 10px; left: 16px; top: 15px; }
  .overlay { justify-content: center; align-items: flex-start; padding: 58px 18px 80px; }
  .welcome-card { width: 280px; padding: 19px 22px; transform: rotate(-1deg); }
  h2 { font-size: 28px; line-height: 1.2; margin: 10px 0; }
  h2 br { display: none; }
  .paper-tag { font-size: 10px; }
  .welcome-card p { font-size: 12px; margin-bottom: 14px; }
  .start-button { padding: 10px 14px; font-size: 16px; }
  .welcome-note { margin-top: 12px; font-size: 10px; }
  .ground-hud { left: 12px; right: 12px; bottom: 14px; gap: 8px; }
  .health { width: 178px; padding: 7px 9px; gap: 6px; }
  .health-icon { font-size: 22px; }
  .ground-hud > p { max-width: 120px; text-align: right; font-size: 10px; padding: 5px 7px; }
  .controls { gap: 14px; padding: 17px 2px 0; }
  .move-controls { gap: 8px; }
  .move-button { width: 58px; height: 60px; border-radius: 16px; }
  .keyboard-note,.control-tip { display: none; }
  .fire-button { min-width: 0; min-height: 63px; flex: 1; gap: 9px; padding: 9px 10px; border-radius: 17px; }
  .fire-button strong { font-size: 16px; }
  .fire-button small { font-size: 9px; }
  .fire-button b { display: none; }
  .net-icon { font-size: 30px; }
  footer { font-size: 9px; letter-spacing: 0; margin-top: 12px; }
}
@media (min-width: 360px) and (max-width: 380px) { .brand { gap: 5px; } h1 { font-size: 20px; } .score { padding-inline: 6px; } }
@media (max-width: 359px) { .brand p { display: none; } .brand { gap: 5px; } h1 { font-size: 18px; white-space: nowrap; } .pig-mark { display: none; } .move-button { width: 48px; } .fire-button { gap: 5px; } }
@media (max-width: 380px), (max-width: 700px) and (max-height: 740px) {
  .overlay { padding-top: 32px; }
  .welcome-card { padding: 14px 18px; }
  h2 { font-size: 24px; margin: 8px 0; }
  .welcome-card p { font-size: 11px; line-height: 1.6; margin-bottom: 10px; }
  .start-button { min-height: 48px; padding: 8px 12px; font-size: 14px; }
  .start-button > span { font-size: 20px; }
  .welcome-note { margin-top: 9px; font-size: 9px; }
  .paper-tag { font-size: 9px; }
}
@media (min-width: 701px) and (max-height: 740px) {
  .overlay { align-items: flex-start; padding: 16px 5% 70px; }
  .welcome-card { padding: 14px 22px; }
  h2 { font-size: 26px; line-height: 1.2; margin: 8px 0; }
  .welcome-card p { font-size: 12px; line-height: 1.6; margin-bottom: 10px; }
  .start-button { padding: 9px 14px; font-size: 16px; }
  .welcome-note { font-size: 10px; margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) { *,*::before,*::after { transition: none !important; } }
