* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: "Gaegu", "Comic Sans MS", "Comic Sans", "Marker Felt", cursive, sans-serif;
	background: linear-gradient(135deg, #f5f5f5 0%, #ffffff 50%, #f9f9f9 100%);
	color: #222;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	padding: 1rem;
	position: relative;
}

body::before {
	content: "";
	position: absolute;
	inset: 0;
	background-image: 
		repeating-linear-gradient(
			0deg,
			transparent,
			transparent 27px,
			#e8e8e8 27px,
			#e8e8e8 28px
		),
		repeating-linear-gradient(
			90deg,
			transparent,
			transparent 27px,
			#ffeaa7 27px,
			#ffeaa7 28px
		);
	opacity: 0.3;
	pointer-events: none;
}

main {
	text-align: center;
	padding: 1rem 1rem 0.5rem;
	width: 100%;
	max-width: 900px;
	margin: 0 auto;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding-top: 2rem;
}

h1 {
	font-size: clamp(2rem, 6vw, 3rem);
	margin-bottom: 0.5rem;
	font-weight: 700;
	line-height: 1.3;
}

.highlight {
	position: relative;
	z-index: 1;
}

.highlight::after {
	content: "";
	position: absolute;
	left: -3px;
	bottom: 0;
	width: calc(100% + 6px);
	height: 35%;
	background: linear-gradient(
		105deg,
		transparent 2%,
		#ffd166 5%,
		#ffd166 95%,
		transparent 98%
	);
	transform: skewX(-2deg) rotate(-1deg);
	z-index: -1;
	opacity: 0.8;
	border-radius: 3px 15px 10px 20px / 5px 10px 20px 15px;
	filter: blur(0.5px);
}

.subtitle {
	font-size: clamp(1.2rem, 3.5vw, 1.5rem);
	margin-top: 0.5rem;
	margin-bottom: 0.3rem;
	font-weight: 400;
}

#today-inline {
	font-weight: 700;
	color: #e63946;
	font-size: 1.2em;
	transition: transform 0.3s ease-in-out, color 0.3s ease-in-out;
	display: inline-block;
}

.right-count {
	font-size: clamp(0.9rem, 2vw, 1.1rem);
	color: #6b7280;
	margin-top: 0;
	margin-bottom: 1.5rem;
	font-weight: 400;
	font-style: italic;
}

.chart-section {
	margin-top: 2rem;
	padding: 0 1rem;
	width: 100%;
}

.chart-section h2 {
	font-size: clamp(1.1rem, 3vw, 1.4rem);
	font-weight: 700;
	color: #1f2937;
	margin-bottom: 1rem;
}

#chart {
	width: 100%;
	max-width: 800px;
	height: 400px;
	margin: 0 auto;
	display: block;
}

#chart-container {
	width: 100%;
	height: 100%;
}

.chart-legend {
	display: flex;
	justify-content: center;
	gap: 2rem;
	margin-top: 1rem;
	font-size: 0.95rem;
}

.legend-item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.legend-color {
	width: 20px;
	height: 12px;
	border: 2px solid #333;
	border-radius: 2px;
	display: inline-block;
}

footer {
	text-align: center;
	padding: 0.5rem 1rem 0.8rem;
	font-size: clamp(0.8rem, 2vw, 0.9rem);
	color: #6b7280;
	margin-top: 1rem;
	margin-bottom: 0.5rem;
}

/* Mobile styles */
@media (max-width: 600px) {
	body {
		padding: 0.5rem;
		min-height: 100vh;
	}

	main {
		padding: 1.5rem 0.5rem 0.5rem;
	}

	h1 {
		font-size: 2rem;
	}

	.highlight::after {
		height: 30%;
	}

	.today-count {
		font-size: 4rem;
	}

	.subtitle {
		font-size: 1.3rem;
	}

	.right-count {
		font-size: 0.9rem;
	}

	#chart {
		height: 320px;
	}

	footer {
		font-size: 0.75rem;
	}
	
	.chart-legend {
		font-size: 0.85rem;
		gap: 1rem;
		flex-wrap: wrap;
	}
	
	.legend-color {
		width: 16px;
		height: 10px;
	}
}

/* Tablet styles */
@media (min-width: 601px) and (max-width: 900px) {
	main {
		padding: 2rem 1.5rem;
	}
}

footer a {
	color: #e63946;
	text-decoration: none;
	font-weight: 700;
	transition: transform 0.2s;
	display: inline-block;
}

footer a:hover {
	transform: rotate(-5deg) scale(1.1);
}

.wiggle {
	display: inline-block;
	color: #9ca3af;
	font-weight: 700;
}
