/* ==========================================================================
   MITIC FUT — efeitos de evento e motion
   Referência: Figma "Mitic Fut — Sistema de Assets e Motion", página 02 (storyboards + keyframes).
   Entrada 420 ms cubic-bezier(.2,.9,.1,1) · impacto 120 ms · saída 260 ms ease-in.
   ========================================================================== */
:root {
  --ease-in-firm: cubic-bezier(.2, .9, .1, 1);
  --paper: #EDEBE6;
  --card-yellow: #F2C200;
  --card-red: #D7261E;
  --gold-trophy: #C9A227;
}

/* ---------------------------------------------------------------- Camada 1: dentro do cartão da partida */
#my-match-card { position: relative; overflow: hidden; }
.cfx { position: absolute; inset: 0; z-index: 5; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 18px 22px; background: rgba(5, 5, 5, 0.93); pointer-events: none; animation: cfx-in 420ms var(--ease-in-firm) both; }
.cfx.cfx-out { animation: cfx-out 260ms ease-in both; }
.cfx-net { position: absolute; inset: 0; animation: net-slide 1.2s var(--ease-in-firm) both; }
.cfx-rule { position: absolute; left: 22px; right: 22px; height: 2px; background: var(--paper); transform-origin: left; animation: rule-in 420ms var(--ease-in-firm) both; }
.cfx-rule-top { top: 12px; } .cfx-rule-bot { bottom: 12px; }
.cfx-body { position: relative; min-width: 0; overflow: hidden; }
.cfx-kicker { font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; color: var(--text-muted); text-transform: uppercase; }
.cfx-head { font-family: var(--font-sports); font-weight: 900; font-size: clamp(3rem, 9vw, 5.6rem); line-height: 0.86; color: var(--paper);
  animation: head-rise 420ms var(--ease-in-firm) both, punch 120ms 420ms ease-out both; transform-origin: left bottom; }
.cfx-sub { font-weight: 600; margin-top: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; animation: fade-up 300ms 200ms var(--ease-in-firm) both; }
.cfx-art { position: relative; width: clamp(70px, 18vw, 120px); animation: art-in 480ms 60ms var(--ease-in-firm) both; }
.cfx-art svg { width: 100%; height: auto; display: block; }
.cfx-goal .cfx-art svg { animation: spin-in 1s var(--ease-in-firm) both; }
.cfx-yellow .cfx-head { color: var(--card-yellow); }
.cfx-red .cfx-head { color: var(--card-red); }
.cfx-red { box-shadow: inset 0 0 0 4px var(--card-red); }
.cfx-yellow .cfx-art svg, .cfx-red .cfx-art svg { animation: card-flip 380ms var(--ease-in-firm) both; }
.cfx-injury .cfx-art svg { animation: pulse 420ms ease-in-out 2 both; }
.cfx-goal-against { background: rgba(5, 5, 5, 0.8); }
.cfx-goal-against .cfx-head { color: var(--text-muted); font-size: clamp(2.2rem, 6vw, 3.4rem); animation: head-rise 420ms var(--ease-in-firm) both; }
.cfx-goal-against .cfx-rule { background: var(--text-muted); }
.cfx-miss .cfx-head { text-decoration: line-through; text-decoration-thickness: 6px; color: var(--text-secondary); }
.cfx-sub .art-led, .cfx-art .art-led { width: 100%; }

/* Placa de fim de jogo (fica até a próxima data) */
#mm-result:empty { display: none; }
.result-plate { margin-top: 10px; display: flex; align-items: baseline; justify-content: center; gap: 14px; padding: 10px 14px;
  border-top: 2px solid var(--paper); border-bottom: 2px solid var(--paper); animation: plate-in 520ms var(--ease-in-firm) both; }
.rp-word { font-family: var(--font-sports); font-weight: 900; font-size: 2.6rem; line-height: 1; letter-spacing: 0.01em; animation: punch 140ms 420ms ease-out both; }
.rp-line { font-family: var(--font-mono); font-size: 0.82rem; color: var(--text-secondary); }
.rp-draw .rp-word { color: var(--text-muted); }
.rp-loss { border-color: var(--card-red); }
#my-match-card.lost .scoreboard, #my-match-card.lost .mini-pitch { filter: grayscale(1) brightness(0.8); transition: filter 600ms ease; }

