.onboarding-step {
  min-height: 410px;
}

.onboarding-step > h2 {
  margin-bottom: 10px;
}

.onboarding-step > .primary {
  width: 100%;
  margin-bottom: 15px;
}

#onboarding-trainer > small {
  display: block;
  color: #7b8a70;
  font-size: 11px;
}

.onboarding-intro {
  margin-bottom: 22px;
}

.entry-language-options,
.origin-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

.entry-language-options > button,
.origin-choice {
  min-height: 82px;
  border: 1px solid #a5b89d;
  border-radius: 7px;
  background: #f6f5e8;
  color: var(--ink);
}

.entry-language-options > button {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
  text-align: left;
}

.entry-language-options > button[aria-pressed='true'] {
  border-color: #48793d;
  box-shadow: inset 0 0 0 2px #d5e6b9;
  background: #eef3df;
}

.entry-language-options > button[aria-pressed='true']::after {
  content: '✓';
  position: absolute;
  right: 10px;
  top: 7px;
  color: #446a36;
}

.entry-language-options .language-flag,
.origin-flag {
  font:
    30px/1 system-ui,
    sans-serif;
}

.entry-language-options strong,
.entry-language-options small,
.origin-choice strong,
.origin-choice small {
  display: block;
}

.entry-language-options small,
.origin-choice small {
  color: #667c70;
  margin-top: 3px;
}

.origin-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
}

.origin-choice:has(input:checked) {
  border-color: #48793d;
  box-shadow: inset 0 0 0 2px #d5e6b9;
  background: #eef3df;
}

.origin-choice input {
  accent-color: #537e40;
}

.onboarding-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.onboarding-actions .primary {
  flex: 1;
}

#onboarding-trainer-back {
  margin-bottom: 16px;
}

@media (max-width: 520px) {
  .onboarding-step {
    min-height: auto;
  }

  .entry-language-options,
  .origin-options {
    grid-template-columns: 1fr;
  }

  .entry-language-options > button,
  .origin-choice {
    min-height: 64px;
  }
}

.first-adventure-dialog {
  width: min(760px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}
#first-adventure-dialog h2 {
  font-size: 32px;
}
#first-adventure-copy {
  font-size: 24px;
  line-height: 1.3;
}
#first-adventure-detail {
  font-size: 21px;
  line-height: 1.3;
}
#first-adventure-dialog > button {
  font-size: 22px;
}
.first-adventure-dialog > .primary {
  width: 100%;
  margin: 12px 0;
}
.first-adventure-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}
.first-adventure-options .first-adventure-card {
  font-size: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  min-width: 0;
  background: #f2f5e4;
  border: 2px solid #b5c1a5;
  color: #254336;
}
.first-adventure-options img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  image-rendering: pixelated;
}
.first-adventure-options small {
  font-size: 18px;
}
.first-adventure-goal {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 12;
  max-width: calc(100% - 100px);
  padding: 10px 12px;
  border: 2px solid #9c7121;
  background: #fff3bf;
  color: #273d31;
  box-shadow: 0 3px 0 #0003;
  font-size: 12px;
  text-align: left;
}
@media (max-width: 520px) {
  .first-adventure-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .first-adventure-options img {
    width: 56px;
    height: 56px;
  }
  .first-adventure-dialog {
    padding: 18px;
  }
  .first-adventure-goal {
    font-size: 10px;
    padding: 7px;
  }
}

.mobile-game #first-adventure-dialog h2 {
  font-size: 28px;
  line-height: 1.15;
  margin: 8px 0;
}
.mobile-game #first-adventure-copy {
  font-size: 21px;
  line-height: 1.25;
  margin: 8px 0;
}
.mobile-game #first-adventure-detail {
  font-size: 19px;
  line-height: 1.2;
  margin: 8px 0;
}
.mobile-game .first-adventure-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 10px 0;
}
.mobile-game .first-adventure-options .first-adventure-card {
  padding: 5px 2px;
  font-size: 19px;
}
.mobile-game .first-adventure-options small {
  font-size: 16px;
}
.mobile-game .first-adventure-options img {
  width: 48px;
  height: 48px;
}
.mobile-game #first-adventure-next {
  position: sticky;
  bottom: 0;
  z-index: 1;
  margin: 8px 0;
}

.entry-settings {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.entry-settings button {
  font-size: 11px;
  padding: 6px 9px;
}
.entry-settings #onboarding-trainer-back {
  margin: 0;
}
.first-story {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  z-index: 15;
  padding: 16px 20px;
  max-height: 66%;
  overflow-y: auto;
  background: #fffde9;
  border: 4px double #465569;
  box-shadow: 0 3px 0 #0005;
  color: #263c37;
  font-size: clamp(26px, 2.2vw, 32px);
  line-height: 1.25;
}
.first-story > strong {
  color: #825017;
}
.first-story p {
  margin: 8px 0;
  font-size: inherit;
  line-height: inherit;
}
.first-story button {
  display: block;
  font-size: 21px;
  min-height: 44px;
  padding: 8px 12px;
  margin: 8px 0 0 auto;
}
#first-story-team {
  display: flex;
  justify-content: center;
  gap: 4px;
}
#first-story-team img {
  width: 48px;
  height: 48px;
  image-rendering: pixelated;
}
@media (max-width: 520px) {
  .first-story {
    font-size: 23px;
    padding: 10px 12px;
  }
  #first-story-team img {
    width: 40px;
    height: 40px;
  }
}

.first-borrowed-team .team-panel {
  visibility: hidden;
}
