body {
  font-family: sans-serif;
  margin: 20px;
  padding: 0;
  background: #f9f9f9;
  color: #333;
}

h1 {
  text-align: center;
}

#controls {
  position: fixed;
  top: 10px;
  left: 10px;
  margin: 0;
  text-align: left;
  background: #fff;
  padding: 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 1100; /* ensure it stays above other elements */
}

#controls select,
#controls button {
  margin: 0 10px;
  padding: 5px 10px;
  font-size: 16px;
}

#character-canvas {
  display: flex;
  justify-content: center;
  margin: 20px 0;
}

#quiz-controls {
  text-align: center;
}

#quiz-controls button {
  margin: 5px;
  padding: 8px 12px;
  font-size: 16px;
}

#progress-text {
  margin-top: 10px;
  font-style: italic;
}

/* Modal Styling */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
  background-color: #fff;
  margin: 10% auto;
  padding: 20px 30px;
  border-radius: 8px;
  width: 300px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  text-align: left;
}

.close {
  color: #aaa;
  float: right;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #000;
}

#summary {
  display: none; /* keep hidden by default */
  
  /* Center horizontally and vertically */
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  
  background: #fff;
  padding: 30px 40px;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  max-width: 400px;
  width: 90%;
  z-index: 1200; /* make sure it’s above other elements */
  
  text-align: center;
}

.hanzi-char {
  font-family: "Kaiti", "KaiTi", serif;
  font-size: 50pt;
  font-weight: normal;
  margin-right: 8px;
}

.score {
  font-size: 24pt;
  font-weight: bold;
  margin-left: 5px;
  margin-right: 5px;
}