/* Rebirth Idle - efeitos (fx.js). Curtos, não bloqueantes (pointer-events: none) e desligados com reduce-motion. */

/* troca de tela (View Transitions quando o navegador tem) */
::view-transition-old(root) { animation: fx-fade-out var(--dur) var(--ease-out) both; }
::view-transition-new(root) { animation: fx-fade-in var(--dur-slow) var(--ease-out) both; }
@keyframes fx-fade-out { to { opacity: 0; transform: translateY(-4px); } }
@keyframes fx-fade-in { from { opacity: 0; transform: translateY(6px); } }

/* sobreposição de celebração / aviso */
.fx-burst { position: fixed; inset: 0; z-index: 900; display: grid; place-items: center; pointer-events: none; animation: fx-burst-life 1.9s var(--ease-out) both; }
.fx-burst.fx-death { animation-duration: 2.3s; background: radial-gradient(ellipse at center, transparent 30%, rgba(90, 0, 0, .55) 100%); }
.fx-card { position: relative; display: grid; justify-items: center; gap: 4px; padding: 14px 26px; background: linear-gradient(var(--surface-raised), var(--surface)); border: 2px solid var(--gold); box-shadow: 0 0 0 2px var(--frame-edge), 0 12px 40px rgba(0, 0, 0, .55); animation: fx-card-in .45s var(--ease-out) both; }
.fx-death .fx-card { border-color: var(--danger); }
.fx-icon { font-size: 34px; line-height: 1; color: var(--gold); }
.fx-death .fx-icon { color: #E8D8B6; }
.fx-sprite { width: 64px; height: 64px; image-rendering: pixelated; }
.fx-title { font-family: var(--font-title); font-size: var(--fs-xl); color: var(--ink); letter-spacing: .02em; text-align: center; }
.fx-sub { font-size: var(--fs-sm); color: var(--ink-mute); text-align: center; max-width: 30ch; }
.fx-rays { position: absolute; width: 360px; height: 360px; border-radius: 50%; background: repeating-conic-gradient(rgba(198, 160, 90, .28) 0 8deg, transparent 8deg 22deg); animation: fx-rays 1.9s linear both; -webkit-mask: radial-gradient(circle, #000 25%, transparent 70%); mask: radial-gradient(circle, #000 25%, transparent 70%); }
.fx-death .fx-rays, .fx-depart .fx-rays { display: none; }
.fx-spark { position: absolute; width: 6px; height: 6px; background: var(--gold-light); box-shadow: 0 0 6px var(--gold); transform: rotate(var(--a)) translateY(0); animation: fx-spark .9s var(--ease-out) .1s both; }
@keyframes fx-burst-life { 0% { opacity: 0; } 10% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes fx-card-in { from { opacity: 0; transform: translateY(14px) scale(.9); } 60% { transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes fx-rays { from { transform: rotate(0) scale(.6); opacity: 0; } 20% { opacity: 1; } to { transform: rotate(40deg) scale(1.1); opacity: 0; } }
@keyframes fx-spark { from { opacity: 1; transform: rotate(var(--a)) translateY(0); } to { opacity: 0; transform: rotate(var(--a)) translateY(calc(-1 * var(--d))); } }

/* loot caindo */
.fx-drop { position: fixed; z-index: 890; width: 32px; height: 32px; image-rendering: pixelated; pointer-events: none; animation: fx-drop 1.2s cubic-bezier(.3, 0, .6, 1) both; }
@keyframes fx-drop { 0% { opacity: 0; transform: translateY(-20px) rotate(-10deg); } 15% { opacity: 1; } 70% { transform: translateY(var(--fall)) rotate(8deg); } 85% { transform: translateY(calc(var(--fall) - 8px)); } 100% { opacity: 0; transform: translateY(var(--fall)); } }

/* cena da expedição */
.progress-scene.fx-live .walker { animation: fx-idle-bob 1.2s steps(2, end) infinite; left: calc(84% - 140px); }
.progress-scene .walker.fx-lunge { animation: fx-lunge .35s var(--ease-out); }
.progress-scene .foe.fx-hit { animation: fx-hit .3s steps(2, end); }
.progress-scene .foe.fx-die { animation: fx-die .7s var(--ease-out) both; }
.fx-puff { position: absolute; bottom: 70px; font: 700 13px/1 var(--font-num); pointer-events: none; text-shadow: 1px 1px 0 #000; animation: fx-puff .9s var(--ease-out) both; }
.fx-puff.hit { color: #FF5A4E; }
.fx-puff.miss { color: #CFCFCF; }
@keyframes fx-idle-bob { 50% { transform: translateY(-2px); } }
@keyframes fx-lunge { 40% { transform: translateX(14px); } }
@keyframes fx-hit { 50% { filter: brightness(2.2) saturate(.2); transform: translateX(3px); } }
@keyframes fx-die { to { opacity: 0; transform: translateY(6px) scale(.85); filter: grayscale(1); } }
@keyframes fx-puff { from { opacity: 0; transform: translateY(6px); } 20% { opacity: 1; } to { opacity: 0; transform: translateY(-26px); } }

/* viagem (partida) */
.fx-travel { position: fixed; inset: 0; z-index: 900; display: grid; place-content: center; gap: 12px; background: rgba(20, 16, 12, .82); pointer-events: none; animation: fx-fade-in .2s both; }
.fx-travel.out { animation: fx-fade-out .3s both; }
.fx-road { position: relative; width: min(420px, 80vw); height: 72px; border-bottom: 4px solid #4A3420; background: repeating-linear-gradient(90deg, transparent 0 22px, rgba(198, 160, 90, .15) 22px 26px); animation: fx-road .5s linear infinite; }
.fx-road img { position: absolute; bottom: 2px; left: 0; width: 64px; height: 64px; image-rendering: pixelated; animation: fx-walk-across 1.1s linear both, fx-idle-bob .3s steps(2, end) infinite; }
.fx-where { text-align: center; color: var(--ink-on-dark); font-family: var(--font-title); font-size: var(--fs-lg); }
@keyframes fx-road { to { background-position: -26px 0; } }
@keyframes fx-walk-across { from { left: 0; } to { left: calc(100% - 64px); } }

/* relatório offline pronto, reconexão */
.alert.fx-ready { animation: fx-ready 1.6s var(--ease-out) 2; }
@keyframes fx-ready { 30% { box-shadow: 0 0 0 3px var(--gold-light), 0 0 20px var(--gold); } }
#net:not([hidden]) { animation: fx-net 1.4s ease-in-out infinite; }
@keyframes fx-net { 50% { opacity: .65; } }

/* sem movimento */
.reduce-motion .fx-burst, .reduce-motion .fx-drop, .reduce-motion .fx-travel, .reduce-motion .fx-puff { display: none !important; }
.reduce-motion *, .reduce-motion ::view-transition-group(*) { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .fx-burst, .fx-drop, .fx-travel, .fx-puff { display: none !important; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
