/* ═════════════ ⚡ rendimiento: que nada obligue a repintar el mapa en cada cuadro ═════════════
   Regla de oro: lo que se mueve sin parar va en capas HTML y se anima solo con
   transform u opacity (eso lo hace la tarjeta gráfica). Dentro de los SVG del mapa
   no queda ninguna animación infinita. */

/* 🌿 capa de vida del paisaje (entre el terreno y las fichas/casas) */
#life { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
#life.off, body.no-anim #life { display: none; }
#life .world { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
#life .lf { position: absolute; left: 0; top: 0; width: 0; height: 0; transform-origin: 0 0; }
#life .lf svg { position: absolute; overflow: visible; backface-visibility: hidden; }
#life .lf-sway { animation: sway 3.4s ease-in-out infinite; }
#life .lf-wave { animation: wheatWave 2.8s ease-in-out infinite; }
#life .lf-graze { animation: graze 6s ease-in-out infinite; }
#life .lf-hop { animation: bkHop 5.2s ease-in-out infinite; }
#life .lf-glint { opacity: 0; animation: bkGlint 5.2s ease-in-out infinite; }
#life .lf-spark { opacity: 0; animation: spark 3.6s ease-in-out infinite; }
body.fx-busy #life .lf svg { animation-play-state: paused; }
#board-wrap.quake #life { animation: quake .38s linear; }
#board-wrap.tsu-go #life { transition: transform 1s cubic-bezier(.5,0,.3,1), opacity 1s; }
#board-wrap.tsu-sunk #life { transform: translateY(34px) scale(.86) rotate(-1.5deg); opacity: .12; }
#board-wrap.tsu-up #life { animation: tsuPop 1.1s cubic-bezier(.2,1.4,.4,1); }
@media (prefers-reduced-motion: reduce) { #life { display: none; } }

/* dentro de los SVG nada se anima sin parar (los dibujos compartidos, el ladrón quieto,
   banderas, molinos, luces de las casas, la ruta más larga, caminos de neón o lava) */
#dicetyp-art * { animation: none !important; }
.robber-bob { animation: none; }
#game .flag, #game .beacon, #game .eye, #game .blades > g, #game .neon, #game .lava, #board .lr-glow,
#game .xstar, #game .xlight, #game .spooky, #game .ghost > path, #game .wave, #game .sway, #game .graze, #game .ear { animation: none !important; }
.token.down .back { animation: none; }

/* el fondo de olas de la portada se mueve con transform y no existe durante la partida */
body::before { inset: -420px; animation: driftT 40s linear infinite; }
@keyframes driftT { to { transform: translate3d(400px, 200px, 0); } }
body:has(#game:not(.hidden))::before { display: none; animation: none; }

/* barras: brillos con opacidad (no con sombras que cambian), sin cartas flotando */
.rcard:not(.zero) { animation: none; }
.bk.low { animation: none; box-shadow: inset 3px 0 0 var(--rc), 0 0 6px rgba(255,90,70,.6); }
.roll-btn { overflow: visible; }
.roll-btn::after { display: none; }
.btn.glowing { animation: none; position: relative; }
.btn.glowing::before { content: ''; position: absolute; inset: -3px; border-radius: inherit; pointer-events: none;
  box-shadow: 0 0 22px 6px rgba(255,213,107,.85); opacity: 0; animation: glowOp 1.4s ease-in-out infinite; }
.dcard.play { animation: none; }
.dcard.play::after { content: ''; position: absolute; inset: -3px; border-radius: 12px; pointer-events: none;
  box-shadow: 0 0 20px 5px rgba(255,213,107,.85); opacity: 0; animation: glowOp 1.6s ease-in-out infinite; }
@keyframes glowOp { 50% { opacity: 1; } }

/* vida marina (tiburón y monstruo del lago) en la capa de actores */
.sealife { position: absolute; left: -60px; top: -60px; width: 120px; height: 120px; overflow: visible; }

/* Mega: menos cosas moviéndose a la vez */
#board-wrap.big-map .pm-ripple { display: none; }
#board-wrap.big-map .sea-glints b:nth-child(n+5) { display: none; }
@media (max-width: 760px), (max-height: 520px) { .sea-glints b:nth-child(n+5) { display: none; } }

@media (prefers-reduced-motion: reduce) { .btn.glowing::before, .dcard.play::after { animation: none; opacity: .6; } }

/* la vida marina se dibuja en su propia capa (si no, al nadar repinta toda la pantalla) */
.sea-critter { will-change: transform; }
