@correct_culture_primary_score = 100
@better_than_the_alternatives_score = 50
@always_primary_score = 1000
@never_primary_score = -1000

e_japan = {
	color = { 255 100 255 }

	capital = c_yamashiro

	landless = no

	can_create = {}

	ai_primary_priority = {
		if = {
			limit = {
				culture = { has_cultural_pillar = heritage_japonic }
			}
			add = @correct_culture_primary_score
		}
	}

	# Ceremonial Liege/Regent in personal relation summary
	#
	# Scopes
	# ------
	# root: Inspected character (who holds this title).
	# target: Character we are evaluating relationships to (usually local player).
	# title: This title (held by inspected character).
	# liege: Inspected characters liege.
	# vassal: Vassal who matches the trigger below, if any.
	#
	# Alternate descriptions are provided to trim the extra "Your" before this entry in the summary.
	#
	personal_relation_entry = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:target
					scope:vassal ?= scope:target
				}
				desc = japan_personal_relation_ceremonial_regent_same
			}
			triggered_desc = {
				trigger = { exists = scope:vassal }
				desc = japan_personal_relation_ceremonial_regent_other
			}
		}
	}
	personal_relation_vassal = {
		has_title = title:k_chrysanthemum_throne
	}

	k_yamato = {
		color = { 96 3 6 }

		capital = c_yamashiro
		can_be_named_after_dynasty = no

		can_create = {
			japan_government_japan_kingdom_restriction_trigger = yes
		}

		ai_primary_priority = {
			if = {
				limit = { culture = culture:japanese }
				add = @correct_culture_primary_score
			}
		}

		d_kinai = {
			color = { 68 18 14 }

			capital = c_yamashiro
			can_be_named_after_dynasty = no

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_yamashiro = {
				color = { 77 7 3 }
				can_be_named_after_dynasty = no

				b_kyo = {
					province = 10603
					
					color = { 84 9 11 }
				}
				b_uji = {
					province = 10604
					
					color = { 54 25 20 }
				}
			}
			
			c_settsu = {
				color = { 46 26 23 }
				can_be_named_after_dynasty = no

				b_fukuhara = {
					province = 10598
					
					color = { 36 21 19 }
				}
				b_watanabe = {
					province = 10599
					
					color = { 74 19 15 }
				}
				b_nose = {
					province = 10600
					
					color = { 76 66 64 }
				}
			}

			c_yamato = {
				color = { 101 61 60 }
				can_be_named_after_dynasty = no

				b_yoshino = {
					province = 10613
					
					color = { 62 31 28 }
				}
				b_kofuku_ji = {
					province = 10609
					
					color = { 138 97 99 }
				}
				b_omine = {
					province = 10610
					
					color = { 135 60 60 }
				}
				b_totsukawa = {
					province = 10611
					
					color = { 172 151 150 }
				}
			}

			c_kawachi = {
				color = { 115 9 1 }

				b_kawachi = {
					province = 10606
					
					color = { 149 43 44 }
				}
				b_otori = {
					province = 10601
					
					color = { 69 30 24 }
				}
				b_izumi = {
					province = 10602
					
					color = { 160 5 5 }
				}
			}
		}

		d_nankaido = {
			color = { 131 1 8 }

			capital = c_iyo
			can_be_named_after_dynasty = no

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_iyo = {
				color = { 79 29 28 }
				can_be_named_after_dynasty = no

				b_iyo = {
					province = 10506
					
					color = { 82 23 22 }
				}
				b_ishizuchi = {
					province = 10507
					
					color = { 53 31 33 }
				}
				b_uma = {
					province = 10508
					
					color = { 110 70 67 }
				}
				b_kita_iyo = {
					province = 10509
					
					color = { 109 5 4 }
				}
				b_uwa = {
					province = 10510
					
					color = { 134 60 51 }
				}
			}

			c_awa = {
				color = { 171 23 39 }
				can_be_named_after_dynasty = no

				b_nakata = {
					province = 10511
					
					color = { 177 76 94 }
				}
				b_tsurugi = {
					province = 10513
					
					color = { 226 15 31 }
				}
				b_kaifu = {
					province = 10512
					
					color = { 103 2 5 }
				}
				b_naka_awa = {
					province = 10514
					
					color = { 183 27 48 }
				}
			}

			c_sanuki = {
				color = { 165 61 77 }
				can_be_named_after_dynasty = no

				b_yashima = {
					province = 10515
					
					color = { 205 29 62 }
				}
				b_kotohira = {
					province = 10517
					
					color = { 109 67 73 }
				}
				b_sangawa = {
					province = 10516
					
					color = { 226 129 148 }
				}
			}

			c_tosa = {
				color = { 99 2 1 }
				can_be_named_after_dynasty = no

				b_nagaoka = {
					province = 10501
					
					color = { 98 33 36 }
				}
				b_kami = {
					province = 10502
					
					color = { 132 10 0 }
				}
				b_aki = {
					province = 10503
					
					color = { 37 19 18 }
				}
				b_takaoka = {
					province = 10504
					
					color = { 159 98 100 }
				}
				b_hata = {
					province = 10505
					
					color = { 161 70 60 }
				}
			}

			c_kii = {
				color = { 192 6 2 }
				can_be_named_after_dynasty = no

				b_nagusa = {
					province = 10614
					
					color = { 120 28 21 }
				}
				b_kongobu_ji = {
					province = 10615
					
					color = { 247 6 12 }
				}
				b_hidaka = {
					province = 10616
					
					color = { 246 113 99 }
				}
				b_muro = {
					province = 10617
					
					color = { 175 25 11 }
				}
				b_kumano = {
					province = 10618
					
					color = { 190 67 75 }
				}
			}

			c_awaji = {
				color = { 212 124 125 }
				can_be_named_after_dynasty = no
				
				b_awaji = {
					province = 10608
					
					color = { 140 86 89 }
				}
			}
		}

		d_east_sanindo = {
			color = { 131 48 54 }

			capital = c_tanba
			can_be_named_after_dynasty = no

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_tanba = {
				color = { 183 21 31 }
				can_be_named_after_dynasty = no

				b_kuwada = {
					province = 10638
					
					color = { 250 61 76 }
				}
				b_funai = {
					province = 10640
					
					color = { 120 51 61 }
				}
				b_hikami = {
					province = 10639
					
					color = { 146 4 21 }
				}
			}

			c_tajima = {
				color = { 88 14 22 }
				can_be_named_after_dynasty = no

				b_keta_tajima = {
					province = 10635
					
					color = { 71 2 14 }
				}
				b_kinosaki = {
					province = 10634
					
					color = { 123 5 17 }
				}
				b_asago = {
					province = 10633
					
					color = { 123 55 60 }
				}
			}
			
			c_inaba = {
				color = { 168 104 113 }
				can_be_named_after_dynasty = no

				b_homi = {
					province = 10630
					
					color = { 220 147 152 }
				}
				b_yakami = {
					province = 10631
					
					color = { 104 53 62 }
				}
				b_takakusa = {
					province = 10632
					
					color = { 181 85 89 }
				}
			}

			c_tango = {
				color = { 172 58 72 }
				can_be_named_after_dynasty = no

				b_kumano_tango = {
					province = 10637
					
					color = { 194 112 123 }
				}
				b_kasa_tango = {
					province = 10636
					
					color = { 231 28 36 }
				}
			}
		}
		
		d_west_sanindo = {
			color = { 98 61 64 }

			capital = c_izumo
			can_be_named_after_dynasty = no

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_izumo = {
				color = { 137 104 107 }
				can_be_named_after_dynasty = no

				b_ou = {
					province = 10626
					
					color = { 117 89 93 }
				}
				b_kizuki_taisha = {
					province = 10623
					
					color = { 191 161 162 }
				}
				b_shimane = {
					province = 10624
					
					color = { 180 116 116 }
				}
				b_nita = {
					province = 10625
					
					color = { 59 42 44 }
				}
			}

			c_iwami = {
				color = { 71 48 51 }
				can_be_named_after_dynasty = no

				b_naka_iwami = {
					province = 10621
					
					color = { 56 32 34 }
				}
				b_kanoashi = {
					province = 10619
					
					color = { 106 83 85 }
				}
				b_mino = {
					province = 10620
					
					color = { 117 53 66 }
				}
				b_ochi = {
					province = 10622
					
					color = { 21 16 17 }
				}
			}
			
			c_hoki = {
				color = { 121 57 63 }
				can_be_named_after_dynasty = no

				b_kume = {
					province = 10627
					
					color = { 95 29 33 }
				}
				b_daisen = {
					province = 10628
					
					color = { 169 107 117 }
				}
				b_hino = {
					province = 10629
					
					color = { 165 49 58 }
				}
			}

			c_oki = {
				color = { 163 61 60 }
				can_be_named_after_dynasty = no

				b_oki = {
					province = 10641
					
					color = { 223 28 45 }
				}
			}
		}

		d_west_sanyodo = {
			color = { 37 22 23 }

			capital = c_aki
			can_be_named_after_dynasty = no

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_aki = {
				color = { 33 23 24 }
				can_be_named_after_dynasty = no

				b_kamo = {
					province = 10575
					
					color = { 36 21 22 }
				}
				b_itsukushima = {
					province = 10576
					
					color = { 56 50 51 }
				}
				b_yamagata = {
					province = 10574
					
					color = { 56 28 34 }
				}
				b_takada = {
					province = 10577
					
					color = { 20 19 19 }
				}
			}

			c_bingo = {
				color = { 63 21 21 }
				can_be_named_after_dynasty = no

				b_yasuna = {
					province = 10579
					
					color = { 44 20 21 }
				}
				b_mitsugi = {
					province = 10578
					
					color = { 86 11 6 }
				}
				b_konu = {
					province = 10580
					
					color = { 97 67 67 }
				}
				b_mikami = {
					province = 10581
					
					color = { 106 44 49 }
				}
			}

			c_nagato = {
				color = { 63 54 55 }
				can_be_named_after_dynasty = no

				b_toyora = {
					province = 10566
					
					color = { 43 34 36 }
				}
				b_asa = {
					province = 10567
					
					color = { 88 80 81 }
				}
				b_otsu = {
					province = 10569
					
					color = { 73 55 57 }
				}
				b_abu = {
					province = 10568
					
					color = { 20 15 16 }
				}
			}

			c_suo = {
				color = { 62 35 40 }
				can_be_named_after_dynasty = no

				b_yoshiki = {
					province = 10570
					
					color = { 56 30 36 }
				}
				b_tsuno = {
					province = 10573
					
					color = { 100 82 84 }
				}
				b_kumage = {
					province = 10572
					
					color = { 98 29 48 }
				}
				b_kuga = {
					province = 10571
					
					color = { 20 17 17 }
				}
			}
		}
		
		d_east_sanyodo = {
			color = { 163 112 113 }

			capital = c_harima
			can_be_named_after_dynasty = no

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}
			
			c_harima = {
				color = { 143 112 110 }
				can_be_named_after_dynasty = no

				b_shikama = {
					province = 10594
					
					color = { 172 146 145 }
				}
				b_ibo = {
					province = 10593
					
					color = { 89 64 65 }
				}
				b_akashi = {
					province = 10595
					
					color = { 226 145 148 }
				}
				b_shiso = {
					province = 10596
					
					color = { 229 207 204 }
				}
				b_taka = {
					province = 10597
					
					color = { 153 95 95 }
				}
			}
			
			c_bitchu = {
				color = { 222 130 128 }
				can_be_named_after_dynasty = no

				b_kuboya = {
					province = 10583
					
					color = { 182 106 102 }
				}
				b_kibitsu = {
					province = 10584
					
					color = { 250 110 103 }
				}
				b_tetta = {
					province = 10585
					
					color = { 240 177 173 }
				}
			}

			c_bizen = {
				color = { 217 172 176 }
				can_be_named_after_dynasty = no

				b_joto = {
					province = 10589
					
					color = { 154 115 120 }
				}
				b_oku = {
					province = 10587
					
					color = { 248 216 222 }
				}
			}

			c_mimasaka = {
				color = { 99 59 59 }
				can_be_named_after_dynasty = no

				b_tomata = {
					province = 10592
					
					color = { 127 88 84 }
				}
				b_mashima = {
					province = 10590
					
					color = { 60 28 27 }
				}
				b_aida = {
					province = 10591
					
					color = { 124 50 49 }
				}
			}
		}
	}

	k_aynumosir = {
		color = { 141 70 23 }

		capital = c_sum

		can_create = {
			japan_government_japan_kingdom_restriction_trigger = yes
		}

		cultural_names = {
			name_list_yamato = cn_ezo
			name_list_emishi = cn_oshima
			name_list_han = cn_kuye
			name_list_mohe = cn_sahaliyan
			name_list_jurchen = cn_sahaliyan
			name_list_nivkh = cn_ygh_mif
		}
		
		d_menas = {
			color = { 141 70 23 }
			
			capital = c_simenas

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			cultural_names = {
				name_list_yamato = cn_east_hokkaido
				name_list_emishi = cn_east_oshima
			}
			
			c_simenas = {
				color = { 60 75 95 }

				cultural_names = {
					name_list_yamato = cn_kushiro
					name_list_emishi = cn_kushiro
				}

				b_kusuri = {
					province = 10790

					cultural_names = {
						name_list_yamato = cn_kushiro
						name_list_emishi = cn_kushiro
					}

					color = { 60 75 95 }
				}
				b_cipasir = {
					province = 10791

					cultural_names = {
						name_list_yamato = cn_abashiri
						name_list_emishi = cn_abashiri
					}

					color = { 60 75 95 }
				}
				b_nimuoro = {
					province = 10792

					cultural_names = {
						name_list_yamato = cn_nemuro
						name_list_emishi = cn_nemuro
					}

					color = { 60 75 95 }
				}
				b_sir_etok = {
					province = 10793

					cultural_names = {
						name_list_yamato = cn_shiretoko
						name_list_emishi = cn_shiretoko
					}

					color = { 60 75 95 }
				}
			}

			c_menas = {
				color = { 35 50 85 }

				cultural_names = {
					name_list_yamato = cn_tokachi
					name_list_emishi = cn_tokachi
				}

				b_pior = {
					province = 10787

					cultural_names = {
						name_list_yamato = cn_hiro_o
						name_list_emishi = cn_hiro_o
					}

					color = { 35 50 85 }
				}
				b_opereperkep = {
					province = 10788

					cultural_names = {
						name_list_yamato = cn_obihiro
						name_list_emishi = cn_obihiro
					}

					color = { 35 50 85 }
				}
				b_tokapusi = {
					province = 10789

					cultural_names = {
						name_list_yamato = cn_tokachi
						name_list_emishi = cn_tokachi
					}

					color = { 35 50 85 }
				}
			}

			c_soya = {
				color = { 85 95 145 }

				cultural_names = {
					name_list_yamato = cn_kitami
					name_list_emishi = cn_kitami
				}

				b_mopet = {
					province = 10794

					cultural_names = {
						name_list_yamato = cn_monbetsu
						name_list_emishi = cn_monbetsu
					}
					
					color = { 85 95 145 }
				}
				b_soya = {
					province = 10795

					cultural_names = {
						name_list_yamato = cn_soya
						name_list_emishi = cn_soya
					}
					
					color = { 85 95 145 }
				}
				b_nay_or = {
					province = 10796

					cultural_names = {
						name_list_yamato = cn_kamikawa
						name_list_emishi = cn_kamikawa
					}
					
					color = { 85 95 145 }
				}
				b_tes_uni = {
					province = 10797

					cultural_names = {
						name_list_yamato = cn_teshio
						name_list_emishi = cn_teshio
					}
					
					color = { 85 95 145 }
				}
			}

			c_chupka = {
				color = { 11 6 88 }

				cultural_names = {
					name_list_yamato = cn_chishima
					name_list_emishi = cn_chishima
				}

				b_kinasir = {
					province = 12819

					cultural_names = {
						name_list_yamato = cn_kunashiri
						name_list_emishi = cn_kunashiri
					}
					
					color = { 11 6 88 }
				}
				b_etuworop_sir = {
					province = 12820

					cultural_names = {
						name_list_yamato = cn_etorofu
						name_list_emishi = cn_etorofu
					}
					
					color = { 11 6 88 }
				}
			}
		}

		d_sum = {
			color = { 80 50 23 }
			
			capital = c_uskes

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			cultural_names = {
				name_list_yamato = cn_west_hokkaido
				name_list_emishi = cn_west_oshima
			}
			
			c_uskes = {
				color = { 0 20 115 }

				cultural_names = {
					name_list_yamato = cn_oshima
					name_list_emishi = cn_oshima
				}

				b_matomai = {
					province = 10774

					cultural_names = {
						name_list_yamato = cn_matsumae
						name_list_emishi = cn_matsumae
					}
					
					color = { 0 20 115 }
				}
				b_uskes = {
					province = 10775

					cultural_names = {
						name_list_yamato = cn_kameda
						name_list_emishi = cn_kameda
					}
					
					color = { 0 20 115 }
				}
				b_kayaunpesh = {
					province = 10782

					cultural_names = {
						name_list_yamato = cn_kayabe
						name_list_emishi = cn_kayabe
					}
					
					color = { 0 20 115 }
				}
				b_kumausi = {
					province = 10776

					cultural_names = {
						name_list_yamato = cn_nishi
						name_list_emishi = cn_nishi
					}
					
					color = { 0 20 115 }
				}
			}
			c_ioci = {
				color = { 30 40 90 }

				cultural_names = {
					name_list_yamato = cn_shiribeshi
					name_list_emishi = cn_shiribeshi
				}

				b_ioci = {
					province = 10777

					cultural_names = {
						name_list_yamato = cn_yoichi
						name_list_emishi = cn_yoichi
					}
					
					color = { 30 40 90 }
				}
				b_setanay = {
					province = 10780

					cultural_names = {
						name_list_yamato = cn_setana
						name_list_emishi = cn_setana
					}
					
					color = { 30 40 90 }
				}
				b_otarunay = {
					province = 10779

					cultural_names = {
						name_list_yamato = cn_otaru
						name_list_emishi = cn_otaru
					}
					
					color = { 30 40 90 }
				}
				b_aptapet_ainu = {
					province = 10781

					cultural_names = {
						name_list_yamato = cn_abuta
						name_list_emishi = cn_abuta
					}
					
					color = { 30 40 90 }
				}
			}
			c_iskar = {
				color = { 5 40 200 }

				cultural_names = {
					name_list_yamato = cn_ishikari
					name_list_emishi = cn_ishikari
				}

				b_iskar_hokkaido = {
					province = 10801

					cultural_names = {
						name_list_yamato = cn_ishikari
						name_list_emishi = cn_ishikari
					}
					
					color = { 5 40 200 }
				}
				b_rurmo_otpe = {
					province = 10798

					cultural_names = {
						name_list_yamato = cn_rumoi
						name_list_emishi = cn_rumoi
					}
					
					color = { 5 40 200 }
				}
				b_cup_pet = {
					province = 10799

					cultural_names = {
						name_list_yamato = cn_asahikawa
						name_list_emishi = cn_asahikawa
					}
					
					color = { 5 40 200 }
				}
				b_sorapci = {
					province = 10800

					cultural_names = {
						name_list_yamato = cn_sorachi
						name_list_emishi = cn_sorachi
					}
					
					color = { 5 40 200 }
				}
			}
			c_sum = {
				color = { 60 80 150 }

				cultural_names = {
					name_list_yamato = cn_iburi
					name_list_emishi = cn_iburi
				}

				b_sar = {
					province = 10785

					cultural_names = {
						name_list_yamato = cn_saru
						name_list_emishi = cn_saru
					}
					
					color = { 60 80 150 }
				}
				b_iput = {
					province = 10784

					cultural_names = {
						name_list_yamato = cn_yufutsu
						name_list_emishi = cn_yufutsu
					}
					
					color = { 60 80 150 }
				}
				b_sipicar = {
					province = 10786

					cultural_names = {
						name_list_yamato = cn_shizunai
						name_list_emishi = cn_shizunai
					}
					
					color = { 60 80 150 }
				}
				b_moruran = {
					province = 10783

					cultural_names = {
						name_list_yamato = cn_muroran
						name_list_emishi = cn_muroran
					}
					
					color = { 60 80 150 }
				}
			}
		}
	}	
	k_azuma = {	#mostly Chubu, also includes Kanto
		color = { 125 15 65 }

		capital = c_mino
		can_be_named_after_dynasty = no

		can_create = {
			japan_government_japan_kingdom_restriction_trigger = yes
		}
		
		d_east_bando = {
			color = { 164 35 90 }
			
			capital = c_shimosa

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_shimosa = {
				color = { 223 103 163 }

				b_katsushika = {
					province = 10767

					color = { 151 77 108 }
				}
				b_katori = {
					province = 10769

					color = { 246 62 153 }
				}
				b_chiba = {
					province = 10768

					color = { 244 162 199 }
				}
				b_inba = {
					province = 10721

					color = { 216 99 156 }
				}
			}

			c_hitachi = {
				color = { 190 17 79 }

				b_ibaraki = {
					province = 10722

					color = { 161 40 85 }
				}
				b_kashima_hitachi = {
					province = 10772

					color = { 231 15 74 }
				}
				b_naka_hitachi = {
					province = 10724

					color = { 246 104 150 }
				}
				b_taga_hitachi = {
					province = 10725

					color = { 239 18 115 }
				}
				b_tsukuba = {
					province = 10726

					color = { 123 55 84 }
				}
			}

			c_kazusa = {
				color = { 102 42 62 }

				b_ichihara = {
					province = 10761

					color = { 71 15 36  }
				}
				b_awa = {
					province = 10760

					color = { 143 89 104  }
				}
				b_ichinomiya = {
					province = 10762

					color = { 139 29 73  }
				}
			}
			
			c_shimotsuke = {
				color = { 143 28 87 }

				b_ashikaga = {
					province = 10667

					color = { 190 89 146 }
				}
				b_futara = {
					province = 10668

					color = { 87 36 58 }
				}
				b_nasu = {
					province = 10665

					color = { 200 15 101 }
				}
				b_utsunomiya = {
					province = 10666

					color = { 129 17 72 }
				}
				b_shioya = {
					province = 10669

					color = { 144 80 110 }
				}
			}
		}

		d_west_bando = {
			color = { 84 39 55 }
			
			capital = c_musashi

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_musashi = {
				color = { 76 35 48 }

				b_tama_musashi = {
					province = 10732

					color = { 53 24 35 }
				}
				b_adachi_musashi = {
					province = 10731

					color = { 106 42 68 }
				}
				b_toshima = {
					province = 10730

					color = { 123 92 101 }
				}
				b_iruma = {
					province = 10727

					color = { 116 16 38 }
				}
				b_chichibu = {
					province = 10729

					color = { 72 7 23 }
				}
			}

			c_sagami = {
				color = { 123 88 100 }

				b_kamakura = {
					province = 10765

					color = { 144 113 120 }
				}
				b_hakone = {
					province = 10766

					color = { 78 50 58 }
				}
				b_osumi = {
					province = 10684

					color = { 197 113 143 }
				}
			}

			c_izu = {
				color = { 122 27 55 }

				b_tagata = {
					province = 10764

					color = { 167 22 74 }
				}
				b_kamo_izu = {
					province = 10763

					color = { 76 39 48 }
				}
			}

			c_kozuke = {
				color = { 26 16 18 }

				b_gunma = {
					province = 10672

					color = { 28 14 18 }
				}
				b_tone = {
					province = 10670

					color = { 44 38 38 }
				}
				b_nitta = {
					province = 10671

					color = { 44 15 18 }
				}
				b_agatsuma = {
					province = 10673

					color = { 44 27 28 }
				}
			}
		}
		
		d_tokaido = {
			color = { 105 0 42 }
			
			capital = c_ise

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}
			
			c_ise = {
				color = { 77 18 42 }

				b_ano = {
					province = 10756

					color = { 79 16 44 }
				}
				b_ise_jingu = {
					province = 10757

					color = { 40 21 29 }
				}
				b_iga = {
					province = 10738

					color = { 94 67 79 }
				}
				b_mie = {
					province = 10755

					color = { 124 5 52 }
				}
				b_shima = {
					province = 10758

					color = { 128 61 88 }
				}
			}

			c_owari = {
				color = { 146 21 64 }

				b_nakashima = {
					province = 10754

					color = { 117 2 44 }
				}
				b_atsuta = {
					province = 10752

					color = { 202 16 83 }
				}
				b_kasugai = {
					province = 10753

					color = { 186 86 118 }
				}
			}
			
			c_mikawa = {
				color = { 156 75 105 }

				b_atsumi = {
					province = 10748

					color = { 208 67 131 }
				}
				b_nukata = {
					province = 10750

					color = { 94 63 73 }
				}
				b_shitara = {
					province = 10749

					color = { 213 145 169 }
				}
				b_kamo_mikawa = {
					province = 10751

					color = { 131 39 76 }
				}
			}
			
			c_suruga = {
				color = { 32 22 27 }

				b_abe = {
					province = 10686

					color = { 26 19 22 }
				}
				b_fuji = {
					province = 10685

					color = { 54 26 43 }
				}
				b_shida = {
					province = 10687

					color = { 54 49 52 }
				}
			}
			
			c_totomi = {
				color = { 102 69 82 }

				b_toyoda = {
					province = 10690

					color = { 102 71 86 }
				}
				b_suchi = {
					province = 10688

					color = { 150 121 130 }
				}
				b_fuchi = {
					province = 10691

					color = { 153 82 113 }
				}
			}
		}

		d_tosando = {
			color = { 157 84 114 }
			
			capital = c_omi

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_omi = {
				color = { 208 150 169 }

				b_koka = {
					province = 10742

					color = { 173 141 153 }
				}
				b_enryaku_ji = {
					province = 10739

					color = { 250 154 191 }
				}
				b_inukami = {
					province = 10741

					color = { 249 200 221 }
				}
				b_azai = {
					province = 10740

					color = { 130 83 96 }
				}
			}

			c_mino = {
				color = { 121 70 89 }

				b_fuwa = {
					province = 10747

					color = { 89 61 72 }
				}
				b_gujo = {
					province = 10743

					color = { 168 70 98 }
				}
				b_kani = {
					province = 10744

					color = { 169 120 138 }
				}
				b_motosu = {
					province = 10746

					color = { 204 177 186 }
				}
				b_mugi = {
					province = 10771

					color = { 105 34 65 }
				}
			}
			
			c_hida = {
				color = { 214 92 153 }

				b_ono_hida = {
					province = 10655

					color = { 151 47 108 }
				}
				b_yoshiki_hida = {
					province = 10654

					color = { 250 162 201 }
				}
				b_mashita = {
					province = 10656

					color = { 246 71 164 }
				}
			}
			
			c_shinano = {
				color = { 146 48 97 }

				b_tsukama = {
					province = 10660

					color = { 187 13 92 }
				}
				b_zenko_ji = {
					province = 10662

					color = { 107 63 86 }
				}
				b_saku = {
					province = 10663

					color = { 203 103 148 }
				}
				b_azumi = {
					province = 10664

					color = { 119 11 56 }
				}
			}
			
			c_kai = {
				color = { 59 47 52 }

				b_yatsushiro = {
					province = 10682

					color = { 40 31 34 }
				}
				b_tsuru = {
					province = 10680

					color = { 88 75 80 }
				}
				b_koma = {
					province = 10683

					color = { 71 46 58 }
				}
			}
		}

		d_hokurikudo = {
			color = { 191 137 165 }
			
			capital = c_echizen

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_echizen = {
				color = { 250 200 227 }

				b_nyu = {
					province = 10735

					color = { 202 155 183 }
				}
				b_ono_echizen = {
					province = 10733

					color = { 250 216 233 }
				}
				b_tsuruga = {
					province = 10736

					color = { 133 113 124 }
				}
				b_wakasa = {
					province = 10737

					color = { 84 64 74 }
				}
				b_sakai = {
					province = 10734

					color = { 250 169 220 }
				}
			}

			c_echigo = {
				color = { 143 96 115 }

				b_kubiki = {
					province = 10652

					color = { 132 76 104 }
				}
				b_yahiko = {
					province = 10696

					color = { 200 154 174 }
				}
				b_kambara = {
					province = 10651

					color = { 195 108 151 }
				}
				b_iwafune = {
					province = 10650

					color = { 88 69 75 }
				}
				b_sado = {
					province = 10649

					color = { 51 23 36 }
				}
				b_uonuma = {
					province = 10653

					color = { 137 122 128 }
				}
			}

			c_etchu = {
				color = { 216 131 173 }

				b_imizu = {
					province = 10676

					color = { 144 68 112 }
				}
				b_tateyama = {
					province = 10677

					color = { 237 174 204 }
				}
			}

			c_noto = {
				color = { 182 149 166 }

				b_kashima = {
					province = 10675

					color = { 231 187 210 }
				}
				b_fugeshi = {
					province = 10674

					color = { 112 85 99 }
				}
			}

			c_kaga = {
				color = { 81 48 63 }

				b_enuma = {
					province = 10679

					color = { 60 34 48 }
				}
				b_haku = {
					province = 10678

					color = { 112 83 97 }
				}
			}
		}
	}
	
	k_tsukushi = {
		color = { 210 145 30 }

		capital = c_chikuzen
		can_be_named_after_dynasty = no

		can_create = {
			japan_government_japan_kingdom_restriction_trigger = yes
		}

		d_north_saikaido = {
			color = { 138 103 45 }

			capital = c_chikuzen
			can_be_named_after_dynasty = no
			definite_form = yes

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_chikuzen = {
				color = { 181 157 100 }
				can_be_named_after_dynasty = no

				b_dazaifu = {
					province = 10528
					
					color = { 226 199 146 }
				}
				b_hakata = {
					province = 10529
					
					color = { 109 86 45 }
				}
				b_munakata = {
					province = 10530
					
					color = { 250 215 109 }
				}
				b_kurate = {
					province = 10531
					
					color = { 179 138 75 }
				}
			}

			c_bungo = {
				color = { 112 92 65 }
				#can_be_named_after_dynasty = no

				b_oita = {
					province = 10518
					
					color = { 85 73 59 }
				}
				b_amabe = {
					province = 10520
					
					color = { 152 127 78 }
				}
				b_ono = {
					province = 10522
					
					color = { 146 135 122 }
				}
				b_kunisaki = {
					province = 10523
					
					color = { 117 75 34 }
				}
				b_hita = {
					province = 10524
					
					color = { 36 27 18 }
				}
			}

			c_buzen = {
				color = { 192 134 20 }
				#can_be_named_after_dynasty = no

				b_usa = {
					province = 10525
					
					color = { 232 169 56 }
				}
				b_hiko = {
					province = 10527
					
					color = { 117 94 51 }
				}
				b_kiku = {
					province = 10526
					
					color = { 160 102 24 }
				}
			}
			
			c_chikugo = {
				color = { 134 80 18 }
				can_be_named_after_dynasty = no

				b_mii = {
					province = 10533
					
					color = { 129 76 19 }
				}
				b_mizuma = {
					province = 10532
					
					color = { 187 144 88 }
				}
			}

			c_hizen = {
				color = { 71 42 10 }
				can_be_named_after_dynasty = no

				b_saga = {
					province = 10534
					
					color = { 75 36 2 }
				}
				b_matsura = {
					province = 10536
					
					color = { 44 31 21 }
				}
				b_sonogi = {
					province = 10538
					
					color = { 105 82 50 }
				}
				b_chikanoshima = {
					province = 10539
					
					color = { 119 63 3 }
				}
			}

			c_tsushima = {
				color = { 52 47 38 }
				can_be_named_after_dynasty = no

				b_yora = {
					province = 10563
					
					color = { 34 31 26 }
				}
			}
		}
		
		d_south_saikaido = {
			color = { 250 142 13 }

			capital = c_satsuma
			can_be_named_after_dynasty = no

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			c_satsuma = {
				color = { 159 78 1 }
				can_be_named_after_dynasty = no

				b_izumi_satsuma = {
					province = 10559
					
					color = { 129 81 42 }
				}
				b_kawanabe = {
					province = 10561
					
					color = { 221 94 12 }
				}
				b_kagoshima = {
					province = 10557
					
					color = { 210 151 78 }
				}
				b_isa = {
					province = 10558
					
					color = { 150 65 1 }
				}
			}

			c_higo = {
				color = { 248 115 1 }
				can_be_named_after_dynasty = no

				b_mashiki = {
					province = 10550
					
					color = { 200 111 45 }
				}
				b_aso_higo = {
					province = 10552
					
					color = { 246 93 2 }
				}
				b_kikuchi = {
					province = 10551
					
					color = { 151 102 60 }
				}
				b_amakusa = {
					province = 10554
					
					color = { 250 153 34 }
				}
				b_yatsushiro_higo = {
					province = 10555
					
					color = { 206 151 81 }
				}
				b_kuma = {
					province = 10556
					
					color = { 129 55 8 }
				}
			}
			
			c_hyuga = {
				color = { 166 126 70 }
				can_be_named_after_dynasty = no

				b_koyu = {
					province = 10540
					
					color = { 109 86 44 }
				}
				b_naka = {
					province = 10543
					
					color = { 230 185 94 }
				}
				b_miyazaki = {
					province = 10542
					
					color = { 170 105 33 }
				}
				b_usuki = {
					province = 10541
					
					color = { 214 172 130 }
				}
				b_morokata = {
					province = 10544
					
					color = { 249 172 37 }
				}
			}

			c_osumi = {
				color = { 250 181 83 }
				can_be_named_after_dynasty = no

				b_soo = {
					province = 10547
					
					color = { 174 127 41 }
				}
				b_kimotsuki = {
					province = 10545
					
					color = { 249 140 17 }
				}
				b_kuwabara = {
					province = 10546
					
					color = { 247 192 137 }
				}
				b_tane = {
					province = 10560
					
					color = { 152 124 90 }
				}
			}
		}
	}

	k_hitakami = {
		color = { 45 15 125 }

		capital = c_korehari # Taga
		can_be_named_after_dynasty = no

		can_create = {
			japan_government_japan_kingdom_restriction_trigger = yes
		}

		cultural_names = {
			name_list_yamato = cn_michinoku
		}
		
		d_hitakami = {
			color = { 55 25 135 }
			
			capital = c_korehari # Taga

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			cultural_names = {
				name_list_yamato = cn_mutsu
			}

			c_korehari = {
				color = { 35 10 95 }

				cultural_names = {
					name_list_yamato = cn_taga
				}

				b_taga = {
					province = 10699
					
					color = { 35 10 95 }
				}
				b_korehari = {
					province = 10698

					cultural_names = {
						name_list_yamato = cn_kurihara
					}
					
					color = { 35 10 95 }
				}
				b_kesen = {
					province = 10770
					
					color = { 35 10 95 }
				}
				b_momunofu = {
					province = 10773

					cultural_names = {
						name_list_yamato = cn_motoyoshi
					}
					
					color = { 35 10 95 }
				}
			}

			c_iwase = {
				color = { 70 40 150 }

				b_adachi = {
					province = 10716
					
					color = { 70 40 150 }
				}
				b_yama_iwase = {
					province = 10714
					
					color = { 70 40 150 }
				}
				b_aizu = {
					province = 10712
					
					color = { 70 40 150 }
				}
				b_iwase = {
					province = 10717
					
					color = { 70 40 150 }
				}
			}

			c_isawa = {
				color = { 55 40 130 }

				b_isawa = {
					province = 10697
					
					color = { 55 40 130 }
				}
				b_nukanobu = {
					province = 10692

					cultural_names = {
						name_list_yamato = cn_kunohe
					}
					
					color = { 55 40 130 }
				}
				b_kuriyagawa = {
					province = 10693
					
					color = { 55 40 130 }
				}
				b_hei = {
					province = 10694
					
					color = { 55 40 130 }
				}
			}

			c_tsugaru = {
				color = { 63 69 176 }

				b_tsugaru = {
					province = 10700
					
					color = { 63 69 176 }
				}
				b_tsumo = {
					province = 10702

					cultural_names = {
						name_list_yamato = cn_sannohe
					}
					
					color = { 63 69 176 }
				}
				b_usori = {
					province = 10701

					cultural_names = {
						name_list_yamato = cn_kita
					}
					
					color = { 63 69 176 }
				}
				b_nisattai = {
					province = 10703

					cultural_names = {
						name_list_yamato = cn_ninohe
					}
					
					color = { 63 69 176 }
				}
			}

			c_iwaki = {
				color = { 70 30 125 }

				b_iwaki = {
					province = 10719
					
					color = { 70 30 125 }
				}
				b_shirakawa = {
					province = 10720
					
					color = { 70 30 125 }
				}
				b_namekata = {
					province = 10718
					
					color = { 70 30 125 }
				}
			}
		}

		d_nushiro = {
			color = { 15 10 135 }
			
			capital = c_nushiro

			can_create = {
				japan_government_japan_duchy_restriction_trigger = yes
			}

			cultural_names = {
				name_list_yamato = cn_dewa
			}
			
			c_nushiro = {
				color = { 40 30 195 }

				cultural_names = {
					name_list_yamato = cn_akita
				}

				b_agita = {
					province = 10705

					cultural_names = {
						name_list_yamato = cn_akita
					}
					
					color = { 40 30 195 }
				}
				b_nushiro = {
					province = 10704

					cultural_names = {
						name_list_yamato = cn_hiyama
					}
					
					color = { 40 30 195 }
				}
				b_hotta = {
					province = 10706

					cultural_names = {
						name_list_yamato = cn_yamamoto
					}
					
					color = { 40 30 195 }
				}
				b_okachi = {
					province = 10707

					cultural_names = {
						name_list_yamato = cn_ogachi
					}
					
					color = { 40 30 195 }
				}
				b_yuri = {
					province = 10708

					cultural_names = {
						name_list_yamato = cn_akumi
					}
					
					color = { 40 30 195 }
				}
			}

			c_tokisara = {
				color = { 5 0 125 }

				cultural_names = {
					name_list_yamato = cn_dewa
				}

				b_okitama = {
					province = 10711
					
					color = { 5 0 125 }
				}
				b_tokisara = {
					province = 10709

					cultural_names = {
						name_list_yamato = cn_haguro
					}
					
					color = { 5 0 125 }
				}
				b_mogami = {
					province = 10710
					
					color = { 5 0 125 }
				}
			}
		}
	}
	
	k_ruucuu = {
		color = { 0 130 60 }

		capital = c_ucinaa
		can_be_named_after_dynasty = no

		cultural_names = {
			name_list_yamato = cn_ryukyu
			name_list_emishi = cn_ryukyu
		}

		can_create = {
		}

		ai_primary_priority = {
			if = {
				limit = { culture = culture:japanese }
				add = @correct_culture_primary_score
			}
		}

		d_ruucuu = {
			color = { 0 137 41 }

			capital = c_ucinaa
			can_be_named_after_dynasty = no

			cultural_names = {
				name_list_yamato = cn_ryukyu
				name_list_emishi = cn_ryukyu
			}
			
			c_ucinaa = {
				color = { 0 103 43 }
				can_be_named_after_dynasty = no

				cultural_names = {
					name_list_yamato = cn_okinawa
					name_list_emishi = cn_okinawa
				}

				b_simajiri = {
					province = 10645

					cultural_names = {
						name_list_yamato = cn_shimajiri
						name_list_emishi = cn_shimajiri
					}
					
					color = { 0 116 43 }
				}
				b_nakajan = {
					province = 10646

					cultural_names = {
						name_list_yamato = cn_nakagami
						name_list_emishi = cn_nakagami
					}
					
					color = { 0 77 30 }
				}
				b_kunjan_ucinaa = {
					province = 10647

					cultural_names = {
						name_list_yamato = cn_kunigami
						name_list_emishi = cn_kunigami
					}
					
					color = { 0 117 34 }
				}
			}
			
			c_amami = {
				color = { 0 159 45 }
				can_be_named_after_dynasty = no

				b_amami = {
					province = 10643
					
					color = { 0 142 55 }
				}
			}
		}
	}
	
}



