body {
  text-align: center;
  font-family: Arial, sans-serif;
  background-color: #000;
  transition: background-color 1s ease-in-out;
}
/* 戻るボタンの配置 */
a[href="../../index.html"] {
  position: fixed;
  right: 20px;
  bottom: 20px;
  background-color: #ffffff;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  color: #333;
  font-weight: bold;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: background-color 0.3s;
}

a[href="../../index.html"]:hover {
  background-color: #ddd;
}
.container {
  margin-top: 50px;
}
.bulb {
  width: 120px;
  height: 200px;
  background-color: gray;
  border-radius: 10px;
  position: relative;
  margin: 20px auto;
  transition: background-color 1s, box-shadow 1s, opacity 1s;
}
/* チラつきアニメーション */
@keyframes flicker {
  0%,
  100% {
    background-color: rgba(255, 255, 0, 0.1);
    box-shadow: 0 0 5px rgba(255, 255, 0, 0.1);
  }
  10% {
    background-color: rgba(255, 255, 0, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 0, 0.6);
  }
  25% {
    background-color: rgba(255, 255, 0, 0.2);
    box-shadow: 0 0 10px rgba(255, 255, 0, 0.2);
  }
  40% {
    background-color: rgba(255, 255, 0, 0.8);
    box-shadow: 0 0 25px rgba(255, 255, 0, 0.8);
  }
  60% {
    background-color: rgba(255, 255, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.4);
  }
  80% {
    background-color: yellow;
    box-shadow: 0 0 40px yellow;
  }
  90% {
    background-color: rgba(255, 255, 0, 0.4);
    box-shadow: 0 0 15px rgba(255, 255, 0, 0.4);
  }
  100% {
    background-color: yellow;
    box-shadow: 0 0 40px yellow;
  }
}
.bulb.on {
  animation: flicker 1.5s ease-in-out forwards;
}
.bulb.off {
  background-color: gray;
  box-shadow: none;
  opacity: 0.3; /* じわっと消える */
}
/* スイッチデザインの改良 */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
  box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}
.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}
input:checked + .slider {
  background-color: #4caf50; /* ON時は緑 */
}
input:checked + .slider:before {
  transform: translateX(26px);
}
