/* =====================================================
   ZDVAL — /tactics
   Playbook tático. Referências: VS Code Explorer (árvore),
   Linear (densidade + hairlines), Notion (documento), Figma (painéis).

   Regras da casa:
   - Vermelho é sinal, não decoração. Só marca estado ativo e destrutivo.
   - Profundidade vem de valor e hairline, nunca de sombra pesada.
   - A árvore é densa. O documento respira.

   Escopo: #page-tactics.tc-page — especificidade suficiente para vencer os
   overrides !important de antitactic-legacy.css, que ainda serve /antitatico.
   ===================================================== */

#page-tactics.tc-page {
  /* --- superfícies --- */
  --tc-bg:            #0f1115;
  --tc-bg-sidebar:    #0b0d11;
  --tc-bg-raised:     #14171d;
  --tc-bg-hover:      rgba(255, 255, 255, 0.035);
  --tc-bg-active:     rgba(255, 70, 85, 0.09);

  /* --- traços --- */
  --tc-line:          rgba(255, 255, 255, 0.06);
  --tc-line-strong:   rgba(255, 255, 255, 0.11);
  --tc-guide:         rgba(255, 255, 255, 0.055);

  /* --- texto --- */
  --tc-fg:            #e9ecf1;
  --tc-fg-soft:       #9aa3b2;
  --tc-fg-mute:       #626b7a;

  /* --- acentos --- */
  --tc-accent:        #ff4655;
  --tc-accent-soft:   rgba(255, 70, 85, 0.14);
  --tc-attack:        #ff4655;
  --tc-defense:       #46a0ff;

  /* --- forma --- */
  --tc-r:             12px;
  --tc-r-sm:          8px;
  --tc-r-xs:          6px;
  --tc-sidebar-w:     clamp(210px, 24%, 420px);
  --tc-ease:          cubic-bezier(0.22, 1, 0.36, 1);

  position: relative;
  grid-template-columns: var(--tc-sidebar-w) minmax(0, 1fr);
  height: calc(100vh - var(--header-height, 64px));
  min-height: 0;
  padding: 0;
  background: var(--tc-bg) !important;
  color: var(--tc-fg);
  font-family: 'Inter', system-ui, sans-serif;
  overflow: hidden;
}

/* display só quando a página está ativa — .page{display:none} precisa vencer
   enquanto /tactics não é a rota corrente. */
#page-tactics.tc-page.active { display: grid; }

/* O legado desenha um halo fixo em #page-tactics — não pertence a esta página. */
#page-tactics.tc-page::before {
  content: '';
  position: absolute;
  inset: 0;
  animation: none;
  opacity: 0.035;
  pointer-events: none;
  z-index: 0;
  /* Grão sutil — tira o "plástico" do fundo chapado. */
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* =====================================================
   SIDEBAR
   ===================================================== */

.tc-sidebar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--tc-bg-sidebar);
  border-right: 1px solid var(--tc-line);
}

.tc-sidebar-tree {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Alternador Time/Pessoal — só existe quando o usuário tem time (ver
   renderModeToggle em tactics.js); sem time, fica hidden e o espaço some. */
.tc-mode-toggle {
  display: flex;
  gap: 4px;
  padding: 12px 16px 0;
}

.tc-mode-toggle[hidden] { display: none; }

.tc-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--tc-r-xs);
  border: 1px solid var(--tc-line);
  background: transparent;
  color: var(--tc-fg-soft);
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s var(--tc-ease), color 0.15s var(--tc-ease), border-color 0.15s var(--tc-ease);
}

.tc-mode-btn:hover {
  background: var(--tc-bg-hover);
  color: var(--tc-fg);
}

.tc-mode-btn.active {
  background: var(--tc-bg-active);
  border-color: var(--tc-accent-soft);
  color: var(--tc-fg);
}

.tc-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 16px 14px;
}

.tc-side-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

/* Losango vermelho — âncora de marca, no lugar do emoji de pasta. */
.tc-side-brand-mark {
  width: 9px;
  height: 9px;
  flex: none;
  background: var(--tc-accent);
  transform: rotate(45deg);
  border-radius: 1.5px;
  box-shadow: 0 0 12px rgba(255, 70, 85, 0.55);
}

.tc-side-title {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tc-fg);
}

/* --- busca --- */

.tc-side-search {
  position: relative;
  margin: 0 12px 12px;
}

.tc-side-search i {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  color: var(--tc-fg-mute);
  pointer-events: none;
}

.tc-side-search-input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 34px;
  font: inherit;
  font-size: 14px;
  color: var(--tc-fg);
  background: var(--tc-bg-raised);
  border: 1px solid transparent;
  border-radius: var(--tc-r-sm);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.tc-side-search-input::placeholder { color: var(--tc-fg-mute); }

.tc-side-search-input:focus {
  border-color: var(--tc-line-strong);
  background: #171b22;
}

.tc-side-search-input::-webkit-search-cancel-button { filter: invert(0.5); }

/* =====================================================
   ÁRVORE
   ===================================================== */

.tc-tree {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 8px 32px;
}

.tc-tree::-webkit-scrollbar { width: 9px; }
.tc-tree::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.08);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: 99px;
}
.tc-tree:hover::-webkit-scrollbar-thumb { background-color: rgba(255, 255, 255, 0.16); }

/* --- linha base (todos os níveis) --- */

.tc-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 8px;
  border-radius: var(--tc-r-xs);
  cursor: pointer;
  user-select: none;
  color: var(--tc-fg-soft);
  transition: background 0.12s, color 0.12s;
}

.tc-row:hover { background: var(--tc-bg-hover); color: var(--tc-fg); }

.tc-row:focus-visible {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--tc-accent);
}

.tc-caret {
  flex: none;
  width: 14px;
  font-size: 11px;
  color: var(--tc-fg-mute);
  transition: transform 0.18s var(--tc-ease);
}

.is-open > .tc-row > .tc-caret { transform: rotate(90deg); }

/* Contador — mono, discreto, encostado à direita. */
.tc-count {
  flex: none;
  margin-left: auto;
  padding: 2px 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--tc-fg-mute);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
}

/* Ações só aparecem no hover — mantém a árvore limpa (padrão Notion). */
.tc-row-action {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin-left: 2px;
  font-size: 12px;
  color: var(--tc-fg-mute);
  background: transparent;
  border: 0;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}

/* Sem contador a ação ainda precisa encostar à direita. */
.tc-row > .tc-row-action:not(.tc-count ~ .tc-row-action) { margin-left: auto; }
.tc-row .tc-count ~ .tc-row-action { margin-left: 2px; }

