:root {
  --ink: #171613;
  --muted: #696966;
  --paper: #fff;
  --window: #ece9e1;
  --line: #d8d5ce;
  --soft: #f1eee7;
  --gold: #e6bd54;
  --correct: #23885b;
  --wrong: #cb4d55;
  --shadow: 0 22px 70px #0b0b0a18;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--window);
}

body {
  min-height: 100svh;
  margin: 0;
  color: var(--ink);
  background: var(--window);
  font-family: var(--font-sans);
}

button,
a {
  font: inherit;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  width: 100%;
  min-height: 74px;
  padding: 8px clamp(18px, 3vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fff;
  box-shadow: 0 9px 30px #0003;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
}

.brand-icon {
  position: relative;
  display: block;
  flex: none;
  width: 50px;
  height: 51px;
  overflow: hidden;
}

.brand-icon img {
  position: absolute;
  top: -11px;
  left: -104px;
  width: 260px;
  height: auto;
  max-width: none;
}

.brand-text {
  display: grid;
}

.brand-text strong {
  font: 700 1.43rem/1 var(--font-serif);
}

.brand-text small {
  margin-top: 2px;
  font: 850 0.55rem/1.2 var(--font-sans);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

nav {
  display: flex;
  align-items: center;
  gap: 18px;
}

nav a {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
}

nav a:hover {
  color: var(--ink);
}

nav button {
  min-height: 44px;
  padding: 0 17px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: var(--gold);
  cursor: pointer;
  font-weight: 850;
}

main {
  width: min(1120px, calc(100% - 32px));
  margin: 24px auto 0;
  padding-bottom: 48px;
}

.learning-status {
  min-height: 70px;
  margin-bottom: 14px;
  padding: 12px 16px;
  display: grid;
  grid-template-columns: auto minmax(200px, 1fr) auto;
  align-items: center;
  gap: 24px;
  background: var(--paper);
  border: 0;
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.learning-status > div:first-child {
  display: grid;
}

.status-label,
.status-progress > span,
#question-progress {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
}

#group-status {
  font-size: 1rem;
}

.status-progress {
  display: grid;
  gap: 7px;
}

.progress-track {
  height: 7px;
  overflow: hidden;
  background: var(--soft);
  border-radius: 99px;
}

#progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), #c58e2e);
  border-radius: inherit;
  transition: width 250ms ease;
}

.reset-button {
  padding: 8px 11px;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.72rem;
  font-weight: 750;
}

.quiz {
  display: grid;
  grid-template-columns: minmax(280px, 0.85fr) minmax(420px, 1.35fr);
  gap: 14px;
  align-items: stretch;
}

.question-card,
.answer-area {
  min-height: min(680px, calc(100svh - 180px));
  overflow: hidden;
  background: var(--paper);
  border: 0;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.question-card {
  display: grid;
  grid-template-rows: auto 1fr;
}

.question-card.is-comparison {
  grid-template-rows: 1fr;
}

.question-card.is-comparison .question-heading {
  display: none;
}

.question-heading {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--line);
}

#question-instruction {
  max-width: 100%;
  color: var(--ink);
  font: 700 1.35rem/1.15 var(--font-serif);
  overflow-wrap: normal;
  hyphens: none;
}

.question-content {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: clamp(22px, 4vw, 48px);
  display: grid;
  place-items: center;
  text-align: center;
  container-type: size;
}

.prompt-name,
.prompt-symbol {
  max-width: 100%;
  overflow-wrap: anywhere;
  font-family: var(--font-serif);
  line-height: 0.95;
}

