/* ベース */

html,body{
  margin:0;
  padding:0;
  background:#050509;
  color:#f5f5f5;
  font-family:"Yu Mincho","Hiragino Mincho ProN",serif;
}

/* 神の帳っぽいメイン枠 */

main.board{
  max-width:960px;
  margin:32px auto 60px;
  padding:28px 22px 40px;
  background:rgba(0,0,0,0.65);
  border-radius:16px;
  border:1px solid rgba(210,220,255,0.25);
  box-shadow:0 0 30px rgba(0,0,0,0.9);
}

/* タイトル・キービジュアル */

.page-title{
  margin:0 0 18px;
  font-size:24px;
  letter-spacing:0.18em;
  text-indent:0.18em;
  text-align:center;
  background:linear-gradient(90deg,#e3e6ff,#f8fafe,#e3e6ff);
  -webkit-background-clip:text;
  color:transparent;
}

.kv-wrap{
  margin:0 0 20px;
}
.kv{
  display:block;
  width:100%;
  height:auto;
  border-radius:12px;
  border:1px solid rgba(210,220,255,0.35);
}

/* 冒頭テキスト */

.lead{
  margin:6px 0 10px;
  font-size:14px;
  text-align:center;
  color:#ddd;
}

.strong-line{
  margin:4px 0 18px;
  font-size:15px;
  text-align:center;
}

p{
  margin:0 0 14px;
  font-size:14px;
  line-height:1.9;
}

/* 見出し */

h2{
  margin:0 0 14px;
  font-size:17px;
  letter-spacing:0.12em;
  text-indent:0.12em;
  color:#ffdca0;
}

/* 図解エリア */

.diagram-block{
  margin:26px 0 30px;
  padding:18px 16px 20px;
  border-radius:14px;
  border:1px solid rgba(190,210,255,0.4);
  background:rgba(0,0,0,0.5);
}

/* 凡例 */

.legend{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:4px 0 18px;
}
.legend-item{
  flex:1 1 200px;
  display:flex;
  align-items:center;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(0,0,0,0.6);
  border:1px solid rgba(190,210,255,0.45);
}
.legend-icon{
  width:30px;
  height:30px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-right:10px;
  font-size:14px;
  background:#111;
}
.legend-icon.cause{
  box-shadow:0 0 8px rgba(150,210,255,0.9);
}
.legend-icon.rule{
  box-shadow:0 0 8px rgba(180,170,255,0.9);
}
.legend-icon.exist{
  box-shadow:0 0 8px rgba(210,230,255,0.9);
}
.legend-text{
  font-size:12px;
  line-height:1.7;
}

/* 横並びのノード図 */

.diagram{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(210px,1fr));
  gap:14px;
  margin-bottom:18px;
}

.node{
  position:relative;
  padding:14px 12px 16px;
  border-radius:12px;
  background:rgba(0,0,0,0.7);
  border:1px solid rgba(190,210,255,0.5);
  box-shadow:0 0 18px rgba(0,0,0,0.9);
}

.node-head{
  display:flex;
  align-items:center;
  margin-bottom:6px;
}

.node-icon{
  width:28px;
  height:28px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-right:8px;
  font-size:14px;
  background:#111;
}
.node-icon.cause{
  background:radial-gradient(circle,#9fd5ff 0,#163047 80%);
}
.node-icon.rule{
  background:radial-gradient(circle,#c9bfff 0,#22163f 80%);
}
.node-icon.exist{
  background:radial-gradient(circle,#d4ecff 0,#283545 80%);
}

.node-title{
  font-size:13px;
  letter-spacing:0.06em;
}

.node-text{
  font-size:13px;
  line-height:1.8;
  margin:0;
}

.node-flow{
  position:absolute;
  right:8px;
  bottom:8px;
  font-size:11px;
  padding:2px 6px;
  border-radius:999px;
  border:1px solid rgba(200,220,255,0.9);
  background:rgba(0,0,0,0.7);
}

/* 縦の層イメージ */

.layers-diagram{
  margin-top:16px;
  padding-top:10px;
  border-top:1px dashed rgba(190,210,255,0.5);
}

.layer{
  display:flex;
  align-items:flex-start;
  padding:10px 10px;
  border-radius:10px;
  background:rgba(0,0,0,0.7);
  border:1px solid rgba(190,210,255,0.45);
}

.layer + .layer{
  margin-top:10px;
}

.layer-icon{
  width:26px;
  height:26px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  margin-right:8px;
  font-size:14px;
  background:#111;
}

.layer-title{
  font-size:13px;
  letter-spacing:0.06em;
  margin-bottom:2px;
}
.layer-desc{
  font-size:12px;
  line-height:1.8;
}

.world-layer{
  border-color:rgba(190,210,255,0.55);
}
.exist-layer{
  border-color:rgba(200,240,200,0.45);
}

.arrow-block{
  text-align:center;
  margin:6px 0;
  font-size:12px;
  color:#ccc;
}
.stitch-icon{
  font-size:16px;
}
.stitch-label{
  margin:0 0 4px;
}
.arrow{
  font-size:16px;
}

/* 本文の枠 */

.text-block{
  margin-top:26px;
  padding:18px 16px 20px;
  border-radius:14px;
  border:1px solid rgba(255,205,150,0.45);
  background:rgba(0,0,0,0.65);
}

/* スマホ調整 */

@media (max-width:600px){
  main.board{
    margin:16px auto 40px;
    padding:20px 14px 28px;
  }
  .diagram-block,
  .text-block{
    padding:14px 10px 16px;
  }
}
