/* Map taskbar — single new-frame/taskbar-v2 shell. Combat overlay: map-taskbar-combat.css */

#map-taskbar {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-ship-nav);
    width: max-content;
    max-width: calc(100vw - 2rem);
    pointer-events: none;
    user-select: none;
}

#map-taskbar,
#map-taskbar * {
    box-sizing: border-box;
}

#ship-navigation-panel {
    position: relative;
    background: none;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    min-width: 0;
    max-width: none;
    pointer-events: auto;
}

.map-taskbar-plate {
    --tb-w: min(680px, calc(100vw - 2rem));
    --tb-y: calc(var(--tb-w) / 1156);
    position: relative;
    width: var(--tb-w);
    height: calc(var(--tb-y) * 224);
    overflow: visible;
}

.map-taskbar-skin {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: url(/assets/bg-main-C19v7vdo.png) center / 100% 100% no-repeat;
}

.cab-context[hidden] {
    display: none !important;
}

/* ── Nav POI slots (right wing — green taskbar plates) ───────────────────── */

#map-taskbar .cab-slots {
    gap: 0;
}

#map-taskbar .cab-slot {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: calc(var(--tb-y) * 93);
    height: calc(var(--tb-y) * 92);
    padding: 0;
    border: 0;
    border-radius: 0;
    background-color: transparent;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
    cursor: pointer;
    transition: filter 0.15s ease;
}

/* Right-wing slot positions: map-taskbar-combat.css (.map-taskbar-combat-side--right .cab-slot) */

#ship-navigation-panel .cab-slot::before {
    display: none;
}

#ship-navigation-panel .cab-slot:hover {
    filter: brightness(1.08);
}

#ship-navigation-panel .cab-slot.is-active {
    filter: brightness(1.14);
}

#ship-navigation-panel .cab-slot.is-zero {
    opacity: 1;
}

#ship-navigation-panel .cab-slot.is-zero .cab-slot-icon {
    opacity: 0.52;
}

.cab-slot-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--tb-y) * 44);
    height: calc(var(--tb-y) * 44);
}

#map-taskbar .cab-slot-img {
    display: block;
    width: calc(var(--tb-y) * 44);
    height: calc(var(--tb-y) * 44);
    object-fit: contain;
}

/* Journal (Q) — slightly lighter than map nav icons */
#map-taskbar .cab-slot[data-cat='destinations'] .cab-slot-icon,
#map-taskbar .cab-slot[data-cat='destinations'] .cab-slot-img {
    width: calc(var(--tb-y) * 37.4);
    height: calc(var(--tb-y) * 37.4);
}

/* Combat wing Q slot (bg-btn-1): recess sits right of the hit target centre. */
.map-taskbar-combat-side--right .cab-slot[data-cat='destinations'] .cab-slot-icon {
    transform: translateX(calc(var(--tb-y) * 6));
}

/* Centre, zoom — 5% smaller than default cab-slot icon */
#map-taskbar .cab-slot[data-map-action]:not([data-map-action='follow']) .cab-slot-icon,
#map-taskbar .cab-slot[data-map-action]:not([data-map-action='follow']) .cab-slot-img {
    width: calc(var(--tb-y) * 41.8);
    height: calc(var(--tb-y) * 41.8);
}

/* Follow (E) — 5% larger than centre/zoom */
#map-taskbar .cab-slot[data-map-action='follow'] .cab-slot-icon,
#map-taskbar .cab-slot[data-map-action='follow'] .cab-slot-img {
    width: calc(var(--tb-y) * 46.1);
    height: calc(var(--tb-y) * 46.1);
}

#map-taskbar .cab-slot-icon:has(img) {
    background: none;
}

.cab-slot-badge {
    display: none !important;
}

/* Drawer stacks above the plate (destinations + combat volley/munitions). */
#ship-navigation-panel .cab-drawer,
#ship-navigation-panel .combat-ammo-hud-volley-drawer,
#ship-navigation-panel .combat-ammo-hud-munitions-drawer {
    position: absolute;
    margin-left: 2rem;
    width: 94%;
    bottom: 70%;
    z-index: 0;
    pointer-events: auto;
}

@media (min-width: 768px) and (pointer: fine) {
    #map-taskbar {
        bottom: 12px;
    }

    #map-taskbar .cab-slots {
        gap: 0;
    }

    #map-taskbar .cab-slot {
        height: calc(var(--tb-y) * 92);
    }

    #map-taskbar .cab-slot:nth-child(1) {
        width: calc(var(--tb-y) * 107);
    }
}

/* Reinstate responsive.css lift after this async sheet loads (see game.html order). */
@media not ((min-width: 768px) and (pointer: fine)) {
    #map-taskbar {
        bottom: var(--mobile-bottom-inset);
    }

    #map-taskbar .map-taskbar-key {
        display: none;
    }

    #map-taskbar .cab-slot.is-zero {
        display: flex;
    }
}