.prompt-name {
  display: block;
  max-width: 100%;
  font-size: 4rem;
  hyphens: none;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.prompt-symbol {
  font-size: clamp(5rem, 12vw, 10rem);
}

.prompt-image {
  width: min(100%, 390px, calc(100cqh - 6rem));
  display: grid;
  grid-template-rows: auto auto;
  gap: 18px;
}

.prompt-image img {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 20px;
}

.prompt-image strong {
  font-family: var(--font-serif);
  font-size: clamp(2.6rem, 7vw, 5.5rem);
}

.prompt-question {
  width: min(100%, 520px);
  max-width: 100%;
  margin: 0;
  font: 700 clamp(1.9rem, 4.3vw, 3.8rem)/1.08 var(--font-serif);
  letter-spacing: -0.025em;
  text-align: center;
  overflow-wrap: normal;
  hyphens: manual;
}

.battle-term {
  position: relative;
  margin: 0 0.08em;
  padding: 0.02em 0.36em 0.08em;
  border: 1px solid #ded9cf;
  border-radius: 0.18em;
  color: inherit;
  background: #f3f0ea;
  cursor: pointer;
  font: inherit;
  letter-spacing: inherit;
  line-height: inherit;
  overflow-wrap: normal;
  hyphens: manual;
  vertical-align: baseline;
  box-shadow: none;
}

.battle-term span {
  transition: color 120ms ease;
}

.battle-term i {
  position: absolute;
  top: -0.55rem;
  right: -0.55rem;
  width: 1.7rem;
  height: 1.7rem;
  padding: 0 0 0.08rem;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 50%;
  color: #fff;
  background: var(--ink);
  box-shadow: 0 2px 6px #0003;
  font: 900 0.82rem/1 var(--font-sans);
  letter-spacing: 0;
}

.battle-term:hover span,
.battle-term:focus-visible span {
  color: #a87b22;
}

.battle-term:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 5px;
}

.battle-info-dialog {
  width: min(680px, calc(100% - 28px));
  max-height: calc(100svh - 28px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 25px;
  color: var(--ink);
  background: #f6f2e9;
  box-shadow: 0 35px 120px #0009;
}

.battle-info-dialog::backdrop {
  background: #0b0b0ad9;
  backdrop-filter: blur(7px);
}

.battle-info-shell {
  position: relative;
  padding: clamp(30px, 6vw, 60px);
}

.battle-info-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  padding: 0 0 4px;
  border: 1px solid #c9c4b8;
  border-radius: 50%;
  color: var(--ink);
  background: #fff9;
  cursor: pointer;
  font-size: 1.8rem;
  line-height: 1;
}

