

.juego-pagina { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }

.juego-intro { max-width: 60ch; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
.juego-intro__h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0 0 0.5rem;
}
.juego-nota { margin-top: 1.25rem; }


.juego {
  --j-verde:    var(--h2-green);
  --j-gris:     #98a3b8;
  --j-azul:     #4ba6ff;
  --j-turquesa: var(--h2-blue);
  --j-rosa:     #ff79cf;
  --j-radio:    clamp(18px, 3vw, 28px);

  position: relative;
  border: 1px solid var(--border-2);
  border-radius: var(--j-radio);
  background:
    radial-gradient(120% 90% at 10% -10%, rgba(255, 194, 75, 0.12), transparent 55%),
    radial-gradient(110% 90% at 95% 0%, rgba(255, 77, 141, 0.1), transparent 55%),
    var(--bg-2);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
}
.juego:focus { outline: none; }
.juego[data-pantalla="nivel"] { scroll-margin-top: calc(var(--nav-h) + 12px); }

:root[data-theme="light"] .juego {
  background:
    radial-gradient(120% 90% at 10% -10%, rgba(255, 194, 75, 0.16), transparent 55%),
    radial-gradient(110% 90% at 95% 0%, rgba(255, 77, 141, 0.1), transparent 55%),
    var(--bg-2);
}


