body {
  background-color: #f4f7f6;
  color: #333333;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
}
.simulator-box {
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  max-width: 650px;
  width: 100%;
  box-sizing: border-box;
}
.controls-wrapper {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
  background: #f8fafc;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}
.controls-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}
.control-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
label {
  font-weight: 600;
  font-size: 14px;
}
select, .wpm-number-input, .custom-text-box {
  padding: 8px 12px;
  font-size: 15px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  outline: none;
  background: white;
  box-sizing: border-box;
}
select, .wpm-number-input {
  font-weight: bold;
  color: #007bff;
}
select:focus, .wpm-number-input:focus, .custom-text-box:focus {
  border-color: #007bff;
}
.wpm-number-input {
  width: 75px;
  text-align: center;
}
/* Live WPM stat (Racer mode) */
.stat-label {
  font-weight: 600;
  font-size: 14px;
  color: #475569;
}
.wpm-live-value {
  font-weight: bold;
  font-size: 15px;
  color: #007bff;
  font-variant-numeric: tabular-nums;
  min-width: 2.5ch;
  display: inline-block;
  text-align: center;
  padding: 8px 10px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: white;
  box-sizing: border-box;
}
/* Collapsible container styling */
.collapsible-container {
  width: 100%;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  margin-top: 5px;
}
.collapsible-container summary {
  font-weight: 600;
  font-size: 14px;
  color: #475569;
  cursor: pointer;
  user-select: none;
  outline: none;
  display: flex;
  align-items: center;
  gap: 6px;
}
.collapsible-container summary:hover {
  color: #007bff;
}
.custom-text-box {
  width: 100%;
  height: 70px;
  resize: vertical;
  font-family: inherit;
  font-size: 14px;
  color: #475569;
  margin-top: 10px;
}
.text-display {
  font-size: 22px;
  line-height: 1.6;
  letter-spacing: 0.5px;
  word-break: break-word;
  min-height: 120px;
  position: relative;
  margin-bottom: 20px;
}
.char {
  color: #9ca3af; 
  transition: color 0.08s ease, background-color 0.08s ease;
  position: relative;
}
.char.completed, .char.user-correct {
  color: #1f2937; 
  font-weight: 500;
}
.char.user-incorrect {
  color: #ef4444;
  background-color: #fee2e2;
}
.char.pace-marker {
  border-bottom: 2px solid #007bff;
}
.input-field {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s, opacity 0.2s;
}
.input-field:focus {
  border-color: #007bff;
}
.input-field:disabled {
  background-color: #f1f5f9;
  cursor: not-allowed;
  opacity: 0.6;
}
