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

body {
  min-height: 100vh;

  font-family:
    Arial,
    Helvetica,
    sans-serif;

  overflow-x: hidden;

  background:
    radial-gradient(
      circle at top,
      #252525 0%,
      #141414 40%,
      #0b0b0b 100%
    );

  color: white;

  padding: 45px 55px;
}


/* =========================
   SHOWS VIEW
========================= */

#shows-view {
  width: 100%;
}


/* =========================
   SHOW HEADER
========================= */

.shows-header {
  width: 100%;
  max-width: 1600px;

  margin: 0 auto 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  gap: 20px;
}

.shows-header h1 {
  font-size: 2rem;

  color: white;

  white-space: nowrap;
}


/* =========================
   SHOW SEARCH + SELECTOR
========================= */

.shows-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;

  gap: 10px;

  flex-shrink: 0;
}

#show-search {
  width: 280px;
  height: 38px;

  padding: 8px 12px;

  border: 1px solid #777;
  border-radius: 5px;

  background: white;
  color: #222;

  font-size: 0.95rem;
}

#show-select {
  width: 180px;
  height: 38px;

  padding: 7px 10px;

  border: 1px solid #777;
  border-radius: 5px;

  background: white;
  color: #222;

  font-size: 0.9rem;

  cursor: pointer;
}

#show-search:focus,
#show-select:focus {
  outline: 2px solid #e50914;
  outline-offset: 2px;

  border-color: #e50914;
}


/* =========================
   SHOW STATUS
========================= */

#show-status {
  width: 100%;
  max-width: 1600px;

  margin: 0 auto 20px;

  color: #999;

  font-size: 0.9rem;
}


/* =========================
   SHOW GRID
========================= */

#shows-root {
  width: 100%;
  max-width: 1600px;

  margin: 0 auto;

  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(300px, 1fr)
    );

  gap: 25px;
}


/* =========================
   SHOW CARD
========================= */

.show-card {
  display: flex;
  flex-direction: column;

  background:
    linear-gradient(
      180deg,
      #222222 0%,
      #181818 65%,
      #111111 100%
    );

  border-radius: 14px;
  overflow: hidden;

  border:
    1px solid
    rgba(255, 255, 255, 0.06);

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.35);

  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.show-card:hover {
  transform: translateY(-7px);

  border-color:
    rgba(229, 9, 20, 0.5);

  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.7);
}


/* =========================
   SHOW IMAGE
========================= */

.show-card > img {
  width: 100%;
  height: 300px;

  object-fit: cover;

  display: block;

  background: #111;
}


/* =========================
   SHOW CONTENT
========================= */

.show-content {
  padding: 18px;
}


/* =========================
   SHOW TITLE BUTTON
========================= */

.show-title {
  margin-bottom: 12px;

  padding: 0;

  border: 0;

  background: none;

  color: white;

  font-family: inherit;

  font-size: 1.2rem;
  font-weight: 700;

  text-align: left;

  cursor: pointer;

  transition: color 0.2s ease;
}

.show-title:hover {
  color: #e50914;

  text-decoration: underline;
}

.show-title:focus {
  outline: 2px solid #e50914;
  outline-offset: 4px;
}


/* =========================
   SHOW SUMMARY
========================= */

.show-summary {
  color: #a9a9a9;

  font-size: 0.85rem;

  line-height: 1.55;

  margin-bottom: 15px;

  display: -webkit-box;

  -webkit-line-clamp: 5;

  -webkit-box-orient: vertical;

  overflow: hidden;
}


/* =========================
   SHOW DETAILS
========================= */

.show-details {
  border-top:
    1px solid
    rgba(255, 255, 255, 0.08);

  padding-top: 12px;

  color: #999;

  font-size: 0.82rem;

  line-height: 1.7;
}

.show-details p {
  margin: 0;
}

.show-details strong {
  color: #ddd;
}


/* =========================
   EPISODE CONTROLS
========================= */

#search {
  width: 100%;

  display: flex;

  align-items: center;
  justify-content: center;

  gap: 10px;

  margin-bottom: 25px;
}


/* =========================
   BACK BUTTON
========================= */

#back-to-shows {
  height: 32px;

  padding: 4px 12px;

  border: 1px solid #777;

  border-radius: 5px;

  background: #222;

  color: white;

  cursor: pointer;

  font-size: 0.85rem;
}

#back-to-shows:hover {
  background: #333;

  border-color: #e50914;
}

#back-to-shows:focus {
  outline: 2px solid #e50914;

  outline-offset: 2px;
}


/* =========================
   EPISODE SELECTOR
========================= */

#episode-select {
  width: 230px;
  height: 32px;

  padding: 4px 8px;

  border: 1px solid #777;

  border-radius: 4px;

  background: white;

  color: #222;

  font-size: 0.9rem;

  cursor: pointer;
}

#episode-select:focus {
  outline: 2px solid #e50914;

  outline-offset: 2px;

  border-color: #e50914;
}


/* =========================
   EPISODE SEARCH
========================= */

#site-search {
  width: 220px;
  height: 32px;

  padding: 4px 8px;

  border: 1px solid #777;

  border-radius: 4px;

  background: white;

  color: #222;

  font-size: 0.9rem;
}

#site-search:focus {
  outline: 2px solid #e50914;

  outline-offset: 2px;

  border-color: #e50914;
}


/* =========================
   EPISODE COUNT
========================= */

#search-count {
  color: #999;

  font-size: 0.85rem;

  white-space: nowrap;
}


/* =========================
   EPISODE GRID
========================= */

