/* ===== コンセプト図：鍵穴と「鍵の人」 ===== */
.km-map{position:relative}
.km-flow{position:absolute;inset:0;width:100%;height:100%;overflow:visible;pointer-events:none;z-index:1}
.km-node{position:relative;z-index:0}
.km-core{position:relative;z-index:2}
.km-flow .km-path{fill:none;stroke:var(--gold);stroke-width:1.6;stroke-dasharray:2 7;stroke-linecap:round;opacity:.7}

/* 鍵穴：カードの中央側の辺に半分はみ出して付ける */
.km-node .kh{
  position:absolute;width:46px;height:46px;border-radius:50%;
  background:#0B0B0C url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 46 46'%3E%3Ccircle cx='23' cy='18.5' r='6.2' fill='%23C9A44C'/%3E%3Cpath d='M19.6 21.5h6.8l2.4 12.5H17.2z' fill='%23C9A44C'/%3E%3C/svg%3E") center/100% no-repeat;
  box-shadow:0 0 0 2px var(--gold),0 0 0 6px var(--white);
  transition:box-shadow .35s,transform .35s;
  display:block;font-size:0
}
.km-map>a:nth-of-type(1) .kh,.km-map>a:nth-of-type(3) .kh{right:-23px;top:50%;transform:translateY(-50%)}
.km-map>a:nth-of-type(2) .kh,.km-map>a:nth-of-type(4) .kh{left:-23px;top:50%;transform:translateY(-50%)}
.km-node.lit{border-color:var(--gold)}
.km-node.lit .kh{box-shadow:0 0 0 2px var(--gold),0 0 0 6px var(--white),0 0 0 10px rgba(201,164,76,.35),0 0 26px 8px rgba(201,164,76,.45)}

@media (max-width:760px){
  /* スマホ：上段カード → 中央の〇 → 下段カード */
  .km-core{grid-area:2/1/3/3 !important;width:170px;margin:34px auto}
  .km-map>a:nth-of-type(1){grid-area:1/1 !important}.km-map>a:nth-of-type(2){grid-area:1/2 !important}
  .km-map>a:nth-of-type(3){grid-area:3/1 !important}.km-map>a:nth-of-type(4){grid-area:3/2 !important}
  .km-map>a:nth-of-type(1) .kh,.km-map>a:nth-of-type(2) .kh{top:auto;right:auto;left:50%;bottom:-23px;transform:translateX(-50%)}
  .km-map>a:nth-of-type(3) .kh,.km-map>a:nth-of-type(4) .kh{right:auto;left:50%;top:-23px;transform:translateX(-50%)}
  .km-node .kh{width:40px;height:40px}
  .km-map>a:nth-of-type(1) .kh,.km-map>a:nth-of-type(2) .kh{bottom:-20px}
  .km-map>a:nth-of-type(3) .kh,.km-map>a:nth-of-type(4) .kh{top:-20px}
}

/* 歩く距離を確保するため、中央の〇の周りを広げる */
@media (min-width:761px){
  .km-map{grid-template-columns:1fr 380px 1fr;column-gap:36px;row-gap:40px;max-width:1080px}
  .km-core{width:190px;justify-self:center;align-self:center}
  .km-node{padding:34px 26px}
}
@media (max-width:760px){
  .km-core{margin:70px auto !important;width:150px !important}
}
