/* Defensive: allow disabling floating numbers by CSS class. */

html.floating-numbers-disabled .floating-hearts,
html.floating-numbers-disabled .floating-heart,
html.floating-numbers-disabled [data-floating-number] {
  display: none !important;
  animation: none !important;
  transition: none !important;
}

html.no-bg-effects .floating-hearts {
  display: none !important;
}

/* Lite visual mode for buggy/slow mobile browsers (e.g. Xiaomi / MIUI). */
html.low-performance *,
html.low-performance *::before,
html.low-performance *::after {
  animation: none !important;
  transition: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  text-shadow: none !important;
}

html.low-performance .grid,
html.low-performance .cell,
html.low-performance .system-toast,
html.low-performance .preview-bubble,
html.low-performance .wheel-content,
html.low-performance .victory-content,
html.low-performance .level-content {
  box-shadow: none !important;
}

html.low-performance .cell.frozen {
  filter: none !important;
}

html.low-performance .floating-hearts,
html.low-performance .preview-bubble {
  display: none !important;
}

/*
 * Після глобального «вимкни все анімації» залишаємо мінімальну плавність саме для гріда:
 * інакше гравітація виглядає «як на калькуляторі». Специфічність вища за html.low-performance *.
 */
html.low-performance .cell {
  transition:
    transform 0.2s cubic-bezier(0.25, 0.8, 0.25, 1),
    opacity 0.15s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease !important;
}

html.low-performance .cell-inner {
  transition:
    transform 0.18s ease,
    background 0.2s ease,
    color 0.15s ease !important;
}

html.low-performance .cell.popping {
  animation: bubbleOut 0.24s ease forwards !important;
}

html.low-performance .cell.merged .cell-inner {
  animation: pop 0.2s ease !important;
}

html.low-performance .cell.carry .cell-inner {
  animation: carryIn 0.38s ease-out !important;
}

html.low-performance .cell.shuffle-anim .cell-inner {
  animation: shuffleWiggle 0.32s ease !important;
}
