body {
    margin: 0;
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f0f0f0;
    color: #333;
}

#main-content {
    display: flex;
    flex-grow: 1;
    height: calc(100vh - 90px); /* keep the whole 3D scene visible; UI panel scrolls internally */
}

#scene-container {
    flex-grow: 1;
    background-color: #111;
    height: 100%;
    position: relative;
}

#ui-panel {
    width: 300px;
    padding: 20px;
    box-sizing: border-box;
    flex-shrink: 0;
    height: 100%;
    background-color: #fff;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
    overflow-y: auto;
    border-left: 1px solid #ccc;
}

h2, h3, h4 {
    color: #0056b3;
    margin-top: 0;
}

.control-group, .info-group, .fun-stuff {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}
.control-group:last-child, .info-group:last-child, .fun-stuff:last-child {
    border-bottom: none;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="range"] {
    width: 100%;
}

button {
    padding: 8px 15px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-right: 6px;
    margin-bottom: 6px;
}

button:hover {
    background-color: #0056b3;
}

.swatch {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 3px;
    margin-right: 6px;
    vertical-align: middle;
    border: 1px solid #999;
}

#forceValue, #omegaValue, #currentValueDisplay, #magnetValueDisplay, #polarityText {
    font-weight: bold;
    color: #d9534f;
}

#description {
    max-width: 900px;
    margin: 0 auto;
    padding: 25px 20px;
    background-color: #fff;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    line-height: 1.6;
}

#description ul li, #description ol li {
    margin-bottom: 8px;
}

.quiz details {
    margin: 6px 0 12px;
    padding: 8px 12px;
    background-color: #e9f2fb;
    border-left: 4px solid #007bff;
    border-radius: 4px;
}

.quiz summary {
    cursor: pointer;
    font-weight: bold;
    color: #0056b3;
}

.credits {
    font-style: italic;
}

footer {
    width: 100%;
    padding: 10px 0;
    text-align: center;
    background-color: #333;
    color: #fff;
    margin-top: auto;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

footer a {
    color: #9fd3ff;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #main-content {
        flex-direction: column;
        height: auto;
    }

    #scene-container {
        flex-grow: 0;
        width: 100%;
        height: 60vh;
        min-height: 300px;
    }

    #ui-panel {
        width: 100%;
        box-sizing: border-box;
        flex-shrink: 1;
        border-left: none;
        box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
        padding: 15px;
    }
}