.tc-row:hover .tc-row-action { opacity: 1; }
.tc-row-action:hover { background: rgba(255, 255, 255, 0.09); color: var(--tc-fg); }
.tc-row-action:focus-visible { opacity: 1; outline: 1px solid var(--tc-accent); }
.tc-row-action[disabled] { opacity: 0; pointer-events: none; }

/* --- nível 1: mapa --- */

.tc-map { margin-bottom: 1px; }

.tc-row--map { min-height: 42px; }

.tc-map-name {
  font-family: 'Rajdhani', sans-serif;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--tc-fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-map.is-open > .tc-row--map { background: rgba(255, 255, 255, 0.025); }

/* Guias verticais de indentação — leitura de árvore do VS Code. */
.tc-map-body,
.tc-comp-body,
.tc-side-body,
.tc-folder-body {
  position: relative;
  margin-left: 12px;
  padding-left: 10px;
  animation: tc-branch 0.18s var(--tc-ease);
}

.tc-map-body::before,
.tc-comp-body::before,
.tc-side-body::before,
.tc-folder-body::before {
  content: '';
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 2px;
  width: 1px;
  background: var(--tc-guide);
}

@keyframes tc-branch {
  from { opacity: 0; transform: translateY(-3px); }
  to   { opacity: 1; transform: none; }
}

/* --- nível 2: composição --- */

.tc-row--comp { min-height: 40px; }

/* Slot numerado (1..5) — dá endereço fixo à comp. */
.tc-comp-slot {
  flex: none;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--tc-fg-mute);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
}

.tc-comp.is-open .tc-comp-slot {
  color: var(--tc-accent);
  background: var(--tc-accent-soft);
}

.tc-comp-label {
  min-width: 0;
  flex: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  white-space: nowrap;
}

.tc-agent { color: var(--tc-fg-soft); }
.tc-comp.is-open .tc-agent { color: var(--tc-fg); }
.tc-agent-sep { color: var(--tc-fg-mute); font-size: 10px; }

/* Estrela de favorita — mesmo tamanho e espaçamento dos ícones de agente,
   sempre colada ao último agente da composição. */
.tc-comp-label .tc-fav-btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  font-size: 14px;
  color: var(--tc-fg-mute);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}
.tc-row:hover .tc-comp-label .tc-fav-btn { opacity: 1; }
.tc-comp-label .tc-fav-btn:hover { background: rgba(255, 255, 255, 0.09); color: var(--tc-fg); }
.tc-comp-label .tc-fav-btn:focus-visible { opacity: 1; outline: 1px solid var(--tc-accent); }
.tc-comp-label .tc-fav-btn.is-fav { opacity: 1; color: #ffc95c; }
.tc-comp-label .tc-fav-btn.is-fav:hover { background: rgba(255, 201, 92, 0.14); color: #ffc95c; }

.tc-agent--icon {
  flex: none;
  display: inline-flex;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  overflow: hidden;
  /* Mesmo gradiente por agente usado nos cards de /lineups. */
  background: linear-gradient(160deg, var(--agent-g0, #1a1a2e) 0%, var(--agent-g1, #0f1923) 50%, var(--agent-g2, #1a1a2e) 100%);
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0.9;
}
.tc-comp.is-open .tc-agent--icon { opacity: 1; }
.tc-agent--icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tc-comp-empty { font-style: italic; color: var(--tc-fg-mute); font-size: 13px; }

/* Bloco vazio de mapa + botão "Criar composição" ficam maiores só na sidebar,
   sem afetar o mesmo .tc-ghost-btn usado no editor de tática. */
.tc-empty-branch .tc-ghost-btn {
  padding: 7px 12px;
  font-size: 13px;
}

/* --- nível 3: lado --- */

.tc-row--side { min-height: 34px; }

.tc-side-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.tc-side-group--attack  .tc-side-dot { background: var(--tc-attack);  box-shadow: 0 0 7px rgba(255, 70, 85, 0.6); }
.tc-side-group--defense .tc-side-dot { background: var(--tc-defense); box-shadow: 0 0 7px rgba(70, 160, 255, 0.6); }

.tc-side-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tc-side-group--attack.is-open  .tc-side-label { color: var(--tc-attack); }
.tc-side-group--defense.is-open .tc-side-label { color: var(--tc-defense); }

/* --- nível 4: pasta (só quando há mais de uma) --- */

.tc-row--folder { min-height: 32px; }
.tc-folder-icon { font-size: 12px; color: var(--tc-fg-mute); }
.tc-folder-name { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- folha: tática --- */

.tc-row--tactic {
  min-height: 34px;
  padding-left: 8px;
  font-size: 14px;
}

.tc-tactic-icon { flex: none; font-size: 12px; color: var(--tc-fg-mute); }

.tc-tactic-name {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-tactic-flag {
  flex: none;
  margin-left: auto;
  font-size: 11px;
  color: var(--tc-fg-mute);
}

/* Estado ativo — trilho vermelho, o único lugar da árvore com acento cheio. */
.tc-row--tactic.is-active {
  color: #fff;
  background: var(--tc-bg-active);
  font-weight: 500;
}

.tc-row--tactic.is-active::before {
  content: '';
  position: absolute;
  left: -10px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  border-radius: 99px;
  background: var(--tc-accent);
  box-shadow: 0 0 10px rgba(255, 70, 85, 0.7);
}

.tc-row--tactic.is-active .tc-tactic-icon { color: var(--tc-accent); }

/* --- vazios da árvore --- */

.tc-empty-branch,
.tc-empty-leaf,
.tc-limit-note {
  padding: 8px 8px;
  font-size: 13px;
  color: var(--tc-fg-mute);
}

.tc-empty-branch p { margin: 0 0 7px; }
.tc-limit-note { font-style: italic; }

.tc-tree-empty {
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 48px 16px;
  text-align: center;
  color: var(--tc-fg-mute);
}

.tc-tree-empty i { font-size: 20px; opacity: 0.5; }
.tc-tree-empty p { margin: 0; font-size: 12px; }

/* =====================================================
   BOTÕES
   ===================================================== */

.tc-icon-btn {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 12px;
  color: var(--tc-fg-soft);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--tc-r-sm);
  cursor: pointer;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
}

.tc-icon-btn:hover {
  color: var(--tc-fg);
  background: var(--tc-bg-hover);
  border-color: var(--tc-line);
}

.tc-icon-btn.is-active {
  color: var(--tc-accent);
  background: var(--tc-accent-soft);
  border-color: transparent;
}

/* =====================================================
   DRAWER DE ANOTAÇÕES — utilitárias, passo a passo e notas
   agrupados atrás do ícone de nota no header.
   ===================================================== */

.tc-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(6, 8, 12, 0.55);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--tc-ease);
}

.tc-drawer-overlay.is-open { opacity: 1; pointer-events: auto; }

.tc-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 211;
  width: min(480px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--tc-bg-sidebar);
  border-left: 1px solid var(--tc-line);
  box-shadow: -24px 0 48px rgba(0, 0, 0, 0.35);
  transform: translateX(100%);
  transition: transform 0.24s var(--tc-ease);
}

.tc-drawer.is-open { transform: none; }

.tc-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--tc-line);
}

