body {
  margin: 0;
  background-color: #d9cece;
  font-family: "Inter", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
div {
  box-sizing: border-box;
}
span, input {
  font-family: "Inter", sans-serif;
  line-height: 1;
}
.selectorOption:hover {
  cursor: pointer;
  background-color: #cc2929;
}
.selectorOption:hover > span {
  color: #f2e6e6 !important;
}
.selectorOption:first-child {
  border-radius: 10px 10px 0 0;
}
.selectorOption:last-child {
  border-radius: 0 0 10px 10px;
}
.selector:hover {
  cursor: pointer;
  background-color: #bfb6b6 !important;
}
.button:hover {
  cursor: pointer;
  background-color: #d9cece !important;
}
.button:hover > span {
  color: #cc2929 !important;
} 
.button:hover > svg {
  fill: #cc2929;
}
.primary-button {
  display: flex;
  background-color: #cc2929;
  padding: 20px;
  border-radius: 10px;
  align-items: center;
  gap: 20px;
}
.secondary-button {
  display: flex;
  background-color: #d9cece;
  padding: 20px;
  border-radius: 10px;
  align-items: center;
  gap: 20px;
}
.secondary-button span {
  color: #403d3d;
}
.primary-button span {
  color: #f2e6e6;
}
.history-item {
  display: flex;
  padding: 10px;
  border-radius: 5px;
  margin-bottom: 5px;
}
.history-item.correct {
  background-color: rgba(0, 128, 0, 0.1);
}
.history-item.incorrect {
  background-color: rgba(255, 0, 0, 0.1);
  color: #cc2929;
}
#progressBar {
  height: 10px;
  background-color: #d9cece;
  border-radius: 5px;
  margin-top: 10px;
}
#progressFill {
  height: 100%;
  background-color: #cc2929;
  border-radius: 5px;
  width: 0%;
  transition: width 0.3s;
}
#statsContainer {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.stat-box {
  flex: 1;
  min-width: 120px;
  background-color: #d9cece;
  border-radius: 10px;
  padding: 15px;
}
#mainContent {
  display: flex;
  flex-direction: column;
  margin: 40px auto;
  background-color: #f2e6e6;
  padding: 40px;
  border-radius: 20px;
  gap: 40px;
  max-width: 800px;
  width: calc(100% - 40px);
  height: 800px; /* Increased height from 700px to 800px */
  overflow-y: auto; /* Allow scrolling if content exceeds height */
  position: relative; /* Enable absolute positioning for back buttons */
}
.mode-selector {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
}
.mode-button {
  padding: 10px 20px;
  border-radius: 5px;
  cursor: pointer;
  background-color: #d9cece;
  color: #403d3d;
  font-weight: bold;
  text-align: center;
  flex: 1;
}
.mode-button.active {
  background-color: #cc2929;
  color: #f2e6e6;
}
.length-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.length-button {
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #d9cece;
  color: #403d3d;
  font-weight: bold;
  border-radius: 5px;
  cursor: pointer;
}
.length-button.active {
  background-color: #cc2929;
  color: #f2e6e6;
}
#manualModeControls {
  margin-top: 20px;
  padding: 20px;
  background-color: #d9cece;
  border-radius: 10px;
}
.extended-lengths {
  margin-top: 10px;
}
.stimulus {
  font-size: 36px;
  font-weight: bold;
}
#feedbackMessage {
  margin-top: 0px;
  padding: 10px;
  border-radius: 5px;
  font-weight: bold;
  text-align: center;
  height: 28px; /* Reduced to pull buttons up */
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 5;
}
.correct-feedback {
  background-color: rgba(0, 128, 0, 0.1);
  color: green;
}
.incorrect-feedback {
  background-color: rgba(255, 0, 0, 0.1);
  color: #cc2929;
}
/* Progress chart */
#progressCanvas {
  width: 100%;
  height: 300px;
  background: #d9cece;
  border-radius: 10px;
}
/* Game screen containers - ensure consistent height */
.game-screen {
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 50px; /* Increased gap from 40px to 50px for more spacing */
}
/* Button spacing for mobile */
.response-buttons {
  margin-top: -80px; /* Raise buttons a lot more */
}
/* Fixed grey content box styling */
.content-box {
  text-align: center;
  padding: 25px;
  background-color: #d9cece;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 250px; /* Increased height to accommodate longer text */
  width: 100%; /* Fixed width */
  box-sizing: border-box;
}
/* Special styling for rule screen content box */
.rule-content-box {
  text-align: center;
  padding: 25px;
  background-color: #d9cece;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 250px; /* Increased height to accommodate longer text */
  width: 100%; /* Fixed width */
  box-sizing: border-box;
}
/* Fixed back button positioning */
.back-button-container {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}
@media screen and (max-width: 500px) {
  #mainContent {
    margin: 20px auto;
    padding: 20px;
    height: 700px; /* Increased height from 600px to 700px for mobile */
  }
  .descriptionActions {
    flex-direction: column !important;
    align-self: stretch !important;
  }
  .primary-button {
    align-self: stretch !important;
  }
  .response-buttons {
    margin-top: -48px; /* Raise a lot more on mobile */
  }
}

/* Modal popup styling */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: #f2e6e6;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  border-bottom: 1px solid #bfb6b6;
  background: linear-gradient(135deg, #cc2929 0%, #a02020 100%);
  color: #f2e6e6;
  border-radius: 12px 12px 0 0;
}

.modal-header h3 {
  color: #f2e6e6;
  font-weight: 700;
  margin: 0;
}

.modal-close-btn {
  background: rgba(242, 230, 230, 0.2);
  border: none;
  color: #f2e6e6;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.modal-close-btn:hover {
  background-color: rgba(242, 230, 230, 0.3);
  color: #f2e6e6;
}

.modal-body {
  padding: 1.5rem;
  color: #262424;
}


