html, body {
  height: 100%;
}

body {
  /* center the main stage; overlays keep working (they are fixed) */
  min-height: 100vh;
  display: flex;
  align-items: center;     /* vertical center */
  justify-content: center; /* horizontal center */
}

body.mobile #stage { padding-top: 12px; padding-bottom: 12px; }

body.mobile .option-box {
  max-width: 90vw; /* keep boxes fully visible on narrow screens */
}

#stage {
  width: 100%;
  max-width: 980px;        /* optional: keeps content from stretching too wide */
  padding: 24px 16px;      /* breathing room */
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}

/* remove the top push so true centering works */
#trialContainer {
  margin-top: 0;
}

body {
  font-family: Arial, sans-serif;
  text-align: center;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.instruction-content, .popup-content {
  background: white;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  box-sizing: border-box;
  overflow-y: auto;
}

.instruction-content p, .popup-content p {
  margin-bottom: 15px;
}

button {
  padding: 10px 20px;
  margin-top: 10px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 6px;
  border: none;
  background-color: #007BFF;
  color: white;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #0056b3;
}

/* Survey buttons container */
#popupButtons {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

/* Individual survey response buttons */
#popupButtons button {
  width: 45px;
  height: 45px;
  font-size: 16px;
  background-color: #ddd;
  color: #000;
  border: 1px solid #999;
  border-radius: 6px;
  transition: background-color 0.2s ease, transform 0.1s ease;
}

/* ✅ Highlight selected button */
#popupButtons button.selected {
  background-color: #007BFF;
  color: #fff;
  border: 2px solid #0056b3;
  transform: scale(1.05);
}

#popupButtons button:hover {
  background-color: #bbb;
}

/* Trial display */
#trialContainer {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 40px;
  gap: 15px;
  flex-wrap: nowrap;
}

.option-box {
  width: 40%;
  max-width: 220px;
  height: 150px;
  background-color: #fff;
  border: 2px solid #000;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 1.2em;
  padding: 10px;
  word-wrap: break-word;
  box-sizing: border-box;
}

#orLabel {
  font-weight: bold;
  font-size: 1.5em;
}

.key-label {
  font-size: 0.9em;
  margin-top: 5px;
}

.hidden-transparent {
  opacity: 0;
}

.cross-visible {
  opacity: 1;
  font-size: 2em;
}

/* Status text */
#status {
  margin-top: 20px;
  font-weight: bold;
}

/* Mobile adjustments */
body.mobile .option-box {
  width: 42%;
  height: auto;
  min-height: 100px;
  font-size: 4vw;
}

body.mobile #popupButtons button {
  width: 12vw;
  height: 12vw;
  font-size: 4vw;
}

#numberButtons button {
  width: 45px;
  height: 45px;
  font-size: 16px;
  background-color: #ddd;
  color: #000;
  border: 1px solid #999;
  border-radius: 6px;
  transition: background-color 0.2s ease;
}

#numberButtons button:hover {
  background-color: #bbb;
}

#numberButtons button.selected {
  background-color: #007BFF !important;
  color: white !important;
  border: 2px solid #0056b3;
}

#popupButtons button.selected {
  background-color: #007BFF !important;
  color: #fff !important;
  border: 2px solid #0056b3 !important;
}
