/*
 * Jasex site styles, on top of nocturne.css (the design system — tokens
 * and components live there and are not redefined here). This file holds only
 * what the design adds for this site: the page shell, poster cards, rails,
 * Top 10, ad frames, flash and auth layout. Every colour, radius and shadow
 * comes from a Nocturne variable.
 */

/* — globals the design sets on top of the system — */
:root {
  --font-body: "Inter", "Noto Sans JP", system-ui, sans-serif;
  --font-heading: "Inter", "Noto Sans JP", system-ui, sans-serif;
  --page-max: 1320px;
  --page-pad: clamp(16px, 4vw, 40px);
}
body { margin: 0; background: var(--color-bg); }
a { color: var(--color-accent); cursor: pointer; }
a:hover { color: var(--color-accent-300); }
.noscroll { scrollbar-width: none; }
.noscroll::-webkit-scrollbar { display: none; }
.seg-opt:first-child { border-radius: calc(var(--radius-md) - 1px) 0 0 calc(var(--radius-md) - 1px); }
.seg-opt:last-child { border-radius: 0 calc(var(--radius-md) - 1px) calc(var(--radius-md) - 1px) 0; }
.seg-opt:only-child { border-radius: calc(var(--radius-md) - 1px); }
/* A segmented control made of links (language switch): the current one marks like a checked radio. */
a.seg-opt { color: var(--color-text); text-decoration: none; }
a.seg-opt[aria-current] { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
a.seg-opt:not([aria-current]):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: 0;
}
.btn-link {
  background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer;
}

/* — page shell — */
.site {
  min-height: 100vh; display: flex; flex-direction: column;
  background: radial-gradient(1200px 600px at 10% -10%, var(--color-accent-900), transparent 60%), var(--color-bg);
  color: var(--color-text); font-family: var(--font-body);
}
.site-main { flex: 1; }
.page {
  max-width: var(--page-max); margin: 0 auto; width: 100%;
  padding: 28px var(--page-pad) 56px;
  display: flex; flex-direction: column; gap: 44px;
}

