* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f4ecff;
  font-family: Arial, sans-serif;
  color: #333;
}

header {
  text-align: center;
  padding: 30px;
  background: #7b4bb7;
  color: white;
}

header h1 {
  margin-bottom: 10px;
}

header a {
  color: white;
}

main {
  width: 90%;
  margin: 20px auto;
}

label {
  display: block;
  max-width: 500px;
  margin: 10px auto 5px;
  font-weight: bold;
}

input,
select {
  display: block;
  width: 90%;
  max-width: 500px;
  margin: 10px auto;
  padding: 10px;
  border: 1px solid #555;
  border-radius: 6px;
  font-size: 16px;
  background: white;
  color: #333;
}

#showMatchCount,
#matchCount {
  text-align: center;
  margin: 10px;
  font-weight: bold;
}

#showsRoot,
#episodesRoot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 30px;
  align-items: stretch;
}

.show-card,
.episode-card {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  height: 100%;
}

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

.show-card h2,
.episode-card h3 {
  background: #dfc8f5;
  padding: 15px;
  text-align: center;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.show-name {
  border: none;
  background: none;
  font-size: 20px;
  font-weight: bold;
  color: #333;
  cursor: pointer;
}

.show-name:hover {
  text-decoration: underline;
}

.show-name:focus-visible,
#backToShows:focus-visible,
.episode-card a:focus-visible {
  outline: 3px solid #222;
  outline-offset: 2px;
}

.show-card p {
  padding: 8px 15px;
}

.summary {
  height: 150px;
  padding: 15px;
  line-height: 1.5;
  overflow-y: auto;
  scrollbar-width: thin;
}

.episode-card a {
  display: block;
  margin: 15px;
  padding: 10px;
  background: #6b3fa0;
  color: white;
  text-align: center;
  text-decoration: none;
  border-radius: 6px;
  margin-top: auto;
}

.episode-card a:hover {
  background: #512f7a;
}

#backToShows {
  display: block;
  margin: 20px auto;
  padding: 10px 20px;
  border: none;
  border-radius: 6px;
  background: #6b3fa0;
  color: white;
  font-size: 16px;
  cursor: pointer;
}

#backToShows:hover {
  background: #512f7a;
}

#selectedShowName {
  text-align: center;
  margin: 20px;
}

#statusMessage,
#showsStatus {
  text-align: center;
  margin: 20px;
  font-size: 18px;
}
