* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #0a0a0a;
    color: #e0e0e0;
    font-family: 'Noto Serif JP', 'Yu Mincho', serif;
    overflow-x: hidden;
    position: relative;
}

/* 雨のアニメーション */
.rain-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    opacity: 0.6;
}

.rain {
    position: absolute;
    width: 1px;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: fall linear infinite;
}

@keyframes fall {
    from {
        transform: translateY(-100vh);
    }
    to {
        transform: translateY(100vh);
    }
}

/* 色レイヤー - Fixed配置 */
.color-layer {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0;
    transition: opacity 3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 黄色レイヤー - 最背面 */
#yellow-layer {
    z-index: 1;
    background: radial-gradient(
        circle at 30% 40%,
        rgba(255, 230, 0, 0.15) 0%,
        rgba(255, 200, 0, 0.08) 30%,
        transparent 70%
    );
    animation: floatYellow 20s ease-in-out infinite;
}

/* 赤レイヤー - 中間 */
#red-layer {
    z-index: 2;
    background: radial-gradient(
        circle at 70% 60%,
        rgba(255, 50, 50, 0.12) 0%,
        rgba(200, 30, 30, 0.06) 40%,
        transparent 80%
    );
    animation: floatRed 25s ease-in-out infinite;
}

/* 青レイヤー - 最前面（雨より後ろ） */
#blue-layer {
    z-index: 3;
    transition: opacity 3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatBlue 30s ease-in-out infinite;
}

/* 青レイヤーの強度を動的に制御するためのCSS変数 */
#blue-layer::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 50% 50%,
        rgba(50, 150, 255, var(--blue-intensity-1, 0.18)) 0%,
        rgba(30, 100, 200, var(--blue-intensity-2, 0.08)) 35%,
        transparent 75%
    );
    transition: all 0.5s ease-out;
}

/* 追加の青レイヤー（最下部用） */
#blue-layer::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(
        circle at 50% 70%,
        rgba(30, 120, 255, var(--blue-final-intensity, 0)) 0%,
        rgba(0, 80, 220, calc(var(--blue-final-intensity, 0) * 0.5)) 50%,
        transparent 90%
    );
    opacity: var(--blue-final-opacity, 0);
    transition: opacity 1s ease-out;
}

/* レイヤーごとの浮遊アニメーション */
@keyframes floatYellow {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        filter: blur(80px);
    }
    25% { 
        transform: translate(50px, -30px) scale(1.1);
        filter: blur(100px);
    }
    50% { 
        transform: translate(-30px, 20px) scale(0.95);
        filter: blur(90px);
    }
    75% { 
        transform: translate(40px, 10px) scale(1.05);
        filter: blur(85px);
    }
}

@keyframes floatRed {
    0%, 100% { 
        transform: translate(0, 0) scale(1) rotate(0deg);
        filter: blur(100px);
    }
    33% { 
        transform: translate(-60px, 40px) scale(1.15) rotate(10deg);
        filter: blur(120px);
    }
    66% { 
        transform: translate(80px, -20px) scale(0.9) rotate(-5deg);
        filter: blur(110px);
    }
}

@keyframes floatBlue {
    0%, 100% { 
        transform: translate(0, 0) scale(1);
        filter: blur(90px);
    }
    20% { 
        transform: translate(-40px, -50px) scale(1.2);
        filter: blur(110px);
    }
    40% { 
        transform: translate(60px, 30px) scale(0.85);
        filter: blur(95px);
    }
    60% { 
        transform: translate(-70px, 10px) scale(1.1);
        filter: blur(105px);
    }
    80% { 
        transform: translate(30px, -40px) scale(0.95);
        filter: blur(100px);
    }
}

/* アクティブ状態 */
.yellow-active #yellow-layer {
    opacity: 1;
}

.red-active #red-layer {
    opacity: 1;
}

.blue-active #blue-layer {
    opacity: 1;
}

/* タイトルセクション */
.title-section {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 5;
}

h1 {
    font-size: clamp(2rem, 5vw, 4rem);
    letter-spacing: 0.3em;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
    animation: fadeIn 3s ease-in-out;
    writing-mode: vertical-rl;
    opacity: 0.9;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

/* 小説コンテンツ */
.novel-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 100px 40px;
    line-height: 2.5;
    font-size: 1.1rem;
    position: relative;
    z-index: 5;
}

.paragraph {
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(30px);
    animation: paragraphFade 1.5s ease-out forwards;
    position: relative;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
}

.paragraph:nth-child(1) { animation-delay: 0.5s; }
.paragraph:nth-child(2) { animation-delay: 1s; }
.paragraph:nth-child(3) { animation-delay: 1.5s; }
.paragraph:nth-child(4) { animation-delay: 2s; }
.paragraph:nth-child(5) { animation-delay: 2.5s; }
.paragraph:nth-child(6) { animation-delay: 3s; }
.paragraph:nth-child(7) { animation-delay: 3.5s; }
.paragraph:nth-child(8) { animation-delay: 4s; }
.paragraph:nth-child(9) { animation-delay: 4.5s; }
.paragraph:nth-child(10) { animation-delay: 5s; }
.paragraph:nth-child(11) { animation-delay: 5.5s; }
.paragraph:nth-child(12) { animation-delay: 6s; }
.paragraph:nth-child(13) { animation-delay: 6.5s; }

@keyframes paragraphFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* スクロールインジケーター */
.scroll-indicator {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 50px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    z-index: 20;
    transition: opacity 0.3s;
}

.scroll-indicator::before {
    content: '';
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    left: 50%;
    top: 10px;
    transform: translateX(-50%);
    animation: scrollDown 2s ease-in-out infinite;
}

@keyframes scrollDown {
    0% { top: 10px; opacity: 1; }
    100% { top: 30px; opacity: 0; }
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .novel-content {
        padding: 50px 20px;
        font-size: 1rem;
    }
    
    h1 {
        writing-mode: horizontal-tb;
        font-size: 2rem;
    }
}