/* ==========================================================
   T - SHOOT — front-end styles (lavender theme)
   Solid colours only: no gradients, glass, blur or transparency.
   Visual design only; markup and behaviour are unchanged.
   Scene geometry (scene size, shelf tops, target positions) is
   deliberately unchanged: targets are placed in % of the scene.
   ========================================================== */

.xsst-game {
    --xs-lav: #E6E0F8;
    --xs-lav-mid: #B9AEE6;
    --xs-lav-dark: #8F82CC;
    --xs-blue: #1D4ED8;
    --xs-blue-dark: #1E40AF;
    --xs-green: #1B7A34;
    --xs-red: #C62828;
    --xs-shadow: 0 2px 6px rgba(60, 40, 120, .16);

    position: relative;
    box-sizing: border-box;
    max-width: 1100px;
    margin: 20px auto;
    padding: 28px;
    background: var(--xs-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;
    user-select: none;
    -webkit-user-select: none;
}

.xsst-game,
.xsst-game * {
    box-sizing: border-box;
}

.xsst-game:focus {
    outline: none;
}

.xsst-game:focus-visible {
    outline: 3px solid var(--xs-blue);
    outline-offset: 3px;
}

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

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

.xsst-game .xsst-hud {
    position: relative;
    z-index: 20;
    margin: 0 0 14px;
    padding: 16px 20px;
    background: #fff;
    border-radius: 14px;
    box-shadow: var(--xs-shadow);
    pointer-events: none;
}

.xsst-game .xsst-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2px;
}

.xsst-game .xsst-question {
    min-height: 1.3em;
    margin: 6px 130px 0 0;
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
}

.xsst-game .xsst-stats {
    position: absolute;
    right: 20px;
    top: 16px;
    display: flex;
    gap: 18px;
    font-weight: 800;
}

.xsst-game .xsst-score {
    font-size: 20px;
}

/* ---------- Scene (white card) ---------- */

.xsst-game .xsst-scene {
    position: relative;
    height: 650px;
    min-height: 520px;
    overflow: hidden;
    cursor: crosshair;
    background: #ECE6FA;
    border-radius: 14px;
    box-shadow: var(--xs-shadow);
}

.xsst-game .xsst-backwall {
    position: absolute;
    inset: 0 0 35%;
    background: #FAF8FE;
}

.xsst-game .xsst-backwall:before,
.xsst-game .xsst-backwall:after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 18px;
    background: #F0EBFB;
}

.xsst-game .xsst-backwall:before { left: 16%; }
.xsst-game .xsst-backwall:after  { right: 16%; }

.xsst-game .xsst-shelf {
    position: absolute;
    left: 8%;
    right: 8%;
    height: 26px;
    background: var(--xs-lav-mid);
    border-radius: 4px;
    box-shadow: 0 6px 0 var(--xs-lav-dark), 0 12px 12px rgba(60, 40, 120, .18);
}

.xsst-game .xsst-shelf-1 { top: 52%; }
.xsst-game .xsst-shelf-2 { top: 72%; }

/* ---------- Targets (white cards with a lavender lid) ---------- */

.xsst-game .xsst-targets {
    position: absolute;
    inset: 0;
    z-index: 5;
}

.xsst-game .xsst-target {
    appearance: none;
    -webkit-appearance: none;
    position: absolute;
    transform: translate(-50%, -100%);
    width: 96px;
    height: 118px;
    margin: 0;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #fff;
    border: 3px solid var(--xs-lav-mid);
    border-radius: 14px;
    box-shadow: var(--xs-shadow);
    font-family: inherit;
    cursor: crosshair;
    transition: transform .12s, box-shadow .12s, border-color .12s;
}

.xsst-game .xsst-target:before {
    content: "";
    position: absolute;
    top: -12px;
    left: 50%;
    width: 68px;
    height: 14px;
    transform: translateX(-50%);
    background: var(--xs-lav-mid);
    border: 2px solid var(--xs-lav-dark);
    border-radius: 8px;
}

