/* 鳥居のむこう（仮） 記録帳・取得の演出・探索（records.js / explore.js）
   文字の大きさは --fs-scale（設定の文字サイズ・既定1）で変わる。 */

.bk-get, .bk-book, .xp-root {
  --bk-paper: #efe5cf;
  --bk-paper2: #e4d6b8;
  --bk-ink: #22201c;
  --bk-ink2: #4a443a;
  --bk-shu: #b8322a;
  --bk-font: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "MS PMincho", serif;
  --bk-fs: calc(clamp(17px, 2.5vh, 22px) * var(--fs-scale, 1));
  position: absolute;
  inset: 0;
  pointer-events: auto;
  font-family: var(--bk-font);
  font-size: var(--bk-fs);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
  box-sizing: border-box;
}
.bk-get *, .bk-book *, .xp-root * { box-sizing: border-box; }

/* ================= 取得の演出 ================= */
.bk-get {
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 8, 12, 0);
  transition: background .5s ease;
  cursor: pointer;
  color: #f4ecdc;
}
.bk-get.is-in { background: rgba(6, 8, 12, .55); }
.bk-get.is-out { background: rgba(6, 8, 12, 0); transition: background .35s ease; }

.bk-get-ink {
  position: absolute;
  left: 50%; top: 44%;
  width: 120vmin; height: 120vmin;
  max-width: 900px; max-height: 900px;
  transform: translate(-50%, -50%) scale(.1);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(10, 10, 12, .78), rgba(10, 10, 12, .45) 55%, rgba(10, 10, 12, 0) 100%);
  filter: blur(8px);
  opacity: 0;
  pointer-events: none;
}
.bk-get.is-in .bk-get-ink { animation: bk-inkspread 1.1s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes bk-inkspread {
  0% { transform: translate(-50%, -50%) scale(.1); opacity: 0; }
  40% { opacity: 1; }
  100% { transform: translate(-50%, -50%) scale(1); opacity: .9; }
}

.bk-get-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5em;
  max-width: min(88%, 520px);
  padding: 0 1em;
  margin-top: -6%;
}
.bk-get.is-in .bk-get-card { animation: bk-inkin 1.2s .15s cubic-bezier(.2, .7, .2, 1) both; }
.bk-get.is-out .bk-get-card { animation: bk-inkout .35s ease forwards; }
@keyframes bk-inkin {
  0% { opacity: 0; filter: blur(14px); transform: scale(1.06); }
  55% { opacity: 1; filter: blur(3px); }
  100% { opacity: 1; filter: blur(0); transform: scale(1); }
}
@keyframes bk-inkout {
  from { opacity: 1; filter: blur(0); }
  to { opacity: 0; filter: blur(8px); }
}

.bk-get-pic {
  width: min(56vmin, 300px);
  aspect-ratio: 1 / 1;
  border-radius: 6px;
  box-shadow: 0 0 40px rgba(0, 0, 0, .6);
}

/* 札 */
.bk-get-tag {
  position: relative;
  padding: .7em 1.4em .75em;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255, 255, 255, .35), rgba(255, 255, 255, 0) 60%),
    linear-gradient(180deg, var(--bk-paper), var(--bk-paper2));
  color: var(--bk-ink);
  border-radius: 3px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(60, 40, 20, .25), inset 0 0 22px rgba(120, 90, 50, .25);
}
.bk-get-tag::before { /* 札の穴と紐 */
  content: "";
  position: absolute;
  left: 50%; top: -.9em;
  width: 2px; height: 1.3em;
  background: #8a2a22;
  transform: translateX(-50%);
}
.bk-get-name {
  font-size: 1.45em;
  font-weight: 600;
  letter-spacing: .06em;
  text-shadow: 0 0 1px rgba(0, 0, 0, .4);
}
.bk-get-line {
  margin-top: .5em;
  font-size: 1.15em;
  letter-spacing: .4em;
  padding-left: .4em;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}
.bk-get-count {
  font-size: .95em;
  letter-spacing: .1em;
  color: #d9c9a6;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .8);
}
.bk-get-hint {
  position: absolute;
  bottom: 7%;
  font-size: .8em;
  color: rgba(244, 236, 220, .6);
  letter-spacing: .15em;
  opacity: 0;
}
.bk-get.is-in .bk-get-hint { animation: bk-fadein .6s 1.4s forwards; }
@keyframes bk-fadein { to { opacity: 1; } }

/* ================= 記録帳 ================= */
.bk-book {
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  background: rgba(5, 6, 9, 0);
  transition: background .25s ease;
}
.bk-book.is-in { background: rgba(5, 6, 9, .6); }
.bk-book.is-out { background: rgba(5, 6, 9, 0); }

