/* =====================================================
   イントロ画面全体のコンテナ
===================================================== */
#intro-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    transition: opacity 1s ease-out;
}

#intro-container.hidden {
    opacity: 0;
    pointer-events: none;
}

/* =====================================================
   音量確認画面（最初の画面）
===================================================== */
#volume-check-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #fefeff 0%, 
        #f5f8fe 15%,
        #e8f4fd 30%,
        #f0f5fe 45%,
        #f8f3fe 60%,
        #f2f8fd 75%,
        #faf5fe 90%,
        #fefeff 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease-out;
}

#volume-check-screen.hidden {
    opacity: 0;
    pointer-events: none;
}

/* 細かく描写された雲のような背景（多層構造） */
#volume-check-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        /* 小さな雲のディテール */
        radial-gradient(ellipse 120px 80px at 15% 20%, rgba(200, 220, 255, 0.25) 0%, transparent 50%),
        radial-gradient(ellipse 90px 60px at 25% 25%, rgba(220, 240, 255, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 100px 70px at 18% 22%, rgba(180, 210, 255, 0.18) 0%, transparent 50%),
        
        radial-gradient(ellipse 150px 100px at 75% 30%, rgba(210, 200, 255, 0.22) 0%, transparent 50%),
        radial-gradient(ellipse 110px 75px at 82% 28%, rgba(230, 220, 255, 0.18) 0%, transparent 50%),
        radial-gradient(ellipse 130px 85px at 78% 32%, rgba(190, 180, 255, 0.15) 0%, transparent 50%),
        
        radial-gradient(ellipse 140px 90px at 50% 60%, rgba(190, 230, 250, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 100px 65px at 55% 62%, rgba(210, 240, 255, 0.17) 0%, transparent 50%),
        radial-gradient(ellipse 120px 80px at 48% 58%, rgba(170, 220, 245, 0.15) 0%, transparent 50%),
        
        radial-gradient(ellipse 160px 110px at 30% 75%, rgba(230, 210, 255, 0.23) 0%, transparent 50%),
        radial-gradient(ellipse 120px 85px at 35% 78%, rgba(250, 230, 255, 0.19) 0%, transparent 50%),
        radial-gradient(ellipse 140px 95px at 28% 73%, rgba(210, 190, 255, 0.16) 0%, transparent 50%),
        
        radial-gradient(ellipse 180px 120px at 80% 70%, rgba(200, 240, 250, 0.21) 0%, transparent 50%),
        radial-gradient(ellipse 130px 90px at 85% 72%, rgba(220, 250, 255, 0.17) 0%, transparent 50%),
        radial-gradient(ellipse 150px 100px at 78% 68%, rgba(180, 230, 245, 0.14) 0%, transparent 50%),
        
        /* 大きな雲のベース */
        radial-gradient(ellipse 300px 200px at 20% 35%, rgba(200, 220, 255, 0.15) 0%, transparent 60%),
        radial-gradient(ellipse 350px 220px at 70% 45%, rgba(220, 200, 255, 0.13) 0%, transparent 60%),
        radial-gradient(ellipse 280px 180px at 50% 80%, rgba(210, 230, 255, 0.14) 0%, transparent 60%);
    animation: cloudDrift 40s ease-in-out infinite alternate;
    pointer-events: none;
}

#volume-check-screen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(ellipse 200px 130px at 40% 15%, rgba(230, 245, 255, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 220px 150px at 65% 85%, rgba(245, 230, 255, 0.11) 0%, transparent 55%),
        radial-gradient(ellipse 190px 120px at 10% 50%, rgba(220, 235, 255, 0.1) 0%, transparent 55%);
    animation: cloudDrift 35s ease-in-out infinite alternate-reverse;
    pointer-events: none;
}

@keyframes cloudDrift {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 0.9;
    }
    100% {
        transform: translate(2%, 1.5%) scale(1.02);
        opacity: 1;
    }
}

/* メッセージテキスト - 文学的なフォント */
.intro-message {
    font-size: 26px;
    color: #5a6b8f;
    margin-bottom: 35px;
    text-align: center;
    z-index: 1;
    font-weight: 400;
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 2px;
    line-height: 1.8;
}

