body {
    font-family: sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 2rem;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
    box-sizing: border-box;
}

.container {
    position: relative;
    text-align: center;
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: background-color 0.3s ease; /* Add transition for smooth color change */
}

h1 {
    color: #333;
}

.settings {
    margin-bottom: 1rem;
}

#digit-selector {
    width: 50px;
    padding: 5px;
    font-size: 1rem;
}

.number-display {
    font-size: 4rem;
    font-weight: bold;
    margin: 2rem 0;
    min-height: 5rem;
    color: #007bff;
}

.input-area input {
    font-size: 1.5rem;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.input-area button {
    font-size: 1.2rem;
    padding: 0.6rem 1rem;
    margin-left: 0.5rem;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
}

.score-area {
    margin-top: 1.5rem;
    font-size: 1.2rem;
}

#start-button {
    display: block;
    margin: 1rem auto 0;
    font-size: 1.5rem;
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
}

/* Custom Dialog */
.dialog-overlay {
    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;
    z-index: 1000;
}

.dialog-box {
    background-color: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 80%;
}

#dialog-message {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

#dialog-close-button {
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
}

/* Difficulty Styles */
body.difficulty-easy {
    background-color: #e0f7fa; /* Light Cyan */
}
body.difficulty-easy .number-display {
    color: #00796b; /* Teal */
}

body.difficulty-medium {
    background-color: #fff9c4; /* Light Yellow */
}
body.difficulty-medium .number-display {
    color: #f57f17; /* Amber */
}

body.difficulty-hard {
    background-color: #ffcdd2; /* Light Pink */
}
body.difficulty-hard .number-display {
    color: #c62828; /* Red */
}

/* Menu */
#menu-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1100;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.menu-list li {
    padding: 0.8rem 1.5rem;
    cursor: pointer;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.menu-list li:hover {
    background-color: #f0f0f0;
}

#menu-popup .dialog-box {
    max-width: 300px; /* メニューの幅を調整 */
}

#menu-close-button, #help-close-button {
    font-size: 1rem;
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    background-color: #6c757d; /* Gray */
    color: white;
    border: none;
    border-radius: 5px;
}

/* Animations */
@keyframes number-focus {
    from {
        transform: scale(1);
        opacity: 0.8;
    }
    to {
        transform: scale(1.1);
        opacity: 1;
    }
}

.number-focus-animation {
    animation: number-focus 0.3s ease-in-out alternate 2;
}