.tc-drawer-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: 'Rajdhani', sans-serif;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tc-fg);
}

.tc-drawer-head h2 i { color: var(--tc-accent); font-size: 15px; }

.tc-drawer-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tc-drawer-body .tc-card { margin: 0; }

@media (max-width: 640px) {
  .tc-drawer { width: 100vw; }
}

/* =====================================================
   MODO TÁTICO — tela cheia, só mapa/imagens/vídeo, pra estudo.
   Acima de tudo (drawers incluídos): overlay próprio, sem sidebar,
   sem header do site, sem árvore.
   ===================================================== */

.tc-focus-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  background: #06070a;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.01);
  transition: opacity 0.22s var(--tc-ease), transform 0.22s var(--tc-ease);
}

.tc-focus-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

/* Some o resto da UI enquanto o modo tático está ativo — o overlay já
   cobre a tela, isto evita scroll fantasma atrás dele. */
body.tc-focus-active { overflow: hidden; }

.tc-focus-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.tc-focus-title {
  font-family: 'Rajdhani', sans-serif;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tc-fg-soft);
}

/* =====================================================
   EDITOR DE DESENHO — só existe dentro do Modo Tático, por cima da
   imagem do mapa. Réplica reduzida das ferramentas do zdpro (caneta,
   borracha, linha, seta, texto, imagem).
   ===================================================== */

/* Barra flutuante, centralizada, colada na parte inferior do modo tático
   — mesma lógica de "flutuante sobre o conteúdo" do FAB de anotações. */
.tc-draw-toolbar {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 2;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  background: rgba(10, 12, 16, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  flex-wrap: nowrap;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
}

.tc-draw-group {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 8px;
  flex: none;
}

.tc-draw-group + .tc-draw-group {
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.tc-draw-tool {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 13px;
  color: #9aa3b2;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  outline: none !important;
  transition: background 0.12s, color 0.12s;
}

.tc-draw-tool:hover { color: #e9ecf1; background: rgba(255, 255, 255, 0.06); }

.tc-draw-tool.is-active {
  color: #fff;
  background: var(--tc-accent);
}

.tc-draw-color {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--swatch);
  border: 2px solid transparent;
  cursor: pointer;
  outline: none !important;
  transition: border-color 0.12s, transform 0.12s;
}

.tc-draw-color:hover { transform: scale(1.1); }
.tc-draw-color.is-active { border-color: #fff; }

.tc-draw-width {
  height: 30px;
  padding: 0 6px;
  font: inherit;
  font-size: 12px;
  color: #e9ecf1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  outline: none !important;
  box-shadow: none !important;
}

/* Canvas de desenho sobreposto à imagem do mapa, ocupando o container
   inteiro — a imagem fica embaixo, o traço por cima. */
[data-draw-container] {
  position: relative;
}

.tc-draw-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: default;
  touch-action: none;
}

/* Cursor reflete a ferramenta armada — sai do crosshair genérico, cada
   ferramenta com seu próprio ícone (mesma lógica de "o que você vê é o
   que vai acontecer" de qualquer editor de desenho). */
.tc-draw-canvas[data-cursor-tool="pen"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M3 21l1.6-5.2L15.8 4.6a2 2 0 0 1 2.8 0l0.8 0.8a2 2 0 0 1 0 2.8L8.2 19.4 3 21z' fill='%23ff4655'/%3E%3C/svg%3E") 3 21, crosshair;
}

.tc-draw-canvas[data-cursor-tool="eraser"] {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.6' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='8' rx='1.5' transform='rotate(-20 12 15)' fill='%2346a0ff'/%3E%3C/svg%3E") 12 15, crosshair;
}

.tc-draw-canvas[data-cursor-tool="line"],
.tc-draw-canvas[data-cursor-tool="arrow"] {
  cursor: crosshair;
}

.tc-draw-canvas[data-cursor-tool="text"] {
  cursor: text !important;
}

.tc-draw-canvas[data-cursor-tool="pointer"] {
  cursor: default;
}

/* Lixeira — canto superior direito do mapa, mesmas configurações do
   vp2-trash-bin do zdpro: sempre visível (não só durante o arrasto),
   borda tracejada vermelha discreta em repouso, realce sólido quando um
   elemento arrastado está em cima (soltar ali exclui). */
.tc-draw-trash {
  position: absolute;
  top: 16px;
  right: 16px;
  left: auto;
  z-index: 50;
  width: 42px;
  height: 42px;
  flex: none;
  box-sizing: border-box;
  border-radius: 9px;
  background: rgba(8, 8, 8, 0.92);
  border: 2px dashed rgba(239, 68, 68, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(239, 68, 68, 0.65);
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.tc-draw-trash i { display: block; }

.tc-draw-trash.is-hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #ef4444;
  transform: scale(1.15);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Camada HTML por cima do canvas — hospeda o input de texto solto e as
   alças de redimensionar imagem. Não intercepta cliques por padrão (o
   canvas embaixo continua recebendo os eventos de desenho); só os filhos
   diretos (input, alças) voltam a ser clicáveis. */
.tc-draw-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.tc-draw-text-input {
  position: absolute;
  min-width: 120px;
  padding: 6px 10px;
  font: 600 14px Inter, system-ui, sans-serif;
  background: rgba(10, 12, 16, 0.9);
  border: 1px solid var(--tc-accent);
  border-radius: 6px;
  outline: none !important;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4) !important;
  pointer-events: auto;
}

/* O box em si é só a borda tracejada decorativa em volta da imagem
   selecionada — precisa deixar o clique atravessar até o canvas embaixo
   (é lá que o drag da imagem é tratado). Só as 4 bolinhas de canto
   (.tc-draw-handle) voltam a ser clicáveis, pra redimensionar. */
.tc-draw-handles {
  position: absolute;
  border: 1.5px dashed rgba(255, 255, 255, 0.55);
  border-radius: 2px;
  pointer-events: none;
}

.tc-draw-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--tc-accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
}

.tc-draw-handle--nw { top: 0; left: 0; cursor: nwse-resize; }
.tc-draw-handle--ne { top: 0; left: 100%; cursor: nesw-resize; }
.tc-draw-handle--sw { top: 100%; left: 0; cursor: nesw-resize; }
.tc-draw-handle--se { top: 100%; left: 100%; cursor: nwse-resize; }

.tc-focus-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0;
}

/* Mapa e vídeo lado a lado, cada um preenchendo 100% da própria metade —
   sem respiro, sem cantos: é a tela de estudo, a mídia é tudo. Quando não
   há imagens extra empilhadas abaixo, esta linha é a única coisa em
   .tc-focus-body e precisa consumir 100% do espaço restante (flex:1), não
   uma altura fixa que sobra vazio embaixo. */
.tc-focus-row {
  flex: 1;
  min-height: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 2px;
}

.tc-focus-media {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
}

.tc-focus-media img {
  display: block;
  width: 100%;
  height: 100%;
  /* contain — a imagem da tática precisa aparecer INTEIRA, sem cortar
     nada (sem zoom/crop), mesmo que sobre faixa vazia nas bordas quando a
     proporção não bate com o card. O sistema de coordenadas do desenho
     (TacticsDrawing.getImageRect()) calcula exatamente essa área real da
     imagem dentro do container e usa ela como referência 0-100%, não o
     container inteiro — assim caneta/texto/imagem ficam sempre alinhados
     com a imagem de verdade, mesmo com as faixas vazias. */
  object-fit: contain;
}

.tc-focus-media--empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 260px;
  padding: 24px;
  color: #626b7a;
  background: #0a0c10;
}

