html {
}

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

body {
  margin: 0;
  padding-bottom: env(safe-area-inset-bottom);
}

#calculator {
  font-family: "Seven Segment", sans-serif;
  font-size: 30px;
  margin: 1rem auto;
  width: 16rem;
  max-width: 90%;
  border: 1px solid #c96c2b;
  border-radius: 10px;
  padding: 1rem;
  color: #3b1a08;
  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: #3b1a08;
  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 #c96c2b;
  border-radius: 4px;
  background-color: #ffffff;
}

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

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

/* Der "geht nicht"-Button braucht mehr Platz als eine einzelne Ziffer */
#btnGehtNicht {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 140px;
  height: auto;
  padding: 0.3rem 1.2rem;
  font-size: 20px;
  line-height: 1.1;
  white-space: nowrap;
}

#calculator button:focus {
  outline: none;
}

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

#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;
  }

  #btnGehtNicht {
    min-width: 110px;
    height: 22px !important;
    font-size: 16px !important;
    padding: 0.1rem 0.8rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.1rem;
  }
  
  /* Extra Abstand am Ende für Safari-Leiste */
  body {
    padding-bottom: calc(env(safe-area-inset-bottom) + 60px);
  }
  
  #calculator:last-of-type {
    margin-bottom: 0.5rem;
  }

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

