/* Minimal, clean UI */
:root{
  --bg:#0b0f17;
  --panel:#111827;
  --card:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:rgba(255,255,255,.08);
  --shadow: 0 14px 40px rgba(0,0,0,.35);

  /* Board colors (overridden by themes) */
  --sqLight:#d1d5db;
  --sqDark:#334155;
  --sqDark2:#2b3a52;
  --boardBorder: rgba(0,0,0,.22);

  /* Entorno / moldura (white by default per requirement) */
  --surround1:#ffffff;
  --surround2:#ffffff;
  --surroundChan2:#f3f4f6;

  /* Moldura (espessura para o snapper) */
  --frameT: 34px;
  --coordColor: rgba(60,60,60,.90);
  --coordShadow: 0 1px 0 rgba(255,255,255,.35);
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  height:100%;
  min-height: 100dvh;
  height: 100dvh;
  overflow:hidden; /* evita scroll da página principal */
  display:flex;
  flex-direction:column;
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial;
  background: radial-gradient(1200px 800px at 20% 0%, rgba(34,197,94,.12), transparent 60%),
              radial-gradient(900px 700px at 90% 10%, rgba(59,130,246,.12), transparent 60%),
              var(--bg);
  color:var(--text);
}

/* ---------- App shell (sidebar + content) ---------- */
.app-shell{
  flex: 1 1 auto;
  height: 100%;
  min-height: 0;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 14px;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  overflow: hidden;
}
.content{
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display:flex;
}
.sidebar{
  min-height: 0;
  overflow: auto;
  padding: 14px 14px 10px;
}
.sidebar-head{margin-bottom:12px}
.side-title{font-weight:900; letter-spacing:.2px; font-size:15px}
.side-sub{font-size:12px; color: var(--muted); margin-top:4px}

.side-nav{display:flex; flex-direction:column; gap:10px}
.side-divider{height:1px; background: var(--line); margin: 4px 0 2px}

.side-btn{
  width: 100%;
  text-align:left;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
}
.side-btn:hover{background: rgba(255,255,255,.07)}
.side-btn:active{transform: translateY(1px)}

.side-submenu{
  margin-top: 8px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.side-option{
  width: 100%;
  text-align:left;
  padding:10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor:pointer;
}
.side-option:hover{background: rgba(255,255,255,.07)}
.side-option.active{
  border-color: rgba(255,255,255,.20);
  background: rgba(255,255,255,.09);
}

.side-toggle{
  display:flex;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
}
.side-toggle input{transform: translateY(1px)}
.side-action-btn{
  width: 100%;
  display:flex;
  align-items:center;
  justify-content:center;
  padding: 11px 12px;
  border: 1px solid rgba(34,197,94,.45);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34,197,94,.22), rgba(34,197,94,.08));
  color: var(--text);
  font-weight: 900;
  cursor:pointer;
}
.side-action-btn:hover{
  background: linear-gradient(180deg, rgba(34,197,94,.30), rgba(34,197,94,.12));
}
.side-field{
  padding:10px 12px;
  border:1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.04);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.side-label{font-size:12px; color: var(--muted)}
.side-field select{
  background: rgba(0,0,0,.15);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  padding: 6px 10px;
}

.games-panel{margin-top:8px; display:flex; flex-direction:column; gap:10px}
.games-list{display:flex; flex-direction:column; gap:10px}
.game-folder{display:flex; flex-direction:column; gap:8px}
.folder-title{font-size:12px; color: var(--muted); font-weight:800; letter-spacing:.2px}
.game-item{
  width:100%;
  text-align:left;
  padding:10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.03);
  color: var(--text);
  cursor:pointer;
}
.game-item:hover{background: rgba(255,255,255,.07)}
.game-item.active{
  border-color: rgba(34,197,94,.35);
  background: rgba(34,197,94,.10);
}

.sidebar-foot{margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line)}

.sidebar-toggle{
  position:absolute;
  top: 10px;
  left: 10px;
  z-index: 5;
  display:none; /* desktop */
}

.mobile-bar{display:none;}
.mobile-playbar{display:none;}
.btn-moves{white-space:nowrap}

.sidebar-overlay{
  display:none; /* desktop */
}

/* Mobile: sidebar vira drawer */
@media (max-width: 980px){
  body{overflow:hidden}
  .app-shell{
    grid-template-columns: 1fr;
    padding: 8px;
    padding-left: calc(env(safe-area-inset-left) + 8px);
    padding-right: calc(env(safe-area-inset-right) + 8px);
  }
  /* Mobile layout: empilhar barra ☰ + conteúdo */
  .content{display:block;}
  .mobile-bar{
    display:flex;
    align-items:center;
    justify-content:flex-start;
    gap:10px;
    padding: calc(env(safe-area-inset-top) + 4px) 6px 4px;
    margin-bottom: 6px;
  }
  .mobile-bar .sidebar-toggle{
    display:inline-flex !important;
    position:static !important;
    inset:auto !important;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 24px;
    padding: 0;
  }

  /* Tabuleiro centralizado e 100% visível no mobile */
  .board-host{justify-content:center;}
  .board-wrap{margin: 0 auto;}

  /* Playbar mobile (seletor + slider) junto aos controles */
  .mobile-playbar{
    display:flex;
    flex-direction:column;
    gap: 10px;
    margin-top: 10px;
  }
  .mobile-playbar .mobile-row{
    display:flex;
    align-items:center;
    gap: 10px;
  }
  #gameSelectMobile{
    flex: 1 1 auto;
    min-width: 0;
    height: 50px;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.06);
    color: var(--text);
    outline:none;
  }
  #moveSliderMobile{
    flex: 1 1 auto;
    min-width: 0;
    height: 50px;
  }
  .btn-moves{
    height: 50px;
    padding: 0 16px;
    border-radius: 16px;
    font-size: 15px;
  }
  .mobile-ply{
    min-width: 84px;
    text-align:right;
  }

  /* Aproximar painel de lances do tabuleiro */
  .moves-panel.sheet{
    left: 8px;
    right: 8px;
    bottom: 6px;
    --sheetPeek: 40px;
  }

  .sidebar{
    position: fixed;
    top: 10px;
    bottom: 10px;
    left: 10px;
    width: min(320px, 92vw);
    transform: translateX(-110%);
    transition: transform .22s ease;
    z-index: 50;
  }
  body.sidebar-open .sidebar{transform: translateX(0)}
  .sidebar-toggle{display:inline-flex; position:fixed; top: calc(env(safe-area-inset-top) + 8px); left: calc(env(safe-area-inset-left) + 8px); z-index: 60; width: 46px; height: 46px; padding: 0; border-radius: 16px; font-size: 22px; line-height: 1}
  /* Mobile: compactar espaçamentos e maximizar área útil do tabuleiro */
  .board-panel{gap:10px}

  .sidebar-overlay{
    display:block;
    position: fixed;
    inset:0;
    background: rgba(0,0,0,.45);
    opacity:0;
    pointer-events:none;
    transition: opacity .22s ease;
    z-index: 40;
  }
  body.sidebar-open .sidebar-overlay{
    opacity:1;
    pointer-events:auto;
  }
}

/* PlayOK-like board + pieces (somente visual) */
body.theme-playok{
  --sqLight:#f2f2e1;
  --sqDark:#57aa6a;
  --sqDark2:#4fa260;
  --boardBorder: rgba(0,0,0,.22);
  --surround1:#ffffff;
  --surround2:#ffffff;
  --surroundChan2:#f3f4f6;
}
body.theme-dambo{
  --sqLight:#b3cce3;
  --sqDark:#258ecd;
  --sqDark2:#1f7fb8;
  --boardBorder: rgba(0,0,0,.22);
  --surround1:#ffffff;
  --surround2:#ffffff;
  --surroundChan2:#f3f4f6;
}

body.theme-playok .board{border-radius: 0}
body.theme-playok .square.dark{background: var(--sqDark)}
body.theme-playok .square.light{background: var(--sqLight)}
body.theme-playok .square .dot{background: rgba(0,0,0,.55)}


