/* The four stages share a dark, tactile case desk. */
.murdle-page {
  --m-paper: #26302e;
  --m-ink: #d5d1c5;
  --m-line: #69746270;
  --m-red: #baa27b;
  --m-soft: #344039;
}
.murdle-page .murdle-heading h1,
.murdle-page .murdle-ending h1 {
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  font-weight: 500;
  letter-spacing: .045em;
}
.murdle-page .murdle-opening {
  padding: 28px;
  background: linear-gradient(130deg, #29332ef7, #1f2928f7);
  border-color: #a493695e;
  box-shadow: 0 20px 60px #070e1855, inset 0 1px #c5b18119;
}
.murdle-opening-display {
  display: grid; grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
  gap: 28px; align-items: stretch;
}
.murdle-objects, .murdle-suspects { min-width: 0; display: flex; flex-direction: column; }
.murdle-page .murdle-opening-label {
  margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid #9c957943;
  color: #c7b995; font-size: .9375rem; line-height: 1.65;
  font-weight: 500; letter-spacing: .1em;
}
.murdle-props {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
  flex: 1; align-items: center; padding: 22px 16px;
  background: radial-gradient(ellipse at 50% 48%, #66704a21, transparent 80%), #1c2825;
  border: 1px solid #7d87624f; box-shadow: inset 0 2px 18px #101c193d;
}
.murdle-prop-card {
  min-width: 0; width: 100%; max-width: 154px; justify-self: center;
  margin: 0; padding: 5px; background: #243028;
  border: 1px solid #8d805d68; box-shadow: 0 7px 16px #08110f33;
}
/* Reuse the approved image intact; CSS isolates each drawing without its baked label. */
.murdle-prop-art {
  display: block; width: 100%; aspect-ratio: 438 / 670;
  background: #222b23 url("assets/murdle-props.webp") var(--prop-x) 28.24859% / 350.68493% auto no-repeat;
}
.murdle-prop-card figcaption {
  min-height: 48px; display: grid; place-items: center; padding: 11px 2px 7px;
  border-top: 1px solid #9a89614d; text-align: center; color: #d1bea0;
  font: 500 1rem/1.65 "Songti SC", "Noto Serif CJK SC", serif;
}
.murdle-page .murdle-cast { grid-template-columns: 1fr; gap: 10px; flex: 1; }
.murdle-page .murdle-cast article {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px; align-items: center; min-width: 0;
  padding: 11px 15px 11px 11px; border: 1px solid #8d917146;
  background: linear-gradient(100deg, #35423877, #26332b33);
}
.murdle-page .murdle-cast-image { border-color: #aa966e88; box-shadow: 0 4px 14px #0a15193d; }
.murdle-cast-copy { min-width: 0; }
.murdle-page .murdle-cast h3 {
  font-family: "Songti SC", "Noto Serif CJK SC", serif;
  color: #d9c7a5; font-size: 1.1875rem; line-height: 1.6; font-weight: 500; margin: 0 0 7px;
}
.murdle-page .murdle-cast p { margin: 0; font-size: 1rem; line-height: 1.8; color: #c4c9ba; }
.murdle-page .murdle-invitation { margin-top: 25px; padding-top: 23px; align-items: center; }
.murdle-page .murdle-invitation > p { margin: 0; font-size: 1.1875rem; line-height: 1.7; letter-spacing: .02em; gap: 24px; }
.murdle-page .murdle-invitation .murdle-primary { min-width: 166px; min-height: 50px; }
.murdle-page .murdle-primary {
  background: linear-gradient(140deg, #536047, #3d4c3f);
  border-color: #a298718c; color: #ddd1b7;
  box-shadow: inset 0 1px #d1c19715, 0 4px 14px #111c1922;
}
.murdle-page .murdle-primary:hover { background: #536149; }

/* The experiment flow separates review-and-lock from the spoiler reveal. */
.murdle-progress.experiment-progress-four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.murdle-judgment { max-width: 1160px; margin: 0 auto; }
.murdle-judgment-heading { max-width: 820px; margin-bottom: 24px; }
.murdle-page .murdle-judgment-heading h1 {
  margin: 10px 0 12px; color: #ddcfb2;
  font: 500 clamp(2rem, 4vw, 3rem)/1.4 "Songti SC", "Noto Serif CJK SC", serif;
  letter-spacing: .045em;
}
.murdle-judgment-heading p { color: #c4c8ba; }
.murdle-judgment-ready {
  display: flex; align-items: baseline; justify-content: space-between; gap: 18px;
  margin-bottom: 0; padding: 18px 23px;
  border: 1px solid #a58f6157; border-bottom: 0;
  background: linear-gradient(100deg, #4d503763, #29342e);
}
.murdle-judgment-ready strong {
  color: #e0c99e; font: 500 1.18rem/1.7 "Songti SC", "Noto Serif CJK SC", serif;
}
.murdle-judgment-ready span { color: #bfc4b4; font-size: .9375rem; }
.murdle-page .murdle-judgment-board {
  padding: 28px; border: 1px solid #a58f6157;
  background: linear-gradient(125deg, #29352f, #202b29);
  box-shadow: 0 24px 65px #080f1650, inset 0 1px #c7bb8914;
}
.murdle-judgment .murdle-verdict { grid-column: 1 / -1; margin-top: 2px; padding: 22px; }
.murdle-judgment .murdle-verdict h2 { color: #ddc99f; font-size: 1.2rem; }
.murdle-judgment .murdle-answer-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.village-page .murdle-judgment .murdle-answer-fields,
.backlot-page .murdle-judgment .murdle-answer-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.murdle-judgment-actions { display: flex; margin-top: 18px; }
.murdle-page .murdle-judgment-actions button { color: #cdb991; }

/* Clues first, source cards below; the notebook stays alongside them. */
.murdle-page .murdle-rules {
  background: #26312dec; padding: 17px 25px; border-color: #8d957262;
}
.murdle-page .murdle-rules p { font-size: .9rem; line-height: 1.75; }
.murdle-page .murdle-workbench {
  grid-template-columns: minmax(290px, .85fr) minmax(0, 1.45fr);
  border-color: #8d957262;
  background: linear-gradient(125deg, #29352f, #202b29);
  box-shadow: 0 24px 65px #080f1650, inset 0 1px #c7bb8914;
}
.murdle-page .murdle-evidence {
  display: block; padding: 26px; border-right: 1px solid #818d6c55;
  border-bottom: 0; background: #1e2a274a;
}
.murdle-page .murdle-evidence > .murdle-clues {
  margin: 0; padding: 0; border-top: 0;
}
.murdle-page .murdle-evidence h2,
.murdle-page .murdle-notebook h2 { font-size: 1.2rem; color: #d6c6a7; }
.murdle-page .murdle-clues ol { margin-top: 14px; }
.murdle-page .murdle-clues li { padding: 13px 0; gap: 13px; border-color: #83917540; }
.murdle-page .murdle-clues li > span {
  width: 25px; height: 25px; line-height: 23px;
  border-color: #a28f63; color: #dbc39a; background: #ad976713;
}
.murdle-page .murdle-clues li p { font-size: 1rem; line-height: 1.8; }
.murdle-page .murdle-evidence .murdle-reference {
  border-top: 1px solid #84917155; margin-top: 25px; padding-top: 25px;
}
.murdle-page .murdle-reference-cards { min-height: 0; }
.murdle-page .murdle-reference-cards article {
  display: grid; grid-template-columns: 96px minmax(0, 1fr);
  align-items: start; gap: 15px; padding: 18px 0;
}
.murdle-card-image {
  display: block; width: 100%; height: auto; aspect-ratio: 1;
  object-fit: cover; background: #202922; border: 1px solid #9c936b66;
  box-shadow: 0 4px 12px #09131033;
}
.murdle-object-image { display: grid; place-items: center; }
.murdle-object-image .murdle-prop-art { width: 65.37313%; }
.murdle-page .murdle-reference-cards article > div { min-width: 0; }
.murdle-page .murdle-reference-cards h3 { font-size: 1rem; color: #cfc9b6; }
.murdle-page .murdle-reference-cards p { font-size: 1rem; line-height: 1.8; }
.murdle-page .murdle-traits { font-size: .875rem; color: #aebaa9; }
.murdle-page .murdle-reference-tabs button[aria-pressed=true] {
  background: #75805f28; border-bottom-color: #bca475;
}
.murdle-page .murdle-notebook { min-width: 0; padding: 24px; background: #1b262429; }
.murdle-notebook-tools { margin-bottom: 22px; }
.murdle-page .murdle-notebook-title { margin: 0 0 16px; align-items: center; }
.murdle-page .murdle-notebook-title button { font-size: .875rem; padding: 9px 13px; }
.murdle-page button:disabled { opacity: .42; cursor: default; }
.murdle-page .murdle-grid-help { margin: 11px 0 0; font-size: .875rem !important; }
.murdle-workbench-tabs, .murdle-panel-tabs { display: none; }

/* All three relationships remain visible on desktop. */
.murdle-page .murdle-grid-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start; gap: 24px 20px; max-width: none; margin: 0;
}
.murdle-page .murdle-grid { font-size: .89rem; }
.murdle-page .murdle-grid caption {
  color: #c6b694; font-size: .9rem; margin-bottom: 13px;
  padding-bottom: 9px; border-bottom: 1px solid #8791734d;
}
.murdle-page .murdle-grid thead th {
  height: auto; font-size: .86rem; padding: 0 3px 10px; line-height: 1.6;
}
.murdle-page .murdle-grid thead td,
.murdle-page .murdle-grid tbody th { width: 52px; }
.murdle-page .murdle-grid tbody th { font-size: .87rem; line-height: 1.6; padding-right: 8px; }
.murdle-page .murdle-grid tbody td {
  height: 54px; background: #233029; border-color: #7a89686b;
}
.murdle-page .murdle-cell, .murdle-page .murdle-static-cell {
  height: 54px; min-height: 54px; font: 1.9rem/1 Georgia, serif; color: #d6d0bb;
}
.murdle-page .murdle-cell { cursor: pointer; touch-action: manipulation; }
.murdle-page .murdle-cell:focus-visible {
  position: relative; z-index: 1; outline: 2px solid #c6b37f; outline-offset: -3px;
}
.murdle-page .murdle-grid td.is-yes { background: #3e5141; }
.murdle-page .murdle-grid td.is-no { background: #473c33; }
.murdle-page .murdle-grid td.is-no .murdle-cell,
.murdle-page .murdle-grid td.is-no .murdle-static-cell { color: #c8af95; }
.murdle-page .murdle-grid tr:has(.murdle-cell:is(:hover,:focus-visible)) > th,
.murdle-page .murdle-grid:has(td:nth-child(2) .murdle-cell:is(:hover,:focus-visible)) thead th:nth-child(2),
.murdle-page .murdle-grid:has(td:nth-child(3) .murdle-cell:is(:hover,:focus-visible)) thead th:nth-child(3),
.murdle-page .murdle-grid:has(td:nth-child(4) .murdle-cell:is(:hover,:focus-visible)) thead th:nth-child(4) {
  color: #e1c696; background: #b59f6421;
}
.murdle-page .murdle-verdict {
  margin: 0; padding: 17px; border: 1px solid #9b95645c;
  background: linear-gradient(140deg, #3e48353d, #232e27);
}
.murdle-page .murdle-verdict h2 { font-size: 1.1rem; }
.murdle-page .murdle-answer-fields { grid-template-columns: 1fr; gap: 11px; margin: 16px 0; }
.murdle-page .murdle-answer-fields label {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px;
  font-size: .86rem; color: #bfc5b0;
}
.murdle-page .murdle-answer-fields select {
  font-size: .9rem; background: #26382d; color: #d6d0bc; border-color: #83906b6b;
}
.murdle-page .murdle-verdict .murdle-primary { width: 100%; font-size: .88rem; padding: 11px 8px; }

/* The reveal uses the same materials, with a stronger visual hierarchy. */
.murdle-page .murdle-answer-key {
  gap: 1px; padding: 0; border-color: #aa986754;
  background: #8079585c; box-shadow: 0 10px 35px #101b1940;
}
.murdle-page .murdle-answer-key > div {
  padding: 25px 28px; min-width: 0;
  background: linear-gradient(135deg, #3b4433, #28362e);
}
.murdle-page .murdle-answer-key span { color: #afb8a1; font-size: .83rem; margin-bottom: 11px; }
.murdle-page .murdle-answer-key strong { color: #dbc69f; font-size: 1.4rem; }
.murdle-page .murdle-reconstruction {
  grid-template-columns: minmax(0,.85fr) minmax(0,1.25fr); gap: 0; padding: 0;
  border: 1px solid #9a92604d; background: #26312c;
  box-shadow: 0 20px 50px #0c161b44;
}
.murdle-deduction-copy { padding: 30px; background: linear-gradient(130deg, #303b30, #273229); }
.murdle-page .murdle-deduction-copy > h2 { font: 1.3rem/1.7 "Songti SC", serif; color: #ccbf9f; }
.murdle-page .murdle-deduction-copy > h3 {
  font: 500 1.6rem/1.6 "Songti SC", serif; color: #e0c69c;
  margin: 24px 0 16px; padding-left: 15px; border-left: 2px solid #c2a16c;
}
.murdle-page .murdle-deduction-copy > p { font-size: 1.03rem; line-height: 1.95; }
.murdle-page .murdle-step-tabs { gap: 10px; margin: 23px 0; }
.murdle-page .murdle-step-tabs button { flex: 1; min-height: 46px; background: #243029; border-color: #8b936654; }
.murdle-page .murdle-step-tabs button[aria-pressed=true] {
  background: #586045; border-color: #b19c69; color: #e1cfa6; box-shadow: inset 0 -2px #c0a570;
}
.murdle-page .murdle-solution-grid { padding: 30px; border: 0; border-left: 1px solid #83916d4d; background: #1d2a263d; }
.murdle-page .murdle-solution-grid h2 { font-size: 1.2rem; color: #d5c9ab; }
.murdle-page .murdle-solution-grid .murdle-grid-layout:has(>table:only-child) { grid-template-columns: 1fr; max-width: 390px; margin: 28px auto; }
.murdle-page .murdle-takeaway { background: linear-gradient(120deg, #354233, #28352e); border-color: #bda16c; }

@media(max-width:980px) {
  .murdle-opening-display { grid-template-columns: 1fr; gap: 26px; }
  .murdle-props { width: 100%; max-width: none; margin: 0; padding: 21px; }
  .murdle-prop-card { max-width: 150px; }
  .murdle-page .murdle-workbench { display: block; }
  .murdle-workbench-tabs {
    position: sticky; top: 0; z-index: 5; display: flex;
    padding: 9px 16px; gap: 10px; background: #222f28;
    border-bottom: 1px solid #8d95644d;
  }
  .murdle-page .murdle-workbench-tabs button { flex: 1; border-color: #85906866; background: transparent; }
  .murdle-page .murdle-workbench-tabs button[aria-pressed=true] { background: #4a5942; color: #dfcca9; border-color: #b29d6c; }
  .murdle-workbench[data-workspace=evidence] > .murdle-notebook,
  .murdle-workbench[data-workspace=notebook] > .murdle-evidence { display: none; }
  .murdle-page .murdle-evidence { padding: 24px; border: 0; }
  .murdle-page .murdle-notebook { padding: 20px 24px 24px; }
  .murdle-page .murdle-jump { display: block; width: 100%; margin-top: 23px; padding: 12px; border: 1px solid #91956877; background: #394b37; text-decoration: none; }
  .murdle-page .murdle-reconstruction { grid-template-columns: 1fr; }
  .murdle-page .murdle-solution-grid { border: 0; border-top: 1px solid #83916d4d; }
}

@media(max-width:680px) {
  .murdle-progress.experiment-progress-four { margin-bottom: 23px; }
  .murdle-page .murdle-progress.experiment-progress-four button { padding: 9px 1px 10px; font-size: .78rem; line-height: 1.35; }
  .murdle-progress.experiment-progress-four span { display: block; margin: 0 0 2px; font-size: .68rem; }
  .murdle-judgment-heading { margin-bottom: 18px; padding: 0 4px; }
  .murdle-page .murdle-judgment-heading h1 { font-size: 2rem; }
  .murdle-judgment-heading p { font-size: .9375rem; }
  .murdle-judgment-ready { display: block; padding: 16px 17px; }
  .murdle-judgment-ready strong, .murdle-judgment-ready span { display: block; }
  .murdle-judgment-ready strong { font-size: 1.08rem; }
  .murdle-judgment-ready span { margin-top: 5px; font-size: .875rem; }
  .murdle-page .murdle-judgment-board { padding: 18px 14px; }
  .murdle-judgment .murdle-answer-fields,
  .village-page .murdle-judgment .murdle-answer-fields,
  .backlot-page .murdle-judgment .murdle-answer-fields { grid-template-columns: 1fr; }
  .murdle-judgment-actions button { width: 100%; }
  .murdle-page .murdle-opening { padding: 16px; }
  .murdle-page .murdle-opening-label { margin-bottom: 14px; padding-bottom: 10px; }
  .murdle-props { gap: 8px; padding: 12px 9px; }
  .murdle-prop-card { padding: 3px; }
  .murdle-prop-card figcaption { min-height: 48px; font-size: .9375rem; padding: 8px 1px 4px; }
  .murdle-page .murdle-cast article { grid-template-columns: 88px minmax(0,1fr); gap: 13px; padding: 10px; }
  .murdle-page .murdle-cast h3 { font-size: 1.125rem; line-height: 1.65; margin-bottom: 5px; }
  .murdle-page .murdle-cast p { font-size: 1rem; line-height: 1.85; }
  .murdle-page .murdle-reference-cards article { grid-template-columns: 84px minmax(0,1fr); gap: 13px; }
  .murdle-page .murdle-invitation > p { font-size: 1.0625rem; gap: 12px; margin-bottom: 17px; }
  .murdle-page .murdle-rules { padding: 16px 20px; }
  .murdle-page .murdle-rules p { font-size: .85rem; }
  .murdle-page .murdle-evidence { padding: 22px 20px; }
  .murdle-page .murdle-notebook { padding: 18px; }
  .murdle-page .murdle-clues li p { font-size: .95rem; }
  .murdle-page .murdle-notebook-tools {
    padding: 12px 0 16px;
    background: #26312c; margin: -6px 0 16px;
  }
  .murdle-page .murdle-grid-help { font-size: .875rem !important; }
  .murdle-panel-tabs { display: flex; gap: 6px; margin-top: 18px; }
  .murdle-page .murdle-panel-tabs button { flex: 1; min-width: 0; font-size: .76rem; padding: 9px 3px; border: 0; border-bottom: 2px solid transparent; }
  .murdle-page .murdle-panel-tabs button[aria-pressed=true] { border-color: #c0a570; color: #ddc49a; background: #64714826; }
  .murdle-notebook .murdle-grid[data-active=false] { display: none; }
  .murdle-page .murdle-grid-layout { grid-template-columns: 1fr; gap: 25px; }
  .murdle-page .murdle-grid-lp { grid-column: auto; }
  .murdle-page .murdle-notebook .murdle-grid caption { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); border: 0; }
  .murdle-page .murdle-grid thead th { font-size: .9rem; }
  .murdle-page .murdle-grid thead td, .murdle-page .murdle-grid tbody th { width: 62px; }
  .murdle-page .murdle-grid tbody th { font-size: .92rem; }
  .murdle-page .murdle-cell, .murdle-page .murdle-static-cell, .murdle-page .murdle-grid tbody td { height: 56px; min-height: 56px; }
  .murdle-page .murdle-verdict { margin-top: 3px; padding: 20px; }
  .murdle-page .murdle-answer-fields label { grid-template-columns: 1fr; align-items: center; gap: 6px; }
  .murdle-page .murdle-answer-fields select { font-size: .92rem; }
  .murdle-page .murdle-answer-key { grid-template-columns: 1fr; }
  .murdle-page .murdle-answer-key > div { padding: 19px 23px; grid-template-columns: 64px minmax(0,1fr); gap: 14px; }
  .murdle-page .murdle-answer-key span { margin: 0; }
  .murdle-page .murdle-answer-key strong { font-size: 1.2rem; }
  .murdle-deduction-copy, .murdle-page .murdle-solution-grid { padding: 24px 20px; }
  .murdle-page .murdle-deduction-copy > h3 { font-size: 1.35rem; }
  .murdle-page .murdle-deduction-copy > p { font-size: .98rem; }
  .murdle-page .murdle-solution-grid .murdle-notebook-title { flex-wrap: wrap; gap: 10px; }
}
