/* ════════════════════════════════════════════════════════════
   Mölkky Score — feuille de styles
   Thème unique : épicéa le soir + bois de bouleau.
   Polices : Barlow (texte) et Barlow Condensed (chiffres, titres).
   ════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Fond et surfaces (épicéa) */
  --bg: #0F2219;
  --surface-1: #152C20;
  --surface-2: #1C3829;
  --surface-3: #244634;
  --line: #2E4E3D;
  --line-strong: #46685A;

  /* Texte (écorce de bouleau, lichen) */
  --text: #F1EADB;
  --text-2: #B5C6B9;
  --text-3: #8BA394;

  /* Bois des quilles */
  --wood-light: #EED3A2;
  --wood: #D6AE72;
  --wood-dark: #C39558;
  --wood-side: #7A5326;
  --wood-ink: #3B2410;

  /* Signaux */
  --danger: #F2654F;
  --warn: #F2B544;
  --ok: #7FD39B;

  /* Typo */
  --font-text: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Barlow Condensed', 'Barlow', system-ui, sans-serif;

  /* Formes */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --gutter: 16px;

  color-scheme: dark;
}

html, body { height: 100%; overflow: hidden; }

body {
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.4;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}

#root {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

button, input { font: inherit; color: inherit; }
button {
  min-height: 44px;
  min-width: 44px;
  cursor: pointer;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }
input { min-height: 44px; }
[role="button"] { min-height: 44px; cursor: pointer; }

:focus-visible {
  outline: 3px solid #9FD4FF;
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(15,34,25,0.8);
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.icon { flex-shrink: 0; display: block; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ═════════ ÉCRANS ═════════ */
.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.topbar {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 48px 1fr 48px;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px;
  padding-top: max(8px, env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.topbar-title {
  text-align: center;
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 24px;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn.is-danger { color: var(--danger); }

.scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: var(--gutter);
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}
.scroll > * { max-width: 560px; margin-left: auto; margin-right: auto; }

/* ═════════ BOUTONS ═════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: var(--r-md);
  font-weight: 600;
  font-size: 17px;
  transition: transform 0.12s, background 0.15s, opacity 0.15s;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.35; }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 19px; }
.btn-sm { min-height: 44px; padding: 8px 14px; font-size: 15px; }

/* Action principale : bouleau clair, très contrasté en plein soleil. */
.btn-primary {
  background: var(--text);
  color: var(--bg);
  box-shadow: 0 3px 0 #B9AE95;
}
.btn-primary:disabled { box-shadow: none; background: var(--surface-3); color: var(--text-3); opacity: 1; }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-quiet {
  color: var(--text-2);
}
.btn-danger {
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 55%, transparent);
  background: transparent;
}
.btn-danger-fill {
  background: var(--danger);
  color: #2A0D08;
}

/* ═════════ SECTIONS / LISTES ═════════ */
.section { margin-bottom: 24px; }
.section-title {
  font-family: var(--font-num);
  font-weight: 600;
  font-size: 22px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-note {
  color: var(--text-3);
  font-size: 14px;
  margin-top: -6px;
  margin-bottom: 12px;
}
.panel {
  background: var(--surface-1);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.row:last-child { border-bottom: none; }
.row-label { font-weight: 600; font-size: 16px; }
.row-sub { color: var(--text-3); font-size: 14px; margin-top: 2px; }
.row-value { color: var(--text-2); font-weight: 600; font-size: 15px; text-align: right; }
.row-stack { flex-direction: column; align-items: stretch; gap: 10px; }
.row-score { font-size: 26px; font-weight: 600; }
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

/* ═════════ FORMULAIRES ═════════ */
.field {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
}
.field::placeholder { color: var(--text-3); }
.field:focus { border-color: var(--text-2); outline: none; }
.field:focus-visible { outline: 3px solid #9FD4FF; outline-offset: 2px; }
.field[aria-invalid="true"] { border-color: var(--danger); }
.field-hint { color: var(--text-3); font-size: 14px; margin-top: 8px; }
.field-error { color: var(--danger); font-size: 15px; font-weight: 600; margin: 4px 0 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-2);
  font-weight: 600;
  font-size: 15px;
}
.chip.is-on {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
}

.switch {
  position: relative;
  width: 60px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 22px;
  background: var(--surface-3);
  border: 1px solid var(--line-strong);
  transition: background 0.2s;
}
.switch-thumb {
  position: absolute;
  top: 6px; left: 6px;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--text-2);
  transition: transform 0.2s, background 0.2s;
}
.switch.is-on { background: var(--ok); border-color: var(--ok); }
.switch.is-on .switch-thumb { transform: translateX(16px); background: var(--bg); }

.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text);
}
.stepper-btn:disabled { opacity: 0.3; }
.stepper-value {
  min-width: 64px;
  text-align: center;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}
.stepper-value.is-zero { color: var(--text-3); font-family: var(--font-text); font-size: 15px; }

.help-btn {
  width: 44px; height: 44px;
  margin: -8px -8px -8px 0;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}

/* ═════════ BOIS DES QUILLES ═════════ */
/* Disque de bouleau vu du dessus : cernes, chant visible en dessous,
   numéro gravé. C'est l'élément signature de l'application. */
.wood-disc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--wood-ink);
  font-family: var(--font-num);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 0 rgba(255,244,220,0.45);
  background:
    radial-gradient(circle at 50% 50%,
      transparent 0 17%, rgba(122,83,38,0.16) 18% 19.5%,
      transparent 20.5% 33%, rgba(122,83,38,0.13) 34% 35.5%,
      transparent 36.5% 50%, rgba(122,83,38,0.13) 51% 52.5%,
      transparent 53.5% 66%, rgba(122,83,38,0.18) 67% 68.5%,
      transparent 69.5%),
    radial-gradient(circle at 36% 30%, var(--wood-light), var(--wood) 62%, var(--wood-dark));
  box-shadow:
    inset 0 0 0 1.5px rgba(122,83,38,0.35),
    0 4px 0 var(--wood-side),
    0 7px 14px rgba(0,0,0,0.35);
}