/* 音量コントロール */
.intro-volume-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(180, 200, 255, 0.35);
    border-radius: 20px;
    padding: 35px 45px;
    box-shadow: 0 10px 40px rgba(100, 120, 180, 0.15);
    z-index: 1;
}

.intro-volume-label {
    font-size: 16px;
    color: #6b7c9f;
    font-family: 'Noto Serif JP', serif;
    letter-spacing: 3px;
    font-weight: 400;
}

.intro-volume-slider {
    width: 220px;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(160, 180, 220, 0.3);
    border-radius: 3px;
    outline: none;
}

.intro-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #a0b8ff, #8098ff);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(130, 160, 255, 0.6);
    transition: all 0.3s;
}

.intro-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(130, 160, 255, 0.8);
}

.intro-volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #a0b8ff, #8098ff);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 0 10px rgba(130, 160, 255, 0.6);
    transition: all 0.3s;
}

.intro-volume-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px rgba(130, 160, 255, 0.8);
}

/* タップ促進テキスト */
.tap-prompt {
    position: absolute;
    bottom: 60px;
    font-size: 15px;
    color: #8898b8;
    animation: blinkFade 2s ease-in-out infinite;
    z-index: 1;
    text-align: center;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    letter-spacing: 1px;
}

@keyframes blinkFade {
    0%, 100% {
        opacity: 0.3;
    }
    50% {
        opacity: 1;
    }
}

/* =====================================================
   音量確認画面の装飾エフェクト
===================================================== */
/* ふわふわ浮遊する光の玉 */
.light-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    animation: orbFloat 8s ease-in-out infinite;
}

.light-orb-1 {
    width: 80px;
    height: 80px;
    top: 15%;
    left: 10%;
    background: radial-gradient(circle, rgba(200, 220, 255, 0.5) 0%, rgba(180, 210, 255, 0.3) 50%, transparent 100%);
    box-shadow: 0 0 40px rgba(200, 220, 255, 0.4), 0 0 60px rgba(180, 210, 255, 0.2);
    animation-delay: 0s;
}

.light-orb-2 {
    width: 100px;
    height: 100px;
    top: 60%;
    right: 12%;
    background: radial-gradient(circle, rgba(220, 200, 255, 0.45) 0%, rgba(200, 180, 255, 0.28) 50%, transparent 100%);
    box-shadow: 0 0 45px rgba(220, 200, 255, 0.35), 0 0 65px rgba(200, 180, 255, 0.18);
    animation-delay: 1s;
}

.light-orb-3 {
    width: 70px;
    height: 70px;
    bottom: 20%;
    left: 15%;
    background: radial-gradient(circle, rgba(255, 220, 220, 0.4) 0%, rgba(255, 200, 200, 0.25) 50%, transparent 100%);
    box-shadow: 0 0 35px rgba(255, 220, 220, 0.3), 0 0 55px rgba(255, 200, 200, 0.15);
    animation-delay: 2s;
}

.light-orb-4 {
    width: 90px;
    height: 90px;
    top: 40%;
    right: 20%;
    background: radial-gradient(circle, rgba(220, 255, 240, 0.45) 0%, rgba(200, 255, 220, 0.28) 50%, transparent 100%);
    box-shadow: 0 0 42px rgba(220, 255, 240, 0.35), 0 0 62px rgba(200, 255, 220, 0.18);
    animation-delay: 0.5s;
}

@keyframes orbFloat {
    0%, 100% {
        opacity: 0.7;
        transform: translate(0, 0) scale(1);
    }
    25% {
        opacity: 0.9;
        transform: translate(20px, -25px) scale(1.15);
    }
    50% {
        opacity: 1;
        transform: translate(0, -45px) scale(1.1);
    }
    75% {
        opacity: 0.85;
        transform: translate(-20px, -25px) scale(1.05);
    }
}

/* キラキラと輝く小さな光の粒 */
.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    pointer-events: none;
    z-index: 10;
    animation: sparkleAnim 3s ease-in-out infinite;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.9), 0 0 15px rgba(255, 255, 255, 0.5);
}

