body {
  margin: 0;
  padding: 0;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
}
#jspsych-target {
  width: 100vw;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 10;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}
.jspsych-content {
  max-width: 100vw;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  min-height: 0; /* Allows flex item to shrink below its intrinsic minimum height when space is constrained (flexbox quirk) */
}
#jspsych-visual-search-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 5; /* Lower z-index to avoid interfering with main content */
  margin: 0 auto;
  pointer-events: none; /* Initially disable pointer events */
}
#search-window {
  position: fixed;
  border: 2px solid black;
  background-color: transparent;
  pointer-events: none;
  z-index: 100;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}
#memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 100px);
  grid-template-rows: repeat(4, 100px);
  gap: 5px;
  margin: 0 auto;
}
.memory-cell {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.memory-cell.highlighted {
  background-color: #ffcc00;
}
.memory-cell.selected {
  background-color: #66aaff;
}
.memory-reproduction-grid {
  display: grid;
  grid-template-columns: repeat(4, 100px);
  grid-template-rows: repeat(4, 100px);
  gap: 5px;
  margin: 20px auto;
}
.reproduction-cell {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s;
}
.reproduction-cell:hover {
  background-color: #e0e0e0;
}
.reproduction-cell.selected {
  background-color: #66aaff;
}
.memory-submit-btn {
  padding: 12px 24px;
  font-size: 16px;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 20px auto;
  display: block;
  transition: background-color 0.2s;
}
.memory-submit-btn:hover {
  background-color: #0056b3;
}
.memory-submit-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}
.memory-reset-btn {
  padding: 8px 16px;
  font-size: 14px;
  background-color: #6c757d;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  margin: 10px auto;
  display: block;
  transition: background-color 0.2s;
}
.memory-reset-btn:hover {
  background-color: #545b62;
}
.memory-choice-container {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin: 20px 0;
}
.memory-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, 80px);
  grid-template-rows: repeat(4, 80px);
  gap: 3px;
  margin: 0 auto;
  border: 3px solid transparent;
  padding: 10px;
  cursor: pointer;
  border-radius: 8px;
}
.memory-choice-grid:hover {
  border-color: #ccc;
}
.memory-choice-grid.selected {
  border-color: #007bff;
  background-color: #f8f9fa;
}
.choice-cell {
  background-color: #f0f0f0;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
}
.choice-cell.highlighted {
  background-color: #ffcc00;
}
.hidden {
  display: none !important;
}