/* Corrida da Fazenda — visual próprio do jogo (o comum está em base.css). Prefixo "cf-". */
:root { --tema: #ffcf5c; --tema-escuro: #d84a2f; --ceu: #ffe9a8; --ceu-2: #fff7da; --vermelho: #d84a2f; --cf-icone: clamp(40px, 10vh, 96px); }

/* opções grandes (menu, pistas, garagem) */
.cf-opcao {
  min-width: var(--alvo); min-height: var(--alvo); border: 0; border-radius: var(--raio); background: var(--branco);
  box-shadow: var(--sombra); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px;
  overflow: hidden;
}
.cf-opcao:active { transform: translateY(3px); }
.cf-opcao.escolhida { background: var(--amarelo); outline: 4px solid var(--vermelho); outline-offset: -4px; }
.cf-icone { display: flex; align-items: center; justify-content: center; font-size: clamp(34px, 8vh, 72px); line-height: 1; min-height: 0; }
.cf-icone img { height: var(--cf-icone); width: auto; }
.cf-mini { display: block; max-width: 100%; height: auto; border-radius: 10px; }
.cf-rotulo { font-size: clamp(15px, 2vw, 24px); font-weight: bold; color: var(--azul); line-height: 1.1; text-align: center; }
.cf-sub { font-size: clamp(12px, 1.4vw, 16px); color: #50606f; line-height: 1.1; text-align: center; }

/* 1. o jeito de correr e 2. a pista */
.cf-menu, .cf-pistas { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cf-menu .cf-icone { font-size: clamp(40px, 12vh, 96px); }
.cf-pistas .cf-icone { width: 100%; flex: 0 1 auto; }
.cf-pistas .cf-mini { width: min(100%, 300px); max-height: 46vh; object-fit: contain; }

/* 3. a garagem: carrinhos em cima, motoristas embaixo, "Correr!" do lado */
.cf-garagem { gap: 10px; align-items: stretch; }
.cf-escolhas { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cf-linha { flex: 1 1 0; min-height: 0; display: flex; gap: 8px; }
.cf-linha .cf-opcao { flex: 1 1 0; min-width: var(--alvo); }
.cf-veiculos .cf-mini { height: var(--cf-icone); width: auto; }
.cf-correr { flex: 0 0 auto; align-self: center; min-width: 0; width: 150px; min-height: 120px; padding: 0 8px; border-radius: var(--raio); background: var(--vermelho); color: #fffdf7; }

/* 4. a corrida: botão de virar em cada lado, a pista no meio */
.cf-corrida { gap: 6px; align-items: stretch; }
.cf-coluna { flex: 0 0 calc(var(--alvo) + 10px); display: flex; flex-direction: column; justify-content: space-between; align-items: center; gap: 6px; min-height: 0; }
.cf-info {
  width: 100%; padding: 6px 4px; border-radius: 14px; background: var(--branco); box-shadow: var(--sombra); color: var(--azul);
  font-weight: bold; font-size: clamp(13px, 1.7vw, 20px); line-height: 1.15; text-align: center; font-variant-numeric: tabular-nums;
}
.cf-virar {
  width: calc(var(--alvo) + 8px); height: calc(var(--alvo) + 8px); flex: 0 0 auto; border: 0; border-radius: 50%;
  background: var(--amarelo); color: var(--azul); font-size: 40px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.18);
  touch-action: none; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none;
}
.cf-virar.apertado { background: #ffb300; transform: translateY(4px); box-shadow: 0 2px 0 rgba(0, 0, 0, 0.18); }
.cf-meio { flex: 1 1 0; min-width: 0; min-height: 0; display: flex; align-items: center; justify-content: center; }
.cf-tela { display: block; border-radius: 14px; box-shadow: 0 0 0 4px var(--branco), var(--sombra); touch-action: none; }

/* 5. o fim */
.cf-fim { align-items: center; justify-content: center; gap: 2vw; }
.cf-fim-figuras { flex: 0 1 auto; height: 72%; max-height: 380px; display: flex; align-items: flex-end; gap: 4px; min-width: 0; }
.cf-fim-figuras img { height: 100%; width: auto; min-width: 0; object-fit: contain; }
.cf-fim-figuras.turma { height: 46%; max-width: 46%; flex-wrap: nowrap; }
.cf-fim-figuras.turma img { flex: 1 1 0; height: auto; max-height: 100%; max-width: 20%; }
.cf-fim-meio {
  flex: 0 1 520px; min-width: 0; max-height: 100%; overflow: auto; background: var(--branco); border-radius: var(--raio); box-shadow: var(--sombra);
  padding: clamp(8px, 2vh, 22px) 14px; text-align: center;
}
.cf-fim-titulo { margin: 0 0 4px; color: var(--azul); font-size: clamp(22px, 3.2vw, 38px); }
.cf-fim-frase { margin: 0 0 6px; font-size: clamp(15px, 1.9vw, 21px); line-height: 1.25; }
.cf-fim-detalhe { margin: 0 0 8px; font-size: clamp(13px, 1.6vw, 18px); color: #50606f; font-variant-numeric: tabular-nums; }
.cf-fim-botoes { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cf-fim .botao-acao { min-width: 120px; padding: 0 16px; font-size: clamp(16px, 1.9vw, 20px); }

/* celular deitado (pouca altura) */
@media (max-height: 460px) {
  .cf-menu, .cf-pistas { gap: 8px; }
  .cf-garagem, .cf-escolhas { gap: 6px; }
  .cf-linha { gap: 4px; }
  .cf-opcao { gap: 2px; padding: 3px; }
  .cf-correr { width: calc(var(--alvo) + 14px); min-height: var(--alvo); font-size: 17px; padding: 0 4px; }
  .cf-virar { width: var(--alvo); height: var(--alvo); font-size: 34px; }
  .cf-coluna { flex-basis: calc(var(--alvo) + 4px); }
  .cf-fim-titulo { font-size: 22px; }
  .cf-fim-frase { font-size: 15px; margin-bottom: 4px; }
  .cf-fim-detalhe { font-size: 13px; margin-bottom: 4px; }
  .cf-fim .botao-acao { min-width: 0; padding: 0 14px; font-size: 17px; }
  .cf-veiculos .cf-mini { height: calc(var(--cf-icone) * 1.25); }
}
/* dentro do navegador do celular sobra ainda menos: só o essencial */
@media (max-height: 340px), (max-width: 700px) {
  .cf-sub { display: none; }
  .cf-garagem .cf-rotulo { font-size: 13px; }
  .cf-fim-figuras { display: none; }
  .cf-fim .botao-acao { min-width: 0; padding: 0 12px; font-size: 16px; }
  .cf-fim-meio { flex-basis: 100%; }
}
