:root{--wood:#a8743f;--wood-dark:#8a5a33;--grass:#8fb865;--bg:#faf5ea;--ink:#3b2a1a}*{box-sizing:border-box}html,body{margin:0;overflow-x:hidden}body{background:var(--bg);color:var(--ink);padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);font:16px/1.4 system-ui,-apple-system,Segoe UI,sans-serif}.page{max-width:420px;margin:0 auto;padding:24px 16px}h1{color:var(--wood-dark);overflow-wrap:anywhere;margin:0 0 16px;font-size:1.5rem}form{flex-direction:column;gap:16px;display:flex}label{flex-direction:column;gap:6px;font-weight:600;display:flex}input{border:2px solid var(--wood);width:100%;min-height:44px;color:var(--ink);background:#fff;border-radius:8px;padding:8px 12px;font-size:16px}input:focus-visible,.btn:focus-visible{outline:3px solid var(--grass);outline-offset:2px}.btn{background:var(--wood);color:#fff;cursor:pointer;border:0;border-radius:8px;min-width:44px;min-height:44px;padding:8px 16px;font-size:16px;font-weight:600}.btn:hover{background:var(--wood-dark)}.btn:disabled{opacity:.6;cursor:default}.btn.secondary{color:var(--wood-dark);border:2px solid var(--wood);background:0 0}.error{color:#a12b1b;margin:0;font-weight:600}.bar{justify-content:space-between;align-items:center;gap:12px;display:flex}.bar h1{margin:0}.page.fill{flex-direction:column;max-width:none;height:100dvh;padding:12px 16px;display:flex}.scene{background:var(--grass);touch-action:none;border-radius:12px;flex:1;min-height:240px;margin-top:12px;position:relative;overflow:hidden}.inline{flex-direction:row;align-items:center;gap:8px;font-size:14px}select{border:2px solid var(--wood);min-height:44px;color:var(--ink);background:#fff;border-radius:8px;padding:8px 12px;font-size:16px}.page.fill h1{font-size:1.15rem}.scene-overlay{z-index:1;text-align:center;color:var(--wood-dark);background:var(--bg);pointer-events:none;justify-content:center;align-items:center;padding:16px;font-weight:600;display:flex;position:absolute;inset:0}.hud{z-index:2;pointer-events:none;flex-direction:column;gap:6px;display:flex;position:absolute;top:8px;left:8px;right:8px}.hud-row{-webkit-backdrop-filter:blur(8px);background:#302012b8;border-radius:12px;flex-wrap:wrap;gap:6px;padding:6px;display:flex;box-shadow:0 2px 10px #00000040}.hud-chip{color:#fdf3e0;background:#fff5e11a;border-radius:8px;flex:calc(50% - 6px);align-items:center;gap:8px;min-width:0;padding:6px 8px;display:flex;overflow:hidden}.hud-chip svg{flex:none}.hud-body{flex-direction:column;flex:1;min-width:0;display:flex}.hud-label{color:#e8d5b5;font-size:14px;line-height:1.2}.hud-value{font-variant-numeric:tabular-nums;white-space:nowrap;text-overflow:ellipsis;font-size:16px;font-weight:700;overflow:hidden}.hud-cap{letter-spacing:-.01em;color:#e8d5b5;font-size:14px;font-weight:400}.hud-rate{font-variant-numeric:tabular-nums;white-space:nowrap;font-size:14px;font-weight:600}.hud-rate.up{color:#8fe08a}.hud-rate.down{color:#ff8a78}.hud-rate.flat{color:#cdbb9c}.hud-gauge{background:#ffffff2e;border-radius:2px;height:4px;margin-top:4px;display:block;overflow:hidden}.hud-gauge>span{background:var(--grass);border-radius:2px;height:100%;transition:width .6s linear;display:block}.hud-wood .hud-gauge>span{background:#d9a766}.hud-stone .hud-gauge>span{background:#b8bec4}.hud-chip.full .hud-gauge>span{background:#f0c24b}.hud-alert,.hud-warn{border-radius:10px;margin:0;padding:8px 12px;font-size:14px;font-weight:700;box-shadow:0 2px 8px #00000040}.hud-alert{color:#fff;background:#c0392b}.hud-warn{color:#3b2a1a;background:#f0a23b}.hud-builds{flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none;display:flex}.hud-pill{white-space:nowrap;-webkit-backdrop-filter:blur(8px);color:#fdf3e0;background:#302012b8;border-radius:999px;padding:4px 10px;font-size:14px;font-weight:600}.hud-pill.more{background:var(--wood)}@media (width>=720px){.hud{max-width:640px;right:auto}.hud-chip{flex:1 1 0}}@media (width<=719px){.hud-chip{flex:1 1 0;gap:4px;padding:5px 6px;position:relative}.hud-chip svg{width:18px;height:18px}.hud-label,.hud-cap{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.hud-value{font-size:15px}.hud-rate{font-size:12px}}@media (prefers-reduced-motion:reduce){.hud-gauge>span{transition:none}}.sr{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.sheet{z-index:3;max-height:62%;padding:12px 16px calc(12px + env(safe-area-inset-bottom));background:var(--bg);color:var(--ink);border-radius:16px 16px 0 0;flex-direction:column;gap:8px;font-size:14px;display:flex;position:absolute;bottom:0;left:0;right:0;overflow-y:auto;box-shadow:0 -4px 18px #0000004d}.sheet h2{color:var(--wood-dark);margin:0;font-size:1.15rem}.sheet h3{margin:0;font-size:1rem}.sheet p{margin:0}.sheet-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.sheet-actions{gap:8px;display:flex}.sheet-actions .btn{flex:1}.level{color:var(--ink);font-size:14px;font-weight:400}.build-list{flex-direction:column;gap:8px;margin:0;padding:0;list-style:none;display:flex}.build-item{background:#fff;border:1px solid #e3d5ba;border-radius:10px;align-items:center;gap:12px;padding:10px;display:flex}.build-item.locked strong,.build-item.locked .build-effect{opacity:.6}.build-main{flex-direction:column;flex:1;gap:2px;min-width:0;display:flex}.build-effect{color:#5a4630}.build-meta,.panel-cost{flex-wrap:wrap;align-items:center;gap:4px 12px;display:flex}.build-time{font-variant-numeric:tabular-nums;font-weight:600}.build-reason{color:#a12b1b;font-weight:600}.cost{flex-wrap:wrap;gap:4px 10px;display:inline-flex}.cost-item{font-variant-numeric:tabular-nums;align-items:center;gap:3px;font-weight:700;display:inline-flex}.cost-item svg{width:18px;height:18px}.cost-item.short{color:#a12b1b}.placement-hint{font-size:14px}.cards{flex-direction:column;gap:8px;display:flex}.card{border:2px solid var(--wood);background:#fff;border-radius:10px;flex-direction:column;gap:6px;padding:12px;display:flex}.banner{z-index:4;color:#fff;background:#a12b1b;border-radius:10px;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;font-size:14px;font-weight:600;display:flex;position:absolute;bottom:8px;left:8px;right:8px;box-shadow:0 2px 10px #00000059}.banner-x{color:#fff;cursor:pointer;background:0 0;border:0;min-width:44px;min-height:44px;font-size:24px}@media (width>=720px){.sheet{border-radius:14px;width:340px;max-height:none;inset:8px 8px 8px auto;box-shadow:0 2px 18px #0000004d}.cards{flex-direction:row}.card{flex:1}.banner{width:340px;bottom:8px;left:auto;right:8px}}.quest-card{border:2px solid var(--wood);color:var(--ink);background:#fff;border-radius:10px;flex-direction:column;gap:6px;padding:12px;font-size:14px;display:flex}.quest-card h3{margin:0;font-size:1rem}.quest-card p{margin:0}.quest-count{color:var(--wood-dark);font-weight:600}.quest-reward{flex-wrap:wrap;gap:12px;margin:0;padding:0;list-style:none;display:flex}.quest-reward li{align-items:center;gap:4px;display:flex}.quest-card .btn{min-height:44px}.game{height:100dvh;position:relative;overflow:hidden}.game .scene{border-radius:0;min-height:0;margin:0;position:absolute;inset:0}.top-stack{z-index:5;pointer-events:none;flex-direction:column;gap:6px;display:flex;position:absolute;top:8px;left:8px;right:8px}.top-stack>*{pointer-events:auto}.top-stack .hud{pointer-events:none;position:static}.top-stack .banner{width:auto;position:static}.quest-slot{flex-direction:column;gap:6px;display:flex}.top-stack .quest-slot{max-width:320px}.bottom-stack{left:8px;right:8px;bottom:calc(8px + env(safe-area-inset-bottom));z-index:2;pointer-events:none;flex-direction:column;align-items:stretch;gap:6px;display:flex;position:absolute}.bottom-stack>*{pointer-events:auto}.bottom-bar{gap:8px;display:flex}.btn.big{flex:1;min-height:56px;font-size:1.15rem;box-shadow:0 2px 10px #00000059}.btn.menu-btn{background:var(--bg);min-width:56px;min-height:56px;font-size:1.4rem;box-shadow:0 2px 10px #00000059}.chip{border:2px solid var(--wood);min-height:44px;color:var(--ink);cursor:pointer;text-align:left;background:#fff;border-radius:999px;align-self:flex-start;padding:8px 14px;font-size:14px;font-weight:600}.menu{background:var(--bg);border-radius:10px;flex-direction:column;align-self:flex-start;gap:8px;padding:12px;display:flex;box-shadow:0 2px 10px #0000004d}.menu-name{color:var(--wood-dark);overflow-wrap:anywhere;margin:0;font-weight:700}@media (width>=720px){.top-stack{max-width:640px;right:364px}.sheet.placement{bottom:auto}.bottom-stack{width:360px;left:50%;right:auto;transform:translate(-50%)}}
