/* Efeitos de evento (efeitos.js): só o que fica POR CIMA do jogo. Painéis com a cara de pesca do tema (moldura de madeira,
   miolo de água escura, barra de título em maiúsculas com × boia, selos e números em fonte pixel com sombra em bloco).
   Não desenha cena nem tema: o tema geral é o tema-jogo.css. Reduzir movimento e Modo leve: só aparece e some. */
:root {
  --fx-madeira: var(--madeira, #6b4a2b);
  --fx-madeira-clara: var(--madeira-clara, #8a6239);
  --fx-madeira-escura: var(--madeira-escura, #4e341c);
  --fx-contorno: var(--contorno, #2a1a0e);
  --fx-miolo: var(--agua-escura, #123a4a);
  --fx-miolo-claro: var(--agua, #1d5566);
  --fx-boia: var(--boia-vermelha, #b94e14);
  --fx-ouro: #f2c14e;
  --fx-pixel: "Press Start 2P", "Lucida Console", "Consolas", ui-monospace, monospace;
}

.fx-canvas { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9998; }

/* ---- números em "pixel": monoespaçada grossa com sombra em bloco */
.fx-pixel, .fx-sobe, .fx-dano, .fx-nivel-num, .fx-vida-txt, .fx-cartao-titulo, .fx-luta-vitoria, .fx-roleta-res {
  font-family: var(--fx-pixel); font-weight: 700; letter-spacing: .02em;
  text-shadow: 2px 0 0 var(--fx-contorno), -2px 0 0 var(--fx-contorno), 0 2px 0 var(--fx-contorno), 0 -2px 0 var(--fx-contorno), 2px 2px 0 var(--fx-contorno);
}

/* ---- texto que sobe (+XP, +moedas, Comprado!) */
.fx-sobe {
  position: fixed; z-index: 9999; pointer-events: none; transform: translate(-50%, -50%);
  color: #fff; font-size: 15px; white-space: nowrap; animation: fx-sobe 1.4s cubic-bezier(.2, .8, .3, 1) forwards;
}
.fx-sobe.fx-ganho { color: var(--fx-ouro); }
.fx-sobe.fx-xp { color: #7fe3ff; }
.fx-sobe.fx-compra { color: var(--fx-ouro); font-size: 17px; }
@keyframes fx-sobe {
  0% { opacity: 0; transform: translate(-50%, -20%) scale(.6); }
  15% { opacity: 1; transform: translate(-50%, -70%) scale(1.15); }
  30% { transform: translate(-50%, -90%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -170%); }
}

/* ---- pulos e brilhos em elementos do jogo */
.fx-pulsa { animation: fx-pulsa .6s ease-out; }
@keyframes fx-pulsa { 30% { transform: scale(1.08); filter: brightness(1.5) drop-shadow(0 0 6px var(--fx-ouro)); } }
.fx-salta { animation: fx-salta .55s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fx-salta { 0% { transform: scale(.94); } 45% { transform: scale(1.04) translateY(-4px); } }
.fx-brilha { animation: fx-brilha .8s ease-out; }
@keyframes fx-brilha { 30% { box-shadow: 0 0 0 3px var(--fx-ouro), 0 0 22px var(--fx-ouro); filter: brightness(1.3); } }
.fx-sorteio { animation: fx-sorteio .7s ease-out; }
@keyframes fx-sorteio { 0% { transform: rotateX(80deg); opacity: .2; } 60% { transform: rotateX(-12deg); filter: brightness(1.5); } 100% { transform: none; } }
.fx-apanha { animation: fx-apanha .25s ease-out; }
@keyframes fx-apanha { 40% { transform: translateX(4px) scale(.92); filter: brightness(2) saturate(0); } }

/* ---- tremida (só o jogo) */
.fx-treme { animation: fx-treme .45s linear; }
.fx-treme-forte { animation: fx-treme-forte .65s linear; }
@keyframes fx-treme { 20% { transform: translate(-3px, 1px); } 40% { transform: translate(3px, -2px); } 60% { transform: translate(-2px, 2px); } 80% { transform: translate(2px, -1px); } }
@keyframes fx-treme-forte {
  10% { transform: translate(-8px, 3px) rotate(-.4deg); } 25% { transform: translate(7px, -5px) rotate(.4deg); }
  40% { transform: translate(-6px, 4px); } 55% { transform: translate(5px, -3px); } 70% { transform: translate(-3px, 2px); } 85% { transform: translate(2px, -1px); }
}

/* ---- flash dourado */
.fx-flash { position: fixed; inset: 0; z-index: 9997; pointer-events: none; animation: fx-flash .9s ease-out forwards; }
.fx-flash-ouro { background: radial-gradient(circle at 50% 45%, #fff6cfee 0%, #f2c14eaa 30%, #f2c14e33 60%, transparent 80%); }
.fx-flash.fx-suave { animation-duration: .6s; opacity: .35; }
@keyframes fx-flash { 0% { opacity: 0; } 12% { opacity: 1; } 100% { opacity: 0; } }

/* ---- painel do jogo: moldura de madeira, faixa de título, × cor de boia, miolo escuro (o formato do PokeIdle, a nossa cara) */
.fx-roleta, .fx-luta, .fx-cartao, .fx-toast {
  background: linear-gradient(180deg, var(--fx-madeira-clara), var(--fx-madeira) 40%, var(--fx-madeira-escura));
  border: 3px solid var(--fx-contorno); border-radius: 6px; color: #fff;
  box-shadow: inset 0 0 0 2px #c9a06a55, 0 6px 0 var(--fx-contorno), 0 14px 40px #000a;
}
.fx-janela-titulo {
  display: flex; align-items: center; justify-content: space-between; gap: .5rem;
  padding: .35rem .5rem .35rem .7rem; text-transform: uppercase; font-weight: 900; font-size: .8rem; letter-spacing: .06em;
  text-shadow: 1px 1px 0 var(--fx-contorno);
}
.fx-xis {
  min-width: 28px; min-height: 28px; padding: 0; border-radius: 4px; border: 2px solid var(--fx-contorno);
  background: var(--fx-boia); color: #fff; font-weight: 900; font-size: 1rem; line-height: 1; box-shadow: 0 2px 0 var(--fx-contorno);
}
.fx-janela-miolo { margin: 0 6px 6px; padding: .8rem; background: var(--fx-miolo); border: 2px solid var(--fx-contorno); border-radius: 4px; }
.fx-selo {
  display: inline-block; padding: .1rem .45rem; border-radius: 3px; border: 2px solid var(--fx-contorno);
  background: var(--fx-boia); font-size: .65rem; font-weight: 900; text-transform: uppercase; letter-spacing: .04em;
}

/* ---- raios girando atrás do que é raro */
.fx-raios {
  position: absolute; left: 50%; top: 50%; width: min(520px, 100vw); aspect-ratio: 1; height: auto; transform-origin: center; translate: -50% -50%; z-index: -1; pointer-events: none;
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--cor-rar, var(--fx-ouro)) 45%, transparent) 0 10deg, transparent 10deg 24deg);
  -webkit-mask: radial-gradient(circle, #000 0 18%, transparent 62%); mask: radial-gradient(circle, #000 0 18%, transparent 62%);
  animation: fx-gira 9s linear infinite;
}
@keyframes fx-gira { to { transform: rotate(360deg); } }

/* ---- cartão do peixe pescado */
.fx-cartao {
  position: fixed; right: 18px; bottom: 84px; z-index: 9990; display: flex; align-items: center; gap: .7rem;
  width: min(300px, calc(100vw - 32px)); padding: .5rem .8rem .5rem .5rem; cursor: pointer; isolation: isolate;
  animation: fx-entra-lado .45s cubic-bezier(.3, 1.5, .5, 1) both;
}
.fx-cartao-arte {
  flex: none; width: 88px; height: 56px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle, var(--fx-miolo-claro), var(--fx-miolo)); border: 2px solid var(--fx-contorno); border-radius: 4px;
}
.fx-cartao-arte svg { max-width: 100%; max-height: 100%; }
.fx-folha { width: 100%; height: 100%; object-fit: contain; }
.fx-folha-dourada { filter: sepia(1) saturate(4) hue-rotate(-12deg) brightness(1.15) drop-shadow(0 0 6px #f2c14e); }
.fx-cartao-txt { min-width: 0; line-height: 1.25; }
.fx-cartao-nome { font-weight: 900; font-size: 1rem; text-shadow: 1px 1px 0 var(--fx-contorno); overflow-wrap: anywhere; }
.fx-cartao-rar {
  display: inline-block; margin-top: .15rem; padding: .05rem .45rem; border-radius: 3px; border: 2px solid var(--fx-contorno);
  background: var(--cor-rar); color: #1a0f07; font-size: .65rem; font-weight: 900; text-transform: uppercase;
}
.fx-cartao-mais { font-size: .7rem; opacity: .85; }
.fx-estrelas span { display: inline-block; font-size: 1rem; text-shadow: 1px 1px 0 var(--fx-contorno); animation: fx-estrela .35s cubic-bezier(.3, 1.8, .5, 1) both; }
.fx-estrelas .cheia { color: var(--fx-ouro); }
.fx-estrelas .vazia { color: #00000055; text-shadow: none; }
@keyframes fx-estrela { from { transform: scale(0) rotate(-90deg); opacity: 0; } }
@keyframes fx-entra-lado { from { transform: translateX(120%) rotate(6deg); opacity: 0; } }

/* Raro+ : no centro, grande, com raios e brilho na cor da raridade */
.fx-cartao.fx-grande {
  right: auto; bottom: auto; left: 50%; top: 22%; flex-direction: column; text-align: center; gap: .4rem;
  width: min(300px, calc(100vw - 32px)); padding: .8rem 1rem 1rem; transform: translateX(-50%);
  animation: fx-entra-centro .6s cubic-bezier(.3, 1.6, .5, 1) both;
  box-shadow: inset 0 0 0 2px #c9a06a55, 0 6px 0 var(--fx-contorno), 0 0 34px color-mix(in srgb, var(--cor-rar) 70%, transparent), 0 14px 40px #000a;
}
.fx-grande .fx-cartao-arte { width: 200px; height: 110px; box-shadow: inset 0 0 24px color-mix(in srgb, var(--cor-rar) 45%, transparent); }
.fx-grande .fx-cartao-nome { font-size: 1.2rem; white-space: normal; }
.fx-cartao-titulo { font-size: 1.25rem; color: var(--cor-rar); }
.fx-grande .fx-estrelas span { font-size: 1.35rem; }
.fx-cartao.fx-dourado { border-color: #6b4806; background: linear-gradient(180deg, #ffe28a, #e0a420 45%, #9a6a10); }
.fx-cartao.fx-dourado .fx-cartao-titulo { color: #fff4c2; animation: fx-pisca 1s ease-in-out infinite; }
@keyframes fx-entra-centro { 0% { transform: translateX(-50%) scale(.2) rotate(-8deg); opacity: 0; } 70% { transform: translateX(-50%) scale(1.06); } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes fx-pisca { 50% { filter: brightness(1.4); } }

/* ---- banner de nível */
.fx-nivel {
  position: fixed; left: 50%; top: 34%; z-index: 9991; transform: translate(-50%, -50%); pointer-events: none; text-align: center; isolation: isolate;
  animation: fx-nivel 2.7s cubic-bezier(.3, 1.4, .5, 1) forwards;
}
.fx-nivel .fx-raios { --cor-rar: var(--fx-ouro); width: min(640px, 100vw); }
.fx-nivel-sub {
  display: inline-block; padding: .2rem .8rem; margin-bottom: .4rem; border: 3px solid var(--fx-contorno); border-radius: 4px;
  background: var(--fx-boia); color: #fff; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; font-size: .85rem; box-shadow: 0 4px 0 var(--fx-contorno);
}
.fx-nivel-num {
  font-size: clamp(34px, 7vw, 76px); color: var(--fx-ouro); white-space: nowrap;
  text-shadow: 4px 0 0 var(--fx-contorno), -4px 0 0 var(--fx-contorno), 0 4px 0 var(--fx-contorno), 0 -4px 0 var(--fx-contorno), 4px 4px 0 var(--fx-contorno), 0 8px 0 var(--fx-contorno), 0 0 30px #f2c14e;
}
@keyframes fx-nivel {
  0% { transform: translate(-50%, -50%) scale(.2); opacity: 0; } 18% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; }
  28% { transform: translate(-50%, -50%) scale(1); } 82% { opacity: 1; } 100% { transform: translate(-50%, -64%) scale(1); opacity: 0; }
}

/* ---- toast de conquista */
.fx-toasts { position: fixed; right: 18px; top: 84px; z-index: 9992; display: flex; flex-direction: column; gap: .5rem; width: min(320px, calc(100vw - 32px)); }
.fx-toast { display: flex; align-items: center; gap: .7rem; padding: .6rem .8rem; cursor: pointer; animation: fx-entra-lado .5s cubic-bezier(.3, 1.5, .5, 1) both, fx-sai 0.5s ease-in 5.5s forwards; }
.fx-toast-trofeu {
  flex: none; display: grid; place-items: center; width: 46px; height: 46px; font-size: 28px;
  background: var(--fx-miolo); border: 2px solid var(--fx-contorno); border-radius: 4px; animation: fx-trofeu 1s cubic-bezier(.3, 1.8, .5, 1) both;
}
.fx-toast-titulo { font-size: .65rem; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; color: var(--fx-ouro); text-shadow: 1px 1px 0 var(--fx-contorno); }
.fx-toast .mini { color: #ffe9dc; }
@keyframes fx-sai { to { transform: translateX(120%); opacity: 0; } }
@keyframes fx-trofeu { 0% { transform: scale(0) rotate(-30deg); } 60% { transform: scale(1.25) rotate(8deg); } }

/* ---- roleta */
.fx-roleta-fundo { position: fixed; inset: 0; z-index: 9995; display: flex; align-items: center; justify-content: center; padding: 16px; background: #04121aa6; animation: fx-aparece .2s ease-out; }
.fx-roleta { width: min(720px, 100%); min-width: 0; animation: fx-entra-centro-sem .35s cubic-bezier(.3, 1.5, .5, 1) both; }
.fx-roleta-janela { width: 100%;
  position: relative; height: 132px; overflow: hidden; background: var(--agua-funda, #0b2533); border: 2px solid var(--fx-contorno); border-radius: 4px;
  -webkit-mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent); mask: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
}
.fx-roleta-fita { display: flex; height: 100%; padding: 10px 0; will-change: transform; }
.fx-casa {
  flex: none; width: 110px; margin: 0 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem;
  background: linear-gradient(180deg, var(--fx-miolo-claro), var(--fx-miolo)); border: 2px solid var(--fx-contorno); border-radius: 4px;
  border-bottom: 6px solid var(--cor-rar); text-align: center; padding: .3rem;
}
.fx-casa-ico { font-size: 32px; filter: drop-shadow(0 0 6px color-mix(in srgb, var(--cor-rar) 80%, transparent)); }
.fx-casa-nome { font-size: .68rem; font-weight: 800; line-height: 1.15; color: var(--cor-rar); text-shadow: 1px 1px 0 #000; }
.fx-roleta-agulha {
  position: absolute; left: 50%; top: 0; bottom: 0; width: 4px; margin-left: -2px; background: var(--fx-ouro);
  box-shadow: 0 0 0 2px var(--fx-contorno), 0 0 14px var(--fx-ouro);
}
.fx-roleta-agulha::before, .fx-roleta-agulha::after {
  content: ""; position: absolute; left: 50%; border: 10px solid transparent; transform: translateX(-50%);
}
.fx-roleta-agulha::before { top: 0; border-top-color: var(--fx-ouro); }
.fx-roleta-agulha::after { bottom: 0; border-bottom-color: var(--fx-ouro); }
.fx-roleta-res { min-height: 2.2rem; margin-top: .7rem; text-align: center; font-size: 1.2rem; }
.fx-roleta-rodape { margin-top: .4rem; align-items: center; color: #d9ecf2; }
.fx-roleta-rodape .secundario { min-height: 36px; }
.fx-parou .fx-casa-fim { animation: fx-ganhou .9s ease-out both; }
.fx-premio .fx-casa-fim { animation: fx-ganhou-grande 1.2s ease-out both; }
.fx-parou .fx-roleta-res { animation: fx-salta .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fx-ganhou { 40% { transform: scale(1.12); box-shadow: 0 0 0 3px var(--cor-rar), 0 0 24px var(--cor-rar); } 100% { box-shadow: 0 0 0 3px var(--cor-rar), 0 0 14px var(--cor-rar); } }
@keyframes fx-ganhou-grande { 30% { transform: scale(1.2); box-shadow: 0 0 0 3px var(--fx-ouro), 0 0 40px var(--fx-ouro); } 100% { transform: scale(1.06); box-shadow: 0 0 0 3px var(--fx-ouro), 0 0 22px var(--fx-ouro); } }
@keyframes fx-aparece { from { opacity: 0; } }
@keyframes fx-entra-centro-sem { from { transform: scale(.85); opacity: 0; } }

/* ---- luta contra o Leviatã */
.fx-luta {
  position: fixed; left: 50%; top: 18%; z-index: 9993; width: min(440px, calc(100vw - 32px)); transform: translateX(-50%); cursor: pointer;
  animation: fx-entra-centro .45s cubic-bezier(.3, 1.5, .5, 1) both;
}
.fx-luta.fx-compacta { top: auto; bottom: 84px; left: auto; right: 18px; transform: none; width: min(320px, calc(100vw - 32px)); animation: fx-entra-lado .35s ease-out both; }
.fx-luta-cab { display: flex; align-items: baseline; gap: .5rem; font-size: 1.05rem; }
.fx-luta-bicho { display: inline-block; font-size: 2rem; line-height: 1; }
.fx-vida { position: relative; height: 18px; margin-top: .5rem; background: var(--agua-funda, #0b2533); border: 2px solid var(--fx-contorno); border-radius: 3px; overflow: hidden; }
.fx-vida-cheia, .fx-vida-rastro { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; }
.fx-vida-cheia { background: linear-gradient(180deg, #ff7a7a, #d6323a 55%, #9a1b24); transition: width .12s linear;
  box-shadow: inset 0 2px 0 #ffffff55; }
.fx-vida-cheia::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 10px, #0000003a 10px 12px); }
.fx-vida-rastro { background: #ffe28a; transition: width .5s ease-out; }
.fx-vida-txt { margin-top: .3rem; text-align: right; font-size: .75rem; color: #ffd4d4; }
.fx-luta-numeros { position: relative; height: 34px; }
.fx-dano { position: absolute; top: 16px; color: #fff; font-size: 15px; white-space: nowrap; animation: fx-dano .95s ease-out forwards; }
.fx-dano.fx-dupla { color: var(--fx-ouro); font-size: 18px; }
@keyframes fx-dano { 0% { transform: translateY(14px) scale(.5); opacity: 0; } 20% { transform: translateY(0) scale(1.25); opacity: 1; } 100% { transform: translateY(-28px) scale(1); opacity: 0; } }
.fx-luta-res { text-align: center; }
.fx-luta-res .mini { color: #d9ecf2; }
.fx-trofeu { font-size: 54px; line-height: 1.1; animation: fx-trofeu 1s cubic-bezier(.3, 1.8, .5, 1) both; filter: drop-shadow(0 0 14px #f2c14e); }
.fx-luta-vitoria { font-size: 1.4rem; color: var(--fx-ouro); animation: fx-salta .6s cubic-bezier(.3, 1.6, .5, 1); }
.fx-luta-derrota { font-size: 1.1rem; font-weight: 900; color: #c9d6e0; padding-top: .3rem; }
.fx-venceu .fx-luta-bicho { filter: grayscale(1) brightness(.6); transform: rotate(180deg); transition: transform .5s, filter .5s; }
.fx-compacta .fx-trofeu { font-size: 34px; }

/* ---- celular: só não pode quebrar */
@media (max-width: 600px) {
  .fx-cartao { right: 16px; bottom: 132px; }
  .fx-toasts { right: 16px; top: 64px; }
  .fx-luta.fx-compacta { right: 16px; bottom: 132px; }
  .fx-casa { width: 90px; }
  .fx-roleta-janela { height: 116px; }
}

/* ---- reduzir movimento e Modo leve: aparece e some, sem pulo, giro nem tremida */
@media (prefers-reduced-motion: reduce) {
  .fx-cartao, .fx-cartao.fx-grande, .fx-nivel, .fx-toast, .fx-luta, .fx-roleta, .fx-sobe, .fx-estrelas span, .fx-dano, .fx-trofeu,
  .fx-toast-trofeu, .fx-luta-vitoria, .fx-parou .fx-casa-fim, .fx-parou .fx-roleta-res { animation-name: fx-aparece !important; animation-duration: .25s !important; }
  .fx-toast { animation: fx-aparece .25s both, fx-some .4s 5.5s forwards !important; }
  .fx-nivel { animation: fx-aparece-some 2.6s forwards !important; }
  .fx-raios { animation: none; }
  .fx-pulsa, .fx-salta, .fx-sorteio, .fx-apanha, .fx-treme, .fx-treme-forte { animation: none !important; }
}
body.modo-leve .fx-raios { animation: none; }
body.modo-leve .fx-treme, body.modo-leve .fx-treme-forte { animation: none !important; }
@keyframes fx-some { to { opacity: 0; } }
@keyframes fx-aparece-some { 0% { opacity: 0; } 10%, 85% { opacity: 1; } 100% { opacity: 0; } }
.fx-cartao.fx-dourado .fx-estrelas .cheia { color: #fff; }
.fx-cartao.fx-dourado .fx-cartao-arte { background: radial-gradient(circle, #5a3d12, #2c1d10); }
.fx-roleta-rodape label { display: inline-flex; align-items: center; gap: .4rem; cursor: pointer; }
.fx-roleta-rodape input { width: auto; margin: 0; }
/* Rara: no canto, com brilho na cor */
.fx-cartao.fx-brilho { box-shadow: inset 0 0 0 2px #c9a06a55, 0 6px 0 var(--fx-contorno), 0 0 22px var(--cor-rar), 0 14px 40px #000a; }
.fx-cartao.fx-brilho .fx-cartao-arte { box-shadow: inset 0 0 16px var(--cor-rar); }
