/* Shared styles for native application dialogs and their controls. */
.app-dialog {
    margin: auto;
    border: 1px solid rgba(150, 255, 220, 0.2);
    border-radius: 1rem;
    background: #101a1f;
    color: #f4fff9;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
}

.app-dialog::backdrop {
    background: rgba(1, 7, 10, 0.76);
    backdrop-filter: blur(4px);
}

.dialog-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.dialog-heading h2 {
    margin: 0.25rem 0 0;
    font-size: 1.25rem;
}

.dialog-heading h2:focus {
    outline: none;
}

.dialog-close {
    display: grid;
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.07);
    color: white;
    cursor: pointer;
    transition:
        background-color 160ms ease,
        color 160ms ease;
}

.dialog-close::before {
    content: "×";
    display: block;
    font-family: Arial, sans-serif;
    font-size: 1.9rem;
    font-weight: 400;
    line-height: 1;
    transition: transform 180ms ease;
}

.dialog-close:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #9affd9;
}

.dialog-close:hover::before {
    transform: rotate(90deg);
}

.dialog-close:active {
    background: rgba(255, 255, 255, 0.2);
}

.dialog-close:focus-visible {
    outline: 2px solid #65f0bd;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .dialog-close,
    .dialog-close::before {
        transition: none;
    }
}

/* Shared base for legacy overlay modals used by account and party pages. */
.app-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 4vh 1rem;
    background: rgba(1, 7, 10, 0.76);
    backdrop-filter: blur(4px);
}

.app-modal-overlay.show {
    display: flex !important;
}

.app-modal-panel {
    position: relative;
    box-sizing: border-box;
    width: min(90%, 32.5rem);
    padding: 2rem;
    border: 1px solid rgba(150, 255, 220, 0.2);
    border-radius: 1rem;
    background: #101a1f;
    color: #f4fff9;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.app-modal-panel--danger {
    border-color: rgba(255, 76, 76, 0.32);
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.6),
        0 0 24px rgba(255, 76, 76, 0.1);
}

.app-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
    .dialog-close,
    .dialog-close::before {
        transition: none;
    }
}
