
       :root {
    --neon-green: #00ff9d;
    --team-a-color: #d946ef;
    --team-b-color: #06b6d4;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #0a0f1d; /* Colore base di sicurezza */
    color: #e2e8f0;
    min-height: 100vh;
    overflow-x: hidden;
    /* RIMOSSO: background: radial-gradient... */
}

#static-background {
    position: fixed; /* Sta fermo per sempre */
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Sta dietro a tutto */
    pointer-events: none; /* Non interferisce coi click */
    
    /* Spostiamo qui il gradiente pesante */
    background: radial-gradient(circle at top center, #1a2236 0%, #0a0f1d 100%);
    
    /* Trucco per dire alla scheda video "questo non cambia mai" */
    transform: translateZ(0);
    will-change: transform;
}

h1, h2, h3, .font-teko {
    font-family: 'Teko', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.glass {
    background: rgba(30, 41, 59, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateZ(0);
}

.player-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    will-change: transform, border-color; /* Prepara il browser ai cambiamenti */
    transform: translateZ(0); /* Attiva l'accelerazione hardware */
}

/* Aggiungi o modifica questo per l'header sticky */
header.sticky {
    transform: translateZ(0); /* Crea un livello GPU separato */
}

.player-card.selected {
    border-color: var(--neon-green);
    background: linear-gradient(145deg, rgba(6, 78, 59, 0.8), rgba(2, 44, 34, 0.9));
}

.fullscreen-overlay { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; }

.center-overlay {
    align-items: center;
    justify-content: center;
}

/* SLIDER STYLE */
input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    height: 24px;
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: #0f172a;
    border-radius: 10px;
    border: 1px solid #334155;
    background-image: linear-gradient(90deg, var(--neon-green) 0%, var(--neon-green) var(--val-percent, 0%), transparent var(--val-percent, 0%));
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 0 10px var(--neon-green);
    border: 2px solid var(--neon-green);
}

.arch-btn {
    transition: all 0.2s;
    opacity: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
}

.arch-btn.active {
    border: 1px solid var(--neon-green);
    background: rgba(0, 255, 157, 0.2);
    transform: scale(1.05);
}

.disabled-area {
    opacity: 0.1 !important;
    pointer-events: none !important;
    filter: grayscale(100%);
}

#toast {
    visibility: hidden;
    min-width: 280px;
    background-color: #0f172a;
    color: #fff;
    text-align: center;
    border-radius: 12px;
    padding: 16px;
    position: fixed;
    z-index: 999;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    border: 1px solid rgba(0,255,157,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

#toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
}

@keyframes fadein {
    from {
        bottom: 0;
        opacity: 0;
    }

    to {
        bottom: 30px;
        opacity: 1;
    }
}

@keyframes fadeout {
    from {
        bottom: 30px;
        opacity: 1;
    }

    to {
        bottom: 0;
        opacity: 0;
    }
}

.chk-container {
    display: block;
    position: relative;
    padding-left: 35px;
    margin-bottom: 12px;
    cursor: pointer;
    font-size: 14px;
    user-select: none;
}

.chk-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 0;
    left: 0;
    height: 25px;
    width: 25px;
    background-color: #1e293b;
    border: 1px solid #475569;
    border-radius: 6px;
}

.chk-container:hover input ~ .checkmark {
    background-color: #334155;
}

.chk-container input:checked ~ .checkmark {
    background-color: #00ff9d;
    border-color: #00ff9d;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.chk-container input:checked ~ .checkmark:after {
    display: block;
}

.chk-container .checkmark:after {
    left: 9px;
    top: 5px;
    width: 5px;
    height: 10px;
    border: solid #0a0f1d;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

.match-item {
    border-left: 4px solid #334155;
    transition: all 0.2s;
    position: relative;
}

body.viewer-mode #editor-section {
    display: none !important;
}

input[type=number].clean-score::-webkit-inner-spin-button, input[type=number].clean-score::-webkit-outer-spin-button, input[type=number].history-score::-webkit-inner-spin-button, input[type=number].history-score::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number].clean-score, input[type=number].history-score {
    -moz-appearance: textfield;
}

/* PITCH 2D CLASSICO */
.pitch-container {
    width: 100%;
    height: 380px;
    background-color: #388e3c;
    background-image: repeating-linear-gradient(to right, transparent 0 10%, rgba(0,0,0,0.1) 10% 20%);
    position: relative;
    border-radius: 12px;
    border: 4px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    margin-bottom: 20px;
}

.pitch-line {
    position: absolute;
    border: 2px solid rgba(255,255,255,0.7);
    pointer-events: none;
}

.pitch-center-line {
    width: 0;
    height: 100%;
    left: 50%;
    top: 0;
    border-left: 2px solid rgba(255,255,255,0.7);
    transform: translateX(-50%);
}

.pitch-center-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.pitch-center-spot {
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    position: absolute;
}

