:root{

  /* BG SYSTEM */
  --bg-1:#0f172a;
  --bg-2:#1e293b;
  --bg-3:#334155;

  /* ALIASES (IMPORTANT POUR COMPAT EXISTANT) */
  --bg:var(--bg-1);
  --card:var(--bg-2);

  /* TEXT */
  --text:#f8fafc;
  --secondary:#94a3b8;

  /* UI */
  --accent:#f59e0b;
  --input-bg:#334155;

  /* EFFECTS */
  --chart-text:#ffffff;
  --chart-grid:rgba(255,255,255,0.15);
}

body.light{

  --bg-1: #94a3b8;
  --bg-2: #e2e8f0;
  --bg-3: #ffffff;

  --bg:var(--bg-1);
  --card:var(--bg-2);
  --text:#000000;
  --secondary:#475569;
  --accent:#f59e0b;
  --input-bg:#e5e7eb;
  --chart-text:#000000;
  --chart-grid:rgba(0,0,0,0.15);

}

body.light .arc-default-btn{
    background:#e5e7eb;
    color:#111827;
}
body.light .arc-default{
    color:#111827;
}

*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}
body.light .header{
    background: var(--card);
}

body.light input,
body.light select,
body.light textarea{
    background:#ffffff;
}

body{
  min-height:100vh;
  font-family:Arial,Helvetica,sans-serif;

  background:var(--bg);
  color:var(--text);
  padding:0;
}


/* =========================
   HEADER
========================= */

.header{

  color: var(--text);  
  position:relative;
  background: var(--card);
  display:flex;
  justify-content:center;
  padding:10px 0;
  align-items:center;
  margin-bottom:8px;

}

.section-header{
  margin-bottom:6px;
}


h2{
  margin:0 0 6px 0;
}

.header h2{
    font-size:20px;
    font-weight:600;
    margin:0;
    white-space:nowrap;
}

@media (min-width: 768px){
    .header h2{
        font-size:24px;
    }
}

.menu-btn{

  position:absolute;

  right:15px;

  font-size:24px;

  cursor:pointer;

  padding:5px 10px;

}

.type-btn{
  border:none;
  border-radius:14px;
  padding:18px;
  font-size:18px;
  font-weight:bold;
  cursor:pointer;

  background:var(--bg-3);
  color:var(--text);
}

.type-btn.active{
  background:var(--accent);
  color:#111827;
}

/* =========================
   MENU
========================= */

.menu{

  position:fixed;

  top:60px;

  right:15px;

  background:var(--card);

  border-radius:10px;

  padding:10px;

  display:none;

  flex-direction:column;

  gap:4px;

  box-shadow:0 10px 30px rgba(0,0,0,.4);

  z-index:1000;

}

.menu a,
.menu button{

  display:flex;

  align-items:center;

  gap:10px;

  padding:8px 12px;

  width:100%;

  background:none;

  border:none;

  color:var(--text);

  text-decoration:none;

  text-align:left;

  font-size:15px;

  cursor:pointer;

  border-radius:6px;

}

.menu a:hover,
.menu button:hover{

  background:rgba(255,255,255,.1);

}

body.light .menu a:hover,
body.light .menu button:hover{

  background:rgba(0,0,0,.08);

}

/* =========================
   CONTENT
========================= */

.wrapper{

  display:flex;

  justify-content:center;

  padding-top:20px;

}

.card{
  width:100%;
  max-width:700px;
  background:var(--card);
  border-radius:20px;
  padding:12px 14px;
  box-shadow:0 10px 30px rgba(0,0,0,.15);
  margin-bottom:8px;
}

.regles-grid{

  display:grid;
  align-items:start;
  grid-template-columns:1fr 1fr;

  gap:30px;

  align-items:start;
  text-align:left;

}

.regles-liste{
  text-align:left;
}
.regles-liste form{
  display:inline;
}
.regles-grid input[type="text"]{
  width:180px;


}
.regles-grid input[type="number"]{
  width:80px;
}

