﻿/* ===== TOP全体 ===== */
#top {
    width: 100%;
    height: 100vh;
}

.top_body {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
}

/* ===== 背景 ===== */
.bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 1;
    transition: opacity 1.2s ease;
}

.bg1 { 
    background-image: url("../image/title01.webp"); 
    z-index: 1; 
}

.bg2 { 
    background-image: url("../image/title02.webp"); 
    z-index: 2; 
    opacity: 0; 
}
.bg2.active { opacity: 1; }

/* ★白ホワイトアウトレイヤー */
.white-transition {
    position: absolute;
    inset: 0;
    background: #ffffff;
    z-index: 35;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}
.white-transition.active { 
    opacity: 1; 
}

/* ===== UI ===== */
.top_main {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

/* テキストセット */
.text-set {
    position: absolute;
    inset: 0;
    opacity: 0;
    visibility: hidden;
    z-index: 20;
    transition: opacity 0.6s ease;
}

.text-set.active {
    opacity: 1;
    visibility: visible;
}

/* 文字画像 */
#set1 .moji, #set1 .sub,
#set2 .moji, #set2 .sub {
    position: absolute;
    opacity: 0;
    transition: opacity 0.8s ease;
    display: block;
}

#set1.active .moji,
#set1.active .sub,
#set2.active .moji,
#set2.active .sub {
    opacity: 1;
}

/* 位置 */
#set1 .moji, #set2 .moji { top: 50px; right: 200px; z-index: 50; }
#set1 .sub,  #set2 .sub  { bottom: 50px; left: 150px; z-index: 55; }

/* ===== NEXTボタン（PC版） ===== */
.next-button {
    position: absolute;
    bottom: 40px;
    right: 40px;
    z-index: 30;
    padding: 12px 32px;
    font-size: 18px;
    background: rgba(0,0,0,0.7);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    border: 1px solid white;
}

.next-button.active {
    opacity: 1;
}

.next-button:hover {
    background: rgba(0,0,0,0.9);
    transform: scale(1.05);
}

/* ============================================= */
/* ================ スマホ版 =================== */
/* ============================================= */
@media screen and (max-width: 768px) {
    /* 背景画像 */
    .bg1 { 
        background-image: url("../image/titles01.png"); 
    }
    
    .bg2 { 
        background-image: url("../image/titles02.png"); 
        display: block;
        opacity: 0;
    }
    .bg2.active { 
        opacity: 1; 
    }

    /* テキストセットは非表示 */
    .text-set { 
        display: none !important; 
    }

    /* スマホ版ボタン：四角く・小さく調整 */
        .next-button {
            display: block;
            bottom: 15px;
            right: 5px;

            padding: 2px 5px;
            font-size: 10px;

            border-radius: 4px;

            min-width: auto;
            width: auto;
            height: auto;

            background: rgba(0,0,0,0.75);
            border: 1px solid white;

            text-align: center;
        }
    
    .next-button.active {
        opacity: 1;
    }

    .next-button:hover {
        background: rgba(0,0,0,0.9);
        transform: scale(1.08);
    }
}