.hidro { display: block; overflow: visible; flex: none; }
.hidro__cuerpo { fill: var(--h2-blue); }
.hidro__sombra { fill: rgba(4, 19, 13, 0.18); }
.hidro__brillo { fill: rgba(255, 255, 255, 0.5); }
.hidro__ojo    { fill: #08202c; }
.hidro__chispa { fill: #ffffff; }
.hidro__boca   { fill: none; stroke: #08202c; stroke-width: 3.4; stroke-linecap: round; }
.hidro__boca--llena { fill: #08202c; stroke: none; }
.hidro__mejilla { fill: var(--h2-magenta); opacity: 0.4; }
.hidro__h {
  fill: var(--h2-green);
  stroke: rgba(4, 19, 13, 0.25);
  stroke-width: 1.5;
}
.hidro__letra { fill: #06061c; font: 700 11px/1 var(--font-display); }
.hidro__ceja { fill: none; stroke: #08202c; stroke-width: 3; stroke-linecap: round; }

.hidro--salta { animation: hidroSalta 2.6s var(--ease) infinite; }
@keyframes hidroSalta {
  0%, 70%, 100% { transform: translateY(0) rotate(0); }
  78%  { transform: translateY(-9px) rotate(-5deg); }
  86%  { transform: translateY(0) rotate(3deg); }
  92%  { transform: translateY(-3px) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hidro--salta { animation: none; }
}


.j-inicio {
  padding: clamp(1.25rem, 3.5vw, 2.5rem);
  display: grid;
  gap: clamp(1.25rem, 3vw, 2rem);
}
.j-portada {
  display: flex;
  gap: clamp(1rem, 3vw, 2rem);
  align-items: center;
  flex-wrap: wrap;
}
.j-portada__texto { flex: 1 1 260px; min-width: 0; }
.j-portada__titulo {
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 8vw, 3.6rem);
  font-weight: 700;
  line-height: 0.95;
  letter-spacing: -0.045em;
  margin: 0 0 0.4rem;
  background: linear-gradient(100deg, var(--h2-amber), var(--h2-magenta) 55%, var(--h2-indigo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.j-portada__frase { font-size: clamp(1rem, 2.2vw, 1.15rem); color: var(--text-2); margin: 0 0 1.25rem; max-width: 40ch; }
.j-portada__acciones { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.j-burbuja {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: 18px 18px 18px 4px;
  padding: 0.7rem 1rem;
  font-size: var(--fs-sm);
  color: var(--text);
  flex: 1 1 auto;
  min-width: 0;
  max-width: 26ch;
  margin: 0;
}
.j-portada__hidro {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
  flex: 1 1 auto;
  min-width: 0;
}
.j-portada__hidro > div:first-child { flex: 0 0 auto; }
.j-portada__hidro .hidro { width: clamp(72px, 24vw, 108px); height: auto; }


.j-record {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  padding: 0.9rem 1.1rem;
  border: 1px dashed var(--border-2);
  border-radius: var(--r);
  background: var(--surface);
}
.j-record__dato { display: flex; flex-direction: column; }
.j-record__num {
  font: 700 1.45rem/1 var(--font-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--h2-amber);
}
.j-record__et { font-size: var(--fs-xs); color: var(--text-3); text-transform: uppercase; letter-spacing: 0.1em; }

.j-record__acciones {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
  margin-inline-start: auto; align-self: center;
}


.j-mapa { display: grid; gap: 0.7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); }
.j-nodo {
  position: relative;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.9rem 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  transition: transform 0.3s var(--ease), border-color 0.3s, background 0.3s;
}
.j-nodo:hover { transform: translateY(-4px); border-color: var(--h2-amber); background: var(--surface-2); }
.j-nodo__cab { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.j-nodo__num {
  width: 30px; height: 30px; flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 0.85rem/1 var(--font-display);
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--text-2);
}
.j-nodo__nombre { font-family: var(--font-display); font-weight: 600; font-size: 0.97rem; line-height: 1.2; }
.j-nodo__sub { font-size: var(--fs-xs); color: var(--text-3); }
.j-nodo.is-ok { border-color: rgba(79, 189, 118, 0.45); background: rgba(79, 189, 118, 0.07); }
.j-nodo.is-ok .j-nodo__num { background: var(--grad-brand); border-color: transparent; color: var(--on-accent); }
.j-nodo__ok { color: var(--h2-green); font-size: var(--fs-xs); font-weight: 600; }
.j-nodo--mision { border-style: dashed; }

.j-ayuda-link { background: none; border: 0; color: var(--h2-blue); cursor: pointer; font: inherit; font-size: var(--fs-sm); text-decoration: underline; padding: 0; }


.j-hud {
  display: flex;
  align-items: center;
  gap: 0.5rem 0.75rem;
  flex-wrap: wrap;
  padding: 0.6rem clamp(0.7rem, 2vw, 1.1rem);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.j-hud__nivel { display: flex; align-items: baseline; gap: 0.45rem; min-width: 0; }
.j-hud__etiqueta { font: 500 var(--fs-xs)/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--h2-amber); }
.j-hud__nombre { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.j-hud__sep { flex: 1 1 auto; }
.j-marcador {
  display: inline-flex; align-items: center; gap: 0.35rem;
  font: 600 0.95rem/1 var(--font-mono);
  font-variant-numeric: tabular-nums;
  padding: 0.3rem 0.6rem;
  border-radius: var(--r-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.j-marcador__et { font-size: var(--fs-xs); color: var(--text-3); letter-spacing: 0.06em; }
.j-marcador.is-sube { animation: marcaSube 0.45s var(--ease); }
@keyframes marcaSube {
  50% { transform: scale(1.14); color: var(--h2-green); }
}
.j-vidas { display: inline-flex; gap: 0.2rem; align-items: center; }
.j-vida { width: 18px; height: 18px; }
.j-vida .j-vida__f { fill: var(--h2-magenta); }
.j-vida.is-off .j-vida__f { fill: var(--text-3); opacity: 0.35; }
.j-hud__acciones { display: flex; gap: 0.35rem; align-items: center; }
.j-hud__acciones .btn { padding: 0.45rem 0.8rem; font-size: var(--fs-xs); }
.j-hud__acciones .btn--icon { padding: 0.45rem; }

.j-barra { height: 6px; background: var(--surface-2); position: relative; overflow: hidden; }
.j-barra i { position: absolute; inset: 0 auto 0 0; background: var(--grad-brand); transition: width 0.35s var(--ease); }
.j-barra--reloj i { background: linear-gradient(90deg, var(--h2-amber), var(--h2-magenta)); transition: width 0.25s linear; }
.j-barra--reloj.is-poco i { background: var(--h2-magenta); }


.j-escena {
  position: relative;
  flex: 1 1 auto;
  padding: clamp(0.75rem, 2.2vw, 1.4rem);
  min-width: 0;
}
.j-escena--lienzo { padding: clamp(0.5rem, 1.5vw, 0.9rem); }
.j-lienzo-caja {
  position: relative;
  width: 100%;
  height: clamp(270px, 52vh, 460px);
  border-radius: var(--r);
  overflow: hidden;
}
.j-lienzo {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: pointer;
  border-radius: var(--r);
}
.j-lienzo:focus-visible { outline: 2px solid var(--h2-green); outline-offset: 2px; }


.j-dice {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.7rem 0 0;
  padding: 0.55rem 0.8rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: var(--fs-sm);
  color: var(--text-2);
  min-height: 52px;
}
.j-dice strong { color: var(--text); }
.j-dice.is-bien { border-color: rgba(79, 189, 118, 0.4); background: rgba(79, 189, 118, 0.08); }
.j-dice.is-mal  { border-color: rgba(255, 194, 75, 0.45); background: rgba(255, 194, 75, 0.09); }
.j-dice__txt { min-width: 0; }


.j-controles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.7rem;
  align-items: stretch;
}
.j-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 0.9rem;
  border-radius: var(--r-full);
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 550;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s, border-color 0.2s;
  touch-action: manipulation;
}
.j-btn:hover { transform: translateY(-2px); border-color: var(--h2-amber); }
.j-btn:active { transform: translateY(0) scale(0.97); }
.j-btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.j-btn kbd {
  font: 500 0.68rem/1 var(--font-mono);
  padding: 0.2rem 0.35rem;
  border-radius: 5px;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text-3);
}

.j-btn--energia {
  flex: 0 1 auto;
  background: linear-gradient(100deg, rgba(255, 194, 75, 0.34), rgba(255, 77, 141, 0.26));
  border-color: rgba(255, 194, 75, 0.75);
  font-weight: 700;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.j-btn--energia.is-lleno { border-color: var(--h2-green); box-shadow: 0 0 0 1px var(--h2-green) inset; }
.j-medidor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(0, 0, 0, 0.3);
  overflow: hidden;
}
:root[data-theme="light"] .j-medidor { background: rgba(10, 20, 40, 0.14); }
.j-medidor i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--h2-amber), var(--h2-green));
  transition: width 0.08s linear;
}
.j-btn--romper { border-color: rgba(79, 189, 118, 0.5); }
.j-btn--romper.is-listo { background: var(--grad-brand); color: var(--on-accent); border-color: transparent; font-weight: 700; }
.j-btn--romper.is-listo kbd { background: rgba(0, 0, 0, 0.18); color: inherit; border-color: rgba(0, 0, 0, 0.2); }


.j-btn.is-guia {
  border-color: var(--h2-amber);
  box-shadow: 0 0 0 2px rgba(255, 194, 75, 0.3);
  animation: j-late 1.5s ease-in-out infinite;
}
@keyframes j-late {
  0%, 100% { box-shadow: 0 0 0 2px rgba(255, 194, 75, 0.28); }
  50%      { box-shadow: 0 0 0 7px rgba(255, 194, 75, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .j-btn.is-guia { animation: none; }
}


.j-saltar {
  display: block;
  margin: 0.5rem 0 0 auto;
  padding: 0.2rem 0.1rem;
  border: 0;
  background: none;
  color: var(--text-3);
  font: 500 var(--fs-xs) / 1.3 var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.j-saltar:hover { color: var(--text); }
.j-saltar[hidden] { display: none; }

.j-pista { margin: 0.6rem 0 0; font-size: var(--fs-xs); color: var(--text-3); }
.j-pista kbd {
  font: 500 0.68rem/1 var(--font-mono);
  padding: 0.12rem 0.3rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface-2);
}


.j-colores { display: grid; gap: clamp(0.8rem, 2vw, 1.2rem); }
.j-mazo {
  position: relative;
  min-height: 176px;
  display: grid;
  place-items: center;
}
.j-carta {
  position: relative;
  width: min(100%, 420px);
  padding: 1rem 1.1rem;
  border-radius: var(--r);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
  cursor: grab;
  touch-action: none;
  user-select: none;
  text-align: left;
}
.j-carta.is-fondo { position: absolute; inset: 10px 14px auto; transform: rotate(-4deg) scale(0.96); opacity: 0.4; pointer-events: none; z-index: 0; }
.j-carta.is-fondo2 { transform: rotate(3deg) scale(0.93); opacity: 0.22; }
.j-carta--activa { z-index: 2; animation: cartaEntra 0.4s var(--ease); }
.j-carta.is-drag { cursor: grabbing; box-shadow: var(--shadow-lg); }
.j-carta__et { font: 500 var(--fs-xs)/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--h2-amber); }
.j-carta__txt { font-family: var(--font-display); font-weight: 600; font-size: clamp(1rem, 2.6vw, 1.2rem); line-height: 1.25; letter-spacing: -0.02em; margin: 0.5rem 0 0; }
.j-carta__pie { margin: 0.6rem 0 0; font-size: var(--fs-xs); color: var(--text-3); }
@keyframes cartaEntra { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
.j-carta.is-vuela { transition: transform 0.3s var(--ease), opacity 0.3s; opacity: 0; }

.j-cubos { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.j-cubo {
  --c: var(--j-verde);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.65rem 0.5rem 0.75rem;
  border-radius: var(--r-sm);
  border: 2px solid color-mix(in srgb, var(--c) 55%, transparent);
  background: color-mix(in srgb, var(--c) 10%, transparent);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: center;
  transition: transform 0.2s var(--ease), background 0.2s, box-shadow 0.2s;
}
.j-cubo:hover, .j-cubo.is-objetivo {
  transform: translateY(-3px);
  background: color-mix(in srgb, var(--c) 24%, transparent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 35%, transparent);
}
.j-cubo__gota { width: 26px; height: 30px; }
.j-cubo__gota .g { fill: var(--c); }
.j-cubo__n { font-family: var(--font-display); font-weight: 700; font-size: 0.9rem; letter-spacing: -0.02em; }
.j-cubo__p { font-size: 0.66rem; line-height: 1.25; color: var(--text-3); }
.j-cubo--verde    { --c: var(--j-verde); }
.j-cubo--gris     { --c: var(--j-gris); }
.j-cubo--azul     { --c: var(--j-azul); }
.j-cubo--turquesa { --c: var(--j-turquesa); }
.j-cubo--rosa     { --c: var(--j-rosa); }
.j-cubo.is-bien { animation: cuboBien 0.5s var(--ease); }
.j-cubo.is-mal  { animation: cuboMal 0.4s ease-in-out; }
@keyframes cuboBien { 40% { transform: translateY(-9px) scale(1.06); } }
@keyframes cuboMal  { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@media (prefers-reduced-motion: reduce) {
  .j-cubo.is-bien, .j-cubo.is-mal, .j-carta--activa { animation: none; }
}


.j-ciudad { display: grid; gap: clamp(0.8rem, 2vw, 1.1rem); }
.j-fichas {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  padding: 0.6rem 0.8rem;
  border-radius: var(--r-sm);
  border: 1px dashed var(--border-2);
  background: var(--surface);
  font-size: var(--fs-sm);
}
.j-fichas__lista { display: flex; gap: 0.25rem; }
.j-ficha { width: 22px; height: 22px; }
.j-ficha .f { fill: var(--h2-green); }
.j-ficha.is-off .f { fill: var(--text-3); opacity: 0.3; }




.j-ciudad-mapa {
  display: grid;
  gap: 0.7rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  align-items: start;
}
.j-zona {
  position: relative;
  padding: 3.6rem 0.8rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--r-lg, 14px);
  background: var(--surface);
  overflow: hidden;
}
.j-zona__cielo {
  position: absolute;
  inset: 0 0 auto;
  height: 54px;
  pointer-events: none;
  opacity: 0.5;
}
.j-horizonte { display: block; width: 100%; height: 100%; }
.j-horizonte .s { fill: var(--h2-indigo); }
.j-horizonte .h { fill: var(--h2-amber); opacity: 0.5; }
.j-horizonte .a { fill: var(--h2-blue); opacity: 0.35; }
.j-horizonte .w { fill: none; stroke: var(--h2-blue); stroke-width: 1.6; stroke-linecap: round; }
.j-horizonte .t { fill: none; stroke: var(--h2-green); stroke-width: 2; stroke-linecap: round; }
.j-zona--poligono { background: linear-gradient(180deg, rgba(66, 66, 161, 0.14), transparent 46%), var(--surface); }
.j-zona--puerto   { background: linear-gradient(180deg, rgba(88, 130, 214, 0.14), transparent 46%), var(--surface); }
.j-zona--barrio   { background: linear-gradient(180deg, rgba(79, 189, 118, 0.12), transparent 46%), var(--surface); }
.j-zona__cab { position: relative; margin: 0 0 0.7rem; }
.j-zona__n {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.j-zona__p { margin: 0.1rem 0 0; font-size: var(--fs-xs); color: var(--text-3); }
.j-destino__dib { display: flex; }
.j-destino__dib .j-destino__ico { width: 34px; height: 34px; }

.j-rejilla { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr)); }
.j-rejilla { position: relative; }
.j-cubo.is-guia {
  border-color: var(--h2-amber);
  box-shadow: 0 0 0 2px rgba(255, 194, 75, 0.32);
  animation: j-late 1.5s ease-in-out infinite;
}
.j-cubo[disabled] { opacity: 0.4; cursor: default; }
@media (prefers-reduced-motion: reduce) { .j-cubo.is-guia { animation: none; } }

.j-destino.is-guia {
  border-color: var(--h2-amber);
  box-shadow: 0 0 0 2px rgba(255, 194, 75, 0.32);
  animation: j-late 1.5s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) { .j-destino.is-guia { animation: none; } }
.j-destino {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.75rem 0.8rem 0.8rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.j-destino:hover { transform: translateY(-3px); border-color: var(--border-2); background: var(--surface-2); }
.j-destino__ico { width: 28px; height: 28px; stroke: var(--h2-blue); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.j-destino__n { font-family: var(--font-display); font-weight: 600; font-size: 0.9rem; line-height: 1.2; letter-spacing: -0.01em; }
.j-destino__cat { font: 500 0.62rem/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.j-destino__marca {
  position: absolute; top: 0.5rem; right: 0.5rem;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: grid; place-items: center;
  font: 700 0.7rem/1 var(--font-display);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s, transform 0.25s var(--ease);
}
.j-destino.is-elegido { border-color: var(--h2-green); background: rgba(79, 189, 118, 0.1); box-shadow: 0 0 0 2px rgba(79, 189, 118, 0.25); }
.j-destino.is-elegido .j-destino__marca { opacity: 1; transform: scale(1); background: var(--grad-brand); color: var(--on-accent); }
.j-destino.is-bien { border-color: var(--h2-green); background: rgba(79, 189, 118, 0.12); }
.j-destino.is-mal  { border-color: var(--h2-magenta); background: rgba(255, 77, 141, 0.1); }
.j-destino.is-bien .j-destino__marca { opacity: 1; transform: scale(1); background: var(--h2-green); color: var(--on-accent); }
.j-destino.is-mal  .j-destino__marca { opacity: 1; transform: scale(1); background: var(--h2-magenta); color: #2a0712; }
.j-destino__por { font-size: 0.73rem; line-height: 1.4; color: var(--text-2); margin: 0.3rem 0 0; }
.j-destino.is-revisado { cursor: default; }
.j-destino.is-revisado:hover { transform: none; }


.j-sena {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  min-width: 0;
  text-align: center;
  color: var(--h2-blue);
}
.j-sena svg { width: 26px; height: 26px; display: block; }
.j-sena svg .l,
.j-cubo__sena svg .l,
.j-destino__sena svg .l {
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.j-sena svg .f,
.j-cubo__sena svg .f,
.j-destino__sena svg .f { fill: currentColor; stroke: none; }
.j-sena__n { font-size: 0.64rem; line-height: 1.2; color: var(--text-3); }

.j-sena--fila { flex-direction: row; align-items: center; gap: 0.55rem; text-align: left; }
.j-sena--fila .j-sena__n { font-size: 0.82rem; color: var(--text-2); }

.j-senas { display: flex; flex-wrap: wrap; gap: 0.9rem; }

.j-senas--carta {
  margin-top: 0.75rem; padding-top: 0.75rem;
  gap: 1.4rem;
  border-top: 1px dashed var(--border-2);
}
.j-senas--carta .j-sena svg { width: 36px; height: 36px; }
.j-senas--carta .j-sena__n { font-size: 0.72rem; color: var(--text-2); }


.j-cubo__senas { display: flex; gap: 0.4rem; color: var(--c); }
.j-cubo__sena svg { width: 20px; height: 20px; display: block; }


.j-destino__sena { display: flex; align-items: center; gap: 0.4rem; color: var(--h2-blue); }
.j-destino__sena svg { width: 18px; height: 18px; flex: none; display: block; }

.j-destino__sena > span:last-child {
  font-size: 0.7rem; line-height: 1.2; color: var(--text-2);
}


.j-ap { display: grid; gap: 1rem; }
.j-ap__titulo {
  margin: 0;
  font-family: var(--font-display); font-weight: 700;
  font-size: clamp(1.15rem, 3vw, 1.5rem); letter-spacing: -0.02em;
}
.j-ap__rejilla {
  display: grid; gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
}
.j-ap__item {
  --c: var(--j-verde);
  display: grid; gap: 0.5rem; align-content: start;
  padding: 0.8rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  border-top: 3px solid var(--c);
  background: var(--surface);
}
.j-ap__item--verde    { --c: var(--j-verde); }
.j-ap__item--gris     { --c: var(--j-gris); }
.j-ap__item--azul     { --c: var(--j-azul); }
.j-ap__item--turquesa { --c: var(--j-turquesa); }
.j-ap__item--rosa     { --c: var(--j-rosa); }
.j-ap__item .j-sena { color: var(--c); }
.j-ap__cab { display: flex; align-items: center; gap: 0.45rem; }
.j-ap__gota { width: 20px; height: 24px; flex: none; display: block; }
.j-ap__gota svg { width: 100%; height: 100%; display: block; }
.j-ap__gota .g { fill: var(--c); }
.j-ap__n { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 0.95rem; }
.j-ap__p { margin: 0; font-size: 0.76rem; line-height: 1.45; color: var(--text-2); }

.j-ap__dos {
  display: grid; gap: 0.6rem;
  grid-template-columns: repeat(auto-fit, minmax(228px, 1fr));
}
.j-ap__col {
  padding: 0.9rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.j-ap__col--si { border-left: 3px solid var(--h2-green); }
.j-ap__col--no { border-left: 3px solid var(--h2-magenta); }
.j-ap__col h4 {
  margin: 0 0 0.7rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.95rem;
}
.j-ap__lista { display: grid; gap: 0.6rem; }


.j-perdida {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}
.j-perdida__tira { display: flex; gap: 0.2rem; }
.j-perdida__pie { font-size: 0.75rem; line-height: 1.4; color: var(--text-2); flex: 1 1 14rem; }


.j-inter {
  padding: clamp(1.25rem, 4vw, 2.5rem);
  display: grid;
  gap: 1.25rem;
  justify-items: center;
  text-align: center;
}
.j-medalla { width: clamp(96px, 22vw, 132px); height: auto; animation: medalla 0.7s var(--ease); }
@keyframes medalla { from { transform: scale(0.5) rotate(-18deg); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .j-medalla { animation: none; } }
.j-medalla__disco { fill: var(--h2-amber); }
.j-medalla__borde { fill: none; stroke: #06061c; stroke-width: 3; opacity: 0.25; }
.j-medalla__cinta { fill: var(--h2-magenta); }
.j-medalla__cinta2 { fill: var(--h2-indigo); }
.j-medalla__txt { fill: #4a2d00; font: 700 20px/1 var(--font-display); }

.j-inter__titulo { font-family: var(--font-display); font-size: clamp(1.4rem, 4.5vw, 2rem); letter-spacing: -0.03em; margin: 0; }
.j-sabias {
  display: flex;
  gap: 0.9rem;
  text-align: left;
  max-width: 56ch;
  padding: 1rem 1.1rem;
  border-radius: var(--r);
  border: 1px solid rgba(88, 130, 214, 0.35);
  background: rgba(88, 130, 214, 0.08);
}
.j-sabias__et { font: 500 var(--fs-xs)/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--h2-blue); display: block; margin-bottom: 0.4rem; }
.j-sabias p { margin: 0; color: var(--text-2); font-size: var(--fs-sm); }
.j-sabias p + p { margin-top: 0.5rem; }


.j-mision { display: grid; gap: 1rem; max-width: 62ch; margin-inline: auto; }



.j-enc {
  padding: 0.85rem 1rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border);
  border-left: 3px solid var(--h2-amber);
  background: var(--surface);
}
.j-enc__de {
  display: block;
  font: 500 var(--fs-xs)/1 var(--font-mono);
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--h2-amber);
}
.j-enc__txt {
  margin: 0.5rem 0 0;
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1rem, 2.6vw, 1.25rem); line-height: 1.3; letter-spacing: -0.02em;
}

.j-mision__gesto { display: grid; gap: 0.8rem; }

.j-mision .j-cubo[disabled] { opacity: 0.45; }
.j-mision .j-cubo.is-bien {
  opacity: 1; border-color: var(--h2-green);
  box-shadow: 0 0 0 2px rgba(79, 189, 118, 0.3);
}
.j-mision .j-cubo.is-mal {
  opacity: 1; border-color: var(--h2-magenta);
  box-shadow: 0 0 0 2px rgba(255, 77, 141, 0.28);
}

.j-carta--quieta { cursor: default; width: 100%; }

.j-destino--solo { max-width: 300px; margin-inline: auto; cursor: default; }
.j-destino--solo:hover { transform: none; }


.j-elige { display: grid; gap: 0.6rem; }
.j-elige--dos  { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.j-elige--tres { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.j-elige__op {
  display: flex; flex-direction: column; align-items: center; gap: 0.5rem;
  padding: 0.9rem 0.8rem;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: center;
  cursor: pointer;
  transition: transform 0.2s var(--ease), border-color 0.2s, background 0.2s;
}
.j-elige__op:hover { transform: translateY(-3px); border-color: var(--h2-amber); background: var(--surface-2); }
.j-elige__ico { color: var(--h2-blue); display: block; }
.j-elige__ico svg { width: 34px; height: 34px; display: block; }
.j-elige__ico .l { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.j-elige__ico .f { fill: currentColor; stroke: none; }
.j-elige__ico--ancho svg { width: 120px; height: 52px; }
.j-elige__t { font-size: var(--fs-sm); line-height: 1.3; }
.j-elige__op.is-ok { border-color: var(--h2-green); background: rgba(79, 189, 118, 0.12); }
.j-elige__op.is-no { border-color: var(--h2-magenta); background: rgba(255, 77, 141, 0.1); }
.j-elige__op[disabled] { cursor: default; }
.j-elige__op[disabled]:hover { transform: none; }


.j-atomos__o { fill: var(--h2-blue); }
.j-atomos__h { fill: var(--h2-green); }
.j-atomos__t { fill: #0b1220; font-family: var(--font-display); font-weight: 700; }


.j-sala {
  position: relative;
  height: clamp(190px, 34vw, 240px);
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border-2);
  background: var(--surface);
}
.j-sala__dib { position: absolute; inset: 0; }
.j-sala__dib svg { width: 100%; height: 100%; display: block; }
.j-sala__dib .p  { fill: var(--surface-2); stroke: var(--border-2); stroke-width: 2; }
.j-sala__dib .su { fill: var(--border); }
.j-sala__dib .m  { fill: var(--text-3); opacity: 0.55; }
.j-sala__dib .b  { fill: var(--h2-green); opacity: 0.5; }
.j-sala__bandas {
  position: relative;
  display: grid; grid-template-rows: repeat(3, 1fr);
  height: 100%; padding: 0.4rem; gap: 0.3rem;
}
.j-sala__banda {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 0.9rem;
  border-radius: var(--r-sm);
  border: 1px dashed var(--border-2);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  color: var(--text);
  font: inherit; font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .j-sala__banda { background: var(--surface); opacity: 0.92; }
}
.j-sala__banda:hover { border-style: solid; border-color: var(--h2-amber); background: var(--surface-2); }
.j-sala__banda.is-ok { border-style: solid; border-color: var(--h2-green); background: rgba(79, 189, 118, 0.18); }
.j-sala__banda.is-no { border-style: solid; border-color: var(--h2-magenta); background: rgba(255, 77, 141, 0.16); }
.j-sala__banda[disabled] { cursor: default; }

.j-mision__paso { font: 500 var(--fs-xs)/1 var(--font-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }


.j-result { padding: clamp(1.25rem, 4vw, 2.5rem); display: grid; gap: 1.25rem; justify-items: center; text-align: center; }
.j-result__titulo {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 6vw, 3rem);
  letter-spacing: -0.04em;
  line-height: 1;
  margin: 0;
  background: linear-gradient(100deg, var(--h2-amber), var(--h2-magenta) 60%, var(--h2-indigo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.j-result__cifras { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.j-medallero { display: flex; gap: 0.45rem; flex-wrap: wrap; justify-content: center; }
.j-medallita {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--r-full);
  border: 1px solid rgba(255, 194, 75, 0.45);
  background: rgba(255, 194, 75, 0.1);
  font-size: var(--fs-xs);
  color: var(--text);
}
.j-medallita.is-off { border-color: var(--border); background: var(--surface); color: var(--text-3); }
.j-diploma-caja { width: min(100%, 560px); }
.j-diploma-caja canvas, .j-diploma-caja img {
  width: 100%; height: auto;
  border-radius: var(--r-sm);
  border: 1px solid var(--border-2);
  box-shadow: var(--shadow);
}
.j-nombre { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; align-items: flex-end; width: min(100%, 420px); }
.j-nombre .field { flex: 1 1 180px; text-align: left; }


.j-capa {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.25s var(--ease);
  overflow-y: auto;
}
.j-capa__caja {
  width: min(100%, 460px);
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 3vw, 1.6rem);
  box-shadow: var(--shadow-lg);
  text-align: center;
  display: grid;
  gap: 0.85rem;
  justify-items: center;
}
.j-capa__caja h3 { margin: 0; font-size: clamp(1.15rem, 3.4vw, 1.5rem); }
.j-capa__caja p { margin: 0; font-size: var(--fs-sm); }
.j-capa__acciones { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.j-teclas { text-align: left; width: 100%; display: grid; gap: 0.35rem; margin: 0; }
.j-teclas div { display: flex; gap: 0.6rem; align-items: baseline; font-size: var(--fs-sm); color: var(--text-2); }
.j-teclas dt { flex: 0 0 auto; }
.j-teclas kbd {
  font: 500 0.7rem/1 var(--font-mono);
  padding: 0.2rem 0.4rem;
  border-radius: 5px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  white-space: nowrap;
}


.j-lista { margin: 0; padding-left: 1.1rem; font-size: var(--fs-sm); color: var(--text-2); display: grid; gap: 0.3rem; }
.j-chip-ok { color: var(--h2-green); font-weight: 600; }
.j-chip-no { color: var(--h2-magenta); font-weight: 600; }

@media (max-width: 420px) {
  .j-hud__nombre { font-size: 0.88rem; max-width: 10ch; }
  .j-marcador { font-size: 0.85rem; padding: 0.25rem 0.5rem; }
  .j-cubo__p { display: none; }
}


@media (max-height: 520px) and (orientation: landscape) {
  .j-lienzo-caja { height: 240px; }
}



.juegos {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(.9rem, 2vw, 1.3rem);
  margin: clamp(1.5rem, 3.5vw, 2.5rem) 0 clamp(1.25rem, 3vw, 2rem);
  align-items: stretch;
}
.juegoc {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
  transition: transform .35s var(--ease), border-color .3s, box-shadow .3s;
}
.juegoc:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--h2-green) 45%, var(--border-2));
  box-shadow: var(--shadow);
}

.juegoc__art {
  aspect-ratio: 320 / 190;
  width: 100%;
  background: color-mix(in srgb, var(--h2-green) 7%, var(--surface-2));
  border-bottom: 1px solid var(--border);
}
.juegoc__cuerpo {
  display: flex;
  flex-direction: column;
  gap: .5rem;
  padding: 1.1rem 1.2rem 1.3rem;
  flex: 1;
}
.juegoc__et {
  font: 500 var(--fs-xs)/1 var(--font-mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--h2-green-txt, var(--h2-green));
}
.juegoc__h { margin: 0; font-size: var(--fs-h3); letter-spacing: -.02em; }
.juegoc p { margin: 0; font-size: var(--fs-sm); color: var(--text-2); flex: 1; }
.juegoc .btn { align-self: flex-start; margin-top: .4rem; }

.juegoc--aqui {
  border-color: color-mix(in srgb, var(--h2-green) 55%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--h2-green) 9%, var(--surface)), var(--surface));
}


@media (min-width: 760px) {
  .juego.is-proyeccion { min-height: 520px; }

  
  .juego.is-proyeccion .j-dice { font-size: 1.05rem; min-height: 64px; }

  
  .juego.is-proyeccion .j-hud__nombre { font-size: 1.2rem; }
  .juego.is-proyeccion .j-hud__etiqueta,
  .juego.is-proyeccion .j-marcador__et { font-size: 0.8rem; }
  .juego.is-proyeccion .j-marcador { font-size: 1.1rem; }
  .juego.is-proyeccion .j-hud__acciones .btn { font-size: 0.9rem; padding: 0.55rem 0.95rem; }

  
  .juego.is-proyeccion .j-portada__frase { font-size: 1.2rem; max-width: 46ch; }
  .juego.is-proyeccion .j-burbuja { font-size: 1.05rem; max-width: 32ch; }
  .juego.is-proyeccion .j-nodo__nombre { font-size: 1.2rem; }
  .juego.is-proyeccion .j-nodo__sub { font-size: 0.92rem; }
  .juego.is-proyeccion .j-record__et { font-size: 0.82rem; }

  
  .juego.is-proyeccion .j-lienzo-caja { height: clamp(320px, 56vh, 560px); }
  .juego.is-proyeccion .j-btn { font-size: 1.05rem; padding: 0.75rem 1.15rem; }

  
  .juego.is-proyeccion .j-carta { width: min(100%, 540px); }
  .juego.is-proyeccion .j-carta__et { font-size: 0.85rem; }
  .juego.is-proyeccion .j-carta__txt { font-size: 1.5rem; }
  .juego.is-proyeccion .j-carta__pie { font-size: 0.95rem; }
  .juego.is-proyeccion .j-cubos { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
  .juego.is-proyeccion .j-cubo__gota { width: 34px; height: 39px; }
  .juego.is-proyeccion .j-cubo__n { font-size: 1.15rem; }
  .juego.is-proyeccion .j-cubo__p { font-size: 0.88rem; }

  
  .juego.is-proyeccion .j-fichas { font-size: 1rem; }
  .juego.is-proyeccion .j-rejilla { grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
  .juego.is-proyeccion .j-destino__ico { width: 36px; height: 36px; }
  .juego.is-proyeccion .j-destino__cat { font-size: 0.78rem; }
  .juego.is-proyeccion .j-destino__n { font-size: 1.15rem; }
  .juego.is-proyeccion .j-destino__por { font-size: 0.95rem; }

  
  .juego.is-proyeccion .j-inter__titulo { font-size: clamp(1.8rem, 5vw, 2.5rem); }
  .juego.is-proyeccion .j-sabias { max-width: 70ch; }
  .juego.is-proyeccion .j-sabias__et { font-size: 0.85rem; }
  .juego.is-proyeccion .j-sabias p { font-size: 1.05rem; }

  
  .juego.is-proyeccion .j-mision { max-width: 76ch; }
  .juego.is-proyeccion .j-mision__paso { font-size: 0.85rem; }
  .juego.is-proyeccion .j-enc__txt { font-size: clamp(1.4rem, 3.4vw, 1.9rem); }
  .juego.is-proyeccion .j-elige__t { font-size: 1.05rem; }
  .juego.is-proyeccion .j-sala { height: 300px; }

  
  .juego.is-proyeccion .j-capa__caja h3 { font-size: 1.7rem; }
  .juego.is-proyeccion .j-capa__caja p { font-size: 1.05rem; }
  .juego.is-proyeccion .j-teclas div { font-size: 1.02rem; }
  .juego.is-proyeccion .j-lista { font-size: 1.02rem; }
  .juego.is-proyeccion .j-pista { font-size: 0.95rem; }
}
