* {
	box-sizing: border-box;
}

body {
	margin: 0;
	font-family: 'Segoe UI', Tahoma, sans-serif;
	background: #1a1625;
	color: #f0e6ff;
}

header {
	background: #241734;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 1px solid #3d2563;
}

.header-title {
	margin: 0;
	text-align: center;
	font-size: 28px;
	color: #f0e6ff;
	letter-spacing: 0.5px;
}

.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.toolbar-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.toolbar-label {
	font-weight: 700;
	color: #f0e6ff;
}

.left-group,
.right-group {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

header p {
	margin: 0;
}

#search-results {
	font-weight: 600;
	color: #f0e6ff;
	flex: 0 0 auto;
}

select,
input[type='search'] {
	background: #2d1b4e;
	color: #f0e6ff;
	border: 1px solid #3d2563;
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 14px;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
	outline: none;
	min-width: 240px;
	width: 240px;
}

select:focus,
input[type='search']:focus {
	border-color: #ffa500;
	box-shadow: 0 0 0 2px rgba(255, 165, 0, 0.25);
}

input[type='search']::placeholder {
	color: #cbb5ef;
}

.shows-count {
	margin: 0;
	font-weight: 600;
	color: #f0e6ff;
}

.back-button {
	background: #2d1b4e;
	border: 1px solid #3d2563;
	color: #f0e6ff;
	padding: 10px 14px;
	border-radius: 10px;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
}

.back-button:hover,
.back-button:focus-visible {
	border-color: #ffa500;
	color: #ffa500;
}

.hidden {
	display: none;
}

@media (max-width: 640px) {
	.left-group,
	.right-group {
		width: 100%;
	}

	.right-group {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	#search-results {
		width: 100%;
		order: 2;
	}

	.right-group input[type='search'] {
		width: 100%;
		order: 1;
		padding-left: 6px;
		margin-top: 3px;
	}

	select,
	input[type='search'] {
		width: 100%;
		min-width: 0;
	}
}

a {
	color: #cdeafe;
	text-decoration: none;
}

a:visited {
	color: #cdeafe;
}

a:hover,
a:focus-visible {
	color: #e0f2fe;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.page-footer a,
.page-footer a:visited {
	color: #f0f9ff;
	text-decoration: underline;
}

.page-footer a:hover,
.page-footer a:focus-visible {
	color: #ffffff;
}

#root {
	min-height: 100vh;
	padding: 24px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.page-title {
	margin: 0;
	font-size: 28px;
	letter-spacing: 0.5px;
}

.shows-list {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.show-card {
	display: grid;
	grid-template-columns: 180px 1fr 200px;
	gap: 16px;
	background: #2d1b4e;
	border: 1px solid #3d2563;
	border-radius: 14px;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
	padding: 14px 16px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	cursor: pointer;
}

.show-card:hover,
.show-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.show-poster-wrapper {
	width: 100%;
}

.show-poster {
	width: 100%;
	height: 240px;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid #3d2563;
}

.show-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.show-title {
	margin: 0;
	font-size: 26px;
}

.show-title-button {
	background: transparent;
	border: none;
	color: #f0e6ff;
	font: inherit;
	padding: 0;
	cursor: pointer;
}

.show-title-button:hover,
.show-title-button:focus-visible {
	color: #ffa500;
}

.show-summary {
	margin: 0;
	line-height: 1.6;
	color: #d4c5f9;
}

.show-meta {
	background: #241734;
	border: 1px solid #3d2563;
	border-radius: 12px;
	padding: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 180px;
}

.show-meta-row {
	margin: 0;
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.show-meta-label {
	font-weight: 700;
}

.show-meta-value {
	color: #d4c5f9;
}

.episodes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
	width: 100%;
	align-items: stretch;
}

@media (max-width: 960px) {
	.show-card {
		grid-template-columns: 1fr;
	}

	.show-poster {
		height: 220px;
	}

	.show-meta {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 12px;
	}

	.show-meta-row {
		flex: 1 1 45%;
	}
}

@media (min-width: 1024px) {
	.episodes-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.episode-card-link {
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
	outline-offset: 2px;
}

.episode-card {
	background: #2d1b4e;
	border: 1px solid #3d2563;
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
	height: 380px;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.episode-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

.episode-card img {
	width: 100%;
	height: 180px;
	object-fit: cover;
	display: block;
}

.episode-body {
	padding: 14px 16px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	overflow: hidden;
}

.episode-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 8px;
}

.episode-name {
	margin: 0;
	font-size: 18px;
}

.episode-code {
	margin: 0;
	font-weight: 700;
	color: #ffa500;
	letter-spacing: 0.5px;
}

.episode-summary {
	margin: 0;
	line-height: 1.5;
	color: #d4c5f9;
	flex: 1;
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 5;
	line-clamp: 5;
	text-overflow: ellipsis;
}

.attribution {
	font-size: 14px;
	color: #d4c5f9;
}

.page-footer {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid #3d2563;
	text-align: center;
	font-weight: 700;
}
