:root {
	--dialog-main-color: var(--light-green-color);
	--dialog-bg-color: var(--main-bg-color);
	--dialog-title-color: var(--black-color);
	--dialog-text-color: var(--black-color);
	--dialog-font-size: 20px;
}

* {
	box-sizing: border-box;
}

#main {
	position: relative;
	width: 800px;
	margin: 10px auto;
	padding: 20px 20px;
	text-align: center;
}

#generate-box {
	justify-items: center;
}

/* main-title */
#main-title {
	margin: 0px 70px 20px;
	line-height: 50px;
	font-size: 40px;
}

/* back button */
#back {
	position: absolute;
	display: none;
	top: 29px;
	left: 30px;
	font-size: 20px;
	cursor: pointer;
}

#back-text {
	display: inline;
	opacity: 0;
	transition: all 0.1s;
}

#back:hover>#back-text {
	opacity: 1;
	transition: all 0.1s;
}

/* title */
.title-block {
	position: relative;
	display: block;
	margin: 10px;
	padding: 0px;
	height: 50px;
	width: 400px;
	line-height: 50px;
	background-color: var(--grey-d-color);
	border-radius: 10px;
	cursor: pointer;
}

.title-name {
	display: flex;
	margin: 0px 50px;
	width: 300px;
	overflow: hidden;
	justify-content: center;
}

.title-name-text {
	font-size: 23px;
	width: fit-content;
	word-break: keep-all;
	transform: translateX(max(0px, calc(50% - 150px)));
}

.title-block:hover .title-name-text {
	animation: 3s infinite ease-in-out title-name-animation;
}

@keyframes title-name-animation {

	from,
	10% {
		transform: translateX(max(0px, calc(50% - 150px)));
	}

	90%,
	to {
		transform: translateX(min(0px, calc(150px - 50%)));
	}
}

#add-button {
	background-color: var(--grey-green-color);
}

#add-button::before {
	content: "追加";
	font-size: 23px;
}

.title-move {
	position: absolute;
	top: 0px;
	left: 0px;
	width: 50px;
	font-size: 30px;
	opacity: 0;
	transition: all 0.1s;
	cursor: grab;
}

#generate-box:has(.dragging)>.dragging>.title-move,
#generate-box:not(:has(.dragging))>.title-block:hover>.title-move {
	opacity: 0.3;
	transition: all 0.1s;
}

.title-move::before {
	content: "\21C5";
}

.dragging {
	opacity: 0.5;
}

.dots {
	position: absolute;
	top: 0px;
	right: 0px;
	width: 50px;
	font-size: 30px;
}

.dots::before {
	content: "…";
}

/* dots manu */
#dots-menu {
	position: absolute;
	top: 0px;
	right: -150px;
	width: 130px;
	background-color: var(--contrast-color);
	border: 1px solid var(--grey-c-color);
	border-radius: 10px;
	font-size: 16px;
	line-height: 25px;
	overflow: hidden;
}

#dots-menu hr {
	margin: 2px 10px;
	border: 0px;
	border-top: 1px solid var(--grey-a-color);
}

#words-list::before {
	content: "一覧を表示";
}

#title-edit::before {
	content: "名前の変更";
}

#words-edit::before {
	content: "編集";
}

#title-remove::before {
	content: "削除";
	color: var(--red-color);
}

/* words list */
#words-list-table {
	display: block;
	width: 760px;
	font-size: 20px;
	border-collapse: collapse;
	scrollbar-width: thin;
	border: 1px solid var(--black-color);
	border-bottom: none;
	scrollbar-color: var(--leaf-green-color) var(--main-bg-color);
}

#words-list-table tr {
	border-bottom: 1px solid var(--black-color);
}

#words-list-table .no {
	margin: 0px 10px;
	min-width: 50px;
}

#words-list-table .word {
	margin: 0px;
	min-width: 200px;
	border-left: 1px solid var(--black-color);
	border-right: 1px solid var(--black-color);
}

#words-list-table .description {
	margin: 0px;
	padding: 0px;
	padding-left: 10px;
	width: 510px;
	text-align: left;
}

/* words edit */
#words-edit-field {
	width: 100%;
	font-size: 20px;
	border: 1px solid var(--black-color);
	justify-items: left;
}

#words-edit-field .input {
	padding: 0px;
	font-size: 20px;
	border: none;
	background-color: var(--main-bg-color);
	outline: none;
}

