/* Coach Board: ecrã do jogo (janela de transferências), tabuleiro 2D e cartas de jogador. */

/* --- Barra e grelha --- */
.barra-jogo {
  flex-wrap: wrap;
}
@media (max-width: 640px) {
  .barra-marca .barra-nome {
    display: none;
  }
  .barra-info {
    order: 5;
    flex-basis: 100%;
    font-size: 13px;
  }
  .barra-jogo {
    gap: 6px 10px;
  }
}
.barra-dinheiro {
  margin: 0;
  font-family: var(--display);
  font-size: 20px;
  letter-spacing: 0.03em;
  color: var(--destaque-2);
  white-space: nowrap;
}
.barra-dinheiro strong {
  font-weight: 400;
}
.ecra-jogo {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}
.ecra-jogo[hidden] {
  display: none;
}
.ecra-jogo .barra-jogo {
  flex: none;
}
@media (min-width: 641px) {
  .barra-info {
    flex: 1;
    min-width: 0;
  }
}
/* O tabuleiro manda: fica sempre no meio e ocupa o espaço que houver. */
.palco {
  position: relative;
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(150px, 215px) minmax(0, 1fr) minmax(150px, 215px);
  gap: 6px;
  padding: 6px 10px 4px;
}
.palco.em-jogo {
  grid-template-columns: minmax(190px, 255px) minmax(0, 1fr) minmax(190px, 255px);
}
/* O canvas fica por trás de tudo: com zoom, o tabuleiro continua por trás dos nomes. */
.coluna-lado,
.centro {
  position: relative;
  z-index: 1;
  pointer-events: none;
  min-width: 0;
  min-height: 0;
}
.coluna-lado > *,
.centro > *:not(.centro-tabuleiro),
.centro-tabuleiro > *,
.equipas-lado > * {
  pointer-events: auto;
}
.coluna-lado {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.equipas-lado {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 8px;
  pointer-events: none;
}
.palco.em-jogo .equipas-lado {
  flex: 0 1 auto;
  justify-content: flex-start;
  overflow: hidden;
  pointer-events: auto;
}
.centro {
  display: flex;
  flex-direction: column;
}
.equipas-topo {
  flex: none;
  display: flex;
  justify-content: center;
}
.equipas-topo .chip-caixa {
  width: min(280px, 60%);
}
.centro-tabuleiro {
  position: relative;
  flex: 1;
  min-height: 0;
}
.col-tabuleiro {
  position: absolute;
  inset: 0;
  z-index: 0;
  min-width: 0;
  overflow: hidden;
  container-type: inline-size;
}
.caixa-3d {
  width: 100%;
  height: 100%;
}
.caixa-3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.legenda-vez {
  position: absolute;
  top: 4px;
  left: 10px;
  white-space: nowrap;
  z-index: 3;
  margin: 0;
  padding: 3px 10px;
  border-radius: 8px;
  background: #06140dcc;
  font-size: 13px;
  pointer-events: none;
}
.legenda-vez:empty {
  display: none;
}
/* As informações do jogo aparecem em cima do relvado. */
.sobre-relvado {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 13%;
  transform: translateX(-50%);
  width: min(68%, 760px);
  max-height: 78%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: #06140de6;
  animation: aparecer-relvado 0.25s ease-out;
}
.sobre-relvado[hidden] {
  display: none;
}
.sobre-relvado p {
  margin: 0;
}
.sobre-relvado .carta {
  --largura: 212px;
}
/* O draft tem de caber inteiro, mesmo com vários jovens na formação: as cartas encolhem com o espaço. */
.sobre-relvado:has(.draft-layout) {
  width: min(96%, 1180px);
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-height: 96%;
}
.draft-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 16px;
  min-width: 0;
}
.draft-layout .opcoes {
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}
.draft-layout .carta {
  --largura: clamp(112px, 13vw, 190px);
}
.draft-formacao {
  flex: 0 1 auto;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--panel-border);
}
.draft-formacao .carta {
  --largura: clamp(84px, 8.5vw, 124px);
}
@media (max-width: 760px) {
  .draft-layout {
    flex-direction: column;
    align-items: center;
  }
  .draft-formacao {
    padding-left: 0;
    border-left: 0;
  }
}
.draft-formacao .rotulo {
  margin-bottom: 6px;
}
.draft-formacao-cartas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.carta-clicavel {
  cursor: pointer;
  transition: transform 0.12s;
}
.carta-clicavel:hover {
  transform: translateY(-3px);
}
.info-esquerda {
  align-items: flex-start;
  text-align: left;
  gap: 4px;
}
.info-esquerda .linha-botoes {
  margin-top: 6px;
}
.adversario {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adversario div {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.adversario strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
}
.adversario small {
  color: var(--muted);
}
.sobre-relvado .destaque-carta {
  flex-wrap: nowrap;
}
.sobre-relvado .opcoes {
  flex-wrap: nowrap;
}
.sobre-relvado .segmentos {
  flex-wrap: wrap;
}
@keyframes aparecer-relvado {
  from { opacity: 0; transform: translate(-50%, 12px); }
}
.sem-3d .col-tabuleiro {
  position: static;
}
.sem-3d .centro-tabuleiro {
  overflow-y: auto;
}
.sem-3d .sobre-relvado {
  position: static;
  transform: none;
  width: auto;
  max-height: none;
  margin-top: 8px;
  animation: none;
}
.relvado-2d {
  display: block;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  border-radius: 12px;
}

/* --- Os treinadores à volta do tabuleiro --- */
.chip-caixa {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.chip-equipa {
  width: 100%;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel-forte);
  text-align: left;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s;
}
.chip-equipa:hover {
  transform: scale(1.03);
  border-color: var(--destaque-borda);
}
.chip-equipa.vez {
  border-color: var(--destaque);
  box-shadow: 0 0 14px var(--destaque-brilho);
}
.chip-equipa.desligado {
  opacity: 0.55;
}
.chip-texto {
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.chip-texto small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.chip-texto strong {
  font-size: 15px;
  overflow-wrap: break-word;
}
.chip-orcamento {
  padding: 0 8px;
  border-radius: 6px;
  background: #06140dcc;
  font-family: var(--display);
  font-size: 16px;
  color: var(--destaque-2);
  white-space: nowrap;
}
.chip-moedas {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  margin-top: 2px;
}
.chip-moedas:empty {
  display: none;
}
.moeda {
  display: block;
  flex: none;
}
.moeda-canto {
  position: absolute;
  top: 2%;
  right: 2%;
  z-index: 3;
  width: 24%;
  filter: drop-shadow(0 1px 2px #000a);
}
.moeda-canto .moeda {
  width: 100%;
  height: auto;
}
.carta:has(.moeda-canto) .carta-tags {
  top: 21%;
}

/* --- Durante os jogos --- */
.lado-jogo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px;
  min-height: 0;
}
.lado-jogo p {
  margin: 0;
}
.lado-jogo-topo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  cursor: pointer;
}
.lado-contratos {
  font-size: 11px;
}
/* Se faltar altura, só a lista desliza: o aviso, a substituição e as fichas ficam sempre à vista. */
.lado-jogo .lista-jogadores {
  display: block;
  flex: 0 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
  margin: 0;
  gap: 2px;
}
.lado-jogo .linha-jog {
  margin-bottom: 2px;
  padding: 1px 4px;
  font-size: 12px;
}
.lado-jogo .mini-ovr {
  width: 24px;
  height: 18px;
  font-size: 12px;
}

/* --- A barra de baixo --- */
.barra-equipa {
  flex: none;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 12px;
  background: #020a06f2;
  border-top: 1px solid var(--panel-border);
  min-height: 70px;
}
.barra-clube {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.barra-clube-texto {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.barra-clube-texto strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.barra-clube-texto small {
  color: var(--muted);
  white-space: nowrap;
}
.barra-contratos {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 1 auto;
  min-width: 0;
}
.barra-lista-contratos {
  display: flex;
  gap: 6px;
  min-width: 0;
}
.barra-contrato {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
}
button.barra-contrato {
  cursor: zoom-in;
}
button.barra-contrato.ampliado {
  z-index: 2;
  cursor: zoom-out;
}
.barra-contrato-logo {
  width: 54px;
  height: 54px;
  object-fit: contain;
  transform-origin: bottom center;
  transition: transform 0.18s ease-out;
}
.barra-contrato:hover .barra-contrato-logo {
  transform: scale(1.08);
}
.barra-contrato.ampliado .barra-contrato-logo {
  transform: scale(2);
}
.barra-contrato-info {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 9px;
  border: 1px solid var(--destaque-borda);
  border-radius: 8px;
  background: var(--panel-forte);
  box-shadow: 0 6px 18px #0008;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
}
.barra-contrato:hover .barra-contrato-info,
.barra-contrato:focus-visible .barra-contrato-info,
.barra-contrato.ampliado .barra-contrato-info {
  display: flex;
}
.barra-contrato.ampliado .barra-contrato-info {
  bottom: calc(200% + 6px);
}
.barra-contrato-texto {
  flex: 0 1 76px;
  min-width: 0;
  min-height: 44px;
  padding: 3px 6px;
  border-radius: 8px;
  background: #ffffff12;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}
.barra-contrato-texto > span:first-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.moedas-orcamento {
  vertical-align: -3px;
  margin-right: 4px;
}
.barra-orcamento {
  font-family: var(--display);
  font-weight: 400;
  font-size: 20px;
  color: var(--destaque-2);
}
.barra-contratos small {
  color: var(--destaque-2);
  font-size: 11px;
  white-space: nowrap;
}
.valor-contrato {
  color: var(--destaque-2);
}
.barra-moedas {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  max-width: 120px;
}
.barra-moedas:empty,
.barra-redes:empty {
  display: none;
}
.barra-redes {
  display: flex;
  gap: 5px;
}
.carta-rede {
  width: 46px;
  height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  border: 2px solid #2563eb;
  border-radius: 6px;
  background: #fff;
  color: #1e3a8a;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  line-height: 1.05;
  overflow: hidden;
}
.carta-rede small {
  font-size: 8px;
  font-weight: 600;
}
.barra-acao {
  flex: 0 1 auto;
  margin-left: auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px 12px;
}
.barra-sancao {
  flex: none;
  padding: 4px 8px;
  border: 1px solid #fca5a566;
  border-radius: 8px;
  background: #dc26262e;
  font-size: 12px;
  font-weight: 800;
}
.btn-branco {
  background: #fff;
  color: #111;
  font-family: var(--display);
  font-weight: 400;
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.btn-branco:hover:not(:disabled) {
  filter: brightness(0.92);
}
.btn-branco:disabled {
  opacity: 0.45;
}
.btn.a-piscar {
  animation: piscar-botao 0.9s ease-in-out infinite;
}
@keyframes piscar-botao {
  50% { box-shadow: 0 0 22px 6px #fff; transform: scale(1.05); }
}
.barra-equipa {
  position: relative;
  z-index: 6;
}
.barra-equipa.minha-vez {
  animation: brilho-vez 1.6s ease-in-out infinite;
}
@keyframes brilho-vez {
  0%, 100% { box-shadow: 0 -2px 12px color-mix(in srgb, var(--cor-equipa) 55%, transparent), inset 0 2px 0 var(--cor-equipa); }
  50% { box-shadow: 0 -6px 34px var(--cor-equipa), inset 0 2px 0 var(--cor-equipa); }
}
.soma-dados,
.titulo-casa {
  position: absolute;
  z-index: 4;
  left: 50%;
  top: 50%;
  margin: 0;
  transform: translate(-50%, -50%);
  font-family: var(--display);
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 6px 24px #000c;
  pointer-events: none;
}
.soma-dados[hidden],
.titulo-casa[hidden] {
  display: none;
}
.soma-dados {
  font-size: 120px;
  color: #fff;
  animation: aparecer-grande 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.titulo-casa {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 22px 44px;
  border-radius: 18px;
  border: 3px solid #fff8;
  box-shadow: 0 20px 60px #000b;
  font-size: clamp(36px, 7vw, 76px);
  white-space: nowrap;
  color: #fff;
  animation: aparecer-grande 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
@keyframes aparecer-grande {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
}
.lance-linha {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.lance-linha .btn {
  width: auto;
}
.notificacoes {
  position: fixed;
  z-index: 7;
  left: 12px;
  bottom: calc(var(--altura-barra, 80px) + 10px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.notificacao {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 360px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--destaque-borda);
  border-radius: 14px;
  background: var(--panel-forte);
  box-shadow: 0 12px 30px #000a;
  animation: notificacao-entra 0.35s ease-out;
}
.notificacao p {
  margin: 2px 0 0;
  font-size: 13px;
}
.notificacao strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 22px;
}
.notificacao-carta .carta {
  --largura: 92px;
}
.notificacao-entrou {
  border-color: #86efac99;
}
.notificacao-saiu {
  border-color: var(--destaque-borda);
}
.notificacao-roubo {
  border-color: #fff8;
  background: var(--fundo-empresario) center / cover;
  color: #2b1a0e;
}
.notificacao-casa {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 2px;
  font-family: var(--display);
  font-size: 15px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
@keyframes notificacao-entra {
  from { opacity: 0; transform: translateY(16px); }
}
.barra-acao .btn {
  flex: none;
  width: auto;
}
.barra-dica {
  flex: 0 1 240px;
  min-width: 140px;
  margin: 0;
  font-size: 12px;
  line-height: 1.25;
}
.barra-andadas {
  color: var(--destaque-2);
  font-weight: 700;
}
.barra-plantel {
  display: flex;
  align-items: center;
  gap: 12px;
}
.barra-plantel .btn {
  width: auto;
}
.barra-formacao {
  flex: none;
  white-space: nowrap;
  font-family: var(--display);
  font-size: 22px;
}
.barra-relato {
  min-height: 48px;
  gap: 12px;
}
.barra-relato .rotulo {
  flex: none;
  margin: 0;
}
.jogos-direto {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 18px;
}
.jogo-direto {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.jogo-direto strong {
  font-family: var(--display);
  font-weight: 400;
  font-size: 17px;
  color: var(--destaque-2);
}
.jogo-direto small {
  color: var(--muted);
  font-size: 11px;
}

/* --- Por baixo das equipas, durante o jogo --- */
.caixa-lance,
.registo-jogo {
  flex: none;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.caixa-lance[hidden],
.registo-jogo[hidden] {
  display: none;
}
.dados-3d {
  position: relative;
  height: 192px;
}
.coluna-esq .caixa-lance {
  margin-top: auto;
}
.dados-rotulo {
  position: absolute;
  left: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  max-width: 100%;
  font-size: 11px;
  font-weight: 800;
  color: var(--destaque-2);
  pointer-events: none;
}
.dados-rotulo.cima {
  top: 0;
}
.dados-rotulo.baixo {
  top: calc(50% + 2px);
}
.dados-3d::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: calc(50% - 2px);
  border-top: 1px solid var(--panel-border);
}
.dados-2d {
  position: absolute;
  inset: 22px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
.dados-3d canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}
.lance-acoes {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.lance-acoes p {
  margin: 0;
}
.registo-jogo {
  flex: 1;
  min-height: 90px;
  overflow: hidden;
}
.registo-jogo .rotulo {
  margin: 0;
}
.registo-jogo .relato li {
  display: flex;
  align-items: flex-start;
  gap: 5px;
}
.registo-jogo .relato .emblema {
  flex: none;
}
.registo-jogo .relato {
  flex: 1;
  min-height: 0;
  margin: 0;
  max-height: none;
  overflow-y: auto;
  font-size: 12px;
}
.icone-lesao {
  flex: none;
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: var(--vermelho);
  color: #fff;
  font-size: 11px;
  line-height: 1;
}
.linha-lesionado .linha-nome {
  color: #fca5a5;
}
.aviso-lesao {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 5px 8px;
  border: 1px solid #fca5a566;
  border-radius: 8px;
  background: #dc26262e;
  font-size: 12px;
  line-height: 1.25;
}
.aviso-lesao p {
  margin: 0;
}
.emprestados-novos {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.fichas-lesao .rotulo {
  margin: 2px 0;
}
.fichas-lista {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.ficha-lesao {
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.ficha-lesao:disabled {
  opacity: 0.45;
  cursor: default;
}
.ficha-lesao:not(:disabled) {
  animation: pulsar 1.2s ease-in-out infinite;
}
.bola-golo {
  display: inline-flex;
  align-items: center;
  gap: 1px;
  flex: none;
  font-size: 11px;
  font-weight: 800;
  color: var(--destaque-2);
}

/* --- O resultado, fora do estádio --- */
.marcador-jogo {
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: start;
  gap: 2px 14px;
  padding: 4px 12px;
  border-radius: 12px;
  background: #06140de6;
  border: 1px solid var(--panel-border);
}
.marcador-jogo[hidden] {
  display: none;
}
/* Tudo junto ao centro: emblema e nome colados ao resultado; os marcadores usam o resto da largura. */
.marcador-lado {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.marcador-lado:first-child {
  align-items: flex-end;
  text-align: right;
}
.marcador-lado:first-child .marcador-nome {
  flex-direction: row-reverse;
}
.marcador-lado:last-of-type {
  align-items: flex-start;
  text-align: left;
}
.marcador-nome {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.marcador-nome strong {
  font-size: 15px;
  overflow-wrap: break-word;
}
.marcador-lado small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}
.marcador-centro {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}
.marcador-golos {
  font-family: var(--display);
  font-size: 30px;
  white-space: nowrap;
}
.marcador-tempo {
  margin-top: 7px;
  color: var(--destaque-2);
  font-size: 18px;
  font-weight: 800;
}
.marcador-centro small {
  color: var(--muted);
  font-size: 11px;
}
.marcador-homem {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
.celula-equipa {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --- A carta em grande --- */
.dialogo-carta {
  width: min(92vw, 400px);
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
}
.dialogo-carta[open] {
  animation: carta-sai 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
@keyframes carta-sai {
  from { opacity: 0; transform: scale(0.4) rotateX(70deg); }
}
.carta-sorte > .btn,
.carta-sorte .carta-espera,
.carta-sorte-botoes {
  margin-top: auto;
}
.carta-sorte-botoes {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rede-painel {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 12px;
  border-radius: 12px;
  background: #fff;
  color: #0b1f57;
  box-shadow: 0 8px 22px #0005;
}
.rede-desconto {
  font-family: var(--display);
  font-size: 58px;
  line-height: 1;
  color: #1d4ed8;
}
.rede-liga {
  font-family: var(--display);
  font-size: 40px;
  line-height: 1.05;
}
.rede-bandeira {
  width: 120px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px #0003, 0 4px 12px #0003;
}
.dialogo-carta:has(.slot-maquina) {
  width: min(94vw, 560px);
}
.slot-rolos {
  display: flex;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #0007;
  box-shadow: inset 0 0 0 2px #fbe39a55;
}
.slot-rolo {
  width: 110px;
  height: 120px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(180deg, #d9d9d9, #fff 35%, #fff 65%, #d9d9d9);
  font-size: 66px;
  line-height: 1;
}
.slot-rolo.parado {
  animation: rolo-para 0.3s ease-out;
}
@keyframes rolo-para {
  40% { transform: translateY(6px); }
}
.slot-resultado {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  animation: aparecer-resultado 0.4s ease-out;
}
.slot-resultado[hidden] {
  display: none;
}
@keyframes aparecer-resultado {
  from { opacity: 0; transform: scale(0.8); }
}
.slot-acusacao {
  font-family: var(--display);
  font-size: 30px;
  line-height: 1.1;
  text-transform: uppercase;
  color: #fecaca;
}
.slot-sentenca {
  font-size: 20px;
  font-weight: 800;
}
.slot-resultado .btn {
  width: 100%;
}
.carta-sorte {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 460px;
  justify-content: flex-start;
  padding: 26px 22px;
  border-radius: 20px;
  border: 3px solid #fff5;
  background: #0c2016;
  text-align: center;
  box-shadow: 0 24px 60px #000c;
}
.carta-sorte p {
  margin: 0;
}
.carta-sorte .rotulo,
.carta-sorte .nota {
  color: inherit;
  opacity: 0.88;
}
.simbolo-casa {
  flex: none;
  filter: drop-shadow(0 3px 6px #0005);
}
.carta-sorte .btn {
  width: 100%;
  margin-top: 6px;
}
.carta-sorte-titulo {
  margin: 0;
  font-family: var(--display);
  font-weight: 400;
  font-size: 36px;
  line-height: 1.05;
  text-transform: uppercase;
}
.carta-sorte-misterio { background: var(--fundo-misterio) center / cover; color: #fff; }
.carta-sorte-investigacao { background: var(--fundo-investigacao) center / cover; color: #fff; }
.carta-sorte-rede { background: var(--fundo-rede) center / cover; color: #fff; }
.carta-sorte-empresario { background: var(--fundo-empresario) center / cover; color: #2b1a0e; }
.carta-sorte-medico { background: var(--fundo-medico) center / cover; color: #fff; }
.titulo-casa-mercado { background: var(--fundo-mercado) center / cover; }
.titulo-casa-jovens { background: var(--fundo-jovens) center / cover; }
.painel-titulo.cabecalho-casa {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -4px -4px 12px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: 22px;
  color: #fff;
}
.cabecalho-mercado { background: var(--fundo-mercado) center / cover; }
.cabecalho-jovens { background: var(--fundo-jovens) center / cover; }
.cabecalho-rede { background: var(--fundo-rede) center / cover; }
.cabecalho-patrocinio { background: var(--fundo-patrocinio) center / cover; }
.painel-titulo.cabecalho-empresario { background: var(--fundo-empresario) center / cover; color: #2b1a0e; }
.carta-evento.evento-patrocinio {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  border-color: #fff5;
  background: var(--fundo-patrocinio) center / cover;
  color: #fff;
}
.patrocinio-logo {
  flex: none;
  width: 150px;
  height: 150px;
  object-fit: contain;
}
.evento-patrocinio .rotulo {
  color: inherit;
  opacity: 0.88;
}
.sorte-ma {
  border-color: #fca5a5aa;
}

/* --- Menu --- */
.menu-jogo {
  position: relative;
}
.menu-jogo summary {
  list-style: none;
  cursor: pointer;
}
.menu-jogo summary::-webkit-details-marker {
  display: none;
}
.menu-lista {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  right: 0;
  width: 230px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: var(--panel-forte);
  box-shadow: 0 12px 30px #000a;
}
.menu-volume {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.menu-volume input {
  flex: 1;
  min-width: 0;
  accent-color: var(--destaque);
}
.menu-anfitriao {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.menu-anfitriao:not(:empty) {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.menu-anfitriao .rotulo {
  margin: 0;
}
.dialogo-registo {
  width: min(94vw, 560px);
  max-height: 86dvh;
}
.dialogo-registo .dialogo-corpo {
  overflow-y: auto;
}

/* --- Telemóvel: o tabuleiro em cima, tudo o resto a deslizar por baixo --- */
@media (max-width: 800px) {
  .palco,
  .palco.em-jogo {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 4px 8px;
  }
  .centro {
    display: contents;
  }
  .marcador-jogo {
    order: 0;
  }
  .col-tabuleiro {
    order: 1;
  }
  .equipas-topo {
    order: 2;
  }
  .centro-tabuleiro {
    order: 3;
  }
  .coluna-lado {
    order: 4;
    flex: none;
  }
  .equipas-lado {
    flex: none;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: flex-start;
    overflow: visible;
  }
  .equipas-lado:empty {
    display: none;
  }
  .equipas-lado .chip-caixa,
  .equipas-topo .chip-caixa {
    flex: 1 1 45%;
  }
  .equipas-lado .lado-jogo {
    flex: 1 1 100%;
  }
  .registo-jogo {
    max-height: 200px;
  }
  .coluna-esq .caixa-lance {
    order: -1;
    margin-top: 0;
  }
  .centro-tabuleiro {
    position: relative;
    flex: none;
    height: auto;
  }
  .col-tabuleiro {
    position: relative;
    inset: auto;
    flex: none;
    height: 66vw;
    max-height: 44dvh;
  }
  .legenda-vez {
    position: static;
    order: 0;
    margin: 0;
    width: fit-content;
  }
  .legenda-vez {
    font-size: 12px;
  }
  .sobre-relvado {
    position: static;
    transform: none;
    width: auto;
    max-height: none;
    overflow: visible;
    margin-top: 6px;
    animation: none;
  }
  .sobre-relvado .destaque-carta,
  .sobre-relvado .opcoes,
  .draft-layout {
    flex-wrap: wrap;
  }
  .draft-formacao {
    max-width: none;
    padding-left: 0;
    border-left: 0;
  }
  .barra-equipa {
    flex-wrap: wrap;
    gap: 6px 10px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    min-height: 0;
  }
  .barra-lista-contratos,
  .barra-dica {
    display: none;
  }
  .barra-clube .equipamento {
    display: none;
  }
  .barra-clube .emblema {
    width: 34px;
    height: 34px;
  }
  .barra-clube-texto strong {
    font-size: 16px;
  }
  .barra-acao {
    order: 5;
    flex-basis: 100%;
  }
  .barra-acao:empty {
    display: none;
  }
  .barra-acao .btn {
    flex: 1;
  }
  .barra-plantel {
    margin-left: auto;
    gap: 6px;
  }
  .barra-formacao {
    font-size: 16px;
  }
  .barra-plantel .btn {
    padding: 6px 12px;
    min-height: 0;
  }
  .barra-moedas svg {
    width: 20px;
    height: 20px;
  }
  .carta-rede {
    width: 34px;
    height: 42px;
    font-size: 9px;
  }
  .carta-rede small {
    display: none;
  }
}

/* --- Tabuleiro --- */
.tabuleiro {
  display: grid;
  grid-template-columns: repeat(var(--celas), minmax(0, 1fr));
  grid-template-rows: repeat(var(--celas), minmax(0, 1fr));
  aspect-ratio: 1;
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  gap: 2px;
  padding: 6px;
  border-radius: 16px;
  background: linear-gradient(180deg, #2a1812, var(--castanho));
  border: 1px solid var(--destaque-borda);
  box-shadow: 0 20px 50px #0008;
}
.casa {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
  border-radius: 4px;
  background: #f4ead8;
  color: #2b1a0e;
  padding: 2px;
  border-top: 5px solid var(--cor-casa, #8a6a4f);
}
.casa-rotulo {
  text-transform: uppercase;
  font-size: clamp(6px, 1.05vw, 10px);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}
.casa-canto .casa-rotulo {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(8px, 1.4vw, 14px);
}
.casa-mercado { --cor-casa: #bb8550; }
.casa-rede { --cor-casa: #2f6ff0; }
.casa-empresario { --cor-casa: #f0bc42; }
.casa-medico { --cor-casa: #1db056; }
.casa-patrocinio { --cor-casa: #8b45f5; }
.casa-jovens { --cor-casa: #f76512; }
.casa-misterio { --cor-casa: #ee3a8c; background: #fbe4ef; }
.casa-sad { --cor-casa: #01203e; background: #d7e2ee; }
.casa-investigacao { --cor-casa: #a81f1f; background: #f6dcd6; }
.casa-inicio { --cor-casa: #41261f; background: #fff6e3; }
.fichas {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}
.ficha {
  width: clamp(7px, 1.4vw, 13px);
  height: clamp(7px, 1.4vw, 13px);
  border-radius: 50%;
  background: var(--c1);
  border: 2px solid var(--c2);
  box-shadow: 0 1px 2px #0008;
}
.ficha-vez {
  outline: 2px solid #111;
  animation: pulsar 1.2s ease-in-out infinite;
}
.tabuleiro-centro {
  grid-area: 2 / 2 / var(--celas) / var(--celas);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  border-radius: 10px;
  background:
    radial-gradient(70% 70% at 50% 45%, #1a5a37 0%, #0d2a1b 100%);
  color: var(--text);
  padding: 8px;
}
.centro-logo {
  opacity: 0.85;
}
.centro-vez {
  margin: 0;
  font-size: clamp(11px, 1.8vw, 16px);
}
.dados {
  display: flex;
  gap: 10px;
}
.dado {
  width: clamp(30px, 6vw, 48px);
  height: clamp(30px, 6vw, 48px);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 15%;
  border-radius: 18%;
  background: #fbf8ef;
  box-shadow: inset 0 -3px 0 #0003, 0 4px 10px #0006;
  animation: bater 0.3s ease-out;
}
.dado i.p {
  width: 70%;
  height: 70%;
  margin: auto;
  border-radius: 50%;
  background: #2b1a0e;
}

/* --- Painel de ação --- */
.opcoes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.opcao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.destaque-carta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}
.leilao-info {
  flex: 1;
  min-width: 150px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.valor-grande {
  font-family: var(--display);
  font-size: 36px;
  line-height: 1;
  color: var(--destaque-2);
}
.lance {
  display: flex;
  gap: 8px;
}
.lance .campo {
  max-width: 140px;
}
.progresso {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.anfitriao {
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

/* --- Listas de jogadores --- */
.lista-jogadores {
  list-style: none;
  margin: 6px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.linha-jog {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 8px;
  background: #ffffff08;
  cursor: pointer;
  font-size: 13px;
}
.linha-jog:hover {
  background: #ffffff12;
}
.linha-nome {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.linha-nome small {
  color: var(--muted);
  font-weight: 600;
}
.linha-sub {
  display: none;
}
.linha-pos {
  width: 34px;
  flex: none;
  font-weight: 800;
  font-size: 11px;
  color: var(--destaque-2);
}
.linha-valor {
  flex: none;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.linha-tags {
  display: flex;
  gap: 3px;
}
.tag {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 5px;
  border-radius: 5px;
  background: #ffffff14;
  color: var(--muted);
  white-space: nowrap;
}
.tag-onze {
  background: var(--castanho);
  color: var(--destaque-2);
}
.mini-ovr {
  flex: none;
  width: 28px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  font-family: var(--display);
  font-size: 14px;
  color: #2b1a0e;
  background: #d8dde3;
}
.mini-bronze { background: linear-gradient(180deg, #e0a66c, #a8693a); }
.mini-prata { background: linear-gradient(180deg, #eef1f4, #a7b0ba); }
.mini-ouro { background: linear-gradient(180deg, #f7dc8a, #c8963a); }
.mini-ouro-brilho { background: linear-gradient(180deg, #fff0b3, #c8963a); }
.mini-ciano { background: linear-gradient(180deg, #a5f3fc, #22b8cf); color: #04262c; }
.linha-fecho input[type='checkbox'] {
  width: 18px;
  height: 18px;
  accent-color: var(--destaque);
}

/* --- Coluna lateral --- */
.separadores {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.separador-btn {
  flex: 1;
  border: 1px solid #ffffff1f;
  background: #00000040;
  border-radius: 10px;
  padding: 7px;
  font-weight: 800;
  cursor: pointer;
}
.separador-btn[aria-selected='true'] {
  border-color: var(--destaque);
  background: var(--destaque-suave);
}
.equipa-lado {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 6px;
  background: #ffffff08;
  text-align: left;
  cursor: pointer;
}
.equipa-lado:hover {
  background: #ffffff14;
}
.equipa-lado.eu {
  box-shadow: inset 0 0 0 1px var(--destaque-borda);
}
.equipa-lado .quem {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.equipa-lado .quem small {
  color: var(--muted);
  font-size: 12px;
}

/* --- Carta Mistério / Investigação --- */
.carta-evento {
  border-radius: 12px;
  padding: 10px 12px;
  border: 1px solid;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.evento-bom {
  border-color: #86efac66;
  background: #16a34a1f;
}
.evento-mau {
  border-color: #fca5a566;
  background: #dc26261f;
}
.evento-titulo {
  font-family: var(--display);
  font-size: 22px;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.evento-detalhe {
  font-weight: 800;
}

/* --- Campeonato --- */
.placar-jogo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #ffffff0a;
}
.placar-equipa {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-weight: 700;
  font-size: 13px;
}
.placar-equipa span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.placar-equipa.fora {
  justify-content: flex-end;
  text-align: right;
}
.placar-golos {
  font-family: var(--display);
  font-size: 28px;
  line-height: 1;
  color: var(--destaque-2);
}
.placar-penaltis {
  display: block;
  font-family: var(--body);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
}
.dados-jogo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  justify-items: center;
}
.dados-jogo .dado {
  width: 34px;
  height: 34px;
}
.relato {
  max-height: 260px;
  overflow-y: auto;
}

/* --- Diálogo da equipa: o onze no campo --- */
/* Sem scroll: o campo encolhe para caber o plantel todo na janela. */
.dialogo-equipa[open] {
  animation: zoom-equipa 0.28s cubic-bezier(0.2, 0.9, 0.3, 1.15);
}
@keyframes zoom-equipa {
  from { opacity: 0; transform: scale(0.25); }
}
.equipa-contratos {
  flex: none;
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 1px 10px;
  margin: 0;
  font-size: 13px;
}
.equipa-contratos dt {
  color: var(--muted);
  font-weight: 700;
}
.equipa-contratos dd {
  margin: 0;
  font-weight: 700;
}
.dialogo-equipa {
  width: min(96vw, 560px);
  height: calc(100dvh - 16px);
  max-height: calc(100dvh - 16px);
  overflow: hidden;
}
.dialogo-equipa[open] {
  display: flex;
  flex-direction: column;
}
.dialogo-equipa .dialogo-cabecalho {
  flex: none;
  padding: 8px 12px 8px 14px;
}
.equipa-info {
  flex: none;
  font-size: 12px;
  line-height: 1.3;
}
.campo-caixa {
  flex: 1;
  min-height: 0;
  container-type: size;
  display: grid;
  place-items: center;
}
.banco {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.banco .rotulo {
  margin: 0;
}
.equipa-titulo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.equipa-titulo .titulo {
  font-size: clamp(22px, 5vw, 32px);
}
.equipa-titulo .nota {
  margin: 0;
}
.dialogo-equipa .dialogo-corpo {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 12px 10px;
}
.dialogo-equipa .btn {
  flex: none;
}
.avisos-equipa {
  flex: none;
  margin: 0;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--destaque-suave);
  font-size: 12px;
}
.campo-jogo {
  position: relative;
  container-type: inline-size;
  width: min(100cqw, calc(100cqh * 0.78));
  aspect-ratio: 0.78;
  border-radius: 12px;
  overflow: hidden;
  background: repeating-linear-gradient(180deg, #1c6b40 0 12.5%, #186139 12.5% 25%);
  border: 2px solid #ffffff4d;
}
.campo-linhas i {
  position: absolute;
  border: 2px solid #ffffff40;
}
.campo-linhas .meio {
  left: 0;
  right: 0;
  top: 50%;
  border-width: 2px 0 0;
}
.campo-linhas .circulo {
  left: 50%;
  top: 50%;
  width: 26%;
  aspect-ratio: 1;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.campo-linhas .area {
  left: 22%;
  right: 22%;
  height: 15%;
}
.campo-linhas .cima {
  top: -2px;
}
.campo-linhas .baixo {
  bottom: -2px;
}
.lugar {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 17cqw;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
}
.mini-carta {
  position: relative;
  width: 100%;
  aspect-ratio: 0.78;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-radius: 7px;
  overflow: hidden;
  border: 1px solid var(--c-claro);
  background: var(--c-base);
  color: var(--c-texto);
  box-shadow: 0 3px 8px #0009;
}
.mini-carta-ovr {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  padding: 1px 4px;
  border-radius: 0 0 6px 0;
  background: var(--c-base);
  font-family: var(--display);
  font-size: clamp(13px, 3.6cqw, 22px);
  line-height: 1;
}
.mini-carta-foto {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.mini-carta-foto::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 52%, var(--c-base) 84%);
}
.mini-carta-foto .carta-silhueta {
  width: 62%;
  margin-bottom: 18%;
}
.mini-carta-nome {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0 2px 1px;
  text-align: center;
  font-size: clamp(8px, 2.1cqw, 12px);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-carta-tag {
  position: absolute;
  top: 2%;
  right: 2%;
  z-index: 1;
  padding: 0 3px;
  border-radius: 3px;
  background: var(--castanho);
  color: var(--destaque-2);
  font-size: clamp(7px, 1.6cqw, 10px);
  font-weight: 800;
  text-transform: uppercase;
}
.mini-carta-valor {
  padding: 0 4px;
  border-radius: 4px;
  background: #000a;
  color: #fff;
  font-size: clamp(8px, 2cqw, 12px);
  font-weight: 700;
  white-space: nowrap;
}
.mini-vazia {
  display: grid;
  place-items: center;
  justify-content: center;
  background: #00000040;
  border: 1.5px dashed #ffffff66;
  color: #ffffffb3;
  font-weight: 800;
  font-size: clamp(9px, 2.4cqw, 13px);
  box-shadow: none;
}
.fora-onze {
  display: grid;
  grid-template-columns: repeat(var(--colunas, 1), minmax(0, 60px));
  justify-content: center;
  gap: 4px;
}
.foto-jogador {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
}
.lugar-fora {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  cursor: pointer;
}

/* --- O plantel: sobe de baixo e ocupa o ecrã --- */
.dialogo-plantel {
  position: fixed;
  z-index: 5;
  inset: 48px 0 0 auto;
  width: min(100vw, 560px);
  max-width: 100vw;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0 0 var(--altura-barra, 80px);
  border-radius: 18px 0 0 0;
  overflow: hidden;
}
.dialogo-plantel[open] {
  display: flex;
  flex-direction: column;
  animation: subir-plantel 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btn-minimizar {
  flex: none;
  align-self: center;
  width: 64px;
  height: 26px;
  border: 0;
  border-radius: 0 0 10px 10px;
  background: var(--destaque-suave);
  color: var(--text);
  font-size: 22px;
  line-height: 0.7;
  cursor: pointer;
}
@keyframes subir-plantel {
  from { transform: translateY(100%); }
}
.plantel-corpo {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 12px 10px;
}
.dialogo-plantel .campo-caixa {
  flex: 1;
  min-height: 0;
  height: auto;
  padding-block: 14px;
}
.dialogo-plantel .campo-jogo {
  width: 100cqw;
  height: 100cqh;
  aspect-ratio: auto;
}
/* A carta mede-se também pela altura do campo: assim a primeira e a última fila nunca ficam cortadas. */
.dialogo-plantel .lugar {
  width: min(19cqw, 16cqh);
}
.plantel-fecho {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.plantel-fecho p {
  margin: 0;
}
.plantel-fecho .btn {
  flex: none;
  width: auto;
}
.banco-jogador {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  width: 84px;
}
.banco-banca {
  font-size: 10px;
  white-space: nowrap;
}
.plantel-banco-caixa p {
  margin: 0;
}
.plantel-dica {
  margin: 0;
  text-align: center;
  font-size: 12px;
}
.plantel-banco {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
}
.plantel-banco .lugar-fora {
  width: 100%;
}
.lugar-editavel {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: grab;
  border-radius: 8px;
  touch-action: none;
  user-select: none;
}
.lugar-editavel.arrastado {
  opacity: 0.3;
}
.fantasma-arrasto {
  cursor: grabbing;
  filter: drop-shadow(0 8px 12px #000c);
  container-type: inline-size;
}
.lugar-editavel.selecionado {
  outline: 3px solid var(--destaque-claro);
  outline-offset: 1px;
  z-index: 2;
}
.lugar-editavel.valido {
  outline: 2px dashed var(--verde);
  outline-offset: 1px;
}
.lugar-editavel.invalido {
  opacity: 0.2;
}
.lugar-pos {
  padding: 0 4px;
  border-radius: 4px;
  background: #000a;
  color: var(--destaque-2);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}
.lugar-alt {
  position: absolute;
  top: 0;
  right: 0;
  padding: 0 3px;
  border-radius: 4px;
  background: var(--vermelho);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}
.linha-troca {
  width: 100%;
  border: 0;
  color: inherit;
  text-align: left;
}
.troca-lista {
  max-height: 55dvh;
  overflow-y: auto;
}
@media (max-width: 800px) {
  .plantel-corpo {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 0.55fr);
  }
  .plantel-banco {
    grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  }
}
/* O banco fica ao lado do campo, em fila vertical. Mais jogadores abrem colunas à esquerda e alargam a janela. */
.plantel-banco-caixa.alvo-banco {
  outline: 2px dashed var(--verde);
  outline-offset: 2px;
  border-radius: 8px;
}
.plantel-falta {
  color: var(--destaque-claro);
}
@media (min-width: 801px) {
  .dialogo-plantel {
    width: min(100vw, calc(580px + var(--colunas-banco, 1) * 94px));
  }
  .plantel-corpo {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr) auto auto;
    column-gap: 12px;
    row-gap: 6px;
  }
  .plantel-banco-caixa {
    grid-column: 1;
    grid-row: 1 / -1;
    min-width: 84px;
  }
  .plantel-banco {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--linhas-banco, 4), auto);
    justify-content: end;
    align-content: start;
    gap: 8px 10px;
    direction: rtl;
  }
  .banco-jogador {
    direction: ltr;
  }
  .dialogo-plantel .campo-caixa,
  .plantel-dica,
  .plantel-fecho {
    grid-column: 2;
    min-width: 0;
  }
}

/* --- Diálogos --- */
.dialogo-jogador {
  width: min(94vw, 640px);
}
.jogador-detalhe {
  display: grid;
  grid-template-columns: min-content minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.jogador-acoes {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ficha-jogador {
  font-size: 14px;
}
.ficha-jogador dl {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 4px 12px;
  margin: 0;
}
.confirma-venda p {
  margin: 0 0 8px;
}
.ficha-jogador hr {
  margin: 10px 0;
  border: 0;
  border-top: 1px solid var(--panel-border);
}
.ficha-jogador dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ficha-jogador dd {
  margin: 0;
  font-weight: 700;
}
.troca-colunas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-height: 55dvh;
  overflow-y: auto;
  margin-bottom: 12px;
}
@media (max-width: 520px) {
  .jogador-detalhe,
  .troca-colunas {
    grid-template-columns: minmax(0, 1fr);
  }
  .jogador-detalhe .carta {
    margin: 0 auto;
  }
}

/* --- Carta de jogador: retangular, com a foto a ocupar a carta e a desvanecer para a cor do nível --- */
.carta {
  --largura: 190px;
  position: relative;
  width: var(--largura);
  aspect-ratio: 0.7;
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  /* Em relação à largura da carta: uma percentagem aqui contaria sobre o elemento-pai. */
  padding: 0 calc(var(--largura) * 0.05) calc(var(--largura) * 0.04);
  overflow: hidden;
  border-radius: 12px;
  border: 2px solid var(--c-claro);
  color: var(--c-texto);
  background: var(--c-base);
  font-size: calc(var(--largura) / 11.5);
  box-shadow: 0 6px 14px #0008;
}
.carta-pequena { --largura: 158px; }
.carta-grande { --largura: 240px; }
.carta-bronze { --c-claro: #e7b07a; --c-base: #b9814f; --c-texto: #2b1a0e; }
.carta-prata { --c-claro: #f4f6f8; --c-base: #c3cbd3; --c-texto: #2b1a0e; }
.carta-ouro,
.carta-ouro-brilho { --c-claro: #fbe39a; --c-base: #dfb75c; --c-texto: #2b1a0e; }
.carta-ciano { --c-claro: #cffafe; --c-base: #22b8cf; --c-texto: #04262c; }
/* Brilho: leve e dourado de 84 a 87, forte a partir de 88. */
.carta-ouro-brilho::before,
.carta-ciano::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  background-size: 250% 100%;
  pointer-events: none;
}
.carta-ouro-brilho::before {
  background-image: linear-gradient(115deg, transparent 40%, #fff3c44d 50%, transparent 60%);
  animation: brilho-carta 5s linear infinite;
}
.carta-ciano::before {
  background-image: linear-gradient(115deg, transparent 30%, #ffffff8c 50%, transparent 70%);
  animation: brilho-carta 2.8s linear infinite;
}
.carta-ciano {
  box-shadow: 0 0 16px #22d3ee99, 0 6px 14px #0008;
}
.carta-topo {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3% 3.5% 2%;
  min-width: 24%;
  border-radius: 0 0 10px 0;
  background: var(--c-base);
  line-height: 0.95;
  z-index: 1;
}
.carta-ovr {
  font-family: var(--display);
  font-size: 2.2em;
}
.carta-pos {
  font-weight: 800;
  font-size: 0.95em;
}
.carta-foto {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.carta-foto::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 38%, var(--c-base) 66%);
}
.carta-tags {
  position: absolute;
  top: 3%;
  right: 3%;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  z-index: 1;
}
.carta-tag {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--castanho);
  color: var(--destaque-2);
  font-size: 0.55em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}
.carta-silhueta {
  fill: currentColor;
  opacity: 0.35;
}
.carta-foto .carta-silhueta {
  width: 58%;
  margin-bottom: 38%;
}
.carta-nome,
.carta-facetas,
.carta-rodape {
  position: relative;
  z-index: 1;
}
.carta-nome {
  width: 100%;
  text-align: center;
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 1.3em;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.carta-facetas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 6%;
  width: 96%;
  margin-top: 2%;
  font-size: 0.88em;
  font-weight: 700;
  line-height: 1.25;
}
.carta-facetas span {
  white-space: nowrap;
}
.carta-facetas b {
  font-weight: 900;
}
.carta-rodape {
  align-self: stretch;
  margin-top: 1%;
  text-align: center;
  font-size: 0.72em;
  font-weight: 700;
  line-height: 1.1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
@keyframes brilho-carta {
  from { background-position: 150% 0; }
  to { background-position: -100% 0; }
}
.bandeira {
  display: inline-block;
  vertical-align: -0.15em;
  margin-right: 0.35em;
  width: 1.5em;
  height: 1.125em;
  border-radius: 2px;
  box-shadow: 0 0 0 1px #0003;
}
.credito-foto {
  grid-column: 1 / -1;
  font-size: 11px;
  margin: 0;
}

/* --- Criador de emblemas --- */
.emblema {
  object-fit: contain;
}
.emblema-botao {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--destaque-2);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.emblema-botao:hover {
  background: #ffffff14;
}
.dialogo-emblema {
  width: min(94vw, 720px);
}
.emblema-editor {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  margin-block: 14px;
}
.emblema-previa {
  align-self: start;
  position: sticky;
  top: 0;
  padding: 10px;
  border-radius: 14px;
  background: repeating-conic-gradient(#ffffff14 0 25%, #0000 0 50%) 0 0 / 20px 20px, #06140d;
}
.emblema-previa canvas {
  display: block;
  width: 100%;
  height: auto;
}
.emblema-controlos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.emblema-controlos .cores {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.emblema-opcoes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.emblema-opcao {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 4px;
}
.emblema-ficheiro {
  text-align: center;
  cursor: pointer;
}
.emblema-controlos input[type='range'] {
  width: 100%;
  accent-color: var(--destaque-2);
}
@media (max-width: 620px) {
  .emblema-editor {
    grid-template-columns: minmax(0, 1fr);
  }
  .emblema-previa {
    position: static;
    width: 180px;
    justify-self: center;
  }
}

/* --- Sliders --- */
.slider {
  --p: 50%;
  width: 100%;
  height: 22px;
  margin: 0;
  background: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.slider::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--destaque-2) var(--p), #ffffff1f var(--p));
}
.slider::-moz-range-track {
  height: 8px;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--destaque-2) var(--p), #ffffff1f var(--p));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -7px;
  border: 3px solid #1a0f0a;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px #0009;
}
.slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 3px solid #1a0f0a;
  border-radius: 50%;
  background: #fff;
}
.slider:disabled {
  opacity: 0.55;
  cursor: default;
}
.slider-rotulo {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.slider-rotulo strong {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 400;
  color: var(--destaque-2);
}
.slider-marcas {
  display: flex;
  justify-content: space-between;
  margin-top: -6px;
  padding-inline: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
#lobby-config .segmentos {
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
}

/* --- Seletor de cor --- */
.seletor-cor {
  position: fixed;
  z-index: 40;
  width: 252px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--destaque-borda);
  border-radius: 14px;
  background: #0b2016;
  box-shadow: 0 18px 44px #000c;
}
.seletor-cor[hidden] {
  display: none;
}
.seletor-area {
  position: relative;
  height: 130px;
  border-radius: 10px;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, transparent), var(--matiz, #f00);
  cursor: crosshair;
  touch-action: none;
}
.seletor-ponto {
  position: absolute;
  width: 16px;
  height: 16px;
  transform: translate(-50%, -50%);
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px #000a;
  pointer-events: none;
}
.seletor-matiz {
  height: 16px;
}
.seletor-matiz::-webkit-slider-runnable-track {
  height: 10px;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.seletor-matiz::-moz-range-track {
  height: 10px;
  background: linear-gradient(90deg, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.seletor-matiz::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -3px;
  border-width: 2px;
}
.seletor-hex {
  display: flex;
  align-items: center;
  gap: 8px;
}
.seletor-hex .campo {
  padding: 6px 10px;
  font-size: 14px;
  text-transform: uppercase;
}
.seletor-paleta {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
}
.seletor-paleta button {
  aspect-ratio: 1;
  padding: 0;
  border: 0;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px #ffffff30;
  cursor: pointer;
}
.seletor-paleta button:hover,
.seletor-paleta button.escolhida {
  outline: 2px solid #fff;
  outline-offset: 1px;
}

/* --- Saldo negativo --- */
.saldo-negativo {
  color: #fca5a5 !important;
}
.barra-orcamento {
  flex: none;
  white-space: nowrap;
}

/* --- Fim da época --- */
.confetis {
  position: fixed;
  inset: 0;
  z-index: 60;
  pointer-events: none;
}
.sobre-relvado:has(.fim-epoca) {
  width: min(97%, 1240px);
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  max-height: 97%;
}
.fim-epoca {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.fim-topo {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 14px;
  border-radius: 16px;
  background: radial-gradient(ellipse at center, #f2c14e33, #0000 70%);
}
.fim-taca {
  width: 104px;
  height: auto;
  filter: drop-shadow(0 8px 18px #f2c14e66);
}
.fim-entrada .fim-taca {
  animation: fim-entra 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3);
}
.fim-entrada .fim-campeao {
  animation: fim-entra 0.7s 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.3) backwards;
}
.fim-campeao .emblema {
  display: block;
  filter: drop-shadow(0 8px 24px #000a);
}
@keyframes fim-entra {
  from { opacity: 0; transform: scale(0.4); }
}
.fim-titulo h2 {
  margin: 2px 0 4px;
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 60px);
  font-weight: 400;
  line-height: 1;
  text-transform: uppercase;
  color: #fff;
}
.fim-grelha {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.fim-coluna {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.fim-cartao {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  background: #ffffff08;
}
.fim-lista li {
  align-items: center;
  justify-content: flex-start;
}
.fim-posicao {
  flex: none;
  width: 16px;
  color: var(--muted);
  font-weight: 800;
}
.fim-nome {
  flex: 1;
  min-width: 0;
}
.fim-nome small {
  display: block;
  color: var(--muted);
}
.fim-campo {
  width: 100%;
  height: clamp(320px, 52vh, 500px);
  container-type: size;
  display: grid;
  place-items: center;
}
.fim-momentos-grelha {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.fim-momentos ul {
  margin: 4px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  line-height: 1.35;
}
.fim-momentos li {
  padding: 6px 9px;
  border-radius: 8px;
  border-left: 3px solid;
  background: #ffffff0a;
}
.momentos-bons li {
  border-color: #4ade80;
}
.momentos-maus li {
  border-color: #f87171;
}
.fim-botao {
  display: flex;
  justify-content: center;
}
.fim-botao .btn {
  width: min(100%, 420px);
}
.melhorias {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  justify-items: center;
}
.melhoria {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.melhoria .carta {
  --largura: 124px;
}
.melhoria-valor {
  font-family: var(--display);
  font-size: 18px;
}
.melhoria-valor span {
  color: var(--muted);
}
.melhoria-valor em {
  font-style: normal;
}
.melhoria.sobe .melhoria-valor em {
  color: #4ade80;
}
.melhoria.desce .melhoria-valor em {
  color: #f87171;
}
.melhoria small {
  color: var(--destaque-2);
  font-size: 11px;
  font-weight: 700;
}
@media (max-width: 860px) {
  .fim-grelha,
  .fim-momentos-grelha {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* No telemóvel e sem 3D, o painel segue o resto da página: não fica centrado por cima do relvado. */
.sem-3d .sobre-relvado:has(.draft-layout),
.sem-3d .sobre-relvado:has(.fim-epoca) {
  top: auto;
  transform: none;
  width: auto;
  max-height: none;
}
@media (max-width: 800px) {
  .sobre-relvado:has(.draft-layout),
  .sobre-relvado:has(.fim-epoca) {
    top: auto;
    transform: none;
    width: auto;
    max-height: none;
  }
}
/* O ecrã do campeão ocupa o palco todo, por cima das outras equipas, e o botão fica sempre à vista. */
@media (min-width: 801px) {
  #palco:not(.sem-3d) .sobre-relvado:has(.fim-epoca) {
    position: fixed;
    z-index: 5;
    top: calc((100dvh - var(--altura-barra, 80px) + 44px) / 2);
    width: min(96vw, 1400px);
    max-height: calc(100dvh - var(--altura-barra, 80px) - 60px);
    animation: none;
  }
}
.fim-botao {
  position: sticky;
  bottom: -12px;
  z-index: 1;
  padding: 10px 0;
  background: linear-gradient(180deg, #0000, #0a1f15 45%);
}
.sobre-relvado:has(.fim-epoca) {
  background: #071a11;
}
#palco:has(.fim-epoca) .coluna-lado,
#palco:has(.fim-epoca) .equipas-topo {
  visibility: hidden;
}
.fim-momentos {
  text-align: left;
}
.fim-epoca .fim-campo {
  display: flex;
  justify-content: center;
  flex: none;
  width: 100%;
  height: clamp(340px, 56vh, 520px);
  max-height: none;
}
/* A entrada normal do painel mexe no transform, o que estragava o centrado destes dois. */
.sobre-relvado:has(.draft-layout),
.sobre-relvado:has(.fim-epoca) {
  animation: none;
}

/* --- Demo: o guia flutua por baixo do título, e a legenda de quem é a vez fica por baixo dele --- */
.linha-inicio {
  justify-content: center;
}
.demo-guia {
  position: fixed;
  z-index: 200;
  left: 12px;
  top: 60px;
  width: clamp(280px, 26vw, 380px);
  max-height: calc(100dvh - 160px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--destaque);
  border-radius: 14px;
  box-shadow: 0 12px 40px #000a;
}
.modo-demo #notificacoes,
.modo-demo .barra-dica {
  display: none;
}
@media (max-width: 1600px) {
  .modo-demo .barra-sancao {
    display: none;
  }
}
.modo-demo .dialogo-carta[open],
.modo-demo .dialogo-jogador[open] {
  position: fixed;
  inset: 0;
  margin: auto;
  z-index: 150;
}
.demo-progresso {
  flex: none;
  height: 4px;
  border-radius: 2px;
  background: #fff2;
  overflow: hidden;
}
.demo-progresso span {
  display: block;
  height: 100%;
  background: var(--destaque);
  transition: width 0.25s;
}
.demo-titulo {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.2;
}
.demo-texto {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.4;
}
.demo-guia .rotulo {
  margin: 0;
}
.demo-botoes {
  flex: none;
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
.demo-botoes .btn {
  flex: 1;
  text-align: center;
  text-decoration: none;
}
.demo-sair {
  align-self: center;
  font-size: 0.8rem;
  color: inherit;
  opacity: 0.75;
}
.demo-alvo {
  outline: 2px solid var(--destaque);
  outline-offset: 3px;
  border-radius: 8px;
}
.modo-demo .draft-layout .carta {
  --largura: clamp(90px, 8vw, 130px);
}
/* Os painéis que ocupam o palco todo ficam ao lado do guia. */
@media (min-width: 801px) {
  /* Durante os lances, as equipas e os dados ficam à vista: o guia passa para cima do relvado. */
  body.modo-demo:has(#caixa-lance:not([hidden])):has(#col-acao[hidden]):not(:has(#dialogo-carta[open])) .demo-guia {
    left: 50%;
    top: 132px;
    transform: translateX(-50%);
    width: min(420px, 36vw);
  }
  .modo-demo #palco:not(.em-jogo) #equipas-esq {
    position: fixed;
    left: 12px;
    top: calc(var(--demo-fundo, 340px) + 44px);
    z-index: 4;
  }
  .modo-demo #palco .sobre-relvado:has(.draft-layout),
  .modo-demo #palco .sobre-relvado:has(.fim-epoca) {
    left: calc(50% + clamp(280px, 26vw, 380px) / 2 + 6px);
    width: calc(100% - clamp(280px, 26vw, 380px) - 36px);
    max-width: none;
  }
}
@media (max-width: 800px) {
  .demo-guia {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    max-height: 42dvh;
    padding: 12px;
    border-width: 1px 0 0;
    border-radius: 14px 14px 0 0;
  }
  .modo-demo #ecra-jogo {
    padding-bottom: 44dvh;
  }
}

.demo-limpa .demo-guia {
  display: none;
}
.modo-demo.demo-limpa #legenda-vez {
  top: 4px !important;
}
.modo-demo.demo-limpa #palco #equipas-esq {
  position: revert;
  top: auto;
  left: auto;
}
