:root {
  --bar: #4a7ab5;
  --bar-mode: #2c5a95;
  --ink: #222;
  --muted: #777;
}

body {
  font-family: 'Helvetica Neue', Helvectica, Arial, sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.01em;
  line-height: 1.4;
  background-color: var(--bg);
  color: var(--text);
}

input, button, textarea, select {
  font: inherit;
}

.confidence button {
  width: 4em;
  margin-top: 1em;
  margin-left: 6px;
  margin-right: 6px;
  border-radius: 6px;

  background: var(--bg-mild);
  color: var(--text-dim);
  border-color:rgba(0, 0, 0, 0.15);
  font-size: 0.9rem;
}

.confidence button.selected {
  background: var(--text);
  color: var(--bg)
}

.confidence button:not(.selected):disabled {
  color: transparent;
  background: transparent;
  border-color: transparent;
}

.confidence button.selected {
  background: var(--text);
  color: var(--bg)
}

.invisible {
  display: none;
}

div.question, details.history-record {
  text-align: center;

  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 16px;

  background-color: var(--bg-mild);

  width: 98%;
}

div.question.correct {
  background-color: var(--bg-correct);
}

div.question.incorrect {
  background-color: var(--bg-incorrect);
}

div.compare-question p {
  margin-top: 0px;
  margin-bottom: 0px;
}

div.clickable {
  cursor: pointer;
}

div.compare-question span.answer-value {
  font-weight: bold;
}

div.compare-question hr {
  border: none;
  border-top: 1px dashed #ccc;
  width: 80%;
}

span.highlight {
  text-decoration: underline;
}

.histogram {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 220px;
}
.bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
}
.bar-value {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 2px;
  font-variant-numeric: tabular-nums;
}
.bar-fill {
  width: 100%;
  background: var(--bar);
  border-radius: 3px 3px 0 0;
  transition: height 0.4s ease;
  min-height: 1px;
}
.bar.mode .bar-fill { background: var(--bar-mode); }
.bar-label {
  font-size: 0.8rem;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

button#top-menu {
  all: unset; /* strip default button styling. */
  cursor: pointer;
  font: inherit;
}

/* Use :where(...) to lower the specificity of the menu rule, to let .invisible win. */
:where(div#menu) {
  display: flex;
}
:where(div#game) {
  display: flex;
}
:where(div#history) {
  display: flex;
}

div#title, details.history-record > div {
  display: flex;
}

div#title, div#menu, div#game, div#history, details.history-record > div {
  flex-direction:column;
  align-items: center;
}

div#menu, div#history, details.history-record > div {
  gap: 8px;
}

div#game {
  gap: 1em;
}

button.emoji {
  display: grid;
  grid-template-columns: 1.5em 1fr;
  align-items: center;
  min-width: 15em;
}
