/* multiblock designer */

/* sidebar and grid layout */

#mbClose:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.mb-center-warning {
    opacity: 1;
    color: var(--danger);
}

.mb-layout {
    display: flex;
    gap: 14px;
    height: 100%;
}

.mb-side {
    flex: 0 0 270px;
    overflow-y: auto;
}

.mb-main {
    flex: 1 1 auto;
    min-width: 0;
    overflow: auto;
}

/* 2d faces make up the isometric preview */
.mb-preview-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.mb-preview-head .ins-title {
    margin: 0;
}

.mb-layer-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.mb-preview {
    height: 270px;
    margin-bottom: 6px;
    border: 1px solid var(--border);
    background: var(--bg);
}

.mb-isometric {
    display: block;
    width: 100%;
    height: 100%;
}

.mb-iso-floor {
    fill: var(--bg2);
    stroke: var(--border);
    stroke-width: 1;
}

.mb-iso-floor polyline {
    fill: none;
}

.mb-iso-block {
    cursor: pointer;
}

.mb-iso-block polygon {
    stroke: rgba(0,0,0,.6);
    stroke-width: 0.8;
    stroke-linejoin: round;
}

/* different shades on each side */
.mb-iso-top {
    fill: hsl(var(--block-hue), 42%, 58%);
}

.mb-iso-left {
    fill: hsl(var(--block-hue), 42%, 38%);
}

.mb-iso-right {
    fill: hsl(var(--block-hue), 42%, 46%);
}

.mb-iso-block.current polygon {
    stroke: var(--accent);
    stroke-width: 1.2;
}

/* any-block and empty center cells stay see-through */
.mb-iso-block.ghost polygon {
    fill: rgba(128,128,128,.12);
    stroke: #999;
    stroke-dasharray: 3 2;
}

.mb-iso-block.center polygon {
    stroke: #ff0;
    stroke-width: 1.5;
}

.mb-iso-block:hover polygon {
    stroke: #fff;
    stroke-width: 2;
}

.mb-iso-label {
    fill: #fff;
    font: bold 10px monospace;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
    paint-order: stroke;
    stroke: rgba(0,0,0,.65);
    stroke-width: 2px;
}

/* grid cells */

/* the designer sets the grid size */
.mb-grid {
    display: inline-grid;
    gap: 1px;
    background: #000;
    padding: 1px;
    margin-top: 8px;
}

.mb-cell {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #999;
    color: #fff;
    font: bold 13px monospace;
    text-shadow: 1px 1px 0 #000;
    cursor: pointer;
}

.mb-cell:hover {
    outline: 2px solid #fff;
    z-index: 1;
}

/* air and any-block cells */
.mb-cell.air {
    background: #444;
}

.mb-cell.any {
    background: #666;
}

/* yellow outline marks the center block */
.mb-cell.center {
    box-shadow: inset 0 0 0 2px #ff0;
}

/* block palette */

.mb-pal {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 3px;
    border: 1px solid transparent;
    border-radius: 0;
    cursor: pointer;
    margin-bottom: 2px;
}

.mb-pal.active {
    border-color: var(--accent);
    background: color-mix(in srgb, var(--accent) 20%, transparent);
}

.mb-pal .ch {
    width: 22px;
    height: 22px;
    background: #999;
    text-align: center;
    font: bold 13px/22px monospace;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    flex: 0 0 auto;
}

.mb-pal input {
    flex: 1 1 auto;
    min-width: 0;
    height: 22px;
    padding: 0 4px;
    background: var(--bg);
    color: var(--fg);
    border: 1px solid var(--border);
    border-radius: 0;
    font: inherit;
    line-height: normal;
    text-overflow: ellipsis;
}

.mb-side .btn.small {
    padding: 3px 6px 3px;
}

/* layer tabs */

.layer-tabs {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
    margin: 6px 0;
}

.layer-tabs .btn.active {
    background: var(--accent);
    color: #000;
}