/*
body {
  margin: 0;
  background: #000;
  color: #fff;
  font-family: sans-serif;
}
*/
.bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
}

.bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bg1 {
  opacity: 1;
}

.bg2 {
  opacity: 0;
}

.top1 {
  opacity: 1;
}

.top2 {
  opacity: 0;
  transition: opacity 1.2s ease;
}

.top2.show {
  opacity: 1;
}

/* 雷 */

.lightning-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.lightning {
  position: absolute;
  opacity: 0;
  transform-origin: center;
}

.lightning.show {
  animation: lightningFlash 0.3s ease-out;
}

@keyframes lightningFlash {

  0% {
    opacity: 0;
  }

  10% {
    opacity: 1;
  }

  40% {
    opacity: 0.9;
  }

  70% {
    opacity: 0.5;
  }

  100% {
    opacity: 0;
  }

}

/* フラッシュ */

.flash {
  position: fixed;
  inset: 0;
  background: #fff;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  --flash-power: 0.6;
}

.flash.show {
  animation: flashAnim 0.25s ease-out;
}

@keyframes flashAnim {

  0% {
    opacity: 0;
  }

  20% {
    opacity: var(--flash-power);
  }

  100% {
    opacity: 0;
  }

}

/* -------------------------
瓦礫
------------------------- */

.debris-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
}
/* 重い場合
.debris-layer{
  contain: layout paint;
}
*/
.debris {
  position: absolute;
  bottom: -120px;
  opacity: 0.9;
  animation: debrisFloat linear infinite;
}

@keyframes debrisFloat {

  0% {
    transform: translateY(0);
  }

  100% {
    transform: translateY(-120vh);
  }

}

.debris {
  will-change: transform;
}

.debris-front-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999; /* 最前面 */
}

/* SPだけ表示 */
@media (min-width: 744px) {
  .debris-front-layer {
    display: none;
  }
}


/* デバッグ */

.stage-debug {
  position: fixed;
  bottom: 10px;
  right: 10px;
  z-index: 9999;
  display: flex;
  gap: 6px;
}

.stage-debug button {
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.stage-debug button {
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
  border: 1px solid #999;
  background: #fff;
  color: #000;
  border-radius: 999px;
}

.stage-debug button.is-active {
  background: #000;
  color: #fff;
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.25);
}