/* Juego de parejas. Comparte el degradado y los tintes del reproductor, para
   que no parezca una pieza traída de otra aplicación. */

.jg-dialog{position:fixed;inset:0;width:100%;max-width:100%;height:100%;max-height:100%;margin:0;padding:0;border:0;background:none;overflow:hidden;color:oklch(.995 .003 300)}
.jg-dialog::backdrop{background:oklch(.16 .07 298 / .72)}
.jg-dialog[open]{animation:np-rise .34s cubic-bezier(.22,1,.36,1)}

.jg{position:relative;display:flex;flex-direction:column;align-items:center;min-height:100%;text-align:center;
 padding:max(10px,env(safe-area-inset-top)) 20px max(26px,env(safe-area-inset-bottom));
 background:linear-gradient(180deg,oklch(.78 .14 200) 0%,oklch(.5 .2 288) 45%,oklch(.23 .11 298) 100%)}
.jg-top{width:100%;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px}
.jg-cuenta{font-family:'Nunito',sans-serif;font-weight:800;font-size:14px;background:oklch(1 0 0 / .2);padding:7px 14px;border-radius:999px}
.jg-titulo{font-family:'Nunito',sans-serif;font-size:clamp(23px,6vw,30px);font-weight:900;margin-top:14px}
.jg-sub{font-size:13px;opacity:.85;margin-top:6px}

.jg-tablero{display:grid;grid-template-columns:repeat(3,1fr);gap:11px;width:100%;max-width:400px;margin:20px auto 0}

/* La carta gira: una cara tapada y otra con el dibujo. Con movimiento reducido
   la regla global apaga la transición y el giro pasa a ser instantáneo. */
.jg-carta{position:relative;aspect-ratio:1;border-radius:20px;transform-style:preserve-3d;transition:transform .35s cubic-bezier(.22,1,.36,1);background:none;padding:0}
.jg-carta.abierta{transform:rotateY(180deg)}
.jg-cara{position:absolute;inset:0;display:grid;place-items:center;border-radius:20px;backface-visibility:hidden;-webkit-backface-visibility:hidden}
.jg-atras{background:oklch(.62 .19 300);box-shadow:0 4px 0 oklch(.42 .16 300),inset 0 0 0 3px oklch(1 0 0 / .22);color:oklch(1 0 0 / .72)}
.jg-atras svg{width:32px;height:32px}
.jg-frente{transform:rotateY(180deg);background:oklch(.97 .015 300);box-shadow:0 4px 0 oklch(.16 .08 298 / .35)}
.jg-frente svg{width:58%;height:58%;stroke:none;fill:none}
.jg-carta.hecha{opacity:1}
.jg-carta.hecha .jg-frente{background:oklch(.9 .11 152);box-shadow:0 4px 0 oklch(.6 .14 152)}
.jg-carta:not(.abierta):active{transform:scale(.95)}

.jg-pista{margin:auto 0 0;padding-top:22px;font-size:14px;opacity:.8}
.jg-fin{margin:30px 0 auto;display:flex;flex-direction:column;align-items:center;gap:4px}
.jg-fin strong{font-family:'Nunito',sans-serif;font-size:24px;font-weight:900;color:oklch(.93 .14 150)}
.jg-fin small{font-size:14px;opacity:.85}
.jg-otra{display:flex;align-items:center;justify-content:center;gap:9px;margin-top:16px;padding:15px 28px;border-radius:999px;font-family:'Nunito',sans-serif;font-weight:800;font-size:17px;color:oklch(.22 .1 298);background:var(--gold,oklch(.88 .14 88));box-shadow:0 5px 0 oklch(.72 .13 78)}
.jg-otra svg{width:20px;height:20px;stroke-width:2}

/* La tarjeta de Inicio que lo abre. */
.hm-juego{display:flex;align-items:center;gap:14px;width:100%;margin-top:14px;padding:14px 16px;border-radius:22px;text-align:left;
 color:oklch(.995 .003 300);background:linear-gradient(120deg,oklch(.58 .19 290),oklch(.62 .17 215));box-shadow:0 10px 24px -14px oklch(.16 .08 298 / .9)}
.hm-juego strong{display:block;font-family:'Nunito',sans-serif;font-weight:900;font-size:17px}
.hm-juego small{display:block;font-size:12px;opacity:.85;margin-top:3px}
.hm-juego>span:nth-child(2){flex:1;min-width:0}
.hm-juego>svg{flex:none;opacity:.9}
.hm-juego-fichas{flex:none;display:flex}
.hm-juego-fichas i{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:oklch(.97 .015 300);box-shadow:0 2px 6px -2px oklch(.16 .08 298 / .8)}
.hm-juego-fichas i+i{margin-left:-13px}
.hm-juego-fichas svg{width:24px;height:24px;stroke:none;fill:none}

@media(min-width:700px){.jg-tablero{max-width:440px;gap:14px}}
@media(max-height:680px){.jg-titulo{font-size:22px;margin-top:8px}.jg-tablero{max-width:330px;gap:9px;margin-top:14px}}