.pitch-area-left {
    width: 60px;
    height: 160px;
    top: 50%;
    left: -2px;
    transform: translateY(-50%);
}

.pitch-area-right {
    width: 60px;
    height: 160px;
    top: 50%;
    right: -2px;
    transform: translateY(-50%);
}

.pitch-goal-left {
    width: 10px;
    height: 60px;
    top: 50%;
    left: -8px;
    transform: translateY(-50%);
    border: 2px solid rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.1);
    position: absolute;
}

.pitch-goal-right {
    width: 10px;
    height: 60px;
    top: 50%;
    right: -8px;
    transform: translateY(-50%);
    border: 2px solid rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.1);
    position: absolute;
}

.corner-tl {
    width: 20px;
    height: 20px;
    border-radius: 0 0 100% 0;
    border-right: 2px solid rgba(255,255,255,0.7);
    border-bottom: 2px solid rgba(255,255,255,0.7);
    top: 0;
    left: 0;
    position: absolute;
}

.corner-tr {
    width: 20px;
    height: 20px;
    border-radius: 0 0 0 100%;
    border-left: 2px solid rgba(255,255,255,0.7);
    border-bottom: 2px solid rgba(255,255,255,0.7);
    top: 0;
    right: 0;
    position: absolute;
}

.corner-bl {
    width: 20px;
    height: 20px;
    border-radius: 0 100% 0 0;
    border-right: 2px solid rgba(255,255,255,0.7);
    border-top: 2px solid rgba(255,255,255,0.7);
    bottom: 0;
    left: 0;
    position: absolute;
}

.corner-br {
    width: 20px;
    height: 20px;
    border-radius: 100% 0 0 0;
    border-left: 2px solid rgba(255,255,255,0.7);
    border-top: 2px solid rgba(255,255,255,0.7);
    bottom: 0;
    right: 0;
    position: absolute;
}

.player-token {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 60px;
    z-index: 10;
    transition: all 0.5s ease;
}

.token-img-box {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #1e293b;
    border: 3px solid #fff;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.7);
}

.token-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.token-emoji {
    font-size: 22px;
}

.token-name {
    margin-top: 2px;
    font-family: 'Teko', sans-serif;
    font-size: 14px;
    color: white;
    text-shadow: 0 2px 4px #000;
    background: rgba(0,0,0,0.8);
    padding: 0 6px;
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.2);
}

.module-label-dynamic {
    font-size: 10px;
    padding: 2px 6px;
    top: 5px;
}

/* COLORI DINAMICI */
.token-team-a .token-img-box {
    border-color: var(--team-a-color);
    box-shadow: 0 0 15px var(--team-a-color);
}

.token-team-b .token-img-box {
    border-color: var(--team-b-color);
    box-shadow: 0 0 15px var(--team-b-color);
}

.upload-box {
    width: 100%;
    height: 120px;
    border: 2px dashed #475569;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(15, 23, 42, 0.5);
    position: relative;
    overflow: hidden;
}

.upload-box:hover {
    border-color: var(--neon-green);
    background: rgba(0, 255, 157, 0.05);
}

.upload-box img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.5;
}

.upload-content {
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (max-width: 640px) {
    .pitch-container {
        height: 220px !important;
        width: 100% !important;
        border-width: 2px !important;
    }

    .player-token {
        width: 28px !important;
        z-index: 20 !important;
    }

    .token-img-box {
        width: 22px !important;
        height: 22px !important;
        border-width: 1px !important;
        box-shadow: none !important;
    }

    .token-name {
        font-size: 6px !important;
        line-height: 1;
        padding: 1px 2px !important;
        margin-top: 0px !important;
        max-width: 38px !important;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        background: rgba(0,0,0,0.85) !important;
        border-radius: 2px !important;
        position: relative;
        top: -2px;
    }

    .token-emoji {
        font-size: 10px !important;
    }

    .module-label-dynamic {
        font-size: 7px !important;
        padding: 1px 3px !important;
        top: 2px !important;
    }

    #stats-display-a, #stats-display-b {
        display: none !important;
    }

    .glass.border-t-4 {
        padding: 8px !important;
        margin-bottom: 10px !important;
    }
}

/* ANIMAZIONI LANDING PAGE */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

.floating-logo {
    animation: float 6s ease-in-out infinite;
    will-change: transform; /* Ottimizza l'animazione continua */
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-100 {
    animation-delay: 0.1s;
}

.delay-200 {
    animation-delay: 0.2s;
}

.delay-300 {
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.landing-grid {
    background-image: radial-gradient(circle at 50% 50%, rgba(0, 255, 157, 0.05) 0%, transparent 50%);
}

.logo-glow {
    filter: drop-shadow(0 0 20px rgba(0, 255, 157, 0.6));
}

.color-swatch {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    border: 4px solid transparent;
    transition: transform 0.2s;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: white;
}