.tc-focus-media--empty i { font-size: 26px; opacity: 0.4; }
.tc-focus-media--empty p { margin: 0; font-size: 13px; }

/* .tc-video embutido tem aspect-ratio próprio — no modo tático ele deve
   preencher a célula inteira em vez de flutuar centralizado no meio. */
.tc-focus-media--video { display: flex; }
.tc-focus-media--video .tc-video {
  flex: 1;
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

.tc-focus-media-note {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #9aa3b2;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 5px;
}

/* Botão flutuante de anotações — único atalho pra utilitárias/passo a
   passo/notas dentro do modo tático, onde o header normal está escondido. */
.tc-focus-notes-fab {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 18px;
  color: #e9ecf1;
  background: #14171d;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  outline: none !important;
  transition: background 0.14s, transform 0.14s, border-color 0.14s;
}

.tc-focus-notes-fab:hover {
  background: #1b1f27;
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.tc-focus-notes-fab.is-active {
  color: #ff8b95;
  border-color: rgba(255, 70, 85, 0.35);
  background: rgba(255, 70, 85, 0.14);
}

@media (max-width: 900px) {
  .tc-focus-row { grid-template-columns: 1fr; }
  .tc-focus-row .tc-focus-media { min-height: 42vh; }
}

@media (max-width: 640px) {
  .tc-focus-head { padding: 12px 16px; }
  .tc-focus-notes-fab { right: 16px; bottom: 16px; width: 46px; height: 46px; font-size: 16px; }
  .tc-draw-toolbar { bottom: 16px; gap: 6px; padding: 6px; }
  .tc-draw-tool { width: 30px; height: 30px; }
}

.tc-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 14px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--tc-fg);
  background: var(--tc-bg-raised);
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s, border-color 0.14s, transform 0.14s;
}

.tc-btn:hover { background: #1b1f27; border-color: var(--tc-line-strong); }
.tc-btn:active { transform: translateY(1px); }
.tc-btn:focus-visible { outline: 2px solid rgba(255, 255, 255, 0.35) !important; outline-offset: 2px; box-shadow: none !important; }

.tc-btn--primary {
  color: #fff;
  background: var(--tc-accent);
  border-color: transparent;
  box-shadow: 0 1px 10px rgba(255, 70, 85, 0.28) !important;
}

.tc-btn--primary:hover { background: #ff5a67; border-color: transparent; }
.tc-btn--primary:focus-visible { outline: 2px solid #fff !important; outline-offset: 2px; box-shadow: 0 1px 10px rgba(255, 70, 85, 0.28) !important; }
.tc-btn--primary[disabled] { opacity: 0.4; pointer-events: none; box-shadow: none !important; }

.tc-btn--danger { color: #fff; background: var(--tc-accent); border-color: transparent; }
.tc-btn--danger:hover { background: #ff5a67; }

.tc-ghost-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  font: inherit;
  font-size: 11.5px;
  color: var(--tc-fg-soft);
  background: transparent;
  border: 1px dashed var(--tc-line-strong);
  border-radius: var(--tc-r-xs);
  cursor: pointer;
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}

.tc-ghost-btn:hover {
  color: var(--tc-fg);
  background: var(--tc-bg-hover);
  border-color: var(--tc-fg-mute);
}

/* =====================================================
   MAIN — documento
   ===================================================== */

.tc-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  overflow-y: auto;
}

.tc-main-head {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 32px;
  background: rgba(15, 17, 21, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--tc-line);
}

/* --- breadcrumb --- */

.tc-crumbs {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  font-size: 12px;
  color: var(--tc-fg-mute);
}

.tc-crumbs i { font-size: 8px; opacity: 0.55; }

.tc-crumb {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tc-crumb--comp { max-width: 260px; }

.tc-crumb--side {
  flex: none;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  border-radius: 4px;
}

.tc-crumb--attack  { color: var(--tc-attack);  background: rgba(255, 70, 85, 0.12); }
.tc-crumb--defense { color: var(--tc-defense); background: rgba(70, 160, 255, 0.12); }

.tc-crumb--current { color: var(--tc-fg); font-weight: 500; max-width: 300px; }

/* Nome da tática editável direto na trilha — não existe mais um campo de
   título repetido no corpo do documento. Largura generosa (não a herança
   de <input> de ~20ch) e foco flat, no mesmo padrão silencioso da árvore —
   sobrescreve o glow vermelho global de input:focus do style.css. */
.tc-crumb-title {
  flex: 1 1 auto;
  min-width: 120px;
  max-width: 420px;
  width: auto;
  padding: 4px 8px;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--tc-fg);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--tc-r-xs);
  transition: background 0.14s, border-color 0.14s;
}

.tc-crumb-title::placeholder { color: var(--tc-fg-mute); font-weight: 400; }

.tc-crumb-title:hover {
  background: var(--tc-bg-hover);
}

.tc-crumb-title:focus {
  outline: none !important;
  background: var(--tc-bg-raised);
  border-color: var(--tc-line-strong) !important;
  box-shadow: none !important;
}

/* --- ações do topo --- */

.tc-main-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.tc-save-state {
  font-size: 11px;
  color: var(--tc-fg-mute);
  transition: opacity 0.2s;
}

.tc-save-state--saved { color: var(--accent-green, #10b981); }
.tc-save-state--error { color: var(--tc-accent); }

.tc-menu-wrap { position: relative; }

.tc-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 172px;
  padding: 5px;
  background: var(--tc-bg-raised);
  border: 1px solid var(--tc-line-strong);
  border-radius: var(--tc-r-sm);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
  animation: tc-pop 0.14s var(--tc-ease);
}

@keyframes tc-pop {
  from { opacity: 0; transform: translateY(-4px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.tc-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 8px 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--tc-fg-soft);
  background: transparent;
  border: 0;
  border-radius: var(--tc-r-xs);
  cursor: pointer;
  text-align: left;
  transition: background 0.12s, color 0.12s;
}

.tc-menu-item:hover { background: var(--tc-bg-hover); color: var(--tc-fg); }
.tc-menu-item--danger { color: var(--tc-accent); }
.tc-menu-item--danger:hover { background: var(--tc-accent-soft); }

/* --- corpo do documento --- */

.tc-doc {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 40px 32px 96px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Mapa e vídeo lado a lado — mesma linha, altura acompanhada. As imagens
   extras (tc-image-stack) ficam numa seção cheia abaixo desta linha. */

/* Gatilho do modo tático — vive no header, mesma linha e altura dos ícones
   de busca/anotações/anexos (.tc-icon-btn), não mais uma barra própria. */
.tc-focus-trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: #9aa3b2;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--tc-r-sm);
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}

.tc-focus-trigger:hover,
.tc-focus-trigger:focus-visible {
  color: #e9ecf1;
  border-color: rgba(255, 255, 255, 0.18);
  background: var(--tc-bg-hover);
  outline: none !important;
  box-shadow: none !important;
}

.tc-focus-trigger i { color: #ff4655; font-size: 11px; }

.tc-doc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: 20px;
}

.tc-doc-row .tc-media-pane {
  min-height: 0;
}

.tc-doc-row .tc-card {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tc-doc-row .tc-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Notas, Passo a Passo e Sequência de Utilitárias lado a lado, abaixo do
   mapa/vídeo — mesma lógica horizontal do .tc-doc-row, três colunas iguais
   em vez de duas. Empilha em telas estreitas. */
.tc-notes-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
  gap: 20px;
}

.tc-notes-row .tc-card { height: 100%; display: flex; flex-direction: column; }
.tc-notes-row .tc-card-body { flex: 1; }

@media (max-width: 1180px) {
  .tc-notes-row { grid-template-columns: 1fr; }
}

/* Prévia das imagens da galeria, abaixo do mapa/vídeo — grade de miniaturas
   só-visualização; editar continua no drawer (ícone de galeria). */
.tc-images-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.tc-images-preview-item {
  position: relative;
  display: block;
  border-radius: var(--tc-r-sm);
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid var(--tc-line);
  aspect-ratio: 16 / 10;
  transition: border-color 0.14s;
}

.tc-images-preview-item:hover { border-color: var(--tc-line-strong); }

.tc-images-preview-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tc-images-preview-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 6px 8px;
  font-size: 11px;
  color: #e9ecf1;
  background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.75) 100%);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --- cards --- */

.tc-card {
  background: var(--tc-bg-raised);
  border: 1px solid var(--tc-line);
  border-radius: var(--tc-r);
  overflow: hidden;
  animation: tc-rise 0.4s var(--tc-ease) backwards;
  transition: border-color 0.18s;
}

.tc-card:hover { border-color: var(--tc-line-strong); }

/* Entrada escalonada — uma orquestração no load, não micro-ruído espalhado. */
.tc-card:nth-of-type(1) { animation-delay: 0.02s; }
.tc-card:nth-of-type(2) { animation-delay: 0.06s; }
.tc-card:nth-of-type(3) { animation-delay: 0.10s; }
.tc-card:nth-of-type(4) { animation-delay: 0.14s; }
.tc-card:nth-of-type(5) { animation-delay: 0.18s; }
.tc-card:nth-of-type(6) { animation-delay: 0.22s; }

@keyframes tc-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

.tc-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--tc-line);
}

