/* ACE CARDS boot overlay, direction B "MERGE" (#acboot + boot.js). Everything here is under #acboot / acboot- and touches nothing else.
   The #acboot node itself is created by boot.js (first script in <body>); without boot.js there is no overlay.
   Timeline (s; boot.js pauses every animation and sets its currentTime each frame, so the delays below ARE the timetable):
   0.00-0.46  SLAM   two cards drive in from the screen edges and stop head to head: ours (blue) left, hostile (red) right
   0.60-1.22  LOCK   a range line runs across the gap, nose to nose; ochre lock brackets slam onto the hostile card
   1.30-2.02  MARK   rule line draws; ACE CARDS rises letter by letter; M75
   The last frame is the hold frame, the reduced-motion frame and the no-animation-API frame.
   Colours: the nine ACE CARDS tokens only (written as literals in the SVG). Type: Barlow Semi Condensed outlines (OFL), no web font. */
#acboot {
    position: fixed; inset: 0; z-index: 2147483000;
    display: flex; align-items: center; justify-content: center;
    background: #E6DFCC; overflow: hidden; cursor: default;
    transition: opacity 180ms linear;
    animation: acboot-cap 0s linear 6s forwards;          /* safety net: boot.js died after inserting the node, so get out of the way after 6 s */
}
#acboot.acboot-js { animation: none; }                    /* boot.js is driving (its own 6 s cap) */
#acboot.acboot-out { opacity: 0; pointer-events: none; }
@keyframes acboot-cap { to { visibility: hidden; opacity: 0; pointer-events: none; } }

#acboot .acboot-scene { display: block; flex: none; overflow: visible; width: min(84vw, calc(62vh * 888 / 662)); height: auto; aspect-ratio: 888 / 662; }
@supports (height: 1dvh) { #acboot .acboot-scene { width: min(84vw, calc(62dvh * 888 / 662)); } }
@media (max-aspect-ratio: 4/5) { #acboot .acboot-scene { width: min(88vw, calc(70dvh * 888 / 662)); } }
#acboot :is(.acboot-slam, .acboot-rng-l, .acboot-rng-t0, .acboot-rng-t1, .acboot-brk, .acboot-rule) { transform-box: fill-box; transform-origin: 50% 50%; }      /* only the animated elements: transform-origin would also move SVG transform attributes */

/* JS drives the clock; without the API (.acboot-final) or with reduced motion, jump straight to the last frame */
#acboot.acboot-js * { animation-play-state: paused !important; }
#acboot.acboot-final * { animation-play-state: running !important; animation-delay: -10s !important; }
@media (prefers-reduced-motion: reduce) {
    #acboot { transition: none; }
    #acboot *, #acboot.acboot-js * { animation-play-state: running !important; animation-delay: -10s !important; }
}

/* beat 1: slam (both cards drive in from off screen and settle with a small overshoot toward the centre) */
#acboot .acboot-slam { animation: acboot-slam .42s cubic-bezier(.2, .8, .3, 1) both; }
#acboot .acboot-sb { --x: -1400px; --o: 10px; animation-delay: 0s; }
#acboot .acboot-sr { --x: 1400px; --o: -10px; animation-delay: .05s; }
@keyframes acboot-slam { 0% { transform: translateX(var(--x)); } 72% { transform: translateX(var(--o)); } 100% { transform: none; } }

/* beat 2: range line (dimension-line style, drawn left to right), then the lock */
#acboot .acboot-rng-l { transform-origin: 0 50%; animation: acboot-rule .2s cubic-bezier(.3, .6, .3, 1) .62s both; }
#acboot .acboot-rng-t0 { animation: acboot-tick .08s ease-out .6s both; }
#acboot .acboot-rng-t1 { animation: acboot-tick .08s ease-out .8s both; }
@keyframes acboot-tick { from { transform: scaleY(0); } }
#acboot .acboot-brk { animation: acboot-lock .32s cubic-bezier(.3, .7, .3, 1) .9s both; }
@keyframes acboot-lock { 0% { opacity: 0; transform: scale(1.4); } 12% { opacity: 1; } 70% { opacity: 1; transform: scale(.97); } 100% { opacity: 1; transform: none; } }

/* beat 3: the mark */
#acboot .acboot-rule { transform-origin: 0 50%; animation: acboot-rule .3s cubic-bezier(.2, .7, .2, 1) 1.3s both; }
@keyframes acboot-rule { from { transform: scaleX(0); } }
#acboot .acboot-wl { animation: acboot-wl .22s cubic-bezier(.2, .7, .2, 1) both; animation-delay: calc(1.4s + var(--i) * .03s); }
@keyframes acboot-wl { from { transform: translateY(1000px); } }      /* glyph units: 1000 = 1 em, clipped at the baseline */
#acboot .acboot-m75 { animation: acboot-m75 .16s linear 1.86s both; }
@keyframes acboot-m75 { from { opacity: 0; } }
