/* ═══════════════════════════════════════════════════════════════
   Ardoise — compteur de fléchettes
   Palette & typo reprises de la-mire.pro
   Mobile first : l'écran de jeu tient dans une hauteur d'écran.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* la-mire.pro */
  --ink:        #15120D;
  --ink-soft:   #211C14;
  --cream:      #F3EAD6;
  --cream-fg:   #F6EFD9;
  --board:      #EFE4C6;
  --green:      #1C7A47;
  --green-hud:  #3FB374;
  --red:        #C0272D;
  --red-bright: #D8322F;

  /* dérivés pour le fond sombre */
  --surface:    #191510;
  --surface-2:  #221C15;
  --surface-3:  #2C241A;
  --fg:         var(--cream-fg);
  --fg-muted:   rgba(246, 239, 217, 0.62);
  --fg-faint:   rgba(246, 239, 217, 0.38);
  --line:       rgba(246, 239, 217, 0.14);
  --line-soft:  rgba(246, 239, 217, 0.07);

  --font-display: 'Clash Display', ui-sans-serif, system-ui, sans-serif;
  --font-text:    'General Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono:    'Chakra Petch', ui-monospace, SFMono-Regular, Menlo, monospace;

  --gap: 10px;
  --r: 12px;
  --r-lg: 18px;
}

* { box-sizing: border-box; }

html { height: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  padding: var(--gap);
  padding-bottom: max(var(--gap), env(safe-area-inset-bottom));
  padding-top: max(var(--gap), env(safe-area-inset-top));
  background:
    radial-gradient(120% 80% at 50% 0%, #241E15 0%, var(--ink) 62%),
    var(--ink);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

#app { max-width: 1120px; margin: 0 auto; }

.hidden { display: none !important; }

button { font-family: inherit; touch-action: manipulation; user-select: none; }

::selection { background: var(--green-hud); color: var(--ink); }

/* ─────────────────────────────────────────────────────────────
   Écran de configuration
   ───────────────────────────────────────────────────────────── */

.board {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: clamp(16px, 4vw, 30px);
  box-shadow: 0 20px 50px rgba(0,0,0,.5);
  position: relative;
  overflow: hidden;
}
.board::before {
  /* liseré cible : vert / rouge / crème */
  content: "";
  position: absolute; inset: 0 0 auto 0; height: 4px;
  background: repeating-linear-gradient(90deg,
    var(--green) 0 22px, var(--cream) 22px 30px,
    var(--red) 30px 52px, var(--ink-soft) 52px 60px);
  opacity: .9;
}

.board-head { text-align: center; margin-bottom: clamp(18px, 4vw, 28px); }
.logo-dot {
  width: 40px; height: 40px; margin: 4px auto 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle, var(--red) 0 18%, var(--green) 18% 38%,
      var(--cream) 38% 62%, var(--ink-soft) 62% 82%, var(--cream) 82% 100%);
  box-shadow: 0 0 0 1px var(--line);
}
.board-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2rem, 9vw, 2.9rem);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--cream-fg);
}
.board-head .subtitle {
  margin: 8px 0 0;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .7rem;
  letter-spacing: .3em;
  text-transform: uppercase;
  color: var(--green-hud);
}

#setup-form { display: grid; gap: 16px; }

