* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #17142b; color: #ffebcb; font: 14px system-ui, sans-serif; }
#stage { position: relative; width: 100%; height: 100dvh; overflow: hidden; }
canvas, #field { position: absolute; inset: 0; width: 100%; height: 100%; }
#field { z-index: 1; touch-action: none; user-select: none; }
header { position: absolute; z-index: 2; top: max(12px,env(safe-area-inset-top)); left: 16px; right: 16px; pointer-events: none; }
small { font-size: 9px; letter-spacing: 1.5px; color: #8ee4e2; }
h1 { font-size: 23px; font-weight: 600; margin: 5px 0; }
#clock { position: absolute; right: 0; top: 53px; font-size: 22px; font-variant-numeric: tabular-nums; }
#message { position: absolute; z-index: 2; top: 100px; left: 4%; width: 92%; text-align: center; color: #ffd08b; font-size: 12px; pointer-events: none; }
footer { position: absolute; z-index: 2; bottom: max(12px,env(safe-area-inset-bottom)); width: 100%; text-align: center; pointer-events: none; }
#help { line-height: 1.5; font-size: 11px; text-shadow: 0 1px 4px #17142b; }
nav { display: flex; justify-content: center; gap: 10px; }
button { min-width: 90px; min-height: 44px; border: 1px solid #8ee4e2; border-radius: 24px; background: #30263e; color: inherit; font: inherit; pointer-events: auto; }
:focus-visible { outline: 2px solid #ffd08b; outline-offset: -3px; }
#completion { position: absolute; z-index: 2; top: 22%; width: 100%; text-align: center; pointer-events: none; }
#completion strong { font-size: 23px; }
#completion p { font-size: 12px; }
#error { position: absolute; z-index: 3; top: 40%; padding: 24px; background: #30263e; }
[hidden] { display: none !important; }
@media(max-height:500px) {
 header { width: 27%; top: 6px; } h1 { font-size: 20px; } small { letter-spacing: 0; }
 #clock { top: 80px; left: 0; } #message { left: 69%; width: 29%; top: 10px; }
 footer { width: 32%; right: 0; bottom: 8px; } #help { font-size: 10px; }
 #completion { width: 27%; top: 45%; } #completion strong { font-size: 18px; }
}
body[data-production] nav { flex-wrap: wrap; gap: 6px; padding: 0 8px; }
body[data-production] button { min-width: 44px; padding: 8px 12px; }
#storage, #reward-status { margin: 4px 8px 0; font-size: 10px; color: #d2c4cd; }
#reward-status:empty { display: none; }
dialog { max-width: min(90vw,360px); border: 1px solid #ffb64e; border-radius: 20px; background: #30263e; color: #ffebcb; padding: 20px; }
dialog::backdrop { background: #100d20bb; }
dialog button { margin: 4px; }
#loading { position: absolute; z-index: 4; top: 40%; width: 100%; text-align: center; }
@media(max-height:500px) { body[data-production] #help { font-size: 9px; } body[data-production] button { font-size: 11px; } }
