/* GameFactory · motor de la plantilla "sort@1" — todo va dentro de .gfs */
.gfs{
  --ink:#3A1640; --cream:#FFF7F0; --pink:#FF3F9E; --pink-d:#A3135F; --blue-d:#174FA6;
  --purple:#7A3BD8; --purple-d:#4A1E8F; --yellow:#FFC83D;
  --display:"Baloo 2","Arial Rounded MT Bold","Trebuchet MS",system-ui,sans-serif;
  --body:"Nunito",system-ui,-apple-system,"Segoe UI",sans-serif;
  position:fixed;inset:0;z-index:1000;overflow:hidden;background:#4A2034;color:var(--cream);font-family:var(--body);font-size:15px;
  padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px);
  -webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent;touch-action:manipulation;color-scheme:light}
.gfs *,.gfs *::before,.gfs *::after{box-sizing:border-box}
.gfs button{font:inherit;color:inherit;cursor:pointer}
.gfs button:focus-visible{outline:3px solid var(--yellow);outline-offset:3px}
.gfs img{-webkit-user-drag:none;user-drag:none}
.gfs [hidden]{display:none!important}

.gfs .bg{position:absolute;inset:0;background:#4A2034 center/cover no-repeat;z-index:0}
.gfs .bg::after{content:"";position:absolute;inset:0;background:linear-gradient(rgba(58,22,64,.05),rgba(58,22,64,.28) 70%,rgba(58,22,64,.5))}
.gfs .bg.dim::after{background:linear-gradient(rgba(58,22,64,.35),rgba(58,22,64,.55))}
.gfs .app{position:relative;z-index:1;height:100%;max-width:560px;margin:0 auto;padding-inline:16px}
.gfs .screen{height:100%;display:flex;flex-direction:column;padding-block:10px 12px;gap:10px}

/* botones estilo caramelo */
.gfs .btn{--c1:#FF78C4;--c2:#FF2D95;--c3:#D9157A;--sh:var(--pink-d);
  display:flex;align-items:center;justify-content:center;gap:10px;width:100%;min-height:54px;padding:8px 22px;border-radius:999px;
  border:3px solid rgba(255,255,255,.9);background:linear-gradient(var(--c1),var(--c2) 55%,var(--c3));
  box-shadow:0 5px 0 var(--sh),0 10px 18px rgba(40,0,40,.35),inset 0 3px 0 rgba(255,255,255,.45);
  font:800 21px/1 var(--display);letter-spacing:.04em;text-transform:uppercase;color:#fff;text-shadow:0 2px 0 rgba(0,0,0,.2);transition:transform .08s}
.gfs .btn:active{transform:translateY(3px);box-shadow:0 2px 0 var(--sh),0 5px 10px rgba(40,0,40,.3),inset 0 3px 0 rgba(255,255,255,.45)}
.gfs .btn.blue{--c1:#7DBBFF;--c2:#3C8CF5;--c3:#2466D6;--sh:var(--blue-d)}
.gfs .btn.purple{--c1:#C08BFF;--c2:#8A4AE8;--c3:#6B2FCC;--sh:var(--purple-d)}
.gfs .btn.green{--c1:#8BE39F;--c2:#34B85C;--c3:#1F9444;--sh:#136B2E}
.gfs .btn.small{min-height:44px;font-size:17px;padding:6px 16px}
.gfs .btn img{width:28px;height:28px;object-fit:contain}
.gfs .round{width:44px;height:44px;flex:none;border-radius:50%;display:grid;place-items:center;border:3px solid rgba(255,255,255,.9);
  background:linear-gradient(#C08BFF,#7A3BD8);box-shadow:0 4px 0 var(--purple-d),inset 0 2px 0 rgba(255,255,255,.4)}
.gfs .round svg{width:22px;height:22px;fill:#fff}
.gfs .round:active{transform:translateY(2px)}

/* menú */
.gfs .menu{align-items:center;text-align:center}
.gfs .menu .top{width:100%;display:flex;justify-content:space-between;min-height:44px}
.gfs .logo{display:grid;justify-items:center;margin-top:-6px;max-width:100%}
.gfs .logo .l1,.gfs .logo .l2{font-family:var(--display);font-weight:800;line-height:.82;paint-order:stroke fill;-webkit-text-stroke:7px #fff;letter-spacing:.02em;max-width:100%;overflow-wrap:anywhere}
.gfs .logo .l1{font-size:clamp(50px,17vw,100px);color:var(--pink);text-shadow:0 7px 0 var(--purple),0 12px 18px rgba(40,0,50,.45)}
.gfs .logo .l2{font-size:clamp(44px,13vw,76px);color:var(--yellow);text-shadow:0 6px 0 #D9750F,0 7px 0 var(--purple),0 12px 16px rgba(40,0,50,.45);margin-top:2px}
.gfs .ribbon{margin-top:12px;background:linear-gradient(#9B59F0,#6A2CC9);border:2px solid rgba(255,255,255,.7);border-radius:12px;
  padding:5px 18px;font:800 15px/1.2 var(--display);letter-spacing:.03em;box-shadow:0 4px 0 var(--purple-d)}
.gfs .pet-btn{flex:1;min-height:0;width:100%;border:0;background:none;padding:0;position:relative;display:flex;justify-content:center;align-items:flex-end}
.gfs .pet-btn img{max-height:100%;max-width:78%;object-fit:contain;filter:drop-shadow(0 14px 12px rgba(40,0,30,.45));transform-origin:50% 100%;animation:gfs-breathe 3.2s ease-in-out infinite}
.gfs.framed .pet-btn{align-items:center;padding-block:6px}
.gfs.framed .pet-btn img{height:min(100%,300px);width:auto;max-width:80%;max-height:none;aspect-ratio:1;object-fit:cover;border-radius:50%;border:6px solid #fff;box-shadow:0 8px 0 var(--purple-d),0 16px 30px rgba(40,0,40,.4);filter:none}
.gfs .menu-btns{width:min(100%,340px);display:grid;gap:14px}
.gfs .foot{display:grid;gap:2px;justify-items:center}
.gfs .gf{font:800 22px/1 var(--display);letter-spacing:.06em;color:#fff;text-shadow:0 2px 0 rgba(0,0,0,.3)}
.gfs .gf span{color:var(--yellow)}
.gfs .foot small{font-size:11.5px;opacity:.85}

/* burbuja de la mascota */
.gfs .bubble{position:absolute;left:50%;bottom:78%;transform:translateX(-50%) scale(.6);opacity:0;pointer-events:none;white-space:nowrap;
  background:#fff;color:var(--ink);font:800 16px/1 var(--display);padding:9px 14px 6px;border-radius:16px;box-shadow:0 6px 14px rgba(0,0,0,.25);
  transition:opacity .18s,transform .18s;z-index:3}
.gfs .bubble::after{content:"";position:absolute;left:50%;bottom:-7px;transform:translateX(-50%);border:8px solid transparent;border-top-color:#fff;border-bottom:0}
.gfs .bubble.show{opacity:1;transform:translateX(-50%) scale(1)}
.gfs .bubble.bad{background:#FFE3EC;color:#A3135F}
.gfs .bubble.bad::after{border-top-color:#FFE3EC}
.gfs.framed .menu .bubble{bottom:92%}

/* barras */
.gfs .hud{display:flex;align-items:center;gap:8px}
.gfs .pill{display:flex;align-items:center;gap:6px;height:40px;padding:0 14px;border-radius:999px;background:linear-gradient(#9B59F0,#6A2CC9);
  border:2px solid rgba(255,255,255,.75);box-shadow:0 3px 0 var(--purple-d);font:800 18px/1 var(--display);white-space:nowrap}
.gfs .pill.grow{flex:1;justify-content:center;min-width:0}
.gfs .coin{width:22px;height:22px;border-radius:50%;flex:none;background:radial-gradient(circle at 35% 30%,#FFF6B8,#FFD23F 42%,#E39400);
  box-shadow:inset 0 -2px 0 #B86F00,0 1px 2px rgba(0,0,0,.3);position:relative;display:inline-block}
.gfs .coin::after{content:"";position:absolute;inset:6px;border-radius:50%;border:2px solid rgba(184,111,0,.55)}
.gfs .stars-mini{display:flex;gap:1px}
.gfs .stars-mini img{width:22px;height:22px;transition:filter .3s,opacity .3s}
.gfs .stars-mini img.off{filter:grayscale(1) brightness(.7);opacity:.5}
.gfs .title-bar{font:800 26px/1 var(--display);flex:1;text-align:center;text-shadow:0 3px 0 rgba(0,0,0,.25)}

/* niveles */
.gfs .levels{flex:1;overflow:auto;display:grid;grid-template-columns:repeat(3,1fr);gap:12px;align-content:start;padding:4px 2px 12px}
.gfs .lvl{position:relative;border:3px solid rgba(255,255,255,.85);border-radius:20px;padding:10px 6px 8px;display:grid;justify-items:center;gap:4px;
  background:linear-gradient(#FF8CC9,#E23788);box-shadow:0 5px 0 var(--pink-d),0 8px 14px rgba(40,0,40,.3)}
.gfs .lvl:nth-child(3n+2){background:linear-gradient(#7DBBFF,#2F72DD);box-shadow:0 5px 0 var(--blue-d),0 8px 14px rgba(40,0,40,.3)}
.gfs .lvl:nth-child(3n){background:linear-gradient(#C08BFF,#7A3BD8);box-shadow:0 5px 0 var(--purple-d),0 8px 14px rgba(40,0,40,.3)}
.gfs .lvl b{font:800 34px/1 var(--display);text-shadow:0 3px 0 rgba(0,0,0,.2)}
.gfs .lvl .ics{display:flex;gap:2px}
.gfs .lvl .ics img{width:26px;height:26px;object-fit:contain;background:rgba(255,255,255,.85);border-radius:8px;padding:2px}
.gfs .lvl .st{display:flex;gap:1px}
.gfs .lvl .st img{width:18px;height:18px}
.gfs .lvl .st img.off{filter:grayscale(1) brightness(.8);opacity:.45}
.gfs .lvl[disabled]{filter:grayscale(.85) brightness(.8);cursor:not-allowed}
.gfs .lvl .lock{position:absolute;inset:0;display:grid;place-items:center;border-radius:17px;background:rgba(40,10,40,.35)}
.gfs .lvl .lock svg{width:34px;height:34px;fill:#fff}

/* juego */
.gfs .banner{align-self:center;max-width:100%;text-align:center;background:linear-gradient(#9B59F0,#6A2CC9);border:2px solid rgba(255,255,255,.75);
  border-radius:16px;padding:7px 18px 5px;font:800 17px/1.15 var(--display);letter-spacing:.02em;box-shadow:0 4px 0 var(--purple-d);text-transform:uppercase}
.gfs .boxes{flex:1;min-height:150px;display:grid;gap:10px;grid-template-columns:repeat(var(--n,2),1fr)}
.gfs .box{--g1:#6FB3FF;--g2:#2F72DD;--edge:#BFE0FF;position:relative;display:flex;flex-direction:column;border-radius:22px;padding:8px;min-height:0;
  border:4px solid var(--edge);background:linear-gradient(var(--g1),var(--g2));box-shadow:0 6px 0 rgba(30,10,60,.45),0 10px 20px rgba(40,0,40,.3);transition:transform .15s,box-shadow .15s}
.gfs .box.rosa{--g1:#FF8CC9;--g2:#E23788;--edge:#FFD0E8}
.gfs .box.verde{--g1:#7FE08F;--g2:#23A24A;--edge:#CFF5D6}
.gfs .box.naranja{--g1:#FFC06A;--g2:#F07B1A;--edge:#FFE2BF}
.gfs .box.morado{--g1:#C08BFF;--g2:#7A3BD8;--edge:#E6D2FF}
.gfs .box .bh{display:flex;flex-direction:column;align-items:center;gap:2px;padding:2px 0 6px}
.gfs .box .bh img{width:44px;height:44px;object-fit:contain;filter:drop-shadow(0 2px 2px rgba(0,0,0,.25))}
.gfs .box .bh b{font:800 17px/1 var(--display);text-transform:uppercase;letter-spacing:.03em;text-shadow:0 2px 0 rgba(0,0,0,.22)}
.gfs .box .slots{flex:1;min-height:0;border-radius:14px;background:rgba(255,255,255,.22);box-shadow:inset 0 2px 8px rgba(0,0,0,.18);
  display:flex;flex-wrap:wrap;align-content:flex-start;justify-content:center;gap:4px;padding:6px;overflow:hidden}
.gfs .box .slots img{width:42px;height:42px;object-fit:contain;animation:gfs-pop .35s ease-out}
.gfs .box.over{transform:scale(1.04);box-shadow:0 0 0 4px var(--yellow),0 10px 24px rgba(40,0,40,.4)}
.gfs .box.ready{box-shadow:0 0 0 3px rgba(255,255,255,.9),0 6px 0 rgba(30,10,60,.45)}
.gfs .box.wrong{animation:gfs-shake .4s}
.gfs .box.hint,.gfs .item.hint{animation:gfs-pulse .7s ease-in-out 4}
.gfs .bottom{display:flex;align-items:flex-end;gap:8px;min-height:0}
.gfs .pet-game{position:relative;width:30%;max-width:150px;flex:none;align-self:stretch;display:flex;align-items:flex-end}
.gfs .pet-game img{width:100%;object-fit:contain;filter:drop-shadow(0 8px 8px rgba(40,0,30,.45));transform-origin:50% 100%;animation:gfs-breathe 3.2s ease-in-out infinite}
.gfs.framed .pet-game{align-items:center}
.gfs.framed .pet-game img{aspect-ratio:1;object-fit:cover;border-radius:50%;border:4px solid #fff;box-shadow:0 5px 0 var(--purple-d);filter:none}
.gfs .tray{flex:1;display:flex;flex-wrap:wrap;justify-content:center;align-content:center;gap:8px;min-height:152px;padding:10px;border-radius:22px;
  background:rgba(58,22,64,.55);border:3px solid rgba(255,255,255,.35)}
.gfs .item{width:64px;height:64px;padding:5px;border-radius:18px;border:3px solid #fff;background:linear-gradient(#FFFFFF,#F4E9FF);
  box-shadow:0 4px 0 rgba(80,40,120,.45);touch-action:none;display:grid;place-items:center}
.gfs .item img{width:100%;height:100%;object-fit:contain;pointer-events:none}
.gfs .item.lifted{opacity:.25}
.gfs .item.selected{border-color:var(--yellow);box-shadow:0 0 0 3px var(--yellow),0 4px 0 rgba(80,40,120,.45);transform:translateY(-4px)}
.gfs .gbar{display:flex;align-items:center;gap:10px}
.gfs .gbar .btn{width:auto;flex:none}
.gfs .gbar .prog{flex:1;text-align:right;font:800 16px/1.2 var(--display);text-shadow:0 2px 0 rgba(0,0,0,.3)}
.gfs .ghost{position:fixed;left:0;top:0;width:76px;height:76px;margin:-38px 0 0 -38px;pointer-events:none;z-index:50;filter:drop-shadow(0 10px 10px rgba(0,0,0,.35))}
.gfs .ghost img{width:100%;height:100%;object-fit:contain}

/* marca de agua del plan Gratis */
.gfs .wm{position:absolute;left:50%;bottom:calc(8px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:30;pointer-events:none;
  background:rgba(20,8,30,.62);color:#fff;font:800 11px/1 var(--display);letter-spacing:.08em;text-transform:uppercase;padding:6px 11px;border-radius:999px;white-space:nowrap}
.gfs.wm-on .foot small{visibility:hidden}

/* ventanas */
.gfs .modal{position:absolute;inset:0;z-index:40;display:grid;place-items:center;padding:16px;background:rgba(30,8,36,.62)}
.gfs .card{position:relative;width:min(100%,380px);max-height:100%;overflow:auto;border-radius:28px;border:4px solid #fff;padding:22px 20px 20px;
  background:linear-gradient(#A064F2,#6A2CC9 60%,#5A23B0);box-shadow:0 8px 0 var(--purple-d),0 20px 40px rgba(0,0,0,.45);text-align:center;display:grid;gap:12px;animation:gfs-pop .35s ease-out}
.gfs .card h2{margin:0;font:800 36px/1 var(--display);color:var(--yellow);paint-order:stroke fill;-webkit-text-stroke:5px #fff;text-shadow:0 4px 0 #D9750F}
.gfs .card p{margin:0;font-weight:700;line-height:1.45}
.gfs .card .sub{font:800 16px/1 var(--display);letter-spacing:.06em;text-transform:uppercase;opacity:.95}
.gfs .win-media{width:150px;height:150px;border-radius:50%;overflow:hidden;justify-self:center;border:4px solid #fff;background:#000;box-shadow:0 6px 0 var(--purple-d);margin-top:-6px}
.gfs .win-media video,.gfs .win-media img{width:100%;height:100%;object-fit:cover;object-position:50% 30%}
.gfs .big-stars{display:flex;justify-content:center;gap:4px}
.gfs .big-stars img{width:58px;height:58px;filter:grayscale(1) brightness(.6);opacity:.45;transform:scale(.7);transition:all .35s cubic-bezier(.3,1.6,.5,1)}
.gfs .big-stars img:nth-child(2){margin-top:-12px}
.gfs .big-stars img.on{filter:none;opacity:1;transform:scale(1)}
.gfs .reward{display:flex;justify-content:center;align-items:center;gap:8px;font:800 22px/1 var(--display)}
.gfs .reward .coin{width:26px;height:26px}
.gfs .lang-row{display:grid;gap:12px}
.gfs .about-note{font-size:14px;opacity:.95;text-align:left}
.gfs .about-note code{font-family:ui-monospace,Menlo,monospace;background:rgba(0,0,0,.25);padding:1px 6px;border-radius:6px}
.gfs .confetti{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:60}

@keyframes gfs-breathe{0%,100%{transform:scale(1,1)}50%{transform:scale(1.015,1.03)}}
@keyframes gfs-pop{0%{transform:scale(.4);opacity:0}70%{transform:scale(1.08);opacity:1}100%{transform:scale(1)}}
@keyframes gfs-shake{0%,100%{transform:translateX(0)}20%{transform:translateX(-9px)}40%{transform:translateX(8px)}60%{transform:translateX(-6px)}80%{transform:translateX(4px)}}
@keyframes gfs-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.08);box-shadow:0 0 0 5px var(--yellow)}}
@keyframes gfs-hop{0%,100%{transform:translateY(0)}35%{transform:translateY(-22px) rotate(-4deg)}65%{transform:translateY(-4px)}}
.gfs .hop{animation:gfs-hop .55s ease-out!important}
@media (max-height:640px){.gfs .logo .l1{font-size:58px}.gfs .logo .l2{font-size:44px}.gfs .menu-btns{gap:10px}.gfs .btn{min-height:48px;font-size:19px}.gfs .tray{min-height:132px}.gfs .item{width:56px;height:56px}}
@media (prefers-reduced-motion:reduce){.gfs *{animation-duration:.01ms!important;animation-iteration-count:1!important;transition:none!important}}
