/* The CUE for the big screen and the browser. Brand: docs/brand.md. Dark ("night") like a cinema.
   One scale: 1rem = 24px on a 1920-wide TV, ~16px in a browser on a phone. */
:root {
  --night: #100C20; --night-2: #1A1530; --text: #F4F2FA; --muted: #B3AEC4;
  --orange: #FF8A3D; --pink: #FF3D7F; --violet: #5B4BFF;
  --surface: linear-gradient(135deg, #C74F00, #E8004F 55%, #5B4BFF);   /* text-safe gradient */
  --gutter: 3rem;
}
* { box-sizing: border-box; }
html { font-size: clamp(15px, 1.25vw, 24px); background: var(--night); color: var(--text); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "LG Smart UI", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
       line-height: 1.45; min-height: 100vh; overflow-x: hidden;
       background: radial-gradient(60rem 30rem at 85% -10%, rgba(91, 75, 255, .22), transparent 60%),
                   radial-gradient(50rem 26rem at -10% 10%, rgba(255, 61, 127, .14), transparent 60%), var(--night); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
img { display: block; max-width: 100%; }
h1, h2, p { margin: 0; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 4rem; }

/* Focus: one clear ring in brand pink with a soft glow. With a mouse, hover gives the same cue. */
.f { outline: none; transition: transform .18s ease, box-shadow .18s ease; }
/* The ring shows with the remote or arrow keys (body.keys), and on hover with a mouse; not after a tap. */
body.keys .f:focus, .f:hover, .form .f:focus { box-shadow: 0 0 0 .18rem var(--pink), 0 0 2rem rgba(255, 61, 127, .45); }
@media (prefers-reduced-motion: reduce) { .f { transition: none; } }

/* Sign in */
.signin { max-width: 34rem; margin: 0 auto; padding: 4rem var(--gutter); text-align: center; }
.signin-mark { width: 5rem; height: 5rem; margin: 0 auto 1rem; }
.wordmark { font-weight: 900; letter-spacing: .14em; font-stretch: expanded; font-size: 1.2rem; margin-bottom: 2rem; }
.signin h1 { font-size: 2rem; margin-bottom: .6rem; }
.form { display: flex; flex-direction: column; gap: .8rem; margin-top: 2rem; text-align: left; }
.form label { font-weight: 700; }
.form input { font: inherit; font-size: 1.2rem; color: var(--text); background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14);
              border-radius: 1rem; padding: .9rem 1.1rem; }
.form input.code { letter-spacing: .5em; text-align: center; font-weight: 800; font-size: 1.6rem; }
.btn { display: block; text-align: center; font-weight: 800; padding: .95rem 1.4rem; border-radius: 99rem; background: var(--surface); color: #fff; }
.btn[disabled] { opacity: .5; }
.link { text-align: center; color: var(--muted); padding: .7rem; border-radius: 99rem; }
.hint { font-size: .85rem; color: var(--muted); }
.error { margin-top: 1rem; color: #FF8FA9; }

/* Home */
.home { padding: 2.5rem 0 4rem; }
.greeting { padding: 0 var(--gutter); margin-bottom: 1.6rem; }
.greeting h1 { font-size: 2.6rem; font-weight: 800; }

.hero { position: relative; display: block; width: calc(100% - 2 * var(--gutter)); margin: 0 var(--gutter) 2.4rem;
        aspect-ratio: 21 / 9; min-height: 18rem; border-radius: 1.6rem; overflow: hidden; background: var(--night-2); }
.hero-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero-fade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16, 12, 32, .95) 0%, rgba(16, 12, 32, .75) 38%, rgba(16, 12, 32, 0) 70%); }
.hero-body { position: absolute; left: 2.4rem; top: 50%; transform: translateY(-50%); max-width: 46%; display: flex; flex-direction: column; gap: .55rem; }
.tag { align-self: flex-start; font-size: .8rem; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; padding: .3rem .8rem;
       border-radius: 99rem; background: var(--surface); color: #fff; }
.hero-title { font-size: 2.6rem; font-weight: 900; line-height: 1.05; }
.hero-meta { color: var(--muted); font-weight: 600; }
.hero-reason { font-weight: 700; }
.hero-overview { color: #DCD8E8; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
body.keys .hero:focus { transform: scale(1.01); }

.row { margin-bottom: 2.2rem; }
.row h2 { font-size: 1.35rem; font-weight: 800; padding: 0 var(--gutter); }
.row-sub { color: var(--muted); padding: 0 var(--gutter); font-size: .9rem; }
.row-scroll { display: flex; gap: 1.1rem; overflow-x: auto; padding: 1rem var(--gutter) 1.2rem; scroll-padding: 0 var(--gutter); scrollbar-width: none; }
.row-scroll::-webkit-scrollbar { display: none; }
.card { flex: 0 0 auto; width: 10.5rem; border-radius: 1rem; padding: .35rem; display: flex; flex-direction: column; gap: .35rem; }
body.keys .card:focus, .card:hover { transform: scale(1.07); background: rgba(255, 255, 255, .06); }
.poster { display: block; aspect-ratio: 2 / 3; border-radius: .8rem; overflow: hidden; background: var(--night-2); }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; height: 100%; padding: .6rem; text-align: center; color: var(--muted); font-weight: 700; }
.card-title { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-caption { color: var(--muted); font-size: .78rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* Top 10: the big outlined number sits left of the poster, the title below the poster. */
.card.ranked { width: 13.2rem; display: grid; grid-template-columns: 3rem 1fr; column-gap: .3rem; row-gap: .35rem; align-items: end; }
.card.ranked .rank { grid-row: 1; grid-column: 1; font-size: 5.6rem; font-weight: 900; line-height: .78; color: transparent;
                     -webkit-text-stroke: .12rem rgba(255, 255, 255, .55); text-align: right; }
.card.ranked .poster { grid-row: 1; grid-column: 2; }
.card.ranked .card-title, .card.ranked .card-caption { grid-column: 2; }

/* Browser on a phone or small window */
@media (max-width: 700px) {
  :root { --gutter: 1rem; }
  .hero { aspect-ratio: 3 / 4; min-height: 0; }
  .hero-fade { background: linear-gradient(0deg, rgba(16, 12, 32, .97) 15%, rgba(16, 12, 32, .5) 55%, rgba(16, 12, 32, 0) 80%); }
  .hero-body { left: 1.2rem; right: 1.2rem; top: auto; bottom: 1.4rem; transform: none; max-width: none; }
  .hero-title { font-size: 1.9rem; }
  .greeting h1 { font-size: 2rem; }
  .card { width: 8rem; }
}

/* Title page */
.title { padding-bottom: 4rem; }
.title-hero { position: relative; min-height: 34rem; display: flex; align-items: flex-end; }
.title-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.title-fade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(16, 12, 32, .97) 0%, rgba(16, 12, 32, .8) 40%, rgba(16, 12, 32, .1) 75%),
                                               linear-gradient(0deg, var(--night) 0%, rgba(16, 12, 32, 0) 35%); }
.title-body { position: relative; padding: 2.4rem var(--gutter) 2rem; max-width: 52rem; display: flex; flex-direction: column; gap: .6rem; }
.back { align-self: flex-start; color: var(--muted); font-weight: 700; padding: .4rem .9rem; border-radius: 99rem; background: rgba(255, 255, 255, .08); margin-bottom: 1rem; }
.title h1 { font-size: 3rem; font-weight: 900; line-height: 1.05; }
.title-facts { color: var(--muted); font-weight: 600; }
.title-genres { color: var(--muted); display: flex; gap: .8rem; align-items: center; }
.score { color: #FFD24A; font-weight: 800; }
.actions { display: flex; gap: .8rem; margin: .8rem 0; flex-wrap: wrap; }
.actions .btn { padding: .8rem 1.6rem; }
.btn.secondary { background: rgba(255, 255, 255, .12); }
.title-overview { color: #DCD8E8; max-width: 44rem; }
.small { font-size: .85rem; }
.where { padding: 1rem var(--gutter) 2rem; }
.where h2, .title .row h2 { font-size: 1.35rem; font-weight: 800; margin-bottom: .8rem; }
.providers { margin-bottom: 1rem; }
.providers-label { color: var(--muted); font-weight: 700; margin-bottom: .5rem; }
.provider-list { display: flex; flex-wrap: wrap; gap: .7rem; }
.provider { display: flex; align-items: center; gap: .6rem; padding: .45rem .9rem .45rem .45rem; border-radius: 99rem; background: rgba(255, 255, 255, .08); font-weight: 700; }
.provider img { width: 2.2rem; height: 2.2rem; border-radius: .6rem; }
.provider.mine { background: rgba(91, 75, 255, .28); }
.person { flex: 0 0 auto; width: 8rem; display: flex; flex-direction: column; gap: .3rem; text-align: center; }
.face { width: 6.5rem; height: 6.5rem; border-radius: 50%; overflow: hidden; margin: 0 auto .3rem; background: var(--night-2); }
.face img { width: 100%; height: 100%; object-fit: cover; }
.trailer { position: fixed; inset: 0; background: rgba(0, 0, 0, .92); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.2rem; z-index: 10; }
.trailer iframe { width: min(90vw, 160vh); aspect-ratio: 16 / 9; border: 0; border-radius: 1rem; }
@media (max-width: 700px) {
  .title-hero { min-height: 28rem; }
  .title-fade { background: linear-gradient(0deg, var(--night) 10%, rgba(16, 12, 32, .75) 55%, rgba(16, 12, 32, .2) 100%); }
  .title h1 { font-size: 2.1rem; }
}
