@font-face {
  font-family: Genshin;
  src: url('genshin.ttf');
}

body {
  margin: 0;
  padding: 0;
  color: #eee;
  background-color: #080e1c;
  font-family: Genshin, sans-serif;
  user-select: none;
  overflow: hidden;
}

.container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  container-type: size;
}

.backdrop {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(181cqh, 100cqw);
  height: min(55cqw, 100cqh);
  background-image: url('img/board.png');
  background-size: 100% auto;
  background-repeat: no-repeat;
  container-type: size;
}

.controls {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0.5cqh;
  font-size: 5cqh;
}

.controls > div {
  display: inline-block;
  position: relative;
  width: 7cqh;
  height: 7cqh;
  text-align: center;
  cursor: pointer;
}

.controls > div > div {
  position: absolute;
  top: 0;
  left: 0;
}

.controls .icon {
  filter: grayscale(1) contrast(0) brightness(50%);
  transition: filter 0.25s ease-in-out;
}

.controls > div:hover .icon {
  filter: grayscale(1) contrast(0) brightness(200%);
}

.controls .cross {
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.controls > div.muted .cross {
  opacity: 1;
}

.config {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  left: 0;
  width: 36cqh;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2cqh);
  border-radius: 0 3cqh 3cqh 0;
  padding: 3cqh;
  font-size: 3cqh;
}

.config.hidden {
  display: none;
}

.config h1 {
  margin: 0 0 0.5em 0;
  text-align: center;
  color: #0ff;
  font-size: 5cqh;
}

.config .panel {
  margin: 1em 0;
}

.config .panel > div {
  text-align: center;
}

.config .panel > label {
  display: block;
  margin-bottom: 0.25em;
}

button {
  font-family: Genshin, sans-serif;
  color: #ccc;
  background-color: rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
  border: none;
  border-radius: 1.5cqh;
  margin: 1cqh 0;
  padding: 0.5cqh 2cqh;
  cursor: pointer;
  font-size: 3cqh;
}

button:hover:not(:disabled) {
  color: #fff;
  background-color: #000;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button img {
  vertical-align: middle;
  width: 4cqh;
  height: 4cqh;
}

button label {
  position: relative;
  top: 2px;
  cursor: pointer;
}

.radio button {
  display: block;
  width: 100%;
  text-align: left;
}

.radio button.selected {
  color: #fff;
  background-color: #000;
  outline: solid #0ff 1px;
}

.spinner span {
  display: inline-block;
  width: 4.5em;
}

.config .panel:has(> .start) {
  text-align: center;
}

.config .start {
  font-size: 7cqh;
  padding: 2cqh 5cqh;
}

.board {
  --board-size: 76cqh;
  position: absolute;
  top: 11cqh;
  left: 53.7cqh;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  width: var(--board-size);
  height: var(--board-size);
}

.board div {
  height: 100%;
  width: 100%;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12cqh auto;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.25s ease-in-out;
}

.board.disabled div {
  cursor: default;
}

.board div.show {
  opacity: 1;
}

.board div.columbina {
  background-image: url('img/stone-light.png');
  cursor: not-allowed;
}

.board div.traveler {
  background-image: url('img/stone-dark.png');
  cursor: not-allowed;
}

.board:not(.disabled) div:not(.empty) {
  cursor: not-allowed;
}

.board div.waning {
  animation-name: waning-moon;
  animation-duration: 0.75s;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-timing-function: ease-in-out;
}

@keyframes waning-moon {
  0% {
    opacity: 1;
  }

  100% {
    opacity: 0.25;
  }
}

.talk {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40cqh;
  padding: 1cqh;
  font-size: 3cqh;
}

.talk .subtitles:not(:empty) {
  padding: 0.5em 1em;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  border-radius: 0.5em;
}

.talk .avatar {
  text-align: center;
}

.talk .avatar img {
  width: 25cqh;
  height: 25cqh;
}

.status {
  position: absolute;
  bottom: 2cqh;
  left: 0;
  width: 100%;
  font-size: 8cqh;
  text-align: center;
  color: #fff;
  text-shadow: 0 0 2cqh #000;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

.status.show {
  opacity: 1;
}

.fineprint {
  position: absolute;
  bottom: 1cqh;
  left: 0;
  color: #555;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2cqh);
  font-size: 2cqh;
  padding: 0.5cqh 2cqh;
  border-radius: 0 1cqh 1cqh 0;
  opacity: 0.5;
  transition: opacity 0.5s ease-in-out;
}

.fineprint:hover {
  opacity: 1;
}

.fineprint a:link, .fineprint a:visited {
  color: #999;
  text-decoration: none;
}

.fineprint a:active, .fineprint a:hover {
  color: #0ff;
  text-decoration: underline;
}
