/* The optional route belongs in the journal, never over the walking view. */
.chapter-route {
  border-block: 1px solid #d8cfb8;
  margin-block: 12px;
  padding-block: 10px;
  color: #304e40;
}
.chapter-route p { margin: 0 0 8px; line-height: 1.65; }
.chapter-route summary { min-height: 44px; align-content: center; cursor: pointer; font-weight: 700; }
.chapter-route summary:focus-visible { outline: 3px solid #876628; outline-offset: 2px; }
.chapter-route ol { list-style: none; margin: 6px 0 12px; padding: 0; }
.chapter-route li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 8px; border-left: 2px solid #c5cbb9; }
.chapter-route li > span { display: grid; place-items: center; height: 32px; background: #e8e4d4; border-radius: 5px; }
.chapter-route li b { font-size: 14px; }
.chapter-route li small { font-size: 12px; white-space: nowrap; }
.chapter-route li[data-status="current"] { background: #e0ebdf; border-color: #38654d; }
.chapter-route li[data-status="done"] > span { background: #d6e0cd; }
.chapter-route details > small { display: block; font-size: 12px; line-height: 1.5; }

/* A field notebook stays at the edge; the story world remains the main view. */
.story-cinematic {
  position: fixed;
  inset: auto auto max(28px, env(safe-area-inset-bottom))
    max(28px, env(safe-area-inset-left));
  margin: 0;
  width: min(440px, calc(100vw - 56px));
  max-height: min(470px, calc(100dvh - 100px));
  padding: 22px;
  border: 1px solid #e2d7bb;
  border-radius: 6px 22px 22px 22px;
  background: #fcf7e9;
  color: #263e36;
  box-shadow: 0 14px 60px #163d3652;
}
.story-cinematic::backdrop {
  background: #173c321c;
  backdrop-filter: none;
}
.voxel-stage:has(.story-cinematic[open]) .voxel-gate,
.voxel-stage:has(.story-commission[open]) .voxel-gate {
  display: none;
}
.story-cinematic .story-dialog-head {
  margin-bottom: 16px;
}
.story-cinematic .story-dialog-head h2 {
  font-size: 23px;
  line-height: 1.35;
}
.story-cinematic .story-dialog-head small {
  font-size: 10px;
  color: #8e7956;
  letter-spacing: 0.09em;
}
.story-cinematic .story-step {
  display: none;
}
.story-cinematic .story-quest-copy p {
  font-size: 16px;
  line-height: 1.75;
}
.story-cinematic .story-primary {
  margin: 14px 0 0;
  min-height: 48px;
  border-radius: 9px;
  background: #2d6356;
}
.story-cinematic .story-success-glyph {
  font-size: 48px;
  padding: 6px 0;
}
.story-cinematic .story-success {
  padding: 0;
}
.story-field-note {
  display: flex;
  gap: 20px;
  align-items: center;
  text-align: left;
}
.story-field-glyph {
  flex: 0 0 88px;
  font:
    78px/1.2 "Noto Serif KR",
    "Batang",
    serif;
  color: #426e5a;
}
.story-field-note b {
  font-size: 18px;
  color: #315648;
}
.story-field-note p {
  margin: 8px 0 0;
  font-size: 15px;
  line-height: 1.7;
  color: #56675a;
}
.story-commission {
  width: min(520px, calc(100vw - 24px));
  text-align: center;
  background: #fcf7e9;
  border-color: #d7c9a5;
}
.story-commission .story-dialog-head {
  text-align: left;
}
.commission-seal {
  display: grid;
  place-items: center;
  margin: 12px auto 16px;
  width: 76px;
  height: 76px;
  border: 2px solid #b98c55;
  border-radius: 50%;
  background: #eaddbd;
  color: #896338;
  font:
    44px "Noto Serif KR",
    "Batang",
    serif;
}
.commission-speaker {
  margin: 0 0 10px;
  color: #8d7954;
  font-size: 12px;
}
.commission-quote {
  font-family: "Noto Serif KR", "Batang", serif;
  font-size: 20px;
  line-height: 1.8;
  color: #334e43;
}
.commission-rewards {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin: 24px 0 8px;
  padding-top: 18px;
  border-top: 1px dashed #d4c8aa;
}
.commission-rewards span {
  flex: 1;
  font-size: 11px;
  color: #8a7d60;
}
.commission-rewards b {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  color: #3a5b4c;
}
.story-discovery {
  position: absolute;
  left: max(24px, env(safe-area-inset-left));
  bottom: max(100px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px 22px 13px 15px;
  border: 1px solid #f0d49b;
  border-radius: 12px;
  background: #fbf4dfef;
  color: #395747;
  pointer-events: none;
  box-shadow: 0 8px 30px #173f3429;
  animation: discovery-arrive 0.4s ease-out;
  z-index: 3;
}
.story-discovery[hidden] {
  display: none;
}
.story-discovery > span {
  font:
    45px "Noto Serif KR",
    "Batang",
    serif;
  color: #aa804a;
}
.story-discovery small {
  display: block;
  margin-bottom: 5px;
  font-size: 10px;
  color: #8b805f;
}
.story-discovery b {
  font-size: 17px;
}
.story-atelier .voxel-crosshair {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff5da;
  font-size: 0;
  box-shadow: 0 0 0 4px #fff5da24;
}
.story-atelier .tree-objective {
  background: #173e34e6;
  border: 1px solid #b9c8a950;
}
.story-atelier .voxel-context button {
  background: #f9f0d6;
  color: #294b3e;
  border: 1px solid #d6be86;
  box-shadow: 0 3px 0 #6f6741;
}
@keyframes discovery-arrive {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.chapter-shot {
  position: absolute;
  z-index: 22;
  bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 10px 8px 20px;
  border: 1px solid #c8b77e70;
  border-radius: 14px;
  background: #183d32ed;
  color: #fff5db;
  box-shadow: 0 6px 25px #10281f30;
  font-size: 15px;
}
.chapter-shot[hidden],
.chapter-av-settings[hidden] {
  display: none;
}
.chapter-shot button {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #ddc99380;
  border-radius: 9px;
  background: #fff3d8;
  color: #28483b;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.chapter-shot small {
  opacity: 0.7;
  margin-left: 6px;
}
.chapter-directing .voxel-context,
.chapter-directing .voxel-touch,
.chapter-directing .voxel-crosshair,
.chapter-directing .story-discovery,
.chapter-directing .voxel-toast {
  visibility: hidden;
  pointer-events: none;
}
.chapter-directing .tree-objective {
  pointer-events: none;
}
.chapter-av-settings {
  display: grid;
  min-inline-size: 0;
  gap: 12px;
  margin: 14px 0 0;
  padding: 14px;
  border: 1px solid #597c5c50;
  border-radius: 12px;
  text-align: left;
  color: #254638;
  background: #f5f2e5;
}
.chapter-av-settings legend {
  font-weight: 800;
  font-size: 14px;
  padding: 0 6px;
}
.chapter-av-settings label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 15px;
  white-space: nowrap;
}
.chapter-av-settings input[type="range"] {
  flex: 1;
  width: 0;
  min-width: 50px;
  min-height: 44px;
  accent-color: #356e53;
}
.chapter-av-settings input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #356e53;
}
.chapter-av-settings output {
  min-width: 40px;
  font-size: 13px;
}
.chapter-av-settings small {
  font-size: 12px;
  line-height: 1.5;
  color: #5b7064;
}
.chapter-av-settings button {
  min-height: 44px;
}
.chapter-shot button:focus-visible,
.chapter-av-settings :focus-visible {
  outline: 3px solid #d4a746;
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .chapter-shot {
    gap: 8px;
    width: calc(100% - 24px);
    max-width: none;
    padding-left: 12px;
    font-size: 13px;
    justify-content: space-between;
  }
  .chapter-shot small {
    display: none;
  }
  .chapter-shot button {
    font-size: 12px;
    padding: 8px;
  }
}
@media (max-width: 600px) {
  .story-cinematic {
    inset: auto 12px max(14px, env(safe-area-inset-bottom));
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 90px);
    padding: 18px;
  }
  .story-field-glyph {
    flex-basis: 72px;
    font-size: 66px;
  }
  .story-cinematic .story-dialog-head h2 {
    font-size: 20px;
  }
  .commission-quote {
    font-size: 17px;
  }
  .story-discovery {
    left: 16px;
    bottom: 110px;
    padding: 10px 16px;
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .story-cinematic {
    inset: auto 12px 12px auto;
    width: min(390px, calc(100vw - 145px));
    max-height: calc(100dvh - 24px);
    padding: 14px 18px;
  }
  .story-cinematic .story-dialog-head {
    margin-bottom: 8px;
  }
  .story-field-glyph {
    flex-basis: 58px;
    font-size: 52px;
  }
  .story-field-note {
    gap: 12px;
  }
  .story-field-note p {
    font-size: 13px;
    line-height: 1.5;
  }
  .story-cinematic .story-dialog-head h2 {
    font-size: 18px;
  }
  .story-cinematic .story-primary {
    margin-top: 10px;
  }
  .story-discovery {
    left: 120px;
    bottom: 16px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .story-discovery {
    animation: none;
  }
}
.second-map-open { position:absolute;z-index:12;right:16px;top:68px;min-height:44px;padding:8px 16px;border:1px solid #819f91;background:#e8efe2;color:#274d43;font-family:inherit;font-size:14px;font-weight:700; }
.second-route-tabs { display:flex;gap:8px;margin:8px 0 12px; }
.second-route-tabs button { flex:1;min-height:44px;border:1px solid #b8c9b5;background:#f6f4e9;color:#355c4d;font-weight:700; }
.second-route-tabs button[aria-pressed="true"] { background:#365d4e;color:#fff9e7; }
.second-route-map { background:#eff3e8;border:1px solid #d6e0d1;border-radius:8px; }
.second-route-map svg { display:block;width:100%;height:auto;max-height:50dvh; }
.second-route-map text { font:700 20px "Malgun Gothic",sans-serif;fill:#345147;paint-order:stroke;stroke:#eff3e8;stroke-width:5;stroke-linejoin:round; }
.second-route-legend { display:flex;flex-wrap:wrap;gap:6px 20px;margin:12px 0 0;font-size:13px;color:#5c7163; }