.bk-paper {
  position: relative;
  width: 100%;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  color: var(--bk-ink);
  border-radius: 4px;
  background:
    radial-gradient(140% 90% at 50% 0%, rgba(255, 252, 240, .55), rgba(255, 252, 240, 0) 55%),
    radial-gradient(80% 60% at 100% 100%, rgba(150, 110, 60, .18), rgba(150, 110, 60, 0) 70%),
    radial-gradient(70% 50% at 0% 80%, rgba(150, 110, 60, .12), rgba(150, 110, 60, 0) 70%),
    repeating-linear-gradient(90deg, rgba(120, 90, 50, .035) 0 1px, rgba(0, 0, 0, 0) 1px 7px),
    linear-gradient(180deg, var(--bk-paper), var(--bk-paper2));
  box-shadow: 0 10px 40px rgba(0, 0, 0, .6), inset 0 0 0 1px rgba(80, 55, 25, .3), inset 0 0 60px rgba(120, 85, 40, .22);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .25s ease, transform .3s ease;
  overflow: hidden;
}
.bk-book.is-in .bk-paper { opacity: 1; transform: none; }
.bk-book.is-out .bk-paper { opacity: 0; transform: translateY(8px); }

.bk-head {
  display: flex;
  align-items: center;
  gap: .6em;
  padding: .7em .8em .55em 1em;
  border-bottom: 2px solid rgba(34, 32, 28, .75);
  box-shadow: 0 3px 0 -1px rgba(34, 32, 28, .25);
}
.bk-title {
  margin: 0;
  font-size: 1.4em;
  font-weight: 700;
  letter-spacing: .3em;
}
.bk-count {
  margin-left: auto;
  display: flex;
  align-items: baseline;
  gap: .3em;
  color: var(--bk-shu);
  font-weight: 700;
}
.bk-count-label { font-size: .95em; letter-spacing: .1em; }
.bk-count-num { font-size: 1.25em; font-variant-numeric: tabular-nums; }
.bk-x {
  flex: none;
  margin-left: auto;
  width: 52px; height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(34, 32, 28, .08);
  color: var(--bk-ink);
  font: inherit;
  font-size: 1.6em;
  line-height: 1;
  cursor: pointer;
}
.bk-x:hover, .bk-x:focus-visible { background: rgba(34, 32, 28, .16); }

.bk-body {
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: .6em .9em 1em;
}
.bk-sec { margin-top: .6em; }
.bk-sec-h {
  display: flex;
  align-items: baseline;
  gap: .5em;
  margin: .4em 0 .5em;
  font-size: 1.1em;
  font-weight: 700;
  letter-spacing: .2em;
}
.bk-sec-h::before {
  content: "";
  display: inline-block;
  width: .55em; height: .55em;
  background: var(--bk-shu);
  transform: rotate(45deg) translateY(-.1em);
}
.bk-sec-n { font-size: .8em; color: var(--bk-ink2); letter-spacing: .05em; font-weight: 400; }

.bk-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(46%, 150px), 1fr));
  gap: .55em;
}
.bk-cell {
  position: relative;
  min-height: 108px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .25em;
  padding: .5em .4em .55em;
  border: 1px solid rgba(34, 32, 28, .35);
  border-radius: 3px;
  background: rgba(255, 252, 242, .45);
  color: var(--bk-ink);
  font: inherit;
  font-size: .9em;
  line-height: 1.35;
  text-align: center;
  cursor: pointer;
}
.bk-cell:hover, .bk-cell:focus-visible { background: rgba(255, 252, 242, .8); outline: 2px solid rgba(184, 50, 42, .6); outline-offset: 1px; }
.bk-cell.is-none { background: rgba(60, 45, 25, .06); border-style: dashed; color: var(--bk-ink2); }
.bk-cell-pic { width: 64px; height: 64px; border-radius: 3px; }
.bk-cell-name { font-weight: 700; }
.bk-cell-q { font-size: 1.9em; line-height: 1; color: rgba(34, 32, 28, .45); }
.bk-cell-where { font-size: .82em; color: var(--bk-ink2); }

/* 新 の朱印 */
.bk-new {
  position: absolute;
  top: 4px; right: 4px;
  width: 1.7em; height: 1.7em;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bk-shu);
  border-radius: 3px;
  color: var(--bk-shu);
  font-size: .85em;
  font-weight: 700;
  line-height: 1;
  transform: rotate(-8deg);
  background: rgba(255, 245, 235, .6);
}

