/* ==========================================================================
   タイトル画面専用CSS (page-title.php用)
   ========================================================================== */

/* 1. タイトル画面の初期状態 */
.title-screen,
.title-screen-2 {
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.title-screen.active,
.title-screen-2.active {
    display: flex;
    opacity: 1;
}

/* 最初の画面だけ表示 */
#title-screen {
    display: flex;
    opacity: 1;
}


/* 2. 注意画面のスタイル */
.title-screen {
    background-color: rgb(255 243 215);
    height: 100vh;
    position: absolute;
    max-width: 420px;
    width: 100%;
    max-height: 900px;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 10;
    margin: auto;
}

.title-screen-box {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    max-height: 900px;
    margin: auto;
    text-align: center;
    height: fit-content;
}

.title-screen-text {
    color: #4A1900;
    text-align: center;
    margin: 32px;
}

.sankaku-img {
    width: 100px;
    margin: 0 auto;
}

.title-screen-button {
    padding: 20px;
    border-radius: 50px;
    background-color: orange;
    width: 70%;
    margin: 0 auto;
    margin-top: 40px;
    color: white;
    cursor: pointer;
}


/* 3. 音声トグルスイッチ */
.audio-toggle-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.audio-toggle-label {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
}

.toggle-switch {
    position: relative;
    width: 70px;
    height: 34px;
    background-color: #ccc;
    border-radius: 34px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.toggle-switch.active {
    background: linear-gradient(90deg, rgba(247, 208, 93, 1), rgba(254, 153, 64, 1));
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 28px;
    height: 28px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(36px);
}

.audio-status-icon {
    font-size: 20px;
    transition: opacity 0.3s ease;
}

.audio-status-icon.hidden {
    opacity: 0.3;
}


/* 4. タイトル画面2・3 (背景アニメーション付き) */
.title-screen-2,
.title-screen-3 {
    background: url(https://template-banban.com/wp-content/themes/banban/img/title-back.webp) repeat-x;
    background-position: 0 0;
    -webkit-animation: bgroop 30s linear infinite;
    animation: bgroop 40s linear infinite;
    height: 100vh;
    position: absolute;
    max-width: 420px;
    max-height: 900px;
    width: 100%;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 9;
    margin: auto;
}

@-webkit-keyframes bgroop {
    from {
        background-position: 0  0;
    }
    to {
        background-position: -2000px 0;
    }
}

@keyframes bgroop {
    from {
        background-position: 0 0;
    }
    to {
        background-position: -2000px 0;
    }
}

#title-screen-3 {
    z-index: 8;
}

/* タイトル画面2をクリック可能に */
#title-screen-2 {
    cursor: pointer;
    animation: none !important;
}

#title-screen-2:hover {
    opacity: 0.95;
}


/* 5. ロゴとアニメーション */
.logo-img {
    width: 90%;
    transform: translateY(-400px);
    opacity: 0;
    transition: transform 2s ease-out, opacity 2s ease-out;
    margin: 0 auto;
}

.logo-img.logo-end {
    transform: translateY(0);
    opacity: 1;
}

/* 中間画像のスタイル(ロゴアニメーション後にふわっと表示) */
.middle-img {
    width: 90%;
    margin: 20px auto;
    display: block;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.middle-img.middle-img-end {
    opacity: 1;
    transform: scale(1);
}

/* タップスタート画像のアニメーション(点滅) */
.start-img {
    width: 140px;
    margin: 20px auto;
    display: block;
    transform: scale(0, 0);
    opacity: 0;
    transition: transform 0.5s ease-out, opacity 0.5s ease-out;
}

.start-img.start-img-end {
    transform: scale(1, 1);
    opacity: 1;
    animation: blink 1.5s ease-in-out infinite;
}

/* 点滅アニメーション(完全に消える) */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}


/* 6. 選択肢画面のスタイル */
#choice-screen {
    display: none;
    opacity: 0;
    animation: none !important;
    position: absolute;
    max-width: 420px;
    max-height: 900px;
    width: 100%;
    height: 100vh;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    z-index: 9;
}

#choice-screen.active {
    display: flex;
    opacity: 1;
}

.choice-screen-box {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.choice-screen-title {
    font-size: 24px;
    color: #ffffff;
    text-align: center;
    font-weight: bold;
    margin-bottom: 60px;
    line-height: 1.6;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.choice-cards {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 30px;
    align-items: center;
}

.choice-card {
    width: 90%;
    max-width: 360px;
    display: block;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.choice-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.choice-card img {
    width: 100%;
    height: auto;
    display: block;
}


/* 7. スマホ推奨メッセージ */
.sp-onegai {
    display: flex;
    width: 90%;
    margin: 0 auto;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
}

.sp-onegai img {
    width: 18px;
    height: 28px;
    margin-right: 10px;
}

.sp-onegai p {
    font-weight: normal;
    font-size: 12px;
    margin: 0;
    color: #fff;
}


/* 8. レスポンシブ対応 */
@media (max-width: 600px) {
    .title-screen,
    .title-screen-2,
    .title-screen-3 {
        max-width: 600px;
    }
    
    .choice-screen-title {
        font-size: 20px;
    }
}