/* Kit común de la Zona Niños · sistema «Pixel suave 2» (2026-11-07), el mismo de toda la web (/cq.css) en versión
   algo más grande para peques: Bricolage Grotesque en títulos, DM Sans en texto, tarjetas blancas con borde de tinta
   y sombra «de bloque», iconos y cielo en pixel art detallado (los pinta ui.js). Uso (sin cambios de API):
     <link rel="stylesheet" href="/ninos/ui.css?v=6"> + <script src="/ninos/ui.js?v=7" defer></script>
     <div class="k-sky"></div>   (fondo crema con cielo, sol, nubes y colinas pixel; lo rellena ui.js)
     <header class="k-bar"><a class="k-round" href="/ninos/" data-k-icon="home" aria-label="Zona Niños"></a>
       <h1>TÍTULO</h1><button class="k-round k-mute" aria-label="Silencio"></button></header>
   Clases: .k-card (tarjeta blanca), .k-btn (botón; .alt .pink .blue), .k-title, .k-note, .k-me (avatar en la barra).
   Las variables antiguas (--ink, --pink, --round, --pixel…) se redefinen con más prioridad que los :root de cada juego,
   así todos los juegos heredan colores y letra nuevos sin tocar su lógica. */
@font-face { font-family: "Bricolage Grotesque"; font-style: normal; font-weight: 600 800; font-display: swap;
  src: url("/fonts/BricolageGrotesque-latin.woff2") format("woff2"); }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/fonts/DMSans-latin.woff2") format("woff2"); }
/* se mantienen por si algún lienzo de juego las pide por su nombre */
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("/fonts/Nunito-latin.woff2") format("woff2"); }
@font-face { font-family: "Pixelify Sans"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("/fonts/PixelifySans-latin.woff2") format("woff2"); }

