/*
 * motion.css — アニメーションのみ。
 * config.php の各 true / false、ミリ秒設定で全体を管理します。
 * OSの「視差効果を減らす」設定を優先。光はゆっくり明滅し、急な点滅は使いません。
 */
.gold-button, .dark-button, .answer-button, .text-button, .skip-link { transition: filter .2s ease, background-color .2s ease, border-color .2s ease, color .2s ease, opacity .2s ease; }
.hero-art { animation: dragon-drift 9s ease-in-out infinite; transform-origin: 55% 0%; will-change: transform; }
.gold-dust span { animation: dust-rise var(--duration, 12s) linear var(--delay, 0s) infinite; }
.gold-dust .dust-star { animation-name: star-rise; }
.ritual-sparkles i { animation: ritual-twinkle var(--duration, 2.8s) ease-in-out var(--delay, 0s) infinite; }

.gold-button::after { transform: rotate(20deg) translateX(-250%); animation: gold-sheen 3.8s ease-in-out infinite; }
.line-button { animation: sacred-breathe 3.2s ease-in-out infinite; }
.stage.is-entering { animation: stage-enter .65s cubic-bezier(.18,.7,.25,1) both; }
.question-card { transition: opacity .22s ease, transform .22s ease; }
.question-card.is-changing { opacity: 0; transform: translateY(-8px); }
.answer-button { animation: answer-enter .42s ease both; }
.answer-button:nth-child(2) { animation-delay: .06s; }
.answer-button:nth-child(3) { animation-delay: .12s; }
.answer-button:nth-child(4) { animation-delay: .18s; }
.answer-button.is-selected { animation: selected-answer .42s ease both; }
.question-dots span { transition: background-color .35s ease; }

.summon-crystal { animation: crystal-float 4.6s ease-in-out infinite; }
.crystal-aura { animation: crystal-aura-breathe 4.2s ease-in-out infinite; }
.crystal-core { animation: halo-breathe 3.6s ease-in-out infinite; }
.crystal-orbit { animation: crystal-orbit-drift 7s ease-in-out infinite; }
.summon-crystal.is-charging { animation: crystal-awaken var(--crystal-duration, 1500ms) cubic-bezier(.24,.6,.3,1) both; }
.crystal-summoning .entry-block::before { animation: crystal-backdrop .45s ease-out both; }
.summon-crystal.is-charging .ritual-sparkles i { animation: ritual-spark-burst var(--crystal-duration, 1500ms) cubic-bezier(.16,.7,.3,1) var(--burst-delay, 0s) both; }
.exit-crystal { animation: exit-crystal-pulse 3s ease-in-out infinite; }
.exit-crystal .crystal-aura { animation: exit-aura-pulse 3s ease-in-out infinite; }
.exit-crystal .crystal-burst { animation: exit-ray-pulse 4.8s ease-in-out infinite; }
.exit-crystal .crystal-core { animation: exit-core-pulse 3s ease-in-out infinite; }
.exit-crystal .crystal-sphere { transition: box-shadow .2s ease, border-color .2s ease; }
.exit-crystal-flight .exit-flight-orb.is-charging { animation: exit-flight-approach var(--crystal-duration, 1500ms) cubic-bezier(.24,.6,.3,1) both; }
.exit-crystal-flight .exit-flight-shade { animation: crystal-backdrop .35s ease-out both; }
.exit-crystal-flight .exit-flight-orb, .exit-flight-caption { transition: opacity .25s ease; }

.summon-crystal.is-charging .crystal-aura { animation: crystal-aura-expand var(--crystal-duration, 1500ms) ease-in both; }
.summon-crystal.is-charging .crystal-core { animation: crystal-core-light var(--crystal-duration, 1500ms) ease-in both; }
.summon-crystal.is-charging .crystal-orbit { animation: crystal-orbit-open var(--crystal-duration, 1500ms) ease-in-out both; }
.summon-crystal.is-charging .crystal-burst { animation: crystal-light-release var(--crystal-duration, 1500ms) ease-in both; }

.wish-target { animation: ritual-float 4.4s ease-in-out infinite; }
.wish-halo { animation: halo-breathe 3.8s ease-in-out infinite; }
.wish-rays { animation: wish-rays-idle 13s linear infinite; }

.wish-touch { animation: touch-breathe 2.8s ease-in-out infinite; }
.wish-target.is-touched { animation: wish-accept var(--wish-duration, 1100ms) ease-in-out both; pointer-events: none; }
.wish-target.is-touched .wish-ripple { animation: wish-wave var(--wish-duration, 1100ms) ease-out both; }
.wish-target.is-touched .wish-ripple-outer { animation-name: wish-outer-wave; }
.wish-target.is-touched .wish-rays { animation: wish-rays-release var(--wish-duration, 1100ms) ease-out both; }
.wish-target.is-touched .ritual-sparkles i { animation: ritual-spark-burst var(--wish-duration, 1100ms) cubic-bezier(.15,.65,.3,1) var(--burst-delay, 0s) both; }

