/* ==========================================================
   V - DROP CANVAS — front-end styles (lavender theme)
   Solid colours only: no gradients, glass, blur or transparency.
   Visual design only; markup and behaviour are unchanged.
   ========================================================== */

.xsdc-wrap {
    --dc-lav: #E6E0F8;
    --dc-lav-mid: #B9AEE6;
    --dc-lav-pale: #F3F0FC;
    --dc-blue: #1D4ED8;
    --dc-blue-dark: #1E40AF;
    --dc-correct: #1B7A34;
    --dc-frame: 14px;
    --dc-shadow: 0 2px 6px rgba(60, 40, 120, .16);

    box-sizing: border-box;
    max-width: 1100px;
    margin: 20px auto;
    padding: 28px;
    background: var(--dc-lav);
    border-radius: 22px;
    box-shadow: 0 12px 28px rgba(60, 40, 120, .18), 0 3px 8px rgba(60, 40, 120, .12);
    color: #000;
    font-family: inherit;
    line-height: 1.4;
    text-align: center;
}

.xsdc-wrap,
.xsdc-wrap * {
    box-sizing: border-box;
}

/* All text black (the blue buttons are white-on-blue, below) */
.xsdc-wrap *:not(button) {
    color: #000 !important;
}

/* ---------- Instruction card ---------- */

.xsdc-wrap .xsdc-instructions {
    margin: 0 0 var(--dc-frame);
    padding: 16px 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--dc-shadow);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.5;
    text-align: left;
}

/* ---------- Image card ----------
   The white frame is drawn OUTSIDE the stage with box-shadow, not with border or
   padding: the script measures target positions against the stage box, so the stage
   must stay exactly the size of the image or dropped pictures would sit off-centre. */
.xsdc-wrap .xsdc-stage {
    position: relative;
    display: inline-block;
    max-width: calc(100% - (var(--dc-frame) * 2));
    margin: var(--dc-frame);
    line-height: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow:
        0 0 0 var(--dc-frame) #fff,
        0 3px 10px var(--dc-frame) rgba(60, 40, 120, .14);
    touch-action: none;
}

.xsdc-wrap .xsdc-base {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.xsdc-wrap .xsdc-target-layer {
    position: absolute;
    inset: 0;
}

/* ---------- Target circles ----------
   Outline only (no see-through fill). The fill that the quiz settings used to
   control is switched off here so the picture underneath stays fully visible. */
.xsdc-wrap .xsdc-target {
    position: absolute;
    transform: translate(-50%, -50%);
    background: none !important;
    border: 2px dashed var(--dc-blue);
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
    pointer-events: none;
}

/* Filled = solid green ring + ✓ (not colour alone) */
.xsdc-wrap .xsdc-target.filled {
    background: none !important;
    border: 3px solid var(--dc-correct);
}

.xsdc-wrap .xsdc-target.filled:after {
    content: "\2713";
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--dc-shadow);
    font-size: 14px;
    font-weight: 900;
    line-height: 24px;
    text-align: center;
}

/* ---------- Tray + draggable image cards ---------- */

.xsdc-wrap .xsdc-tray {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    min-height: 100px;
    margin: calc(var(--dc-frame) * 2) 0 20px;
    padding: 15px;
    background: var(--dc-lav-pale);
    border: 2px dashed var(--dc-lav-mid);
    border-radius: 14px;
}

.xsdc-wrap .xsdc-card {
    width: 120px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 2px solid #fff;
    border-radius: 14px;
    box-shadow: var(--dc-shadow);
    cursor: grab;
    touch-action: none;
    transition: box-shadow .12s ease, border-color .12s ease;
}

.xsdc-wrap .xsdc-card:hover {
    border-color: var(--dc-blue);
    box-shadow: 0 5px 12px rgba(60, 40, 120, .22);
}

.xsdc-wrap .xsdc-card img {
    max-width: 110px;
    max-height: 90px;
    object-fit: contain;
    pointer-events: none;
}

/* The card being dragged leaves a dashed, flat, greyscale "slot" behind
   (no fading); the picture itself follows the pointer as .xsdc-floating. */
.xsdc-wrap .xsdc-card.dragging {
    border: 2px dashed var(--dc-blue);
    box-shadow: none;
}

.xsdc-wrap .xsdc-card.dragging img {
    filter: grayscale(1);
}

.xsdc-wrap .xsdc-card.placed {
    visibility: hidden;
}

/* The picture that follows the pointer is appended to <body>, outside .xsdc-wrap */
.xsdc-floating {
    position: fixed;
    z-index: 999999;
    pointer-events: none;
    object-fit: contain;
    filter: drop-shadow(0 8px 8px rgba(60, 40, 120, .3));
}

.xsdc-wrap .xsdc-placed {
    position: absolute;
    z-index: 5;
    pointer-events: none;
    object-fit: contain;
}

/* ---------- Buttons (Check Answer + Reset, solid blue) ---------- */

.xsdc-wrap .xsdc-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.xsdc-wrap .xsdc-check,
.xsdc-wrap .xsdc-reset {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 12px 26px;
    background: var(--dc-blue);
    border: 0;
    border-radius: 10px;
    color: #fff !important;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: .4px;
    line-height: 1.2;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(60, 40, 120, .24);
    transition: background-color .12s ease, box-shadow .12s ease;
}

.xsdc-wrap .xsdc-check:hover,
.xsdc-wrap .xsdc-reset:hover,
.xsdc-wrap .xsdc-check:active,
.xsdc-wrap .xsdc-reset:active {
    background: var(--dc-blue-dark);
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(60, 40, 120, .3);
}

.xsdc-wrap .xsdc-check:focus-visible,
.xsdc-wrap .xsdc-reset:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

/* ---------- Result card ---------- */

.xsdc-wrap .xsdc-result {
    font-size: 18px;
    font-weight: 800;
}

.xsdc-wrap .xsdc-result:not(:empty) {
    padding: 12px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--dc-shadow);
}

/* ---------- Message (question not configured) ---------- */

.xsdc-error {
    max-width: 1100px;
    margin: 20px auto;
    padding: 14px 18px;
    background: #fff;
    border: 2px solid #C62828;
    border-radius: 12px;
    box-shadow: 0 2px 6px rgba(60, 40, 120, .16);
    color: #000;
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
    .xsdc-wrap {
        --dc-frame: 8px;
        padding: 16px;
        border-radius: 18px;
    }

    .xsdc-wrap .xsdc-card {
        width: calc(50% - 6px);
    }

    .xsdc-wrap .xsdc-check,
    .xsdc-wrap .xsdc-reset {
        flex: 1 1 auto;
    }

    .xsdc-wrap .xsdc-result {
        flex: 1 1 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xsdc-wrap .xsdc-card,
    .xsdc-wrap .xsdc-check,
    .xsdc-wrap .xsdc-reset {
        transition: none;
    }
}