.tc-card-title {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--tc-fg-soft);
}

.tc-card-title i { font-size: 11px; color: var(--tc-accent); opacity: 0.85; }

.tc-card-actions { display: flex; align-items: center; gap: 8px; }
.tc-card-body { padding: 18px; }

.tc-card-footer {
  padding: 12px 18px;
  border-top: 1px solid var(--tc-line);
  display: flex;
  justify-content: flex-end;
}

.tc-save-btn { min-width: 96px; justify-content: center; }
.tc-save-btn:disabled { opacity: 0.75; cursor: default; }

/* Mapa e vídeo: título vive FORA e ACIMA do card da mídia (nunca dentro,
   nunca sobrepondo a imagem) e só aparece no hover — fade puro de
   opacidade, sem alterar altura/layout, igual ao hover da estrela e da
   lixeira nas linhas da árvore lateral (.tc-row-action). */
.tc-media-pane {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tc-media-pane-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 20px;
  opacity: 0;
  transform: translateY(3px);
  transition: opacity 0.22s var(--tc-ease), transform 0.22s var(--tc-ease);
}

.tc-media-pane:hover .tc-media-pane-head,
.tc-media-pane-head:focus-within {
  opacity: 1;
  transform: none;
}

.tc-media-pane-head .tc-card-title { color: var(--tc-fg-soft); }
.tc-media-pane-head .tc-icon-btn { width: 24px; height: 24px; font-size: 11px; }

/* Mapa e vídeo preenchem o card por completo — sem respiro interno,
   sem cantos próprios (o card já arredonda). */
.tc-card-body--fill {
  padding: 0;
}

.tc-card-body--fill .tc-map-canvas,
.tc-card-body--fill .tc-video {
  border: 0;
  border-radius: 0;
  flex: 1;
}

.tc-card-body--fill .tc-map-canvas--empty {
  min-height: 280px;
}

/* --- mapa --- */

.tc-map-canvas {
  position: relative;
  border-radius: var(--tc-r-sm);
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid var(--tc-line);
}

.tc-map-canvas img { display: block; width: 100%; height: auto; }

/* Carrossel: mapa + galeria de imagens extras no mesmo slot, uma por vez.
   As imagens ficam empilhadas (absolute) e alternam via .is-active — evita
   reflow/salto de altura ao trocar de slide. */
.tc-map-carousel {
  position: relative;
  height: 100%;
}

.tc-map-carousel-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.tc-map-carousel-img.is-active {
  position: relative;
  opacity: 1;
  pointer-events: auto;
}

.tc-map-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 12, 16, 0.55);
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  z-index: 2;
}

.tc-map-carousel:hover .tc-map-carousel-arrow { opacity: 1; }

.tc-map-carousel-arrow:hover { background: rgba(10, 12, 16, 0.85); }
.tc-map-carousel-arrow:focus-visible { opacity: 1; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.4); }

.tc-map-carousel-arrow--prev { left: 12px; }
.tc-map-carousel-arrow--next { right: 12px; }

.tc-map-carousel-dots {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
}

.tc-map-carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  padding: 0;
  transition: background 0.15s ease, transform 0.15s ease;
}

