/*
 * Drawn motifs (parts/motif-art.php: operations, supply, research). Same vocabulary as the
 * timeline scenes: rounded data cells, nodes and lines; blurple marks what matters. The
 * drawing plays once when assets/js/motifs.js adds is-playing; until then, without scripts
 * and under reduced motion it shows its final state. Parts: pa-pop, pa-rise (grows from its
 * base), pa-draw (stroke draws; stroke-dashoffset paints inside the box, never moves layout),
 * pa-spin (a reel symbol drops in); --t is each part's delay. Once played (is-done), a
 * hover on the drawing or its practice card replays the data part (--h: hover delay).
 */
.rm-motif--art {
    display: grid;
    place-items: center;
}

.rm-practice__media .rm-motif--art {
    display: inline-grid;
    max-width: 52%;
    border-radius: 32px;
    vertical-align: middle;
}

@media (max-width: 767px) {
    .rm-practice__media .rm-motif--art {
        max-width: 72%;
    }
}

.rm-motif-art {
    display: block;
    width: 100%;
    height: 100%;
}

.rm-motif-art * {
    transform-box: fill-box;
    transform-origin: center;
}

.pa-machine,
.pa-tile,
.pa-bar {
    fill: var(--rm-blurple-medium);
}

.pa-machine--on,
.pa-bar--a,
.pa-spot,
.pa-symbol--a,
.pa-dot {
    fill: var(--rm-blurple);
}

.pa-panel,
.pa-screen,
.pa-glass {
    fill: var(--rm-white);
}

.pa-deck {
    fill: #3A3A3A;
}

.pa-cabinet,
.pa-base,
.pa-symbol {
    fill: var(--rm-black);
}

.pa-reel {
    fill: var(--rm-lavender);
}

.pa-topper {
    fill: var(--rm-black);
}

.pa-topper-light,
.pa-button--a {
    fill: var(--rm-blurple);
}

.pa-faint {
    fill: var(--rm-blurple-medium);
}

.pa-payline {
    fill: none;
    stroke: var(--rm-blurple);
    stroke-width: 1.5;
    stroke-dasharray: 3 3;
}

.pa-button {
    fill: var(--rm-white);
}

.pa-panel-low {
    fill: #3A3A3A;
}

.pa-slot {
    fill: none;
    stroke: var(--rm-grey);
    stroke-width: 3;
    stroke-linecap: round;
}


.pa-market {
    fill: #A9A4F8;
}

.pa-draw {
    fill: none;
    stroke-dasharray: 1;
    stroke-linecap: round;
}

.pa-feed {
    stroke: var(--rm-blurple);
    stroke-width: 2;
    stroke-dasharray: 1;
}

.pa-goal {
    stroke: var(--rm-black);
    stroke-width: 2;
}

.pa-route {
    stroke: var(--rm-black);
    stroke-width: 3;
}

.pa-contour {
    stroke: var(--rm-blurple-medium);
    stroke-width: 2;
}

.pa-axis {
    stroke: var(--rm-blurple-medium);
    stroke-width: 3;
}

.pa-rim,
.pa-handle {
    fill: none;
    stroke: var(--rm-black);
    stroke-width: 10;
    stroke-linecap: round;
}

.pa-ring {
    fill: none;
    stroke: var(--rm-blurple);
    stroke-width: 2;
    opacity: 0;
}

.pa-rise {
    transform-origin: center bottom;
}

.is-playing .pa-pop {
    animation: rm-pa-pop 600ms var(--rm-ease) both;
    animation-delay: var(--t, 0ms);
}

.is-playing .pa-rise {
    animation: rm-pa-rise 800ms var(--rm-ease) both;
    animation-delay: var(--t, 0ms);
}

.is-playing .pa-draw {
    animation: rm-pa-draw 1100ms var(--rm-ease-swap) both;
    animation-delay: var(--t, 0ms);
}

