/* ==========================================================
   V - CONTEMPORARIES — front-end styles (lavender theme)
   Solid colours only: no gradients, glass, blur or transparency.
   Visual design only; markup and behaviour are unchanged.
   The script sets a pastel background on each bubble inline; the
   !important white below overrides it so every bubble is a white card.
   ========================================================== */

.xc-quiz {
    --xc-lav: #E6E0F8;
    --xc-lav-mid: #B9AEE6;
    --xc-stage: #F7F4FD;
    --xc-blue: #1D4ED8;
    --xc-blue-dark: #1E40AF;
    --xc-correct: #1B7A34;
    --xc-wrong: #C62828;
    --xc-warn: #B07C00;
    --xc-shadow: 0 2px 6px rgba(60, 40, 120, .16);

    box-sizing: border-box;
    max-width: 1000px;
    margin: 24px auto;
    padding: 28px;
    background: var(--xc-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;
}

.xc-quiz,
.xc-quiz * {
    box-sizing: border-box;
}

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

/* ---------- Question card ---------- */

.xc-quiz .xc-question {
    margin: 0 0 16px;
    padding: 16px 22px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--xc-shadow);
    font-size: 20px;
    font-weight: 700;
    line-height: 1.45;
}

/* ---------- Stage (pale lavender play area; geometry unchanged) ---------- */

.xc-quiz .xc-stage {
    position: relative;
    height: 600px;
    min-height: 480px;
    overflow: hidden;
    background: var(--xc-stage);
    border: 0;
    border-radius: 14px;
    box-shadow: var(--xc-shadow);
    touch-action: none;
}

.xc-quiz .xc-bubble-layer {
    position: absolute;
    inset: 0;
}

/* ---------- Central bubble (fixed) ---------- */

.xc-quiz .xc-central {
    position: absolute;
    z-index: 5;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 170px;
    height: 170px;
    padding: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    border: 4px solid var(--xc-blue);
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(60, 40, 120, .22);
    font-size: 22px;
    font-weight: 800;
    pointer-events: none;
}

/* ---------- Secondary bubbles (white cards) ---------- */

.xc-quiz .xc-bubble {
    position: absolute;
    z-index: 10;
    width: 132px;
    min-height: 132px;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff !important;
    border: 3px solid var(--xc-lav-mid);
    border-radius: 50%;
    box-shadow: var(--xc-shadow);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    transition: border-color .12s, box-shadow .12s, transform .12s;
}

.xc-quiz .xc-bubble.dragging {
    z-index: 20;
    cursor: grabbing;
    transform: scale(1.04);
    border-color: var(--xc-blue);
    box-shadow: 0 10px 22px rgba(60, 40, 120, .3);
}

/* Currently over the central bubble (selected) */
.xc-quiz .xc-bubble.overlap {
    border-color: var(--xc-blue);
    box-shadow: 0 0 0 4px var(--xc-lav-mid), 0 8px 18px rgba(60, 40, 120, .22);
}

/* After submitting: correct = solid green + ✓, wrong = solid red + ✗,
   missed (should have been selected) = dashed amber + !   — never colour alone. */
.xc-quiz .xc-bubble.correct {
    border-color: var(--xc-correct);
    box-shadow: 0 0 0 4px #BFE3C9, var(--xc-shadow);
}

.xc-quiz .xc-bubble.wrong {
    border-color: var(--xc-wrong);
    box-shadow: 0 0 0 4px #F3C4C4, var(--xc-shadow);
}

.xc-quiz .xc-bubble.missed {
    border: 3px dashed var(--xc-warn);
    box-shadow: var(--xc-shadow);
}

.xc-quiz .xc-bubble.correct:after,
.xc-quiz .xc-bubble.wrong:after,
.xc-quiz .xc-bubble.missed:after {
    position: absolute;
    top: 0;
    right: 6px;
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--xc-shadow);
    font-size: 15px;
    font-weight: 900;
    line-height: 26px;
    text-align: center;
}

.xc-quiz .xc-bubble.correct:after { content: "\2713"; }
.xc-quiz .xc-bubble.wrong:after   { content: "\2717"; }
.xc-quiz .xc-bubble.missed:after  { content: "!"; }

/* ---------- Buttons (Submit + Reset, solid blue) ---------- */

.xc-quiz .xc-controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 18px 0 0;
}

.xc-quiz .xc-controls button {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 12px 26px;
    background: var(--xc-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;
}

.xc-quiz .xc-controls button:hover,
.xc-quiz .xc-controls button:active {
    background: var(--xc-blue-dark);
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(60, 40, 120, .3);
}

.xc-quiz .xc-controls button:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

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

.xc-quiz .xc-result {
    margin-top: 16px;
    text-align: center;
    font-size: 17px;
}

.xc-quiz .xc-result:not(:empty) {
    padding: 18px 22px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--xc-shadow);
}

.xc-quiz .xc-result strong {
    font-size: 20px;
    font-weight: 800;
}

.xc-quiz .xc-explanation {
    max-width: 760px;
    margin: 14px auto 0;
    padding: 14px 16px;
    background: #fff;
    border: 2px solid var(--xc-lav);
    border-radius: 12px;
    text-align: left;
    line-height: 1.5;
}

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

@media (max-width: 700px) {
    .xc-quiz {
        padding: 16px;
        border-radius: 18px;
    }

    .xc-quiz .xc-stage {
        height: 72vh;
        min-height: 500px;
    }

    .xc-quiz .xc-central {
        width: 135px;
        height: 135px;
        font-size: 18px;
    }

    .xc-quiz .xc-bubble {
        width: 108px;
        min-height: 108px;
        padding: 12px;
        font-size: 14px;
    }

    .xc-quiz .xc-question {
        font-size: 18px;
    }

    .xc-quiz .xc-controls {
        position: sticky;
        bottom: 8px;
        z-index: 30;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xc-quiz .xc-bubble,
    .xc-quiz .xc-controls button {
        transition: none;
    }
}
