* { box-sizing:border-box; }
body { margin:0; color:#214840; background:#f0faf4; font:16px/1.5 system-ui,"Microsoft YaHei",sans-serif; }
header, main { width:min(100% - 32px, 672px); margin:auto; }
header { display:flex; justify-content:space-between; padding:16px 0; border-bottom:1px solid #bfd4c9; }
a { color:#075f54; text-underline-offset:3px; }
h1 { font-family:"Songti SC",SimSun,serif; font-size:clamp(32px,7vw,48px); line-height:1.2; margin:24px 0 2px; color:#104d45; }
.edition,.keys { margin:0 0 15px; color:#446259; }
.screen { position:relative; padding:clamp(6px,2vw,16px); border-radius:8px; background:#264e46; }
canvas { display:block; width:100%; height:auto; aspect-ratio:5/3; background:#c4c9c5; image-rendering:pixelated; touch-action:none; }
#status { position:absolute; inset:40% 10% auto; margin:0; text-align:center; background:#eaf5ea; }
.controls { display:flex; align-items:center; justify-content:space-between; gap:12px; margin:16px 0; }
.dpad,.actions { display:grid; gap:5px; }
.dpad { grid-template-columns:repeat(3,clamp(38px,9vw,58px)); }
.dpad button:first-child { grid-column:2; }
.dpad button:nth-child(2) { grid-column:1; }
.actions { grid-template-columns:repeat(2,minmax(44px,65px)); }
button { font:inherit; font-weight:600; min-height:42px; border:1px solid #86ad9e; border-radius:5px; background:#fff; color:#234e42; cursor:pointer; touch-action:manipulation; }
button.confirm { background:#006b60; color:white; }
button:active { background:#bce0cd; color:#184536; }
:focus-visible { outline:3px solid #ad521e; outline-offset:2px; }
.keys { font-size:14px; }
@media(pointer:coarse) { .keys { display:none; } }
@media (orientation:landscape) and (max-height:530px) {
main { width:min(100% - 28px,880px); display:grid; grid-template-columns:minmax(220px,1.4fr) minmax(180px,1fr); gap:6px 22px; }
header { padding:4px 0; } h1 { font-size:22px; margin:4px 0; } .edition { align-self:center; margin:0; }
.screen { width:min(100%,calc((100dvh - 80px)*1.6)); } .controls { flex-wrap:wrap; align-content:center; }
}
