.x-modal-on-click {
    cursor: pointer;
    transition: opacity .1s;
}

.x-modal-on-click:hover {
    opacity: .9;
}

.x-modal-on-click:focus-visible {
    outline: 3px solid var(--main-highlight);
    outline-offset: 2px;
}

#x-modal {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 16px;
    box-sizing: border-box;
    border: none;
    background: #000d;
    color: #fff;
}

#x-modal[open] {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

#x-modal .x-stage {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
}

#x-modal .x-image {
    position: absolute;
    inset: 0;
    margin: auto;
    max-width: 100%;
    max-height: 100%;
    cursor: default;
}

#x-modal .x-controls {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 24px;
    height: 44px;
    font-size: 1rem;
}

#x-modal .x-counter {
    min-width: 4em;
    text-align: center;
}

#x-modal .x-close,
#x-modal .x-controls button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: none;
    color: #fff;
    cursor: pointer;
}

#x-modal .x-close svg,
#x-modal .x-controls button svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#x-modal .x-close:hover,
#x-modal .x-controls button:hover {
    border: 3px solid var(--secondary-highlight);
    color: var(--secondary-highlight);
}

#x-modal .x-close:focus-visible,
#x-modal .x-controls button:focus-visible {
    outline: 3px solid var(--main-highlight);
    outline-offset: 2px;
}

#x-modal .x-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 1;
}
