/* ============ The Case of the Cluttered Case Files ============ */

:root {
  --ink: #2b2118;
  --ink-light: #5a4a3a;
  --paper: #f4ead2;
  --paper-dark: #e8dab8;
  --leather: #4a2c1a;
  --leather-dark: #331d10;
  --brass: #b08d3e;
  --brass-light: #d4b56a;
  --correct: #3a6b35;
  --wrong: #8b2f2f;
  --shadow: rgba(30, 20, 10, 0.45);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  color: var(--ink);
  background-color: var(--leather-dark);
  background-image:
    radial-gradient(ellipse at 50% 0%, rgba(212, 181, 106, 0.12), transparent 60%);
  min-height: 100vh;
  line-height: 1.75;
}

/* ---------- masthead ---------- */
.masthead {
  text-align: center;
  padding: 2rem 1rem 1rem;
  color: var(--brass-light);
}
.masthead h1 {
  font-variant: small-caps;
  letter-spacing: 0.08em;
  margin: 0.4rem 0;
  font-size: clamp(1.5rem, 4vw, 2.6rem);
  text-shadow: 0 2px 4px var(--shadow);
}
.subtitle {
  font-style: italic;
  margin: 0 0 0.6rem;
  color: #cbb88a;
}
.masthead-rule {
  height: 2px;
  max-width: 640px;
  margin: 0 auto;
  background: linear-gradient(90deg, transparent, var(--brass), transparent);
}

/* ---------- layout ---------- */
main {
  max-width: 860px;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}
.screen { display: none; }
.screen.active { display: block; }
.hidden { display: none !important; }

/* ---------- paper panels ---------- */
.paper {
  background: var(--paper);
  border: 1px solid #c9b98e;
  border-radius: 3px;
  box-shadow: 0 6px 18px var(--shadow), inset 0 0 60px rgba(176, 141, 62, 0.12);
  padding: 1.5rem 2rem;
  margin: 1.2rem 0;
}
.drop-cap::first-letter {
  font-size: 3.2em;
  float: left;
  line-height: 0.85;
  padding-right: 0.12em;
  color: var(--leather);
  font-weight: bold;
}
blockquote {
  font-style: italic;
  border-left: 3px solid var(--brass);
  margin: 1rem 0 0.2rem;
  padding-left: 1rem;
  color: var(--ink-light);
}

/* ---------- intro case cards ---------- */
.case-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.8rem;
  margin: 1.2rem 0;
}
.case-card {
  background: var(--paper-dark);
  border: 1px solid #c9b98e;
  border-radius: 3px;
  text-align: center;
  padding: 0.9rem 0.5rem;
  font-weight: bold;
  color: var(--leather);
  box-shadow: 0 3px 8px var(--shadow);
}
.case-card span { font-weight: normal; font-style: italic; font-size: 0.9em; }
.card-ic { display: block; width: 34px; height: 34px; margin: 0 auto 0.4rem; }

/* ---------- artwork ---------- */
.level-art { text-align: center; margin: 1.2rem 0 0; }
.scene-art {
  width: min(280px, 70vw);
  height: auto;
  filter: drop-shadow(0 4px 8px var(--shadow));
}
.seal-art { width: 110px; height: auto; }
.btn-ic { width: 1.1em; height: 1.1em; vertical-align: -0.18em; margin-left: 0.35em; }
.ic {
  width: 1.15em;
  height: 1.15em;
  vertical-align: -0.2em;
  margin-right: 0.4em;
  flex-shrink: 0;
}

/* ---------- buttons ---------- */
.controls { text-align: center; margin: 1.5rem 0; }
button {
  font-family: inherit;
  font-size: 1rem;
  cursor: pointer;
}
.btn-primary {
  background: linear-gradient(180deg, var(--brass-light), var(--brass));
  color: var(--leather-dark);
  border: 1px solid #8a6d2f;
  border-radius: 4px;
  padding: 0.7rem 1.8rem;
  font-weight: bold;
  font-size: 1.05rem;
  box-shadow: 0 3px 8px var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 5px 12px var(--shadow); }

/* ---------- level header ---------- */
.level-header {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: space-between;
  align-items: baseline;
  color: var(--brass-light);
  margin-top: 1rem;
}
.level-header h2 {
  font-variant: small-caps;
  margin: 0;
  text-shadow: 0 2px 4px var(--shadow);
}
.scorebox {
  background: var(--leather);
  border: 1px solid var(--brass);
  border-radius: 4px;
  padding: 0.3rem 0.9rem;
  font-weight: bold;
}

