:root{
  --p:5px;
  --headerH:40px;
  --dark:#222;
  --darker:#000;
  --bright:#ddd;
  --brighter:#fff;
}
body{
  font:14px/1.2em "jetbrains mono", "liberation", sans-serif;
  color:black;
  background: var(--dark);
  padding-top: var(--headerH);
}

header{
  color:var(--bright);
  padding: var(--p);
  position: absolute;
  top:0;
  left:0;
  height: var(--headerH);
  background: var(--dark);
  width:100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
}
header .group{
  align-items: center;
  width:clamp(200px, 25%, 500px);
  display: flex;
  justify-content: center;
}
header .group:first-child{justify-content: flex-start;}
header .group:nth-child(4){justify-content: flex-end;}
header .group .button:not(:first-child){margin-left: var(--p);}
header .group p{margin-right: calc(var(--p)*4);}

header .toggle.hidden{
  background:#777;
}
body.menu-opened .menu-btn::after{
  content:" ✕";
  /* font-size: 1.2em; */
  position: relative;
  top:.1em;
}
header .title{margin-left:var(--p);}
header .fork-btn, header .download-btn{display: none;}
/* existing project, created by someone else, or too old */
body.saved:not(.logged) .save{background: #777;}
body.saved .save{border:0;}
body.saved .fork-btn, body.saved .download-btn{display: block;}
body[data-snapmode="false"] .snap-btn{display: none;}
header .menu-container{
  display: none;
  width: max(25%, 300px);
  background: var(--dark);
  position: absolute;
  top: var(--headerH);
  right: 0;
  z-index: 300;
  padding:30px var(--p) var(--p) var(--p);
}
header .menu-container .menu-line{
  margin-bottom: calc(var(--p)*2);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu-line label{
  width: 100%;
  display: flex;
}
.menu-line span{
  width: 50%;
}
body.menu-opened header .menu-container{
  display: block;
}
body.layout-horizontal #main{
  flex-direction: column;
}
/* .fs span{font-size: 1em;} */
.container{
  height: calc(100vh - var(--headerH));
  position: relative;
  display: flex;
}
.pane{
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  width:100%;
  height: calc(100vh - var(--headerH));
  transition:all .2s ease-out;
  border-right:1px solid var(--dark);
}
.pane:first-child{border-left: 0;}
.ace_editor{
  background-color: var(--darker); /* avoid white blinking */
  position: absolute;
  font-family: "jetbrains mono", monospace;
  line-height: 1.6em;
  top: 0;
  right: 0;
  font-size:15px;
  bottom: 0;
  left: 0;
  width: 100%;
}
.pane.hidden{
  overflow: hidden;
  width:0px;
}
.pane.hidden .ace_scrollbar{
  /* does not work on way back */
  display: none;
}
body.layout-horizontal .pane{
  border-bottom:1px solid var(--dark);
  border-right:0;}
body.layout-horizontal .pane.hidden{
  width:auto;
  height:0px;
}
.pane::before{
  position: absolute;
  right: calc(var(--p) * 3);
  top:2px;
  color: #ccc;
  z-index: 200;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
}
.output{
  height: 100%;
  width:100%;
  border:0;
  background: white;
}
.html-pane:before{content:"html";}
.css-pane:before{content:"css";}
.js-pane:before{content:"js";}

a{color:inherit; text-decoration: none;}
a:hover{text-decoration:underline;}

/* List page */
main.list{
  min-height: calc(100vh - var(--headerH));
  background: var(--bright);
  padding-top: var(--headerH);
  color: var(--dark);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  position: relative;
}
.list-item{
  margin-bottom: var(--p);
  width:30%;
  padding: var(--p);
  position: relative;
}
.list-item iframe{
  width:100%;
  height: 80%;
  border:0;
  box-shadow: 0 0 4px gray;
  background: white;
}
.list-item:before{
  display: none;
}
.list-item.preview-message:before{
  display: block;
  content:"Hover to preview";
  pointer-events: none;
  background: #eee;
  position: absolute;
  display: flex;
  left: 5%;
  top: 29%;
  bottom: 5%;
  right: 5%;
  width: 90%;
  height: 60%;
  justify-content: center;
  align-items: center;
  z-index: 1;
  text-align: center;
}

.list-item a{
  display: block;
  margin-bottom: var(--p);
  font-size:1.5em;
  line-height: 1.5em;
  position: relative;
  padding-left: 1.2em;
}
.list-item a:before{
  content: "";
  width:.8em;
  height: .8em;
  left:0;
  top:0.4em;
  position: absolute;
  background: var(--dark);
  border-radius: 1em;
}
.line {
  position: absolute;
  margin-top:-17px;
  margin-left:10px;
  height: 2px;
  width: 2px;
  transform-origin: 0;
  z-index: 10;
  background: var(--dark);
}

/* Player */
main.player{
  background: var(--bright);
  min-height: calc(100vh - var(--headerH));
}
#version-frame{
  background: white;
  border:0;
  width:100%;
  height: calc(100vh - var(--headerH));
}

.button{
  color:var(--dark);
  background: var(--bright);
  padding:3px 10px 4px;
  border-radius: 10px;
  border: 0px;
  cursor: pointer;
}
.button.snapshot-btn{
  background: yellow;
  display: flex;
}
.button.snapshot-btn .snapshot-version{
  margin-left: 4px;
}
.button:hover, .button:focus{
  background: var(--brighter);
  text-decoration: none;
}
.button:active{background: #ccc;}
.title{
  color:var(--dark);
  background: var(--bright);
  padding:2px 2px;
  border:1px solid transparent;
  width: 70%;
}
.title:hover, .title:focus{background:var(--brighter);}
.handle {background-color: var(--dark); }
.handle:hover {background-color: #000; }
::selection{background:yellow;}
header::selection{color:black;}

/* Editors */
.ace_gutter-cell.ace_error, .ace_gutter-cell.ace_warning{
  background: none;
}
.ace_gutter-cell.ace_error:before, .ace_gutter-cell.ace_warning:before{
  position: absolute;
  left: .1em;
  font-size: 1.5em;
}
.ace_gutter-cell.ace_error:before{
  content: "×";
  color: tomato;
}
.ace_gutter-cell.ace_warning:before{
  content: "!";
  left: .5em;
  font-size: 1em;
  color: orange;
}
.ace_gutter{
  background: #000!important;
  color:#444!important;
}
.ace_gutter-active-line, .ace_active-line{
  background: #131313!important;
  color:#aaa;
}
.ace_scrollbar-h {
  overflow: hidden;
}
@media (max-width: 810px) {
  :root{
    --headerH:80px;
  }
  header{
    justify-content: space-between;
  }
}
@media (max-width: 600px) {
  :root{
    --headerH:100px;
  }
  header .group{width:100%; justify-content: space-between;}
  }
