html,
body {
  background-color: #fff;
  font-family: "Helvetica", "Arial", "Verdana", sans-serif;
  margin: 0;
  padding: 0;
}

.app-container {
  max-width: 100%;
  overflow: hidden;
}

.header {
  background-color: #369;
  padding: 10px 0;
}

.header > h1 {
  color: #fff;
  font-size: 24px;
  font-weight: 400;
  margin: 0;
  text-align: center;
}

.container {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 20px auto;
  width: 352px;
}

/* BOARD */

.board {
  align-items: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
  justify-content: center;
  user-select: none;
}

.row {
  align-items: center;
  display: flex;
  gap: 4px;
  justify-content: center;
}

.row > div {
  background: #ddd;
  border: 1px solid #ccc;
  height: 52px;
  position: relative;
  width: 52px;
}

.row .suggested.one {
  box-shadow: inset -3px 3px #8d2;
}

.row .suggested.two {
  box-shadow: inset 3px -3px #f93;
}

.row .suggested.one.two {
  box-shadow: inset -3px 3px #8d2, inset 3px -3px #f93;
}

.row .big:after,
.row .little:after {
  border-radius: 50%;
  content: "";
  position: absolute;
}

.row .big:after {
  height: 32px;
  left: 10px;
  top: 10px;
  width: 32px;
}

.row .little:after {
  height: 16px;
  left: 18px;
  top: 18px;
  width: 16px;
}

.row .one:after {
  background: #8d2;
}

.row .two:after {
  background: #f93;
}

.piece-selected .row > .empty {
  cursor: pointer;
}

.piece-selected .row > .empty:hover {
  background: #eee;
}

.piece-selected .row > .empty:active {
  background: #ccc;
}

/* PIECES */

.pieces {
  align-items: center;
  display: flex;
  gap: 5px;
  justify-content: center;
  margin-top: 20px;
}

.pieces > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pieces > div:nth-child(1) {
  flex-direction: row-reverse;
}

.pieces > div > div {
  height: 52px;
  position: relative;
  width: 52px;
}

.pieces .big:after,
.pieces .little:after {
  border-radius: 50%;
  content: "";
  position: absolute;
}

.pieces .big:after {
  height: 32px;
  left: 10px;
  top: 10px;
  width: 32px;
}

.pieces .little:after {
  height: 16px;
  left: 18px;
  top: 18px;
  width: 16px;
}

.pieces .big.suggested:after,
.pieces .little.suggested:after {
  box-shadow: inset -4px 3px #58a;
}

.pieces .big.selected:after,
.pieces .little.selected:after {
  outline: 3px solid #69b;
}

.pieces .big:not(.selected),
.pieces .little:not(.selected) {
  border-radius: 6px;
  cursor: pointer;
}

.pieces .big:not(.selected):hover,
.pieces .little:not(.selected):hover {
  background: #eee;
}

.pieces .big:not(.selected):active,
.pieces .little:not(.selected):active {
  background: #ccc;
}

.pieces > div:nth-child(1) > div:after {
  background: #8d2;
}

.pieces > div:nth-child(2) > div:after {
  background: #f93;
}

/* CONTROLS */

.depth-gauge {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 12px;
  justify-content: center;
  margin: 24px auto;
  user-select: none;
  font-size: 18px;
}

.number-control {
  align-items: center;
  border-radius: 6px;
  border: 1px solid #ccc;
  display: flex;
  flex-direction: column;
  font-family: sans-serif;
  overflow: hidden;
  user-select: none;
}

.number-control .up,
.number-control .down {
  background: #e5e5e5;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  text-align: center;
  width: 100%;
}

.number-control .up:hover,
.number-control .down:hover {
  background: #f0f0f0;
}

.number-control .up:active,
.number-control .down:active {
  background: #ddd;
}

.number-control .depth {
  padding: 5px;
  font-size: 24px;
  font-weight: bold;
  background: white;
  width: 100%;
  text-align: center;
}

.thinker {
  background: #999;
  border-radius: 50%;
  height: 42px;
  opacity: 0.5;
  overflow: hidden;
  position: relative;
  transform: scale(1);
  transition: opacity 0.6s ease, transform 0.6s ease;
  width: 42px;
}

.thinker::before {
  animation: swirl 3s linear infinite;
  background: conic-gradient(from 0deg, #369, #147, #69b, #369);
  border-radius: 50%;
  content: "";
  inset: 0;
  opacity: 0.4;
  pointer-events: none;
  position: absolute;
  transform: rotate(0deg);
  transition: opacity 0.6s ease;
  z-index: 0;
}

.thinker::after {
  background: radial-gradient(
    circle at 30% 30%,
    rgba(255, 255, 255, 0.2),
    transparent 50%
  );
  border-radius: 50%;
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.thinker:not(.active)::before {
  animation-play-state: paused;
  opacity: 0;
}

.thinker.active {
  animation: pulse 3s ease-in-out infinite;
  background: #369;
  opacity: 1;
  transform: scale(1.05);
}

@keyframes swirl {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1.05);
  }
  50% {
    transform: scale(1.15);
  }
}

.undo {
  background: #e5e5e5;
  border-radius: 50%;
  border: 1px solid #bbb;
  cursor: pointer;
  font-size: 20px;
  height: 31px;
  line-height: 31px;
  text-align: center;
  width: 31px;
}

.undo:hover {
  background: #f0f0f0;
}

.undo:active {
  background: #ddd;
}
