/* The dungeon window of a map site (dungeon_modal.js). */
.mg-dungeon {
    width: min(960px, 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-dungeon::backdrop {
    background: rgba(0, 0, 0, 0.65);
}

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

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

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

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

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

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

.mg-dungeon-stage {
    overflow: auto;
    max-height: 60dvh;
    background: #1d1915;
    border: 1px solid var(--mg-border);
    border-radius: 6px;
}

.mg-dungeon-canvas {
    display: block;
    margin: 0 auto;
}

.mg-dungeon-floors,
.mg-dungeon-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

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

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

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

.mg-dungeon .mg-dungeon-small {
    padding: 4px 12px;
}

.mg-dungeon-picker {
    padding: 10px;
    background: var(--mg-surface-2);
    border: 1px solid var(--mg-border);
    border-radius: 6px;
}

.mg-dungeon-picker h3 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.mg-dungeon-list {
    display: grid;
    gap: 6px;
    max-height: 220px;
    margin: 0 0 8px;
    padding: 0;
    overflow: auto;
    list-style: none;
}

.mg-dungeon-choice {
    display: flex;
    flex-direction: column;
    gap: 2px;
    width: 100%;
    min-height: var(--mg-touch);
    padding: 6px 10px;
    color: var(--mg-text);
    text-align: left;
    background: var(--mg-bg);
    border: 1px solid var(--mg-border);
    border-radius: 6px;
}

.mg-dungeon-choice span {
    color: var(--mg-muted);
    font-size: 0.8125rem;
    text-transform: capitalize;
}

.mg-dungeon-choice[aria-pressed="true"] {
    border-color: var(--mg-accent);
}

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

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

/* The free plan's allowance in the dungeon window, as the Dungeon Generator's plan note. */
.mg-dungeon-plan {
    margin: 0;
    padding: 8px 10px;
    color: var(--mg-muted);
    font-size: 0.875rem;
    background: var(--mg-surface-2);
    border: 1px solid var(--mg-border);
    border-radius: 6px;
}

.mg-dungeon-plan.is-used-up {
    color: var(--mg-danger);
    border-color: var(--mg-danger);
}

.mg-dungeon-plan a {
    color: var(--mg-link);
    text-decoration: underline;
}

/* On a phone the buttons are as wide as the window and their (long) labels wrap instead of running off it. */
@media (max-width: 599px) {
    .mg-dungeon-actions .btn {
        flex: 1 1 100%;
        max-width: 100%;
        white-space: normal;
    }
}
