dialog {
    position: fixed;
    border: 0;
    outline: 0;
    background: transparent;
    opacity: 0;
    overflow: visible;
    /*animation-name: fadeIn fadeOut;
    animation-duration: 0.3s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards; /* アニメーション終了後、最終状態を保持 */
  }


.fade-in {
    animation-name: fadeIn;  /*ダイアログが開いたときもアニメーションを適用*/ 
    animation: fadeIn 0.3s ease-in-out forwards;
}

.fade-out {
    animation-name: fadeOut; /* ダイアログが閉じたときもアニメーションを適用*/
    animation: fadeOut 0.3s ease-in-out forwards;
}
@keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
}
@keyframes fadeOut {
    from {
      opacity: 1;
    }
    to {
      opacity: 0;
    }
}
dialog::backdrop {
  position: fixed;
    background: #788867;
    opacity: 0;
    border: 0;
    width: 1550px;
    height: 1080px;
    left: 0px;
    /*
    animation-name: backdropFadeIn,backdropFadeOut;
    animation-duration: 0.3s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards; /* アニメーション終了後、最終状態を保持 */
}
@keyframes backdropFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.5;
    }
}
@keyframes backdropFadeOut {
    from {
      opacity: 0.5;
    }
    to {
      opacity: 0;
    }
}

dialog.backdropfade-in::backdrop{
  animation: backdropFadeIn 0.3s ease-in-out forwards;
}


dialog.backdropfade-out::backdrop{
  animation: backdropFadeOut 0.3s ease-in-out forwards;
}
