body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #eef2f7; /* Light bluish grey */
    color: #333a40;
}

header {
    background: linear-gradient(90deg, #4a69bd, #6a89cc); /* Gradient blue */
    color: #ffffff;
    padding: 1.2rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 600;
}

header nav {
    margin-top: 0.5rem;
}

header nav a.nav-button {
    color: #ffffff;
    text-decoration: none;
    margin: 0 12px;
    padding: 8px 15px;
    border-radius: 20px; /* Pill shape */
    background-color: rgba(255,255,255,0.2);
    transition: background-color 0.3s ease;
}
header nav a.nav-button:hover {
    background-color: rgba(255,255,255,0.4);
}


main {
    padding: 25px;
    max-width: 1200px;
    margin: 20px auto;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

footer {
    text-align: center;
    padding: 20px;
    margin-top: 30px;
    color: #555c63;
    font-size: 0.9em;
    border-top: 1px solid #d1d8e0;
}

h2, h3, h4 {
    color: #2c3e50; /* Darker blue */
}
h2 { margin-top: 0; }

input[type="number"], input[type="file"], button {
    padding: 10px 12px;
    margin: 8px 0;
    border-radius: 5px;
    border: 1px solid #ced4da;
    font-size: 1em;
}
input[type="range"]{
    vertical-align: middle;
}

button, .button-primary, .button-secondary, .button-action, .button-start-game, .button-navigation {
    cursor: pointer;
    border: none;
    font-weight: 500;
    text-decoration: none; /* For a tags styled as buttons */
    display: inline-block; /* For a tags */
    text-align: center;
     transition: background-color 0.2s ease-in-out, transform 0.1s ease;
}
button:active, .button-primary:active, .button-navigation:active {
    transform: translateY(1px);
}


.button-primary { /* Greenish */
    background-color: #28a745; 
    color: white;
}
.button-primary:hover { background-color: #218838; }

.button-secondary { /* Greyish */
    background-color: #6c757d;
    color: white;
}
.button-secondary:hover { background-color: #5a6268; }

.button-action { /* Bluish */
    background-color: #007bff;
    color: white;
}
.button-action:hover { background-color: #0069d9; }

.button-start-game {
    background-color: #ffc107; /* Amber */
    color: #212529;
    font-size: 1.2em;
    padding: 12px 25px;
}
.button-start-game:hover { background-color: #e0a800; }

.button-navigation {
    background-color: #5dade2; /* Light blue */
    color: white;
    padding: 10px 20px;
    margin: 5px;
    border-radius: 5px;
}
.button-navigation:hover { background-color: #3498db; }


.simulator-container, .game-container {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
}

.controls {
    flex: 1;
    min-width: 320px;
    background: #f8f9fa; /* Lighter grey */
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}
.control-group {
    margin-bottom: 18px;
}
.control-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}
.control-group label.sub-label {
    font-weight: normal;
    margin-left: 15px;
    font-size: 0.95em;
}
.control-group small {
    display: block;
    font-size: 0.85em;
    color: #6c757d;
    margin-top: 3px;
}


.canvas-area {
    flex: 2;
    min-width: 400px; /* Ensure canvas has enough space */
    text-align: center;
}

#simulatorCanvas, #gameRayCanvas {
    border: 1px solid #adb5bd;
    background-color: #f0f4f8; /* Very light blue for canvas */
    border-radius: 4px;
    max-width: 100%; /* Responsive canvas */
    height: auto; /* Maintain aspect ratio */
}

.info-text {
    margin-top: 10px;
    font-style: italic;
    color: #007bff;
}
.info-text-small {
    font-size: 0.9em;
    color: #555;
}


/* Game specific styles */
#gameStartScreen { text-align: center; padding: 20px; }
.patient-intro { font-size: 1.1em; margin-bottom: 20px; font-style: italic; color: #0056b3;}
#gameStartScreen ul { list-style-position: inside; text-align: left; max-width: 500px; margin: 15px auto; padding-left: 20px;}


.info-box {
    margin-top: 15px;
    padding: 12px;
    background: #e9ecef;
    border-left: 4px solid #007bff; /* Blue accent */
    border-radius: 4px;
}
.results-box { border-left-color: #28a745; /* Green accent for results */ }
.results-box p { margin: 8px 0; }
.win-loss-message { font-weight: bold; font-size: 1.1em; }
.win-loss-message.win { color: #28a745; }
.win-loss-message.loss { color: #dc3545; }


.final-guess-area { margin-top: 25px; padding-top: 15px; border-top: 1px solid #dee2e6; }
.spoiler-diagram { margin-top: 25px; padding-top: 15px; border-top: 1px dashed #adb5bd; }
.spoiler-diagram p { margin-bottom: 10px; }

/* Index page specifics */
.content-section {
    background-color: #fff;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.upload-form { margin-top: 10px; }
.uploaded-image-preview {
    max-width: 200px; /* Ensure this matches MAX_DIMENSION if used */
    max-height: 200px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    margin-top: 10px;
    display: block; /* Center if desired with margin: auto */
}
.navigation-links a { margin-right: 10px; }

.explanation-section {
    margin-top: 20px;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}
.explanation-section h4 { margin-top: 0;}
.explanation-section ul li { margin-bottom: 5px; }

/* Input with sign toggle button */
.input-with-button {
    display: flex;
    align-items: center;
}

.input-with-button input {
    flex-grow: 1;
    margin-right: -1px; /* Overlap borders */
}

.sign-toggle-btn {
    padding: 10px 12px;
    margin: 8px 0;
    margin-left: 5px;
    background-color: #6c757d;
    color: white;
    flex-shrink: 0;
}

.sign-toggle-btn:hover {
    background-color: #5a6268;
}

.sign-toggle-btn:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}