/* ==========================================================
   V - 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.
   ========================================================== */

.zst-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;
}

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

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

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

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

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

.zst-game .zst-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;
}

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

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

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

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

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

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

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

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

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

.zst-game .zst-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);
}

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

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

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

.zst-game .zst-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;
}

.zst-game .zst-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;
}

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

.zst-game .zst-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) */
.zst-game .zst-target.hit {
    border-color: var(--xs-green);
    animation: zst-hit .35s forwards;
}

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

.zst-game .zst-target.hit:after,
.zst-game .zst-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;
}

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

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

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

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

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

.zst-game .zst-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);
}

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

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

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

.zst-game .zst-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));
}

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

/* Muzzle flash: a flat solid burst (no gradient, no fade) */
.zst-game .zst-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;
}

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

@keyframes zst-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) ---------- */

.zst-game .zst-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;
}

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

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

@keyframes zst-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 ---------- */

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

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

.zst-game .zst-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;
}

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

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

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

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

.zst-game .zst-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;
}

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

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

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

.zst-game .zst-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 ---------- */

.zst-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) {
    .zst-game {
        padding: 14px;
        border-radius: 18px;
    }

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

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

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

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

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

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

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

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

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

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

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

/* ---------- V Series: SUBMIT on the end card ---------- */
.zst-game .zst-end-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}
.zst-game .zst-btn:disabled {
    opacity: .6;
    cursor: default;
}
.zst-game .zst-submit-msg {
    margin-top: 12px;
    font-size: 14px;
    font-weight: 700;
}

/* Z - SHOOT: exam mode. Shots are neutral (no right/wrong shown before Final Submit). */
.zst-game .zst-target.shot { outline: 4px solid #8B7CF6; outline-offset: 2px; }
.zst-game .zst-target.shot:after { content: "\25CF"; position: absolute; top: -8px; right: -8px; width: 26px; height: 26px; background: #fff; border-radius: 50%; line-height: 26px; text-align: center; color: #5B4BD6; font-size: 14px; }
.zst-game .zst-feedback.neutral { border: 3px solid #8B7CF6; }
.zst-game .zst-btn-ghost { background: #fff !important; color: #2A2457 !important; }