.tc-map-carousel-dot:hover { background: rgba(255, 255, 255, 0.6); }
.tc-map-carousel-dot.is-active { background: #fff; transform: scale(1.25); }

/* Clicar na imagem do mapa abre o modo tático direto — mesmo destino do
   botão "Modo tático" no header, atalho mais óbvio pra quem já está
   olhando pro mapa. */
.tc-map-canvas--clickable {
  cursor: pointer;
  outline: none !important;
}

.tc-map-canvas--clickable:hover img { filter: brightness(1.06); }
.tc-map-canvas--clickable:focus-visible { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3) !important; }

.tc-card-body--fill .tc-map-canvas img {
  height: 100%;
  object-fit: cover;
}

.tc-map-canvas--empty {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 200px;
  border-style: dashed;
  color: var(--tc-fg-mute);
}

.tc-map-canvas--empty i { font-size: 24px; opacity: 0.4; }
.tc-map-canvas--empty p { margin: 0; font-size: 12px; }

/* Estado vazio de mapa/vídeo — ação direta em vez de texto passivo. Ocupa
   o card inteiro (fill), clicável em qualquer ponto pra abrir o modal de
   upload/link, sem precisar procurar o lápis no header. */
.tc-media-empty-cta {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font: inherit;
  color: var(--tc-fg-mute);
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  cursor: pointer;
  outline: none !important;
  transition: color 0.14s, border-color 0.14s, background 0.14s;
}

.tc-media-empty-cta i { font-size: 26px; opacity: 0.5; }
.tc-media-empty-cta span { font-size: 13px; font-weight: 500; }

.tc-media-empty-cta:hover,
.tc-media-empty-cta:focus-visible {
  color: var(--tc-fg);
  background: var(--tc-bg-hover);
  border-color: rgba(255, 255, 255, 0.24);
  outline: none !important;
}

.tc-media-empty-cta:hover i { opacity: 0.75; }

/* --- galeria de imagens da tática --- */

.tc-image-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tc-image-item {
  position: relative;
  border-radius: var(--tc-r-sm);
  overflow: hidden;
  background: #0a0c10;
  border: 1px solid var(--tc-line);
  cursor: grab;
  transition: opacity 0.14s, border-color 0.14s, transform 0.14s var(--tc-ease);
}

.tc-image-item img { display: block; width: 100%; height: auto; pointer-events: none; }

.tc-image-item.is-dragging { opacity: 0.4; }

.tc-image-item.is-drop-target {
  border-color: var(--tc-accent);
  transform: translateY(2px);
}

/* Alça de arrastar — só aparece no hover, mesmo espírito das ações da
   árvore lateral (opacidade em vez de layout mudando). */
.tc-image-item-drag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: #9aa3b2;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 5px;
  opacity: 0;
  transition: opacity 0.12s;
}

.tc-image-item:hover .tc-image-item-drag { opacity: 1; }

.tc-image-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.tc-image-remove:hover { background: rgba(0, 0, 0, 0.75); }

.tc-image-title {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  font: inherit;
  font-size: 12.5px;
  color: var(--tc-fg);
  background: rgba(255, 255, 255, 0.03);
  border: 0;
  border-top: 1px solid var(--tc-line);
  outline: none !important;
  box-shadow: none !important;
}

.tc-image-title::placeholder { color: var(--tc-fg-mute); }
.tc-image-title:focus { background: rgba(255, 255, 255, 0.06); }

/* --- inputs inline --- */

.tc-inline-input {
  height: 28px;
  padding: 0 10px;
  font: inherit;
  font-size: 11.5px;
  color: var(--tc-fg-soft);
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid transparent;
  border-radius: var(--tc-r-xs);
  outline: none;
  transition: border-color 0.15s, color 0.15s;
  min-width: 200px;
}

.tc-inline-input:focus { color: var(--tc-fg); border-color: var(--tc-line-strong); }
.tc-inline-input::placeholder { color: var(--tc-fg-mute); }
.tc-inline-input--wide { width: 100%; height: 34px; font-size: 12.5px; margin-bottom: 14px; }

/* --- listas --- */

.tc-util-list,
.tc-step-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tc-util {
  display: grid;
  grid-template-columns: 22px minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.5fr) 24px;
  align-items: center;
  gap: 6px;
}

/* Ícones de agente/habilidade — mesmo fundo gradiente por agente usado em
   /lineups e na árvore lateral de /tactics (backgroundGradientColors). */
.tc-util-agent-icon,
.tc-util-ability-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  flex: none;
  background: linear-gradient(160deg, var(--g0, #1a1a2e) 0%, var(--g1, #0f1923) 50%, var(--g2, #1a1a2e) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--tc-fg-mute);
  font-size: 11px;
}

.tc-util-agent-icon img,
.tc-util-ability-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ícone de habilidade usa o MESMO gradiente do agente dono (--g0/g1/g2
   herdados via style inline, igual /lineups .lu-ability-popup-icon) —
   não um fundo neutro. */
.tc-util-ability-icon img { object-fit: contain; padding: 4px; }

.tc-util-order,
.tc-step-order {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--tc-fg-mute);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 5px;
}

.tc-util input,
.tc-step-text {
  width: 100%;
  padding: 6px 9px;
  font: inherit;
  font-size: 12.5px;
  color: var(--tc-fg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: var(--tc-r-xs);
  outline: none !important;
  box-shadow: none !important;
  resize: none;
  transition: border-color 0.15s, background 0.15s;
}

/* --- dropdown customizado de agente/habilidade ---
   Não é <select> nativo: o rótulo de <optgroup> é desenhado pelo SO em
   vários navegadores, ignorando qualquer CSS — texto branco sobre fundo
   branco sem jeito de corrigir. Este popup é HTML/CSS 100% da página,
   sempre no tema escuro certo. */

.tc-util-dropdown { position: relative; min-width: 0; }

.tc-util-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 6px 5px 4px;
  font: inherit;
  font-size: 12px;
  color: var(--tc-fg);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: var(--tc-r-xs);
  cursor: pointer;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color 0.15s, background 0.15s;
}

.tc-util-dropdown-trigger:hover { background: rgba(255, 255, 255, 0.055); }
.tc-util-dropdown-trigger[aria-expanded="true"] { background: rgba(255, 255, 255, 0.055); border-color: var(--tc-line-strong) !important; }
.tc-util-dropdown-trigger:disabled { opacity: 0.45; cursor: not-allowed; }

.tc-util-dropdown-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.tc-util-dropdown-caret { flex: none; font-size: 9px; color: var(--tc-fg-mute); }

