.popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 1rem;
    border: 0;
    background: rgba(3, 3, 12, 0.82);
    color: #f4f4f5;
    z-index: 999;
}

dialog.popup-overlay:not([open]) {
    display: none;
}

dialog.popup-overlay[open] {
    display: flex;
}

dialog.popup-overlay::backdrop {
    background: transparent;
}

.popup-alert {
    position: relative;
    width: min(100%, 460px);
    padding: clamp(1.5rem, 6vw, 2.5rem);
    overflow: hidden;
    border: 2px solid #06b6d4;
    background:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        #111120;
    background-size: 18px 18px;
    box-shadow: 7px 7px 0 #c026d3, 0 18px 60px rgba(0, 0, 0, 0.55);
    text-align: center;
    animation: popup-enter 180ms steps(3, end);
}

.card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 190px);
    height: 96px;
    margin: 0 auto 1.5rem;
    padding: 0.45rem;
    border: 2px solid #c026d3;
    background: #090914;
    box-shadow: 4px 4px 0 #06b6d4;
}

.card-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.popup-title {
    margin: 0 0 1rem;
    color: #fff;
    font-family: "Press Start 2P", cursive;
    font-size: clamp(0.65rem, 2.5vw, 0.85rem);
    font-weight: 400;
    line-height: 1.9;
}

.popup-message {
    margin: 0 0 1.75rem;
    color: #d4d4d8;
    font-family: "VT323", monospace;
    font-size: clamp(1.35rem, 4vw, 1.65rem);
    line-height: 1.25;
}

.popup-button {
    min-width: 150px;
    padding: 0.8rem 1.25rem;
    border: 2px solid #06b6d4;
    background: #06b6d4;
    box-shadow: 0 4px 0 #087b91;
    color: #090914;
    cursor: pointer;
    font-family: "Press Start 2P", cursive;
    font-size: 0.6rem;
    line-height: 1.8;
    transition: transform 100ms steps(2), box-shadow 100ms steps(2), background-color 100ms steps(2);
}

.popup-button:hover {
    background: #67e8f9;
    transform: translateY(2px);
    box-shadow: 0 2px 0 #087b91;
}

.popup-button:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 #087b91;
}

.popup-button:focus-visible {
    outline: 2px solid #e879f9;
    outline-offset: 4px;
}

@keyframes popup-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .popup-alert,
    .popup-button {
        animation: none;
        transition: none;
    }
}