/* Mini-campo da partida ao vivo */
.mini-pitch { position: relative; margin-top: 10px; aspect-ratio: 560 / 300; background: var(--grass-1, #0E2A17); border: 1px solid var(--border-medium); overflow: hidden; }
.mini-pitch > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.mp-ball { position: absolute; width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--paper); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35);
  left: 50%; top: 50%; transition: left 380ms var(--ease-in-firm), top 380ms var(--ease-in-firm); }
.mp-mark { position: absolute; width: 9px; height: 12px; margin: -6px 0 0 -4px; animation: mark-in 300ms var(--ease-in-firm) both; }
.mp-mark.yellow { background: var(--card-yellow); } .mp-mark.red { background: var(--card-red); }
.mp-mark.goal { width: 14px; height: 14px; margin: -7px 0 0 -7px; border: 2px solid var(--paper); border-radius: 50%; background: transparent; }
.mp-mark.injury { width: 12px; height: 12px; margin: -6px 0 0 -6px; background: var(--card-red); clip-path: polygon(35% 0, 65% 0, 65% 35%, 100% 35%, 100% 65%, 65% 65%, 65% 100%, 35% 100%, 35% 65%, 0 65%, 0 35%, 35% 35%); }

/* ---------------------------------------------------------------- Camada 2: tela cheia (carreira) */
.fx { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; pointer-events: none; }
.fx-scrim { position: absolute; inset: 0; background: rgba(5, 5, 5, 0.9); animation: fade 260ms ease-out both; }
.fx-stage { position: relative; width: min(1100px, calc(100vw - 32px)); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 32px; row-gap: 16px; }
.fx-rule { grid-column: 1 / -1; height: 3px; background: var(--paper); transform-origin: left; animation: rule-in 420ms var(--ease-in-firm) both; }
.fx-text { min-width: 0; overflow: hidden; }
.fx-kicker { font-family: var(--font-mono); font-size: 0.8rem; letter-spacing: 0.14em; color: var(--text-muted); text-transform: uppercase; animation: fade-up 300ms 120ms var(--ease-in-firm) both; }
.fx-head { font-family: var(--font-sports); font-weight: 900; font-size: clamp(4rem, 15vw, 12.5rem); line-height: 0.84; padding-top: 0.08em; color: var(--paper); overflow-wrap: anywhere;
  animation: head-rise 480ms 80ms var(--ease-in-firm) both, punch 120ms 560ms ease-out both; transform-origin: left bottom; }
.fx-sub { font-size: clamp(1rem, 2.2vw, 1.3rem); font-weight: 600; margin-top: 10px; animation: fade-up 320ms 380ms var(--ease-in-firm) both; }
.fx-sub-below { grid-column: 1 / -1; text-align: center; }
.fx-art { width: clamp(110px, 22vw, 240px); }
.fx-art svg { width: 100%; height: auto; display: block; }
.fx.fx-out { animation: fade-out 280ms ease-in both; }

.fx-title .fx-head, .fx-legend .fx-head { color: var(--gold-trophy); }
.fx-title .art-trophy path, .fx-legend .art-crown path { stroke-dasharray: 700; stroke-dashoffset: 700; animation: draw 900ms 160ms var(--ease-in-firm) forwards; }
.fx-title .art-trophy text { animation: fade 300ms 900ms both; }
.fx-confetti { position: absolute; inset: 0; overflow: hidden; }
.fx-confetti i { position: absolute; top: -6%; left: var(--x); width: 7px; height: 20px; background: var(--paper); opacity: 0.85; transform: rotate(var(--r));
  animation: fall calc(2.2s + var(--h) * 0.4s) var(--d) linear both; }
