*{box-sizing:border-box}body{margin:0;background:#fff;color:#2a2328;font:14px -apple-system,BlinkMacSystemFont,"Noto Sans JP",sans-serif}main{max-width:480px;margin:auto;padding:6px 12px calc(8px + env(safe-area-inset-bottom))}button{font:inherit;font-weight:700;touch-action:manipulation;border:0;border-radius:8px;min-height:44px;background:#f3f4f6;color:#2a2328}button:disabled{opacity:.45}button:focus-visible{outline:3px solid #e6b85c;outline-offset:2px}.nest{position:relative;background:#31271e;border:2px solid #8d7248;border-radius:12px;overflow:hidden;color:#fff1d3;padding:8px}.stats,.resources{display:flex;justify-content:space-between;gap:4px;font-weight:700}.resources{font-size:12px;margin:7px 0}.grid{display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.cell{height:clamp(44px,7.7vh,65px);border:1px solid #67503a;background:#48372b;color:#bda78a;position:relative;font-size:12px}.cell.diggable{background:#6c4c2c;border:2px dashed #e7bf74;color:#fff1cc}.cell.open{background:#a17644;color:#fff8d6;border-color:#d4ae6b}.cell.queen{background:#3f3029;border:2px solid #f4cd6e;box-shadow:inset 0 0 12px #bd8a38}.queen img{height:85%;max-width:100%;object-fit:contain}.cell .ant{font-size:23px;display:block}#forecast{margin:8px 0 0;font-size:12px;min-height:18px}.companion{display:flex;gap:8px;align-items:center;margin:7px 0;min-height:62px}.companion img{width:60px;height:60px;object-fit:cover;border-radius:10px;background:#f3f4f6}.companion b{font-size:12px}.companion p{margin:3px 0;font-size:13px;line-height:1.45}.roles{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.role{background:#f3f4f6;border-radius:8px;text-align:center;padding:6px 3px}.role b{font-size:13px}.adjust{display:flex;align-items:center;justify-content:space-between;margin-top:3px}.adjust button{width:44px;min-height:44px;background:#fff;font-size:20px}.adjust output{font-weight:800;font-size:18px}.actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:8px}#expand{background:#ead19a}#goal,#hint,#warning{margin:6px 0 0;font-size:12px;line-height:1.5}#warning{color:#9c3426}.overlay{position:absolute;inset:0;background:#241b14df;display:grid;place-items:center;padding:16px;z-index:2}.overlay[hidden]{display:none}.panel{background:white;border-radius:12px;padding:18px;color:#2a2328;text-align:center;width:100%;max-width:300px}.panel img{width:96px;height:96px;object-fit:contain}.panel h1{font-size:20px;margin:8px 0}.panel p{font-size:14px;line-height:1.6}.panel button{width:100%;background:#ead19a}.pulse{animation:shine .35s ease-out}@keyframes shine{50%{filter:brightness(1.5)}}@media(prefers-reduced-motion:reduce){.pulse{animation:none}}@media(max-height:740px){.cell{height:44px}.companion{min-height:48px}.companion img{height:48px;width:48px}.nest{padding:6px}}

@media(max-width:359px){.adjust{flex-wrap:wrap}.adjust output{order:-1;width:100%;line-height:22px}.role{padding:4px 1px}}

.rate{display:block;font-size:11px;color:#6e626a;margin-top:4px;white-space:nowrap}
@media(max-width:359px){.rate{font-size:10px}}
/* A living cross-section. Controls remain DOM buttons over the connected tunnels. */
.nest{padding:8px;background:#30251c;border-color:#b99056}.stats{align-items:center;font-size:12px}.stats #pause{min-height:32px;min-width:36px;background:#594433;color:#fff2d7}.resources{margin:5px 0 7px;color:#f0d69e}.underground{position:relative;aspect-ratio:360/304;overflow:hidden;border-radius:6px;box-shadow:inset 0 0 20px #20140d}.underground canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.grid{position:absolute;inset:0;gap:0;grid-template-rows:repeat(4,1fr);touch-action:none}.cell,.cell.open,.cell.queen{height:auto;min-height:0;background:transparent;border:0;box-shadow:none;border-radius:35%;color:#ffe4a4;opacity:1}.cell:disabled{opacity:1}.cell.diggable{background:radial-gradient(ellipse,#d3a35b33,transparent 65%);border:0}.cell.diggable:after{content:'';position:absolute;inset:16% 23%;border:2px dashed #d9ae61;border-radius:40% 55% 45% 50%;opacity:.7}.cell.diggable span{font-size:22px;filter:drop-shadow(0 2px 2px #21150c)}.queen img{width:42px;height:42px;object-fit:cover;border-radius:50%;border:2px solid #edcf86;position:relative;top:-7px}.day-report{min-height:32px;display:flex;align-items:center;font-size:12px;color:#ffe6b3;border-bottom:1px solid #d5ac5b33;padding:4px 0}#sceneLabel{position:absolute;bottom:2%;left:29%;font-size:10px;color:#ead19a;pointer-events:none}#forecast{font-size:12px;margin:5px 0 0}.companion{margin:6px 0;min-height:48px}.companion img{height:48px;width:48px}.allocation-help{font-size:11px;color:#6e626a;margin:5px 0}.role{padding:5px 2px;border:1px solid transparent}.role.selected{border-color:#b18b44;background:#f7eedc}.role b{font-size:12px}.workers{width:100%;display:flex;justify-content:center;align-items:center;gap:3px;flex-wrap:wrap;min-height:44px;background:transparent;touch-action:none;padding:4px}.workers i{position:relative;width:13px;height:6px;border-radius:50%;background:#372418;box-shadow:0 -3px 0 -1px #9ba660,0 3px 0 -1px #9ba660}.role:nth-child(2) i{box-shadow:0 -3px 0 -1px #bd9c71,0 3px 0 -1px #bd9c71}.role:nth-child(3) i{box-shadow:0 -3px 0 -1px #b86542,0 3px 0 -1px #b86542}.workers i:after{content:'';position:absolute;width:4px;height:5px;background:#372418;border-radius:50%;right:-3px;top:0}.adjust{margin:0}.adjust button{min-width:44px}.adjust output{font-size:16px}.rate{margin-top:3px}.actions{margin-top:6px}#goal,#hint{font-size:11px;margin-top:4px}#expand:enabled{background:linear-gradient(#ffe3a0,#d6ae60);box-shadow:inset 0 0 0 1px #b58a3a}#advance:enabled{background:#3d3022;color:#fff0cf}.panel{padding:14px}.panel p{font-size:13px}.panel img{height:74px;width:74px}.overlay{z-index:3}@media(max-height:740px){.underground{aspect-ratio:360/256}.cell{height:auto}.companion p{font-size:12px}.resources{margin:3px 0}.workers{min-height:36px}.rate{font-size:10px}}@media(max-width:359px){.adjust{flex-wrap:nowrap}.adjust output{order:0;width:auto}.adjust button{width:44px;min-width:44px}.role b{font-size:11px}}
