
.won-overlay[hidden] { display: none !important; }

.won-overlay {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(0, 0, 0, var(--won-overlay-alpha, .68));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    overflow-y: auto;
}

.won-dialog {
    position: relative;
    width: min(92vw, 760px);
    max-height: 94vh;
    padding: 0;
    background: #fff;
    border: 1px solid rgba(185, 132, 24, .45);
    border-radius: 14px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .38);
    overflow: auto;
    transform: translateY(8px) scale(.985);
    opacity: 0;
    transition: opacity .22s ease, transform .22s ease;
}

.won-overlay.won-visible .won-dialog {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.won-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(94vh - 58px);
    object-fit: contain;
    background: #fff;
}

.won-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    background: rgba(3, 20, 43, .92);
    color: #fff;
    font: 700 30px/40px Arial, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

.won-close:hover,
.won-close:focus-visible {
    background: #b40000;
    outline: 3px solid rgba(255, 255, 255, .9);
    outline-offset: 2px;
}

.won-understood {
    display: block;
    width: 100%;
    min-height: 52px;
    border: 0;
    border-top: 1px solid rgba(185, 132, 24, .35);
    background: linear-gradient(90deg, #9f6e0b, #d6aa42, #9f6e0b);
    color: #07152b;
    font: 800 16px/1.2 Arial, sans-serif;
    letter-spacing: .08em;
    cursor: pointer;
}

.won-understood:hover,
.won-understood:focus-visible {
    filter: brightness(1.06);
    outline: 3px solid #07152b;
    outline-offset: -4px;
}

body.won-lock {
    overflow: hidden !important;
}

@media (max-width: 600px) {
    .won-overlay {
        padding: 8px;
    }

    .won-dialog {
        width: 96vw;
        max-height: 96vh;
        border-radius: 10px;
    }

    .won-image {
        max-height: calc(96vh - 54px);
    }

    .won-close {
        top: 7px;
        right: 7px;
        width: 38px;
        height: 38px;
        font-size: 27px;
        line-height: 36px;
    }

    .won-understood {
        min-height: 50px;
        font-size: 15px;
    }
}

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