.is-playing .pa-spin {
    animation: rm-pa-spin 900ms var(--rm-ease) both;
    animation-delay: var(--t, 0ms);
}

.is-playing .pa-ring {
    animation: rm-pa-ring 1400ms var(--rm-ease) both;
    animation-delay: var(--t, 0ms);
}

.is-playing .pa-lens-in {
    animation: rm-pa-lens 1300ms var(--rm-ease) 700ms both;
}

:where(.rm-practice:hover) .rm-motif--art.is-done .pa-rise,
.rm-motif--art.is-done:hover .pa-rise {
    animation: rm-pa-rehover 700ms var(--rm-ease) both;
    animation-delay: var(--h, 0ms);
}

:where(.rm-practice:hover) .rm-motif--art.is-done .pa-feed,
:where(.rm-practice:hover) .rm-motif--art.is-done .pa-route,
.rm-motif--art.is-done:hover .pa-feed,
.rm-motif--art.is-done:hover .pa-route {
    animation: rm-pa-redraw 800ms var(--rm-ease-swap) both;
}

:where(.rm-practice:hover) .rm-motif--art.is-done .pa-spin,
.rm-motif--art.is-done:hover .pa-spin {
    animation: rm-pa-respin 700ms var(--rm-ease) both;
    animation-delay: var(--h, 0ms);
}

:where(.rm-practice:hover) .rm-motif--art.is-done .pa-ring,
.rm-motif--art.is-done:hover .pa-ring {
    animation: rm-pa-ring 1400ms var(--rm-ease) 700ms both;
}

:where(.rm-practice:hover) .rm-motif--art.is-done .pa-lens,
.rm-motif--art.is-done:hover .pa-lens {
    animation: rm-pa-scan 1300ms var(--rm-ease-swap) both;
}

@keyframes rm-pa-rehover {
    from { transform: scaleY(.15); }
}

@keyframes rm-pa-redraw {
    from { stroke-dashoffset: 1; }
}

@keyframes rm-pa-respin {
    from { opacity: 0; transform: translateY(-40px); }
    30% { opacity: 1; }
}

@keyframes rm-pa-scan {
    35% { transform: translate(-10px, 6px); }
    70% { transform: translate(8px, -4px); }
}

@keyframes rm-pa-pop {
    from { opacity: 0; transform: scale(.5); }
}

@keyframes rm-pa-rise {
    from { transform: scaleY(0); }
}

@keyframes rm-pa-draw {
    from { stroke-dashoffset: 1; }
}

@keyframes rm-pa-spin {
    from { opacity: 0; transform: translateY(-60px); }
    30% { opacity: 1; }
}

@keyframes rm-pa-ring {
    from { opacity: .9; transform: scale(1); }
    to { opacity: 0; transform: scale(3); }
}

@keyframes rm-pa-lens {
    from { opacity: 0; transform: translate(-90px, 110px) scale(.8); }
    40% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .rm-motif-art * {
        animation: none !important;
    }
}

/* Supply and demand glyphs (rm_theme_sd_cabinet() / rm_theme_sd_player() in inc/content.php):
   supply is always slot cabinets, demand always players. The outer group only places the
   glyph, so it keeps the SVG's own origin whatever transform-box the drawing sets. */
svg .rm-sd-pos {
    transform-box: view-box;
    transform-origin: 0 0;
}

.rm-sd-cabinet__body,
.rm-sd-cabinet__base {
    fill: var(--rm-black);
}

.rm-sd-cabinet__screen {
    fill: var(--rm-white);
}

.rm-sd-cabinet__topper,
.rm-sd-cabinet__symbol {
    fill: var(--rm-blurple);
}

.rm-sd-cabinet__deck {
    fill: #6A6A6A;
}

.rm-sd-player {
    fill: var(--rm-blurple);
}

.rm-sd-player--muted {
    fill: #A9A4F8;
    opacity: .55;
}