/* ---------- quiz options ---------- */
.question-text { font-weight: bold; margin-bottom: 0.4rem; }
.file-preview {
  background: #fffdf5;
  border: 1px dashed #b09a6a;
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 1rem;
  line-height: 1.7;
  white-space: pre-wrap;
}
.options { display: grid; gap: 0.6rem; margin: 1rem 0; }
.option-btn {
  text-align: left;
  background: var(--paper-dark);
  border: 1px solid #b09a6a;
  border-radius: 3px;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  line-height: 1.55;
  transition: background 0.15s, transform 0.1s;
}
.option-btn:hover:not(:disabled) { background: #f0e2bd; transform: translateX(4px); }
.option-btn:disabled { cursor: default; opacity: 0.85; }
.option-btn.correct { background: #d9e8d4; border-color: var(--correct); color: var(--correct); font-weight: bold; }
.option-btn.wrong { background: #ecd3d3; border-color: var(--wrong); color: var(--wrong); }
.option-btn code, .file-name code, .paper code { font-family: Consolas, "Courier New", monospace; font-weight: bold; font-size: 0.95em; }

/* ---------- feedback ---------- */
.feedback { border-left: 5px solid var(--brass); }
.feedback.good { border-left-color: var(--correct); }
.feedback.bad { border-left-color: var(--wrong); }
.feedback .holmes-says { font-weight: bold; font-variant: small-caps; color: var(--leather); }

/* ---------- drag & drop sorting ---------- */
.sort-area { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0; }
@media (max-width: 640px) { .sort-area { grid-template-columns: 1fr; } }

.file-pool, .folder {
  background: var(--paper);
  border: 1px solid #c9b98e;
  border-radius: 3px;
  padding: 0.8rem;
  min-height: 90px;
  box-shadow: 0 4px 10px var(--shadow);
}
.file-pool h3, .folder h3 {
  margin: 0 0 0.6rem;
  font-size: 1rem;
  font-variant: small-caps;
  color: var(--leather);
  border-bottom: 1px solid #c9b98e;
  padding-bottom: 0.3rem;
}
.folders { display: grid; gap: 1rem; }

.file-chip {
  display: flex;
  align-items: center;
  width: 100%;
  text-align: left;
  background: #fffdf5;
  border: 1px solid #b09a6a;
  border-radius: 3px;
  padding: 0.5rem 0.7rem;
  margin: 0.35rem 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
  line-height: 1.4;
  cursor: grab;
  transition: transform 0.1s, box-shadow 0.1s;
}
.file-chip span { overflow-wrap: anywhere; }
.file-chip:hover { transform: translateY(-1px); box-shadow: 0 2px 6px var(--shadow); }
.file-chip.selected { outline: 3px solid var(--brass); background: #fdf3d7; }
.file-chip.placed-right { background: #d9e8d4; border-color: var(--correct); cursor: default; }
.file-chip.placed-wrong { background: #ecd3d3; border-color: var(--wrong); }
.folder.drag-over { background: #f0e2bd; border-color: var(--brass); border-style: dashed; }
.folder .folder-hint { font-size: 0.82rem; font-style: italic; color: var(--ink-light); margin: 0 0 0.4rem; }
.sort-instructions { font-style: italic; color: #cbb88a; text-align: center; margin: 0.4rem 0; }

/* ---------- final exam (Case V) ---------- */
.exam-item.locked { opacity: 0.45; cursor: not-allowed; }
.exam-item.missed { background: #ecd3d3; border-color: var(--wrong); cursor: default; }
.exam-item.placed-right { cursor: default; }
.exam-outcomes {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.95rem;
}
.exam-outcomes li {
  padding: 0.35rem 0.6rem;
  margin: 0.3rem 0;
  border-radius: 3px;
  border: 1px solid;
}
.exam-outcomes li.good { background: #d9e8d4; border-color: var(--correct); color: var(--correct); }
.exam-outcomes li.bad { background: #ecd3d3; border-color: var(--wrong); color: var(--wrong); }

/* ---------- certificate ---------- */
.certificate {
  background: var(--paper);
  border: 4px double var(--brass);
  border-radius: 4px;
  box-shadow: 0 8px 24px var(--shadow), inset 0 0 80px rgba(176, 141, 62, 0.15);
  padding: 2rem 2.5rem;
  margin: 2rem 0 1rem;
  text-align: center;
}
.certificate h2 {
  font-variant: small-caps;
  letter-spacing: 0.1em;
  color: var(--leather);
  margin-top: 0;
  font-size: 1.9rem;
}
.cert-rule { height: 1px; background: linear-gradient(90deg, transparent, var(--brass), transparent); margin: 0.8rem 0 1.2rem; }
.certificate ul { text-align: left; display: inline-block; margin: 0.5rem auto 1rem; list-style: none; padding-left: 0; }
.certificate ul li { padding-left: 1.5em; position: relative; }
.certificate ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 0.65em;
  height: 0.65em;
  background: var(--brass);
  border: 1px solid #8a6d2f;
  transform: rotate(45deg);
}
.cert-score { font-size: 1.2rem; font-weight: bold; }
.cert-rank { font-style: italic; font-size: 1.1rem; color: var(--leather); }
.signature { font-style: italic; font-size: 1.15rem; margin-bottom: 0; }

/* ---------- progress dots ---------- */
.progress { text-align: center; color: #cbb88a; font-style: italic; margin: 0.3rem 0; }

footer { text-align: center; color: #8a7a5e; font-size: 0.85rem; padding-bottom: 2rem; }