.wish-target.is-touched .wish-touch { opacity: 0; animation: none; transition: opacity .25s ease; }
.stage-wish.is-received .wish-status { animation: received-message .7s ease both; }
.advisor-result-portrait { animation: advisor-portrait-enter .8s ease both; }
.advisor-result-name, .advisor-result-subtitle { animation: advisor-message-enter .8s .18s ease both; }
.summon-overlay.is-active { animation: summon-stage 2.4s ease both; }
.summon-overlay.is-active .summon-circle { animation: summon-ring 2.4s cubic-bezier(.2,.7,.35,1) both; }
.summon-overlay.is-active .summon-ray { animation: summon-rays 2.4s ease both; }
.summon-overlay.is-active .summon-aureole { animation: summon-aureole 2.4s ease both; }
.summon-overlay.is-active .summon-dragon { animation: dragon-manifest 2.4s cubic-bezier(.18,.55,.3,1) both; }
.summon-overlay.is-active .summon-dragon-light { animation: dragon-illumination 2.4s ease both; }
.summon-overlay.is-active .summon-mist { animation: summon-mist-part 2.4s ease both; }
.summon-overlay.is-active .summon-flare { animation: summon-final-glow 2.4s ease both; }
.summon-overlay.is-active .summon-symbol { animation: summon-letter 2.4s ease both; }
.summon-overlay.is-active p { animation: summon-copy 2.4s ease both; }
.summon-overlay.is-active, .summon-overlay.is-active .summon-circle, .summon-overlay.is-active .summon-ray, .summon-overlay.is-active .summon-aureole, .summon-overlay.is-active .summon-dragon, .summon-overlay.is-active .summon-dragon-light, .summon-overlay.is-active .summon-mist, .summon-overlay.is-active .summon-flare, .summon-overlay.is-active .summon-symbol, .summon-overlay.is-active p { animation-duration: var(--summon-duration, 2.4s); }
.view-veil { transition: opacity .32s ease; }
.modal-backdrop.is-open { animation: overlay-in .2s ease both; }
.modal-backdrop.is-open .modal-panel { animation: modal-in .3s cubic-bezier(.17,.75,.3,1) both; }
.modal-backdrop.is-open.is-crystal-active .modal-panel { animation: none; }
.toast { animation: toast-in .25s ease both; }

@keyframes dragon-drift { 0%,100% { transform: scale(1.025) translateY(0); } 50% { transform: scale(1.045) translateY(-5px); } }
@keyframes dust-rise { 0% { transform: translate3d(0,0,0); opacity: 0; } 12% { opacity: .72; } 42% { opacity: .45; } 66% { opacity: .7; } 90% { opacity: .24; } 100% { transform: translate3d(var(--sway, 24px),-112vh,0); opacity: 0; } }
@keyframes star-rise { 0% { transform: translate3d(0,0,0) scale(.4) rotate(0); opacity: 0; } 15% { opacity: .38; } 30% { opacity: .74; } 48% { opacity: .17; } 66% { opacity: .65; } 84% { opacity: .2; } 100% { transform: translate3d(var(--sway, -22px),-112vh,0) scale(.9) rotate(25deg); opacity: 0; } }
@keyframes ritual-twinkle { 0%,100% { opacity: .12; transform: translateY(4px) scale(.35) rotate(-8deg); } 48% { opacity: .9; transform: translateY(-4px) scale(.85) rotate(8deg); } }
@keyframes ritual-spark-burst { 0% { opacity: .3; transform: translate(0,0) scale(.45); } 25% { opacity: 1; } 65% { opacity: .95; } 100% { opacity: 0; transform: translate(var(--dx, 50px),var(--dy, -50px)) scale(1.55) rotate(40deg); } }

@keyframes gold-sheen { 0%,60% { transform: rotate(20deg) translateX(-250%); opacity: 0; } 64% { opacity: .8; } 88% { transform: rotate(20deg) translateX(730%); opacity: .5; } 100% { transform: rotate(20deg) translateX(730%); opacity: 0; } }
@keyframes sacred-breathe { 0%,65%,100% { transform: translateY(0); } 77% { transform: translateY(-4px); } 87% { transform: translateY(0); } 93% { transform: translateY(-1px); } }
@keyframes stage-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes answer-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes selected-answer { 0% { transform: scale(1); } 45% { transform: scale(.984); } 100% { transform: scale(1); } }

