#wordtablewrapper {
  -webkit-box-ordinal-group: 1;
  -moz-box-ordinal-group: 1;
  -webkit-order: 0;
  -ms-flex-order: 0;
  order: 0;
  -webkit-box-flex: 2;
  -moz-box-flex: 2;
  -webkit-flex: 2 2 auto;
  -ms-flex: 2 2 auto;
  flex: 2 2 auto;
  -webkit-align-self: stretch;
  -ms-flex-item-align: stretch;
  align-self: stretch;
}

#wordsdiv {
  -webkit-box-ordinal-group: 1;
  -moz-box-ordinal-group: 1;
  -webkit-order: 0;
  -ms-flex-order: 0;
  order: 0;
  -webkit-box-flex: 0;
  -moz-box-flex: 0;
  -webkit-flex: 1 1 auto;
  -ms-flex: 1 1 auto;
  flex: 1 1 auto;
  -webkit-align-self: stretch;
  -ms-flex-item-align: stretch;
  align-self: stretch;
}

#wordsdiv {
  box-sizing: border-box;
  max-width: 250px;
  margin: 20px;
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

#wordswrapper {
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 100%;
  box-sizing: border-box;
}

.hidewordlist #wordsdiv {
  display: none;
  height: 0px;
  width: 0px;
}

table#thetable {
  border-spacing: 0px;
}

table#thetable td {
  padding: 0px;
}

.word {
  display: block;
  padding-left: 5px;
  padding-right: 5px;
  overflow: hidden;
}

.letter {
  padding: 2px;
  text-align: center;
  cursor: pointer;
}

.letter canvas {
  position: relative;
  left: -2px;
  top: -2px;
}
.wordfound {
  background-color: green;
}

.hidewordlist #wordsdiv {
  display: none;
}

#wordtable {
  position: relative;
  padding: 20px;
  margin-left: auto;
  margin-right: auto;
  border: 3px solid black;
  border-radius: 10px;
  display: inline-block;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  z-index: 20;
}

#mycanvas {
  position: absolute;
  top: 20px;
  left: 20px;
  pointer-events: none;
  z-index: 10;
}

@media only screen and (orientation: portrait) {
  html #bottom-container {
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
  }

  html div#wordsdiv {
    max-width: 100%;
  }
  html .word {
    display: inline-block;
  }
}

@media only screen and (orientation: landscape) and (max-width: 750px),
  only screen and (orientation: portrait) and(max-height: 750px) {
  html div#wordtable {
    padding: 10px;
  }

  html #mycanvas {
    top: 10px;
    left: 10px;
  }

  html div#wordsdiv {
    padding: 0;
    border: none;
  }

  html .letter {
    font-size: 18px;
  }

  html .word {
    padding-left: 10px;
    padding-right: 10px;
    overflow: hidden;
    font-size: 18px;
  }
  #wordsdiv,
  #wordtablewrapper {
    margin: 2px;
  }
}

@media only screen and (max-width: 500px), only screen and (max-height: 500px) {
  html .letter {
    font-size: 16px;
  }

  html .word {
    display: inline-block;
    padding-left: 10px;
    padding-right: 10px;
    overflow: hidden;
    font-size: 16px;
  }
}

@media only screen and (max-width: 370px), only screen and (max-height: 370px) {
  html .letter {
    font-size: 14px;
  }

  html .word {
    font-size: 14px;
  }

  html .letter {
    padding: 1px;
  }
}

@media only screen and (orientation: portrait) and (max-height: 650px),
  and (max-width: 380px) {
  html #wordsdiv {
    -webkit-flex: 1 1 100px;
    -ms-flex: 1 1 100px;
    flex: 1 1 100px;
  }
}