/* ═════════ ACCUEIL ═════════ */
.home {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: max(20px, env(safe-area-inset-top));
}
.home-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.wordmark {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 64px;
  line-height: 0.9;
  letter-spacing: -0.01em;
}
.home-tagline { color: var(--text-2); font-size: 17px; margin-top: 6px; }

.resume {
  border: 1px solid var(--line-strong);
  background: var(--surface-1);
  border-radius: var(--r-lg);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.resume-title { font-weight: 700; font-size: 17px; }
.resume-sub { color: var(--text-3); font-size: 14px; }
.resume-teams { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.resume-team { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 15px; }
.resume-team .num { font-size: 20px; }
.resume-actions { display: flex; gap: 8px; }
.resume-actions .btn-primary { flex: 1; }

.dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--team, var(--text-3));
  flex-shrink: 0;
}

.formation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 18px 0 4px;
}
.formation-pins { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.formation-row { display: flex; gap: 6px; }
.formation-pin {
  width: 40px; height: 40px;
  font-size: 19px;
  box-shadow:
    inset 0 0 0 1.5px rgba(122,83,38,0.35),
    0 3px 0 var(--wood-side),
    0 5px 10px rgba(0,0,0,0.3);
}
.formation-caption {
  display: flex; align-items: center; gap: 10px;
  width: 100%; max-width: 260px;
  color: var(--text-3);
  font-size: 14px;
}
.formation-line { flex: 1; height: 1px; background: var(--line-strong); }

.home-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.home-actions .btn:only-child { grid-column: 1 / -1; }
.home-actions .count {
  min-width: 24px; height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-3);
  font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}

.rules { border-top: 1px solid var(--line); }
.rules-toggle {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 52px;
  font-weight: 600; font-size: 17px;
  color: var(--text);
}
.rules-toggle .icon { transition: transform 0.2s; color: var(--text-3); }
.rules-toggle[aria-expanded="true"] .icon { transform: rotate(180deg); }
.rules-list { list-style: none; padding-bottom: 8px; }
.rules-list li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  font-size: 16px;
}
.rules-list .num { color: var(--wood-light); font-size: 20px; font-weight: 700; }

