 /* Styles personnalisés */
        body {
            font-family: 'Inter', sans-serif;
            background-color: #f0f4f8; /* Fond gris très clair */
        }
        .court-container {
            container-type: inline-size; /* Permet au terrain de connaître la largeur disponible (100cqw) */
        }
        .court {
            /* Vraie moitié de terrain de volley : 9 m de large x 9 m de profondeur (carré).
               Zone avant (attaque) = 3 m = 1/3 ; zone arrière = 6 m = 2/3. */
            width: min(100cqw, 70vh); /* Toujours carré : pleine largeur, mais limité à 70% de la hauteur de l'écran */
            height: min(100cqw, 70vh);
            background-color: #fde68a; /* Zone arrière : sable */
            border: 3px solid #ffffff; /* Lignes de touche et de fond */
            outline: 1px solid #374151;
            position: relative;
            margin: 0 auto;
            margin-top: 10px; /* Espace pour le filet */
            display: grid;
            grid-template-columns: 1fr 1fr 1fr; /* 3 joueurs en ligne */
            grid-template-rows: minmax(0, 1fr) minmax(0, 2fr); /* 1/3 zone avant, 2/3 zone arrière, jamais modifiés par le contenu */
        }
        #pos-4, #pos-3, #pos-2 {
            background-color: #fdba74; /* Zone des 3 mètres : couleur différente */
            border-bottom: 3px solid #ffffff; /* Ligne des 3 mètres */
        }
        .net {
            position: absolute;
            top: 0; /* Positionné en haut du terrain */
            left: -8px; /* Le filet dépasse un peu de chaque côté (poteaux) */
            width: calc(100% + 16px);
            height: 10px;
            background-color: #ffffff;
            background-image:
                repeating-linear-gradient(90deg, #1f2937 0 1px, transparent 1px 8px),
                repeating-linear-gradient(0deg, #1f2937 0 1px, transparent 1px 4px);
            border-top: 3px solid #ffffff; /* Bande blanche du haut du filet */
            border-bottom: 2px solid #1f2937;
            transform: translateY(-50%); /* Centré sur la bordure supérieure */
            z-index: 5;
            pointer-events: none;
        }
        .net::before, .net::after { /* Poteaux aux deux extrémités du filet */
            content: '';
            position: absolute;
            top: 50%;
            width: 6px;
            height: 24px;
            background-color: #374151;
            transform: translateY(-50%);
        }
        .net::before { left: -3px; }
        .net::after { right: -3px; }
        .position {
            border: 1px dashed #6b7280;
            display: flex;
            justify-content: center;
            align-items: center;
            flex-direction: column;
            padding: 4px;
            min-height: 0;
            text-align: center;
        }
        .position-label {
            font-weight: bold;
            font-size: 0.9em;
            color: #4b5563;
        }
        .player-select {
            margin-top: 5px;
            width: 100%;
            border-radius: 4px;
            border: 1px solid #d1d5db;
            font-size: 0.8em;
        }
        .tab-button, .set-button {
            transition: all 0.3s ease;
        }
        .tab-button.active, .set-button.active {
            background-color: #3b82f6;
            color: white;
            border-color: #3b82f6;
        }
        /* Style pour les modals */
        .modal-backdrop {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.5);
            display: flex;
            justify-content: center;
            align-items: center;
            z-index: 50;
        }
        .jersey-badge {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            font-weight: bold;
            color: white;
            background-color: #4b5563;
        }
        .captain-checkbox { /* Add base styles for better appearance */
			appearance: none;
			background-color: #fff;
			border: 1px solid #d1d5db; /* gray-300 */
			width: 1.25rem; /* w-5 */
			height: 1.25rem; /* h-5 */
			border-radius: 9999px; /* rounded-full */
			display: inline-block;
			vertical-align: middle;
			position: relative;
			cursor: pointer;
        }
		.captain-checkbox:checked {
			background-color: #f59e0b; /* amber-500 */
			border-color: #f59e0b; /* amber-500 */
		}
		.captain-checkbox:checked::after {
			color: white; /* "C" blanc sur fond orange */
		}
		.captain-checkbox::after {
			content: 'C';
			position: absolute;
			top: 50%;
			left: 50%;
			transform: translate(-50%, -50%);
			font-size: 0.75rem; /* text-xs */
			font-weight: bold;
			color: #9ca3af; /* Un gris (Tailwind gray-400) */
		}
        .captain-checkbox:disabled {
             background-color: #e5e7eb; /* gray-200 */
             border-color: #d1d5db; /* gray-300 */
             cursor: not-allowed;
        }
        .captain-checkbox:disabled:checked::after {
            color: #9ca3af; /* gray-400 */
        }

        /* Styles pour la nouvelle vue Suivi en Direct */
        #live-court-layout {
            display: grid;
            /*grid-template-columns: 1fr 1fr; /* Grille 2x3 */
            grid-template-columns: repeat(2, minmax(0, 1fr)); /* Grille 2x3 robuste */
            gap: 0.75rem;
        }
        @media (min-width: 1024px) {
            #live-court-layout {
                grid-template-columns: repeat(3, minmax(0, 1fr)); /* Grand écran : 3 colonnes */
            }
        }
        .live-player-card {
            border: 1px solid #e5e7eb;
            border-radius: 0.75rem;
            padding: 0.75rem;
            text-align: center;
            background-color: #f9fafb;
            display: flex;
            flex-direction: column;
        }
        .player-name-display {
            line-height: 1.25rem; /* Hauteur d'une ligne de texte */
            height: 2.5rem;      /* Hauteur pour deux lignes de texte */
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .fault-grid {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.5rem;
            margin-top: 0.75rem;
        }
        .fault-grid-btn, .simple-fault-btn {
            border-radius: 0.5rem;
            font-weight: 500;
            transition: background-color 0.2s;
            cursor: pointer;
            user-select: none; /* Empêche la sélection de texte pendant l'appui long */
            background-color: #fb923c; /* Orange clair (orange-400) */
            color: white;
            border: 1px solid #fb923c;
        }
        .fault-grid-btn {
             aspect-ratio: 1 / 1;         /* Force le bouton à être carré */
             display: flex;               /* Nécessaire pour flexbox */
             flex-direction: column;    /* (Déjà appliqué via script.js, mais bon en base) */
             align-items: center;       /* Centre horizontalement */
             justify-content: center;   /* Centre verticalement */
             padding: 0.25rem;            /* Ajoute un petit padding interne */
             font-size: 0.875rem;         /* Uniformise la police (équivalent text-sm) */
        }
        .simple-fault-btn {
            flex-grow: 1;
            margin-top: 0.75rem;
            font-size: 2.25rem;
            font-weight: 700;
            line-height: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            aspect-ratio: 1 / 1; /* Assure que le bouton est carré */
        }
        .fault-btn-active {
            background-color: #f97316 !important; /* Orange un peu plus foncé (orange-500) */
            border-color: #f97316 !important;
        }
        .fault-count {
            font-weight: 700;
            margin-left: 0.25rem;
        }
        /* Style pour l'interrupteur */
        .toggle-label {
            position: relative;
            display: inline-flex;
            align-items: center;
            cursor: pointer;
        }
        .toggle-input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        .toggle-slider {
            width: 44px;
            height: 24px;
            background-color: #ccc;
            border-radius: 9999px;
            transition: background-color 0.2s;
            position: relative;
        }
        .toggle-slider::before {
            content: '';
            position: absolute;
            height: 20px;
            width: 20px;
            left: 2px;
            bottom: 2px;
            background-color: white;
            border-radius: 50%;
            transition: transform 0.2s;
        }
        .toggle-input:checked + .toggle-slider {
            background-color: #3b82f6;
        }
        .toggle-input:checked + .toggle-slider::before {
            transform: translateX(20px);
        }

        /* Ensure number inputs don't show spinners (optional) */
        input[type=number]::-webkit-inner-spin-button,
        input[type=number]::-webkit-outer-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        input[type=number] {
            -moz-appearance: textfield; /* Firefox */
        }

        /* Barre de navigation fixée en bas + boutons de zoom.
           Tailles en px : elles ne changent pas quand on zoome, pour que la barre
           et les boutons de zoom restent à la même place. */
        body {
            padding-bottom: 150px; /* place pour la barre (56px) et les boutons de zoom : le bas de la page reste visible */
        }
        .bottom-nav-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 48px;
            height: 44px;
            margin: 6px 0;
        }
        .bottom-nav-btn svg {
            width: 26px;
            height: 26px;
        }
        /* Fenêtres : si l'écran est trop petit (surtout avec le zoom), la fenêtre défile au lieu d'être coupée */
        .modal-backdrop > div {
            max-height: 90vh;
            overflow-y: auto;
        }
        .zoom-controls {
            position: fixed;
            right: 10px;
            bottom: 68px; /* juste au-dessus de la barre de navigation (56px) */
            z-index: 40; /* sous les fenêtres modales (z-index 50) */
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .zoom-controls button {
            width: 36px;
            height: 36px;
            border-radius: 9999px;
            background-color: rgba(255, 255, 255, 0.85);
            color: #2563eb;
            border: 1px solid #93c5fd;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
            font-size: 22px;
            font-weight: 600;
            line-height: 1;
            opacity: 0.75;
            transition: opacity 0.2s;
        }
        .zoom-controls button:hover:not(:disabled) {
            opacity: 1;
        }
        .zoom-controls button:disabled {
            opacity: 0.35;
            cursor: not-allowed;
        }

        /* Présentation de l'application (fenêtre ouverte par le bouton « i » du bandeau) */
        #presentationModal .pres-box { max-height: 94vh; }
        .pres-pastille { width: 2.25rem; height: 2.25rem; flex-shrink: 0; border-radius: 9999px; background: #fbbf24; display: flex; align-items: center; justify-content: center; }
        .pres-badge { display: inline-block; min-width: 2em; padding: .1em .4em; border-radius: 9999px; color: #fff; font-weight: 700; }
        .pres-carte { background: #f0f4f8; border-radius: 1.25rem; padding: 1.25rem; transition: transform .3s, box-shadow .3s; }
        .pres-carte:hover { transform: translateY(-4px); box-shadow: 0 14px 30px -14px rgba(37, 99, 235, .35); }
        .pres-icone { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: .9rem; background: #2563eb; color: #fff; margin-bottom: .75rem; }
        .pres-icone svg { width: 1.5rem; height: 1.5rem; }
        /* Avant / après : petites notes de papier, barrées une à une à l'ouverture */
        .pres-note { background: #fff; border-radius: 6px; padding: .7rem 1rem; box-shadow: 0 1px 2px rgba(0,0,0,.06), 0 10px 24px -12px rgba(120, 80, 20, .35); transform: rotate(var(--r, 0deg)); }
        .pres-barre { text-decoration: line-through 3px transparent; }
        #presentationModal:not(.hidden) .pres-barre { animation: presBarre .5s ease var(--b, 0ms) forwards; } /* --b : délai donné sur chaque note */
        @keyframes presBarre { to { text-decoration-color: rgba(234, 88, 12, .5); } }
        /* Apparition en cascade de l'accroche, à chaque ouverture */
        @keyframes presFadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
        #presentationModal:not(.hidden) .pres-item { opacity: 0; animation: presFadeUp .7s cubic-bezier(.22,.61,.36,1) forwards; }
        .pres-d1 { animation-delay: .08s !important; } .pres-d2 { animation-delay: .18s !important; }
        .pres-d3 { animation-delay: .28s !important; } .pres-d4 { animation-delay: .38s !important; }
        @keyframes presFlotte { 0%, 100% { transform: translateY(0) rotate(var(--rot, 0deg)); } 50% { transform: translateY(-8px) rotate(var(--rot, 0deg)); } }
        .pres-flotte { animation: presFlotte 6s ease-in-out infinite; }
        .pres-flotte-lent { animation: presFlotte 7s ease-in-out 1.2s infinite; }
        @keyframes presPulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); } 70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
        .pres-pulse { animation: presPulse 2s infinite; }
        @media (prefers-reduced-motion: reduce) {
            #presentationModal *, #presentationModal:not(.hidden) .pres-item { animation: none !important; opacity: 1 !important; }
            #presentationModal .pres-barre { text-decoration-color: rgba(234, 88, 12, .5); }
        }

        /* Bandeau du haut : petite flèche sur le bouton de l'équipe, pour montrer qu'on peut cliquer */
        .team-select-btn::after {
            content: ' ▾';
        }