/* — header — */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--color-bg) 86%, transparent);
  backdrop-filter: blur(14px);
}
.site-header__bar {
  max-width: var(--page-max); margin: 0 auto;
  padding: 12px var(--page-pad);
  display: flex; align-items: center; gap: 22px;
}
.brand {
  display: flex; align-items: center; gap: 9px; flex: none;
  color: var(--color-text); text-decoration: none;
  font: var(--font-heading-weight) 18px var(--font-heading); letter-spacing: -0.01em;
}
.brand:hover { color: var(--color-text); }
.brand__dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--color-accent); box-shadow: 0 0 14px var(--color-accent);
}
.site-nav { display: flex; gap: 2px; }
.site-nav a {
  white-space: nowrap; flex: none; padding: 6px 11px; border-radius: var(--radius-md);
  font-size: 14px; text-decoration: none; color: var(--color-neutral-300);
}
.site-nav a:hover { color: var(--color-neutral-300); background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.site-nav a[aria-current] { color: var(--color-accent); }
.site-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.site-tools .seg-opt { padding: 7px 10px; white-space: nowrap; }
.site-tools .btn { white-space: nowrap; flex: none; }
.site-tools .btn i { font-size: 17px; }
/* Pills row under the bar on narrow screens (the design's `narrow` nav). */
.site-nav-pills {
  display: none; gap: 4px; overflow-x: auto;
  padding: 4px var(--page-pad) 10px;
}
.site-nav-pills a {
  flex: none; padding: 5px 11px; border-radius: 999px; font-size: 13px; text-decoration: none;
  color: var(--color-neutral-300); box-shadow: inset 0 0 0 1px var(--color-divider);
}
.site-nav-pills a[aria-current] { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
@media (max-width: 960px) {
  .site-nav { display: none; }
  .site-nav-pills { display: flex; }
  .account-menu__label { display: none; }
}
@media (max-width: 420px) {
  .site-header__bar { gap: 10px; }
  .site-tools { gap: 6px; }
  .site-tools .seg-opt { padding: 7px 8px; }
}

/* — account menu (native <details>, no script needed) — */
.account-menu { position: relative; }
.account-menu > summary { list-style: none; }
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu__button { gap: 8px; padding: 4px 10px 4px 4px; }
.avatar {
  width: 26px; height: 26px; border-radius: 50%; flex: none;
  display: grid; place-items: center; font-size: 12px;
  background: var(--color-accent-800); color: var(--color-accent-100);
}
.account-menu__list {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 190px; z-index: 40;
  display: flex; flex-direction: column; padding: var(--space-2);
  border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-md);
}
.account-menu__list a, .account-menu__list button {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: var(--radius-sm); font-size: 14px;
  color: var(--color-text); text-decoration: none;
}
.account-menu__list a:hover, .account-menu__list button:hover {
  color: var(--color-text); background: color-mix(in srgb, var(--color-text) 7%, transparent);
}
.account-menu__list form { margin: 0; }

/* — footer — */
.site-footer {
  max-width: var(--page-max); width: 100%; margin: 0 auto;
  padding: 28px var(--page-pad) 40px;
  display: flex; gap: 16px 28px; flex-wrap: wrap; align-items: center;
  font-size: 13px; color: var(--color-neutral-500);
  background: linear-gradient(to right, transparent, var(--color-divider) 48px,
    var(--color-divider) calc(100% - 48px), transparent) no-repeat top / 100% 1px;
}
.site-footer__brand { color: var(--color-text); font-weight: 500; }
.site-footer__links { display: flex; gap: 16px; flex-wrap: wrap; }
.site-footer__links a { color: var(--color-neutral-500); text-decoration: none; }
.site-footer__links a:hover { color: var(--color-text); }
.site-footer__copy { margin-left: auto; }

/* — flash — */
.flash-stack {
  max-width: var(--page-max); margin: 12px auto 0; padding: 0 var(--page-pad);
  display: flex; flex-direction: column; gap: 6px;
}
.flash {
  padding: 10px 14px; border-radius: var(--radius-md); font-size: 14px;
  background: var(--color-surface); box-shadow: var(--shadow-sm);
}
.flash-success { box-shadow: inset 3px 0 0 var(--color-accent), var(--shadow-sm); }
.flash-error { box-shadow: inset 3px 0 0 var(--color-neutral-200), var(--shadow-sm); color: var(--color-neutral-100); }
.flash-notice { box-shadow: inset 3px 0 0 var(--color-neutral-500), var(--shadow-sm); }

/* — sections & rails — */
.section { display: flex; flex-direction: column; gap: 14px; }
.section__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.section__head h2 { margin: 0; font-size: 20px; }
.section__more { font-size: 13px; text-decoration: none; margin-left: auto; }
.section__seg .seg-opt { padding: 5px 11px; }
/* Heading with the fading underline the design gives tabbed sections. */
.section__head--ruled {
  align-items: flex-end; gap: 10px 28px;
  background: linear-gradient(to right, var(--color-divider), var(--color-divider) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.section__head--ruled h2 { margin: 0 0 8px; }
.tabs { display: flex; gap: 20px; overflow-x: auto; max-width: 100%; padding: 4px 4px 0; }
.tabs a {
  flex: none; padding: 6px 0 9px; font-size: 14px; text-decoration: none;
  color: var(--color-neutral-300); box-shadow: inset 0 -2px 0 transparent;
}
.tabs a[aria-current="true"] { color: var(--color-accent); box-shadow: inset 0 -2px 0 var(--color-accent); }
.poster-grid {
  display: grid; grid-template-columns: repeat(auto-fill, 160px); gap: 24px 16px;
  justify-content: space-between;
}
/* Scrollers clip overflow, so they keep room for the 2px focus ring
   (outline-offset 2px) and the poster's 2px hover/focus lift. */
.rail {
  display: grid; grid-auto-flow: column; grid-auto-columns: 160px; gap: 16px; overflow-x: auto;
  padding: 6px 4px; margin: -6px -4px;
}
@media (max-width: 420px) {
  .poster-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); justify-content: stretch; }
  .rail { grid-auto-columns: 140px; }
}

/* — poster card (design/PosterCard) — */
.poster-card {
  display: flex; flex-direction: column; gap: 8px; min-width: 0;
  color: inherit; text-decoration: none;
}
.poster-card:hover { color: inherit; }
.poster-card__art {
  position: relative; aspect-ratio: 2 / 3; overflow: hidden;
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 7px, var(--color-surface) 7px 14px);
  transition: box-shadow 0.2s, transform 0.2s;
}
.poster-card:hover .poster-card__art,
.poster-card:focus-visible .poster-card__art { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.poster-card__art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster-card__badge { position: absolute; top: 6px; right: 6px; gap: 4px; padding: 2px 7px; }
.poster-card__badge i { font-size: 11px; }
.poster-card__overlay {
  position: absolute; left: 10px; right: 10px; bottom: 10px;
  font: var(--font-heading-weight) 16px/1.15 var(--font-heading); letter-spacing: -0.01em;
  color: var(--color-neutral-200); text-wrap: balance;
}
.poster-card__title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-card__meta { font-size: 12px; color: var(--color-neutral-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster-card__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }

/* — Top 10 — */
.top10 { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 20px; }
.top10-item {
  display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 0;
  border-radius: var(--radius-md); color: inherit; text-decoration: none;
}
.top10-item:hover { color: inherit; background: color-mix(in srgb, var(--color-text) 4%, transparent); }
.top10-item__poster { position: relative; flex: none; padding-left: 24px; }
.top10-item__rank {
  position: absolute; left: 0; bottom: -4px; z-index: 1;
  font: var(--font-heading-weight) 50px/1 var(--font-heading); letter-spacing: -0.06em;
  color: var(--color-bg); -webkit-text-stroke: 1.5px var(--color-neutral-600);
}
.top10-item__rank--podium { -webkit-text-stroke-color: var(--color-accent); }
.top10-item__art {
  width: 52px; height: 78px; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm);
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 5px, var(--color-surface) 5px 10px);
  overflow: hidden;
}
.top10-item__art img { width: 100%; height: 100%; object-fit: cover; }
.top10-item__text { flex: 1; min-width: 0; }
.top10-item__title { font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top10-item__meta { font-size: 12px; color: var(--color-neutral-500); }

/* — ad frame (partials/ad-frame) — */
.ad-frame {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 12px; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  background: repeating-linear-gradient(135deg, transparent 0 8px, color-mix(in srgb, var(--color-text) 3%, transparent) 8px 16px);
}
.ad-frame__label { align-self: flex-start; }
.ad-frame__slot { max-width: 100%; overflow: hidden; }
.ad-frame--leaderboard .ad-frame__slot { width: 970px; min-height: 90px; }
/* A 970×90 creative cannot fit a narrow screen; cropping it breaks network
   rules and viewability, so the leaderboard frame is not shown there. */
@media (max-width: 1019px) { .ad-frame--leaderboard { display: none; } }
.ad-frame--rectangle .ad-frame__slot { width: 300px; min-height: 250px; }

/* — empty state & pagination — */
.empty-state {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  padding: 28px 0; color: var(--color-neutral-500);
}
.empty-state i { font-size: 28px; color: var(--color-neutral-600); }
.pagination { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.pagination a, .pagination span {
  min-width: 36px; height: 36px; padding: 0 10px; display: inline-grid; place-items: center;
  border-radius: var(--radius-md); font-size: 14px; text-decoration: none; color: var(--color-text);
  box-shadow: inset 0 0 0 1px var(--color-divider);
}
.pagination a:hover { color: var(--color-text); background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.pagination [aria-current="page"] { color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.pagination .is-gap { box-shadow: none; }

/* — auth & small centred cards — */
.auth-page { min-height: 70vh; display: grid; place-items: center; padding: 40px 16px; }
.auth-card { width: min(400px, 100%); padding: 28px; gap: 16px; border-radius: var(--radius-lg); }
.auth-head { display: flex; flex-direction: column; gap: 4px; }
.auth-head h1 { margin: 0; font-size: 25px; }
.auth-sub { font-size: 14px; color: var(--color-neutral-400); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn-block { padding: 10px; }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.auth-row a { text-decoration: none; }
.checkbox { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--color-neutral-300); }
.checkbox input { accent-color: var(--color-accent); }
.auth-card > .btn-secondary { padding: 10px; margin-top: 0; }
.auth-switch { font-size: 13px; color: var(--color-neutral-400); display: flex; gap: 6px; justify-content: center; }
.auth-switch a { text-decoration: none; }

/* — error page & home intro — */
.error-page { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 64px 0; }
.error-page .label { font: var(--font-heading-weight) 13px var(--font-heading); letter-spacing: 0.08em; color: var(--color-accent); }
.error-page h1 { margin: 0; font-size: 32px; }
.error-page p { margin: 0; color: var(--color-neutral-400); }

/* — dialogs toggled by app.js — */
.dialog-backdrop { z-index: 50; }
.dialog-backdrop[hidden] { display: none; }

/* — listings (design: MOVIES, people, genres, studios, search) — */
.page--tight { gap: 20px; }
.listing-head { display: flex; flex-direction: column; gap: 4px; }
.listing-head__title { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.listing-head__title h1 { margin: 0; font-size: 32px; }
.listing-head__count { color: var(--color-neutral-500); font-size: 14px; }
.listing-head__meta { color: var(--color-neutral-400); font-size: 14px; }
.listing-head--split { flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.listing-head--split form { display: flex; gap: 8px; }
.listing-head--split .input { max-width: 280px; }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters__year { width: auto; min-width: 130px; }
.filter-menu { position: relative; }
.filter-menu > summary { list-style: none; }
.filter-menu > summary::-webkit-details-marker { display: none; }
.filter-menu__button { padding: 8px 12px; min-height: 36px; }
.filter-menu__count { padding: 0 7px; }
.filter-menu__caret { color: var(--color-neutral-500); }
.filter-menu__panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  width: min(330px, 88vw); padding: 10px; gap: 8px; border-radius: var(--radius-lg);
}
.filter-menu__search { position: relative; }
.filter-menu__search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--color-neutral-500); }
.filter-menu__search .input { padding-left: 32px; }
.filter-menu__list { max-height: 288px; overflow-y: auto; display: flex; flex-direction: column; padding: 2px; }
.filter-menu__item {
  display: flex; align-items: center; gap: 10px; padding: 7px 6px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
}
.filter-menu__item:hover { background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.filter-menu__item input { accent-color: var(--color-accent); width: 15px; height: 15px; margin: 0; }
.filter-menu__item span:first-of-type { flex: 1; }
.filter-menu__item[hidden] { display: none; }
.filter-menu__n { font-size: 12px; color: var(--color-neutral-500); }
.filter-menu__actions { display: flex; justify-content: space-between; gap: 8px; padding-top: 4px; }
.filter-menu__actions .btn-primary { margin-top: 0; }

.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { gap: 6px; font-size: 12px; text-decoration: none; }
.chip:hover { color: var(--color-accent-100); background: var(--color-accent-700); }
.chips__clear { font-size: 12px; }
.poster-grid--listing { gap: 24px 18px; justify-content: start; }

/* person / studio cards (design: People list, Studios) */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.link-card {
  color: inherit; text-decoration: none; flex-direction: row; align-items: center; gap: 12px; padding: 12px;
  transition: box-shadow 0.2s;
}
.link-card:hover, .link-card:focus-visible { color: inherit; box-shadow: 0 0 0 1px var(--color-accent); }
.link-card__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.link-card__text .card-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card__meta { font-size: 12px; color: var(--color-neutral-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.link-card > .ph-caret-right { color: var(--color-neutral-500); }
.portrait {
  width: 52px; height: 52px; flex: none; border-radius: 50%; overflow: hidden;
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 5px, var(--color-surface) 5px 10px);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait--lg { width: 96px; height: 96px; box-shadow: var(--shadow-sm);
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 6px, var(--color-surface) 6px 12px); }
.portrait--sm { width: 44px; height: 44px; }
.logo-box {
  width: 64px; height: 64px; flex: none; border-radius: var(--radius-md); overflow: hidden;
  display: grid; place-items: center; font: 500 10px ui-monospace, Menlo, monospace; color: var(--color-neutral-500);
  background: repeating-linear-gradient(135deg, var(--color-neutral-800) 0 5px, var(--color-surface) 5px 10px);
}
.logo-box img { width: 100%; height: 100%; object-fit: contain; }
.logo-box--lg { width: 96px; height: 96px; border-radius: var(--radius-lg); }

/* person / studio header (design: Person detail, Studio detail) */
.entity-head { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.entity-head__text { display: flex; flex-direction: column; gap: 4px; }
.entity-head__text h1 { margin: 0; font-size: clamp(30px, 4.5vw, 46px); }
.entity-head__meta { color: var(--color-neutral-400); font-size: 14px; }
.entity-head__known a { text-decoration: none; }
.film-role { font-size: 12px; color: var(--color-neutral-400); margin-top: -4px; }

/* genres (design: GENRES) */
.genre-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.genre-tile { padding: 0; overflow: hidden; gap: 0; color: inherit; text-decoration: none; transition: box-shadow 0.2s; }
.genre-tile:hover, .genre-tile:focus-visible { color: inherit; box-shadow: 0 0 0 1px var(--color-accent); }
.genre-tile__strip { display: flex; height: 84px; }
.genre-tile__strip span {
  flex: 1;
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 6px, var(--color-surface) 6px 12px);
}
.genre-tile__body { padding: 14px 16px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.genre-tile__names { display: flex; flex-direction: column; gap: 1px; }
.genre-tile__alt { font-size: 12px; color: var(--color-neutral-500); }
.genre-tile__count { font-size: 13px; color: var(--color-neutral-400); }
.pill-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pill-links .btn { border-radius: 999px; padding: 7px 14px; }

/* search (design: SEARCH) */
.search-box { position: relative; display: flex; gap: 8px; }
.search-box i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 20px; color: var(--color-neutral-500); }
.search-box .input { min-height: 54px; font-size: 18px; padding-left: 48px; border-radius: var(--radius-lg); }
.result-group { display: flex; flex-direction: column; gap: 12px; }
.result-group h2 { margin: 0; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-500); }
.person-hit {
  display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: var(--radius-md);
  color: inherit; text-decoration: none;
}
.person-hit:hover { color: inherit; background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.person-hit__name { font-size: 14px; font-weight: 500; }
.person-hit__role { font-size: 12px; color: var(--color-neutral-500); }
.person-hit__text { display: flex; flex-direction: column; min-width: 0; }

/* — movie page (design: MOVIE DETAIL + PLAYER) — */
.movie { flex-direction: row; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.movie__main { flex: 3 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 36px; }
.movie__side { flex: 1 1 300px; min-width: 0; max-width: 420px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 960px) { .movie__side { max-width: none; } .movie__main { flex-basis: 100%; } }

.player {
  position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--color-neutral-900); box-shadow: var(--shadow-sm);
}
.player__still {
  position: absolute; inset: 0; opacity: 0.7;
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 12px, var(--color-neutral-900) 12px 24px);
}
.player__play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 72px; height: 72px; border-radius: 50%; padding: 0;
  border-color: var(--color-neutral-300); background: color-mix(in srgb, var(--color-bg) 50%, transparent);
}
.player__play i { font-size: 28px; }
.player__play:hover { background: color-mix(in srgb, var(--color-bg) 30%, transparent); }
.player.is-loading .player__play { opacity: 0.5; pointer-events: none; }
.player.is-playing .player__play, .player.is-playing .player__still { display: none; }
.player__frame { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: var(--color-neutral-900); }
.player__overlay {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 16px; text-align: center; background: color-mix(in srgb, var(--color-bg) 45%, transparent);
}
.player__overlay p { margin: 0; color: var(--color-neutral-300); }
.player__date { font: var(--font-heading-weight) clamp(20px, 3vw, 30px) / 1.2 var(--font-heading); }
.player__error {
  position: absolute; left: 16px; right: 16px; bottom: 16px; margin: 0; padding: 10px 14px; z-index: 3;
  border-radius: var(--radius-md); background: var(--color-surface); box-shadow: var(--shadow-md);
}
.player__ad { position: absolute; inset: 0; z-index: 2; background: color-mix(in srgb, var(--color-bg) 35%, transparent); }
.player__ad-bar { position: absolute; top: 14px; left: 16px; display: flex; gap: 8px; align-items: center; z-index: 1; }
.player__ad-clock { font-size: 13px; color: var(--color-neutral-300); font-variant-numeric: tabular-nums; }
.player__ad-slot { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; }
.player__skip { position: absolute; right: 16px; bottom: 24px; z-index: 1; background: color-mix(in srgb, var(--color-bg) 70%, transparent); }
.player__ad-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--color-neutral-800); }
.player__ad-progress span { display: block; height: 100%; width: 0; background: var(--color-accent); transition: width 1s linear; }

.pickers {
  display: flex; flex-direction: column; gap: 10px; margin-top: -20px; padding: 12px 14px;
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  background: color-mix(in srgb, var(--color-surface) 60%, transparent);
}
.pickers__row { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; }
.pickers__label { margin: 0; min-width: 76px; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-500); }
.pickers__options { display: flex; gap: 6px; flex-wrap: wrap; }
.pickers__options[hidden] { display: none; }
.pickers__btn { padding: 6px 11px; font-size: 13px; }
.pickers__btn--ep { min-width: 60px; }
.pickers__btn[aria-pressed="true"] { color: var(--color-accent); border-color: var(--color-accent); }
.pickers__note { font-size: 11px; color: var(--color-neutral-500); }

