.detective-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  grid-template-areas: "plate heading" "plate play";
  grid-template-rows: auto 1fr;
  align-items: start;
  gap: 1.25rem clamp(1.5rem, 4vw, 3.5rem);
}

.detective-heading { grid-area: heading; }
.detective-play { grid-area: play; }

.detective-kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .45rem 1rem;
  margin-bottom: .65rem;
}

.detective-kicker > span {
  padding-left: .85rem;
  border-left: 1px solid currentColor;
  color: var(--rust);
  font-size: .78rem;
}

.detective-heading h2 {
  font-size: clamp(1.9rem, 4vw, 3.15rem);
  overflow-wrap: anywhere;
}

.detective-plate {
  --detective-max-height: 29rem;
  grid-area: plate;
  margin: 0;
  min-width: 0;
}

.detective-mat {
  display: grid;
  justify-items: center;
  background: #ebe7db;
  border: 1px solid #d6d0bd;
  border-radius: .25rem;
  padding: clamp(.65rem, 2vw, 1.15rem);
}

.detective-art {
  position: relative;
  width: min(100%, calc(var(--detective-max-height) * var(--detective-ratio)));
}

.detective-art img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.detective-mask {
  position: absolute;
  inset: 80.6% auto auto 6.3%;
  width: 19%;
  height: 5.3%;
  border: 1px solid #fffefa;
  border-radius: .12rem;
  background: #285a42;
  pointer-events: none;
}

.detective-art img[hidden] + .detective-mask { display: none; }
.detective-missing { padding: .75rem 0; }
.detective-plate figcaption { margin-top: .45rem; }

.detective-text {
  margin-top: .45rem;
  color: var(--muted);
}

.detective-text summary {
  width: fit-content;
  min-height: 44px;
  align-content: center;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.detective-text p { padding: .15rem 0 .4rem; }
.detective-text summary:focus-visible,
.detective-layout [tabindex="-1"]:focus-visible,
.detective-summary [tabindex="-1"]:focus-visible {
  outline: 2px solid var(--rust);
  outline-offset: .2rem;
}

.detective-play .game-options {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  margin-top: 1rem;
}

.detective-play .game-options .chip {
  min-height: 44px;
  padding: .65rem .9rem;
  text-align: left;
  white-space: normal;
}

.detective-help .chip { min-height: 44px; }

.detective-clue {
  margin-top: .75rem;
  padding: .65rem .85rem;
  border-left: 2px solid var(--rust);
  background: var(--paper);
}

.detective-clue strong { margin-right: .3rem; }

.detective-feedback > * + * { margin-top: .45rem; }

.detective-answer {
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1.2;
}

.detective-work { color: var(--muted); }

.detective-cues {
  padding-left: 1.4rem;
  margin-bottom: 0;
}

.detective-cues li + li { margin-top: .25rem; }

.detective-credit {
  margin-top: 1rem;
  padding-top: .7rem;
  border-top: 1px solid var(--line);
  overflow-wrap: anywhere;
}

.detective-credit h3 {
  margin-bottom: .3rem;
  font-size: .92rem;
  font-weight: 600;
}

.detective-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
  margin-top: .25rem;
  color: var(--green);
  font-size: .84rem;
}

.detective-links a {
  min-height: 44px;
  align-content: center;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.detective-summary > * + * { margin-top: 1rem; }

.detective-tally {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.detective-tally span {
  padding: .4rem .65rem;
  border: 1px solid var(--line);
  border-radius: .2rem;
  background: var(--mint);
}

@media (max-width: 760px) {
  .detective-layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "heading" "plate" "play";
    grid-template-rows: auto;
    gap: 1rem;
  }

  .detective-plate { --detective-max-height: 22rem; }
}
