html {
  width:100%;
  height:100%;
  background: #53529C;
  color:#ddc;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  touch-action: manipulation;
  overscroll-behavior: contain;
}
body {
  padding:1em;
  margin:0;
  height:calc(100% - 2em);
  font-family: sans-serif;
}

a {
  text-decoration: none;
  color: #EE6600;
  font-weight: bold;
}
a:hover {
  text-decoration: underline;
  color: #FF7700;
}

.page-container {
  display: grid;
  grid-template-rows: 1;
  grid-template-columns: 1;
}

.page-container .page {
  grid-row: 1;
  grid-column: 1;
}

.big-link {
  font-size: 1.5em;
  padding: 0.5em;
  display: inline-block;
}
.big-link.active {
  background-color: #EE6600;
  
  border-radius: 0.5em;
}
.big-link:not(.active) > span {
  display:none;
}
.big-link.active > span {
  font-weight: bold;
}
.big-link.active > a {
  display: none;
}


#sketch-canvas {
  width: 100%;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.hidden {
  display:none !important;
}

.clear { 
  clear: both;
}

.list {
  width:75%;
  margin:0 auto;
}

#create {
  padding:1em 0 2em 0;
  display:flex;
  justify-content: center;
  flex-direction: row;
  flex-wrap: wrap-reverse;
}

.list-column {
  width: calc(100% - 2em);
  text-align: center;
  padding: 1em;
}
.nav-buttons {
  text-align: center;
}
div.top { 
  text-align: center;
}

.sketch {
  margin: 1em 0.5em 0;
  float: left;
  padding: 0.5em 0;
  width: calc(25% - 1em);
}

.frame {
  background-color: #eaead9;
  border: solid 1em #eee;
  border-bottom-color: #fff;
  border-left-color: #eee;
  border-radius: 2px;
  border-right-color: #eee;
  border-top-color: #ddd;
  box-shadow: 0 0 5px 0 rgba(0,0,0,.25) inset, 0 5px 10px 5px rgba(0,0,0,.25);
  box-sizing: border-box;
  position: relative;
  text-align: center;
}
.frame:before {
  border-radius: 2px;
  bottom: -0.5em;
  box-shadow: 0 2px 5px 0 rgba(0,0,0,.25) inset;
  content: "";
  left: -0.5em;
  position: absolute;
  right: -0.5em;
  top: -0.5em;
  pointer-events: none
}
.frame:after {
  border-radius: 2px;
  bottom: -1em;
  box-shadow: 0 2px 5px 0 rgba(0,0,0,.25);
  content: "";
  left: -1em;
  position: absolute;
  right: -1em;
  top: -1em;
  pointer-events: none
}
.frame > canvas {
  margin-bottom: -3px;
}

.sketch .time {
  font-size: 0.75em;
  float: right;
  margin-right: 1em;
  margin-bottom: 0.25em;
  color:#bbb;
}

.sketch a {
  font-size: 0.8em;
  margin: 0 0.5em;
}

.sketch a.replay {
  font-size: 1.25em;
  float: left;
  position: absolute;
  bottom: 0.18em;
  left: 0;
}

.sketch img {
  width:100%;
  cursor: pointer;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

div.toolbar, div.canvas-container {
  float:left;
}
div.toolbar {
  text-align: center;
  padding: 1em;
}
div.toolbar a {
  font-size: 2.5em;
  padding:0.25em;
  text-align: center;
  display: inline-block;
}
div.canvas-container {
  flex-grow: 5;
  max-height: 60vh;
  max-width: 106.67vh;
}

#replay {
  position: fixed;
  top:0;
  left: 0;
  height: 100%;
  width: 100%;
  z-index: 150;
  text-align: center;
  background-color: rgba(0,0,0,0.5);
}
.replay-container {
  width: 50vw; 
  height: 28.125vw; /* height:width ratio = 9/16 = .5625  */
  max-height: 50vh;
  max-width: 88.9vh; /* 16/9 = 1.778 */
  margin: auto;
  position: absolute;
  top:0;bottom:0; /* vertical center */
  left:0;right:0; /* horizontal center */
}
.replay-container > .frame {
  margin-top:-0.5em;
}
#replay-canvas {
  width:100%;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-crisp-edges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

@media screen and (max-width: 1800px) {
  .list {
    width:80%;
  }
}
@media screen and (max-width: 1600px) {
  .list {
    width:90%;
  }
}
@media screen and (max-width: 1400px) {
  .list {
    width:100%;
  }
  .sketch {
    width: calc(33.3% - 1em);
  }
  div.canvas-container {
    flex-grow: 5;
    max-height: 90vh;
    max-width: 160.02vh;
  }
}
@media screen and (max-width: 900px) {
  body {
    padding:1em 0;
  }
  .replay-container {
    width: 90vw; 
    height: 50.625vw; /* height:width ratio = 9/16 = .5625  */
    max-height: 90vh;
    max-width: 160.02vh; /* 16/9 = 1.778 */
  }
  .sketch {
    margin: 1em 0.5em 0;
    float: left;
    padding: 0.5em 0;
    width: calc(50% - 1em);
  }
}
@media screen and (max-width:600px) and (orientation: portrait) {
  div.toolbar, div.canvas-container {
    width: 100%;
  }
  .sketch a.replies {
    width: 100%;
    text-align: right;
  }
  .sketch a.replay {
    display: none;
  }
}