/* Jellyfin screen and book pages. */

.scene--watch-summary .scene__image,
.scene--books .scene__image {
  filter: blur(24px) saturate(1.25) brightness(0.46);
}
.scene--top-show .scene__image,
.scene--top-movie .scene__image {
  filter: blur(1px) saturate(1.06) brightness(0.6);
  opacity: 0.96;
  transform: scale(1.04);
}
.scene--top-show .scene__bg .topo,
.scene--top-movie .scene__bg .topo {
  display: none;
}
.scene--top-show .scene__tint,
.scene--top-movie .scene__tint {
  background:
    linear-gradient(180deg, rgba(4, 4, 6, 0.18) 0%, rgba(4, 4, 6, 0.04) 28%, rgba(4, 4, 6, 0.52) 64%, rgba(4, 4, 6, 0.94) 100%),
    linear-gradient(90deg, rgba(4, 4, 6, 0.68) 0%, rgba(4, 4, 6, 0.15) 48%, rgba(4, 4, 6, 0.42) 100%);
}

.screen-page {
  width: 100%;
  max-width: 760px;
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.screen-number {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: clamp(16px, 3vh, 28px);
}
.screen-page .story-heading h1 {
  font-size: clamp(42px, 8vw, 64px);
}
.screen-page .story-heading > p:last-child {
  max-width: 460px;
  margin-inline: auto;
  font-size: clamp(14px, 1.6vw, 17px);
}
.screen-number strong {
  color: var(--cyan);
  font-family: var(--title);
  font-size: clamp(96px, 21vw, 180px);
  line-height: 0.78;
  font-weight: 800;
  letter-spacing: -0.075em;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 52px rgba(122, 224, 255, 0.12);
}
.screen-number span {
  margin-top: 14px;
  color: rgba(245, 238, 226, 0.78);
  font-family: var(--mono);
  font-size: 13.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.screen-stats {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(var(--stat-count, 4), minmax(0, 1fr));
  gap: 10px;
  margin-top: clamp(22px, 3.5vh, 34px);
}
.screen-stats > div {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 17px 12px;
  border: 1px solid rgba(245, 238, 226, 0.14);
  border-radius: 13px;
  background: rgba(5, 6, 8, 0.4);
  backdrop-filter: blur(12px);
}
.screen-stats strong {
  color: var(--cream);
  font-family: var(--title);
  font-size: clamp(28px, 4.2vw, 40px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}
.screen-stats span {
  color: rgba(245, 238, 226, 0.76);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.screen-genre-line {
  margin: 20px 0 0;
  color: rgba(245, 238, 226, 0.76);
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.4;
}
.screen-genre-line strong {
  color: var(--lime);
  font-weight: 700;
}

.screen-episode-line {
  margin: 12px 0 0;
  color: rgba(245, 238, 226, 0.68);
  font-size: 12.5px;
  line-height: 1.45;
}
.screen-genre {
  margin: 14px 0 0;
  color: rgba(245, 238, 226, 0.72);
  font-size: 13px;
  line-height: 1.45;
}
.screen-range {
  margin: 16px 0 0;
  color: rgba(245, 238, 226, 0.62);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.screen-method {
  max-width: 430px;
  margin: 12px 0 0;
  color: rgba(245, 238, 226, 0.6);
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
}
.screen-genre strong {
  color: var(--lime);
  font-weight: 700;
}

.poster-wall {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: #050608;
}
.poster-wall__grid {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 160vmax;
  height: 160vmax;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 12px;
  transform: translate(-50%, -50%) rotate(-38deg) scale(1.04);
  filter: blur(2px) brightness(0.4) saturate(0.92);
  opacity: 0.9;
  animation: posterWallPan 42s ease-in-out infinite alternate;
  will-change: transform;
}
.poster-wall__grid span {
  display: block;
  border-radius: 14px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}
.poster-wall::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 44%, rgba(4, 5, 7, 0.14), rgba(4, 5, 7, 0.66) 72%),
    linear-gradient(180deg, rgba(3, 4, 6, 0.72) 0%, transparent 28% 66%, rgba(3, 4, 6, 0.84) 100%);
}
.scene--watch-summary .scene__bg .topo {
  display: none;
}
.scene--watch-summary .scene__tint {
  background: linear-gradient(
    180deg,
    rgba(3, 4, 6, 0.28) 0%,
    transparent 28% 70%,
    rgba(3, 4, 6, 0.62) 100%
  );
}
@keyframes posterWallPan {
  from {
    transform: translate(-51%, -50%) rotate(-39deg) scale(1.03);
  }
  to {
    transform: translate(-49%, -50%) rotate(-36deg) scale(1.07);
  }
}

/* Show and movie hero */
.screen-hero {
  width: 100%;
  max-width: 880px;
  min-height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
}
.screen-hero__poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.52);
}
.screen-hero__poster img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.screen-hero__poster-score {
  position: absolute;
  z-index: 2;
  right: 9px;
  bottom: 9px;
  padding: 4px 7px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(6, 7, 9, 0.7);
  color: var(--lime);
  font-family: var(--mono);
  font-size: 11px;
  backdrop-filter: blur(8px);
}
.screen-hero__placeholder {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--cyan);
  font-family: var(--title);
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 800;
  background: #0a0d12;
}
.screen-hero__body {
  min-width: 0;
}
.screen-hero__title {
  min-width: 0;
  margin-top: 13px;
}
.screen-hero__title h1 {
  margin: 0;
  color: var(--cream);
  font-family: var(--title);
  font-size: clamp(38px, 6.4vw, 70px);
  line-height: 0.9;
  font-weight: 800;
  letter-spacing: -0.06em;
  overflow-wrap: anywhere;
  text-shadow: 0 4px 38px rgba(0, 0, 0, 0.3);
}
.screen-hero__logo {
  display: none;
  width: auto;
  max-width: min(100%, 520px);
  height: auto;
  max-height: clamp(72px, 14vw, 132px);
  object-fit: contain;
  filter: drop-shadow(0 6px 28px rgba(0, 0, 0, 0.4));
}
.screen-hero__title.has-logo .screen-hero__logo {
  display: block;
}
.screen-hero__title.has-logo h1 {
  display: none;
}
.screen-hero__meta {
  margin: 14px 0 0;
  color: rgba(245, 238, 226, 0.84);
  font-size: 14px;
  line-height: 1.5;
}
.screen-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}
.screen-hero__badges span:not(.screen-hero__score):not(.screen-hero__cert) {
  color: rgba(245, 238, 226, 0.62);
}
.screen-hero__badges span {
  padding: 5px 9px;
  border: 1px solid rgba(245, 238, 226, 0.18);
  border-radius: 999px;
  color: rgba(245, 238, 226, 0.76);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.screen-hero__badges .screen-hero__score {
  border-color: transparent;
  background: var(--lime);
  color: #111;
  font-weight: 700;
}
.screen-hero__overview {
  display: -webkit-box;
  max-width: 62ch;
  margin: 15px 0 0;
  overflow: hidden;
  color: rgba(245, 238, 226, 0.72);
  font-size: 13.5px;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}
.screen-hero__stats {
  display: flex;
  gap: clamp(18px, 4vw, 36px);
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}
.screen-hero__stats > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.screen-hero__stats strong {
  color: var(--cream);
  font-family: var(--title);
  font-size: clamp(20px, 2.8vw, 28px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}
.screen-hero__stats span {
  color: rgba(245, 238, 226, 0.68);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.screen-episodes {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-soft);
}
.screen-episodes li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(245, 238, 226, 0.08);
  color: rgba(245, 238, 226, 0.8);
  font-size: 12px;
}
.screen-episodes li span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.screen-episodes li strong {
  flex: 0 0 auto;
  color: rgba(245, 238, 226, 0.6);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.03em;
}

/* Books */
.books-page {
  width: 100%;
  max-width: 760px;
  min-height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.book-shelf {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: clamp(9px, 2.2vw, 18px);
  margin-top: clamp(16px, 3vh, 28px);
}
.book-shelf figure {
  width: clamp(88px, 17vw, 132px);
  margin: 0;
}
.book-shelf img {
  width: 100%;
  aspect-ratio: 2 / 3;
  display: block;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.4);
}
.book-shelf figcaption {
  margin-top: 8px;
  overflow: hidden;
  color: rgba(245, 238, 226, 0.74);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-list {
  width: min(620px, 100%);
  margin-top: clamp(16px, 3vh, 26px);
  text-align: left;
}
.book-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 8px 2px;
  border-top: 1px solid rgba(245, 238, 226, 0.09);
}
.book-row:last-child {
  border-bottom: 1px solid rgba(245, 238, 226, 0.09);
}
.book-row__cover {
  width: 30px;
  height: 45px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.06);
}
.book-row__cover img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.book-row__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.book-row__meta strong,
.book-row__meta small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.book-row__meta strong {
  color: rgba(245, 238, 226, 0.92);
  font-size: 14px;
}
.book-row__meta small {
  color: rgba(245, 238, 226, 0.6);
  font-size: 11px;
}
.book-row__state {
  color: rgba(194, 255, 115, 0.82);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.books-page .tap-note {
  margin-top: 13px;
  padding-top: 0;
}

@media (max-width: 700px) {
  .screen-hero {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 13px;
    padding-top: 2px;
  }
  .screen-hero__poster {
    width: min(160px, 45vw);
    align-self: center;
  }
  .screen-hero__body {
    width: 100%;
  }
  .screen-hero__body h1 {
    font-size: clamp(32px, 9.8vw, 42px);
  }
  .screen-hero__overview {
    font-size: 13px;
    -webkit-line-clamp: 3;
  }
  .screen-hero__stats {
    margin-top: 12px;
    padding-top: 11px;
  }
  .screen-hero__stats strong {
    font-size: 22px;
  }
  .screen-episodes {
    margin-top: 12px;
  }
  .screen-episodes li {
    font-size: 11px;
  }
  .screen-episodes {
    display: none;
  }
  .screen-number strong {
    font-size: clamp(72px, 23vw, 105px);
  }
  .screen-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }
  .screen-stats[data-count="3"] > div:last-child {
    grid-column: 1 / -1;
  }
  .screen-stats strong {
    font-size: 30px;
  }
  .screen-stats > div {
    padding: 14px 11px;
  }
  .book-shelf figure {
    width: clamp(78px, 22vw, 108px);
  }
}

