/* v0.3 interaction, terrain and equipment additions */
.tile-swatch{display:block;width:54px;height:46px;border-radius:6px;border:1px solid #829474;box-shadow:inset 0 0 16px #0005}.equipment-slots{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:14px 0}.equipment-slot{background:#111d16;border:1px solid #5b6c44;border-radius:8px;padding:12px;min-height:120px}.equipment-slot small,.equipment-slot strong{display:block}.equipment-slot small{color:var(--gold);margin-bottom:8px}.equipment-slot button{font-size:11px;padding:4px 8px}.inventory-row{display:flex;align-items:center;gap:14px;justify-content:space-between;padding:14px 0;border-top:1px solid var(--line)}.inventory-row small{display:block;color:var(--muted);font-size:11px;margin-top:5px}.inventory-row button{white-space:nowrap;font-size:11px}#inventoryDialog{width:min(700px,94vw)}#inventoryContent label{display:block}#inventoryContent select{margin-top:6px}#battleHud button[aria-pressed=true]{border-color:#9dc8e9;background:#33535a}#cancelSelection{border-color:#84734e}#rest{border-color:#8ca870;color:#d8efbd}.library-actions label{font-size:11px;color:var(--muted)}.library-actions select{margin-top:6px}.workspace{min-height:710px}body.testing .workspace{min-height:790px}body.testing .canvas-wrap{min-height:380px}.tabs{grid-template-columns:repeat(3,1fr)}
@media(max-width:760px){.equipment-slots{grid-template-columns:1fr}.workspace,body.testing .workspace{min-height:0}body.testing .viewport-panel{height:80dvh;min-height:680px}.tabs{grid-template-columns:repeat(5,1fr)}body.testing .canvas-wrap{min-height:330px}.minimap-wrap{opacity:.85}}

#inventoryDialog .dialog-heading{position:sticky;top:-22px;padding:14px 0;background:var(--panel);z-index:2}.buff-note{color:#efce7e;font-size:12px}#castMorale[hidden]{display:none}
.item-swatch{display:block;width:54px;height:56px;border-radius:6px;border:1px solid #829474;background:#12251d;box-shadow:inset 0 0 16px #0005}.equipment-slots{grid-template-columns:repeat(5,minmax(0,1fr));gap:7px}.equipment-slot{padding:9px;min-height:108px}@media(max-width:760px){.equipment-slots{grid-template-columns:repeat(2,minmax(0,1fr))}}
.crop-dialog{width:min(1100px,94vw);max-height:92dvh;overflow:auto;background:#12251f;color:#eef5de;border:1px solid #759883;border-radius:18px}.crop-work{display:grid;grid-template-columns:minmax(0,1fr) 250px;gap:18px}.crop-sheet{overflow:auto;max-height:65vh;background:repeating-conic-gradient(#3a4840 0% 25%,#28362f 0% 50%) 0 0/20px 20px}.crop-sheet canvas{max-width:100%;height:auto;display:block;touch-action:none;cursor:crosshair}.crop-result canvas,.object-crop-preview{max-width:100%;background:repeating-conic-gradient(#3a4840 0% 25%,#28362f 0% 50%) 0 0/20px 20px;border-radius:8px}.crop-values{display:grid;grid-template-columns:1fr 1fr;gap:8px}.crop-values label{display:grid;gap:4px}.crop-values input{width:100%;min-width:0}.crop-error{color:#ffb3a3}.crop-dialog button{min-height:42px}.draft-row .danger{margin-left:8px}@media(max-width:650px){.crop-work{grid-template-columns:1fr}.crop-result{display:grid;grid-template-columns:110px 1fr;gap:10px}.crop-result strong{grid-column:1/-1}.crop-result canvas{width:110px}.crop-sheet{max-height:45dvh}}

/* Sample templates are managed separately from editable map drafts. */
.sample-shortcuts{display:flex;gap:8px;align-items:center;padding:8px 22px;background:#12231c;border-bottom:1px solid #364e40;overflow-x:auto;flex-shrink:0}
.sample-shortcuts button{white-space:nowrap;font-size:13px;padding:8px 13px}
.sample-dialog{width:min(1060px,94vw);max-height:88dvh;padding:24px;overflow:auto}
.sample-dialog>label{display:grid;gap:6px;max-width:460px;margin:14px 0}
.sample-dialog input{width:100%;padding:12px;color:inherit;background:#10231b;border:1px solid #58715b;border-radius:8px}
.sample-actions{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}
.sample-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin:16px 0}
.sample-card{background:#193127;border:1px solid #496650;border-radius:14px;padding:14px;min-width:0}
.sample-card img{width:100%;height:160px;object-fit:cover;border-radius:8px}
.sample-card h3{margin:12px 0 4px}.sample-card .help{font-size:12px}.sample-card button{font-size:12px;padding:9px}
.sample-dialog details>button{margin:10px 8px 0 0}
@media(max-width:600px){.sample-shortcuts{padding:8px 12px}.sample-dialog{padding:14px}.sample-grid{grid-template-columns:1fr 1fr;gap:10px}.sample-card{padding:9px}.sample-card img{height:115px}.sample-card .sample-actions{display:grid}.sample-dialog .sample-actions>button{min-height:42px}}

body.testing .sample-shortcuts{pointer-events:none;opacity:.4}

/* v0.6.3 campaign map editor */
.world-editor-dialog{width:min(1280px,96vw);max-width:1280px;padding:0;border-color:#647b675e;background:#0d1914;color:#edf4e5}
.world-editor-dialog .dialog-heading{padding:18px 20px;border-bottom:1px solid #71817044}.world-editor-dialog .dialog-heading h2{margin:3px 0 0}
.world-editor-toolbar{display:flex;align-items:center;gap:8px;padding:12px 20px;border-bottom:1px solid #71817033}.world-editor-toolbar span{margin-left:auto;color:#b9c7b4}.world-editor-toolbar span.error{color:#ff9289}
.world-editor-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:14px;padding:14px}.world-editor-layout>aside{padding:16px;border:1px solid #71817044;border-radius:14px;background:#15261d}.world-editor-layout h3{margin-top:0}
.world-editor-board{position:relative;aspect-ratio:1672/941;min-height:420px;overflow:hidden;border:1px solid #93a78466;border-radius:15px;background:url("../assets/alkkagi-studio/full map.png") center/cover no-repeat;box-shadow:inset 0 0 70px #0008;touch-action:none}
.world-editor-node{position:absolute;translate:-50% -50%;width:112px;padding:0;border:0;background:transparent;color:white;filter:drop-shadow(0 5px 5px #000b);cursor:grab}.world-editor-node:active{cursor:grabbing}.world-editor-node.selected{filter:drop-shadow(0 0 12px #ffe27d)}.world-editor-node .world-stage-art{display:block;margin:auto;background-repeat:no-repeat;pointer-events:none}.world-editor-node>span:last-child{display:block;width:max-content;max-width:120px;margin:-2px auto 0;padding:3px 8px;border:1px solid #e8d98e77;border-radius:999px;background:#0c1c15e8;font-size:11px;font-weight:800;white-space:nowrap}
.world-stage-properties{display:grid;gap:10px}.world-stage-properties label{display:grid;gap:5px}.world-stage-properties label>span{font-size:12px;color:#b9c6b6}.world-stage-properties input,.world-stage-properties select{width:100%}.world-editor-actions{display:grid;gap:8px;margin-top:6px}
@media(max-width:850px){.world-editor-dialog{width:100%;max-width:100%;height:100dvh;max-height:none;margin:0;border-radius:0;overflow-x:hidden}.world-editor-toolbar{flex-wrap:wrap}.world-editor-toolbar span{width:100%;margin-left:0}.world-editor-layout{width:100%;max-width:100%;grid-template-columns:minmax(0,1fr);overflow:auto}.world-editor-board{width:calc(100vw - 28px);max-width:calc(100vw - 28px);min-width:0;min-height:0;height:clamp(185px,52vw,225px);aspect-ratio:auto;background-size:100% 100%}.world-editor-layout>aside{width:calc(100vw - 28px);max-width:calc(100vw - 28px);min-height:360px}.world-editor-node{transform:scale(.64)}}