.fx-confetti i:nth-child(5n) { background: var(--gold-trophy); }
.fx-promoted .art-chev { animation: chev-up 420ms var(--ease-in-firm) both; }
.fx-promoted .art-chev-1 { animation-delay: 90ms; } .fx-promoted .art-chev-2 { animation-delay: 180ms; }
.fx-relegated .fx-rule { background: var(--card-red); }
.fx-relegated .art-chev { animation: chev-down 420ms var(--ease-in-firm) both; }
.fx-relegated .art-chev-1 { animation-delay: 90ms; } .fx-relegated .art-chev-2 { animation-delay: 180ms; }
.fx-relegated .fx-scrim, .fx-fired .fx-scrim { background: rgba(5, 5, 5, 0.94); }
.fx-fired .fx-stage { grid-template-columns: 1fr; justify-items: center; }
.fx-fired .fx-custom { position: relative; width: min(560px, 92vw); }
.fx-clip svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.6)); }
.fx-clip { animation: clip-in 460ms var(--ease-in-firm) both; }
.fx-stamp { position: absolute; left: 22%; top: 40%; width: 62%; opacity: 0; animation: stamp-slam 160ms 720ms cubic-bezier(.5, 0, .9, .4) forwards, shake 200ms 880ms linear; }
.fx-stamp svg { width: 100%; height: auto; display: block; }
.fx-signed .art-sign { stroke-dasharray: 220; stroke-dashoffset: 220; animation: draw 700ms 380ms ease-out forwards; }
.fx-signed .fx-art svg, .fx-offer .fx-art svg { animation: clip-in 480ms var(--ease-in-firm) both; }
.fx-sold .art-gavel g { transform-origin: 30px 150px; animation: gavel 300ms 120ms cubic-bezier(.6, 0, .9, .5) both; }
.fx-sold .art-impact { opacity: 0; animation: fade 120ms 420ms both; }
.fx-final .fx-art svg { animation: whistle 140ms 3 ease-in-out; }

/* ---------------------------------------------------------------- Reduzir movimento: só opacidade */
.cfx-still, .cfx-still *, .fx-still, .fx-still * { animation: none !important; transition: none !important; }
.fx-still .fx-stamp { opacity: 1; }
.fx-still .art-trophy path, .fx-still .art-crown path, .fx-still .art-sign { stroke-dashoffset: 0 !important; }
@media (prefers-reduced-motion: reduce) { .mp-ball { transition: none; } }

/* ---------------------------------------------------------------- Keyframes */
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes cfx-in { from { opacity: 0; clip-path: inset(100% 0 0 0); } to { opacity: 1; clip-path: inset(0 0 0 0); } }
@keyframes cfx-out { to { opacity: 0; } }
@keyframes rule-in { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes head-rise { from { transform: translateY(70%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes punch { 0% { transform: scale(1.18); } 100% { transform: scale(1); } }
@keyframes art-in { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }
@keyframes spin-in { from { transform: translateX(-60px) rotate(-220deg); } to { transform: none; } }
@keyframes card-flip { from { transform: rotate(-24deg) translateY(-20px); opacity: 0; } 70% { transform: rotate(3deg); opacity: 1; } to { transform: none; } }
@keyframes pulse { 50% { transform: scale(1.08); } }
@keyframes net-slide { from { transform: translateY(-44px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes plate-in { from { opacity: 0; transform: scaleY(0.4); } to { opacity: 1; transform: none; } }
@keyframes mark-in { from { transform: scale(2.4); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fall { from { transform: translateY(0) rotate(var(--r)); } to { transform: translateY(115vh) rotate(calc(var(--r) + 540deg)); } }
@keyframes chev-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; } }
@keyframes chev-down { from { transform: translateY(-40px); opacity: 0; } to { transform: none; } }
@keyframes clip-in { from { transform: translateY(60vh) rotate(8deg); } to { transform: rotate(3deg); } }
@keyframes stamp-slam { 0% { opacity: 0; transform: rotate(-11deg) scale(1.6); } 100% { opacity: 0.94; transform: rotate(-11deg) scale(1); } }
@keyframes shake { 25% { translate: 2px 0; } 50% { translate: -2px 1px; } 75% { translate: 1px -1px; } }
@keyframes gavel { from { transform: rotate(-30deg); } to { transform: rotate(0); } }
@keyframes whistle { 50% { transform: rotate(6deg); } }
.result-plate { gap: 20px; flex-wrap: wrap; }
.mini-pitch { max-width: 560px; margin-left: auto; margin-right: auto; }