@keyframes crystal-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes crystal-aura-breathe { 0%,100% { opacity: .6; transform: scale(.95); } 50% { opacity: .9; transform: scale(1.06); } }
@keyframes crystal-orbit-drift { 0%,100% { transform: rotate(-18deg); opacity: .65; } 50% { transform: rotate(-9deg); opacity: .9; } }
@keyframes crystal-awaken {
  0% { transform: translate3d(0,0,0) scale(1); filter: brightness(1); }
  16% { transform: translate3d(0,4px,0) scale(.94); filter: brightness(1.1); }
  76% { transform: translate3d(var(--crystal-dx, 0px),var(--crystal-dy, -60px),0) scale(2.25); filter: brightness(1.4); }
  100% { transform: translate3d(var(--crystal-dx, 0px),var(--crystal-dy, -60px),0) scale(2.7); filter: brightness(1.8); }
}
@keyframes crystal-backdrop { from { opacity: 0; } to { opacity: 1; } }
@keyframes exit-crystal-pulse { 0%,100% { transform: translateY(0) scale(.97); filter: brightness(1); } 50% { transform: translateY(-4px) scale(1.055); filter: brightness(1.2); } }
@keyframes exit-aura-pulse { 0%,100% { opacity: .55; transform: scale(.86); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes exit-ray-pulse { 0%,100% { opacity: .12; transform: scale(.8) rotate(-8deg); } 50% { opacity: .42; transform: scale(1.12) rotate(8deg); } }
@keyframes exit-core-pulse { 0%,100% { opacity: .4; transform: scale(.8); } 50% { opacity: .92; transform: scale(1.2); } }
@keyframes exit-flight-approach {
  0% { transform: translate3d(var(--flight-from-x, 0px),var(--flight-from-y, 0px),0) scale(var(--flight-start-scale, .8)); filter: brightness(1); }
  16% { transform: translate3d(var(--flight-from-x, 0px),calc(var(--flight-from-y, 0px) + 4px),0) scale(calc(var(--flight-start-scale, .8) * .94)); filter: brightness(1.1); }
  76% { transform: translate3d(0,0,0) scale(2.25); filter: brightness(1.4); }
  100% { transform: translate3d(0,0,0) scale(2.7); filter: brightness(1.8); }
}

@keyframes crystal-aura-expand { 0% { opacity: .6; transform: scale(1); } 55% { opacity: 1; transform: scale(1.3); } 100% { opacity: 1; transform: scale(2); } }
@keyframes crystal-core-light { 0% { opacity: .35; transform: scale(.7); } 70% { opacity: .75; transform: scale(1.35); } 100% { opacity: 1; transform: scale(2); } }
@keyframes crystal-orbit-open { 0% { transform: rotate(-18deg) scale(1); opacity: .7; } 60% { transform: rotate(8deg) scale(1.07); opacity: 1; } 100% { transform: rotate(24deg) scale(1.5); opacity: 0; } }
@keyframes crystal-light-release { 0%,22% { opacity: 0; transform: scale(.5) rotate(-20deg); } 67% { opacity: .36; } 100% { opacity: .82; transform: scale(1.6) rotate(16deg); } }

@keyframes ritual-float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes halo-breathe { 0%,100% { opacity: .7; } 50% { opacity: 1; } }
@keyframes touch-breathe { 0%,65%,100% { transform: scale(1); } 78% { transform: scale(.92); } 89% { transform: scale(1.04); } }
@keyframes wish-accept { 0% { transform: scale(1); filter: brightness(1); } 18% { transform: scale(.96); filter: brightness(1.12); } 72% { transform: scale(1.15); filter: brightness(1.55); } 100% { transform: scale(1.12); filter: brightness(1.35); } }
@keyframes wish-wave { 0% { opacity: 0; transform: scale(.55); } 20% { opacity: 1; } 100% { opacity: 0; transform: scale(2.15); } }
@keyframes wish-outer-wave { 0%,12% { opacity: 0; transform: scale(.75); } 38% { opacity: .9; } 100% { opacity: 0; transform: scale(1.65); } }
@keyframes wish-rays-idle { from { transform: rotate(0); } to { transform: rotate(360deg); } }
@keyframes wish-rays-release { 0% { opacity: .2; transform: rotate(-12deg) scale(.85); } 45% { opacity: .9; } 100% { opacity: .15; transform: rotate(24deg) scale(1.6); } }

@keyframes received-message { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: translateY(0); } }
@keyframes advisor-portrait-enter { from { opacity: 0; transform: translateY(9px) scale(.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes advisor-message-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes summon-stage { 0% { opacity: 0; } 6%,91% { opacity: 1; } 100% { opacity: 0; } }
@keyframes summon-ring { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.55) rotate(-15deg); } 27% { opacity: .65; transform: translate(-50%, -50%) scale(.88) rotate(-3deg); } 76% { opacity: .8; transform: translate(-50%, -50%) scale(1.08) rotate(5deg); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.6) rotate(12deg); } }
@keyframes summon-rays { 0% { opacity: 0; transform: translate(-50%, -50%) rotate(-10deg) scale(.72); } 28% { opacity: .75; } 82% { opacity: 1; transform: translate(-50%, -50%) rotate(6deg) scale(1.1); } 100% { opacity: 0; transform: translate(-50%, -50%) rotate(11deg) scale(1.3); } }
@keyframes summon-aureole { 0% { opacity: .1; transform: translate(-50%, -50%) scale(.45); } 30% { opacity: .8; transform: translate(-50%, -50%) scale(.95); } 75% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); } 100% { opacity: .4; transform: translate(-50%, -50%) scale(1.35); } }
@keyframes dragon-manifest {
  0% { opacity: 0; transform: translate3d(0, 42px, 0) scale(.78) rotate(-2deg); filter: brightness(.22); }
  15% { opacity: .55; filter: brightness(.5); }
  35% { opacity: 1; transform: translate3d(0, 8px, 0) scale(.96) rotate(-.4deg); filter: brightness(1); }
  64% { opacity: 1; transform: translate3d(0, 0, 0) scale(1.035) rotate(0); filter: brightness(1.04); }
  84% { opacity: 1; transform: translate3d(0, -8px, 0) scale(1.11) rotate(.5deg); filter: brightness(1.1); }
  100% { opacity: 0; transform: translate3d(0, -18px, 0) scale(1.2) rotate(.8deg); filter: brightness(1.24); }
}
@keyframes dragon-illumination { 0%,12% { opacity: 0; transform: translateY(-16px) scale(.6); } 34% { opacity: .7; } 66% { opacity: .25; transform: translateY(55px) scale(1.2); } 100% { opacity: 0; transform: translateY(90px) scale(1.45); } }
@keyframes summon-mist-part { 0% { opacity: 1; transform: translateY(-30px) scale(1); } 65% { opacity: .8; transform: translateY(8px) scale(1.08); } 100% { opacity: 1; transform: translateY(15px) scale(1.15); } }
@keyframes summon-final-glow { 0%,70% { opacity: 0; transform: scale(.8); } 88% { opacity: .42; transform: scale(1.1); } 100% { opacity: 0; transform: scale(1.45); } }
@keyframes summon-letter { 0%,16% { opacity: 0; transform: translateY(8px) scale(.88); } 34%,91% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-3px) scale(1.04); } }
@keyframes summon-copy { 0%,20% { opacity: 0; transform: translateY(9px); } 36%,92% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; } }
@keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes modal-in { from { opacity: 0; transform: translateY(15px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%,8px); } to { opacity: 1; transform: translate(-50%,0); } }

