* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body { color: #293331; background: #f5f6f2; font-family: "Courier New", "Microsoft YaHei", monospace; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.topbar { position: absolute; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: start; pointer-events: none; }
.back { color: inherit; pointer-events: auto; }
.back svg { width: 24px; height: 24px; }
.scores { display: flex; gap: 24px; margin-left: auto; text-align: right; }
.scores span { display: block; font-size: 10px; }
.scores strong { font-size: 20px; font-weight: 700; }
.message { position: absolute; top: 26%; left: 50%; translate: -50% -50%; width: 90%; text-align: center; }
.message h1 { margin: 0 0 12px; font-size: 32px; line-height: 1.2; }
.message p { font: 12px/1.6 "Microsoft YaHei", sans-serif; margin: 6px 0; }
.message button { border: 0; border-radius: 3px; background: #293331; color: #fff; padding: 12px 22px; font: 700 13px monospace; cursor: pointer; }
.controls { position: absolute; left: 0; right: 0; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; justify-content: center; gap: 12px; }
.control { display: grid; place-items: center; width: 58px; height: 42px; border: 1px solid #68767066; border-radius: 3px; background: #f5f6f2dd; color: #293331; cursor: pointer; touch-action: none; }
.control svg { width: 20px; height: 20px; }
.control:active, .control.is-active { background: #bfe5cc; }
button:focus-visible, a:focus-visible { outline: 3px solid #c34f3b; outline-offset: 3px; }
body[data-game="racer"] { background: #5a8c65; color: white; }
body[data-game="racer"] .topbar { text-shadow: 1px 2px #263d2d; }
body[data-game="racer"] .message button { background: #f7d765; color: #273331; }
.embedded body[data-game="dino"] .message { top: 26%; bottom: auto; translate: -50% -50%; }
.embedded body[data-game="racer"] .message { bottom: 80px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
@media (max-height: 360px) { .scores { gap: 14px; } .scores strong { font-size: 16px; } .message h1 { font-size: 22px; } .control { width: 48px; height: 34px; } .controls { bottom: 8px; } }
