/* AtomicType on juegos.forjait.com: the page wears Forja IT's look, like the
   site's home (site/index.html); the game itself, the Atomic line's neon. */

@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(/fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/inter-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/inter-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 500; font-display: swap; src: url(/fonts/space-grotesk-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Space Grotesk'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/space-grotesk-latin-700-normal.woff2) format('woff2'); }

:root {
    /* Forja IT */
    --tinta: #0F172A; --tinta-alta: #172033; --borde: #1E293B; --acero: #155E93; --acero-claro: #2B7FBD;
    --ambar: #F59E0B; --chispa: #FBBF24; --pizarra: #64748B; --pizarra-claro: #94A3B8; --niebla: #F8FAFC;
    --verde: #34D399; --rojo: #F87171;
    /* Atomic */
    --noche: #0B1026; --violeta-noche: #1E1250; --cian: #22D3EE; --violeta: #8B5CF6; --rosa: #F472B6;
    --display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
    --sans: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; background: var(--tinta); -webkit-text-size-adjust: 100%; }
body {
    margin: 0; font-family: var(--sans); color: var(--niebla); line-height: 1.6; -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(ellipse 50% 35% at 0% 0%, rgba(245,158,11,.10), transparent 70%),
        radial-gradient(ellipse 45% 35% at 100% 20%, rgba(21,94,147,.20), transparent 70%),
        var(--tinta);
    min-height: 100vh; display: flex; flex-direction: column;
}
::selection { background: var(--ambar); color: var(--tinta); }
main { flex: 1; }
a { color: var(--chispa); }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -0.02em; }
.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 24px; }
.wrap.ancho { max-width: 980px; }
.grad { color: var(--ambar); }
.muted { color: var(--pizarra-claro); }
.eyebrow { font-family: var(--display); font-size: 12px; font-weight: 500; letter-spacing: .22em;
           text-transform: uppercase; color: var(--ambar); margin: 0 0 16px; }