@keyframes sparkleAnim {
    0%, 100% {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        opacity: 1;
        transform: scale(1.8);
    }
}

/* =====================================================
   アニメーション画面（op_se.wav再生時）
===================================================== */
#animation-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, 
        #ffffff 0%, 
        #fff8fa 20%,
        #f8f8ff 40%,
        #fffff8 60%,
        #faf8ff 80%,
        #ffffff 100%
    );
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in;
}

#animation-screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* レインボーな背景グラデーション */
#animation-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(ellipse at 20% 30%, rgba(180, 220, 255, 0.18) 0%, transparent 45%),
        radial-gradient(ellipse at 80% 70%, rgba(255, 180, 200, 0.14) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(255, 240, 180, 0.16) 0%, transparent 55%),
        radial-gradient(ellipse at 70% 20%, rgba(220, 180, 255, 0.15) 0%, transparent 48%),
        radial-gradient(ellipse at 30% 80%, rgba(180, 255, 220, 0.13) 0%, transparent 50%);
    animation: rainbowPulse 7s ease-in-out;
    pointer-events: none;
}

@keyframes rainbowPulse {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    100% {
        opacity: 0.95;
        transform: scale(1);
    }
}

/* ホタルの光の点 */
.firefly {
    position: absolute;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 200, 0.9) 30%, rgba(255, 250, 180, 0.5) 60%, transparent 100%);
    border-radius: 50%;
    opacity: 0;
    box-shadow: 0 0 12px rgba(255, 255, 255, 1), 0 0 20px rgba(255, 255, 220, 0.7), 0 0 30px rgba(255, 250, 200, 0.4);
    z-index: 3;
    pointer-events: none;
}

/* ホタルの軌跡コンテナ（SVGパス用） */
.firefly-trail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.firefly-trail svg {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* 大人びた花の装飾 */
.flower {
    position: absolute;
    opacity: 0;
    animation: flowerFadeIn 2s ease-out forwards;
    z-index: 2;
}

.flower svg {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 0 8px rgba(200, 180, 220, 0.5));
}

.flower.rotate svg {
    animation: flowerRotate 20s linear infinite;
}

@keyframes flowerRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.flower.flower-1 {
    top: 12%;
    left: 12%;
    animation-delay: 1s;
}

.flower.flower-2 {
    top: 18%;
    right: 15%;
    animation-delay: 1.5s;
}

.flower.flower-3 {
    bottom: 18%;
    left: 18%;
    animation-delay: 2s;
}

.flower.flower-4 {
    bottom: 22%;
    right: 12%;
    animation-delay: 2.5s;
}

.flower.flower-5 {
    top: 50%;
    left: 8%;
    animation-delay: 3s;
}

.flower.flower-6 {
    top: 55%;
    right: 10%;
    animation-delay: 3.3s;
}

@keyframes flowerFadeIn {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-45deg);
    }
    100% {
        opacity: 0.9;
        transform: scale(1) rotate(0deg);
    }
}

/* メインテキスト */
.intro-text {
    font-size: 52px;
    font-family: 'Noto Serif JP', serif;
    font-weight: 400;
    color: #6b7c9f;
    text-align: center;
    opacity: 0;
    z-index: 3;
    text-shadow: 0 0 25px rgba(180, 200, 255, 0.3);
    letter-spacing: 4px;
}

.intro-text.welcome {
    animation: textFadeIn 2s ease-out 0.5s forwards;
    margin-bottom: 35px;
}

.intro-text.title {
    font-size: 60px;
    animation: textFadeIn 2s ease-out 2s forwards;
    letter-spacing: 10px;
}

@keyframes textFadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .intro-message {
        font-size: 22px;
        padding: 0 20px;
    }
    
    .intro-volume-control {
        padding: 28px 35px;
    }
    
    .intro-volume-slider {
        width: 170px;
    }
    
    .intro-text.welcome {
        font-size: 40px;
    }
    
    .intro-text.title {
        font-size: 46px;
        letter-spacing: 6px;
    }
    
    .flower svg {
        width: 60px;
        height: 60px;
    }
}