/*
 * Chessground base css properties.
 *
 * You need to include the css files in themes folder in order to have the
 * board and pieces displayed!
 */

.cg-wrap {
  width: 640px;
  height: 640px;
  position: relative;
  display: block;
}

cg-helper {
  position: absolute;
  width: calc(100% / var(--files,8));
  padding-bottom: calc(100% / var(--files,8));
  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::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform-origin: center center;
}

.orientation-black cg-board::before {
  transform: rotate(180deg);
}

cg-board square {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--files,8));
  height: calc(100% / var(--ranks,8));
  pointer-events: none;
}
cg-board square.move-dest {
  background: radial-gradient(rgba(20, 85, 30, 0.5) 22%, #208530 0, rgba(0, 0, 0, 0.3) 0, rgba(0, 0, 0, 0) 0);
  pointer-events: auto;
}
cg-board square.premove-dest {
  background: radial-gradient(rgba(20, 30, 85, 0.5) 22%, #203085 0, rgba(0, 0, 0, 0.3) 0, rgba(0, 0, 0, 0) 0);
}
cg-board square.oc.move-dest {
  background: radial-gradient(transparent 0%, transparent 80%, rgba(20, 85, 0, 0.3) 80%);
}
cg-board square.oc.premove-dest {
  background: radial-gradient(transparent 0%, transparent 80%, rgba(20, 30, 85, 0.2) 80%);
}
cg-board square.move-dest:hover {
  background: rgba(20, 85, 30, 0.3);
}
cg-board square.premove-dest:hover {
  background: rgba(20, 30, 85, 0.2);
}
cg-board square.last-move {
  will-change: transform;
  background-color: rgba(155, 199, 0, 0.41);
}
cg-board square.selected {
  background-color: rgba(20, 85, 30, 0.5);
}
cg-board square.check {
  background: radial-gradient(ellipse at center, rgba(255, 0, 0, 1) 0%, rgba(231, 0, 0, 1) 25%, rgba(169, 0, 0, 0) 89%, rgba(158, 0, 0, 0) 100%);
}
cg-board square.current-premove {
  background-color: rgba(20, 30, 85, 0.5);
}
.cg-wrap piece {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(100% / var(--files,8));
  height: calc(100% / var(--ranks,8));
  background-size: cover;
  z-index: 2;
  will-change: transform;
  pointer-events: none;
}
cg-board piece.dragging {
  cursor: move;
  z-index: 10;
}
cg-board piece.anim {
  z-index: 8;
}
cg-board piece.fading {
  z-index: 1;
  opacity: 0.5;
}
.cg-wrap square.move-dest:hover {
  background-color: rgba(20, 85, 30, 0.3);
}
.cg-wrap piece.ghost {
  opacity: 0.3;
}
.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;
}
.cg-wrap svg {
  overflow: hidden;
  position: relative;
  top: 0px;
  left: 0px;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  opacity: 0.9;
  font-family: "Consolas";
  font-weight: bold;
}
.cg-wrap coords {
  position: absolute;
  display: flex;
  pointer-events: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  opacity: 1;
  font-size: 14px;
  font-weight: bold;
  font-family: "Arial";
}
.inner .cg-wrap coords {
  z-index: 1;
  font-size: 18px;
}
.cg-wrap.micro coords {
  display: none;
}
.cg-wrap coords.side {
  right: -20px;
  top: 0;
  flex-flow: column-reverse;
  height: 100%;
  width: 20px;
}
.inner .cg-wrap coords.side {
  right: 0;
}
.cg-wrap coords.side.black {
  flex-flow: column;
}
.cg-wrap coords.bottom {
  bottom: -20px;
  left: 0;
  flex-flow: row;
  width: 100%;
  height: 20px;
  text-transform: uppercase;
  text-align: center;
}
.inner .cg-wrap coords.bottom {
  bottom: 0;
}
.cg-wrap coords.top {
  top: -20px;
  left: 0;
  flex-flow: row;
  width: 100%;
  height: 20px;
  text-transform: uppercase;
  text-align: center;
}
.inner .cg-wrap coords.top {
  top: 0;
}
.cg-wrap coords.bottom.black {
  flex-flow: row-reverse;
}
.cg-wrap coords.top.black {
  flex-flow: row-reverse;
}

.shogi .cg-wrap coords.top.black {
  flex-flow: row;
}
.shogi .cg-wrap coords.top {
  flex-flow: row-reverse;
}
.shogi .cg-wrap coords.side.black {
  flex-flow: column-reverse;
}
.shogi .cg-wrap coords.side {
  flex-flow: column;
}
.xiangqi .cg-wrap coords.top {
  flex-flow: row;
}
.xiangqi .cg-wrap coords.top.black {
  flex-flow: row-reverse;
}
.xiangqi .cg-wrap coords.bottom.black {
  flex-flow: row;
}
.xiangqi .cg-wrap coords.bottom {
  flex-flow: row-reverse;
}

.cg-wrap coords.bottom coord {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.cg-wrap coords.top coord {
  flex: 1;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.cg-wrap coords.side coord {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: left;
  padding-left: 2px;
}
.inner .cg-wrap coords.bottom coord {
  align-items: flex-end;
  justify-content: right;
  padding-right: 3px;
}
.inner .cg-wrap coords.top coord {
  align-items: flex-start;
  justify-content: left;
  padding-top: 2px;
  padding-left: 3px;
}
.inner .cg-wrap coords.side coord {
  align-items: flex-start;
  justify-content: right;
  padding-top: 2px;
  padding-right: 3px;
}

.inner .cg-wrap coords coord.dark {
  color: var(--dark-square-color,#000);
}
.inner .cg-wrap coords coord.light {
  color: var(--light-square-color,#000);
}

/* Drop variants */
.cg-wrap.pocket-top {
  display: inline;
}
.cg-wrap.pocket-bottom {
  display: inline;
}
.pocket {
  width: calc(var(--pocketLength) * (var(--cg-width) / var(--files)));
  height: calc(var(--cg-height) / var(--ranks));
  border-radius: 3px;
  box-shadow: 0 2px 3px rgba(0,0,0,0.3) inset;
  background: #888;
  white-space: nowrap;
  display: flex;
  --fs: calc(var(--cg-height) / var(--ranks));
  font-size: var(--fs);
  padding-bottom: 1px;
}
.pocket.top {
  margin-bottom: var(--pocketMargin);
}
.pocket.bottom {
  margin-top: var(--pocketMargin);
}
.pocket square, .pocket nosquare {
  flex: 0 0 calc(100% / var(--pocketLength));
  position: relative !important;
  pointer-events: none;
}
.pocket piece {
  height: 100% !important;
  width: 100% !important;
  background-position: center;
  pointer-events: auto;
}
.pocket square.selected-square{
  background-color: #14551e80 !important;
}
.pocket.usable square:first-child:hover {
  border-radius: 3px 0 0 3px;
}
.pocket.usable square {
  cursor: pointer;
}
.pocket.usable square:hover {
  background-color: #999;
  transition: background-color 0.13s;
}
.pocket.usable square.premove {
  background-color: #555;
}
.pocket.usable square.premove:hover {
  background-color: #666;
}
.pocket square.last-move {
  will-change: transform;
  background-color: rgba(155, 199, 0, 0.41);
}
.pocket piece[data-nb='0'] {
  cursor: auto;
  opacity: 0.1;
}
.movemode .pocket piece[data-nb='0'] {
  cursor: inherit;
}
.pocket piece::after {
  content: attr(data-nb);
  bottom: 0;
  right: 0;
  position: absolute;
  line-height: 0.9em;
  padding: 2px 0.2em;
  font-weight: bold;
  border-radius: 2px;
  font-size: 0.3em;
  color: #fff !important;
  text-shadow: 0 1px 0 #000 !important;
  background: #d85000 !important;
  box-shadow: 0 3px 4px rgba(0, 0, 0, 0.15) inset !important;
}

cg-auto-pieces piece {
  opacity: 0.6;
}
