@charset "utf-8";

* {
  box-sizing: border-box;
}
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}
body {
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 14px;
  padding: 0;
  margin: 0;
  position: absolute;
  top: .25em;
  left: .5em;
  right: .5em;
  bottom: .5em;
  background-color: #f7f7f7;
  -webkit-user-select: none;
     -moz-user-select: none;
      -ms-user-select: none;
          user-select: none;
}

input[type="range"] {
  display: inline-block;
  vertical-align: middle;
  margin: 0;
  padding: 0; /* IE */
  cursor: pointer;
  outline-width: 0;
}
i.fa { /* prevent page load flicker */
  display: inline-block;
  width: .875em;
}

::-moz-focus-inner,
::-moz-focus-outer {
  border-width: 0;
  outline-width: 0;
}
.button {
  position: relative;
  margin: .5em .25em;
  padding: 0 1em;
  line-height: 2em;

  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  outline: none;

  text-align: center;

  color: #444;
  text-shadow: 1px 1px 0px white;

  background-color: #e8e8e8;
  border: 1px solid #d0d0d0;
  border-color: #fff #d8d8d8 #ccc #f5f5f5;
  border-radius: 3px;
  box-shadow: 1px 1px 4px rgba(0, 0, 0, .2),
              inset -1px -2px 1em rgba(0, 0, 0, .05);
  transition: .2s background, .2s box-shadow, .2s text-shadow;
}
.button svg {
  /* text-shadow for font-awesome svg icons */
  filter: drop-shadow(1px 1px 0px white);
}
.icon-button {
  padding: 0 .75em;
}
.button.nohover{
  cursor: default;
}
.button:not(:disabled):not(.nohover):hover {
  z-index: 1;
  background-color: #fff;
  box-shadow: 0 0 4px rgba(0, 0, 0, .2),
              inset -1px -2px 1em rgba(0, 0, 0, .1);
}
.button:disabled {
  color: #aaa;
  cursor: default;
}
.hidden {
  display: none;
  /*position: fixed;*/
  /*left: -99999px;*/
}

/*** layout ***/

.panel {
  position: absolute;
  padding: .5em;
  overflow: auto;

  display: flex;
  flex-direction: column;
  justify-content: stretch;
}
.editor-panel {
  width: 20em;
  left: 0;
  top: 0;
  bottom: 0;
}
.world-panel {
  left: 20em;
  right: 0;
  top: 0;
  bottom: 0;
}
.panel > header {
  display: flex;
  align-items: center;
  padding: 0 .25em;
  color: #444;
  text-shadow: 1px 1px 0 white;
}
.panel > header > h2 {
  margin: 0;
  padding: 0 .5em;
  font-size: 1.2em;
  font-weight: normal;
  display: inline-block;
}
.panel > header::before,
.panel > header::after
{
  content: "";
  display: inline-block;
  vertical-align: middle;
  border: 1px solid white;
  border-color: #ddd white white #ddd;
}
.panel > header::before {
  width: 2em;
}
.panel > header::after {
  flex: 1;
}

.editor-wrapper,
.world-wrapper
{
  margin-top: .5em;

  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: stretch;

  background-color: white;
  border: 1px solid #ddd;
  border-radius: 3px;
  box-shadow: 1px 1px 5px rgba(0, 0, 0, .1)
            , 0 0 2px rgba(0, 0, 0, .1);
}


/** editor **/

.editor {
  flex: 1 1 auto;
}
.editor-buttons {
  display: flex;
  padding-right: .5em;
}
.editor-buttons .button {
  margin: .5em 0 .5em .5em;
  flex:  1 1 auto;
}
#run-button {
  font-weight: bold;
  margin-right: .5em;
}
#unpause-button,
#pause-button,
#step-button,
#stop-button
{
  flex: 0 0 0;
  margin: .5em 0;
}

/** world **/

.world-wrapper {
  position: relative;
  border-radius: 3px;
}
.world-canvas-container {
  position: relative;
  flex: 1 1 auto;
}
.world-canvas-container > div {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
}
canvas#world-canvas {
  max-height: 100%;
  max-width: 100%;
  /*min-height: 300px;*/
  /*min-width: 300px;*/
  image-rendering: crisp-edges;
}
#world-output {
  /*max-height: 5em;*/
  /*min-height: 3em;*/
  height: 5em;
  margin: 0;
  /*overflow-y: scroll;*/
  overflow: auto;
}

.world-tools {
  position: relative;
  z-index: 10;
  /*min-height: 3em;*/

  display: flex;
  flex-direction: row;
  align-items: stretch;
  flex-wrap: wrap;

  padding: 0 .5em;
}
.world-tools .separator
{
  margin: .5em .25em;
  border: 1px solid white;
  border-right-color: #ddd;
}
.world-tools .expander,
.world-settings .expander
{
  flex: 1;
}

.world-settings {
  position: absolute;
  z-index: 1;
  width: 100%;
  padding: 0 .5em;
  overflow: auto;
  display: flex;
  flex-wrap: nowrap;

  height: 0;
  opacity: 0;
  transition: .2s height, .2s opacity;

  background: rgba(255, 255, 255, .3);
  box-shadow: inset 0 0 1.3em rgba(255, 255, 255, .5);
}
#world-settings-toggle:checked + .world-settings {
  height: 3em;
  opacity: 1;
}

.world-settings label {
  display: flex;
  align-items: center;
  margin: 0 .25em;
  cursor: pointer;
}

.world-settings input[type="number"] {
  width: 4em;
  margin: 0 .25em;
  text-align: center;
}
#world-load-form input {
  background-color: #eee;
  border-radius: 3px;
}
.world-settings .separator
{
  margin: 0 .25em;
  border: 1px solid transparent;
  border-right-color: rgba(255, 255, 255, .66);
}
.world-settings-close {
  cursor: pointer;
  padding: 0 .5em;
  color: white;
}
.world-settings-close svg {
  /* text-shadow for font-awesome svg icons */
  filter: drop-shadow(0 0 3px rgba(0, 0, 0, .3));
}

.world-canvas-container {
  background: rgb(240,249,255); /* Old browsers */
  background: linear-gradient(to bottom,
                rgba(225,225,255,.1) 0%,
                rgba(35,93,158,.4) 100%),
              radial-gradient(ellipse at center,
                rgba(240,249,255,1) 0%,
                rgba(203,235,255,1) 47%,
                rgba(161,219,255,1) 100%);
}
#world-output {
  padding: .5em 1em;
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}

#world-output > p {
  margin: 0;
  font-size: .85em;
  line-height: 1.6em;
  border-bottom: 1px dotted #ccc;
}
#world-output > p:last-child {
  font-weight: bold;
  border-bottom-width: 0;
}
.error-message {
  color: #a00;
}

