.hero-art {
  max-width: 1500px;
  margin: 18px auto 0;
  padding: 0 clamp(12px, 3vw, 38px);
}

.hero-art img {
  display: block;
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  object-position: center;
  border: 4px solid var(--ink);
  box-shadow: 7px 7px 0 var(--ink);
}

.pieces .piece {
  width: clamp(21px, 2.25vw, 31px);
  height: clamp(21px, 2.25vw, 31px);
  font-size: clamp(17px, 1.9vw, 26px);
}

.pieces .piece.human-piece {
  width: clamp(30px, 3.25vw, 45px);
  height: clamp(30px, 3.25vw, 45px);
  font-size: clamp(24px, 2.8vw, 38px);
  z-index: 2;
}

.player .piece.human-piece,
.npc-card .piece.human-piece,
.result-row .piece.human-piece {
  width: 42px;
  height: 42px;
  font-size: 34px;
}

.big-piece.npc-piece {
  width: 60px;
  height: 60px;
  font-size: 44px;
}

.big-piece.human-piece {
  width: 82px;
  height: 82px;
  font-size: 62px;
}

@media (max-width: 720px) {
  .hero-art img { max-height: 170px; }
  .pieces .piece.human-piece {
    width: clamp(26px, 7vw, 38px);
    height: clamp(26px, 7vw, 38px);
  }
}

.character-token {
  display: inline-block;
  flex: 0 0 auto;
  background-color: transparent !important;
  background-image: url("assets/chess-characters.png") !important;
  background-repeat: no-repeat !important;
  background-size: 600% 500% !important;
  background-position: var(--piece-x) var(--piece-y) !important;
  color: transparent;
  text-shadow: none;
}

.names {
  display: block;
}

.name-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.chosen-token,
.picker-token {
  width: 80px;
  height: 80px;
  padding: 0;
  border: 2px solid var(--ink);
  border-radius: 18px;
  cursor: pointer;
}

.name {
  align-items: center;
}

.name.choosing {
  outline: 4px solid var(--sun);
  outline-offset: 2px;
}

.name .chosen-token {
  width: 64px;
  height: 64px;
  border: 0;
  border-right: 2px solid var(--ink);
  border-radius: 0;
}

.piece-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  padding: 12px;
  max-height: 290px;
  overflow-y: auto;
  border: 3px solid var(--ink);
  background: #efe3b4;
}

.picker-token {
  justify-self: center;
  background-color: #fff8d9 !important;
}

.picker-token:hover:not(:disabled),
.picker-token.selected {
  border-color: var(--red);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translate(-2px, -2px);
}

.picker-token:disabled {
  opacity: .28;
  cursor: not-allowed;
  filter: grayscale(1);
}

.piece.character-token,
.big-piece.character-token {
  border-radius: 12px;
  box-shadow: none;
}

@media (max-width: 720px) {
  .name-list { grid-template-columns: 1fr; }
  .piece-picker { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
}

@media (min-width: 1001px) and (min-height: 650px) {
  body.playing {
    height: 100dvh;
    overflow: hidden;
  }

  body.playing main {
    margin-top: 14px;
    margin-bottom: 0;
  }

  body.playing .game {
    height: var(--game-height);
    align-items: stretch;
  }

  body.playing .game > section {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  body.playing .board-frame {
    flex: 1;
    min-height: 0;
  }

  body.playing .board {
    height: 100%;
    grid-template-rows: repeat(var(--board-rows), minmax(0, 1fr));
  }

  body.playing .cell {
    min-height: 0;
    aspect-ratio: auto;
  }

  body.playing .players,
  body.playing .turn {
    max-height: 100%;
    overflow: hidden;
  }
}

.pieces .piece {
  position: relative;
  animation: none;
}

.pieces .piece.is-moving {
  animation: hop .35s ease-in-out;
}

.move-count {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: calc(100% - 5px);
  min-width: 25px;
  height: 25px;
  padding: 0 6px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--red);
  color: white;
  font: 900 13px/1 Arial, sans-serif;
  font-style: normal;
  text-shadow: 1px 1px var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  pointer-events: none;
}

.move-count.count-zero {
  animation: count-fade .4s ease-out forwards;
}

@keyframes count-fade {
  to { opacity: 0; transform: translate(-50%, -9px) scale(.7); }
}

.start-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.start-actions .primary {
  margin-top: 0;
}

.original-start {
  width: 100%;
  padding: 12px;
  border: 3px solid var(--ink);
  background: var(--sun);
  color: var(--ink);
  font-weight: 900;
  box-shadow: 5px 5px 0 var(--ink);
}

.original-start span {
  display: block;
  margin-top: 4px;
  color: #87362b;
  font-size: 11px;
}

@media (max-width: 720px) {
  .start-actions { grid-template-columns: 1fr; }
}

.original-frame {
  background: #f0cf3e;
}

.original-board {
  background-color: #101711;
  background-image: url("assets/original-board.png");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: 100% 117%;
}

.original-board .cell {
  background: transparent !important;
  border-color: transparent;
}

.original-board .cell > span,
.original-board .cell.finish::after {
  display: none;
}

.original-board .paths {
  display: none;
}

.original-board .pieces {
  filter: drop-shadow(0 2px 1px #fff8d9) drop-shadow(0 1px 2px #17251b);
}

body {
  display: flex;
  flex-direction: column;
}

main {
  width: 100%;
  flex: 1 0 auto;
}

.site-footer {
  width: 100%;
  margin-top: auto;
  padding: 18px 16px 20px;
  border-top: 2px solid var(--ink);
  color: #574d31;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .02em;
  text-align: center;
}