# Japanese Emperor
k_chrysanthemum_throne = {
	color = { 96 3 42 }

	capital = c_yamashiro
	can_be_named_after_dynasty = no
	landless = yes
	figurehead = yes
	allow_domicile = no
	always_follows_primary_heir = yes
	definite_form = yes

	can_create = { always = no }

	ai_primary_priority = {
		if = {
			limit = {
				culture = { has_cultural_pillar = heritage_japonic }
			}
			add = @correct_culture_primary_score
		}
	}

	# Ceremonial Liege/Regent in personal relation summary
	# (reminder: the ceremonial liege if mechanically a vassal of the ceremonial regent)
	#
	# Scopes
	# ------
	# root: Inspected character (who holds this title).
	# target: Character we are evaluating relationships to (usually local player).
	# title: This title (held by inspected character).
	# liege: Inspected characters liege.
	# vassal: Vassal who matches the trigger below, if any.
	#
	# Alternate descriptions are provided to trim the extra "Your" before this entry in the summary.
	#
	personal_relation_entry = {
		first_valid = {
			triggered_desc = {
				trigger = {
					exists = scope:target
					scope:liege ?= scope:target
				}
				desc = japan_personal_relation_ceremonial_liege_same
			}
			triggered_desc = {
				trigger = { exists = scope:liege }
				desc = japan_personal_relation_ceremonial_liege_other
			}
		}
	}

	# Male posthumous Ten'no names
	posthumous_regnal_male_names = {
		Ankan Antoku
		Daigo
		En_yU_
		Heizei
		Higashiyama
		Horikawa
		IchijO_
		Jun_an Junna Junnin Junchi Junmu
		Kameyama Kanmu Kashiwabara Kazan
		Keitai
		Kinmei
		KO_bun KO_chi KO_kaku_2 KO_kO_ Komatsu KO_mei KO_mu KO_myO_ KO_nin Konoe Kotoku KO_zei
		Momozono Monmu Montoku
		Murakami
		Nakamikado Nara
		NijO_ Nin_an Ninchi NinkO_ Ninmu NinmyO_ NinshO_
		O_gimachi
		Reichi Reigen Reimei ReishO_ Reizei
		RokujO_
		Saga_JP Sakuramachi SanjO_
		Seiwa Senka
		ShijO_ Shirakawa
		ShO_kO_ ShO_mu ShO_toku
		SukO_ Sushun Sutoku Suzaku
		Takakura
		Tenji Tenmu
		Toba_JP
		Tsuchimikado
		Uda_JP
		YO_mei YO_zei
		# Unisex
		AnegakO_ji
		Atago
		AyanokO_ji
		BunchO_ BunryU_ BunshO_
		BO_jO_
		Eian
		Enso
		Genka
		GojO_
		HachijO_
		Higashiyama
		Imadegawa
		Iwakura
		Junmei Junmei_2
		Kaen Kan_an Karasuma Kasuga
		Katoku
		Keimei KenshO_ Kentoku
		Kinugasa Kitano Kitashirakawa Kitayama Kiyomizu Kiyotaki
		Koga
		KujO_ Kurama
		KyO_goku
		KO_bun KO_ka
		Mantoku Matsunoo
		Meiho Meitei
		Mibu
		Murasakino Muromachi
		Narutaki
		Okazaki
		Omuro
		OshinokO_ji
		Reitoku
		Sakuragi
		ShichijO_ ShO_ka ShU_bun
		Taireki TaiO_ Takao Takatsukasa
		TenkyU_ TenkO_ Tensei
		TO_in
		Umezu
		Yamashina Yase_JP
		O_hara O_inomikado O_miya
	}

	# Female posthumous Ten'no names
	posthumous_regnal_female_names = {
		Gen_an Genchi Genken GenkO_ Genmei Gennei Gennin GenshO_ GentO_ Gentoku Genzei
		JitO_
		KO_ken KO_gyoku
		MeishO_
		Saimei
		Suiko
		# Unisex
		AnegakO_ji
		Atago
		AyanokO_ji
		BunchO_ BunryU_ BunshO_
		BO_jO_
		Eian
		Enso
		Genka
		GojO_
		HachijO_
		Imadegawa
		Iwakura
		Junmei_2
		Kaen Kan_an Karasuma Kasuga
		Katoku
		Keimei KenshO_ Kentoku
		Kinugasa Kitano Kitashirakawa Kitayama Kiyomizu Kiyotaki
		Koga
		KujO_ Kurama
		KyO_goku
		KO_bun KO_ka
		Mantoku Matsunoo
		Meiho Meitei
		Mibu
		Murasakino Muromachi
		Narutaki
		Okazaki
		Omuro
		OshinokO_ji
		Reitoku
		Sakuragi
		ShichijO_ ShO_ka ShU_bun
		Taireki TaiO_ Takao Takatsukasa
		TenkyU_ TenkO_ Tensei
		TO_in
		Umezu
		Yamashina Yase_JP
		O_hara O_inomikado O_miya
	}
}

