/* Tour de Hanoï : styles propres à l'outil. Couleurs tirées des variables du site, sauf les disques (volontairement colorés). */
.o-tour-hanoi { min-width: 0; }
.o-tour-hanoi [hidden] { display: none !important; }

.o-tour-hanoi .o-tour-hanoi-nombres { border-top: 0; padding-top: 0; justify-content: center; }
.atelier .o-tour-hanoi-nombres .btn { min-height: 42px; min-width: 44px; padding-left: 8px; padding-right: 8px; font-variant-numeric: tabular-nums; }
.atelier .o-tour-hanoi-nombres .btn[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); color: var(--sur-marque); }

.o-tour-hanoi-options { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 26px; margin: 6px 0 4px; }
.o-tour-hanoi-groupe { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin: 0; padding: 0; border: 0; }
.o-tour-hanoi-groupe legend { float: left; margin-right: 6px; font-size: .9rem; font-weight: 600; color: var(--texte-2); }
.o-tour-hanoi label.case { display: inline-flex; align-items: center; gap: 8px; min-height: 36px; font-size: .95rem; color: var(--texte); cursor: pointer; }
.o-tour-hanoi input[type="radio"] { width: 20px; height: 20px; margin: 0; accent-color: var(--marque); }
.o-tour-hanoi-vitesse { display: inline-flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 600; color: var(--texte-2); }
.o-tour-hanoi-vitesse select { min-height: 36px; padding: 4px 8px; border: 1px solid var(--bord); border-radius: var(--rayon-petit); background: var(--surface); color: var(--texte); font: inherit; font-weight: 400; }

.o-tour-hanoi-barre { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 24px; margin: 10px 0; }
.o-tour-hanoi-barre p { display: inline-flex; align-items: baseline; gap: 8px; margin: 0; color: var(--texte-2); font-size: .92rem; }
.o-tour-hanoi-barre strong { font: 700 1.3rem/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--texte); }
.o-tour-hanoi-barre small { margin-left: -2px; font-size: .8rem; font-style: italic; }

.o-tour-hanoi-plateau {
  display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; box-sizing: border-box;
  border-radius: var(--rayon); background: var(--surface-2); border: 1px solid var(--bord);
  touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; outline: none; cursor: pointer;
}
.o-tour-hanoi-plateau:focus-visible { box-shadow: 0 0 0 3px var(--marque); }
.o-tour-hanoi-socle { fill: color-mix(in srgb, var(--texte) 45%, var(--surface-2)); }
.o-tour-hanoi-axe { fill: color-mix(in srgb, var(--texte) 35%, var(--surface-2)); }
.o-tour-hanoi-zone { fill: transparent; }
.o-tour-hanoi-tige.arrivee .o-tour-hanoi-zone { fill: color-mix(in srgb, var(--ok-texte) 7%, transparent); }
.o-tour-hanoi.clavier .o-tour-hanoi-tige.curseur .o-tour-hanoi-zone { fill: color-mix(in srgb, var(--marque) 12%, transparent); stroke: var(--marque); stroke-width: 2; }
@media (hover: hover) { .o-tour-hanoi-tige:hover .o-tour-hanoi-zone { fill: color-mix(in srgb, var(--marque) 8%, transparent); } }
.o-tour-hanoi-nom { fill: var(--texte-2); font-family: var(--police); font-weight: 700; }
.o-tour-hanoi-disque rect { stroke: rgba(0, 0, 0, .28); stroke-width: 1; }
.o-tour-hanoi-disque text { fill: #1b1b1b; font-family: var(--police); font-weight: 700; pointer-events: none; }
.o-tour-hanoi-disque.souleve rect { stroke: var(--texte); stroke-width: 2.5; }
.o-tour-hanoi.refus .o-tour-hanoi-plateau { animation: o-tour-hanoi-refus .3s ease-in-out; }
@keyframes o-tour-hanoi-refus { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

.o-tour-hanoi-aides { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.atelier .o-tour-hanoi-aides .btn { min-height: 42px; }
.atelier .o-tour-hanoi-aides .btn[aria-pressed="true"] { background: var(--marque); border-color: var(--marque); color: var(--sur-marque); }
.o-tour-hanoi .btn:focus-visible, .o-tour-hanoi input:focus-visible, .o-tour-hanoi select:focus-visible { outline: 3px solid var(--marque); outline-offset: 2px; }

.o-tour-hanoi-message { display: block; min-height: 1.5em; margin-top: 10px; text-align: center; font-size: .98rem; line-height: 1.45; color: var(--texte); }
.o-tour-hanoi[data-gagne] .o-tour-hanoi-plateau { border-color: var(--ok-texte); box-shadow: 0 0 0 2px var(--ok-texte); }
.o-tour-hanoi[data-gagne] .o-tour-hanoi-message { padding: 8px 10px; border-radius: var(--rayon-petit); background: var(--ok-fond); color: var(--ok-texte); font-weight: 600; }
.o-tour-hanoi .o-tour-hanoi-aide { margin: 0; color: var(--texte-2); font-size: .88rem; line-height: 1.5; }
.o-tour-hanoi .o-tour-hanoi-centre { text-align: center; margin-top: 6px; }

.o-tour-hanoi-bloc { display: grid; gap: 10px; margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--bord); }
.o-tour-hanoi-bloc h2 { margin: 0; font-size: 1.15rem; }
.o-tour-hanoi-records { width: 100%; max-width: 600px; border-collapse: collapse; font-size: .95rem; }
.o-tour-hanoi-records th, .o-tour-hanoi-records td { padding: 6px 8px; border-bottom: 1px solid var(--bord); text-align: left; }
.o-tour-hanoi-records td { font-variant-numeric: tabular-nums; }
.o-tour-hanoi-records thead th { color: var(--texte-2); font-weight: 600; font-size: .85rem; }

@media (prefers-reduced-motion: reduce) {
  .o-tour-hanoi.refus .o-tour-hanoi-plateau { animation: none; }
}
@media (max-width: 560px) {
  .o-tour-hanoi-records { font-size: .86rem; }
  .o-tour-hanoi-records th, .o-tour-hanoi-records td { padding: 5px 3px; }
  .o-tour-hanoi-records thead th { font-size: .78rem; }
}