/* Brand and header, as on the site's home */
.marca { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--niebla); }
.marca svg { width: 36px; height: 36px; flex-shrink: 0; }
.marca .nombre { display: flex; flex-direction: column; line-height: 1; }
.marca b { font-family: var(--display); font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.marca b span { color: var(--ambar); }
.marca small { margin-top: 5px; font-family: var(--display); font-size: 10px; font-weight: 500;
               letter-spacing: .28em; text-transform: uppercase; color: var(--pizarra); }
.cabecera { position: sticky; top: 0; z-index: 10; background: rgba(15,23,42,.85);
            backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid rgba(30,41,59,.7); }
.cabecera .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 68px; }
nav { display: flex; align-items: center; gap: 28px; font-size: 14px; font-weight: 500; }
nav a { color: var(--pizarra-claro); text-decoration: none; transition: color .15s; }
nav a:hover { color: var(--niebla); }
nav a.estudio { padding: 8px 16px; border-radius: 8px; background: var(--ambar); color: var(--tinta); font-weight: 600; transition: background .15s; }
nav a.estudio:hover { background: var(--chispa); color: var(--tinta); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 8px;
       font-weight: 600; text-decoration: none; color: var(--niebla); border: 1px solid var(--borde);
       background: rgba(23,32,51,.6); cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { border-color: var(--acero); }
.btn:focus-visible, .leccion:focus-visible, .modo:focus-visible { outline: 2px solid var(--chispa); outline-offset: 2px; }
.btn.primary { background: var(--ambar); border-color: var(--ambar); color: var(--tinta); }
.btn.primary:hover { background: var(--chispa); border-color: var(--chispa); }
.btn.ghost { background: transparent; }
.btn.chico { padding: 7px 12px; font-size: 14px; }
.btn.icono { padding: 7px 10px; }

/* Home */
.hero { display: grid; grid-template-columns: 1fr auto; gap: 40px; align-items: center; padding-top: 72px; padding-bottom: 56px; }
.hero img { width: 220px; height: 220px; border-radius: 48px; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
h1 { font-size: clamp(34px, 6.5vw, 58px); line-height: 1.1; margin: 0 0 24px; font-weight: 700; }
.lead { color: var(--pizarra-claro); font-size: 18px; line-height: 1.7; max-width: 620px; margin: 0; }
.lead strong { color: var(--niebla); font-weight: 600; }
.botones { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 32px; }

section { padding: 64px 0; border-top: 1px solid rgba(30,41,59,.7); }
#inicio section:nth-of-type(even) { background: rgba(23,32,51,.3); }
h2 { font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--ambar); margin: 0 0 16px; }
.section-lead { color: var(--pizarra-claro); font-size: 18px; line-height: 1.7; margin: 0 0 32px; max-width: 680px; }
.titulo-seccion { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.titulo-seccion h2 { margin: 0; }
.pildora { font-size: 14px; font-weight: 600; padding: 4px 12px; border-radius: 999px; color: var(--chispa);
           border: 1px solid rgba(251,191,36,.4); }
.titulo-seccion + .section-lead { margin-top: 16px; }
.panel { background: var(--tinta); border: 1px solid var(--borde); border-radius: 16px; padding: 28px; }
.panel h3 { margin: 0 0 6px; font-size: 18px; }
.nota { color: var(--pizarra); font-size: 14px; margin: 24px 0 0; }

.modos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.modo { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 24px; border-radius: 16px; cursor: pointer;
        border: 1px solid var(--borde); color: var(--niebla);
        background: linear-gradient(135deg, rgba(11,16,38,.95), rgba(30,18,80,.85)); transition: border-color .15s, transform .15s; }
.modo:hover { border-color: var(--violeta); transform: translateY(-2px); }
.modo .eyebrow { margin: 0; color: var(--cian); }
.modo strong { font-family: var(--display); font-size: 22px; }
.modo span:last-child { color: var(--pizarra-claro); font-size: 15px; }

.grupo { margin-bottom: 28px; }
.grupo h3 { font-size: 16px; color: var(--pizarra-claro); margin: 0 0 12px; font-weight: 500; }
.lista-lecciones { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.leccion { width: 100%; height: 100%; display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 16px; cursor: pointer;
           border-radius: 14px; border: 1px solid var(--borde); background: var(--tinta); color: var(--niebla); transition: border-color .15s; }
.leccion:hover { border-color: var(--acero); }
.leccion.sigue { border-color: rgba(245,158,11,.6); box-shadow: 0 0 0 1px rgba(245,158,11,.25); }
.leccion .cabeza { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.leccion .numero { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-family: var(--display);
                   font-weight: 700; font-size: 14px; background: var(--tinta-alta); color: var(--pizarra-claro); }
.leccion.sigue .numero { background: var(--ambar); color: var(--tinta); }
.leccion .estrellas-mini { color: var(--chispa); font-size: 14px; letter-spacing: 2px; }
.leccion.sigue .estrellas-mini { letter-spacing: 0; font-size: 12px; font-weight: 600; }
.leccion strong { font-family: var(--display); font-size: 16px; line-height: 1.3; }
.leccion .teclas { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.leccion .teclas small, .leccion .mejor { color: var(--pizarra); font-size: 13px; }

.tecla-mini { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 7px;
              font-family: var(--display); font-weight: 700; font-size: 14px; color: var(--niebla);
              background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-bottom: 3px solid var(--c); }

.marcas { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; align-items: start; }
.pasos { list-style: none; margin: 0; padding: 0; counter-reset: paso; }
.pasos li { counter-increment: paso; position: relative; padding: 0 0 18px 52px; }
.pasos li::before { content: counter(paso); position: absolute; left: 0; top: 0; width: 36px; height: 36px; border-radius: 10px;
                    display: grid; place-items: center; font-family: var(--display); font-weight: 700; background: var(--ambar); color: var(--tinta); }
.pasos strong { display: block; font-family: var(--display); font-size: 18px; }
.pasos p { margin: 2px 0 0; color: var(--pizarra-claro); }
.dedos { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; color: var(--pizarra-claro); }
.dedos b { color: var(--niebla); margin-right: 6px; }
.punto { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--c); margin-right: 10px;
         box-shadow: 0 0 10px var(--c); vertical-align: -1px; }
.como { margin: 0; padding-left: 22px; color: var(--pizarra-claro); display: grid; gap: 8px; max-width: 760px; }
.como b { color: var(--niebla); }

/* Game. While playing, the header scrolls away with the page: the scene and
   the keyboard need the room. */
body.jugando .cabecera { position: relative; }
#juego { padding: 16px 0 40px; }
.hud { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hud-titulo { font-family: var(--display); font-size: 18px; flex: 1; min-width: 160px; }
.hud-datos { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hud-dato { display: flex; flex-direction: column; line-height: 1.1; text-align: right; }
.hud-dato small { font-size: 11px; color: var(--pizarra); text-transform: uppercase; letter-spacing: .12em; }
.hud-dato b { font-family: var(--display); font-size: 18px; font-variant-numeric: tabular-nums; }
.hud-vidas { display: flex; gap: 3px; }
.vida { width: 22px; height: 22px; }
.vida.perdida { opacity: .2; filter: grayscale(1); }
.avance { height: 4px; border-radius: 4px; background: var(--borde); margin: 12px 0; overflow: hidden; }
.avance span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cian), var(--violeta), var(--rosa)); transition: width .3s; }
.nivel { margin: 8px 0; font-family: var(--display); color: var(--cian); font-weight: 700; }

/* The scene keeps its height while playing; with a card on top (start,
   pause, results) it grows to fit the card instead of cutting it. */
.escena { --alto: clamp(280px, calc(100vh - 400px), 540px);
          position: relative; height: var(--alto); border-radius: 20px; overflow: hidden;
          border: 1px solid rgba(139,92,246,.35); background: var(--noche); box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.escena.con-capa { height: auto; min-height: var(--alto); }
.escena canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; outline: none; touch-action: manipulation; }
.capa { position: relative; min-height: var(--alto); display: flex; padding: 16px;
        background: rgba(11,16,38,.72); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.tarjeta { width: 100%; max-width: 520px; margin: auto; text-align: center; padding: 28px 24px; border-radius: 18px;
           background: rgba(15,23,42,.92); border: 1px solid rgba(139,92,246,.4); }
.tarjeta h2 { font-size: clamp(24px, 4vw, 30px); letter-spacing: -0.02em; text-transform: none; color: var(--niebla); font-weight: 700; margin: 0 0 10px; }
.tarjeta .eyebrow { margin-bottom: 10px; color: var(--cian); }
.tarjeta .consejo { color: var(--pizarra-claro); margin: 0 0 16px; }
.tarjeta .datos { color: var(--pizarra); font-size: 14px; margin: 0 0 18px; }
.tarjeta .pista { color: var(--pizarra); font-size: 13px; margin: 10px 0 0; }
.muestra { display: flex; justify-content: center; flex-wrap: wrap; gap: 14px; margin: 0 0 16px; }
.nueva-tecla { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.nueva-tecla .tecla-mini { min-width: 52px; height: 52px; font-size: 24px; border-radius: 12px; border-bottom-width: 4px; }
.nueva-tecla small { color: var(--pizarra-claro); font-size: 13px; }
.ejemplo { margin: 0; font-family: var(--display); font-weight: 700; color: var(--niebla); font-size: 18px; }
.acciones { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.estrellas { font-size: 38px; letter-spacing: 6px; margin: 0 0 8px; color: rgba(148,163,184,.3); }
.estrellas .on { color: var(--chispa); text-shadow: 0 0 18px rgba(251,191,36,.6); }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 8px 0 0; }
.cifras div { padding: 10px; border-radius: 12px; background: var(--tinta-alta); }
.cifras dt { font-size: 12px; color: var(--pizarra); }
.cifras dd { margin: 0; font-family: var(--display); font-size: 22px; font-weight: 700; }
.practicar { margin-top: 14px; }
.practicar p { margin: 0 0 8px; color: var(--pizarra-claro); font-size: 14px; }
.practicar .lista { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; color: var(--pizarra-claro); font-size: 14px; }
.tarjeta .nota { margin-top: 14px; }
.tarjeta .estado { margin: 10px 0 0; font-size: 14px; color: var(--verde); white-space: pre-line; }
.tarjeta .estado:empty { display: none; }

.aviso { position: absolute; left: 50%; top: 38%; margin: 0; transform: translate(-50%, -50%); pointer-events: none; opacity: 0;
         font-family: var(--display); font-size: clamp(30px, 6vw, 48px); font-weight: 700; color: var(--cian);
         text-shadow: 0 0 24px rgba(34,211,238,.6); }
.aviso.ver { animation: aviso 1.3s ease-out; }
@keyframes aviso { 0% { opacity: 0; transform: translate(-50%, -30%) scale(.8); } 20% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 75% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -70%); } }

.dedo { min-height: 28px; margin: 14px 0 8px; text-align: center; color: var(--pizarra-claro); font-size: 15px; }
.dedo b { font-family: var(--display); color: var(--niebla); }

/* On-screen keyboard: each key wears its finger's color. */
.teclado { --k: min(56px, calc((100vw - 40px - 9 * 6px) / 10.6)); --g: 6px;
           display: flex; flex-direction: column; gap: var(--g); width: max-content; max-width: 100%; margin: 0 auto;
           user-select: none; -webkit-user-select: none; }
.fila { display: flex; gap: var(--g); padding-left: calc(var(--desfase, 0) * (var(--k) + var(--g))); }
.fila-espacio { justify-content: center; padding-left: 0; }
.tecla { position: relative; display: inline-grid; place-items: center; width: var(--k); height: calc(var(--k) * .88); padding: 0; border-radius: 9px; cursor: pointer;
         font-family: var(--display); font-weight: 700; font-size: calc(var(--k) * .34); color: #E2E8F0;
         background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-bottom: 3px solid var(--c);
         transition: transform .08s, background .12s, opacity .2s, box-shadow .12s; touch-action: manipulation; }
.tecla.marca::after { content: ''; position: absolute; left: 50%; bottom: 16%; width: 28%; height: 2px; border-radius: 2px;
                      background: currentColor; transform: translateX(-50%); opacity: .8; }
.fila-espacio .tecla { width: calc(var(--k) * 5.4); font-size: calc(var(--k) * .26); font-weight: 500; color: var(--pizarra-claro); }
.tecla.fuera { opacity: .28; }
.tecla.nueva { box-shadow: inset 0 0 0 1px var(--c); }
.tecla.siguiente { background: color-mix(in srgb, var(--c) 30%, transparent); color: #fff; transform: translateY(-2px);
                   box-shadow: 0 0 18px color-mix(in srgb, var(--c) 55%, transparent), inset 0 0 0 1px var(--c); opacity: 1; }
.tecla.ok { background: var(--c); color: var(--tinta); }
.tecla.mal { background: var(--rojo); color: var(--tinta); transform: translateY(1px); }
.leyenda { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 14px; font-size: 13px; color: var(--pizarra-claro); }
.chip::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: -1px; }

footer { margin-top: auto; padding: 40px 0; color: var(--pizarra); font-size: 14px;
         border-top: 1px solid rgba(30,41,59,.7); background: rgba(23,32,51,.4); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 28px; justify-content: space-between; align-items: center; }
footer a { color: var(--pizarra-claro); }
footer a:hover { color: var(--ambar); }
footer a.marca:hover { color: var(--niebla); }

@media (max-width: 860px) {
    .marcas { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .wrap { padding: 0 16px; }
    nav a:not(.estudio) { display: none; }
    .hero { grid-template-columns: 1fr; padding-top: 36px; padding-bottom: 44px; }
    .hero picture { order: -1; }
    .hero img { width: 120px; height: 120px; border-radius: 28px; }
    .modos { grid-template-columns: 1fr; }
    section { padding: 52px 0; }
    .teclado { --k: calc((100vw - 32px - 9 * 4px) / 10.4); --g: 4px; }
    .tecla { border-radius: 6px; }
    .hud { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
    .hud-titulo { min-width: 0; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .hud-datos { grid-column: 1 / -1; flex-wrap: nowrap; justify-content: space-between; gap: 8px; }
    .hud-dato b { font-size: 16px; }
    .vida { width: 18px; height: 18px; }
    #juego { padding-top: 12px; }
    .escena { --alto: clamp(280px, 50vh, 460px); }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .aviso.ver { animation-duration: .01s; }
    .modo:hover { transform: none; }
}
