html,
body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
    position: relative;
    background: #181818;
    font-family: sans-serif;
    --component-palette-width: clamp(190px, 11%, 240px);
}

* {
    box-sizing: border-box;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#top-bar {
    position: fixed;
    z-index: 110;
    top: 0;
    left: calc(var(--component-palette-width) - 1px);
    display: flex;
    width: max-content;
    height: 44px;
    align-items: center;
    padding: 4px;
    border: 1px solid #484848;
    border-top: 0;
    border-radius: 0 0 9px 0;
    background: #292929;
    user-select: none;
}

#logo {
    position: fixed;
    z-index: 111;
    bottom: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    color: #643c3c;
    font-size: 23px;
    font-weight: 700;
    letter-spacing: 0.5em;
    margin-right: -0.5em;
    pointer-events: none;
    user-select: none;
}

.logo-accent {
    color: #5f4444;
}

#top-bar button {
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 5px;
    background: #292929;
    color: #f2f2f2;
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

#top-bar button:hover,
#top-bar button:focus-visible {
    outline: none;
    background: #444;
}

#top-bar button[aria-expanded="true"] {
    background: #444;
}

.menu-bar__dropdown {
    position: fixed;
    z-index: 200;
    display: none;
    min-width: 148px;
    padding: 4px;
    overflow: hidden;
    border: 1px solid #4a4a4a;
    border-radius: 9px;
    background: #2d2d2d;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    user-select: none;
}

.menu-bar__dropdown--open {
    display: block;
}

.menu-bar__section + .menu-bar__section {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #484848;
}

.menu-bar__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #f2f2f2;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.menu-bar__shortcut {
    margin-left: 24px;
    color: #888;
    font-size: 11px;
    pointer-events: none;
}

.menu-bar__item:hover,
.menu-bar__item:focus-visible {
    outline: none;
    background: #444;
}

.menu-bar__separator {
    height: 0;
    margin: 4px 0;
    border-top: 1px solid #484848;
}

.component-palette {
    position: fixed;
    z-index: 100;
    top: 0;
    left: 0;
    width: var(--component-palette-width);
    max-height: 100vh;
    overflow: hidden;
    border: 1px solid #484848;
    border-top: 0;
    border-radius: 0;
    background: #292929DD;
    user-select: none;
}

.component-palette:not(.collapsed) {
    border-radius: 0 0 12px 0;
}

.component-palette__title {
    display: flex;
    width: 100%;
    height: 44px;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    border: 0;
    border-bottom: 1px solid #484848;
    border-radius: 0;
    background: #292929;
    color: #f2f2f2;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.component-palette__title:hover {
    background: #444;
}

.component-palette.collapsed .component-palette__title {
    border-radius: 0;
}

.component-palette__body.collapsed {
    display: none;
}

.component-palette__body {
    max-height: calc(100vh - 44px);
    overflow-y: auto;
}

.component-palette.collapsed {
    border-bottom: 0;
}

.component-palette__section--divided {
    margin-top: 0;
    padding-top: 0;
    border-top: 1px solid #484848;
}

.component-palette__cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
}

.component-palette__heading {
    display: flex;
    height: 44px;
    align-items: center;
    justify-content: space-between;
    margin: 0;
    padding: 0 14px;
    width: 100%;
    border: 0;
    background: transparent;
    color: #f2f2f2;
    font: inherit;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
}

.component-palette__heading:hover {
    background: #444;
}

.component-palette__chevron,
.component-palette__title-chevron {
    width: 8px;
    height: 8px;
    margin-right: 3px;
    border-right: 1.5px solid #a7a7a7;
    border-bottom: 1.5px solid #a7a7a7;
    transform: rotate(45deg);
    transform-origin: center;
    transition: transform 120ms ease;
}

.component-palette__title[aria-expanded="false"] .component-palette__title-chevron {
    transform: rotate(-45deg);
}

.component-palette__section.collapsed .component-palette__cards {
    display: none;
}

.component-palette__section.collapsed .component-palette__chevron {
    transform: rotate(-45deg);
}

.component-card {
    display: flex;
    min-width: 0;
    min-height: 90px;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 3px;
    padding: 0;
    border: none;
    border-radius: 9px;
    background: transparent;
    color: #f2f2f2;
    font: inherit;
    font-size: 12px;
    line-height: 1.2;
    cursor: pointer;
}

.component-card:hover,
.component-card:focus-visible {
    outline: none;
    background: #444;
}

.component-card__thumbnail {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 120 / 80;
}

.editor-context-menu {
    position: fixed;
    z-index: 200;
    min-width: 148px;
    padding: 4px;
    overflow: hidden;
    border: 1px solid #4a4a4a;
    border-radius: 9px;
    background: #2d2d2d;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
    user-select: none;
}

.editor-context-menu__section + .editor-context-menu__section {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #484848;
}

.editor-context-menu__item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #f2f2f2;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.editor-context-menu__shortcut {
    margin-left: 24px;
    color: #888;
    font-size: 11px;
    pointer-events: none;
}

.editor-context-menu__item:hover,
.editor-context-menu__item:focus-visible {
    outline: none;
    background: #444;
}

.editor-context-menu__item--destructive {
    color: #ff8d8d;
}