.regles-liste > div{
  background:var(--bg-3);
  border-radius:10px;
  padding:12px;
  margin-bottom:12px;
}

input,
select{

  background:var(--input-bg, #ffffff);

  color:var(--text);

  border:1px solid rgba(128,128,128,.4);

  border-radius:6px;

  padding:6px 8px;

}

@media(max-width:700px){


}

.logo{

  font-size:70px;

  margin-bottom:20px;

}

h1{

  font-size:3rem;

  margin-bottom:15px;

}

.subtitle{

  margin-top:4px;

  font-size:14px;

  font-weight:400;

  color:var(--secondary);

}

.badge{

  display:inline-block;
  font-size:14px;
  background:var(--accent);

  color:#111827;

  font-weight:bold;

  padding:6px 12px;

  border-radius:999px;

  margin-bottom:15px;

}

.badge a{

    color:#111827;
    text-decoration:none;
}

.features{

  text-align:left;

  max-width:420px;

  margin:0 auto;

  line-height:1.9;

}

footer{

  margin-top:15px;

  font-size:.9rem;

  color:var(--secondary);

}

.compact-btn{

  min-height:auto;

  padding:14px 20px;

  display:flex;

  justify-content:space-between;

  align-items:center;

  text-align:left;

  font-size:18px;

  font-weight:600;

}

.compact-btn span{

  font-size:20px;

  font-weight:400;

  color:var(--secondary);

}


.distance-choice,
.cible-choice,
.lieu-choice,
.regle-choice{

    width:100%;

    min-height:auto;

    padding:14px;

    font-size:18px;

    border-radius:12px;

}

.regle-nom{

    font-size:1.35rem;
    font-weight:700;

}

.regle-detail{

    font-size:1rem;
    line-height:1.4;

}


#distance-valid,
#cible-valid,
#lieu-valid,
#exercice-valid{

    width:100%;

    min-height:70px;

    font-size:22px;

    font-weight:bold;

    border:none;

    border-radius:12px;

    background:var(--accent);

    color:#111827;

    cursor:pointer;

}



.card h2{
  font-size:16px;
  font-weight:600;
  opacity:0.9;
  margin-bottom:8px; /* AJOUT IMPORTANT */
}


.titre-tireur{
    text-align:center;
    font-size:18px;
    font-weight:700;
    margin:0 0 8px 0;
    padding:10px 12px;
    color:var(--text);
    background:var(--card);
    border-radius:12px;
}
/* LIGHT override (optionnel mais recommandé pour contraste propre) */
body.light .titre-tireur{
    background:var(--card);
    color:var(--text);
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

}
.modal-header{
    display:flex;
    justify-content:space-between;
    align-items:center;
}


.modal-close{

    float:right;
    border:none;
    background:none;
    color:red;
    font-size:28px;
    font-weight:bold;
    cursor:pointer;
}


.modal input,

.modal input[type="text"],

.modal input[type="number"] {

    font-size: 22px;
    padding: 14px;
    height: 48px;
    width: 100%;
    border-radius: 10px;
    box-sizing: border-box;
}

[id$="-modal"]{
    display:flex;
    align-items:center;
    justify-content:center;
}

[id$="-modal"] > div{
    width:420px;
    max-width:90vw;
    box-sizing:border-box;
}
[id$="-modal"] input{
    width:100%;
    font-size:20px;
    padding:14px;
    box-sizing:border-box;
}

.stats-scroll{

  display:flex;

  gap:12px;

  overflow-x:auto;

  margin-top:15px;

  padding-bottom:5px;

}

.stats-scroll::-webkit-scrollbar{

  display:none;

}

.stat-badge{

  flex:0 0 auto;

  min-width:110px;

  background:var(--bg-3);

  border-radius:12px;

  padding:12px;

  text-align:center;

}

body.light .stat-badge{

  background:var(--bg-3);

}
.stat-value{

  font-size:24px;

  font-weight:bold;

  margin-bottom:6px;

}

