/* Salão de Jogos do Gemalino — o visual próprio (prefixo sl-). O comum fica em base.css. */
:root {
  --sl-roxo: #6a4fb3;
  --sl-madeira: #e9c891;
  --sl-madeira-2: #c99a5b;
  --sl-casa: #fffdf7;
  --cor-gemalino: #ffd54f;
  --cor-bia: #e53935;
  --cor-tobias: #43a047;
  --cor-saltitao: #8d6e63;
}

/* ---------- menu e escolhas ---------- */
.sl-menu, .sl-escolha { flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.sl-jogos { flex-wrap: nowrap; }
.sl-jogos .sl-cartao { width: clamp(112px, 15vw, 220px); }
.sl-cartao {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  width: clamp(130px, 19vw, 230px); height: clamp(150px, 42vh, 260px); padding: 8px;
  border: 0; border-radius: var(--raio); background: var(--branco); box-shadow: var(--sombra);
}
.sl-cartao:active { transform: translateY(3px); }
.sl-icone { display: flex; gap: 4px; height: 55%; width: 100%; justify-content: center; }
.sl-icone svg { height: 100%; width: auto; max-width: 48%; }
.sl-nome { font-weight: bold; font-size: clamp(15px, 2vw, 21px); color: var(--azul); text-align: center; line-height: 1.15; }
.sl-tchau { align-self: flex-end; min-height: var(--alvo); min-width: var(--alvo); border: 0; border-radius: 999px; padding: 0 20px; font-weight: bold; box-shadow: var(--sombra); }
.sl-linha { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.sl-figuras { display: flex; justify-content: center; height: 58%; width: 100%; min-height: 0; }
.sl-figuras img { height: 100%; width: auto; min-width: 0; flex: 0 1 auto; object-fit: contain; }
.sl-cenouras { font-size: clamp(26px, 5vh, 44px); }
.sl-nivel.sugerido { outline: 6px solid var(--amarelo); box-shadow: 0 0 0 10px rgba(255, 213, 79, 0.45), var(--sombra); }
.sl-escolha .sl-cartao { height: clamp(140px, 36vh, 240px); }

.sl-temas { display: flex; gap: 10px; }
.sl-tema {
  width: var(--alvo); height: var(--alvo); border-radius: 18px; border: 4px solid #fff; font-size: 30px;
  box-shadow: var(--sombra);
}
.sl-tema.escolhido { border-color: var(--azul); outline: 4px solid var(--amarelo); }
.sl-tema.fechado { filter: grayscale(0.7); opacity: 0.7; }
.sl-tema.tema-fazenda, .tema-fazenda .sl-tabuleiro { --sl-fundo: #a5d67a; --sl-casa: #fffdf7; --sl-escura: #5f9e3a; --sl-clara: #f3e2c3; }
.sl-tema.tema-por-do-sol, .tema-por-do-sol .sl-tabuleiro { --sl-fundo: #ffb74d; --sl-casa: #fff3e0; --sl-escura: #c2185b; --sl-clara: #ffe0b2; }
.sl-tema.tema-noite, .tema-noite .sl-tabuleiro { --sl-fundo: #283593; --sl-casa: #e8eaf6; --sl-escura: #3949ab; --sl-clara: #c5cae9; }
.sl-tema { background: var(--sl-fundo); }

/* ---------- mesa ---------- */
.sl-mesa { display: flex; gap: 14px; width: 100%; height: 100%; min-height: 0; justify-content: center; align-items: center; }
.sl-caixa { position: relative; flex: 0 0 auto; height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.sl-tabuleiro {
  position: relative; background: var(--sl-fundo, #a5d67a); border-radius: 18px; padding: 0;
  border: 6px solid var(--sl-madeira-2); outline: 3px solid #fff8; box-shadow: 0 10px 24px rgba(31, 78, 140, 0.25), inset 0 0 0 3px rgba(255, 255, 255, 0.35); touch-action: none;
}
.sl-lado {
  flex: 0 0 clamp(190px, 20vw, 230px); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  align-self: center; padding: 14px 10px; background: rgba(255, 253, 247, 0.92); border: 4px solid var(--sl-madeira-2);
  border-radius: 24px; box-shadow: 0 10px 24px rgba(31, 78, 140, 0.2);
}
.sl-vez { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 2px 8px; }
.sl-vez img { height: clamp(40px, 9vh, 80px); width: auto; }
.sl-vez-nome { font-weight: bold; color: var(--azul); }
.sl-dado { width: max(var(--alvo), 11vh); height: max(var(--alvo), 11vh); border: 0; padding: 4px; background: transparent; border-radius: 20px; }
.sl-dado svg { width: 100%; height: 100%; }
.sl-dado.ativo { box-shadow: 0 0 0 6px var(--amarelo); animation: sl-chama 1.4s ease-in-out infinite; }
.sl-dado.rolando svg { animation: sl-gira 0.18s linear infinite; }
@media (max-height: 460px) {
  .sl-lado { flex-direction: row; flex-wrap: wrap; align-content: center; flex-basis: 210px; padding: 6px; gap: 6px; }
  .sl-vez { width: 100%; flex-direction: row; justify-content: center; padding: 0 8px; }
  .sl-vez img { height: 40px; }
}

/* peões (Ludo e Trilha): um disco com o recorte do personagem */
.sl-peao {
  position: absolute; z-index: 2; width: 11%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; border: 3px solid #fff; background: var(--cor, #fff); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25);
  display: grid; place-items: center; overflow: hidden; transition: left 0.2s, top 0.2s; pointer-events: none;
}
.sl-peao img { width: 92%; height: 92%; object-fit: contain; }
.sl-peao.mexe { border-color: var(--azul); box-shadow: 0 0 0 5px var(--amarelo); animation: sl-chama 1.2s ease-in-out infinite; z-index: 3; }
.sl-peao.chegou { width: 7%; }
.cor-gemalino { --cor: var(--cor-gemalino); }
.cor-bia { --cor: var(--cor-bia); }
.cor-tobias { --cor: var(--cor-tobias); }
.cor-saltitao { --cor: var(--cor-saltitao); }

.sl-foco { outline: 5px solid #e53935 !important; outline-offset: 2px; z-index: 4; }
.sl-tabuleiro:focus-visible { outline: 4px solid var(--azul); outline-offset: 4px; }
.sl-so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- trilha ---------- */
.sl-tab-trilha { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(5, 1fr); gap: 3%; padding: 2.5%; }
.sl-tab-trilha .sl-peao { width: 9%; }
.sl-casa-trilha {
  background: var(--sl-casa); border-radius: 22%; display: grid; place-items: center; overflow: hidden;
  border: 3px solid rgba(0, 0, 0, 0.1);
}
.sl-casa-trilha svg { width: 78%; height: 78%; }
.sl-numero { font-weight: bold; color: var(--azul); opacity: 0.55; font-size: clamp(11px, 2.2vh, 22px); }
.tipo-bonus { background: #fff8d6; } .tipo-atalho { background: #e1f5fe; } .tipo-desafio { background: #e3f2fd; }
.tipo-sujinho { background: #e8f5e9; } .tipo-tesouro { background: #ffe082; } .tipo-saida { background: #c8e6c9; }

.sl-surpresa {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; background: rgba(255, 253, 247, 0.93); border-radius: 18px;
}
.sl-surpresa[hidden] { display: none; }
.sl-grande { width: max(var(--alvo), 40vh); height: max(var(--alvo), 40vh); max-width: 90%; border: 0; background: transparent; border-radius: 24px; }
.sl-grande svg { width: 100%; height: 100%; }
.sl-coisas, .sl-respostas, .sl-bolhas { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.sl-coisa { width: var(--alvo); height: var(--alvo); border: 0; background: #fff; border-radius: 18px; box-shadow: var(--sombra); padding: 6px; }
.sl-coisa.contada { outline: 5px solid #66bb6a; }
.sl-coisa svg { width: 100%; height: 100%; }
.sl-resposta {
  width: var(--alvo); height: var(--alvo); border: 0; border-radius: 50%; background: var(--amarelo);
  font-size: 40px; font-weight: bold; color: var(--azul); box-shadow: var(--sombra);
}
.sl-resposta:disabled { opacity: 0.35; }
.sl-sujinho { width: clamp(80px, 26vh, 200px); aspect-ratio: 1; --limpo: 0; }
.sl-sujinho svg { width: 100%; height: 100%; filter: saturate(calc(1 + var(--limpo))) brightness(calc(1 + var(--limpo) * 0.15)); }
.sl-bolha { width: var(--alvo); height: var(--alvo); border: 0; background: transparent; padding: 0; }
.sl-bolha svg { width: 100%; height: 100%; }
.sl-bolha.estourou { opacity: 0.2; transform: scale(0.6); }
@media (max-height: 460px) {
  .sl-surpresa { flex-direction: row; flex-wrap: wrap; align-content: center; }
}

/* ---------- ludo ---------- */
.sl-tab-ludo { display: grid; grid-template-columns: repeat(7, 1fr); grid-template-rows: repeat(7, 1fr); gap: 1.4%; padding: 1.6%; }
.sl-casa-ludo { position: relative; border-radius: 14%; display: grid; place-items: center; }
.sl-casa-ludo.volta { background: #fff3d6; border: 2px solid #e2c48f; }
.sl-casa-ludo.entrada, .sl-casa-ludo.corredor { background: var(--cor); border: 2px solid rgba(0, 0, 0, 0.18); }
.sl-casa-ludo.entrada { box-shadow: inset 0 0 0 4px #fff; }
.sl-casa-ludo.ninho { background: var(--cor); border: 3px dashed #fff; box-shadow: inset 0 0 0 40px rgba(255, 255, 255, 0.18); }
.sl-casa-ludo.vazia { background: transparent; }
.sl-seta-entra { position: absolute; right: 4%; top: 2%; font-size: clamp(12px, 2.6vh, 26px); font-weight: bold; color: var(--cor); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.sl-seta { font-size: clamp(12px, 3vh, 30px); font-weight: bold; color: rgba(31, 78, 140, 0.45); line-height: 1; }
.sl-casa-ludo.corredor .sl-seta, .sl-casa-ludo.entrada .sl-seta-entra { position: absolute; right: 4%; top: 2%; font-size: clamp(12px, 2.6vh, 26px); font-weight: bold; color: var(--cor); text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.sl-seta { color: rgba(255, 255, 255, 0.95); text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.sl-casa-ludo.destino { outline: 4px solid var(--azul); outline-offset: -4px; background-image: radial-gradient(circle, rgba(255, 213, 79, 0.95) 0 32%, transparent 34%); }
.sl-casa-ludo.meio { background: #bfe9ff; display: grid; place-items: center; }
.sl-casa-ludo.meio svg { width: 90%; height: 90%; }

/* ---------- velha ---------- */
.sl-tab-velha { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(3, minmax(0, 1fr)); gap: 1.5%; padding: 1.5%; }
.sl-casa-velha { border: 0; border-radius: 18%; background: var(--sl-casa); padding: 10%; min-height: 0; overflow: hidden; }
.sl-casa-velha svg { width: 100%; height: 100%; animation: entra 0.25s ease-out; }
.sl-casa-velha.linha { background: #fff59d; box-shadow: 0 0 0 5px var(--amarelo); }

/* ---------- damas ---------- */
.sl-tab-damas { display: grid; grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(6, 1fr); padding: 2%; }
.sl-casa-damas { background: var(--sl-clara); display: grid; place-items: center; }
.sl-casa-damas.escura { background: var(--sl-escura); }
.sl-casa-damas.ultima { box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.6); }
.sl-casa-damas.destino { box-shadow: inset 0 0 0 5px var(--amarelo); background: #fff59d; }
.sl-peca {
  width: 76%; height: 76%; border-radius: 50%; display: grid; place-items: center; font-size: clamp(12px, 3vh, 30px);
  border: 3px solid rgba(0, 0, 0, 0.25); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.25); color: #fff;
}
.sl-peca.dono-0 { background: var(--cor-gemalino); color: var(--azul); }
.sl-peca.dono-1 { background: var(--cor-saltitao); }
.sl-peca.mexe { box-shadow: 0 0 0 4px var(--amarelo), 0 3px 0 rgba(0, 0, 0, 0.25); }
.sl-peca.escolhida { box-shadow: 0 0 0 5px var(--azul); transform: scale(1.08); }

/* ---------- xadrez ---------- */
.sl-tab-xadrez { display: grid; grid-template-columns: repeat(5, 1fr); grid-template-rows: repeat(5, 1fr); padding: 2%; }
.sl-casa-xadrez { position: relative; background: var(--sl-clara); display: grid; place-items: center; }
.sl-casa-xadrez.escura { background: var(--sl-escura); }
.sl-casa-xadrez.ultima { box-shadow: inset 0 0 0 4px rgba(255, 255, 255, 0.65); }
.sl-casa-xadrez.pega { box-shadow: inset 0 0 0 6px #e53935; }
.sl-peca-xadrez { width: 84%; height: 84%; display: grid; place-items: center; filter: drop-shadow(0 3px 0 rgba(0, 0, 0, 0.25)); }
.sl-peca-xadrez svg { width: 100%; height: 100%; }
.sl-peca-xadrez.mexe { border-radius: 50%; box-shadow: 0 0 0 4px var(--amarelo); }
.sl-peca-xadrez.escolhida { border-radius: 50%; box-shadow: 0 0 0 6px var(--azul); transform: scale(1.08); }
.sl-bolinha { width: 34%; height: 34%; border-radius: 50%; background: var(--amarelo); border: 4px solid var(--azul); }
.sl-variante .sl-icone svg { max-width: 48%; }

/* ---------- fim e despedida ---------- */
.sl-fim, .sl-despedida { flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.sl-figuras-fim { display: flex; gap: 10px; height: clamp(70px, 26vh, 220px); }
.sl-figuras-fim img, .sl-aceno { height: 100%; width: auto; min-width: var(--alvo); object-fit: contain; }
.sl-aceno { height: clamp(90px, 34vh, 260px); }
.sl-titulo { margin: 0; font-size: clamp(24px, 4.5vh, 42px); font-weight: bold; color: var(--azul); text-shadow: 0 2px 0 #fff; }
.sl-valor { margin: 0; font-size: clamp(17px, 3vh, 26px); background: var(--branco); padding: 4px 16px; border-radius: 999px; }
.sl-botoes { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

@keyframes sl-chama { 50% { transform: scale(1.06); } }
.sl-peao.mexe { animation-name: sl-chama-peao; }
@keyframes sl-chama-peao { 50% { transform: translate(-50%, -50%) scale(1.15); } }
@keyframes sl-gira { to { transform: rotate(360deg); } }
.sem-movimento .sl-dado.ativo, .sem-movimento .sl-peao.mexe, .sem-movimento .sl-dado.rolando svg { animation: none; }
.sem-movimento .sl-peao { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .sl-dado.ativo, .sl-peao.mexe, .sl-dado.rolando svg, .sl-casa-velha svg { animation: none; }
  .sl-peao { transition: none; }
}

/* ---------- impressão: só a página de jogar na mesa ---------- */
#impressao { display: none; }
@media print {
  body { background: #fff; overflow: visible; height: auto; }
  body > *:not(#impressao) { display: none !important; }
  #impressao { display: block; font: 14px/1.4 system-ui, sans-serif; color: #000; }
  .im-pagina { page-break-after: always; }
  .im-grade, .im-trilha { display: grid; gap: 4px; width: 16cm; margin: 0 auto 10px; }
  .im-trilha { grid-template-columns: repeat(6, 1fr); grid-template-rows: repeat(5, 2.6cm); }
  .im-7 { grid-template-columns: repeat(7, 2.2cm); grid-auto-rows: 2.2cm; width: auto; justify-content: center; }
  .im-3 { grid-template-columns: repeat(3, 4cm); grid-auto-rows: 4cm; width: auto; justify-content: center; }
  .im-5 { grid-template-columns: repeat(5, 2.8cm); grid-auto-rows: 2.8cm; width: auto; justify-content: center; gap: 0; }
  .im-damas svg { width: 80%; height: 80%; }
  .im-6 { grid-template-columns: repeat(6, 2.4cm); grid-auto-rows: 2.4cm; width: auto; justify-content: center; gap: 0; }
  .im-casa, .im-ludo, .im-velha, .im-damas { border: 1.5px solid #333; display: grid; place-items: center; position: relative; }
  .im-casa svg, .im-ludo svg { width: 70%; height: 70%; }
  .im-casa b { position: absolute; top: 2px; left: 4px; font-size: 11px; }
  .im-ludo.entrada { background: #ddd; } .im-ludo.corredor { background: #eee; } .im-ludo.ninho { border-style: dashed; } .im-ludo.vazia { border: 0; }
  .im-damas.escura { background: #999; }
  .im-pecas { display: flex; flex-wrap: wrap; gap: 6px; }
  .im-peca { width: 1.8cm; height: 1.8cm; border-radius: 50%; border: 1.5px solid #333; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
