/* ============================================================
   StyleKit — background.css
   Layer canvas di sfondo + mappa z-index + shield.
   HTML richiesto:
     <canvas id="bg"></canvas>    (matrice, opzionale #pet #fx)
   ============================================================ */

/* matrice / sfondo animato */
#bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.22;            /* resta leggibile il contenuto */
    pointer-events: none;
    z-index: 0;
}

/* livello pet/sprite (opzionale) */
#pet {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 1;
}

/* layer shader del cursore: glow + ripple click.
   mix-blend-mode: screen → la luce "si mescola" con ciò che c'è sotto. */
#fx {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    z-index: 4;
    mix-blend-mode: screen;
}

/* variante: griglia sottile via CSS puro (senza canvas).
   Aggiungi class="grid-bg" al body. */
.grid-bg::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(rgba(132, 99, 168, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(132, 99, 168, 0.04) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
}

/* variante: scanline CRT + vignettatura.
   Aggiungi class="crt-bg" al body. */
.crt-bg::after {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at center, transparent 55%, rgba(0, 0, 0, 0.45) 100%),
        repeating-linear-gradient(0deg,
            transparent 0px, transparent 2px,
            rgba(0, 0, 0, 0.08) 3px, transparent 4px);
    pointer-events: none;
    z-index: 2;
}