/* 設定OFF時でも、操作中のメッセージと結果表示はそのまま機能します。 */
.no-particles .gold-dust, .no-particles .ritual-sparkles { display: none; }
.no-bounce .line-button { animation: none; }
.page-paused *, .page-paused *::before, .page-paused *::after { animation-play-state: paused !important; }
.no-motion *, .no-motion *::before, .no-motion *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
.no-motion .gold-dust, .no-motion .ritual-sparkles { display: none; }
.no-motion .gold-button::after { display: none; }
.no-motion .summon-overlay { opacity: 1; }
.no-motion .summon-circle, .no-motion .summon-symbol, .no-motion .summon-overlay p { opacity: 1; }
.no-motion .summon-dragon { opacity: 1; transform: none; filter: none; }
.no-motion .summon-dragon-light, .no-motion .summon-flare { display: none; }
.no-motion .question-card.is-changing { opacity: 1; transform: none; }
.no-motion .summon-crystal.is-charging .crystal-core { opacity: .9; }
.no-motion .summon-crystal.is-charging { transform: none; }
.no-motion .exit-crystal-flight .exit-flight-orb.is-charging { transform: none; }
.no-motion.crystal-summoning .entry-block::before { display: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .gold-dust, .ritual-sparkles, .gold-button::after { display: none; }
  .summon-overlay, .summon-circle, .summon-symbol, .summon-overlay p { opacity: 1; }
  .summon-dragon { opacity: 1; transform: none; filter: none; }
  .summon-dragon-light, .summon-flare { display: none; }
  .question-card.is-changing { opacity: 1; transform: none; }
  .summon-crystal.is-charging .crystal-core { opacity: .9; }
  .summon-crystal.is-charging { transform: none; }
  .exit-crystal-flight .exit-flight-orb.is-charging { transform: none; }
  .crystal-summoning .entry-block::before { display: none; }
}
