body {
    font-family: 'Kiwi Maru', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #fdf8e1; /* 優しいクリーム色 */
}

h1 {
    color: #e67e22;
    font-weight: 500;
}

.container {
    background-color: #fff;
    padding: 30px 40px;
    border-radius: 20px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    text-align: center;
    border: 3px solid #f39c12;
    min-width: 300px;
}

#game-area {
    margin-bottom: 20px;
}

#problem-display {
    font-size: 2.5em;
    margin-bottom: 20px;
    font-weight: 500;
    color: #34495e;
}

#answer-input {
    padding: 10px;
    font-size: 1.5em;
    margin-bottom: 20px;
    text-align: center;
    border: 2px solid #bdc3c7;
    border-radius: 10px;
    width: 100px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#answer-input:focus {
    outline: none;
    border-color: #f39c12;
    box-shadow: 0 0 8px rgba(243, 156, 18, 0.4);
}

/* --- ボタンの共通スタイル --- */
.btn {
    padding: 10px 20px;
    font-size: 1.2em;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Kiwi Maru', sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px #999;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px #999;
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px #666;
}

#submit-button {
    background-color: #2ecc71; /* 明るい緑 */
    box-shadow: 0 4px #27ae60;
}

#feedback-display {
    font-size: 1.2em;
    margin-top: 15px;
    min-height: 1.5em; /* 高さを確保してレイアウトが崩れないように */
}

#timer-display {
    font-size: 1.2em;
    margin-top: 15px;
    margin-bottom: 20px;;
    color: #7f8c8d;
}

#records-area {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px dashed #bdc3c7;
}

#records-display {
    text-align: center;
}

.hidden {
    display: none;
}

#level-clear-container {
    padding: 20px 0;
}

#level-clear-message {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #2980b9;
}

#continue-button, #quit-button, #quit-button2 {
    padding: 12px 24px;
    margin: 0 10px;
}

#continue-button {
    background-color: #3498db; /* 青 */
    box-shadow: 0 4px #2980b9;
}

#quit-button, #quit-button2 {
    background-color: #e74c3c; /* 赤 */
    box-shadow: 0 4px #c0392b;
}

#start-button, #restart-button {
    padding: 15px 30px;
    font-size: 1.5em;
    margin-top: 20px;
    background-color: #f39c12; /* オレンジ */
    box-shadow: 0 6px #e67e22;
}

#game-over-container {
    padding: 20px 0;
}

#game-over-message {
    font-size: 1.8em;
    margin-bottom: 20px;
    color: #333;
}

#start-container {
    padding: 40px 0;
}

#start-options {
    margin-top: 20px;
}

#start-options p {
    margin-bottom: 15px;
    font-size: 1.1em;
}

#resume-start-button {
    background-color: #3498db; /* 青 */
    box-shadow: 0 4px #2980b9;
    margin: 5px;
}

#new-start-button {
    background-color: #95a5a6; /* グレー */
    box-shadow: 0 4px #7f8c8d;
    margin: 5px;
}

#records-display table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

#records-display th,
#records-display td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
}

#records-display th {
    background-color: #f2f2f2;
    font-weight: 500;
    color: #34495e;
}

/* --- アニメーション --- */
.incorrect {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.correct-animation {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); color: #2ecc71; }
}
