html,
body {
  margin: 0;
  padding: 0;
  background: #f7fbff;
  color: #1f2f3f;
  font-family: Arial, Helvetica, sans-serif;
}

.africa-coloring-game {
  box-sizing: border-box;
  width: 100%;
  min-height: 600px;
  padding: 12px;
  background: linear-gradient(#f8fcff, #eef7fb);
}

.africa-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 auto 10px;
  max-width: 960px;
}

.palette {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.swatch {
  width: 30px;
  height: 30px;
  border: 2px solid #fff;
  border-radius: 4px;
  box-shadow: 0 0 0 1px #6e8195;
  cursor: pointer;
}

.swatch.is-active {
  box-shadow: 0 0 0 3px #263f58;
}

.tool-button {
  height: 32px;
  padding: 0 11px;
  border: 1px solid #7c91a7;
  border-radius: 5px;
  background: #fff;
  color: #17364f;
  font-weight: bold;
  cursor: pointer;
}

.tool-button:hover,
.country-button:hover {
  background: #e9f5ff;
}

.africa-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 245px;
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
}

.map-panel,
.country-panel {
  border: 1px solid #b8c9d8;
  border-radius: 6px;
  background: #fff;
  box-shadow: 0 2px 5px rgba(31, 47, 63, 0.14);
}

.map-panel {
  overflow: hidden;
}

.map-status {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid #d6e2ec;
  background: #f4f9fd;
  font-size: 14px;
  font-weight: bold;
}

.map-wrap {
  position: relative;
  background: #dff3ff;
}

#africaMap {
  display: block;
  width: 100%;
  height: auto;
  max-height: 560px;
}

.country-shape {
  stroke: #4d657c;
  stroke-width: 0.8;
  vector-effect: non-scaling-stroke;
  cursor: pointer;
  transition: filter 0.12s ease, stroke-width 0.12s ease;
}

.country-shape:hover,
.country-shape:focus {
  filter: brightness(1.06);
  outline: none;
  stroke: #172a3c;
  stroke-width: 1.6;
}

.island-shape {
  stroke-width: 1.2;
}

.country-label {
  display: none;
  fill: #24384c;
  font-size: 10px;
  font-weight: bold;
  text-anchor: middle;
  pointer-events: none;
  paint-order: stroke;
  stroke: #fff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.show-labels .country-label {
  display: block;
}

.country-panel {
  max-height: 590px;
  overflow: hidden;
}

.country-panel-header {
  padding: 8px 10px;
  border-bottom: 1px solid #d6e2ec;
  background: #f4f9fd;
  font-weight: bold;
}

.country-list {
  display: grid;
  gap: 2px;
  max-height: 540px;
  overflow: auto;
  padding: 6px;
}

.country-button {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #12334d;
  text-align: left;
  cursor: pointer;
}

.country-chip {
  width: 14px;
  height: 14px;
  border: 1px solid #798da1;
  border-radius: 3px;
  background: #fffaf0;
}

.country-button.is-colored {
  font-weight: bold;
}

.country-button.is-active {
  background: #dff0ff;
}

@media (max-width: 760px) {
  .africa-stage {
    grid-template-columns: 1fr;
  }

  .country-panel {
    max-height: none;
  }

  .country-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 190px;
  }
}
