/*
 * 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 {
  margin: auto;
  display: flex;
  flex-flow: row;
  aspect-ratio: 1 / 1;
  width: auto;
  height: 100%;
}

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;
  margin: auto;
}

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 {
  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: 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;
}
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 coords {
  position: absolute;
  display: flex;
  pointer-events: none;
  opacity: 0.8;
  font-size: 9px;
}
.cg-wrap coords.ranks {
  right: -16px;
  top: 0;
  flex-flow: column-reverse;
  height: 100%;
  width: 16px;
}
.cg-wrap coords.ranks.black {
  flex-flow: column;
}
.cg-wrap coords.files {
  bottom: -16px;
  left: 0;
  flex-flow: row;
  width: 100%;
  text-transform: uppercase;
  text-align: center;
  line-height: 16px;
}

.cg-wrap coords.files.black {
  flex-flow: row-reverse;
}
.cg-wrap coords coord {
  flex: 1 1 auto;
}
.cg-wrap coords.ranks coord {
  transform: translateY(51%);
  text-align: center;
}

/* Unrelated to chessground; only for the examples page */
#play-vs-ai menu {
  flex: 0 0 300px;
  margin: 0 15px 0 0;
}
#play-vs-ai menu a {
  display: block;
  cursor: pointer;
  padding: 5px 15px;
}
#play-vs-ai menu a:hover {
  background: #333;
}
#play-vs-ai menu a.active {
  border-left: 5px solid #b0b0b0;
}
#play-vs-ai section {
  display: inline-block;
  background: #FFFFFF;
  padding: 0px 12px 0px 12px;
  border-radius: 2px;
}
#play-vs-ai section p {
  text-align: center;
  margin: 20px 0 0 0;
}
#play-vs-ai control {
  margin-left: 20px;
}
#play-vs-ai control .zoom {
  margin-top: 1em;
  display: block;
}
#play-vs-ai control .zoom input {
  margin-left: 1em;
  width: 4em;
}

/*
 * Board
 */
.blue .cg-wrap {
  background: url('images/board/8x8maple.jpg') repeat 0 0/25%;
}

.merida .cg-wrap piece.pawn.white {
  background-image: url('images/pieces/merida/wP.svg');
}
.merida .cg-wrap piece.bishop.white {
  background-image: url('images/pieces/merida/wB.svg');
}
.merida .cg-wrap piece.knight.white {
  background-image: url('images/pieces/merida/wN.svg');
}
.merida .cg-wrap piece.rook.white {
  background-image: url('images/pieces/merida/wR.svg');
}
.merida .cg-wrap piece.queen.white {
  background-image: url('images/pieces/merida/wQ.svg');
}
.merida .cg-wrap piece.king.white {
  background-image: url('images/pieces/merida/wK.svg');
}
.merida .cg-wrap piece.pawn.black {
  background-image: url('images/pieces/merida/bP.svg');
}
.merida .cg-wrap piece.bishop.black {
  background-image: url('images/pieces/merida/bB.svg');
}
.merida .cg-wrap piece.knight.black {
  background-image: url('images/pieces/merida/bN.svg');
}
.merida .cg-wrap piece.rook.black {
  background-image: url('images/pieces/merida/bR.svg');
}
.merida .cg-wrap piece.queen.black {
  background-image: url('images/pieces/merida/bQ.svg');
}
.merida .cg-wrap piece.king.black {
  background-image: url('images/pieces/merida/bK.svg');
}


.lichess_ground .replay .moves {
  border-top: 1px solid #e2e2e2;
  border-bottom: 1px solid #e2e2e2;
  margin: 0 -10px 0 -10px;
  height: 115px;
  overflow: auto;
  position: relative;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.variant_crazyhouse .lichess_ground .replay .moves {
  height: 100px;
}
.lichess_ground .replay turn {
  display: flex;
  height: 26px;
}
.lichess_ground .replay turn > index,
.lichess_ground .replay turn > move {
  display: inline-block;
  height: 22px;
  line-height: 22px;
}
.lichess_ground .replay turn > index {
  flex: 0 0 34px;
  padding: 2px 0;
  background: #315c7f;
  text-align: center;
}
.lichess_ground .replay turn > move {
  flex: 1 1 50%;
  font-size: 17px;
  padding: 2px 5px;
}
.lichess_ground .replay move:not(.empty) {
  cursor: pointer;
  transition: background-color 0.13s;
}
.lichess_ground .replay move:not(.empty):hover {
  background: #bebbbb;
}
.lichess_ground .replay move.active,
.lichess_ground .replay move.active::after {
  color: #63a1ca!important; /* highlight color */
  font-weight: bold;
}
.lichess_ground .replay move.context_menu {
  background: #3893E8;
  color: #fff;
}
.lichess_ground .replay .result {
  font-weight: bold;
  font-size: 1.3em;
  padding: 4px 0;
  text-align: center;
  display: none;
}
.lichess_ground .replay .status {
  background: url(../images/cmg-images/status-bg.png);
  font-size: 14px;
  height: 39px;
  margin: -28px 0px -5px -14px;
  padding-top: 16px;
  padding-left: 20px;
  text-align: left;
  width: 232px;
  font-weight: bold;
  display: none;
}
.lichess_ground .table .replay .status {
  display: block;
}
.lichess_ground .replay .status.black{
  background: url(../images/cmg-images/black-wins.png);
  font-size: 0px;
}
.lichess_ground .replay .status.white{
  background: url(../images/cmg-images/white-wins.png);
   font-size: 0px;
}
.lichess_ground .replay .status.outoftime.white{
  background: url(../images/cmg-images/whitewins-timeout.png);
   font-size: 0px;
}
.lichess_ground .replay .status.outoftime.black{
  background: url(../images/cmg-images/blackwins-timeout.png);
   font-size: 0px;
 }
.lichess_ground .replay .status.resign.white{
  background: url(../images/cmg-images/whitewins_black_resigns.png);
   font-size: 0px;
}
.lichess_ground .replay .status.resign.black{
  background: url(../images/cmg-images/blackwins_white_resigns.png);
   font-size: 0px;
 }

.lichess_ground .replay .status.stalemate{
  background: url(../images/cmg-images/tie-game.png);
  font-size: 0px;
}
.lichess_ground .replay .status.draw{
  background: url(../images/cmg-images/draw-game.png);
  font-size: 0px;
}
.lichess_ground .replay .moves .status{
  display: none;
}
.lichess_ground .replay .buttons {
  text-align: center;
  margin: 8px 0 5px 0;
}
.lichess_ground .replay a.button {
  opacity: 0.9;
  padding: 4px 7px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  margin-left: -1px;
  margin-right: -1px;
}
.lichess_ground .replay a.flip {
  margin-right: 10px;
}
.lichess_ground .replay a.analysis {
  margin-left: 10px;
  display: none;
}
.lichess_ground .replay a.disabled {
  cursor: default;
}
.lichess_ground .replay a.disabled::before {
  opacity: 0.4;
  text-shadow: none !important;
}