.case-map-link { margin-top: 10px; }
.case-page .page-lead { margin-bottom: 20px; }
.case-layout { display: grid; grid-template-columns: minmax(0, 1.07fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.case-panel {
  min-width: 0; padding: 17px; border: 1px solid #6e4c33; border-radius: 8px;
  background: linear-gradient(135deg, #261b15, #191410 70%);
}
.case-subhead { display: flex; flex-wrap: wrap; gap: 5px 10px; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.case-subhead h2 { font-size: clamp(19px, 2.1vw, 25px); color: #f2d7aa; }
.case-subhead > span { color: #d2b288; font-size: 12px; }
.case-clue-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.case-clue {
  min-width: 0; display: grid; grid-template-rows: auto 1fr auto; gap: 3px; width: 100%;
  overflow: hidden; padding: 0 0 7px; text-align: left; border: 1px solid #715239; border-radius: 6px;
  background: #261b14; color: #f1d8b4; transition: background .16s ease, border-color .16s ease, transform .16s ease;
}
.case-clue:is(:hover, :focus-visible) { border-color: #e0ba7a; background: #38271b; }
.case-clue:active, .case-record-choice:active, .case-rule-out:active { transform: translateY(1px); }
.case-clue[aria-pressed="true"] { border-color: #dbac6e; background: #39271a; }
.case-clue.review-clue { border-color: #c97759; }
.case-clue-image { position: relative; display: block; overflow: hidden; }
.case-clue-image img { width: 100%; height: clamp(61px, 10vw, 119px); object-fit: cover; transition: transform .24s ease; }
.case-clue:is(:hover, :focus-visible) img { transform: scale(1.055); }
.case-clue-image svg {
  position: absolute; right: 5px; bottom: 6px; box-sizing: content-box; padding: 4px;
  border: 1px solid #b78958b3; border-radius: 50%; color: #ffe0a7; background: #21130edf;
}
.case-clue > strong { padding: 1px 7px 0; font-size: 13px; }
.case-clue > small { padding-inline: 7px; color: #c7a782; font-size: 11px; }
.case-inspection {
  margin-top: 12px; padding: 10px 11px; border: 1px solid #6c4d336b; border-radius: 7px;
  background: #1c140f;
}
.case-inspection-empty, .case-lantern > p, .case-discovery p { color: #d0b99c; font-size: 13px; }
.case-discovery h3 { margin-bottom: 5px; color: #efd2a5; font: 700 17px var(--serif); }
.case-paper {
  position: relative; isolation: isolate; overflow: hidden; height: clamp(156px, 21vw, 205px); margin-block: 8px;
  border: 1px solid #9f7447; border-radius: 4px;
  background: url("../assets/illustrations/gold-grain.svg") 0 0 / 112px 112px,
    radial-gradient(ellipse at 20% 48%, #6e4c33 0, transparent 43%),
    radial-gradient(ellipse at 72% 58%, #5d4131, transparent 31%),
    linear-gradient(125deg, #8a6645, #b79a6a 53%, #75533a);
  box-shadow: inset 0 0 23px #3b261eb8;
  cursor: crosshair;
}
.case-paper-lines {
  position: absolute; inset: 14px 16px;
  border: 1px solid #4b2f24a2; opacity: .66;
  background: repeating-linear-gradient(0deg, transparent 0 23px, #4f322659 23px 24px),
    linear-gradient(90deg, transparent 49.5%, #412819ab 50%, #debd8229 50.4%, transparent 51%);
}
.case-paper::before {
  position: absolute; z-index: 1; inset: 0; content: ""; pointer-events: none;
  background: radial-gradient(92px circle at var(--lens-x, var(--pointer-x, 50%)) var(--lens-y, var(--pointer-y, 40%)), #fff1b88e, #f1c78138 43%, transparent 95%);
  opacity: 0; transition: opacity .18s ease;
}
.case-paper:is(:hover,:focus-within)::before { opacity: 1; }
.case-paper:has(.paper-check[data-id="edge"]:focus-visible) { --lens-x: 22%; --lens-y: 51%; }
.case-paper:has(.paper-check[data-id="crease"]:focus-visible) { --lens-x: 50%; --lens-y: 37%; }
.case-paper:has(.paper-check[data-id="corner"]:focus-visible) { --lens-x: 76%; --lens-y: 70%; }
.case-paper-ink {
  position: absolute; z-index: 2; inset: 0; pointer-events: none; opacity: 0;
  mask-image: radial-gradient(70px circle at var(--lens-x, var(--pointer-x, 50%)) var(--lens-y, var(--pointer-y, 40%)), #000 40%, transparent 94%);
}
.case-paper:is(:hover, :focus-within) .case-paper-ink { opacity: 1; }
.case-paper.seal-found .case-paper-ink { mask-image: none; opacity: 1; }
.case-paper-ink i {
  position: absolute; left: calc(76% - 17px); top: calc(70% - 37px); width: 34px; height: 4px;
  background: #702c24; box-shadow: 0 1px 0 #f0c9874a; transform: rotate(-7deg);
}
.case-paper-ink i:last-child { top: calc(70% - 26px); }
.paper-check {
  position: absolute; z-index: 3; left: var(--zone-x); top: var(--zone-y); transform: translate(-50%, -50%);
  display: grid; justify-items: center; gap: 2px; min-width: 62px; min-height: 55px; padding: 0; place-content: center;
  border: 1px solid transparent; border-radius: 8px; color: #f5dbab; background: transparent; cursor: crosshair;
}
.paper-check > span {
  width: 12px; height: 12px; border-radius: 50%; border: 1px solid #f4d8a2;
  box-shadow: 0 0 0 2px #38241d70; background: #7243328f;
}
.paper-check small { padding: 1px 3px; border-radius: 2px; background: #362318cf; font-size: 10px; }
.paper-check:is(:hover, :focus-visible) { border-color: #f0d6a7b0; background: #e3b57b14; }
.paper-check:is(:hover, :focus-visible) > span { box-shadow: 0 0 0 3px #f1cf8b55; }
.case-lantern .case-glance { min-height: 22px; color: #e9c38f; }

.case-records { display: grid; gap: 7px; }
.case-record { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: stretch; border-radius: 6px; }
.case-record-choice, .case-rule-out {
  min-width: 0; min-height: 48px; color: #eddbc0;
  border: 1px solid #6b4b31; background: #2b1f17; transition: background .16s ease, border-color .16s ease;
}
.case-record-choice {
  display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 6px 0 0 6px; text-align: left;
}
.case-record-choice > span:nth-child(2) { display: grid; gap: 2px; }
.case-record-choice strong { font-size: 13px; }
.case-record-choice small { color: #c3a581; font-size: 11px; line-height: 1.35; }
.case-letter { display: grid; place-items: center; width: 23px; height: 23px; border: 1px solid #ad7a4b; border-radius: 50%; color: #f3ce91; font: 700 11px var(--latin-serif); }
.case-rule-out { min-width: 46px; padding: 3px 7px; color: #e9c38d; border-inline-start: 0; border-radius: 0 6px 6px 0; font-size: 11px; }
.case-record-choice:is(:hover, :focus-visible):not(:disabled), .case-rule-out:is(:hover, :focus-visible) { border-color: #d8aa6e; background: #433020; }
.case-record-choice[aria-pressed="true"] { border-color: #d9a366; background: #483321; }
.case-record-choice:disabled { color: #9f8d77; background: #201914; cursor: default; }
.case-record-choice:disabled strong { text-decoration: line-through; }
.case-record-choice:disabled small, .case-record-choice:disabled .case-letter { color: #a18a72; }
.case-submit { margin-top: 13px; }
.case-feedback { min-height: 25px; margin-top: 8px; color: #d9b789; font-size: 12px; }
.case-setting { margin-top: 12px; color: #ac967c; font-size: 11px; }
.case-finale { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 16px; align-items: start; }
.case-paper-receipt {
  position: relative; padding: 23px 21px; color: #4c3426;
  border: 1px solid #ca9e64; border-radius: 6px; background: url("../assets/illustrations/gold-grain.svg") 0 0 / 115px 115px, linear-gradient(135deg, #e9d7a7, #d1b47c);
  box-shadow: inset 0 0 0 4px #6a3f2820; animation: receipt-appear .38s ease-out;
}
.receipt-label { font-size: 12px; color: #644531; }
.receipt-mark {
  position: absolute; right: 14px; top: 15px; width: 43px; height: 43px; padding-top: 4px;
  color: #812d22; border: 2px solid #8a3026; font: 700 12px/1.2 var(--serif); text-align: center; transform: rotate(7deg);
}
.case-paper-receipt h2 { margin-block: 7px; padding-right: 39px; font-size: clamp(23px, 3.5vw, 39px); color: #3b271f; }
.case-paper-receipt p:not(.receipt-label) { font-size: 13px; }
.receipt-route { display: flex; flex-wrap: wrap; gap: 6px; margin-block: 10px; padding: 0; list-style: none; color: #672f23; font-size: 12px; }
.receipt-route li:not(:last-child)::after { content: " →"; margin-inline-start: 4px; }
.case-after { padding: 18px; border: 1px solid #77563d; border-radius: 8px; background: var(--card); }
.case-after h3 { font: 700 20px var(--serif); color: #edcda6; }
.case-after p { margin-block: 7px 13px; color: var(--muted); font-size: 13px; }
.case-after .inline-link { margin-inline-start: 4px; font-size: 12px; }

@keyframes receipt-appear { from { opacity: .3; transform: translateY(7px); } to { opacity: 1; transform: none; } }
@media (max-width: 850px) {
  .case-layout, .case-finale { grid-template-columns: minmax(0, 1fr); }
  .case-panel { padding: 12px; }
}
@media (max-width: 400px) {
  .case-clue > strong { font-size: 12px; padding-inline: 5px; }
  .case-clue > small { padding-inline: 5px; }
  .case-inspection { padding-inline: 8px; }
  .case-record-choice { grid-template-columns: 23px minmax(0, 1fr); gap: 5px; padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .case-paper-receipt { animation: none; }
  .case-clue, .case-clue-image img, .case-paper::before, .case-record-choice, .case-rule-out { transition: none; }
}