/* Estado de repouso (dentro do .tc-util-dropdown, no fluxo normal do
   documento) — na prática só existe assim por uma fração de segundo,
   porque abrir move o menu pro <body> (ver .tc-util-dropdown-menu--portal
   e toggleUtilDropdown no JS). Sem o portal, o overflow:hidden do .tc-card
   ancestral cortava o menu — nenhum z-index resolve overflow:hidden. */
.tc-util-dropdown-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  width: max(100%, 220px);
  max-height: 280px;
  overflow-y: auto;
  padding: 6px;
  background: #14171d;
  border: 1px solid var(--tc-line-strong);
  border-radius: var(--tc-r-sm);
  box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.5);
}

/* Aberto: portado pro <body>, position:fixed com left/top/width setados
   via JS (getBoundingClientRect do trigger) — z-index acima de qualquer
   coisa na página, incluindo o Modo Tático. */
.tc-util-dropdown-menu--portal {
  position: fixed;
  z-index: 9999;
}

.tc-util-dropdown-group-label {
  padding: 6px 8px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tc-fg-mute);
}

.tc-util-dropdown-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  font: inherit;
  font-size: 12.5px;
  color: var(--tc-fg);
  background: transparent;
  border: 0;
  border-radius: var(--tc-r-xs);
  cursor: pointer;
  text-align: left;
  outline: none !important;
}

.tc-util-dropdown-option:hover,
.tc-util-dropdown-option:focus-visible { background: var(--tc-bg-hover); }
.tc-util-dropdown-option.is-selected { background: var(--tc-accent-soft); color: var(--tc-fg); }

.tc-util-dropdown-empty {
  padding: 8px;
  font-size: 12px;
  font-style: italic;
  color: var(--tc-fg-mute);
}

.tc-util input:focus,
.tc-step-text:focus {
  background: rgba(255, 255, 255, 0.055);
  border-color: var(--tc-line-strong) !important;
}

.tc-util input::placeholder,
.tc-step-text::placeholder { color: var(--tc-fg-mute); }

.tc-util .tc-row-action,
.tc-step .tc-row-action { opacity: 0.45; margin-left: 0; }

.tc-util:hover .tc-row-action,
.tc-step:hover .tc-row-action { opacity: 1; }

/* --- passos --- */

.tc-step {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 24px;
  align-items: start;
  gap: 8px;
}

.tc-step-order { margin-top: 4px; }
.tc-step-text { min-height: 32px; line-height: 1.55; overflow: hidden; }
.tc-step .tc-row-action { margin-top: 5px; }

/* --- notas --- */

.tc-notes {
  width: 100%;
  min-height: 96px;
  padding: 12px 14px;
  font: inherit;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--tc-fg);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  border-radius: var(--tc-r-sm);
  outline: none;
  resize: none;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.tc-notes:focus { background: rgba(255, 255, 255, 0.045); border-color: var(--tc-line-strong); }
.tc-notes::placeholder { color: var(--tc-fg-mute); }

.tc-notes-count {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: var(--tc-fg-mute);
  text-align: right;
}

/* Badge "7/7" no lugar do botão Adicionar quando a lista bate o teto —
   mesmo espaço, sem convidar a clicar em algo que vai só mostrar aviso. */
.tc-list-limit {
  padding: 4px 9px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--tc-fg-mute);
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--tc-r-xs);
}

/* --- vídeo --- */

.tc-video {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--tc-r-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--tc-line);
}

.tc-video iframe,
.tc-video video { width: 100%; height: 100%; border: 0; display: block; }

/* Iframes de vídeo (YouTube/Twitch) renderizam numa camada de composição
   própria do navegador que às vezes ignora z-index do DOM — nem um
   z-index gigante no dropdown garante ficar por cima em 100% dos
   navegadores/GPUs. Em vez de esconder o iframe (visibility:hidden virava
   um retângulo preto sólido feio), cobre-se o vídeo com um véu real no
   fluxo normal do documento (não compete pixel-a-pixel com a camada do
   iframe — é um elemento OUTRO desenhado por cima dele no mesmo
   container). Dá a sensação de "o vídeo recua, o dropdown é o foco" em
   vez de simplesmente apagar a tela. */
.tc-video::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(6, 8, 12, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s ease;
}

body.tc-dropdown-active .tc-video::after {
  opacity: 1;
}

.tc-video-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--tc-accent);
  text-decoration: none;
}

.tc-video-link:hover { text-decoration: underline; }

.tc-list-empty {
  margin: 0;
  padding: 6px 2px;
  font-size: 12px;
  color: var(--tc-fg-mute);
  list-style: none;
}

/* --- vazio do main --- */

.tc-empty-main {
  flex: 1;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  padding: 40px;
  text-align: center;
}

.tc-empty-mark {
  width: 34px;
  height: 34px;
  transform: rotate(45deg);
  border: 2px solid #1a1d24;
  border-radius: 5px;
  opacity: 0.55;
  animation: tc-breathe 3.4s ease-in-out infinite;
}

@keyframes tc-breathe {
  0%, 100% { opacity: 0.3; transform: rotate(45deg) scale(0.94); }
  50%      { opacity: 0.7; transform: rotate(45deg) scale(1); }
}

.tc-empty-main h2 {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #1a1d24;
}

.tc-empty-main p {
  margin: 0;
  max-width: 380px;
  font-size: 13px;
  line-height: 1.65;
  color: #4a4f5a;
}

/* --- loading --- */

/* display explícito vence o atributo [hidden] da UA stylesheet — reafirmar. */
.tc-loading[hidden],
.tc-menu[hidden] { display: none; }

.tc-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: rgba(15, 17, 21, 0.6);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.tc-spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--tc-line-strong);
  border-top-color: var(--tc-accent);
  border-radius: 50%;
  animation: tc-spin 0.7s linear infinite;
}

@keyframes tc-spin { to { transform: rotate(360deg); } }

/* =====================================================
   MODAIS — renderizados em document.body, fora de .tc-page
   ===================================================== */

