.cg-wrap {
    box-sizing: content-box;
    position: relative;
    display: block;
}

cg-helper {
    position: absolute;
    width: 12.5%;
    padding-bottom: 12.5%;
    display: table; /** hack: round to full pixel size in chrome */
    bottom: 0;
}

cg-container {
    position: absolute;
    width: 800%;
    height: 800%;
    display: block;
    bottom: 0;
}

cg-board {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    line-height: 0;
    background-size: cover;
    cursor: pointer;
}

cg-board square {
    position: absolute;
    top: 0;
    left: 0;
    width: 12.5%;
    height: 12.5%;
    pointer-events: none;
}

cg-board square.move-dest {
    pointer-events: auto;
}

cg-board square.last-move {
    will-change: transform;
}
piece {
    position: absolute;
    top: 0;
    left: 0;
    width: 12.5%;
    height: 12.5%;
    background-size: cover;
    z-index: 2;
    will-change: transform;
    pointer-events: none;
}

cg-board piece.dragging {
    cursor: move;
    z-index: 10;
}

piece.anim {
    z-index: 8;
}

piece.fading {
    z-index: 1;
    opacity: 0.5;
}

.cg-wrap piece.ghost {
    opacity: 0.3;
}

.cg-wrap piece svg {
    overflow: hidden;
    position: relative;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
    opacity: 0.6;
}

.cg-wrap piece svg image {
    opacity: 0.5;
}

.cg-wrap .cg-shapes, .cg-wrap .cg-custom-svgs {
    overflow: hidden;
    position: absolute;
    top: 0px;
    left: 0px;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.cg-wrap .cg-shapes {
    opacity: 0.6;
    z-index: 2;
}

.cg-wrap .cg-custom-svgs {
    /* over piece.anim = 8, but under piece.dragging = 10 */
    z-index: 9;
    overflow: visible;
}

.cg-wrap .cg-custom-svgs svg {
    overflow: visible;
}

.cg-wrap coords {
    position: absolute;
    display: flex;
    pointer-events: none;
    opacity: 0.8;
    font-weight: bold;
    font-family: sans-serif;
    /*font-size: 9px;*/
    font-size:calc( 8px + 4 * ((100vw - 320px) / 880))

}

.cg-wrap coords.ranks {
    right: 0;
    top: 1px;
    flex-flow: column-reverse;
    height: 100%;
    width: 12px;
}

.cg-wrap coords.ranks.black {
    flex-flow: column;
}

.cg-wrap coords.files {
    bottom: 0;
    left: 0;
    flex-flow: row;
    width: 100%;
    height: 16px;
    text-transform: uppercase;
    text-align: left;
}

.cg-wrap coords.files coord {
    padding-left: 4px;
}

.cg-wrap coords.files.black {
    flex-flow: row-reverse;
}

.cg-wrap coords coord {
    flex: 1 1 auto;
}

/*.cg-wrap coords.ranks coord {*/
/*    transform: translateY(39%);*/
/*}*/
