/* VOICE: living-room TV app, calm and cinematic, readable from the sofa
   IDEA: a cinema marquee turned TV home screen; tonight's feature announced big, posters on shelves below
   COLOUR and TYPE: near-black velvet ground, marquee gold focus, cinema red for the main action;
   Big Shoulders Display + Figtree
   TV NOTES: sized for 1920x1080 viewed from the sofa (base 24px there); focus uses :focus, not only
   :focus-visible, so older webOS browsers still show where you are. */
:root{color-scheme:dark;--bg:#0f0b0b;--panel:#1c1514;--panel2:#271d1b;--ink:#f6ece4;--mut:#b9a99f;--line:#3a2c28;--red:#d72c46;--gold:#ffc93c;--gut:3rem}
*{box-sizing:border-box;min-width:0}
html{font-size:16px;font-size:clamp(16px,1.25vw,30px)}
body{margin:0;background:var(--bg);color:var(--ink);font:1rem/1.45 Figtree,system-ui,sans-serif;overflow-x:hidden}
.disp{font-family:"Big Shoulders Display",Impact,sans-serif;line-height:1.02;letter-spacing:.01em}
button{font:inherit;color:inherit;cursor:pointer}
img{max-width:100%}
[hidden]{display:none!important}

/* Focus: gold ring everywhere. Mouse/touch clicks hide it where the browser knows :focus-visible;
   where it doesn't, the rule below is dropped as a whole and the ring stays, which is what a TV needs. */
:focus{outline:.2rem solid var(--gold);outline-offset:.2rem}
:focus:not(:focus-visible){outline:none}

.app{display:grid;grid-template-columns:auto minmax(0,1fr);min-height:100vh}
.app.signed-out{grid-template-columns:minmax(0,1fr)}
.rail{position:sticky;top:0;height:100vh;display:flex;flex-direction:column;padding:1.6rem .8rem;background:linear-gradient(90deg,#000a,#0000);z-index:3}
.rail>*+*{margin-top:.6rem}
.logo{font-size:1.6rem;font-weight:900;color:var(--gold);padding:0 .6rem 1.2rem;text-align:center}
.rail button{display:flex;flex-direction:column;align-items:center;width:5.6rem;padding:.7rem .3rem;border-radius:.9rem;border:0;background:none;color:var(--mut);font-weight:600;font-size:.8rem}
.rail button svg{width:1.6rem;height:1.6rem;margin-bottom:.25rem}
.rail button[aria-current=page]{color:var(--ink);background:var(--panel2)}
.rail button:focus{background:var(--gold);color:#2a0a10;outline:0}
main{padding:0 0 3rem}

/* Hero */
.hero{position:relative;min-height:50vh;display:flex;align-items:flex-end;overflow:hidden}
.hero .bd{position:absolute;top:0;right:0;bottom:0;left:28%;background-size:cover;background-position:center top;border-bottom-left-radius:2rem}
.hero .bd::after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(90deg,var(--bg) 0%,rgba(15,11,11,.8) 22%,rgba(15,11,11,0) 60%),linear-gradient(0deg,var(--bg) 0%,rgba(15,11,11,0) 45%)}
.hero .info{position:relative;padding:2rem var(--gut) 1rem;max-width:48rem}
.kick{display:flex;flex-wrap:wrap;color:var(--gold);font-weight:700;font-size:1rem}
.kick span{margin-right:1rem}
.hero h1{font-size:3.6rem;font-weight:900;margin:.3rem 0 .5rem}
.meta{display:flex;flex-wrap:wrap;align-items:center;color:var(--mut);font-size:.95rem}
.meta>*{margin-right:1rem}
.meta b{color:var(--ink)}
.tag{background:var(--gold);color:#2a0a10;border-radius:.35rem;padding:0 .5rem;font-weight:700}
.why{font-size:1.1rem;margin:.7rem 0 1rem;max-width:40rem}
.ovw{color:var(--mut);font-size:.9rem;margin:-.4rem 0 1rem;max-width:40rem;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.acts{display:flex;flex-wrap:wrap;margin:-.35rem}
.acts>*{margin:.35rem}

/* Buttons */
.b{min-height:2.6rem;padding:.5rem 1.2rem;border-radius:.7rem;border:0;background:rgba(255,255,255,.12);font-weight:700;font-size:.95rem;display:inline-flex;align-items:center;text-decoration:none;color:var(--ink)}
.b.pri{background:var(--ink);color:#120c0b}
.b.on{background:var(--red);color:#fff}
.b:focus,.b:hover{background:var(--gold);color:#2a0a10;outline:0}
.b[disabled]{opacity:.5}

.status{padding:.4rem var(--gut) 0;color:var(--mut);min-height:1.6rem;font-size:.9rem}
.status .warn{color:var(--gold)}

/* Rows of posters */
.row{margin-top:1.2rem}
.row h2{font-size:1.25rem;font-weight:700;margin:0 var(--gut) .5rem}
.row .note{margin:0 var(--gut) .4rem;color:var(--mut);font-size:.85rem}
.shelf{display:flex;overflow-x:auto;padding:.6rem var(--gut) 1rem;scrollbar-width:none}
.shelf::-webkit-scrollbar{display:none}
.shelf>*+*{margin-left:1rem}
.tile{flex:none;width:9.5rem;padding:0;border:0;background:none;text-align:left;border-radius:.8rem;transition:transform .15s}
.tile:focus,.tile.cur{transform:scale(1.07);outline:.2rem solid var(--gold);outline-offset:.15rem}
.tile .cap{font-size:.8rem;color:var(--mut);margin-top:.45rem;padding:0 .2rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.empty{margin:0 var(--gut);border:2px dashed var(--line);border-radius:1rem;padding:1.2rem 1.4rem;color:var(--mut)}

/* Poster art: TMDB poster when there is one, a drawn card when there isn't */
.art{position:relative;overflow:hidden;display:flex;flex-direction:column;justify-content:flex-end;padding:.7rem;border-radius:.8rem;box-shadow:0 .6rem 1.4rem -.6rem #000;background:#221a18}
.tile .art,.dlg .art,.hist .art{height:0;padding:0 0 150%}
.art img{position:absolute;top:0;left:0;width:100%;height:100%;object-fit:cover}
.art .txt{position:absolute;left:0;right:0;bottom:0;padding:.7rem}
.art .tt{overflow-wrap:break-word;font-family:"Big Shoulders Display",Impact,sans-serif;font-weight:900;font-size:1.4rem;line-height:.95;text-shadow:0 2px 12px rgba(0,0,0,.6)}
.art .yr{font-size:.7rem;opacity:.8;margin-top:.25rem}
.art .svc{position:absolute;top:.5rem;left:.5rem;background:rgba(0,0,0,.72);border-radius:.35rem;padding:.05rem .45rem;font-size:.68rem;font-weight:700}
.art .nw{position:absolute;top:.5rem;right:.5rem;font-size:.68rem}
.prog{position:absolute;left:.5rem;right:.5rem;bottom:.5rem;height:.3rem;background:rgba(255,255,255,.3);border-radius:1rem;overflow:hidden}
.prog i{display:block;height:100%;background:var(--red)}

/* Pages */
.page{padding:2rem var(--gut)}
.page h1{font-size:3rem;font-weight:900;margin:0 0 1rem}
.page h2{font-size:1.25rem;margin:1.8rem 0 .6rem}
.chips{display:flex;flex-wrap:wrap;margin:-.3rem}
.chips>*{margin:.3rem}
.chip{min-height:2.5rem;padding:.4rem 1rem;border-radius:2rem;border:2px solid var(--line);background:var(--panel);font-weight:600;font-size:.9rem}
.chip.on{background:var(--ink);color:#120c0b;border-color:var(--ink)}
.chip:focus{border-color:var(--gold);outline-offset:.1rem}
/* Setup: categories */
.cats{max-width:52rem}
.cat{background:var(--panel);border-radius:1rem;padding:.8rem 1rem;margin-bottom:.7rem}
.cat h3{margin:0 0 .3rem;font-size:1.05rem}
.cat .small{margin:.2rem 0 0}
.cat .addrow{margin-bottom:0}
.imdb{background:#f5c518;color:#000;border-radius:.35rem;padding:0 .45rem;font-weight:700}
textarea,input[type=text],input[type=password]{width:100%;font:inherit;font-size:max(16px,1rem);padding:.6rem 1rem;border-radius:.8rem;border:2px solid var(--line);background:var(--panel);color:var(--ink);min-height:2.6rem}
textarea:focus,input:focus{border-color:var(--gold);outline:0}
textarea+.acts{margin-top:.4rem}
.addrow{display:flex;flex-wrap:wrap;margin:.4rem -.3rem}
.addrow>*{margin:.3rem}
.addrow input{flex:1 1 14rem;width:auto}
.hist{display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));grid-gap:1.4rem 1rem}
.hist .cap{font-size:.8rem;color:var(--mut);margin-top:.4rem}
.found{display:grid;grid-template-columns:repeat(auto-fill,minmax(9.5rem,1fr));grid-gap:1.2rem 1rem;margin:.6rem 0 1.4rem}
.found .acts .b{font-size:.75rem;padding:.3rem .6rem;min-height:2rem}
.stars{display:flex;margin-top:.4rem}
.stars button{width:2.2rem;height:2.2rem;border-radius:.5rem;border:0;background:rgba(255,255,255,.08);color:var(--mut);font-size:1.05rem;margin-right:.25rem}
.stars button.on{color:var(--gold)}
.stars button:focus{background:var(--gold);color:#2a0a10;outline:0}
.small{font-size:.85rem;color:var(--mut)}
.err{color:#ff8a8a}
.linkish{background:none;border:0;color:var(--mut);padding:.3rem 0;text-decoration:underline;font-size:.8rem}
.linkish:focus{color:var(--gold)}

/* Sign in */
.signin{max-width:60rem;margin:0 auto}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(18rem,1fr));grid-gap:1.2rem}
.card{background:var(--panel);border-radius:1.2rem;padding:1.4rem}
.card h2{margin-top:0}
.code{font-family:"Big Shoulders Display",Impact,sans-serif;font-size:4.5rem;font-weight:900;color:var(--gold);letter-spacing:.08em;margin:.4rem 0}

/* Rating overlay */
.ov{position:fixed;top:0;right:0;bottom:0;left:0;background:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;z-index:9;padding:1rem}
.dlg{background:var(--panel);border-radius:1.4rem;padding:2rem;max-width:36rem;width:100%;display:grid;grid-template-columns:7rem minmax(0,1fr);grid-gap:1.4rem;align-items:center}
.dlg h3{margin:0 0 .3rem;font-size:1.6rem}
.dlg .stars button{width:2.8rem;height:2.8rem;font-size:1.4rem}
.dlg .acts{margin-top:.8rem}

/* Big screens (the TV): the preview stays pinned at the top while the rows scroll beneath it. */
@media(min-width:1100px) and (min-height:600px){
 .hero{position:sticky;top:0;z-index:2;height:47vh;min-height:0;background:var(--bg)}
 .hero .info{padding-top:1.2rem}
 .hero h1{font-size:3rem}
 .ovw{-webkit-line-clamp:2}
 /* Room for the last row to scroll up under the preview. */
 #rows{padding-bottom:45vh}
}
.tv,.tv body{scrollbar-width:none}
.tv::-webkit-scrollbar,.tv body::-webkit-scrollbar{display:none}

@media(max-width:760px){
 :root{--gut:1rem}
 html{font-size:15px}
 .app{grid-template-columns:1fr}
 .rail{position:sticky;height:auto;flex-direction:row;justify-content:center;padding:.5rem;background:rgba(15,11,11,.95);top:0}
 .rail>*+*{margin:0 0 0 .4rem}
 .logo{display:none}
 .rail button{width:auto;flex:1;flex-direction:row;justify-content:center}
 .rail button svg{margin:0 .4rem 0 0;width:1.2rem;height:1.2rem}
 .hero{min-height:0;flex-direction:column;align-items:stretch}
 .hero .bd{position:relative;left:auto;height:13rem;border-radius:0}
 .hero .info{padding:0 1rem 1rem;margin-top:-3rem}
 .hero h1{font-size:2.4rem}
 .page h1{font-size:2.3rem}
 .tile{width:8rem}
 .code{font-size:3.2rem}
 .dlg{grid-template-columns:1fr}.dlg .art{display:none}
}
@media(prefers-reduced-motion:reduce){.tile{transition:none}}