.bk-ends .bk-end-none { margin: .2em 0 0 1em; font-size: 1.2em; color: var(--bk-ink2); }
.bk-end-list { margin: 0; padding: 0 0 0 1.2em; }
.bk-end-list li { padding: .2em 0; color: var(--bk-ink2); }
.bk-end-list li.is-got { color: var(--bk-ink); font-weight: 700; }
.bk-empty { color: var(--bk-ink2); }

.bk-foot {
  padding: .6em .9em .8em;
  border-top: 1px solid rgba(34, 32, 28, .3);
  display: flex;
  justify-content: center;
}
.bk-close {
  min-width: 60%;
  min-height: 56px;
  padding: .5em 1.4em;
  border: 2px solid var(--bk-ink);
  border-radius: 4px;
  background: var(--bk-ink);
  color: var(--bk-paper);
  font: inherit;
  font-size: 1.1em;
  letter-spacing: .4em;
  padding-left: calc(1.4em + .4em);
  cursor: pointer;
}
.bk-close:hover, .bk-close:focus-visible { background: #3a3630; outline: 3px solid rgba(184, 50, 42, .5); outline-offset: 2px; }

/* 詳細 */
.bk-detail {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background:
    radial-gradient(140% 90% at 50% 0%, rgba(255, 252, 240, .6), rgba(255, 252, 240, 0) 55%),
    linear-gradient(180deg, var(--bk-paper), var(--bk-paper2));
  z-index: 2;
}
.bk-detail[hidden] { display: none; }
.bk-detail-inner {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5em;
  padding: 1.2em 1.1em 1.2em;
}
.bk-detail-pic {
  width: min(70%, 320px);
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  box-shadow: 0 4px 18px rgba(60, 40, 20, .3);
}
.bk-detail-pic.is-q { display: flex; align-items: center; justify-content: center; font-size: 4em; color: rgba(34, 32, 28, .35); background: rgba(60, 45, 25, .08); }
.bk-detail-kind { font-size: .85em; color: var(--bk-shu); letter-spacing: .3em; padding-left: .3em; }
.bk-detail-name { margin: 0; font-size: 1.4em; letter-spacing: .05em; text-align: center; }
.bk-detail-note { margin: .2em 0; width: 100%; max-width: 30em; white-space: pre-wrap; }
.bk-detail-where {
  margin: 0; width: 100%; max-width: 30em;
  font-size: .9em; color: var(--bk-ink2);
  border-top: 1px dashed rgba(34, 32, 28, .35);
  padding-top: .4em;
}
.bk-seal {
  position: absolute;
  top: 1em; right: 1em;
  width: 2.2em; height: 2.2em;
  display: flex; align-items: center; justify-content: center;
  border: 3px double var(--bk-shu);
  border-radius: 50%;
  color: var(--bk-shu);
  font-weight: 700;
  transform: rotate(10deg);
  opacity: .85;
}
.bk-back { margin-top: auto; }

/* 絵の箱（仮表示つき） */
.bk-pic {
  position: relative;
  overflow: hidden;
  background: radial-gradient(closest-side, rgba(34, 32, 28, .22), rgba(34, 32, 28, .06));
  flex: none;
}
.bk-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.bk-pic-ph {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: rgba(34, 32, 28, .5);
  font-size: 1.2em;
}
.bk-get .bk-pic { background: radial-gradient(closest-side, rgba(240, 230, 210, .2), rgba(240, 230, 210, 0)); }
.bk-get .bk-pic-ph { color: rgba(240, 230, 210, .6); font-size: 2em; }
.bk-pic.has-img .bk-pic-ph { display: none; }

/* ================= 探索 ================= */
.xp-root {
  z-index: 20;
  pointer-events: none; /* 子だけ押せる */
  opacity: 0;
  transition: opacity .35s ease;
}
.xp-root.is-in { opacity: 1; }
.xp-root.is-out { opacity: 0; transition: opacity .25s ease; }

.xp-prompt {
  position: absolute;
  left: 50%; top: max(5.5%, calc(env(safe-area-inset-top) + 56px));
  transform: translateX(-50%);
  max-width: 88%;
  padding: .55em 1.4em;
  background: rgba(10, 12, 18, .72);
  border: 1px solid rgba(220, 210, 190, .45);
  box-shadow: 0 0 0 4px rgba(10, 12, 18, .35), 0 4px 18px rgba(0, 0, 0, .5);
  color: #efe6d4;
  text-align: center;
  letter-spacing: .08em;
  font-size: 1.05em;
  pointer-events: none;
}

.xp-marks { position: absolute; inset: 0; pointer-events: none; }
.xp-mark {
  position: absolute;
  width: 56px; height: 56px;  /* 当たり判定（最小48px以上） */
  margin: -28px 0 0 -28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  animation: xp-breathe 3.2s ease-in-out infinite;
}
.xp-ring {
  position: absolute;
  left: 50%; top: 50%;
  width: 34px; height: 34px;
  margin: -17px 0 0 -17px;
  border-radius: 50%;
  border: 2px solid rgba(210, 230, 255, .85);
  box-shadow: 0 0 10px 2px rgba(150, 195, 255, .55), inset 0 0 8px rgba(150, 195, 255, .5);
}
.xp-dot {
  position: absolute;
  left: 50%; top: 50%;
  width: 8px; height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: #eef5ff;
  box-shadow: 0 0 8px 3px rgba(170, 205, 255, .8);
}
/* 絵の外（画面のふちの先）にある物の印：ふちの内側に出して、その向きに小さな矢印（1123d） */
.xp-arrow {
  position: absolute; top: 50%;
  margin-top: -.62em;
  font-size: 22px; line-height: 1.2; font-weight: 700;
  color: #eef5ff; text-shadow: 0 0 6px rgba(150, 195, 255, .9), 0 1px 2px #000;
  pointer-events: none;
}
.xp-mark.is-edge-l .xp-arrow { left: 0; }
.xp-mark.is-edge-r .xp-arrow { right: 0; }
@keyframes xp-breathe {
  0%, 100% { opacity: .55; transform: scale(.92); }
  50% { opacity: 1; transform: scale(1.06); }
}
.xp-mark.is-guide { animation-name: xp-breathe-g; animation-duration: 2.4s; }
.xp-mark.is-guide .xp-ring { border-color: #fff; border-width: 3px; box-shadow: 0 0 18px 5px rgba(170, 210, 255, .8), inset 0 0 10px rgba(170, 210, 255, .7); }
@keyframes xp-breathe-g {
  0%, 100% { opacity: .75; transform: scale(.95); }
  50% { opacity: 1; transform: scale(1.18); }
}
.xp-mark.is-seen { animation: none; opacity: .38; }
.xp-mark.is-seen .xp-ring { box-shadow: none; border-style: dashed; }
.xp-mark.is-hl, .xp-mark:hover, .xp-mark:focus-visible { opacity: 1; outline: none; }
.xp-mark.is-hl .xp-ring, .xp-mark:hover .xp-ring, .xp-mark:focus-visible .xp-ring { border-color: #fff; box-shadow: 0 0 20px 6px rgba(190, 220, 255, .9); }
.xp-mark.is-picked .xp-ring { animation: xp-pick .3s ease-out forwards; }
@keyframes xp-pick { to { transform: scale(1.8); opacity: 0; } }

.xp-list {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 40%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: .45em;
  padding: .8em max(14px, 4%) max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(8, 10, 16, 0), rgba(8, 10, 16, .78) 1.2em, rgba(8, 10, 16, .88));
  pointer-events: auto;
}
.xp-root.is-list-only .xp-list { max-height: 60%; }
.xp-item {
  display: flex;
  align-items: center;
  gap: .7em;
  width: 100%;
  min-height: 52px;
  padding: .45em 1em;
  border: 1px solid rgba(220, 210, 190, .4);
  border-radius: 4px;
  background: rgba(24, 28, 38, .78);
  color: #f1e9d8;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.xp-num {
  flex: none;
  width: 1.6em; height: 1.6em;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(220, 210, 190, .45);
  border-radius: 50%;
  font-size: .8em;
  color: #cfc4ad;
}
.xp-label { flex: 1 1 auto; }
.xp-done { flex: none; font-size: .75em; color: #a99f8a; letter-spacing: .1em; }
.xp-item.is-seen { color: #b8b0a0; background: rgba(24, 28, 38, .55); }
.xp-item.is-guide { border-color: rgba(200, 225, 255, .85); box-shadow: 0 0 12px rgba(150, 195, 255, .45); animation: xp-gbtn 2.4s ease-in-out infinite; }
@keyframes xp-gbtn {
  0%, 100% { box-shadow: 0 0 6px rgba(150, 195, 255, .3); }
  50% { box-shadow: 0 0 16px rgba(150, 195, 255, .7); }
}
.xp-item:hover, .xp-item:focus-visible, .xp-item.is-hl { background: rgba(48, 58, 80, .9); outline: 2px solid rgba(200, 225, 255, .8); outline-offset: 0; }
.xp-item.is-picked { background: rgba(70, 90, 130, .95); }

/* こわさ控えめ・動きを減らす */
.is-calm .xp-mark, .is-calm .xp-item.is-guide { animation: none; }
.is-calm .xp-mark { opacity: .9; }
.is-calm .xp-mark.is-seen { opacity: .38; }
.bk-get.is-calm.is-in .bk-get-card { animation-duration: .4s; }
.bk-get.is-calm.is-in .bk-get-ink { animation-duration: .4s; }
@media (prefers-reduced-motion: reduce) {
  .xp-mark, .xp-item.is-guide { animation: none; }
  .xp-mark { opacity: .9; }
  .xp-mark.is-seen { opacity: .38; }
}

/* PC・横長のとき少しゆったり */
@media (min-width: 900px) and (min-height: 700px) {
  .bk-cell-pic { width: 76px; height: 76px; }
}

/* 探索中は文字窓・選択肢を隠す（explore.js が #stage に is-exploring を付ける） */
#stage.is-exploring #textwin,
#stage.is-exploring #choices,
#stage.is-exploring #next-mark { visibility: hidden; }

/* =====================================================================
   第2段（DESIGN §12・§13・§19）：記録帳のタブ・段位・朱印・シルエット
   ===================================================================== */

/* ---- いちばん上：段位と END／記録／気づき ---- */
.bk-summary {
  flex: none;
  padding: .45em .8em .45em;
  border-bottom: 1px solid rgba(34, 32, 28, .25);
  display: flex;
  flex-direction: column;
  gap: .35em;
}
.bk-rank { display: flex; align-items: center; gap: .6em; }
.bk-rank-text { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: .5em; row-gap: 0; min-width: 0; flex: 1 1 auto; }
.bk-rank-label { font-size: .8em; color: var(--bk-ink2); letter-spacing: .2em; }
.bk-rank-name { font-size: 1.3em; font-weight: 700; letter-spacing: .12em; white-space: nowrap; }   /* 1123d：320 で「迷い／人」と割れないように */
.bk-rank-next { flex-basis: 100%; font-size: .8em; color: var(--bk-ink2); line-height: 1.45; }
.bk-cardbtn {
  flex: none;
  min-height: 48px;
  padding: .3em .8em;
  border: 1.5px solid var(--bk-shu);
  border-radius: 3px;
  background: rgba(255, 248, 238, .6);
  color: var(--bk-shu);
  font: inherit;
  font-size: .85em;
  font-weight: 700;
  letter-spacing: .1em;
  cursor: pointer;
}
.bk-cardbtn:hover, .bk-cardbtn:focus-visible { background: rgba(184, 50, 42, .1); outline: 2px solid rgba(184, 50, 42, .5); outline-offset: 2px; }
.bk-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .35em; }
.bk-stats:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
.bk-stat {
  position: relative;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; column-gap: .3em;
  padding: .15em .25em .2em;
  border: 1px solid rgba(34, 32, 28, .22);
  border-radius: 3px;
  background: rgba(255, 252, 242, .4);
  white-space: nowrap;
}
.bk-stat-label { font-size: .72em; color: var(--bk-shu); letter-spacing: .06em; font-weight: 700; }
.bk-stat-num { font-size: 1.15em; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.bk-stat-total { font-size: .62em; font-weight: 400; color: var(--bk-ink2); margin-left: .1em; }
.bk-stat .bk-stat-seal { position: absolute; top: -.45em; right: -.3em; }

/* ---- タブ ---- */
.bk-tabs {
  flex: none;
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  gap: 0;
  padding: 0 .3em;
  border-bottom: 2px solid rgba(34, 32, 28, .7);
}
.bk-tabs::-webkit-scrollbar { display: none; }
.bk-tabs[hidden] { display: none; }
.bk-tab {
  position: relative;
  flex: 1 0 auto;
  min-height: 48px;
  padding: .25em .45em .2em;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--bk-ink2);
  font: inherit;
  font-size: .84em;
  letter-spacing: 0;
  white-space: nowrap;
  cursor: pointer;
  margin-bottom: 0;
}
.bk-tab.is-on { color: var(--bk-ink); font-weight: 700; border-bottom-color: var(--bk-shu); background: rgba(255, 252, 242, .5); }
.bk-tab:hover, .bk-tab:focus-visible { background: rgba(34, 32, 28, .07); outline: none; }
.bk-tab:focus-visible { box-shadow: inset 0 0 0 2px rgba(184, 50, 42, .5); }
.bk-tab .bk-tab-seal { position: absolute; top: 3px; right: 2px; }

/* ---- 朱の印（小） ---- */
.bk-stamp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  min-width: 1.5em; height: 1.5em;
  padding: 0 .15em;
  border: 2px solid var(--bk-shu);
  border-radius: 3px;
  color: var(--bk-shu);
  background: rgba(255, 244, 234, .55);
  font-size: .72em;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 1px rgba(184, 50, 42, .25);
  pointer-events: none;
}
.bk-stamp.is-pon { animation: bk-pon .55s cubic-bezier(.3, 1.6, .5, 1) .25s both; }
@keyframes bk-pon {
  0% { opacity: 0; transform: scale(2.4) rotate(-20deg); }
  55% { opacity: 1; transform: scale(.88) rotate(-6deg); }
  75% { transform: scale(1.06) rotate(-9deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}
.is-calm .bk-stamp.is-pon { animation: bk-fadein .2s both; }
@media (prefers-reduced-motion: reduce) { .bk-stamp.is-pon { animation: bk-fadein .2s both; } }
.bk-tab-seal, .bk-sec-seal { font-size: .6em; }
.bk-sec-seal { margin-left: .2em; }
.bk-rank-seal {
  min-width: 2.6em; height: auto; min-height: 2.6em;
  padding: .25em .2em;
  font-size: .78em;
  color: #fbf2e6;
  background: var(--bk-shu);
  border-color: var(--bk-shu);
  writing-mode: vertical-rl;
  text-orientation: upright;
  letter-spacing: .05em;
  transform: rotate(-4deg);
  box-shadow: inset 0 0 0 2px rgba(255, 240, 230, .7);
}
.bk-sec-left { margin-left: auto; font-size: .78em; color: var(--bk-shu); letter-spacing: .08em; font-weight: 400; }

/* 取得の札の朱印と「あと◯」 */
.bk-get-seal {
  position: absolute;
  right: -.9em; top: -.8em;
  font-size: 1.1em;
  background: rgba(255, 240, 230, .9);
}
.bk-get-left { margin-left: .8em; color: #f0b3a8; letter-spacing: .12em; }

/* ---- 未取得：墨のシルエット ---- */
.bk-sil {
  position: relative;
  flex: none;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.bk-sil img {
  position: absolute; inset: 8%;
  width: 84%; height: 84%;
  object-fit: contain;
  filter: brightness(0) blur(1.5px);
  opacity: 0;
}
.bk-sil.has-img img { opacity: .5; }
.bk-sil.has-img .bk-sil-blot { opacity: .25; }
.bk-sil-blot {
  display: block;
  width: 70%; height: 70%;
  border-radius: 48% 52% 44% 56% / 55% 45% 55% 45%;
  background: radial-gradient(closest-side at 46% 52%, rgba(26, 24, 22, .62), rgba(26, 24, 22, .38) 55%, rgba(26, 24, 22, 0) 100%);
  filter: blur(2px);
}
.bk-sil.kind-kaii .bk-sil-blot { border-radius: 50% 50% 30% 70% / 70% 60% 40% 30%; transform: scaleY(1.15); }
.bk-sil.kind-place .bk-sil-blot { border-radius: 10% 10% 6% 6%; transform: scaleX(1.1); }
.bk-cell-sil { width: 66px; height: 66px; }
.bk-detail-sil { width: min(60%, 260px); aspect-ratio: 1 / 1; height: auto; }
.bk-sil-bar {
  display: inline-block;
  vertical-align: middle;
  width: 6.5em; max-width: 70%;
  height: .7em;
  border-radius: 1em;
  background: linear-gradient(90deg, rgba(26, 24, 22, 0), rgba(26, 24, 22, .4) 12%, rgba(26, 24, 22, .32) 80%, rgba(26, 24, 22, 0));
  filter: blur(.6px);
}
.bk-cell.is-got .bk-cell-seal { position: absolute; top: 5px; left: 5px; font-size: .62em; }

/* ---- 結末 ---- */
.bk-end-list { list-style: none; padding: 0 0 0 .4em; }
.bk-end-list li { display: flex; align-items: center; gap: .5em; min-height: 2em; }
.bk-end-seal { font-size: .62em; }

/* ---- 共通の文 ---- */
.bk-lead { margin: .2em 0 .5em; font-size: .85em; color: var(--bk-ink2); }
.bk-note { margin: .8em 0 .2em; font-size: .8em; color: var(--bk-ink2); text-align: center; }

/* ---- 気づき ---- */
.bk-nlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35em; }
.bk-nitem {
  display: flex; align-items: center; gap: .6em;
  min-height: 48px;
  padding: .35em .6em;
  border: 1px solid rgba(34, 32, 28, .25);
  border-radius: 3px;
  background: rgba(255, 252, 242, .45);
}
.bk-nitem.is-none { border-style: dashed; background: rgba(60, 45, 25, .05); color: var(--bk-ink2); }
.bk-n-seal { font-size: .62em; }
.bk-n-blot {
  flex: none; width: 1.3em; height: 1.3em; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(26, 24, 22, .55), rgba(26, 24, 22, 0));
}
.bk-n-hint { font-size: .85em; }

/* ---- 人物帖 ---- */
.bk-person {
  margin: .5em 0 .8em;
  padding: .5em .7em .6em .9em;
  border-left: 4px solid var(--pc, #8a7a66);
  background: rgba(255, 252, 242, .4);
  border-radius: 0 3px 3px 0;
}
.bk-person.is-none { border-left-color: rgba(26, 24, 22, .35); background: rgba(60, 45, 25, .05); }
.bk-person-h { margin: 0 0 .15em; display: flex; align-items: baseline; gap: .4em; font-size: 1.1em; }
.bk-person-name { font-weight: 700; letter-spacing: .12em; }
.bk-person-sub { font-size: .75em; color: var(--bk-ink2); font-weight: 400; }
.bk-person-meta { font-size: .78em; color: var(--bk-ink2); }
.bk-person-lines { list-style: none; margin: .35em 0 0; padding: 0; display: flex; flex-direction: column; gap: .25em; }
.bk-person-lines li { position: relative; padding-left: 1em; }
.bk-person-lines li::before { content: ""; position: absolute; left: .1em; top: .75em; width: .38em; height: .38em; background: var(--pc, #8a7a66); transform: rotate(45deg); }
.bk-person-lines li.is-lock { color: var(--bk-ink2); }
.bk-person-lines li.is-lock::before { background: rgba(26, 24, 22, .3); }
.bk-line-lock { margin-left: .5em; font-size: .75em; }
.bk-line-seal { font-size: .58em; margin-right: .4em; }
.bk-person-sil { width: 5em; }

/* ---- 道しるべ ---- */
.bk-route { list-style: none; margin: .2em 0 0; padding: 0 0 0 1.1em; position: relative; }
.bk-route::before { /* 通った道の墨の線 */
  content: ""; position: absolute; left: .42em; top: .6em; bottom: .6em; width: 3px;
  background: linear-gradient(180deg, rgba(26, 24, 22, .85), rgba(26, 24, 22, .6));
  border-radius: 2px;
}
.bk-route-ch { margin: .6em 0 .25em -1.1em; font-size: .82em; color: var(--bk-shu); font-weight: 700; letter-spacing: .12em; }
.bk-route-node { position: relative; margin: 0 0 .7em; padding: .4em .6em .5em; background: rgba(255, 252, 242, .45); border: 1px solid rgba(34, 32, 28, .22); border-radius: 3px; }
.bk-route-node::before { content: ""; position: absolute; left: -1.03em; top: .8em; width: .7em; height: .7em; border-radius: 50%; background: var(--bk-ink); box-shadow: 0 0 0 3px var(--bk-paper); }
.bk-route-title { display: flex; align-items: baseline; gap: .5em; flex-wrap: wrap; }
.bk-route-kind { font-size: .72em; padding: 0 .4em; border: 1px solid rgba(34, 32, 28, .4); border-radius: 2px; color: var(--bk-ink2); }
.bk-route-name { font-weight: 700; }
.bk-route-opts { list-style: none; margin: .3em 0 0; padding: 0 0 0 .3em; display: flex; flex-direction: column; gap: .2em; }
.bk-route-opts li { position: relative; padding-left: 1.3em; min-height: 1.6em; }
.bk-route-opts li::before { content: ""; position: absolute; left: 0; top: .78em; width: .95em; height: 0; border-top: 3px solid rgba(26, 24, 22, .8); border-radius: 2px; }
.bk-route-opts li.is-q { color: rgba(34, 32, 28, .5); }
.bk-route-opts li.is-q::before { border-top: 2px dashed rgba(26, 24, 22, .35); }
.bk-route-q { font-weight: 700; }
.bk-route-jump {
  margin-top: .45em;
  min-height: 48px;
  width: 100%;
  padding: .3em .8em;
  border: 1.5px solid rgba(34, 32, 28, .6);
  border-radius: 3px;
  background: rgba(255, 252, 242, .7);
  color: var(--bk-ink);
  font: inherit;
  font-size: .85em;
  cursor: pointer;
}
.bk-route-jump:hover, .bk-route-jump:focus-visible { background: rgba(34, 32, 28, .08); outline: 2px solid rgba(184, 50, 42, .5); outline-offset: 1px; }

/* ---- 絵 ---- */
.bk-ggrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(30%, 120px), 1fr)); gap: .45em; }
.bk-gcell {
  position: relative;
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 1px solid rgba(34, 32, 28, .35);
  border-radius: 3px;
  background: rgba(60, 45, 25, .06);
  overflow: hidden;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.bk-gcell.is-none { border-style: dashed; cursor: default; }
.bk-gcell:not(.is-none):hover, .bk-gcell:focus-visible { outline: 2px solid rgba(184, 50, 42, .6); outline-offset: 1px; }
.bk-gimg { position: absolute; inset: 0; background: #111 center / cover no-repeat; }
.bk-g-seal { position: absolute; top: 4px; right: 4px; font-size: .62em; }
.bk-detail-inner.is-picture { padding: .6em; }
.bk-gbig { width: 100%; flex: 1 1 auto; min-height: 60vh; background: #000 center / contain no-repeat; border-radius: 3px; }

/* ---- 曲 ---- */
.bk-mlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35em; }
.bk-mrow { display: flex; align-items: center; gap: .6em; min-height: 52px; }
.bk-mrow.is-none { padding: 0 .8em; border: 1px dashed rgba(34, 32, 28, .3); border-radius: 3px; color: var(--bk-ink2); }
.bk-mplay {
  display: flex; align-items: center; gap: .7em;
  width: 100%;
  min-height: 52px;
  padding: .3em .9em;
  border: 1px solid rgba(34, 32, 28, .35);
  border-radius: 3px;
  background: rgba(255, 252, 242, .5);
  color: var(--bk-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  position: relative;
}
.bk-mplay:hover, .bk-mplay:focus-visible { background: rgba(255, 252, 242, .85); outline: 2px solid rgba(184, 50, 42, .5); outline-offset: 1px; }
.bk-micon { flex: none; width: 1.6em; text-align: center; color: var(--bk-shu); }
.bk-mname { flex: 1 1 auto; }
.bk-mrow.is-playing .bk-mplay { background: rgba(184, 50, 42, .1); border-color: var(--bk-shu); font-weight: 700; }
.bk-m-seal { font-size: .62em; }

/* ---- 称号の札 ---- */
.bk-detail-inner.is-card { gap: .45em; }
.bk-cardbox { width: min(100%, 380px); display: flex; align-items: center; justify-content: center; min-height: 200px; }
.bk-cardimg { width: 100%; height: auto; max-height: 52vh; object-fit: contain; box-shadow: 0 6px 22px rgba(60, 40, 20, .35); border-radius: 2px; }
.bk-cardwait { color: var(--bk-ink2); }
.bk-cardrow { display: flex; flex-wrap: wrap; justify-content: center; gap: .5em; width: 100%; }
.bk-cardrow .bk-close { min-width: 40%; letter-spacing: .15em; padding-left: 1.2em; }
.bk-cardhint { flex-basis: 100%; margin: .1em 0 0; }

/* 記録帳はタブの分だけ縦がつまるので、低い画面では見出しを少し小さく */
@media (max-height: 700px) {
  .bk-head { padding-top: .4em; padding-bottom: .35em; }
  .bk-title { font-size: 1.2em; }
  .bk-x { width: 48px; height: 48px; }
  .bk-stat-num { font-size: 1.1em; }
}

/* 見出しの数・「あと◯」は折らない（1123c extras） */
.bk-sec-name { min-width: 0; }
.bk-sec-n, .bk-sec-left { white-space: nowrap; flex: none; }
.bk-sec-h { flex-wrap: nowrap; }
.bk-person-meta .ph, .bk-person-meta > span { white-space: nowrap; }
.bk-person-meta { display: flex; flex-wrap: wrap; column-gap: 1em; }
.bk-cardrow .bk-close { min-width: 0; flex: 1 1 40%; max-width: 14em; }
/* 文字「大」でタブが入りきらないときは2段に（横に隠さない） */
.bk-tabs { flex-wrap: wrap; overflow: visible; }

/* 1123c つなぎこみ：選んだ一覧の項目に fx.inkspread（墨のにじみ）を置く。文字は上に */
.xp-item { position: relative; overflow: hidden; }
.xp-item > .fx-ink { z-index: 0; opacity: .7; }
.xp-item > :not(.fx-ink) { position: relative; z-index: 1; }
