* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: 200px;
  flex-shrink: 0;
  border-right: 1px solid #ddd;
  padding: 16px;
  overflow-y: auto;
  max-height: 100vh;
}

#sidebar h1 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
  margin: 0 0 12px 0;
}

#sets-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

#sets-list li {
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 4px;
  font-size: 14px;
}

#sets-list li:hover { background: #f0f0f0; }
#sets-list li.active { background: #e0e8f0; font-weight: 600; }

#main {
  flex: 1;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

#toolbar {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.switcher {
  display: inline-flex;
  border: 1px solid #ccc;
  border-radius: 6px;
  overflow: hidden;
}

.switcher button {
  border: 0;
  padding: 6px 12px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  border-right: 1px solid #ccc;
}

.switcher button:last-child { border-right: 0; }
.switcher button.active { background: #333; color: white; }

#board {
  width: 480px;
  height: 480px;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border: 1px solid #333;
}

.square {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  color: #999;
}

.square.light { background: var(--light, #f0d9b5); }
.square.dark  { background: var(--dark,  #b58863); }

.square img { width: 100%; height: 100%; display: block; }

.square .missing-piece {
  font-size: 14px;
  font-weight: 600;
  color: #c00;
}