/* ═════════ CONFIGURATION ═════════ */
.team-list { display: flex; flex-direction: column; }
.team-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 8px;
}
.team-item:first-child { padding-top: 0; }
.team-line {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}
.team-color-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
}
.order-btns { display: flex; }
.order-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.order-btn:disabled { opacity: 0.25; }
.remove-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.remove-btn:disabled { display: none; }
.team-handicap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
  padding-left: 22px;
}
.team-handicap-label {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--text-2); font-size: 15px; font-weight: 600;
}
.add-team { margin-top: 12px; }

.setup-memo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 6px;
  color: var(--text-3); font-size: 14px;
  margin: -4px 0 14px;
}
.link-btn {
  min-height: 44px;
  min-width: 0;
  padding: 0;
  color: var(--text-2);
  font-weight: 600;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Joueurs d'une équipe */
.team-players {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding-left: 22px;
}
.player-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  padding: 0 0 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 15px;
}
.player-chip-order {
  min-width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 13px;
  display: inline-flex; align-items: center; justify-content: center;
}
.player-chip-remove {
  width: 44px; height: 44px;
  margin-left: -6px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}
.player-add { display: flex; align-items: center; gap: 6px; flex: 1 1 180px; min-width: 0; }
.field-sm { min-height: 44px; padding: 8px 12px; font-size: 15px; }

.setting-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 10px;
}
.setting-desc { color: var(--text-3); font-size: 14px; margin: -4px 0 12px; }
.setting-sub { color: var(--text-2); font-size: 15px; margin: 14px 0 8px; font-weight: 600; }

.start-bar {
  flex-shrink: 0;
  padding: 10px var(--gutter);
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.start-bar > * { max-width: 560px; margin: 0 auto; }

/* ═════════ PARTIE ═════════ */
.game-layout { background: var(--bg); }

/* Tableau des scores : toutes les équipes visibles, 2 colonnes. */
.scoreboard {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 12px 6px;
  padding-top: max(8px, env(safe-area-inset-top));
}
.score-tile {
  position: relative;
  min-width: 0;
  padding: 8px 10px 8px 14px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  overflow: hidden;
  transition: background 0.2s, border-color 0.2s;
}
.score-tile::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--team);
  opacity: 0.55;
}
.score-tile.is-active {
  background: var(--surface-3);
  border-color: var(--text-2);
}
.score-tile.is-active::before { opacity: 1; width: 6px; }
.score-tile.is-out { opacity: 0.45; }
.tile-head {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.tile-wins {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--team);
  color: var(--bg);
  font-size: 14px;
  vertical-align: 2px;
}
.tile-name {
  min-width: 0;
  font-weight: 700;
  font-size: 15px;
  color: var(--team);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tile-body {
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
  margin-top: 2px;
}
.tile-score {
  font-size: 46px;
  font-weight: 700;
  line-height: 0.95;
  color: var(--text);
}
.tile-remain {
  color: var(--text-3);
  font-size: 14px;
  white-space: nowrap;
}
.tile-remain .num { font-size: 22px; font-weight: 600; color: var(--text-2); margin-left: 3px; }
.score-tile.is-playable .tile-remain .num { color: var(--team); }
.tile-status { font-size: 13px; color: var(--text-3); font-weight: 600; }

.misses { display: inline-flex; gap: 4px; flex-shrink: 0; }
.miss-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  border: 1.5px solid var(--text-3);
}
.miss-dot.filled { background: var(--danger); border-color: var(--danger); }
.misses.is-last .miss-dot:not(.filled) { border-color: var(--danger); }

/* 3 à 6 équipes : tuiles plus basses. */
.scoreboard[data-count="3"] .tile-score,
.scoreboard[data-count="4"] .tile-score { font-size: 34px; }
.scoreboard[data-count="5"] .score-tile,
.scoreboard[data-count="6"] .score-tile { padding-top: 5px; padding-bottom: 5px; }
.scoreboard[data-count="5"] .tile-score,
.scoreboard[data-count="6"] .tile-score { font-size: 28px; }
.scoreboard[data-count="5"] .tile-remain .num,
.scoreboard[data-count="6"] .tile-remain .num { font-size: 19px; }
.scoreboard[data-count="3"] .score-tile:last-child,
.scoreboard[data-count="5"] .score-tile:last-child { grid-column: 1 / -1; }

.game-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

.turnbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 12px 8px;
  padding-left: 4px;
}
.turn-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.turn-main { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.turn-meta {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  min-height: 22px;
  font-size: 15px;
}
.turn-prefix { color: var(--text-2); font-size: 16px; flex-shrink: 0; }
.turn-team-name {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 30px;
  line-height: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.turn-round { color: var(--text-3); font-size: 15px; flex-shrink: 0; white-space: nowrap; }
.turn-player {
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.turn-alert {
  flex-shrink: 0;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--danger);
  color: #2A0D08;
  font-weight: 700;
  font-size: 14px;
  white-space: nowrap;
}
.history-btn {
  flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  color: var(--text-2);
  font-weight: 600;
  font-size: 15px;
}

/* Aperçu du lancer */
.preview-wrap {
  flex-shrink: 0;
  position: relative;
  padding: 0 12px 6px;
}
.preview {
  display: grid;
  grid-template-columns: 1fr 1.25fr 1fr;
  align-items: stretch;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  min-height: 70px;
}
.preview-col {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6px 4px;
  min-width: 0;
}
.preview-col + .preview-col { border-left: 1px solid var(--line); }
.preview-label { color: var(--text-3); font-size: 13px; white-space: nowrap; }
.preview-value {
  font-size: 32px;
  font-weight: 600;
  line-height: 1;
  color: var(--text-3);
}
.preview-col-main .preview-value { font-size: 42px; }
.preview.has-selection .preview-col-main .preview-value { color: var(--text); }
.preview.has-selection .preview-value.is-after { color: var(--text-2); }
.preview-value.is-win { color: var(--ok) !important; }
.preview-value.is-overflow { color: var(--danger) !important; }

/* Toast : posé sur l'aperçu, jamais sur les boutons. */
.toast {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 50;
  transform: translate(-50%, -50%) scale(0.94);
  max-width: calc(100% - 40px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 17px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
}
.toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* Quilles */
.pins-grid-container {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px 10px;
  overflow: hidden;
  container-type: size;
}
.pins-grid {
  --pin-gap: 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--pin-gap);
  width: 100%;
  max-width: 340px;
}
@supports (width: 1cqh) {
  .pins-grid {
    --pin: min(calc((100cqw - 3 * var(--pin-gap)) / 4), calc((100cqh - 2 * var(--pin-gap) - 6px) / 3), 80px);
    grid-template-columns: repeat(4, var(--pin));
    width: auto;
    max-width: none;
  }
  .pin-btn { width: var(--pin); }
}
.pin-btn {
  aspect-ratio: 1;
  font-size: clamp(22px, 7.5vw, 32px);
  position: relative;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
}
.pin-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: inset 0 0 0 1.5px rgba(122,83,38,0.35), 0 1px 0 var(--wood-side);
}
/* Quille tombée (sélectionnée) : sombre, anneau à la couleur de l'équipe. */
.pin-btn.selected {
  background: var(--surface-2);
  color: var(--text);
  text-shadow: none;
  transform: translateY(3px);
  box-shadow:
    inset 0 0 0 4px var(--team, var(--text)),
    0 1px 0 rgba(0,0,0,0.4);
}
.pin-btn .check-mark { display: none; }
/* Aide en fin de partie */
.pin-btn.is-target:not(.selected) {
  box-shadow:
    0 0 0 3px var(--bg),
    0 0 0 6px var(--ok),
    0 4px 0 var(--wood-side),
    0 7px 14px rgba(0,0,0,0.35);
}
.pin-btn.is-over:not(.selected) { opacity: 0.4; }

/* Disposition « terrain » : 4 rangées 3-4-3-2 */
.pins-grid.is-field {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
  max-width: none;
}
.pins-row { display: flex; gap: var(--pin-gap); }
.pins-grid.is-field .pin-btn { width: 64px; }
@supports (width: 1cqh) {
  .pins-grid.is-field {
    --pin: min(calc((100cqw - 3 * var(--pin-gap)) / 4), calc((100cqh - 3 * var(--pin-gap) - 6px) / 4), 80px);
  }
  .pins-grid.is-field .pin-btn { width: var(--pin); }
}
.pin-btn:disabled { opacity: 0.45; }

/* Raté + actions */
.miss-bar { flex-shrink: 0; padding: 0 12px 8px; }
.miss-bar-btn {
  width: 100%;
  min-height: 48px;
  border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-weight: 600;
  font-size: 17px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.miss-bar-btn .icon { color: var(--danger); }
.miss-bar-btn:active:not(:disabled) { background: color-mix(in srgb, var(--danger) 20%, transparent); }
.miss-bar-btn:disabled { opacity: 0.35; }
.miss-bar-btn.is-last { border-color: var(--danger); background: color-mix(in srgb, var(--danger) 12%, transparent); }
.miss-bar-btn.is-last small { color: var(--danger); font-weight: 600; }
.miss-bar-btn small { color: var(--text-3); font-size: 14px; font-weight: 500; }

.bottom-action-row {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 76px 1fr 76px;
  gap: 8px;
  padding: 0 12px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
}
.side-btn {
  min-height: 58px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  color: var(--text-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 13px;
  font-weight: 600;
}
.side-btn:disabled { opacity: 0.35; }
.side-btn:active:not(:disabled) { background: var(--surface-2); }
.validate-btn {
  min-height: 58px;
  border-radius: var(--r-md);
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  font-size: 20px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 3px 0 #B9AE95;
  transition: transform 0.1s;
}
.validate-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 #B9AE95; }
.validate-btn:disabled { background: var(--surface-2); color: var(--text-3); box-shadow: none; }

/* Petits téléphones en portrait (SE, mini) */
@media (max-height: 740px) and (orientation: portrait) {
  .scoreboard { gap: 5px; padding-bottom: 4px; }
  .score-tile { padding-top: 5px; padding-bottom: 5px; }
  .tile-score { font-size: 36px; }
  .scoreboard[data-count="3"] .tile-score,
  .scoreboard[data-count="4"] .tile-score { font-size: 28px; }
  .scoreboard[data-count="5"] .tile-score,
  .scoreboard[data-count="6"] .tile-score { font-size: 24px; }
  .turnbar { margin-bottom: 5px; }
  .turn-team-name { font-size: 25px; }
  .preview { min-height: 56px; }
  .preview-value { font-size: 26px; }
  .preview-col-main .preview-value { font-size: 32px; }
  .pins-grid { --pin-gap: 9px; }
  .pins-grid-container { padding-top: 4px; padding-bottom: 6px; }
  .miss-bar { padding-bottom: 6px; }
  .miss-bar-btn { min-height: 44px; }
  .side-btn, .validate-btn { min-height: 52px; }
}
@media (max-width: 360px) {
  .turn-prefix { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .history-btn { padding: 0 10px; }
  .bottom-action-row { grid-template-columns: 66px 1fr 66px; }
}

/* Paysage (iPad, téléphone couché) */
@media (orientation: landscape) {
  .game-layout { flex-direction: row; }
  .scoreboard {
    grid-template-columns: 1fr;
    align-content: start;
    width: 200px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid var(--line);
    padding: max(10px, env(safe-area-inset-top)) 10px 10px max(10px, env(safe-area-inset-left));
  }
  .scoreboard .score-tile:last-child { grid-column: auto; }
  .scoreboard .tile-score { font-size: 32px !important; }
  .pins-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); max-width: 460px; }
  @supports (width: 1cqh) {
    .pins-grid {
      --pin: min(calc((100cqw - 5 * var(--pin-gap)) / 6), calc((100cqh - var(--pin-gap) - 6px) / 2), 84px);
      grid-template-columns: repeat(6, var(--pin));
      max-width: none;
    }
  }
}
@media (orientation: landscape) and (max-height: 500px) {
  .scoreboard { width: 170px; }
  .game-main { overflow-y: auto; }
  .pins-grid-container { flex: none; container-type: normal; }
  .pins-grid { --pin: 52px; grid-template-columns: repeat(6, 52px); width: auto; max-width: none; }
  .pin-btn { width: 52px; font-size: 24px; }
}

/* ═════════ FEUILLES MODALES ═════════ */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(4,12,8,0.72);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--surface-1);
  border: 1px solid var(--line-strong);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 20px 18px max(20px, env(safe-area-inset-bottom));
  animation: sheetIn 0.26s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -20px 40px rgba(0,0,0,0.4);
}
.sheet-warn { border-top: 4px solid var(--warn); }
.sheet-danger { border-top: 4px solid var(--danger); }
@keyframes sheetIn { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
  * { transition-duration: 0.01ms !important; }
}
.sheet-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  margin-bottom: 14px;
}
.sheet-title {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.05;
}
.sheet-sub { color: var(--text-3); font-size: 15px; margin-top: 4px; }
.sheet-close {
  width: 44px; height: 44px; margin: -6px -6px 0 0;
  border-radius: 50%;
  background: var(--surface-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-2);
}
.sheet-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.sheet-text { color: var(--text-2); font-size: 16px; line-height: 1.5; }
.sheet-text + .sheet-text { margin-top: 10px; }

