* {
  box-sizing: border-box;
}

html {
  font-family: Cousine, monospace;
  margin: 0;
  background-color: #292929;
  color: #fff;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-size: 10px;
}

body {
  margin: 0;
}

::-moz-selection {
  background: #444;
  color: #fff;
  text-shadow: none;
}

::selection{
  background: #444;
  color: #fff;
  text-shadow: none;
}

a, a:visited {
  color: #333;
  text-decoration: none;
  background-color: rgba(255, 255, 255, .8);
  outline: .2rem solid rgba(255, 255, 255, .8);
}

a:hover {
  background-color: #FF5859;
  outline-color: #FF5859;
  color: #fff;
}

a.download, a.download:hover {
  background-color: transparent;
  outline: none;
}

button {
  background-color: #444;
  border: none;
  font-family: Cousine, monospace;
  color: #fff;
  font-size: 2rem;
  padding: 1rem 2rem;
  cursor: pointer;
  transition: transform .2s;
}

button:hover {
  background-color: #0000ff;
  transform: translateY(-.2rem);
}

button:focus {
  outline: none;
}

button.wait {
  cursor: wait;
  opacity: .3;
}

button.wait:hover {
  background-color: #444;
}

.modal {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: rgba(0, 0, 0, .8);
  z-index: 1999;
  display: none;
}

.modal.active {
  display: block;
}

.modal > div {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate3d(-50%, -50%, 0);
  transform: translate3d(-50%, -50%, 0);
  background-color: #333;
  padding: 4rem;
  font-size: 2rem;
  line-height: 1.5;
  max-width: 60%;
  box-shadow: 1rem 1rem 0 0 #0000ff, 2rem 2rem 0 0 #FF5859;
  max-height: 90%;
  overflow: auto;
}

.modal img, .modal button {
  display: block;
  margin: 0 auto;
}

.modal .logo {
  width: 40%;
}

.modal button {
  margin-top: 3rem;
  background-color: #fff;
  color: #333;
}

.modal button:hover {
  background-color: #0000ff;
  color: #fff;
}

.modal button.wait:hover {
  background-color: #fff;
  color: #333;
}

.modal img {
  margin-bottom: 3rem;
  outline: 12px solid #fff;
}

.modal h1 {
  font-size: 3rem;
}

#sidebar {
  background-color: rgba(255, 255, 255, .5);
  background-color: #fff;
  color: #555;
  padding: 1rem;
  position: absolute;
  top: 0;
  right: 0;
  box-sizing: content-box;
  z-index: 100;
  box-shadow: -1rem 1rem 0 0 #0000ff, -2rem 2rem 0 0 #FF5859;
}

#sidebar.hidden {
  visibility: hidden;
}

#sidebar img {
  width: 65%;
}

#sidebar h1 {
  font-size: 3rem;
  line-height: 1;
  margin: .5rem 0;
  font-weight: 100;
  letter-spacing: 2rem;
}

#sidebar h2 {
  font-weight: 100;
  font-size: 1.3rem;
  opacity: .8;
}

#sidebar label {
  display: block;
  font-size: 1.2rem;
}

#sidebar label em {
  float: right;
  opacity: .7;
}

.move-count {
  text-align: right;
}

#sidebar input {
  display: block;
  margin: 1rem 0;
  margin-bottom: 2rem;
}

#sidebar input[type='checkbox'] {
  width: 2rem;
  height: 2rem;
}

#sidebar button:last-of-type {
  float: right;
}

#sidebar p {
  float: right;
  margin-top: 1rem;
  margin-bottom: 0;
  font-size: 1.2rem;
}

#sidebar p span {
  margin: 0 1rem;
}

.grid {
  position: relative;
}

.grid.show-nums label {
  opacity: 1;
}

.cell {
  position: absolute;
  display: inline-block;
  transition: transform .2s, opacity .2s;
  overflow: hidden;
  text-align: center;
  font-size: 24;
}

.cell video {
  position: absolute;
  top: 0;
  left: 0;
}

.cell label {
  color: #fff;
  position: relative;
  font-size: 5em;
  opacity: 0;
  pointer-events: none;
  cursor: pointer;
  transition: opacity .2s;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.adjacent-l {
  cursor: w-resize;
}

.adjacent-r {
  cursor: e-resize;
}

.adjacent-u {
  cursor: n-resize;
}

.adjacent-d {
  cursor: s-resize;
}

input[type='range'] {
  width: 100%;
  -webkit-appearance: none;
}

input[type='range']:focus {
  outline: none;
  border: 0;
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 16px;
  width: 16px;
  border-radius: 100%;
  border: 1px solid #bbb;
  background: #fff;
  cursor: ew-resize;
  cursor: -webkit-grab;
  margin-top: -8px;
}

input[type='range']::-webkit-slider-thumb:active {
  cursor: -webkit-grabbing;
}

input[type='range']::-moz-range-thumb {
  height: 16px;
  width: 16px;
  border-radius: 100%;
  border: 1px solid #bbb;
  background: #fff;
  cursor: ew-resize;
  margin-top: -8px;
}

input[type='range']::-ms-thumb {
  height: 16px;
  width: 16px;
  border-radius: 100%;
  border: 1px solid #bbb;
  background: #fff;
  cursor: ew-resize;
  margin-top: -8px;
}

input[type='range']::-webkit-slider-runnable-track {
  width: 100%;
  height: 1px;
  cursor: -webkit-grab;
  background: #bbb;
}

input[type='range']::-webkit-slider-runnable-track:active {
  cursor: -webkit-grabbing;
}

input[type='range']::-moz-range-track {
  width: 100%;
  height: 1px;
  cursor: pointer;
  background: #bbb;
  border: 0;
}

input[type='range']::-ms-track {
  width: 100%;
  height: 1px;
  cursor: pointer;
  background: transparent;
  border-color: transparent;
  border-width: 16px 0;
  color: transparent;
}

input[type='range']::-ms-fill-lower {
  background: #bbb;
}
