/* O DESENHO DA CHAVE (public/js/torneio_chave.js) — o mesmo no Admin > Torneios e na página
   pública /torneio. Escuro como o jogo; ouro = a cor do texto de item único do D2 (#c7b377).
   As cores moram no .trn-chave (a raiz que o quadroHtml devolve), para valer nas duas telas. */

.trn-chave {
  --trn-ouro: #c7b377;
  --trn-ouro-forte: #e0c97f;
  --trn-fundo: #17181b;
  --trn-card: #22252a;
  --trn-borda: #34383f;
  --trn-texto: #d6d8dc;
  --trn-apagado: #7c828c;
  --trn-azul: #5b9bd5;
  --trn-verm: #d9534f;
  --trn-colw: 210px;
}


.trn-legenda { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 12px; color: #777; margin-bottom: 6px; }
.trn-l { display: inline-block; width: 22px; height: 0; vertical-align: middle; margin-right: 3px; border-top: 2px solid #9aa1ab; }
.trn-l-venc { border-top-color: var(--trn-ouro); }
.trn-l-perd { border-top: 2px dashed #e07b6e; }

.trn-board-wrap { overflow-x: auto; border-radius: 6px; background: var(--trn-fundo); }
.trn-board { position: relative; display: inline-block; min-width: 100%; padding: 8px 18px 18px; background: var(--trn-fundo); border-radius: 6px; }
.trn-fios { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.trn-grade { position: relative; display: grid; column-gap: 36px; grid-template-rows: auto auto auto auto auto; }

.trn-coltit {
  color: var(--trn-apagado);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-align: center;
  padding: 6px 0 2px;
}
.trn-faixa { position: relative; margin: 10px 0 6px; border-top: 1px solid #2c3036; }
.trn-faixa span {
  position: relative;
  top: -0.8em;
  background: var(--trn-fundo);
  padding-right: 10px;
  font-family: "ExocetHeavy", "Palatino Linotype", serif;
  font-size: 17px;
  letter-spacing: .08em;
  color: var(--trn-ouro);
  text-transform: uppercase;
}
.trn-faixa-upper { margin-top: 14px; }
.trn-faixa-lower { margin-top: 24px; }
.trn-col { display: flex; flex-direction: column; justify-content: space-around; gap: 14px; }

.trn-mwrap { position: relative; }
.trn-mtit {
  position: absolute;
  bottom: 100%;
  left: 0;
  margin-bottom: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--trn-ouro);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.trn-m {
  position: relative;
  z-index: 1;
  width: var(--trn-colw);
  background: var(--trn-card);
  border: 1px solid var(--trn-borda);
  border-radius: 5px;
  color: var(--trn-texto);
  cursor: pointer;
  overflow: hidden;
  transition: border-color .12s, box-shadow .12s;
}
.trn-m:hover { border-color: #5c636e; box-shadow: 0 0 0 1px #5c636e; }
.trn-mcab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px;
  font-size: 10px;
  color: var(--trn-apagado);
  background: rgba(255, 255, 255, .03);
  border-bottom: 1px solid #2c3036;
}
.trn-cod { font-weight: 700; letter-spacing: .03em; }
.trn-md { margin-left: auto; }
.trn-pronta { color: var(--trn-azul); font-weight: 700; text-transform: uppercase; }
.trn-conf { color: var(--trn-verm); font-weight: 700; text-transform: uppercase; }
.trn-timer { color: #f0ad4e; font-weight: 700; font-variant-numeric: tabular-nums; }
.trn-timer.is-estourou { color: #ff6b61; }

.trn-s {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 27px;
  padding: 0 8px;
  font-size: 13px;
  border-bottom: 1px solid #2a2d33;
  transition: background .12s;
}
.trn-s:last-child { border-bottom: 0; }
.trn-s .trn-n { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trn-s .trn-pl { flex: 0 0 auto; min-width: 18px; text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; color: #9aa1ab; }
.trn-s.is-venc { color: var(--trn-ouro-forte); font-weight: 700; }
.trn-s.is-venc .trn-pl { color: var(--trn-ouro-forte); }
.trn-s.is-perd { color: #8a9099; }
.trn-s.is-perd .trn-n { text-decoration: none; }
.trn-s.is-vazio .trn-n { color: #646a74; font-style: italic; font-size: 12px; }
.trn-s.is-bye .trn-n { color: #555b64; font-style: italic; }
.trn-s.is-dq .trn-n { text-decoration: line-through; }
.trn-s.is-foco { background: rgba(199, 179, 119, .16); }
.trn-a { flex: 0 0 auto; font-size: 10px; font-weight: 700; color: #7f8792; min-width: 20px; }
.trn-cls { flex: 0 0 auto; width: 18px; height: 18px; object-fit: contain; display: inline-block; }
.trn-vant { font-size: 10px; color: #8fd18f; font-weight: 700; }

.trn-m.is-pronta { border-color: #36607f; }
.trn-m.is-pronta:hover { border-color: var(--trn-azul); box-shadow: 0 0 0 1px var(--trn-azul); }
.trn-m.is-chamada { border-color: #9a6a24; }
.trn-m.is-bye,
.trn-m.is-dispensada { opacity: .45; border-style: dashed; }
.trn-m.is-conflito { border-color: var(--trn-verm); }

.trn-board.is-compacta { --trn-colw: 180px; }
.trn-board.is-compacta .trn-s { height: 22px; font-size: 12px; }
.trn-board.is-compacta .trn-col { gap: 8px; }

/* os fios */
.trn-fio { fill: none; stroke: #464b54; stroke-width: 1.5; transition: stroke .12s, opacity .12s; }
.trn-fio.is-feita { stroke: #6f6447; }
.trn-fio-perd { stroke: #e07b6e; stroke-dasharray: 5 4; opacity: 0; }
.trn-fio.is-foco { stroke: var(--trn-ouro-forte); stroke-width: 2; opacity: 1; }
.trn-fio-perd.is-foco { stroke: #ff8c7d; }

/* a página pública só olha: sem a mão de "clique para lançar" */
.trn-board.is-leitura .trn-m { cursor: default; }
/* o jogador logado (página pública) */
.trn-s.is-eu { box-shadow: inset 3px 0 0 var(--trn-ouro-forte); }
.trn-s.is-eu .trn-n { color: #fff; }