.tc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(5, 6, 9, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

.tc-modal-overlay.is-open { opacity: 1; }

.tc-modal {
  width: min(var(--tc-modal-w, 480px), 100%);
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: #14171d;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 14px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.6);
  color: #e9ecf1;
  font-family: 'Inter', system-ui, sans-serif;
  transform: translateY(10px) scale(0.985);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.tc-modal-overlay.is-open .tc-modal { transform: none; }

.tc-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.tc-modal-title {
  margin: 0;
  font-family: 'Rajdhani', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tc-modal-sub { margin: 4px 0 0; font-size: 12px; color: #626b7a; }
.tc-modal-hint { margin: 0 0 14px; font-size: 12.5px; color: #9aa3b2; }
.tc-modal-message { margin: 0; font-size: 13.5px; line-height: 1.65; color: #9aa3b2; }

.tc-modal-body { padding: 20px 22px; overflow-y: auto; }

.tc-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.tc-modal-btns { display: flex; gap: 8px; margin-left: auto; }

.tc-modal-counter {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: #626b7a;
}

/* --- roster: agentes agrupados por função --- */

.tc-roster { display: flex; flex-direction: column; gap: 20px; }

.tc-role-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: #9aa3b2;
}

.tc-role-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #626b7a;
}

/* Cores de função do Valorant — leitura instantânea de composição. */
.tc-role-dot--duelist    { background: #ff7a45; box-shadow: 0 0 8px rgba(255, 122, 69, 0.6); }
.tc-role-dot--initiator  { background: #35d0d6; box-shadow: 0 0 8px rgba(53, 208, 214, 0.6); }
.tc-role-dot--controller { background: #a97bff; box-shadow: 0 0 8px rgba(169, 123, 255, 0.6); }
.tc-role-dot--sentinel   { background: #4ade80; box-shadow: 0 0 8px rgba(74, 222, 128, 0.6); }

.tc-role-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9.5px;
  color: #626b7a;
  background: rgba(255, 255, 255, 0.05);
  padding: 1px 5px;
  border-radius: 4px;
}

.tc-agent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.tc-agent-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 0 0 9px;
  background: linear-gradient(160deg, var(--agent-g0, #1a1a2e) 0%, var(--agent-g1, #0f1923) 50%, var(--agent-g2, #1a1a2e) 100%);
  border: 1px solid transparent;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.14s, transform 0.14s, opacity 0.14s;
}

.tc-agent-portrait {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 0;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.tc-agent-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}

.tc-agent-portrait i { font-size: 18px; color: #626b7a; }

.tc-agent-check {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
  background: rgba(255, 70, 85, 0.55);
  opacity: 0;
  transform: scale(0.85);
  transition: opacity 0.16s, transform 0.16s;
}

.tc-agent-name {
  max-width: 100%;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #e9ecf1;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
  transition: color 0.14s;
}

.tc-agent-abilities {
  display: flex;
  gap: 3px;
  padding: 0 6px;
  opacity: 0.85;
  transition: opacity 0.16s;
}

.tc-ability {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.28);
}

.tc-ability img {
  width: 11px;
  height: 11px;
  object-fit: contain;
}

/* hover */
.tc-agent-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
}

.tc-agent-card:hover .tc-agent-portrait img { transform: scale(1.04); }
.tc-agent-card:hover .tc-agent-abilities { opacity: 1; }

.tc-agent-card:focus-visible {
  outline: none;
  border-color: rgba(255, 255, 255, 0.35);
}

/* selecionado */
.tc-agent-card.is-selected {
  border-color: rgba(255, 70, 85, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 70, 85, 0.75);
}

.tc-agent-card.is-selected .tc-agent-check { opacity: 1; transform: none; }

/* Roster cheio: quem não entrou apaga em vez de fingir ser clicável. */
.tc-roster.is-full .tc-agent-card:not(.is-selected) { opacity: 0.3; }
.tc-roster.is-full .tc-agent-card:not(.is-selected):hover {
  opacity: 0.45;
  transform: none;
  cursor: not-allowed;
}

/* --- slots escolhidos no rodapé --- */

.tc-picked { display: flex; align-items: center; gap: 6px; }

.tc-picked-slot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  border: 1px dashed rgba(255, 255, 255, 0.14);
  overflow: hidden;
}

.tc-picked-slot.is-filled {
  border: 1px solid rgba(255, 70, 85, 0.5);
  border-style: solid;
  animation: tc-pop-slot 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tc-picked-slot img { width: 100%; height: 100%; object-fit: cover; }

@keyframes tc-pop-slot {
  from { transform: scale(0.6); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.tc-picked .tc-modal-counter { margin-left: 6px; }

/* --- campos do modal --- */

.tc-field { display: block; margin-bottom: 16px; }
.tc-field > span {
  display: block;
  margin-bottom: 7px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #626b7a;
}

.tc-field input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  font: inherit;
  font-size: 13.5px;
  color: #e9ecf1;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  outline: none;
  transition: border-color 0.15s;
}

.tc-field input:focus { border-color: rgba(255, 255, 255, 0.35); }

/* --- upload por arquivo (clique ou arrastar) --- */

.tc-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding: 22px 16px;
  text-align: center;
  color: #626b7a;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.tc-dropzone i { font-size: 20px; opacity: 0.55; }

.tc-dropzone p { margin: 0; font-size: 12.5px; line-height: 1.5; }
.tc-dropzone p strong { color: #e9ecf1; font-weight: 600; }

.tc-dropzone:hover,
.tc-dropzone:focus-visible {
  color: #9aa3b2;
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.22);
}

.tc-dropzone.is-dragover {
  color: #e9ecf1;
  background: rgba(255, 70, 85, 0.06);
  border-color: rgba(255, 70, 85, 0.5);
}

.tc-dropzone.is-uploading {
  pointer-events: none;
  opacity: 0.7;
}

.tc-dropzone-status {
  font-size: 11.5px;
  color: #9aa3b2;
}
.tc-dropzone-status:empty { display: none; }

.tc-segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.035);
  border-radius: 9px;
}

.tc-segmented button {
  height: 32px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9aa3b2;
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.tc-segmented button:hover { color: #e9ecf1; }
.tc-segmented button.is-active { color: #fff; background: rgba(255, 255, 255, 0.09); }
.tc-segmented button[data-side="attack"].is-active  { background: rgba(255, 70, 85, 0.22); color: #ff8b95; }
.tc-segmented button[data-side="defense"].is-active { background: rgba(70, 160, 255, 0.22); color: #8fc4ff; }

/* =====================================================
   RESPONSIVO
   ===================================================== */

@media (max-width: 1180px) {
  .tc-doc { padding: 32px 24px 80px; }
  .tc-main-head { padding: 12px 24px; }
  .tc-doc-row { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  #page-tactics.tc-page {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(180px, 38vh) 1fr;
    height: auto;
    min-height: calc(100vh - var(--header-height, 64px));
    overflow: visible;
  }

  .tc-sidebar { border-right: 0; border-bottom: 1px solid var(--tc-line); }
  .tc-main-head { flex-wrap: wrap; gap: 12px; }
  .tc-crumbs { order: 2; width: 100%; }
  .tc-main-actions { order: 1; margin-left: auto; }
  .tc-doc { padding: 24px 16px 72px; }
  .tc-util {
    grid-template-columns: 22px minmax(0, 1fr) 24px;
    row-gap: 6px;
  }
  .tc-util [data-util-dropdown="ability"],
  .tc-util .tc-util-timing { grid-column: 2; }
}

@media (prefers-reduced-motion: reduce) {
  #page-tactics.tc-page *,
  .tc-modal-overlay * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
