 /* Landing Page Setup */

        :root {
            --primary-color: #2563eb;
            --primary-hover: #1d4ed8;
            --background: #f8fafc;
            --card-bg: #ffffff;
            --text-primary: #1e293b;
            --text-secondary: #64748b;
            --error: #ef4444;
            --success: #22c55e;
            --orange: #ffa600;
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
        }

        body {
            background: url('../images/sfondo.jpg') center/cover no-repeat, #f4f7f6;
            background-attachment: fixed;
            background-size: cover;
            font-family: Arial, sans-serif;
            min-height: 100vh;
            margin: 0;
            padding: 0;
            padding-bottom: 100px;
        }

        /* Header Navigation */
        .header-nav {
            background: rgba(255, 255, 255, 0.95);
            backdrop-filter: blur(10px);
            padding: 1rem 2rem;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 1000;
            display: grid;
            grid-template-columns: 1fr auto 1fr;
            align-items: center;
            gap: 2rem;
        }

        .header-nav .logo {
            display: flex;
            align-items: center;
            justify-content: start;
            text-decoration: none;
            justify-self: start;
            z-index: 1001;
        }

        .header-nav .logo img {
            height: 50px;
            width: auto;
            transition: transform 0.3s ease;
        }

        .header-nav .logo img:hover {
            transform: scale(1.05);
        }

        .nav-toggle {
            display: none;
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            padding: 0.5rem;
            color: var(--text-primary);
            z-index: 1001;
        }

        .header-nav .nav-links {
            display: flex;
            gap: 1.5rem;
            align-items: center;
            flex-wrap: wrap;
            justify-content: center;
            grid-column: 2;
        }

        .header-nav .nav-links a:not(.btn-login-header) {
            color: var(--text-primary);
            text-decoration: none;
            font-weight: 600;
            font-size: 1rem;
            transition: all 0.3s;
            white-space: nowrap;
            padding: 0.5rem 1rem;
            border-radius: 0.5rem;
            background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
            backdrop-filter: blur(5px);
            border: 1px solid rgba(37, 99, 235, 0.1);
            position: relative;
            overflow: hidden;
        }

        .header-nav .nav-links a:not(.btn-login-header)::before {
            content: '';
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(37, 99, 235, 0.2), transparent);
            transition: left 0.5s;
        }

        .header-nav .nav-links a:not(.btn-login-header):hover {
            color: white;
            background: linear-gradient(135deg, var(--primary-color), var(--orange));
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
            border-color: var(--primary-color);
        }

        .header-nav .nav-links a:not(.btn-login-header):hover::before {
            left: 100%;
        }

        .btn-login-header {
            background: var(--primary-color) !important;
            color: white !important;
            padding: 0.6rem 1.8rem;
            border-radius: 0.5rem;
            text-decoration: none;
            transition: background 0.2s;
            font-weight: 600;
            border: none;
            cursor: pointer;
            display: inline-block;
        }

        .btn-login-header:hover {
            background: var(--primary-hover) !important;
            color: white !important;
        }

        /* Pulsante Accedi mobile - fuori dal menu */
        .btn-login-mobile {
            display: none;
        }

        /* Hero Section */
        .hero-section {
            min-height: 70vh;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            text-align: center;
            padding: 3rem 2rem;
        }

        .hero-content {
            max-width: 800px;
            color: white;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(10px);
            padding: 3rem 2rem;
            border-radius: 1.5rem;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4),
                        inset 0 1px 0 rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.1);
            transform: translateZ(0);
            transition: transform 0.3s ease;
        }

        .hero-content:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5),
                        inset 0 1px 0 rgba(255, 255, 255, 0.15);
        }

        .hero-content h1 {
            font-size: 3.5rem;
            font-weight: 700;
            margin-bottom: 1rem;
            color: var(--orange);
            text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.7);
        }

        .hero-content .subtitle {
            font-size: 1.5rem;
            margin-bottom: 2rem;
            color: #e2e8f0;
            text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7);
        }

        .hero-content .description {
            font-size: 1.1rem;
            line-height: 1.6;
            margin-bottom: 2.5rem;
            color: #cbd5e1;
        }

        .cta-buttons {
            display: flex;
            gap: 1rem;
            justify-content: center;
            flex-wrap: wrap;
        }

        .btn-primary, .btn-secondary {
            padding: 1rem 2rem;
            font-size: 1.1rem;
            font-weight: 600;
            border-radius: 0.75rem;
            text-decoration: none;
            transition: all 0.3s;
            cursor: pointer;
            border: none;
        }

        .btn-primary {
            background: var(--orange);
            color: white;
        }

        .btn-primary:hover {
            background: #ff8c00;
            transform: translateY(-2px);
            box-shadow: 0 8px 20px rgba(255, 166, 0, 0.4);
        }

        .btn-secondary {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: 2px solid white;
        }

        .btn-secondary:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
        }

        /* Features Section */
        .features-section {
            padding: 4rem 2rem;
            background: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(255, 166, 0, 0.05) 100%);
        }

        .container {
            max-width: 1200px;
            margin: 0 auto;
        }

        .section-title {
            text-align: center;
            font-size: 2.5rem;
            font-weight: 700;
            margin-bottom: 3rem;
            color: var(--text-primary);
            background: linear-gradient(145deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
            padding: 1.5rem 2rem;
            border-radius: 1rem;
            backdrop-filter: blur(10px);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3),
                        inset 0 1px 0 rgba(255, 255, 255, 0.1);
            color: white;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
            border: 1px solid rgba(255, 255, 255, 0.1);
        }

        .features-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
            gap: 2rem;
            margin-bottom: 3rem;
        }

        .feature-card {
            background: linear-gradient(145deg, #ffffff, #f8f9fa);
            padding: 2rem;
            border-radius: 1rem;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1),
                        inset 0 1px 0 rgba(255, 255, 255, 0.8);
            transition: all 0.3s ease;
            border: 1px solid rgba(37, 99, 235, 0.1);
            position: relative;
            overflow: hidden;
        }

        .feature-card::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 4px;
            background: linear-gradient(90deg, var(--primary-color), var(--orange));
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .feature-card:hover {
            transform: translateY(-8px) scale(1.02);
            box-shadow: 0 15px 40px rgba(37, 99, 235, 0.2),
                        inset 0 1px 0 rgba(255, 255, 255, 1);
        }

        .feature-card:hover::before {
            opacity: 1;
        }

        .feature-card h3 {
            font-size: 1.5rem;
            margin-bottom: 1rem;
            color: var(--primary-color);
        }

        .feature-card p {
            color: var(--text-secondary);
            line-height: 1.6;
        }

        .feature-icon {
            font-size: 3rem;
            margin-bottom: 1rem;
        }

        /* Stats Section */
        .stats-section {
            background: rgba(255, 255, 255, 0.95);
            padding: 3rem 2rem;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        .stat-card {
            text-align: center;
            padding: 2rem;
        }

        .stat-number {
            font-size: 3rem;
            font-weight: 700;
            color: var(--orange);
            margin-bottom: 0.5rem;
        }

        .stat-label {
            font-size: 1.1rem;
            color: var(--text-secondary);
        }

        /* Leaderboard Preview Section */
        .leaderboard-section {
            padding: 4rem 2rem;
            background: rgba(0, 0, 0, 0.3);
        }

        .leaderboard-section .section-title {
            color: white;
        }

        .leaderboard-container {
            background: linear-gradient(145deg, #ffffff, #f8f9fa);
            border-radius: 1rem;
            padding: 2rem;
            max-width: 900px;
            margin: 0 auto;
            box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3),
                        inset 0 1px 0 rgba(255, 255, 255, 0.8);
            border: 1px solid rgba(255, 255, 255, 0.2);
        }

        .leaderboard-table {
            width: 100%;
            border-collapse: separate;
            border-spacing: 0 0.5rem;
        }

        .leaderboard-table th {
            background: linear-gradient(135deg, var(--primary-color), var(--orange));
            color: white;
            padding: 1.2rem;
            text-align: left;
            font-weight: 600;
            font-size: 1rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
        }

        .leaderboard-table th:first-child {
            border-radius: 0.5rem 0 0 0.5rem;
        }

        .leaderboard-table th:last-child {
            border-radius: 0 0.5rem 0.5rem 0;
        }

        .leaderboard-table td {
            padding: 1.2rem;
            border-bottom: 1px solid #e2e8f0;
            background: white;
            transition: all 0.3s;
        }

        .leaderboard-table tbody tr {
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            transition: all 0.3s;
        }

        .leaderboard-table tr:hover {
            background: linear-gradient(90deg, rgba(37, 99, 235, 0.05), rgba(255, 166, 0, 0.05));
            transform: translateX(5px);
            box-shadow: 0 4px 15px rgba(37, 99, 235, 0.15);
        }

        .leaderboard-table tbody tr td:first-child {
            border-radius: 0.5rem 0 0 0.5rem;
        }

        .leaderboard-table tbody tr td:last-child {
            border-radius: 0 0.5rem 0.5rem 0;
        }

        .rank {
            font-weight: 700;
            font-size: 1.3rem;
            padding: 0.3rem 0.8rem;
            border-radius: 0.5rem;
            display: inline-block;
            min-width: 40px;
            text-align: center;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }

        .rank-1 {
            background: linear-gradient(135deg, #ffd700, #ffed4e);
            color: #000;
            font-size: 1.5rem;
            animation: pulse 2s infinite;
        }
        .rank-2 {
            background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
            color: #000;
        }
        .rank-3 {
            background: linear-gradient(135deg, #cd7f32, #e89b5e);
            color: #fff;
        }

        @keyframes pulse {
            0%, 100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.1);
            }
        }

        .view-more-link {
            display: block;
            text-align: center;
            margin-top: 1.5rem;
            color: var(--primary-color);
            text-decoration: none;
            font-weight: 600;
            font-size: 1.1rem;
        }

        .view-more-link:hover {
            text-decoration: underline;
        }

        /* Login Modal */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            justify-content: center;
            align-items: center;
        }

        .modal.visible {
            display: flex !important;
        }

        .login-form {
            background: var(--card-bg);
            padding: 2.5rem;
            border-radius: 1.2rem;
            box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
            width: 90%;
            max-width: 420px;
            position: relative;
            transition: transform 0.3s ease;
        }

        .close-modal {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: var(--text-secondary);
        }

        .close-modal:hover {
            color: var(--text-primary);
        }

        .login-form h2 {
            text-align: center;
            margin-bottom: 0.75rem;
            font-size: 2rem;
            font-weight: 700;
            color: var(--orange);
        }

        .login-form .subtitle {
            text-align: center;
            color: var(--text-secondary);
            margin-bottom: 2rem;
            font-size: 1.1rem;
        }

        .input-group {
            margin-bottom: 1.5rem;
        }

        .input-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 500;
            color: var(--text-primary);
        }

        .input-group input {
            width: 100%;
            padding: 0.875rem;
            border: 1px solid #e2e8f0;
            border-radius: 0.5rem;
            font-size: 1rem;
            transition: border-color 0.2s;
        }

        .input-group input:focus {
            outline: none;
            border-color: var(--primary-color);
            box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        }

        .forgot-password,
        .new-user {
            text-align: center;
            margin-bottom: 1rem;
        }

        .forgot-password a,
        .new-user a {
            color: var(--primary-color);
            text-decoration: none;
            font-size: 0.9rem;
        }

        .forgot-password a:hover,
        .new-user a:hover {
            text-decoration: underline;
        }

        .btn-login {
            width: 100%;
            padding: 0.875rem;
            background: var(--primary-color);
            color: white;
            border: none;
            border-radius: 0.5rem;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s;
        }

        .btn-login:hover {
            background: var(--primary-hover);
        }

        .message {
            padding: 0.75rem;
            border-radius: 0.5rem;
            margin-bottom: 1rem;
            font-size: 0.875rem;
            display: none;
        }

        .message.error {
            background: #fee2e2;
            color: var(--error);
            border: 1px solid #fecaca;
        }

        .message.success {
            background: #dcfce7;
            color: var(--success);
            border: 1px solid #00b640;
        }

        /* Fixed Ad Banner - Desktop normale, Mobile compatto */
        .ad-banner-fixed {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(255, 255, 255, 0.98);
            backdrop-filter: blur(10px);
            padding: 0.5rem;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
            z-index: 999;
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: 90px;
            transition: transform 0.3s ease;
        }

        .ad-banner-fixed.hidden {
            transform: translateY(100%);
        }

        /* Pulsante chiusura banner */
        .ad-banner-fixed .close-ad {
            position: absolute;
            top: 5px;
            right: 5px;
            background: rgba(0, 0, 0, 0.6);
            color: white;
            border: none;
            border-radius: 50%;
            width: 24px;
            height: 24px;
            font-size: 14px;
            cursor: pointer;
            opacity: 0.8;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: opacity 0.2s;
            z-index: 1000;
        }

        .ad-banner-fixed .close-ad:hover {
            opacity: 1;
            background: rgba(0, 0, 0, 0.8);
        }

        /* Rimuovo pulsanti minimize che non servono */
        .ad-minimize-btn,
        .ad-expand-tab {
            display: none !important;
        }

        /* Footer */
        .footer {
            background: rgba(30, 41, 59, 0.95);
            color: white;
            padding: 2rem;
            text-align: center;
        }

        .footer-links {
            display: flex;
            justify-content: center;
            gap: 2rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
        }

        .footer-links a {
            color: #cbd5e1;
            text-decoration: none;
            transition: color 0.2s;
        }

        .footer-links a:hover {
            color: white;
        }

        .footer-copyright {
            color: #94a3b8;
            font-size: 0.9rem;
            margin-top: 1rem;
        }

        /* Responsive */
        @media (max-width: 768px) {
            body {
                padding-bottom: 70px;
            }

            /* Header mobile con layout speciale */
            .header-nav {
                padding: 0.75rem 1rem;
                display: flex;
                justify-content: space-between;
                align-items: center;
                flex-wrap: wrap;
                gap: 0.75rem;
                z-index: 10000;
                position: relative;
            }

            .header-nav .logo {
                order: 1;
                flex: 0 0 auto;
            }

            .header-nav .logo img {
                height: 40px;
            }

            /* Pulsante Accedi mobile centrato */
            .btn-login-mobile {
                display: block;
                order: 2;
                flex: 1;
                text-align: center;
                background: var(--primary-color);
                color: white;
                padding: 0.5rem 1rem;
                border-radius: 0.5rem;
                text-decoration: none;
                font-weight: 600;
                font-size: 0.9rem;
                transition: background 0.2s;
                max-width: 120px;
                margin: 0 auto;
            }

            .btn-login-mobile:hover {
                background: var(--primary-hover);
            }

            /* Menu hamburger */
            .nav-toggle {
                display: block;
                order: 3;
                flex: 0 0 auto;
            }

            /* Backdrop per menu aperto */
            .header-nav .nav-links::before {
                content: '';
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                background: rgba(0, 0, 0, 0.5);
                z-index: 9998;
                opacity: 0;
                pointer-events: none;
                transition: opacity 0.3s;
            }

            .header-nav .nav-links.active::before {
                opacity: 1;
                pointer-events: auto;
            }

            /* Menu nascosto di default */
            .header-nav .nav-links {
                display: none;
                position: fixed;
                top: 0;
                right: 0;
                width: 80%;
                max-width: 300px;
                height: 100vh;
                flex-direction: column;
                gap: 0;
                padding: 4rem 1.5rem 2rem;
                background: rgba(255, 255, 255, 0.98);
                backdrop-filter: blur(20px);
                box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
                z-index: 9999;
                transform: translateX(100%);
                transition: transform 0.3s ease;
                overflow-y: auto;
            }

            .header-nav .nav-links.active {
                display: flex;
                transform: translateX(0);
            }

            .header-nav .nav-links a:not(.btn-login-header) {
                width: 100%;
                text-align: center;
                font-size: 0.95rem;
                padding: 1rem;
                margin-bottom: 0.5rem;
            }

            /* Nascondo il pulsante Accedi dal menu mobile */
            .header-nav .nav-links .btn-login-header {
                display: none;
            }

            /* Pulsante chiusura menu */
            .nav-links .close-menu {
                position: absolute;
                top: 1rem;
                right: 1rem;
                background: none;
                border: none;
                font-size: 2rem;
                cursor: pointer;
                color: var(--text-primary);
                padding: 0.5rem;
                line-height: 1;
            }

            /* Hero responsive */
            .hero-section {
                min-height: 60vh;
                padding: 2rem 1rem;
            }

            .hero-content {
                padding: 2rem 1.5rem;
            }

            .hero-content h1 {
                font-size: 2rem;
                margin-bottom: 0.75rem;
            }

            .hero-content .subtitle {
                font-size: 1.1rem;
                margin-bottom: 1.5rem;
            }

            .hero-content .description {
                font-size: 0.95rem;
                margin-bottom: 1.5rem;
            }

            /* Pulsanti CTA */
            .cta-buttons {
                flex-direction: column;
                gap: 0.75rem;
            }

            .btn-primary, .btn-secondary {
                width: 100%;
                padding: 0.875rem 1.5rem;
                font-size: 1rem;
            }

            /* Stats grid */
            .stats-section {
                padding: 2rem 1rem;
            }

            .stats-grid {
                grid-template-columns: repeat(2, 1fr);
                gap: 1rem;
            }

            .stat-card {
                padding: 1.5rem 1rem;
            }

            .stat-number {
                font-size: 2rem;
            }

            .stat-label {
                font-size: 0.9rem;
            }

            /* Features */
            .features-section {
                padding: 3rem 1rem;
            }

            .section-title {
                font-size: 1.75rem;
                padding: 1rem 1.5rem;
                margin-bottom: 2rem;
            }

            .features-grid {
                grid-template-columns: 1fr;
                gap: 1.5rem;
            }

            .feature-card {
                padding: 1.5rem;
            }

            .feature-icon {
                font-size: 2.5rem;
            }

            .feature-card h3 {
                font-size: 1.25rem;
            }

            .feature-card p {
                font-size: 0.95rem;
            }

            /* Leaderboard */
            .leaderboard-section {
                padding: 3rem 1rem;
            }

            .leaderboard-container {
                padding: 1rem;
                overflow-x: auto;
            }

            .leaderboard-table {
                font-size: 0.8rem;
                min-width: 500px;
            }

            .leaderboard-table th,
            .leaderboard-table td {
                padding: 0.75rem 0.5rem;
            }

            .rank {
                font-size: 1rem;
                padding: 0.25rem 0.5rem;
                min-width: 30px;
            }

            .rank-1 {
                font-size: 1.2rem;
            }

            .view-more-link {
                font-size: 1rem;
                margin-top: 1rem;
            }

            /* Banner mobile compatto */
            .ad-banner-fixed {
                min-height: 60px;
                padding: 0.3rem;
            }

            .ad-banner-fixed ins.adsbygoogle {
                max-width: 320px;
                max-height: 50px;
            }

            /* Footer */
            .footer {
                padding: 1.5rem 1rem;
            }

            .footer-links {
                gap: 1rem;
                font-size: 0.9rem;
            }
        }

        /* Tablet */
        @media (min-width: 769px) and (max-width: 1024px) {
            .btn-login-mobile {
                display: none;
            }

            .header-nav {
                grid-template-columns: auto 1fr auto;
            }

            .header-nav .nav-links {
                gap: 1rem;
                grid-column: 2;
            }

            .header-nav .nav-links a {
                font-size: 0.9rem;
                padding: 0.5rem 0.75rem;
            }

            .hero-content h1 {
                font-size: 3rem;
            }

            .features-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }

        /* Desktop large */
        @media (min-width: 769px) {
            .btn-login-mobile {
                display: none;
            }

            .ad-banner-fixed {
                min-height: 90px;
            }
        }
