body {
  font-family: 'Arial', sans-serif;
  background-image: url('https://alittlemoreenglish.weebly.com/uploads/2/6/6/3/26638990/untitled-design-7_orig.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  color: #333;
}

.container {
  background-color: rgba(244, 248, 211, 0.6);
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
  width: 80%;
  max-width: 700px;
  text-align: center;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(115, 199, 199, 0.4);
  margin-bottom: 20px;
}

h1 {
  color: #495057;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

#quiz-area {
  margin-top: 30px;
}

#timer {
  font-size: 1.4em;
  margin-bottom: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  color: #212529;
}

#sentence {
  font-size: 2.2em;
  margin-bottom: 20px;
  font-weight: bold;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  letter-spacing: 1px;
  color: #343a40;
}

input[type="text"] {
  padding: 12px;
  border: none;
  border-radius: 8px;
  width: 70%;
  margin-bottom: 20px;
  background-color: rgba(255, 255, 255, 0.7);
  color: #333;
  font-size: 1em;
  transition: all 0.3s ease;
  border: 1px solid rgba(115, 199, 199, 0.2);
}

input[type="text"]:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(115, 199, 199, 0.5);
}

button {
  padding: 12px 24px;
  background-color: #73c7c7;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1em;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

button:hover {
  background-color: #a6f1e0;
  color: #333;
}

#result {
  font-size: 1.2em;
  font-weight: bold;
  margin-top: 20px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  color: #212529;
}

#score {
  margin-top: 20px;
  font-size: 1.4em;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
  color: #495057;
}

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

.container {
  animation: fadeIn 0.5s ease-out;
}

#score-value {
  font-weight: bold;
  color: #d4a373;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1;
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: #fefefe;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  width: 90%;
  max-width: 400px; /* Set a max-width for better control */
}

.close-button {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 20px;
  cursor: pointer;
  color: #aaa;
}

.close-button:hover {
  color: #000;
}

#medal {
  display: block; /* Change to block */
  margin: 0 auto 20px; /* Center horizontally and add bottom margin */
  width: 100px; /* Fixed width */
  height: auto;
  object-fit: contain; /* Maintain aspect ratio */
}

#modalMessage {
  margin: 15px 0;
  font-size: 1.1em;
  color: #333;
  line-height: 1.4;
}

#returnToStart {
  margin-top: 15px;
  padding: 10px 20px;
  background-color: #73c7c7;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  display: block;
  width: 200px;
  margin: 15px auto 0; /* Center the button */
}

#returnToStart:hover {
  background-color: #a6f1e0;
}

footer {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9em;
  color: #555;
}

/* Score Animation */
@keyframes scoreUpdate {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

.score-update {
  animation: scoreUpdate 0.5s ease-in-out;
}

.mode-selection {
  margin: 20px 0;
}

.mode-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 20px;
}

.mode-button {
  flex: 1;
  max-width: 300px;
  padding: 20px;
  border-radius: 10px;
  background-color: rgba(115, 199, 199, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
}

.mode-button:hover {
  transform: translateY(-5px);
  background-color: rgba(166, 241, 224, 0.9);
}

.mode-button h3 {
  margin: 0 0 10px 0;
  color: #fff;
}

.mode-button p {
  margin: 5px 0;
  font-size: 0.9em;
  color: #fff;
}

#current-mode {
  font-size: 1.2em;
  font-weight: bold;
  color: #495057;
  margin-bottom: 10px;
}