/* Ajuste fino para ficar mais parecido com os exemplos (cores + bordas) */
body.theme-playok .piece.white{
  --pFace: radial-gradient(circle at 35% 25%, #ffffff, #eef2f6 62%, #e6ebf0 100%);
  --pRim:  #f6f8fb;
  --pInner: rgba(0,0,0,.18);
  color: rgba(0,0,0,.55);
}
body.theme-playok .piece.black{
  --pFace: radial-gradient(circle at 35% 25%, var(--pRedFaceHi), var(--pRedFace) 62%, #c9251d 100%);
  --pRim:  var(--pRedRim);
  --pInner: rgba(255,255,255,.18);
  color: var(--pRedText);
}
/* Rei no estilo PlayOK: anel (em vez do símbolo ♛) */
body.theme-playok .piece.king::after{
  content: "";
  width: 54%;
  height: 54%;
  border-radius: 999px;
  border: 7px solid var(--pKingRingRed);
  box-shadow: inset 0 0 0 3px rgba(0,0,0,.10);
}


/* Rei branco precisa de mais contraste (anel escuro + interno claro) */
body.theme-playok .piece.white.king::after{
  border-color: var(--pKingRingWhite);
  box-shadow: inset 0 0 0 4px rgba(255,255,255,.95), 0 2px 6px rgba(0,0,0,.25);
}

.topbar{
  flex: 0 0 auto;
  display:flex; gap:14px; align-items:center; justify-content:space-between;
  padding:12px 14px;
  background: rgba(15,23,42,.82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand{display:flex; gap:10px; align-items:center}
.logo{width:36px;height:36px;display:grid;place-items:center;border-radius:12px;background:rgba(255,255,255,.06);box-shadow: var(--shadow)}
.title{font-weight:800; letter-spacing:.2px}
.subtitle{font-size:12px;color:var(--muted)}
.top-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;justify-content:flex-end}
.toggle{display:flex; gap:8px; align-items:center; padding:6px 10px; border:1px solid var(--line); border-radius:12px; background:rgba(255,255,255,.04)}
.toggle-sound{padding:6px 8px}
.toggle-sound span{font-size:12px}
.btn{
  padding:8px 12px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.04);
  color:var(--text);
  cursor:pointer;
}
.btn:hover{background:rgba(255,255,255,.07)}
.btn:active{transform: translateY(1px)}
.layout{
  flex: 1 1 auto;
  min-height: 0; /* crucial para evitar overflow com flex */
  width: 100%;
  margin: 0;
  padding: 0;
  display:grid;
  grid-template-columns: 1.25fr .75fr;
  gap:14px;
  overflow:hidden; /* sem scroll no wrapper; cada painel pode rolar */
}
@media (max-width: 1100px){
  .layout{
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
  .moves-panel{
    width: 100%;
    justify-self: stretch;
    max-height: 42vh;
  }
}
.card{
  background: rgba(15,23,42,.78);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
}
.board-panel{display:flex; flex-direction:column; gap:14px; min-height:0}
.board-host{
  flex: 1 1 auto;
  min-height: 0;
  display:flex;
  align-items:center;
  justify-content:center;
}

.board-wrap{
  position: relative;
  width: calc(var(--boardSize, 520px) + 2*var(--frameT));
  height: calc(var(--boardSize, 520px) + 2*var(--frameT));
  max-width: 100%;
  max-height: 100%;
  margin: 0 auto;
  padding: var(--frameT);
  overflow: visible;
  border-radius: 0;

  /* Entorno branco conforme solicitado */
  background: linear-gradient(180deg, var(--surround1) 0%, var(--surround2) 100%);
  border: 1px solid rgba(0,0,0,.10);
  box-shadow:
    0 18px 55px rgba(0,0,0,.55),
    0 0 0 1px rgba(255,255,255,.12);
}


.board-wrap::before{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;

  /* Detalhe de encaixe/junção nos cantos (estilo miter) */
  background:
    /* sombra */
    linear-gradient(45deg, rgba(0,0,0,.42) 0 3px, transparent 3px) 0 0/72px 72px no-repeat,
    linear-gradient(-45deg, rgba(0,0,0,.42) 0 3px, transparent 3px) 100% 0/72px 72px no-repeat,
    linear-gradient(-45deg, rgba(0,0,0,.42) 0 3px, transparent 3px) 0 100%/72px 72px no-repeat,
    linear-gradient(45deg, rgba(0,0,0,.42) 0 3px, transparent 3px) 100% 100%/72px 72px no-repeat,

    /* highlight */
    linear-gradient(45deg, rgba(255,255,255,.20) 0 2px, transparent 2px) 0 0/72px 72px no-repeat,
    linear-gradient(-45deg, rgba(255,255,255,.20) 0 2px, transparent 2px) 100% 0/72px 72px no-repeat,
    linear-gradient(-45deg, rgba(255,255,255,.20) 0 2px, transparent 2px) 0 100%/72px 72px no-repeat,
    linear-gradient(45deg, rgba(255,255,255,.20) 0 2px, transparent 2px) 100% 100%/72px 72px no-repeat;

  box-shadow:
    inset 0 3px 0 rgba(255,255,255,.18),
    inset 0 -7px 12px rgba(0,0,0,.32),
    inset 0 0 0 1px rgba(0,0,0,.35);
}

.board-wrap::after{
  content:"";
  position:absolute;
  pointer-events:none;

  /* "Canal" interno onde o tabuleiro encaixa */
  inset: calc(var(--frameT) - 7px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.16)),
    linear-gradient(180deg, var(--surround1) 0%, var(--surroundChan2) 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,.18),
    inset 0 -2px 8px rgba(0,0,0,.28),
    0 0 0 1px rgba(255,255,255,.10),
    0 0 0 2px rgba(0,0,0,.30);
}

.coords{
  pointer-events:none;
  position:absolute;
  inset:0;
  z-index:4;
}

.coords .files{
  position:absolute;
  left: var(--frameT);
  right: var(--frameT);
  bottom: calc(var(--frameT)/2 - 8px);
  display:grid;
  grid-template-columns: repeat(8, 1fr);
}

.coords .ranks{
  position:absolute;
  top: var(--frameT);
  bottom: var(--frameT);
  left: calc(var(--frameT)/2 - 8px);
  display:grid;
  grid-template-rows: repeat(8, 1fr);
}

.coords .files div,
.coords .ranks div{
  display:flex;
  align-items:center;
  justify-content:center;
  color: var(--coordColor);
  text-shadow: var(--coordShadow);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .4px;
}


/* Moldura do tabuleiro (somente visual; não altera o tamanho do tabuleiro) */


.board{
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 2;
  border-radius: 0;
  overflow:hidden;
  display:grid;
  grid-template-columns: repeat(8, 1fr);
  grid-template-rows: repeat(8, 1fr);
  border: 0;
  box-shadow: var(--shadow);
  background: var(--sqLight);
  transform: translateZ(0);
}
.square{position:relative; display:flex; align-items:center; justify-content:center; user-select:none; min-width:0; min-height:0; overflow:hidden}
.square{transform: translateZ(0)}
.square.light{background: var(--sqLight)}
.square.dark{background: linear-gradient(180deg, var(--sqDark), var(--sqDark2))}
.square .dot{
  width: 9px; height: 9px;
  border-radius: 999px;
  opacity: .0;
  background: rgba(255,255,255,.85);
}
.square.highlight .dot{opacity:.95}
.piece{
  position:absolute;
  left:50%; top:50%;
  transform: translate(-50%,-50%);
  width: 78%;
  height: 78%;
  border-radius: 999px;
  display:grid;
  place-items:center;
  font-weight:900;

  /* Base "disco" (mais parecido com as peças de exemplo) */
  background:
    radial-gradient(circle at 34% 26%, rgba(255,255,255,.28), rgba(255,255,255,0) 36%),
    radial-gradient(circle at 50% 70%, rgba(0,0,0,.22), rgba(0,0,0,0) 58%),
    var(--pFace, #111);
  border: 6px solid var(--pRim, rgba(255,255,255,.12));
  box-shadow:
    0 10px 18px rgba(0,0,0,.55),
    inset 0 2px 2px rgba(255,255,255,.28),
    inset 0 -8px 12px rgba(0,0,0,.30);
}

/* ---- Peças por imagens (pics/*.png) ----
   Quando o JS encontra as imagens, ele adiciona a classe .has-img.
   Se a imagem não existir, a classe é removida e o estilo "desenhado" em CSS volta.
*/
.piece.has-img{
  width: 86%;
  height: 86%;
  border-radius: 0;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  display:flex;
  align-items:center;
  justify-content:center;
}
.piece.has-img::before,
.piece.has-img::after{
  content: none !important;
  display:none !important;
}
.piece-img{
  width: 100%;
  height: 100%;
  display:block;
  object-fit: contain;
  user-select:none;
  pointer-events:none;
  -webkit-user-drag:none;
  filter: drop-shadow(0 10px 16px rgba(0,0,0,.45));
}

.piece::before{
  content:"";
  width: 52%;
  height: 52%;
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,.18), rgba(255,255,255,0) 58%),
    rgba(255,255,255,.02);
  box-shadow:
    inset 0 0 0 2px var(--pInner, rgba(0,0,0,.16)),
    inset 0 6px 10px rgba(0,0,0,.18);
  opacity:.95;
}

.piece.white{
  --pFace: radial-gradient(circle at 35% 25%, #ffffff, #eef2f6 62%, #e6ebf0 100%);
  --pRim:  #f6f8fb;
  --pInner: rgba(0,0,0,.16);
  color: rgba(0,0,0,.55);
}

.piece.black{
  /* no estilo PlayOK (theme-playok) isso vira "vermelha" via vars abaixo */
  --pFace: radial-gradient(circle at 35% 25%, rgba(255,255,255,.18), rgba(2,6,23,.92));
  --pRim: rgba(255,255,255,.12);
  --pInner: rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
}

/* Padrão (fora do PlayOK): mantém o símbolo ♛ */
.piece.king::after{
  content: "♛";
  font-size: 20px;
  transform: translateY(-1px);
  opacity:.9;
}

/* Capturas seguem o efeito direto do tabuleiro principal do DamExpert. */

/* Controles abaixo do tabuleiro */
.board-controls{
  padding:10px 12px;
  /* mantém a mesma largura do tabuleiro */
  width: min(var(--boardSize, 520px), 100%);
  max-width: var(--boardSize, 520px);
  margin: 0 auto;
}
.btn-row{display:flex; gap:8px; align-items:center; flex-wrap:wrap}
.btn-row .spacer{flex:1 1 auto}
.btn.primary{border-color: rgba(34,197,94,.55); background: rgba(34,197,94,.12)}
.btn.primary:hover{background: rgba(34,197,94,.18)}

.small{font-size:12px;color:var(--muted)}
.meta{padding:12px}
.meta-grid{display:grid; grid-template-columns: repeat(3, 1fr); gap:10px}
@media (max-width: 560px){
  .meta-grid{grid-template-columns: repeat(2, 1fr)}
}
.k{font-size:11px;color:var(--muted)}
.v{font-weight:700}
.loaders{padding:12px; display:grid; gap:12px}
.loader .h{font-weight:800; margin-bottom:6px}

/* ----------------- Modo Treino (tático) ----------------- */
.train-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
  flex-wrap:wrap;
}
.train-toggle{
  display:inline-flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  user-select:none;
  font-size:13px;
  color: var(--text);
}
.train-toggle input{
  accent-color: var(--accent);
}
.train-status{
  flex: 1 1 auto;
  min-width: 140px;
  padding: 6px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
}
.train-status.ok{
  border-color: rgba(52,211,153,.55);
}
.train-status.err{
  border-color: rgba(251,113,133,.6);
}

body.training .square{ cursor:pointer; }

.square.selected{
  outline: 3px solid rgba(52,211,153,.95);
  outline-offset: -3px;
}

.square.path{
  outline: 2px solid rgba(255,255,255,.22);
  outline-offset: -3px;
}
.square.wrong{
  outline: 3px solid rgba(251,113,133,.9);
  outline-offset: -3px;
  animation: sqShake .22s linear 1;
}
@keyframes sqShake{
  0%{ transform: translateZ(0) translateX(0); }
  25%{ transform: translateZ(0) translateX(-2px); }
  50%{ transform: translateZ(0) translateX(2px); }
  75%{ transform: translateZ(0) translateX(-1px); }
  100%{ transform: translateZ(0) translateX(0); }
}

.hint{font-size:12px;color:var(--muted); margin-top:6px}
.row{display:flex; gap:8px}
input[type="file"], input[type="text"]{
  width:100%;
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.moves-panel{
  padding:10px;
  display:flex;
  flex-direction:column;
  min-height: 0;
  overflow:hidden;
  justify-self: end;
  /* proporcional ao tabuleiro (ajustado via JS em --boardSize) */
  width: min(440px, calc(var(--boardSize, 520px) * .92));
}


.moves{flex:1 1 auto; min-height:0; overflow:auto; padding-right:4px}

/* Melhor contraste no select e lista */
select{
  padding:8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
}
select option{background: #0b1220; color: var(--text)}
.moves-head{display:flex; gap:10px; align-items:center; justify-content:space-between}
.moves-head .h{font-weight:900}
select{
  padding:10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.controls{margin-top:10px}
#moveSlider{width:100%}
.small{font-size:12px;color:var(--muted); margin-top:4px}
.moves{
  margin-top:10px;
  padding:8px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(0,0,0,.14);
  overflow:auto;
  flex:1;
  font-size: 13px;
}
.move-row{display:grid; grid-template-columns: 44px 1fr 1fr; gap:8px; padding:6px 8px; border-radius: 12px}
.move-row:hover{background: rgba(255,255,255,.04)}
.move-no{color:var(--muted); font-weight:800}
.move{
  padding:4px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor:pointer;
  white-space: nowrap;
  overflow:hidden;
  text-overflow: ellipsis;
}
.move.active{border-color: rgba(34,197,94,.55); background: rgba(34,197,94,.10)}
.move.missing{opacity:.25; cursor:default}
.notation-flow{
  line-height: 1.85;
}
.notation-line{
  white-space: normal;
  word-break: normal;
}
.notation-flow .move-no{
  display: inline;
  margin-right: 3px;
}
.notation-flow .move{
  display: inline-block;
  vertical-align: baseline;
  margin: 1px 2px;
  max-width: none;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
.notation-flow .move.not-clickable{
  cursor: default;
}
.notation-flow .variation{
  font-style: normal;
}
.notation-flow .notation-comment{
  display: inline;
  margin: 0 2px;
  color: #64748b;
  font-weight: 500;
}
.notation-flow .variation-depth-1,
.notation-flow .variant-depth-1,
.notation-flow .variation-depth-1 .move-no{
  color: #ef4444;
}
.notation-flow .variation-depth-2,
.notation-flow .variant-depth-2,
.notation-flow .variation-depth-2 .move-no{
  color: #2563eb;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}
.notation-flow .variation-depth-3,
.notation-flow .variant-depth-3,
.notation-flow .variation-depth-3 .move-no{
  color: #7c3aed;
}
.notation-flow .notation-comment.variant-depth-1,
.notation-flow .notation-comment.variant-depth-2,
.notation-flow .notation-comment.variant-depth-3{
  color: #64748b;
}
.notation-flow .notation-comment.variant-depth-2{
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}
.debug{margin-top:10px}
.debug summary{cursor:pointer;color:var(--muted)}
.debug pre{white-space:pre-wrap; word-break:break-word; color:rgba(255,255,255,.85)}
.footer{
  max-width: 1200px;
  margin: 0 auto 18px;
  padding: 0 14px;
  color: rgba(255,255,255,.5);
  font-size: 12px;
}


/* ----- Controles extras (cores + peças) ----- */
.toggle .toggle-label{font-size:12px;color:var(--muted); font-weight:700}
.toggle select{
  padding:6px 8px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 12px;
}
.toggle input[type="color"]{
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.toggle-color input[type="text"]{
  width: 92px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font: 12px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}
.muted{color: var(--muted)}

/* ----- Dialog (Estilo de Peças) ----- */
dialog.dialog{
  border: none;
  padding: 0;
  border-radius: 18px;
  background: transparent;
  width: min(560px, calc(100vw - 28px));
}
dialog.dialog::backdrop{
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(3px);
}
.dialog-card{
  background: rgba(15,23,42,.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 18px;
  overflow: hidden;
}
.dialog-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap: 14px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}
.dialog-title{font-weight: 900; font-size: 16px; letter-spacing: .2px}
.dialog-sub{color: var(--muted); font-size: 12px; margin-top: 2px}
.dialog-body{padding: 14px}
.field{display:grid; gap:6px; margin-bottom:10px}
.field > span{font-size: 12px; color: var(--muted); font-weight: 700}
.field select{width: 100%}

.training-picker-card{
  max-width: min(520px, calc(100vw - 28px));
}
.training-picker-list{
  display:grid;
  gap: 8px;
  margin-top: 12px;
}
.training-picker-item{
  width: 100%;
  text-align:left;
  padding: 11px 12px;
  border-radius: 8px;
  border: 1px solid rgba(148,163,184,.34);
  background: rgba(255,255,255,.06);
  color: #fff;
  font-weight: 850;
  cursor:pointer;
}
.training-picker-item:hover,
.training-picker-item:focus{
  background: rgba(34,197,94,.18);
  border-color: rgba(34,197,94,.45);
  outline: none;
}
.training-picker-empty{
  padding: 10px 0;
}


.top-actions .btn{padding:8px 12px}

/* Mobile fine-tuning: maximize board area and avoid clipping on mobile browser UI */
@media (max-width: 520px){
  :root{
    --frameT: 22px; /* thinner surround so the board fits better */
  }
  .app-shell{padding: 8px}
  .board-panel{gap: 10px}
  .board-controls{padding: 12px}
}


/* --- Mobile layout fixes (v2) --- */
/* Corrige alinhamento do painel de lances no mobile (não ficar “encostado à direita”) */
@media (min-width: 981px) and (max-width: 1100px){
  .layout{
    /* garante que os dois painéis dividam a altura do viewport */
    grid-template-columns: 1fr;
    grid-template-rows: 1.35fr 0.95fr;
    height: 100%;
  }
  .moves-panel{
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    justify-self: stretch !important;
    align-self: stretch !important;
  }
}

/* Ajustes finos para telas bem pequenas */
@media (max-width: 560px){
  :root{ --frameT: 18px; }
  .app-shell{ padding: 6px; }
  .board-panel{ gap: 10px; }
  .board-controls{
    width: 100%;
    max-width: none;
  }
  .moves-panel{ padding: 10px; }
  .sidebar-toggle{
    top: calc(env(safe-area-inset-top) + 8px);
    left: calc(env(safe-area-inset-left) + 8px);
  }
}

/* Quando o usuário ativa “Versão para computador” no navegador, evitar micro-board */
@media (min-width: 981px) and (max-width: 1100px) and (pointer: coarse){
  .layout{ grid-template-rows: 1.25fr 1fr; }
}


/* ---------------- Bottom sheet (mobile) ---------------- */
.sheet-overlay{
  display:none;
}

@media (max-width: 980px){
  /* Overlay para fechar ao tocar fora */
  .sheet-overlay{
    display:block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.42);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease;
    z-index: 35;
  }
  body.sheet-open .sheet-overlay{
    opacity: 1;
    pointer-events: auto;
  }

  /* Painel de Jogos/Lances vira bottom-sheet */
  .moves-panel.sheet{
    --sheetPeek: 40px;
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 8px;
    z-index: 45;

    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    align-self: auto !important;

    height: min(72vh, 640px);
    transform: translateY(calc(100% - var(--sheetPeek)));
    transition: transform .22s ease;
    will-change: transform;
    backdrop-filter: blur(10px);
  }
  /* Quando recolhido no mobile, mostre apenas o cabeçalho (para maximizar o tabuleiro) */
  .moves-panel.sheet:not(.sheet-expanded) #gameSelect,
  .moves-panel.sheet:not(.sheet-expanded) .controls,
  .moves-panel.sheet:not(.sheet-expanded) #moves{
    display:none !important;
  }
  .moves-panel.sheet:not(.sheet-expanded){
    padding: 10px 12px;
  }
  /* Peek mais baixo: esconder botão e centralizar título */
  .moves-panel.sheet:not(.sheet-expanded) .sheet-toggle{ display:none; }
  .moves-panel.sheet:not(.sheet-expanded) .moves-head{ gap: 4px; }
  .moves-panel.sheet:not(.sheet-expanded) .moves-head-row{ justify-content: center; }
  .moves-panel.sheet:not(.sheet-expanded) .moves-head-row .h{ font-size: 14px; opacity: .85; }

  .moves-panel.sheet.sheet-expanded{
    transform: translateY(0);
  }
  .moves-panel.sheet.sheet-dragging{
    transition: none;
  }

  /* Cabeçalho em coluna + handle */
  .moves-head{
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 0px;
  }
  .moves-head-row{
    display:flex;
    align-items:center;
    justify-content: space-between;
    gap: 10px;
  }
  .sheet-grab{
    display:block;
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255,255,255,.22);
    margin: 2px auto 0;
  }
  .sheet-toggle{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,.06);
    color: var(--text);
    cursor: pointer;
  ;
    font-size: 18px;
  }
  .sheet-toggle:active{ transform: translateY(1px); }

  /* Reserva um “rodapé” para o tabuleiro/controles não ficarem sob o sheet */
  .layout{
    padding-bottom: calc(var(--sheetPeek, 0px) + 6px);
    /* No mobile com bottom-sheet, NÃO dividir a tela em 2 painéis/linhas (isso encolhe o tabuleiro). */
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    /* Evita criar linhas implícitas no grid (o sheet é position:fixed). */
    grid-auto-rows: 0 !important;
    height: 100%;
  }

  .board-panel{ grid-column: 1; grid-row: 1; }
  .moves-panel{ grid-column: 1; grid-row: 1; }

  /* No mobile, mantenha seletor/slider próximos aos controles (usar a playbar do mobile). */
  .moves-panel.sheet #gameSelect,
  .moves-panel.sheet .controls{
    display: none !important;
  }

  .board-controls{
    width: 100%;
    max-width: none;
  }
}

/* Em telas maiores, esconda os elementos do sheet */
@media (min-width: 981px){
  .sheet-grab, .sheet-toggle{ display:none; }
}


/* ---------------- Board fullscreen (mobile UI) ---------------- */
.btn-fullscreen{ display:none; }

@media (max-width: 980px){
  .btn-fullscreen{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width: 40px;
    padding-left: 10px;
    padding-right: 10px;
  }

  /* Modo “Tela cheia do tabuleiro”: esconde menu e bottom-sheet e maximiza área do tabuleiro */
  body.board-fullscreen{
    overflow:hidden;
  }
  /* Em tela cheia do tabuleiro (mobile): esconder o painel de lances, mas manter o menu acessível */
  body.board-fullscreen .sheet-overlay{
    display:none !important;
  }
  body.board-fullscreen .moves-panel{
    display:none !important;
  }
  body.board-fullscreen .layout{
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    gap: 0 !important;
    padding-bottom: 0 !important; /* remove reserva do sheet */
  }
  body.board-fullscreen .app-shell{
    padding: calc(env(safe-area-inset-top) + 8px)
             calc(env(safe-area-inset-right) + 8px)
             calc(env(safe-area-inset-bottom) + 8px)
             calc(env(safe-area-inset-left) + 8px) !important;
    gap: 0 !important;
  }
  body.board-fullscreen .board-panel{ gap: 10px; }
  body.board-fullscreen .hint{ display:none; }
  body.board-fullscreen .sidebar-toggle{ display:inline-flex !important; }
}


/* --- Treino (mobile) toast + toggle --- */
.train-toggle-mini{
  margin-left:auto;
  padding:6px 10px;
  border:1px solid var(--line);
  border-radius:12px;
  background: rgba(255,255,255,.04);
  white-space:nowrap;
}
.train-toggle-mini span{font-size:13px}

.train-toast{
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(env(safe-area-inset-bottom) + 12px);
  z-index: 120;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(0,0,0,.14);
  background: rgba(255,255,255,.95);
  color: rgba(0,0,0,.85);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  font-weight: 600;
}
.train-toast.show{opacity:1; transform: translateY(0)}

/* Desktop: posiciona no topo/centro para ficar bem visível */
@media (min-width: 981px){
  .train-toast{
    top: 14px;
    bottom: auto;
    left: 50%;
    right: auto;
    width: min(560px, calc(100% - 40px));
    transform: translate(-50%, 10px);
  }
  .train-toast.show{
    transform: translate(-50%, 0);
  }
}

/* Sucesso: balão claro (como no anexo) */
.train-toast.ok{
  background: rgba(255,255,255,.96);
  color: rgba(0,0,0,.86);
  border-color: rgba(0,0,0,.12);
}

/* Erro: cartão vermelho grande (como no anexo) */
.train-toast.err{
  background: rgba(239,68,68,.92);
  color: rgba(255,255,255,.95);
  border-color: rgba(255,255,255,.20);
  padding: 20px 16px;
  border-radius: 10px;
  font-size: 22px;
  letter-spacing: .2px;
  text-align: center;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
}
.train-toast.err .icon{ font-size: 26px; line-height: 1; opacity: .95; }
.train-toast.err .text{ display:inline-block; }

/* Botões bloqueados no treino */
.btn.disabled{
  opacity: .45;
  cursor: not-allowed;
}

/* Banner inline no desktop (abaixo do checkbox de treino) */
.train-status:empty{ display:none; }
.train-status{
  flex: 1 1 auto;
  min-width: 160px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.06);
  font-weight: 700;
}
.train-status.ok{
  border-color: rgba(34,197,94,.55);
  background: rgba(34,197,94,.14);
}
.train-status.err{
  border-color: rgba(251,113,133,.55);
  background: rgba(239,68,68,.20);
  display:flex;
  align-items:center;
  gap:10px;
}
.train-status.err .icon{ font-size: 18px; line-height: 1; }
.train-status.err .text{ font-weight: 800; }

/* ===== Treino: ocultar anotação e impedir atalhos que entregam solução ===== */
body.training .moves-panel{ display:none !important; }
body.training .layout{ grid-template-columns: 1fr; }
body.training .hint{ display:none !important; }
body.training .sidebar-foot{ display:none !important; }
body.training #btnOpenMoves{ display:none !important; }

/* =========================
   Tema claro (ui-light)
   ========================= */
.sidebar-head-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.theme-toggle{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex: 0 0 auto;
}
.theme-toggle:hover{ background: rgba(255,255,255,.07); }
.theme-toggle:active{ transform: translateY(1px); }

.theme-toggle-mobile{
  width: 46px;
  height: 46px;
  border-radius: 14px;
  padding: 0;
  font-size: 18px;
}

label.disabled{ opacity: .55; }

body.ui-light{
  --bg:#f5f7ff;
  --panel:#ffffff;
  --card:#ffffff;
  --text:#0b1220;
  --muted:#475569;
  --line: rgba(15,23,42,.16);
  --shadow: 0 14px 36px rgba(2,6,23,.12);
  --coordColor: rgba(20,20,20,.88);
  --coordShadow: 0 1px 0 rgba(255,255,255,0);
}

body.ui-light .card{
  background: rgba(255,255,255,.84);
}
body.ui-light .btn,
body.ui-light .side-btn,
body.ui-light .side-option,
body.ui-light .side-toggle,
body.ui-light .side-field,
body.ui-light .game-item,
body.ui-light .theme-toggle{
  background: rgba(15,23,42,.035);
  border-color: rgba(15,23,42,.14);
  color: var(--text);
}
body.ui-light .btn:hover,
body.ui-light .side-btn:hover,
body.ui-light .side-option:hover,
body.ui-light .side-toggle:hover,
body.ui-light .game-item:hover,
body.ui-light .theme-toggle:hover{
  background: rgba(15,23,42,.06);
}

body.ui-light .side-option.active{
  border-color: rgba(37,99,235,.30);
  background: rgba(37,99,235,.10);
}
body.ui-light .game-item.active{
  border-color: rgba(37,99,235,.30);
  background: rgba(37,99,235,.10);
}

body.ui-light select,
body.ui-light input[type="text"],
body.ui-light input[type="search"]{
  background: rgba(255,255,255,.95);
  color: var(--text);
  border-color: rgba(15,23,42,.18);
}

body.ui-light code{
  background: rgba(15,23,42,.06);
  color: #0b1220;
}

body.ui-light .sidebar-overlay,
body.ui-light .sheet-overlay{
  background: rgba(15,23,42,.45) !important;
}

/* Melhor contraste do texto dos lances no claro */
body.ui-light .moves .move{ background: rgba(15,23,42,.03); }
body.ui-light .moves .move:hover{ background: rgba(15,23,42,.06); }
body.ui-light .moves .move.active{ background: rgba(37,99,235,.10); border-color: rgba(37,99,235,.30); }
body.ui-light .moves{
  background: rgba(15,23,42,.03);
  border-color: rgba(15,23,42,.14);
}
body.ui-light .move-row:hover{ background: rgba(15,23,42,.06); }
body.ui-light .move.active{ border-color: rgba(37,99,235,.30); background: rgba(37,99,235,.10); }
body.ui-light .debug pre{ color: rgba(2,6,23,.88); }
body.ui-light .footer{ color: rgba(2,6,23,.55); }

/* ==========================================================
   Correção das caixas de seleção no tema claro
   Evita fundo escuro/preto no menu aberto dos <select>.
   ========================================================== */
body.ui-light select,
body.ui-light .side-field select,
body.ui-light #gameSelect,
body.ui-light #gameSelectMobile,
body.ui-light #boardStyleSelect,
body.ui-light #playbackSpeed{
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15,23,42,.18) !important;
  color-scheme: light;
}

