/* Painel logado: complementa styles.css */
:root {
  --panel: #262421;
  --panel-2: #1f1e1b;
  --line: #3c3a37;
  --gold: #f5c242;
  --red: #e2574c;
}

body.app { min-height: 100vh; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
main#view { outline: none; padding: 20px 28px 40px; }

/* ---------- Sidebar ---------- */
.nav .more-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 16px; background: none; border: 0; color: var(--text-dim);
  font: inherit; font-weight: 800; font-size: 1.02rem; cursor: pointer; text-align: left;
}
.nav .more-toggle:hover { background: var(--bg-hover); color: var(--text); }
.nav .more-toggle[aria-expanded="true"] .ico { transform: rotate(180deg); }
.more-menu a { padding-left: 28px; font-size: .95rem; }
.nav a.active { background: var(--bg-hover); box-shadow: inset 3px 0 0 var(--green); }

.side-user { display: flex; align-items: center; gap: 10px; padding: 6px; font-weight: 800; }
.side-user:hover { background: var(--bg-hover); border-radius: 6px; }
.side-icons { display: flex; justify-content: space-between; padding: 0 2px; }
.side-icons button {
  background: none; border: 0; cursor: pointer; font-size: 1.1rem;
  padding: 6px; border-radius: 6px; filter: grayscale(1) brightness(1.4);
}
.side-icons button:hover { background: var(--bg-hover); filter: none; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 4px; background: #e0e0e0; color: #777;
  font-size: 1.6rem; flex: none;
}
.avatar.sm { width: 28px; height: 28px; font-size: 1.1rem; }
.avatar.bot { background: #3a3835; color: inherit; }

/* ---------- Cartões e utilitários ---------- */
.card {
  background: var(--panel); border-radius: 10px; padding: 16px;
}
.card h3 { margin: 0 0 12px; font-size: 1.1rem; font-weight: 900; }
.muted { color: var(--text-dim); }
.small { font-size: .85rem; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-big { font-size: 1.25rem; padding: 14px 18px; }
.btn[aria-disabled="true"], .btn:disabled { opacity: .5; cursor: not-allowed; }

.progress { height: 10px; background: #3c3a37; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--green); border-radius: inherit; }

/* ---------- Início ---------- */
.home { max-width: 1320px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }
.home-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.home-head .me { display: flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 900; }
.streak { font-size: 1.5rem; font-weight: 900; display: flex; align-items: center; gap: 8px; }

.hero-card {
  display: grid; grid-template-columns: 310px repeat(3, minmax(0, 1fr)); gap: 14px;
  background: var(--panel); border-radius: 10px; padding: 14px;
}
.play-card { display: flex; flex-direction: column; gap: 10px; }
.play-card h2 { margin: 0; font-size: 1.3rem; font-weight: 900; }
.chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.chip {
  background: var(--gray-btn); color: var(--text); border: 2px solid transparent;
  border-radius: 6px; padding: 12px 4px; font: inherit; font-weight: 800; cursor: pointer;
}
.chip:hover { filter: brightness(1.15); }
.chip.active { border-color: var(--green); }
.big-link {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--gray-btn); border-radius: 8px; padding: 14px; font-weight: 900; font-size: 1.1rem;
  box-shadow: 0 3px 0 var(--gray-btn-shadow);
}
.big-link:hover { filter: brightness(1.15); }

.mini-card {
  background: var(--panel-2); border-radius: 8px; overflow: hidden;
  display: flex; flex-direction: column;
}
.mini-card .board { border-radius: 0; }
.mini-meta { display: flex; align-items: center; gap: 10px; padding: 12px 16px; min-height: 64px; }
.mini-card .btn { margin: 0 16px 16px; }

.home-cols { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
.col-side { display: flex; flex-direction: column; gap: 20px; }

.history { width: 100%; border-collapse: collapse; font-size: .92rem; }
.history th { text-align: left; color: var(--text-dim); font-weight: 700; padding: 8px; border-bottom: 1px solid var(--line); }
.history td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.history tr:hover td { background: #2b2926; }
.res { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center;
  border-radius: 4px; font-size: .8rem; font-weight: 900; color: #fff; }
.res.win { background: var(--green); } .res.loss { background: var(--red); } .res.draw { background: #8b8987; }
.empty { text-align: center; padding: 24px 8px; color: var(--text-dim); }

.daily .board { border-radius: 6px; margin-bottom: 12px; }
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat { background: var(--panel-2); border-radius: 8px; padding: 12px; }
.stat b { display: block; font-size: 1.5rem; font-weight: 900; }

/* ---------- Partida / layout de tabuleiro ---------- */
.game-layout {
  display: grid;
  /* tabuleiro: o que couber na altura, sem empurrar o painel (sidebar 180 + margens + painel ~ 600px) */
  grid-template-columns: max(280px, min(calc(100vh - 150px), calc(100vw - 600px))) minmax(300px, 420px);
  gap: 24px; justify-content: center; align-items: start;
}
.board-col { width: 100%; display: flex; flex-direction: column; gap: 8px; }
.player-bar { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.player-bar .pb-name { font-weight: 800; }
.player-bar .pb-rating { color: var(--text-dim); font-weight: 600; }
.clock {
  margin-left: auto; min-width: 120px; text-align: right;
  background: #262421; color: #8b8987; border-radius: 4px;
  font-size: 1.6rem; font-weight: 800; padding: 4px 12px; font-variant-numeric: tabular-nums;
}
.clock.running { background: #fff; color: #262421; }
.clock.low.running { background: var(--red); color: #fff; }
.clock[hidden] { display: none; }

.panel {
  background: var(--panel); border-radius: 10px; display: flex; flex-direction: column;
  min-height: min(640px, calc(100vh - 80px)); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; font-size: 1.3rem; font-weight: 900; background: var(--panel-2);
}
.panel-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; overflow: auto; }
.panel-foot { padding: 14px 16px; border-top: 1px solid var(--line); display: flex; gap: 10px; flex-wrap: wrap; }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--panel-2); }
.tabs button {
  background: none; border: 0; color: var(--text-dim); font: inherit; font-weight: 700;
  padding: 12px 6px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.tabs button .ti { font-size: 1.3rem; }
.tabs button[aria-selected="true"] { background: var(--panel); color: var(--text); }

.select {
  width: 100%; appearance: none; background: var(--gray-btn) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23c3c2c1' stroke-width='2' fill='none'/%3E%3C/svg%3E") no-repeat right 16px center;
  color: var(--text); border: 0; border-radius: 8px; padding: 16px; font: inherit; font-weight: 900; font-size: 1.15rem;
  text-align: center; cursor: pointer;
}

.moves {
  display: grid; grid-template-columns: 40px 1fr 1fr; gap: 2px 6px;
  font-size: .95rem; align-content: start; background: var(--panel-2); border-radius: 8px; padding: 8px;
  min-height: 120px; max-height: 340px; overflow: auto;
}
.moves .n { color: var(--text-dim); text-align: right; padding: 3px 0; }
.moves button {
  background: none; border: 0; color: var(--text); font: inherit; font-weight: 700; text-align: left;
  padding: 3px 6px; border-radius: 4px; cursor: pointer;
}
.moves button:hover { background: var(--bg-hover); }
.moves button.cur { background: #4b4847; }

.banner-result {
  text-align: center; padding: 16px; border-radius: 8px; background: var(--panel-2);
}
.banner-result h3 { margin: 0 0 4px; font-size: 1.5rem; font-weight: 900; }
.banner-result.win h3 { color: var(--green-hover); }
.banner-result.loss h3 { color: #ff8a7f; }

.searching { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 0; }
.spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 5px solid #3c3a37; border-top-color: var(--green); animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Robôs */
.bubble-row { display: flex; gap: 12px; align-items: flex-start; }
.bubble-row .avatar { width: 64px; height: 64px; font-size: 2.4rem; }
.bubble {
  position: relative; background: #fff; color: #262421; border-radius: 10px; padding: 10px 14px;
  font-weight: 700; flex: 1;
}
.bubble::before {
  content: ""; position: absolute; left: -8px; top: 18px;
  border: 8px solid transparent; border-left: 0; border-right-color: #fff;
}
.bot-group h4 { margin: 8px 0; color: var(--text-dim); font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }
.bot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.bot-btn {
  background: var(--panel-2); border: 2px solid transparent; border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; padding: 8px 4px; color: var(--text);
  font: inherit; font-size: .75rem; font-weight: 800;
}
.bot-btn .em { font-size: 1.8rem; }
.bot-btn:hover { background: var(--bg-hover); }
.bot-btn[aria-pressed="true"] { border-color: var(--green); }
.colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.colors button {
  background: var(--panel-2); border: 2px solid transparent; border-radius: 8px; padding: 10px;
  font-size: 1.6rem; color: var(--text); cursor: pointer;
}
.colors button[aria-pressed="true"] { border-color: var(--green); }

/* Problemas e aulas */
.path { display: flex; flex-wrap: wrap; gap: 8px; }
.path a {
  width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: #8a5a2b; font-weight: 900; box-shadow: 0 4px 0 #5e3b1a;
}
.path a.done { background: var(--green); box-shadow: 0 4px 0 var(--green-dark); }
.path a.cur { outline: 3px solid var(--gold); }
.feedback { min-height: 48px; padding: 12px; border-radius: 8px; background: var(--panel-2); font-weight: 800; }
.feedback.ok { background: #3f5d27; }
.feedback.bad { background: #6b2b26; }
.rating-big { font-size: 2rem; font-weight: 900; }

.lesson-list { display: flex; flex-direction: column; gap: 6px; }
.lesson-list h4 { margin: 10px 0 2px; color: var(--text-dim); font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }
.lesson-list a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--panel-2);
}
.lesson-list a:hover { background: var(--bg-hover); }
.lesson-list a.cur { outline: 2px solid var(--green); }
.lesson-list .li-icon {
  width: 34px; height: 34px; border-radius: 8px; background: #3c3a37;
  display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.lesson-list a.done .li-icon { background: var(--green); }

.review-controls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.panel-foot > .review-controls, .panel-foot > .row { flex-basis: 100%; }
.panel-foot > .row .btn { padding-left: 8px; padding-right: 8px; }
.colors .piece.icon { width: 2.2rem; height: 2.2rem; }

/* Diálogo, toast */
dialog#settings {
  background: var(--panel); color: var(--text); border: 0; border-radius: 12px; padding: 0;
  width: min(420px, calc(100vw - 32px));
}
dialog#settings::backdrop { background: rgba(0,0,0,.6); }
.settings-form { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.settings-form h2 { margin: 0; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; }
.field input[type="text"], .field input:not([type]) , .field input[name="name"] {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px;
  padding: 10px; font: inherit;
}
.field legend { margin-bottom: 6px; }
.field label { display: flex; gap: 8px; align-items: center; }
.settings-actions { display: flex; justify-content: space-between; gap: 10px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 50;
  background: #fff; color: #262421; padding: 12px 18px; border-radius: 8px; font-weight: 800;
  box-shadow: 0 6px 20px rgba(0,0,0,.4);
}

/* ---------- Treino: componentes novos ---------- */
.good-txt { color: var(--green-hover); }
.bad-txt { color: #ff8a7f; }
.back { font-size: 1.6rem; line-height: 1; padding: 0 8px 0 0; color: var(--text-dim); }
.back:hover { color: var(--text); }
.panel-head { position: relative; }
.engine-badge {
  font-size: .7rem; font-weight: 800; padding: 3px 8px; border-radius: 99px;
  background: #3c3a37; color: var(--text-dim); white-space: nowrap;
}
.engine-badge.sf { background: #2f4a1f; color: #b9e08a; }
.engine-badge.basic { background: #5a3a1c; color: #ffc68a; }
.spinner.sm { width: 16px; height: 16px; border-width: 3px; display: inline-block; vertical-align: middle; }

.hub { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.hub.narrow { max-width: 820px; }
.hub-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.hub-head h1 { margin: 0; font-size: 2rem; font-weight: 900; }
.hub-head p { margin: 6px 0 0; }
.hub-rating { display: flex; flex-direction: column; align-items: flex-end; }
.hub-rating b { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.group-title { margin: 14px 0 8px; font-size: 1.05rem; font-weight: 900; }

.mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.mode-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: 12px;
  background: var(--panel); border-top: 4px solid var(--c, var(--green)); min-height: 140px;
}
.mode-card:hover { background: var(--bg-hover); }
.mode-card .mi { font-size: 1.8rem; }
.mode-card b { font-size: 1.15rem; }
.mode-card span:last-child { color: var(--text-dim); font-size: .88rem; }
.mode-card.green { --c: #81b64c; } .mode-card.orange { --c: #e68f00; } .mode-card.blue { --c: #5d9cec; }
.mode-card.red { --c: #e2574c; } .mode-card.purple { --c: #9b6bd6; }

.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.theme-chip {
  position: relative; display: flex; align-items: center; gap: 8px; padding: 10px 12px 14px;
  background: var(--panel-2); border-radius: 8px; overflow: hidden;
}
.theme-chip:hover { background: var(--bg-hover); }
.theme-chip .mini-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 0; }
.mini-bar { display: inline-block; height: 6px; width: 60px; background: #3c3a37; border-radius: 99px; overflow: hidden; }
.mini-bar.wide { width: 140px; }
.mini-bar > span { display: block; height: 100%; background: var(--green); }
.mini-bar.bad > span { background: var(--red); }
.progress.bad > span { background: var(--red); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 5px 10px; border-radius: 99px;
  background: var(--panel-2); color: var(--text-dim); font-size: .85rem; font-weight: 700;
}
.tag:hover { color: var(--text); background: var(--bg-hover); }
.tag.on { background: #3f5d27; color: #fff; }
.turn-ind { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.05rem; }
.turn-ind .piece.icon { width: 1.9rem; height: 1.9rem; }

.race-top { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 10px; text-align: center; }
.race-top > div { background: var(--panel-2); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; }
.race-top b { font-size: 1.6rem; font-weight: 900; font-variant-numeric: tabular-nums; }
.race-score { color: var(--green-hover); font-size: 2.2rem !important; }
.race-log { display: flex; flex-wrap: wrap; gap: 6px; }
.race-dot {
  width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: .85rem;
}
.race-dot.ok { background: var(--green); } .race-dot.bad { background: var(--red); }

/* Interruptores do treinador */
.switch { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw {
  flex: none; width: 40px; height: 22px; border-radius: 99px; background: #4b4847; position: relative; transition: background .15s; margin-top: 2px;
}
.switch .sw::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s;
}
.switch input:checked + .sw { background: var(--green); }
.switch input:checked + .sw::after { transform: translateX(18px); }
.switch input:focus-visible + .sw { outline: 2px solid #fff; outline-offset: 2px; }
.switch > span:last-child { display: flex; flex-direction: column; gap: 2px; }

/* Treinador ao vivo */
.coach { background: var(--panel-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.coach-head { font-weight: 900; color: var(--text-dim); font-size: .85rem; text-transform: uppercase; letter-spacing: .5px; }
.coach-line { display: flex; gap: 8px; align-items: center; color: var(--text-dim); }
.coach-verdict { display: flex; gap: 10px; align-items: center; }
.cls-sym {
  flex: none; min-width: 36px; height: 36px; padding: 0 6px; border-radius: 99px; background: var(--cls, #777);
  display: flex; align-items: center; justify-content: center; font-weight: 900; color: #fff;
}
.coach-reasons { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
.coach-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.coach-actions .btn { padding: 8px 6px; font-size: .85rem; }
.coach-tip { background: #2c3a4a; border-radius: 8px; padding: 8px 10px; font-size: .92rem; }
.coach-tip.good { background: #2f4a1f; }
.coach-alert { background: #4a2a26; border-radius: 8px; padding: 8px 10px; font-size: .92rem; }
.coach-alert.check { background: #6b2b26; font-weight: 800; }

/* Análise */
.board-eval { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
.evalbar {
  position: relative; border-radius: 4px; overflow: hidden; background: #403d39;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.evalbar.flipped { flex-direction: column-reverse; }
.evalbar-w { background: #f3f3f3; height: 50%; transition: height .35s; }
.evalbar-txt {
  position: absolute; left: 0; right: 0; top: 4px; text-align: center; font-size: .62rem; font-weight: 900; color: #f3f3f3;
}
.evalbar-txt.on-white { top: auto; bottom: 4px; color: #262421; }
.evalbar.flipped .evalbar-txt { top: auto; bottom: 4px; }
.evalbar.flipped .evalbar-txt.on-white { bottom: auto; top: 4px; }
.evalgraph { width: 100%; height: 70px; border-radius: 6px; cursor: pointer; display: block; }
.acc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.acc { background: var(--panel-2); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; align-items: center; }
.acc b { font-size: 2rem; font-weight: 900; }
.acc.me { outline: 2px solid var(--green); }
.class-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.class-table td, .class-table th { padding: 3px 6px; }
.class-table td:first-child { font-weight: 900; width: 28px; text-align: center; }
.class-table td:nth-child(n+3), .class-table th:nth-child(n+3) { text-align: center; width: 40px; }
.detail { background: var(--panel-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 8px; border-left: 4px solid var(--cls, #777); }
.analysis-cta { background: var(--panel-2); border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.moves button .msym { font-weight: 900; margin-left: 3px; }
.lines { display: flex; flex-direction: column; gap: 4px; }
.line {
  display: flex; gap: 10px; align-items: baseline; text-align: left; background: var(--panel-2); border: 0; border-radius: 6px;
  padding: 8px 10px; color: var(--text); font: inherit; cursor: pointer;
}
.line:hover { background: var(--bg-hover); }
.line-score { font-weight: 900; min-width: 48px; }
.line-pv { color: var(--text-dim); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.import { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.import summary { cursor: pointer; }
.import textarea, .field input[data-bind="fen"] {
  width: 100%; background: #1a1917; color: var(--text); border: 1px solid var(--line); border-radius: 6px; padding: 8px;
  font: .85rem/1.4 ui-monospace, Consolas, monospace; resize: vertical;
}
.import select { background: var(--gray-btn); color: var(--text); border: 0; border-radius: 6px; padding: 6px; font: inherit; }
.import .row { margin-top: 8px; flex-wrap: wrap; }

/* Início: metas, pontos fracos, dica */
.goals { display: flex; flex-direction: column; gap: 8px; }
.goal { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel-2); border-radius: 8px; }
.goal:hover { background: var(--bg-hover); }
.goal-ico { width: 34px; height: 34px; border-radius: 8px; background: #3c3a37; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; flex: none; }
.goal.done .goal-ico { background: var(--green); }
.goal .progress { margin-top: 6px; height: 6px; }
.weak { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.weak .progress { margin-top: 5px; height: 6px; }
.tip p { margin: 6px 0 12px; font-size: .92rem; }
.col-main { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Aberturas */
.opening-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.opening-card { background: var(--panel); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.opening-card:hover { background: var(--bg-hover); }
.opening-card .board { border-radius: 0; }
.oc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.stars { color: var(--gold); letter-spacing: 2px; }
.tabs.two { grid-template-columns: 1fr 1fr; }
.line-notes { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.line-notes li { padding: 6px 8px; border-radius: 6px; background: var(--panel-2); display: flex; flex-direction: column; }
.line-notes li.cur { outline: 2px solid var(--green); }
.line-notes li.hidden-note { opacity: .45; }

/* Dicas */
.checklist ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.tip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tip-card { background: var(--panel); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.tip-card .board { border-radius: 0; }
.tip-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tip-body p { margin: 0 0 4px; font-size: .92rem; }
.tip-body .btn { margin-right: 6px; }

/* Progresso */
.prog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.linechart { width: 100%; height: 140px; display: block; background: var(--panel-2); border-radius: 8px; }
.chart-axis { display: flex; justify-content: space-between; margin-top: 4px; }
.stats-grid.three { grid-template-columns: repeat(3, 1fr); }
.recs { display: flex; flex-direction: column; gap: 8px; }
.rec { display: flex; align-items: center; gap: 12px; background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.rec-ico { font-size: 1.4rem; }
.theme-table td { vertical-align: middle; }
.prose a { color: var(--green-hover); text-decoration: underline; }
.prose li { margin-bottom: 8px; }
.prose code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }

/* ---------- Conta ---------- */
.side-account { display: flex; flex-direction: column; gap: 6px; }
.side-account .side-user .grow { display: flex; flex-direction: column; min-width: 0; }
.side-auth { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-auth .btn { padding: 7px 4px; font-size: .8rem; }
.side-expired { display: flex; flex-direction: column; gap: 6px; padding: 8px; background: #4a2a26; border-radius: 8px; }
.sync-state { font-size: .7rem; font-weight: 700; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sync-state.salvo { color: #9fd26a; }
.sync-state.offline, .sync-state.expirada { color: #ffb36b; }
.sync-state.big { font-size: .9rem; padding: 6px 12px; background: var(--panel); border-radius: 99px; }
.boot { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 80px 0; }

.auth-wrap { display: flex; justify-content: center; padding: 24px 0; }
.auth { width: min(440px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px; }
.auth h1 { margin: 0; font-size: 1.8rem; font-weight: 900; }
.auth p { margin: 0; }
.auth form, .stack { display: flex; flex-direction: column; gap: 12px; }
.field input, .input {
  background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px;
  padding: 11px 12px; font: inherit; font-size: 1rem;
}
.field input:focus, .input:focus { outline: 2px solid var(--green); border-color: transparent; }
.link { color: var(--green-hover); text-decoration: underline; }
.privacy { background: var(--panel-2); border-radius: 8px; padding: 10px 12px; }
.privacy summary { cursor: pointer; font-weight: 800; }
.privacy ul { margin: 8px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.choice {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px; padding: 14px; color: var(--text);
  font: inherit; cursor: pointer;
}
.choice:hover { border-color: var(--green); }
.choice:disabled { opacity: .5; cursor: wait; }
.card.danger { border: 1px solid #6b2b26; }
.btn-danger { background: #c8312a; color: #fff; box-shadow: 0 4px 0 #7d1e19; }
.btn-danger:hover { filter: brightness(1.1); }

/* Seletor de peças nas configurações */
.piece-sets label { padding: 2px 0; }
.set-preview { display: inline-flex; gap: 2px; background: #dfe7ec; border-radius: 6px; padding: 2px 4px; }
.set-preview .piece.icon { width: 1.8rem; height: 1.8rem; }

/* ---------- Responsivo ---------- */
@media (max-width: 1200px) {
  .hero-card { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-cols { grid-template-columns: 1fr; }
}
@media (max-width: 1000px) {
  .game-layout { grid-template-columns: minmax(0, 1fr); }
  .board-col { width: 100%; }
  .board-col { width: 100%; max-width: 640px; margin: 0 auto; min-width: 0; }
  .panel { min-height: 0; }
}
@media (max-width: 900px) {
  .prog-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  main#view { padding: 64px 16px 32px; }
  .coach-actions { grid-template-columns: 1fr; }
  .stats-grid.three { grid-template-columns: 1fr 1fr 1fr; }
  .mini-bar.wide { width: 70px; }
  .hero-card { grid-template-columns: minmax(0, 1fr); }
  .history .hide-sm { display: none; }
  .clock { font-size: 1.3rem; min-width: 96px; }
}