# Landless

d_laamp_shunkan = { # Shunkan Minamoto
	color = { 100 100 100 }
	capital = c_amami

	definite_form = yes
	landless = yes
	require_landless = yes
	ruler_uses_title_name = no
	no_automatic_claims = yes
	destroy_if_invalid_heir = yes

	ai_primary_priority = { add = @never_primary_score }
}

d_laamp_takaoka = { # Prince Takaoka (Shinnyo)
	color = { 100 100 100 }
	capital = c_nakhon_pathom

	definite_form = yes
	landless = yes
	require_landless = yes
	ruler_uses_title_name = no
	no_automatic_claims = yes
	destroy_if_invalid_heir = yes

	ai_primary_priority = { add = @never_primary_score }
}

d_laamp_yoshitsune = { # Yoshitsune Minamoto
	color = { 100 100 100 }
	capital = c_isawa

	definite_form = yes
	landless = yes
	require_landless = yes
	ruler_uses_title_name = no
	no_automatic_claims = yes
	destroy_if_invalid_heir = yes

	ai_primary_priority = { add = @never_primary_score }
}

d_laamp_miyoshi_kiyotsura = { # Miyoshi Kiyotsura, Kiyotsura's Inspectors
	color = { 100 100 100 }
	capital = c_yamashiro

	definite_form = yes
	landless = yes
	require_landless = yes
	ruler_uses_title_name = no
	no_automatic_claims = yes
	destroy_if_invalid_heir = yes

	ai_primary_priority = { add = @never_primary_score }
}

d_laamp_hiei_wayfarers = { # Jōjin, Hiei Wayfarers
	color = { 100 100 100 }
	capital = c_yamashiro

	definite_form = yes
	landless = yes
	require_landless = yes
	ruler_uses_title_name = no
	no_automatic_claims = yes
	destroy_if_invalid_heir = yes

	ai_primary_priority = { add = @never_primary_score }
}

d_laamp_northern_blades = { # Isawa no Saburō, Northern Blades
	color = { 100 100 100 }
	capital = c_korehari

	definite_form = yes
	landless = yes
	require_landless = yes
	ruler_uses_title_name = no
	no_automatic_claims = yes
	destroy_if_invalid_heir = yes

	ai_primary_priority = { add = @never_primary_score }
}

d_laamp_band_of_the_inland_sea = { # Tsukushi no Koretaka, Band of the Inland Sea
	color = { 100 100 100 }
	capital = c_chikuzen

	definite_form = yes
	landless = yes
	require_landless = yes
	ruler_uses_title_name = no
	no_automatic_claims = yes
	destroy_if_invalid_heir = yes

	ai_primary_priority = { add = @never_primary_score }
}