fieldset {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  margin: 0;
  background: rgba(0,0,0,.16);
}
legend {
  padding: 0 8px;
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
.hint { margin: 0 0 12px; color: var(--fg-faint); font-size: .82rem; line-height: 1.4; }

/* segmented */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg-btn {
  display: grid; gap: 1px;
  padding: 12px 8px;
  font-size: 1rem; font-weight: 600;
  color: var(--fg-muted);
  background: transparent;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.seg-btn span {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  opacity: .7;
}
.seg-btn.is-active {
  color: var(--ink);
  background: var(--cream);
  border-color: var(--cream);
}

/* équipes */
.teams-setup { display: grid; gap: 14px; }
.team-setup { display: grid; gap: 8px; }
.team-setup h3 {
  margin: 0;
  font-family: var(--font-mono); font-weight: 700;
  font-size: .72rem; letter-spacing: .18em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.team-setup h3::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%; flex: none;
}
.t-green h3::before, .bull-row.t-green .bull-name::before { background: var(--green-hud); }
.t-red h3::before,   .bull-row.t-red .bull-name::before   { background: var(--red-bright); }
.t-green h3 { color: var(--green-hud); }
.t-red h3   { color: var(--red-bright); }

input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 13px 12px;
  font-family: inherit; font-size: 1rem;
  color: var(--fg);
  background: rgba(0,0,0,.3);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color .15s, background .15s;
}
input::placeholder { color: var(--fg-faint); }
input:focus, select:focus { border-color: var(--green-hud); background: rgba(0,0,0,.45); }
select {
  appearance: none; cursor: pointer; padding-right: 34px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: right 17px center, right 12px center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  background-color: rgba(0,0,0,.3);
}
select option { background: var(--surface-2); color: var(--fg); }

.grid-cfg { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.grid-cfg label {
  display: grid; gap: 6px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-muted);
}

/* bulle */
.bull-grid { display: grid; gap: 10px; }
.bull-row {
  display: grid;
  grid-template-columns: auto 1fr 96px;
  align-items: center; gap: 12px;
  padding: 10px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.bull-row input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.bull-check {
  width: 22px; height: 22px; flex: none;
  border: 2px solid var(--fg-faint);
  border-radius: 50%;
  display: grid; place-items: center;
  transition: border-color .15s;
}
.bull-check::after {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: currentColor; transform: scale(0); transition: transform .15s;
}
.bull-name { display: flex; align-items: center; gap: 8px; font-weight: 500; overflow-wrap: anywhere; }
.bull-name::before { content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bull-row.t-green:has(input:checked) { border-color: var(--green-hud); background: rgba(63,179,116,.1); color: var(--green-hud); }
.bull-row.t-red:has(input:checked)   { border-color: var(--red-bright); background: rgba(216,50,47,.1); color: var(--red-bright); }
.bull-row:has(input:checked) .bull-check { border-color: currentColor; }
.bull-row:has(input:checked) .bull-check::after { transform: scale(1); }
.bull-dist { text-align: center; font-family: var(--font-mono); font-weight: 600; color: var(--fg); }

/* ─────────────────────────────────────────────────────────────
   Boutons
   ───────────────────────────────────────────────────────────── */

.btn {
  font-size: 1rem; font-weight: 600;
  padding: 13px 18px;
  border-radius: var(--r);
  border: 1.5px solid var(--line);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .06s, opacity .15s;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn-primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn-outline { border-color: var(--line); color: var(--fg-muted); }
.btn-danger  { border-color: rgba(216,50,47,.5); color: var(--red-bright); }
.btn-block   { width: 100%; padding: 16px; font-size: 1.05rem; }
@media (hover: hover) {
  .btn:hover:not(:disabled) { background: rgba(246,239,217,.07); border-color: rgba(246,239,217,.3); }
  .btn-primary:hover:not(:disabled) { background: var(--red-bright); border-color: var(--red-bright); }
  .btn-danger:hover:not(:disabled) { background: rgba(216,50,47,.14); border-color: var(--red-bright); }
  .seg-btn:hover { color: var(--fg); }
  .seg-btn.is-active:hover { color: var(--ink); }
}

.icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  font-size: 1.25rem; line-height: 1;
  color: var(--fg-muted);
  background: rgba(0,0,0,.25);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background .15s, color .15s, opacity .15s, transform .06s;
}
.icon-btn:active:not(:disabled) { transform: scale(.93); }
.icon-btn:disabled { opacity: .28; cursor: not-allowed; }
.icon-btn.is-danger { color: var(--red-bright); }
@media (hover: hover) { .icon-btn:hover:not(:disabled) { background: rgba(246,239,217,.1); color: var(--fg); } }

/* ─────────────────────────────────────────────────────────────
   Écran de jeu — grille pleine hauteur
   ───────────────────────────────────────────────────────────── */

#screen-game {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: var(--gap);
  min-height: calc(100dvh - var(--gap) * 2);
}

.game-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.match-info {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase;
  color: var(--fg-faint);
  line-height: 1.5;
  min-width: 0;
}
.match-info b { color: var(--green-hud); font-weight: 700; }
.match-info .bull-note { display: block; color: var(--fg-faint); text-transform: none; letter-spacing: .04em; opacity: .8; }
.head-actions { display: flex; gap: 8px; flex: none; }

/* tableau des scores */
.scoreboard {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.team-panel {
  position: relative;
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 10px;
  min-width: 0;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1.5px solid var(--line);
  border-radius: var(--r);
  transition: border-color .2s, background .2s;
}
.team-panel::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--line);
}
.team-panel.t0::before { background: var(--green); }
.team-panel.t1::before { background: var(--red); }
.team-panel.t0.is-active { border-color: var(--green-hud); background: linear-gradient(180deg, rgba(28,122,71,.22), var(--surface)); }
.team-panel.t1.is-active { border-color: var(--red-bright); background: linear-gradient(180deg, rgba(192,39,45,.22), var(--surface)); }

.team-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; min-width: 0; }
.team-name {
  font-weight: 600; font-size: .95rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-crowns {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .62rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--fg-faint); white-space: nowrap; flex: none;
}
.team-crowns b { color: var(--cream-fg); font-weight: 700; font-size: .8rem; }

