/* =========================================================
   GolfTrack — charte monochrome
   Noir, blanc, gris. La couleur est réservée à ce qui a un sens :
   jaune = saisie (saisie.css) · vert / orange / rouge = qualité du contact et état du GPS
   · rouge et bleu = symboles de la carte de score
   · rouge / jaune / bleu = les 5 directions dans les statistiques (voir DIRCOL dans stats.js).
   ========================================================= */
:root { --shadow: none; --on-dark: #FFFFFF; }

/* ---------- Surfaces : aplats, sans dégradé ni anneaux ---------- */
.hud, .feat-play, .login, .admin-hero { background: var(--slate); }
.hud, .feat-play { border-color: var(--slate); }
.login { background: #123F32; }
.avatar { background: var(--slate); }
.card, .hole-card, .recap-card, .profile-card, .feat, .round-item, .club-stat { box-shadow: none; }

/* ---------- Sur fond noir, l'accent est blanc ---------- */
.hud .hole-badge, .feat-play .feat-icon { background: #fff; color: var(--slate); }
.hud .hole-badge.dark { background: var(--slate-2); color: #fff; }
.hud-chip { background: rgba(255, 255, 255, 0.1); color: #fff; }
.pod.main { background: rgba(255, 255, 255, 0.14); border-color: rgba(255, 255, 255, 0.28); }
.feat-play .btn-primary, .login .btn-primary, .hud .btn-primary { background: #fff; color: var(--slate); box-shadow: none; }
.feat-play.live { border-color: var(--slate); box-shadow: none; }

/* ---------- Boutons : noirs, sans halo ---------- */
.btn-primary, .ra-btn.finish { box-shadow: none; }

/* ---------- La carte de score : en-tête noir, trou en cours en blanc ---------- */
.golf-card .sc-num .sc-tot { background: var(--slate-2); }
.golf-card .sc-num th.cur { background: #fff; color: var(--slate); }

/* ---------- La couleur quand elle a un sens ---------- */
.pulse { background: var(--ok); }
.gps-pill.ok .pulse, .hud-chip.ok .pulse { background: var(--ok); }
.dot.q3 { background: var(--ok); }
.state.live .pulse { background: var(--ok); }
.contact-row button.q3.on { background: var(--ok); border-color: var(--ok); }

/* ---------- Trou en cours : repère noir au lieu du vert ---------- */
.hole-card.live { border-color: var(--slate); box-shadow: none; }
.state.live { background: var(--chip); color: var(--slate); }

/* ---------- Écran de connexion ---------- */
.login-tag { color: #A8B8AC; }

/* ---------- Statistiques : cartes sobres, sans code couleur par thème ---------- */
.tone-green, .tone-blue, .tone-amber, .tone-violet, .tone-red, .tone-slate { --tc: #111713; --tb: #E9EFEB; --tl: #111713; }
#stats-body .viz-card { border: 1px solid var(--line); box-shadow: none; }
#stats-body .stat-tile { box-shadow: none; }
#stats-body .tiles.kpi { background: var(--slate); border-color: var(--slate); }
#stats-body .tiles.kpi .t-ic { background: #fff; color: var(--slate); }

/* ---------- Saisie manuelle : simple mention, sans couleur ---------- */
.src.man { color: var(--muted); }

/* ---------- Trous joués : carré trou + par, puis colonnes fixes nom / coups / score ---------- */
.hole-card.row { position: relative; grid-template-columns: 44px minmax(0, 1fr); column-gap: 8px; align-items: start; padding: 6px; }
.hole-card.row .hc-badge { width: 41px; height: 41px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; border-radius: 4px; background: var(--slate); color: #fff; line-height: 1; }
.hc-badge b { font-family: var(--display); font-size: 18px; line-height: 22px; font-weight: 600; }
.hc-badge small { font-family: var(--display); font-size: 10px; line-height: 11px; font-weight: 600; opacity: 1; color: #DCE2DC; }
/* à droite : le menu du trou et le chevron, l'un sous l'autre */
.hole-card.row { --hp-coups: 62px; --hp-score: 64px; }
.hole-card.row .hc-icons { position: absolute; top: 4px; right: 4px; }
.hole-card.row .hc-ic { width: 26px; height: 26px; }
.hole-card.row .hc-info { gap: 3px; padding: 0 22px 0 0; min-height: 41px; justify-content: center; cursor: pointer; }
.hole-card.row .hc-chev { position: absolute; right: 10px; top: 36px; width: 16px; height: 16px; color: var(--muted-2); pointer-events: none; }
.hole-card.row.open .hc-chev { transform: rotate(90deg); }
/* trou en cours : une ligne de plus pour « En cours » et le bouton de reprise */
.hole-card.row.live { padding: 5px; }
.hc-live { display: flex; align-items: center; min-height: 26px; padding-right: 31px; }
.hc-live .state { font-size: 10px; padding: 2px 6px; }
/* une ligne par joueur : crayon, puis les mêmes colonnes sur toutes les cartes */
.hp-line { display: flex; align-items: flex-start; gap: 4px; }
.hp-edit { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px; background: var(--chip); color: var(--ink); }
.hp-edit svg { width: 14px; height: 14px; }
.hp-edit:active { background: var(--line); transform: none; }
.hp-toggle { flex: 1; min-width: 0; min-height: 24px; text-align: left; display: grid; grid-template-columns: var(--hp-name, 48px) var(--hp-coups) minmax(0, auto); column-gap: 5px; align-items: center; justify-items: start; justify-content: start; font-size: 13px; line-height: 17px; color: var(--muted); }
.hp-toggle:active { transform: none; }
.hp-name { width: 100%; font-weight: 500; color: var(--ink); line-height: 15px; padding: 4px 0; overflow-wrap: anywhere; }
.hp-n { white-space: nowrap; }
.hp-n b { font-family: var(--display); font-size: 14px; color: var(--ink); }
.hp-toggle .topar { margin-left: 0; font-size: 11px; padding: 1px 6px; }
.hp-none { grid-column: 2 / -1; font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.hp-putts { grid-column: 2 / -1; font-size: 11px; line-height: 14px; color: var(--muted); white-space: nowrap; }
/* très petits écrans avec un nom long : le nom au-dessus de ses coups */
.hp-stack .hp-toggle { grid-template-columns: var(--hp-coups) minmax(0, auto); }
.hp-stack .hp-name { grid-column: 1 / -1; padding: 4px 0 0; }
.hp-stack .hp-none, .hp-stack .hp-putts { grid-column: 1 / -1; }
.hole-card.row.open { padding-bottom: 0; }
.hole-card.row .hc-body { margin: 6px -6px 0 -6px; }
.hole-card.row.live .hc-body { margin: 5px -5px 0 -5px; }
@media (max-width: 370px) {
  .hole-card.row { --hp-coups: 58px; --hp-score: 56px; column-gap: 6px; grid-template-columns: 39px minmax(0, 1fr); }
  .hole-card.row .hc-badge { width: 40px; height: 40px; }
  .hc-badge b { font-size: 16px; line-height: 20px; }
  .hc-badge small { font-size: 10px; line-height: 10px; }
  .hp-toggle { column-gap: 4px; }
  .hp-toggle .topar { font-size: 10px; padding: 1px 5px; }
}

/* ---------- Détail : il s'agit bien de mes coups ---------- */
.shot-title { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 0 8px; padding: 6px 8px 0; }
.shot-title b { font-family: var(--display); font-size: 13px; color: var(--ink); }
.shot-title span { font-size: 10px; color: var(--muted); }

/* ---------- Carte de score : le nom complet, sur deux lignes s'il le faut ---------- */
.golf-card .sc-name { max-width: none; white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: normal; word-break: normal; line-height: 11px; }

/* ---------- Trou suivant : seulement Par 3, Par 4, Par 5 ---------- */
.par-tiles button { min-height: 51px; }
.par-tiles button b { font-size: 17px; line-height: 24px; }

/* ---------- Détail des coups : une seule ligne, colonnes alignées ---------- */
.shot-head, .shot-row { display: grid; grid-template-columns: 17px minmax(0, 1fr) 83px 53px 39px; align-items: center; column-gap: 4px; padding-left: 6px; padding-right: 6px; }
.shot-head { padding-top: 5px; padding-bottom: 4px; font-family: var(--display); font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.shot-head span:last-child { text-align: right; }
.hc-body .shot-list { border-top: 1px solid var(--line); }
.shot-row { min-height: 36px; padding-top: 4px; padding-bottom: 4px; font-size: 11px; line-height: 14px; }
.sr-num { width: 18px; height: 18px; font-size: 10px; }
.sr-club { font-family: var(--display); font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-dir, .sr-contact { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: var(--muted); min-width: 0; }
.sr-dir i { font-style: normal; color: var(--ink); width: 12px; flex: none; text-align: center; }
.sr-contact .dot { width: 7px; height: 7px; flex: none; }
.sr-dist { display: block; text-align: right; white-space: nowrap; }
.sr-dist b { font-family: var(--display); font-size: 13px; line-height: 14px; font-variant-numeric: tabular-nums; }
.sr-dist small { font-size: 10px; color: var(--muted-2); }
/* très petits écrans : la flèche seule indique la direction */
@media (max-width: 340px) {
  .shot-head, .shot-row { grid-template-columns: 17px minmax(0, 1fr) 15px 53px 39px; }
  .sr-dir { font-size: 0; }
  .sr-dir i { font-size: 12px; }
  .shot-head span:nth-child(3) { visibility: hidden; }
}

/* ---------- Mes records : deux records, avec le lieu et la date ---------- */
.record em { font-style: normal; font-size: 13px; font-weight: 500; color: var(--ink); }
.record > small { font-size: 11px; line-height: 14px; }
html[data-device="desktop"] #home-features .records { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- Direction par club : le practice ---------- */
.range-box { display: flex; flex-direction: column; gap: 6px; }
.range-clubs { display: flex; flex-wrap: wrap; gap: 5px; }
.range-clubs button { min-height: 31px; padding: 0 9px; border-radius: 999px; background: var(--chip); color: var(--ink); font-family: var(--display); font-size: 12px; font-weight: 600; white-space: nowrap; }
.range-clubs button span { font-weight: 400; color: var(--muted); }
.range-clubs button:active { transform: none; }
.range-clubs button.on { background: var(--slate); color: #fff; }
.range-clubs button.on span { color: #DCE2DC; }
.range-sum { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.range-sum b { font-family: var(--display); font-size: 13px; color: var(--ink); }
.chart.range { width: 100%; height: auto; display: block; }
.chart.range .range-pct { font-family: var(--display); font-weight: 600; font-size: 14px; fill: var(--ink); }
.chart.range .range-lbl { font-family: var(--display); font-weight: 500; font-size: 10px; fill: var(--muted); }
.chart.range .range-club { font-family: var(--display); font-weight: 600; pointer-events: none; }

/* ---------- Statistiques : raccourcis vers les blocs ---------- */
.stats-jump { position: sticky; top: var(--jump-top, 60px); z-index: 5; display: flex; gap: 5px; overflow-x: auto; scrollbar-width: none; padding: 6px 0; background: #E9EFEB; }
.stats-jump::-webkit-scrollbar { display: none; }
.stats-jump button { flex: none; min-height: 31px; padding: 0 11px; border-radius: 999px; background: var(--card); border: 1.5px solid var(--line); color: var(--ink); font-family: var(--display); font-size: 13px; font-weight: 600; }
.stats-jump button:active { transform: none; }
.stats-jump button.on { background: var(--slate); border-color: var(--slate); color: #fff; }
#stats-body .stats-h[id] { scroll-margin-top: calc(var(--jump-top, 60px) + var(--jump-h, 52px) + 8px); }

/* ---------- Contact par club : le % dans chaque segment ---------- */
.qrows.labeled .qrow { grid-template-columns: 63px minmax(0, 1fr); }
.qrows.labeled .qseg { height: 20px; }
.qrows.labeled .qseg span { min-width: 27px; display: grid; place-items: center; font-family: var(--display); font-size: 10px; font-weight: 600; font-variant-numeric: tabular-nums; color: #fff; white-space: nowrap; overflow: hidden; }
.qrows.labeled .qseg span.q2 { color: #111713; }

/* ---------- Profil de frappe seul sur sa ligne : le radar garde une taille raisonnable ---------- */
html[data-device="desktop"] #stats-body .viz-card[data-sz="4"] > svg { display: block; width: 100%; max-width: 480px; margin: 0 auto; }

/* Filtre de dates (zone de saisie jaune, comme toutes les saisies) */
.sf-dates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; padding: 4px 0 9px; }
.sf-dates label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 500; min-width: 0; }
.sf-dates input { width: 100%; min-width: 0; min-height: 40px; padding: 0 6px; border-radius: 4px; border: 1px solid #DCE2DC; background: #FFFFFF; color: #111713; font-size: 13px; }

/* Récap : comparaison à la moyenne */
.cmp-verdict { margin: 0 0 9px; padding: 9px 11px; border-radius: 4px; display: flex; flex-direction: column; gap: 2px; background: #E9EFEB; }
.cmp-verdict b { font-family: var(--display); font-size: 15px; line-height: 21px; }
.cmp-verdict span { color: #677169; font-size: 12px; line-height: 15px; }
.cmp-verdict.up b { color: #123F32; }
.cmp-verdict.down b { color: #B91C1C; }
.cmp-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 1fr) 65px; grid-template-areas: "label delta" "vals delta" "bar bar"; gap: 2px 9px; padding: 8px 0; border-top: 1px solid #E9EFEB; }
.cmp-row:first-child { border-top: 0; }
.cmp-label { grid-area: label; font-size: 13px; font-weight: 500; }
.cmp-vals { grid-area: vals; display: flex; align-items: baseline; gap: 6px; }
.cmp-vals b { font-family: var(--display); font-size: 14px; }
.cmp-vals small { color: #677169; font-size: 11px; }
.cmp-delta { grid-area: delta; display: flex; flex-direction: column; align-items: flex-end; justify-content: center; text-align: right; }
.cmp-delta b { font-family: var(--display); font-size: 13px; white-space: nowrap; }
.cmp-delta small { color: #677169; font-size: 10px; white-space: nowrap; }
.cmp-row.up .cmp-delta b { color: #123F32; }
.cmp-row.down .cmp-delta b { color: #B91C1C; }
.cmp-bar { grid-area: bar; position: relative; height: 7px; margin-top: 5px; background: #E9EFEB; border-radius: 4px; }
.cmp-bar::after { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: #123F32; }
.cmp-bar i { position: absolute; top: 0; bottom: 0; background: #123F32; }
.cmp-bar i.right { left: 50%; border-radius: 0 4px 4px 0; }
.cmp-bar i.left { right: 50%; border-radius: 4px 0 0 4px; }
.cmp-row.up .cmp-bar i { background: #123F32; }
.cmp-row.down .cmp-bar i { background: #B91C1C; }
.cmp-h { margin: 12px 0 4px; font-family: var(--display); font-size: 13px; }
html[data-device="desktop"] .cmp-row { grid-template-columns: 170px 145px minmax(0, 1fr) 82px; grid-template-areas: "label vals bar delta"; align-items: center; gap: 9px; }
html[data-device="desktop"] .cmp-bar { margin-top: 0; }
