Spaces:
Running
Running
Deploy pawfoil to the hub
Browse filesFiles changed (8)
- pawfoil/cmx.js+3-1
- pawfoil/funpass.js+2-2
- pawfoil/game.js+13-2
- pawfoil/index.html+61-21
- pawfoil/ladder.jsAdded+312
- pawfoil/levels.jsAdded+238
- pawfoil/style.css+61
- pawfoil/sw.js+2-2
128 unmodified lines1291301311321331341351 unmodified line137138139140141142143144145146128 unmodified lineslet deferred = null;let wanted = false;const ios = /iphone|ipad|ipod/i.test(navigator.userAgent) && !/crios|fxios/i.test(navigator.userAgent);window.addEventListener('beforeinstallprompt', (e) => { e.preventDefault(); deferred = e; if (wanted && btn) btn.hidden = false; });window.addEventListener('appinstalled', () => { count(game, 'install', 'prompt'); if (btn) btn.hidden = true; });if (btn) {btn.addEventListener('click', async () => {1 unmodified linedeferred.prompt();const r = await deferred.userChoice.catch(() => null);if (r && r.outcome === 'accepted') btn.hidden = true;deferred = null;} else if (ios) {toast('Tap the Share button, then "Add to Home Screen".', 5000);count(game, 'install', 'ios-hint');}});}128 unmodified lines1291301311321331341351 unmodified line137138139140141142143144145146147148128 unmodified lineslet deferred = null;let wanted = false;const ios = /iphone|ipad|ipod/i.test(navigator.userAgent) && !/crios|fxios/i.test(navigator.userAgent);window.addEventListener('beforeinstallprompt', (e) => { e.preventDefault(); deferred = e; if (wanted && btn && !store(`cmx-install-no:${game}`)) btn.hidden = false; });window.addEventListener('appinstalled', () => { count(game, 'install', 'prompt'); if (btn) btn.hidden = true; });if (btn) {btn.addEventListener('click', async () => {1 unmodified linedeferred.prompt();const r = await deferred.userChoice.catch(() => null);if (r && r.outcome === 'accepted') btn.hidden = true;else if (r && r.outcome === 'dismissed') { store(`cmx-install-no:${game}`, 1); btn.hidden = true; } // "Not now" is remembereddeferred = null;} else if (ios) {toast('Tap the Share button, then "Add to Home Screen".', 5000);count(game, 'install', 'ios-hint');store(`cmx-install-no:${game}`, 1);}});}
1234568 unmodified lines15161718192021// CyberMax Fun Pass: ONE optional supporter pass for every CyberMax game (copied into each game's web/ folder).// Free games stay free. The pass removes the supporter nudges and unlocks extra packs, the full archive and themes.// Monthly $2.99 · Yearly $19 · Lifetime $29.99 once (Stripe Payment Links, pack revenue/packs/stripe/fun-pass).// Buy: counted redirect https://data.cybermaxtools.com/buy/st-fun-pass-<plan>?s=game-<id> -> Stripe checkout.// After checkout Stripe sends the buyer to data.cybermaxtools.com/unlock/fun-pass?session_id=..., which checks// the Checkout Session (and, for a subscription, that it is still active) and returns to /games/ with #cmx-pro=<code>.8 unmodified linesexport const PLANS = [{ id: 'monthly', label: 'Monthly', price: '$2.99', per: '/month', note: 'Cancel any time' },{ id: 'yearly', label: 'Yearly', price: '$19', per: '/year', note: 'Save 47%', best: true },{ id: 'unlock', label: 'Lifetime', price: '$29.99', per: ' once', note: 'Pay once, keep forever' },];export const COMMON_PERKS = ['No supporter nudges, ever', 'Extra puzzle packs in every game', 'The full archive of past dailies', 'Custom colour themes'];1234568 unmodified lines15161718192021// CyberMax Fun Pass: ONE optional supporter pass for every CyberMax game (copied into each game's web/ folder).// Free games stay free. The pass removes the supporter nudges and unlocks extra packs, the full archive and themes.// Monthly $2.99 · Yearly $19 · Unlock all $4.99 once (Stripe Payment Links, pack revenue/packs/stripe/fun-pass).// Buy: counted redirect https://data.cybermaxtools.com/buy/st-fun-pass-<plan>?s=game-<id> -> Stripe checkout.// After checkout Stripe sends the buyer to data.cybermaxtools.com/unlock/fun-pass?session_id=..., which checks// the Checkout Session (and, for a subscription, that it is still active) and returns to /games/ with #cmx-pro=<code>.8 unmodified linesexport const PLANS = [{ id: 'monthly', label: 'Monthly', price: '$2.99', per: '/month', note: 'Cancel any time' },{ id: 'yearly', label: 'Yearly', price: '$19', per: '/year', note: 'Save 47%', best: true },{ id: 'unlock', label: 'Unlock all', price: '$4.99', per: ' once', note: 'Pay once, keep forever' },];export const COMMON_PERKS = ['No supporter nudges, ever', 'Extra puzzle packs in every game', 'The full archive of past dailies', 'Custom colour themes'];
2 unmodified lines3456783 unmodified lines1213141516171836 unmodified lines55565758596061107 unmodified lines1691701712 unmodified linesimport { makeCard, KINDS, RARITY, FRAMES, cleanPetName } from './core.js';import { count, store, toast, share, intents, download, canvasBlob, pwa, rr, themeToggle } from './cmx.js';import * as pass from './funpass.js';const GAME = 'pawfoil';const PATH = '/games/pawfoil/';3 unmodified linesconst W = 750, H = 1050, ART = { x: 52, y: 128, w: 646, h: 430 };let photo = null, kind = store('pawfoil:kind') || 'dog', roll = 0, forced = null, ox = 0, oy = 0, zoom = 1, made = false;pass.init({ game: GAME, name: 'Pawfoil', perks: ['Pick any frame: Legendary gold holo on demand', 'Hide the CyberMax line on your cards'] });const install = pwa(GAME, $('install'));themeToggle($('theme'));36 unmodified lines} catch { toast('Could not read that image. Try a JPG or PNG.'); }}$('file').onchange = (e) => { const f = e.target.files[0]; if (f) loadPhoto(f, 'photo'); };$('sample').onclick = async () => { const r = await fetch('sample.jpg'); loadPhoto(await r.blob(), 'sample'); if (!$('name').value) $('name').value = 'Biscuit'; draw(); };// drag to move the photo inside the art boxlet drag = null;107 unmodified linesrenderKinds();draw();2 unmodified lines34567893 unmodified lines131415161718192036 unmodified lines5758596061626364107 unmodified lines1721731741751761771781791801811822 unmodified linesimport { makeCard, KINDS, RARITY, FRAMES, cleanPetName } from './core.js';import { count, store, toast, share, intents, download, canvasBlob, pwa, rr, themeToggle } from './cmx.js';import * as pass from './funpass.js';import { initLadder, openDuel } from './ladder.js';const GAME = 'pawfoil';const PATH = '/games/pawfoil/';3 unmodified linesconst W = 750, H = 1050, ART = { x: 52, y: 128, w: 646, h: 430 };let photo = null, kind = store('pawfoil:kind') || 'dog', roll = 0, forced = null, ox = 0, oy = 0, zoom = 1, made = false;pass.init({ game: GAME, name: 'Pawfoil', perks: ['Duel ladder levels 21-30 (1-20 are free)', 'Pick any frame: Legendary gold holo on demand', 'Hide the CyberMax line on your cards'],extra: 'The Fun Pass opens duel levels 21-30, past daily rivals, any card frame and extras in every CyberMax game.' });const install = pwa(GAME, $('install'));themeToggle($('theme'));36 unmodified lines} catch { toast('Could not read that image. Try a JPG or PNG.'); }}$('file').onchange = (e) => { const f = e.target.files[0]; if (f) loadPhoto(f, 'photo'); };async function loadSample() { const r = await fetch('sample.jpg'); await loadPhoto(await r.blob(), 'sample'); if (!$('name').value) $('name').value = 'Biscuit'; draw(); }$('sample').onclick = loadSample;// drag to move the photo inside the art boxlet drag = null;107 unmodified linesrenderKinds();draw();// Duel ladder: your current card (or the sample pet) duels 30 rivals. The art is copied canvas-to-canvas locally.$('go-duel').onclick = () => { openDuel(); window.scrollTo({ top: 0 }); };initLadder({getCard: card,ensurePet: async () => { if (!photo && !$('name').value.trim()) { try { await loadSample(); } catch { /* emoji art is fine */ } } },drawArt: (c) => { const x = c.getContext('2d'); x.clearRect(0, 0, c.width, c.height); x.drawImage(cv, ART.x, ART.y, ART.w, ART.h, 0, 0, c.width, c.height); },});
12345678910113 unmodified lines15161718192021222324252627289 unmodified lines3839404142434445464748495051525354555657585960616263<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><title>Pawfoil: free pet trading card maker, holo cards in seconds | CyberMax</title><meta name="description" content="Turn your pet's photo into a shiny collectible trading card with funny stats and moves. Free HD download, no sign-up, no watermark grab: your photo never leaves your phone."><link rel="canonical" href="https://cybermaxtools.com/games/pawfoil/"><meta property="og:type" content="website"><meta property="og:site_name" content="CyberMax"><meta property="og:title" content="Pawfoil: make your pet a holo trading card"><meta property="og:description" content="Photo in, collectible card out: stats, two funny moves, a rarity roll. Free HD download."><meta property="og:url" content="https://cybermaxtools.com/games/pawfoil/"><meta property="og:image" content="https://cybermaxtools.com/games/pawfoil/og.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://cybermaxtools.com/games/pawfoil/og.png">3 unmodified lines<meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-title" content="Pawfoil"><link rel="stylesheet" href="fun.css"><link rel="stylesheet" href="style.css"><script>try{var t=localStorage.getItem('cm-theme');if(t)document.documentElement.dataset.theme=t}catch(e){}</script><script type="application/ld+json">{"@context":"https://schema.org","@type":"WebApplication","name":"Pawfoil","url":"https://cybermaxtools.com/games/pawfoil/","image":"https://cybermaxtools.com/games/pawfoil/og.png","description":"Free pet trading card maker: your pet's photo becomes a collectible card with stats, moves and a rarity roll. Runs in the browser; photos never leave the device.","applicationCategory":"MultimediaApplication","operatingSystem":"Any","publisher":{"@type":"Organization","name":"CyberMax","url":"https://cybermaxtools.com/"},"offers":[{"@type":"Offer","price":"0","priceCurrency":"USD","description":"Free HD card"},{"@type":"Offer","price":"2.99","priceCurrency":"USD","description":"CyberMax Fun Pass, monthly"}]}</script></head><body><div class="wrap wide"><header class="top"><a class="brand" href="https://cybermaxtools.com/games/"><svg viewBox="0 0 512 512" aria-hidden="true"><clipPath id="lg"><rect width="512" height="512" rx="116"/></clipPath><g clip-path="url(#lg)"><rect width="512" height="512" fill="#FF6A3D"/><path d="M512 250V512H250Z" fill="#D9481F"/></g><g transform="translate(86 86) scale(3.4)"><path d="M66 27 A27 27 0 1 0 66 73" fill="none" stroke="#11141B" stroke-width="17" stroke-linecap="round"/><rect x="66" y="41" width="20" height="18" rx="4" fill="#11141B"/></g></svg>CyberMax</a><nav><a href="https://cybermaxtools.com/games/">Games</a></nav><button class="icon" id="theme" type="button" aria-label="Switch light or dark">◐</button></header><main><h1>Make your pet a holo trading card <span class="pro-badge">PASS</span></h1><p class="muted lede">Add a photo, type a name, roll for rarity. Stats and moves are made for your pet. Free HD download; your photo never leaves this device.</p><div class="maker"><section class="controls panel"><label class="photo"><input type="file" id="file" accept="image/*"><span class="btn">📷 Choose a photo</span></label>9 unmodified lines</section><section class="preview"><div class="tilt" id="tilt"><canvas id="card" width="750" height="1050" aria-label="Your pet's trading card"></canvas><div class="holo" id="holo"></div></div><div class="row share"><button class="btn" id="dl" type="button">⬇ Download HD card</button><button class="btn ghost" id="share" type="button">Share</button><a class="btn ghost sm" id="sx" target="_blank" rel="noopener">X</a><a class="btn ghost sm" id="sb" target="_blank" rel="noopener">Bluesky</a><a class="btn ghost sm" id="sw" target="_blank" rel="noopener">WhatsApp</a></div><div class="row"><button class="btn ghost sm" id="install" type="button" hidden>📲 Add to Home Screen</button><button class="btn pass sm" id="pass-btn" type="button">✨ Fun Pass</button></div></section></div><div class="nudge"><span>Want a Legendary every time? The <b>Fun Pass</b> lets you pick any frame, hides the CyberMax line and works in every CyberMax game.</span><button class="btn pass sm" data-pass="nudge" type="button">See the pass</button></div><section class="seo"><h2>How Pawfoil works</h2><p>Pick a photo of your dog, cat, bunny, bird or any pet. Pawfoil frames it as a collectible trading card with HP, six stats (Cuteness is always high), a type and two funny moves like <i>Sock Heist</i> or <i>3 AM Zoomies</i>. Each roll draws a rarity: Common, Rare, Epic (holo) or Legendary (gold holo). Roll again until you love it, then download the HD PNG or share it.</p><h3>Private: your photo stays on your device</h3><p>The card is drawn in your browser. Your photo is never uploaded, stored or seen by anyone but you. No account, no email.</p><h3>Free, with an optional Fun Pass</h3><p>Every card is free in full HD. The optional <b>CyberMax Fun Pass</b> ($2.99/month, $19/year, or $29.99 for life) lets you pick any frame (Legendary on demand), hides the small CyberMax line on the card, and unlocks extras in every CyberMax game.</p><h3>FAQ</h3><p><b>Can I print it?</b> Yes: the download is 750×1050 px, a standard 2.5×3.5 inch card at 300 dpi. <b>Why not an AI card generator?</b> Pawfoil uses your real photo (no strange AI faces), is instant, works offline and needs no sign-up. <b>Is it really free?</b> Yes, the HD download is free; the pass only adds extras.</p><h2>More free games from CyberMax</h2><div class="more"><a href="https://cybermaxtools.com/games/kenwren/"><b>Kenwren</b><span>How well do your friends know you?</span></a><a href="https://cybermaxtools.com/games/pathmoor/"><b>Pathmoor</b><span>Daily path puzzle</span></a><a href="https://cybermaxtools.com/games/whirlane/"><b>Whirlane</b><span>One-tap orbit dodger</span></a></div></section></main><footer>© 2026 CyberMax · <a href="https://cybermaxtools.com/games/">Games</a> · <a href="https://cybermaxtools.com/toys/">Toys</a> · <a href="https://cybermaxtools.com/store/">Store</a> · <a href="https://cybermaxtools.com/privacy">Privacy</a> · <a href="https://cybermaxtools.com/terms">Terms</a></footer></div><script type="module" src="game.js"></script><!-- cybermax-count:start --><script>(function(){try{var u="https://data.cybermaxtools.com/v?p="+encodeURIComponent(location.host+location.pathname)+"&r="+encodeURIComponent((document.referrer||"").split("/")[2]||"")+(function(){var q=new URLSearchParams(location.search),s=q.get("utm_source");return s?"&us="+encodeURIComponent(s)+"&uc="+encodeURIComponent(q.get("utm_campaign")||""):""})();navigator.sendBeacon?navigator.sendBeacon(u):(new Image).src=u}catch(e){}})()</script><!-- cybermax-count:end --></body></html>12345678910113 unmodified lines151617181920212223242526272829303132339 unmodified lines434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"><title>Pawfoil: Free Pet Trading Card Maker, Turn Your Pet Into a Holo Card</title><meta name="description" content="Make your pet a free holo trading card, then duel it up a ladder of 30 rival pets. Stats, moves, rarity rolls, daily rival. Photo stays on your phone."><link rel="canonical" href="https://cybermaxtools.com/games/pawfoil/"><meta property="og:type" content="website"><meta property="og:site_name" content="CyberMax"><meta property="og:title" content="Pawfoil: Free Pet Trading Card Maker"><meta property="og:description" content="Make your pet a free holo trading card, then duel it up a ladder of 30 rival pets. Stats, moves, rarity rolls, daily rival. Photo stays on your phone."><meta property="og:url" content="https://cybermaxtools.com/games/pawfoil/"><meta property="og:image" content="https://cybermaxtools.com/games/pawfoil/og.png"><meta property="og:image:width" content="1200"><meta property="og:image:height" content="630"><meta name="twitter:card" content="summary_large_image"><meta name="twitter:image" content="https://cybermaxtools.com/games/pawfoil/og.png">3 unmodified lines<meta name="apple-mobile-web-app-capable" content="yes"><meta name="apple-mobile-web-app-title" content="Pawfoil"><link rel="stylesheet" href="fun.css"><link rel="stylesheet" href="style.css"><script>try{var t=localStorage.getItem('cm-theme');if(t)document.documentElement.dataset.theme=t}catch(e){}</script><meta name="twitter:title" content="Pawfoil: Free Pet Trading Card Maker"><meta name="twitter:description" content="Make your pet a free holo trading card, then duel it up a ladder of 30 rival pets. Stats, moves, rarity rolls, daily rival. Photo stays on your phone."><style>.h1kw{display:block;font-size:.42em;font-weight:600;opacity:.75;letter-spacing:.01em;margin-top:.15em}.seo ol,.seo ul{padding-left:1.2em}.seo li{margin:.25em 0}</style><script type="application/ld+json">{"@context": "https://schema.org", "@graph": [{"@type": "VideoGame", "@id": "https://cybermaxtools.com/games/pawfoil/#game", "name": "Pawfoil", "alternateName": "Pet trading card maker free", "url": "https://cybermaxtools.com/games/pawfoil/", "image": "https://cybermaxtools.com/games/pawfoil/og.png", "description": "Pawfoil turns a photo of your dog, cat, bunny or any pet into a collectible holo trading card with HP, stats, a type and two funny moves. Roll for rarity, download the HD card or share it, then duel your card's stats against 30 rival pet cards and a daily rival. The card is drawn in your browser, so your photo never leaves your device.", "genre": ["Creative", "Card maker", "Pets"], "gamePlatform": ["Web browser", "Android", "iOS", "Windows", "macOS", "ChromeOS"], "applicationCategory": "Game", "operatingSystem": "Any (web browser)", "playMode": "SinglePlayer", "inLanguage": "en", "isAccessibleForFree": true, "offers": {"@type": "Offer", "price": "0", "priceCurrency": "USD"}, "author": {"@type": "Organization", "name": "CyberMax", "url": "https://cybermaxtools.com/"}, "publisher": {"@type": "Organization", "name": "CyberMax"}, "datePublished": "2026-10-02", "keywords": "Pet trading card maker free, free pet trading card maker, unblocked, no download, browser game", "trailer": {"@id": "https://cybermaxtools.com/games/pawfoil/#video"}}, {"@type": "FAQPage", "@id": "https://cybermaxtools.com/games/pawfoil/#faq", "mainEntity": [{"@type": "Question", "name": "Is Pawfoil free?", "acceptedAnswer": {"@type": "Answer", "text": "Yes: every HD card, the daily rival and duel levels 1-20 are free."}}, {"@type": "Question", "name": "Is my photo uploaded?", "acceptedAnswer": {"@type": "Answer", "text": "No, the card is drawn on your device."}}, {"@type": "Question", "name": "Do I need a photo to duel?", "acceptedAnswer": {"@type": "Answer", "text": "No, you can duel with the built-in sample pet."}}, {"@type": "Question", "name": "Can I print it?", "acceptedAnswer": {"@type": "Answer", "text": "Yes, 750×1050 px, a standard card at 300 dpi."}}, {"@type": "Question", "name": "Do I need an app?", "acceptedAnswer": {"@type": "Answer", "text": "No, it works in any browser."}}]}, {"@type": "VideoObject", "name": "Pawfoil demo: Make your pet a holo trading card", "description": "A 15-second screen recording of the live Pawfoil page: Add a pet photo (here: the built-in sample); Give it a name; Your holo card, made on your phone; Roll again for a new card. Real result, no voice.", "thumbnailUrl": ["https://cybermax.cybermax-tools.workers.dev/media/demos/pawfoil/poster.jpg"], "uploadDate": "2026-10-02T18:07:57+00:00", "duration": "PT15S", "contentUrl": "https://cybermax.cybermax-tools.workers.dev/media/demos/pawfoil/demo-16x9.mp4", "embedUrl": "https://cybermaxtools.com/games/pawfoil/", "inLanguage": "en", "publisher": {"@type": "Organization", "name": "CyberMax", "logo": {"@type": "ImageObject", "url": "https://cybermax.cybermax-tools.workers.dev/store/img/favicon.webp"}}, "@id": "https://cybermaxtools.com/games/pawfoil/#video"}]}</script></head><body><div class="wrap wide"><header class="top"><a class="brand" href="https://cybermaxtools.com/games/"><svg viewBox="0 0 512 512" aria-hidden="true"><clipPath id="lg"><rect width="512" height="512" rx="116"/></clipPath><g clip-path="url(#lg)"><rect width="512" height="512" fill="#FF6A3D"/><path d="M512 250V512H250Z" fill="#D9481F"/></g><g transform="translate(86 86) scale(3.4)"><path d="M66 27 A27 27 0 1 0 66 73" fill="none" stroke="#11141B" stroke-width="17" stroke-linecap="round"/><rect x="66" y="41" width="20" height="18" rx="4" fill="#11141B"/></g></svg>CyberMax</a><nav><a href="https://cybermaxtools.com/games/">Games</a></nav><button class="icon" id="theme" type="button" aria-label="Switch light or dark">◐</button></header><main><h1>Make your pet a holo trading card <span class="pro-badge">PASS</span> <small class="h1kw">Free pet trading card maker</small></h1><p class="muted lede">Add a photo, type a name, roll for rarity, then duel your card up a ladder of 30 rival pets. Free HD download; your photo never leaves this device.</p><div class="modes" role="tablist" aria-label="Mode"><button class="mode" id="tab-make" role="tab" type="button" aria-selected="true">🖼️ Make a card</button><button class="mode" id="tab-duel" role="tab" type="button" aria-selected="false">⚔️ Duel ladder</button></div><div id="mk"><div class="maker"><section class="controls panel"><label class="photo"><input type="file" id="file" accept="image/*"><span class="btn">📷 Choose a photo</span></label>9 unmodified lines</section><section class="preview"><div class="tilt" id="tilt"><canvas id="card" width="750" height="1050" aria-label="Your pet's trading card"></canvas><div class="holo" id="holo"></div></div><div class="row share"><button class="btn" id="dl" type="button">⬇ Download HD card</button><button class="btn ghost" id="share" type="button">Share</button><button class="btn" id="go-duel" type="button">⚔️ Duel with this card</button><a class="btn ghost sm" id="sx" target="_blank" rel="noopener">X</a><a class="btn ghost sm" id="sb" target="_blank" rel="noopener">Bluesky</a><a class="btn ghost sm" id="sw" target="_blank" rel="noopener">WhatsApp</a></div><div class="row"><button class="btn ghost sm" id="install" type="button" hidden>📲 Add to Home Screen</button><button class="btn pass sm" id="pass-btn" type="button">✨ Fun Pass</button></div></section></div><div class="nudge"><span>Want a Legendary every time? The <b>Fun Pass</b> lets you pick any frame, hides the CyberMax line, opens duel levels 21-30 and works in every CyberMax game.</span><button class="btn pass sm" data-pass="nudge" type="button">See the pass</button></div></div><section id="duel" class="duel" hidden aria-label="Duel ladder"><div class="dbar"><p class="goal" id="goal" aria-live="polite"></p><div class="dtools"><span class="badge" id="streak" title="Daily streak">🔥 0</span><button class="icon-btn" id="restart" type="button" aria-label="Restart duel (R)" title="Restart (R)" hidden>↻</button><button class="icon-btn" id="to-map" type="button" aria-label="Level map" title="Map">🗺️</button><button class="icon-btn" id="mute" type="button" aria-label="Mute sound" aria-pressed="false">🔊</button></div></div><div id="map" class="dmap"><div class="daily"><button class="daily-tile" id="daily-tile" type="button"></button><div class="past"><label class="small">Past daily # <input id="daily-num" type="number" min="1" inputmode="numeric"></label><button class="btn ghost sm" id="daily-past" type="button">Play (Fun Pass)</button></div></div><p class="muted small maprule">Each rival shows the cards it will play. Answer each with one of your six stats, once each. Higher number wins; ties go to the rival. Rival numbers are matched to your card, so every pet gets a fair climb. <span id="stars-total"></span></p><div id="levels"></div><p class="muted small">Levels 1-20 are free. Levels 21-30 come with the CyberMax Fun Pass; a level you reached stays open.</p></div><div id="arena" class="arena" hidden><div class="rival" id="rival"></div><p class="lbl">Rival plays, in order</p><div class="rounds" id="rounds"></div><p class="pending" id="pending" hidden></p><div class="me"><canvas id="me-art" width="240" height="160" aria-hidden="true"></canvas><div><b id="me-name"></b><span class="muted small" id="me-sub"></span><span class="small" id="score-now"></span></div></div><p class="lbl">Your stats: tap one</p><div class="stats" id="stats" role="group" aria-label="Your stats: tap one to play it"></div><button class="btn ghost sm move" id="move" type="button" aria-pressed="false" hidden></button><div class="hand" id="hand" hidden aria-hidden="true">👆</div></div><div id="result" class="result panel" hidden aria-live="polite"></div></section><section class="seo" id="guide"><h2>Pawfoil: pet trading card maker free</h2><p>Pawfoil turns a photo of your dog, cat, bunny or any pet into a collectible holo trading card with HP, stats, a type and two funny moves. Roll for rarity, download the HD card or share it, then duel your card's stats against 30 rival pet cards and a daily rival. The card is drawn in your browser, so your photo never leaves your device.</p><h2>How to play Pawfoil</h2><ol><li>Pick a photo of your pet (or use the sample pet).</li><li>Pawfoil frames it as a trading card with stats and moves.</li><li>Roll for rarity: Common, Rare, Epic holo or Legendary gold.</li><li>Download the HD PNG or share it.</li><li>Open the Duel ladder: answer each rival card with one of your six stats; higher number wins, ties go to the rival.</li></ol><h3>Controls</h3><p><b>Phone and tablet:</b> Pick a photo from your gallery, tilt your phone to see the holo effect.</p><p><b>Desktop, laptop and Chromebook:</b> Choose an image file and move the mouse over the card for the holo effect.</p><h2>Pawfoil tips and strategy</h2><ul><li>In a duel, beat each rival card with your smallest stat that still wins.</li><li>Throw your weakest stat at a rival card you can't beat.</li><li>Crown rounds are worth 2 points: save a big stat for them.</li><li>The 750×1050 download prints as a standard 2.5×3.5 inch card.</li></ul><h2>Game modes</h2><ul><li>Free HD cards.</li><li>Duel ladder: levels 1-20 free, a new twist every 5 levels, a boss every 10th, 1-3 stars.</li><li>Daily rival (free): the same rival for everyone each day, with a streak.</li><li>Fun Pass: duel levels 21-30, past daily rivals, pick any frame, Legendary on demand.</li></ul><p>Free to play with no ads and no sign-up. The optional <a href="https://cybermaxtools.com/games/#pass">CyberMax Fun Pass</a> ($2.99/month, $19/year or $29.99 for life) adds cosmetic extras and bonus modes in every CyberMax game.</p><h2>Pawfoil FAQ</h2><h3>Is Pawfoil free?</h3><p>Yes: every HD card, the daily rival and duel levels 1-20 are free.</p><h3>Is my photo uploaded?</h3><p>No, the card is drawn on your device.</p><h3>Do I need a photo to duel?</h3><p>No, you can duel with the built-in sample pet.</p><h3>Can I print it?</h3><p>Yes, 750×1050 px, a standard card at 300 dpi.</p><h3>Do I need an app?</h3><p>No, it works in any browser.</p><h2>Similar free games</h2><div class="more"><a href="https://cybermaxtools.com/games/kenwren/"><b>Kenwren</b><span>How well do your friends know you?</span></a><a href="https://cybermaxtools.com/games/brimbloom/"><b>Brimbloom</b><span>Stop the bloom on the brim</span></a><a href="https://cybermaxtools.com/games/latchkite/"><b>Latchkite</b><span>Let go at the right moment, catch the next peg</span></a><a href="https://cybermaxtools.com/games/"><b>All CyberMax games</b><span>Free browser games, no download</span></a></div></section></main><footer>© 2026 CyberMax · <a href="https://cybermaxtools.com/games/">Games</a> · <a href="https://cybermaxtools.com/toys/">Toys</a> · <a href="https://cybermaxtools.com/store/">Store</a> · <a href="https://cybermaxtools.com/privacy">Privacy</a> · <a href="https://cybermaxtools.com/terms">Terms</a></footer></div><canvas id="fx" aria-hidden="true"></canvas><script type="module" src="game.js"></script></body></html>
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312// Pawfoil Duel Ladder UI: map, duel table, result + share card, daily rival, streak, sounds and particles.// Uses the card from the maker (or the built-in sample pet). The photo is only copied canvas-to-canvas on this// device for the small card preview; it is never uploaded and never put in the share image. (c) 2026 CyberMax.import { LEVELS, FREE_LEVELS, TWISTS, buildDuel, newPlay, playRound, done, playScore, stars, dailySpec, cleanProgress, playable, lockReason, recordLevel, keepWithPass, totalStars, bumpStreak, currentStreak, parseLink, linkPath, grid, playValue } from './levels.js';import { FRAMES } from './core.js';import { count, store, toast, share, today, dayNumber, rr, canvasBlob } from './cmx.js';import * as pass from './funpass.js';
const GAME = 'pawfoil', PATH = '/games/pawfoil/';const $ = (id) => document.getElementById(id);const esc = (s) => String(s).replace(/[&<>"]/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"' }[c]));const reduced = () => matchMedia('(prefers-reduced-motion: reduce)').matches;let H = null; // hooks from game.js: getCard(), drawArt(canvas), ensurePet()let prog = cleanProgress(store('pawfoil:ladder'));let daily = store('pawfoil:daily') || {};let muted = !!store('pawfoil:mute');let cur = null; // { spec, duel, play, target, link, armed, day }let started = false;const TODAY = () => dayNumber(today());
// ------------------------------------------------------------------ sound (WebAudio synth, no files)let ac = null;function tone(f, t = 0.09, type = 'square', vol = 0.05, when = 0, slide = 0) { if (muted) return; try { ac = ac || new (window.AudioContext || window.webkitAudioContext)(); const o = ac.createOscillator(), g = ac.createGain(), s = ac.currentTime + when; o.type = type; o.frequency.setValueAtTime(f, s); if (slide) o.frequency.exponentialRampToValueAtTime(f * slide, s + t); g.gain.setValueAtTime(vol, s); g.gain.exponentialRampToValueAtTime(0.0001, s + t); o.connect(g).connect(ac.destination); o.start(s); o.stop(s + t + 0.03); } catch { /* no audio */ }}const sfx = { tap: () => tone(660, 0.04, 'triangle', 0.04), win: () => { tone(523, 0.08, 'square', 0.045); tone(784, 0.12, 'square', 0.045, 0.07); }, lose: () => tone(180, 0.22, 'sawtooth', 0.05, 0, 0.6), clear: (n) => [523, 659, 784, 1047].slice(0, 1 + n).forEach((f, i) => tone(f, 0.14, 'triangle', 0.06, i * 0.11)), fail: () => { tone(300, 0.15, 'sawtooth', 0.05); tone(200, 0.3, 'sawtooth', 0.05, 0.14, 0.7); },};
// ------------------------------------------------------------------ particles + shakeconst fx = $('fx'), fg = fx.getContext('2d');let parts = [], raf = 0;function burst(el, n = 18, colors = ['#FFB547', '#FF6A3D', '#5BA8E8', '#2FD3A0', '#E5C8FF']) { if (!el) return; const r = el.getBoundingClientRect(), x = r.left + r.width / 2, y = r.top + r.height / 2; for (let i = 0; i < n; i++) { const a = Math.random() * Math.PI * 2, s = 2 + Math.random() * 5; parts.push({ x, y, vx: Math.cos(a) * s, vy: Math.sin(a) * s - 2, life: 1, c: colors[i % colors.length], sz: 3 + Math.random() * 4 }); } if (!raf) raf = requestAnimationFrame(tick);}function tick() { const dpr = window.devicePixelRatio || 1; if (fx.width !== innerWidth * dpr) { fx.width = innerWidth * dpr; fx.height = innerHeight * dpr; } fg.setTransform(dpr, 0, 0, dpr, 0, 0); fg.clearRect(0, 0, innerWidth, innerHeight); parts = parts.filter((p) => (p.life -= 0.022) > 0); for (const p of parts) { p.x += p.vx; p.y += p.vy; p.vy += 0.18; fg.globalAlpha = p.life; fg.fillStyle = p.c; fg.fillRect(p.x, p.y, p.sz, p.sz); } fg.globalAlpha = 1; raf = parts.length ? requestAnimationFrame(tick) : 0;}function shake(el) { if (reduced() || !el) return; el.classList.remove('shake'); void el.offsetWidth; el.classList.add('shake');}
// ------------------------------------------------------------------ progressfunction save() { if (pass.isPro()) prog = keepWithPass(prog); store('pawfoil:ladder', prog); }const target = () => (cur && cur.target != null ? cur.target : null);
// ------------------------------------------------------------------ mapfunction showStreak() { const st = currentStreak(daily.streak, TODAY()); $('streak').textContent = `🔥 ${st}`; $('streak').title = `Daily streak: ${st} day${st === 1 ? '' : 's'} in a row`;}function renderMap() { const day = TODAY(), pro = pass.isPro(); showStreak(); $('daily-past').textContent = pro ? 'Play' : 'Play (Fun Pass)'; $('stars-total').textContent = `⭐ ${totalStars(prog)}/${LEVELS.length * 3}`; const dd = daily.res && daily.res.day === day ? daily.res : null; $('daily-tile').innerHTML = `<b>📅 Daily rival #${day}</b><span>${dd ? `Done: ${'★'.repeat(dd.stars)}${'☆'.repeat(3 - dd.stars)} · ${dd.score}. Play again for a better score.` : 'Same rival for everyone today. Keep your streak going.'}</span>`; const el = $('levels'); el.innerHTML = ''; for (const tw of TWISTS) { const h = document.createElement('div'); h.className = 'tier'; h.innerHTML = `<b>${tw.icon} ${esc(tw.name)}</b> <span>${esc(tw.rule)}</span>${tw.from > FREE_LEVELS ? ' <em>Fun Pass</em>' : ''}`; el.appendChild(h); const row = document.createElement('div'); row.className = 'lvrow'; for (const lv of LEVELS.filter((l) => l.twist === tw)) { const b = document.createElement('button'), why = lockReason(lv.n, prog, pro), s = prog.stars[lv.n] || 0; b.type = 'button'; b.className = `lv${lv.boss ? ' boss' : ''}${why ? ' locked' : ''}${s ? ' done' : ''}`; b.dataset.lv = lv.n; b.setAttribute('aria-label', `Level ${lv.n}${lv.boss ? ' boss' : ''}${why === 'pass' ? ', needs the Fun Pass' : why ? ', locked' : `, ${s} stars`}`); b.innerHTML = `<span class="em">${why === 'pass' ? '🔒' : lv.rival.emoji}</span><b>${lv.n}</b><small>${why ? (why === 'pass' ? 'Pass' : '·') : '★'.repeat(s) + '☆'.repeat(3 - s)}</small>`; b.onclick = () => (why === 'pass' ? pass.open(`level-${lv.n}`) : why ? toast(`Clear level ${lv.n - 1} first.`) : startLevel(lv.n)); row.appendChild(b); } el.appendChild(row); } const next = Math.min(prog.reached, LEVELS.length); $('goal').innerHTML = `🎯 Climb 30 rival cards. Levels 1-${FREE_LEVELS} free · next: <b>level ${next}</b>`; show('map');}function show(view) { $('map').hidden = view !== 'map'; $('arena').hidden = view !== 'arena'; $('result').hidden = view !== 'result'; $('restart').hidden = view === 'map'; }
// ------------------------------------------------------------------ duelasync function begin(spec, opts = {}) { await H.ensurePet(); const card = H.getCard(); cur = { spec, duel: buildDuel(spec, card), play: newPlay(), target: opts.target ?? null, link: !!opts.link, armed: false, day: opts.day || 0, card }; if (!started) { started = true; count(GAME, 'play', 'duel'); } renderArena(); if (innerWidth < 760) { const m = document.querySelector('.modes'); if (m && m.getBoundingClientRect().top !== 0) m.scrollIntoView({ block: 'start' }); } // whole duel on one phone screen}function startLevel(n, opts = {}) { if (!playable(n, prog, pass.isPro(), !!opts.link)) { if (lockReason(n, prog, pass.isPro()) === 'pass') pass.open(`level-${n}`); else toast(`Clear level ${n - 1} first.`); return; } if (n > FREE_LEVELS && pass.isPro()) { prog.kept = Math.max(prog.kept, n); save(); } return begin(LEVELS[n - 1], opts);}function startDaily(day = TODAY(), opts = {}) { if (day !== TODAY() && !opts.link && !pass.isPro()) { pass.open('archive'); return; } return begin(dailySpec(day), { ...opts, day });}function restart() { if (!cur) return; cur.play = newPlay(); cur.armed = false; sfx.tap(); renderArena(); }
function goalText(d) { const bits = [`🎯 Win <b>${d.need}</b> of ${d.max} point${d.max > 1 ? 's' : ''}`, 'ties go to the rival']; if (d.arena) bits.push(`🏟️ ${esc(d.arena[0])} +${d.arena[1]}`); if (d.boost) bits.push(`⚡ move +${d.boost} once`); if (d.comeback) bits.push(`🔥 lose → next +${d.comeback}`); if (d.rounds.some((r) => r.pts > 1)) bits.push('👑 = 2 points'); if (target() != null) bits.push(`<b class="beat">Beat ${target()}</b>`); return bits.join(' · ');}function renderArena() { const { duel: d, play: p, spec } = cur, R = spec.rival, F = FRAMES[R.rarity] || FRAMES.common; $('goal').innerHTML = goalText(d); const title = spec.daily ? `Daily rival #${cur.day}` : `Level ${d.n}${d.boss ? ' · Boss' : ''}`; $('rival').style.setProperty('--fa', F.a); $('rival').style.setProperty('--fb', F.b); $('rival').style.setProperty('--fi', F.ink); $('rival').innerHTML = `<div class="rv-em">${R.emoji}</div><div class="rv-tx"><small>${esc(title)} · ${spec.twist.icon} ${esc(spec.twist.name)}</small><b>${esc(R.name)}</b><span>${esc(R.type)}-type · ${esc(R.rarity)}</span></div>`; $('rounds').innerHTML = d.rounds.map((r, i) => { const res = p.log[i], now = i === p.ri; const val = r.fog && !res ? `${Math.floor(r.v / 10)}?` : r.v; return `<div class="rd${now ? ' now' : ''}${res ? (res.win ? ' won' : ' lost') : ''}${r.fog && !res ? ' fog' : ''}"><small>${r.pts > 1 ? '👑 ' : ''}${esc(r.stat)}</small><b>${val}</b>${res ? `<i>${res.win ? '✓' : '✗'} ${res.v}</i>` : '<i> </i>'}</div>`; }).join(''); $('score-now').textContent = `${p.points} pt${p.points === 1 ? '' : 's'} · ${playScore(p)}`; const c = cur.card; $('me-name').textContent = c.name; $('me-sub').textContent = `${c.type}-type ${c.kindLabel} · ${c.rarityLabel}`; H.drawArt($('me-art')); const sb = $('stats'); sb.innerHTML = ''; d.mine.forEach((v, i) => { const b = document.createElement('button'), used = p.used.includes(i), eff = playValue(d, i, cur.armed, p.pending), plus = eff - v; b.type = 'button'; b.className = `st${used ? ' used' : ''}${d.arena && d.names[i] === d.arena[0] ? ' home' : ''}`; b.disabled = used || done(d, p); b.dataset.i = i; const res = p.log.find((r) => r.stat === i); b.innerHTML = `<small>${esc(d.names[i])}${d.arena && d.names[i] === d.arena[0] ? ' 🏟️' : ''}</small><b>${used ? res.v : eff}</b>${!used && plus ? `<em>+${plus}</em>` : ''}${used ? `<i>${res.win ? '✓' : '✗'}</i>` : ''}<kbd>${i + 1}</kbd>`; b.onclick = () => pick(i); sb.appendChild(b); }); const mv = $('move'); mv.hidden = !d.boost; if (d.boost) { mv.disabled = p.boostUsed || done(d, p); mv.setAttribute('aria-pressed', String(cur.armed)); mv.innerHTML = `⚡ ${esc(c.moves[0].name)} <b>+${d.boost}</b>${p.boostUsed ? ' (used)' : cur.armed ? ' (armed: tap a stat)' : ''}`; } $('pending').hidden = !p.pending; $('pending').textContent = p.pending ? `🔥 Underdog: +${p.pending} on your next stat` : ''; show('arena'); hint();}function hint() { const h = $('hand'); const tut = cur && !cur.spec.daily && cur.duel.n === 1 && !prog.stars[1] && cur.play.ri < 3; if (!tut) { h.hidden = true; return; } // point at the smallest stat that wins this round (the move the tutorial teaches), else the lowest one const { duel: d, play: p } = cur, rv = d.rounds[p.ri].v; const free = d.mine.map((v, i) => i).filter((i) => !p.used.includes(i)).sort((a, b) => d.mine[a] - d.mine[b]); const i = free.find((k) => playValue(d, k, false, p.pending) > rv) ?? free[0]; const btn = document.querySelector(`#stats .st[data-i="${i}"]`), box = $('arena').getBoundingClientRect(), r = btn.getBoundingClientRect(); h.style.left = `${r.left - box.left + r.width / 2 - 18}px`; h.style.top = `${r.top - box.top + r.height * 0.55}px`; h.hidden = false;}function pick(i) { const { duel: d, play: p } = cur; const res = playRound(d, p, i, cur.armed); if (!res) return; cur.armed = false; renderArena(); const tile = document.querySelectorAll('#rounds .rd')[res.round]; if (res.win) { sfx.win(); burst(tile, res.pts > 1 ? 30 : 16); } else { sfx.lose(); shake($('arena')); } if (navigator.vibrate) try { navigator.vibrate(res.win ? 8 : [30, 30, 30]); } catch { /* */ } if (done(d, p)) setTimeout(finish, 380);}$('move').onclick = () => { if (!cur || cur.play.boostUsed) return; cur.armed = !cur.armed; sfx.tap(); renderArena(); };
// ------------------------------------------------------------------ resultfunction finish() { const { duel: d, play: p, spec } = cur, sc = playScore(p), st = stars(p.points, d); let line = ''; if (spec.daily) { if (cur.day === TODAY()) { daily.streak = bumpStreak(daily.streak, cur.day); const prev = daily.res && daily.res.day === cur.day ? daily.res : null; if (!prev || sc > prev.score) daily.res = { day: cur.day, score: sc, stars: st, grid: grid(p) }; store('pawfoil:daily', daily); showStreak(); } count(GAME, 'win', 'daily'); } else { const before = prog.reached; prog = recordLevel(prog, d.n, st, sc, pass.isPro()); save(); if (st) count(GAME, 'win', `level-${d.n}`); if (prog.reached > before && d.n === FREE_LEVELS) line = 'You cleared every free level! Levels 21-30 come with the Fun Pass.'; } const beat = target() != null ? (sc > target() ? `<p class="beat ok">You beat ${target()}! 🎉</p>` : `<p class="beat">Target was ${target()}. ${target() - sc + 1} more to beat it.</p>`) : ''; const nextN = d.n + 1, nextOk = !spec.daily && st > 0 && nextN <= LEVELS.length; const nextWhy = nextOk ? lockReason(nextN, prog, pass.isPro()) : null; $('result').innerHTML = `<div class="res-stars">${[0, 1, 2].map((k) => `<span class="${k < st ? 'on' : ''}">★</span>`).join('')}</div> <h3>${st ? (st === 3 ? 'Perfect duel!' : 'Duel won!') : 'Not this time'}</h3> <p class="res-grid">${grid(p)}</p> <p><b>${p.points}/${d.max}</b> points (needed ${d.need}, best possible ${d.opt}) · score <b>${sc}</b></p>${beat}${line ? `<p>${esc(line)}</p>` : ''} <div class="row res-btns">${nextOk ? `<button class="btn" id="r-next" type="button">${nextWhy === 'pass' ? '🔒 Level ' + nextN + ': Fun Pass' : '▶ Next: level ' + nextN}</button>` : ''} <button class="btn${nextOk ? ' ghost' : ''}" id="r-retry" type="button">↻ Retry</button><button class="btn ghost" id="r-share" type="button">Share result</button><button class="btn ghost" id="r-map" type="button">🗺 Map</button></div>`; show('result'); if (st) { sfx.clear(st); burst($('result').querySelector('.res-stars'), 40); } else { sfx.fail(); shake($('result')); } if ($('r-next')) $('r-next').onclick = () => (nextWhy === 'pass' ? pass.open(`level-${nextN}`) : startLevel(nextN)); $('r-retry').onclick = () => { restart(); }; $('r-map').onclick = renderMap; $('r-share').onclick = () => shareResult(); if (st && (spec.daily || d.n >= 5)) pass.afterWin($('result'), spec.daily ? 'daily' : `level-${d.n}`); // not on the first tutorial levels}
export function shareText(c = cur) { const { duel: d, play: p, spec } = c, st = stars(p.points, d), sc = playScore(p); const head = spec.daily ? `Pawfoil Daily #${c.day}` : `Pawfoil Duel · Level ${d.n}`; const streak = spec.daily ? currentStreak(daily.streak, TODAY()) : 0; return { text: `${head} ${'⭐'.repeat(st)}${'☆'.repeat(3 - st)}\n${c.card.name} vs ${spec.rival.name}: ${grid(p)} ${p.points}/${d.max} · ${sc}${streak ? `\n🔥 ${streak}-day streak` : ''}\nBeat my score:`, path: linkPath(PATH, spec.daily ? { seed: c.day, score: sc } : { lvl: d.n, score: sc }) };}async function shareResult() { const { text, path } = shareText(); const blob = await canvasBlob(scoreCard()); await share(GAME, text, path, blob, 'pawfoil-duel.png'); count(GAME, 'share', cur.spec.daily ? 'daily' : 'duel');}/** 1080x1080 result card: no photo (it stays on your device), just names, emoji, grid and score. */function scoreCard() { const c = document.createElement('canvas'); c.width = 1080; c.height = 1080; const g = c.getContext('2d'), { duel: d, play: p, spec } = cur, st = stars(p.points, d), F = FRAMES[cur.card.rarity] || FRAMES.common; const bg = g.createLinearGradient(0, 0, 1080, 1080); bg.addColorStop(0, '#1B1430'); bg.addColorStop(1, '#3A1F5C'); g.fillStyle = bg; g.fillRect(0, 0, 1080, 1080); g.textAlign = 'center'; g.fillStyle = '#FFE9A8'; g.font = '900 64px system-ui, sans-serif'; g.fillText(spec.daily ? `Daily rival #${cur.day}` : `Duel ladder · level ${d.n}`, 540, 120); const card = (x, em, name, sub, col) => { g.fillStyle = col.a; rr(g, x, 190, 400, 440, 30); g.fill(); g.fillStyle = 'rgba(255,255,255,.5)'; rr(g, x + 16, 206, 368, 408, 22); g.fill(); g.font = '170px system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif'; g.fillStyle = '#000'; g.fillText(em, x + 200, 420); g.fillStyle = col.ink; g.font = '900 44px system-ui, sans-serif'; g.fillText(name.slice(0, 14), x + 200, 520); g.font = '700 28px system-ui, sans-serif'; g.fillText(sub, x + 200, 570); }; card(90, cur.card.emoji, cur.card.name, `${cur.card.rarityLabel} ${cur.card.kindLabel}`, F); card(590, spec.rival.emoji, spec.rival.name, `${spec.rival.type}-type`, FRAMES[spec.rival.rarity] || FRAMES.common); g.fillStyle = '#fff'; g.font = '900 60px system-ui, sans-serif'; g.fillText('VS', 540, 430); p.log.forEach((r, i) => { const n = p.log.length, x = 540 - (n * 110 - 20) / 2 + i * 110; g.fillStyle = r.win ? (r.pts > 1 ? '#FFB547' : '#2FD3A0') : '#FF5C5C'; rr(g, x, 680, 90, 90, 18); g.fill(); }); g.fillStyle = '#FFE9A8'; g.font = '900 90px system-ui, sans-serif'; g.fillText('★'.repeat(st) + '☆'.repeat(3 - st), 540, 890); g.fillStyle = '#fff'; g.font = '800 46px system-ui, sans-serif'; g.fillText(`${p.points}/${d.max} points · score ${playScore(p)}`, 540, 960); g.font = '600 30px system-ui, sans-serif'; g.globalAlpha = 0.8; g.fillText('Beat it: cybermaxtools.com/games/pawfoil', 540, 1030); g.globalAlpha = 1; return c;}
// ------------------------------------------------------------------ setupfunction setMute() { $('mute').textContent = muted ? '🔇' : '🔊'; $('mute').setAttribute('aria-pressed', String(muted)); }export function openDuel() { tab('duel'); if (!cur || $('map').hidden === false) renderMap(); }function tab(which) { const duel = which === 'duel'; $('duel').hidden = !duel; $('mk').hidden = duel; $('tab-duel').setAttribute('aria-selected', String(duel)); $('tab-make').setAttribute('aria-selected', String(!duel)); store('pawfoil:tab', which);}
export function initLadder(hooks) { H = hooks; showStreak(); setMute(); $('mute').onclick = () => { muted = !muted; store('pawfoil:mute', muted); setMute(); sfx.tap(); }; $('restart').onclick = restart; $('to-map').onclick = renderMap; $('tab-duel').onclick = () => { tab('duel'); renderMap(); }; $('tab-make').onclick = () => tab('make'); $('daily-tile').onclick = () => startDaily(); $('daily-past').onclick = () => { const n = Number($('daily-num').value); if (!Number.isInteger(n) || n < 1 || n > TODAY()) { toast(`Pick a daily from 1 to ${TODAY()}.`); return; } startDaily(n); }; $('daily-num').max = String(TODAY()); $('daily-num').value = String(Math.max(1, TODAY() - 1)); document.addEventListener('keydown', (e) => { if ($('duel').hidden || e.target.closest('input,textarea') || e.metaKey || e.ctrlKey || e.altKey) return; if (/^[1-6]$/.test(e.key) && !$('arena').hidden) { e.preventDefault(); pick(Number(e.key) - 1); } else if ((e.key === 'r' || e.key === 'R') && cur) { e.preventDefault(); restart(); } else if ((e.key === 'm' || e.key === 'M') && cur && cur.duel.boost) $('move').click(); }); addEventListener('resize', () => { if (cur && !$('arena').hidden) hint(); }); pass.onChange((pro) => { if (pro) { prog = keepWithPass(prog); store('pawfoil:ladder', prog); } if (!$('duel').hidden && !$('map').hidden) renderMap(); }); // beat-my-score links: ?lvl=<n>&score=<n> or ?seed=<daily #>&score=<n> const L = parseLink(location.search, TODAY() + 1); if (L.lvl || L.seed) { tab('duel'); if (L.lvl) { if (playable(L.lvl, prog, pass.isPro(), true)) startLevel(L.lvl, { target: L.score, link: true }); else { renderMap(); pass.open(`link-level-${L.lvl}`); } } else startDaily(L.seed, { target: L.score, link: true }); if (L.score != null) toast(`A friend scored ${L.score}. Beat it!`, 3000); } else if (store('pawfoil:tab') === 'duel') { tab('duel'); renderMap(); }}
// test/screenshot hooks (no effect on normal play)window.__pawDuel = { get cur() { return cur; }, get prog() { return prog; }, shareText: () => shareText(), scoreCard: () => scoreCard().toDataURL(), pick, restart, renderMap, startLevel, startDaily };123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238// Pawfoil Duel Ladder: pure game logic (no DOM). Your pet card's six stats duel a ladder of 30 hand-made rival cards.// Each duel: the rival shows the 5 (boss: 6) stat cards it will play, in order. You answer each with one of your own// stats (each once). Higher number wins the round; ties go to the rival. Plan the match-ups, sacrifice your weakest stat// on rounds you can't win. Rival numbers are set relative to YOUR card's stats (by rank), so every pet, Common or// Legendary, gets the same fair puzzle. A new twist every 5 levels, a boss every 10th. (c) 2026 CyberMax.import { rng, hash } from './cmx.js';
export const FREE_LEVELS = 20;export const STAT_NAMES = ['Cuteness', 'Chaos', 'Snack drive', 'Nap power', 'Zoomies', 'Loyalty']; // same as core.js STATS
// Twists: one new rule every 5 levels (shown on the map and in the goal line).export const TWISTS = [ { from: 1, id: 'basics', name: 'First duels', icon: '🃏', rule: 'Win rounds with a higher number. Ties go to the rival.' }, { from: 6, id: 'arena', name: 'Home turf', icon: '🏟️', rule: 'One stat gets a home-turf bonus.' }, { from: 11, id: 'fog', name: 'Fog', icon: '🌫️', rule: 'Some rival cards are face down: you only see the tens digit.' }, { from: 16, id: 'boost', name: 'Power move', icon: '⚡', rule: 'Once per duel, your move adds a bonus to one stat.' }, { from: 21, id: 'crown', name: 'Crown rounds', icon: '👑', rule: 'Crown rounds are worth 2 points.' }, { from: 26, id: 'comeback', name: 'Underdog', icon: '🔥', rule: 'Lose a round and your next stat gets a bonus.' },];export const twistOf = (n) => [...TWISTS].reverse().find((t) => n >= t.from) || TWISTS[0];
// 30 rival cards (original characters). Bosses (10, 20, 30) are every pet's nemeses.export const RIVALS = [ ['Pip', '🐹', 'Snack', 'common'], ['Noodle', '🌭', 'Zoomies', 'common'], ['Miso', '🐱', 'Nap', 'common'], ['Clover', '🐰', 'Hop', 'common'], ['Kiwi', '🐦', 'Song', 'common'], ['Duchess Fluff', '🐈', 'Royal', 'rare'], ['Turbo', '🐕', 'Zoomies', 'rare'], ['Pickles', '🐹', 'Snack', 'rare'], ['Captain Whiskers', '😼', 'Chaos', 'rare'], ['The Vacuum', '🌀', 'Boss', 'legendary'], ['Shadow', '🐈⬛', 'Shadow', 'rare'], ['Mochi', '🐕', 'Loyal', 'rare'], ['Pepper', '🦜', 'Chaos', 'rare'], ['Gizmo', '🦎', 'Mystery', 'rare'], ['Waffles', '🐶', 'Snack', 'epic'], ['Biscotti', '🐶', 'Nap', 'epic'], ['Sir Hops-a-Lot', '🐰', 'Royal', 'epic'], ['Luna', '🐺', 'Shadow', 'epic'], ['Mango', '🐤', 'Sky', 'epic'], ['Bath Time', '🛁', 'Boss', 'legendary'], ['Tofu', '🐢', 'Nap', 'epic'], ['Ziggy', '🦔', 'Chaos', 'epic'], ['Princess Purrsia', '🐈', 'Royal', 'epic'], ['Rocket', '🐕', 'Zoomies', 'epic'], ['Bubbles', '🐠', 'Mystery', 'epic'], ['Nugget', '🐥', 'Fluff', 'legendary'], ['Professor Hoot', '🦉', 'Sky', 'legendary'], ['Thunder Paws', '🐕🦺', 'Loyal', 'legendary'], ['Empress Meowgaret', '🐈', 'Royal', 'legendary'], ['The Vet', '🩺', 'Boss', 'legendary'],].map(([name, emoji, type, rarity]) => ({ name, emoji, type, rarity }));
// Hand-tuned level table. A round is [rank, delta, flags]: the rival plays (your rank-th best stat + delta).// rank 0 = your highest stat, 5 = your lowest. flags: f = face down (fog), 2 = crown round (2 points).// need = points to clear (1 star); 3 stars = the best possible result for your card (found by solve()).const L = (rounds, need, o = {}) => ({ rounds, need, ...o });export const LEVELS = [ // 1-5 First duels: see every rival card, match them up. L([[5, -3], [4, -3], [3, -3], [2, -3], [0, 6]], 2), L([[0, 4], [3, -2], [1, -2], [4, -2], [2, -2]], 2), L([[1, -1], [0, -1], [2, -1], [3, -1], [4, -1]], 3), L([[2, 1], [0, -2], [4, 1], [1, -2], [5, 0]], 2), L([[3, 2], [1, 1], [0, 8], [2, 1], [4, 1]], 2), // 6-10 Home turf: one stat gets a bonus. 10 = boss (6 rounds, no spare stat). L([[0, 5], [2, -1], [3, -1], [4, -1], [1, -1]], 3, { arena: ['Zoomies', 15] }), L([[0, 3], [0, -3], [1, 2], [3, 0], [5, 0]], 2, { arena: ['Nap power', 15] }), L([[1, 3], [2, 3], [3, 3], [4, 3], [0, 10]], 2, { arena: ['Snack drive', 12] }), L([[0, 12], [1, 1], [2, 1], [3, 1], [5, -5]], 3, { arena: ['Chaos', 15] }), L([[0, -1], [1, -1], [2, 1], [3, 1], [4, 1], [5, 1]], 4, { arena: ['Loyalty', 10], boss: true }), // 11-15 Fog: some rival cards are face down. L([[3, -2, 'f'], [1, -2], [0, 6], [2, -2, 'f'], [4, -2]], 3), L([[0, -1, 'f'], [2, 2], [1, -1], [4, 2, 'f'], [5, -1]], 3), L([[2, 1, 'f'], [1, 1, 'f'], [3, 1], [0, 9], [4, 1, 'f']], 3), L([[0, 0, 'f'], [1, 0, 'f'], [2, 0, 'f'], [3, 0], [4, 0]], 3), L([[0, 4, 'f'], [1, 3], [2, 3, 'f'], [3, 3], [4, 3, 'f']], 3, { arena: ['Cuteness', 10] }), // 16-20 Power move: once per duel, your card's move adds a bonus. L([[0, 8], [1, -1], [2, -1], [3, -1], [4, -1]], 4, { boost: 15 }), L([[0, 10], [0, 6], [1, -1], [2, -1], [3, -1]], 3, { boost: 12 }), L([[1, 4], [0, 12], [2, 4], [3, 4], [5, 4]], 3, { boost: 20 }), L([[0, 3, 'f'], [0, -2], [2, 5, 'f'], [3, 2], [4, 2]], 3, { boost: 15 }), L([[0, 6], [1, 2], [2, 2], [0, -3], [3, 2], [4, 2]], 4, { boost: 15, arena: ['Nap power', 10], boss: true }), // 21-25 Crown rounds: worth 2 points. L([[0, -4], [1, -1], [2, -1], [3, -1], [0, -2, '2']], 4), L([[1, -2], [0, 7, '2'], [2, -1], [0, -2], [3, -1]], 4, { boost: 10 }), L([[1, -1, 'f'], [2, -1], [0, -1], [3, -1], [1, -1, '2f']], 4), L([[0, 8, '2'], [0, 0], [1, 0, '2'], [2, 0], [3, 0]], 4, { boost: 10 }), L([[0, -1], [1, -1], [2, -1], [3, -1], [0, -3, '2']], 4), // 26-30 Underdog: losing a round powers up your next stat. 30 = final boss with every twist. L([[3, -2], [0, 6], [1, -1], [2, -1], [4, -1]], 3, { comeback: 12 }), L([[4, -3], [3, -2], [0, 9, '2'], [1, -1], [2, -1]], 4, { comeback: 12 }), L([[1, -2, 'f'], [0, 8], [2, -1], [0, 7, 'f'], [3, -1]], 3, { comeback: 10, arena: ['Zoomies', 10] }), L([[2, -2], [0, 12], [1, 5, '2'], [3, -1], [0, -1]], 4, { comeback: 8, boost: 10 }), L([[0, 10], [0, 3, '2'], [1, 4, 'f'], [2, 4], [0, -2, 'f'], [3, 4, '2']], 5, { comeback: 10, boost: 12, arena: ['Cuteness', 8], boss: true }),].map((lv, i) => ({ ...lv, n: i + 1, rival: RIVALS[i], twist: twistOf(i + 1) }));
/** Your six stats sorted high to low (ties keep card order). */export function ranked(card) { return card.stats.map((st, i) => ({ s: st.s, v: st.v, i })).sort((a, b) => b.v - a.v || a.i - b.i);}
/** Build a concrete duel for a level (or daily spec) and a card: rival numbers, flags, need and the best result. */export function buildDuel(spec, card) { const r = ranked(card); const rounds = spec.rounds.map(([k, d, f = ''], i) => ({ v: Math.max(1, r[Math.max(0, Math.min(5, k))].v + d), fog: f.includes('f'), pts: f.includes('2') ? 2 : 1, stat: STAT_NAMES[(i + (spec.n || 0)) % 6], })); const duel = { n: spec.n || 0, rival: spec.rival, twist: spec.twist, rounds, arena: spec.arena || null, boost: spec.boost || 0, comeback: spec.comeback || 0, boss: !!spec.boss, mine: card.stats.map((st) => st.v), names: card.stats.map((st) => st.s) }; const best = solve(duel); duel.max = rounds.reduce((a, b) => a + b.pts, 0); duel.opt = best.points; duel.optScore = best.score; duel.need = Math.max(1, Math.min(spec.need, best.points)); return duel;}
/** Value of playing stat i (with optional power move) given the current bonus state. */export function playValue(duel, i, useBoost, pending = 0) { let v = duel.mine[i]; if (duel.arena && duel.names[i] === duel.arena[0]) v += duel.arena[1]; if (useBoost) v += duel.boost; return v + pending;}
/** Best possible (points, then score) for a duel: exhaustive search, at most 6! x boost choices. */export function solve(duel) { const R = duel.rounds.length, n = duel.mine.length; let best = { points: -1, score: -1 }; const go = (ri, used, boostLeft, pending, pts, margin) => { if (ri === R) { const sc = score(pts, margin); if (pts > best.points || (pts === best.points && sc > best.score)) best = { points: pts, score: sc }; return; } const rv = duel.rounds[ri]; for (let i = 0; i < n; i++) { if (used & (1 << i)) continue; for (const b of boostLeft ? [false, true] : [false]) { const v = playValue(duel, i, b, pending), win = v > rv.v; go(ri + 1, used | (1 << i), boostLeft && !b, !win && duel.comeback ? duel.comeback : 0, pts + (win ? rv.pts : 0), margin + (win ? v - rv.v : 0)); } } }; go(0, 0, !!duel.boost, 0, 0, 0); return best;}
/** Score = 100 per point + the total winning margin (a tie-breaker that rewards strong wins). */export const score = (points, margin) => points * 100 + margin;
/** Fresh play state for a duel. */export const newPlay = () => ({ ri: 0, used: [], boostUsed: false, pending: 0, points: 0, margin: 0, log: [] });
/** Play stat i in the current round. Returns the round result; mutates play. */export function playRound(duel, play, i, useBoost = false) { if (play.ri >= duel.rounds.length || play.used.includes(i) || i < 0 || i >= duel.mine.length) return null; const b = !!(useBoost && duel.boost && !play.boostUsed); const rv = duel.rounds[play.ri], v = playValue(duel, i, b, play.pending), win = v > rv.v; const res = { round: play.ri, stat: i, v, rival: rv.v, win, tie: v === rv.v, pts: win ? rv.pts : 0, boost: b, bonus: play.pending }; play.used.push(i); play.ri++; if (b) play.boostUsed = true; play.pending = !win && duel.comeback ? duel.comeback : 0; if (win) { play.points += rv.pts; play.margin += v - rv.v; } play.log.push(res); return res;}export const done = (duel, play) => play.ri >= duel.rounds.length;export const playScore = (play) => score(play.points, play.margin);
/** 0-3 stars: 1 = cleared (need), 2 = cleared and at most one point short of the best, 3 = the best possible for your card. */export function stars(points, duel) { if (points < duel.need) return 0; if (points >= duel.opt) return 3; return points >= duel.opt - 1 ? 2 : 1;}
// ------------------------------------------------------------------ daily rival/** The daily duel for puzzle number `day` (same rival and rounds for everyone that day). */export function dailySpec(day) { const r = rng(hash(`pawfoil-daily:${day}`)); const rival = RIVALS[Math.floor(r() * RIVALS.length)]; const kinds = ['basics', 'arena', 'fog', 'boost', 'crown', 'comeback']; const tw = kinds[Math.floor(r() * kinds.length)]; const rounds = []; for (let i = 0; i < 5; i++) { const k = Math.floor(r() * 5); const d = -4 + Math.floor(r() * 10) + (k === 0 && r() < 0.5 ? 6 : 0); rounds.push([k, d, tw === 'fog' && r() < 0.5 ? 'f' : tw === 'crown' && i === 4 - Math.floor(r() * 2) ? '2' : '']); } const o = {}; if (tw === 'arena') o.arena = [STAT_NAMES[1 + Math.floor(r() * 5)], 10 + Math.floor(r() * 3) * 2]; if (tw === 'boost') o.boost = 10 + Math.floor(r() * 3) * 5; if (tw === 'comeback') o.comeback = 8 + Math.floor(r() * 3) * 2; return { n: 0, day, rounds, need: 3, rival, twist: TWISTS.find((t) => t.id === tw), daily: true, ...o };}
// ------------------------------------------------------------------ progression (saved by the UI with store())export const newProgress = () => ({ reached: 1, kept: 0, stars: {}, best: {} });export function cleanProgress(p) { const o = newProgress(); if (!p || typeof p !== 'object') return o; const int = (x, lo, hi) => (Number.isInteger(x) && x >= lo && x <= hi ? x : null); o.reached = int(p.reached, 1, LEVELS.length + 1) || 1; o.kept = int(p.kept, 0, LEVELS.length + 1) || 0; for (const [k, v] of Object.entries(p.stars || {})) if (int(+k, 1, LEVELS.length) && int(v, 0, 3) !== null) o.stars[+k] = v; for (const [k, v] of Object.entries(p.best || {})) if (int(+k, 1, LEVELS.length) && int(v, 0, 9999) !== null) o.best[+k] = v; return o;}/** Can level n be played? Free: 1-20 once reached (or opened from a friend's link). 21+: Fun Pass, or already reached * while the pass was on (never taken away). */export function playable(n, prog, pro, viaLink = false) { if (!Number.isInteger(n) || n < 1 || n > LEVELS.length) return false; if (n > FREE_LEVELS && !pro && n > prog.kept) return false; return n <= prog.reached || (viaLink && n <= FREE_LEVELS) || (viaLink && pro);}/** Why a level is closed: 'pass' (needs the Fun Pass) or 'order' (clear the one before first). */export const lockReason = (n, prog, pro) => (playable(n, prog, pro) ? null : n > FREE_LEVELS && !pro && n > prog.kept ? 'pass' : 'order');/** Record a finished level; returns the updated progress (never lowers stars, best or reached). */export function recordLevel(prog, n, st, sc, pro) { const p = cleanProgress(prog); if (st > (p.stars[n] || 0)) p.stars[n] = st; if (sc > (p.best[n] || 0)) p.best[n] = Math.min(9999, sc); if (st > 0) p.reached = Math.max(p.reached, Math.min(LEVELS.length + 1, n + 1)); if (pro) p.kept = Math.max(p.kept, p.reached); return p;}/** Keep levels reached while the pass is on (called whenever the pass is on). */export function keepWithPass(prog) { const p = cleanProgress(prog); p.kept = Math.max(p.kept, p.reached); return p; }export const totalStars = (prog) => Object.values(prog.stars).reduce((a, b) => a + b, 0);
// ------------------------------------------------------------------ streak (consecutive days the daily was finished)export function bumpStreak(st, day) { const s = st && Number.isInteger(st.last) ? { last: st.last, streak: Number.isInteger(st.streak) ? st.streak : 0, best: Number.isInteger(st.best) ? st.best : 0 } : { last: 0, streak: 0, best: 0 }; if (s.last === day) return s; s.streak = s.last === day - 1 ? s.streak + 1 : 1; s.last = day; s.best = Math.max(s.best, s.streak); return s;}export const currentStreak = (st, day) => (st && Number.isInteger(st.last) && Number.isInteger(st.streak) && st.last >= day - 1 ? st.streak : 0);
// ------------------------------------------------------------------ "beat my score" links/** Parse ?seed=<daily #>&score=<n>&lvl=<level>. Anything malformed or out of range is ignored. */export function parseLink(search, maxDay = 100000) { let q; try { q = new URLSearchParams(search || ''); } catch { return {}; } const int = (k, lo, hi) => { const s = q.get(k); if (s == null || !/^\d{1,6}$/.test(s)) return null; const v = Number(s); return v >= lo && v <= hi ? v : null; }; const out = {}; const lvl = int('lvl', 1, LEVELS.length), seed = int('seed', 1, maxDay), sc = int('score', 0, 9999); if (lvl) out.lvl = lvl; else if (seed) out.seed = seed; if (sc !== null && (out.lvl || out.seed)) out.score = sc; return out;}/** Path (with query) for a beat-my-score link. */export function linkPath(base, { lvl, seed, score: sc }) { const q = new URLSearchParams(); if (lvl) q.set('lvl', String(lvl)); else if (seed) q.set('seed', String(seed)); if (Number.isInteger(sc)) q.set('score', String(sc)); return `${base}?${q}`;}/** Emoji result grid: 🟩 won, 🟨 won a crown round, 🟥 lost. */export function grid(play) { return play.log.map((r) => (r.win ? (r.pts > 1 ? '🟨' : '🟩') : '🟥')).join('');}15 unmodified lines16171815 unmodified lines.tilt.foil .holo{opacity:.55}.share{justify-content:center}.controls .chips{flex-wrap:wrap!important;overflow:visible!important;margin:0!important;padding:0!important}15 unmodified lines1617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787915 unmodified lines.tilt.foil .holo{opacity:.55}.share{justify-content:center}.controls .chips{flex-wrap:wrap!important;overflow:visible!important;margin:0!important;padding:0!important}/* Duel ladder */.modes{display:flex;gap:6px;margin:0 0 14px;background:var(--chip);padding:4px;border-radius:14px;width:max-content;max-width:100%}.mode{border:0;background:none;color:var(--ink);font:inherit;font-weight:800;font-size:15px;padding:10px 16px;border-radius:11px;cursor:pointer;min-height:44px}.mode[aria-selected=true]{background:var(--card);box-shadow:var(--shadow)}.duel{max-width:620px;margin:0 auto}.dbar{display:flex;gap:8px;align-items:flex-start;justify-content:space-between;margin-bottom:10px}.goal{margin:0;font-size:15px;line-height:1.4;padding:8px 12px;border-radius:12px;background:var(--card);border:1px solid var(--line);flex:1}.goal .beat{color:var(--acc)}.dtools{display:flex;gap:4px;align-items:center;flex:0 0 auto}.icon-btn{min-width:44px;min-height:44px;border-radius:12px;border:1.5px solid var(--line);background:var(--card);color:var(--ink);font-size:20px;cursor:pointer}.badge{font-weight:800;font-size:15px;padding:0 6px;white-space:nowrap}.daily{display:flex;flex-direction:column;gap:6px;margin-bottom:10px}.daily-tile{display:flex;flex-direction:column;gap:2px;text-align:left;width:100%;padding:14px 16px;border-radius:16px;border:0;cursor:pointer;font:inherit;color:#11141B;background:linear-gradient(135deg,#FFE9A8,#E8A93A);box-shadow:var(--shadow)}.daily-tile b{font-size:18px}.daily-tile span{font-size:14px}.past{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.past input{width:80px;font:inherit;padding:6px 8px;border-radius:8px;border:1.5px solid var(--line);background:var(--bg);color:var(--ink)}.maprule{margin:6px 0 4px}.tier{margin:14px 0 6px;font-size:14px}.tier b{font-size:16px}.tier span{color:var(--muted)}.tier em{font-style:normal;font-weight:800;font-size:12px;background:linear-gradient(135deg,#FFB547,#FF6A3D);color:#11141B;border-radius:999px;padding:1px 7px}.lvrow{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}.lv{display:flex;flex-direction:column;align-items:center;gap:0;padding:8px 2px 6px;border-radius:14px;border:1.5px solid var(--line);background:var(--card);color:var(--ink);font:inherit;cursor:pointer;min-height:76px}.lv .em{font-size:22px;line-height:1.1}.lv b{font-size:16px}.lv small{font-size:12px;color:#E8A93A;letter-spacing:1px}.lv.done{border-color:#E8A93A}.lv.boss{background:linear-gradient(160deg,var(--card),rgba(155,91,232,.18));border-color:#9B5BE8}.lv.locked{opacity:.5}.lv.locked small{color:var(--muted)}.arena{position:relative;display:flex;flex-direction:column;gap:10px}.rival{display:flex;gap:12px;align-items:center;padding:10px 14px;border-radius:18px;background:linear-gradient(135deg,var(--fa),var(--fb));color:var(--fi)}.rv-em{font-size:44px;line-height:1;background:rgba(255,255,255,.55);border-radius:14px;padding:6px 10px}.rv-tx{display:flex;flex-direction:column;line-height:1.25}.rv-tx b{font-size:20px}.rv-tx small,.rv-tx span{font-size:13px;font-weight:700;opacity:.85}.rounds{display:grid;grid-template-columns:repeat(auto-fit,minmax(0,1fr));gap:6px}.rd{display:flex;flex-direction:column;align-items:center;padding:6px 2px;border-radius:12px;background:var(--card);border:2px solid var(--line);min-width:0}.rd small{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.rd b{font-size:26px;line-height:1.1}.rd i{font-style:normal;font-size:12px;font-weight:800}.rd.now{border-color:var(--acc);box-shadow:0 0 0 3px rgba(255,106,61,.25);animation:pulse 1s ease-in-out infinite}.rd.won{background:rgba(47,211,160,.16);border-color:var(--ok)}.rd.won i{color:var(--ok)}.rd.lost{background:rgba(255,92,92,.12);border-color:var(--bad)}.rd.lost i{color:var(--bad)}.rd.fog b{color:var(--muted)}@keyframes pulse{50%{transform:translateY(-2px)}}.pending{margin:0;text-align:center;font-weight:800;color:var(--acc)}.me{display:flex;gap:12px;align-items:center}.me canvas{width:96px;height:64px;border-radius:10px;object-fit:cover;flex:0 0 auto;background:#1B1430}.me div{display:flex;flex-direction:column;line-height:1.3}.me b{font-size:18px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.st{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:0;min-height:72px;padding:6px 4px;border-radius:14px;border:2px solid var(--line);background:var(--card);color:var(--ink);font:inherit;cursor:pointer;touch-action:manipulation}.st:hover:not(:disabled){border-color:var(--acc)}.st:active:not(:disabled){transform:scale(.97)}.st small{font-size:12px;font-weight:700;color:var(--muted)}.st b{font-size:26px;line-height:1.1}.st em{position:absolute;top:4px;right:6px;font-style:normal;font-size:11px;font-weight:800;color:var(--ok)}.st i{font-style:normal;font-weight:900}.st.home{border-color:#5BA8E8}.st kbd{position:absolute;top:4px;left:6px;font:700 10px system-ui;color:var(--muted);opacity:.7}.st.used{opacity:.45;cursor:default}.move[aria-pressed=true]{background:var(--acc);color:#11141B;border-color:var(--acc)}.hand{position:absolute;font-size:36px;pointer-events:none;animation:tapme .9s ease-in-out infinite;z-index:3;filter:drop-shadow(0 3px 4px rgba(0,0,0,.35))}@keyframes tapme{0%,100%{transform:translateY(0)}50%{transform:translateY(-12px)}}.result{text-align:center;margin-top:4px}.res-stars{font-size:54px;letter-spacing:6px;line-height:1}.res-stars span{color:var(--line)}.res-stars span.on{color:#E8A93A}.result h3{margin:6px 0 2px;font-size:24px}.res-grid{font-size:26px;letter-spacing:2px;margin:4px 0}.beat{font-weight:800}.beat.ok{color:var(--ok)}.res-btns{justify-content:center}.shake{animation:shake .32s linear}@keyframes shake{20%{transform:translateX(-7px)}40%{transform:translateX(6px)}60%{transform:translateX(-4px)}80%{transform:translateX(3px)}}#fx{position:fixed;inset:0;width:100vw;height:100vh;pointer-events:none;z-index:50}@media (prefers-reduced-motion:reduce){.shake,.rd.now,.hand{animation:none}}@media (max-width:420px){.rd b{font-size:22px}.st b{font-size:24px}.goal{font-size:14px}}.lbl{margin:0 0 -6px;font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
12345678// CyberMax game service worker: the game works offline after the first visit. Cache-first for the game's own files,// network-first for the page itself (so updates arrive), never caches API calls or other sites. (c) 2026 CyberMax.const GAME = 'pawfoil';const CACHE = `cmx-${GAME}-aef686760a`;const FILES = ["index.html", "cmx.js", "core.js", "fun.css", "funpass.js", "game.js", "icon-192.png", "icon-512.png", "icon-maskable.png", "icon.svg", "index.html", "manifest.webmanifest", "sample.jpg", "style.css"];self.addEventListener('install', (e) => {e.waitUntil(caches.open(CACHE).then((c) => c.addAll(FILES)).then(() => self.skipWaiting()));12345678// CyberMax game service worker: the game works offline after the first visit. Cache-first for the game's own files,// network-first for the page itself (so updates arrive), never caches API calls or other sites. (c) 2026 CyberMax.const GAME = 'pawfoil';const CACHE = `cmx-${GAME}-06edb7823f`;const FILES = ["index.html", "cmx.js", "core.js", "fun.css", "funpass.js", "game.js", "icon-192.png", "icon-512.png", "icon-maskable.png", "icon.svg", "index.html", "ladder.js", "levels.js", "manifest.webmanifest", "sample.jpg", "style.css"];self.addEventListener('install', (e) => {e.waitUntil(caches.open(CACHE).then((c) => c.addAll(FILES)).then(() => self.skipWaiting()));
pawfoil/cmx.js+3-1
pawfoil/funpass.js+2-2
pawfoil/game.js+13-2
pawfoil/index.html+61-21
pawfoil/ladder.jsAdded+312
pawfoil/levels.jsAdded+238
pawfoil/style.css+61
pawfoil/sw.js+2-2