.movie__info { display: flex; flex-direction: column; gap: 12px; }
.crumbs { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--color-neutral-500); }
.crumbs a { color: var(--color-neutral-400); text-decoration: none; }
.crumbs i { font-size: 10px; }
.crumbs [aria-current] { color: var(--color-neutral-300); }
.movie__tags { display: flex; gap: 6px; flex-wrap: wrap; }
.movie__tags .tag { text-decoration: none; }
.movie__title { margin: 0; font-size: clamp(28px, 3.6vw, 40px); text-wrap: balance; }
.movie__facts { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--color-neutral-400); }
.movie__synopsis { max-width: 64ch; font-size: 16px; color: var(--color-neutral-300); margin: 0; text-wrap: pretty; }
.movie__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.movie__cta { padding: 10px 16px; font-size: 15px; }
.movie__actions .btn-primary.movie__cta { padding: 10px 18px; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px 28px; max-width: 900px; margin: 10px 0 0; }
.facts div { display: flex; flex-direction: column; gap: 3px; }
.facts dt { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-500); }
.facts dd { margin: 0; font-size: 15px; }
.facts dd a { text-decoration: none; }

.cast-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; }
.cast-chip {
  display: flex; align-items: center; gap: 10px; padding: 6px 12px 6px 6px; min-width: 0;
  border-radius: 999px; color: inherit; text-decoration: none; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s;
}
.cast-chip:hover, .cast-chip:focus-visible { color: inherit; box-shadow: 0 0 0 1px var(--color-accent); }
.portrait--xs { width: 36px; height: 36px;
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 4px, var(--color-surface) 4px 8px); }
.cast-chip__text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.cast-chip__name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cast-chip__role { font-size: 11px; color: var(--color-neutral-500); }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery__item { aspect-ratio: 16 / 9; border-radius: var(--radius-md); overflow: hidden; box-shadow: var(--shadow-sm); transition: box-shadow 0.2s; }
.gallery__item:hover, .gallery__item:focus-visible { box-shadow: 0 0 0 1px var(--color-accent); }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }
.dialog--wide { width: min(960px, 100%); }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gallery-view img { width: 100%; max-height: 70vh; object-fit: contain; border-radius: var(--radius-md); }
.share__copy { display: flex; gap: 8px; }
.share__copy .btn { flex: none; }
.share__targets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.share__targets .btn { flex-direction: column; gap: 6px; padding: 12px 6px; font-size: 12px; }
.share__targets i { font-size: 22px; }

