/* Compact state-first toolbar for map.php. Loaded after map-editor-refinement.css. */

.build-editor-page .build-editor-header-row {
    grid-template-columns: minmax(210px, 0.7fr) minmax(360px, 1.45fr) minmax(180px, 0.65fr) minmax(650px, 1.5fr);
    min-height: 54px;
    padding: 8px 10px;
}

.build-editor-page .build-editor-map-meta h3,
.build-editor-page .build-editor-title-col,
.build-editor-page .build-editor-author-meta {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.build-editor-page .build-editor-map-meta h3 {
    white-space: nowrap;
}

.build-editor-page .build-editor-map-meta h3 > b {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.build-editor-page .build-editor-title-col > label,
.build-editor-page .build-editor-author-meta > label {
    flex: 0 0 auto;
    margin: 0;
    white-space: nowrap;
}

.build-editor-page #buildname,
.build-editor-page #author {
    min-width: 0;
    height: 34px;
}

.build-editor-page .build-editor-resource-meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.build-editor-page .build-editor-resources {
    flex: 0 0 auto;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 11px;
}

.build-editor-page .build-editor-resources b {
    font-size: 14px;
}

.build-editor-page .build-editor-map-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 7px;
    min-width: 0;
}

.build-editor-page .map-toolbar-control {
    flex: 0 0 auto;
}

.build-editor-page .map-toolbar-button {
    height: 36px;
    padding: 7px 11px;
    border-color: rgba(139, 155, 181, 0.34);
    border-radius: 6px;
    background: rgba(24, 31, 41, 0.82);
    color: #d9e3f1;
    font-size: 11px;
    font-weight: 700;
    line-height: 20px;
    white-space: nowrap;
}

.build-editor-page .map-toolbar-button:hover,
.build-editor-page .map-toolbar-button:focus,
.build-editor-page .map-toolbar-control.open > .map-toolbar-button,
.build-editor-page .map-toolbar-button.is-active {
    border-color: rgba(91, 153, 255, 0.5);
    background: rgba(61, 130, 246, 0.18);
    color: #fff;
}

.build-editor-page .map-toolbar-button .fa {
    margin-right: 5px;
    opacity: 0.9;
}

.build-editor-page .map-toolbar-scale-value {
    margin-left: 2px;
    color: #fff;
}

.build-editor-page .map-toolbar-arrow-control .map-toolbar-arrow-toggle {
    border-radius: 6px 0 0 6px;
}

.build-editor-page .map-toolbar-arrow-control .map-toolbar-arrow-details {
    width: 34px;
    padding-left: 9px;
    padding-right: 9px;
    border-left-color: rgba(139, 155, 181, 0.18);
    border-radius: 0 6px 6px 0;
}

.build-editor-page .map-toolbar-native-toggle {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.build-editor-page .map-toolbar-menu {
    min-width: 240px;
    margin-top: 6px;
    padding: 11px;
    border: 1px solid rgba(139, 155, 181, 0.42);
    border-radius: 8px;
    background: #252e3c;
    box-shadow: 0 14px 30px rgba(5, 9, 16, 0.44);
    color: #dce5f2;
}

.build-editor-page .map-toolbar-scale-menu {
    left: auto;
    right: 0;
    width: 280px;
}

.build-editor-page .map-toolbar-arrow-menu {
    width: 240px;
}

.build-editor-page .map-toolbar-menu-title {
    margin-bottom: 8px;
    color: #f0f4fb;
    font-size: 12px;
    font-weight: 700;
}

.build-editor-page .map-toolbar-menu-label,
.build-editor-page .map-toolbar-native-scale-label {
    display: block;
    margin: 0 0 6px;
    color: #afbdd1;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.build-editor-page .map-toolbar-scale-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.build-editor-page .map-toolbar-scale-row #mapscaleadjustment {
    width: 100%;
    min-width: 0;
}

.build-editor-page .map-toolbar-menu-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 9px;
}

.build-editor-page .map-toolbar-menu-button {
    min-height: 30px;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 11px;
}