.xsst-game .xsst-target span {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.xsst-game .xsst-target:hover {
    border-color: var(--xs-blue);
    box-shadow: 0 6px 14px rgba(60, 40, 120, .24);
    transform: translate(-50%, -100%) scale(1.04);
}

/* Hit = solid green border + ✓; miss = dashed red border + ✗ (not colour alone) */
.xsst-game .xsst-target.hit {
    border-color: var(--xs-green);
    animation: xsst-hit .35s forwards;
}

.xsst-game .xsst-target.miss {
    border: 3px dashed var(--xs-red);
    animation: xsst-miss .28s;
}

.xsst-game .xsst-target.hit:after,
.xsst-game .xsst-target.miss:after {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    box-shadow: var(--xs-shadow);
    font-size: 16px;
    font-weight: 900;
    line-height: 26px;
    text-align: center;
}

.xsst-game .xsst-target.hit:after  { content: "\2713"; }
.xsst-game .xsst-target.miss:after { content: "\2717"; }

.xsst-game .xsst-target.disabled {
    pointer-events: none;
}

@keyframes xsst-hit {
    to { transform: translate(-50%, -100%) scale(.1) rotate(20deg); visibility: hidden; }
}

@keyframes xsst-miss {
    50% { transform: translate(-50%, -100%) translate(5px, -2px); }
}

/* ---------- Crosshair ---------- */

.xsst-game .xsst-crosshair {
    position: absolute;
    z-index: 12;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: drop-shadow(0 1px 2px #fff);
}

.xsst-game .xsst-crosshair i,
.xsst-game .xsst-crosshair b,
.xsst-game .xsst-crosshair em,
.xsst-game .xsst-crosshair strong {
    position: absolute;
    display: block;
    background: #000;
}

.xsst-game .xsst-crosshair i      { left: 16px; top: 0;    width: 2px;  height: 10px; }
.xsst-game .xsst-crosshair b      { left: 16px; bottom: 0; width: 2px;  height: 10px; }
.xsst-game .xsst-crosshair em     { top: 16px;  left: 0;   width: 10px; height: 2px; }
.xsst-game .xsst-crosshair strong { top: 16px;  right: 0;  width: 10px; height: 2px; }

/* ---------- Revolver ---------- */

.xsst-game .xsst-gun {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: -26px;
    width: 310px;
    height: 390px;
    transform: translateX(-50%) rotate(-3deg);
    pointer-events: none;
    filter: drop-shadow(0 12px 8px rgba(60, 40, 120, .3));
}

.xsst-game .xsst-revolver {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Muzzle flash: a flat solid burst (no gradient, no fade) */
.xsst-game .xsst-muzzle {
    position: absolute;
    z-index: 11;
    left: 50%;
    bottom: 346px;
    width: 60px;
    height: 70px;
    transform: translateX(-50%);
    border-radius: 50%;
    pointer-events: none;
    visibility: hidden;
}

.xsst-game .xsst-muzzle.fire {
    animation: xsst-fire .18s;
}

@keyframes xsst-fire {
    0%   { visibility: visible; background: #FFC83D; box-shadow: 0 0 0 10px #FF8A00; transform: translateX(-50%) scale(1); }
    100% { visibility: visible; background: #FFC83D; box-shadow: 0 0 0 10px #FF8A00; transform: translateX(-50%) scale(1.4); }
}

/* ---------- HIT / MISS toast (white card, black text) ---------- */

.xsst-game .xsst-feedback {
    position: absolute;
    z-index: 30;
    left: 50%;
    top: 40%;
    transform: translate(-50%, -50%);
    padding: 8px 30px;
    background: #fff;
    border: 3px solid var(--xs-green);
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(60, 40, 120, .25);
    font-size: 40px;
    font-weight: 900;
    line-height: 1.2;
    white-space: nowrap;
    visibility: hidden;
    pointer-events: none;
}

.xsst-game .xsst-feedback.show {
    visibility: visible;
    animation: xsst-feedback .75s;
}

.xsst-game .xsst-feedback.good { border: 3px solid var(--xs-green); }
.xsst-game .xsst-feedback.bad  { border: 3px dashed var(--xs-red); }

@keyframes xsst-feedback {
    0%   { transform: translate(-50%, -40%) scale(.7); }
    25%  { transform: translate(-50%, -50%) scale(1); }
    100% { transform: translate(-50%, -65%) scale(1.05); }
}

/* ---------- Start / end overlays ---------- */

.xsst-game .xsst-start,
.xsst-game .xsst-end {
    position: absolute;
    z-index: 40;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
}

.xsst-game .xsst-end[hidden] {
    display: none;
}

.xsst-game .xsst-end-card {
    min-width: 280px;
    padding: 32px 42px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 30px rgba(60, 40, 120, .3);
    text-align: center;
}

.xsst-game .xsst-end-card h2 {
    margin: 0 0 10px;
    font-size: 26px;
    font-weight: 800;
}

.xsst-game .xsst-final-score {
    font-size: 48px;
    font-weight: 900;
    line-height: 1.2;
}

.xsst-game .xsst-final-detail {
    margin: 8px 0 20px;
}

/* ---------- Blue buttons ---------- */

.xsst-game .xsst-btn {
    appearance: none;
    -webkit-appearance: none;
    margin: 0;
    padding: 13px 28px;
    background: var(--xs-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, .3);
    transition: background-color .12s ease, box-shadow .12s ease;
}

.xsst-game .xsst-btn:hover,
.xsst-game .xsst-btn:active {
    background: var(--xs-blue-dark);
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(60, 40, 120, .35);
}

.xsst-game .xsst-btn:focus-visible {
    outline: 3px solid #000;
    outline-offset: 2px;
}

/* ---------- Help line (white card) ---------- */

.xsst-game .xsst-help {
    margin-top: 14px;
    padding: 10px 16px;
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--xs-shadow);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* ---------- "No questions yet" message ---------- */

.xsst-empty {
    max-width: 1100px;
    margin: 20px auto;
    padding: 16px 20px;
    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: 700px) {
    .xsst-game {
        padding: 14px;
        border-radius: 18px;
    }

    .xsst-game .xsst-scene {
        height: 520px;
    }

    .xsst-game .xsst-hud {
        padding: 12px 14px;
    }

    .xsst-game .xsst-question {
        margin-right: 70px;
        font-size: 16px;
    }

    .xsst-game .xsst-stats {
        right: 14px;
        top: 12px;
        font-size: 12px;
    }

    .xsst-game .xsst-target {
        width: 78px;
        height: 96px;
    }

    .xsst-game .xsst-target span {
        font-size: 12px;
    }

    .xsst-game .xsst-gun {
        transform: translateX(-50%) scale(.72) rotate(-3deg);
        transform-origin: bottom center;
    }

    .xsst-game .xsst-muzzle {
        bottom: 253px;
    }

    .xsst-game .xsst-feedback {
        font-size: 30px;
        padding: 6px 20px;
    }

    .xsst-game .xsst-end-card {
        min-width: 0;
        width: 86%;
        padding: 22px 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .xsst-game .xsst-target,
    .xsst-game .xsst-btn {
        transition: none;
    }
}
