/* Finder FX: the motion for the diagnosis games. Independent of the site: it only uses the data-fx hooks described in
   finder-fx.js and its own --finder-* variables (each with a default), so the Japanese pages can load it with their
   own layout. Every animation sits in prefers-reduced-motion: no-preference, and a reduce block switches all of it
   off again. Nothing here changes layout, so the page reads the same with the file removed. */
[data-fx="reveal"] { position: relative; }
[dir="rtl"] [data-fx="root"], [dir="rtl"][data-fx="root"] { --finder-dir: -1; }

@keyframes fx-slide-in { from { opacity: 0; transform: translateX(calc(var(--finder-dir, 1) * var(--finder-slide, 28px))); } to { opacity: 1; transform: none; } }
@keyframes fx-slide-back { from { opacity: 0; transform: translateX(calc(var(--finder-dir, 1) * var(--finder-slide, 28px) * -1)); } to { opacity: 1; transform: none; } }
@keyframes fx-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes fx-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes fx-listen { 0% { transform: scale(1); } 40% { transform: scale(1.07) rotate(-3deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes fx-nod { 0%, 100% { transform: translateY(0); } 25% { transform: translateY(5px); } 50% { transform: translateY(0); } 75% { transform: translateY(4px); } }
@keyframes fx-think { 0% { transform: rotate(0); } 60%, 100% { transform: rotate(-7deg); } }
@keyframes fx-shrug { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-4px) rotate(-3deg); } 60% { transform: translateX(4px) rotate(3deg); } }
@keyframes fx-pop { 0% { transform: scale(.96); } 60% { transform: scale(1.03); } 100% { transform: scale(1); } }
@keyframes fx-spark { from { opacity: 1; transform: rotate(var(--fx-a, 0deg)) translateX(0) scale(1); } to { opacity: 0; transform: rotate(var(--fx-a, 0deg)) translateX(var(--finder-burst, 48px)) scale(.3); } }

@media (prefers-reduced-motion: no-preference) {
  [data-fx="fill"] { transition: inline-size .5s cubic-bezier(.2, .8, .2, 1); }
  .fx-in-forward { animation: fx-slide-in .28s ease-out both; }
  .fx-in-back { animation: fx-slide-back .28s ease-out both; }
  .fx-reveal [data-fx="item"] { animation: fx-rise .45s ease-out both; animation-delay: calc(var(--fx-i, 0) * 70ms); }
  [data-fx="mascot"] > img { animation: fx-float 4.5s ease-in-out infinite; }
  [data-fx="mascot"][data-mood="listen"] > img { animation: fx-listen .5s ease-out 1; }
  [data-fx="mascot"][data-mood="nod"] > img { animation: fx-nod .7s ease-in-out 1; }
  [data-fx="mascot"][data-mood="think"] > img { animation: fx-think .6s ease-out 1 forwards; }
  [data-fx="mascot"][data-mood="shrug"] > img { animation: fx-shrug .7s ease-in-out 1; }
  [data-fx="opt"] input:checked ~ * { animation: fx-pop .24s ease-out 1; }
  .fx-burst { position: absolute; inset-inline-start: 1.1rem; inset-block-start: .8rem; inline-size: 0; block-size: 0; pointer-events: none; }
  .fx-spark { position: absolute; inset-inline-start: -4px; inset-block-start: -4px; inline-size: 8px; block-size: 8px; border-radius: 50%; background: var(--finder-spark, #f2c14e); animation: fx-spark .9s ease-out both; }
}
@media (prefers-reduced-motion: reduce) {
  [data-fx], [data-fx] *, .fx-burst, .fx-burst * { animation: none !important; transition: none !important; }
  .fx-burst { display: none !important; }
}
[data-fx="root"][data-motion="off"], [data-fx="root"][data-motion="off"] * { animation: none !important; transition: none !important; }
