body {
  width: 1000px;
  margin: auto;
  background-color: white;
  color: black;
  font-size: 18pt;
  padding: 30px 20px 20px 20px;
  border: 5px solid white;
}

/* Show only the consent screen */
#welcome {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
  text-align: justify;
}

.welcomeButton {
  width: 230px;
  margin: 0 auto;
  padding: 5px;
  font-weight: bold;
  background: #f4f4f4;
  border: 4px outset #dbdbdb;
}

.startButton {
  padding: 15px 30px;
  border: 2.5px solid lightblue;
  border-radius: 50px;
  background-color: white;
  text-align: center;
  font-size: 16pt;
  display: inline-block;
  margin: 0 auto;
  cursor: pointer;
  transition: all 0.3s ease;
}

.startButton:hover {
  background-color: lightblue;
  color: white;
}

/* instruction container */
.instruction-container {
  display: none;
  margin: 0 auto;
  overflow-y: auto;
  position: relative;
}

.instructions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  gap: 5px;
}

.instruction-container>button {
  background-color: white;
  border: 2px solid;
  border-color: rgb(187, 193, 196);
  border-radius: 50px;
  padding: 10px 20px;
  font-size: 25px;
  cursor: cursor;
  color: black;
}

.instruction-container>button:hover {
  background-color: rgb(236, 238, 238);
}

#instructionButton2 {
  margin-top: 15px;
}

/* mining behavior container */
.mining-behavior-container {
  display: none;
}

.mining-behavior {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
  gap: 10px;
  margin-top: 80px;
}

.mining-behavior-container img {
  width: 100px;
}

/* mineral boxes */
.mineral-container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin: 20px auto;
  max-width: 300px;
}

.mineral-box {
  width: 50px;
  height: 50px;
  border: 2px solid #cec8c8;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.mineral-container .mining-sandglass {
  width: 50px;
  height: 50px;
  object-fit: contain;
}

.transition-container {
  display: none;
  text-align: center;
  padding: 220px;
}

.loading-gif {
  position: absolute;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* ============================================================
   RANGE ESTIMATION SCREEN
   ============================================================ */

.range-container {
  display: none;
}

.range-container.show {
  display: block;
}

body:has(.range-container.show) {
  max-width: calc(100% - 50px);
}

.range-screen {
  max-width: 940px;
  margin: 0 auto;
  font-size: 17pt;
}

.mining-impression-instruction {
  color: #b54f4f;
}

.mining-next-prompt {
  display: none;
  text-align: center;
}

.mining-next-prompt kbd {
  font-weight: bold;
}

.range-note {
  margin: 0 0 14px;
  color: #444;
}

.range-block {
  margin-bottom: 14px;
}

.range-block-heading {
  min-height: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}

.range-block-heading h3 {
  text-align: center;
  margin: 0;
  font-size: inherit;
}

.range-block-heading img {
  width: 100px;
  height: auto;
}

#range-group .range-block-heading img {
  width: 120px;
}

.range-questions {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 12px 0;
}

.range-item {
  display: flex;
  flex-direction: column;
}

.range-item p {
  margin: 0 0 6px;
  line-height: 1.4;
}

.slider-block {
  width: 50%;
  margin: auto auto 0;
}

/* dual handle slider */
.dual-slider {
  position: relative;
  height: 44px;
  margin: 0 10px;
}

.slider-track,
.slider-fill {
  position: absolute;
  top: 19px;
  height: 6px;
  border-radius: 3px;
}

.slider-track {
  left: 0;
  right: 0;
  background-color: #e0e0e0;
}

.slider-fill {
  background-color: black;
}

.slider-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 44px;
  margin: 0;
  background: none;
  pointer-events: none;
  -webkit-appearance: none;
  appearance: none;
}

.slider-input:focus-visible {
  outline: 2px solid #333;
  border-radius: 6px;
}

/* which handle is on top (swapped from JS when the handles meet) */
.slider-lower {
  z-index: 2;
}

.slider-upper {
  z-index: 3;
}

.slider-lower.on-top {
  z-index: 4;
}

.slider-input::-webkit-slider-runnable-track {
  height: 44px;
  background: none;
  border: none;
}

.slider-input::-moz-range-track {
  height: 44px;
  background: none;
  border: none;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  width: 16px;
  height: 16px;
  margin-top: 14px;
  border-radius: 50%;
  background-color: #333;
  border: none;
  cursor: grab;
}

.slider-input::-moz-range-thumb {
  pointer-events: auto;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background-color: #333;
  border: none;
  cursor: grab;
}

.slider-input:active::-webkit-slider-thumb {
  cursor: grabbing;
}

.slider-ticks {
  position: relative;
  height: 34px;
  margin: 0 10px;
}

.slider-tick {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  text-align: center;
  color: #666;
}

.slider-tick .tick-mark {
  display: block;
  width: 1px;
  height: 7px;
  margin: 0 auto 2px auto;
  background-color: #aaa;
}

.range-readout {
  text-align: center;
  margin-top: 6px;
}

.readout-value {
  font-weight: bold;
  color: black;
  padding: 0 4px;
}

#range-button {
  font-size: inherit;
  display: block;
  margin: 22px auto 0;
}

