body {
    font-family: sans-serif;
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
}

.container {
    background-color: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 600px;
}

h1 {
    color: #333;
    margin-bottom: 25px;
}

.image-area {
    height: 300px; 
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    border: 2px solid #ddd;
    border-radius: 5px;
    background-color: #fafafa;
    /* 新しい演出のための設定 */
    overflow: hidden; /* 画像がエリア外からスライドしてくる際に、外側を隠す */
}

#quizImage {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; 
    
    /* 初期状態 */
    transform: translateY(0); /* 通常の位置 */
    opacity: 1;
    transition: none; /* 通常時はアニメーションしない */
}

/* 答を見るボタンを押した瞬間の「揺れ」アニメーション */
.shake {
    animation: shake-animation 0.5s ease-in-out;
}

/* 答えの画像が下からスライドして現れるアニメーション */
.slide-up {
    opacity: 1; 
    transform: translateY(0); /* 最終的な位置（元の場所） */
    transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275); /* バウンドするような演出 */
}

/* 答えの画像が表示される前の準備状態（下側に隠す） */
.slide-prep {
    opacity: 0;
    transform: translateY(100%); /* 画面下側（外）に隠しておく */
    transition: none;
}


/* --- キーフレーム定義 --- */
@keyframes shake-animation {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* --- 以下、既存のスタイル --- */

.message {
    font-size: 1.5em;
    font-weight: bold;
    color: #007bff; 
    min-height: 30px;
    margin-bottom: 20px;
}

.message.answer {
    color: #28a745; 
}

.button-area button {
    padding: 10px 20px;
    font-size: 1.1em;
    margin: 0 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

#answerButton {
    background-color: #ffc107;
    color: #333;
}

#answerButton:hover {
    background-color: #e0a800;
}

#nextButton {
    background-color: #007bff;
    color: white;
}

#nextButton:hover:not(:disabled) {
    background-color: #0056b3;
}

#nextButton:disabled {
    background-color: #b3d4fc;
    cursor: not-allowed;
}