#canvas, #emscripten-canvas {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: black;
    touch-action: none;
}

#legend {
    position: fixed;
    left: 0;
    top: 0;
    padding: 10px;
    user-select: none;
}

#axes {
    display: block;
    pointer-events: none;
    margin-top: 5px;
    margin-left: -2px;
}

#control {
    position: fixed;
    top: 10px;
    right: 10px;
    width: min-content;
    height: min-content;
    min-width: 240px;
    max-width: 80%;
    background-color: rgba(15, 31, 23, 0.92);
    border: 1px solid rgba(74, 222, 128, 0.25);
    border-radius: 4px;
    padding: 15px 20px;
    color: #f0fdf4;
    font-size: 0.95em;
    font-family: 'Inter', 'Arial', sans-serif;
    white-space: nowrap;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

#control strong {
    color: #4ade80;
    letter-spacing: -0.01em;
}

#control a {
    color: #86efac;
    text-decoration: none;
    font-weight: 500;
}

#control a:hover {
    color: #4ade80;
    text-decoration: underline;
}

#control input[type="button"] {
    background-color: #1a2f23;
    border: 1px solid #4ade80;
    color: #f0fdf4;
    border-radius: 3px;
    padding: 0.3em 0.7em;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

#control input[type="button"]:hover {
    background-color: #4ade80;
    color: #0f1f17;
}

#control select {
    background-color: #1a2f23;
    border: 1px solid #4ade80;
    color: #f0fdf4;
    border-radius: 3px;
}

#control input[type="range"] {
    background: rgba(74, 222, 128, 0.35);
}

#control input[type="range"]::-webkit-slider-thumb {
    background: #4ade80;
}

#control input[type="range"]::-moz-range-thumb {
    background: #4ade80;
}

#error-message {
    display: inline-block;
    margin: 0.5em -0.1em;
    padding: 0.2em 0.3em;
    white-space: normal;
    margin-bottom: 0;
    background-color: yellow;
    color: red;
}

input, select, button {
    margin: 0.1em 0.2em 0.1em 0;
    display: inline-block;
    vertical-align: middle;
}

hr {
    color: rgba(255, 255, 255, 0.4);
    margin: 0.5em 0;
}

a {
    text-decoration: underline;
    color: white;
}

input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    height: 1.0em;
    background: hsl(120, 0%, 80%, 0.5);
    outline: none;
}

input[type="range"]:hover {
    background: hsl(120, 0%, 80%, 0.7);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0.0em;
    height: 1.1em;
    cursor: pointer;
    border: 0.1em solid hsl(120, 80%, 100%);
    border-radius: 0.4em;
}

input[type="range"]::-moz-range-thumb {
    width: 0.0em;
    height: 1.0em;
    cursor: pointer;
    border: 0.1em solid hsl(120, 80%, 100%);
    border-radius: 0.4em;
}

input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    background-color: rgba(232, 232, 232, 0.5);
    width: 1em;
    height: 1em;
    border-radius: 0.2em;
    display: inline-grid;
    place-content: center;
}

input[type="checkbox"]:hover {
    background-color: rgba(232, 232, 232, 1);
}

input[type="checkbox"]::before {
    content: "";
    width: 0.7em;
    height: 0.7em;
    transform: scale(0);
    background-color: white;
    clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
}

input[type="checkbox"]:checked::before {
    transform: scale(1);
}

input[type="checkbox"]:checked {
    background-color: rgb(0, 120, 237);
}

input[type="checkbox"]:checked:hover {
    background-color: dodgerblue;
}