body.ui-light select option,
body.ui-light #gameSelect option,
body.ui-light #gameSelectMobile option,
body.ui-light #boardStyleSelect option,
body.ui-light #playbackSpeed option,
body.ui-light select optgroup{
  background-color: #ffffff !important;
  color: #0f172a !important;
}

body.ui-light select option:checked,
body.ui-light #gameSelect option:checked,
body.ui-light #gameSelectMobile option:checked,
body.ui-light #boardStyleSelect option:checked,
body.ui-light #playbackSpeed option:checked{
  background-color: #dbeafe !important;
  color: #0f172a !important;
}

body.ui-light select:focus,
body.ui-light #gameSelect:focus,
body.ui-light #gameSelectMobile:focus,
body.ui-light #boardStyleSelect:focus,
body.ui-light #playbackSpeed:focus{
  outline: 2px solid rgba(37,99,235,.25);
  outline-offset: 2px;
}

/* ==========================================================
   Layout Base de Estudo aplicado ao Treinamento de Cálculo
   - Menu lateral em gaveta aberta pelo ícone de três traços
   - Tema claro/escuro no canto superior direito
   - Anotação do jogo à direita do tabuleiro
   ========================================================== */
body.tc-base-layout{
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background:
    radial-gradient(980px 520px at 4% 0%, rgba(34,197,94,.10), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0) 120px),
    var(--bg);
}
body.tc-base-layout .tc-topbar{
  height: 60px;
  flex: 0 0 60px;
  display: grid;
  grid-template-columns: 76px minmax(0,1fr) 86px;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(15,23,42,.80);
  backdrop-filter: blur(12px);
  box-shadow: 0 12px 34px rgba(0,0,0,.20);
  position: relative;
  z-index: 70;
}
body.ui-light.tc-base-layout .tc-topbar{
  background: rgba(255,255,255,.90);
}
.tc-topbar h1{
  margin: 0;
  text-align: center;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
  letter-spacing: .04em;
  font-weight: 1000;
  color: var(--text);
  text-transform: uppercase;
}
.tc-top-icon{
  width: 52px;
  height: 52px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,.86);
  color: #0f172a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  font-size: 22px;
  justify-self: start;
}
.tc-theme-btn{
  justify-self: end;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: var(--text);
  font-size: 18px;
}
body.ui-light .tc-theme-btn{
  background: rgba(15,23,42,.04);
  color: #0f172a;
}
.tc-top-icon:hover{ filter: brightness(1.04); transform: translateY(-1px); }
.tc-top-icon:active{ transform: translateY(0); }

