* {
  font-family: 'Nunito Sans';
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 20px;
  background-color: #f9f9f9;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #4c7ef3;
  padding: 10px 20px;
  border-radius: 10px;
  margin-bottom: 20px;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.navbar-logo {
  font-size: 20px;
  font-weight: 700;
}

.navbar-links {
  list-style: none;
  display: flex;
  gap: 20px;
  padding: 0;
  margin: 0;
}

.navbar-links li a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s;
}

.navbar-links li a:hover {
  opacity: 0.8;
}

.game-container {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
  background-color: #fff;
  padding: 20px;
  border-radius: 20px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

header h1 {
  font-size: 40px;
  color: #333;
  margin-bottom: 10px;
}

.rounds {
  margin-bottom: 30px;
}

.round-label {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}

.guess-label {
  font-size: 18px;
  font-weight: 700;
  margin: 5px 0;
}

.guessing-area {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin-bottom: 40px;
  gap: 20px;
}

.guess {
  background-color: #ececec;
  border-radius: 16px;
  padding: 20px;
  width: 300px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.guess input {
  width: 90px;
  height: 90px;
  font-size: 30px;
  text-align: center;
  margin-bottom: 10px;
}

.number-controls {
  margin-bottom: 20px;
}

.number-control {
  border: solid 1px #4c7ef3;
  width: 45px;
  height: 35px;
  font-size: 24px;
  font-weight: 700;
  color: #4c7ef3;
  cursor: pointer;
  background: none;
}

.number-controls button[disabled] {
  color: #dfdfdf;
  cursor: default;
}

.left {
  border-top-left-radius: 22.5px;
  border-bottom-left-radius: 22.5px;
}

.right {
  border-top-right-radius: 22.5px;
  border-bottom-right-radius: 22.5px;
  border-left-width: 0;
}

.button {
  background-color: #4c7ef3;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.button[disabled] {
  background-color: #d2d2d2;
  color: #a0a0a0;
  cursor: default;
}

#guess {
  margin-top: 10px;
}

#next-round {
  margin: 0 auto 60px auto;
  display: block;
}

.winning-text {
  font-size: 18px;
  color: #ec3636;
  font-weight: 700;
  margin-top: 12px;
}

.instructions {
  background: linear-gradient(to right, #f0f0f0, #ffffff);
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  padding: 20px;
  border-radius: 16px;
}

.instruction {
  width: 200px;
  margin: 10px;
  text-align: center;
}

.instructions h3 {
  font-size: 16px;
  margin-bottom: 5px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.6s ease-in-out;
}

@media (max-width: 600px) {
  .guessing-area {
    flex-direction: column;
    align-items: center;
  }

  .instruction {
    width: 100%;
    max-width: 300px;
  }
}

.navbar-toggle {
  background: none;
  border: none;
  font-size: 28px;
  color: white;
  display: none;
  cursor: pointer;
}

.scramble-area {
  text-align: center;
  margin-top: 30px;
}

.scramble-area h2 {
  font-size: 36px;
  letter-spacing: 5px;
  margin-bottom: 20px;
}

#user-guess {
  font-size: 18px;
  padding: 10px;
  width: 60%;
  max-width: 300px;
  margin-bottom: 10px;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-top: 20px;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.rps-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 30px 0;
  flex-wrap: wrap;
}

.rps-buttons .button {
  padding: 15px 25px;
  font-size: 18px;
  border-radius: 12px;
}

.results {
  text-align: center;
  font-size: 20px;
  color: #444;
}

.results h2 {
  margin-top: 20px;
  font-size: 28px;
}

.memory-stats {
  display: flex;
  justify-content: center;
  gap: 30px;
  font-weight: bold;
  margin-bottom: 20px;
}

.memory-controls {
  text-align: center;
  margin-bottom: 20px;
}

.memory-controls select,
.memory-controls button {
  padding: 10px 15px;
  font-size: 14px;
  margin: 0 5px;
  border-radius: 8px;
  border: 1px solid #ccc;
}


.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  gap: 15px;
  justify-content: center;
  margin: 0 auto;
}

.card {
  width: 80px;
  height: 80px;
  background-color: #4c7ef3;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 32px;
  color: white;
  cursor: pointer;
  transition: transform 0.3s;
  user-select: none;
}

.card.matched {
  background-color: #8bc34a;
  cursor: default;
}

.card.revealed {
  background-color: #fff;
  color: #4c7ef3;
  border: 2px solid #4c7ef3;
  font-weight: bold;
}

.number-box {
  font-size: 60px;
  margin: 30px 0;
  color: #4c7ef3;
  font-weight: bold;
}

.scoreboard {
  display: flex;
  justify-content: center;
  gap: 40px;
  font-size: 18px;
  font-weight: bold;
}

.feedback {
  font-size: 20px;
  margin: 20px 0;
  font-weight: bold;
}

.correct {
  color: green;
  animation: pop 0.4s ease;
}

.wrong {
  color: red;
  animation: shake 0.4s ease;
}

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

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

.math-info {
  font-size: 18px;
  margin-bottom: 20px;
}

.math-question {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 15px;
}

#qm-answer {
  font-size: 24px;
  width: 100px;
  text-align: center;
  margin-right: 10px;
}

#qm-feedback {
  font-weight: bold;
  margin-top: 15px;
  height: 24px;
}

.reaction-game {
  text-align: center;
  max-width: 500px;
  margin: auto;
}

.reaction-box {
  width: 100%;
  height: 200px;
  background-color: #ddd;
  margin-top: 20px;
  border-radius: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}


@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    align-items: center;
    justify-content: center
  }

  .navbar-toggle {
    display: block;
    align-self: flex-end;
    margin-top: 5px;
  }

  .navbar-links {
    display: none;
    flex-direction: column;
    width: 100%;
    padding: 10px 0;
    gap: 10px;
    background-color: #4c7ef3;
    border-radius: 10px;
  }

  .navbar-links.show {
    display: flex;
  }

  .navbar-links li {
    width: 100%;
    text-align: left;
    padding-left: 20px;
  }

  .navbar-links li a {
    display: block;
    padding: 10px 0;
  }
}
