html {
}

header {
  height: 100px;
  font-family: "Rancho";
  font-size: 72px;
  background: #8b3fa0;
  color: #f3e4fb;
  padding: 4px;
  text-align: center;
  width: 100%;
}

body {
  margin: 0;
}

#calculator {
  font-family: "Seven Segment", sans-serif;
  font-size: 30px;
  margin: 1rem auto;
  width: 16rem;
  max-width: 90%;
  border: 1px solid #8b3fa0;
  border-radius: 10px;
  padding: 1rem;
  color: #3b0b4a;
  text-align: center;
}

.fraction-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.fraction-task,
.fraction-result {
  display: flex;
  align-items: center;
  justify-content: center;
}

.fraction {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.fraction-bar {
  width: 60px;
  height: 2px;
  background-color: #3b0b4a;
  margin: 4px 0;
}

.fraction-result .result-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  font-size: 30px;
  text-align: center;
  min-height: 1.8em;
  border: 1px solid #8b3fa0;
  border-radius: 4px;
  background-color: #ffffff;
}

.times {
  font-size: 20px;
  margin: 0 0.25rem;
}

.factor {
  font-size: 22px;
}

.fraction-buttons {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

#calculator button {
  font: inherit;
  background: #8b3fa0;
  color: white;
  border: 1px solid #8b3fa0;
  padding: 0.5rem 1rem;
  margin: 0.2rem;
  cursor: pointer;
  border-radius: 6px;
  width: 70px;
  height: 70px;
}

#calculator button:focus {
  outline: none;
}

#calculator button:hover,
#calculator button:active {
  background: #a95ac0;
  border-color: #a95ac0;
}

#feedback {
  min-height: 1.5rem;
  font-size: 18px;
}

#feedback.ok {
  color: #0c9031;
}

#feedback.error {
  color: #b00020;
}

/* Sehr kleine Screens, z.B. iPhone */
@media (max-width: 430px) {
  header {
    font-size: 36px;
    height: auto;
    padding: 6px 4px;
  }

  #calculator {
    width: 12rem;
    max-width: 100%;
    margin: 0.5rem auto;
    padding: 0.5rem;
  }

  .fraction-line {
    gap: 1rem;
  }

  .fraction-bar {
    width: 48px;
  }

  .fraction-result .result-cell {
    width: 40px;
    font-size: 24px;
    min-height: 1.6em;
  }

  #calculator button {
    width: 48px;
    height: 48px;
    padding: 0.3rem;
  }
}

