:root {
  color-scheme: dark;
  --ink: #e9dfca;
  --muted: #9caa9f;
  --deep: #10242f;
  --panel: #193440;
  --line: #3e5a5b;
  --coral: #e28362;
  --mint: #87c7b6;
  --gold: #d6b579;
  --serif: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --sans: "Segoe UI", Arial, sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html { background: #0d1c24; min-width: 320px; }
body {
  margin: 0;
  color: var(--ink);
  font: 15px/1.5 var(--sans);
  background: radial-gradient(ellipse at 52% 0%, #203a41 0, #0d1c24 62%);
  min-height: 100vh;
}
.shell { max-width: 1220px; margin: 0 auto; padding: 0 34px; }
.topbar { height: 86px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid rgba(218,202,165,.17); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 44px; height: 44px; border: 1px solid #73958c; border-radius: 50%; display: grid; place-items: center; color: #9bc8b4; }
.brand-mark svg { width: 30px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.brand strong { display: block; font: 500 12px var(--mono); letter-spacing: .17em; }
.brand small { display: block; color: #9ba99f; font-size: 12px; margin-top: 3px; }
.top-actions { display: flex; align-items: center; gap: 19px; }
.save-state { font: 11px var(--mono); color: #92a99e; }
.text-button { border: 0; background: none; color: #bbbfad; font: 12px var(--sans); padding: 10px 0; cursor: pointer; text-decoration: underline; text-decoration-color: #657b72; text-underline-offset: 4px; }
.text-button:hover { color: var(--ink); }
.language-button { border: 1px solid #657b72; border-radius: 5px; padding: 6px 8px; min-width: 52px; text-align: center; color: #a8cbbb; text-decoration: none; }
.language-button:hover, .language-button:focus-visible { border-color: #a8cbbb; background: rgba(135,199,182,.1); }
#game { padding-bottom: 20px; }
.case-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 30px 0 20px; }
.eyebrow { font: 10px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--gold); margin: 0 0 8px; }
.eyebrow span { color: #83958b; margin: 0 4px; }
.case-heading h1, .ending h1 { font: 600 clamp(27px,3.6vw,43px)/1.08 var(--serif); letter-spacing: -.025em; margin: 0; color: #f0e8d7; }
.case-intro { max-width: 680px; color: #adbaae; margin: 11px 0 0; font-size: 14px; }
.chapter-seal { width: 78px; height: 78px; flex: none; border: 1px solid #65786d; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(-8deg); color: #d0b982; }
.chapter-seal span, .chapter-seal i { font: 8px var(--mono); letter-spacing: .13em; font-style: normal; }
.chapter-seal b { font: 500 23px var(--serif); line-height: 1.1; }
.case-track { display: grid; grid-template-columns: repeat(5,1fr); margin: 6px 0 20px; position: relative; }
.case-track:before { content: ""; height: 1px; background: #3b5958; position: absolute; top: 14px; left: 8%; right: 8%; }
.track-stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 7px; color: #71867d; }
.track-stop b { display: grid; place-items: center; width: 28px; height: 28px; background: #172e38; border: 1px solid #587068; border-radius: 50%; font: 9px var(--mono); z-index: 1; }
.track-stop small { font: 10px var(--sans); white-space: nowrap; }
.track-stop.active { color: #e8d4a8; }
.track-stop.active b { background: #ddba7a; color: #20373b; border-color: #f0d29b; box-shadow: 0 0 0 5px rgba(214,181,121,.12); }
.track-stop.done { color: #91c8b8; }
.track-stop.done b { background: #31594f; color: #d8eee1; border-color: #77ad9c; }
.compare { border: 1px solid #3b5657; background: linear-gradient(145deg,rgba(31,59,66,.96),rgba(19,42,53,.97)); border-radius: 14px; padding: 18px 20px 13px; box-shadow: 0 18px 45px rgba(0,0,0,.17); }
.compare-head { display: grid; grid-template-columns: 1fr 1fr 1fr; align-items: center; margin: 0 2px 12px; }
.compare-head > div { display: flex; align-items: center; gap: 10px; }
.compare-head > div:last-child { justify-content: flex-end; }
.compare-head b { display: block; font: 500 12px var(--mono); color: #e3d8c2; }
.compare-head small { display: block; color: #85998f; font-size: 10px; margin-top: 2px; }
.compare-icon { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: #c9a66c; color: #213a40; font: 11px var(--mono); }
.compare-icon.later { background: #83b8a6; }
.compare-instruction { text-align: center; color: #a4b1a4; font-size: 11px; }
.snapshot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.snapshot { margin: 0; min-width: 0; }
.scene-frame { overflow: hidden; border-radius: 9px; border: 1px solid #536a61; background: #495e56; position: relative; }
.scene { display: block; width: 100%; height: auto; aspect-ratio: 5/3; }
.snapshot figcaption { display: flex; justify-content: space-between; color: #91a095; font: 9px var(--mono); padding: 7px 3px 0; }
.snapshot figcaption span:first-child { color: #d4c49f; }
.interaction-note { text-align: center; color: #85958d; font-size: 10px; margin: 10px 0 0; }
.hotspot { cursor: pointer; outline: none; }
.spot-ring { fill: #fff; fill-opacity: .001; stroke: transparent; stroke-width: 5; transition: stroke .15s, fill .15s; }
.spot-core { fill: #fff; fill-opacity: .001; stroke: transparent; stroke-width: 2; }
.hotspot:hover .spot-ring, .hotspot:focus .spot-ring { stroke: #f4d189; stroke-dasharray: 7 5; fill: #f4d189; fill-opacity: .08; }
.hotspot.found .spot-ring { stroke: #a1e0c7; stroke-dasharray: none; fill: #8dd4b3; fill-opacity: .2; }
.hotspot.found .spot-core { stroke: #e4f3d0; stroke-width: 2; }
.spot-check { fill: none; stroke: #143e3c; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.feedback { min-height: 42px; display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 12px 0 16px; border: 1px solid #3a5553; border-radius: 8px; background: rgba(26,54,59,.55); font-size: 12px; color: #b8c4b6; }
.feedback-dot { width: 7px; height: 7px; flex: none; background: #d2b779; border-radius: 50%; box-shadow: 0 0 0 4px rgba(210,183,121,.12); }
.feedback.clue, .feedback.success { border-color: #4d7569; color: #bce0ce; }
.feedback.clue .feedback-dot, .feedback.success .feedback-dot { background: #8bd1b6; box-shadow: 0 0 0 4px rgba(139,209,182,.12); }
.feedback.answer { border-color: #8b6852; color: #e4b491; }
.feedback.answer .feedback-dot { background: #e28362; }
.deduction { display: grid; grid-template-columns: 1.07fr .93fr; gap: 14px; }
.clues-card, .question-card { min-width: 0; border: 1px solid #334f53; border-radius: 12px; background: rgba(23,48,58,.75); padding: 17px 19px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2 { font: 500 20px var(--serif); margin: 0; color: #eee3cc; }
.count-pill { border: 1px solid #64796e; border-radius: 99px; padding: 4px 10px; color: #cfb780; font: 10px var(--mono); }
.clue-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.clue { display: flex; gap: 8px; align-items: flex-start; color: #7f948b; font-size: 11px; min-height: 32px; }
.clue.revealed { color: #d3dccd; }
.clue-number { font: 9px var(--mono); color: #cfb780; min-width: 23px; padding-top: 2px; }
.clue.revealed .clue-number { color: #89cdb4; }
.question-card { display: flex; flex-direction: column; justify-content: center; }
.question { width: 100%; }
.question h3 { font: 500 20px/1.25 var(--serif); margin: 4px 0 14px; color: #eee5d3; }
.question p:not(.eyebrow) { color: #97a89c; font-size: 12px; margin: 4px 0; }
.question.locked { display: flex; align-items: center; gap: 12px; }
.question.locked h3 { font-size: 17px; margin: 0 0 3px; }
.lock-mark { width: 38px; height: 38px; flex: none; border: 1px solid #70816d; border-radius: 50%; display: grid; place-items: center; color: #d2b779; font-size: 22px; }
.answer-options { display: grid; gap: 7px; }
.answer-button { display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; border: 1px solid #46625d; border-radius: 7px; padding: 9px 11px; background: #203e45; color: #e1deca; font: 12px var(--sans); cursor: pointer; transition: background .15s,border-color .15s,transform .15s; }
.answer-button span { color: #91c8ae; }
.answer-button:hover, .answer-button:focus-visible { background: #2a4a4b; border-color: #9bc4a7; transform: translateX(2px); outline: none; }
.answer-feedback { min-height: 0; margin: 8px 0 0; color: #dfaa88; font-size: 11px; }
.footer { border-top: 1px solid rgba(218,202,165,.14); display: flex; justify-content: space-between; padding: 14px 0 24px; color: #70847c; font: 9px var(--mono); letter-spacing: .03em; }
.footer a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.footer a:hover { color: #d6c29a; }
.ending { min-height: calc(100vh - 150px); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 36px 20px; }
.ending-art { width: 224px; margin-bottom: 20px; }
.ending-art svg { width: 100%; overflow: visible; }
.ending h1 { max-width: 650px; margin: 0; }
.ending-copy { max-width: 520px; color: #adbaae; margin: 14px auto 24px; }
.primary-button { border: 1px solid #b7945f; border-radius: 7px; background: #d4b174; color: #1a343b; padding: 12px 18px; font: 600 13px var(--sans); cursor: pointer; }
.primary-button:hover { background: #e6c98e; }
.primary-button span { margin-left: 9px; font-size: 17px; vertical-align: -1px; }

@media (max-width: 760px) {
  .shell { padding: 0 18px; }
  .topbar { min-height: 72px; height: auto; gap: 10px; }
  .brand-mark { width: 38px; height: 38px; }
  .brand strong { font-size: 10px; }
  .brand small { font-size: 9px; }
  .top-actions { gap: 7px; }
  .save-state { font-size: 8px; max-width: 76px; text-align: right; }
  .text-button { font-size: 9px; }
  .language-button { min-width: 44px; padding: 5px 6px; }
  .case-heading { padding: 24px 0 16px; }
  .case-intro { font-size: 12px; max-width: 540px; }
  .chapter-seal { width: 61px; height: 61px; }
  .chapter-seal b { font-size: 18px; }
  .chapter-seal i, .chapter-seal span { font-size: 7px; }
  .track-stop small { font-size: 8px; max-width: 62px; overflow: hidden; text-overflow: ellipsis; }
  .compare { padding: 13px 11px 10px; border-radius: 10px; }
  .compare-head { gap: 4px; }
  .compare-head > div { gap: 6px; }
  .compare-head b { font-size: 9px; }
  .compare-head small { font-size: 8px; }
  .compare-icon { width: 22px; height: 22px; font-size: 9px; }
  .compare-instruction { font-size: 8px; line-height: 1.25; }
  .snapshot-grid { gap: 7px; }
  .snapshot figcaption { font-size: 8px; }
  .interaction-note { font-size: 9px; line-height: 1.4; }
  .deduction { grid-template-columns: 1fr; gap: 10px; }
  .clues-card, .question-card { padding: 14px; }
  .section-heading h2 { font-size: 18px; }
  .clue-list { gap: 7px 8px; }
  .clue { font-size: 10px; }
  .question h3 { font-size: 18px; }
  .footer { font-size: 8px; gap: 12px; }
  .footer span:last-child { text-align: right; }
}

@media (max-width: 480px) {
  .snapshot-grid { grid-template-columns: 1fr; gap: 10px; }
}

@media (max-width: 390px) {
  .shell { padding: 0 12px; }
  .top-actions { gap: 5px; }
  .save-state { max-width: 58px; font-size: 7px; line-height: 1.2; }
  .brand { gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 9px; letter-spacing: .11em; }
  .brand small { font-size: 8px; }
  .compare { padding-left: 8px; padding-right: 8px; }
  .compare-instruction { max-width: 92px; }
  .compare-head small { font-size: 7px; }
  .case-heading h1 { font-size: 27px; }
  .chapter-seal { width: 55px; height: 55px; }
  .track-stop small { max-width: 53px; }
  .clue-list { grid-template-columns: 1fr; }
  .clue { min-height: 25px; }
  .footer { flex-direction: column; gap: 3px; }
  .footer span:last-child { text-align: left; }
}