@media (max-width: 760px) and (max-height: 760px) {
  .screen-number {
    margin-top: 10px;
  }
  .screen-number strong {
    font-size: clamp(62px, 19vw, 94px);
  }
  .screen-stats {
    margin-top: 12px;
  }
  .screen-stats > div {
    padding: 9px 8px;
  }
  .screen-range {
    margin-top: 10px;
  }
  .screen-hero {
    gap: 13px;
  }
  .screen-hero__poster {
    width: min(140px, 42vw);
  }
  .screen-hero__body h1 {
    font-size: 32px;
  }
  .screen-hero__meta {
    margin-top: 10px;
  }
  .screen-hero__stats {
    margin-top: 12px;
  }
  .screen-episodes {
    margin-top: 10px;
  }
  .book-shelf img {
    max-height: 150px;
  }
}

/* Jellyfin top shows and movies */
.screen-list-page .story-heading {
  margin-inline: auto;
}
.screen-list {
  width: min(640px, 100%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: clamp(20px, 4vh, 38px) auto 0;
}
.screen-list-row {
  display: grid;
  grid-template-columns: 28px 46px minmax(0, 1fr) 74px;
  gap: 12px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid rgba(245, 238, 226, 0.12);
  border-radius: 12px;
  background: rgba(5, 6, 8, 0.34);
  backdrop-filter: blur(14px);
}
.screen-list-row__rank {
  color: rgba(245, 238, 226, 0.56);
  font-size: 10px;
}
.screen-list-row__poster {
  width: 46px;
  aspect-ratio: 2 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(245, 238, 226, 0.7);
  font-family: var(--title);
  font-size: 20px;
}
.screen-list-row__poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.screen-list-row__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.screen-list-row__meta strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--cream);
  font-size: 14px;
  line-height: 1.15;
  font-weight: 700;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.screen-list-row__meta small {
  overflow: hidden;
  color: rgba(245, 238, 226, 0.66);
  font-size: 11.5px;
  line-height: 1.2;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.screen-list-row__value {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}
.screen-list-row__value strong {
  color: var(--cream);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
}
.screen-list-row__value small {
  color: rgba(245, 238, 226, 0.58);
  font-size: 9.5px;
  white-space: nowrap;
}

/* Jellyfin genres */
.screen-genres-page {
  width: 100%;
  max-width: 680px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
}
.screen-genre-list {
  width: min(620px, 100%);
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: clamp(26px, 6vh, 58px) auto 0;
}
.screen-genre-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  grid-template-areas:
    "rank name share"
    "rank bar bar";
  gap: 7px 12px;
  align-items: center;
  padding: 14px 0 13px;
  border-bottom: 1px solid rgba(245, 238, 226, 0.14);
}
.screen-genre-row__rank {
  grid-area: rank;
  align-self: start;
  margin-top: 5px;
  color: rgba(245, 238, 226, 0.52);
  font-size: 10px;
}
.screen-genre-row__name {
  grid-area: name;
  min-width: 0;
  color: var(--cream);
  font-family: var(--title);
  font-size: clamp(23px, 4.8vw, 34px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.04em;
}
.screen-genre-row__share {
  grid-area: share;
  color: rgba(245, 238, 226, 0.82);
  font-family: var(--mono);
  font-size: 15px;
  text-align: right;
}
.screen-genre-row__bar {
  grid-area: bar;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(245, 238, 226, 0.13);
}
.screen-genre-row__bar i {
  width: var(--bar-width);
  height: 100%;
  display: block;
  border-radius: inherit;
  background: var(--cyan);
}
.screen-genre-row.is-top .screen-genre-row__bar i {
  background: var(--lime);
}

/* Soulmate */
.soulmate-page {
  width: 100%;
  max-width: 700px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  text-align: center;
}
.soulmate-page .story-heading h1 {
  color: var(--lime);
  font-size: clamp(48px, 10vw, 78px);
}
.soulmate-page .story-heading > p:last-child {
  max-width: 500px;
  margin-inline: auto;
  font-size: clamp(15px, 1.8vw, 18px);
  line-height: 1.5;
}
.soulmate-page .eyebrow {
  font-size: clamp(11px, 1.3vw, 13px);
}
.soulmate-tally {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 16px;
}
.soulmate-tally strong {
  color: var(--pink);
  font-family: var(--title);
  font-size: clamp(56px, 13vw, 88px);
  line-height: 0.8;
  font-weight: 800;
  letter-spacing: -0.06em;
}
.soulmate-tally span {
  color: rgba(245, 238, 226, 0.78);
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.soulmate-genres {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 10px;
}
.soulmate-genres span {
  padding: 6px 10px;
  border: 1px solid rgba(245, 238, 226, 0.18);
  border-radius: 999px;
  color: rgba(245, 238, 226, 0.84);
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.soulmate-list {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
  text-align: left;
}
.soulmate-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 9px 12px;
  border: 1px solid rgba(245, 238, 226, 0.13);
  border-radius: 11px;
  background: rgba(5, 6, 8, 0.38);
  backdrop-filter: blur(12px);
}
.soulmate-row__image {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--cream);
  font-family: var(--title);
  font-size: 20px;
}
.soulmate-row__image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.soulmate-row__meta {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.soulmate-row__meta small {
  color: rgba(245, 238, 226, 0.7);
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}
.soulmate-row__meta strong {
  overflow: hidden;
  color: var(--cream);
  font-size: 15px;
  line-height: 1.18;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.soulmate-page .source-note {
  max-width: 480px;
  margin-top: 16px;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 700px) {
  .screen-list {
    gap: 7px;
    margin-top: 18px;
  }
  .screen-list-row {
    grid-template-columns: 22px 40px minmax(0, 1fr) 58px;
    gap: 8px;
    padding: 7px 8px;
  }
  .screen-list-row__poster {
    width: 40px;
  }
  .screen-list-row__meta strong {
    font-size: 12.5px;
    line-height: 1.15;
  }
  .screen-list-row__meta small {
    font-size: 10.5px;
  }
  .screen-list-row__value strong {
    font-size: 13px;
  }
  .screen-list-row__value small {
    font-size: 9.5px;
  }
  .screen-genre-list {
    margin-top: 30px;
  }
  .screen-genre-row {
    grid-template-columns: 24px minmax(0, 1fr) auto;
    gap: 6px 9px;
    padding: 12px 0 11px;
  }
  .screen-genre-row__name {
    font-size: clamp(22px, 6.8vw, 29px);
  }
  .screen-genre-row__share {
    font-size: 13px;
  }
  .screen-genre-row__plays {
    font-size: 10.5px;
  }
  .soulmate-tally {
    margin-top: 18px;
  }
  .soulmate-list {
    grid-template-columns: 1fr;
    gap: 7px;
    margin-top: 18px;
  }
  .soulmate-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }
  .soulmate-row__image {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 380px) {
  .soulmate-row:nth-child(n + 3) {
    display: none;
  }
  .soulmate-tally strong {
    font-size: 50px;
  }
}

/* Cover-first top shows / top movies */
.screen-cover-grid {
  width: min(760px, 100%);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: clamp(22px, 4vh, 40px) auto 0;
}
.screen-cover-card {
  min-width: 0;
  text-align: left;
}
.screen-cover-card__poster {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(245, 238, 226, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.4);
}
.screen-cover-card__poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.screen-cover-card__rank,
.screen-cover-card__rating {
  position: absolute;
  z-index: 2;
  top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
}
.screen-cover-card__rank {
  left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(6, 7, 9, 0.62);
  color: var(--cream);
  backdrop-filter: blur(8px);
}
.screen-cover-card__rating {
  right: 8px;
  background: var(--lime);
  color: #111;
  font-weight: 700;
}
.screen-cover-card__caption {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  padding: 56px 10px 10px;
  background: linear-gradient(180deg, transparent, rgba(4, 5, 7, 0.82) 42%, #040507 100%);
}
.screen-cover-card__caption h2 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--cream);
  font-family: var(--title);
  font-size: clamp(16px, 2.1vw, 22px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.screen-cover-card__caption p {
  margin: 5px 0 0;
  overflow: hidden;
  color: rgba(245, 238, 226, 0.7);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@media (max-width: 700px) {
  .screen-cover-grid {
    width: min(100%, 330px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    margin-top: 18px;
  }
  .screen-cover-card__caption h2 {
    font-size: 16px;
  }
  .screen-cover-card__caption p {
    font-size: 10.5px;
  }
}

/* Interactive cover fan for top shows / top movies */
.scene--top-shows .scene__bg .topo,
.scene--top-movies .scene__bg .topo,
.scene--watch-leaderboard .scene__bg .topo {
  display: none;
}
.scene--watch-leaderboard .scene__tint {
  background: linear-gradient(
    180deg,
    rgba(3, 4, 6, 0.52) 0%,
    transparent 28% 70%,
    rgba(3, 4, 6, 0.82) 100%
  );
}
.cover-fan {
  --card-w: clamp(108px, 33.8vw, 150px);
  --spread: clamp(38px, 13.2vw, 58px);
  position: relative;
  width: 100%;
  max-width: 760px;
  height: clamp(250px, 35vh, 320px);
  margin: clamp(14px, 3vh, 28px) auto 0;
}
.cover-fan__card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--card-w);
  aspect-ratio: 2 / 3;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  transform: translate(-50%, -50%) translateX(calc(var(--x) * var(--spread))) rotate(var(--r)) scale(var(--s));
  transform-origin: 50% 85%;
  z-index: var(--z);
  filter: brightness(0.78) saturate(0.92);
  transition:
    transform 340ms cubic-bezier(0.22, 1, 0.36, 1),
    filter 240ms ease;
  will-change: transform;
}
.cover-fan__card.is-active {
  transform: translate(-50%, -58%) translateX(calc(var(--x) * var(--spread))) rotate(0deg) scale(1.08);
  z-index: 20;
  filter: none;
}
.cover-fan__poster {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(245, 238, 226, 0.2);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.48);
}
.cover-fan__poster img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.cover-fan__fallback {
  position: absolute;
  z-index: 0;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(245, 238, 226, 0.72);
  font-family: var(--title);
  font-size: clamp(38px, 9vw, 76px);
  line-height: 1;
  font-weight: 800;
}
.cover-fan__rank,
.cover-fan__rating {
  position: absolute;
  z-index: 2;
  top: 8px;
  padding: 4px 7px;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 10px;
}
.cover-fan__rank {
  left: 8px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(6, 7, 9, 0.64);
  color: var(--cream);
  backdrop-filter: blur(8px);
}
.cover-fan__rating {
  right: 8px;
  background: var(--lime);
  color: #111;
  font-weight: 700;
}
.cover-fan__detail {
  width: min(620px, 100%);
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px auto 0;
  padding: 10px 14px;
  border: 1px solid rgba(245, 238, 226, 0.13);
  border-radius: 12px;
  background: rgba(5, 6, 8, 0.44);
  text-align: left;
  backdrop-filter: blur(14px);
}
.cover-fan__detail-rank {
  flex: 0 0 auto;
  color: var(--lime);
  font-family: var(--title);
  font-size: 30px;
  line-height: 0.8;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.cover-fan__detail-copy {
  min-width: 0;
}
.cover-fan__detail h2 {
  overflow: hidden;
  margin: 0;
  color: var(--cream);
  font-family: var(--title);
  font-size: clamp(18px, 3vw, 24px);
  line-height: 1.02;
  font-weight: 700;
  letter-spacing: -0.035em;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cover-fan__detail p {
  margin: 4px 0 0;
  overflow: hidden;
  color: rgba(245, 238, 226, 0.7);
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.cover-fan__detail-overview {
  display: -webkit-box;
  max-width: 580px;
  margin-top: 6px !important;
  color: rgba(245, 238, 226, 0.58) !important;
  font-size: 12.5px !important;
  line-height: 1.45 !important;
  white-space: normal !important;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
@media (min-width: 761px) {
  .cover-fan {
    --card-w: 205px;
    --spread: 125px;
    height: 380px;
  }
  .cover-fan__detail {
    min-height: 78px;
  }
  .cover-fan__detail h2 {
    font-size: 25px;
  }
  .cover-fan__detail p {
    font-size: 13px;
  }
}
@media (max-width: 700px) {
  .cover-fan__detail {
    min-height: 66px;
    padding: 9px 11px;
  }
  .cover-fan__detail-rank {
    font-size: 26px;
  }
  .cover-fan__detail h2 {
    font-size: 17px;
  }
  .cover-fan__detail p {
    font-size: 11px;
  }
  .cover-fan__detail-overview {
    font-size: 11.5px !important;
    -webkit-line-clamp: 2;
  }
}

/* Watch-time leaderboard */
.leaderboard-page {
  width: 100%;
  max-width: 680px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  text-align: center;
}
.leaderboard-list {
  width: min(580px, 100%);
  margin: clamp(20px, 4vh, 34px) auto 0;
  overflow: hidden;
  border: 1px solid rgba(245, 238, 226, 0.15);
  border-radius: 16px;
  background: rgba(5, 6, 8, 0.44);
  text-align: left;
  backdrop-filter: blur(14px);
}
.leaderboard-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(245, 238, 226, 0.09);
}
.leaderboard-row:last-child {
  border-bottom: 0;
}
.leaderboard-row.is-you {
  background: rgba(194, 255, 115, 0.11);
}
.leaderboard-row__rank {
  color: rgba(245, 238, 226, 0.62);
  font-family: var(--title);
  font-size: 25px;
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
}
.leaderboard-row.is-you .leaderboard-row__rank {
  color: var(--lime);
}
.leaderboard-row__name {
  overflow: hidden;
  color: var(--cream);
  font-size: 16px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.leaderboard-row__name em {
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--lime);
  color: #111;
  font-family: var(--mono);
  font-size: 9px;
  font-style: normal;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  vertical-align: 2px;
}
.leaderboard-row__time {
  color: rgba(245, 238, 226, 0.82);
  font-family: var(--mono);
  font-size: 15px;
  white-space: nowrap;
}
.leaderboard-divider {
  height: 8px;
  background: rgba(3, 4, 6, 0.3);
}
@media (max-width: 700px) {
  .leaderboard-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 12px;
  }
  .leaderboard-row__rank {
    font-size: 21px;
  }
  .leaderboard-row__name {
    font-size: 14.5px;
  }
  .leaderboard-row__time {
    font-size: 13.5px;
  }
}

/* Book cover fan */
.book-fan-page .story-heading h1 {
  font-size: clamp(42px, 8vw, 64px);
}
.book-fan-page .cover-fan {
  margin-top: clamp(16px, 3.5vh, 32px);
}
.scene--books .scene__bg .topo {
  display: none;
}
.scene--books .scene__tint {
  background: linear-gradient(
    180deg,
    rgba(3, 4, 6, 0.5) 0%,
    transparent 28% 70%,
    rgba(3, 4, 6, 0.82) 100%
  );
}

.cover-fan__fallback--book {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  padding: 18px 14px;
  background:
    linear-gradient(155deg, hsl(var(--book-hue, 190) 30% 22%), #080b10 72%);
  color: var(--cream);
  text-align: left;
}
.cover-fan__fallback--book small {
  color: var(--aqua, #49d7e8);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.cover-fan__fallback--book strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--cream);
  font-family: var(--title);
  font-size: clamp(19px, 4.8vw, 30px);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.cover-fan__fallback--book em {
  overflow: hidden;
  color: rgba(245, 238, 226, 0.66);
  font-family: var(--ui);
  font-size: 11px;
  font-style: normal;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.soulmate-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
}
.soulmate-category {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid rgba(245, 238, 226, 0.16);
  border-radius: 999px;
  background: rgba(5, 6, 8, 0.28);
  color: rgba(245, 238, 226, 0.74);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.soulmate-category strong {
  color: var(--lime);
  font-family: var(--title);
  font-size: 16px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.soulmate-category--movies strong {
  color: var(--pink);
}
.soulmate-category--songs strong {
  color: var(--periwinkle);
}
.soulmate-category--books strong {
  color: var(--cyan);
}
.soulmate-list-title {
  margin: 14px 0 -6px;
  color: rgba(245, 238, 226, 0.55);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.soulmate-row--movies small {
  color: var(--pink);
}
.soulmate-row--songs small {
  color: var(--periwinkle);
}
.soulmate-row--books small {
  color: var(--cyan);
}
.soulmate-row--shows small {
  color: var(--cyan);
}
@media (max-width: 700px) {
  .soulmate-list-title {
    margin-top: 16px;
  }
}
