/* Imperium BlueMap: a lightweight layer over the stock interface. */
:root { --imperium-radius: 12px; --imperium-ease: cubic-bezier(.22, .8, .25, 1); }
#app { font-family: 'Quicksand', 'Segoe UI', sans-serif; }
#app .svg-button, #app .simple-button, #app .switch-button,
#app .text-input, #app .choice-box, #app button {
    border-radius: var(--imperium-radius);
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
#app .svg-button {
    box-sizing: border-box;
    min-width: 40px;
    min-height: 40px;
    border: 1px solid color-mix(in srgb, var(--theme-fg) 10%, transparent);
    box-shadow: 0 3px 12px #00000012;
}
#app .svg-button:hover { box-shadow: 0 4px 16px #00000026; }
#app [role='button']:focus-visible {
    outline: 2px solid #d5a357;
    outline-offset: 3px;
}
#app .control-bar {
    height: 40px;
    margin: 12px;
    width: calc(100% - 24px);
    gap: 6px;
    filter: none;
    background: transparent;
}
#app .control-bar > :not(:first-child) { border-left: none; }
#app .control-bar .space { width: 2px; }
#app .control-bar .controls-switch { display: flex; gap: 6px; }
#app .control-bar .day-night-switch { display: none !important; }
#app .position-input {
    border-radius: var(--imperium-radius);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--theme-fg) 10%, transparent);
    box-shadow: 0 3px 12px #00000012;
}
#app .position-input .number-input { min-height: 38px; align-items: center; }
#app .side-menu {
    box-sizing: border-box;
    top: 12px;
    left: 12px;
    width: min(336px, calc(100vw - 24px));
    max-width: none;
    height: calc(100% - 24px);
    height: calc(100dvh - 24px);
    border: 1px solid color-mix(in srgb, var(--theme-fg) 10%, transparent);
    border-radius: 20px;
    box-shadow: 0 12px 44px #00000030;
    filter: none;
    transform: translateX(0);
}
#app .side-menu > .menu-button { margin: 8px; }
#app .side-menu > .title {
    box-sizing: border-box;
    padding: 16px 62px;
    min-height: 58px;
    line-height: 24px;
    font-weight: 600;
}
#app .side-menu > .content {
    box-sizing: border-box;
    padding: 12px;
    height: calc(100% - 58px);
    scrollbar-width: thin;
}
#app .side-menu .simple-button {
    box-sizing: border-box;
    min-height: 44px;
    padding: 5px 12px;
    margin: 3px 0;
    align-items: center;
}
#app .side-menu .content hr { margin: 12px 4px; border-bottom-width: 1px; }
html[data-imperium-menu-page='root'] #app .side-menu .content > div > .simple-button:nth-child(3),
html[data-imperium-menu-page='root'] #app .side-menu .content > div > .simple-button:nth-child(4) {
    display: none !important;
}
#app .side-menu-enter-active, #app .side-menu-leave-active {
    transition: transform 320ms var(--imperium-ease), opacity 240ms ease;
}
#app .side-menu-enter-from, #app .side-menu-enter,
#app .side-menu-leave-to {
    transform: translateX(calc(-100% - 20px));
    opacity: 0;
    pointer-events: none;
}
#app .menu-button svg path {
    transition: transform 300ms var(--imperium-ease), opacity 180ms ease, fill 160ms ease;
}
#app .menu-button:not(.close) svg path { opacity: 1; }
#app .menu-button.close svg path:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
#app #zoom-buttons { margin: 12px; width: 40px; gap: 6px; filter: none; }
@media (max-width: 600px) {
    #app .control-bar { gap: 4px; }
    #app .control-bar .pos-input { min-width: 0; }
    #app .side-menu { max-height: calc(100dvh - 24px); }
}
@media (prefers-reduced-motion: reduce) {
    #app *, #app *::before, #app *::after { transition-duration: 0.01ms !important; }
}
#app .map-button, #app .marker-item, #app .marker-set,
#app .marker-button, #app .follow-player-button,
#app .open-menu-button, #app .marker-set > .info, #app .choice {
    border-radius: var(--imperium-radius);
    transition: background-color 160ms ease, box-shadow 160ms ease;
}
#app .map-button, #app .marker-item, #app .marker-set { margin: 5px 0; overflow: hidden; }
#app .map-button { padding: 7px 10px; }
/* Keep the simplified menu correct even while BlueMap is loading map data. */
#app .side-menu .content > div:has(> hr) > .simple-button:nth-child(3),
#app .side-menu .content > div:has(> hr) > .simple-button:nth-child(4) {
    display: none !important;
}
#app .side-menu .simple-button,
#app .side-menu .map-button,
#app .side-menu .marker-item,
#app .side-menu .marker-set {
    background: color-mix(in srgb, var(--theme-fg) 4%, var(--theme-bg));
    border: 1px solid color-mix(in srgb, var(--theme-fg) 10%, transparent);
    border-radius: 13px;
    margin: 7px 0;
    overflow: hidden;
}
#app .side-menu .simple-button:hover,
#app .side-menu .map-button:hover {
    background: color-mix(in srgb, #fcc77f 18%, var(--theme-bg));
    border-color: color-mix(in srgb, #c89243 40%, transparent);
}
#app .side-menu .map-button.selected {
    background: color-mix(in srgb, #fcc77f 24%, var(--theme-bg));
    border-color: color-mix(in srgb, #c89243 60%, transparent);
}

/* Joined view selector: one surface, three interactive segments. */
#app .control-bar .controls-switch {
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--theme-bg);
    box-shadow: 0 3px 12px #00000012;
}
#app .controls-switch > .svg-button {
    border-radius: 0;
    box-shadow: none;
    border: none;
}
#app .controls-switch > .svg-button + .svg-button {
    border-left: 1px solid color-mix(in srgb, var(--theme-fg) 10%, transparent);
}
/* Coordinates and compass share a continuous rounded outline. */
#app .control-bar > .position-input {
    border-radius: 12px 0 0 12px;
    border-right: none;
    box-shadow: none;
}
#app .control-bar > .position-input + .compass {
    margin-left: -6px;
    border-radius: 0 12px 12px 0;
    box-shadow: none;
}
@media (max-width: 600px) {
    #app .control-bar > .position-input + .compass { margin-left: -4px; }
}

