/* AtariGo — la première prise gagne
   Copyright (c) 2026 Tristan Cazenave. Tous droits réservés — voir LICENSE.

   Le goban prend la largeur, et rien d'autre ne compte. Le bois et les pierres
   sont ceux des autres gobans du site — sept jeux de Go côte à côte ne peuvent
   pas être de sept couleurs. */

:root {
  --fond: #f4f1e8; --surface: #fffdf7; --ligne: #d8d0bc;
  --texte: #2b2620; --texte-doux: #7a7161;
  --accent: #7a4d1e; --accent-clair: #f2e6d6;
  --bois-a: #e6cd93; --bois-b: #d8b878; --trait-goban: #6b5426;
  --pierre-n1: #5a626c; --pierre-n2: #0b0e12;
  --pierre-b1: #ffffff; --pierre-b2: #d8cfba;
  --cher: #a53a24; --bon: #2f6d43;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fond: #18150f; --surface: #241f18; --ligne: #3d362b;
    --texte: #f0e9df; --texte-doux: #a99e8f; --accent: #d9a463; --accent-clair: #3a2c1b;
    --pierre-n1: #3e454e; --pierre-n2: #05070a;
    --pierre-b1: #f7f2e5; --pierre-b2: #cbc1a9;
    --cher: #e08c78; --bon: #7fc79a;
  }
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%; }
button, input, select { font: inherit; color: inherit; }
.ecran { display: flex; flex-direction: column; min-height: 100%; }
/* Le goban ne gagne rien à s'étaler : l'écran de jeu tient dans la même
   colonne que la boîte de choix, et se centre comme elle. */
#ecran-jeu { max-width: 640px; width: 100%; margin: 0 auto; }
/* `display:flex` écrase la règle du navigateur pour [hidden]. */
.ecran[hidden] { display: none; }
.pousse { flex: 1; }

.btn { appearance: none; background: var(--surface); border: 1px solid var(--ligne);
  color: var(--texte); border-radius: 10px; padding: 10px 14px; cursor: pointer;
  min-height: 44px; }
.btn:disabled { opacity: .4; cursor: default; }
.btn-primaire { background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 650; }
.btn-mini { padding: 6px 10px; min-height: 36px; font-size: 13px; }
.seg { display: inline-flex; border: 1px solid var(--ligne); border-radius: 999px;
  overflow: hidden; }
.seg button { appearance: none; background: transparent; border: 0;
  color: var(--texte-doux); font-size: 12px; letter-spacing: .08em;
  padding: 6px 10px; cursor: pointer; min-height: 36px; }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.boite { background: var(--surface); border: 1px solid var(--ligne);
  border-radius: 16px; margin: 16px auto; max-width: 34rem; width: calc(100% - 24px); }
.boite-tete { padding: 16px 18px 0; }
.boite-tete h1 { margin: 8px 0 0; font-size: 30px; letter-spacing: -.01em; }
.sous-titre { margin: 8px 0 0; color: var(--texte-doux); font-size: 14px; }
.sous-titre .rappel { opacity: .85; font-size: 13px; }
.boite-corps { padding: 12px 18px 16px; }
.boite-pied { display: flex; gap: 8px; padding: 0 18px 18px; }
.champ { margin-top: 12px; }
.champ label { font-weight: 600; }

.choix { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.choix button { appearance: none; background: var(--surface); color: var(--texte);
  border: 1px solid var(--ligne); border-radius: 10px; padding: 8px 14px;
  min-height: 44px; cursor: pointer; font-variant-numeric: tabular-nums; }
.choix button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 650; }
.note { margin: 8px 0 0; font-size: 13px; color: var(--texte-doux); }
.note:empty { display: none; }
.bascule { display: flex; align-items: center; gap: 10px; margin-top: 14px;
  cursor: pointer; }
.bascule input { width: 20px; height: 20px; accent-color: var(--accent); }

