.gobang {
    width: 300px;
    height: 300px;
    margin: auto;
}

#gobang_main {
    width: 300px;
    height: 300px;
    background: #F9CC9D;
}

.gobang_block {
    position: relative;
    z-index: 2;
    float: left;
    width: 20px;
    height: 20px;
}

.gobang_block:before {
    content: "";
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    top: 10px;
    height: 1px;
    background: #000;
}

.gobang_block:after {
    content: "";
    position: absolute;
    z-index: 2;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 1px;
    background: #000;
}

.gobang_block.left, .gobang_block.right {
    width: 20px;
    height: 20px;
}

.gobang_block.left:before {
    left: 10px;
    top: 10px;
    width: 10px;
    height: 1px;
}

.gobang_block.right:before {
    left: 0;
    top: 10px;
    width: 10px;
    height: 1px;
}

.gobang_block.left:after, .gobang_block.right:after {
    left: 10px;
}

.gobang_block.top, .gobang_block.bottom {
    width: 20px;
    height: 20px;
}

.gobang_block.top:before, .gobang_block.bottom:before {
    left: 0;
    right: 0;
    top: 10px;
    height: 1px;
}

.gobang_block.top:after {
    left: 10px;
    top: 10px;
    height: 10px;
}

.gobang_block.bottom:after {
    left: 10px;
    top: 0;
    height: 10px;
}

.gobang_block.top.left, .gobang_block.top.right, .gobang_block.bottom.left, .gobang_block.bottom.right {
    width: 20px;
    height: 20px;
}

.gobang_block.top.left:before, .gobang_block.bottom.left:before {
    left: 10px;
    top: 10px;
    width: 10px;
    height: 1px;
}

.gobang_block.top.right:before, .gobang_block.bottom.right:before {
    left: 0;
    top: 10px;
    width: 10px;
    height: 1px;
}

.gobang_block.top.left:after, .gobang_block.top.right:after {
    left: 10px;
    top: 10px;
    width: 1px;
    height: 10px;
}

.gobang_block.bottom.left:after, .gobang_block.bottom.right:after {
    left: 10px;
    top: 0;
    width: 1px;
    height: 10px;
}

.gobang_block:hover {
    border: 1px dashed #f00;
    box-sizing: border-box;
    -moz-box-sizing: border-box;
    -webkit-box-sizing: border-box;
}

.gobang_block:hover:before, .gobang_block:hover:after {
    content: none;
}

.gobang_block.active {
    -webkit-box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
    -moz-box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
}

.gobang_block.active:before, .gobang_block.active:after {
    content: none;
}

.gobang_block.active.black {
    background: #45484d;
    background: radial-gradient(ellipse at 70% 30%, #45484d 1%, #000000 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#45484d', endColorstr='#000000', GradientType=1);
}

.gobang_block.active.white {
    background: rgb(255, 255, 255);
    background: radial-gradient(ellipse at 70% 30%, rgba(255, 255, 255, 1) 0%, rgba(244, 244, 244, 1) 100%);
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f4f4f4', GradientType=1);
}
