/* Page block: basic layout and typography */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 16px;
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  color: #111;
}

/* Reusable card block */
.card {
  background: #fff;
  border: 1px solid #d7dde3;
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
}

/* Utility block */
.hidden {
  display: none;
}

/* Form row block */
.row {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

/* Inputs block */
input {
  padding: 8px;
  border: 1px solid #b8c3ce;
  border-radius: 8px;
}

/* Buttons block */
button {
  padding: 8px 10px;
  border: 1px solid #9aa6b2;
  border-radius: 8px;
  background: #fdfdfd;
  cursor: pointer;
  margin-right: 6px;
  margin-bottom: 6px;
}

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

/* Text color block */
.error {
  color: #c1121f;
  min-height: 20px;
}

/* Top bar block */
.topbar p {
  margin: 4px 0;
}

/* Players list block */
#players {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}

.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid #e4e7eb;
  border-radius: 8px;
  padding: 8px;
}

.player-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Small player badge block */
.token-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid #222;
}

/* Board stage block: responsive square board container */
.board-stage {
  position: relative;
  width: 100%;
  max-width: 860px;
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  border: 1px solid #d1d7dd;
  border-radius: 10px;
  overflow: hidden;
  background: radial-gradient(circle at center, #f9f7e8 0%, #efe7ca 70%, #e6ddbe 100%);
}

/* Board image block: real board art should go in /assets/board.png */
#board-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlay layer block: used for clickable spaces and tokens */
.overlay-layer {
  position: absolute;
  inset: 0;
}

/* Space hotspot block: invisible but clickable area per board square */
.space-hit {
  position: absolute;
  width: 8%;
  height: 8%;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  cursor: pointer;
}

.space-hit.active {
  outline: 2px solid #0ea5e9;
  border-radius: 6px;
}

/* Token stack block: holds one or more tokens for one space */
.token-stack {
  position: absolute;
  transform: translate(-50%, -50%);
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  width: 54px;
  min-height: 18px;
  justify-content: center;
  pointer-events: none;
}

/* Token piece block: fallback circle when image is missing */
.token-piece {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  border: 1px solid #222;
  background: #ddd;
  overflow: hidden;
}

/* Token image block: optional classic token image from assets */
.token-piece img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Space info block */
#space-info {
  margin: 0;
  min-height: 20px;
}

/* Log block */
.log {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 260px;
  overflow: auto;
  display: grid;
  gap: 6px;
  font-size: 13px;
}

/* Mobile block */
@media (max-width: 700px) {
  body {
    padding: 10px;
  }

  .space-hit {
    width: 9%;
    height: 9%;
  }
}
