:root {
  --square-border-width: 4px;
  --darkest-color: #010101;
  --darker-color: #282828;
  --dark-color: #545454;
  --dark-color-hover: #4b4b4b;
  --light-color: #848484;
  --lighter-color: #bfbfbf;
  --lightest-color: #ffffff;
  --board-vh-limit: 70vh;
  --graveyard-unit: 0.6rem;
}



* {
  touch-action: manipulation;
  -webkit-touch-callout:none;
  -webkit-user-select:none;
  -khtml-user-select:none;
  -moz-user-select:none;
  -ms-user-select:none;
  user-select:none;
  -webkit-tap-highlight-color:rgba(0,0,0,0);
}

#p1graveyard,
#p2graveyard {
  height: fit-content;
  display: flex;
  justify-content: flex-start;
  position: relative;
  pointer-events: none;
}

#p1graveyard .sub-graveyard,
#p2graveyard .sub-graveyard{
  align-items: flex-end;
}

#p1graveyard {
}

.sub-graveyard {
  width: calc(100vw / 15);
  height: calc(100vw / 15);
  max-width: calc(var(--board-vh-limit) / 15);
  max-height: calc(var(--board-vh-limit) / 15);
  margin-left: calc(-1.2 * var(--graveyard-unit));
  position: relative;
}

.sub-graveyard .piece {
  width: calc(100vw / 15);
  height: calc(100vw / 15);
  max-width: calc(var(--board-vh-limit) / 15);
  max-height: calc(var(--board-vh-limit) / 15);
}
.sub-graveyard:nth-of-type(1) {
  margin-left: 0rem;
}

.sub-graveyard > *:nth-child(2){
  margin-left:calc(1* var(--graveyard-unit));
}
.sub-graveyard > *:nth-child(3){
  margin-left:calc(2* var(--graveyard-unit));
}
.sub-graveyard > *:nth-child(4){
  margin-left:calc(3* var(--graveyard-unit));
}
.sub-graveyard > *:nth-child(5){
  margin-left:calc(4* var(--graveyard-unit));
}
.sub-graveyard > *:nth-child(6){
  margin-left:calc(5* var(--graveyard-unit));
}
.sub-graveyard > *:nth-child(7){
  margin-left:calc(6* var(--graveyard-unit));
}
.sub-graveyard > *:nth-child(8){
  margin-left:calc(7* var(--graveyard-unit));
}




#ff-buttons {
  display: flex;
  justify-content: space-around;
}

#ff-yes:hover,
#ff-no:hover {
  cursor: pointer;
}

#ff-yes,
#ff-no {
  display: inline-block;
  background-color: var(--dark-color);
  padding: 0.5rem 1rem;
  font-size: 1.2rem;
  width: 2.5rem;
  text-align: center;
  border-radius: 5px;
  margin-top: 1rem;
}

#choose-promotion > .promotion-piece {
  margin: 8px;
  position: relative;
}

#choose-promotion > .promotion-piece:hover {
  cursor: pointer;
}

#choose-promotion {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /*   min-width: calc( var(--square-dim-main) * 3);
  min-height: calc( var(--square-dim-main) * 3); */
  background-color: var(--dark-color);
  opacity: 90%;
  border-radius: 0.1rem;
  z-index: 2;
  box-shadow: 0px 0px 1rem -2px #ccc;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  visibility: hidden;
}

#traverse-moves button {
  background-color: var(--dark-color);
}
#traverse-moves button:hover {
  background-color: #313131;
}
#traverse-moves button:active {
  background-color: #282828;
}

#traverse-moves {
  display: flex;
  justify-content: center;
}

#traverse-moves button {
  margin: 0 0.5rem;
  width: 5rem;
  font-size: 2rem;
}

button:focus {
  outline-color: #757575;
}

#thinking {
  display: flex;
  justify-content: center;
  flex-grow: 1;
  padding-top: .5rem;
  visibility: hidden;
}

#thinking.visible {
  visibility: visible;
}

#thinking * {
  margin: 0 2px;
}

.rotate-anim {
  position: relative;
}

.rotate1 {
  position: absolute;
  border-top: 1pt solid black;
  border-right: 1pt solid black;
  border-radius: 50%;
  padding: 5px;
  animation: rotation 2s infinite linear;
}

.rotate2 {
  position: absolute;
  border-bottom: 1pt solid black;
  border-radius: 50%;
  padding: 5px;
  animation: rotation 1s infinite linear;
}

@keyframes rotation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(359deg);
  }
}

#placeholder {
  font-size: 15px;
  visibility: hidden;
}

#pgn-save.left {
  left: -125px;
}

#pgn-load.right {
  left: 125px;
}

#toggle-computer.right,
#toggle-first.left {
  height: 32px;
  top: 0;
  margin-top: 5px;
  visibility: visible;
}

#toggle-computer {
}

#toggle-first.left {
  width: 125px;
  left: -125px;
}

#toggle-compute.right {
  width: 160px;
  left: 125px;
}

.options > button {
  width: 125px;
  height: 32px;
  margin: 5px auto;
}


@media screen and (max-width: 500px) and (max-height: 1000px) {
  :root{
    --graveyard-unit: 0.5rem;
  }
}

@media screen and (max-width: 500px) and (max-height: 600px) {
  :root{
    --graveyard-unit: 0.5rem;
  }
  .sub-graveyard{
    margin-left:0rem;
  }
}


@media screen and (max-width:300px) and (min-height:601px){
  #ff-yes,
  #ff-no {
    padding: 0.3rem 0.8rem;
    font-size: 0.9rem;
    width: 1.4rem;
    border-radius: 5px;
    margin-top: .8rem;
  }
}