/* =====================================================================
   cards.css: lockup cards (artwork with nothing over it, the title and
   a meta line under it), continue-watching lockups, rows, grids and
   episode tiles (ui.js card, continueCard, row, episodeList).
   Mobile first; sizes come from tokens (--card-w, --card-gap, …).
   ===================================================================== */

/* ---------------------------------------------------------------- .card */
.card { position: relative; display: block; min-width: 0; color: var(--text); -webkit-tap-highlight-color: transparent; }
/* The hover shadow switches without a transition: box-shadow blur is never animated. */
/* Before (or without) its picture, a card is a plate of the page's own colour (ambient.js --amb-1), not grey. */
.card__media {
  position: relative; isolation: isolate; aspect-ratio: 2 / 3; border-radius: var(--radius-card); overflow: hidden;
  background: rgba(var(--amb-1), .32); transition: transform 200ms var(--ease-calm);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__media::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), inset 0 0 0 1px var(--hairline);
}
.card__title {
  margin-top: 10px; color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.3; letter-spacing: -.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.is-tv .card__title { margin-top: calc(24px * var(--tvu)); font-size: var(--fs-callout); font-weight: 500; letter-spacing: 0; }
.card__meta {
  margin-top: 2px; color: var(--text-2); font-size: 13px; font-weight: 400; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
html.is-tv .card__meta { color: var(--text-3); font-size: var(--fs-caption); font-weight: 500; }
@media (max-width: 599px) {
  .card__title { margin-top: 8px; font-size: 14px; }
  .card__meta { font-size: 12px; }
}
/* Same dots as .meta, but inline so the line can end in an ellipsis. */
.card__meta > * + *::before, .row__focus-meta > * + *::before {
  content: ""; display: inline-block; width: 3px; height: 3px; margin: 0 6px; border-radius: 50%;
  background: currentColor; opacity: .55; vertical-align: middle;
}
/* A grey star (TV focus meta only): the palette stays monochrome. */
.card__score .icon { width: 11px; height: 11px; margin-right: 3px; color: var(--text-2); vertical-align: -1px; }
@media (max-width: 599px) {
  /* Phones read "2024 · ★ 7,4"; a hidden first part must not leave a leading dot. */
  .card__extra { display: none; }
  .card__meta > .card__extra:first-child + *::before { display: none; }
}

/* Mouse hover: the art grows a little and lifts on a soft shadow; nothing pops up. */
@media (hover: hover) and (pointer: fine) {
  html:not(.is-tv) .card:hover .card__media { transform: scale(1.04); box-shadow: 0 14px 30px -6px rgba(0, 0, 0, .7); }
}
/* Keyboard: a 2px gap in the page colour, then a 2px light ring. The transparent outline is what
   forced-colors (Windows High Contrast) draws, as it drops box-shadows. */
.card:focus-visible { outline: none; box-shadow: none; }
.card:focus-visible .card__media { outline: 2px solid transparent; outline-offset: 2px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus); }
.card:active .card__media { transform: scale(.98); transition-duration: var(--dur-1); }
/* TV keeps its lift and thick ring. */
html.is-tv .card__media { transition: transform var(--dur-3) var(--ease-calm); }
html.is-tv .card:focus-visible .card__media {
  transform: scale(1.05);
  outline: 4px solid var(--focus); outline-offset: 4px; box-shadow: 0 0 0 4px var(--focus-halo), var(--shadow-2);
}
@media (prefers-reduced-motion: reduce) {
  html .card:hover .card__media, html .card:active .card__media, html.is-tv .card:focus-visible .card__media { transform: none; }
}

/* The title being viewed, in its saga row and on #/saga (ui.js markCurrentCard). Softer than the focus ring. */
.card.is-current .card__media::after { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.card.is-current .card__title { color: #fff; }
.card__tag {
  position: absolute; left: 8px; bottom: 8px; z-index: 2; max-width: calc(100% - 16px); padding: 3px 8px; border-radius: 999px;
  background: rgba(0, 0, 0, .82); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
html.is-tv .card__tag { left: calc(10px * var(--tvu)); bottom: calc(10px * var(--tvu)); padding: calc(4px * var(--tvu)) calc(10px * var(--tvu)); font-size: var(--fs-caption); }
@media (max-width: 599px) { .card__tag { left: 6px; bottom: 6px; padding: 2px 6px; font-size: 11px; } }

/* A series with episodes the account has not seen (ui.js markNewEpisode, home only): a small dark tag
   on the art ("Nuevo: E9"), its own backing so it reads over any picture. */
.card__new {
  position: absolute; left: 8px; top: 8px; z-index: 2; display: flex; align-items: center; max-width: calc(100% - 16px);
  height: 22px; padding: 0 8px; border-radius: 6px; background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: var(--text); font-size: 11px; font-weight: 700; letter-spacing: .02em; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
html.is-tv .card__new {
  left: calc(12px * var(--tvu)); top: calc(12px * var(--tvu)); height: calc(30px * var(--tvu)); padding: 0 calc(10px * var(--tvu));
  border-radius: calc(8px * var(--tvu)); font-size: calc(16px * var(--tvu)); -webkit-backdrop-filter: none; backdrop-filter: none;
}
@media (max-width: 599px) { .card__new { left: 6px; top: 6px; max-width: calc(100% - 12px); height: 20px; padding: 0 6px; font-size: 10px; } }
/* "Nuevos episodios" says it in the line under the art (home.js newCard): no tag on the picture there. */
.row[data-personal="new"] .card__new { display: none; }
/* Its card in "Nuevos episodios" while the episode is looked up (home.js playNew): dimmed. */
.card.is-busy:not(.card--continue) .card__media { opacity: .6; transition: opacity .2s; }

/* Typographic title card: missing or broken artwork. */
.card__fallback {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px; text-align: center;
  background: radial-gradient(120% 90% at 100% 0%, rgba(var(--amb-1), .55) 0, rgba(var(--amb-1), 0) 70%), linear-gradient(160deg, rgba(255, 255, 255, .1), rgba(255, 255, 255, .03));
}
.card__fallback .brand__mark { width: 28px; height: 28px; margin-bottom: 12px; opacity: .32; }
.card__fallback-title { color: var(--text); font-size: 15px; font-weight: 600; line-height: 1.3; }
/* 16:9 lockups carry the title under the art: the mark alone. */
.card--wide .card__fallback .brand__mark { width: 28px; height: 28px; margin: 0; }
.card--wide .card__fallback-title { display: none; }

/* --------------------------------------------------- remove (withRemove) */
/* A small round X on the art's top right corner: on hover or focus with a mouse, always on touch and TV. */
.card-wrap { position: relative; min-width: 0; }
.card__remove {
  position: absolute; top: 2px; right: 2px; z-index: var(--z-raised);
  display: grid; place-items: center; width: 44px; height: 44px; color: #fff;
}
.card__remove > span {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(30, 30, 32, .8); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
html.is-tv .card__remove > span { -webkit-backdrop-filter: none; backdrop-filter: none; }
.card__remove .icon { width: 12px; height: 12px; stroke-width: 2.6; }
.card__remove:focus-visible { outline: none; box-shadow: none; }
.card__remove:focus-visible > span { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus); outline: 2px solid transparent; }
@media (hover: hover) and (pointer: fine) {
  .card__remove { opacity: 0; transition: opacity var(--dur-2); }
  .card-wrap:hover .card__remove, .card-wrap:focus-within .card__remove { opacity: 1; }
  .card__remove:hover > span { background: rgba(58, 58, 60, .92); }
  /* The X rides on the art, which grows on hover. */
  html:not(.is-tv) .card-wrap:hover .card__remove { transform: translate(4px, -4px); }
}

/* --------------------------------------- 16:9 lockups (.card--wide) */
.card--wide .card__media { aspect-ratio: 16 / 9; }
/* No backdrop: the poster centred, over a blurred, dimmed copy of itself that fills the 16:9 frame (ui.js
   wideMedia); TV draws no blur filters, the page's colour fills it there. */
.card__media.is-poster { display: flex; justify-content: center; background: rgba(var(--amb-1), .4); }
.card__media.is-poster > img:not(.card__fill) { position: relative; width: auto; height: 100%; aspect-ratio: 2 / 3; box-shadow: 0 0 24px rgba(0, 0, 0, .45); }
.card__fill { position: absolute; inset: -12%; width: 124%; height: 124%; max-width: none; object-fit: cover; filter: blur(18px) brightness(.6) saturate(1.2); }
html.is-tv .card__fill { display: none; }
/* TMDB's textless backdrop (ui.js placeCardLogo): in place of the provider's backdrop, or over it when that one had
   already loaded; it shows with the logo once both have loaded. */
.card__media > img.card__scene { position: absolute; inset: 0; opacity: 0; transition: opacity var(--dur-3) var(--ease-std); }
.card__media > img.card__scene.is-ready { opacity: 1; }
html.is-tv .card__media > img.card__scene { transition: none; }
@media (prefers-reduced-motion: reduce) { .card__media > img.card__scene { transition: none; } }
/* The TMDB scene (no lettering) carries the title's TMDB logo at its bottom left (ui.js placeCardLogo):
   its width is set inline so it stays under 58% of the card's width and 32% of its height. A faint shade from that
   corner and a soft drop shadow keep it legible; both fade in once the logo has loaded. TV: the shade only. */
.card__media > img.card__logo {
  position: absolute; z-index: 1; left: 6%; bottom: 9%; height: auto; max-height: 32%; object-fit: contain; object-position: left bottom;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, .55)) drop-shadow(0 0 12px rgba(0, 0, 0, .3));
  opacity: 0; transition: opacity var(--dur-3) var(--ease-std); pointer-events: none; user-select: none;
}
.card__logo-shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity var(--dur-3) var(--ease-std);
  background: radial-gradient(70% 62% at 0% 100%, rgba(0, 0, 0, .5) 0, rgba(0, 0, 0, .22) 50%, rgba(0, 0, 0, 0) 100%);
}
.card__media > img.card__logo.is-ready, .card__logo-shade.is-ready { opacity: 1; }
html.is-tv .card__media > img.card__logo { filter: none; transition: none; }
html.is-tv .card__logo-shade { transition: none; background: radial-gradient(76% 70% at 0% 100%, rgba(0, 0, 0, .62) 0, rgba(0, 0, 0, .28) 50%, rgba(0, 0, 0, 0) 100%); }
/* Continuar viendo: clear of the bar inside the art's foot. */
.card--continue .card__media > img.card__logo { bottom: calc(9% + 10px); }
@media (prefers-reduced-motion: reduce) { .card__media > img.card__logo, .card__logo-shade { transition: none; } }
/* Continuar viendo: the bar inside the bottom of the art, over a faint shade so it reads on light pictures. */
.card--continue .card__media::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32%; z-index: 1; pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, .5), rgba(0, 0, 0, 0));
}
.card__progress {
  position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; height: 4px; overflow: hidden;
  border-radius: 2px; background: rgba(255, 255, 255, .3);
}
@media (max-width: 599px) { .card__progress { left: 8px; right: 8px; bottom: 8px; } }
html.is-tv .card__progress { left: calc(14px * var(--tvu)); right: calc(14px * var(--tvu)); bottom: calc(12px * var(--tvu)); height: calc(5px * var(--tvu)); }
.card__progress > span { display: block; height: 100%; border-radius: inherit; background: #fff; transform-origin: left; }
/* A white disc with the play glyph, centred: on hover, on keyboard focus and while the title loads. */
.card__play {
  position: absolute; top: 50%; left: 50%; z-index: 1; display: grid; place-items: center;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  background: rgba(245, 245, 247, .92); color: #000; opacity: 0; transition: opacity var(--dur-2);
}
.card__play .icon { width: 18px; height: 18px; margin-left: 2px; }
.card__play .spinner { display: none; border-color: rgba(0, 0, 0, .2); border-top-color: #000; }
@media (hover: hover) and (pointer: fine) { .card--continue:hover .card__play { opacity: 1; } }
.card--continue:focus-visible .card__play, .card.is-busy .card__play { opacity: 1; }
html.is-tv .card__play { width: calc(64px * var(--tvu)); height: calc(64px * var(--tvu)); margin: calc(-32px * var(--tvu)) 0 0 calc(-32px * var(--tvu)); }
html.is-tv .card__play .icon { width: calc(24px * var(--tvu)); height: calc(24px * var(--tvu)); }
.card.is-busy { pointer-events: none; }
.card.is-busy .card__play .icon { display: none; }
.card.is-busy .card__play .spinner { display: block; }

/* -------------------------------------------------- ranked (.card--ranked) */
/* TOP 15 shelves (Top 15 películas, Top 15 series): a big outlined numeral beside each poster, tucked under its
   left edge and standing on the poster's bottom line (Apple TV / Netflix top 10). The outline is a light line
   and the inside the page's own dark tone (ambient.js --amb-2), so the numeral reads crisp on any tint. */
.row--ranked .row__track { grid-auto-columns: max-content; }
.card--ranked { --rank-w: calc(var(--card-w) * .6); width: calc(var(--rank-w) + var(--card-w)); }
.card--ranked.is-2d { --rank-w: calc(var(--card-w) * 1.05); }
/* The narrow "1" stands clear of its poster (tucked under it, it all but vanished, worst under the TV focus scale). */
.card--ranked.is-1 { --rank-w: calc(var(--card-w) * .45); }
.card__ranked { display: grid; grid-template-columns: var(--rank-w) var(--card-w); align-items: end; }
.card__rank {
  position: relative; z-index: 0; justify-self: end; margin-right: calc(var(--card-w) * -.06); margin-bottom: -.035em;
  font: 800 clamp(84px, calc(var(--card-w) * .98), 168px)/.8 var(--font); letter-spacing: -.07em; font-variant-numeric: lining-nums;
  color: rgba(var(--amb-2), .72); -webkit-text-stroke: 2px rgba(255, 255, 255, .58); user-select: none;
  text-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
html.is-tv .card__rank { font-size: calc(var(--card-w) * .9); -webkit-text-stroke: calc(3px * var(--tvu)) rgba(255, 255, 255, .55); text-shadow: none; }
.card--ranked.is-1 .card__rank { margin-right: calc(var(--card-w) * .05); }
html.is-tv .card--ranked.is-1 .card__rank { margin-right: calc(var(--card-w) * .08); }
@supports not (-webkit-text-stroke: 1px) { .card__rank { color: rgba(255, 255, 255, .22); } }
/* The focused or hovered title's numeral lights up. */
.card--ranked:focus-visible .card__rank { -webkit-text-stroke-color: #fff; }
@media (hover: hover) and (pointer: fine) { .card--ranked:hover .card__rank { -webkit-text-stroke-color: rgba(255, 255, 255, .85); } }
.card--ranked .card__media { z-index: 1; }
.card--ranked .card__title, .card--ranked .card__meta { margin-left: var(--rank-w); }

/* ------------------------------------------- Destacados (.card--featured) */
/* The home's first shelf: 16:9 lockups, the title at 17px and "2026 · Película" under it.
   Same size as the other 16:9 rows (the owner's choice); the shelf stands out by its place and titles. */
.row--featured { --card-featured-w: var(--card-wide-w); }
.row.row--featured .row__track { grid-auto-columns: var(--card-featured-w); }
.row--featured {
  contain-intrinsic-size: 1px calc(var(--card-featured-w) * .5625 + 130px);
  contain-intrinsic-size: auto calc(var(--card-featured-w) * .5625 + 130px);
}
.card--featured .card__media { border-radius: var(--radius-tile); }
.card--featured .card__title { margin-top: 12px; font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.card--featured .card__meta { margin-top: 3px; font-size: 14px; }
@media (max-width: 599px) {
  .card--featured .card__title { margin-top: 10px; font-size: 16px; }
  .card--featured .card__meta { font-size: 13px; }
}
html.is-tv .card--featured .card__title { font-size: var(--fs-headline); font-weight: 600; }
html.is-tv .card--featured .card__meta { font-size: var(--fs-callout); }
/* A big picture grows less on hover. */
@media (hover: hover) and (pointer: fine) {
  html:not(.is-tv) .card--featured:hover .card__media { transform: scale(1.025); }
}
html.is-tv .card--featured:focus-visible .card__media { transform: scale(1.035); }
@media (prefers-reduced-motion: reduce) {
  html:not(.is-tv) .card--featured:hover .card__media, html.is-tv .card--featured:focus-visible .card__media { transform: none; }
}

/* ------------------------------------------------- platforms (brand tiles) */
/* ui.js platformTile: a 16:9 tile in the platform's colour (--p-face to --p-deep, ui.js brandStyle) with a glass
   highlight on top, a title of that platform faint behind it (its brightness only, tinted by the colour), and
   the name in bold white type. Text only: no logo artwork. Hover and focus lift it, with a white ring. */
.row--platforms { --ptile-w: calc(var(--card-wide-w) * .74); }
@media (max-width: 599px) { .row--platforms { --ptile-w: calc(var(--vw, 100vw) * .44); } }
html.is-tv .row--platforms { --ptile-w: calc(300px * var(--tvu)); }
.row--platforms .row__track { grid-auto-columns: var(--ptile-w); }
.row--platforms {
  contain-intrinsic-size: 1px calc(var(--ptile-w) * .5625 + 90px);
  contain-intrinsic-size: auto calc(var(--ptile-w) * .5625 + 90px);
}
/* One short row with nothing under the tiles: drawn always, so the lifted tile and its focus ring are not cut at
   the row's bottom edge (content-visibility: auto clips painting to the row's box). */
.row.row--platforms { content-visibility: visible; }
.ptile { position: relative; display: block; min-width: 0; color: #fff; -webkit-tap-highlight-color: transparent; }
.ptile__media {
  position: relative; isolation: isolate; display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; padding: 0 8%; border-radius: var(--radius-tile); overflow: hidden;
  background:
    radial-gradient(110% 80% at 15% 0%, rgba(255, 255, 255, .14) 0, rgba(255, 255, 255, 0) 60%),
    linear-gradient(155deg, rgb(var(--p-face)) 0%, rgb(var(--p-face)) 30%, rgb(var(--p-deep)) 100%);
  box-shadow: 0 12px 26px -12px rgba(0, 0, 0, .7);
  transition: transform 240ms var(--ease-calm);
}
/* Engines without aspect-ratio (old TV browsers): the 16:9 box from padding. */
@supports not (aspect-ratio: 16 / 9) {
  .ptile__media { height: 0; padding: 56.25% 0 0; }
  .ptile__name { position: absolute; top: 50%; left: 8%; right: 8%; transform: translateY(-50%); }
}
/* The glass: a soft light band across the top and a hairline edge. */
.ptile__media::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(46% 42% at 50% 50%, rgba(0, 0, 0, .16) 0, rgba(0, 0, 0, 0) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, .2) 0, rgba(255, 255, 255, .06) 34%, rgba(255, 255, 255, 0) 50%, rgba(0, 0, 0, .14) 100%);
}
.ptile__media::after {
  content: ""; position: absolute; inset: 0; z-index: 2; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 0 0 1px rgba(255, 255, 255, .1);
}
.ptile__art {
  position: absolute; inset: 0; z-index: 0; width: 100%; height: 100%; max-width: none; object-fit: cover;
  opacity: var(--p-art-opacity, .3); mix-blend-mode: luminosity;
  /* Gone behind the name and only at the edges, so lettering printed on the picture never runs into it. */
  -webkit-mask-image: radial-gradient(74% 82% at 50% 50%, transparent 0, transparent 46%, #000 100%);
  mask-image: radial-gradient(74% 82% at 50% 50%, transparent 0, transparent 46%, #000 100%);
}
.ptile__name {
  position: relative; z-index: 3; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 800 calc(var(--ptile-w, 220px) * .125)/1.1 var(--font); letter-spacing: -.035em; text-align: center;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .3);
}
.ptile--long .ptile__name { font-size: calc(var(--ptile-w, 220px) * .105); }
@media (hover: hover) and (pointer: fine) {
  html:not(.is-tv) .ptile:hover .ptile__media {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(255, 255, 255, .85), 0 20px 36px -12px rgba(0, 0, 0, .75);
  }
}
.ptile:focus-visible { outline: none; box-shadow: none; }
.ptile:focus-visible .ptile__media {
  transform: translateY(-4px) scale(1.03); outline: 2px solid transparent; outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px #fff, 0 20px 36px -12px rgba(0, 0, 0, .75);
}
.ptile:active .ptile__media { transform: scale(.98); transition-duration: var(--dur-1); }
/* TV: no blend over the picture (a cheap faint copy instead), the TV lift and its thick ring. */
html.is-tv .ptile__art { mix-blend-mode: normal; opacity: calc(var(--p-art-opacity, .3) * .53); }
html.is-tv .ptile__media { box-shadow: none; transition: transform var(--dur-3) var(--ease-calm); }
html.is-tv .ptile:focus-visible .ptile__media {
  transform: scale(1.06); outline: 4px solid var(--focus); outline-offset: 4px; box-shadow: 0 0 0 4px var(--focus-halo), var(--shadow-2);
}
@media (prefers-reduced-motion: reduce) {
  html .ptile:hover .ptile__media, html .ptile:focus-visible .ptile__media, html .ptile:active .ptile__media { transform: none; }
}
/* Explorar (search page): a wrapping grid of smaller tiles with a fixed type size. */
.ptiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; max-width: 1180px; }
@media (max-width: 599px) { .ptiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
html.is-tv .ptiles { grid-template-columns: repeat(auto-fill, minmax(calc(260px * var(--tvu)), 1fr)); gap: calc(24px * var(--tvu)); max-width: none; }
.ptile--compact .ptile__media { border-radius: var(--radius-card); }
.ptile--compact .ptile__name { font-size: 21px; }
.ptile--compact.ptile--long .ptile__name { font-size: 18px; }
@media (max-width: 599px) { .ptile--compact .ptile__name { font-size: 19px; } .ptile--compact.ptile--long .ptile__name { font-size: 16px; } }
html.is-tv .ptile--compact .ptile__name { font-size: calc(30px * var(--tvu)); }
html.is-tv .ptile--compact.ptile--long .ptile__name { font-size: calc(25px * var(--tvu)); }

/* A platform's row: a dot in its colour before the name ("● Netflix ›"). */
.row__dot {
  display: inline-block; flex: none; width: 10px; height: 10px; margin-right: 10px; border-radius: 50%; vertical-align: .12em;
  background: rgb(var(--p-accent)); box-shadow: 0 0 0 3px rgba(var(--p-accent), .18), 0 0 14px rgba(var(--p-accent), .55);
}
html.is-tv .row__dot { width: calc(14px * var(--tvu)); height: calc(14px * var(--tvu)); margin-right: calc(14px * var(--tvu)); }

/* ------------------------------------------------ "Ver todo" end tile */
/* Only for D-pad and TV, where the row title link is out of the arrow-key path. */
.card--more { display: none; }
body.is-dpad .card--more, html.is-tv .card--more { display: block; }
.card--more .card__media {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  color: var(--text); font-size: 16px; font-weight: 600;
}
.card--more .card__media .icon { width: 24px; height: 24px; }
.row--wide .card--more .card__media { aspect-ratio: 16 / 9; }
.row--featured .card--more .card__media { border-radius: var(--radius-tile); }
.row--ranked .card--more { width: var(--card-w); align-self: start; }

/* ----------------------------------------------------------------- rows */
.rows { position: relative; z-index: var(--z-raised); display: flex; flex-direction: column; gap: var(--rows-gap); }
.rows--top { padding-top: calc(var(--header-h) + 32px); }
/* Off-screen rows skip layout and paint until they scroll near (first line: engines without "auto"). */
.row {
  content-visibility: auto;
  contain-intrinsic-size: 1px calc(var(--card-w) * 1.5 + 120px);
  contain-intrinsic-size: auto calc(var(--card-w) * 1.5 + 120px);
}
.row--wide {
  contain-intrinsic-size: 1px calc(var(--card-wide-w) * .5625 + 120px);
  contain-intrinsic-size: auto calc(var(--card-wide-w) * .5625 + 120px);
}
.row__head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 0 var(--gutter); margin-bottom: 4px; }
html.is-tv .row__head { margin-bottom: calc(32px * var(--tvu)); }
/* 20–22px, bold and tight. A row with a "Ver todo" page links its whole title, with a chevron after it. */
.row__title { min-width: 0; font-size: clamp(19px, 1.55vw, 22px); font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
html.is-tv .row__title { font-size: var(--fs-title-2); font-weight: 600; line-height: var(--lh-title-2); }
.row__title-link {
  display: inline-flex; align-items: center; gap: 2px; max-width: 100%; min-height: 32px; border-radius: 6px; color: inherit;
}
.row__title-link .icon { flex: none; width: 20px; height: 20px; color: var(--text-2); stroke-width: 2.6; transition: transform var(--dur-2) var(--ease-calm), color var(--dur-2); }
@media (hover: hover) and (pointer: fine) {
  .row__title-link:hover .icon { color: var(--text); transform: translateX(3px); }
}
.row__title-link:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; box-shadow: 0 0 0 4px var(--focus-halo); }
.row__title-link:focus-visible .icon { color: var(--text); }
/* Title and a one-line note under it ("Lo más visto en mipalco"). */
.row__heading { min-width: 0; }
.row__sub { margin-top: 0; color: var(--text-2); font-size: 14px; line-height: 1.35; }
html.is-tv .row__sub { margin-top: calc(4px * var(--tvu)); font-size: var(--fs-caption); }
.row__focus-meta { display: none; }
html.is-tv .row__focus-meta { display: block; margin-right: auto; color: var(--text-2); font-size: var(--fs-caption); white-space: nowrap; }
/* "Porque viste <título>": at the far end, or it reads as the year and score of that title. */
html.is-tv .row[data-personal^="because:"] .row__focus-meta { margin-right: 0; }

.row__viewport { position: relative; }
/* The padding leaves room for the hover growth, the lift and the focus ring; the negative margin gives the space back.
   On desktops the track also runs under the floating sidebar to the window's left edge (--shell-x, tokens.css),
   while its first card stays on the content's gutter, level with the hero's copy. With the panel shown, cards
   scrolled past that gutter fade out under the glass (a soft peek through it) instead of showing sharp in the
   12px gap at the window's edge or beside the rail. */
.row__track {
  display: grid; grid-auto-flow: column; grid-auto-columns: var(--card-w); gap: var(--card-gap);
  overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
  padding: var(--track-pad-top) var(--gutter) var(--track-pad-bottom) calc(var(--gutter) + var(--shell-x));
  margin: calc(-1 * var(--track-pad-top)) 0 calc(-1 * var(--track-pad-bottom)) calc(-1 * var(--shell-x));
  scroll-padding: 0 var(--gutter) 0 calc(var(--gutter) + var(--shell-x));
}
.row__track::-webkit-scrollbar { display: none; }
@media (min-width: 1024px) {
  html.has-shell:not(.is-nav-hidden):not(.is-tv) .row__track {
    -webkit-mask-image: linear-gradient(90deg, transparent 0, transparent calc(var(--shell-x) * .6), #000 calc(var(--content-x) - 12px));
    mask-image: linear-gradient(90deg, transparent 0, transparent calc(var(--shell-x) * .6), #000 calc(var(--content-x) - 12px));
  }
}
.row__track > * { scroll-margin-block: 96px; }
/* "Continuar viendo" wraps each card (.card-wrap): what takes the focus is inside it. */
.row__track .card-wrap > * { scroll-margin-block: 96px; }
.row--wide .row__track { grid-auto-columns: var(--card-wide-w); }
/* Snap only for touch; wheels and trackpads scroll freely. */
@media (pointer: coarse) {
  .row__track { scroll-snap-type: x mandatory; }
  .row__track > * { scroll-snap-align: start; }
}

/* Paddles: 40px round dark buttons with a white chevron, centred on the artwork at the row's edges, for
   mouse users only (out of the tab order: the keyboard scrolls a row by moving along its cards). Shown
   while the row is hovered, hidden at the scroll ends. */
.row__arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .row__arrow {
    position: absolute; z-index: var(--z-row-arrow); top: calc(var(--track-pad-top) + var(--card-w) * .75 - 20px);
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
    background: rgba(30, 30, 32, .8); color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .45), inset 0 0 0 1px rgba(255, 255, 255, .1);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    opacity: 0; transition: opacity 200ms var(--ease-std), background-color var(--dur-2);
  }
  .row--wide .row__arrow { top: calc(var(--track-pad-top) + var(--card-wide-w) * .28125 - 20px); }
  .row--featured .row__arrow { top: calc(var(--track-pad-top) + var(--card-featured-w) * .28125 - 20px); }
  .row--platforms .row__arrow { top: calc(var(--track-pad-top) + var(--ptile-w) * .28125 - 20px); }
  .row__arrow--prev { left: max(6px, calc(var(--gutter) / 2 - 20px)); }
  .row__arrow--next { right: max(6px, calc(var(--gutter) / 2 - 20px)); }
  .row__arrow .icon { width: 20px; height: 20px; stroke-width: 2.6; }
  .row__arrow--prev .icon { margin-left: -2px; }
  .row__arrow--next .icon { margin-right: -2px; }
  .row__arrow:hover { background: rgba(58, 58, 60, .92); }
  .row__viewport:hover .row__arrow:not(:disabled) { opacity: 1; }
  .row__arrow:disabled { visibility: hidden; }
}
html.is-tv .row__arrow { display: none; }

/* Home and title page rows (not TV): widths that always leave part of the next card in view, counted from
   the left gutter to the window's edge — 6.5 posters and 3.4 16:9 lockups from 1180px, 5.25 and 2.6 from
   761px; phones keep the token sizes. --vw (main.js) is the content width beside the sidebar, without a
   classic scrollbar (100vw includes it). */
@media (min-width: 1180px) {
  html:not(.is-tv) .page--home, html:not(.is-tv) .page--title {
    --card-w: calc((var(--vw, 100vw) - var(--gutter) - 6 * var(--card-gap)) / 6.5);
    --card-wide-w: calc((var(--vw, 100vw) - var(--gutter) - 3 * var(--card-gap)) / 3.4);
  }
}
@media (min-width: 761px) and (max-width: 1179px) {
  html:not(.is-tv) .page--home, html:not(.is-tv) .page--title {
    --card-w: calc((var(--vw, 100vw) - var(--gutter) - 5 * var(--card-gap)) / 5.25);
    --card-wide-w: calc((var(--vw, 100vw) - var(--gutter) - 2 * var(--card-gap)) / 2.6);
  }
}
/* 44px between the home rows (a meta line to the next title). */
@media (min-width: 861px) { html:not(.is-tv) .page--home { --rows-gap: 44px; } }

/* ----------------------------------------------------------------- grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr)); gap: 32px var(--card-gap); }
/* Columns still share the spare width (1fr), but a poster stops at 232px (the 262w source is never
   upscaled); wide screens get a slightly larger gap instead. TV's own --card-w may be larger. */
.grid > :not(.empty) { max-width: max(var(--card-w), 232px); }
/* D-pad moves keep the focused card clear of the fixed header and tab bar. */
.grid > * { scroll-margin: calc(var(--header-h) + 16px) 0 calc(var(--tabbar-total) + 16px); }
@media (min-width: 1120px) { .grid { gap: 40px var(--card-gap); } }
@media (max-width: 599px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px 10px; } }
html.is-tv .grid { gap: calc(56px * var(--tvu)) var(--card-gap); }

/* ------------------------------------------------------- episode tiles */
.ranges { margin-bottom: 16px; }
.ranges .segmented { max-width: 100%; }

.ep-grid, .ep-list { list-style: none; padding: 0; margin: 0; max-width: var(--content-max); }

.ep { position: relative; width: 100%; text-align: left; color: var(--text); transition: background-color var(--dur-2); }
.ep:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; background: var(--surface-2); }
@media (hover: hover) and (pointer: fine) { .ep:hover { background: var(--surface-2); } }
.ep__meta { color: var(--text-2); font-size: 13px; font-weight: 500; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep__bar { position: absolute; left: 12px; right: 12px; bottom: 8px; height: 3px; border-radius: 2px; background: var(--progress-track); overflow: hidden; }
.ep__bar > span { display: block; height: 100%; background: var(--progress); transform-origin: left; }

/* Numbered grid: seasons whose episodes have no names (title page). Radius 12 tiles on #1c1c1e: the
   number over "Visto", what is left or the length; the resume tile is lighter, with a ring and its bar. */
.ep-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
@media (max-width: 599px) { .ep-grid { grid-template-columns: repeat(auto-fill, minmax(68px, 1fr)); gap: 8px; } }
html.is-tv .ep-grid { grid-template-columns: repeat(auto-fill, calc(136px * var(--tvu))); gap: calc(16px * var(--tvu)); }
.ep--num {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 68px; padding: 0 3px;
  border-radius: 12px; background: #1c1c1e; text-align: center;
  content-visibility: auto; contain-intrinsic-size: auto 68px;
}
@media (max-width: 599px) { .ep--num { height: 60px; contain-intrinsic-size: auto 60px; } }
html.is-tv .ep--num { height: calc(88px * var(--tvu)); contain-intrinsic-size: auto calc(88px * var(--tvu)); }
.ep__n { font-size: 22px; font-weight: 700; line-height: 1; letter-spacing: -.02em; }
html.is-tv .ep__n { font-size: calc(32px * var(--tvu)); }
.ep--num .ep__meta { max-width: 100%; color: var(--text-3); font-size: 12px; font-weight: 500; }
@media (max-width: 599px) { .ep--num .ep__meta { font-size: 11px; } }
html.is-tv .ep--num .ep__meta { font-size: var(--fs-overline); }
/* Phones: "23 min" on the resume tile; its bar and ring already say it is under way. */
@media (max-width: 599px) { html:not(.is-tv) .ep__left-word { display: none; } }
.ep--num.is-watched .ep__n { color: var(--text-3); }
.ep--num .ep__bar { left: 10px; right: 10px; bottom: 7px; height: 3px; background: rgba(255, 255, 255, .3); }
.ep--num .ep__bar > span { background: #fff; }
.ep--num.is-resume { background: #2c2c2e; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--text); }
.ep--num.is-resume .ep__meta { color: var(--text-light); }
.ep--num.is-resume:focus-visible { outline-offset: 6px; }
@media (hover: hover) and (pointer: fine) { .ep--num:hover { background: #2c2c2e; } }
.ep--num:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; background: #2c2c2e; box-shadow: 0 0 0 2px var(--focus-halo); }
html.is-tv .ep--num:focus-visible { outline-width: 4px; outline-offset: 4px; background: var(--inverse); color: var(--on-inverse); box-shadow: 0 0 0 4px var(--focus-halo); }
html.is-tv .ep--num:focus-visible .ep__meta, html.is-tv .ep--num:focus-visible .ep__n { color: var(--on-inverse); }

/* Titled list (the player, ui.js compact). */
.ep-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.ep--row { display: grid; grid-template-columns: 64px 1fr; gap: 16px; align-items: center; min-height: 88px; padding: 12px; border-radius: var(--radius-tile); }
.ep--row.is-resume { box-shadow: inset 0 0 0 1px var(--line-strong); }
.ep__tile {
  position: relative; display: flex; align-items: center; justify-content: center; width: 64px; height: 64px;
  border-radius: var(--radius); background: var(--surface-2); font-size: 24px; font-weight: 700; overflow: hidden;
}
.ep__tile .icon { width: 20px; height: 20px; }
.ep.is-watched .ep__tile { background: var(--surface-1); color: var(--text-2); }
.ep.is-watched .ep__tile .icon { width: 22px; height: 22px; }
.ep__tile .ep__bar { left: 8px; right: 8px; bottom: 8px; }
.ep__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ep__over { color: var(--text-2); }
.ep__title { font-size: 16px; font-weight: 600; line-height: 1.3; }
@media (max-width: 599px) {
  .ep--row { grid-template-columns: 56px 1fr; min-height: 76px; }
  .ep__tile { width: 56px; height: 56px; }
  .ep__title { font-size: 15px; }
}

/* Episode lockups (title page, ui.js episodeList track): a .row of 16:9 art with the home paddles, about
   3.4 per view; under the art the name, "E5 · 52 min" and up to 2 lines of synopsis (tvOS). A vertical list
   with 140px thumbnails on phones (≤760). detail.css tints the plates and text for the page's colours. */
.row--episodes { content-visibility: visible; }
.ep-track { list-style: none; }
.ep.ep--card { display: flex; flex-direction: column; padding: 0; border-radius: 0; background: none; box-shadow: none; }
.ep__art {
  position: relative; display: block; flex: none; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden;
  background: var(--surface-2); transition: transform 200ms var(--ease-calm);
}
.ep__art::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--hairline); pointer-events: none; }
.ep__art img { width: 100%; height: 100%; object-fit: cover; }
/* No still of its own (or a broken one): a calm dark plate with the big episode number at its bottom left,
   so the shelf reads as a list instead of copies of one picture. */
.ep__plate { position: absolute; inset: 0; background: linear-gradient(150deg, #2c2c2e 0, #1c1c1e 70%); }
.ep__numeral {
  position: absolute; left: 16px; bottom: 18px; color: #f5f5f7;
  font-size: clamp(40px, 3.6vw, 60px); font-weight: 700; line-height: .9; letter-spacing: -.04em;
}
.ep--card.is-watched .ep__numeral { color: var(--text-3); }
/* Progress inside the bottom of the art: 4px, white on 30% white. */
.ep__art .ep__bar { left: 10px; right: 10px; bottom: 10px; z-index: 1; height: 4px; background: rgba(255, 255, 255, .3); }
.ep__art .ep__bar > span { border-radius: inherit; background: #fff; }
/* A white play disc, centred: on mouse hover and keyboard focus. */
.ep__play {
  position: absolute; left: 50%; top: 50%; z-index: 1; display: grid; place-items: center;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(245, 245, 247, .92); color: #000;
  opacity: 0; transition: opacity var(--dur-2);
}
.ep__play .icon { width: 18px; height: 18px; margin-left: 2px; }
/* "Te quedaste aquí": a small dark tag on the art's top left. */
.ep__here {
  position: absolute; left: 10px; top: 10px; z-index: 2; display: flex; align-items: center; height: 22px; padding: 0 8px;
  border-radius: 6px; background: rgba(0, 0, 0, .78); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  color: #fff; font-size: 12px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.ep--card .ep__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; margin-top: 12px; }
.ep--card .ep__over { color: var(--text-3); font-size: 12px; font-weight: 600; letter-spacing: .06em; line-height: 1.3; text-transform: uppercase; }
.ep--card .ep__title { font-size: 15px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ep--card.is-watched .ep__title { color: var(--text-light); }
.ep__desc { margin-top: 6px; color: var(--text-2); font-size: 13px; line-height: 1.4; }
.ep--card .ep__meta { margin-top: 2px; color: var(--text-3); font-size: 13px; font-weight: 400; }
.ep__seen .icon { width: 13px; height: 13px; margin-right: 3px; stroke-width: 2.6; vertical-align: -2px; }
/* Mouse: the art grows a little on a soft shadow, the disc shows. Keyboard: a 2px gap, then a 2px light ring. */
@media (hover: hover) and (pointer: fine) {
  .ep.ep--card:hover { background: none; }
  html:not(.is-tv) .ep--card:hover .ep__art { transform: scale(1.04); box-shadow: 0 14px 30px -6px rgba(0, 0, 0, .7); }
  .ep--card:hover .ep__play { opacity: 1; }
}
.ep.ep--card:focus-visible { outline: none; background: none; }
.ep--card:focus-visible .ep__art { outline: 2px solid transparent; outline-offset: 2px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--focus); }
.ep--card:focus-visible .ep__play { opacity: 1; }
.ep--card:active .ep__art { transform: scale(.98); transition-duration: var(--dur-1); }
html.is-tv .ep--card .ep__art { transition: transform var(--dur-3) var(--ease-calm); }
html.is-tv .ep--card:focus-visible .ep__art {
  transform: scale(1.05);
  outline: 4px solid var(--focus); outline-offset: 4px; box-shadow: 0 0 0 4px var(--focus-halo), var(--shadow-2);
}
@media (prefers-reduced-motion: reduce) {
  html .ep--card:hover .ep__art, html .ep--card:active .ep__art, html.is-tv .ep--card:focus-visible .ep__art { transform: none; }
}
html.is-tv .ep--card .ep__text { margin-top: calc(16px * var(--tvu)); }
html.is-tv .ep--card .ep__over { font-size: var(--fs-overline); }
html.is-tv .ep--card .ep__title { font-size: var(--fs-headline); }
html.is-tv .ep__desc { font-size: var(--fs-callout); }
html.is-tv .ep--card .ep__meta { font-size: var(--fs-caption); }
html.is-tv .ep__numeral { left: calc(18px * var(--tvu)); bottom: calc(26px * var(--tvu)); font-size: calc(64px * var(--tvu)); }
html.is-tv .ep__here { left: calc(12px * var(--tvu)); top: calc(12px * var(--tvu)); height: calc(30px * var(--tvu)); padding: 0 calc(10px * var(--tvu)); font-size: calc(16px * var(--tvu)); -webkit-backdrop-filter: none; backdrop-filter: none; }
html.is-tv .ep__play { width: calc(64px * var(--tvu)); height: calc(64px * var(--tvu)); margin: calc(-32px * var(--tvu)) 0 0 calc(-32px * var(--tvu)); }
html.is-tv .ep__play .icon { width: calc(24px * var(--tvu)); height: calc(24px * var(--tvu)); }
html.is-tv .ep__art .ep__bar { left: calc(14px * var(--tvu)); right: calc(14px * var(--tvu)); bottom: calc(12px * var(--tvu)); height: calc(5px * var(--tvu)); }

/* Phones: one episode per line, the 140px thumbnail with the name, "E5 · 52 min" and the synopsis beside it. */
@media (max-width: 760px) {
  html:not(.is-tv) .ep-track {
    display: flex; flex-direction: column; gap: 18px; overflow: visible; scroll-snap-type: none;
    padding: 14px var(--gutter) 0; margin: 0;
  }
  html:not(.is-tv) .row--episodes .row__arrow { display: none; }
  html:not(.is-tv) .ep.ep--card { display: grid; grid-template-columns: 140px minmax(0, 1fr); align-items: center; gap: 14px; }
  html:not(.is-tv) .ep--card .ep__art { width: 140px; border-radius: 10px; }
  html:not(.is-tv) .ep--card .ep__text { margin: 0; }
  html:not(.is-tv) .ep--card .ep__over { font-size: 11px; }
  html:not(.is-tv) .ep--card .ep__title { font-size: 14px; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  html:not(.is-tv) .ep__desc { margin-top: 4px; font-size: 12px; }
  html:not(.is-tv) .ep--card .ep__meta { margin-top: 2px; font-size: 12px; }
  html:not(.is-tv) .ep__numeral { left: 10px; bottom: 12px; font-size: 28px; }
  html:not(.is-tv) .ep__here { left: 6px; top: 6px; height: 18px; padding: 0 6px; border-radius: 5px; font-size: 10px; }
  html:not(.is-tv) .ep__play { width: 32px; height: 32px; margin: -16px 0 0 -16px; }
  html:not(.is-tv) .ep__play .icon { width: 12px; height: 12px; }
  html:not(.is-tv) .ep__art .ep__bar { left: 6px; right: 6px; bottom: 6px; height: 3px; }
}

/* Compact: the player's episode panel and sheet. */
.ep-list--compact { gap: 4px; }
.ep-list--compact .ep--row { grid-template-columns: 48px 1fr; min-height: 64px; padding: 8px 10px; border-radius: 12px; gap: 14px; }
.ep-list--compact .ep__tile { width: 48px; height: 48px; font-size: 18px; border-radius: 10px; }
.ep-list--compact .ep__title { font-size: 15px; }
.ep-list--compact .ep[aria-current="true"] { background: rgba(255, 255, 255, .08); }
.ep-list--compact .ep[aria-current="true"]::before {
  content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: #fff;
}
@media (hover: hover) and (pointer: fine) { .ep-list--compact .ep:hover { background: rgba(255, 255, 255, .08); } }
.ep-list--compact .ep:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; box-shadow: none; background: rgba(255, 255, 255, .08); }