#words-edit-field .line.title {
	font-weight: bold;
}

#words-edit-field .line {
	display: block;
}

#words-edit-field .no,
#words-edit-field .word,
#words-edit-field .description {
	display: inline-block;
}

#words-edit-field .no {
	width: 50px;
	user-select: none;
}

#words-edit-field .word {
	margin: 0px;
	width: 200px;
	border-left: 1px solid var(--black-color);
	border-right: 1px solid var(--black-color);
}

#words-edit-field .word .input {
	width: 180px;
}

#words-edit-field .description {
	margin: 0px;
	padding-left: 10px;
	width: 500px;
	text-align: left;
}

#words-edit-field .description .input {
	width: 100%;
}

.word-add {
	left: -10px;
	width: 30px;
}

.word-add svg {
	width: 20px;
}

.word-remove {
	width: 25px;
}

.word-add,
.word-remove {
	position: absolute;
	height: 32px;
	display: none;
}

.line:hover .word-add,
.line:hover .word-remove {
	display: block;
}

#add-new-word {
	margin: 10px 0px;
	height: 40px;
	width: 200px;
	border: none;
	border-radius: 10px;
	background-color: var(--main-color);
}

#add-new-word svg {
	color: var(--white-color);
	height: 100%;
}

#words-edit-field .line.title .no::before {
	content: "No.";
}

#words-edit-field .line.title .word::before {
	content: "単語";
}

#words-edit-field .line.title .description::before {
	content: "説明";
}

/* card */
#card {
	position: relative;
	display: flex;
	height: 200px;
	width: 400px;
	align-items: center;
	border-radius: 10px;
	border: 1px solid var(--black-color);
	font-size: 23px;
	background-color: var(--white-color);
	user-select: none;
}

#card>#front-word {
	position: absolute;
	top: 5px;
	width: 500px;
	font-size: 15px;
	color: var(--grey-5-color);
}

#card>#front-word,
#card>#card-main-text {
	width: 100%;
	overflow-wrap: break-word;
}

/* export - import */
#export-import-buttons {
	position: absolute;
	display: flex;
	top: 30px;
	right: 30px;
	gap: 10px;
}

.mini-button {
	padding: 4px;
	height: 30px;
	width: 30px;
	color: var(--white-color);
	background-color: var(--main-color);
	border-radius: 5px;
}


#export {
	position: fixed;
	display: none;
	top: 0px;
	bottom: 0px;
	left: 0px;
	right: 0px;
	align-items: center;
	justify-content: center;
	background-color: #0004;
}

#export-popup {
	position: relative;
	height: 400px;
	width: 500px;
	border-radius: 10px;
	background-color: var(--main-bg-color);
	overflow: hidden;
}

#export-title {
	font-size: 25px;
	line-height: 50px;
	background-color: var(--grey-green-color);
}

#export-all {
	margin: 20px 20px 0px;
	text-align: left;
}

#export-remove {
	margin: 10px 20px 0px;
	text-align: left;
}

#export-select-box {
	margin: 0px 20px;
	height: 210px;
	width: 460px;
	text-align: left;
	overflow: auto;
}

.export-label {
	position: relative;
	display: block;
}

.export-checkbox {
	margin: 0px;
	height: 0px;
	width: 0px;
}

.export-checkbox::before {
	content: '';
	position: absolute;
	display: block;
	top: 5px;
	left: 5px;
	height: 17px;
	width: 17px;
	background-color: var(--light-side-color);
	border-radius: 3px;
	border: 1px solid var(--grey-5-color);
	opacity: 1;
}

.export-checkbox:checked::after {
	content: '';
	position: absolute;
	display: block;
	top: 10px;
	left: 8px;
	height: 4px;
	width: 10px;
	border-left: 1.5px solid;
	border-bottom: 1.5px solid;
	border-color: var(--black-color);
	background-color: #0000;
	transform: rotate(-45deg);
}

.export-book-name {
	display: inline;
	margin-left: 27px;
	font-size: 17px;
	line-height: 27px;
	user-select: none;
}

#export-execute-button {
	position: absolute;
	margin: 0px 160px 10px;
	width: 180px;
	bottom: 0px;
	font-size: 17px;
	line-height: 40px;
	background-color: var(--grey-green-color);
	border-radius: 10px;
}