body { font-family: Arial, sans-serif; margin: 20px; color: #222; }
h1 { margin: 0; font-size: 22px; }
.toolbar { display:flex; flex-wrap:wrap; justify-content:space-between; align-items:center; gap:16px; margin-bottom:16px; }
.course-selector { display:flex; gap:16px; font-size:14px; align-items:center; }
.course-selector label { display:flex; align-items:center; gap:6px; margin:0; }
.course-selector input[type="radio"] { margin:0; cursor:pointer; }
button { padding:8px 12px; cursor:pointer; }
.card { border:1px solid #ddd; border-radius:8px; padding:12px; margin-bottom:14px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
label { font-size:14px; display:flex; flex-direction:column; gap:6px; }
select, input { padding:6px; }
.input-green { background:#c6efce; border:1px solid #7aa17a; }
.meta { margin-top:12px; display:flex; flex-wrap:wrap; gap:16px; font-size:14px; }

table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { border:1px solid #ccc; padding:6px; text-align:center; }
td:first-child, th:first-child { text-align:left; }
.calc { background:#f3f3f3; }

.hidden-row { display:none; }

.toolbar-actions{
  display:flex;
  gap:8px;
}

/* Force le tableau à prendre toute la largeur sans dépasser */
table {
    width: 100%;
    table-layout: fixed; /* Force les colonnes à avoir une largeur égale */
    border-collapse: collapse;
    word-break: break-all; /* Coupe les mots si nécessaire */
}

/* Ajuste la taille de la police pour les petits écrans */
@media screen and (max-width: 600px) {
    th, td {
        font-size: 0.8rem;
        padding: 4px 2px;
    }
    input {
        width: 100%; /* Les champs de saisie s'adaptent à la cellule */
        box-sizing: border-box;
    }
}

@media print {
    /* Cache le bouton et les listes déroulantes */
    #btnImprimer, .no-print, select {
        display: none !important;
    }

    /* Affiche le nom du joueur via l'attribut qu'on remplit en JS */
    .player-select-container::after {
        content: attr(data-player-name);
        font-weight: bold;
        display: block;
        font-size: 16px;
        margin-top: 5px;
    }

    body { width: 100%; margin: 0; padding: 0; }
    table { width: 100% !important; border: 1px solid #000; }
    .has-stroke {
        background-color: #ffeeba !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* Force les inputs à occuper tout l'espace sans déborder */
td input {
    width: 100%;
    height: 100%;
    box-sizing: border-box; /* Crucial : inclut bordure/padding dans la largeur */
    border: none;           /* Optionnel : pour un look plus "pro" dans le tableau */
    text-align: center;
    font-size: 14px;
}

/* Supprime les flèches sur les inputs number pour gagner de la place */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* La couleur de fond quand il y a un coup rendu (ex: orange clair) */
.has-stroke {
  background-color: #ffeeba !important;
  font-weight: bold;
  color: #856404;
}
/*

@media print {
  .no-print { display:none !important; }
  body { margin:0; }
  .card { border:none; padding:0; margin:0 0 8px 0; }
  table { font-size:12px; }
}
i*/
.crHole {
  transition: background-color 0.3s ease; /* Optionnel : pour un effet fluide */
}


.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.nav-actions,
.main-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Base bouton */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}

/* Navigation: outline vert */
.btn-outline-green {
  background: #fff;
  color: #2d5a27;
  border-color: #2d5a27;
}
.btn-outline-green:hover {
  background: #f1f8f1;
  color: #23471f;
  border-color: #23471f;
}

/* Action légère */
.btn-light {
  background: #f7f7f7;
  color: #333;
  border-color: #ddd;
}
.btn-light:hover {
  background: #ececec;
}

/* Action principale */
.btn-primary {
  background: #2d5a27;
  color: #fff;
}

.btn-primary:hover {
  background: #1f3f1a;
  color: #fff;
}

/* Spinner de chargement */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.spinner-overlay.hidden {
  display: none;
}

.spinner-content {
  background: white;
  padding: 40px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #2d5a27;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spinner-content p {
  margin: 0;
  color: #333;
  font-weight: bold;
}

/* Modal */
.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: 1001;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  min-width: 300px;
  max-width: 500px;
  overflow: hidden;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #eee;
  background: #f9f9f9;
}

.modal-header h2 {
  margin: 0;
  font-size: 20px;
  color: #333;
}

.modal-body {
  padding: 20px;
  color: #555;
}

.modal-body p {
  margin: 0;
  line-height: 1.6;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid #eee;
  text-align: right;
  background: #f9f9f9;
}

.modal-content.modal-error .modal-header {
  background: #ffebee;
}

.modal-content.modal-error .modal-header h2 {
  color: #c62828;
}
  border-color: #2d5a27;
}
.btn-primary:hover {
  background: #23471f;
  border-color: #23471f;
}

/* Mobile */
@media (max-width: 768px) {
  .top-actions {
    justify-content: flex-start;
  }

  .btn {
    width: 100%;
  }

  .nav-actions,
  .main-actions {
    width: 100%;
  }
}