/* ================= animations (fx.js) ================= */
/* loading: bus drives along a scrolling dashed road */
.fx-loader { display: grid; justify-items: center; gap: 6px; padding: 8px 0 4px; }
.fx-loader p { margin: 0; font-size: 13px; color: var(--muted); }
.fx-road { position: relative; width: 100%; max-width: 240px; height: 44px; overflow: hidden;
  background: linear-gradient(90deg, var(--faint) 50%, transparent 0) 0 40px / 22px 2px repeat-x; animation: fx-road 0.6s linear infinite; }
.fx-bus { position: absolute; bottom: 5px; height: 32px; animation: fx-drive 2.4s cubic-bezier(0.45, 0, 0.55, 1) infinite, fx-bob 0.3s ease-in-out infinite alternate; }
@keyframes fx-road { to { background-position-x: -22px; } }
@keyframes fx-drive { from { left: -40%; } to { left: 100%; } }
@keyframes fx-bob { to { transform: translateY(-1.5px); } }

/* empty state: sleeping bus */
.fx-sleep { display: flex; align-items: center; gap: 14px; padding: 4px 0; }
.fx-sleep-art { position: relative; flex: none; width: 104px; height: 56px; }
.fx-sleep-art img { position: absolute; left: 0; bottom: 0; width: 100px; filter: saturate(0.35) brightness(0.8); }
.fx-moon { position: absolute; right: -2px; top: -4px; width: 16px; height: 16px; border-radius: 50%; box-shadow: -4px 3px 0 0 #ffd37a; transform: rotate(-20deg); }
.fx-z { position: absolute; left: 70px; bottom: 30px; font-weight: 700; color: var(--muted); opacity: 0; animation: fx-z 3s ease-in-out infinite; }
.fx-z.z1 { font-size: 10px; }
.fx-z.z2 { font-size: 12px; animation-delay: 1s; }
.fx-z.z3 { font-size: 15px; animation-delay: 2s; }
@keyframes fx-z { 0% { opacity: 0; transform: translate(0, 0); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(14px, -26px); } }
.fx-sleep-text { display: grid; gap: 2px; font-size: 15px; }
.fx-sleep-text small { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }

/* "leave now": walking figure + pulsing card + number pop */
.fx-walker { width: 26px; height: 26px; vertical-align: -3px; margin-right: 2px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; color: var(--u); }
.fx-walker circle { fill: currentColor; stroke: none; }
.fx-leg, .fx-arm { transform-origin: 11.3px 13.5px; animation: fx-swing 0.5s ease-in-out infinite alternate; }
.fx-arm { transform-origin: 12.3px 8.8px; }
.fx-leg.b, .fx-arm.a { animation-direction: alternate-reverse; }
@keyframes fx-swing { from { transform: rotate(-18deg); } to { transform: rotate(18deg); } }
.mystop-card.pulse-now { animation: fx-pulse 1.6s ease-out infinite; }
@keyframes fx-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--u) 55%, transparent); } 100% { box-shadow: 0 0 0 14px transparent; } }
.ms-big b { display: inline-block; animation: fx-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes fx-pop { from { transform: scale(0.6); opacity: 0.3; } to { transform: none; opacity: 1; } }

/* bus arriving at a stop */
.bus.fx-arrive .body { animation: fx-bounce 0.7s cubic-bezier(0.3, 1.8, 0.5, 1); }
@keyframes fx-bounce { 0% { scale: 1; } 35% { scale: 1.35; } 100% { scale: 1; } }
.fx-ripple-icon { background: none; border: none; }
.fx-ripple { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%;
  border: 3px solid var(--c); animation: fx-ring 1.2s ease-out forwards; pointer-events: none; }
.fx-ripple.r2 { animation-delay: 0.25s; opacity: 0; }
@keyframes fx-ring { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(4); opacity: 0; } }

/* launch splash (shown by splash-boot.js via html.splash-on) */
#splash { display: none; }
.splash-on #splash { display: grid; }
.fx-splash { position: fixed; inset: 0; z-index: 3000; display: grid; place-items: center; background: var(--bg); transition: opacity 0.45s; }
.fx-splash.out { opacity: 0; pointer-events: none; }
.fx-splash-inner { display: grid; justify-items: center; gap: 14px; width: min(320px, 80vw); }
.fx-splash-road { position: relative; width: 100%; height: 70px; overflow: hidden;
  background: linear-gradient(90deg, var(--accent) 60%, transparent 0) 0 66px / 26px 3px repeat-x; }
.fx-splash-road img { position: absolute; bottom: 7px; height: 56px; left: 50%; transform: translateX(-50%); animation: fx-arrive-in 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.15) both; }
@keyframes fx-arrive-in { from { transform: translateX(-190%); } to { transform: translateX(-50%); } }
.fx-splash-title { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); opacity: 0; animation: fx-fade 0.5s 0.45s forwards; }
@keyframes fx-fade { to { opacity: 1; } }