#root {
  width: 100%;
  max-width: 1600px;

  margin: 0 auto;

  display: grid;

  grid-template-columns:
    repeat(
      auto-fill,
      minmax(240px, 280px)
    );

  gap: 30px 22px;

  justify-content: center;

  align-items: start;
}


/* =========================
   EPISODE CARD
========================= */

.card {
  width: 100%;

  position: relative;

  display: flex;

  flex-direction: column;

  min-height: 390px;

  background:
    linear-gradient(
      180deg,
      #222222 0%,
      #181818 65%,
      #111111 100%
    );

  border-radius: 14px;

  overflow: hidden;

  border:
    1px solid
    rgba(255, 255, 255, 0.06);

  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.45),
    0 2px 6px rgba(0, 0, 0, 0.35);

  transition:
    transform 0.28s ease,
    box-shadow 0.28s ease,
    border-color 0.28s ease;
}

.card:hover {
  transform:
    translateY(-10px)
    scale(1.035);

  border-color:
    rgba(229, 9, 20, 0.5);

  box-shadow:
    0 20px 45px rgba(0, 0, 0, 0.7),
    0 0 18px rgba(229, 9, 20, 0.12);

  z-index: 5;
}


/* =========================
   EPISODE IMAGE
========================= */

.card img {
  width: 100%;
  height: 170px;

  object-fit: cover;

  display: block;

  background: #111;

  filter: brightness(0.9);

  transition:
    transform 0.35s ease,
    filter 0.35s ease;
}

.card:hover img {
  transform: scale(1.05);

  filter: brightness(1);
}


/* =========================
   EPISODE TITLE
========================= */

.title {
  padding: 16px 17px 8px;

  font-size: 1rem;

  font-weight: 700;

  line-height: 1.35;

  color: white;

  min-height: 65px;

  display: -webkit-box;

  -webkit-line-clamp: 2;

  -webkit-box-orient: vertical;

  overflow: hidden;
}


/* =========================
   EPISODE SUMMARY
========================= */

.content {
  padding: 8px 17px 20px;

  color: #a9a9a9;

  font-size: 0.84rem;

  line-height: 1.55;

  flex: 1;

  overflow: hidden;

  display: -webkit-box;

  -webkit-line-clamp: 6;

  -webkit-box-orient: vertical;
}

.content p {
  margin: 0;
}


/* =========================
   RED ACCENT
========================= */

.card::after {
  content: "";

  position: absolute;

  bottom: 0;
  left: 0;

  width: 0;
  height: 3px;

  background: #e50914;

  transition: width 0.3s ease;
}

.card:hover::after {
  width: 100%;
}


/* =========================
   ERROR MESSAGE
========================= */

.error-message {
  width: 100%;

  padding: 20px;

  color: #ffb3b3;

  text-align: center;
}


/* =========================
   FOOTER
========================= */

.footer {
  text-align: center;

  margin-top: 50px;

  padding: 20px;

  color: #777;

  font-size: 0.85rem;
}

.footer a {
  color: #e50914;

  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}


/* =========================
   TABLET
========================= */

@media (max-width: 1000px) {
  body {
    padding: 35px;
  }

  .shows-header {
    align-items: center;
  }

  .shows-controls {
    flex: 1;
  }

  #show-search {
    flex: 1;

    width: auto;
  }

  #show-select {
    width: 180px;
  }

  #shows-root {
    grid-template-columns:
      repeat(
        auto-fill,
        minmax(260px, 1fr)
      );
  }

  #root {
    grid-template-columns:
      repeat(
        auto-fill,
        minmax(220px, 260px)
      );

    gap: 28px 20px;
  }

  #search {
    flex-wrap: wrap;
  }
}


/* =========================
   MOBILE
========================= */

@media (max-width: 600px) {
  body {
    padding: 20px;
  }

  .shows-header {
    flex-direction: column;

    align-items: stretch;
  }

  .shows-controls {
    width: 100%;

    flex-direction: row;
  }

  #show-search {
    width: auto;

    flex: 1;
  }

  #show-select {
    width: 150px;
  }

  #shows-root {
    grid-template-columns: 1fr;

    gap: 20px;
  }

  .show-card > img {
    height: 260px;
  }


  /* Episode controls */

  #search {
    flex-direction: column;

    align-items: stretch;
  }

  #back-to-shows,
  #episode-select,
  #site-search {
    width: 100%;
  }

  #search-count {
    white-space: normal;

    text-align: center;
  }


  /* Episode grid */

  #root {
    grid-template-columns:
      minmax(0, 320px);

    justify-content: center;

    gap: 25px;

    padding: 10px;
  }

  .card {
    width: 100%;

    min-height: auto;
  }

  .card img {
    height: 200px;
  }

  .title {
    font-size: 1rem;

    min-height: auto;

    padding: 15px 16px 8px;
  }

  .content {
    padding: 8px 16px 20px;

    font-size: 0.86rem;
  }

  .card:hover {
    transform:
      translateY(-5px)
      scale(1.01);
  }

  .footer {
    margin-top: 35px;

    padding: 15px;
  }
}


/* =========================
   VERY SMALL PHONES
========================= */

@media (max-width: 360px) {
  body {
    padding: 14px;
  }

  .shows-controls {
    flex-direction: column;
  }

  #show-search,
  #show-select {
    width: 100%;
  }

  #root {
    grid-template-columns: 1fr;
  }

  .card img {
    height: 185px;
  }
}


/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }

  .show-card,
  .card,
  .card img,
  .card::after,
  .show-title {
    transition: none;
  }
}