.battle-info-kicker {
  margin: 0 0 10px;
  color: #a87b22;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.battle-info-shell h2 {
  max-width: calc(100% - 50px);
  margin: 0 0 30px;
  font: 700 clamp(2.7rem, 8vw, 5rem)/0.9 var(--font-serif);
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.battle-info-shell section {
  padding: 20px 0;
  border-top: 1px solid #d2cec5;
}

.battle-info-shell h3 {
  margin: 0 0 8px;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.battle-info-shell section p {
  margin: 0;
  color: #4f504c;
  font: 1.08rem/1.55 var(--font-serif);
}

.answer-area {
  padding: 20px;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 14px;
}

.continue-button {
  justify-self: end;
  min-width: 118px;
  min-height: 48px;
  padding: 0 22px;
  color: white;
  background: var(--ink);
  border: 0;
  border-radius: 99px;
  box-shadow: 0 8px 24px #1f252a40;
  cursor: pointer;
  font-weight: 850;
}

.continue-button:hover {
  background: #384148;
}

.continue-button:focus-visible {
  outline: 3px solid #858d9266;
  outline-offset: 3px;
}

.continue-button[hidden] {
  display: none;
}

.answer-heading {
  min-height: 35px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.answer-heading h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.answers {
  min-height: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 10px;
}

.answer {
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  display: grid;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 18px;
  cursor: pointer;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
}

.answer:hover:not(:disabled) {
  border-color: #858d92;
  box-shadow: 0 8px 24px #20262b12;
  transform: translateY(-2px);
}

.answer:focus-visible {
  outline: 3px solid #858d9266;
  outline-offset: 2px;
}

.answer:disabled {
  cursor: default;
}

.answer.correct {
  border-color: var(--correct);
  box-shadow: inset 0 0 0 2px var(--correct);
}

.answer.wrong {
  border-color: var(--wrong);
  opacity: 0.62;
}

.answer-with-image {
  grid-template-rows: minmax(0, 1fr) auto;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.answer img {
  width: 100%;
  height: auto;
  min-height: 0;
  aspect-ratio: 1;
  object-fit: cover;
}

.answer-with-image img {
  width: auto;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  justify-self: center;
  border-radius: 18px;
}

.answer-with-image:hover:not(:disabled) {
  border-color: transparent;
  box-shadow: none;
}

.answer-with-image.correct,
.answer-with-image.wrong {
  border: 0;
  box-shadow: none;
}

.answer-with-image.correct img {
  outline: 4px solid var(--correct);
  outline-offset: -4px;
}

.answer-with-image.wrong img {
  outline: 4px solid var(--wrong);
  outline-offset: -4px;
}

.answer-copy {
  min-height: 56px;
  padding: 9px 11px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.answer-series {
  min-height: 62px;
  padding: 9px 11px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  background: transparent;
  text-align: center;
}

.answer-series strong {
  color: color-mix(
    in srgb,
    var(--series) var(--series-label-strength),
    var(--series-label-ink)
  );
  overflow-wrap: anywhere;
  font: 900 clamp(0.62rem, 1.05vw, 0.78rem)/1.15 var(--font-sans);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.answer-copy strong {
  overflow-wrap: anywhere;
  font-family: var(--font-serif);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.05;
}

.answer-copy small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.comparison-value {
  display: none;
}

.answers.reveal-comparison .comparison-value {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: clamp(0.76rem, 1.4vw, 0.92rem);
  font-weight: 850;
}

.answers.reveal-comparison .answer.correct .comparison-value {
  color: var(--correct);
}

.answers.reveal-comparison .answer.wrong .comparison-value {
  color: var(--wrong);
}

.answer-name-only {
  place-items: center;
  padding: 20px;
}

.answer-name-only strong {
  overflow-wrap: anywhere;
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 3.1vw, 2.5rem);
  line-height: 1;
}

.loading {
  padding: 50px;
  color: var(--muted);
  text-align: center;
}

.quiz[hidden],
.loading[hidden] {
  display: none;
}

.notice {
  position: fixed;
  z-index: 10;
  left: 50%;
  bottom: max(24px, env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  color: white;
  background: var(--ink);
  border-radius: 99px;
  box-shadow: 0 12px 40px #0003;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 20px);
  transition: 180ms ease;
}

.notice.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 761px) and (min-height: 600px) {
  body {
    height: 100dvh;
    overflow: hidden;
  }

  main {
    height: calc(100dvh - 74px);
    margin-top: 0;
    padding-top: 14px;
    padding-bottom: 14px;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 14px;
  }

  .learning-status {
    min-height: 64px;
    margin-bottom: 0;
  }

  .quiz {
    min-height: 0;
    height: 100%;
  }

  .question-card,
  .answer-area {
    min-height: 0;
    height: 100%;
  }

}

.introduction-dialog {
  width: min(1240px, calc(100% - 28px));
  max-height: calc(100svh - 28px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 28px;
  color: var(--ink);
  background: #f6f2e9;
  box-shadow: 0 35px 120px #0009;
}

.introduction-dialog::backdrop {
  background: #0b0b0ae8;
  backdrop-filter: blur(8px);
}

.introduction-shell {
  padding: clamp(25px, 4.5vw, 58px);
}

.introduction-welcome {
  min-height: min(560px, calc(100svh - 144px));
  display: grid;
  place-content: center;
  justify-items: center;
  text-align: center;
}

.introduction-welcome[hidden],
.introduction-slideshow[hidden] {
  display: none;
}

.introduction-welcome > header {
  max-width: 820px;
  margin: 0 auto 30px;
  text-align: center;
}

.introduction-welcome > header > p:first-child {
  margin: 0 0 12px;
  color: #a87b22;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.introduction-welcome h2 {
  margin: 0;
  font: 700 clamp(2.5rem, 6vw, 5.4rem)/0.9 var(--font-serif);
  letter-spacing: -0.035em;
}

.introduction-welcome > header > p:last-child {
  max-width: 660px;
  margin: 24px auto 0;
  color: var(--muted);
  font: 1rem/1.5 var(--font-serif);
}

.introduction-primary {
  min-height: 52px;
  padding: 0 25px;
  border: 0;
  border-radius: 11px;
  color: var(--ink);
  background: var(--gold);
  cursor: pointer;
  font-weight: 900;
}

.introduction-slideshow {
  min-height: min(560px, calc(100svh - 144px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 18px;
}

.introduction-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-align: center;
  text-transform: uppercase;
}

.introduction-slide {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(250px, 0.9fr) minmax(280px, 1.1fr);
  align-items: center;
  gap: clamp(30px, 6vw, 90px);
  padding: 0 clamp(0px, 3vw, 35px);
}

.introduction-slide.is-entering .introduction-portrait {
  animation: introduction-pop 0.5s cubic-bezier(0.2, 1.3, 0.35, 1) both;
}

.introduction-slide.is-entering .introduction-copy {
  animation: introduction-copy 0.42s 0.08s ease-out both;
}

.introduction-portrait {
  position: relative;
  width: min(100%, 500px);
  aspect-ratio: 1;
  justify-self: end;
  filter: drop-shadow(0 28px 35px #0003);
}

.introduction-portrait-card {
  position: relative;
  width: 100%;
  height: 100%;
}

.introduction-portrait::before {
  content: "";
  position: absolute;
  inset: -8%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--series) 35%, transparent), transparent 68%);
}

.introduction-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 24px;
  object-fit: cover;
}

.introduction-portrait-card > strong {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  min-width: 68px;
  min-height: 68px;
  padding: 5px 11px;
  border: 2px solid var(--ink);
  border-radius: 13px;
  background: #fffddd;
  font: 700 2.8rem/1 var(--font-serif);
}

.introduction-copy small {
  display: block;
  color: color-mix(
    in srgb,
    var(--series) var(--series-label-strength),
    var(--series-label-ink)
  );
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.introduction-copy h2 {
  margin: 13px 0 0;
  font: 700 clamp(3.5rem, 8vw, 8rem)/0.82 var(--font-serif);
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.introduction-copy p {
  margin: 25px 0 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.combat-reveal {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
  min-height: 44px;
  margin-top: 23px;
}

.combat-reveal-line {
  position: relative;
  display: grid;
  width: max-content;
  min-width: 112px;
  min-height: 48px;
  place-items: center;
}

.combat-reveal-measure {
  grid-area: 1 / 1;
  min-width: 112px;
  padding: 12px 18px 13px;
  visibility: hidden;
  font: 800 0.82rem/1.05 var(--font-sans);
  letter-spacing: 0.025em;
  text-transform: uppercase;
  white-space: nowrap;
}

.combat-reveal-line .combat-badge {
  position: absolute;
  top: 0;
  left: 50%;
  justify-content: center;
  width: max-content;
  min-width: 100%;
  max-width: none;
  min-height: 48px;
  margin: 0;
  padding: 12px 18px 13px;
  font-size: 1rem;
  white-space: nowrap;
  transform: translateX(-50%);
}

.combat-reveal-line .combat-badge strong {
  font-size: 1rem;
}

.combat-reveal-line .combat-badge.is-revealed {
  animation: combat-badge-flight 0.3s cubic-bezier(0.12, 0.78, 0.2, 1) both;
}

.introduction-portrait-card.combat-weight {
  animation: combat-weight-impact 1.08s cubic-bezier(0.25, 0.8, 0.35, 1) both;
}

.introduction-portrait-card.combat-size {
  animation: combat-size-surge 1.08s cubic-bezier(0.2, 0.8, 0.3, 1) both;
}

.introduction-portrait-card.combat-ionization {
  transform-origin: 50% 85%;
  animation: combat-ionization-sway 1.08s ease-out both;
}

@keyframes combat-weight-impact {
  0%, 10% { transform: translateY(0); }
  28% { transform: translateY(-25px); }
  45% { transform: translateY(8px) scaleY(0.985); }
  52% { transform: translate(-7px, 2px) rotate(-0.7deg); }
  59% { transform: translate(6px, 0) rotate(0.6deg); }
  67% { transform: translate(-4px, 0) rotate(-0.35deg); }
  76% { transform: translate(3px, 0) rotate(0.2deg); }
  88% { transform: translate(-1px, 0); }
  100% { transform: translate(0) scale(1); }
}

@keyframes combat-size-surge {
  0%, 12% { transform: scale(1); }
  48% { transform: scale(1.105); }
  64% { transform: scale(0.985); }
  78% { transform: scale(1.025); }
  100% { transform: scale(1); }
}

@keyframes combat-ionization-sway {
  0%, 12% { transform: translateX(0) rotate(0); }
  28% { transform: translateX(24px) rotate(2.8deg); }
  43% { transform: translateX(-17px) rotate(-2deg); }
  57% { transform: translateX(11px) rotate(1.3deg); }
  70% { transform: translateX(-7px) rotate(-0.8deg); }
  82% { transform: translateX(4px) rotate(0.4deg); }
  92% { transform: translateX(-2px) rotate(-0.2deg); }
  100% { transform: translateX(0) rotate(0); }
}

@keyframes combat-badge-flight {
  0% {
    opacity: 0;
    transform: translate(calc(-50% + 165px), -125px) scale(1.38) rotate(27deg);
    filter: drop-shadow(-68px 72px 18px #0005) blur(1.5px);
  }
  34% {
    opacity: 1;
    transform: translate(calc(-50% + 92px), -91px) scale(1.22) rotate(17deg);
    filter: drop-shadow(-45px 51px 13px #0005) blur(0.5px);
  }
  70% {
    transform: translate(calc(-50% + 22px), -31px) scale(1.06) rotate(5deg);
    filter: drop-shadow(-17px 23px 7px #0004);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1) rotate(-1.5deg);
    filter: drop-shadow(1px 1px 1px rgba(0, 0, 0, 0.5));
  }
}

@media (prefers-reduced-motion: reduce) {
  .introduction-portrait-card.combat-weight,
  .introduction-portrait-card.combat-size,
  .introduction-portrait-card.combat-ionization,
  .combat-reveal-line .combat-badge.is-revealed {
    animation-duration: 1ms;
  }
}

.introduction-progress {
  width: min(620px, 80%);
  height: 5px;
  margin: auto;
  overflow: hidden;
  border-radius: 99px;
  background: #ded9cf;
}

.introduction-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold);
  transition: width 0.25s ease;
}

.introduction-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.introduction-controls button {
  min-height: 48px;
  padding: 0 20px;
  border: 0;
  border-radius: 11px;
  color: var(--muted);
  background: #e7e2d8;
  cursor: pointer;
  font-weight: 850;
}

.introduction-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

.introduction-controls .introduction-primary {
  color: var(--ink);
  background: var(--gold);
}

@keyframes introduction-pop {
  from { opacity: 0; transform: scale(0.68) rotate(-4deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes introduction-copy {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (max-width: 760px) {
  .topbar {
    min-height: 68px;
  }

  .topbar nav a {
    display: none;
  }

  .brand-icon {
    width: 42px;
    height: 44px;
  }

  .brand-icon img {
    top: -9px;
    left: -88px;
    width: 220px;
  }

  .learning-status {
    grid-template-columns: auto 1fr;
    gap: 10px 16px;
  }

  .reset-button {
    display: none;
  }

  .quiz {
    grid-template-columns: 1fr;
  }

  .question-card,
  .answer-area {
    min-height: auto;
  }

  .question-content {
    min-height: 300px;
  }

  .answer-area {
    height: min(590px, 65svh);
  }

  .answer-area:has(.answers.has-image-answers) {
    height: auto;
  }

  .answers.has-image-answers {
    grid-template-rows: auto auto;
  }

  .introduction-slide {
    grid-template-columns: 1fr;
    align-content: center;
    gap: 18px;
    text-align: center;
  }

  .introduction-portrait {
    width: min(46svh, 72vw, 360px);
    justify-self: center;
  }

  .introduction-copy h2 {
    margin-top: 8px;
    font-size: clamp(2.8rem, 12vw, 5rem);
  }

  .introduction-copy p {
    margin-top: 12px;
  }
}

@media (max-width: 460px) {
  main {
    width: min(100% - 20px, 1120px);
  }

  .topbar {
    padding: 7px 10px;
  }

  .topbar nav button {
    min-height: 42px;
    padding: 0 11px;
    font-size: 0.7rem;
  }

  .learning-status {
    border-radius: 14px;
  }

  .question-card,
  .answer-area {
    border-radius: 18px;
  }

  .question-content {
    min-height: 260px;
    padding: 22px;
  }

  .answer-area {
    height: 560px;
    padding: 12px;
  }

  .answer-copy {
    min-height: 49px;
    padding: 7px 8px;
  }

  .answer-series {
    min-height: 56px;
    padding: 7px 8px;
  }

  .introduction-dialog {
    width: calc(100% - 14px);
    max-height: calc(100svh - 14px);
    border-radius: 20px;
  }

  .introduction-shell {
    padding: 25px 14px;
  }

  .introduction-welcome,
  .introduction-slideshow {
    min-height: calc(100svh - 64px);
  }

  .introduction-portrait {
    width: min(40svh, 76vw, 310px);
  }

  .introduction-portrait-card > strong {
    top: 10px;
    right: 10px;
    min-width: 52px;
    min-height: 52px;
    font-size: 2rem;
  }

  .introduction-controls button {
    padding: 0 13px;
    font-size: 0.76rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
