/* 百鬼国盗 攻略wiki。色と書体は紹介ページ（/hyakki/style.css）とゲームの UI に合わせる */
:root {
  --bg: #0a1226;
  --bg-2: #0e1832;
  --panel: #13203f;
  --panel-2: #1a2b52;
  --line: rgba(230, 196, 115, .2);
  --line-2: rgba(230, 196, 115, .45);
  --text: #f6efdf;
  --muted: #bdb5a2;
  --gold: #e6c473;
  --gold-l: #f4dc9c;
  --gold-hi: #ffd54a;
  --shu: #c23a27;
  --shu-l: #df5a40;
  --ally: #4f9cff;
  --good: #7fd09a;
  --radius: 12px;
  --wrap: 1240px;
  --bar-h: 60px;
  --font: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", sans-serif;
  --font-title: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--bar-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-weight: 500; line-height: 1.8; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: var(--gold-l); text-underline-offset: 3px; }
a:hover { color: #fff; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
:focus-visible { outline: 3px solid var(--gold-hi); outline-offset: 2px; border-radius: 6px; }
b { font-weight: 700; color: #fff; }
.small { font-size: 13px; color: var(--muted); }

/* ほぬらぼの帯 */
.studio { background: #060a18; font-size: 13px; }
.studio .wrap { display: flex; align-items: center; gap: 12px; min-height: 34px; }
.studio a { color: var(--muted); text-decoration: none; font-weight: 700; }
.studio a:hover { color: #fff; }
.studio span { color: rgba(189, 181, 162, .5); }
.studio-logo img { height: 18px; width: auto; display: block; }

/* 上のバー */
.bar { position: sticky; top: 0; z-index: 40; height: var(--bar-h); background: rgba(10, 18, 38, .9); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.bar .wrap { height: 100%; display: flex; align-items: center; gap: 16px; }
.bar-logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.bar-logo img { height: 34px; width: auto; display: block; }
.bar-logo b { font-family: var(--font-title); font-size: 17px; color: var(--gold-l); white-space: nowrap; }
.menu-btn { display: none; width: 40px; height: 40px; border: 1px solid var(--line-2); border-radius: 10px; background: transparent; cursor: pointer; padding: 0; position: relative; flex: none; }
.menu-btn span, .menu-btn span::before, .menu-btn span::after { position: absolute; left: 10px; width: 18px; height: 2px; background: var(--gold-l); content: ""; transition: transform .2s; }
.menu-btn span { top: 19px; }
.menu-btn span::before { left: 0; top: -6px; }
.menu-btn span::after { left: 0; top: 6px; }
.search { position: relative; margin-left: auto; width: min(320px, 40vw); }
.search input { width: 100%; height: 38px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); padding: 0 16px; font: inherit; font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.results { position: absolute; top: 44px; left: 0; right: 0; max-height: 60vh; overflow: auto; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .5); padding: 6px; }
.results a { display: block; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: 14px; line-height: 1.5; }
.results a small { color: var(--muted); margin-left: 8px; font-size: 12px; }
.results a:hover, .results a.on { background: var(--panel-2); }
.results p { margin: 8px 10px; color: var(--muted); font-size: 14px; }

/* AIに相談 */
.ask { position: relative; flex: none; }
.search + .ask { margin-left: -6px; }
.ask-btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--gold-l); font: inherit; font-size: 14px; font-weight: 900; cursor: pointer; white-space: nowrap; }
.ask-btn:hover, .ask-btn[aria-expanded="true"] { background: var(--panel-2); color: #fff; }
.ask-pop { position: absolute; z-index: 70; top: 46px; right: 0; width: min(340px, calc(100vw - 24px)); background: var(--panel); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: 0 16px 40px rgba(0, 0, 0, .55); padding: 14px; }
.ask-h { margin: 0 0 8px; font-family: var(--font-title); color: var(--gold-l); font-size: 15px; }
.ask-pop textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); padding: 8px 10px; font: inherit; font-size: 16px; line-height: 1.5; }
.ask-pop textarea::placeholder { color: var(--muted); font-size: 14px; }
.ask-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.ask-list a { position: relative; display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--bg-2); color: var(--text); text-decoration: none; font-weight: 900; font-size: 14px; }
.ask-list a:hover { background: var(--panel-2); color: #fff; }
.ask-list a.last { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold); }
.ask-list a.last::after { content: "いつもの"; position: absolute; top: -8px; right: 6px; padding: 0 6px; border-radius: 999px; background: var(--gold); color: #1a1205; font-size: 10px; line-height: 16px; }
.ask-note { margin: 10px 0 0; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* ボタン */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; font-weight: 900; color: #fff; background: linear-gradient(180deg, var(--shu-l), var(--shu)); border: 1px solid rgba(255, 220, 160, .45); border-radius: 999px; padding: 10px 24px; box-shadow: 0 4px 0 #7a1c10; }
.btn:hover { color: #fff; filter: brightness(1.08); }
.btn.sm { padding: 6px 16px; font-size: 14px; box-shadow: 0 3px 0 #7a1c10; flex: none; }
.btn.ghost { background: transparent; box-shadow: none; border-color: var(--line-2); color: var(--gold-l); }

/* レイアウト */
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 36px; padding-top: 24px; padding-bottom: 64px; }
.side { position: sticky; top: calc(var(--bar-h) + 16px); align-self: start; max-height: calc(100vh - var(--bar-h) - 32px); overflow: auto; font-size: 14px; padding-right: 4px; }
.side-h { margin: 18px 0 4px; font-size: 12px; color: var(--gold); letter-spacing: .1em; font-weight: 900; }
.side-h:first-child { margin-top: 0; }
.side ul { list-style: none; margin: 0; padding: 0; }
.side a { display: block; padding: 5px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 700; }
.side li.sub a { padding-left: 26px; font-size: 13px; }
.side a:hover { color: #fff; background: rgba(255, 255, 255, .05); }
.side a[aria-current="page"] { color: #fff; background: var(--panel-2); box-shadow: inset 3px 0 0 var(--gold); }
.main { min-width: 0; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
h1, h2, h3 { font-family: var(--font-title); font-weight: 800; line-height: 1.4; }
h1 { font-size: clamp(28px, 4vw, 38px); margin: 0 0 16px; color: var(--gold-l); }
h2 { font-size: 24px; margin: 44px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line-2); color: #fff; }
h3 { font-size: 19px; margin: 28px 0 10px; color: var(--gold-l); }
.main > h2:first-child, .toc + h2 { margin-top: 20px; }
p { margin: 0 0 14px; }
ul, ol { margin: 0 0 16px; padding-left: 1.4em; }
li { margin: 4px 0; }
ol.steps { list-style: none; padding: 0; counter-reset: s; }
ol.steps li { counter-increment: s; position: relative; padding: 8px 12px 8px 46px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; margin: 6px 0; }
ol.steps li::before { content: counter(s); position: absolute; left: 12px; top: 9px; width: 24px; height: 24px; border-radius: 50%; background: var(--shu); color: #fff; font-weight: 900; font-size: 13px; display: grid; place-items: center; line-height: 1; }
.note { background: rgba(230, 196, 115, .08); border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 10px; padding: 10px 14px; margin: 14px 0; font-size: 14px; color: var(--muted); }

/* 目次 */
.toc { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; margin: 0 0 20px; font-size: 14px; }
.toc p { margin: 0 0 4px; font-weight: 900; color: var(--gold); font-size: 13px; }
.toc ul { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 24px; }
.toc li { margin: 2px 0; break-inside: avoid; }
.toc li.l3 { padding-left: 1em; font-size: 13px; }
.toc a { color: var(--text); text-decoration: none; }
.toc a:hover { color: var(--gold-l); text-decoration: underline; }

/* 表 */
.tbl-wrap { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 14px; line-height: 1.6; }
th, td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
th { background: var(--panel-2); color: var(--gold-l); font-weight: 900; white-space: nowrap; font-size: 13px; }
tbody tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
tbody tr:last-child td { border-bottom: 0; }
td img.face, td img.mon { vertical-align: middle; margin-right: 6px; }
.stats-tbl td { font-size: 18px; font-weight: 900; color: #fff; text-align: center; }
.stats-tbl th { text-align: center; }
.waza-tbl td:first-child { white-space: nowrap; color: var(--gold); font-weight: 900; }
.waza-tbl td:nth-child(2) { white-space: nowrap; }
.stage-tbl td { white-space: nowrap; vertical-align: middle; }
.stage-tbl td:last-child { white-space: normal; }
.foes { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.foes img { margin: 0 !important; background: var(--bg-2); border-radius: 6px; }

/* 名前と説明 */
.dl { margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.dl > div { display: grid; grid-template-columns: 180px 1fr; border-bottom: 1px solid var(--line); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { background: var(--panel); padding: 9px 14px; font-weight: 700; color: var(--gold-l); }
.dl dd { margin: 0; padding: 9px 14px; font-size: 15px; }
.stats { font-size: 14px; color: var(--muted); }
.stats span { color: var(--line-2); margin: 0 4px; }

/* 札 */
.tag { display: inline-block; font-family: var(--font); font-size: 12px; font-weight: 900; line-height: 1; padding: 4px 8px; border-radius: 999px; background: var(--panel-2); color: var(--gold-l); border: 1px solid var(--line-2); margin-left: 6px; vertical-align: middle; text-decoration: none; white-space: nowrap; }
.tag.good { color: var(--good); border-color: rgba(127, 208, 154, .5); }
.tag.warn { color: #ffb59e; border-color: rgba(223, 90, 64, .6); }
.tag.gold { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.tag.muted { color: var(--muted); border-color: var(--line); }
.tags .tag:first-child { margin-left: 0; }
.tag.role-small { color: #c9e2a8; border-color: #5d8a4a; }
.tag.role-medium { color: #b8c6f2; border-color: #4c5f9e; }
.tag.role-elite { color: #f5b9a0; border-color: #b1452f; }
.tag.role-boss { color: #ffe08a; border-color: #9c7a1c; }
.tag.role-rival { color: #f39ab8; border-color: #6e1f3a; }

/* カード */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin: 0 0 20px; }
.card { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--text); }
.card b { font-size: 16px; }
.card small { color: var(--muted); font-size: 13px; line-height: 1.6; }
.char-card { flex-direction: row; align-items: center; gap: 12px; }
.char-card > div { display: flex; flex-direction: column; }
.char-card span { font-size: 13px; line-height: 1.5; margin-top: 2px; }
img.face { border-radius: 50%; background: radial-gradient(circle at 50% 40%, #2a3f73, #13203f); object-fit: cover; flex: none; }

/* キャラ */
.char-hero { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: center; margin-bottom: 8px; }
.char-hero .portrait { width: 100%; height: auto; filter: drop-shadow(0 12px 24px rgba(0, 0, 0, .5)); }
.kana { color: var(--muted); margin: 0 0 10px; letter-spacing: .2em; }
.jutsu { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 18px 14px; margin: 0 0 12px; }
.jutsu h3 { margin-top: 14px; }
.ougi { margin-top: 8px; padding: 10px 14px; border-radius: 10px; background: linear-gradient(90deg, rgba(194, 58, 39, .22), rgba(194, 58, 39, .05)); border: 1px solid rgba(223, 90, 64, .4); font-size: 14px; }

/* 建物 */
.build-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 12px; margin-bottom: 18px; }
.build { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.build h3 { margin: 2px 0 4px; font-size: 18px; }
.build p { margin: 0 0 6px; font-size: 14px; }
.bimg { width: 84px; height: 84px; object-fit: contain; flex: none; }

/* 式神 */
.shiki { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 0 0 16px; }
.shiki h3 { margin-top: 6px; }
.shiki-forms { display: flex; gap: 10px; flex-wrap: wrap; }
.shiki-forms figure { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }
.shiki-forms img { width: 110px; height: 110px; border-radius: 12px; background: radial-gradient(circle at 50% 45%, #2a3f73, #0e1832); display: block; }

/* 図鑑 */
.mon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; margin-bottom: 18px; }
.mon-card { display: flex; gap: 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; scroll-margin-top: calc(var(--bar-h) + 16px); }
.mon-card:target { border-color: var(--gold-hi); box-shadow: 0 0 0 2px rgba(255, 213, 74, .35); }
.mon-card h3 { margin: 0; font-size: 17px; color: #fff; }
.mon-card p { margin: 0; line-height: 1.6; }
.mon-card .no { font-size: 12px; color: var(--muted); }
.mon-card .tags { margin: 4px 0; }
img.mon { border-radius: 10px; background: radial-gradient(circle at 50% 45%, #2a3f73, #0e1832); flex: none; object-fit: contain; }

/* トップ */
.top-hero { text-align: center; padding: 18px 0 8px; }
.top-hero img { width: min(420px, 80%); height: auto; display: block; margin: 0 auto 8px; }
.top-hero p { color: var(--muted); }
.top-hero .btn { margin: 4px; }

.foot { border-top: 1px solid var(--line); background: #060a18; padding: 20px 0; font-size: 14px; color: var(--muted); }
.foot p { margin: 0 0 4px; }
.foot a { color: var(--muted); }

/* スマホ */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 12px; }
  .menu-btn { display: block; }
  .bar { z-index: 60; }
  .side { position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; align-self: stretch; width: min(300px, 84vw); max-height: none; overscroll-behavior: contain; background: var(--bg-2); border-right: 1px solid var(--line-2); padding: calc(var(--bar-h) + 50px) 16px 24px; transform: translateX(-105%); transition: transform .2s; box-shadow: 0 0 40px rgba(0, 0, 0, .6); }
  body.menu-open { overflow: hidden; }
  body.menu-open .side { transform: none; }
  body.menu-open .menu-btn span { background: transparent; }
  body.menu-open .menu-btn span::before { transform: translateY(6px) rotate(45deg); }
  body.menu-open .menu-btn span::after { transform: translateY(-6px) rotate(-45deg); }
  .bar-logo img { height: 28px; }
  .bar-logo b { font-size: 15px; }
  .search { width: auto; flex: 1; min-width: 0; }
  .bar .btn.sm { display: none; }
  .ask-btn { width: 40px; padding: 0; justify-content: center; }
  .ask-btn span { display: none; }
  .search + .ask { margin-left: -8px; }
  .toc ul { columns: 1; }
  .char-hero { grid-template-columns: 1fr; text-align: left; }
  .char-hero .portrait { max-width: 220px; margin: 0 auto; display: block; }
  .dl > div { grid-template-columns: 1fr; }
  .dl dt { padding-bottom: 4px; }
  h2 { font-size: 21px; }
  .build-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 16px; }
  .bar .wrap { gap: 10px; }
  .bar-logo img { display: none; }
  th, td { padding: 7px 9px; }
}

/* 攻略実績 */
.warn-note { border-left-color: var(--shu-l); color: var(--text); }
.rec-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 0 0 8px; }
.rec-sum > div { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; text-align: center; }
.rec-sum b { display: block; font-size: 22px; font-family: var(--font-title); color: var(--gold-l); line-height: 1.3; }
.rec-sum small { color: var(--muted); font-size: 12px; }
.rbars { max-width: 640px; }
.rb { display: grid; grid-template-columns: 120px 1fr 86px; align-items: center; gap: 10px; font-size: 14px; margin: 5px 0; }
.rb-l { display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-t { height: 10px; background: rgba(255, 255, 255, .06); border-radius: 999px; overflow: hidden; }
.rb-t i { display: block; height: 100%; background: linear-gradient(90deg, var(--shu), var(--shu-l)); border-radius: 999px; }
.rb-t.lv i { background: linear-gradient(90deg, #a57c36, var(--gold)); }
.rb-v { text-align: right; font-weight: 700; white-space: nowrap; }
.rb-v small { color: var(--muted); font-weight: 500; }
.rec-builds { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.rec-build { background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 16px 12px; }
.rec-build h3 { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; }
.rec-build .rb { grid-template-columns: 76px 1fr 46px; font-size: 13px; margin: 3px 0; }
.rec-h { margin: 10px 0 2px; font-size: 12px; font-weight: 900; color: var(--gold); }
.rec-rank { margin: 0; padding-left: 1.4em; font-size: 14px; }
.rec-rank li { margin: 1px 0; }
.rec-rank small { color: var(--muted); margin-left: 8px; }
.rec-diff { display: flex; gap: 6px; margin: 0 0 12px; }
.rec-diff button { border: 1px solid var(--line-2); background: transparent; color: var(--muted); border-radius: 999px; padding: 5px 16px; font-weight: 700; cursor: pointer; }
.rec-diff button[aria-selected="true"] { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.rec-diff button:disabled { opacity: .35; cursor: default; }
.rec-country { margin: 0 0 10px; }
.rec-country summary { cursor: pointer; font-family: var(--font-title); font-size: 18px; font-weight: 800; color: var(--gold-l); padding: 6px 0; }
.rec-country summary small { font-family: var(--font); font-size: 12px; color: var(--muted); margin-left: 10px; font-weight: 500; }
.rec-tbl td { white-space: nowrap; vertical-align: middle; }
.rec-tbl th small, .rec-tbl td small { color: var(--muted); font-weight: 500; }
.rec-tbl tr.dim td { color: var(--muted); }
.rec-tbl .good { color: var(--good); font-weight: 900; }
.rate { display: inline-block; width: 48px; height: 6px; background: rgba(255, 255, 255, .08); border-radius: 999px; overflow: hidden; margin-right: 6px; vertical-align: middle; }
.rate i { display: block; height: 100%; background: var(--good); }
.cstack { display: inline-flex; width: 90px; height: 10px; border-radius: 999px; overflow: hidden; vertical-align: middle; background: rgba(255, 255, 255, .06); }
.cstack i { display: block; height: 100%; }
.nw { white-space: nowrap; }
.cdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.c-akari { background: #ef7a4f; }
.c-kazamaru { background: #4f9cff; }
.c-suzune { background: #c46be0; }
.c-yuzuha { background: #f2c84b; }
@media (max-width: 520px) {
  .rec-sum { grid-template-columns: repeat(2, 1fr); }
  .rb { grid-template-columns: 96px 1fr 70px; }
}

/* 画面の写真（押すと拡大） */
.shots { display: flex; flex-wrap: wrap; gap: 16px; margin: 14px 0 20px; }
.shot { margin: 0; width: 220px; }
.shot a { display: block; border-radius: 14px; overflow: hidden; border: 1px solid var(--line-2); background: #000; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; }
.shot figcaption { margin-top: 6px; font-size: 13px; line-height: 1.55; color: var(--muted); }
@media (max-width: 520px) {
  .shots { gap: 10px; }
  .shot { width: calc(50% - 5px); }
  .shot:only-child { width: 64%; }
}
.zoom { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(4, 8, 20, .9); cursor: zoom-out; }
.zoom img { max-width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); width: auto; height: auto; border-radius: 16px; box-shadow: 0 10px 40px rgba(0, 0, 0, .6); }
