h1 {
  /* reduce bottom padding */
  margin-top: 20px;
  margin-bottom: 0px;
}

body {
  font-family: Arial, sans-serif;
  font-family: Roboto, Helvetica, sans-serif;
  max-width: 600px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
  background-color: #333;
  color: #f4f4f4;
}

.form-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.form-group {
  flex: 1;
  margin-right: 10px;
}

.form-group:last-child {
  margin-right: 0;
}

label {
  display: block;
  margin-bottom: 5px;
  width: 100%;
  accent-color: black;
}

details label {
  color: black;
}

input[type='number'],
input[type='text'],
select {
  width: 100%;
  padding: 5px;
  box-sizing: border-box;
  background-color: #a1a1a1;
}

select {
  border-radius: 1em;
}

button {
  margin-top: 10px;
  padding: 10px;
  border: none;
  border-radius: 1em;
  border-radius: 1em 1em 0em 1em;
  cursor: pointer;
  width: 100%;
  font-size: medium;
  background-color: #1b1b1b;
  color: #ededed;
}

#result {
  margin-top: 20px;
}

.abilities {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
}

.ability-column {
  flex: 1;
}

.ability-option {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.ability-option input[type='checkbox'] {
  margin-right: 5px;
}

.ability-option input[type='number'] {
  margin-right: 1em;
}

.calculation,
.final-result,
.effects {
  margin-top: 10px;
  padding: 10px;
  border-radius: 5px;
  background-color: #4a4a4a;
}

.final-result {
  margin-top: 20px;
}

.disabled {
  opacity: 0.5;
  pointer-events: none;
  /* strike through */
  text-decoration: line-through;
}

.effects ul {
  margin: 0;
  padding-left: 20px;
}

.effects li {
  margin-bottom: 5px;
}

.character {
  margin-top: 10px;
  margin-left: 0em;
  border-radius: 1em;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 95vh;
}

main {
  flex: 1 0 auto;
}

footer {
  flex-shrink: 0;
  padding: 10px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 50px;
}

details {
  margin: 0;
  padding: 0.5em;
  margin-left: 2em;
  border-radius: 0em 0em 1em 1em;
  background-color: #a1a1a1;
}

a {
  color: #ededed;
}

summary {
  cursor: pointer;
  padding: 0.1em;
  color: black;
}

.history-container {
  margin: 20px 0;
  padding: 10px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  background-color: #4a4a4a;
}

.history-controls {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Set specific flex ratios for the children */
.history-controls input[type="range"] {
  flex: 3;  /* Takes up 3/5 of the available space */
}

.history-controls .history-count {
  flex: 1;  /* Takes up 1/5 of the available space */
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-controls .damage-total {
  flex: 1;  /* Takes up 1/5 of the available space */
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-controls .history-clear {
  margin-top: 0;
  flex: 1;  /* Takes up 1/5 of the available space */
  display: flex;
  align-items: center;
  justify-content: center;
}

.history-clear {
  padding: 5px 15px;
  border: none;
  border-radius: 1em;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9em;
  white-space: nowrap;
  background-color: #1b1b1b;
  color: #ededed;
}

input[type="range"] {
  flex: 1;
  height: 5px;
  border-radius: 1em;
  background-color: #fff;
  outline: none;
  -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #1b1b1b;
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  cursor: pointer;
  border: none;
  background-color: #1b1b1b;
}

.history-count {
  font-size: 0.9em;
  min-width: 60px;
  text-align: center;
  color: #fff;
}