.fact-list {
  list-style: none;
  border-top: 1px solid var(--line);
  margin-top: 4px;
}
.fact-list li {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
  color: var(--text-2);
}
.fact-list li strong { color: var(--text); font-weight: 700; }
.fact-list li .num { font-size: 22px; line-height: 1; }
.tip {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  font-weight: 600;
  font-size: 16px;
}

.rule-block { padding: 10px 0; border-bottom: 1px solid var(--line); }
.rule-block:last-of-type { border-bottom: none; }
.rule-block h3 { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.rule-block p { color: var(--text-2); font-size: 15px; line-height: 1.5; }

.pause-scores { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-bottom: 4px; }
.pause-score { display: inline-flex; align-items: baseline; gap: 6px; font-weight: 600; color: var(--text-2); }
.pause-score .num { font-size: 24px; color: var(--text); }

/* Historique des coups */
.match-history-sheet { display: flex; flex-direction: column; }
.match-history-list { padding-top: 4px; }
.match-history-round { margin-bottom: 14px; }
.match-history-round-title { color: var(--text-3); font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.match-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  min-height: 52px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.match-history-team { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 600; }
.match-history-team span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.match-history-event { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.match-history-event strong { font-size: 14px; font-weight: 600; color: var(--text-2); }
.match-history-event span { font-size: 13px; color: var(--text-3); }
.match-history-row.warning .match-history-event strong { color: var(--warn); }
.match-history-row.danger .match-history-event strong { color: var(--danger); }
.match-history-points { min-width: 44px; text-align: right; font-size: 24px; font-weight: 600; }
.match-history-empty { color: var(--text-3); padding: 24px 0; text-align: center; }

/* ═════════ VICTOIRE ═════════ */
.win {
  display: flex; flex-direction: column; gap: 20px;
  padding-top: max(28px, env(safe-area-inset-top));
}
.win-kicker { color: var(--text-2); font-size: 18px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.win-team {
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 60px;
  line-height: 0.95;
  color: var(--team);
  overflow-wrap: anywhere;
}
.win-sub { color: var(--text-2); font-size: 16px; margin-top: 6px; }
.ranking { list-style: none; }
.ranking li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}
.ranking .rank { color: var(--text-3); font-size: 20px; font-weight: 600; }
.ranking .name { display: flex; align-items: center; gap: 8px; font-weight: 600; min-width: 0; }
.ranking .name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .score { font-size: 28px; font-weight: 600; }
.ranking .out { color: var(--text-3); font-size: 14px; font-weight: 500; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
}
.stat {
  background: var(--surface-1);
  padding: 10px 8px;
  text-align: center;
}
.stat-value { font-size: 28px; font-weight: 600; line-height: 1.05; }
.stat-label { color: var(--text-3); font-size: 13px; margin-top: 2px; }
.win-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-board {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
}
.match-board-title { color: var(--text-3); font-size: 14px; margin-bottom: 6px; }
.match-board-teams { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.match-board-team { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.match-board-team .num { font-size: 28px; line-height: 1; }

/* ═════════ HISTORIQUE / STATS ═════════ */
.tabs {
  flex-shrink: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 10px var(--gutter) 0;
  padding: 4px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
}
.tab {
  min-height: 44px;
  border-radius: var(--r-sm);
  color: var(--text-3);
  font-weight: 600;
  font-size: 16px;
}
.tab.is-on { background: var(--surface-3); color: var(--text); }

.empty {
  text-align: center;
  padding: 64px 16px;
  color: var(--text-3);
}
.empty strong { display: block; color: var(--text-2); font-size: 18px; margin-bottom: 4px; }

.list-count { color: var(--text-3); font-size: 14px; margin-bottom: 8px; }
.history-item {
  position: relative;
  display: block;
  padding: 12px 52px 12px 0;
  border-bottom: 1px solid var(--line);
}
.history-item:active { background: var(--surface-1); }
.history-game-label { font-weight: 700; font-size: 17px; }
.history-item-date { color: var(--text-3); font-size: 14px; margin-top: 1px; }
.history-item-teams { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; }
.history-team-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; color: var(--text-2); }
.history-team-pill.is-winner { color: var(--text); font-weight: 700; }
.history-team-pill .num { font-size: 20px; }
.history-delete {
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-3);
}

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 24px; }
.summary {
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
  min-width: 0;
}
.summary-value { font-size: 26px; font-weight: 600; line-height: 1.1; overflow-wrap: anywhere; }
.summary-label { color: var(--text-3); font-size: 14px; }

.player-row {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 24px;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.player-row .rank { color: var(--text-3); font-size: 20px; font-weight: 600; text-align: center; }
.player-name { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; min-width: 0; }
.player-name span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player-meta { color: var(--text-3); font-size: 14px; margin-top: 2px; }
.player-wins { text-align: right; }
.player-wins .num { font-size: 26px; font-weight: 600; line-height: 1; }
.player-wins small { display: block; color: var(--text-3); font-size: 13px; }
.player-row .icon { color: var(--text-3); transform: rotate(-90deg); }

.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--team, var(--text)); border-radius: 3px; }

.detail-head { margin-bottom: 18px; }
.detail-title { font-family: var(--font-num); font-weight: 700; font-size: 34px; line-height: 1; }
.detail-sub { color: var(--text-3); font-size: 15px; margin-top: 6px; }
.detail-team { padding: 14px 0; border-bottom: 1px solid var(--line); }
.detail-team-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.detail-team-head .name { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 18px; min-width: 0; }
.detail-team-head .num { font-size: 34px; font-weight: 600; }
.detail-team.is-winner .detail-team-head .name { color: var(--team); }
.detail-players { list-style: none; margin-top: 8px; }
.detail-players li {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}
.detail-players li:last-child { border-bottom: none; }
.detail-player-stats { color: var(--text-3); font-weight: 500; font-size: 15px; }
.detail-player-stats strong { color: var(--text); font-size: 20px; }

.big-rate { font-family: var(--font-num); font-weight: 700; font-size: 64px; line-height: 1; color: var(--team); }

/* ═════════ RÉGLAGES ═════════ */
.nav-group {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--surface-1);
  overflow: hidden;
}
.nav-row {
  width: 100%;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  text-align: left;
  color: var(--text);
}
.nav-row + .nav-row { border-top: 1px solid var(--line); }
.nav-row:active { background: var(--surface-2); }
.nav-row-icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: var(--surface-3);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--wood-light);
}
.nav-row-text { display: flex; flex-direction: column; min-width: 0; }
.nav-row-chevron { color: var(--text-3); transform: rotate(-90deg); }

