/* Modo tela cheia dos jogos: barra fixa no topo (voltar, nome, ações, placar, menu) e o jogo ocupando o resto da tela.
   Ativado por tela-cheia.js (classe "tc" no <body>). As opções, o "Como jogar" e a lista de jogadas ficam na gaveta do menu. */
html:has(body.tc), body.tc { min-height: 100dvh; background: var(--papel-2) !important; }
body.tc > header.topo, body.tc .tema-voltar-linha, body.tc .tema-cabeca, body.tc .tema-rodape, body.tc .tema-rodape-linha, body.tc #fundo-menu { display: none !important; }

/* barra do topo */
.tc-barra { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .45rem .8rem;
  background: var(--papel); border-bottom: 1px solid var(--fio); box-shadow: 0 2px 10px rgba(0,0,0,.08); font-family: var(--sans); }
.tc-voltar { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; text-decoration: none; font-size: 1.3rem; color: var(--tinta); border: 1px solid var(--fio); background: var(--papel-2); flex: none; }
.tc-voltar:hover { border-color: var(--realce); color: var(--realce); }
.tc-titulo { margin: 0; font-family: var(--serifa, Georgia, serif); font-size: 1.25rem; font-weight: 600; color: var(--tinta); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.tc-acoes { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-left: .6rem; }
.tc-acoes .xz-botao { padding: .4rem .85rem; font-size: .85rem; }
.tc-acoes [hidden] { display: none; }
.tc-direita { display: flex; align-items: center; gap: .45rem; margin-left: auto; }
.tc-icone { display: grid; place-items: center; min-width: 2.2rem; height: 2.2rem; padding: 0 .6rem; border-radius: 999px; border: 1px solid var(--fio); background: var(--papel-2); color: var(--tinta); font: 600 .9rem var(--sans); cursor: pointer; gap: .3rem; }
.tc-icone:hover { border-color: var(--realce); color: var(--realce); }
.tc-menu { display: flex; background: var(--realce); border-color: var(--realce); color: var(--papel); }
.tc-menu:hover { background: var(--realce-forte); color: var(--papel); }
.tc-barra #tema { width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--fio); background: var(--papel-2); color: var(--tinta); cursor: pointer; font-size: 1rem; }

/* placar compacto na barra */
.tc-barra .dm-placar { display: flex; gap: .3rem; margin: 0; padding: 0; background: none; border: 0; }
.tc-barra .dm-placar > div { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 3.3rem; padding: .15rem .45rem; border-radius: 8px;
  background: var(--papel-2); border: 1px solid var(--fio); font-size: .62rem; line-height: 1.1; color: var(--tinta-suave); }
.tc-barra .dm-placar b { font-size: 1rem; color: var(--tinta); }

/* área do jogo: tudo o que sobra da tela */
body.tc main.tema-mesa { max-width: none; width: 100%; margin: 0; padding: .7rem .8rem 1rem; border-radius: 0; box-shadow: none; border: 0; min-height: calc(100dvh - var(--tc-barra, 56px)); box-sizing: border-box; }
body.tc .xz-palco, body.tc .pc-palco, body.tc .gm-palco, body.tc .bn-palco { display: block; max-width: none; }
body.tc .xz-centro, body.tc .pc-centro, body.tc .gm-centro, body.tc .bn-centro { width: 100%; max-width: none; }

/* gaveta do menu */
.tc-fundo { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.35); }
.tc-gaveta { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; width: min(360px, 92vw); overflow-y: auto; background: var(--papel-2); border-left: 1px solid var(--fio);
  box-shadow: -8px 0 24px rgba(0,0,0,.2); padding: 1rem; box-sizing: border-box; transform: translateX(105%); transition: transform .22s ease; visibility: hidden; }
.tc-gaveta.aberta { transform: none; visibility: visible; }
.tc-gaveta-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: .8rem; font: 700 1rem var(--sans); color: var(--tinta); }
.tc-gaveta .xz-painel { margin-bottom: .9rem; }
.tc-gaveta .xz-dir, .tc-gaveta .xz-esq { display: block; }

@media (max-width: 700px) {
  .tc-barra { padding: .4rem .5rem; gap: .35rem; }
  .tc-titulo { font-size: 1.05rem; flex: 1; min-width: 5.4rem; }
  .tc-direita { margin-left: 0; }
  .tc-acoes { order: 5; width: 100%; margin: 0; justify-content: center; }
  .tc-acoes .xz-botao { padding: .35rem .7rem; font-size: .8rem; }
  .tc-barra .dm-placar > div { min-width: 2.4rem; max-width: 3.3rem; padding: .1rem .25rem; font-size: .5rem; text-align: center; white-space: normal; overflow-wrap: anywhere; }
  .tc-barra .dm-placar b { font-size: .9rem; }
  .tc-tela { display: none; }
  .tc-menu span { display: none; }
  body.tc main.tema-mesa { padding: .5rem .4rem .8rem; }
}
@media (prefers-reduced-motion: reduce) { .tc-gaveta { transition: none; } }

/* tabuleiro 8x8 comum (Damas, Xadrez) */
body.tc .xz-tabuleiro { width: min(88vw, calc(var(--tc-alto, 700px) - 165px), 720px); }
/* lista de jogadas que estava embaixo do jogo e foi para o menu */
.tc-gaveta .tc-lista { background: var(--papel); border: 1px solid var(--fio); border-radius: 12px; padding: 1rem; margin-bottom: .9rem; width: auto; }

/* texto "Como jogar" embaixo do jogo (para quem rola a página e para o Google); gerado por Biografia/ferramentas/seo_jogos.py */
.seo-texto { width: min(760px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 3rem; border-top: 1px solid var(--fio); font-family: var(--sans); color: var(--tinta); line-height: 1.65; }
.seo-texto h2 { font-family: var(--serif-titulo, Georgia, serif); font-size: 1.6rem; font-weight: 600; margin: 1.6rem 0 .6rem; color: var(--tinta); }
.seo-texto h2:first-child { margin-top: 0; }
.seo-texto h3 { font-size: 1.02rem; margin: 1.2rem 0 .3rem; color: var(--realce); }
.seo-texto p, .seo-texto li { font-size: .98rem; color: var(--tinta-suave); }
.seo-texto p { margin: .3rem 0; }
.seo-texto ul, .seo-texto ol { margin: .3rem 0; padding-left: 1.3rem; }
.seo-texto .seo-links { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .45rem; }
.seo-texto .seo-links a { display: inline-block; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--fio); background: var(--papel); color: var(--tinta); text-decoration: none; font-size: .88rem; }
.seo-texto .seo-links a:hover { border-color: var(--realce); color: var(--realce); }
.seo-texto .seo-todos { margin-top: 1.2rem; }
.seo-texto .seo-todos a { color: var(--realce); font-weight: 600; }
