html, body {
  touch-action: manipulation; /* ← ダブルタップのズーム抑止 */
  -ms-touch-action: manipulation; /* ← IE用（不要なら省略可） */
  overscroll-behavior: none; /* ← スクロールのバウンド抑止 */
}
body {
  font-family: 'Noto Sans JP', sans-serif;
}

.fade-in {
  opacity: 0;
  animation: fadeIn 0.5s ease-in forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

.container {
  height: calc(var(--vh, 1vh) * 100);
}

.container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0); /* ← 最初は透明 */
  transition: background-color 0.5s ease;
  z-index: 0;
  pointer-events: none;
}

.container.visible::before {
  background-color: rgba(0, 0, 0, 0.4);
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: calc(var(--vh, 1vh) * 100);
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
  }

  #modalLink {
    z-index: 4;
  }

  .safe-area-content {
    /* max-height: calc(100dvh - env(safe-area-inset-bottom, 20px) - 2rem);
    padding-bottom: env(safe-area-inset-bottom, 20px);
    padding-top: env(safe-area-inset-top, 20px); */

    width: calc(100vw - env(safe-area-inset-left) - env(safe-area-inset-right));
    /* height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom)); */
    height: 100%;
    /* background-color: rgba(186, 14, 14, 0.482); */
    position: absolute;
    top:  0;
    /* flex-direction: column; */
    z-index: 11;
    display: flex;
    justify-content: center;
    align-items: center;
  }


  .close-modal {
    position: absolute;
    top: 1%;
    right: 1%;
    color: white;
    font-size: 50px;
    width: 120px;
    height: 120px;
    text-align: center;
    line-height: 120px;
    cursor: pointer;
    z-index: 11;
  }

  .close-modal img {
    width: 100%;
    height: 100%;
  }

  .close-modal:hover {
    opacity: 0.7;
  }

  .show-after-delay {
    opacity: 0;
    transition: opacity 1.5s ease;
    display: none;
    flex-wrap: wrap;
    justify-content: center;
    position: absolute;
    top: 50%;
    width: 70%;
    transform: translateY(-50%);
    z-index: 10;
    gap: 6%;
  }
  
  .show-after-delay a {
    transition: transform 0.5s ease;
    display: inline-block;
  }
  
  .show-after-delay a:hover {
    transform: scale(1.02);
    cursor: pointer;
  }
  
  .show-after-delay.flex {
    display: flex;
  }

  .show-after-delay.visible {
    opacity: 1;
    pointer-events: auto;
  }

  .poster-link {
    height: 100%;
    width: 100%;
    flex: 1 1 calc(20% - 6%);
    z-index: 10;
  }


  .poster-link img {
    box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.4);
  }

  @media screen and (max-width: 1024px) {
    .close-modal {
      width: 80px;
      height: 80px;
      line-height: 80px;
    }
  }

  @media screen and (max-width: 768px) and (orientation: portrait) {
    .show-after-delay {
      gap: 10px 20px;
    }
    .poster-link {
      flex: 1 1 calc(50% - 10px);
      max-width: calc(50% - 10px);
      width: 100%;
    }
  }