* { box-sizing: border-box; }
html,body { margin:0; height:100%; overflow:hidden; background:#162e39; color:#f7edd5; font:14px system-ui; overscroll-behavior:none; }
main { height:100dvh; max-width:760px; margin:auto; padding:10px; display:grid; grid-template-rows:auto minmax(0,1fr) auto; gap:8px; }
header { position:relative; padding-right:50px; } small { font-size:9px; letter-spacing:1px; color:#a5d8cc; }
h1 { font-size:clamp(20px,5vw,28px); margin:4px 0; } p { margin:6px 0; }
#message { font-size:12px; min-height:30px; } #clock { position:absolute; top:24px; right:0; font-size:24px; color:#ffb791; }
#stage { position:relative; min-height:0; overflow:hidden; border:1px solid #659b99; border-radius:24px; background:radial-gradient(ellipse at top,#608e9b,#213f50); }
canvas { display:block; width:100%; height:100%; touch-action:none; }
#thermal,#banner { position:absolute; top:9px; left:0; right:0; text-align:center; font-size:11px; pointer-events:none; }
#banner { top:auto; bottom:16px; font-size:18px; color:#ffe3a7; }
.controls { display:flex; gap:8px; } button { min-width:44px; min-height:44px; flex:1; border:0; border-radius:12px; background:#b3dfca; color:#163d3e; font:700 13px system-ui; touch-action:manipulation; }
:focus-visible { outline:3px solid #ffd98c; outline-offset:-3px; } #help { font-size:11px; line-height:1.4; color:#bedad6; } #count { font-size:12px; color:#ffc6a4; }
@media (orientation:landscape) { main { max-width:none; grid-template-columns:165px minmax(0,1fr) 175px; grid-template-rows:minmax(0,1fr); } header,footer { align-self:center; } header { padding:0; } #clock { position:static; } .controls { flex-direction:column; } }
@media (max-width:350px) { main { padding:6px; gap:4px; } small { display:none; } #help { font-size:10px; } }

body[data-production] .controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
.catalog { display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; color:#d5f4db; font-weight:700; }
header .catalog { margin-right:10px; }
#storage { font-size:11px; margin:3px 0; }
dialog { max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); width:350px; border:1px solid #8dcbb8; border-radius:20px; padding:18px; background:#213f50; color:#f7edd5; }
dialog::backdrop { background:#071d2cbb; } dialog button { padding:8px 14px; margin:4px 0; } dialog h2 { margin:0 0 10px; font-size:22px; }
#fallback:not([hidden]) { position:fixed; inset:20px; z-index:5; background:#213f50; border:2px solid #b3dfca; border-radius:20px; padding:24px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:16px; }
#fallback button { flex:0; padding:10px 24px; }
@media (orientation:landscape) { body[data-production] main { grid-template-columns:165px minmax(0,1fr) 190px; } body[data-production] .controls { grid-template-columns:1fr 1fr; } body[data-production] #help { font-size:10px; } }
@media (max-width:350px) { body[data-production] header .catalog { font-size:12px; } body[data-production] #message { margin:3px 0; } body[data-production] h1 { margin:0; } }
