html {
    height: 100%;
}

.wrapper {
    min-height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 1fr;
    width: 100%;
}

body {
    background: #e2e2e7; /* Light gray background for subtle contrast */
    color: #333; /* Dark gray text for better readability */
    font-family: 'Noto Sans JP', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    flex-direction: column;
    height: 100%;
}

footer {
    text-align: center;
    font-size: 14px;
    color: #555; /* Medium gray text */
    background: #e0e0e0; /* Light gray background */
    padding: 10px 10px;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for footer */
    line-height: 1.2;
    margin: 0;
}

footer a {
    color: #007acc; /* Blue links for better visibility */
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.page {
    padding: 20px;
}

#loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: #333;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); /* Slightly stronger shadow */
}

#question {
    font-size: 24px;
    margin: 10px;
    color: #333;
}

#timer {
    font-size: 18px;
    color: #d32f2f; /* Red for timer */
    margin-top: 10px;
}

#input {
    font-size: 18px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    margin-top: 10px;
    background: #fff;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for input */
}

#input.anaume {
    width: 30px;
    text-align: center;
    font-size: 18px;
    padding: 5px;
    margin: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #333;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#score {
    font-size: 18px;
    margin-top: 10px;
    color: #388e3c; /* Green for score */
}

#lives {
    font-size: 18px;
    margin-top: 10px;
    color: #d32f2f; /* Red for lives */
}



h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #333;
}

h2 {
    font-size: 20px;
    margin: 5px 0;
    color: #333;
}

.container {
    margin-bottom: 10px;
}

#gameOverPrompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    color: #333;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2); /* Stronger shadow for modal */
}

#gameOverPrompt button {
    font-size: 16px;
    padding: 8px 16px;
    margin: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #007acc;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#gameOverPrompt button:hover {
    background: #005f99;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

#explanation {
    margin-right: auto;
    margin-left: auto;
    width: 60%;
    @media (max-width: 1024px) {
        width: 100%;
    }
}

#puzzle2_mode {
    text-align: center;
    margin-top: 20px;
    padding: 10px;
}

#puzzle2_quiz {
    display: inline-block;
    margin: 20px auto;
    text-align: center;
    max-width: 100%;
}

.puzzle-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px 0;
    flex-wrap: nowrap;
}

#puzzle2_right {
    white-space: nowrap;
}

.puzzle-row p {
    margin: 5px 10px;
    font-size: 24px;
    font-weight: bold;
    color: #000;
}

#puzzle2_input {
    width: 50px;
    text-align: center;
    font-size: 18px;
    padding: 5px;
    margin: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    color: #000;
}

#puzzle2_arrow_left, #puzzle2_arrow_right {
    font-size: 24px;
    font-weight: bold;
    margin: 0 5px;
    color: #000;
}

/* Responsive styles for smaller screens */
@media (max-width: 600px) {
    #puzzle2_quiz {
        width: 90%; /* Ensure the quiz fits within the screen */
    }

    .puzzle-row p, #puzzle2_input, #puzzle2_arrow_left, #puzzle2_arrow_right {
        font-size: 18px; /* Reduce font size for smaller screens */
    }

    #puzzle2_input {
        width: 40px; /* Adjust input width for smaller screens */
    }
}

#explanationText div {
    margin: 5px 0;
}

.button {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 16px;
    padding: 8px 16px;
    margin-top: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #007acc; /* Blue background for buttons */
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for buttons */
}

.button:hover {
    background: #005f99; /* Darker blue on hover */
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2); /* Stronger shadow on hover */
}

#settingsButton {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #4d5053;
    border: 1px solid #ccc;
    border-radius: 50%;
    padding: 2px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#settingsButton button {
    font-size: 24px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s ease;
}

#settingsButton button:hover {
    transform: scale(1.2);
}

#settingsModal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 20px;
    border-radius: 10px;
    color: #333;
    text-align: center;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

#settingsModal h2 {
    margin-bottom: 20px;
}

#settingsModal label {
    display: block;
    margin: 10px 0;
    font-size: 18px;
    color: #333;
}

#settingsModal button {
    font-size: 16px;
    padding: 8px 16px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #007acc;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#settingsModal button:hover {
    background: #005f99;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
