:root {
  --stroke-width: 1.24;
  --icon-color: #5d6478;
}

* {
  outline: 0;
  padding: 0;
  margin: 0;
  border: 0;
  box-sizing: border-box;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

*::-webkit-scrollbar {
  display: none;
}

html {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: "JetBrains Mono", monospace;
  font-optical-sizing: auto;
  font-style: normal;
  text-transform: uppercase;
  text-size-adjust: none;
  margin: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  position: relative;
  user-select: none;
  background-color: #0e0f12;
  overflow: hidden;
}

button {
  cursor: pointer;
  background: none;
}

button:disabled {
  cursor: not-allowed;
}

a {
  text-decoration: none;
  color: inherit;
}

iframe {
  border: 0;
}

.disabled {
  pointer-events: none;
  cursor: not-allowed;
}

.desktop-sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  width: 100%;
}

.header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding: 16px 16px 16px 16px;
  width: 100%;
  border-radius: 100px;
  cursor: pointer;
}

.logo {
  width: 24px;
  height: 24px;
}

.logo svg {
  display: block;
}

.button {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #121418;
  border: 1px solid #16171c;
  color: var(--text);
  padding: 12px 12px;
  width: 44px;
  height: 44px;
  border-radius: 100px;
  cursor: pointer;
  transition:
    background-color 180ms ease,
    border-color 180ms ease;
  box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.16);
}

.button:hover {
  background-color: #14161a;
  border-color: #18191e;
}

.button svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.button svg path,
.accordion .icon svg path,
.category .icon svg path,
.control-button svg path {
  stroke: var(--icon-color);
  stroke-width: var(--stroke-width);
}

.logo svg path,
.accordion .arrow path,
.category .arrow path,
.control-button .arrow path {
  fill: var(--icon-color);
}

.app-main {
  flex: 1;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
}

.canvas-wrap {
  flex: 1;
  min-height: 0;
  width: 100%;
  padding: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.canvas {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  background-color: #16171c;
  position: relative;
  transition: background-color 180ms ease;
}

.render-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-placeholder {
  display: block;
  width: min(100%, 240px);
  height: auto;
  max-height: 100%;
  object-fit: contain;
  pointer-events: none;
}

@media (min-width: 836px) {
  .canvas-placeholder {
    width: min(100%, 360px);
  }
}

.canvas-placeholder[hidden] {
  display: none;
}

.controls-spacer {
  flex-shrink: 0;
  width: 100%;
  transition: height 260ms ease;
}

.controls {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: 100%;
  box-sizing: border-box;
  max-height: min(624px, 48svh);
  max-height: min(624px, 48dvh);
  overflow-y: auto;
  background-color: #101115;
  border: 1px solid #121418;
  border-radius: 24px 24px 0 0;
}

@media (min-width: 836px) {
  .app-main {
    flex-direction: row;
  }

  .desktop-sidebar {
    order: -1;
    width: 300px;
    max-width: 300px;
    height: 100%;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    background-color: #101115;
    border-right: 1px solid #121418;
  }

  .desktop-sidebar .header {
    flex-shrink: 0;
    align-items: center;
    border-radius: 0;
    padding-bottom: 8px;
    padding-top: 16px;
  }

  .controls {
    position: static;
    flex: none;
    width: 100%;
    max-width: none;
    max-height: none;
    border: none;
    border-radius: 0;
    overflow: visible;
  }

  .controls-spacer {
    display: none;
  }

  .canvas-wrap {
    flex: 1;
    min-width: 0;
  }
}

.accordion-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.accordion .content,
.control-button .content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.category .item {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.category .title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.category .title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.accordion .icon,
.category .icon,
.control-button .icon {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-shrink: 0;
  width: 18px;
  height: 18px;
}

.accordion .icon svg,
.category .icon svg,
.control-button .icon svg {
  display: block;
}

.accordion .arrow {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: block;
  transition: transform 160ms ease;
}

.accordion .label,
.category .label {
  text-align: left;
}

.control-button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #121418;
  border: 1px solid #16171c;
  border-radius: 8px;
  padding: 16px 12px;
  width: 100%;
  box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.16);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-radius 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    opacity 180ms ease;
}

.control-button:hover {
  background-color: #14161a;
  border-color: #18191e;
}

.accordion {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #121418;
  border: 1px solid #16171c;
  border-radius: 8px;
  padding: 16px 12px;
  width: 100%;
  box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.16);
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition:
    border-radius 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    opacity 180ms ease;
}

