/* PATCH PERF (v156) : même rendu, moins de batterie.
   1) Sur téléphone/tablette (pointeur tactile), les animations qui obligent le navigateur à redessiner à chaque image
      (dégradés qui défilent, ombres qui pulsent, aurore, halo) avancent par petits paliers (10 à 25 images/s au lieu de 60/120).
      Ce sont des mouvements lents : à l'œil c'est identique, mais l'écran est redessiné 3 à 10 fois moins souvent.
   2) Les animations hors écran sont mises en pause (classe .perfOff posée par perf.js).
   3) Mode éco (bouton 🔋 du menu, ou automatique batterie faible) : les décors animés en boucle sont figés. */

@media (pointer: coarse) {
  @keyframes aurora { from { transform: translate3d(-2%, -1%, 0) rotate(0deg) scale(1); animation-timing-function: steps(88); } to { transform: translate3d(3%, 2%, 0) rotate(6deg) scale(1.08); } }
  @keyframes halo { from { rotate: 0deg; animation-timing-function: steps(168); } to { rotate: 360deg; } }
  @keyframes hue { from { background-position: 0% 0; animation-timing-function: steps(90); } to { background-position: 300% 0; } }
  @keyframes flow { from { background-position: 0% 0; animation-timing-function: steps(90); } to { background-position: 100% 0; } }
  @keyframes godShine { from { background-position: 0% 0; animation-timing-function: steps(80); } to { background-position: -300% 0; } }
  @keyframes foil { from { background-position: 150% 0; animation-timing-function: steps(75); } to { background-position: -100% 0; } }
  @keyframes shine { 0% { background-position: 150% 0; animation-timing-function: steps(40); } 60%, 100% { background-position: -100% 0; } }
  @keyframes legend { from { box-shadow: 0 0 34px 2px var(--r-L); animation-timing-function: steps(45); } to { box-shadow: 0 0 52px 6px var(--r-L); } }
  .packSub, .stockPips i.on { animation-timing-function: steps(30); }
  .plPulse, .plTimer.low { animation-timing-function: steps(20); }

  /* une couche GPU permanente par carte = beaucoup de mémoire et de batterie dans la collection ; le navigateur la crée seul pendant l'animation */
  .grid .card:not(.unknown) { will-change: auto; }

  /* confort de jeu : pas de zoom au double-tap, pas de menu « enregistrer l'image » au appui long, cibles plus faciles à toucher */
  a, label, select, input, summary, .btn, .chip, .tab, [role="button"] { touch-action: manipulation; }
  .card, .card img, .pack, .deck, .dcard, .flip, .gbPick { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
  img { -webkit-user-drag: none; }
  .gbCtl button { width: 34px; height: 34px; }
  .gbCtl span { min-width: 2.8rem; }
}
@supports (height: 100dvh) { body { min-height: 100dvh; } }

/* animations hors écran / onglet en arrière-plan : en pause */
.perfOff, .perfOff *, .perfOff::before, .perfOff::after, .perfOff *::before, .perfOff *::after { animation-play-state: paused !important; }
html.perfHidden *, html.perfHidden *::before, html.perfHidden *::after { animation-play-state: paused !important; }


/* onglet Paramètres */
.setList { display: grid; gap: .2rem; padding: .4rem .9rem; }
.setRow { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 0; cursor: pointer; border-bottom: 1px solid var(--line, rgba(255, 255, 255, .1)); }
.setRow:last-of-type { border-bottom: 0; }
.setTxt { display: grid; gap: .2rem; }
.setTxt b { font-size: 1.05rem; }
.setTxt small { color: var(--muted, #9aa3b2); line-height: 1.35; }
.setBox { appearance: none; -webkit-appearance: none; flex: none; width: 30px; height: 30px; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border-radius: 8px; background: rgba(255, 255, 255, .08); border: 2px solid var(--accent, #2dd4bf) !important; position: relative; cursor: pointer; box-shadow: none !important; }
.setBox:checked { background: var(--accent, #2dd4bf); }
.setBox:checked::after { content: '✓'; position: absolute; inset: 0; display: grid; place-items: center; color: #04211d; font-size: 1.15rem; font-weight: 900; line-height: 1; }
.setReload { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .7rem .8rem; margin: .3rem 0 .5rem; border-radius: 12px; background: rgba(255, 207, 77, .12); font-size: .9rem; }

/* Mode éco : fige aussi les pseudo multicolores et les animations décoratives restantes. */
html.eco .geo-rainbow-name, html.eco .nmRainbow { animation: none !important; background-position: 0 50% !important; }
html.eco *, html.eco *::before, html.eco *::after { animation-play-state: paused !important; }