#sieges { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.siege { display: flex; align-items: center; gap: 10px; }
.pion { width: 20px; height: 20px; border-radius: 50%; flex: none; border: 2px solid;
  background: radial-gradient(circle at 35% 30%, var(--pierre-n1), var(--pierre-n2));
  border-color: #00000055; }
.pion.blanc { background: radial-gradient(circle at 35% 30%, var(--pierre-b1), var(--pierre-b2));
  border-color: #5a462859; }
.siege-nom { min-width: 4.5rem; font-size: 14px; }
.siege select { flex: 1; max-width: 14rem; min-height: 44px; border-radius: 10px;
  border: 1px solid var(--ligne); background: var(--surface); padding: 0 10px; }

#barre { display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  flex-wrap: wrap; border-bottom: 1px solid var(--ligne); }
.trait { font-weight: 650; font-size: 14px; display: inline-flex; align-items: center;
  gap: 7px; white-space: nowrap; }
.trait::before { content: ""; width: 14px; height: 14px; border-radius: 50%;
  flex: none; border: 1px solid #00000055;
  background: radial-gradient(circle at 35% 30%, var(--pierre-n1), var(--pierre-n2)); }
.trait[data-couleur="2"]::before {
  background: radial-gradient(circle at 35% 30%, var(--pierre-b1), var(--pierre-b2)); }
/* Le souffle de chaque camp : les libertés de sa chaîne la plus fragile. À un,
   il est à un coup de perdre — et la pastille passe au rouge. */
#compteurs { display: flex; gap: 5px; }
.compteur { font-size: 12px; font-weight: 650; border-radius: 999px; padding: 3px 10px;
  border: 1px solid; font-variant-numeric: tabular-nums; }
.compteur.noir { background: #17151a; color: #fdfbf4; border-color: #00000080; }
.compteur.blanc { background: #fdfbf4; color: #17151a; border-color: #5a462859; }
.compteur.au-trait { box-shadow: 0 0 0 2px var(--accent); }
.compteur.atari { outline: 2px solid var(--cher); outline-offset: 1px; }

#zone-goban { padding: 10px; display: flex; justify-content: center; }
#goban { width: 100%; max-width: 600px; height: auto; touch-action: manipulation;
  cursor: pointer; }

/* L'identifiant du dégradé porte le nom du jeu, et doit correspondre à celui
   que `vue.js` pose dans les <defs> : un `url()` qui ne pointe sur rien ne
   peint rien du tout, et le goban prend alors la couleur de la page. */
.bois { fill: url(#boisatari); }
.ligne { stroke: var(--trait-goban); stroke-width: 3; opacity: .8; }
.hoshi { fill: var(--trait-goban); }
.ombre { fill: #00000038; }
.pierre.noire { fill: url(#pierre-n); stroke: #00000080; stroke-width: .8; }
.pierre.blanche { fill: url(#pierre-b); stroke: #5a462859; stroke-width: .8; }
.fantome { opacity: .38; pointer-events: none; }
.marque { fill: none; stroke-width: 4; }
.marque.sur-noire { stroke: #fdfbf4; }
.marque.sur-blanche { stroke: #17151a; }
/* L'atari : un liseré rouge autour des pierres qui n'ont plus qu'une liberté,
   et un cercle sur cette liberté. Le trait est le même que celui de la prise,
   en pointillé — l'un annonce ce que l'autre accomplit. */
.atari { fill: none; stroke: var(--cher); stroke-width: 6;
  stroke-dasharray: 13 10; pointer-events: none; }
.souffle { fill: none; stroke: var(--cher); stroke-width: 6;
  stroke-dasharray: 9 8; opacity: .85; pointer-events: none; }
.prise { fill: none; stroke: var(--cher); stroke-width: 8; pointer-events: none; }
.refus { fill: none; stroke: var(--cher); stroke-width: 6; }

/* Le ruban de revue : il ne rejoue rien, il montre une position déjà atteinte.
   Les quatre flèches se lisent comme une seule commande, et le curseur prend
   toute la place qui reste. */
.ruban { display: flex; align-items: center; gap: 6px; margin: 0 12px;
  max-width: 600px; }
.ruban[hidden] { display: none; }
.ruban .btn-mini { flex: 0 0 auto; padding: 6px 9px; line-height: 1; }
.ruban input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent);
  height: 24px; }
.coup-n { font-size: 12.5px; color: var(--texte-doux); white-space: nowrap;
  font-variant-numeric: tabular-nums; }
/* « Reprendre ici » n'apparaît qu'en revue : il pousse le reste vers la gauche
   plutôt que de faire sauter la ligne quand il arrive. */
#btn-ici { margin-left: auto; }
@media (max-width: 420px) {
  .ruban { gap: 4px; margin: 0 8px; }
  .ruban .btn-mini { padding: 6px 7px; }
  .coup-n { font-size: 11.5px; }
}

.dit { margin: 6px 14px 0; color: var(--texte-doux); font-size: 15px; min-height: 1.5em; }
.actions { display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 12px calc(14px + env(safe-area-inset-bottom)); }

.modale { position: fixed; inset: 0; background: #0b0e0a99; display: flex;
  align-items: center; justify-content: center; padding: 16px; z-index: 20; }
.modale[hidden] { display: none; }
.modale-boite { background: var(--surface); border-radius: 14px; max-width: 34rem;
  width: 100%; max-height: 88vh; display: flex; flex-direction: column; }
.modale-tete { display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--ligne); }
.modale-tete h2 { margin: 0; font-size: 18px; flex: 1; }
.modale-corps { padding: 14px 16px; overflow: auto; }
.modale-corps h3 { font-size: 14px; color: var(--accent); margin: 14px 0 6px; }
.modale-corps p { font-size: 14px; }
