/* ========================================
   基本設定
   ======================================== */
* {
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:root {
	--primary-color: #1a237e;
	--secondary-color: #283593;
	--accent-color: #ff6f00;
	--text-color: #333;
	--bg-color: #f5f5f5;
	--card-bg: #ffffff;
	--border-color: #e0e0e0;
	--shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	--shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.2);
}

body {
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Hiragino Sans',
		'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
	background-color: var(--bg-color);
	color: var(--text-color);
	line-height: 1.6;
}

/* ========================================
   ヘッダー
   ======================================== */
header {
	background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
	color: white;
	text-align: center;
	padding: 2rem 1rem;
	box-shadow: var(--shadow);
	position: relative;
}

.header-logo {
	position: absolute;
	top: 1rem;
	right: 1rem;
	height: 80px;
	width: auto;
	object-fit: contain;
}

.header-content {
	max-width: 1200px;
	margin: 0 auto;
}

.event-name {
	font-size: 0.9rem;
	opacity: 0.85;
	font-weight: 400;
	margin-bottom: 0.5rem;
	letter-spacing: 0.5px;
}

header h1 {
	font-size: 2.5rem;
	margin-bottom: 0.5rem;
	font-weight: 700;
}

.subtitle {
	font-size: 1rem;
	opacity: 0.9;
	font-weight: 300;
	letter-spacing: 1px;
	margin-bottom: 1rem;
}

.special-site-btn {
	display: inline-block;
	background-color: var(--accent-color);
	color: white;
	padding: 0.75rem 2rem;
	border-radius: 25px;
	text-decoration: none;
	font-weight: 600;
	font-size: 1rem;
	transition: all 0.3s ease;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
	margin-top: 0.5rem;
}

.special-site-btn:hover {
	background-color: #ff8f00;
	transform: translateY(-2px);
	box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

/* ========================================
   メインコンテンツ
   ======================================== */
main {
	max-width: 1400px;
	margin: 0 auto;
	padding: 2rem 1rem;
}

/* ========================================
   統計情報
   ======================================== */
.stats {
	display: flex;
	justify-content: center;
	gap: 2rem;
	margin-bottom: 3rem;
	flex-wrap: wrap;
}

.stat-item {
	background: var(--card-bg);
	padding: 1.5rem 2rem;
	border-radius: 12px;
	box-shadow: var(--shadow);
	text-align: center;
	min-width: 180px;
	transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-item:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-hover);
}

.stat-label {
	display: block;
	font-size: 0.9rem;
	color: #666;
	margin-bottom: 0.5rem;
}

.stat-value {
	display: inline-block;
	font-size: 2.5rem;
	font-weight: 700;
	color: var(--primary-color);
	margin: 0 0.25rem;
}

.stat-unit {
	font-size: 1rem;
	color: #666;
}

/* ========================================
   メシエ天体グリッド
   ======================================== */
.messier-grid {
	display: grid;
	grid-template-columns: repeat(10, 1fr);
	gap: 1rem;
	margin-bottom: 2rem;
}

.messier-card {
	background: var(--card-bg);
	border-radius: 8px;
	overflow: hidden;
	box-shadow: var(--shadow);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
}

.messier-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow-hover);
}

.messier-card.observed {
	border: 2px solid var(--accent-color);
}

.messier-image {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	background: #f0f0f0;
	display: block;
}

.messier-image.loading {
	background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
	background-size: 200% 100%;
	animation: loading 1.5s ease-in-out infinite;
}

@keyframes loading {
	0% {
		background-position: 200% 0;
	}

	100% {
		background-position: -200% 0;
	}
}

.messier-info {
	padding: 0.75rem;
	text-align: center;
}

.messier-id {
	font-weight: 700;
	font-size: 1rem;
	color: var(--primary-color);
	margin-bottom: 0.25rem;
}

.messier-name {
	font-size: 0.75rem;
	color: #666;
	margin-bottom: 0.5rem;
	min-height: 2.4em;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.messier-count {
	font-size: 1.1rem;
	font-weight: 600;
	color: var(--accent-color);
}

.messier-count .count-number {
	font-size: 1.3rem;
}

/* ========================================
   ローディング・エラー表示
   ======================================== */
.loading,
.error {
	text-align: center;
	padding: 3rem;
	font-size: 1.2rem;
	color: #666;
}

.error {
	color: #d32f2f;
}

/* ========================================
   フッター
   ======================================== */
footer {
	background: var(--card-bg);
	text-align: center;
	padding: 2rem 1rem;
	margin-top: 3rem;
	border-top: 1px solid var(--border-color);
}

footer p {
	margin: 0.5rem 0;
	color: #666;
	font-size: 0.9rem;
}

.credit {
	font-weight: 600;
	color: var(--primary-color);
	font-size: 1rem;
	margin-bottom: 0.75rem;
}

.update-info {
	font-size: 0.8rem;
	color: #999;
}

/* ========================================
   レスポンシブデザイン
   ======================================== */

/* タブレット (横幅 768px 以下) */
@media (max-width: 768px) {
	.header-logo {
		height: 50px;
		top: 0.5rem;
		right: 0.5rem;
	}

	.event-name {
		font-size: 0.8rem;
	}

	header h1 {
		font-size: 2rem;
	}

	.special-site-btn {
		font-size: 0.9rem;
		padding: 0.6rem 1.5rem;
	}

	.stats {
		gap: 1rem;
	}

	.stat-item {
		min-width: 140px;
		padding: 1rem 1.5rem;
	}

	.stat-value {
		font-size: 2rem;
	}

	.messier-grid {
		grid-template-columns: repeat(5, 1fr);
		gap: 0.75rem;
	}

	.messier-info {
		padding: 0.5rem;
	}

	.messier-id {
		font-size: 0.9rem;
	}

	.messier-name {
		font-size: 0.7rem;
	}

	.messier-count {
		font-size: 1rem;
	}

	.messier-count .count-number {
		font-size: 1.2rem;
	}
}

/* スマートフォン (横幅 480px 以下) */
@media (max-width: 480px) {
	header {
		padding: 1.5rem 1rem;
	}

	header h1 {
		font-size: 1.5rem;
	}

	.subtitle {
		font-size: 0.85rem;
	}

	main {
		padding: 1.5rem 0.75rem;
	}

	.stats {
		flex-direction: column;
		gap: 1rem;
		margin-bottom: 2rem;
	}

	.stat-item {
		width: 100%;
	}

	.messier-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 0.5rem;
	}

	.messier-info {
		padding: 0.4rem;
	}

	.messier-id {
		font-size: 0.85rem;
	}

	.messier-name {
		font-size: 0.65rem;
		min-height: 2.6em;
	}

	.messier-count {
		font-size: 0.9rem;
	}

	.messier-count .count-number {
		font-size: 1.1rem;
	}
}

/* 極小スマートフォン (横幅 360px 以下) */
@media (max-width: 360px) {
	.messier-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.messier-name {
		font-size: 0.7rem;
	}
}

/* ========================================
   印刷用スタイル
   ======================================== */
@media print {
	header {
		background: white;
		color: black;
		box-shadow: none;
	}

	.stats {
		page-break-after: avoid;
	}

	.messier-card {
		page-break-inside: avoid;
	}

	footer {
		page-break-before: always;
	}
}