#modal-end {
  display: none;
  width: 100%;
  height: 100%;
}
.img-wrap {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: 50px;
  max-height: 50px;
  transform: translate(-50%, -50%);
  transition: top 0.8s ease; /* 位置の移動をスムーズにする */
}

.img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* アニメーションクラスを分離 */
.img-wrap.animate {
  animation: img-wrap 2s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes img-wrap {
  0% {
    clip-path: circle(0 at 50% 50%);
    -webkit-clip-path: circle(0 at 50% 50%);
    opacity: .3;
  }
  100% {
    clip-path: circle(100% at 50% 50%);
    -webkit-clip-path: circle(100% at 50% 50%);
    opacity: 1;
  }
}
.line-container {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 80%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  display: flex;
  justify-content: center; /* 中央揃え */
  align-items: center;
  transition: top 0.8s ease; /* 位置の移動をスムーズにする */
}

.line {
  position: relative;
  height: 1px;
  background: #ccc;
  width: 0;
  opacity: 0;
}

.line.left {
  transform-origin: right; /* 右端が固定点 */
  margin-right: 40px; /* 画像の半分のスペース */
}

.line.right {
  transform-origin: left; /* 左端が固定点 */
  margin-left: 40px; /* 画像の半分のスペース */
}

/* 個別の線のアニメーション */
.line.animate {
  animation: line-expand 1s ease-out forwards;
}

@keyframes line-expand {
  0% {
    width: 0;
    opacity: 0;
  }
  100% {
    width: calc(50% - 50px); /* 画像の半分より少し余裕をもたせる */
    opacity: 1;
  }
}

#end-title {
  position: relative;
  margin: 120px auto 0;
  text-align: center;
  font-family: 'Zen Old Mincho', 'Noto Serif JP', serif;
  font-size: 1.2rem;
  color: #f0e6d2;
  text-shadow: 0px 0px 3px rgba(248, 246, 164, 0.8);
}
#end-subtext {
  position: relative;
  width: 80%;
  margin: 10px auto 0;
  text-align: center;
  font-family: 'Zen Old Mincho', 'Noto Serif JP', serif;
  font-size: 1rem;
  padding: 10px;
}
#end-subtext span {
  display: inline-block;
}

#end-deck-list-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  width: 80%;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  margin: 0 auto;
}
.end-deck-item {
  aspect-ratio: 5 / 7;
}
.end-deck-item img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: drop-shadow(0 0 3px rgba(255, 250, 180, 0.8));
}
@media (max-width: 480px) {
  #end-deck-list-container {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
}

#end-button {
  display: block;
  position: relative;
  padding: 10px 30px;
  margin: 10px auto 0;
  text-align: center;
  color: #00ff88;
  font-family: 'Zen Old Mincho', 'Noto Serif JP', serif;
  font-size: .9rem;
  background: transparent;
  border: 1px solid #00ff88;
  border-radius: calc(0.9rem + 10px + 10px);
}

.modal-end-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at center, rgba(116, 59, 59, 0.2) 0%, rgba(90, 48, 48, 0.8) 70%, rgba(79, 19, 19, 0.95) 100%);
  z-index: -1;
}