 :root{
        --header-height: 72px;
        --footer-height: 56px;
        --border-color: #e5e7eb; /* gris clair */
        --text-color: #111827;   /* gris très foncé */
        --muted: #6b7280;        /* gris moyen */
        --maxw: 1200px;
        }
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            padding: 20px;
        }


         /* HEADER */
            header.site-header {
            position: fixed;
            top: 0; left: 0; right: 0;
            height: var(--header-height);
            background: #fff;
            border-bottom: 1px solid var(--border-color);
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0 24px; /* espace à gauche et à droite */
            z-index: 1000;
            }

            .brand {
            display: flex;
            align-items: center;
            gap: 12px;
            text-decoration: none;
            color: inherit;
            }

            .brand img {
            height: 40px;
            width: auto;
            display: block;
            }

            .header-link {
            text-decoration: none;
            color: var(--text-color);
            font-weight: 500;
            }

            .header-link:hover {
            text-decoration: underline;
            }




            /* PIED DE PAGE FIXE */
            footer.site-footer {
            position: fixed;
            bottom: 0; left: 0; right: 0;
            height: var(--footer-height);
            background: #fff;
            border-top: 1px solid var(--border-color);
            z-index: 1000;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 0 16px;
            }
            .site-footer p {
            margin: 0;
            color: var(--muted);
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: var(--maxw);
            width: 100%;
            }

            

            /* Responsive */
            @media (max-width: 640px) {
            :root{
                --header-height: 64px;
                --footer-height: 52px;
            }
            .brand { min-width: 120px; }
            nav.primary-nav ul { gap: 12px; }
            }

            /* Option "menu repliable" pour très petits écrans (facultatif) */
            @media (max-width: 460px) {
            .header-inner { gap: 12px; }
            .nav-toggle { display: inline-flex; }
            nav.primary-nav { display: none; }
            .header-inner[aria-expanded="true"] nav.primary-nav { display: block; position: absolute; top: calc(var(--header-height) - 1px); right: 0; left: 0; background: #fff; border-bottom: 1px solid var(--border-color); }
            .header-inner[aria-expanded="true"] nav.primary-nav ul { padding: 8px 16px 12px; gap: 0; }
            .header-inner[aria-expanded="true"] nav.primary-nav li { padding: 6px 0; }
            body { padding-top: calc(var(--header-height) + 0px); }
            }






            
        .container {
            background: white;
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
            max-width: 800px;
            width: 100%;
        }

        .header {
            text-align: center;
            margin-bottom: 30px;
        }

        .header h1 {
            color: #2c3e50;
            font-size: 2.5rem;
            margin-bottom: 10px;
        }

        .stats {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 30px;
            background: #f8f9fa;
            padding: 20px;
            border-radius: 15px;
        }

        .stat-item {
            text-align: center;
        }

        .stat-label {
            color: #6c757d;
            font-size: 0.9rem;
            margin-bottom: 5px;
        }

        .stat-value {
            color: #2c3e50;
            font-size: 1.5rem;
            font-weight: bold;
        }

        .timer {
            background: #e3f2fd;
            color: #1976d2;
            padding: 15px 25px;
            border-radius: 50px;
            font-size: 1.3rem;
            font-weight: bold;
        }

        .typing-area {
            position: relative;
            margin-bottom: 30px;
        }

        .text-display {
            background: #f8f9fa;
            border: 2px solid #e9ecef;
            border-radius: 15px;
            padding: 30px;
            min-height: 150px;
            font-size: 2.3rem;
            line-height: 1.6;
            color: #6c757d;
            cursor: text;
        }

        .current-text {
            color: #42a5f5;
            font-weight: 500;
        }

        .typed-correct {
            color: #2e7d32;
        }

        .typed-incorrect {
            color: #e53935;
            text-decoration: underline;
        }

        .input-field {
            position: absolute;
            opacity: 0;
            pointer-events: none;
        }

        .controls {
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 15px;
        }

        .time-control {
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .time-control label {
            color: #6c757d;
        }

        .time-control input {
            width: 60px;
            padding: 8px;
            border: 2px solid #e9ecef;
            border-radius: 8px;
            text-align: center;
        }

        button {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border: none;
            padding: 12px 25px;
            border-radius: 8px;
            cursor: pointer;
            font-size: 1rem;
            font-weight: 500;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        button:hover {
            transform: translateY(-2px);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
        }

        button:disabled {
            background: #cccccc;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        .level-indicator {
            background: #e8f5e8;
            color: #2e7d32;
            padding: 8px 16px;
            border-radius: 20px;
            font-weight: 500;
        }

        .result-modal {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 1000;
        }

        .modal-content {
            background: white;
            padding: 40px;
            border-radius: 20px;
            text-align: center;
            max-width: 500px;
            width: 90%;
        }

        .modal-content h2 {
            color: #2c3e50;
            margin-bottom: 20px;
        }

        .result-stats {
            margin: 20px 0;
        }

        .result-stats p {
            margin: 10px 0;
            color: #6c757d;
        }

        @media (max-width: 768px) {
            .container {
                padding: 20px;
            }
            
            .stats {
                flex-direction: column;
                gap: 15px;
            }
            
            .controls {
                flex-direction: column;
                align-items: stretch;
            }
            
            .header h1 {
                font-size: 2rem;
            }
        }

        @media (max-height: 900px) {
            .container {
                padding: 10px;
            }
            header.site-header {
              height:50px;
            }
            .stats {
              padding: 10px;
            }
            footer.site-footer {
              height:30px;
            }
            
            .header h1 {
                color: #2c3e50;
                font-size: 2rem;
                margin-bottom: 10px;
            }

        }