/**
 * /characterforge/css/modal_plaque.css
 * Every CharacterForge modal box wears the corner-notched plaque frame from
 * plaque.css (design.md, Components > Plaque; user decision 2026-11-27): the
 * chamfered dark plaque, its double gold line with scooped outer corners and the
 * inner line's top fading open in the middle, in place of the old 2 px gold
 * border, rounded corners and drop shadow.
 *
 * The plaque component draws its lines with ::before/::after, which would scroll
 * away inside a tall modal and clash with modals that already use those
 * pseudo-elements. Here the same lines are background layers instead, which stay
 * put while the modal's content scrolls. The !important flags beat the many
 * per-page and inline modal styles (background, border, radius, shadow).
 *
 * Loaded by global.css, universal_modals.php (so also the tabletop), header.php,
 * /includes/login_modal.php (the sign-in box) and maintenance.php. Not for
 * the side drawers (.cf-inspecting, .cf-spell-drawer), sheet2's own look, the
 * tabletop's bare picture viewer (#imageModal) or the player NPC creator's
 * see-through wrapper around its parchment stat block (#statModalBox). Windows
 * whose tabs stick out of their side get the frame without the corner cut,
 * which would hide those tabs.
 */
:is(.forge-modal, .modal-box, .modal-content, .smith-modal, .sys-modal-box, .tavern-modal,
    .confirm-modal-box, .path-modal-box, .modal-card, .cf-damage-dialog, .creator-art-dialog,
    .cf-draft-dialog, .edit-token-modal-content, .map-config-modal-content, .forge-modal-card):not(
    :where(.cf-inspecting, .cf-spell-drawer) > *, :where(.sheet2-body) *, .forge-plaque,
    #imageModal > *, #statModalBox) {
    --plaque-notch: 12px;
    --plaque-i: 8px;   /* plaque edge to the outer gold line */
    --plaque-j: 12px;  /* plaque edge to the inner gold line */
    --plaque-r: 16px;  /* radius of the outer line's scooped corners */
    --plaque-line: rgba(212, 175, 55, 0.42);
    --plaque-arc: transparent calc(var(--plaque-r) - 1.3px), var(--plaque-line) calc(var(--plaque-r) - 0.9px), var(--plaque-line) calc(var(--plaque-r) - 0.1px), transparent calc(var(--plaque-r) + 0.3px);
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background:
        /* outer line: straight sides */
        linear-gradient(var(--plaque-line), var(--plaque-line)) center top var(--plaque-i) / calc(100% - 2 * var(--plaque-i) - 2 * var(--plaque-r)) 1px no-repeat,
        linear-gradient(var(--plaque-line), var(--plaque-line)) center bottom var(--plaque-i) / calc(100% - 2 * var(--plaque-i) - 2 * var(--plaque-r)) 1px no-repeat,
        linear-gradient(var(--plaque-line), var(--plaque-line)) left var(--plaque-i) center / 1px calc(100% - 2 * var(--plaque-i) - 2 * var(--plaque-r)) no-repeat,
        linear-gradient(var(--plaque-line), var(--plaque-line)) right var(--plaque-i) center / 1px calc(100% - 2 * var(--plaque-i) - 2 * var(--plaque-r)) no-repeat,
        /* outer line: scooped corners */
        radial-gradient(circle at 0 0, var(--plaque-arc)) left var(--plaque-i) top var(--plaque-i) / var(--plaque-r) var(--plaque-r) no-repeat,
        radial-gradient(circle at 100% 0, var(--plaque-arc)) right var(--plaque-i) top var(--plaque-i) / var(--plaque-r) var(--plaque-r) no-repeat,
        radial-gradient(circle at 0 100%, var(--plaque-arc)) left var(--plaque-i) bottom var(--plaque-i) / var(--plaque-r) var(--plaque-r) no-repeat,
        radial-gradient(circle at 100% 100%, var(--plaque-arc)) right var(--plaque-i) bottom var(--plaque-i) / var(--plaque-r) var(--plaque-r) no-repeat,
        /* inner line: square corners, top side fading open in the middle */
        linear-gradient(90deg, var(--plaque-line) 0%, var(--plaque-line) 12%, transparent 32%, transparent 68%, var(--plaque-line) 88%, var(--plaque-line) 100%) center top var(--plaque-j) / calc(100% - 2 * var(--plaque-j)) 1px no-repeat,
        linear-gradient(var(--plaque-line), var(--plaque-line)) center bottom var(--plaque-j) / calc(100% - 2 * var(--plaque-j)) 1px no-repeat,
        linear-gradient(var(--plaque-line), var(--plaque-line)) left var(--plaque-j) center / 1px calc(100% - 2 * var(--plaque-j)) no-repeat,
        linear-gradient(var(--plaque-line), var(--plaque-line)) right var(--plaque-j) center / 1px calc(100% - 2 * var(--plaque-j)) no-repeat,
        /* the plaque surface with its soft top-centre glow */
        radial-gradient(circle at top center, #28241e 0%, #1a1816 80%) !important;
    background-attachment: scroll !important;
    clip-path: polygon(
        var(--plaque-notch) 0%, calc(100% - var(--plaque-notch)) 0%,
        100% var(--plaque-notch), 100% calc(100% - var(--plaque-notch)),
        calc(100% - var(--plaque-notch)) 100%, var(--plaque-notch) 100%,
        0% calc(100% - var(--plaque-notch)), 0% var(--plaque-notch));
}
/* Windows with tab rails sticking out of their side keep the frame but not the corner cut. */
:is(.edit-token-modal-content, .map-config-modal-content) {
    clip-path: none !important;
}
/* Content stays clear of the inner line. */
.cf-damage-dialog:not(:where(.sheet2-body) *),
#statModal > .modal-box,
#cf-level-overlay .forge-modal {
    padding: 20px !important;
}
/* Corner close buttons sit inside the frame. */
#forge-modal-overlay.cf-vtt-item .cf-vtt-item-close {
    top: 16px;
    right: 16px;
}
