/* Engenhocas da Fazenda — visual próprio do jogo (o comum está em base.css).
   A fazenda é um SVG 16:9 à esquerda; a bandeja com as peças e os botões, à direita. Nada pisca. */
:root {
  --tema: #ffb35c;
  --tema-escuro: #c96a12;
  --ef-cel: max(var(--alvo), min(12vh, 8vw));
  --ef-madeira: linear-gradient(#e3ac6c 0 30%, #cf9152 30% 34%, #dda266 34% 66%, #cf9152 66% 70%, #d89c5c 70%);
  --ef-borda: #6b3f17;
  --ef-gap: 8px;
}

/* ---------- menu: abas dos mundos e as fases ---------- */
.ef-menu { flex-direction: column; justify-content: safe center; align-items: center; gap: 10px; }
.ef-abas { display: flex; gap: var(--ef-gap); flex-wrap: nowrap; max-width: 100%; }
.ef-aba {
  min-height: var(--alvo); min-width: var(--alvo); padding: 4px 14px; border: 3px solid transparent; border-radius: 18px;
  background: rgba(255, 253, 247, 0.85); display: flex; flex-direction: column; justify-content: center; line-height: 1.15;
  box-shadow: var(--sombra);
}
.ef-aba strong { font-size: clamp(16px, 2.1vw, 24px); color: var(--azul); }
.ef-aba span { font-size: clamp(11px, 1.4vw, 15px); }
.ef-aba.ativa { background: var(--amarelo); border-color: var(--azul); }
.ef-fases-linha { display: flex; gap: var(--ef-gap); flex-wrap: wrap; justify-content: center; }
.ef-fase-botao {
  --ef-fase: max(var(--alvo), min(9vw, 15vh));
  position: relative; width: var(--ef-fase); height: var(--ef-fase); padding: 0; border: 3px solid var(--ef-borda);
  border-radius: 14px; background: var(--ef-madeira); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.2);
  color: #fffdf7; font-size: 34px; font-weight: bold; text-shadow: 0 2px 0 var(--ef-borda);
}
.ef-fase-botao:active { transform: translateY(2px); }
.ef-fase-botao.fechada { filter: grayscale(0.7); opacity: 0.6; }
.ef-selo { position: absolute; right: -6px; top: -8px; width: 34px; height: 34px; }
.ef-extra { position: absolute; left: 2px; top: -4px; font-size: 22px; color: var(--amarelo); text-shadow: 0 0 2px var(--ef-borda), 0 1px 0 var(--ef-borda); }
.ef-cadeado { position: absolute; right: 2px; bottom: 0; font-size: 20px; text-shadow: none; }

/* ---------- a fase: fazenda + coluna ---------- */
.ef-fase { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--ef-gap); align-items: center; }
.ef-campo { min-width: 0; min-height: 0; height: 100%; display: grid; place-items: center; }
.ef-mundo-caixa { position: relative; border-radius: 14px; overflow: hidden; box-shadow: 0 0 0 4px var(--branco), 0 6px 0 4px rgba(0, 0, 0, 0.12); }
.ef-mundo { display: block; width: 100%; height: 100%; touch-action: none; }
.ef-peca:not(.ef-fixa) { cursor: grab; }
.ef-pega { fill: transparent; }
.ef-escolhida { fill: none; stroke: var(--amarelo); stroke-width: 0.09; stroke-dasharray: 0.25 0.15; pointer-events: none; }
.ef-previa-peca { opacity: 0.45; pointer-events: none; }
.ef-fantasma { opacity: 0.55; pointer-events: none; filter: grayscale(1) brightness(1.9); animation: ef-respira 2.4s ease-in-out infinite; }
.ef-tobias, .ef-morango, .ef-saquinho, .ef-ventos, .ef-fundo, .ef-cesta { pointer-events: none; }
.ef-festa .ef-tobias { animation: ef-pulinho 0.7s ease-in-out 3; transform-box: fill-box; transform-origin: bottom; }

.ef-coluna {
  display: grid; grid-template-columns: repeat(3, var(--ef-cel)); grid-auto-rows: var(--ef-cel); gap: var(--ef-gap);
  align-content: center; touch-action: none;
}
.ef-coluna.ef-travada { opacity: 0.55; pointer-events: none; }
.ef-vaga-peca {
  position: relative; padding: 2px; border: 3px solid var(--ef-borda); border-radius: 16px; background: #fff4e3;
  box-shadow: var(--sombra); touch-action: none; display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.ef-vaga-peca svg { width: 100%; flex: 1 1 auto; min-height: 0; display: block; pointer-events: none; }
.ef-vaga-peca .ef-nome { font-size: 13px; font-weight: bold; color: var(--ef-borda); line-height: 1; padding-bottom: 2px; pointer-events: none; }
.ef-vaga-peca.escolhida { outline: 4px dashed var(--amarelo); outline-offset: 2px; }
.ef-vaga-peca.vazia { background: rgba(255, 253, 247, 0.4); border-style: dashed; box-shadow: none; }
.ef-girar, .ef-soltar {
  border: 0; border-radius: 18px; box-shadow: var(--sombra); display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-weight: bold; color: var(--azul); line-height: 1;
}
.ef-girar { background: var(--branco); }
.ef-girar-volta .ef-sinal { color: var(--tema-escuro); }
.ef-soltar { background: #66c25a; color: #fffdf7; text-shadow: 0 2px 0 #2f7a26; }
.ef-sinal { font-size: clamp(28px, 4vh, 40px); }
.ef-rotulo { font-size: clamp(14px, 2vh, 20px); }
.ef-girar:active, .ef-soltar:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.12); }

.ef-arrastando { position: fixed; left: 0; top: 0; z-index: 8; pointer-events: none; opacity: 0.9; }
.ef-arrastando svg { width: 100%; height: 100%; display: block; }

/* ---------- fim da fase ---------- */
.ef-coluna.ef-acabou { display: flex; flex-direction: column; justify-content: center; width: calc(3 * var(--ef-cel) + 2 * var(--ef-gap)); }
.ef-fim { display: flex; flex-direction: column; gap: 8px; align-items: center; background: rgba(255, 253, 247, 0.92); border-radius: var(--raio); padding: 8px; }
.ef-fim strong { font-size: clamp(16px, 2.4vh, 24px); color: var(--azul); text-align: center; }
.ef-fim-botoes { display: flex; gap: var(--ef-gap); }

@keyframes ef-respira { 0%, 100% { opacity: 0.35; } 50% { opacity: 0.7; } }
@keyframes ef-pulinho { 50% { transform: translateY(-0.4px); } }
