.game-container body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background: linear-gradient(to bottom, #f4f4f4, #e0e0e0); /* Light gray gradient */
    color: #333333; /* Dark gray default text */
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.game-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #ffffff; /* White background */
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    width: 90%;
    max-width: 400px;
}

header {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

header h1 {
    color: #0056b3; /* Darker blue, consistent with buttons */
}

.score-container p {
    margin: 0;
    font-size: 1.2em;
}

#instruction-text {
    color: #333333; /* Dark gray text */
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: none; /* Remove shadow for light background */
    margin-top: 10px;
    margin-bottom: 15px;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(3, 80px);
    grid-template-rows: repeat(3, 80px);
    gap: 5px;
    border: 2px solid #cccccc; /* Lighter border */
    padding: 5px;
    background-color: #f0f0f0; /* Keep light background */
    margin-bottom: 20px;
}

.grid-cell {
    width: 80px;
    height: 80px;
    background-color: #e0e0e0; /* Light gray background */
    border: 2px solid #b0b0b0; /* Medium gray border */
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.8em;
    color: #333333; /* Dark gray text */
    cursor: pointer;
    user-select: none;
    transition: background-color 0.3s, border-color 0.3s;
    box-sizing: border-box;
}

.grid-cell.selected {
    background-color: #a0d4ff; /* Selected state - more vibrant blue */
    border-color: #c0e5ff;
    color: #000;
}

.grid-cell:not(.selected):hover {
    background-color: #cccccc; /* Slightly darker light gray */
    border-color: #a0a0a0; /* Slightly darker border */
}

.grid-cell.error-flash {
    animation: flash-red 0.5s ease-in-out;
}

@keyframes flash-red {
    50% {
        background-color: #e74c3c; /* 間違いを示す赤色 */
        border-color: #c0392b;
    }
}

footer {
    text-align: center;
    margin-top: 20px;
    width: 100%;
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px; /* Space between buttons */
}

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

#complete-button {
    background-color: #4CAF50; /* Green */
}

#complete-button:hover {
    background-color: #45a049;
}

#log-button {
    background-color: #007bff; /* Blue */
}

#log-button:hover {
    background-color: #0069d9;
}

/* Result Screen Styles */
.result-container {
    background-color: #ffffff; /* White background */
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    width: 90%;
    max-width: 450px;
    text-align: center;
}

.result-icon {
    width: 80px;
    height: 80px;
    background-color: #cccccc; /* Medium light gray */
    border-radius: 50%;
    margin: 0 auto 20px;
    /* 将来的にここにSVGや画像を表示することもできます */
}

.result-container p {
    color: #333333; /* Dark gray text */
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 30px;
    text-shadow: none; /* Remove shadow for light background */
}

.result-container .score-text {
     font-size: 2em;
     margin-bottom: 20px;
}

.result-container .thinking-type-text {
    font-size: 1.5em;
    color: #a0a0a0;
    margin-bottom: 30px;
}

.result-buttons a, .result-buttons button {
    display: block;
    width: 80%;
    margin: 15px auto;
    padding: 12px 20px;
    font-size: 1.1em;
    color: white;
    font-weight: bold; /* 文字を太字に */
    text-decoration: none;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.result-buttons .retry-button {
    background-color: #0056b3; /* 通常時の背景色を濃く */
}

.result-buttons .retry-button:hover {
    background-color: #004085; /* ホバー時の背景色をさらに濃く */
}

.result-buttons .home-button {
    background-color: #6c757d;
}

.result-buttons .home-button:hover {
    background-color: #545b62;
}

/* Home Screen Styles */
.home-container {
    background-color: #ffffff; /* White background */
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Lighter shadow */
    text-align: center;
}

.home-container h1 {
    color: #0056b3; /* Darker blue, consistent with buttons */
    margin-bottom: 30px;
}

.home-container p {
    margin-bottom: 25px;
}

.home-container a {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 1.2em;
    transition: background-color 0.3s;
}

.home-container a:hover {
    background-color: #0056b3;
}

.difficulty-selector {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.difficulty-btn {
    padding: 10px 20px;
    font-size: 1em;
    color: #333;
    background-color: #e0e0e0;
    border: 2px solid #b0b0b0;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.difficulty-btn:hover {
    background-color: #cccccc;
    border-color: #a0a0a0;
}

.difficulty-btn.selected {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.start-button.disabled {
    background-color: #6c757d;
    opacity: 0.6;
    cursor: not-allowed;
}