/* :root:root gana a los ":root { --ink… }" que cada juego trae en su <style> */
:root:root {
  --ink: #1f2240; --soft: #464a68; --cream: #fbf8f2;
  --pink: #ff8a6b; --yellow: #ffcf4a; --mint: #2fae82; --blue: #2f6bf2; --lilac: #8b5cf6;
  --round: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --pixel: "Bricolage Grotesque", "DM Sans", system-ui, sans-serif;
  --line: #f0e6d6; --line2: #e3dccd; --k-shadow: 4px 4px 0 #1f2240;
  --pink-d: #b83d22; --yellow-d: #7a5200; --mint-d: #17694b; --blue-d: #1c45b5; --lilac-d: #5b34c2;
  --pink-l: #ffe7df; --yellow-l: #fff3cf; --mint-l: #dcf6ea; --blue-l: #e4ecff; --lilac-l: #f1e8ff;
}
html { background: #fbf8f2; }
body.k { color: var(--ink); font: 600 19px/1.4 var(--round); background: #fbf8f2; margin: 0;
         -webkit-tap-highlight-color: transparent; touch-action: manipulation; overscroll-behavior: none; }
body.k button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
body.k :focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
body.k h1, body.k h2, body.k h3 { font-family: var(--pixel); letter-spacing: -.3px; }

/* fondo fijo detrás de todo: cielo, sol, nubes y colinas pixel */
.k-sky { position: fixed; inset: 0; overflow: hidden; z-index: -1; pointer-events: none;
         background: linear-gradient(#cfe8ff, #e6f3ff 30%, #fbf8f2 62%); }
.k-sky svg { display: block; shape-rendering: crispEdges; }
.k-sky .sun { position: absolute; right: 5%; top: 92px; width: 120px; animation: k-spin 60s linear infinite; }
.k-sky .cloud { position: absolute; left: -200px; width: 160px; animation: k-drift linear infinite; }
.k-sky .c1 { top: 120px; animation-duration: 80s; animation-delay: -20s; }
.k-sky .c2 { top: 230px; width: 120px; animation-duration: 110s; animation-delay: -70s; }
.k-sky .c3 { top: 70px; width: 80px; animation-duration: 140s; animation-delay: -40s; }
.k-sky .hills { position: absolute; left: 0; right: 0; bottom: 0; height: 132px; background-repeat: repeat-x; background-position: left bottom;
                background-size: 384px 132px; image-rendering: pixelated; }
.k-sky .hills::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 0; }
@keyframes k-drift { from { transform: translateX(0); } to { transform: translateX(calc(100vw + 400px)); } }
@keyframes k-bob { 50% { transform: translateY(-4px); } }
@keyframes k-spin { to { transform: rotate(360deg); } }

/* barra superior: casita / título / avatar / sonido (coherente con la cabecera .cq-top) */
.k-bar { position: sticky; top: 0; display: flex; align-items: center; gap: 10px; padding: 9px 14px;
         padding-top: max(9px, env(safe-area-inset-top)); background: rgba(251, 248, 242, .95);
         -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); border-bottom: 3px solid var(--ink); box-shadow: none; z-index: 5; }
.k-bar h1 { flex: 1; margin: 0; text-align: center; font: 800 26px/1.1 var(--pixel); color: var(--ink); letter-spacing: .2px;
            text-shadow: none; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.k-round { width: 54px; height: 54px; flex: none; border-radius: 14px; border: 3px solid var(--ink); background: #fff;
           display: grid; place-items: center; box-shadow: 3px 3px 0 var(--ink); text-decoration: none; padding: 0; color: var(--ink);
           transition: transform .1s, box-shadow .1s, background .15s; }
.k-round svg { width: 32px; height: 32px; shape-rendering: crispEdges; }
.k-round:hover { background: var(--yellow-l); }
.k-round:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.k-round[hidden] { visibility: hidden; display: grid; }

/* piezas */
.k-card { background: #fff; border: 3px solid var(--ink); border-radius: 20px; box-shadow: var(--k-shadow); padding: 18px; }
.k-btn { font: 800 21px/1.1 var(--round); padding: 12px 22px; min-height: 54px; border-radius: 14px; border: 3px solid var(--ink);
         background: var(--yellow); color: var(--ink); box-shadow: 4px 4px 0 var(--ink); display: inline-flex; align-items: center;
         justify-content: center; gap: 8px; text-decoration: none; transition: transform .1s, box-shadow .1s, filter .15s; }
.k-btn:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.k-btn svg { width: 28px; height: 28px; flex: none; shape-rendering: crispEdges; }
.k-btn.alt { background: var(--mint-d); color: #fff; }
.k-btn.pink { background: var(--pink); color: #3a1206; }
.k-btn.blue { background: var(--blue); color: #fff; }
.k-btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.k-btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.k-title { font: 800 30px/1.15 var(--pixel); color: var(--ink); text-shadow: none; text-align: center; margin: 10px 0; letter-spacing: -.5px; }
.k-note { color: var(--soft); font-size: 17px; font-weight: 600; text-align: center; }

/* "yo" en la barra: avatar + compañera + monedas/estrellas */
.k-me { flex: none; display: flex; align-items: center; height: 54px; padding: 0 14px 0 3px; gap: 2px; border-radius: 999px;
        border: 3px solid var(--ink); background: #fff; box-shadow: 3px 3px 0 var(--ink); text-decoration: none; color: var(--ink); }
.k-me:hover { background: var(--yellow-l); color: var(--ink); }
.k-me:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.k-me-pic { width: 44px; height: 44px; border-radius: 50%; overflow: hidden; background: var(--blue-l); flex: none; border: 2px solid var(--ink); }
.k-me-pic svg, .k-me-pal svg { width: 100%; height: 100%; display: block; }
.k-me-pal { width: 38px; height: 38px; margin-left: -14px; align-self: flex-end; flex: none; animation: k-hop 2.4s ease-in-out infinite; }
.k-me-num { display: flex; flex-direction: column; font: 800 15px/1.2 var(--round); margin-left: 6px; white-space: nowrap; }
.k-me-num span { display: flex; align-items: center; gap: 4px; }
.k-me-num svg { width: 16px; height: 16px; shape-rendering: crispEdges; }
@keyframes k-hop { 0%, 70%, 100% { transform: translateY(0); } 80% { transform: translateY(-6px); } }
@media (max-width: 640px) { .k-me-num { display: none; } .k-me { padding-right: 6px; } .k-sky .sun { width: 84px; top: 84px; } }
@media (max-width: 480px) {
  .k-bar { padding: 7px 10px; padding-top: max(7px, env(safe-area-inset-top)); gap: 8px; }
  .k-bar h1 { font-size: 21px; }
  .k-round { width: 46px; height: 46px; border-radius: 12px; } .k-round svg { width: 28px; height: 28px; }
  .k-me { height: 46px; } .k-me-pic { width: 36px; height: 36px; } .k-me-pal { width: 30px; height: 30px; }
  .k-btn { font-size: 19px; padding: 11px 16px; }
}
@media (prefers-reduced-motion: reduce) { .k-me-pal, .k-sky .sun, .k-sky .cloud { animation: none; } }
