* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #101a2a; color: #e9f5ed; font: 14px system-ui; overscroll-behavior: none; }
main { height: 100dvh; max-width: 760px; margin: auto; padding: 12px; display: grid; grid-template-rows: auto minmax(0,1fr) auto; gap: 10px; }
header { position: relative; padding-right: 48px; }
small { color: #91cbbf; font-size: 10px; letter-spacing: 2px; }
h1 { font-size: clamp(20px,5vw,28px); margin: 5px 0; }
p { margin: 7px 0; }
#message { font-size: 12px; min-height: 30px; }
#clock { position: absolute; right: 0; top: 23px; font-size: 24px; color: #f3c68e; }
#stage { position: relative; min-height: 0; border: 1px solid #456d70; border-radius: 28px; overflow: hidden; background: radial-gradient(ellipse at 50% 30%,#254051,#111c31); }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#weather { position: absolute; top: 12px; left: 12px; right: 12px; text-align: center; color: #b4dbd4; font-size: 11px; pointer-events: none; }
.controls { display: flex; gap: 8px; }
button { min-width: 44px; min-height: 44px; flex: 1; border: 0; border-radius: 14px; color: #172b34; background: #a6e2d6; font: 700 13px system-ui; touch-action: manipulation; }
button:focus-visible, canvas:focus-visible { outline: 3px solid #ffe1ac; outline-offset: -3px; }
button:disabled { opacity: .5; }
#help { font-size: 11px; line-height: 1.5; color: #a9bfc9; }
#count, #payoff { font-size: 12px; color: #edcda6; }
#payoff:empty { display: none; }
@media (orientation: landscape) {
  main { max-width: none; grid-template-columns: 165px minmax(0,1fr) 165px; grid-template-rows: minmax(0,1fr); }
  header, footer { align-self: center; }
  header { padding: 0; } #clock { position: static; } h1 { font-size: 23px; }
  .controls { flex-direction: column; }
}
@media (max-width: 350px) { main { padding: 8px; gap: 6px; } small { font-size: 9px; } #help { font-size: 10px; } }

body[data-production] { background: radial-gradient(ellipse at top,#213849,#080f20); }
body[data-production] #stage { box-shadow: inset 0 0 45px #071225,0 0 20px #23484e55; border-color:#75918a; }
.catalog { display:inline-flex; align-items:center; justify-content:center; min-width:44px; min-height:44px; color:#d5eee5; font-size:12px; }
body[data-production] header .catalog { display:flex; width:74px; }
body[data-production] .controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:6px; }
body[data-production] .controls button { font-size:11px; }
body[data-production] #help { margin:4px 0; }
#storage { font-size:10px; margin:0; }
dialog { color:#e9f5ed; background:#172b3b; border:1px solid #a6e2d6; border-radius:22px; padding:18px; width:min(340px,calc(100% - 24px)); max-height:calc(100dvh - 24px); }
dialog::backdrop { background:#06101c99; }
dialog h2 { font-size:22px; margin:0 0 12px; }
dialog button, dialog a { display:flex; width:100%; margin-top:8px; align-items:center; justify-content:center; }
#fallback:not([hidden]) { position:fixed; inset:12px; z-index:20; background:#172b3b; padding:24px; border-radius:24px; display:flex; flex-direction:column; align-items:center; justify-content:center; }
#fallback button { flex:0; padding:12px; }
@media (orientation:landscape) { body[data-production] .controls { grid-template-columns:1fr; } body[data-production] main { gap:8px; } }
@media (max-width:350px) and (orientation:portrait) { body[data-production] main { gap:4px; } body[data-production] h1 { margin:0; } body[data-production] #message { margin:3px 0; min-height:28px; } body[data-production] #count { margin:3px 0; } }
