/* 基本設定 */

body {
    font-family: "M PLUS 1", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    background-color: #f9f9f9;
    color: #667; 
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}
.game-container {
    background-color: white;
    padding: 30px 30px 50px;
    margin: 1em;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    text-align: center;
    width: 90%;
    max-width: 500px;
}
/* hiddenクラスはそのまま */
.hidden { display: none !important; }

/* ===== スタート画面 ===== */
.logo {
     width: 200px;
     margin-bottom: 8px;
     }
.sub-title {
    font-size: 1.2em;
    color: #f48fb1;
    text-shadow: 1px 2px 3px rgba(232, 138, 170, 0.3);
}
.catch-copy {
    font-size: 2.5em;
    color: #f8b3c3;
    font-family: "Nico Moji", sans-serif;
    font-weight: 400;
    margin: 0 0 60px;
    text-shadow: 1px 2px 3px rgba(232, 138, 170, 0.3);
}
#start-button, #restart-button {
    background-color: #f8b3c3;
    color: white;
    border: none;
    padding: 15px 32px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); /* 影を柔らかく */
}
#restart-button {
    font-size: 1em;
}
#start-button:hover, #restart-button:hover { background-color: #f48fb1; }


/* ===== クイズ画面（sample.png風） ===== */
#scenario-text {
    font-size: 1em;
    line-height: 1.6;
    margin: 20px 0;
}
#question-text {
    font-size: 1.2em;
    font-weight: 500;
    margin: 30px 0;
}
#choices-area button {
    display: block;
    width: 100%;
    background-color: #f8b3c3;
    color: white;
    border: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-family: "M PLUS 1", sans-serif;
    font-size: 1em;
    cursor: pointer;
    margin: 16px auto;
    transition: background-color 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); /* 影を柔らかく */ 
}
#choices-area button:hover { background-color: #f48fb1; }

@media screen and (min-width: 500px) {
    #choices-area button {
        width: 80%;
    }
}

/* ===== ロジのコメント部分 ===== */
.roji-comment {
    display: flex;
    align-items: flex-start;
    margin-top: 20px; text-align: left; }
.roji-icon {
    width: 60px;
    height: 60px; 
    border-radius: 50%; 
    margin-right: 15px; 
    object-fit: cover; }
.speech-bubble { 
    position: relative; 
    background: #fffaf2; 
    border-radius: 10px; 
    padding: 15px;
    flex-grow: 1;
    margin-bottom: 16px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); /* 影を柔らかく */ }
.speech-bubble::before { 
    content: ''; 
    position: absolute; 
    left: -20px; 
    top: 20px; 
    border: 10px solid transparent; 
    border-right-color: #fffaf2;
}

/* ===== フィードバック画面（モーダル）===== */
#feedback-modal { 
    position: fixed; 
    top: 0; left: 0; 
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.5); 
    display: flex; 
    justify-content: center; 
    align-items: center; }
.modal-content { 
    background-color: white; 
    padding: 30px; 
    border-radius: 15px; 
    text-align: center; 
    width: 80%; 
    max-width: 450px; }
#feedback-title { 
    font-size: 2.5em; 
    margin: 0 0 10px 0; }
#feedback-title.correct { 
    color: #f48fb1;
    text-shadow: 1px 2px 3px rgba(0,0,0,0.1); }
#feedback-title.incorrect { 
    color: #99bdff;
    text-shadow: 1px 2px 3px rgba(0,0,0,0.1); }
#note-link { 
    display: block; 
    margin: 20px 0; 
    color: #f48fb1;
    font-size: 0.875em; 
    font-weight: 400; }
#next-question-button { 
    background-color: #f8b3c3; 
    color: white; 
    border: none; 
    padding: 10px 40px; 
    border-radius: 20px; 
    font-size: 1.2em; 
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1); /* 影を柔らかく */ 
 }
#next-question-button:hover { background-color: #f48fb1; }

/* ===== 最終結果画面 ===== */
#final-score { font-size: 1.5em; font-weight: bold; }
#final-stars {
    font-size: 2.2em;
    color: #ffd700; /* 星の色をゴールドに */
    margin: 8px 0;
}
.title { font-size: 2em; font-weight: bold; color: #ff99bd; margin: 8px 0; text-shadow: 2px 6px 4px #ddd; }

/*アニメーションを追加*/
 /* start buttonのアニメーション */
#start-button, #next-question-button, #restart-button {
    /* 既存のスタイル */
    transition: background-color 0.3s ease, transform 0.2s ease; /* transformを追加 */
}
#start-button:hover, #next-question-button:hover, #restart-button:hover {
    background-color: #f48fb1;
    transform: scale(1.05); /* ホバーで少し拡大 */
}
#start-button:active, #next-question-button:active, #restart-button:active {
    transform: scale(0.98); /* クリック時に少し縮小 */
}
/*クイズ画面表示時のアニメーション*/
.game-container {
    /* 既存のスタイル */
    overflow: hidden; /* 子要素のtransformによってはみ出さないように */
}

#quiz-screen {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
#quiz-screen.show { /* JavaScriptでこのクラスを追加 */
    opacity: 1;
    transform: translateY(0);
}
/*選択肢ボタンの出現アニメーション*/
#choices-area button {
    /* 既存のスタイル */
    opacity: 0; /* 初期状態を透明に */
    transform: translateY(10px); /* 少し下にずらす */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
#choices-area button.show-choice { /* JavaScriptでこのクラスを追加 */
    opacity: 1;
    transform: translateY(0);
}
/*フィードバックモーダルの表示アニメーション*/
#feedback-modal {
    /* 既存のスタイル */
    opacity: 0; /* 初期状態を透明に */
    transform: scale(0.9); /* 少し小さく */
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}
#feedback-modal:not(.hidden) { /* hiddenクラスがない場合にアニメーションを適用 */
    opacity: 1;
    transform: scale(1);
}

/*最終結果画面のアニメーション*/
#final-result-screen > *:not(button) { /* ボタン以外の要素に適用 */
    opacity: 0;
    transform: translateY(10px);
}
#final-result-screen.show-results > *:nth-child(1) { /* 1番目の子要素（h2） */
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
    opacity: 1;
    transform: translateY(0);
}
#final-result-screen.show-results > *:nth-child(2) { /* 2番目の子要素（スコア） */
    transition: opacity 0.4s ease-out 0.1s, transform 0.4s ease-out 0.1s; /* 少し遅延 */
    opacity: 1;
    transform: translateY(0);
}
#final-result-screen.show-results > *:nth-child(3) { /* 3番目の子要素（称号h3） */
    transition: opacity 0.4s ease-out 0.2s, transform 0.4s ease-out 0.2s;
    opacity: 1;
    transform: translateY(0);
}
#final-result-screen.show-results > *:nth-child(4) { /* 星 */
    transition: opacity 0.4s ease-out 0.3s, transform 0.4s ease-out 0.3s;
    opacity: 1;
    transform: translateY(0);
}
#final-result-screen.show-results > *:nth-child(5) { /* 称号タイトル */
    transition: opacity 0.4s ease-out 0.4s, transform 0.4s ease-out 0.4s;
    opacity: 1;
    transform: translateY(0);
}
#final-result-screen.show-results .roji-comment { /* ロジのコメント */
    transition: opacity 0.4s ease-out 0.5s, transform 0.4s ease-out 0.5s;
    opacity: 1;
    transform: translateY(0);
}