/* first-visit intro */
.fx-intro { position: fixed; inset: 0; z-index: 2500; display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); opacity: 0; animation: fx-fade 0.3s forwards; }
.fx-intro.out { animation: fx-out 0.3s forwards; }
@keyframes fx-out { from { opacity: 1; } to { opacity: 0; } }
.fx-intro-card { position: relative; width: min(360px, 100%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 22px; padding: 22px 22px 18px; box-shadow: var(--shadow); text-align: center; }
.fx-intro-card h2 { font-size: 20px; text-transform: none; letter-spacing: -0.01em; color: var(--text); margin: 14px 0 6px; font-weight: 700; }
.fx-intro-card p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.fx-intro-skip { position: absolute; top: 12px; right: 14px; border: none; background: none; color: var(--faint); cursor: pointer; font-size: 13px; }
.fx-intro-art { height: 150px; display: grid; place-items: center; }
.fx-intro-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 18px; }
.fx-dots { display: flex; gap: 6px; }
.fx-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: 0.2s; }
.fx-dots span.on { background: var(--accent); width: 20px; border-radius: 4px; }
.fx-intro-next { border: none; background: var(--accent); color: #062015; font-weight: 700; border-radius: 999px; padding: 10px 20px; cursor: pointer; font-size: 14px; }
/* slide 1: tap a stop */
.fx-i1-map { position: relative; width: 190px; height: 130px; border-radius: 16px; background: var(--line); overflow: hidden; }
.fx-i1-route { position: absolute; left: -10px; right: -10px; top: 64px; height: 6px; border-radius: 6px; background: #e9222a; transform: rotate(-12deg); }
.fx-i1-pin { position: absolute; left: 86px; top: 34px; width: 28px; height: 28px; border-radius: 50% 50% 50% 0; rotate: -45deg; background: var(--soon); display: grid; place-items: center; color: #1a1300; font-weight: 700; animation: fx-drop 2.4s ease-out infinite; }
.fx-i1-tap { position: absolute; left: 90px; top: 56px; width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--text); animation: fx-tap 2.4s ease-out infinite; }
@keyframes fx-drop { 0%, 30% { translate: 0 -40px; opacity: 0; } 45% { translate: 0 0; opacity: 1; } 100% { translate: 0 0; opacity: 1; } }
@keyframes fx-tap { 0% { transform: scale(0.4); opacity: 1; } 30% { transform: scale(1.8); opacity: 0; } 100% { opacity: 0; } }
/* slide 2: countdown card */
.fx-i2-card { width: 200px; text-align: left; border-radius: 16px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.fx-i2-card small { font-size: 10px; letter-spacing: 0.08em; color: var(--accent); font-weight: 700; }
.fx-i2-card div { font-size: 22px; font-weight: 300; margin-top: 2px; }
.fx-i2-n { display: inline-block; font-weight: 700; color: var(--accent); font-size: 28px; }
.fx-i2-n.tick { animation: fx-pop 0.45s cubic-bezier(0.3, 1.6, 0.5, 1); }
.fx-i2-bar { display: block; height: 4px; border-radius: 4px; margin-top: 10px; background: var(--accent); transform-origin: left; animation: fx-bar 5.4s linear infinite; }
@keyframes fx-bar { from { transform: scaleX(1); } to { transform: scaleX(0); } }
/* slide 3: ringing bell + notification */
.fx-i3 { display: grid; justify-items: center; gap: 12px; }
.fx-bell { width: 46px; height: 46px; fill: none; stroke: var(--soon); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transform-origin: 50% 8%; animation: fx-ring-bell 1.8s ease-in-out infinite; }
@keyframes fx-ring-bell { 0%, 50%, 100% { rotate: 0deg; } 10% { rotate: 16deg; } 20% { rotate: -14deg; } 30% { rotate: 10deg; } 40% { rotate: -6deg; } }
.fx-i3-note { display: grid; text-align: left; font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 8px 12px; animation: fx-slide 1.8s ease-out infinite; }
.fx-i3-note b { font-size: 13px; }
.fx-i3-note span { color: var(--muted); }
@keyframes fx-slide { 0% { translate: 0 -10px; opacity: 0; } 20%, 80% { translate: 0 0; opacity: 1; } 100% { opacity: 0.9; } }

@media (prefers-reduced-motion: reduce) {
  .fx-road, .fx-bus, .fx-z, .fx-leg, .fx-arm, .mystop-card.pulse-now, .ms-big b, .fx-i1-pin, .fx-i1-tap, .fx-i2-bar, .fx-bell, .fx-i3-note { animation: none !important; }
  .fx-bus { left: 40%; }
  .fx-z { opacity: 0.7; }
}
