*,
*::after,
*::before {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #fdf6ee;
  --text: #2d3142;
  --accent: #ef8354;
  --container-bg: #ffffff;
  --container-text: #2d3142;
  --input-bg: #e6e6e6;
  --input-text: #2d3142;
}

.darkmode {
  --bg: #2d3142;
  --text: #fdf6ee;
  --secondary: #4f5d75;
  --input-bg: #4f5d75;
  --input-text: #fdf6ee;
  --container-bg: #fdf6ee;
  --container-text: #2d3142;
}

#dark-mode {
  display: inline-block;
}
#light-mode {
  display: none;
}
body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  font-size: 1.5rem;
  transition: all 0.3s ease-in-out;
}

.container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 4rem 3rem;
  background-color: var(--container-bg);
  color: var(--container-text);
  border-radius: 1.5em;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  min-width: 40%;
  max-width: 40%;
}

h1 {
  text-align: center;
  margin-bottom: 1.5rem;
}

input {
  margin-top: 1.5rem;
  padding: 1rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 2rem;
  background-color: var(--input-bg);
  color: var(--input-text);
  text-align: center;
  outline: none;
  transition: box-shadow 0.3s ease;
}

input:focus {
  box-shadow: 0 0 0 3px rgba(239, 131, 84, 0.4);
}

.btn {
  font-size: 1.1rem;
  font-weight: bold;
  background-color: var(--accent);
  border: none;
  padding: 0.8rem 2rem;
  border-radius: 2rem;
  color: white;
  cursor: pointer;
  margin-top: 2rem;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
  background-color: #da6a3b;
  transform: scale(1.03);
}

.btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.btn.reset {
  display: none;
  background-color: var(--secondary);
}

.btn.reset:hover {
  background-color: #3c475e;
}

.btn.toggle {
  position: fixed;
  top: 0;
  left: 0;
}

/* light and dark mode */
[class*="fa-"] {
  position: fixed;
  top: 0;
  right: 0;
  color: var(--accent);
  font-size: 2em;
  margin: 1rem;
  transition: 0.3s ease;
}
[class*="fa-"]:hover {
  transform: scale(1.2);
  color: var(--icons-dark);
}

#inputLabel {
  margin-top: 1.5rem;
  font-weight: bold;
  text-align: center;
}

input:focus {
  box-shadow: 0 0 0 4px rgba(239, 131, 84, 0.8);
}

.attempts {
  margin: 2rem 0 1rem;
  font-weight: bold;
  text-align: center;
}

.container.answer {
  margin-top: 2rem;
  margin-left: 2rem;
  text-align: center;
}

/*chromium based*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/*firefox based*/
input[type="number"] {
  -moz-appearance: textfield;
}

@media (max-width: 600px) {
  body {
    align-items: center;
    min-height: 80vh;
    flex-direction: column;
    padding: 2rem;
    font-size: 1rem;
  }

  .container {
    padding: 1rem;
    border-radius: 1em;
    width: 90%;
  }

  .container.answer {
    margin-left: 0;
  }

  input {
    padding: 0.75rem;
    font-size: 1rem;
  }

  .btn {
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
    margin-top: 0.5rem;
  }
}

/* well... :) */
@keyframes shake {
  0% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-8px);
  }
  40% {
    transform: translateX(8px);
  }
  60% {
    transform: translateX(-6px);
  }
  80% {
    transform: translateX(6px);
  }
  100% {
    transform: translateX(0);
  }
}

.shake {
  animation: shake 0.4s ease-in-out;
}
