.checkers-icon {
  display: block;
  object-fit: contain;
  image-rendering: pixelated;
}

.checkers-icon-desktop {
  width: 72px;
  height: 72px;
}

.checkers-icon-mini {
  width: 24px;
  height: 24px;
}

#checkersWindow {
  width: 760px;
  min-height: 0;
  --checkers-text: #2b1809;
  --checkers-muted: #68472a;
  --checkers-panel-bg: rgba(255, 247, 226, 0.9);
  --checkers-panel-border: #7f6441;
  --checkers-wrap-border: #6e5432;
  --checkers-wrap-bg:
    linear-gradient(180deg, rgba(255, 239, 209, 0.94), rgba(214, 188, 142, 0.94)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.12),
      rgba(255, 255, 255, 0.12) 1px,
      transparent 1px,
      transparent 7px
    );
  --checkers-body-bg: linear-gradient(180deg, #e7dcc3, #ccb58a 58%, #a17b4a 100%);
}

:root[data-theme="dark"] #checkersWindow {
  --checkers-text: #f4e3c0;
  --checkers-muted: #d1b68e;
  --checkers-panel-bg: rgba(52, 35, 22, 0.9);
  --checkers-panel-border: #8f6d46;
  --checkers-wrap-border: #9e784b;
  --checkers-wrap-bg:
    linear-gradient(180deg, rgba(92, 65, 37, 0.94), rgba(58, 38, 22, 0.94)),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.07),
      rgba(255, 255, 255, 0.07) 1px,
      transparent 1px,
      transparent 7px
    );
  --checkers-body-bg: linear-gradient(180deg, #5b4127, #3d2917 56%, #24170d 100%);
}

.checkers-window-body {
  padding: 16px;
  color: var(--checkers-text);
  background: var(--checkers-body-bg);
}

.checkers-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  color: inherit;
}

.checkers-sidebar {
  display: grid;
  gap: 12px;
}

.checkers-panel {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--checkers-panel-border);
  border-radius: 4px;
  background: var(--checkers-panel-bg);
  box-shadow: var(--bevel-out);
}

.checkers-panel h3 {
  margin: 0;
}

.checkers-window-body .eyebrow,
.checkers-window-body .secondary-line {
  color: var(--checkers-muted);
}

.checkers-board-wrap {
  padding: 14px;
  border: 1px solid var(--checkers-wrap-border);
  border-radius: 4px;
  background: var(--checkers-wrap-bg);
  box-shadow: var(--bevel-out), 0 6px 18px rgba(50, 28, 8, 0.18);
}

.checkers-board {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  grid-template-rows: repeat(8, minmax(0, 1fr));
  width: min(100%, 496px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 3px solid #6d4f2a;
  box-shadow: inset 0 0 0 1px rgba(255, 240, 212, 0.5), 0 4px 12px rgba(45, 22, 5, 0.2);
}

.checkers-square {
  appearance: none;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
}

.checkers-square.is-light {
  background-color: #ead19d;
  background-image: url("./assets/checkers/tile-light.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.checkers-square.is-dark {
  background-color: #7f4d22;
  background-image: url("./assets/checkers/tile-dark.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.checkers-square.is-selectable {
  box-shadow: inset 0 0 0 2px rgba(255, 246, 199, 0.35);
}

.checkers-square.is-selected {
  box-shadow: inset 0 0 0 3px #ffe287;
}

.checkers-square.is-legal-destination::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px dashed rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.checkers-square.has-capture::after {
  border-color: rgba(255, 210, 102, 0.94);
}

.checkers-piece {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 82%;
  height: 82%;
}

.checkers-piece-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
  image-rendering: pixelated;
  pointer-events: none;
}

.checkers-move-dot {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 249, 235, 0.9);
  box-shadow: 0 0 0 3px rgba(70, 44, 16, 0.35);
  pointer-events: none;
}

.checkers-move-dot.is-capture {
  background: #ffd96a;
  box-shadow: 0 0 0 3px rgba(130, 50, 14, 0.45);
}

@media (max-width: 920px) {
  #checkersWindow {
    width: 680px;
  }

  .checkers-shell {
    grid-template-columns: 1fr;
  }

  .checkers-sidebar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .checkers-window-body {
    padding: 10px;
  }

  .checkers-sidebar {
    grid-template-columns: 1fr;
  }

  .checkers-board-wrap {
    padding: 8px;
  }
}