.build-editor-page .map-toolbar-color-select {
    width: 100% !important;
    height: 32px !important;
    margin: 0;
    border-radius: 5px;
    font-size: 11px;
}

/* The tab row contains both the tab strip and the page tab content in the
 * legacy markup. It must remain block-flow; using flex here puts the entire
 * editor to the right of Build / Comments. */
.build-editor-page .build-editor-tabs-row {
    display: block;
    margin: 0;
}

.build-editor-page .build-editor-tabs-row > .build-editor-tabs {
    margin-bottom: 10px;
}

.build-editor-page .build-editor-tabs-row > .tab-content {
    display: block;
    width: 100%;
    min-width: 0;
}

.build-editor-page .build-sidebar-tab-content {
    transition: min-height 120ms ease;
}

/* Build Description belongs to the build metadata, so keep it at the bottom
 * of Build Details instead of consuming a second full-width editor below the map. */
.build-editor-page .build-sidebar-details-pane .build-details-description {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(139, 155, 181, 0.22);
}

.build-editor-page .build-sidebar-details-pane .build-description-panel {
    margin: 0;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.build-editor-page .build-sidebar-details-pane .build-description-panel > .panel-heading {
    padding: 0 2px 9px;
    border: 0;
    background: transparent;
    color: #dce5f2;
    font-size: 13px;
}

.build-editor-page .build-sidebar-details-pane .build-description-panel > .panel-body {
    padding: 0 2px 2px;
}

.build-editor-page .build-sidebar-details-pane .cke {
    width: 100% !important;
    max-width: 100%;
}

@media (min-width: 2200px) {
    .build-editor-page .build-editor-header-row {
        grid-template-columns: minmax(270px, 340px) minmax(560px, 720px) minmax(220px, 300px) minmax(760px, 1fr);
    }

    .build-editor-page .build-editor-resource-meta,
    .build-editor-page .build-editor-map-tools {
        justify-content: flex-end;
    }

    .build-editor-page .build-sidebar-details-pane .build-description-panel > .panel-heading {
        font-size: 14px;
    }
}

/* At Full HD the sidebar naturally settles into fewer columns. Put EV directly
 * after the first three builders there so Monk's wider aura card cannot leave a
 * visual hole. Wide 4K keeps the server-side order: Squire, Apprentice,
 * Huntress, Monk, Summoner, Series-EV. */
@media (min-width: 1200px) and (max-width: 2199px) {
    .build-editor-page .hero-pool-grid > .hero-pool-item {
        order: 100;
    }

    .build-editor-page .hero-pool-grid > .hero-pool-item-squire { order: 10; }
    .build-editor-page .hero-pool-grid > .hero-pool-item-apprentice { order: 20; }
    .build-editor-page .hero-pool-grid > .hero-pool-item-huntress { order: 30; }
    .build-editor-page .hero-pool-grid > .hero-pool-item-ev { order: 40; }
    .build-editor-page .hero-pool-grid > .hero-pool-item-monk { order: 50; }
    .build-editor-page .hero-pool-grid > .hero-pool-item-summoner { order: 60; }
}

@media (max-width: 1599px) {
    .build-editor-page .build-editor-header-row {
        grid-template-columns: minmax(180px, 0.65fr) minmax(300px, 1.2fr) minmax(160px, 0.6fr) minmax(560px, 1.55fr);
    }

    .build-editor-page .map-toolbar-button {
        padding-left: 8px;
        padding-right: 8px;
        font-size: 10px;
    }
}

@media (max-width: 1199px) {
    .build-editor-page .build-editor-header-row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .build-editor-page .build-editor-resource-meta {
        grid-column: 1 / -1;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .build-editor-page .build-editor-map-tools {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 767px) {
    .build-editor-page .build-editor-header-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .build-editor-page .build-editor-map-meta h3,
    .build-editor-page .build-editor-title-col,
    .build-editor-page .build-editor-author-meta,
    .build-editor-page .build-editor-resource-meta {
        grid-column: auto;
        flex-wrap: wrap;
    }

    .build-editor-page .build-editor-map-tools {
        width: 100%;
    }
}