.factfluency-container {
  width: 100%;
  max-width: 900px;
  min-height: 560px;
  margin: auto;
  border: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  user-select: none;
  background: white;
}

.factfluency-control {
  display: none;
}

.factfluency-question-pane {
  min-height: 170px;
  background-color: white;
  transition: background 0.1s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 36px 20px 18px;
}

.factfluency-question-container {
  color: #111;
  background: #fff;
  width: 100%;
  min-height: 100px;
  position: relative;
}

.factfluency-info-header {
  /* border: 1px solid #000; */
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 1.25em;
}

.fact-pack-mode-screen {
  background: white;
  gap: 14px;
  margin: 0 auto;
  max-width: 560px;
  padding: 12px 20px;
  text-align: center;
}

.fact-pack-mode-title {
  color: #111;
  font-size: 1.4em;
  font-weight: 400;
}

.fact-pack-mode-copy {
  color: #555;
  line-height: 1.35;
  margin: 0;
}

.fact-pack-mode-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  width: 100%;
}

.fact-pack-mode-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 400;
  gap: 8px;
  justify-content: center;
  min-height: 44px;
  min-width: 132px;
  padding: 10px 16px;
}

.fact-pack-mode-button-primary {
  background: dodgerblue;
  color: white;
}

.fact-pack-mode-button-secondary {
  background: #eef2f7;
  color: #111;
}

.factfluency-report-header {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 4em;
  padding: 0 40px;
  text-align: center;
}

.factfluency-report-header button {
  appearance: none;
  font-size: 0.5em;
  background: #eee;
  border: 1px solid #00000040;
  color: #000;
  border-radius: 5px;
  cursor: pointer;
  padding: 1px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  width: 42px;
}

.factfluency-report-header button:hover {
  opacity: 0.7;
}

.factfluency-equation {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  font-size: 4em;
  white-space: nowrap;
}

.factfluency-equation > span {
  align-items: center;
  display: flex;
  justify-content: center;
}

.factfluency-equation-input {
  width: 120px;
  font: inherit;
  text-align: center;
  border: 3px solid currentColor;
  border-radius: 10px;
  background-color: #fff;
  padding: 0;
}

.factfluency-result-attempts {
  display: inline-block;
  font-size: 0.8em;
  width: 4ch;
  margin-right: 0.5ch;
  background: #ee5253;
  text-align: center;
  border-radius: 25px;
  color: #fff;
}

.factfluency-question-number {
  display: none;
}

.factfluency-visual-pane {
  flex: 3;
  /* border-top: 1px solid #808080; */
  /* border-bottom: 1px solid #808080; */
  background-color: #eee;
  position: relative;
  /* gap: 25px; */
  display: flex;
  /* flex-wrap: wrap; */
  align-items: center;
  justify-content: space-evenly;
  overflow: hidden;
}

.factfluency-visual-pane.factfluency-results-pane {
  flex: 0 1 320px;
  min-height: 240px;
}

.factfluency-container.fact-pack-results-active {
  max-width: 760px;
  min-height: 720px;
}

.factfluency-container.fact-pack-results-active .factfluency-question-pane {
  min-height: 105px;
  padding: 12px 20px 6px;
}

.factfluency-container.fact-pack-results-active .factfluency-report-header {
  font-size: 3.4em;
  padding: 0 20px;
}

.factfluency-container.fact-pack-results-active .factfluency-visual-pane.factfluency-results-pane {
  flex: 1 1 auto;
  align-items: flex-start;
  justify-content: center;
  min-height: 520px;
}

.fact-pack-results-actions {
  align-items: center;
  background: white;
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 16px 20px 28px;
}

.factfluency-representation {
  display: flex;
  align-items: center;
  gap: 30px;
  position: relative;
}