/* Equal inset segments keep the selected state inside the outer outline. */
#app .control-bar .controls-switch {
    height: 40px;
    padding: 4px;
    box-sizing: border-box;
    gap: 2px;
    align-items: center;
    flex-shrink: 0;
}
#app .control-bar .controls-switch > .svg-button {
    flex: 0 0 36px;
    width: 36px;
    height: 32px;
    min-width: 36px;
    min-height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    box-shadow: none;
}
#app .control-bar .controls-switch > .svg-button.active {
    background: var(--theme-bg-light);
}
#app .control-bar .controls-switch > .svg-button:hover {
    background: var(--theme-bg-hover);
}
#app .control-bar .controls-switch > .svg-button svg {
    width: 26px;
    height: 26px;
}

#app #zoom-buttons {
    width: 40px;
    gap: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--theme-bg);
    box-shadow: 0 3px 12px #00000026;
    filter: none;
}
#app #zoom-buttons > .svg-button {
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}
#app #zoom-buttons > .svg-button + .svg-button {
    border-top: 1px solid color-mix(in srgb, var(--theme-fg) 12%, transparent);
}
.bm-marker-popup {
    border-radius: 12px;
    box-shadow: 0 5px 20px #00000030;
}
.bm-marker-popup > .group {
    border-radius: 12px;
}

#app .control-bar > .position-input {
    flex: 0 1 auto;
    width: auto;
}
#app .control-bar .position-input > .number-input {
    width: 124px;
    flex: 0 1 124px;
    min-width: 96px;
}

/* One continuous camera panel: reset, coordinate fields, compass. */
#app .control-bar > .svg-button:has(+ .position-input) {
    height: 40px;
    border: 0;
    border-radius: 12px 0 0 12px;
    box-shadow: none;
    flex: 0 0 40px;
}
#app .control-bar > .position-input {
    height: 40px;
    margin-left: -6px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    box-sizing: border-box;
}
#app .control-bar .position-input > .number-input {
    height: 40px;
    min-height: 40px;
    box-sizing: border-box;
    border-left: 1px solid color-mix(in srgb, var(--theme-fg) 10%, transparent);
}
#app .control-bar .position-input .number-input label {
    display: flex;
    align-items: center;
    height: 40px;
}
#app .control-bar .position-input .number-input input {
    box-sizing: border-box;
    min-width: 0;
    height: 40px;
    flex: 1;
}
#app .control-bar > .position-input + .compass {
    height: 40px;
    border: 0;
    border-left: 1px solid color-mix(in srgb, var(--theme-fg) 10%, transparent);
    flex: 0 0 40px;
}
@media (max-width: 600px) {
    #app .control-bar > .position-input { margin-left: -4px; }
}

/* Use BlueMap's actual POI image as the hover target and strip its label frame. */
#map-container .bm-marker-html.holy-place-hover > .bm-marker-poi-label {
    box-sizing: border-box;
    width: 320px;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    filter: none !important;
    white-space: normal;
    z-index: 10;
    pointer-events: none;
}
#map-container .bm-marker-html.holy-place-hover > .bm-marker-poi-label::after {
    display: none !important;
    content: none !important;
}
#map-container .bm-marker-html.holy-place-hover > .bm-marker-poi-icon:hover + .bm-marker-poi-label,
#map-container .bm-marker-html.holy-place-hover > .bm-marker-poi-label:hover,
#map-container .bm-marker-html.holy-place-hover.bm-marker-highlight > .bm-marker-poi-label {
    opacity: 1;
    pointer-events: auto;
}
