* { box-sizing: border-box; }
html,body { margin:0; height:100%; overflow:hidden; background:#3a2a24; color:#f4efe0; 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:60px; } small { font-size:9px; letter-spacing:1px; color:#ffc46b; }
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:#ffc46b; }
#stage { position:relative; min-height:0; overflow:hidden; border:1px solid #e0b070; border-radius:24px; background:#f2c89a; touch-action:none; }
canvas { display:block; width:100%; height:100%; touch-action:none; }
#weather { position:absolute; top:9px; left:0; right:0; text-align:center; font-size:11px; color:#2a1c14;text-shadow:0 1px 0 #ffffffaa; pointer-events:none; }
.controls { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; }
button { min-width:44px; min-height:44px; flex:1; border:0; border-radius:12px; background:#f3e9c6; color:#3a2a10; font:700 13px system-ui; touch-action:manipulation; }
:focus-visible { outline:3px solid #ffc46b; outline-offset:-3px; } #help { font-size:11px; line-height:1.4; color:#d8ecef; } #count { font-size:12px; color:#ffc46b; }
.catalog { display:inline-flex; align-items:center; justify-content:center; min-height:44px; min-width:44px; color:#ffe08a; font-weight:700; }
header .catalog { margin-right:10px; }
#storage { font-size:11px; margin:3px 0; } #storage:empty { display:none; }
dialog { max-width:calc(100vw - 24px); max-height:calc(100dvh - 24px); width:350px; border:1px solid #e0b070; border-radius:20px; padding:18px; background:#4a3228; color:#f4efe0; }
dialog::backdrop { background:#1a0e0acc; } 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:#4a3228; border:2px solid #f3e9c6; 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; }
#acts { position:absolute; left:10px; right:74px; bottom:10px; display:flex; gap:8px; z-index:2; }
#acts button { height:56px; flex:1; font-size:15px; user-select:none; -webkit-user-select:none; }
#acts #retry { background:#fff6dc; flex:0 1 150px; }
#acts button:disabled { opacity:.5; }

@media (orientation:landscape) { main { max-width:none; grid-template-columns:165px minmax(0,1fr) 190px; grid-template-rows:minmax(0,1fr); } header,footer { align-self:center; } header { padding:0; } #clock { position:static; } .controls { grid-template-columns:1fr 1fr; } #help { font-size:10px; } }
@media (max-width:350px) { main { padding:6px; gap:4px; } small { display:none; } #help { display:none; } header .catalog { font-size:12px; } #message { margin:3px 0; } h1 { margin:0; } }
@media (max-width:350px) and (orientation:portrait) {
  header { display:flex; flex-wrap:wrap; align-items:center; padding-right:56px; } header h1 { font-size:18px; margin:0; }
  #message { flex-basis:100%; font-size:11px; min-height:0; margin:2px 0; line-height:1.2; } #clock { top:6px; font-size:20px; }
  .controls { display:flex; gap:3px; } .controls button { min-width:44px; padding:0 1px; font-size:10px; line-height:1.05; } #count { margin:2px 0; font-size:11px; }
  #acts button { height:48px; font-size:13px; }
}



#acts button { height:64px; }

#acts button { height:56px; }
#acts #lens { flex:0 1 130px; background:#fff0d2; } #acts #shutter { flex:1; height:64px; font-size:17px; background:#ffd36b; box-shadow:0 3px 0 #a8742a; }
#acts button:disabled { opacity:.5; }
#frame { position:absolute; left:50%; top:50%; width:200px; height:200px; transform:translate(-50%,-50%); border:2px solid #fff8e6cc; border-radius:6px; pointer-events:none; z-index:1; background:linear-gradient(#fff8e644,#fff8e644) 33.3% 0/1px 100% no-repeat,linear-gradient(#fff8e644,#fff8e644) 66.6% 0/1px 100% no-repeat,linear-gradient(#fff8e644,#fff8e644) 0 33.3%/100% 1px no-repeat,linear-gradient(#fff8e644,#fff8e644) 0 66.6%/100% 1px no-repeat; box-shadow:0 0 0 2000px #00000022; }
#frame i { position:absolute; left:50%; top:50%; width:10px; height:10px; margin:-5px 0 0 -5px; border:1px solid #fff8e6; border-radius:50%; }
#frame.cool { border-color:#ffc46b; }
#briefs { position:absolute; left:8px; top:30px; z-index:2; margin:0; padding:0; list-style:none; display:grid; gap:4px; width:min(210px,64%); pointer-events:none; }
#briefs li { display:flex; gap:6px; align-items:center; padding:4px 6px; border-radius:10px; background:#2a1c14cc; color:#fff3dc; font-size:11px; line-height:1.2; }
#briefs li.done { background:#2f5a34cc; } #briefs li b { flex:0 0 auto; color:#ffc46b; font-size:11px; } #briefs li img,#briefs li em { flex:0 0 28px; width:28px; height:34px; border-radius:4px; object-fit:cover; background:#ffffff33; font-style:normal; text-align:center; line-height:34px; }
#gauge { position:absolute; right:10px; top:30px; width:14px; height:110px; border-radius:7px; background:#ffffff66; border:2px solid #2a1c14aa; overflow:hidden; pointer-events:none; z-index:1; }
#gauge i { position:absolute; left:0; right:0; bottom:0; height:100%; background:#5fbf6a; transition:background .1s; } #gauge.shaky i { background:#d9544d; }
#flash { position:absolute; inset:0; background:#fff; opacity:0; pointer-events:none; z-index:3; } #flash.on { animation:fl .18s ease-out; } @keyframes fl { from { opacity:.85; } to { opacity:0; } }
@media (max-width:350px) and (orientation:portrait) { #acts button { height:48px; font-size:13px; } #acts #shutter { height:56px; } #briefs li { font-size:10px; padding:2px 4px; } #briefs li img,#briefs li em { height:26px; line-height:26px; flex-basis:22px; width:22px; } #gauge { height:70px; } }
@media (orientation:landscape) { #briefs { width:min(250px,40%); } }
