body {
  margin: 0;
  font-family: "Avenir Next", "Trebuchet MS", "Segoe UI", sans-serif;
  background: #ffffff;
  color: #1f2933;
}

#start-root,
#jspsych-target {
  min-height: 100vh;
}

.start-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: #ffffff;
}

.start-card {
  width: min(360px, 100%);
  padding: 20px;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(31, 41, 51, 0.04);
  border: 1px solid rgba(31, 41, 51, 0.1);
}

.start-form,
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.start-form {
  margin: 0;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.start-label {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: #102a43;
}

.field-label {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #102a43;
}

.field-hint {
  margin: 0;
  font-size: 14px;
  color: #52606d;
}

.confirmation-error {
  min-height: 1.4em;
  color: #b42318;
}

.day-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.day-choice {
  position: relative;
  cursor: pointer;
}

.day-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.day-choice-copy {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(31, 41, 51, 0.16);
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  color: #102a43;
  transition:
    border-color 150ms ease,
    background 150ms ease;
}

.day-choice input:checked + .day-choice-copy {
  border-color: #102a43;
  background: #f5f7fa;
}

.day-choice input:focus-visible + .day-choice-copy {
  outline: 3px solid rgba(29, 78, 216, 0.18);
  outline-offset: 2px;
}

.text-input,
.recall-textarea,
.notes-textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid rgba(31, 41, 51, 0.16);
  border-radius: 16px;
  background: #ffffff;
  font: inherit;
  color: inherit;
}

.text-input {
  min-height: 54px;
  padding: 0 16px;
}

.start-input {
  min-height: 46px;
  border-radius: 10px;
}

.free-recall-input-field {
  min-height: 46px;
  border-radius: 10px;
}

.recall-textarea,
.notes-textarea {
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.5;
}

.start-button {
  width: 100%;
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: #102a43;
  color: #ffffff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none;
  transition: background 150ms ease;
}

.start-button:hover {
  background: #0b2034;
}

.start-button:focus-visible,
.text-input:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.18);
  outline-offset: 2px;
}

.instructions {
  max-width: 860px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.7;
  text-align: left;
}

.instructions p {
  margin-bottom: 1em;
}

.instructions ul {
  margin: 0 0 1em 1.4em;
  padding: 0;
}

.instructions li {
  margin-bottom: 0.55em;
}

.word-screen,
.fixation-screen {
  min-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.word-box {
  min-width: min(62vw, 540px);
  min-height: min(26vh, 190px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 28px;
  border: 5px solid transparent;
  font-size: clamp(34px, 7vw, 64px);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 22px 60px rgba(31, 41, 51, 0.12);
}

.word-box-orange {
  border-color: #d97706;
  color: #8b3d00;
  background: linear-gradient(180deg, #fff0dd 0%, #ffe3bf 100%);
}

.word-box-blue {
  border-color: #1d4ed8;
  color: #143d73;
  background: linear-gradient(180deg, #e7f0ff 0%, #d7e7ff 100%);
}

.fixation-cross {
  font-size: clamp(42px, 8vw, 68px);
  font-weight: 700;
  color: #000000;
}

.choice-prompt {
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.choice-prompt p {
  font-size: 19px;
  line-height: 1.6;
}

.word-center {
  margin: 24px auto 10px;
  font-size: clamp(34px, 7vw, 58px);
  font-weight: 700;
  color: #102a43;
}

@media (max-width: 680px) {
  .start-card {
    padding: 18px;
  }

  .day-choice-grid {
    grid-template-columns: 1fr;
  }
}

.feedback {
  font-size: clamp(30px, 6vw, 44px);
  font-weight: 700;
  text-align: center;
}

.feedback.correct {
  color: #1f7a39;
}

.feedback.incorrect {
  color: #b42318;
}

.option-line {
  display: flex;
  align-items: center;
  gap: 10px;
  line-height: 1.5;
}

.free-recall-prompt {
  max-width: 900px;
  margin: 0 auto 20px;
}

.free-recall-list-block {
  gap: 10px;
}

.free-recall-entry-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  min-height: 64px;
}

.free-recall-entry,
.free-recall-entry-placeholder {
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid rgba(31, 41, 51, 0.12);
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px 12px;
}

.free-recall-entry {
  display: flex;
  align-items: center;
}

.free-recall-entry-word {
  min-width: 0;
  overflow-wrap: anywhere;
}

.free-recall-entry-placeholder {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  color: #52606d;
}

.free-recall-grid {
  max-width: 980px;
  margin: 0 auto;
}

.free-recall-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.free-recall-column-label {
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.free-recall-header .free-recall-column-label:first-child {
  color: #a14d00;
}

.free-recall-header .free-recall-column-label:last-child {
  color: #1d4ed8;
}

.free-recall-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.free-recall-confirmation {
  font-size: 14px;
}

.free-recall-confirmation.is-hidden {
  display: none;
}

.free-recall-confirmation.needs-confirmation {
  color: #b42318;
}

.free-recall-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.free-recall-grid-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.free-recall-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.free-recall-input {
  width: 100%;
  min-height: 42px;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid rgba(31, 41, 51, 0.18);
  border-radius: 10px;
  background: #ffffff;
  font: inherit;
  color: inherit;
}

.free-recall-grid-table[data-category="top"] .free-recall-input {
  background: #fff4e8;
  border-color: rgba(214, 109, 31, 0.28);
}

.free-recall-grid-table[data-category="bottom"] .free-recall-input {
  background: #eff5ff;
  border-color: rgba(29, 78, 216, 0.24);
}

.free-recall-input:focus-visible {
  outline: 3px solid rgba(29, 78, 216, 0.18);
  outline-offset: 2px;
}

.jspsych-content-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  box-sizing: border-box;
}

.jspsych-content {
  width: min(980px, 100%);
}

.jspsych-btn {
  border: none;
  border-radius: 999px;
  background: #6b7280;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  padding: 12px 18px;
  box-shadow: 0 8px 18px rgba(107, 114, 128, 0.18);
}

.jspsych-btn:hover,
.jspsych-nav-complete:hover {
  background: #5b6472;
}

.jspsych-nav-complete {
  background: #6b7280 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(107, 114, 128, 0.18);
}

.jspsych-btn:disabled {
  opacity: 0.6;
  box-shadow: none;
}

@media (max-width: 800px) {
  .start-card {
    width: min(360px, 100%);
  }

  .day-choice-grid {
    grid-template-columns: 1fr;
  }

  .instructions {
    font-size: 17px;
  }

  .free-recall-header,
  .free-recall-body {
    grid-template-columns: 1fr;
  }

  .free-recall-entry-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .free-recall-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .word-box {
    min-width: 100%;
    min-height: 180px;
    padding: 18px;
  }
}
