﻿html, body { margin: 0; }

    .ttx-wrapper {
        margin: 0;
        box-sizing: border-box;
        min-height: 100vh;
        font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
        background: linear-gradient(135deg, #eef2ff 0%, #f9fafc 45%, #e0f2fe 100%);
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 40px 20px 80px;
        color: #0f172a;
    }

    .ttx-app-shell {
        width: min(960px, 100%);
        display: flex;
        flex-direction: column;
        gap: 10px;
        align-items: center;
    }

    .ttx-top-bar {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 16px;
    }

    .ttx-top-bar .ttx-button {
        margin: 0;
    }

    .ttx-sound-toggle {
        width: 48px;
        height: 48px;
        border-radius: 50%;
        border: 1px solid rgba(148, 163, 184, 0.45);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.12);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 22px;
        color: #1f2937;
        cursor: pointer;
        transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
    } 

    .ttx-sound-toggle:hover {
        transform: translateY(-1px);
        box-shadow: 0 14px 30px rgba(15, 23, 42, 0.16);
        filter: brightness(1.05);
    }

    .ttx-sound-toggle[aria-pressed="true"] {
        background: rgba(226, 232, 240, 0.9);
        color: #64748b;
        box-shadow: inset 0 2px 6px rgba(15, 23, 42, 0.12);
    }

    .ttx-button {
        margin: 0;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 14px 32px;
        font-size: 18px;
        font-weight: 600;
        color: #fff;
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        border-radius: 999px;
        border: none;
        cursor: pointer;
        box-shadow: 0 14px 32px rgba(37, 99, 235, 0.35);
        transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
        text-decoration: none;
    }

    .ttx-button:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 18px 36px rgba(29, 78, 216, 0.35);
        filter: brightness(1.05);
    }

    .ttx-button:disabled {
        background: #94a3b8; /* Couleur de fond grisée */
        cursor: not-allowed; /* Change le curseur pour indiquer que le bouton est désactivé */
        color: #e2e8f0; /* Change la couleur du texte pour qu'elle soit également grisée */
        box-shadow: none;
    }
    .ttx-difficulty-selector {
        display: inline-flex;
        align-items: center;
        gap: 14px;
        background: rgba(255, 255, 255, 0.75);
        padding: 12px 24px;
        border-radius: 999px;
        box-shadow: 0 12px 26px rgba(15, 23, 42, 0.15);
        backdrop-filter: blur(12px);
        font-size: 18px;
        color: #1f2937;
    }

    .ttx-difficulty-selector label {
        font-weight: 600;
    }

    .ttx-difficulty-selector select {
        padding: 2px 24px;
        border-radius: 999px;
        border: 1px solid rgba(148, 163, 184, 0.45);
        background: rgba(255, 255, 255, 0.9);
        font-size: 16px;
        color: #111827;
        box-shadow: inset 0 1px 1px rgba(255,255,255,0.4);
        cursor: pointer;
        transition: box-shadow 0.12s ease, border-color 0.12s ease;
    }

    .ttx-duration-selector select {
        min-width: 140px;
    }

    .ttx-difficulty-selector select:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    }

    .ttx-control-panel {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
        gap: 16px;
        visibility: hidden;
        opacity: 0;
        transition: opacity 0.15s ease;
    }

    .ttx-control-buttons {
        display: inline-flex;
        justify-content: center;
        gap: 12px;
        margin: 0;
    }

    .ttx-control-buttons button,
    .ttx-scoreboard-toggle-button {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 9px 18px;
        border-radius: 99px;
        border: 1px solid rgba(148, 163, 184, 0.45);
        background: rgba(255, 255, 255, 0.9);
        color: #0f172a;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
        transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
    }

    .ttx-control-buttons button:hover:not(:disabled),
    .ttx-scoreboard-toggle-button:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
        filter: brightness(1.02);
    }

    .ttx-control-buttons button:disabled,
    .ttx-scoreboard-toggle-button:disabled {
        background-color: rgba(226, 232, 240, 0.9);
        color: #64748b;
        cursor: not-allowed;
        box-shadow: none;
    }

    .ttx-control-buttons .ttx-icon,
    .ttx-scoreboard-toggle-button .ttx-icon {
        display: inline-flex;
        width: 16px;
        height: 16px;
    }

    .ttx-control-buttons .ttx-icon svg,
    .ttx-scoreboard-toggle-button .ttx-icon svg {
        width: 100%;
        height: 100%;
        fill: currentColor;
    }

    .ttx-control-buttons .ttx-label,
    .ttx-scoreboard-toggle-button .ttx-label {
        display: inline-flex;
        align-items: center;
    }

    #ttx-pauseTest .ttx-icon-play,
    #ttx-pauseTest .ttx-label-play {
        display: none;
    }

    #ttx-pauseTest.ttx-is-paused .ttx-icon-play,
    #ttx-pauseTest.ttx-is-paused .ttx-label-play {
        display: inline-flex;
    }

    #ttx-pauseTest.ttx-is-paused .ttx-icon-pause,
    #ttx-pauseTest.ttx-is-paused .ttx-label-pause {
        display: none;
    }

    .ttx-status-line {
        text-align: center;
        font-size: 15px;
        color: #1f2937;
        margin: 0;
        display: none;
        padding: 8px 22px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.7);
        box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
        backdrop-filter: blur(10px);
    }


    .ttx-medal-section {
        display: none;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
        flex-wrap: wrap;
    }

    .ttx-medal-actions {
        display: inline-flex;
        align-items: center;
        gap: 12px;
    }

    .ttx-medal-badge {
        display: inline-flex;
        align-items: center;
        gap: 14px;
        padding: 12px 20px;
        border-radius: 16px;
        color: #0f172a;
        background: linear-gradient(145deg, rgba(242, 244, 247, 1), rgba(221, 229, 239, 0.95));
        box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.7), inset 0 -1px 2px rgba(15, 23, 42, 0.08);
        border: 1px solid rgba(148, 163, 184, 0.4);
    }

    .ttx-medal-badge.ttx-platinum {
        background: linear-gradient(145deg, rgba(186, 230, 253, 1), rgba(129, 212, 250, 0.95));
        color: #0b1120;
        border-color: rgba(59, 130, 246, 0.45);
    }

    .ttx-medal-badge.ttx-gold {
        background: linear-gradient(145deg, rgba(253, 224, 71, 0.98), rgba(251, 191, 36, 0.9));
        color: #1f2937;
        border-color: rgba(217, 119, 6, 0.55);
    }

    .ttx-medal-badge.ttx-silver {
        background: linear-gradient(145deg, rgba(209, 213, 219, 0.98), rgba(156, 163, 175, 0.92));
        color: #111827;
        border-color: rgba(107, 114, 128, 0.55);
    }

    .ttx-medal-badge.ttx-bronze {
        background: linear-gradient(145deg, rgba(248, 196, 113, 0.95), rgba(217, 119, 6, 0.92));
        color: #1f2937;
        border-color: rgba(180, 83, 9, 0.6);
    }

    .ttx-medal-badge.ttx-copper {
        background: linear-gradient(145deg, rgba(233, 196, 148, 0.9), rgba(202, 138, 73, 0.88));
        color: #1f2937;
        border-color: rgba(180, 112, 43, 0.6);
    }

    .ttx-medal-icon {
        width: 32px;
        height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 26px;
    }

    .ttx-medal-text {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .ttx-medal-title {
        margin: 0;
        font-size: 20px;
        font-weight: 700;
    }

    .ttx-medal-subtitle {
        margin: 0;
        font-size: 15px;
        opacity: 0.85;
    }

    .ttx-medal-info-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 50%;
        border: none;
        background: rgba(37, 99, 235, 0.12);
        color: #1d4ed8;
        cursor: pointer;
        box-shadow: 0 12px 24px rgba(30, 64, 175, 0.16);
        transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    }

    .ttx-medal-info-button:hover {
        transform: translateY(-1px);
        background: rgba(37, 99, 235, 0.18);
        box-shadow: 0 14px 30px rgba(30, 64, 175, 0.2);
    }

    .ttx-medal-info-button:focus-visible {
        outline: 3px solid rgba(59, 130, 246, 0.35);
        outline-offset: 2px;
    }

    .ttx-medal-info-button span[aria-hidden="true"] {
        font-size: 18px;
    }

    .ttx-medal-info-panel {
        display: none;
        margin-top: 14px;
        padding: 16px 22px;
        border-radius: 18px;
        background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(226, 232, 240, 0.88));
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
        color: #0f172a;
        min-width: 360px;
        width: 100%;
        max-width: 520px;
    }

    .ttx-medal-info-panel.ttx-open {
        display: block;
    }

    .ttx-medal-info-description {
        margin: 0 0 12px 0;
        font-size: 15px;
        font-weight: 600;
        color: #1f2937;
    }

    .ttx-medal-info-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding: 0 0 6px 0;
        margin-bottom: 4px;
        border-bottom: 1px solid rgba(15, 23, 42, 0.08);
        font-size: 13px;
        font-weight: 600;
        color: #64748b;
    }

    .ttx-medal-info-header span {
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .ttx-medal-info-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 18px;
        padding: 8px 0;
        font-size: 13px;
        border-radius: 12px;
        transition: background 0.12s ease;
    }

    .ttx-medal-info-row.ttx-active {
        background: rgba(59, 130, 246, 0.12);
        padding: 10px 12px;
    }

    .ttx-medal-info-name {
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .ttx-medal-info-speed,
    .ttx-medal-info-accuracy {
        min-width: 72px;
        text-align: right;
        font-variant-numeric: tabular-nums;
        font-weight: 600;
        color: #0f172a;
    }

    .ttx-medal-info-header .ttx-medal-info-speed,
    .ttx-medal-info-header .ttx-medal-info-accuracy {
        color: #64748b;
    }

    .ttx-sr-only {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .ttx-test-container {
        display: block;
        width: 800px;
        max-width: calc(100% - 40px);
        height: 400px;
        margin: 18px auto 10px;
        padding: 36px 36px 32px 36px;
        border-radius: 24px;
        box-sizing: border-box;
        background: rgba(255, 255, 255, 0.82);
        box-shadow: 0 28px 60px rgba(15, 23, 42, 0.18);
        border: 1px solid rgba(148, 163, 184, 0.25);
        backdrop-filter: blur(8px);
        overflow: hidden;
        position: relative;
    }
    .ttx-test-text {
        display: block;
        font-size: 32px; /* Doublé la taille de la police */
        margin: 0;
        line-height: 2; /* Doubler l'interligne */
        letter-spacing: 4px; /* Augmenter l'espace entre chaque lettre */
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 18px;
        color: #111827;
        font-family: 'Arial', 'Helvetica Neue', sans-serif;
        transition: filter 0.3s ease, opacity 0.3s ease;
    }
    .ttx-test-container.ttx-preview-mode .ttx-test-text {
        filter: blur(4px);
        opacity: 0.55;
        user-select: none;
        pointer-events: none;
    }
    .ttx-preview-overlay {
        position: absolute;
        inset: 0;
        display: none;
        align-items: center;
        justify-content: center;
        padding: 0;
        text-align: center;
        border-radius: 24px;
        border: none;
        background: transparent;
        cursor: pointer;
        z-index: 2;
        transition: transform 0.15s ease, box-shadow 0.15s ease;
    }
    .ttx-preview-overlay-label {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 20px 28px;
        border-radius: 18px;
        background: rgba(255, 255, 255, 0.85);
        color: #0f172a;
        font-size: 20px;
        font-weight: 500;
        box-shadow: 0 20px 46px rgba(15, 23, 42, 0.18);
        backdrop-filter: blur(3px);
    }
    .ttx-preview-overlay strong {
        font-weight: 700;
    }
    .ttx-preview-overlay:hover .ttx-preview-overlay-label {
        transform: translateY(-2px);
        box-shadow: 0 24px 52px rgba(15, 23, 42, 0.22);
    }
    .ttx-preview-overlay:focus-visible {
        outline: 3px solid rgba(37, 99, 235, 0.35);
        outline-offset: -6px;
    }
    .ttx-test-container.ttx-preview-mode .ttx-preview-overlay {
        display: flex;
    }
            .ttx-test-text::-webkit-scrollbar {
                width: 10px;
            }
            .ttx-test-text::-webkit-scrollbar-track {
                background: rgba(226, 232, 240, 0.6);
                border-radius: 999px;
            }
            .ttx-test-text::-webkit-scrollbar-thumb {
                background: rgba(148, 163, 184, 0.7);
                border-radius: 999px;
            }
            .ttx-test-text span {
                padding: 3px;
                border-radius: 6px;
                transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
            }
            .ttx-correct {
                color: #64748b;
            }
            .ttx-incorrect {
                text-decoration: underline;
                text-decoration-color: #ef4444;
            }
            .ttx-semi {
                text-decoration: underline;
                text-decoration-color: #f97316;
            }
            .ttx-current {
                background: rgba(248, 113, 113, 0.18);
                box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
            }
            .ttx-next {
                background: rgba(34, 197, 94, 0.12);
                box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.25);
            }
            .ttx-results {
                display: none;
                margin-top: 20px;
            }

     .ttx-scoreboard-panel {
        width: 100%;
        max-width: 900px;
        background: rgba(255, 255, 255, 0.85);
        border-radius: 24px;
        padding: 12px;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .ttx-scoreboard-panel[hidden] {
        display: none;
    }

    .ttx-scoreboard-header {
        text-align: center;
    }

    .ttx-scoreboard-title {
        margin: 0;
        font-size: 24px;
        font-weight: 700;
    }

    .ttx-scoreboard-content {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .ttx-scoreboard-table-wrapper {
        max-height: 248px;
        overflow: auto;
        border-radius: 16px;
        border: 1px solid rgba(148, 163, 184, 0.25);
        background: rgba(248, 250, 252, 0.45);
    }

    .ttx-scoreboard-table {
        width: 100%;
        border-collapse: collapse;
        min-width: 640px;
    }

    .ttx-scoreboard-table th,
    .ttx-scoreboard-table td {
        padding: 4px 4px;
        text-align: left;
        font-size: 15px;
        border-bottom: 1px solid rgba(148, 163, 184, 0.35);
        color: #0f172a;
        white-space: nowrap;
    }

    .ttx-scoreboard-table th {
        font-weight: 700;
        font-size: 14px;
        letter-spacing: 0.02em;
        text-transform: uppercase;
        color: #1f2937;
    }

    .ttx-scoreboard-table tbody tr:last-child td {
        border-bottom: none;
    }
    .ttx-scoreboard-medal-cell {
        min-width: 90px;
    }

    .ttx-scoreboard-note-cell {
        min-width: 150px;
    }

    .ttx-score-note-input {
        width: 100%;
        padding: 4px 8px;
        border: 1px solid rgba(148, 163, 184, 0.5);
        border-radius: 8px;
        font-size: 13px;
        background: rgba(255, 255, 255, 0.9);
        color: #0f172a;
        box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.08);
    }

    .ttx-score-note-input:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
    }


    .ttx-scoreboard-table-wrapper::-webkit-scrollbar {
        width: 10px;
    }

    .ttx-scoreboard-table-wrapper::-webkit-scrollbar-track {
        background: rgba(226, 232, 240, 0.55);
        border-radius: 999px;
    }

    .ttx-scoreboard-table-wrapper::-webkit-scrollbar-thumb {
        background: rgba(148, 163, 184, 0.55);
        border-radius: 999px;
    }

    .ttx-scoreboard-empty {
        margin: 0;
        text-align: center;
        color: #64748b;
        font-size: 15px;
        display: none;
    }

    @media (max-width: 640px) {
        .ttx-scoreboard-panel {
            padding: 20px;
        }
        .ttx-scoreboard-table {
            min-width: unset;
        }
        .ttx-scoreboard-table th,
        .ttx-scoreboard-table td {
            font-size: 14px;
        }
    }

    /* Styles pour les boîtes de résultats */
    .ttx-result-box {
        display: inline-flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-width: 200px;
        min-height: 110px;
        border-radius: 18px;
        text-align: center;
        padding: 2px 4px;
        margin: 0;
        color: #0f172a;
        background: linear-gradient(145deg, rgba(255,255,255,0.9), rgba(226, 232, 240, 0.85));
        box-shadow: 0 18px 30px rgba(15, 23, 42, 0.16);
    }

    #ttx-speedResult {
        background: linear-gradient(145deg, rgba(129, 140, 248, 0.92), rgba(96, 165, 250, 0.88));
        color: #fff;
    }

    #ttx-timeResult {
        background: linear-gradient(145deg, rgba(251, 191, 36, 0.92), rgba(249, 115, 22, 0.88));
        color: #fff;
    }

    #ttx-accuracyResult {
        background: linear-gradient(145deg, rgba(34, 197, 94, 0.9), rgba(16, 185, 129, 0.9));
        color: #fff;
    }

    #ttx-errorCountResult {
        background: linear-gradient(145deg, rgba(248, 113, 113, 0.95), rgba(239, 68, 68, 0.9));
        color: #fff;
    }

    .ttx-result-title {
        font-size: 15px;
        letter-spacing: 0.6px;
        text-transform: uppercase;
        opacity: 0.8;
    }

    .ttx-result-value {
        font-size: 26px;
        font-weight: 700;
        margin-top: 10px;
    }

    .ttx-results-chart {
        width: 100%;
        max-width: none;
        min-height: 145px;
        box-sizing: border-box;
        padding: 10px 14px 8px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(148, 163, 184, 0.25);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
        display: flex;
        flex-direction: column;
        gap: 6px;
        cursor: zoom-in;
        transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    }

    .ttx-results-chart[hidden] {
        display: none;
    }

    .ttx-results-chart:hover,
    .ttx-results-chart:focus-visible {
        transform: translateY(-1px);
        border-color: rgba(37, 99, 235, 0.42);
        box-shadow: 0 22px 42px rgba(15, 23, 42, 0.2);
        outline: none;
    }

    .ttx-results-chart svg {
        width: 100%;
        height: 128px;
        display: block;
        overflow: visible;
    }

    .ttx-chart-plot {
        fill: rgba(248, 250, 252, 0.72);
        stroke: rgba(148, 163, 184, 0.28);
    }

    .ttx-chart-grid-line {
        stroke: rgba(148, 163, 184, 0.28);
        stroke-width: 1;
    }

    .ttx-chart-grid-line-vertical {
        stroke-dasharray: 4 6;
        opacity: 0.72;
    }

    .ttx-chart-axis-line {
        stroke: rgba(15, 23, 42, 0.48);
        stroke-width: 1.4;
    }

    .ttx-chart-speed-line,
    .ttx-chart-accuracy-line {
        fill: none;
        stroke-width: 4;
        stroke-linecap: round;
        stroke-linejoin: round;
    }

    .ttx-chart-speed-line {
        stroke: #2563eb;
        filter: drop-shadow(0 5px 8px rgba(37, 99, 235, 0.25));
    }

    .ttx-chart-accuracy-line {
        stroke: #10b981;
        filter: drop-shadow(0 5px 8px rgba(16, 185, 129, 0.22));
    }

    .ttx-chart-error-marker {
        fill: none;
        stroke: #ef4444;
        stroke-width: 3;
        stroke-linecap: round;
        filter: drop-shadow(0 4px 6px rgba(239, 68, 68, 0.25));
    }

    .ttx-chart-axis-label,
    .ttx-chart-axis-title {
        fill: #475569;
        font-size: 13px;
        font-weight: 600;
        font-family: 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    }

    .ttx-chart-axis-title {
        fill: #0f172a;
    }

    .ttx-chart-axis-title-vertical {
        writing-mode: tb;
        glyph-orientation-vertical: 0;
    }

    .ttx-chart-legend {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 16px;
        color: #334155;
        font-size: 14px;
        font-weight: 600;
    }

    .ttx-chart-legend span {
        display: inline-flex;
        align-items: center;
        gap: 7px;
    }

    .ttx-chart-hover-context {
        display: grid;
        gap: 6px;
        margin: 0 22px;
        padding: 10px 12px;
        border-radius: 12px;
        background: rgba(248, 250, 252, 0.92);
        border: 1px solid rgba(148, 163, 184, 0.28);
        color: #0f172a;
        font-size: 14px;
        line-height: 1.35;
    }

    .ttx-chart-hover-context[hidden] {
        display: none;
    }

    .ttx-chart-hover-line {
        display: grid;
        grid-template-columns: 150px minmax(0, 1fr);
        gap: 14px;
        margin: 0;
        align-items: baseline;
    }

    .ttx-chart-hover-label {
        color: #475569;
        font-weight: 700;
        white-space: nowrap;
    }

    .ttx-chart-hover-text {
        min-width: 0;
        overflow-wrap: anywhere;
        font-weight: 600;
    }

    .ttx-chart-hover-error {
        color: #dc2626;
        font-weight: 800;
        text-decoration: underline;
        text-decoration-thickness: 2px;
        text-underline-offset: 3px;
    }

    .ttx-chart-dot {
        width: 22px;
        height: 4px;
        border-radius: 999px;
        display: inline-block;
    }

    .ttx-chart-dot.ttx-speed {
        background: #2563eb;
    }

    .ttx-chart-dot.ttx-accuracy {
        background: #10b981;
    }

    .ttx-chart-cross {
        width: 12px;
        height: 12px;
        display: inline-block;
        position: relative;
    }

    .ttx-chart-cross::before,
    .ttx-chart-cross::after {
        content: '';
        position: absolute;
        left: 5px;
        top: 0;
        width: 3px;
        height: 12px;
        border-radius: 99px;
        background: #ef4444;
    }

    .ttx-chart-cross::before {
        transform: rotate(45deg);
    }

    .ttx-chart-cross::after {
        transform: rotate(-45deg);
    }

    .ttx-results-analysis {
        width: 100%;
        max-width: 900px;
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: minmax(0, 5fr) minmax(280px, 3fr);
        gap: 18px;
        align-items: stretch;
    }

    .ttx-keyboard-heatmap {
        width: 100%;
        min-height: 0;
        box-sizing: border-box;
        padding: 8px 10px 7px;
        border-radius: 22px;
        background: rgba(255, 255, 255, 0.9);
        border: 1px solid rgba(148, 163, 184, 0.25);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
        display: flex;
        flex-direction: column;
        gap: 5px;
        cursor: zoom-in;
        transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
    }

    .ttx-keyboard-heatmap[hidden] {
        display: none;
    }

    .ttx-keyboard-heatmap:hover,
    .ttx-keyboard-heatmap:focus-visible {
        transform: translateY(-1px);
        border-color: rgba(37, 99, 235, 0.42);
        box-shadow: 0 22px 42px rgba(15, 23, 42, 0.2);
        outline: none;
    }

    .ttx-keyboard-title {
        color: #0f172a;
        font-size: 13px;
        font-weight: 700;
        text-align: center;
    }

    .ttx-keyboard-layout {
        display: flex;
        flex-direction: column;
        gap: 2px;
        width: 100%;
    }

    .ttx-keyboard-row {
        display: flex;
        justify-content: stretch;
        gap: 2px;
        width: 100%;
    }

    .ttx-keyboard-key {
        --ttx-key-width: 1;
        flex: var(--ttx-key-width) 1 0;
        min-width: 0;
        height: 22px;
        border-radius: 6px;
        border: 1px solid rgba(15, 23, 42, 0.12);
        background: var(--ttx-key-color, #cbd5e1);
        color: #0f172a;
        box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5), 0 5px 10px rgba(15, 23, 42, 0.1);
        box-sizing: border-box;
        position: relative;
        overflow: hidden;
        font-family: 'Segoe UI Variable Text', 'Segoe UI', Arial, sans-serif;
    }

    .ttx-keyboard-key-control {
        background: linear-gradient(145deg, #d1d5db, #bfc4ca);
        color: #111827;
    }

    .ttx-keyboard-key-highlight {
        background: linear-gradient(145deg, #dff7ff, #bae6fd);
    }

    .ttx-keyboard-key.ttx-unused {
        background: #cbd5e1;
        color: #64748b;
    }

    .ttx-key-label {
        position: absolute;
        inset: 2px 3px;
        display: block;
        font-weight: 650;
        line-height: 1;
        white-space: nowrap;
    }

    .ttx-keyboard-key-control .ttx-key-label {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;
        color: rgba(17, 24, 39, 0.78);
        font-size: 8px;
        font-weight: 650;
        white-space: normal;
    }

    .ttx-key-primary {
        position: absolute;
        color: #020617;
    }

    .ttx-key-secondary {
        position: absolute;
        color: #020617;
    }

    .ttx-key-label-single .ttx-key-primary {
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 13px;
    }

    .ttx-key-label-dual .ttx-key-primary {
        left: 0;
        top: -1px;
        font-size: 8px;
    }

    .ttx-key-label-dual .ttx-key-secondary {
        right: 0;
        bottom: 0;
        font-size: 8px;
    }

    .ttx-key-alt {
        position: absolute;
        right: 0;
        bottom: 1px;
        color: #1d4ed8;
        font-size: 10px;
    }

    .ttx-keyboard-key.ttx-has-error::before,
    .ttx-keyboard-key.ttx-has-error::after {
        content: '';
        position: absolute;
        right: 3px;
        top: -1px;
        width: 2px;
        height: 8px;
        border-radius: 99px;
        background: #dc2626;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
        transform-origin: center;
        z-index: 2;
    }

    .ttx-keyboard-key.ttx-has-error::before {
        transform: rotate(45deg);
    }

    .ttx-keyboard-key.ttx-has-error::after {
        transform: rotate(-45deg);
    }

    .ttx-keyboard-legend {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px 10px;
        color: #334155;
        font-size: 10px;
        font-weight: 600;
    }

    .ttx-keyboard-legend span {
        display: inline-flex;
        align-items: center;
        gap: 5px;
    }

    .ttx-keyboard-gradient-label {
        gap: 7px;
    }

    .ttx-keyboard-gradient-label b {
        font-size: 11px;
        font-weight: 650;
    }

    .ttx-keyboard-scale,
    .ttx-keyboard-gradient,
    .ttx-keyboard-error-sample {
        width: 16px;
        height: 7px;
        border-radius: 99px;
        display: inline-block;
        border: 1px solid rgba(15, 23, 42, 0.1);
    }

    .ttx-keyboard-gradient {
        width: 120px;
        background: linear-gradient(90deg, hsl(18 86% 55%), hsl(70 86% 56%), hsl(150 86% 58%));
    }

    .ttx-keyboard-scale.ttx-empty {
        background: #cbd5e1;
    }

    .ttx-keyboard-error-sample {
        width: 10px;
        height: 10px;
        border: none;
        position: relative;
    }

    .ttx-keyboard-error-sample::before,
    .ttx-keyboard-error-sample::after {
        content: '';
        position: absolute;
        left: 4px;
        top: 0;
        width: 2px;
        height: 10px;
        border-radius: 99px;
        background: #dc2626;
    }

    .ttx-keyboard-error-sample::before {
        transform: rotate(45deg);
    }

    .ttx-keyboard-error-sample::after {
        transform: rotate(-45deg);
    }

    /* Styles pour le conteneur de résultats */
    #ttx-resultsContainer {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        justify-items: center;
        gap: 18px; /* Espace entre les blocs */
        margin: 18px 0 10px; /* Marge autour du conteneur */
    }

    .ttx-certificate-cta {
        display: inline-flex;
        align-items: center;
    }

    .ttx-certificate-cta[hidden] {
        display: none;
    }

    .ttx-certificate-button {
        min-height: 38px;
        padding: 9px 16px;
        background: linear-gradient(135deg, #0ea5e9, #2563eb);
        box-shadow: 0 12px 24px rgba(14, 165, 233, 0.28);
        white-space: nowrap;
    }

    .ttx-modal {
        position: fixed;
        inset: 0;
        display: none;
        align-items: center;
        justify-content: center;
        background: rgba(15, 23, 42, 0.45);
        padding: 20px;
        z-index: 80;
    }

    .ttx-modal[aria-hidden="false"] {
        display: flex;
    }

    .ttx-modal-content {
        width: min(480px, 100%);
        background: #fff;
        border-radius: 24px;
        padding: 28px;
        box-shadow: 0 30px 60px rgba(15, 23, 42, 0.25);
        position: relative;
        display: flex;
        flex-direction: column;
        gap: 16px;
    }

    .ttx-modal-close {
        position: absolute;
        top: 14px;
        right: 14px;
        border: none;
        background: transparent;
        font-size: 24px;
        cursor: pointer;
        color: #475569;
    }

    .ttx-modal-title {
        margin: 0;
        font-size: 24px;
        font-weight: 700;
        color: #0f172a;
    }

    .ttx-modal-form {
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .ttx-modal-form label {
        font-size: 15px;
        font-weight: 600;
        color: #0f172a;
    }

    .ttx-modal-form input {
        width: 100%;
        padding: 12px 14px;
        border-radius: 12px;
        border: 1px solid rgba(148, 163, 184, 0.6);
        font-size: 16px;
        box-sizing: border-box;
        transition: border 0.15s ease, box-shadow 0.15s ease;
    }

    .ttx-modal-form input:focus {
        outline: none;
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
    }

    .ttx-modal-hint {
        font-size: 14px;
        color: #475569;
        margin: 0;
    }

    .ttx-modal-message {
        min-height: 20px;
        font-size: 14px;
        color: #b91c1c;
        margin: 0;
    }

    .ttx-modal-message.ttx-success {
        color: #0f766e;
    }

    .ttx-modal-content.ttx-chart-modal-content {
        width: min(900px, calc(100vw - 40px));
        max-height: calc(100vh - 40px);
        box-sizing: border-box;
        padding: 22px 0 18px;
        gap: 12px;
    }

    #ttx-chartModal[aria-hidden="false"] {
        align-items: flex-start;
        padding-top: 7vh;
    }

    #ttx-keyboardModal[aria-hidden="false"] {
        align-items: flex-start;
        padding-top: 7vh;
    }

    .ttx-modal-content.ttx-chart-modal-content .ttx-modal-close {
        top: 8px;
        right: 10px;
        z-index: 2;
    }

    .ttx-chart-modal-title {
        padding: 0 52px 0 22px;
    }

    .ttx-results-chart.ttx-results-chart-large {
        max-width: none;
        width: 100%;
        min-height: 418px;
        padding: 10px 0 12px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        cursor: default;
    }

    .ttx-results-chart.ttx-results-chart-large:hover,
    .ttx-results-chart.ttx-results-chart-large:focus-visible {
        transform: none;
        border-color: rgba(148, 163, 184, 0.25);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    }

    .ttx-results-chart.ttx-results-chart-large svg {
        height: 384px;
    }

    .ttx-results-chart.ttx-results-chart-large .ttx-chart-hover-context {
        font-size: 32px;
    }

    .ttx-results-chart.ttx-results-chart-large .ttx-chart-axis-label {
        font-size: 20px;
    }

    .ttx-results-chart.ttx-results-chart-large .ttx-chart-axis-title {
        font-size: 22px;
        font-weight: 700;
    }

    .ttx-modal-content.ttx-keyboard-modal-content {
        width: min(1000px, calc(100vw - 40px));
        max-height: calc(100vh - 40px);
        box-sizing: border-box;
        padding: 22px 0 18px;
        gap: 12px;
    }

    .ttx-modal-content.ttx-keyboard-modal-content .ttx-modal-close {
        top: 8px;
        right: 10px;
        z-index: 2;
    }

    .ttx-keyboard-heatmap.ttx-keyboard-heatmap-large {
        max-width: none;
        width: 100%;
        min-height: 430px;
        padding: 16px 20px 18px;
        border-radius: 0;
        border-left: none;
        border-right: none;
        cursor: default;
    }

    .ttx-keyboard-heatmap.ttx-keyboard-heatmap-large:hover,
    .ttx-keyboard-heatmap.ttx-keyboard-heatmap-large:focus-visible {
        transform: none;
        border-color: rgba(148, 163, 184, 0.25);
        box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
    }

    .ttx-keyboard-heatmap-large .ttx-keyboard-title {
        font-size: 20px;
    }

    .ttx-keyboard-heatmap-large .ttx-keyboard-layout {
        gap: 8px;
    }

    .ttx-keyboard-heatmap-large .ttx-keyboard-row {
        gap: 8px;
    }

    .ttx-keyboard-heatmap-large .ttx-keyboard-key {
        height: 58px;
        border-radius: 12px;
    }

    .ttx-keyboard-heatmap-large .ttx-key-label {
        inset: 8px 10px;
    }

    .ttx-keyboard-heatmap-large .ttx-keyboard-key-control .ttx-key-label {
        font-size: 20px;
    }

    .ttx-keyboard-heatmap-large .ttx-key-label-single .ttx-key-primary {
        font-size: 30px;
    }

    .ttx-keyboard-heatmap-large .ttx-key-label-dual .ttx-key-primary,
    .ttx-keyboard-heatmap-large .ttx-key-label-dual .ttx-key-secondary {
        font-size: 24px;
    }

    .ttx-keyboard-heatmap-large .ttx-key-label-dual .ttx-key-primary {
        top: -5px;
    }

    .ttx-keyboard-heatmap-large .ttx-keyboard-key.ttx-has-error::before,
    .ttx-keyboard-heatmap-large .ttx-keyboard-key.ttx-has-error::after {
        right: 9px;
        top: 2px;
        height: 20px;
        width: 4px;
    }

    .ttx-keyboard-heatmap-large .ttx-keyboard-legend {
        font-size: 14px;
        gap: 12px 18px;
    }

    @media (max-width: 760px) {
        .ttx-results-analysis {
            grid-template-columns: 1fr;
        }
    }

.ttx-hidden-input { opacity: 0; position: absolute; }

#ttx-resultsContainer.ttx-results-container-hidden { display: none; }

#ttx-resultsContainer[hidden] { display: none; }