/* demographics */
.survey {
  display: none;
}

/* ending screen */
.ending-container {
  display: none;
}

.ending-container.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

.ending-screen img {
  margin-top: 150px;
  margin-bottom: 10px;
}

.ending-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ending-text {
  font-size: 22pt;
  text-align: center;
  font-weight: bold;
}

/* consent screen: the UCSD / Brady lab web-study form, scrolled in place where
   the PDF embed used to sit, so the box the participant scrolls is the size it
   was before */
.consent-text {
  border: dotted 1px grey;
  width: 800px;
  max-width: 100%;
  height: 400px;
  overflow-y: auto;
  margin: 0 auto;
  padding: 16px 20px;
  box-sizing: border-box;
  font-size: 12pt;
  line-height: 1.55;
  text-align: left;
}

.consent-text p {
  margin: 0 0 10px 0;
}

/* only shown when a SONA link arrived without an id on it */
.id-note {
  font-size: 13pt;
  color: #b03030;
  text-align: center;
}

/* ending screen: save status and the return-to-SONA block */
.save-status,
.sona-credit-note {
  font-size: 14pt;
  font-weight: normal;
  color: #444;
}

#sonaCredit {
  margin-top: 10px;
}

/* =====================================================================
   PART 2 - the purple-eyed group (teammate reports, comparison task,
   mining records, attribution ratings). The mineral boxes are part 1's,
   so ten of them fall into two rows of five as they do in experiment 3.
   ===================================================================== */

/* teammate reports */
.p2-report-container {
  display: none;
  padding: 200px;
}

.p2-report-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-around;
}

.p2-report-screen p:nth-of-type(2) {
  /* purple, to match the purple-eyed group part 2 is about */
  border: 2px solid purple;
  padding: 10px;
  border-radius: 6px;
  background-color: #f8f4fb;
}

#p2-teammate-value {
  font-weight: bold;
}

.p2-report-transition {
  display: none;
  text-align: center;
  padding: 200px;
}

/* Experiment 4 slider styles, scoped to avoid affecting Part 1. */
/* slider */
#p2-estimate input[type="range"] {
  -webkit-appearance: none;
  width: 320px;
  height: 6px;
  background: #e0e0e0;
  border-radius: 3px;
}

#p2-estimate input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #333;
  border-radius: 50%;
}

#p2-estimate input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: #333;
  border-radius: 50%;
}


#p2-estimate .slider {
  display: block;
  width: 200px;
  margin: 20px 0 5px 0;
}

#p2-estimate .slider-unselected::-webkit-slider-thumb {
  opacity: 0;
}

#p2-estimate .slider-unselected::-moz-range-thumb {
  opacity: 0;
}

#p2-estimate .slider-labels {
  width: 350px;
  display: flex;
  justify-content: space-between;
  font-size: 30px;
  color: #666;
  margin-bottom: 50px;
}

#p2-estimate-submit {
  margin: 20px auto 0;
}

.p2-estimate-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.p2-estimate-item[hidden] {
  display: none;
}

.p2-estimate-posterior #p2-estimate-items {
  width: min(100%, 780px);
}

.p2-estimate-posterior .p2-estimate-item {
  padding: 16px 0;
  text-align: center;
}

.p2-estimate-posterior .p2-estimate-item + .p2-estimate-item {
  border-top: 1px solid #ded6e6;
}

.p2-estimate-posterior .p2-estimate-item p {
  margin: 0 0 8px;
}

#p2-estimate.p2-estimate-posterior .slider-labels {
  margin-bottom: 0;
}

.p2-estimate-alien {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

#p2-estimate-portrait {
  width: 76px;
}

/* Mining record and ratings share one compact page. */
.p2-mining-container {
  display: none;
}

.p2-mining-container .mining-behavior {
  width: min(100%, 680px);
  margin: 20px auto 0;
  gap: 8px;
  font-size: 18pt;
}

.p2-mining-heading,
.p2-mining-text p {
  margin: 0;
}

.p2-mining-heading {
  margin-bottom: 5pt;
}

.p2-alien-image {
  width: 100px;
  object-fit: contain;
}

#p2MineralContainer {
  display: grid;
  grid-template-columns: repeat(5, 54px);
  max-width: 320px;
  gap: 10px;
}

#p2MineralContainer .mining-sandglass {
  grid-column: 1 / -1;
  justify-self: center;
}

.p2-mining-transition {
  display: none;
  text-align: center;
  padding: 220px;
}

.p2-attribution {
  display: none;
  width: 100%;
  font-size: 12pt;
  text-align: center;
}

.p2-rating {
  min-width: 0;
  border: 0;
  margin: 8px 0 0;
  padding: 0;
}

.p2-rating + .p2-rating {
  margin-top: 16px;
}

.p2-rating legend {
  width: 100%;
  padding: 0;
  font-size: 14pt;
  text-align: left;
}

.p2-rating-options {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: start;
  gap: 4px;
  margin: 6px 0 4px;
}

.likert-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 11pt;
  line-height: 1.15;
  cursor: pointer;
}

.likert-option input {
  margin: 2px 0 3px;
}

#p2-button-attr {
  display: none;
  padding: 8px 22px;
  margin-top: 8px;
  font-size: 12pt;
}
