/* style/loader.css (最終修正版・全コード) */

/* --- ローディング画面全体 --- */
#loader-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 9999;
    
    /* [修正箇所 1]
      背景を「垂直(90deg)」のストライプに変更します。
      これがアーチの外側の色になります。
    */
    background: repeating-linear-gradient(
        90deg, /* 90deg = 垂直ストライプ */
        #FFEAF1,      /* 薄いピンク */
        #FFEAF1 25px, /* 薄いピンクの幅 */
        #F6B8D4 25px, /* 濃いピンク */
        #F6B8D4 50px  /* 濃いピンクの幅 */
    );
    
    overflow: hidden; /* アーチの外側と雲を隠す */

    /* フェードアウト設定 */
    opacity: 1;
    visibility: visible;
    transition: opacity 1.0s ease-out, visibility 1.0s ease-out;
}

/* 非表示の状態 */
#loader-bg.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* --- アーチの作成 --- */
#loader-bg::before {
    content: '';
    position: absolute;
    left: 50%;
    width: 150vw; /* 画面幅より大きく */
    height: 150vw;
    border-radius: 50%;
    
    /* 白いエリアを作成 */
    background-color: white; 
    
    top: 6vw; 
    transform: translateX(-50%);

    /* 雲(z-index: 2)より手前(z-index: 3)に配置 */
    z-index: 3;
}
/* 下部アーチは削除済み */


/* --- コンテンツ（ロゴ・雲など） --- */
/* 中央のロゴとテキスト */
.loader-content {
    position: absolute;
    top: 45%; 
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 4; /* 白いエリア(3)より手前 */
}
.loader-logo {
    width: 60px; 
    height: auto;
    animation: loader-fade-in 1.5s ease-out;
}
.loader-title {
    font-family: 'Shippori Mincho', serif;
    font-size: 2.5rem; 
    color: #555;
    font-weight: 500;
    white-space: nowrap; 
    animation: loader-fade-in 1.5s ease-out;
}
.loader-title-large {
    font-size: 3rem; 
    font-weight: 700;
}
@keyframes loader-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* SCROLL テキスト */
.loader-scroll {
    position: absolute;
    bottom: 30%; 
    left: 50%;
    transform: translateX(-50%);
    z-index: 4; /* 白いエリア(3)より手前 */
    font-size: 1rem;
    font-weight: 500;
    color: #777;
    letter-spacing: 0.1em;
    text-align: center;
    animation: loader-fade-in 1.5s 0.5s ease-out backwards; 
}
.loader-scroll-arrow {
    display: block;
    margin: 8px auto 0;
    color: #999;
    animation: scroll-arrow-bounce 1.5s infinite ease-in-out;
}
@keyframes scroll-arrow-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(5px); }
    60% { transform: translateY(3px); }
}


/* --- 上部の雲 (CSSで作成) --- */
.loader-cloud {
    position: absolute;
    background: white; /* 雲は白 */
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    
    /*
      z-index: 2
      ストライプ背景(1) < 雲(2) < 白いアーチ(3) の順にします。
    */
    z-index: 2; 
    
    animation: drift 20s infinite linear alternate;
}
.loader-cloud::before,
.loader-cloud::after {
    content: '';
    position: absolute;
    background: white; /* 雲は白 */
    border-radius: 50%;
}
.loader-cloud {
    width: 100px;
    height: 35px;
}
.loader-cloud::before {
    width: 45px;
    height: 45px;
    top: -20px;
    left: 15px;
}
.loader-cloud::after {
    width: 60px;
    height: 60px;
    top: -25px;
    right: 10px;
}

/* 雲のサイズと位置 */
.cloud-1 { top: 5%; left: 15%; width: 90px; height: 32px; animation-delay: -5s; opacity: 0.8; }
.cloud-2 { top: 10%; left: 35%; width: 70px; height: 25px; animation-delay: -10s; opacity: 0.7; }
.cloud-3 { top: 6%; right: 30%; width: 80px; height: 28px; animation-delay: -3s; opacity: 0.9; }
.cloud-4 { top: 12%; right: 10%; width: 100px; height: 35px; animation-delay: 0s; }


/* --- 下部の町並み --- */
.loader-town-bg {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 180px; 
    z-index: 4; /* 白いエリア(3)より手前 */
    background-image: url('../image/body/town.png');
    background-position: bottom center;
    background-repeat: repeat-x; 
    background-size: auto 180px; 
    animation: loader-fade-in 1.5s 0.2s ease-out backwards;
}

/* --- レスポンシブ対応 (スマホ) --- */
@media (max-width: 768px) {
    .loader-content {
        flex-direction: column; 
        gap: 10px;
        width: 100%;
    }
    .loader-logo {
        width: 50px;
    }
    .loader-title {
        font-size: 1.5rem; 
    }
    .loader-title-large {
        font-size: 1.8rem; 
    }
    .loader-scroll {
        bottom: 25%; 
    }
    /* [修正箇所 3] アーチを浅くしたのに伴い、スマホの町並みを少し小さく */
    .loader-town-bg {
        height: 100px; 
        background-size: auto 100px;
    }
    
    .cloud-2, .cloud-4 {
        display: none;
    }
}