@charset "utf-8";

* {
  box-sizing: border-box;
  transition-duration: .25s;
  transition-property: background, color, text-shadow, box-shadow;
}
html {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
}
body {
  font-family: verdana, arial, helvetica, sans-serif;
  font-size: 14px;
  position: absolute;
  top: .25em;
  left: .5em;
  right: .5em;
  bottom: .5em;
  display: flex;
  justify-content: stretch;
  padding: 0;
  margin: 0;
  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;
  cursor: pointer;
  outline: none;
  border: none;
  background: transparent;
  -webkit-appearance: none;
}
input[type="range"]::-moz-range-track {
  border: 1px solid #666;
  background: #aaa;
  height: 4px;
  border-radius: 4px;
}
input[type="range"]::-webkit-slider-runnable-track {
  border: 1px solid #666;
  background: #aaa;
  height: 4px;
  border-radius: 4px;
}
input[type="range"]::-moz-range-thumb {
  width: 2em;
  height: 1em;
  border-radius: 1em;
  border: 1px solid #888;
  background: #fff;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, .25);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 2em;
  height: 1em;
  border-radius: 1em;
  border: 1px solid #888;
  background: #fff;
  box-shadow: 1px 1px 2px rgba(0, 0, 0, .25);
  margin-top: calc(-.5em + 1px);
}

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: 3em;
  height: 3em;

  font-family: inherit;
  /*font-size: inherit;*/
  font-size: 1.2em;
  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);
}
.button svg {
  /* text-shadow for font-awesome svg icons */
  filter: drop-shadow(1px 1px 0px white);
}
.icon-button {
  width: 3em;
}
.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 {
  padding: .5em;
  overflow: auto;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
}
.editor-panel {
  flex: auto 1 1;
  min-width: 30em;
}
.world-panel {
  flex: 100% 1 1;
}
.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;
}
.editor-buttons .button {
  flex: 1 1 auto;
  margin: .5em 0 .5em .5em;
}
.editor-buttons .button:last-child {
  margin-right: .5em;
}
.editor-buttons .icon-button {
  flex: 0 0 0;
}
.editor-buttons .icon-button + .icon-button {
  margin-left: 0;
}
#run-button {
  font-weight: bold;
}


/** 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-canvas-container .world-controls {
  top: auto;
  left: auto;
  padding: 1.5em;
  flex-direction: column;
}
.world-controls div {
  display: flex;
  align-items: flex-end;
}
.world-controls .movement-controls > div {
  flex-direction: column;
}
.world-controls button {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2em;
  width: 4rem;
  height: 4rem;
  margin: .5rem;
  padding: 0;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255, 255, 255, .2);
  color: white;
  border: none;
  outline: none;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, .5);
  box-shadow: inset 0 0 1em rgba(255, 255, 255, .33),
              1px 1px .5em rgba(0, 0, 0, .33);
  cursor: pointer;
}
.world-controls button:hover,
.world-controls button:active,
.world-controls button:focus {
  box-shadow: inset 0 0 2em rgba(255, 255, 255, .5),
              1px 1px .75em rgba(0, 0, 0, .33);
}
.world-controls button img {
  flex: 0 0 auto;
  transform: scale(.667);
}
.world-controls button img + svg {
  position: absolute;
  font-size: .75em;
  right: .25em;
  bottom: .25em;
}

.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-property: height, 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;
}

