// Modals: AuthModal, CartDrawer, RevealModal (simplified, no full lightning sequence) const { useState: useStM, useEffect: useEfM, useRef: useRfM } = React; function AuthModal({ open, onClose, onSignIn }) { const [mode, setMode] = useStM('signin'); const [email, setEmail] = useStM(''); const [pwd, setPwd] = useStM(''); if (!open) return null; return (
e.target === e.currentTarget && onClose()}>

{mode==='signin' ? 'Welcome, traveler' : 'Begin your journey'}

{mode==='signin' ? 'Sign in to access your vault and store credit.' : 'Create an account to track your pulls.'}

{[['signin','Sign In'],['signup','Create Account']].map(([k,l]) => ( ))}
{ e.preventDefault(); onSignIn({ email, name: email.split('@')[0] || 'Wizard' }); }} style={{display:'flex',flexDirection:'column',gap:10}}> {mode==='signup' && } setEmail(e.target.value)} required style={authInputStyle} /> setPwd(e.target.value)} required style={authInputStyle} /> {mode==='signin' &&
e.preventDefault()} style={{fontFamily:'var(--font-magic)',fontSize:'0.85rem',color:'var(--purple-400)',fontStyle:'italic',textDecoration:'none'}}>Forgot password?
}
✦ Sign in to track your pulls, save your collection, and use store credit
); } const authInputStyle = { background: 'rgba(10,4,32,0.6)', border: '1px solid var(--border-mid)', borderRadius: 11, padding: '0.85rem 1.1rem', color: 'var(--text-primary)', fontFamily: 'var(--font-magic)', fontStyle: 'italic', fontSize: '1rem', outline: 'none', width: '100%', }; function CartDrawer({ open, items, onClose, onRemove }) { const sub = items.reduce((s, i) => s + i.price * i.qty, 0); return ( <> {open &&
} ); } function RevealModal({ pack, onClose }) { const [phase, setPhase] = useStM('shake'); // shake → burst → reveal useEfM(() => { if (!pack) return; setPhase('shake'); const t1 = setTimeout(() => setPhase('burst'), 900); const t2 = setTimeout(() => setPhase('reveal'), 1500); return () => { clearTimeout(t1); clearTimeout(t2); }; }, [pack]); if (!pack) return null; const tier = window.WW_DATA.tierColors[pack.tier]; const fakePull = { name: pack.tier === 'legendary' ? 'Black Lotus' : pack.tier === 'very-rare' ? 'Mox Sapphire' : pack.tier === 'rare' ? 'Foil Orcish Bowmasters' : 'Lightning Bolt', set: pack.tier === 'legendary' ? 'Beta · 1993' : 'Modern Horizons 3', value: pack.tier === 'legendary' ? 4250 : pack.tier === 'very-rare' ? 320 : pack.tier === 'rare' ? 38 : 4.50, }; return (
e.target === e.currentTarget && onClose()} style={{position:'fixed',inset:0,zIndex:10000,display:'flex',alignItems:'center',justifyContent:'center',padding:'1.5rem',background:'rgba(6,0,13,0.92)',backdropFilter:'blur(14px)'}}>
{/* Orb stage */}
{phase === 'reveal' ? '✦' : '?'}
{phase === 'reveal' ? ( <>
— {pack.tierLabel} PULL —

You conjured a {pack.tierLabel.toLowerCase()}!

{fakePull.name}
{fakePull.set}
Estimated value ${fakePull.value.toLocaleString()}
) : ( <>
{pack.tierLabel}
{pack.name}
{phase === 'shake' ? 'Channeling the rift…' : 'Burst!'}
)}
); } Object.assign(window, { AuthModal, CartDrawer, RevealModal });