.side-title { margin: 0; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-500); }
.up-next { display: flex; flex-direction: column; gap: 10px; }
.up-next__item { display: flex; gap: 12px; padding: 6px; border-radius: var(--radius-md); color: inherit; text-decoration: none; }
.up-next__item:hover { color: inherit; background: color-mix(in srgb, var(--color-text) 5%, transparent); }
.up-next__art {
  width: 132px; aspect-ratio: 16 / 9; flex: none; align-self: flex-start; overflow: hidden; border-radius: var(--radius-sm);
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 6px, var(--color-surface) 6px 12px);
}
.up-next__art img { width: 100%; height: 100%; object-fit: cover; }
.up-next__text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.up-next__title { font-size: 14px; font-weight: 500; line-height: 1.25; }
.up-next__meta { font-size: 12px; color: var(--color-neutral-500); }
.up-next__synopsis {
  font-size: 12px; color: var(--color-neutral-400); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.comments { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.comments__count { color: var(--color-neutral-500); font-size: 12px; text-transform: none; letter-spacing: 0; }
.comments__prompt {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px;
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm); font-size: 14px; color: var(--color-neutral-300);
}
.comments__prompt span { flex: 1; }
.comment {
  display: flex; gap: 12px; padding: 14px 0;
  background: linear-gradient(to right, transparent, var(--color-divider) 48px, var(--color-divider) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.avatar--md { width: 34px; height: 34px; font-size: 13px; background: var(--color-neutral-800); color: var(--color-neutral-200); }
.comment__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.comment__head { display: flex; gap: 10px; align-items: baseline; }
.comment__name { font-size: 14px; font-weight: 500; }
.comment__head time { font-size: 12px; color: var(--color-neutral-500); }
.comment p { margin: 0; font-size: 14px; color: var(--color-neutral-300); text-wrap: pretty; overflow-wrap: anywhere; }
.ad-frame--rectangle { align-self: stretch; }

/* ---------- download page (phase 07) ---------- */
.download { max-width: 1080px; }
.download__head { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.download__art {
  width: 120px; aspect-ratio: 16 / 9; flex: none; overflow: hidden; border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
  background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 6px, var(--color-surface) 6px 12px);
}
.download__art img { width: 100%; height: 100%; object-fit: cover; }
.download__title { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.download__title h1 { margin: 0; font-size: clamp(24px, 3.4vw, 32px); }
.download__title h1 a { color: inherit; text-decoration: none; }
.download__facts { font-size: 13px; color: var(--color-neutral-500); }
.download__group { margin: 8px 0 0; font-size: 18px; }
.download__section { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.download__kind { margin: 0; font-size: 16px; }
.download__groupbox { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.download__empty { color: var(--color-neutral-400); margin: 0; }
.table-scroll { overflow-x: auto; max-width: 100%; position: relative; }
.table-scroll .table { min-width: 560px; }
.table-scroll .table--narrow { min-width: 0; }
.download .table td { color: var(--color-neutral-400); }
.download .table td.table__strong { color: var(--color-text); font-weight: 500; }
.table__action { text-align: right; white-space: nowrap; }
.btn-sm { padding: 5px 11px; font-size: 13px; }

/* ---------- toast (shared: download links, My List, reminders, comments) ---------- */
.toast-stack { position: fixed; left: 16px; right: 16px; bottom: 24px; z-index: 80; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast-stack .toast { max-width: 480px; }
.toast {
  padding: 10px 16px; border-radius: var(--radius-md); background: var(--color-neutral-800); color: var(--color-text);
  box-shadow: var(--shadow-md); font-size: 14px; display: flex; align-items: center; gap: 8px;
  animation: toast-in .18s ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

/* ---------- My List, account, comments (phase 08) ---------- */
.saved-card { position: relative; }
.saved-card .toggle-form { position: absolute; top: 6px; left: 6px; }
.saved-card__remove { width: 30px; height: 30px; border-radius: 50%; background: color-mix(in srgb, var(--color-bg) 75%, transparent); }
.empty-state--action { align-items: flex-start; }
.toggle-form { display: contents; }
.saved-card .toggle-form { display: block; }
.btn[data-active="true"] .ph-fill { color: var(--color-accent); }

.account__card { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.account__who { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.account__who h1 { margin: 0; font-size: 22px; overflow-wrap: anywhere; }
.account__who span { font-size: 13px; color: var(--color-neutral-500); overflow-wrap: anywhere; }
.avatar--lg { width: 60px; height: 60px; font: 500 24px var(--font-heading); background: var(--color-accent-800); color: var(--color-accent-100); overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.account__tabs { align-self: flex-start; }

.reminder-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; max-width: 720px; }
.reminder-list__item {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  background: linear-gradient(to right, transparent, var(--color-divider) 48px, var(--color-divider) calc(100% - 48px), transparent) no-repeat bottom / 100% 1px;
}
.reminder-list__art { width: 96px; aspect-ratio: 16 / 9; flex: none; border-radius: var(--radius-sm); background: repeating-linear-gradient(135deg, var(--tint, var(--color-neutral-800)) 0 6px, var(--color-surface) 6px 12px); }
.reminder-list__text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.reminder-list__text a { color: var(--color-text); text-decoration: none; font-size: 15px; }
.reminder-list__date { font-size: 12px; color: var(--color-accent-300); }

.settings { display: flex; flex-direction: column; gap: 28px; max-width: 640px; }
.settings__block { display: flex; flex-direction: column; gap: 12px; }
.settings__title { margin: 0; font-size: 16px; }
.settings__row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.settings__stack { display: flex; flex-direction: column; gap: 12px; max-width: 420px; }
.settings__grow { flex: 1; min-width: 220px; }
.settings__hint { margin: 0; font-size: 13px; color: var(--color-neutral-500); }
.settings__block--danger { padding-top: 20px; border-top: 1px solid var(--color-divider); }
.btn-danger { background: var(--color-danger, #c2410c); color: #fff; }
.btn-danger:hover { filter: brightness(1.08); }

.comment-form { display: flex; flex-direction: column; gap: 8px; }
.comment-form__body { min-height: 76px; resize: vertical; font: inherit; }
.comment-form__actions { display: flex; justify-content: flex-end; }
.comment--pending, .comment--rejected { opacity: .8; }
.comment__head .tag { font-size: 11px; }
.comment form { align-self: flex-start; }
.comments__more { align-self: center; }

/* ---------- search suggestions (phase 10) ---------- */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none;
  background: var(--color-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
}
.suggest a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: var(--radius-md); color: var(--color-text); text-decoration: none; }
.suggest [aria-selected="true"] a, .suggest a:hover { background: color-mix(in srgb, var(--color-text) 8%, transparent); }
.suggest__kind { font-size: 12px; color: var(--color-neutral-500); flex: none; }

/* ---------- static pages (phase 11) ---------- */
.prose { max-width: 720px; gap: 14px; }
.prose h1 { margin: 0; font-size: clamp(26px, 3.4vw, 34px); }
.prose h2 { margin: 12px 0 0; font-size: 18px; }
.prose p, .prose li { color: var(--color-neutral-300); line-height: 1.65; margin: 0; }
.prose ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.prose a { color: var(--color-accent-300); }
