/* LOLpixel attract v3.93 - promosso dal collaudo v3.92.
   Palette di produzione. Contiene:
   - font Space Grotesk (self-hosted, CSP-safe)
   - CTA dock in basso + stili del pannello ospite (attract.js)
   - FX mosaico: hover glow, entrata in cascata, faro, sheen */

/* --- Font: Space Grotesk (self-hosted, CSP-safe) --- */
@font-face {
    font-family: 'Space Grotesk';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('/fonts/space-grotesk-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

body,
button,
input,
textarea,
select {
    font-family: 'Space Grotesk', 'Segoe UI', system-ui, -apple-system, sans-serif !important;
}

/* --- CTA dock: unico richiamo commerciale in pagina --- */
.stage-docked-cta {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 70;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: calc(100vw - 34px);
    padding: 10px 12px 10px 16px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: rgba(19, 9, 32, 0.88);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.38);
    color: var(--text);
    transform: translateX(-50%);
    backdrop-filter: blur(18px);
}

.stage-docked-cta span {
    white-space: nowrap;
    color: var(--text);
    opacity: 0.85;
    font-size: 0.86rem;
    font-weight: 650;
}

.stage-docked-cta button {
    min-height: 36px;
    padding: 0 13px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    font-weight: 850;
    cursor: pointer;
    animation: stagePulse 2.8s ease-out infinite;
}

@keyframes stagePulse {
    0%   { box-shadow: 0 0 0 0 rgba(255, 29, 180, 0.45); }
    65%  { box-shadow: 0 0 0 12px rgba(255, 29, 180, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 29, 180, 0); }
}

@media (max-width: 720px) {
    .stage-docked-cta {
        width: calc(100vw - 24px);
        justify-content: space-between;
        border-radius: 18px;
    }

    .stage-docked-cta span {
        white-space: normal;
    }
}

/* --- Pannello ospite (markup generato da collaudo-attract.js) --- */
#guestContent .stage-panel-hero {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255, 29, 180, 0.12), rgba(155, 48, 255, 0.10)),
        var(--bg-card);
}

#guestContent .stage-panel-hero h2 {
    margin: 0 0 8px;
    font-size: 1.4rem;
    line-height: 1.08;
    color: var(--text);
}

#guestContent .stage-panel-hero p,
#guestContent .stage-panel-card p {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.55;
    font-size: 0.88rem;
}

#guestContent .stage-panel-card {
    margin-bottom: 12px;
    padding: 15px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--bg-card);
}

#guestContent .stage-panel-card strong {
    color: var(--text);
}

#guestContent .stage-panel-list {
    display: grid;
    gap: 9px;
    margin: 12px 0 0;
}

#guestContent .stage-panel-list div {
    padding: 10px 11px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.84rem;
    line-height: 1.35;
}

#guestContent .stage-panel-note {
    color: var(--primary);
    font-weight: 800;
}

/* ============================================================
   FX mosaico: hover, entrata in cascata, faro, sheen
   ============================================================ */

/* Tessera sotto il cursore (classe gestita da collaudo-attract.js,
   perche' le .pixel-image hanno pointer-events: none) */
.pixel-image {
    transition: transform 0.18s ease-out, filter 0.18s ease-out, box-shadow 0.18s ease-out;
}

.pixel-image.stage-tile-glow {
    z-index: 6;
    transform: scale(1.05);
    filter: saturate(1.3) brightness(1.14) contrast(1.04);
    border-radius: 3px;
    box-shadow:
        0 0 0 2px rgba(0, 229, 255, 0.7),
        0 0 16px 3px rgba(0, 229, 255, 0.34),
        0 0 42px 10px rgba(255, 29, 180, 0.22),
        0 18px 44px rgba(0, 0, 0, 0.55);
}

/* Entrata in cascata al primo caricamento (--stage-d impostato dal JS) */
body.stage-intro .pixel-image {
    animation: stageTileIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--stage-d, 0) * 1ms);
}

@keyframes stageTileIn {
    from {
        opacity: 0;
        transform: scale(0.55);
        filter: saturate(0) brightness(2.4);
    }
}

/* Faro morbido che segue il cursore (coordinate impostate dal JS) */
.stage-spotlight {
    position: fixed;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease-out;
    mix-blend-mode: screen;
    background: radial-gradient(
        circle 300px at var(--sx, 50%) var(--sy, 40%),
        rgba(255, 255, 255, 0.07),
        rgba(255, 29, 180, 0.05) 45%,
        transparent 72%
    );
}

.stage-spotlight.on {
    opacity: 1;
}

/* Sheen: lama di luce che attraversa il mosaico ogni ~12s */
.image-overlay::after {
    content: "";
    position: absolute;
    top: -10%;
    bottom: -10%;
    left: 0;
    width: 28%;
    pointer-events: none;
    background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.05) 50%, transparent);
    transform: translateX(-130%) skewX(-12deg);
    animation: stageSheen 12s ease-in-out infinite;
    will-change: transform;
}

@keyframes stageSheen {
    0%, 58% { transform: translateX(-130%) skewX(-12deg); }
    100%    { transform: translateX(460%) skewX(-12deg); }
}

/* --- Accessibilita' --- */
@media (prefers-reduced-motion: reduce) {
    .stage-docked-cta button,
    .image-overlay::after,
    body.stage-intro .pixel-image {
        animation: none !important;
    }

    .stage-spotlight {
        display: none;
    }

    .pixel-image {
        transition: none !important;
    }
}