.stat-label{

  font-size:12px;

  color:var(--secondary);

  text-transform:uppercase;

}

.score-table{

  margin-top:15px;

  max-height:260px;

  overflow-y:auto;

}

.score-row{

  display:grid;

grid-template-columns:
  40px
  1fr
  45px
  40px;

  gap:6px;

  align-items:center;

  margin-bottom:8px;

}

.score-row div{

  padding:8px;

  border-radius:8px;

  background:var(--bg-3);

  text-align:center;

  font-weight:600;

}

.score-header div{

  background:none;

  color:var(--secondary);

  font-size:12px;

  font-weight:bold;

}

body.light .score-row div{

  background:#e5e7eb;

}

body.light .score-header div{

  background:none;

}

.fleches-cell{

  display:flex;

  gap:6px;

  align-items:center;

  flex-wrap:nowrap;

}

.arrow-score{

  width:34px;

  height:34px;

  min-width:34px;

  border-radius:10px;

  display:flex;

  align-items:center;

  justify-content:center;

  font-weight:bold;

  font-size:18px;

}

.arrow-score.yellow{

  background:#f5e327;

  color:#111;

}

.arrow-score.red{

  background:#ef5350;

  color:white;

}

.arrow-score.blue{

  background:#42b7d1;

  color:white;

}

.arrow-score.black{

  background:#000;

  color:white;

}

.arrow-score.white{

  background:#fff;

  color:#111;

}

.fleches-cell{

  background:none !important;

  padding:0 !important;

  border-radius:0 !important;

  justify-content:center;

}

body.light .fleches-cell{

  background:none !important;

}

.resultats-title{

  font-size:22px;

}

.resultats-info{

  font-size:14px;

  font-weight:400;

  color:var(--secondary);

}

.tir-clavier{

  display:grid;

  grid-template-columns:repeat(3,1fr);

  gap:10px;

  margin-top:15px;

}

.score-btn{

  border:none;

  border-radius:12px;

  height:60px;

  font-size:24px;

  font-weight:bold;

  cursor:pointer;

}

.score-btn.yellow{

  background:#f5e327;

  color:#111;

}

.score-btn.red{

  background:#ef5350;

  color:white;

}

.score-btn.blue{

  background:#42b7d1;

  color:white;

}

.score-btn.black{

  background:#000;

  color:white;

}

.score-btn.white{

  background:#fff;

  color:#111;

  border:1px solid #000;

}

.score-btn.retour{

  background:#64748b;

  color:white;

}

.series-selector{

  display:flex;

  justify-content:center;

  align-items:center;

  gap:20px;

}

.series-selector button{

  width:50px;

  height:50px;

  border:none;

  border-radius:12px;

  font-size:28px;

  font-weight:bold;

  cursor:pointer;

}

#series-value{

  font-size:28px;

  font-weight:bold;

  min-width:40px;

  text-align:center;

}