.team-score {
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(2.9rem, 15vw, 4.6rem);
  line-height: 1;
  text-align: center;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  color: var(--cream-fg);
}
.team-panel.t0.is-active .team-score { color: var(--green-hud); }
.team-panel.t1.is-active .team-score { color: var(--red-bright); }
.team-score.is-finish { color: var(--green-hud) !important; }

.team-thrower {
  text-align: center;
  min-height: 1.2em;
  font-size: .8rem; font-weight: 500;
  color: var(--fg-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-panel.is-active .team-thrower { color: var(--cream-fg); }

.team-turns {
  list-style: none; margin: 6px 0 0; padding: 0;
  max-height: 88px; overflow-y: auto;
  border-top: 1px solid var(--line-soft);
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
  -webkit-overflow-scrolling: touch;
}
.team-turns li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: baseline; gap: 6px;
  padding: 3px 2px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.team-turns .t-darts {
  font-size: .6rem; letter-spacing: .04em;
  color: var(--fg-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.team-turns .t-scored { font-size: .95rem; color: var(--cream-fg); }
.team-turns .t-rest   { font-size: .68rem; color: var(--fg-faint); min-width: 2.8em; text-align: right; }
.team-turns li.is-bust .t-scored { color: var(--red-bright); font-size: .68rem; }
.team-turns li.is-ton  .t-scored { color: var(--green-hud); }
.team-turns li.is-win  .t-scored { color: var(--green-hud); }

.team-stats {
  padding-top: 5px;
  font-family: var(--font-mono); font-weight: 600;
  font-size: .58rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--fg-faint);
  text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* volée en cours */
.turn-area {
  display: grid; gap: 6px; justify-items: center;
  padding: 8px;
  background: rgba(0,0,0,.24);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
}
.turn-who { font-size: .82rem; color: var(--fg-muted); text-align: center; }
.turn-who b { color: var(--cream-fg); font-weight: 600; }

.darts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; width: 100%; max-width: 340px; }
.dart-slot {
  height: 46px;
  display: grid; place-items: center;
  padding: 0;
  font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem;
  background: transparent;
  border: 1.5px dashed var(--line);
  border-radius: 10px;
  color: var(--fg-faint);
  transition: border-color .12s, background .12s, color .12s, transform .06s;
}
.dart-slot.is-filled {
  border-style: solid;
  border-color: rgba(246,239,217,.35);
  background: rgba(246,239,217,.08);
  color: var(--cream-fg);
  cursor: pointer;   /* cliquer une fléchette la corrige */
}
.dart-slot.is-filled:active { transform: scale(.95); }
@media (hover: hover) {
  /* :not(.is-editing) sinon le survol écrase le fond de la fléchette sélectionnée */
  .dart-slot.is-filled:not(.is-editing):hover {
    border-color: var(--cream);
    background: rgba(246,239,217,.16);
  }
}
/* fléchette en cours de correction */
.dart-slot.is-editing {
  border-style: solid;
  border-color: var(--cream);
  background: var(--cream);
  color: var(--ink);
  animation: editing 1.5s ease-in-out infinite;
}
@keyframes editing {
  0%, 100% { box-shadow: 0 0 0 0 rgba(243, 234, 214, .5); }
  55%      { box-shadow: 0 0 0 7px rgba(243, 234, 214, 0); }
}
@media (prefers-reduced-motion: reduce) { .dart-slot.is-editing { animation: none; } }
.turn-total {
  font-family: var(--font-mono); font-weight: 600;
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-muted); min-height: 1.3em;
}
.turn-total b { font-size: 1.05rem; color: var(--cream-fg); }
.turn-total.is-bust, .turn-total.is-bust b { color: var(--red-bright); }
.turn-total.is-win, .turn-total.is-win b { color: var(--green-hud); }

/* volée close : elle attend la validation */
.turn-area.is-locked { border-color: rgba(244,208,111,.4); background: rgba(0,0,0,.34); }
.turn-area.is-locked .dart-slot.is-empty { opacity: .35; }
.turn-area:has(.dart-slot.is-editing) { border-color: var(--cream); }

/* clavier */
.keypad {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 8px;
  min-height: 0;
}
.mods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mod {
  display: grid; justify-items: center; align-content: center; gap: 0;
  padding: 6px 4px;
  color: var(--fg-muted);
  background: rgba(0,0,0,.25);
  border: 1.5px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .06s;
}
.mod:active { transform: scale(.96); }
.mod b { font-family: var(--font-mono); font-weight: 700; font-size: 1.25rem; line-height: 1.1; }
.mod span { font-family: var(--font-mono); font-weight: 600; font-size: .55rem; letter-spacing: .16em; text-transform: uppercase; opacity: .75; }
.mod:disabled { opacity: .28; cursor: not-allowed; }
.mod.is-active { color: var(--ink); background: var(--cream); border-color: var(--cream); }
.mod[data-mult="2"].is-active { background: var(--green-hud); border-color: var(--green-hud); }
.mod[data-mult="3"].is-active { background: var(--red-bright); border-color: var(--red-bright); color: #fff; }

.numbers {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: minmax(44px, 1fr);
  gap: 6px;
  min-height: 0;
}
.specials { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.key {
  display: grid; place-items: center;
  padding: 4px;
  font-family: var(--font-mono); font-weight: 700;
  font-size: clamp(1.05rem, 4.4vw, 1.35rem);
  font-variant-numeric: tabular-nums;
  color: var(--cream-fg);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background .1s, transform .06s, border-color .1s;
}
.key:active:not(:disabled) { transform: scale(.93); background: var(--cream); color: var(--ink); }
.key:disabled { opacity: .25; cursor: not-allowed; }
@media (hover: hover) { .key:hover:not(:disabled) { background: var(--surface-3); border-color: rgba(246,239,217,.3); } }

.key-special { grid-auto-flow: row; gap: 0; min-height: 50px; }
.key-special b { font-family: var(--font-text); font-weight: 600; font-size: .72rem; letter-spacing: .04em; }
.key-special span { font-family: var(--font-mono); font-weight: 700; font-size: 1.05rem; color: var(--fg-muted); }
.key-special.is-green span { color: var(--green-hud); }
.key-special.is-red span   { color: var(--red-bright); }

/* la volée est prête : le bouton de validation se signale */
.btn-primary.is-ready { animation: ready 1.6s ease-in-out infinite; }
@keyframes ready {
  0%, 100% { box-shadow: 0 0 0 0 rgba(216, 50, 47, .55); }
  55%      { box-shadow: 0 0 0 9px rgba(216, 50, 47, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .btn-primary.is-ready { animation: none; box-shadow: 0 0 0 3px rgba(216, 50, 47, .45); }
}

.pad-actions { display: grid; grid-template-columns: 64px 1fr; gap: 8px; }
.pad-actions .btn { padding: 14px 10px; font-size: 1rem; }

/* bannière leg / set */
.banner {
  position: fixed;
  left: 50%; bottom: calc(16px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 40;
  max-width: calc(100vw - 24px);
  padding: 12px 22px;
  text-align: center;
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.05rem;
  color: var(--ink);
  background: var(--green-hud);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0,0,0,.55);
  animation: pop .22s cubic-bezier(.2,.9,.3,1.4);
}
@keyframes pop { from { transform: translateX(-50%) scale(.85); opacity: 0; } }

/* modale */
.modal-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(10,8,5,.78); backdrop-filter: blur(4px); }
.modal {
  position: relative;
  width: min(440px, 100%);
  padding: 26px 22px 22px;
  text-align: center;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,.6);
  animation: pop-modal .2s ease-out;
}
@keyframes pop-modal { from { transform: scale(.92); opacity: 0; } }
.modal h2 {
  margin: 0 0 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 1.6rem;
  color: var(--cream-fg);
}
.modal p { margin: 0 0 20px; color: var(--fg-muted); font-size: .95rem; }
.modal p b { color: var(--green-hud); }
.modal-actions { display: grid; gap: 10px; }
@media (min-width: 400px) { .modal-actions { grid-auto-flow: column; grid-auto-columns: 1fr; } }

/* ─────────────────────────────────────────────────────────────
   Tablette / desktop
   ───────────────────────────────────────────────────────────── */

@media (min-width: 560px) {
  :root { --gap: 14px; }
  .teams-setup { grid-template-columns: 1fr 1fr; gap: 18px; }
  .team-turns { max-height: 130px; }
  .team-turns .t-darts { font-size: .68rem; }
  .team-turns .t-scored { font-size: 1.15rem; }
  .team-stats { font-size: .66rem; }
  .dart-slot { height: 56px; font-size: 1.5rem; }
  .match-info { font-size: .74rem; }
}

@media (min-width: 900px) {
  #screen-game {
    grid-template-columns: 1fr minmax(380px, 440px);
    grid-template-rows: auto auto minmax(0, 1fr);
    grid-template-areas:
      "head head"
      "score turn"
      "score pad";
    column-gap: 18px;
  }
  .game-head { grid-area: head; }
  .scoreboard { grid-area: score; }
  .turn-area { grid-area: turn; align-content: center; }
  .keypad { grid-area: pad; align-content: start; grid-template-rows: auto auto auto auto; }
  /* les panneaux occupent toute la colonne : l'historique respire */
  .team-panel {
    padding: 16px;
    align-content: stretch;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  }
  .team-score { font-size: clamp(4rem, 7vw, 6rem); }
  .team-name { font-size: 1.1rem; }
  .team-turns { max-height: none; }
  .team-turns .t-darts { font-size: .72rem; }
  .team-turns .t-scored { font-size: 1.25rem; }
  .team-turns .t-rest { font-size: .8rem; }
  .team-turns li { padding: 5px 2px; }
  .team-stats { font-size: .68rem; }
  /* on borne la taille des touches pour ne pas avoir de pavé géant */
  .numbers { grid-auto-rows: minmax(46px, 76px); gap: 8px; }
  .key { font-size: 1.3rem; }
  .key-special { min-height: 58px; }
  .dart-slot { height: 60px; font-size: 1.6rem; }
}

/* écrans courts : on compacte pour rester sur une seule hauteur d'écran */
@media (max-height: 760px) and (max-width: 899px) {
  :root { --gap: 8px; }
  .match-info .bull-note { display: none; }
  .team-panel { padding: 8px; }
  .team-score { font-size: clamp(2.3rem, 12vw, 3.1rem); }
  .team-thrower { min-height: 0; font-size: .74rem; }
  .team-turns { max-height: 46px; margin-top: 4px; }
  .team-turns li { padding: 2px; }
  .team-stats { padding-top: 3px; font-size: .55rem; }
  .turn-area { padding: 6px; gap: 4px; }
  .turn-who { font-size: .76rem; }
  .dart-slot { height: 40px; font-size: 1.1rem; }
  .turn-total { font-size: .64rem; min-height: 1.1em; }
  .mods { gap: 6px; }
  .mod { padding: 3px; }
  .mod b { font-size: 1.05rem; }
  .mod span { font-size: .5rem; }
  .key-special { min-height: 40px; }
  .key-special b { font-size: .66rem; }
  .key-special span { font-size: .92rem; }
  .numbers { grid-auto-rows: minmax(36px, 1fr); }
  .pad-actions .btn { padding: 11px 8px; font-size: .95rem; }
  .icon-btn { width: 36px; height: 36px; font-size: 1.1rem; }
}

/* très petits écrans : la liste des volées passe en une ligne */
@media (max-height: 660px) and (max-width: 899px) {
  .team-turns { max-height: 26px; }
  .team-score { font-size: clamp(2rem, 11vw, 2.6rem); }
}
