/* ─── Container ─────────────────────────────────────────────────────── */
#game-root .jm-wrap {
    padding: 0.75rem;
    max-width: 460px;
    margin: 0 auto;
    background: linear-gradient(180deg, #2a1010 0%, #5a1818 100%);
    border-radius: var(--jul-radius-lg, 20px);
    user-select: none;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

/* ─── HUD: pill cards ───────────────────────────────────────────────── */
#game-root .jm-header {
    display: flex; align-items: stretch; gap: 0.4rem;
    margin-bottom: 0.6rem;
}
#game-root .jm-pill {
    flex: 1 1 0; min-width: 0;
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.35rem 0.7rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18);
}
#game-root .jm-pill-icon {
    font-size: 1.4rem; line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}
#game-root .jm-pill-body { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
#game-root .jm-lbl {
    display: block;
    font-size: 0.62rem; letter-spacing: 0.08em;
    color: #8a5a1a; text-transform: uppercase; font-weight: 700;
}
#game-root .jm-val {
    font-size: 1.35rem; font-weight: 800;
    color: var(--jul-red-700, #8B0000);
    font-variant-numeric: tabular-nums;
    text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}

/* Audio control as a tight pill on the right */
#game-root .jm-audio {
    display: flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.55rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18);
}
#game-root .jm-mute {
    background: transparent; border: 0;
    width: 28px; height: 28px; cursor: pointer;
    font-size: 1rem; padding: 0;
    flex: 0 0 auto;
}
#game-root .jm-vol {
    width: 64px; cursor: pointer;
    accent-color: var(--jul-red-700, #8B0000);
}

/* ─── Canvas ────────────────────────────────────────────────────────── */
#game-root .jm-canvas-wrap {
    position: relative;
    border: 3px solid #ffd66b;
    border-radius: 10px; overflow: hidden;
    aspect-ratio: 400/600; max-width: 100%;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.4), inset 0 0 18px rgba(0,0,0,0.35);
}
#game-root #jm-canvas {
    display: block; width: 100%; height: auto;
    touch-action: none;
    background: #1a3a5f;
}

/* Center-screen WIN-only toast (no longer at the top blocking drops) */
#game-root .jm-win-toast {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    padding: 0.9rem 1.6rem; border-radius: 16px;
    font-weight: 800; font-size: 1.4rem;
    color: #2a1500; background: #ffdd44;
    box-shadow: 0 8px 28px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.8);
    border: 2px solid #b8870b;
    pointer-events: none;
    animation: jm-win-pop 0.45s cubic-bezier(.34,1.56,.64,1);
    white-space: nowrap;
}
@keyframes jm-win-pop {
    0%   { transform: translate(-50%, -50%) scale(0.3) rotate(-8deg); opacity: 0; }
    60%  { transform: translate(-50%, -50%) scale(1.1) rotate(2deg);  opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1)   rotate(0);     opacity: 1; }
}

/* ─── Tier-ladder dots ──────────────────────────────────────────────── */
#game-root .jm-ladder {
    display: flex; justify-content: space-between; align-items: center;
    gap: 4px;
    margin: 0.55rem 0.25rem 0.55rem;
    padding: 0.4rem 0.55rem;
    background: rgba(0,0,0,0.22);
    border-radius: 999px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.45);
}
#game-root .jm-dot {
    flex: 1 1 0;
    height: 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.4);
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}
#game-root .jm-dot.jm-dot--lit {
    background: var(--tier-color, #ffdd44);
    box-shadow: 0 0 8px var(--tier-color, #ffdd44), inset 0 1px 0 rgba(255,255,255,0.4);
}
#game-root .jm-dot.jm-dot--pulse {
    animation: jm-dot-pulse 0.7s ease-out;
}
@keyframes jm-dot-pulse {
    0%   { transform: scaleY(1); }
    40%  { transform: scaleY(2.4); }
    100% { transform: scaleY(1); }
}

/* ─── Footer previews (sprite + label cards) ────────────────────────── */
#game-root .jm-footer {
    display: flex; justify-content: space-between; align-items: stretch;
    gap: 0.4rem;
}
#game-root .jm-preview {
    flex: 1 1 0; min-width: 0;
    display: flex; align-items: center; gap: 0.55rem;
    padding: 0.4rem 0.7rem 0.4rem 0.4rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(0,0,0,0.12);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18);
}
#game-root .jm-preview-canvas {
    width: 44px; height: 44px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: radial-gradient(circle at 50% 40%, #fff 0%, #fbf0c8 100%);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.18);
}
#game-root .jm-preview-body { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
#game-root .jm-preview-name {
    font-weight: 700; font-size: 0.9rem;
    color: var(--jul-red-700, #8B0000);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#game-root .jm-preview--flash {
    animation: jm-preview-flash 0.7s ease-out;
}
@keyframes jm-preview-flash {
    0%   { box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18), 0 0 0 0 rgba(255,221,68,0); }
    30%  { box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 4px 18px rgba(0,0,0,0.3), 0 0 0 6px rgba(255,221,68,0.55); transform: scale(1.04); }
    100% { box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), 0 2px 4px rgba(0,0,0,0.18), 0 0 0 0 rgba(255,221,68,0); transform: scale(1); }
}

/* ─── End screen ────────────────────────────────────────────────────── */
#game-root .jm-end {
    text-align: center; padding: 1rem; margin-top: 1rem;
    background: linear-gradient(180deg, #fff8e1 0%, #fbf0c8 100%);
    border: 1px solid rgba(0,0,0,0.15);
    border-radius: 14px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25);
}
#game-root .jm-end h2 { color: var(--jul-red-700, #8B0000); margin: 0 0 0.5rem; }
#game-root .jm-end .jul-btn { margin: 0.25rem; }