.clavier-title{
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.stop-badge{
    cursor:pointer;
    padding:10px 16px;
    border-radius:999px;
    font-size:1.05rem;
    font-weight:700;
    background:#dc2626;
    color:#fff;
    line-height:1;
}

.arc-label{
    font-size:.9rem;
    color:var(--secondary);
    margin-bottom:4px;
}

.arc-modele{
    margin:0;
    font-size:1.4rem;
}

.overlay-seances{

    display:none;

    position:fixed;

    inset:0;

    background:
    rgba(
        0,
        0,
        0,
        .6
    );

    z-index:9999;

    justify-content:center;

    align-items:center;

}

.overlay-card{

    width:90%;

    max-width:700px;

    max-height:80vh;

    overflow:auto;

    background:
    var(--card);

    border-radius:16px;

    padding:20px;

}

.seance-link{

    display:block;

    padding:4px 4px;

    color:var(--text);

    text-decoration:none;

    font-size:.85rem;
}
.seance-link:hover{

    background:
    rgba(
        245,
        158,
        11,
        .15
    );

    border-radius:8px;

}

.overlay-card h2{

    margin:0;

    font-size:1rem;

    text-align:left;

}

.overlay-header{

    position:relative;

    width:100%;

    min-height:40px;

}

.overlay-close{
    position:absolute;
    top:10px;
    right:12px;
    cursor:pointer;
    font-size:28px;
    font-weight:700;
    line-height:1;
    width:36px;
    height:36px;
    display:flex;
    align-items:center;
    justify-content:center;
}

.zone-chart{

    display:flex;

    justify-content:center;

    align-items:flex-end;

    gap:6px;

    height:180px;

    margin-top:10px;
}  

.zone-col{

    display:flex;

    flex-direction:column;

    align-items:center;

    justify-content:flex-end;

    height:100%;

}

.zone-value{

    font-size:.85rem;

    margin-bottom:4px;

}

.zone-bar{

    width:34px;

    min-height:8px;

    border-radius:4px 4px 0 0;

    background:var(--accent);

}

.zone-label{

    font-size:.85rem;

    margin-top:4px;

}

.zone-jaune{ background:#f5e327; }
.zone-rouge{ background:#ef5350; }
.zone-bleu{ background:#42b7d1; }
.zone-noir{ background:#000; }
.zone-blanc{
    background:#fff;
    border:1px solid #000;
}

.zone-pct{

    display:block;

    font-size:14px;

    font-weight:400;

    color:var(--secondary);

    margin-top:2px;

}

.lieux-grid{

    display:flex;
    flex-direction:column;
    gap:12px;
    margin-top:20px;

}

.lieu-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:6px 14px; /* AVANT 16px 20px */
  border-radius:14px;
}

.lieu-nom{
    margin:0;
    line-height:1;
    font-size:20px;
    font-weight:700;

}

.lieu-env{
    margin:0;
    line-height:1.2;
    margin-top:4px;
    color:var(--secondary);
    font-size:14px;

}

.btn-delete{

    width:40px;
    height:40px;

    border:none;
    border-radius:10px;

    cursor:pointer;

    font-size:20px;

    background:none;
    color:white;

}

.card input[name="nom"]{

    width:280px;
    font-size:18px;
    padding:10px 12px;

}
.card select[name="environnement"]{

    font-size:18px;
    padding:10px 12px;

}

.distance-card{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:4px 14px; /* AVANT 8px 20px */
  margin-bottom:0px; /* AVANT 8px */
  border-radius:12px;
}

.distance-card form{
    margin:0;
    display:flex;
    align-items:center;
}

.distance-valeur{
    font-size:18px;
    font-weight:700;
    line-height:1;
}

.distance-input{

    width:100%;
    max-width:440px;

}

.card input[name="nom"],
.card input[name="distance"],
.card select[name="environnement"]{
  font-size:16px;
  padding:8px 10px; /* AVANT 10–12px / 12px */
}

/* =========================
   ARCS
========================= */

.btn-add{

    padding:10px 16px;

    border:none;

    border-radius:10px;

    background:var(--accent);

    color:#111827;

    font-weight:700;

    cursor:pointer;

}

.arcs-grid{

    display:flex;

    flex-direction:column;

    gap:12px;

    margin-top:20px;

}

.arc-card{

    background:var(--bg-2);

    border-radius:14px;

    padding:5px 20px;

}

.arc-nom{

    font-size:20px;

    font-weight:700;

}

.arc-details{

    margin-top:4px;

    color:var(--secondary);

    font-size:14px;

}

.arc-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:4px;
}

.arc-info{
    margin-top:2px;
}

.arc-default-btn{

    border:none;

    border-radius:8px;

    padding:6px 10px;

    background:rgba(245,158,11,.15);

    color:#fbbf24;

    font-size:14px;

    font-weight:700;

    cursor:pointer;

}

.arc-default{

    color:#fbbf24;

    font-weight:700;

}

.objectif-choice{

    width:100%;
    border:none;
    border-radius:14px;
    padding:18px;
    font-size:22px;
    font-weight:700;
    cursor:pointer;

}

.objectif-jaune{

    background:#f5e327;
    color:#111;

}

.objectif-rouge{

    background:#ef5350;
    color:#fff;

}

.objectif-bleu{

    background:#42b7d1;
    color:#fff;

}

.objectif-noir{

    background:#000;
    color:#fff;

}

.objectif-blanc{

    background:#fff;
    color:#111;
    border:1px solid #000;

}

.section-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  margin-bottom:4px; /* AVANT 20px */
}

.section-header h2{

    margin:0;

}

.arc-defaut{

  margin:0;

}

.stat-badge .stat-value{
    line-height:1.1;
}

.stat-badge .stat-value.small{
    font-size:16px;
}

details{
    margin-bottom:10px;
}

.mois-summary{
    cursor:pointer;
    font-weight:400 !important;
    padding:10px;
    border-radius:10px;
    background:rgba(255,255,255,.05);
}

.mois-summary:hover{
    background:rgba(255,255,255,.08);
}


.mois-summary{
    display:flex;
    justify-content:space-between;
    align-items:center;

    padding:12px 16px;

    font-size:18px;
    font-weight:700;

    border-radius:14px;

    background:rgba(255,255,255,.06);
}

.mois-count{
    font-size:14px;
    font-weight:500;
    opacity:.7;
}

.badge-objectif {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 12px;
    color: #fff;
    margin-left: 6px;
}


.objectif-jaune { background:#facc15; color:#111; }
.objectif-rouge  { background:#ef4444; color:#fff; }
.objectif-bleu   { background:#3b82f6; color:#fff; }
.objectif-noir   { background:#000; color:#fff; }
.objectif-blanc { background:#fff; color:#111; border:1px solid #000;}

.stats-zone-objectifs{
    margin-top:10px;
    padding:10px 12px;

    font-size:13px;
    line-height:1.4;

    background:rgba(255,255,255,0.04);
    border-radius:10px;

    color:var(--text);
}

body.light .stats-zone-objectifs{
    background:#f1f5f9;
}

.stats-zone-objectifs strong{
    font-weight:700;
}

.stats-main {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.stats-zone {
    font-size: 13px;
    opacity: 0.65;
    color: var(--secondary);
    line-height: 1.4;
    margin-top: 6px;
    padding-left: 2px;
}

.stats-global {
    font-size: 16px;
    font-weight: 500;
    color: var(--text);
}

.stats-line {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
    margin: 0;
}

.stats-zone,
.stats-global,
.stats-main {
    font-size: 16px !important;
    font-weight: 500 !important;
    opacity: 1 !important;
    margin: 0 !important;
    color: inherit;
}

.stat-badge.objectif-jaune,
.stat-badge.objectif-rouge,
.stat-badge.objectif-bleu,
.stat-badge.objectif-noir,
.stat-badge.objectif-blanc{
    background: transparent !important;
}

/* vraie couleur du badge */
.stat-badge.objectif-jaune{ background:#facc15 !important; }
.stat-badge.objectif-rouge{ background:#ef4444 !important; }
.stat-badge.objectif-bleu{ background:#3b82f6 !important; }
.stat-badge.objectif-noir{ background:#111827 !important; }
.stat-badge.objectif-blanc{ background:#e5e7eb !important; }

/* texte cohérent partout */
.stat-badge.objectif-jaune *,
.stat-badge.objectif-blanc *{
    color:#111 !important;
}

.stat-badge.objectif-rouge *,
.stat-badge.objectif-bleu *,
.stat-badge.objectif-noir *{
    color:#fff !important;
}


.config-btn.compact-btn{
    color: var(--text);
}

.config-btn.compact-btn span{
    color: var(--text);
}

.title-icon{

    width:40px;

    height:40px;

    vertical-align:-6px;

    margin-right:8px;

}