:root {
	--color-primary: #2196f3;
	--color-on-primary: #ffffff;
	--color-secondary: #ffffff;
	--color-on-secondary: #333333;
	--color-surface: #f5f5f5;
	--color-on-surface: #333333;
	--color-outline: #cccccc;
	--color-tertiary: #03a9f4;
	--color-error: #b3261e;

	--header-bg: var(--color-primary);
	--header-on: var(--color-on-primary);
}

body.dark-mode {
	--color-primary: #1565c0;
	--color-on-primary: #ffffff;
	--color-secondary: #2a2e33;
	--color-on-secondary: #ffffff;
	--color-surface: #1a1c1e;
	--color-on-surface: #eeeeee;
	--color-outline: #777;
	--color-tertiary: #00bcd4;
	--color-error: #b3261e;

	--header-bg: #252c33;
	--header-on: #ffffff;
}

body {
	margin: 0;
	font-family: "Noto Sans JP", sans-serif;
	background: var(--color-surface);
	color: var(--color-on-surface);
	transition: background 0.2s ease, color 0.2s ease;
	padding-top: 56px;
}

header {
	background: var(--header-bg);
	color: var(--header-on);
	padding: 8px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	position: fixed;
	top: 0;
	width: 100%;
	z-index: 1000;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
	box-sizing: border-box;
}
.header-left {
	display: flex;
	height: 40px;
	align-items: center;
	border-radius: 4px;
}
.header-left:hover {
	background-color: rgba(0, 0, 0, 0.1);
}
.header-icon img {
	height: 40px;
	margin-right: 8px;
}
.header-title {
	font-size: 28px;
	font-weight: bold;
	white-space: nowrap;
}
.header-right {
	display: flex;
	align-items: center;
	gap: 4px;
}
.no-underline-link {
	text-decoration: none;
	color: inherit;
}

.header-button {
	background: none;
	border: none;
	font-size: 24px;
	color: var(--header-on);
	text-decoration: none;
	height: 40px;
	width: 40px;
	border-radius: 4px;
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
}
.header-button:hover {
	transform: scale(1.1);
	background-color: rgba(0, 0, 0, 0.1);
}

.modal {
	display: none;
	position: fixed;
	z-index: 2000;
	left: 0;
	top: 0;
	width: 100%;
	height: 100%;
	overflow: auto;
	background-color: rgba(0, 0, 0, 0.4);
	backdrop-filter: blur(5px);
}

.modal-content {
	background-color: var(--color-secondary);
	margin: auto;
	margin-top: 72px;
	color: var(--color-on-secondary);
	font-size: clamp(8px, 3.2vw, 16px);
	padding: 20px;
	border-radius: 8px;
	width: 90%;
	max-width: 850px;
	position: relative;
	max-height: calc(95vh - 72px);
	overflow-y: auto;
	box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
	animation: fadeIn 0.3s ease-in-out;
}
.modal-content h2 {
	margin-top: 0;
}

.close-button {
	position: absolute;
	top: 16px;
	right: 16px;
	border: none;
	background-color: transparent;
	color: var(--color-on-secondary);
	font-size: clamp(14px, 5.6vw, 28px);
	cursor: pointer;
	line-height: 1;
	padding: 4px;
	border-radius: 50%;
	transition: background-color 0.2s ease;
}
.close-button:hover {
	background-color: rgba(0, 0, 0, 0.1);
	transform: scale(1.1);
}

footer {
	text-align: center;
	padding: 20px;
	font-size: 12px;
	color: #999;
	transition: color 0.2s ease;
}
footer a {
	color: var(--color-tertiary);
	text-decoration: none;
	transition: color 0.2s ease;
}
footer a:hover {
	text-decoration: underline;
}

@media (max-width: 630px) {
	.header-icon {
		display: none;
	}
}

@media (max-width: 435px) {
	.header-title {
		font-size: clamp(16px, 6vw, 28px);
	}
	.header-button {
		height: 32px;
		width: 32px;
		font-size: 20px;
	}
	.header-button .material-icons {
		font-size: 20px;
	}
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(-20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
