*{box-sizing:border-box}html,body{margin:0;min-height:100%;background:#142015;color:#f4f0de;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif}body{padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)}main{max-width:1420px;margin:auto;padding:12px}.topbar{display:flex;justify-content:space-between;gap:12px;align-items:center;background:#22351f;border:1px solid #536948;border-radius:12px;padding:10px 14px;margin-bottom:10px}.topbar strong{font-size:18px}.topbar span{font-size:12px;color:#d5e4b7}.layout{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:12px}.gamecol{min-width:0}canvas{display:block;width:100%;height:auto;max-height:72vh;background:#789e58;border:2px solid #536948;border-radius:12px;image-rendering:pixelated;touch-action:none}.panel{background:#1d2d1b;border:1px solid #536948;border-radius:12px;padding:14px;min-height:540px}.panel h2{margin:0 0 6px;font-size:18px}.panel h3{font-size:14px;margin:16px 0 7px;color:#dbe9c1}.muted,.help,.buildcheck{font-size:12px;line-height:1.45;color:#cbd7bc}.stat{display:flex;justify-content:space-between;padding:7px 0;border-bottom:1px solid #3b5035}.seed-list{display:grid;gap:6px}.seed{display:grid;grid-template-columns:20px 1fr auto;gap:8px;align-items:center;background:#263923;border:1px solid #40583b;border-radius:8px;padding:7px;cursor:pointer}.seed.selected{outline:2px solid #e7d56b}.seed small{color:#b8c8aa}.buttons{display:grid;gap:7px;margin-top:10px}button{font:inherit;border:1px solid #6f805e;background:#33472d;color:#fff;border-radius:9px;padding:9px;cursor:pointer}button:active{transform:translateY(1px)}.produce{display:grid;gap:4px;font-size:13px}.produce div{display:flex;justify-content:space-between}.toast{min-height:42px;padding:8px;border-radius:8px;background:#122011;color:#f6e997;font-size:13px}.buildcheck{background:#1d2d1b;border:1px solid #40583b;border-radius:10px;padding:9px 12px}.mobile-controls{display:none;justify-content:space-between;align-items:end;margin-top:8px}.dpad{display:grid;grid-template-columns:54px 54px 54px;grid-template-rows:48px 48px;gap:4px}.dpad button{padding:0;font-size:20px;touch-action:none}.action{height:70px;min-width:110px;touch-action:none}@media(max-width:980px){.layout{grid-template-columns:1fr}.panel{min-height:0}.mobile-controls{display:flex}.topbar{align-items:flex-start;flex-direction:column}.topbar span{font-size:11px}}@media(pointer:coarse){.mobile-controls{display:flex}}
.source-note{font-size:11px;line-height:1.45;padding:8px 9px;margin:10px 0 0;border:1px solid #40583b;border-radius:8px;background:#162416;color:#cbd7bc}.source-note code{color:#f4e37b}.source-note a{color:#e7d56b}
.scene-buttons{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin:10px 0}.scene-buttons button:last-child{grid-column:1/-1}[hidden]{display:none!important}
.canvas-wrap{position:relative}.dialog{position:absolute;left:50%;bottom:18px;transform:translateX(-50%);width:min(92%,620px);background:#102318f2;border:2px solid #e3d472;border-radius:12px;padding:10px 12px;box-shadow:0 8px 28px #0008;z-index:4}.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.dialog-head strong{font-size:16px}.dialog-head button{width:34px;height:30px;padding:0;font-size:22px;line-height:1}.dialog-text{margin-top:6px;font-size:14px;line-height:1.45;color:#fff8cf}.dialog-meta{margin-top:6px;font-size:11px;color:#bdd0ac}.npc-chip{display:inline-flex;align-items:center;gap:6px}
.dialog-actions{display:flex;flex-wrap:wrap;gap:7px;margin-top:9px}.dialog-actions button{padding:7px 10px;font-size:12px}.shop-modal{position:absolute;inset:14px;background:#102318f7;border:2px solid #e3d472;border-radius:12px;box-shadow:0 8px 32px #000a;z-index:5;padding:12px;overflow:auto}.shop-head{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;position:sticky;top:-12px;background:#102318;padding:8px 0 10px;z-index:2}.shop-head>div{display:grid;gap:2px}.shop-head strong{font-size:18px}.shop-head small{font-size:11px;color:#bdd0ac}.shop-head button{width:38px;height:34px;padding:0;font-size:22px}.shop-wallet{background:#1d3521;border:1px solid #536948;border-radius:8px;padding:8px 10px;margin-bottom:10px;color:#ffe878;font-weight:700}.shop-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.shop-card{display:grid;grid-template-columns:62px 1fr auto;grid-template-rows:auto auto;gap:6px 9px;align-items:center;border:1px solid #40583b;background:#1b2d1a;border-radius:10px;padding:8px}.shop-thumb{grid-row:1/3;width:62px;height:62px;border:1px solid #536948;border-radius:8px;background:#263923;display:grid;place-items:center;overflow:hidden;position:relative}.shop-thumb img{max-width:100%;max-height:100%;image-rendering:pixelated;position:relative;z-index:1}.shop-thumb span{position:absolute;font-size:9px;color:#96a98a}.shop-thumb.missing span{color:#e8d58a}.shop-card>div:nth-child(2){display:grid;gap:2px}.shop-card strong{font-size:13px}.shop-card small{font-size:10px;color:#aebfa2}.shop-card b{font-size:12px;color:#ffe878}.shop-card button{padding:6px 8px;font-size:10px;min-width:78px}.shop-card button[disabled]{opacity:.45;cursor:default}.shop-note{font-size:10px;line-height:1.45;color:#b9caad;border-top:1px solid #40583b;margin:12px 0 0;padding-top:9px}.shop-note code{color:#ffe878}@media(max-width:720px){.shop-modal{inset:6px}.shop-grid{grid-template-columns:1fr}.shop-card{grid-template-columns:54px 1fr auto}.shop-thumb{width:54px;height:54px}}
.shop-filters{display:flex;flex-wrap:wrap;gap:6px;margin:-2px 0 10px}.shop-filters button{padding:6px 9px;font-size:10px;border-radius:999px;background:#263923}.shop-filters button.active{background:#6b6230;border-color:#e3d472;color:#fff8cf;box-shadow:inset 0 0 0 1px #e3d47255}
.item-loc{display:inline-flex;width:max-content;max-width:100%;padding:2px 6px;border-radius:999px;font-size:9px;font-style:normal;font-weight:800;letter-spacing:.04em;border:1px solid #536948;color:#cbd9c1;background:#263923}.item-loc.is-equipped{color:#fff8cf;border-color:#e3d472;background:#6b6230}.item-loc.is-chest{color:#dffbff;border-color:#4f7b75;background:#1f4440}.item-loc.is-locked{opacity:.65}

.shop-wallet-row{display:flex;gap:8px;align-items:stretch;margin-bottom:10px}.shop-wallet-row .shop-wallet{flex:1;margin-bottom:0}.test-wallet{white-space:nowrap;padding:8px 10px;font-size:10px;background:#6b6230;border-color:#e3d472;color:#fff8cf}.test-wallet:disabled{opacity:.45}@media(max-width:720px){.shop-wallet-row{align-items:stretch}.test-wallet{font-size:9px;padding:6px 8px}}

/* Combat item detail in Rương/Tủ đồ: values from server-owned effect table. */
.tcq-item-combat-stats{margin:8px 0;padding:8px;border:1px solid #dbc49c;background:#fdf4dc;color:#523827;border-radius:8px;font-size:12px}
.tcq-item-combat-stats>b{display:block;margin-bottom:6px}
.tcq-item-stat-tags{display:flex;gap:5px;flex-wrap:wrap}
.tcq-item-stat-tags span{display:inline-flex;gap:5px;align-items:center;border:1px solid #98ad86;background:#e5f1d6;color:#31582f;padding:4px 6px;border-radius:6px;font-size:11px}
.tcq-item-stat-none{display:block;color:#806b59;font-size:11px}
.tcq-item-card-stat{color:#438356!important;font-weight:700;white-space:normal!important}