.code-box {
  display: block;
  width: 100%;
  height: 120px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--text-2);
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.4;
  resize: none;
  word-break: break-all;
}
.code-box:focus { outline: none; border-color: var(--text-2); }
.sheet-status { margin-top: 10px; color: var(--ok); font-weight: 600; font-size: 15px; }

/* ═════════ GUIDE ═════════ */
.guide-head { margin-bottom: 18px; }
.guide-mark { display: flex; align-items: center; gap: 14px; }
.guide-mark-pin { width: 56px; height: 56px; font-size: 26px; flex-shrink: 0; }
.guide-wordmark { font-size: 40px; }
.guide-head .detail-sub { margin-top: 10px; }
.guide-toc {
  margin-bottom: 28px;
  padding: 6px 14px;
  border-radius: var(--r-md);
  background: var(--surface-1);
  border: 1px solid var(--line);
}
.guide-toc ol { list-style: none; }
.guide-toc li + li { border-top: 1px solid var(--line); }
.guide-toc a {
  display: flex; align-items: center; gap: 12px;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}
.guide-toc .num { color: var(--wood-light); font-size: 20px; width: 18px; text-align: center; }
.guide-section { margin-bottom: 36px; scroll-margin-top: 12px; }
.guide-title {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--font-num);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 14px;
}
.guide-title-num {
  width: 40px; height: 40px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--wood);
  color: var(--wood-ink);
  font-size: 22px;
}
.guide-shot {
  margin: 0 0 16px;
  padding: 10px;
  border-radius: 24px;
  background: #08140E;
  border: 1px solid var(--line-strong);
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
.guide-shot-screen {
  position: relative;
  border-radius: 16px;
  background: var(--bg);
  overflow: hidden;
  pointer-events: none;
  user-select: none;
  padding: 6px 0 10px;
}
.guide-pad { padding: 8px 12px; }
.guide-small-title { font-size: 19px; }
.guide-shot .team-item { padding: 8px 0; }
.guide-team-line { display: flex; align-items: center; gap: 8px; }
.guide-field { display: block; padding: 8px 12px; min-height: 0; }
.guide-shot .team-players { padding-left: 22px; }
.guide-chip { min-height: 34px; }
.guide-shot .chip { min-height: 34px; display: inline-flex; align-items: center; }
.guide-scoreboard { padding-top: 6px !important; }
.guide-scoreboard .tile-score { font-size: 34px; }
.guide-turnbar { margin-bottom: 6px; }
.guide-turnbar .turn-team-name { font-size: 24px; }
.guide-preview { margin: 0 12px 8px; min-height: 56px; }
.guide-preview .preview-value { font-size: 24px; }
.guide-preview .preview-col-main .preview-value { font-size: 30px; }
.guide-preview .preview-label { display: inline-flex; align-items: center; }
.guide-preview .guide-callout { width: 20px; height: 20px; font-size: 13px; margin-left: 6px; }
.guide-pins {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 44px);
  justify-content: center;
  gap: 10px;
  padding: 6px 12px 14px;
}
.guide-pin { width: 44px; height: 44px; font-size: 20px; }
.guide-pin.selected { transform: none; }
.guide-actions { padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.guide-miss { min-height: 40px; position: relative; }
.guide-action-row { display: grid; grid-template-columns: 64px 1fr 64px; gap: 8px; }
.guide-action-row .side-btn, .guide-action-row .validate-btn { min-height: 46px; font-size: 13px; position: relative; }
.guide-action-row .validate-btn { font-size: 17px; }
.guide-win-team { font-size: 40px; }
.guide-tabs { margin: 0 0 8px; }
.guide-tabs .tab { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.guide-shot .player-row { min-height: 56px; }
.guide-shot .nav-row { min-height: 52px; }
.guide-shot .row { min-height: 48px; position: relative; }

.guide-share { margin: 6px 12px; border-radius: var(--r-md); background: var(--surface-1); overflow: hidden; }
.guide-share-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-weight: 700; border-bottom: 1px solid var(--line); }
.guide-share-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; color: var(--text-2); border-bottom: 1px solid var(--line); }
.guide-share-row:last-child { border-bottom: none; }
.guide-share-row.is-hit { color: var(--text); font-weight: 700; background: var(--surface-3); }

/* Repères numérotés sur les maquettes, renvoyant aux étapes. */
.guide-callout {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  margin-left: 8px;
  border-radius: 50%;
  background: var(--warn);
  color: #2A1A02;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--bg);
  flex-shrink: 0;
  vertical-align: middle;
}
.guide-callouts-row { display: flex; justify-content: flex-end; padding: 0 14px; margin: -6px 0 -10px; position: relative; z-index: 1; }

.guide-steps { list-style: none; }
.guide-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.guide-step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--warn);
  color: #2A1A02;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.guide-steps p { color: var(--text-2); font-size: 16px; line-height: 1.5; max-width: 62ch; }
.guide-steps strong { color: var(--text); }
.guide-foot { text-align: center; color: var(--text-3); padding: 8px 0 20px; }

.version-badge {
  font-family: var(--font-num);
  font-size: 17px;
  font-weight: 600;
  color: var(--text-2);
}
