* { box-sizing: border-box; }
:root { font-family: system-ui, sans-serif; color: #233e42; background: #e5eee6; }
body { margin: 0; height: 100dvh; overflow: hidden; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
header { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px; }
h1 { font-size: clamp(16px, 4.5vw, 23px); margin: 0; }
#clock { font-variant-numeric: tabular-nums; min-width: 38px; }
#stage { position: relative; min-height: 0; overflow: hidden; touch-action: none; }
canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#chapter { position: absolute; top: 10px; width: 100%; text-align: center; font-size: 12px; pointer-events: none; }
#veil { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; background: #e5eee6e8; }
#veil[hidden] { display: none; }
footer { padding: 10px 12px max(12px, env(safe-area-inset-bottom)); background: #f5f3df; }
p { margin: 0 0 8px; font-size: 13px; }
#message { min-height: 34px; }
.controls { display: flex; align-items: center; gap: 8px; }
.controls span { flex: 1; font-size: 12px; }
button { min-width: 48px; min-height: 44px; padding: 8px; border: 1px solid #72948a; border-radius: 10px; background: #fffdf1; color: inherit; font: inherit; cursor: pointer; }
.hint, small { font-size: 10px; margin-top: 8px; }
:focus-visible { outline: 3px solid #3156ac; outline-offset: -3px; }
@media (max-height: 450px) { body { grid-template-columns: 200px 1fr; grid-template-rows: auto 1fr; } #stage { grid-column: 2; grid-row: 1 / 3; } footer { padding: 8px; } h1 { font-size: 17px; } }

body[data-production] { background: #deebe3; color: #214c49; }
[data-production] header { padding: 16px 18px 10px; background: #fff9e9; border-bottom: 1px solid #bbcfbe; }
[data-production] .back { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%; background: #f1f4df; color: #214c49; text-decoration: none; font-size: 24px; }
[data-production] header small { letter-spacing: .18em; font-size: 9px; }
[data-production] h1 { font-family: Georgia, serif; font-size: clamp(17px, 4.8vw, 27px); }
[data-production] #clock { border-radius: 50%; padding: 12px 7px; background: #285c56; color: #fff3ca; font-weight: 700; }
[data-production] #chapter { width: auto; left: 50%; transform: translateX(-50%); white-space: nowrap; border-radius: 24px; padding: 8px 12px; background: #fffae7e8; box-shadow: 0 2px 10px #35584918; }
[data-production] footer { background: #fff9e9; padding: 10px 14px max(10px, env(safe-area-inset-bottom)); border-top: 1px solid #bbcfbe; }
[data-production] .objective { font-size: 9px; letter-spacing: .09em; font-weight: 800; }
[data-production] #message { min-height: 48px; line-height: 1.35; margin-bottom: 4px; }
[data-production] #counts { font-size: 11px; display: block; margin-bottom: 6px; }
[data-production] .controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
[data-production] button { font-size: 12px; font-weight: 650; background: #f1f4df; border-color: #9fb7a0; touch-action: manipulation; }
[data-production] #motion { grid-column: span 2; }
[data-production] #storage { display: block; min-height: 14px; }
#reward-status:empty { display: none; }
#reward-status { color: #735116; margin: 4px 0 0; font-size: 12px; }
#flick-target { position: absolute; width: 52px; height: 52px; border: 2px solid #f4b84dbb; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; box-shadow: 0 0 0 5px #fff5ce44; }
#veil { z-index: 3; gap: 10px; }
[hidden] { display: none !important; }
dialog { max-width: min(340px, calc(100vw - 24px)); border: 1px solid #93b3a0; border-radius: 22px; background: #fff9e9; color: #214c49; padding: 22px; }
dialog::backdrop { background: #163f48aa; }
dialog h2 { font-family: Georgia, serif; }
@media (max-height: 450px) { [data-production] { grid-template-columns: 250px 1fr; } [data-production] header { padding: 8px; } [data-production] footer { padding: 8px; } [data-production] #message { min-height: 48px; font-size: 12px; } [data-production] .objective { font-size: 8px; } [data-production] #chapter { font-size: 10px; } }