.accordion:hover,
.accordion-toggle:hover {
  background-color: #14161a;
  border-color: #18191e;
}

.accordion-toggle[aria-expanded="true"] {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.accordion-toggle[aria-expanded="true"] .arrow {
  transform: rotate(90deg);
}

.accordion-menu {
  width: 100%;
  display: flex;
  flex-direction: column;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transform: translateY(-8px);
  transition:
    max-height 260ms ease,
    opacity 180ms ease,
    transform 220ms ease;
}

.accordion-menu.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 16px 12px;
  background-color: #121418;
  border-left: 1px solid #16171c;
  border-right: 1px solid #16171c;
  border-bottom: 1px solid #16171c;
  border-radius: 0;
  box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.16);
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  text-transform: inherit;
  transition:
    background-color 160ms ease,
    color 160ms ease,
    opacity 180ms ease;
}

.menu-option:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.menu-option .content {
  display: flex;
  align-items: center;
  gap: 8px;
}

.menu-option .icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: color 160ms ease;
}

.menu-option .icon svg {
  display: block;
}

.menu-option .icon svg path {
  stroke: var(--icon-color);
  stroke-width: var(--stroke-width);
  transition: stroke 160ms ease;
}

.menu-option .status-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0;
  transform: scale(0.8);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.menu-option .status-icon svg {
  display: block;
  color: #bbff00;
}

.menu-option .status-icon use {
  fill: currentColor;
}

.menu-option:hover {
  background-color: #171a20;
  cursor: pointer;
}

.menu-option.is-active {
  color: #bbff00;
  background-color: rgba(187, 255, 0, 0.04);
}

.menu-option.is-active .icon {
  color: #bbff00;
}

.menu-option.is-active .icon svg path {
  stroke: #bbff00;
}

.menu-option.is-active .status-icon {
  opacity: 1;
  transform: scale(1);
  color: #bbff00;
}

.menu-option.is-active .status-icon use {
  fill: #bbff00;
}

.category {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 12px;
  background-color: #121418;
  border: 1px solid #16171c;
  border-radius: 8px;
  width: 100%;
  color: #ffffff;
  font-size: 14px;
  font-weight: 500;
  box-shadow: -1px 1px 2px rgba(0, 0, 0, 0.16);
  transition: opacity 180ms ease;
}

.is-unavailable {
  opacity: 0.42;
  pointer-events: none;
}

.is-collapsing {
  transition:
    height 220ms ease,
    opacity 180ms ease,
    transform 220ms ease;
}

.category .title .value {
  flex-shrink: 0;
}

.category .description {
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #303440;
}

.category .slider {
  position: relative;
  width: 100%;
  height: 28px;
  display: flex;
  align-items: center;
}

.category .slider-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #2c303b;
  border-radius: 999px;
}

.category .slider-fill {
  position: absolute;
  left: 0;
  right: 0;
  width: 100%;
  height: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: linear-gradient(to right, #bbff00, #0084ff, #ea00ff);
  border-radius: 999px;
  pointer-events: none;
  clip-path: inset(0 calc(100% - var(--slider-value, 31%)) 0 0);
}

.category .slider-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
  background: transparent;
}

.category .slider-input {
  appearance: none;
  -webkit-appearance: none;
}

.category .slider-input::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
}

.category .slider-input::-moz-range-thumb {
  appearance: none;
}

.category .slider-input::-webkit-slider-runnable-track {
  background: transparent;
  height: 6px;
}

.category .slider-input::-moz-range-track {
  background: transparent;
  height: 6px;
}

.category .slider-input::-webkit-slider-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -3px;
}

.category .slider-input::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  border: none;
}

@media (pointer: coarse) {
  .category .slider {
    height: 40px;
  }

  .category .slider-track,
  .category .slider-fill,
  .category .slider-input::-webkit-slider-runnable-track,
  .category .slider-input::-moz-range-track {
    height: 8px;
  }

  .category .slider-input::-webkit-slider-thumb {
    width: 20px;
    height: 20px;
    margin-top: -6px;
  }

  .category .slider-input::-moz-range-thumb {
    width: 20px;
    height: 20px;
  }
}

.canvas.is-image-inverted {
  filter: invert(1);
}

.canvas.is-canvas-inverted {
  background-color: #ffffff;
}

.canvas.is-hidden {
  background-color: transparent;
}

.canvas-wrap.is-drop-active .canvas {
  box-shadow: inset 0 0 0 1px rgba(187, 255, 0, 0.8);
}
