/* The city window of a settlement (city_modal.js): the dungeon window's sibling (dungeon_modal.css), same look and sizes. */
.mg-city {
    width: min(1100px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    padding: 16px;
    color: var(--mg-text);
    background: var(--mg-surface);
    border: 1px solid var(--mg-border);
    border-radius: 10px;
    overflow: auto;
}

.mg-city::backdrop {
    background: rgba(0, 0, 0, 0.65);
}

.mg-city[open] {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mg-city-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mg-city-title {
    margin: 0;
    font-size: 1.25rem;
}

.mg-city-subtitle {
    margin: 2px 0 0;
    color: var(--mg-muted);
    font-size: 0.875rem;
}

.mg-city-status {
    margin: 0;
    color: var(--mg-muted);
}

.mg-city-status.is-error {
    color: var(--mg-danger);
}

.mg-city-status a,
.mg-city-upgrade a {
    color: var(--mg-link);
    text-decoration: underline;
}

/* The stage the canvas fills (the Battlemap Generator's StageView positions its canvas absolutely inside it). */
.mg-city-stage {
    position: relative;
    flex: 1 1 auto;
    height: min(66dvh, 760px);
    min-height: 260px;
    overflow: hidden;
    background: #1d1915;
    border: 1px solid var(--mg-border);
    border-radius: 6px;
}

.mg-city-stage .bm-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    outline: none;
}

.mg-city-stage .bm-canvas:focus-visible {
    outline: 2px solid var(--mg-accent);
    outline-offset: -2px;
}

.mg-city-controls,
.mg-city-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* The site's gold and dark outlined buttons, sized for this window (as the dungeon window sizes them). */
.mg-city .btn-buy,
.mg-city .btn-close-dnd {
    width: auto;
    max-width: none;
    min-height: var(--mg-touch);
    margin: 0;
    padding: 4px 14px;
    font-size: 0.9rem;
}

.mg-city .btn-close-dnd {
    background-color: #151f25;
    border: 1px solid #e7bf8f;
    border-radius: 25px;
    color: #e7bf8f;
    text-transform: uppercase;
}

.mg-city .btn-close-dnd:hover,
.mg-city .btn-close-dnd:focus,
.mg-city .btn-close-dnd[aria-pressed="true"] {
    background-color: #e7bf8f;
    color: #151f25;
}

.mg-city .btn-close-dnd:disabled {
    opacity: 0.5;
}

@media (max-width: 599px) {
    .mg-city {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    .mg-city-stage {
        height: auto;
        min-height: 240px;
    }

    .mg-city-actions .btn {
        flex: 1 1 100%;
        max-width: 100%;
        white-space: normal;
    }
}

/* What the map shows of the place: a plan of the whole city to scale (when the map is only its walled centre) and the words. */
.mg-city-about {
    display: flex;
    align-items: center;
    gap: 14px;
}

.mg-city-about[hidden],
.mg-city-overview[hidden] {
    display: none;
}

.mg-city-overview {
    flex: 0 0 auto;
    border: 1px solid var(--mg-border);
    border-radius: 6px;
}

.mg-city-caption {
    margin: 0;
    color: var(--mg-muted);
    font-size: 0.875rem;
    line-height: 1.4;
}

@media (max-width: 599px) {
    .mg-city-about {
        flex-direction: column;
        align-items: stretch;
    }

    .mg-city-overview {
        align-self: center;
    }
}
