.did {
  --did-green: #173f35;
  --did-rust: #a64b2d;
  --did-gold: #927032;
  position: relative;
  margin: 42px 0 50px;
  border: 1px solid #cbb99b;
  background: #f7f0e4;
  color: #302c27;
  box-shadow: 0 18px 46px rgba(55, 43, 27, .11);
  overflow: hidden;
}

.did * {
  box-sizing: border-box;
  min-width: 0;
  overflow-wrap: anywhere;
}

.did-state {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.did-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, .38fr);
  gap: 32px;
  padding: 35px 40px 28px;
  border-top: 6px solid var(--did-rust);
  border-bottom: 1px solid #d5c4a8;
  background: radial-gradient(circle at 88% 16%, rgba(146, 112, 50, .2), transparent 36%), linear-gradient(135deg, #fffdf8, #eee3d0);
}

.did-kicker {
  display: block;
  margin-bottom: 8px;
  color: var(--did-rust);
  font: 800 .69rem/1.2 Arial, sans-serif;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.did-head h2 {
  margin: 0;
  color: var(--did-green);
  font: 700 clamp(1.76rem, 3.15vw, 2.95rem)/1 Georgia, serif;
  letter-spacing: -.025em;
  text-wrap: balance;
  hyphens: auto;
}

.did-head p {
  margin: 0;
  align-self: end;
  color: #655b4e;
  font-size: .91rem;
  line-height: 1.6;
}

.did-stage {
  display: none;
  padding: 30px 40px 36px;
}

.did-stage h3 {
  margin: 0 0 8px;
  color: var(--did-green);
  font: 700 clamp(1.35rem, 2.2vw, 1.95rem)/1.12 Georgia, serif;
  hyphens: auto;
}

.did-stage > .did-note {
  margin: 0 0 20px;
  color: #6b6052;
  font-size: .87rem;
  line-height: 1.55;
}

.did-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.did-choice {
  display: block;
  padding: 17px 18px;
  border: 1px solid #cdbb9d;
  background: #fffdf8;
  color: var(--did-green);
  cursor: pointer;
  font: 700 1rem/1.3 Georgia, serif;
  hyphens: auto;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.did-choice:hover {
  transform: translateY(-2px);
  border-color: var(--did-rust);
  box-shadow: 0 8px 18px rgba(72, 47, 25, .09);
}

.did-choice::after {
  content: " →";
  color: var(--did-rust);
}

.did-result {
  border: 1px solid #d0bfa6;
  background: #fffdf8;
}

.did-result-head {
  padding: 19px 21px;
  border-bottom: 1px solid #ded0b8;
  background: #e4ebe6;
}

.did-result-head span {
  display: block;
  margin-bottom: 5px;
  color: var(--did-rust);
  font: 800 .66rem/1.25 Arial, sans-serif;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.did-result-head strong {
  color: var(--did-green);
  font: 700 clamp(1.28rem, 2vw, 1.75rem)/1.15 Georgia, serif;
  hyphens: auto;
}

.did-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.did-result-grid div {
  padding: 18px 19px;
}

.did-result-grid div + div {
  border-left: 1px solid #ded0b8;
}

.did-result-grid b {
  display: block;
  margin-bottom: 8px;
  color: var(--did-rust);
  font: 800 .65rem/1.25 Arial, sans-serif;
  letter-spacing: .065em;
  text-transform: uppercase;
}

.did-result-grid div:nth-child(2) b { color: var(--did-green); }
.did-result-grid div:nth-child(3) b { color: var(--did-gold); }

.did-result-grid p {
  margin: 0;
  color: #575148;
  font-size: .83rem;
  line-height: 1.55;
}

.did-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.did-back {
  display: inline-block;
  padding: 11px 14px;
  border: 1px solid #bda989;
  background: #fffaf1;
  color: var(--did-green);
  cursor: pointer;
  font: 800 .68rem/1.2 Arial, sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.did-back:hover {
  border-color: var(--did-rust);
  color: var(--did-rust);
}

.did-state:focus-visible ~ .did-body label[for] {
  outline: 3px solid rgba(166, 75, 45, .32);
  outline-offset: 2px;
}

.did-state#did-start:checked ~ .did-body [data-did-stage="start"],
.did-state#did-land:checked ~ .did-body [data-did-stage="land"],
.did-state#did-armour:checked ~ .did-body [data-did-stage="armour"],
.did-state#did-pterosaur:checked ~ .did-body [data-did-stage="pterosaur"],
.did-state#did-marine:checked ~ .did-body [data-did-stage="marine"],
.did-state#did-fragment:checked ~ .did-body [data-did-stage="fragment"],
.did-state#did-sauropod:checked ~ .did-body [data-did-stage="sauropod"],
.did-state#did-ceratopsia:checked ~ .did-body [data-did-stage="ceratopsia"],
.did-state#did-pachy:checked ~ .did-body [data-did-stage="pachy"],
.did-state#did-ornithopod:checked ~ .did-body [data-did-stage="ornithopod"],
.did-state#did-theropod:checked ~ .did-body [data-did-stage="theropod"],
.did-state#did-uncertain:checked ~ .did-body [data-did-stage="uncertain"],
.did-state#did-stegosaur:checked ~ .did-body [data-did-stage="stegosaur"],
.did-state#did-ankylosaur:checked ~ .did-body [data-did-stage="ankylosaur"],
.did-state#did-thyreophora:checked ~ .did-body [data-did-stage="thyreophora"] {
  display: block;
}

@media (max-width: 850px) {
  .did-head { grid-template-columns: 1fr; padding: 28px 22px 22px; }
  .did-stage { padding: 25px 22px 29px; }
  .did-result-grid { grid-template-columns: 1fr; }
  .did-result-grid div + div { border-left: 0; border-top: 1px solid #ded0b8; }
}

@media (max-width: 560px) {
  .did-choices { grid-template-columns: 1fr; }
  .did-head h2 { font-size: 1.68rem; }
  .did-choice { font-size: .96rem; }
}
