#principle * {
  font-size: 28px;
}

section.explain {
  background-color: transparent;
  pointer-events: none;
}

section.explain>* {
  pointer-events: all;
}

#principle.section {
  font-size: 28px;
  /*background-color: white;*/
  text-align: center;
  overflow: visible;
  height: 500px;
  color: gray;
  padding: 25px;
  position: relative;
  z-index: -20;
}

#principle #stage {
  width: 300px;
  height: 380px;
  border: 1px solid #ddd;
}

#principle #window {
  display: inline-block;
  border: 2px solid #ddd;
  border-top: 20px solid #eee;
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  outline: 1px solid transparent;
  /* this makes edges antialiased */
  text-align: left;
  position: relative;
}

#principle [lj-type="frame"] {
  border-radius: 2px;
}

#principle [lj-type="frame"]>p {
  background-color: white;
  margin: 0px;
  padding: 20px;
}

#principle [lj-type="frame"]>[lj-type="stage"] {
  outline: 20px solid white;
  margin: 20px;
  padding: 20px;
}

#principle [lj-type="stage"] {
  border-radius: 2px;
}

#principle #sslider {
  height: 100px;
}

#principle #hmenu {
  background-color: rgba(0, 250, 200, 0.8);
  height: 40px;
  line-height: 18px;
  padding-left: 10px;
  color: #888;
  box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.5);
}

#principle #menu {
  background-color: rgba(0, 250, 200, 0.8);
  padding: 10px;
  color: #888;
  box-shadow: 0px 0px 2px 2px rgba(0, 0, 0, 0.5);
}

#principle .windowbar {
  position: absolute;
  line-height: 20px;
}

#principle .windowbar [class*="icon"] {
  font-size: 12px;
  position: relative;
  top: -24px;
  left: 5px;
}

#principle #scards {
  height: 390px;
  background-color: white;
}

#principle #overview {
  width: 300px;
  height: 400px;
  background-color: white;
}

#principle #window [lj-type="frame"].card {
  width: 120px;
  height: 120px;
  overflow: hidden !important;
}

#principle a {
  text-decoration: none;
  color: inherit;
}

#principle .card * {
  font-size: 18px;
}

#principle .card {
  background-color: white;
  overflow: hidden !important;
}

#principle .card>div>a {
  float: left;
  /*this is the link around cardimg*/
}

#principle .card h2, #principle .card h3 {
  float: left;
  /* apperently everything in a floating environment must be somehow floating in order to give reasonable results; very weird; only after clear:both things get normal again.*/
}

#principle .cardimg {
  width: 114px;
  margin-right: 10px;
  margin-bottom: 10px;
  transition: 0.5s;
  z-index: 1;
}

#principle .card.lj-active {
  border-radius: 0px;
  border: 1px solid white;
  padding: 20px;
}

/* explainer text */

#principle #explainer {
  position: absolute;
  bottom: 0px;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 20px;
  box-sizing: border-box;
  pointer-events: none;
  transform: translateZ(200px);
}

#explainer-text {
  width: 500px;
  max-widht: 100%;
  text-align: left;
}

#explainer-text>span {
  background-color: rgba(0, 100, 250, 0.7);
  color: white;
}

.hframe {
  font-weight: bold;
  font-size: 120%;
  color: rgba(0, 250, 200, 1);
  text-shadow: 0px 0px 2px gray;
}

.hstage {
  font-weight: bold;
  font-size: 120%;
  color: rgba(250, 0, 250, 1);
  text-shadow: 0px 0px 2px gray;
}

.hlayer {
  font-weight: bold;
  font-size: 120%;
  color: rgba(50, 50, 50, 1);
  text-shadow: 0px 0px 2px gray;
}

#principle #play {
  display: flex;
  position: absolute;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  top: 0px;
  left: 0px;
  right: 0px;
  bottom: 0px;
}

#principle #play i {
  color: rgba(250, 0, 250, 0.7);
  font-size: 72px;
  text-shadow: 0px 0px 15px #aaa;
  cursor: pointer;
  transition: font-size 0.2s
}
#principle #play i:hover {
  color: rgba(250, 0, 250, 1);
  font-size: 86px;
  text-shadow: 0px 0px 15px white;
}

#principle #play span {
  display: none;
}

#principle #replay {
  position: absolute;
  top:0px;
  right: 30px;
  cursor: pointer;
  margin: 10px;
  display: none;
  text-shadow: 0px 0px 10px white;
}
#principle #replay span{
  text-decoration: underline;
}
@media (max-width: 640px){
  #principle #replay {
    top: -30px;
  }
}
/* manually remove 3d separation from grid canvas example */

#principle #window [lj-type="layer"]#canvas {
  transform: translateZ(0px);
}

#principle #window #scards {
  border: 0px;
}

#principle #window [lj-type="layer"]#canvas #overview {
  border: 0px;
  box-shadow: none;
}

/* 3D transforms */

#principle #window {
  transition: transform;
  transform: perspective(0px) translateZ(0px) rotateY(0deg) rotateX(0deg);
  transform-style: preserve-3d;
  pointer-events: none;
}

#principle #window * {
  transform-style: preserve-3d;
  transform: translateZ(0px);
  /* note: native-scroll must be false! */
}

#principle [lj-type="frame"] {
  outline: 1px solid transparent;
  /* this makes edges antialiased */
  pointer-events: auto;
}

#principle [lj-type="stage"] {
  outline: 1px solid transparent;
  /* this makes edges antialiased */
  pointer-events: none;
}

#principle [lj-type="layer"] {
  pointer-events: auto;
}

#principle #window [lj-type="layer"]:nth-of-type(10n+1) {
  transform: translateZ(-120px);
}

#principle #window [lj-type="layer"]:nth-of-type(10n+2) {
  transform: translateZ(-100px);
}

#principle #window [lj-type="layer"]:nth-of-type(10n+3) {
  transform: translateZ(-60px);
}

/* 3d animation */

#principle #window.d3 {
  transform: perspective(1000px) translateZ(0px) rotateY(45deg) rotateX(25deg);
}

#principle #window.d3 [lj-type="frame"] {
  border: 3px solid rgba(0, 250, 200, 0.5);
  box-shadow: 0px 0px 2px 2px rgba(125, 125, 125, 0.5);
}

#principle #window.d3 [lj-type="stage"] {
  border: 3px solid rgba(250, 0, 250, 0.5);
}

#principle #window.d3 *, #principle #window.d3t * {
  overflow: visible !important;
  /* note: native-scroll must be false! */
}

/* stage helper lines */

#principle #window [lj-type="stage"]>.hl {
  width: 120px;
  border-top: 1px dashed rgba(0, 0, 0, 0.5);
  position: absolute;
}

#principle #window [lj-type="stage"]>.hl.tl {
  top: 0px;
  left: 0px;
  transform-origin: 0 0;
  transform: rotateY(90deg);
}

#principle #window [lj-type="stage"]>.hl.tr {
  transform-origin: 100% 0;
  top: 0px;
  right: 0px;
  transform: rotateY(-90deg);
}

#principle #window [lj-type="stage"]>.hl.bl {
  bottom: 0px;
  left: 0px;
  transform-origin: 0 0;
  transform: rotateY(90deg);
}

#principle #window [lj-type="stage"]>.hl.br {
  transform-origin: 100% 0;
  bottom: 0px;
  right: 0px;
  transform: rotateY(-90deg);
}
