/* V2.6.3 — strict stability mode. Only chess pieces animate. */
html { scrollbar-gutter: stable; }
html { scroll-behavior: auto !important; }
body { overflow-anchor: none; }

*, *::before, *::after {
  animation: none !important;
  transition: none !important;
}

/* Blurred fixed layers can shimmer during scrolling on some Chromebooks. */
.topbar,
.academy-sheet,
.lesson-builder,
.lesson-runner,
.teaching-editor,
.pro-promotion-picker,
.menu-scrim {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.main-content,
.workspace-page,
.page-stack,
.sidebar,
.lesson-bank-panel,
.lesson-compose-panel,
.lesson-share-panel,
.runner-stage,
.runner-coach { overflow-anchor: none; }

/* Hover feedback may change colour, but must never move the layout. */
.primary-button:hover,
.feature-card:hover,
.pro-toolbar button:hover,
.pro-import-card button:hover,
.pro-study-controls button:hover,
.pro-side-choice button:hover,
.academy-tool-button:hover,
.board-toolbar button:hover,
.pro-tree-level button:hover,
.student-levels button:hover,
.mri-timeline button:hover,
.mri-timeline button.active,
.vision-mode-grid button:hover,
.vision-mode-grid button.active,
.lesson-source-button:hover { transform: none !important; }

/* Pieces keep the short move animation, without growing under the pointer. */
.pro-piece-wrap:hover,
.runner-square:hover .runner-piece { transform: translateZ(0); }

.pro-piece-wrap,
.runner-piece,
.teaching-piece {
  backface-visibility: hidden;
  transform: translateZ(0);
  will-change: transform;
}

/* Feedback changes state in place instead of shaking whole cards. */
.bullet-board-card.bad,
.pro-training-feedback.wrong,
.daily-feedback.wrong,
.mri-whatif-feedback.wrong,
.pgn-exercise-feedback.wrong,
.vision-feedback.wrong,
.runner-feedback.wrong { animation: none !important; }

/* Engine indicators remain readable without an endless pulse. */
.engine-status.thinking i,
.student-board-toolbar strong.thinking i { animation: none !important; opacity: 1; }

/* Drawers and notices fade; they do not slide through the viewport. */
.academy-sheet { transform: none !important; }
.editor-toast { transform: translate(-50%, 0) !important; }
.lesson-toast { transform: none !important; }

/* Isolate high-frequency board painting from the surrounding page. */
.pro-board-frame,
.teaching-board-frame,
.runner-board-frame,
.student-board-frame,
.opening-board-shell,
.vision-board-shell { contain: layout paint; }

/* Reserve message space so answers never push the next card down. */
.pro-training-feedback { min-height: 72px; }
.daily-feedback,
.pgn-exercise-feedback,
.vision-feedback { min-height: 76px; }
.mri-whatif-feedback { min-height: 88px; }
.runner-feedback { min-height: 92px; }

/* Scores and clocks no longer change width as their digits change. */
.pro-eval strong,
.student-clock,
.mri-score,
.runner-progress span,
.sidebar [data-lesson-nav-count] { font-variant-numeric: tabular-nums; }

@media (min-width: 901px) {
  html { overflow-y: scroll; }
  .sidebar,
  .lesson-bank-panel,
  .lesson-compose-panel,
  .lesson-share-panel,
  .runner-coach { scrollbar-gutter: stable; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
