/* D-PAD motion (2026-11-16) — styles for js/dpad-motion.js.
   Everything is scoped to html.dm-on, which the script only sets when
   motion is on for this device (?motion=0 turns it off). */

/* 1 · plane on the pass: the middle of YOU ✈ CODE becomes a track */
html.dm-on .dw-scope .dw-aw-route.dm-route { grid-template-columns: auto 1fr auto; column-gap: 10px; }
html.dm-on .dw-scope .dm-route .dw-aw-plane { position: relative; align-self: center; height: 28px; margin: 0 0 18px; padding: 0; min-width: 40px; --f: 0; }
html.dm-on .dw-scope .dm-route .dw-aw-plane::before { content: ""; position: absolute; left: 2px; right: 2px; top: 50%;
    border-top: 1.5px dashed currentColor; opacity: .35; }
html.dm-on .dw-scope .dm-route .dm-trail { position: absolute; left: 2px; top: 50%; height: 2px; margin-top: -1px; border-radius: 1px;
    background: var(--dm-plane, #FFD93D); width: calc((100% - 26px) * var(--f)); }
html.dm-on .dw-scope .dm-route .dm-pl { position: absolute; top: 50%; left: calc((100% - 26px) * var(--f)); transform: translateY(-50%);
    font: 400 24px/1 sans-serif; color: var(--dm-plane, #FFD93D); }
html.dm-on .dw-scope .dm-route .dw-aw-plane.dm-go .dm-pl { transition: left .9s cubic-bezier(.22,1,.36,1); }
html.dm-on .dw-scope .dm-route .dw-aw-plane.dm-go .dm-trail { transition: width .9s cubic-bezier(.22,1,.36,1); }
html.dm-on .dw-scope .dm-route.dm-landed .dw-aw-to b { color: #FFD93D; }
html.dm-on .dw-scope .dm-route.dm-landed.dm-arriving .dw-aw-to b { animation: dmPop .6s cubic-bezier(.22,1,.36,1); }
@keyframes dmPop { 40% { transform: scale(1.15); } }

/* 2 · ink stamp — STAMPED on an earned pass */
html.dm-on .dw-scope .dw-aw-hero, html.dm-on .dw-scope .dw-lv { position: relative; }
html.dm-on .dm-ink { position: absolute; right: 6%; bottom: 8%; rotate: -11deg; z-index: 3; pointer-events: none;
    border: 3px solid var(--dm-ink, #FFD93D); border-radius: 9px; padding: 5px 11px; color: var(--dm-ink, #FFD93D); background: rgba(0, 0, 0, .28);
    font: 900 15px/1.1 var(--font-ui, 'Figtree', sans-serif); letter-spacing: .14em; text-align: center;
    animation: dmThump .5s cubic-bezier(.22,1,.36,1) .35s both; }
html.dm-on .dm-ink small { display: block; font: 700 8.5px var(--font-mono, 'JetBrains Mono', monospace); letter-spacing: .1em; }
html.dm-on .dm-ink.still { animation: none; }
@keyframes dmThump { 0% { scale: 2; opacity: 0; } 70% { scale: .96; opacity: 1; } 100% { scale: 1; opacity: .95; } }

/* 2 · ink stamp — CHECKED IN on place-card rows (span added in poi-ring.js) */
:is(.pc-pop, .pc-scope) .pc-ink { display: none; }
html.dm-on :is(.pc-pop, .pc-scope) .pc-ink { display: block; position: absolute; right: 30px; top: 50%; translate: 0 -50%; rotate: -9deg;
    border: 2.5px solid var(--dm-ink-pc, #27ae60); color: var(--dm-ink-pc, #27ae60); background: rgba(255, 255, 255, .85); border-radius: 7px; padding: 3px 7px;
    font: 900 10px var(--font-ui, 'Figtree', sans-serif); letter-spacing: .1em; opacity: 0; pointer-events: none; }
html.dm-on :is(.pc-pop, .pc-scope) .pc-row.done .pc-ink { animation: dmThump .45s cubic-bezier(.22,1,.36,1) forwards; }
html.dm-on :is(.pc-pop, .pc-scope) .pc-row.done .pc-punch { display: none; }

/* 3 · Miles: the pill glows and "+N" floats off it */
html.dm-on .currency-chip.dm-glow { box-shadow: 0 0 0 2px #FFD93D, 0 0 22px rgba(255, 217, 61, .45); transition: box-shadow .3s; }
html.dm-on .dm-plus { position: absolute; right: 8px; top: calc(100% + 4px); z-index: 5; pointer-events: none; white-space: nowrap;
    font: 800 12px/1 var(--font-ui, 'Figtree', sans-serif); color: #FFD93D; background: rgba(15, 15, 35, .88);
    padding: 3px 7px; border-radius: 10px; box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    animation: dmFloat 2.6s cubic-bezier(.22,1,.36,1) forwards; }
@keyframes dmFloat { 0% { opacity: 0; transform: translateY(-6px); } 12% { opacity: 1; transform: none; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(3px); } }

/* 5 · a task that's just been done: struck through, tick pops */
html.dm-on .dw-scope .dw-tasks li.dm-justdone > span { position: relative; }
html.dm-on .dw-scope .dw-tasks li.dm-justdone > span::after { content: ""; position: absolute; left: 0; top: 50%; height: 2px;
    background: #FFD93D; width: 100%; transform-origin: left; animation: dmStrike .5s cubic-bezier(.22,1,.36,1) .3s both, dmFade .6s ease 1.6s forwards; }
html.dm-on .dw-scope .dw-tasks li.dm-justdone > i { animation: dmPop .5s cubic-bezier(.22,1,.36,1) .2s; }
@keyframes dmStrike { from { transform: scaleX(0); } }
@keyframes dmFade { to { opacity: 0; } }

/* 5 · Your passes: a new card slides in */
html.dm-on .hbs-lane .dm-enter { animation: dmSlide .7s cubic-bezier(.22,1,.36,1); }
@keyframes dmSlide { from { transform: translateX(-60px) rotate(-4deg); opacity: 0; } }

/* 6 · Welcome to… */
.dm-wel { position: fixed; inset: 0; z-index: 100000; display: grid; place-items: center; text-align: center; padding: 24px;
    background: radial-gradient(ellipse at 50% 30%, #2a2340, #0f0f23 70%); color: #fff; cursor: pointer; animation: dmIn .3s ease; }
.dm-wel h2 { margin: 0; font: 900 clamp(38px, 11vw, 64px)/1 var(--font-ui, 'Figtree', sans-serif); letter-spacing: -.02em; }
.dm-wel .w { display: inline-block; opacity: 0; transform: translateY(26px); filter: blur(8px); animation: dmWord .8s cubic-bezier(.22,1,.36,1) forwards; }
.dm-wel .w.g { color: #FFD93D; }
.dm-wel p { margin: 14px 0 0; font: 600 15px var(--font-ui, 'Figtree', sans-serif); color: rgba(255, 255, 255, .7);
    opacity: 0; animation: dmUp .7s cubic-bezier(.22,1,.36,1) .9s forwards; }
.dm-wel.out h2 { animation: dmOutR .6s cubic-bezier(.22,1,.36,1) forwards; }
.dm-wel.out p { opacity: 1; animation: dmOutL .6s cubic-bezier(.22,1,.36,1) .05s forwards; }
.dm-wel.out { animation: dmOut .35s ease .4s forwards; }
@keyframes dmIn { from { opacity: 0; } }
@keyframes dmOut { to { opacity: 0; } }
@keyframes dmWord { to { opacity: 1; transform: none; filter: none; } }
@keyframes dmUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes dmOutR { to { transform: translateX(110vw); opacity: 0; } }
@keyframes dmOutL { to { transform: translateX(-110vw); opacity: 0; } }

/* 7 · ready to claim: a full barcode draws in above the button */
html.dm-on .dw-scope .dw-aw-code.dm-ready { flex-direction: column; gap: 10px; }
html.dm-on .dw-scope .dw-aw-code.dm-ready > * { box-sizing: border-box; width: 100%; }
html.dm-on .dw-scope .dm-bc .dw-bar i { transform-origin: bottom; animation: dmBar .45s cubic-bezier(.22,1,.36,1) both;
    animation-delay: calc(var(--k) * 22ms + .3s); }
html.dm-on .dw-scope .dm-bc.still .dw-bar i { animation: none; }
html.dm-on .dw-scope .dm-bc small { color: #27ae60 !important; }
@keyframes dmBar { from { transform: scaleY(0); } }
html.dm-on .dw-scope .dw-aw-flag.dm-ok { background: #27ae60; color: #fff; animation: dmPop .5s cubic-bezier(.22,1,.36,1); }

@media (prefers-reduced-motion: reduce) {
    html.dm-on *, .dm-wel, .dm-wel * { animation-duration: .01s !important; animation-delay: 0s !important; transition-duration: .01s !important; }
}
