import { chromium } from 'playwright';
const b = await chromium.launch({ executablePath:'/usr/bin/chromium-browser', args:['--no-sandbox'] });
const ctx = await b.newContext({ viewport:{ width:390, height:1200 }, deviceScaleFactor:1.5, serviceWorkers:'block' });
await ctx.addInitScript(()=>{localStorage.setItem('sz_theme','dark');localStorage.setItem('sz_accent','green');});
const p = await ctx.newPage();
await p.goto('https://poly-dev.szhub.space/', { waitUntil:'domcontentloaded', timeout:35000 });
await p.waitForTimeout(5500);
await p.click('.pk-ltoggle .pk-f', { timeout:6000 }).catch(()=>{});
await p.waitForTimeout(1500);
const found = await p.evaluate(()=>document.querySelector('.pk-found')?.innerText);
const wrs = await p.evaluate(()=>[...document.querySelectorAll('.pk-wrv')].slice(0,6).map(e=>e.innerText));
const edges = await p.evaluate(()=>[...document.querySelectorAll('.pk-cedge')].slice(0,6).map(e=>e.innerText));
await p.screenshot({ path:'_fb.png' });
console.log('found:', found);
console.log('top6 WR:', wrs.join(' '));
console.log('top6 EDGE:', edges.join(' '));
await b.close();