body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
       background-image: url('rain00.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: "Yu Mincho", "游明朝", YuMincho, serif;

}

.stage-container {
    position: absolute;
    top: 0%;
    left: 0%;
    width: 100vw;
    height: 100vw;
    max-height: 100vh;
    background-image: url('rain00.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    transition: background-image 0.4s ease;
}
/* ==========================================================================
   追加：トップページ共通UI・扉アニメーションの移植
   ========================================================================== */

.audio-control-btn {
    right: 90px !important; 
}

.menu-trigger, .smart-menu-overlay {
    font-family: "Noto Serif JP", serif;
}

.opening-door-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 999;
    pointer-events: none;
    display: flex;
}

.door {
    width: 50%;
    height: 100vh;
    background-color: #333333; 
    position: absolute;
    top: 0;
    transition: transform 1.6s cubic-bezier(0.66, 0, 0.2, 1);
}

.door-left {
    left: 0;
    transform: translateX(0);
    border-right: 1px solid #444444;
}

.door-right {
    right: 0;
    transform: translateX(0);
    border-left: 1px solid #444444;
}

body.loaded .door-left {
    transform: translateX(-100%);
}
body.loaded .door-right {
    transform: translateX(100%);
}

.menu-trigger {
    position: fixed;
    top: 25px; 
    right: 40px;
    z-index: 1000; 
    cursor: pointer;
    width: 28px;
    height: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.menu-trigger span {
    display: block;
    width: 100%;
    height: 1.5px;
    background-color: #cacaca;
    transition: transform 0.4s ease, background-color 0.4s ease;
}

.menu-trigger.active span {
    background-color: #3a3a3a;
}

.menu-trigger.active span:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
.menu-trigger.active span:nth-child(2) {
    transform: translateY(-6.5px) rotate(-45deg);
}

.smart-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(252, 250, 242, 0.98); 
    z-index: 950;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.smart-menu-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.smart-menu-overlay ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    text-orientation: mixed;
    gap: 50px;
}

.smart-menu-overlay li a {
    color: #3a3a3a; 
    text-decoration: none;
    font-size: 18px;
    letter-spacing: 0.3em;
    font-weight: 500;
    transition: opacity 0.3s ease, color 0.3s ease;
}

.smart-menu-overlay li a:hover {
    opacity: 0.5;
}

/*言葉配置*/
.words-container{
display: flex;
align-items: center;
justify-content: center;
position: fixed;
width: 100vw;
height: 100vh;
overflow: visible;
font-size: 32px;
z-index: 10; /* 雲（5）よりも高い値にする */

}
.words {
    position: absolute;
    color: rgb(235, 235, 235);
    font-size: 24px;
    font-family: "Noto Serif JP", serif;
    white-space: nowrap;
    pointer-events: auto; /* クリックを邪魔しないようにする */
    z-index: 10; /* 背景より手前に表示する */
    writing-mode: vertical-rl;/* 文字縦書き */
        text-shadow: 2px 2px 10px #b2d4e4 ,
-2px 2px 10px #b2d4e4 ,
2px -2px 10px #b2d4e4 ,
-2px -2px 10px #b2d4e4;
	  animation: blink 8.0s infinite alternate;
    
}

/* ポップアップ（モーダル）のスタイル */
dialog {
  border: none;
  border-radius: 12px;
  padding: 24px;
  width: 300px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  background: #fff;
}
dialog h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #333;
}

dialog p {
  color: #666;
  line-height: 1.6;
  white-space: pre-line;
}

#close-btn {
  margin-top: 16px;
  padding: 6px 16px;
  background: #6b8e23;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}


/* ホバー時に切り替わる背景画像（各パターン） */
.stage-container.bg1 {
    background-image: url('rain01.png') !important;
      opacity: 30%;
  animation: fadeIn 0.5s ease-in-out forwards;
}
.stage-container.bg2 {
    background-image: url('rain00.png') !important;
      opacity: 30%;
  animation: fadeIn 0.5s ease-in-out forwards;
}
.stage-container.bg3 {
    background-image: url('rain03.png') !important;
      opacity: 30%;
  animation: fadeIn 0.5s ease-in-out forwards;
}


.fadeIn-img {
  opacity:30%;
  animation: fadeIn 0.5s ease-in-out forwards;
}

@keyframes fadeIn {
  0%, 100% { 
    opacity: 30%;
  }
  100% { 
    opacity: 100%;
  }
}

.words:hover {
  transform: scale(1.05); /* ホバーした時に少し大きくする演出 */
}


/*BGMのための*/

.layer {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8); /* 半透明の背景 */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999; /* レイヤーを最前面に */
}

.close-btn {
  display: inline-block;
  height: 4rem;
  background-color: #d5d5d56d;
  padding: 15px 32px;
  border: none;
  border-radius: 2rem;
  font-size: 1rem;
  color: white;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}



/* 雨 */
.rainning {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100%;
  margin: auto;
  width: 100vw;
}

.rain {
  position: absolute;
  width: 1px;
  height: 100%;
  top: 0;
  left: 50%;
  overflow: hidden;
}
.rain::after {
  content: "";
  display: block;
  position: absolute;
  height: 20vh;
  width: 100%;
  top: -50%;
  left: 0;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, #ffffff 80%, #ffffff 100%);
  animation: drop 2.8s 0s infinite;
  animation-fill-mode: forwards;
  opacity: .6;
}
.rain:nth-child(1) {
  margin-left: -40%;
}
.rain:nth-child(1)::after {
  animation-delay: 1.2s;
}
.rain:nth-child(2) {
  margin-left: -30%;
}
.rain:nth-child(2)::after {
  animation-delay: 2.5s;
}
.rain:nth-child(3) {
  margin-left: -20%;
}
.rain:nth-child(3)::after {
  animation-delay: .6s;
}
.rain:nth-child(4) {
  margin-left: -10%;
}
.rain:nth-child(4)::after {
  animation-delay: 2.3s;
}
.rain:nth-child(5) {
  margin-left: 0%;
}
.rain:nth-child(5)::after {
  animation-delay: 1s;
}
.rain:nth-child(6) {
  margin-left: 10%;
}
.rain:nth-child(6)::after {
  animation-delay: .3s;
}
.rain:nth-child(7) {
  margin-left: 20%;
}
.rain:nth-child(7)::after {
  animation-delay: 2.6s;
}
.rain:nth-child(8) {
  margin-left: 30%;
}
.rain:nth-child(8)::after {
  animation-delay: 1.9s;
}
.rain:nth-child(9) {
  margin-left: 40%;
}
.rain:nth-child(9)::after {
  animation-delay: .7s;
}

@keyframes drop {
  0% {
    top: -50%;
  }
  100% {
    top: 150%;
  }
}