/* Forge No Ads Games — dimensional graphics layer v1.
   Progressive enhancement: preserves every game's existing controls and rules. */
:root{--forge-glow:#e9c77e;--forge-ink:#08111b;--forge-depth:0 3px 0 rgba(255,255,255,.16),0 13px 24px rgba(0,0,0,.34),0 30px 60px rgba(0,0,0,.22)}
body{background:radial-gradient(ellipse 100% 75% at 50% -20%,#263e56 0%,#101a29 47%,#060b13 100%) fixed}
#home{isolation:isolate}
#home:before{content:"";position:fixed;inset:0;pointer-events:none;z-index:-1;background:radial-gradient(circle at 15% 12%,rgba(229,188,100,.13),transparent 35%),radial-gradient(circle at 90% 65%,rgba(78,149,187,.13),transparent 43%);opacity:.95}
#home .forge-brand{position:relative;filter:drop-shadow(0 16px 22px rgba(0,0,0,.3))}
#home .forge-title{letter-spacing:.035em;text-shadow:0 2px 0 rgba(255,241,199,.28),0 7px 0 rgba(10,17,27,.6),0 20px 32px rgba(0,0,0,.7)}
#home .grid{perspective:1200px}
#home .card{position:relative;isolation:isolate;transform:translateZ(0);transform-style:preserve-3d;transition:transform .24s cubic-bezier(.2,.7,.2,1),box-shadow .24s,border-color .24s;box-shadow:inset 0 1px 0 rgba(255,255,255,.34),inset 0 -3px 0 rgba(0,0,0,.15),0 8px 0 rgba(4,9,15,.32),0 18px 26px rgba(0,0,0,.27);overflow:hidden}
#home .card:before{content:"";position:absolute;inset:0;pointer-events:none;border-radius:inherit;background:linear-gradient(145deg,rgba(255,255,255,.25),transparent 32%,transparent 64%,rgba(0,0,0,.12));z-index:0}
#home .card>*{position:relative;z-index:1}
#home .card:active{transform:translateY(3px) scale(.992);box-shadow:inset 0 2px 7px rgba(0,0,0,.16),0 3px 0 rgba(4,9,15,.3),0 8px 14px rgba(0,0,0,.2)}
@media(hover:hover) and (pointer:fine){#home .card:hover{transform:translateY(-7px) rotateX(2deg) scale(1.015);box-shadow:inset 0 1px 0 rgba(255,255,255,.4),0 13px 0 rgba(4,9,15,.3),0 26px 38px rgba(0,0,0,.37)}}
#home .card .mini{position:relative;text-shadow:0 2px 2px rgba(0,0,0,.25);filter:drop-shadow(0 5px 4px rgba(0,0,0,.18))}
#home .cat-tile{transition:transform .2s,box-shadow .2s;box-shadow:inset 0 1px 0 rgba(255,255,255,.24),0 5px 0 rgba(0,0,0,.2),0 12px 18px rgba(0,0,0,.17)}
#home .cat-tile:active{transform:translateY(3px)}
#play{background:radial-gradient(ellipse at 50% -20%,rgba(109,137,154,.22),transparent 65%)}
#stage{perspective:1300px}
#stage button,#stage [role="button"]{touch-action:manipulation}
#stage .tk-felt{background:radial-gradient(ellipse 90% 75% at 42% 15%,#467c64 0%,#23513e 46%,#0d2b25 100%)!important;border:9px solid #62422c;outline:2px solid #bd9561;box-shadow:inset 0 0 0 2px rgba(245,217,150,.3),inset 0 18px 35px rgba(0,0,0,.25),0 7px 0 #2b1a13,0 20px 35px rgba(0,0,0,.35)!important}
#stage .tk-paper{background:linear-gradient(145deg,#fffefa,#eee0c9)!important;box-shadow:inset 0 1px 0 white,0 6px 0 #c6ae89,0 17px 30px rgba(0,0,0,.24)!important}
#stage .tk-card{background:linear-gradient(145deg,#fff,#f5eee1)!important;border:1px solid #e4d5bf;box-shadow:inset 0 1px 0 white,0 3px 0 #d6c8b3,0 7px 13px rgba(0,0,0,.3)!important;transition:transform .18s ease,box-shadow .18s ease;backface-visibility:hidden}
#stage .tk-card.back{background:repeating-linear-gradient(45deg,#542b3e,#542b3e 6px,#3b1a2c 6px,#3b1a2c 12px)!important;border:3px double #d7b775}
#stage .tk-card.on{transform:translateY(-8px) rotateX(3deg)}
#stage .tk-die{background:linear-gradient(145deg,#fff,#ded5c5)!important;border:1px solid #c6b9a8;box-shadow:inset 1px 1px 2px white,3px 5px 0 #aa9c87,6px 9px 14px rgba(0,0,0,.28)!important}
#stage .tk-cell{background:linear-gradient(145deg,#fffaf1,#e8d9c2)!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.8),0 2px 0 rgba(80,56,36,.25),0 4px 8px rgba(0,0,0,.13);transition:filter .14s,transform .14s}
#stage .tk-cell:active{transform:translateY(2px)}
#stage .gcell,#stage .c2048,#stage .mcell,#stage .ncell,#stage .xcell,#stage .bcell{box-shadow:inset 0 1px 0 rgba(255,255,255,.55),0 3px 0 rgba(0,0,0,.15),0 6px 12px rgba(0,0,0,.13);transition:transform .16s,filter .16s}
#stage .gcell:active,#stage .mcell:active,#stage .ncell:active,#stage .xcell:active,#stage .bcell:active{transform:translateY(2px)}
#stage .g2048,#stage .bgrid,#stage .mine{box-shadow:inset 0 4px 12px rgba(0,0,0,.22),0 8px 0 rgba(0,0,0,.15),0 16px 26px rgba(0,0,0,.22)}
#stage .tube{background:linear-gradient(90deg,rgba(255,255,255,.22),rgba(255,255,255,.02) 30%,rgba(255,255,255,.12) 75%,rgba(255,255,255,.4));box-shadow:inset 4px 0 8px rgba(255,255,255,.13),inset -5px 0 7px rgba(0,0,0,.2),3px 9px 14px rgba(0,0,0,.23)}
#stage canvas{max-width:100%;filter:drop-shadow(0 12px 18px rgba(0,0,0,.18))}
#stage .tk-btn,#tools button{transition:transform .16s,filter .16s}
#stage .tk-btn:hover,#tools button:hover{filter:brightness(1.08)}
@media(prefers-reduced-motion:reduce){#home .card,#home .cat-tile,#stage .tk-card,#stage .tk-cell,#stage .tk-btn{transition:none!important}#home .card:hover{transform:none!important}}
@media(max-width:600px){#home .card{box-shadow:inset 0 1px 0 rgba(255,255,255,.3),0 4px 0 rgba(0,0,0,.28),0 9px 15px rgba(0,0,0,.18)}#stage .tk-felt{border-width:5px}}
