:root { color-scheme: light; --forest: #344b2c; --cream: #fff3ce; --honey: #ffcc61; }
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { position: fixed; inset: 0; height: 100dvh; background: #ecece0; font-family: system-ui, sans-serif; }
#startup-cover { position: fixed; inset: 0; z-index: 20; background: #ecece0 url('startup-paper.jpg') center 84% / cover no-repeat; }
#startup-cover.leaving { opacity: 0; transition: opacity .14s ease-out; pointer-events: none; }
#GameDiv, #Cocos3dGameContainer, #GameCanvas { width: 100%; height: 100%; }
#GameDiv { position: absolute; inset: 0; }
#game-safe-top { position: absolute; top: 0; left: 0; width: 0; height: env(safe-area-inset-top, 0px); visibility: hidden; pointer-events: none; }
canvas { display: block; touch-action: none; user-select: none; -webkit-tap-highlight-color: transparent; }
canvas:focus-visible { outline: 3px solid var(--honey); outline-offset: -3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.keyboard-controls { position: fixed; bottom: max(8px, env(safe-area-inset-bottom)); left: 50%; transform: translate(-50%, calc(100% + 32px)); z-index: 10; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; width: min(680px, calc(100vw - 16px)); max-height: calc(100dvh - max(8px, env(safe-area-inset-top)) - max(8px, env(safe-area-inset-bottom))); overflow-y: auto; padding: 12px; border: 2px solid var(--forest); border-radius: 16px; background: var(--cream); }
.keyboard-controls:focus-within { transform: translate(-50%, 0); }
.keyboard-controls [hidden] { display: none !important; }
.keyboard-controls button { border: 0; border-radius: 8px; background: var(--forest); color: var(--cream); padding: 10px 14px; min-height: 44px; font: inherit; cursor: pointer; }
.keyboard-controls button:disabled { opacity: .45; cursor: default; }
.keyboard-controls button:focus-visible, .keyboard-controls input:focus-visible { outline: 3px solid #9b5500; outline-offset: 3px; }
.keyboard-controls label { display: flex; align-items: center; gap: 8px; color: var(--forest); font-size: 14px; }
.keyboard-controls input { width: 160px; accent-color: var(--forest); }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
