* {
    box-sizing: border-box;
}

body {
    color: #fff;
    background: #010101;
    font-family: "Google Sans Code", monospace;
    margin: 0;
}

button,
[type="file"],
::file-selector-button {
    color: #fff;
    border: 1px solid;
    width: 120px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    text-transform: uppercase;
    border-radius: 3px;
}

button:hover,
::file-selector-button:hover {
    filter: brightness(120%);
    cursor: pointer;
}

#play {
    padding: 0 12px;
    color: oklch(0.9 0.1 150);
    border-color: oklch(0.59 0.2 160);
    background: oklch(0.55 0.2 160 / 0.33);
    flex-shrink: 2;
    min-width: min-content;
}

#stop {
    padding: 0 12px;
    color: oklch(0.9 0.1 20);
    border-color: oklch(0.59 0.2 50);
    background: oklch(0.5 0.16 50 / 0.33);
    flex-shrink: 2;
    min-width: min-content;
}

[type="file"] {
    width: 60%;
    color: oklch(0.7 0.1 220);
    background-color: oklch(0.5 0.1 220 / 0.4);
    border: none;
    text-transform: none;
    font-weight: 200;
}

::file-selector-button {
    height: 100%;
    width: 150px;
    color: oklch(0.9 0.07 220);
    background-color: oklch(0.4 0.2 210 / 0.33);
    border-color: oklch(0.6 0.2 210);
}

form#waveform {
    padding: 2px 4px;
    border: 1px solid oklch(0.4 0 0);
    width: 66.7%;
    background-color: oklch(0.4 0 0 / 0.33);
    border-radius: 3px;
    text-align: right;
}

@media (max-width: 700px) {

    form#waveform,
    #play,
    #stop,
    [type=file] {
        width: 100%;
        text-align: center;
    }

    #play,
    #stop,
    ::file-selector-button {
        padding: 8px 0;
    }

    ::file-selector-button {
        width: 33.3%;
    }
}

fieldset {
    margin: 0;
    border: none;
    margin-inline: 0;
    padding-inline: 0;
    padding-block: 0;
    display: flex;
    flex-direction: row;
}

input[type="number"],
select {
    color: #fff;
    font-family: "Google Sans Code", monospace;
    font-size: 16px;
    background-color: oklch(0.4 0 0);
    border: 1px solid oklch(0.6 0 0);
    border-radius: 2px;
    width: 60px;
    padding-top: 0;
    padding-bottom: 0;
    text-align: right;
    align-items: center;
    width: fit-content;
}

select {
    appearance: base-select;
}

select::picker(select) {
    color: #fff;
    appearance: base-select;
    background-color: oklch(0.4 0 0);
    border-radius: 2px;
    border: 1px solid oklch(0.6 0 0);
    text-align: right;
    font-family: inherit;
    font-weight: 200;
}

option {
    text-align: right;
    padding-left: 0;
    justify-content: flex-end;
    font-family: "Google Sans Code", monospace;
}

input[type="radio"] {
    background-color: #fffa;
}

[value="sine"] {
    accent-color: oklch(0.75 0.2 210);
}

[value="triangle"] {
    accent-color: oklch(0.75 0.2 190);
}

[value="square"] {
    accent-color: oklch(0.75 0.2 160);
}

[value="sawtooth"] {
    accent-color: oklch(0.75 0.2 90);
}

section {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;

    @media (max-width: 700px) {
        flex-direction: column;
    }
}

label {
    color: #fffc;
}

label>strong {
    font-weight: 500;
    color: oklch(0.9 0.16 80);
}

label>small {
    cursor: pointer;
}

strong.cyan {
    color: oklch(0.88 0.16 200);
}

section#canvases {
    position: relative;
}

#canvases>canvas {
    z-index: -1;
    position: absolute;
    top: 0;
    left: 50%;
    transform: translate(-50%, 0%);
    background-color: rgba(0, 0, 0, 0);
}

i {
    font-size: 1.4em;
    font-style: normal;
    letter-spacing: -3px;
}

i[aria-label="sine"] {
    font-size: 2.4em;
    line-height: 1px;
}

.cm-editor {
    --placeholder: "🌀 @strudel/repl loaded - click to edit 🌀";
}

.cm-editor::before {
    position: absolute;
    top: 50%;
    transform: translate(0%, -50%);
    right: 1rem;
    text-align: end;
    font-size: 0.8rem;
    font-style: italic;
    content: var(--placeholder);
    color: oklch(0.7 0 0 / 0.7);
}

.cm-editor.cm-focused::before {
    content: '';
    content-visibility: hidden;
}
