body {
    margin: 0;
    background-color: #ffffff;
    color: #000000;
    font-family: ui-monospace, "SF Mono", "Liberation Mono", Menlo, Consolas, monospace;
}

body:not(.home-body) {
    overflow: hidden;
}

body.maths-body {
    overflow: auto;
}

#energy-label {
    position: absolute;
    top: 0.5em;
    left: 1em;
}

#metrics-label {
    position: absolute;
    top: 50%;
    right: 1em;
    transform: translateY(-50%);
    line-height: 1.5;
    text-align: right;
}

#conserved-label {
    position: absolute;
    top: 0;
    right: 1em;
    text-align: right;
}

#parameter-summary {
    position: absolute;
    top: 0;
    right: 1em;
    line-height: 1.5;
    text-align: right;
}

#modal-toggle {
    position: absolute;
    top: 2em;
    left: 0.5em;
}

#description-toggle {
    position: absolute;
    top: 4em;
    left: 0.5em;
}

#home-link {
    position: absolute;
    top: 6em;
    left: 0.5em;
    padding: 0.15em 0.4em;
    border: 2px solid black;
    color: inherit;
    background-color: white;
    text-decoration: none;
}

#parameters-toggle {
    position: absolute;
    top: 0;
    right: 1em;
}

#parameters-panel {
    position: absolute;
    display: none;
    top: 0;
    right: 1em;
    max-width: min(28em, calc(100vw - 1em));
    padding: 0.75em;
    border: 2px solid black;
    background-color: white;
    z-index: 1;
}

#parameters-panel.shown {
    display: block;
}

#parameters-panel.available {
    display: none;
}

#parameters-panel.available.shown {
    display: block;
}

.parameter-row {
    display: grid;
    grid-template-columns: 8em 8em 6em;
    gap: 0.5em;
    align-items: center;
    margin-top: 0.5em;
}

.parameter-row input[type="number"] {
    width: 5em;
}

#energy-bar {
    position: absolute;
    top: 20%;
    bottom: 3%;
    left: 1.5em;
    width: 1.5em;
    border: 2px solid black;
    background-color: #AAA;
}

#kinetic-bar {
    position: absolute;
    bottom: 0;
    width: 100%;
    background-color: #EEE;
}

#energy-bar-label {
    position: absolute;
    top: calc(20% - 1.75em);
    left: 0.75em;
}

.color-label {
    display: inline-block;
    width: 0.75em;
    height: 0.75em;
    border: 2px solid black;
    vertical-align: -0.1em;
}

#equation-label {
    position: absolute;
    top: 0;
    right: 1em;
}

#symbol-container svg {
    position: absolute;
    top: 0;
    left: 0;
    visibility: hidden;
}

#simulation-label {
    position: absolute;
    bottom: 2.5em;
    right: 1em;
    font-size: 2em;
}

#attribution-label {
    position: absolute;
    right: 1em;
    bottom: 0.5em;
}

#mechmath-link {
    position: absolute;
    bottom: 0.5em;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.25em 0.5em;
    border: 2px solid black;
    color: inherit;
    background-color: white;
    text-decoration: none;
}

#playback-container {
    position: absolute;
    right: 1em;
    bottom: 3.5em;
    display: flex;
    gap: 0.5em;
}

.playback-button {
    width: 1.5em;
    height: 1.5em;
    cursor: pointer;
}

#system-modal {
    position: absolute;
    display: none;
    align-items: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition-property: display;
    transition-duration: 0.5s;
    transition-behavior: allow-discrete;
}

#system-modal.shown {
    display: flex;
}

#system-modal-content {
    margin: 0 auto;
    overflow: auto;
    background-color: #fefefe;
    border: 2px solid black;
    border-radius: 10px;
    padding: 0.5em 1em;
    font-size: 1.25em;
    max-height: 80vh;
}

#description-modal {
    position: absolute;
    display: none;
    align-items: center;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    transition-property: display;
    transition-duration: 0.5s;
    transition-behavior: allow-discrete;
}

#description-modal.shown {
    display: flex;
}

#description-modal-content {
    margin: 0 auto;
    overflow: auto;
    background-color: #fefefe;
    border: 2px solid black;
    border-radius: 10px;
    padding: 0.5em 1em;
    font-size: 1.25em;
    max-width: 80vw;
    max-height: 80vh;
}

#description-file {
    white-space: pre-wrap;
}

@media (max-width: 600px) {
    body:not(.home-body) {
        overflow: hidden;
    }

    #energy-label {
        top: 0.35em;
        left: 0.5em;
        max-width: 48%;
        font-size: 0.75em;
        white-space: nowrap;
    }

    #equation-label {
        top: 0.25em;
        right: 0.5em;
        max-width: 48%;
        font-size: 0.7em;
        text-align: right;
    }

    #modal-toggle,
    #description-toggle {
        left: 0.5em;
        font-size: 0.75em;
    }

    #modal-toggle {
        top: 3em;
    }

    #description-toggle {
        top: 5.25em;
    }

    #home-link {
        top: 7.5em;
        left: 0.5em;
        font-size: 0.75em;
    }

    #metrics-label {
        top: 7em;
        right: 0.5em;
        transform: none;
        font-size: 0.8em;
    }

    #parameters-toggle {
        top: 14em;
        right: 0.5em;
        font-size: 0.75em;
    }

    #parameters-panel {
        top: 16em;
        right: 0.5em;
        max-width: calc(100vw - 1em);
        max-height: calc(100vh - 18em);
        overflow: auto;
        padding: 0.5em;
        font-size: 0.8em;
    }

    .parameter-row {
        grid-template-columns: 7em minmax(7em, 1fr) 4.5em;
        gap: 0.25em;
    }

    .parameter-row input[type="number"] {
        width: 4em;
    }

    #energy-bar-label {
        top: 20%;
        left: 0.5em;
        transform: translateY(-1.75em);
        font-size: 0.75em;
    }

    #energy-bar {
        top: 23%;
        bottom: 5em;
        left: 0.5em;
        width: 1em;
    }

    #simulation-label {
        right: 0.5em;
        bottom: 3.75em;
        font-size: 1.25em;
    }

    #attribution-label {
        right: 0.5em;
        bottom: 0.5em;
        font-size: 0.65em;
    }

    #mechmath-link {
        bottom: 0.5em;
        font-size: 0.7em;
    }

    #playback-container {
        right: 0.5em;
        bottom: 2.25em;
    }
}