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

:root {
  --bg: #2d3142;
  --text: #fdf6ee;
  --accent: #ef8354;
  --secondary: #4f5d75;
  --input-bg: #4f5d75;
  --input-text: #fdf6ee; 
  --container-bg: #fdf6ee; 
  --container-text: #2d3142;
}

.light-mode {
  --bg: #fdf6ee;
  --text: #2d3142;
  --container-bg: #ffffff;
  --container-text: #2d3142;
  --input-bg: #e6e6e6;
  --input-text: #2d3142;
}

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

#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 {
    flex-direction: column;
    padding: 2rem;
    font-size: 1rem;
  }

  .container {
    padding: 2rem;
    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;
  }
}

/* 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;
}