body.tc-base-layout .app-shell{
  width: 100%;
  max-width: none;
  height: calc(100dvh - 60px);
  min-height: 0;
  padding: 10px 18px 10px;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  overflow: hidden;
}
body.tc-base-layout .content{
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  display: flex;
}
body.tc-base-layout .layout{
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(350px, 34vw) minmax(420px, 1fr);
  gap: 18px;
  align-items: stretch;
  overflow: hidden;
}
body.tc-base-layout .board-panel{
  min-width: 0;
  min-height: 0;
  height: 100%;
  gap: 10px;
  overflow: hidden;
}
body.tc-base-layout .board-host{
  min-height: 0;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
body.tc-base-layout .board-controls{
  flex: 0 0 auto;
  border-radius: 0;
  padding: 8px;
}
body.tc-base-layout .btn-row{
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}
body.tc-base-layout .btn-row .btn{
  min-width: 0;
  height: 36px;
  padding: 0 6px;
  border-radius: 3px;
  font-weight: 900;
  white-space: nowrap;
}
body.tc-base-layout .moves-panel{
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 0;
  overflow: hidden;
}
body.tc-base-layout .moves-head{
  flex: 0 0 auto;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
body.tc-base-layout .moves-head-row .h{
  font-size: 15px;
  font-weight: 1000;
  letter-spacing: .02em;
  text-transform: uppercase;
}
body.tc-base-layout .controls{
  flex: 0 0 auto;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}
body.tc-base-layout .moves{
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

/* Gaveta sempre oculta por padrão, em qualquer resolução. */
body.tc-base-layout .sidebar{
  position: fixed !important;
  top: 72px !important;
  left: 12px !important;
  bottom: 12px !important;
  width: min(322px, calc(100vw - 24px));
  max-height: calc(100dvh - 84px);
  z-index: 100;
  transform: translateX(calc(-100% - 24px));
  transition: transform .22s ease;
  overflow: auto;
  border-radius: 16px;
}
body.tc-base-layout.sidebar-open .sidebar{
  transform: translateX(0);
}
body.tc-base-layout .sidebar-overlay{
  display: block;
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,.48);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease;
}
body.tc-base-layout.sidebar-open .sidebar-overlay{
  opacity: 1;
  pointer-events: auto;
}
body.tc-base-layout .mobile-bar{ display: none !important; }
body.tc-base-layout .sidebar-toggle{ display: none !important; }
body.tc-base-layout .sheet-toggle{ display: none; }
body.tc-base-layout .sheet-grab{ display: none; }

/* Contraste dos selects e campos da gaveta em tema claro. */
body.ui-light.tc-base-layout .side-field select,
body.ui-light.tc-base-layout #gameSelect,
body.ui-light.tc-base-layout #gameSelectMobile,
body.ui-light.tc-base-layout #boardStyleSelect,
body.ui-light.tc-base-layout #playbackSpeed{
  background: #fff !important;
  color: #0f172a !important;
}

/* Responsivo: em telas menores o painel de anotação vira sheet como no projeto original. */
@media (max-width: 980px){
  body.tc-base-layout .tc-topbar{
    height: 58px;
    grid-template-columns: 62px 1fr 62px;
    padding: 5px 8px;
  }
  body.tc-base-layout .tc-top-icon{
    width: 48px;
    height: 48px;
  }
  body.tc-base-layout .tc-topbar h1{
    font-size: clamp(15px, 4.5vw, 20px);
  }
  body.tc-base-layout .app-shell{
    height: calc(100dvh - 58px);
    padding: 8px;
  }
  body.tc-base-layout .layout{
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
    gap: 10px;
  }
  body.tc-base-layout .board-controls{
    padding: 8px;
  }
  body.tc-base-layout .btn-row{
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 7px;
  }
  body.tc-base-layout .btn-row .btn{
    height: 38px;
    font-size: 13px;
  }
  body.tc-base-layout .btn-fullscreen{ display: inline-flex; }
  body.tc-base-layout .mobile-playbar{ display: flex; }
  body.tc-base-layout .moves-panel.sheet{
    border-radius: 18px 18px 0 0;
  }
  body.tc-base-layout .moves-panel.sheet .sheet-toggle,
  body.tc-base-layout .moves-panel.sheet .sheet-grab{
    display: block;
  }
}
@media (max-width: 560px){
  body.tc-base-layout .app-shell{ padding: 6px; }
  body.tc-base-layout .btn-row{
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  body.tc-base-layout .btn-row .btn{
    font-size: 12.5px;
    padding: 0 4px;
  }
  body.tc-base-layout .train-row{
    flex-wrap: wrap;
  }
}

/* ==========================================================
   v35 — Tabuleiro, botões e responsividade no padrão Base de Estudo
   ========================================================== */
:root{
  --frameT: 22px;
}

/* Corpo e workspace como a Base de Estudo: conteúdo preso ao viewport. */
body.tc-base-layout{
  width: 100%;
  min-width: 0;
  min-height: 100dvh;
  height: 100dvh;
  overflow: hidden;
}
body.tc-base-layout .app-shell{
  max-width: none !important;
  width: 100% !important;
  height: calc(100dvh - 60px) !important;
  min-height: 0 !important;
  padding: 8px 18px 8px !important;
  display: grid !important;
  grid-template-columns: 1fr !important;
  overflow: hidden !important;
}
body.tc-base-layout .content,
body.tc-base-layout .layout{
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow: hidden !important;
}
body.tc-base-layout .layout{
  display: grid !important;
  grid-template-columns: minmax(380px, 470px) minmax(410px, 1fr) !important;
  gap: 8px !important;
  align-items: stretch !important;
}

/* Coluna do tabuleiro: os controles fazem parte do mesmo bloco visual.
   Isso impede que os botões desçam para o rodapé em telas altas. */
body.tc-base-layout .board-panel.local-board-panel,
body.tc-base-layout .board-panel{
  width: 100% !important;
  max-width: 470px !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 0 !important;
  overflow: hidden !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}
body.tc-base-layout .board-host.local-board-host,
body.tc-base-layout .board-host{
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  overflow: hidden !important;
}

/* Estilo exato do tabuleiro da Base de Estudo: moldura verde, coordenadas claras. */
body.tc-base-layout .board-wrap{
  padding: var(--frameT) !important;
  background: var(--sqDark) !important;
  border: 1px solid rgba(255,255,255,.72) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow: visible !important;
}
body.tc-base-layout .board-wrap::before,
body.tc-base-layout .board-wrap::after{
  content: none !important;
  display: none !important;
}
body.tc-base-layout .board{
  border: 1px solid rgba(244,246,226,.82) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: var(--sqLight) !important;
}
body.tc-base-layout .coords .files{
  left: var(--frameT) !important;
  right: var(--frameT) !important;
  bottom: 0 !important;
  height: var(--frameT) !important;
  grid-template-columns: repeat(8, 1fr) !important;
}
body.tc-base-layout .coords .ranks{
  top: var(--frameT) !important;
  bottom: var(--frameT) !important;
  left: 0 !important;
  width: var(--frameT) !important;
  grid-template-rows: repeat(8, 1fr) !important;
}
body.tc-base-layout .coords .files div,
body.tc-base-layout .coords .ranks div{
  color: #f2f2e1 !important;
  text-shadow: none !important;
  font-family: Arial, Helvetica, sans-serif !important;
  font-size: clamp(10px, calc(var(--frameT) * .54), 13px) !important;
  font-weight: 800 !important;
  letter-spacing: .01em !important;
  line-height: 1 !important;
  padding: 0 !important;
  transform: none !important;
  align-items: center !important;
  justify-content: center !important;
}
body.tc-base-layout .coords .files div{
  text-transform: uppercase !important;
}

/* Controles no padrão Base de Estudo. */
body.tc-base-layout .play-controls.aurora-play-controls,
body.tc-base-layout .board-controls{
  flex: 0 0 auto !important;
  width: min(var(--boardSize, 448px), 100%) !important;
  max-width: var(--boardSize, 448px) !important;
  margin: 0 auto !important;
  padding: 0 0 2px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
body.tc-base-layout .play-buttons.aurora-play-buttons,
body.tc-base-layout .btn-row{
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
  flex-wrap: nowrap !important;
}
body.tc-base-layout .play-buttons .btn,
body.tc-base-layout .btn-row .btn{
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  height: 32px !important;
  min-height: 32px !important;
  padding: 0 3px !important;
  border: 1px solid #a9a9a9 !important;
  border-radius: 2px !important;
  background: linear-gradient(180deg, #ffffff 0%, #d7d7d7 100%) !important;
  color: #000 !important;
  font-size: clamp(12px, .95vw, 13.5px) !important;
  font-weight: 900 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9) !important;
  white-space: nowrap !important;
}
body.tc-base-layout .play-buttons .btn:hover,
body.tc-base-layout .btn-row .btn:hover{
  background: linear-gradient(180deg, #ffffff 0%, #cfcfcf 100%) !important;
}
body.tc-base-layout .btn.primary{
  border-color: #8f8f8f !important;
}

/* Caixa de identificação do jogo abaixo do tabuleiro. */
body.tc-base-layout .current-game-title{
  margin-top: 4px !important;
  min-height: 27px !important;
  border: 2px groove #cfcfcf !important;
  background: #f8f8f8 !important;
  color: #000 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 3px 6px !important;
  font-size: 12px !important;
  line-height: 1.15 !important;
  overflow: hidden !important;
  white-space: nowrap !important;
  text-overflow: ellipsis !important;
}
body.tc-base-layout .current-game-title strong{
  font-weight: 950 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}
body.tc-base-layout .current-game-title span{
  color: #334155 !important;
  font-size: 11px !important;
  font-weight: 800 !important;
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* Opções auxiliares permanecem, mas compactadas abaixo da caixa do jogo. */
body.tc-base-layout .mobile-playbar{
  margin-top: 6px !important;
}
body.tc-base-layout .train-row{
  margin-top: 6px !important;
  gap: 6px !important;
}
body.tc-base-layout .train-toggle{
  color: var(--text) !important;
}
body.tc-base-layout .train-status{
  min-height: 24px !important;
  padding: 4px 8px !important;
}

/* Painel da anotação à direita, no padrão visual da área de jogos da Base de Estudo. */
body.tc-base-layout .moves-panel{
  width: 100% !important;
  max-width: none !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  justify-self: stretch !important;
  align-self: stretch !important;
  display: flex !important;
  flex-direction: column !important;
  border: 1px solid #bcbcbc !important;
  border-radius: 0 !important;
  background: #eeeeee !important;
  color: #000 !important;
  box-shadow: none !important;
  overflow: hidden !important;
  padding: 0 !important;
}
body.tc-base-layout .moves-head{
  flex: 0 0 auto !important;
  min-height: 64px !important;
  padding: 10px 12px !important;
  background: #f7f7f7 !important;
  border-bottom: 1px solid #d1d1d1 !important;
  color: #000 !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: center !important;
  gap: 8px !important;
}
body.tc-base-layout .moves-head-row{
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px !important;
}
body.tc-base-layout .moves-head-row .h,
body.tc-base-layout .moves-head .h{
  color: #000 !important;
  font-size: 14px !important;
  font-weight: 950 !important;
  letter-spacing: .01em !important;
  text-transform: uppercase !important;
}
body.tc-base-layout #gameSelect,
body.tc-base-layout #gameSelectMobile{
  width: 100% !important;
  min-width: 0 !important;
  height: 34px !important;
  border: 1px solid #c7c7c7 !important;
  border-radius: 2px !important;
  background: #fff !important;
  color: #000 !important;
  font-weight: 800 !important;
  font-size: 12px !important;
  padding: 0 8px !important;
  color-scheme: light !important;
}
body.tc-base-layout #gameSelect option,
body.tc-base-layout #gameSelectMobile option{
  background: #fff !important;
  color: #000 !important;
}
body.tc-base-layout .controls{
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 8px 12px !important;
  border-bottom: 1px solid #d1d1d1 !important;
  background: #f6f6f6 !important;
  color: #000 !important;
}
body.tc-base-layout .controls .small,
body.tc-base-layout .mobile-ply{
  color: #334155 !important;
  font-weight: 800 !important;
}
body.tc-base-layout #moveSlider,
body.tc-base-layout #moveSliderMobile{
  width: 100% !important;
  accent-color: #2563eb !important;
}
body.tc-base-layout .moves{
  flex: 1 1 auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 8px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #eeeeee !important;
  color: #000 !important;
  overflow: auto !important;
  font-size: 13px !important;
}
body.tc-base-layout .move-row{
  display: grid !important;
  grid-template-columns: 44px minmax(0,1fr) minmax(0,1fr) !important;
  gap: 8px !important;
  padding: 5px 7px !important;
  border: 1px solid #c7c7c7 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #000 !important;
  margin-bottom: 5px !important;
}
body.tc-base-layout .move-row:hover{
  border-color: #6699cc !important;
  background: #f1f7ff !important;
}
body.tc-base-layout .move-no{
  color: #334155 !important;
  font-weight: 950 !important;
}
body.tc-base-layout .move{
  color: #000 !important;
  font-weight: 850 !important;
  border-radius: 2px !important;
  padding: 3px 6px !important;
}
body.tc-base-layout .move.active{
  border-color: #1d4ed8 !important;
  background: #dbeafe !important;
  color: #000 !important;
}
body.tc-base-layout .move.missing{
  opacity: .30 !important;
}
body.tc-base-layout .notation-flow{
  line-height: 1.75 !important;
}
body.tc-base-layout .notation-line{
  background: #fff !important;
  color: #000 !important;
  padding: 8px 10px !important;
  min-height: 100% !important;
}
body.tc-base-layout .notation-flow .move-row{
  display: block !important;
}
body.tc-base-layout .notation-flow .move-no{
  display: inline !important;
  color: #000 !important;
  font-weight: 900 !important;
}
body.tc-base-layout .notation-flow .move{
  display: inline-block !important;
  margin: 1px 1px !important;
  color: #000 !important;
  border-radius: 2px !important;
  padding: 1px 3px !important;
  max-width: none !important;
  overflow: visible !important;
  text-overflow: clip !important;
}
body.tc-base-layout .notation-flow .notation-comment{
  display: inline !important;
  margin: 0 2px !important;
  color: #6b7280 !important;
  font-weight: 500 !important;
}
body.tc-base-layout .notation-flow .variation-depth-1,
body.tc-base-layout .notation-flow .variant-depth-1,
body.tc-base-layout .notation-flow .variation-depth-1 .move-no{
  color: #ff0000 !important;
}
body.tc-base-layout .notation-flow .variation-depth-2,
body.tc-base-layout .notation-flow .variant-depth-2,
body.tc-base-layout .notation-flow .variation-depth-2 .move-no{
  color: #0000ff !important;
  font-family: Georgia, "Times New Roman", serif !important;
  font-style: italic !important;
  font-weight: 500 !important;
}
body.tc-base-layout .notation-flow .variation-depth-3,
body.tc-base-layout .notation-flow .variant-depth-3,
body.tc-base-layout .notation-flow .variation-depth-3 .move-no{
  color: #7c3aed !important;
}
body.tc-base-layout .notation-flow .notation-comment.variant-depth-1,
body.tc-base-layout .notation-flow .notation-comment.variant-depth-2,
body.tc-base-layout .notation-flow .notation-comment.variant-depth-3{
  color: #6b7280 !important;
}
body.tc-base-layout .notation-flow .notation-comment.variant-depth-2{
  font-family: Georgia, "Times New Roman", serif !important;
  font-style: italic !important;
}
body.tc-base-layout .notation-flow .move.not-clickable{
  cursor: default !important;
}

/* Gaveta com o mesmo comportamento do projeto Base: abre por cima da tela em qualquer resolução. */
body.tc-base-layout .sidebar{
  top: 70px !important;
}

@media (max-width: 980px){
  :root{ --frameT: 20px; }
  body.tc-base-layout .tc-topbar{
    height: 58px !important;
    flex-basis: 58px !important;
  }
  body.tc-base-layout .app-shell{
    height: calc(100dvh - 58px) !important;
    padding: 6px !important;
  }
  body.tc-base-layout .layout{
    grid-template-columns: 1fr !important;
    grid-template-rows: 1fr !important;
    gap: 0 !important;
    padding-bottom: calc(var(--sheetPeek, 40px) + 4px) !important;
  }
  body.tc-base-layout .board-panel.local-board-panel,
  body.tc-base-layout .board-panel{
    max-width: none !important;
  }
  body.tc-base-layout .board-host.local-board-host,
  body.tc-base-layout .board-host{
    justify-content: flex-start !important;
    gap: 5px !important;
  }
  body.tc-base-layout .play-controls.aurora-play-controls,
  body.tc-base-layout .board-controls{
    width: min(calc(100vw - 12px), var(--boardSize, 520px)) !important;
    max-width: var(--boardSize, 520px) !important;
  }
  body.tc-base-layout .play-buttons.aurora-play-buttons,
  body.tc-base-layout .btn-row{
    gap: 4px !important;
    flex-wrap: nowrap !important;
  }
  body.tc-base-layout .play-buttons .btn,
  body.tc-base-layout .btn-row .btn{
    height: 32px !important;
    font-size: 12px !important;
    padding: 0 2px !important;
  }
  body.tc-base-layout .btn-fullscreen{
    flex: 0 0 34px !important;
    display: inline-flex !important;
  }
  body.tc-base-layout .current-game-title{
    min-height: 31px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1px !important;
    font-size: 11.5px !important;
    padding: 4px 6px !important;
  }
  body.tc-base-layout .current-game-title span{
    font-size: 10.5px !important;
  }
  body.tc-base-layout .mobile-playbar{
    display: flex !important;
    gap: 6px !important;
  }
  body.tc-base-layout .mobile-playbar .mobile-row{
    gap: 6px !important;
  }
  body.tc-base-layout .btn-moves{
    height: 36px !important;
    border-radius: 2px !important;
  }
  body.tc-base-layout #gameSelectMobile{
    height: 36px !important;
  }

  /* Bottom-sheet da anotação, preservando a lógica original. */
  body.tc-base-layout .moves-panel.sheet{
    left: 6px !important;
    right: 6px !important;
    bottom: 6px !important;
    width: auto !important;
    height: min(72vh, 640px) !important;
    border-radius: 16px 16px 0 0 !important;
    z-index: 45 !important;
  }
  body.tc-base-layout .moves-panel.sheet:not(.sheet-expanded) .moves-head{
    min-height: var(--sheetPeek, 40px) !important;
    padding: 7px 12px !important;
  }
  body.tc-base-layout .moves-panel.sheet:not(.sheet-expanded) .moves-head-row{
    justify-content: center !important;
  }
  body.tc-base-layout .moves-panel.sheet .sheet-grab{
    background: rgba(15,23,42,.24) !important;
    height: 5px !important;
    width: 44px !important;
    border-radius: 999px !important;
    margin: 0 auto 2px !important;
  }
  body.tc-base-layout .moves-panel.sheet .sheet-toggle{
    width: 34px !important;
    height: 30px !important;
    border-radius: 2px !important;
    background: linear-gradient(180deg, #fff 0%, #d7d7d7 100%) !important;
    color: #000 !important;
    border: 1px solid #a9a9a9 !important;
  }
}

@media (max-width: 520px){
  :root{ --frameT: 18px; }
  body.tc-base-layout .app-shell{ padding: 5px !important; }
  body.tc-base-layout .board-host.local-board-host,
  body.tc-base-layout .board-host{ gap: 4px !important; }
  body.tc-base-layout .play-controls.aurora-play-controls,
  body.tc-base-layout .board-controls{
    width: min(calc(100vw - 10px), var(--boardSize, 520px)) !important;
  }
  body.tc-base-layout .play-buttons.aurora-play-buttons,
  body.tc-base-layout .btn-row{
    gap: 3px !important;
  }
  body.tc-base-layout .play-buttons .btn,
  body.tc-base-layout .btn-row .btn{
    height: 30px !important;
    font-size: 11px !important;
    padding: 0 1px !important;
  }
  body.tc-base-layout .btn-fullscreen{
    flex-basis: 30px !important;
  }
  body.tc-base-layout .train-row{
    font-size: 12px !important;
  }
  body.tc-base-layout .train-status{
    flex-basis: 100% !important;
  }
}

@media (max-width: 380px){
  :root{ --frameT: 16px; }
  body.tc-base-layout .play-buttons .btn,
  body.tc-base-layout .btn-row .btn{
    font-size: 10.5px !important;
  }
}

/* ==========================================================
   v36 — ajustes solicitados
   - Módulos sempre visíveis na gaveta
   - Remoção definitiva do botão de tela cheia do tabuleiro
   - Botões mobile um pouco maiores após a remoção do botão extra
   - No modo treino, ocultar a anotação também no layout Base
   ========================================================== */
.side-panel-title{
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  font-size: 13px;
  font-weight: 1000;
  letter-spacing: .03em;
  text-transform: uppercase;
}
body.ui-light .side-panel-title{
  background: rgba(15,23,42,.035);
  border-color: rgba(15,23,42,.14);
  color: var(--text);
}
.modules-section .games-panel{
  margin-top: 10px;
}
.modules-section .folder-title{
  text-transform: uppercase;
}

/* O botão ⛶ foi removido do HTML; esta regra evita reaparecimento por cache/customizações. */
.btn-fullscreen,
body.tc-base-layout .btn-fullscreen{
  display: none !important;
}

/* Com seis botões na linha, dá para deixar o toque mais confortável no mobile. */
@media (max-width: 980px){
  body.tc-base-layout .play-buttons .btn,
  body.tc-base-layout .btn-row .btn{
    height: 36px !important;
    min-height: 36px !important;
    font-size: 13px !important;
    padding: 0 5px !important;
  }
}
@media (max-width: 520px){
  body.tc-base-layout .play-buttons .btn,
  body.tc-base-layout .btn-row .btn{
    height: 34px !important;
    min-height: 34px !important;
    font-size: 12px !important;
    padding: 0 3px !important;
  }
}
@media (max-width: 380px){
  body.tc-base-layout .play-buttons .btn,
  body.tc-base-layout .btn-row .btn{
    font-size: 11.5px !important;
    padding: 0 2px !important;
  }
}

/* A regra antiga era vencida por regras posteriores do layout Base; aqui ela fica no final. */
body.tc-base-layout.training .moves-panel,
body.tc-base-layout.training .sheet-overlay{
  display: none !important;
}
body.tc-base-layout.training .layout{
  grid-template-columns: minmax(320px, 470px) !important;
  justify-content: start !important;
}
@media (max-width: 980px){
  body.tc-base-layout.training .layout{
    grid-template-columns: 1fr !important;
    padding-bottom: 0 !important;
  }
}


/* Área de acesso e bloqueio seguro dos estudos */
.course-account-area{padding:0 0 14px;border-bottom:1px solid var(--border,rgba(148,163,184,.22));margin-bottom:14px}
.course-account-btn{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;padding:12px 14px;border-radius:11px;background:linear-gradient(135deg,#1593d1,#0875b8);color:#fff!important;text-decoration:none;font-weight:800;box-shadow:0 7px 20px rgba(8,117,184,.22)}
.course-account-btn:hover{filter:brightness(1.08)}
.course-free-note{margin-top:9px;color:var(--muted);font-size:.84rem;line-height:1.45;text-align:center}.course-free-note i{color:#38bdf8}
.course-member-box{border:1px solid rgba(34,197,94,.35);background:rgba(34,197,94,.09);padding:12px;border-radius:11px;color:var(--text)}.course-member-box>div{font-weight:800;color:#22c55e}.course-member-box small{display:block;margin:5px 0;color:var(--muted)}.course-member-box a{color:#7dd3fc;font-size:.88rem}
select option.course-locked-option{color:#8d96a5;background:#e7eaf0;font-style:italic;opacity:.62}body:not(.light) select option.course-locked-option{color:#9aa4b4;background:#202a38}
.course-lock-modal[hidden]{display:none!important}.course-lock-modal{position:fixed;inset:0;z-index:100000;display:grid;place-items:center;padding:18px}.course-lock-backdrop{position:absolute;inset:0;background:rgba(2,6,14,.78);backdrop-filter:blur(5px)}.course-lock-dialog{position:relative;width:min(100%,480px);border-radius:20px;padding:30px 26px;background:linear-gradient(160deg,#142337,#091423);border:1px solid rgba(148,163,184,.28);box-shadow:0 28px 85px rgba(0,0,0,.55);color:#f8fafc;text-align:center;animation:courseLockIn .2s ease-out}.course-lock-close{position:absolute;right:13px;top:10px;border:0;background:transparent;color:#cbd5e1;font-size:1.9rem;line-height:1;cursor:pointer}.course-lock-icon{width:72px;height:72px;margin:0 auto 16px;border-radius:50%;display:grid;place-items:center;background:rgba(245,158,11,.14);border:1px solid rgba(245,158,11,.38);color:#fbbf24;font-size:29px}.course-lock-dialog h2{margin:0 0 12px;font-size:1.45rem}.course-lock-dialog p{margin:0;color:#c7d2e2;line-height:1.62}.course-lock-actions{display:grid;grid-template-columns:1fr 1fr;gap:11px;margin-top:23px}.course-lock-actions a{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border-radius:11px;padding:10px;text-decoration:none;font-weight:800}.course-login-action{background:#238ed0;color:#fff}.course-whatsapp-action{background:#25d366;color:#062e16}@keyframes courseLockIn{from{transform:translateY(10px) scale(.97);opacity:0}to{transform:none;opacity:1}}
@media(max-width:520px){.course-lock-actions{grid-template-columns:1fr}.course-lock-dialog{padding:27px 19px}}


/* ===== Recursos compartilhados com a modalidade Internacional ===== */
/* ==========================================================
   v63 — Central de opções, planos, tutorial e detalhes
   ========================================================== */
.tc-options-btn{
  width:auto;
  min-width:112px;
  padding:0 16px;
  gap:9px;
  justify-self:end;
  border-radius:8px;
  background:rgba(255,255,255,.08);
  color:var(--text);
  font-size:15px;
  font-weight:900;
}
.tc-options-btn i{font-size:18px}
body.ui-light .tc-options-btn{background:rgba(15,23,42,.04);color:#0f172a}

.drawer-actions{display:grid;gap:9px;margin:0 0 4px}
.drawer-action{
  width:100%;
  min-height:46px;
  display:flex;
  align-items:center;
  justify-content:flex-start;
  gap:10px;
  padding:11px 13px;
  border:1px solid var(--line);
  border-radius:12px;
  background:rgba(255,255,255,.045);
  color:var(--text);
  font:inherit;
  font-weight:850;
  text-align:left;
  cursor:pointer;
}
.drawer-action i{width:20px;text-align:center;color:#7dd3fc;font-size:16px}
.drawer-action:hover{background:rgba(255,255,255,.08);transform:translateY(-1px)}
.drawer-action-plans{
  border-color:rgba(245,158,11,.38);
  background:linear-gradient(135deg,rgba(245,158,11,.16),rgba(249,115,22,.08));
}
.drawer-action-plans i{color:#fbbf24}
body.ui-light .drawer-action{background:rgba(15,23,42,.035);border-color:rgba(15,23,42,.14);color:#0f172a}
body.ui-light .drawer-action:hover{background:rgba(15,23,42,.07)}
body.ui-light .drawer-action-plans{background:linear-gradient(135deg,rgba(245,158,11,.13),rgba(249,115,22,.06));border-color:rgba(217,119,6,.28)}

.tc-modal[hidden]{display:none!important}
.tc-modal{
  position:fixed;
  inset:0;
  z-index:120000;
  display:grid;
  place-items:center;
  padding:clamp(10px,2.4vw,28px);
}
.tc-modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(2,6,14,.78);
  backdrop-filter:blur(7px);
}
.tc-modal-dialog{
  position:relative;
  width:min(100%,760px);
  max-height:min(90dvh,900px);
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(148,163,184,.28);
  border-radius:22px;
  background:linear-gradient(160deg,rgba(20,35,55,.99),rgba(7,17,31,.99));
  color:#f8fafc;
  box-shadow:0 32px 100px rgba(0,0,0,.62);
  animation:tcModalIn .2s ease-out;
}
body.ui-light .tc-modal-dialog{
  background:linear-gradient(160deg,#ffffff,#f4f7fb);
  color:#0f172a;
  border-color:rgba(15,23,42,.16);
  box-shadow:0 30px 90px rgba(15,23,42,.24);
}
@keyframes tcModalIn{from{opacity:0;transform:translateY(12px) scale(.975)}to{opacity:1;transform:none}}
.tc-modal-header{
  flex:0 0 auto;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  padding:20px 22px;
  border-bottom:1px solid rgba(148,163,184,.20);
  background:rgba(255,255,255,.025);
}
body.ui-light .tc-modal-header{background:rgba(15,23,42,.018);border-color:rgba(15,23,42,.12)}
.tc-modal-heading{display:flex;align-items:center;gap:13px;min-width:0}
.tc-modal-heading-icon{
  width:46px;
  height:46px;
  flex:0 0 46px;
  display:grid;
  place-items:center;
  border-radius:14px;
  background:rgba(56,189,248,.13);
  border:1px solid rgba(56,189,248,.30);
  color:#7dd3fc;
  font-size:19px;
}
.tc-modal-heading h2{margin:0;font-size:clamp(19px,2.3vw,26px);line-height:1.15}
.tc-modal-heading p{margin:4px 0 0;color:#b8c4d4;line-height:1.4}
body.ui-light .tc-modal-heading p{color:#64748b}
.tc-modal-close{
  width:42px;
  height:42px;
  flex:0 0 42px;
  display:grid;
  place-items:center;
  border:1px solid rgba(148,163,184,.20);
  border-radius:12px;
  background:rgba(255,255,255,.05);
  color:inherit;
  font-size:28px;
  line-height:1;
  cursor:pointer;
}
.tc-modal-close:hover{background:rgba(255,255,255,.11)}
body.ui-light .tc-modal-close{background:rgba(15,23,42,.035);border-color:rgba(15,23,42,.13)}
.tc-modal-body{min-height:0;overflow:auto;padding:22px}

.tc-options-dialog{width:min(100%,700px)}
.tc-options-list{display:grid;gap:10px}
.tc-option-row{
  width:100%;
  min-height:72px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:18px;
  padding:12px 14px;
  border:1px solid rgba(148,163,184,.18);
  border-radius:15px;
  background:rgba(255,255,255,.035);
  color:inherit;
  text-align:left;
}
body.ui-light .tc-option-row{background:rgba(15,23,42,.025);border-color:rgba(15,23,42,.12)}
.tc-option-row-button{font:inherit;cursor:pointer}
.tc-option-row-button:hover{background:rgba(255,255,255,.075);border-color:rgba(125,211,252,.34)}
body.ui-light .tc-option-row-button:hover{background:rgba(37,99,235,.055);border-color:rgba(37,99,235,.20)}
.tc-option-info{display:flex;align-items:center;gap:12px;min-width:0}
.tc-option-info>span:last-child{display:flex;flex-direction:column;min-width:0}
.tc-option-info strong{font-size:15px}
.tc-option-info small{margin-top:3px;color:#aebacd;line-height:1.35}
body.ui-light .tc-option-info small{color:#64748b}
.tc-option-icon{
  width:40px;
  height:40px;
  flex:0 0 40px;
  display:grid;
  place-items:center;
  border-radius:12px;
  background:rgba(56,189,248,.10);
  color:#7dd3fc;
}
body.ui-light .tc-option-icon{background:rgba(2,132,199,.08);color:#0369a1}
.tc-option-row select{
  min-width:128px;
  height:42px;
  padding:0 11px;
  border:1px solid rgba(148,163,184,.25);
  border-radius:11px;
  background:rgba(0,0,0,.18);
  color:#f8fafc;
  font:inherit;
  font-weight:750;
}
body.ui-light .tc-option-row select{background:#fff!important;color:#0f172a!important;border-color:rgba(15,23,42,.18)!important}
.tc-option-icon-button.theme-toggle{width:44px;height:44px;border-radius:12px}
.tc-option-toggle input{
  appearance:none;
  width:52px;
  height:29px;
  flex:0 0 52px;
  position:relative;
  border:1px solid rgba(148,163,184,.35);
  border-radius:999px;
  background:#334155;
  cursor:pointer;
  transition:.2s ease;
}
.tc-option-toggle input::after{
  content:"";
  position:absolute;
  top:3px;
  left:3px;
  width:21px;
  height:21px;
  border-radius:50%;
  background:#fff;
  box-shadow:0 2px 6px rgba(0,0,0,.35);
  transition:.2s ease;
}
.tc-option-toggle input:checked{background:#1593d1;border-color:#38bdf8}
.tc-option-toggle input:checked::after{transform:translateX(23px)}

.tc-video-dialog{width:min(100%,1050px)}
.tc-video-frame{
  width:100%;
  aspect-ratio:16/9;
  overflow:hidden;
  border-radius:16px;
  background:#000;
  box-shadow:0 16px 45px rgba(0,0,0,.35);
}
.tc-video-frame iframe{display:block;width:100%;height:100%;border:0}

.tc-plans-dialog{width:min(100%,980px)}
.tc-plan-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.tc-plan-card{
  position:relative;
  display:flex;
  flex-direction:column;
  min-height:300px;
  padding:24px;
  border:1px solid rgba(148,163,184,.22);
  border-radius:19px;
  background:linear-gradient(160deg,rgba(255,255,255,.06),rgba(255,255,255,.025));
}
.tc-plan-card-featured{border-color:rgba(245,158,11,.46);background:linear-gradient(160deg,rgba(245,158,11,.12),rgba(249,115,22,.045))}
body.ui-light .tc-plan-card{background:#fff;border-color:rgba(15,23,42,.13)}
body.ui-light .tc-plan-card-featured{background:linear-gradient(160deg,#fffaf0,#fff);border-color:rgba(217,119,6,.28)}
.tc-plan-badge{align-self:flex-start;padding:5px 9px;border-radius:999px;background:rgba(56,189,248,.13);color:#7dd3fc;font-size:12px;font-weight:900;text-transform:uppercase;letter-spacing:.04em}
.tc-plan-card-featured .tc-plan-badge{background:rgba(245,158,11,.17);color:#fbbf24}
body.ui-light .tc-plan-badge{color:#0369a1;background:rgba(2,132,199,.08)}
body.ui-light .tc-plan-card-featured .tc-plan-badge{color:#b45309;background:rgba(245,158,11,.13)}
.tc-plan-card h3{margin:16px 0 5px;font-size:22px}
.tc-plan-price{font-size:39px;line-height:1;font-weight:1000;letter-spacing:-.03em}
.tc-plan-price small{font-size:17px;vertical-align:top;line-height:1.6;color:#94a3b8}
.tc-plan-card p{margin:15px 0 22px;color:#bac5d4;line-height:1.58}
body.ui-light .tc-plan-card p{color:#526174}
.tc-plan-button{
  margin-top:auto;
  min-height:49px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  padding:11px 14px;
  border-radius:12px;
  background:linear-gradient(135deg,#1593d1,#0875b8);
  color:#fff!important;
  text-decoration:none;
  font-weight:900;
  text-align:center;
}
.tc-plan-card-featured .tc-plan-button{background:linear-gradient(135deg,#f59e0b,#ea580c)}
.tc-plan-button:hover{filter:brightness(1.08);transform:translateY(-1px)}
.tc-payment-box{
  margin-top:18px;
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(260px,.72fr);
  gap:18px;
  align-items:center;
  padding:20px;
  border:1px solid rgba(148,163,184,.20);
  border-radius:18px;
  background:rgba(255,255,255,.035);
}
body.ui-light .tc-payment-box{background:rgba(15,23,42,.025);border-color:rgba(15,23,42,.12)}
.tc-payment-box h3{margin:0 0 7px;font-size:18px}.tc-payment-box h3 i{color:#7dd3fc;margin-right:6px}
.tc-payment-box p{margin:0;color:#b8c4d4;line-height:1.5}body.ui-light .tc-payment-box p{color:#64748b}
.tc-pix-box{display:grid;gap:4px;padding:14px;border:1px dashed rgba(56,189,248,.42);border-radius:14px;background:rgba(56,189,248,.07)}
.tc-pix-box span:first-child{color:#94a3b8;font-size:12px;font-weight:850;text-transform:uppercase}.tc-pix-box strong{font-size:22px;letter-spacing:.04em}.tc-pix-box small{color:#b8c4d4}body.ui-light .tc-pix-box small{color:#64748b}
.tc-copy-button{margin-top:8px;min-height:40px;border:1px solid rgba(56,189,248,.32);border-radius:10px;background:rgba(56,189,248,.13);color:inherit;font:inherit;font-weight:850;cursor:pointer}.tc-copy-button:hover{background:rgba(56,189,248,.21)}
.tc-copy-feedback{min-height:18px;color:#4ade80;font-size:12px;font-weight:800}
.tc-whatsapp-button{
  min-height:52px;
  margin-top:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 16px;
  border-radius:13px;
  background:#25d366;
  color:#06351a!important;
  text-decoration:none;
  font-weight:1000;
  font-size:16px;
}
.tc-whatsapp-button i{font-size:22px}

.tc-details-dialog{width:min(100%,820px)}
.tc-details-content{font-size:15px;line-height:1.68}
.tc-details-content p{margin:0 0 16px;color:#c2cddd}
body.ui-light .tc-details-content p{color:#475569}
.tc-details-content strong{color:#fff}body.ui-light .tc-details-content strong{color:#0f172a}
.tc-details-highlight{display:flex;align-items:center;gap:14px;margin:20px 0;padding:17px;border:1px solid rgba(56,189,248,.28);border-radius:15px;background:rgba(56,189,248,.08)}
.tc-details-highlight>i{font-size:28px;color:#7dd3fc}.tc-details-highlight>div{display:flex;flex-direction:column}.tc-details-highlight strong{font-size:18px}.tc-details-highlight span{margin-top:2px;color:#b8c4d4}body.ui-light .tc-details-highlight span{color:#64748b}
.tc-project-author{margin:20px 0 0!important;padding-top:16px;border-top:1px solid rgba(148,163,184,.18)}.tc-project-author i{color:#7dd3fc;margin-right:7px}

@media (max-width:700px){
  .tc-options-btn{min-width:48px;width:48px;padding:0}
  .tc-options-btn span{display:none}
  .tc-modal{padding:8px}
  .tc-modal-dialog{max-height:calc(100dvh - 16px);border-radius:17px}
  .tc-modal-header{padding:15px}
  .tc-modal-heading-icon{width:40px;height:40px;flex-basis:40px;border-radius:12px}
  .tc-modal-heading p{font-size:12.5px}
  .tc-modal-body{padding:15px}
  .tc-option-row{min-height:68px;padding:10px;gap:10px}
  .tc-option-info{gap:9px}
  .tc-option-icon{width:36px;height:36px;flex-basis:36px}
  .tc-option-info small{display:none}
  .tc-option-row select{min-width:104px;max-width:118px}
  .tc-plan-grid{grid-template-columns:1fr}
  .tc-plan-card{min-height:0;padding:20px}
  .tc-payment-box{grid-template-columns:1fr;padding:16px}
  .tc-video-dialog .tc-modal-body{padding:10px}
}
@media (max-width:420px){
  .tc-modal-heading p{display:none}
  .tc-option-info strong{font-size:13.5px}
  .tc-option-row select{min-width:94px;max-width:104px;padding:0 7px;font-size:13px}
  .tc-option-toggle input{width:48px;flex-basis:48px}
  .tc-option-toggle input:checked::after{transform:translateX(19px)}
  .tc-plan-price{font-size:34px}
}
@media (min-width:1600px) and (min-height:850px){
  .tc-modal-dialog{max-height:88vh}
  .tc-video-dialog{width:min(72vw,1280px)}
  .tc-options-dialog{width:min(48vw,820px)}
  .tc-plans-dialog{width:min(66vw,1120px)}
  .tc-details-dialog{width:min(56vw,940px)}
  .tc-modal-header{padding:24px 27px}
  .tc-modal-body{padding:27px}
  .tc-option-row{min-height:82px}
  .tc-details-content{font-size:17px}
}

/* ==========================================================
   v110 — Cores integradas ao estilo do tabuleiro + progresso
   ========================================================== */
:root{
  --tc-accent:#2286c2;
  --tc-accent-dark:#196590;
}

/* O estilo selecionado no tabuleiro também colore os principais botões e ícones. */
.course-account-btn,
.course-login-action,
.course-plans-action,
.tc-plan-card:not(.tc-plan-card-featured) .tc-plan-button{
  background:linear-gradient(135deg,var(--tc-accent),var(--tc-accent-dark)) !important;
}
.course-account-btn{
  box-shadow:0 7px 20px color-mix(in srgb,var(--tc-accent) 28%,transparent) !important;
}
.course-free-note i,
.drawer-action:not(.drawer-action-plans) i,
.tc-modal-heading-icon,
.tc-option-icon,
.tc-payment-box h3 i,
.tc-project-author i,
.tc-details-highlight>i{
  color:var(--tc-accent) !important;
}
.tc-modal-heading-icon,
.tc-option-icon{
  background:color-mix(in srgb,var(--tc-accent) 12%,transparent) !important;
  border-color:color-mix(in srgb,var(--tc-accent) 34%,transparent) !important;
}
.tc-option-row-button:hover{
  border-color:color-mix(in srgb,var(--tc-accent) 38%,transparent) !important;
  background:color-mix(in srgb,var(--tc-accent) 9%,transparent) !important;
}
.tc-option-toggle input:checked{
  background:var(--tc-accent) !important;
  border-color:var(--tc-accent) !important;
}
.tc-pix-box{
  border-color:color-mix(in srgb,var(--tc-accent) 48%,transparent) !important;
  background:color-mix(in srgb,var(--tc-accent) 8%,transparent) !important;
}
.tc-copy-button{
  border-color:color-mix(in srgb,var(--tc-accent) 38%,transparent) !important;
  background:color-mix(in srgb,var(--tc-accent) 13%,transparent) !important;
}
.tc-copy-button:hover{background:color-mix(in srgb,var(--tc-accent) 21%,transparent) !important}

/* Informações do usuário logado na gaveta, sem alterar a estrutura do layout original. */
.course-member-box{
  display:grid;
  gap:7px;
}
.course-member-box .course-member-heading{
  font-weight:900;
  color:#22c55e;
}
.course-member-name{
  display:block;
  font-size:15px;
  color:var(--text);
}
.course-member-plan,
.course-member-days{
  display:flex;
  align-items:center;
  gap:7px;
  color:var(--muted);
  font-size:.86rem;
  line-height:1.35;
}
.course-member-plan i,
.course-member-days i,
.course-member-box a i{
  width:16px;
  color:var(--tc-accent);
  text-align:center;
}
.course-member-box a{
  display:inline-flex;
  align-items:center;
  gap:6px;
  width:max-content;
  max-width:100%;
  color:var(--tc-accent);
  font-size:.87rem;
  font-weight:750;
  text-decoration:none;
}
.course-member-box a:hover{text-decoration:underline}

/* Exercícios concluídos na lista “Anotação do Jogo”.
   O símbolo ✓ mantém a indicação mesmo em navegadores que limitam cores de <option>. */
#gameSelect option.game-played-option,
#gameSelectMobile option.game-played-option,
body.ui-light #gameSelect option.game-played-option,
body.ui-light #gameSelectMobile option.game-played-option,
body.ui-dark #gameSelect option.game-played-option,
body.ui-dark #gameSelectMobile option.game-played-option,
body:not(.ui-light) #gameSelect option.game-played-option,
body:not(.ui-light) #gameSelectMobile option.game-played-option{
  background:#f59e0b !important;
  color:#18181b !important;
  font-weight:900 !important;
}


/* Gaveta de navegação com fundo sólido para melhor leitura em ambos os modos. */
body.ui-light.tc-base-layout .sidebar{
  background: linear-gradient(180deg, rgba(248,250,252,.99), rgba(241,245,249,.98)) !important;
  border-color: rgba(15,23,42,.12) !important;
  box-shadow: 0 24px 56px rgba(15,23,42,.16) !important;
}
body.ui-light.tc-base-layout .sidebar .side-divider{
  background: rgba(15,23,42,.10) !important;
}
body.ui-light.tc-base-layout .sidebar .course-member-box{
  background: rgba(34,197,94,.08) !important;
}
body.tc-base-layout .sidebar .course-member-box{
  background: rgba(34,197,94,.10) !important;
}

@media(max-width:560px){
  .course-member-box{gap:6px}
  .course-member-plan,.course-member-days{font-size:.82rem}
}

/* ==========================================================
   Página/Janela Planos — bloco Pix inspirado no modelo enviado
   e personalizado pela cor do estilo de tabuleiro selecionado.
   ========================================================== */
.tc-plans-dialog .tc-plan-card-featured{
  border-color:color-mix(in srgb,var(--tc-accent) 48%,transparent) !important;
  background:linear-gradient(155deg,
    color-mix(in srgb,var(--tc-accent) 15%,rgba(255,255,255,.035)),
    rgba(255,255,255,.025)) !important;
}
.tc-plans-dialog .tc-plan-badge,
.tc-plans-dialog .tc-plan-card-featured .tc-plan-badge{
  color:color-mix(in srgb,var(--tc-accent) 72%,white) !important;
  background:color-mix(in srgb,var(--tc-accent) 16%,transparent) !important;
}
.tc-plans-dialog .tc-plan-card-featured .tc-plan-button{
  background:linear-gradient(135deg,var(--tc-accent),var(--tc-accent-dark)) !important;
  box-shadow:0 9px 22px color-mix(in srgb,var(--tc-accent) 26%,transparent);
}
body.ui-light .tc-plans-dialog .tc-plan-card-featured{
  background:linear-gradient(155deg,
    color-mix(in srgb,var(--tc-accent) 9%,white),
    #ffffff) !important;
  border-color:color-mix(in srgb,var(--tc-accent) 32%,transparent) !important;
}
body.ui-light .tc-plans-dialog .tc-plan-badge,
body.ui-light .tc-plans-dialog .tc-plan-card-featured .tc-plan-badge{
  color:var(--tc-accent) !important;
  background:color-mix(in srgb,var(--tc-accent) 10%,white) !important;
}

.tc-payment-box.tc-pix-payment{
  display:block;
  margin-top:20px;
  padding:28px;
  border:1px solid color-mix(in srgb,var(--tc-accent) 34%,transparent);
  border-radius:20px;
  background:linear-gradient(145deg,
    color-mix(in srgb,var(--tc-accent) 10%,rgba(15,23,42,.96)),
    rgba(15,23,42,.94));
  overflow:hidden;
}
body.ui-light .tc-payment-box.tc-pix-payment{
  background:linear-gradient(145deg,
    color-mix(in srgb,var(--tc-accent) 9%,white),
    #f8fffb);
  border-color:color-mix(in srgb,var(--tc-accent) 30%,transparent);
}
.tc-pix-intro{
  display:flex;
  align-items:flex-start;
  gap:17px;
}
.tc-pix-logo{
  width:56px;
  height:56px;
  flex:0 0 56px;
  display:grid;
  place-items:center;
  border-radius:16px;
  color:#fff;
  background:linear-gradient(135deg,var(--tc-accent),var(--tc-accent-dark));
  box-shadow:0 9px 24px color-mix(in srgb,var(--tc-accent) 28%,transparent);
  font-size:27px;
}
.tc-pix-eyebrow{
  display:block;
  margin:2px 0 7px;
  color:color-mix(in srgb,var(--tc-accent) 72%,white);
  font-size:12px;
  font-weight:1000;
  letter-spacing:.075em;
  text-transform:uppercase;
}
body.ui-light .tc-pix-eyebrow{color:var(--tc-accent)}
.tc-payment-box.tc-pix-payment h3{
  margin:0 0 6px;
  font-size:clamp(25px,3vw,32px);
  line-height:1.1;
}
.tc-payment-box.tc-pix-payment p{
  margin:0;
  max-width:760px;
  line-height:1.55;
}
.tc-payment-box.tc-pix-payment .tc-pix-box{
  position:relative;
  margin:20px 0 0 73px;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  grid-template-areas:
    "data copy"
    "feedback feedback";
  align-items:center;
  gap:10px 18px;
  padding:18px 20px;
  border:1px dashed color-mix(in srgb,var(--tc-accent) 58%,transparent) !important;
  border-radius:15px;
  background:rgba(255,255,255,.045) !important;
}
body.ui-light .tc-payment-box.tc-pix-payment .tc-pix-box{
  background:rgba(255,255,255,.90) !important;
}
.tc-pix-data{
  grid-area:data;
  display:grid;
  gap:3px;
  min-width:0;
}
.tc-pix-data>span{
  color:#9aa8bb !important;
  font-size:11px !important;
  font-weight:900 !important;
  letter-spacing:.055em;
  text-transform:uppercase;
}
body.ui-light .tc-pix-data>span{color:#64748b !important}
.tc-pix-data strong{
  font-size:clamp(22px,3.1vw,30px) !important;
  line-height:1.15;
  letter-spacing:.025em !important;
  overflow-wrap:anywhere;
}
.tc-pix-data small{
  margin-top:2px;
  color:#aebbd0 !important;
  font-size:13px;
}
body.ui-light .tc-pix-data small{color:#64748b !important}
.tc-payment-box.tc-pix-payment .tc-copy-button{
  grid-area:copy;
  min-width:102px;
  min-height:42px;
  margin:0;
  padding:9px 13px;
  color:var(--text);
  background:color-mix(in srgb,var(--tc-accent) 12%,transparent) !important;
  border-color:color-mix(in srgb,var(--tc-accent) 48%,transparent) !important;
}
body.ui-light .tc-payment-box.tc-pix-payment .tc-copy-button{
  color:#1e293b;
  background:#fff !important;
}
.tc-payment-box.tc-pix-payment .tc-copy-feedback{
  grid-area:feedback;
  min-height:0;
  color:#22c55e;
}
.tc-payment-box.tc-pix-payment .tc-copy-feedback:empty{display:none}
.tc-payment-box.tc-pix-payment .tc-whatsapp-button{
  width:max-content;
  min-width:200px;
  margin:20px 0 0 73px;
  padding-inline:20px;
  background:#25d366;
  color:#fff !important;
  box-shadow:0 9px 22px rgba(37,211,102,.22);
}
.tc-payment-box.tc-pix-payment .tc-whatsapp-button:hover{
  filter:brightness(1.05);
  transform:translateY(-1px);
}

@media(max-width:700px){
  .tc-payment-box.tc-pix-payment{padding:20px 16px}
  .tc-pix-intro{gap:12px}
  .tc-pix-logo{width:48px;height:48px;flex-basis:48px;border-radius:14px;font-size:23px}
  .tc-payment-box.tc-pix-payment .tc-pix-box{
    margin-left:0;
    grid-template-columns:1fr;
    grid-template-areas:"data" "copy" "feedback";
    padding:16px;
  }
  .tc-payment-box.tc-pix-payment .tc-copy-button{width:100%}
  .tc-payment-box.tc-pix-payment .tc-whatsapp-button{
    width:100%;
    margin-left:0;
  }
}

/* Botão “Ver Planos” do aviso de conteúdo bloqueado.
   Usa a mesma cor do estilo de tabuleiro selecionado. */
.course-plans-action{
  color:#fff !important;
  background:linear-gradient(135deg,var(--tc-accent),var(--tc-accent-dark)) !important;
  box-shadow:0 8px 20px color-mix(in srgb,var(--tc-accent) 26%,transparent);
}
.course-plans-action:hover{
  filter:brightness(1.07);
  transform:translateY(-1px);
}
.course-plans-action:active{transform:translateY(0)}

/* Janela de conteúdo bloqueado integrada à cor do tabuleiro. */
.course-lock-dialog{
  border-color:color-mix(in srgb,var(--tc-accent) 34%,rgba(148,163,184,.28)) !important;
  background:linear-gradient(160deg,
    color-mix(in srgb,var(--tc-accent) 12%,#142337),
    #091423) !important;
}
.course-lock-icon{
  color:color-mix(in srgb,var(--tc-accent) 72%,white) !important;
  background:color-mix(in srgb,var(--tc-accent) 15%,transparent) !important;
  border-color:color-mix(in srgb,var(--tc-accent) 45%,transparent) !important;
}
body.ui-light .course-lock-dialog{
  color:#0f172a !important;
  background:linear-gradient(160deg,
    color-mix(in srgb,var(--tc-accent) 8%,white),
    #ffffff) !important;
  border-color:color-mix(in srgb,var(--tc-accent) 28%,rgba(15,23,42,.16)) !important;
}
body.ui-light .course-lock-dialog p{color:#475569 !important}
body.ui-light .course-lock-close{color:#334155 !important}

/* Lista de exercícios personalizada no celular.
   Android e iOS não respeitam background em <option>; por isso usamos uma
   janela própria que conserva a demarcação âmbar igual à versão desktop. */
.mobile-game-picker-trigger,
.mobile-game-picker{
  display:none;
}

@media (max-width:980px){
  body.tc-base-layout .mobile-native-game-select{
    position:absolute !important;
    width:1px !important;
    height:1px !important;
    opacity:0 !important;
    pointer-events:none !important;
    overflow:hidden !important;
    clip:rect(0 0 0 0) !important;
    clip-path:inset(50%) !important;
  }

  body.tc-base-layout .mobile-game-picker-trigger{
    display:flex;
    flex:1 1 auto;
    min-width:0;
    width:100%;
    height:36px;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:7px 11px;
    border:1px solid var(--line);
    border-radius:4px;
    background:rgba(255,255,255,.055);
    color:var(--text);
    font:inherit;
    font-weight:750;
    text-align:left;
    cursor:pointer;
  }
  body.ui-light.tc-base-layout .mobile-game-picker-trigger{
    background:#fff;
    color:#0f172a;
    border-color:rgba(15,23,42,.18);
  }
  body.tc-base-layout .mobile-game-picker-trigger-label{
    min-width:0;
    overflow:hidden;
    white-space:nowrap;
    text-overflow:ellipsis;
  }
  body.tc-base-layout .mobile-game-picker-trigger i{
    flex:0 0 auto;
    font-size:11px;
    opacity:.75;
  }
  body.tc-base-layout .mobile-game-picker-trigger.is-played{
    background:#f59e0b !important;
    color:#18181b !important;
    border-color:#d97706 !important;
  }

  .mobile-game-picker[hidden]{display:none !important}
  .mobile-game-picker{
    position:fixed;
    inset:0;
    z-index:90000;
    display:flex;
    align-items:flex-end;
    justify-content:center;
    padding:10px;
  }
  .mobile-game-picker-backdrop{
    position:absolute;
    inset:0;
    background:rgba(2,6,23,.72);
    backdrop-filter:blur(4px);
  }
  .mobile-game-picker-panel{
    position:relative;
    width:min(100%,620px);
    max-height:min(78dvh,720px);
    display:flex;
    flex-direction:column;
    overflow:hidden;
    border-radius:18px 18px 12px 12px;
    background:linear-gradient(180deg,#101c2d,#0b1422);
    color:#f8fafc;
    border:1px solid rgba(148,163,184,.25);
    box-shadow:0 24px 70px rgba(0,0,0,.55);
    animation:mobileGamePickerIn .18s ease-out;
  }
  body.ui-light .mobile-game-picker-panel{
    background:linear-gradient(180deg,#ffffff,#f8fafc);
    color:#0f172a;
    border-color:rgba(15,23,42,.14);
    box-shadow:0 24px 60px rgba(15,23,42,.22);
  }
  .mobile-game-picker-head{
    flex:0 0 auto;
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:16px;
    border-bottom:1px solid rgba(148,163,184,.18);
  }
  .mobile-game-picker-head strong{display:block;font-size:17px}
  .mobile-game-picker-head small{display:block;margin-top:3px;color:#aebbd0;line-height:1.35}
  body.ui-light .mobile-game-picker-head small{color:#64748b}
  .mobile-game-picker-close{
    width:38px;
    height:38px;
    flex:0 0 38px;
    display:grid;
    place-items:center;
    border:1px solid rgba(148,163,184,.22);
    border-radius:50%;
    background:rgba(255,255,255,.06);
    color:inherit;
    font-size:25px;
    line-height:1;
    cursor:pointer;
  }
  body.ui-light .mobile-game-picker-close{background:#f8fafc}
  .mobile-game-picker-list{
    min-height:0;
    overflow:auto;
    padding:10px;
    display:grid;
    gap:8px;
    overscroll-behavior:contain;
  }
  .mobile-game-picker-item{
    width:100%;
    min-height:48px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:10px;
    padding:11px 12px;
    border:1px solid rgba(148,163,184,.18);
    border-radius:11px;
    background:rgba(255,255,255,.045);
    color:inherit;
    font:inherit;
    font-weight:800;
    text-align:left;
    cursor:pointer;
  }
  body.ui-light .mobile-game-picker-item{
    background:#fff;
    border-color:rgba(15,23,42,.13);
  }
  .mobile-game-picker-item.is-active{
    border-color:var(--tc-accent,#2286c2);
    box-shadow:inset 0 0 0 1px var(--tc-accent,#2286c2);
  }
  .mobile-game-picker-item.is-played{
    background:#f59e0b !important;
    color:#18181b !important;
    border-color:#d97706 !important;
  }
  .mobile-game-picker-item.is-locked:not(.is-played){opacity:.68}
  .mobile-game-picker-item-label{min-width:0;line-height:1.35}
  .mobile-game-picker-item-status{
    flex:0 0 auto;
    padding:3px 7px;
    border-radius:999px;
    background:rgba(24,24,27,.14);
    font-size:10px;
    font-weight:950;
    text-transform:uppercase;
    letter-spacing:.04em;
  }
  body.mobile-game-picker-open{overflow:hidden !important}
  @keyframes mobileGamePickerIn{
    from{transform:translateY(16px);opacity:.72}
    to{transform:translateY(0);opacity:1}
  }
}

/* Seletor de modalidade compartilhado */
.modality-switcher{margin:0 0 12px;padding:12px;border:1px solid var(--line);border-radius:13px;background:rgba(255,255,255,.035)}
.modality-title{display:flex;align-items:center;gap:8px;margin-bottom:9px;color:var(--muted);font-size:.78rem;font-weight:900;letter-spacing:.055em;text-transform:uppercase}
.modality-title i{color:var(--tc-accent)}
.modality-links{display:grid;grid-template-columns:1fr 1fr;gap:7px}
.modality-link{min-width:0;display:flex;align-items:center;justify-content:center;gap:7px;padding:10px 7px;border:1px solid var(--line);border-radius:10px;background:rgba(255,255,255,.04);color:var(--text);font-size:.82rem;font-weight:850;text-decoration:none}
.modality-link:hover{background:rgba(255,255,255,.08);transform:translateY(-1px)}
.modality-link-active{border-color:color-mix(in srgb,var(--tc-accent) 58%,transparent);background:color-mix(in srgb,var(--tc-accent) 16%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--tc-accent) 20%,transparent)}
.modality-link-active i{color:var(--tc-accent)}
body.ui-light .modality-switcher{background:rgba(15,23,42,.025);border-color:rgba(15,23,42,.13)}
body.ui-light .modality-link{background:#fff;color:#0f172a;border-color:rgba(15,23,42,.14)}
body.ui-light .modality-link-active{background:color-mix(in srgb,var(--tc-accent) 10%,white);border-color:color-mix(in srgb,var(--tc-accent) 42%,rgba(15,23,42,.15))}

/* ========================================================================
   DamExpert v3.47.1 — Treino Tático integrado
   Mantém a lógica do reprodutor original, mas adota a casca visual do DamExpert.
   ======================================================================== */
:root{
  --frameT:22px;
  --bg:#0b0f17;
  --panel:#111827;
  --card:#0f172a;
  --text:#e5e7eb;
  --muted:#9ca3af;
  --line:rgba(255,255,255,.10);
  --shadow:0 14px 40px rgba(0,0,0,.34);
  --accent:#258ecd;
  --accent2:#1f7fb8;
  --sqLight:#b3cce3;
  --sqDark:#258ecd;
  --sqDark2:#1f7fb8;
}
body.tactical-integrated{
  width:100%;min-width:0;min-height:100dvh;height:100dvh;margin:0;overflow:hidden;
  display:flex;flex-direction:column;color:var(--text);
  background:radial-gradient(980px 520px at 4% 0%,rgba(34,197,94,.10),transparent 60%),radial-gradient(900px 620px at 96% 8%,rgba(59,130,246,.09),transparent 60%),var(--bg);
}
body.tactical-integrated.ui-light{
  --bg:#eef2f4;--panel:#fff;--card:#fff;--text:#0f172a;--muted:#64748b;--line:rgba(15,23,42,.12);--shadow:0 14px 35px rgba(15,23,42,.12);
  background:#eef2f4;
}
body.tactical-integrated[data-board-style="dambo"],body.tactical-integrated.theme-dambo{--sqLight:#b3cce3;--sqDark:#258ecd;--sqDark2:#1f7fb8;--accent:#258ecd;--accent2:#1f7fb8}
body.tactical-integrated[data-board-style="playok"],body.tactical-integrated.theme-playok{--sqLight:#f2f2e1;--sqDark:#57aa6a;--sqDark2:#4fa260;--accent:#57aa6a;--accent2:#3d8f50}
body.tactical-integrated[data-board-style="aurora"]{--sqLight:#dce6ea;--sqDark:#668b95;--sqDark2:#5d818a;--accent:#668b95;--accent2:#4f747e}
body.tactical-integrated[data-board-style="tundra"]{--sqLight:#ffebd5;--sqDark:#95755d;--sqDark2:#896a54;--accent:#95755d;--accent2:#7d604b}

body.tactical-integrated .tactical-app-shell{
  flex:1 1 auto!important;width:100%!important;max-width:none!important;height:100dvh!important;min-height:0!important;
  margin:0!important;padding:8px 18px!important;display:block!important;overflow:hidden!important;
}
body.tactical-integrated .tactical-content{width:100%!important;height:100%!important;min-width:0!important;min-height:0!important;display:flex!important;overflow:hidden!important}
body.tactical-integrated .tactical-layout{
  --tactical-pair-gap:clamp(14px,2vw,24px);
  --tactical-pair-size:min(520px,calc((100vw - 82px)/2),calc(100dvh - 118px));
  width:min(100%,calc(var(--tactical-pair-size) * 2 + var(--tactical-pair-gap)))!important;height:100%!important;min-height:0!important;margin:0 auto!important;
  display:grid!important;grid-template-columns:minmax(0,var(--tactical-pair-size)) minmax(0,var(--tactical-pair-size))!important;gap:var(--tactical-pair-gap)!important;
  align-items:start!important;align-content:center!important;justify-content:center!important;overflow:visible!important;
}
body.tactical-integrated .tactical-board-panel{
  width:var(--tactical-pair-size)!important;max-width:var(--tactical-pair-size)!important;height:auto!important;min-height:0!important;margin:0!important;
  display:flex!important;flex-direction:column!important;justify-content:flex-start!important;align-items:stretch!important;overflow:visible!important;justify-self:end!important;align-self:start!important;
}
body.tactical-integrated .tactical-board-host{
  width:100%!important;height:calc(var(--tactical-pair-size) + 102px)!important;min-width:0!important;min-height:0!important;
  display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:flex-start!important;gap:6px!important;overflow:visible!important;padding:0!important;
}
body.tactical-integrated .board-wrap{
  padding:var(--frameT)!important;background:var(--sqDark)!important;border:1px solid rgba(255,255,255,.72)!important;border-radius:0!important;
  box-shadow:0 18px 42px color-mix(in srgb,var(--accent) 18%,rgba(15,23,42,.18))!important;overflow:visible!important;
}
body.tactical-integrated .board-wrap::before,body.tactical-integrated .board-wrap::after{content:none!important;display:none!important}
body.tactical-integrated .board{border:1px solid rgba(244,246,226,.82)!important;border-radius:0!important;box-shadow:none!important;background:var(--sqLight)!important}
body.tactical-integrated .square.light{background:var(--sqLight)!important}
body.tactical-integrated .square.dark{background:var(--sqDark)!important}
body.tactical-integrated .coords .files div,body.tactical-integrated .coords .ranks div{color:var(--sqLight)!important;text-shadow:none!important;font-family:Arial,Helvetica,sans-serif!important;font-weight:800!important}

body.tactical-integrated .tactical-board-controls{
  flex:0 0 auto!important;width:min(var(--boardSize,448px),100%)!important;max-width:var(--boardSize,448px)!important;margin:0 auto!important;padding:0 0 2px!important;
  background:transparent!important;border:0!important;box-shadow:none!important;border-radius:0!important;
}
body.tactical-integrated .tactical-play-buttons{display:flex!important;justify-content:center!important;align-items:center!important;gap:5px!important;width:100%!important;flex-wrap:nowrap!important}
body.tactical-integrated .tactical-play-buttons .btn{
  flex:1 1 0!important;min-width:0!important;width:auto!important;height:32px!important;min-height:32px!important;padding:0 3px!important;
  border:1px solid #a9a9a9!important;border-radius:2px!important;background:linear-gradient(180deg,#fff 0%,#d7d7d7 100%)!important;color:#000!important;
  font-size:clamp(11px,.95vw,13px)!important;font-weight:900!important;box-shadow:inset 0 1px 0 rgba(255,255,255,.9)!important;white-space:nowrap!important;
}
body.tactical-integrated .tactical-play-buttons .btn:hover{background:linear-gradient(180deg,#fff 0%,#cfcfcf 100%)!important}
body.tactical-integrated .tactical-play-buttons .btn.primary{border-color:color-mix(in srgb,var(--accent) 70%,#8a8a8a)!important;box-shadow:inset 0 -3px 0 color-mix(in srgb,var(--accent) 72%,transparent)!important}
body.tactical-integrated .current-game-title{width:100%!important;border-color:var(--line)!important;background:color-mix(in srgb,var(--card) 95%,var(--accent))!important;color:var(--text)!important}
body.tactical-integrated .tactical-train-row{width:100%;border-color:var(--line);background:color-mix(in srgb,var(--card) 96%,var(--accent))}

/* Painel pareado ao tamanho externo do tabuleiro. */
body.tactical-integrated .tactical-side-panel{
  width:var(--tactical-pair-size)!important;height:var(--tactical-pair-size)!important;min-width:0!important;min-height:0!important;max-height:var(--tactical-pair-size)!important;
  margin:0!important;border-radius:14px!important;background:var(--card)!important;color:var(--text)!important;overflow:hidden!important;
  display:flex!important;flex-direction:column!important;justify-self:start!important;align-self:start!important;
  border:1px solid color-mix(in srgb,var(--accent) 22%,var(--line))!important;box-shadow:0 18px 42px color-mix(in srgb,var(--accent) 12%,rgba(15,23,42,.15))!important;
}
body.tactical-integrated.ui-light .tactical-side-panel{background:#fff!important}
.tactical-panel-head{flex:0 0 auto;min-height:58px;padding:9px 10px;display:flex;align-items:center;justify-content:space-between;gap:10px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--card) 94%,var(--accent))}
.tactical-panel-brand{min-width:0;display:flex;align-items:center;gap:9px}.tactical-brand-mark{width:36px;height:36px;flex:0 0 36px;border-radius:9px;display:grid;place-items:center;background:color-mix(in srgb,var(--accent) 12%,var(--card));color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 25%,var(--line))}
.tactical-panel-brand>div{min-width:0;display:flex;flex-direction:column;line-height:1.1}.tactical-panel-brand strong{font-size:.92rem;font-weight:950}.tactical-panel-brand small{margin-top:3px;color:var(--muted);font-size:.66rem;font-weight:800;letter-spacing:.03em;text-transform:uppercase}
.tactical-panel-head-actions{display:flex;align-items:center;gap:7px;min-width:0}.tactical-session-badge{max-width:140px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:1px solid var(--line);border-radius:999px;padding:5px 8px;color:var(--muted);font-size:.62rem;font-weight:800}.tactical-session-badge i{color:var(--accent);margin-right:3px}
.tactical-back-btn{height:34px;display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 10px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--text);text-decoration:none;font-size:.68rem;font-weight:900}.tactical-back-btn:hover{border-color:color-mix(in srgb,var(--accent) 55%,var(--line));background:color-mix(in srgb,var(--accent) 7%,var(--card))}

.tactical-guest-ad{flex:0 0 auto;width:100%;padding:5px 9px 7px;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--card) 98%,var(--accent))}.tactical-guest-ad .guest-ad-label{display:block;margin:0 0 3px;color:var(--muted);font-size:.55rem;line-height:1;text-transform:uppercase;letter-spacing:.06em;font-weight:800}.tactical-ad-frame{width:100%;min-width:0;min-height:54px;max-height:92px;overflow:hidden;border:1px solid color-mix(in srgb,var(--accent) 16%,var(--line));border-radius:8px;background:color-mix(in srgb,var(--card) 96%,var(--accent))}.tactical-ad-frame .adsbygoogle{width:100%;min-width:0}

.tactical-tabs{flex:0 0 auto;height:42px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0;border-bottom:1px solid var(--line);background:color-mix(in srgb,var(--card) 97%,var(--accent))}.tactical-tab{min-width:0;border:0;border-right:1px solid var(--line);background:transparent;color:var(--muted);display:flex;align-items:center;justify-content:center;gap:6px;padding:0 6px;cursor:pointer;font-size:.66rem;font-weight:850}.tactical-tab:last-child{border-right:0}.tactical-tab:hover,.tactical-tab.active{color:var(--accent);background:color-mix(in srgb,var(--accent) 7%,var(--card))}.tactical-tab.active{box-shadow:inset 0 -2px 0 var(--accent)}
.tactical-panel-body{flex:1 1 auto;min-height:0;position:relative;overflow:hidden}.tactical-tab-view{width:100%;height:100%;min-height:0;overflow:auto;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--accent) 38%,var(--line)) transparent}.tactical-tab-view[hidden]{display:none!important}.tactical-tab-view.active{display:flex;flex-direction:column}
.tactical-section-head{flex:0 0 auto;padding:10px;display:flex;align-items:center;justify-content:space-between;gap:8px;border-bottom:1px solid var(--line)}.tactical-section-head>div{min-width:0;display:flex;flex-direction:column;gap:2px}.tactical-section-head strong{font-size:.76rem}.tactical-section-head small{font-size:.61rem;color:var(--muted);line-height:1.25}.tactical-live-dot{width:8px;height:8px;border-radius:50%;background:var(--accent);box-shadow:0 0 0 4px color-mix(in srgb,var(--accent) 13%,transparent)}
.tactical-games-panel{flex:1 1 auto;min-height:0;margin:0!important;padding:8px!important;overflow:auto!important}.tactical-games-panel .games-list{gap:6px!important}.tactical-games-panel .game-folder{gap:6px!important}.tactical-games-panel .folder-title{padding:3px 3px 1px;color:var(--muted);font-size:.61rem;text-transform:uppercase;letter-spacing:.05em}.tactical-games-panel .game-item{padding:8px 9px!important;border-radius:8px!important;background:color-mix(in srgb,var(--card) 96%,var(--accent))!important;border-color:var(--line)!important;font-size:.67rem!important;font-weight:760}.tactical-games-panel .game-item:hover,.tactical-games-panel .game-item.active{border-color:color-mix(in srgb,var(--accent) 48%,var(--line))!important;background:color-mix(in srgb,var(--accent) 8%,var(--card))!important}.tactical-games-panel .game-item.active{color:var(--accent);font-weight:900}

.tactical-moves-head{flex:0 0 auto;padding:10px!important;border-bottom:1px solid var(--line)}.tactical-moves-head .h{font-size:.76rem!important;font-weight:950!important;text-transform:uppercase;letter-spacing:.03em}.tactical-moves-head select,#gameSelect{margin-top:7px;width:100%;min-width:0;height:34px;border:1px solid var(--line);border-radius:8px;padding:0 8px;background:var(--card);color:var(--text)}body.ui-light #gameSelect{background:#fff;color:#0f172a}.tactical-notation-controls{flex:0 0 auto;padding:9px 10px!important;border-bottom:1px solid var(--line)}.tactical-notation-controls input[type="range"]{width:100%;accent-color:var(--accent)}.tactical-moves{flex:1 1 auto!important;min-height:0!important;overflow:auto!important;padding:10px!important}

.tactical-settings-list{padding:8px;display:flex;flex-direction:column;gap:7px}.tactical-option-row{min-height:56px!important;border-radius:9px!important;background:color-mix(in srgb,var(--card) 96%,var(--accent))!important;border-color:var(--line)!important}.tactical-option-row select{min-width:105px;max-width:132px;background:var(--card)!important;color:var(--text)!important;border-color:var(--line)!important}.ui-light .tactical-option-row select{background:#fff!important;color:#0f172a!important}.tactical-option-row input{accent-color:var(--accent)}.tactical-option-row .tc-option-icon{color:var(--accent)!important;background:color-mix(in srgb,var(--accent) 10%,var(--card))!important}
.tactical-panel-footer{flex:0 0 auto;min-height:30px;padding:6px 9px;border-top:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:8px;color:var(--muted);font-size:.57rem;font-weight:800}.tactical-panel-footer span:first-child{display:inline-flex;align-items:center;gap:5px}.tactical-panel-footer i{color:var(--accent)}

/* O projeto integrado não usa topbar, sidebar, planos ou bottom-sheet próprios. */
body.tactical-integrated .tc-topbar,body.tactical-integrated .sidebar,body.tactical-integrated .sidebar-overlay,body.tactical-integrated .sheet-overlay{display:none!important}
body.tactical-integrated .mobile-playbar{display:none!important}

@media(min-width:760px) and (max-width:980px) and (hover:hover) and (pointer:fine){
  body.tactical-integrated .tactical-app-shell{padding:8px 10px!important}
  body.tactical-integrated .tactical-layout{--tactical-pair-gap:clamp(10px,1.6vw,16px);--tactical-pair-size:min(430px,calc((100vw - 40px)/2),calc(100dvh - 112px));grid-template-columns:minmax(0,var(--tactical-pair-size)) minmax(0,var(--tactical-pair-size))!important}
}

@media(max-width:980px) and (hover:none), (max-width:759px){
  :root{--frameT:20px}
  body.tactical-integrated{height:auto;min-height:100dvh;overflow-x:hidden;overflow-y:auto}
  body.tactical-integrated .tactical-app-shell{height:auto!important;min-height:100dvh!important;padding:5px 5px 14px!important;overflow:visible!important}
  body.tactical-integrated .tactical-content{height:auto!important;overflow:visible!important}
  body.tactical-integrated .tactical-layout{width:100%!important;height:auto!important;display:flex!important;flex-direction:column!important;gap:7px!important;align-items:stretch!important;overflow:visible!important}
  body.tactical-integrated .tactical-board-panel{width:100%!important;max-width:none!important;height:auto!important;overflow:visible!important;align-items:stretch!important}
  body.tactical-integrated .tactical-board-host{width:100%!important;height:auto!important;min-height:0!important;overflow:visible!important;gap:5px!important}
  body.tactical-integrated .tactical-board-controls{width:min(calc(100vw - 10px),var(--boardSize,520px))!important;max-width:var(--boardSize,520px)!important}
  body.tactical-integrated .tactical-play-buttons{gap:3px!important}
  body.tactical-integrated .tactical-play-buttons .btn{height:30px!important;font-size:11px!important;padding:0 1px!important}
  body.tactical-integrated .mobile-playbar{display:flex!important;width:100%;gap:6px}
  body.tactical-integrated .tactical-mobile-playbar .mobile-row{gap:6px}
  body.tactical-integrated .tactical-side-panel{display:flex!important;width:min(100%,596px)!important;height:auto!important;max-height:none!important;min-height:0!important;margin:0 auto!important;border-radius:10px!important}
  body.tactical-integrated .tactical-panel-body{height:auto;overflow:visible}
  body.tactical-integrated .tactical-tab-view{height:auto;max-height:560px;overflow:auto}
  body.tactical-integrated .tactical-tab-view[data-tactical-view="settings"]{max-height:none}
  .tactical-session-badge{display:none}
  .tactical-back-btn span{display:none}.tactical-back-btn{width:34px;padding:0}
  .tactical-guest-ad{padding:5px 7px 7px}.tactical-ad-frame{min-height:50px;max-height:90px}
}

@media(max-width:520px){
  :root{--frameT:18px}
  .tactical-panel-head{min-height:52px;padding:7px 8px}.tactical-brand-mark{width:32px;height:32px;flex-basis:32px}.tactical-panel-brand strong{font-size:.83rem}.tactical-panel-brand small{font-size:.59rem}
  .tactical-tab{font-size:.60rem;gap:4px}.tactical-tab i{font-size:.72rem}
  .tactical-panel-footer{font-size:.53rem}
  .tactical-option-row{min-height:52px!important;padding:8px!important}.tactical-option-row .tc-option-info small{display:none}
}


/* ========================================================================
   DamExpert v3.47.1 — estabilidade de layout + anúncios do Treino Tático
   ======================================================================== */
body.tactical-integrated .tactical-layout{
  --tactical-pair-size:var(--tactical-board-outer-size,min(520px,calc((100vw - 82px)/2),calc(100dvh - 118px)));
}
body.tactical-integrated .tactical-side-panel,
body.tactical-integrated .tactical-side-panel *{box-sizing:border-box}
body.tactical-integrated .tactical-side-panel{contain:layout paint}
body.tactical-integrated .tactical-panel-head,
body.tactical-integrated .tactical-guest-ad,
body.tactical-integrated .tactical-tabs,
body.tactical-integrated .tactical-panel-footer{min-width:0}
body.tactical-integrated .tactical-panel-body{flex:1 1 0!important;min-height:0!important;overflow:hidden!important}
body.tactical-integrated .tactical-tab-view{min-height:0!important;overscroll-behavior:contain}
body.tactical-integrated .tactical-tab-view.active{display:flex!important;flex-direction:column!important}
body.tactical-integrated .tactical-settings-list{min-height:0}

/* O Modo Treino altera somente a interação; a geometria tabuleiro/painel permanece fixa. */
body.tc-base-layout.tactical-integrated.training .tactical-layout{
  width:min(100%,calc(var(--tactical-pair-size) * 2 + var(--tactical-pair-gap)))!important;
  height:100%!important;
  display:grid!important;
  grid-template-columns:minmax(0,var(--tactical-pair-size)) minmax(0,var(--tactical-pair-size))!important;
  gap:var(--tactical-pair-gap)!important;
  justify-content:center!important;
  align-items:start!important;
  align-content:center!important;
}
body.tc-base-layout.tactical-integrated.training .tactical-board-panel,
body.tc-base-layout.tactical-integrated.training .tactical-side-panel{display:flex!important}
body.tc-base-layout.tactical-integrated.training .tactical-side-panel{
  width:var(--tactical-pair-size)!important;
  height:var(--tactical-pair-size)!important;
  max-height:var(--tactical-pair-size)!important;
}
body.tc-base-layout.tactical-integrated.training .tactical-tab[data-tactical-tab="notation"]{opacity:.42;pointer-events:none}

/* AdSense desktop dentro do painel. */
body.tactical-integrated .tactical-guest-ad[hidden]{display:none!important}
body.tactical-integrated .tactical-guest-ad{padding:5px 9px 7px!important}
body.tactical-integrated .tactical-ad-frame{
  min-height:60px!important;
  max-height:92px!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  overflow:hidden!important;
}
body.tactical-integrated .tactical-ad-frame .damas-ad-unit,
body.tactical-integrated .tactical-ad-frame .adsbygoogle{display:block!important;width:100%!important;min-width:0!important}
.tactical-mobile-floating-ad{display:none}

@media (max-width:980px) and (hover:none), (max-width:759px){
  body.tactical-integrated .tactical-layout{
    --tactical-pair-size:var(--tactical-board-outer-size,min(100%,596px));
  }
  body.tc-base-layout.tactical-integrated.training .tactical-layout{
    width:100%!important;height:auto!important;display:flex!important;flex-direction:column!important;gap:7px!important;align-items:stretch!important;overflow:visible!important;
  }
  body.tc-base-layout.tactical-integrated.training .tactical-board-panel{width:100%!important;max-width:none!important;height:auto!important;overflow:visible!important}
  body.tc-base-layout.tactical-integrated.training .tactical-side-panel{width:min(100%,596px)!important;height:auto!important;max-height:none!important;margin:0 auto!important}
  body.tactical-integrated .tactical-guest-ad{display:none!important}
  body.tactical-integrated.guest-visitor{padding-bottom:calc(var(--tactical-mobile-ad-height,72px) + env(safe-area-inset-bottom))!important}
  .tactical-mobile-floating-ad{
    position:fixed;left:0;right:0;bottom:0;z-index:1200;
    display:flex;flex-direction:column;align-items:center;width:100%;
    padding:4px 8px calc(6px + env(safe-area-inset-bottom));
    background:color-mix(in srgb,var(--card) 98%,var(--accent));
    border-top:1px solid var(--line);box-shadow:0 -7px 22px rgba(0,0,0,.14);
  }
  .tactical-mobile-floating-ad[hidden]{display:none!important}
  .tactical-mobile-floating-ad .guest-ad-label{width:300px;max-width:100%;margin:0 auto 3px;text-align:left;font-size:.56rem;line-height:1;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;font-weight:800}
  .tactical-mobile-floating-frame{width:300px;max-width:100%;height:50px;min-height:50px;display:flex;align-items:center;justify-content:center;overflow:hidden;background:transparent}
  .tactical-mobile-fixed-ad-unit,.tactical-mobile-floating-frame .adsbygoogle{display:inline-block!important;width:300px!important;height:50px!important;max-width:300px!important}
}

/* Neutraliza regras legadas mais específicas do tc-base-layout no modo integrado. */
body.tc-base-layout.tactical-integrated .board-panel.local-board-panel.tactical-board-panel{
  width:var(--tactical-pair-size)!important;
  max-width:var(--tactical-pair-size)!important;
  height:auto!important;
  min-height:0!important;
  gap:0!important;
  overflow:visible!important;
}
body.tc-base-layout.tactical-integrated .board-host.local-board-host.tactical-board-host{
  width:100%!important;
  height:calc(var(--tactical-pair-size) + 102px)!important;
  min-height:0!important;
  overflow:visible!important;
  gap:6px!important;
}
@media(max-width:980px){
  body.tc-base-layout.tactical-integrated .board-panel.local-board-panel.tactical-board-panel{
    width:100%!important;max-width:none!important;height:auto!important;overflow:visible!important;
  }
  body.tc-base-layout.tactical-integrated .board-host.local-board-host.tactical-board-host{
    width:100%!important;height:auto!important;min-height:0!important;overflow:visible!important;
  }
}

/* ========================================================================
   DamExpert v3.48.0 — painel tático, acesso visitante e AdSense
   ======================================================================== */
/* O painel precisa permitir que o iframe do AdSense seja pintado normalmente. */
body.tactical-integrated .tactical-side-panel{contain:none!important}
body.tactical-integrated .tactical-ad-frame{
  min-height:60px!important;
  max-height:none!important;
  overflow:visible!important;
  display:block!important;
}

/* A Anotação permanece navegável também quando o Modo Treino está ativo. */
body.tc-base-layout.tactical-integrated.training .tactical-tab[data-tactical-tab="notation"]{
  opacity:1!important;
  pointer-events:auto!important;
}

/* Modal de conteúdo bloqueado. */
.course-lock-actions .course-close-action{
  min-height:48px;
  border:1px solid rgba(148,163,184,.34);
  border-radius:11px;
  padding:10px;
  background:rgba(255,255,255,.07);
  color:#e2e8f0;
  font:inherit;
  font-weight:800;
  cursor:pointer;
}
.course-lock-actions .course-close-action:hover{background:rgba(255,255,255,.12)}
body.ui-light .course-lock-dialog{
  background:linear-gradient(160deg,#ffffff,#f1f5f9);
  color:#0f172a;
  border-color:rgba(15,23,42,.16);
}
body.ui-light .course-lock-dialog p{color:#475569}
body.ui-light .course-lock-close{color:#334155}
body.ui-light .course-lock-actions .course-close-action{background:#eef2f7;color:#0f172a;border-color:rgba(15,23,42,.14)}

/* Destaque dos exercícios disponíveis apenas para membros. */
.mobile-game-picker-item.is-locked{border-style:dashed!important}
.mobile-game-picker-item.is-locked .mobile-game-picker-item-status{font-weight:900}


/* ========================================================================
   DamExpert v3.48.1 — correção de cliques nas abas do painel tático
   ======================================================================== */
/*
   O iframe criado pelo AdSense pode receber dimensões maiores que o bloco
   reservado. Sem um contexto de empilhamento próprio, a área transparente do
   iframe alcança Módulos/Anotação/Definições e intercepta o mouse. O anúncio
   permanece clicável somente dentro da área reservada a ele.
*/
body.tactical-integrated .tactical-guest-ad{
  position:relative!important;
  z-index:1!important;
  overflow:hidden!important;
  isolation:isolate;
}
body.tactical-integrated .tactical-ad-frame{
  position:relative!important;
  z-index:1!important;
  width:100%!important;
  height:90px!important;
  min-height:60px!important;
  max-height:90px!important;
  overflow:hidden!important;
  display:block!important;
}
body.tactical-integrated .tactical-ad-frame .damas-ad-unit,
body.tactical-integrated .tactical-ad-frame .adsbygoogle{
  display:block!important;
  width:100%!important;
  max-width:100%!important;
  min-width:0!important;
}
body.tactical-integrated .tactical-tabs{
  position:relative!important;
  z-index:30!important;
  pointer-events:auto!important;
  isolation:isolate;
}
body.tactical-integrated .tactical-tab{
  position:relative!important;
  z-index:31!important;
  pointer-events:auto!important;
  touch-action:manipulation;
}
body.tactical-integrated .tactical-panel-body{
  position:relative!important;
  z-index:20!important;
}

@media (max-width:980px) and (hover:none), (max-width:759px){
  body.tactical-integrated .tactical-ad-frame{
    height:60px!important;
    max-height:60px!important;
  }
}


/* ========================================================================
   DamExpert v3.48.2 — área central do painel sempre visível
   ======================================================================== */
/*
   Fallback para navegadores que calculam flex:1 1 0 como zero quando a
   altura do painel deriva de custom properties atualizadas via JavaScript.
   O JS v3.48.2 faz o pareamento exato com o tabuleiro; estas regras garantem
   que a área não desapareça durante o primeiro frame.
*/
body.tactical-integrated .tactical-panel-body{
  display:block!important;
  flex:1 1 180px!important;
  min-height:150px!important;
  width:100%!important;
  overflow:hidden!important;
}
body.tactical-integrated .tactical-panel-body > .tactical-tab-view{
  width:100%!important;
  min-height:0!important;
}
body.tactical-integrated .tactical-panel-body > .tactical-tab-view.active{
  display:flex!important;
  flex-direction:column!important;
  height:100%!important;
}
body.tactical-integrated .tactical-panel-body > .tactical-tab-view[hidden]{
  display:none!important;
}

/* No desktop, há sempre uma altura de segurança enquanto o JS mede o board. */
@media (min-width:760px){
  body.tactical-integrated .tactical-side-panel{
    min-height:420px!important;
  }
}

/* Em layout empilhado/mobile, o painel cresce naturalmente com o conteúdo. */
@media (max-width:980px) and (hover:none), (max-width:759px){
  body.tactical-integrated .tactical-side-panel{
    min-height:0!important;
  }
  body.tactical-integrated .tactical-panel-body{
    height:auto!important;
    min-height:180px!important;
    flex:0 0 auto!important;
    overflow:visible!important;
  }
  body.tactical-integrated .tactical-panel-body > .tactical-tab-view.active{
    height:auto!important;
    min-height:180px!important;
  }
}


/* ========================================================================
   DamExpert v3.48.3 — anúncio por aba + rolagem completa no mobile
   ======================================================================== */
/*
   O anúncio faz parte somente de Módulos. Ao abrir Anotação ou Definições,
   ele sai completamente do fluxo e a área central aproveita a altura liberada.
*/
body.tactical-integrated[data-tactical-active-tab="notation"] .tactical-guest-ad,
body.tactical-integrated[data-tactical-active-tab="settings"] .tactical-guest-ad{
  display:none!important;
}

/* A área central cresce imediatamente quando o anúncio é recolhido. */
body.tactical-integrated.tactical-panel-expanded .tactical-panel-body{
  flex-grow:1!important;
}

/*
   Mobile: o painel ganha uma janela de conteúdo própria. Isso evita que a
   lista de módulos, os lances ou as definições sejam cortados por regras
   legadas que prendem a aplicação ao viewport.
*/
@media (max-width:980px) and (hover:none), (max-width:759px){
  body.tactical-integrated .tactical-side-panel{
    overflow:hidden!important;
  }
  body.tactical-integrated .tactical-panel-body{
    display:block!important;
    width:100%!important;
    height:clamp(300px,62dvh,560px)!important;
    min-height:300px!important;
    max-height:560px!important;
    flex:0 0 auto!important;
    overflow:hidden!important;
  }
  body.tactical-integrated .tactical-panel-body > .tactical-tab-view.active{
    display:flex!important;
    flex-direction:column!important;
    width:100%!important;
    height:100%!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;
    overscroll-behavior-y:contain;
    scrollbar-width:thin;
  }

  /* Módulos: cabeçalho fixo e somente a relação de arquivos rola. */
  body.tactical-integrated #tacticalTabModules{
    overflow:hidden!important;
  }
  body.tactical-integrated #tacticalTabModules .tactical-games-panel{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;
  }

  /* Anotação: seletor/slider permanecem acessíveis e os lances rolam abaixo. */
  body.tactical-integrated #tacticalTabNotation{
    overflow:hidden!important;
  }
  body.tactical-integrated #tacticalTabNotation .tactical-moves{
    flex:1 1 auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;
  }

  /* Definições: a lista completa pode ser percorrida até a última opção. */
  body.tactical-integrated #tacticalTabSettings{
    overflow-y:auto!important;
    overflow-x:hidden!important;
    -webkit-overflow-scrolling:touch;
  }
  body.tactical-integrated #tacticalTabSettings .tactical-settings-list{
    flex:0 0 auto!important;
    min-height:max-content!important;
    padding-bottom:16px!important;
  }
}

/* Em aparelhos muito baixos, ainda reservamos uma área útil com rolagem. */
@media (max-width:759px) and (max-height:620px){
  body.tactical-integrated .tactical-panel-body{
    height:300px!important;
    min-height:300px!important;
  }
}
/* V3.51: ações de membro no bloqueio do Treino Tático */
.course-lock-actions{grid-template-columns:1fr 1fr 1fr}.course-lock-actions .course-login-action{border:0;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;border-radius:11px;padding:10px;text-decoration:none;font-weight:800}.course-lock-actions .course-plans-action{background:rgba(245,158,11,.16);border:1px solid rgba(245,158,11,.42);color:#fbbf24}@media(max-width:700px){.course-lock-actions{grid-template-columns:1fr}}

/* Build 2.0.0 — ajustes específicos para Dama Internacional 10x10 */
:root{--gridN:10}
body.tc-base-layout .board{grid-template-columns:repeat(10,1fr)!important;grid-template-rows:repeat(10,1fr)!important}
body.tc-base-layout .coords .files,body.tc-base-layout .coords .ranks{display:none!important}
@media (min-width:981px){body.tactical-integrated .tactical-layout{grid-template-columns:minmax(380px,500px) minmax(390px,1fr)!important}}


/* ========================================================================
   v2.1.0 — linha de identidade sincronizada com o Estilo do Tabuleiro
   ======================================================================== */
/*
   Repete no visualizador o efeito sutil do cabeçalho usado na página-modelo.
   A cor usa --accent, portanto muda imediatamente entre Dambo, PlayOk,
   Aurora e Tundra sem alterar a geometria do tabuleiro/painel.
*/
body.tactical-integrated::before{
  content:"";
  position:fixed;
  z-index:10050;
  top:0;
  left:0;
  right:0;
  height:2px;
  pointer-events:none;
  background:color-mix(in srgb,var(--accent) 72%,transparent);
  box-shadow:0 5px 18px color-mix(in srgb,var(--accent) 24%,transparent);
  transition:background-color .22s ease,box-shadow .22s ease;
}


/* v2.4 — anúncio flutuante sempre visível no mobile */
@media (max-width:980px) and (hover:none), (max-width:759px){
  body.tactical-integrated .tactical-mobile-floating-ad{
    position:fixed!important;
    left:0!important;
    right:0!important;
    bottom:0!important;
    z-index:1400!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    width:100%!important;
    margin:0!important;
  }
}
