* { box-sizing: border-box; }
body { margin: 0; padding: 20px; background: #f4f0fc; color: #262333; font: 16px/1.6 system-ui, sans-serif; }
main { max-width: 560px; margin: 0 auto; }
.eyebrow { color: #675480; font-size: 12px; font-weight: 700; letter-spacing: .06em; }
h1 { font-size: 24px; line-height: 1.25; margin: 8px 0 14px; }
p { margin: 12px 0; }
canvas { display: block; width: 100%; max-width: 480px; height: auto; background: #111a2b; border: 2px solid #bca6e1; border-radius: 8px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
button { padding: 10px 14px; min-height: 44px; border: 1px solid #6546a8; border-radius: 7px; background: #6f4fbb; color: white; font: inherit; cursor: pointer; }
button:hover { background: #573991; }
button:focus-visible, canvas:focus-visible { outline: 3px solid #ef9b27; outline-offset: 3px; }
.note { color: #5e526e; font-size: 13px; }
#status { min-height: 52px; padding: 10px 12px; background: #fff; border-radius: 7px; }
@media (max-width: 400px) { body { padding: 14px; } h1 { font-size: 21px; } }

button:disabled { opacity: .55; cursor: default; }
.summary { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 10px 0; }
.summary p { margin: 0; }

.direction-pad { display: grid; grid-template-columns: repeat(3, minmax(48px, 64px)); gap: 8px; justify-content: center; margin: 16px 0; }
.direction-pad button { min-height: 52px; font-size: 24px; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.direction-pad [data-direction="up"] { grid-column: 2; }
.direction-pad [data-direction="left"] { grid-column: 1; }
.direction-pad .held { background: #322052; box-shadow: inset 0 0 0 3px #edc15e; }