.factfluency-representation-viewable {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.factfluency-representation-viewable .material-icons {
  font-size: 13em;
  color: #888;
}

.factfluency-representation table {
  border-collapse: collapse;
}

.factfluency-representation td {
  width: 60px;
  height: 60px;
  min-width: 60px;
  min-height: 60px;
  background: #ccc;
  border: 1px solid #808080;
}

.factfluency-representation-circle {
  min-width: 90px;
  min-height: 90px;
  background: #ccc;
  border-radius: 50%;
}

.factfluency-start-container {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.factfluency-start-label {
  font-size: 5em;
  text-align: center;
  color: var(--theme-color);
  display: none;
}

.factfluency-start-button {
  appearance: none;
  /* width: 7em; */
  /* height: 2em; */
  background: var(--theme-color);
  border: 1px solid #00000040;
  border-radius: 5px;
  color: #fff;
  font-size: 1.5em;
  font-family: inherit;
  cursor: pointer;
}

.factfluency-start-button:hover {
  opacity: 0.7;
}

.factfluency-question-container-frame-vertical {
  flex-direction: column;
}

.factfluency-question-container-frame-horizontal,
.factfluency-question-container-frame-vertical {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.factfluency-question-frame-horizontal {
  display: flex;
  flex-wrap: wrap;
  width: 300px;
}

.factfluency-question-frame-vertical {
  display: flex;
  flex-direction: column-reverse;
  flex-wrap: wrap;
  height: 300px;
  width: 120px;
}

.factfluency-question-frame-cell {
  display: grid;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #eee;
  box-shadow:
    0px 0px 0px 1px gray inset,
    0px 0px 0px 1px gray;
}

.factfluency-question-frame-cell-picture {
  width: 55px;
  height: 55px;
  position: relative;
  font-size: 2em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.factfluency-question-frame-cell-ten,
.factfluency-question-frame-cell-one {
  width: 45px;
  height: 45px;
  border: 2px solid #000;
  border-radius: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #000;
}

.factfluency-question-frame-cell-ten {
  background-color: #f1a9a0;
}

.factfluency-question-frame-cell-one {
  background-color: #81cfe0;
}

.factfluency-question-container-disks {
  color: #fff;
  display: flex;
  gap: 10px;
  padding: 40px 30px;
  height: 100%;
  width: 100%;
}

.factfluency-question-rod {
  background: #fff;
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  align-content: center;
  justify-content: flex-end;
  flex: 1;
  gap: 2px;
}

.factfluency-question-rod-disk {
  width: 3ch;
  font-size: 2em;
  border-radius: 5px;
  background: var(--theme-color);
  text-align: center;
}

.factfluency-question-equal-group-row {
  display: flex;
  gap: 10px;
  /* justify-content: center; */
}

.factfluency-question-equal-group {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--theme-color);
  font-size: 3em;
  color: #fff;
}

.factfluency-keypad-horizontal {
  align-self: center;
  background: white;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 350px;
  padding: 0 0 36px;
  transition: background 0.1s;
  width: min(100%, 350px);
}

.factfluency-number-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(55px, 1fr));
}

.factfluency-action-row {
  display: flex;
  gap: 10px;
}

.factfluency-keypad-horizontal button {
  appearance: none;
  border: none;
  background: gainsboro;
  border-radius: 10px;
  color: #111;
  font-size: 2em;
  cursor: pointer;
  min-height: 60px;
  padding: 1px 4px;
}

.factfluency-number-grid button {
  aspect-ratio: 1;
}

.factfluency-action-row button {
  flex: 1;
}

.factfluency-keypad-horizontal button[value="submit"] {
  background: dodgerblue;
  color: white;
}

.factfluency-keypad-horizontal button:hover {
  filter: brightness(0.96);
}

.factfluency-message {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 6em;
  font-weight: bold;
  font-style: italic;
  white-space: nowrap;
  text-shadow:
    #fff 3px 0px,
    #fff -3px 0px,
    #fff 0px 3px,
    #fff 0px -3px;
  box-shadow:
    #fff 0px 0px 5px,
    #fff 0px 0px 10px,
    #fff 0px 0px 15px,
    #fff 0px 0px 20px,
    #fff 0px 0px 25px,
    #fff 0px 0px 30px;
  background: #fff;
  padding: 0 1ch;
}

@keyframes shake {
  0% {
    transform: translateX(5px);
  }
  25% {
    transform: translateX(-5px);
  }
  50% {
    transform: translateX(5px);
  }
  75% {
    transform: translateX(-5px);
  }
  100% {
    transform: translateX(0);
  }
}

@keyframes incorrect {
  100% {
    border-color: #ee5253;
    background-color: #e98282;
  }
}

.factfluency-incorrect {
  animation:
    shake 0.25s,
    incorrect 0.25s forwards;
}

@keyframes correct {
  100% {
    border-color: #00a651;
    background-color: #8ee888;
  }
}

.factfluency-correct {
  animation: correct 0.25s forwards;
}

.factfluency-result-rows-container {
  height: 100%;
  width: 100%;
  overflow-y: scroll;
}

.factfluency-result-rows {
  display: flex;
  flex-direction: column;
  gap: 0.5em 2em;
  padding: 14px;
  font-size: 2.1em;
}

.fact-pack-result-rows-container {
  align-items: stretch;
  box-sizing: border-box;
  display: flex;
  justify-content: flex-start;
  overflow-y: visible;
  padding: 24px 32px;
}

.fact-pack-result-rows {
  box-sizing: border-box;
  font-size: clamp(2rem, 3vw, 2.85rem);
  gap: 0.08em;
  justify-content: flex-start;
  line-height: 1.05;
  margin: 0;
  min-height: 100%;
  max-width: 650px;
  padding: 0;
  width: 100%;
}

.fact-pack-result-rows-full {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.fact-pack-result-rows .factfluency-result-cell {
  align-items: baseline;
  display: flex;
  justify-content: flex-start;
  white-space: nowrap;
}

.factfluency-result-mark {
  display: inline-block;
  width: 1em;
}

.factfluency-result-question-operand {
  display: inline-block;
  text-align: center;
  width: 3ch;
  margin-inline: 0.3ch;
}

.factfluency-result-question-operator {
  display: inline-block;
  text-align: center;
  width: 1.6ch;
  margin-inline: 0.2ch;
}

.factfluency-result-question-number {
  display: inline-block;
  font-size: 0.8em;
  width: 3ch;
  margin-right: 1ch;
  text-align: right;
  color: #777;
}

.factfluency-result-question-text {
  display: inline-block;
  width: 11.5ch;
  margin-right: 0.5ch;
}

.factfluency-result-incorrect {
  color: #ee5253;
  display: inline-block;
  margin-right: 0.5ch;
  text-decoration: line-through;
  text-align: center;
  width: 2.5ch;
}

.factfluency-result-not-reached {
  color: #ee5253;
  text-decoration: none;
}

.factfluency-cell-correct {
  color: #00a651;
  display: inline-block;
  text-align: left;
  width: 2.5ch;
}

.factfluency-cell-incorrect {
  color: #ee5253;
}

.factfluency-report-grid {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  font-size: 0.8em;
  gap: 8px;
}

.factfluency-report-cell {
  text-align: center;
  position: relative;
}

.factfluency-report-cell-info {
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translate(-50%, 0);
  background-color: #fff;
  border: 1px solid #ccc;
  padding: 5px;
  white-space: nowrap;
  pointer-events: none;
}

.factfluency-report-cell:not(:hover) .factfluency-report-cell-info {
  display: none;
}

.factfluency-report-unseen {
  color: #000;
}

.factfluency-report-good {
  color: #00a651;
}

.factfluency-report-needs-work {
  color: #f0932b;
}

.factfluency-report-bad {
  color: #ee5253;
}

.factfluency-report-table th,
.factfluency-report-table td {
  border: 1px solid #ccc;
  padding: 5px 12px;
  font-size: 1.3em;
  text-align: center;
}
