/* Container */
* {
  padding: 0px;
  margin: 0px;
  border-width: 0px;
}

body {
  background-color: #F2EDF5;
  font-family: Kanit;
  
  /* Disable Page Scrolling when Dragging */
  overflow: hidden;
  height: 100%;

  /* Disable Text Selection */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

header {
  background: #704171;
  text-align: center;
  font-size: xx-large;
  height: 48px;
  line-height: 48px;  /* Vertical Center */
  margin-bottom: 4px;
}

/* Wrapper */
#wrapper {
  display: table;
  height: calc(100vh - 68px); /* Vertical Alignment Center */
  margin: 0px auto; /* Horizontal Alignment Center */
}

#wrapper-row {
  display: table-row;
}

#wrapper-cell {
  display: table-cell;
  vertical-align: middle;
}

/* Board */
#board {
  border-collapse: separate;
  border-spacing: 0px;
  border-width: 4px 8px;
  border-style: solid;
  border-color: #B3A5BB;
  min-width: 264px;
  min-height: 268px;
}

#board #p1, #board #p2 {
  height: 4px;
}

#board img {
  display: block;
  width: calc((100vw - 24px) / 8);
  height: calc((100vw - 24px) / 8);
  max-width: calc((100vh - 72px) / 8);
  max-height: calc((100vh - 72px) / 8);
  min-width: 32px;
  min-height: 32px;
}

.board-cell-space {
  background-image: url("../images/space2.png?v=2");
  background-size: cover;
  width: 32px;
  height: 32px;
}

.board-cell-empty {
  background-image: url("../images/cell2.png?v=2");
  background-size: cover;
}

.active-player1 {
  background-color: #D1C2DF;
}

.active-player2 {
  background-color: #623663;
}

.inactive-player {
  background-color: #B3A5BB;
}

.playable {
  cursor: pointer;
}

.movable {
  box-shadow: inset 0 0 0 1024px rgba(130, 114, 107, 0.5);
}

/* Button */
body > img {
  position: absolute;
  top: 0px;
  height: 48px;
  display: none;
}

body > img:hover {
  cursor: pointer;
}

/* Dialog */
#alert, #result, #detail {
  display: none;
}

#detail div {
  text-align: center;
}

#detail div p {
  margin-bottom: 12px;
}

/* Link */
#link {
  position: absolute;
  top: 8px;
  display: none;
}

#link-image {
  background-color: #F9F9F9;
  padding: 7px;
  border-radius: 6px;
}

#link-image:hover, #link-image:focus {
  background-color: #E9E9E9;
  cursor: pointer;
}

#link-menu {
  display: none;
  position: absolute;
  background-color: #F9F9F9;
  padding: 4px 2px;
  min-width: 140px;
  overflow: auto;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 2px;
}

#link-menu .disabled {
  display: block;
  color: #AAAAAA;
  padding: 4px 16px;
  font-weight: bold;
}

#link-menu a {
  display: block;
  color: black;
  padding: 4px 16px;
  text-decoration: none;
}

#link-menu a:hover {
  background-color: #E9E9E9;
}

#link-menu hr {
  height: 1px;
  margin: 6px 2px;
  background-color: #CCCCCC;
}