/* filename: bot/bot.css — Maia 봇 대전. 틀(3단 · 보드 · 엔진 · 기보 · DB)은 research.css 를 그대로 쓰고 여기서는 봇 전용 부분만 */
.bt-main { max-width: 100% !important; padding: 16px 20px 28px; }
/* 화면을 꽉 채움: 양옆 칸은 화면 폭에 비례, 보드는 남는 폭 · 화면 높이 중 작은 쪽까지 */
.bt-layout {
  --left-w: clamp(300px, 21vw, 460px);
  --right-w: clamp(320px, 22vw, 480px);
  --board-max: min(calc(100vw - var(--left-w) - var(--right-w) - 100px), calc(100vh - 150px));
  gap: 18px;
}
.bt-layout.bt-noleft { --board-max: min(calc(100vw - var(--right-w) - 80px), calc(100vh - 150px)); }
.bt-layout.bt-noright { --board-max: min(calc(100vw - var(--left-w) - 80px), calc(100vh - 150px)); }
.bt-layout.bt-noleft.bt-noright { --board-max: min(calc(100vw - 60px), calc(100vh - 150px)); }
@media (max-width: 1000px) { .bt-layout, .bt-layout.bt-noleft, .bt-layout.bt-noright, .bt-layout.bt-noleft.bt-noright { --board-max: min(calc(100vw - 40px), 760px); } }
.bt-main #bt-app { width: 100%; }
.bt-muted { color: var(--text-muted); font-size: 0.8rem; }
.bt-gate { max-width: 420px; margin: 60px auto; padding: 28px; text-align: center; border-radius: 10px; border: 1px solid var(--border-purple); background: var(--card-bg); color: var(--text-main); }
.bt-gate p { margin: 0 0 16px; font-weight: 700; }

/* 대국 모드: 분석 정보 창(Maia · DB · 통계 · 엔진)은 어디로 옮겼든 숨김 */
.bt-layout.bt-plain .bt-info { display: none; }
.bt-layout[hidden], .bt-setup[hidden], #bt-panels[hidden] { display: none !important; }
/* 보이는 창이 없는 열은 접음 */
.bt-layout.bt-noleft { grid-template-columns: minmax(0, 1fr) var(--right-w); }
.bt-layout.bt-noleft .st-side { display: none; }
.bt-layout.bt-noleft .an-board-col { grid-column: 1; }
.bt-layout.bt-noleft .st-right { grid-column: 2; }
.bt-layout.bt-noright { grid-template-columns: var(--left-w) minmax(0, 1fr); }
.bt-layout.bt-noright .st-right { display: none; }
.bt-layout.bt-noleft.bt-noright { grid-template-columns: minmax(0, 1fr); }
.bt-layout.bt-noleft.bt-noright .an-board-col { grid-column: 1; }
.bt-layout .an-board-col > .st-dock { width: 100%; max-width: var(--board-max); margin: 0 auto; }
.bt-reopen-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; margin-top: 10px; }

/* ---------- 시작 전: 단계별 카드 ---------- */
.bt-setup { position: relative; width: 100%; max-width: 1500px; margin: 0 auto; padding: 8px 0 12px; display: flex; flex-direction: column; gap: 3vh; min-height: calc(100vh - 150px); box-sizing: border-box; }
.bt-bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bt-bg::before { content: ''; position: absolute; inset: -10%; background: repeating-conic-gradient(color-mix(in srgb, var(--text-main) 3.5%, transparent) 0 25%, transparent 0 50%) 0 0 / 120px 120px; -webkit-mask: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%); mask: radial-gradient(ellipse at 50% 30%, #000 0%, transparent 72%); }
html[data-theme="light"] .bt-bg::before { background-image: repeating-conic-gradient(color-mix(in srgb, var(--accent-gold) 3%, transparent) 0 25%, transparent 0 50%); }

.bt-steps { display: flex; align-items: center; justify-content: center; gap: 0; flex-wrap: wrap; }
.bt-step { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 0; border-radius: 999px; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.86rem; font-weight: 800; cursor: pointer; }
.bt-step span { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-purple); background: var(--card-bg); font-size: 0.78rem; }
.bt-step:hover { color: var(--text-main); }
.bt-step.done { color: var(--text-main); }
.bt-step.done span { border-color: var(--accent-gold); color: var(--accent-gold); }
.bt-step.on { color: var(--accent-gold); }
.bt-step.on span { background: var(--accent-gold); border-color: var(--accent-gold); color: var(--on-accent, var(--bg-dark)); }
.bt-step-line { width: 34px; height: 1px; background: var(--border-purple); }

.bt-stage { display: flex; flex-direction: column; gap: 18px; }
.bt-stage.bt-in { animation: bt-in 0.28s ease; }
@keyframes bt-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.bt-q { text-align: center; font-size: 1.05rem; font-weight: 900; color: var(--text-main); }
.bt-hintline { text-align: center; font-size: 0.8rem; color: var(--text-muted); }
.bt-cards { display: grid; gap: 14px; }
.bt-cards.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.bt-cards.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.bt-cards.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.bt-cards.c-lv { display: flex; flex-wrap: wrap; justify-content: center; }
.bt-cards.c-lv .bt-pick { flex: 0 0 calc(20% - 12px); min-height: clamp(128px, 22vh, 220px); }
@media (max-width: 760px) {   /* 휴대폰: 3열 → 9단계가 한 화면에 */
  .bt-cards.c-lv { gap: 8px; }
  .bt-cards.c-lv .bt-pick { flex: 0 0 calc(33.333% - 6px); min-height: 118px; padding: 12px 4px; gap: 4px; }
  .bt-cards.c-lv .bt-lv-d { display: none; }
  .bt-cards.c-lv .bt-lv-ico { width: 34px; height: 34px; }
  .bt-cards.c-lv .bt-lv-n { font-size: 1.5rem; }
  .bt-pick.bt-lv.on::after { top: 8px; right: 8px; width: 8px; height: 8px; }
}

.bt-pick { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: clamp(190px, 38vh, 380px); padding: 22px 16px; border-radius: 12px; border: 1px solid var(--border-purple); background: var(--card-bg); color: var(--text-main); font: inherit; text-align: center; cursor: pointer; transition: border-color 0.15s, transform 0.15s, background 0.15s; }
.bt-pick:hover { border-color: var(--accent-gold); transform: translateY(0); }
.bt-pick.on { border-color: var(--accent-gold); background: color-mix(in srgb, var(--accent-gold) 10%, var(--card-bg)); }
.bt-pick.on::after { content: ''; position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent-gold); }
.bt-pick b { font-size: 1.1rem; font-weight: 900; }
.bt-pick > span:not([class]) { font-size: 0.8rem; color: var(--text-muted); line-height: 1.45; }
.bt-art { display: flex; align-items: center; justify-content: center; width: 104px; height: 104px; border-radius: 50%; background: var(--sq-light, #f0d9b5); border: 1px solid var(--border-purple); }
.bt-art img { width: 76px; height: 76px; }
.bt-art2 { width: 132px; border-radius: 12px; }
.bt-art2 img { width: 64px; height: 64px; }
.bt-art2 img + img { margin-left: -18px; }
.bt-art-s { width: 60px; height: 60px; }
.bt-art-s img { width: 44px; height: 44px; }
.bt-art-s.bt-art2 { width: 78px; border-radius: 12px; }
.bt-art-s.bt-art2 img { width: 38px; height: 38px; }
.bt-art-s.bt-art2 img + img { margin-left: -12px; }

/* 레벨 카드: 레벨마다 색(--lv) · 기물 */
.bt-pick.bt-lv { gap: 6px; background: linear-gradient(160deg, color-mix(in srgb, var(--lv, var(--accent-gold)) 12%, var(--card-bg)) 0%, var(--card-bg) 55%); }
.bt-pick.bt-lv:hover, .bt-pick.bt-lv.on { border-color: var(--lv); }
.bt-pick.bt-lv.on { background: linear-gradient(160deg, color-mix(in srgb, var(--lv) 26%, var(--card-bg)) 0%, color-mix(in srgb, var(--lv) 8%, var(--card-bg)) 100%); }
.bt-pick.bt-lv.on::after { background: var(--lv); }
.bt-lv-ico { display: flex; align-items: center; justify-content: center; width: clamp(44px, 4.2vw, 64px); height: clamp(44px, 4.2vw, 64px); border-radius: 50%; background: color-mix(in srgb, var(--lv, var(--accent-gold)) 22%, transparent); border: 1px solid color-mix(in srgb, var(--lv, var(--accent-gold)) 55%, transparent); }
.bt-lv-ico img { width: 72%; height: 72%; }
.bt-lv-n { font-size: clamp(1.7rem, 2.8vw, 2.5rem); font-weight: 900; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: var(--lv, var(--accent-gold)); line-height: 1.05; }
.bt-pick.bt-lv b { font-size: 0.9rem; color: var(--text-main); }
.bt-lv-d { font-size: 0.74rem; color: var(--text-muted); }
.bt-lv-bar { width: 70%; height: 4px; margin-top: 2px; border-radius: 2px; background: color-mix(in srgb, var(--text-main) 10%, transparent); overflow: hidden; }
.bt-lv-bar i { display: block; height: 100%; background: var(--lv, var(--accent-gold)); }
.bt-sumc .bt-lv-ico { width: 48px; height: 48px; }
.bt-sumc[style*="--lv"] .bt-lv-n { color: var(--lv); }

.bt-pick.bt-wide { min-height: clamp(240px, 50vh, 480px); }
.bt-wide .bt-mock { width: clamp(180px, 22vw, 340px); height: clamp(90px, 11vw, 170px); }
.bt-mock { display: flex; gap: 6px; height: 90px; width: 180px; padding: 8px; border-radius: 10px; border: 1px solid var(--border-purple); background: var(--bg-dark); box-sizing: border-box; }
.bt-mock i { display: flex; flex-direction: column; gap: 5px; }
/* 미리보기 체스판: 높이에 맞춘 정사각형, 무늬 한 장(2×2칸)이 판의 1/4 → 8×8칸 */
.bt-mock .bd { flex: 0 0 auto; height: 100%; aspect-ratio: 1 / 1; border-radius: 4px; background: repeating-conic-gradient(var(--sq-dark, #b58863) 0 25%, var(--sq-light, #f0d9b5) 0 50%) 0 0 / 25% 25%; }   /* 설정 > 체스보드 색을 따라감 */
.bt-mock .col { flex: 1; }
.bt-mock .col b { flex: 1; border-radius: 3px; background: color-mix(in srgb, var(--text-main) 12%, transparent); }
.bt-mock .col b.tall { flex: 2.4; }
.bt-pick.on .bt-mock .col b { background: color-mix(in srgb, var(--accent-gold) 35%, transparent); }

.bt-ogrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 22px; }
.bt-olbl { margin: 0 0 8px 2px; font-size: 0.8rem; font-weight: 900; color: var(--text-muted); }
.bt-cards.bt-small { gap: 10px; }
.bt-small .bt-pick { min-height: clamp(92px, 15vh, 160px); padding: 14px 12px; gap: 4px; }
.bt-small .bt-pick b { font-size: 0.98rem; }

.bt-pick.bt-sumc { min-height: clamp(170px, 32vh, 320px); gap: 8px; }
.bt-sumc .bt-mock { transform: scale(0.75); margin: -10px 0; }
.bt-sum-l { font-size: 0.74rem; font-weight: 800; color: var(--text-muted); }
.bt-sumc b { font-size: 0.92rem; line-height: 1.45; }
.bt-opt-ico { display: flex; flex-direction: column; gap: 6px; width: 46px; height: 50px; justify-content: center; }
.bt-opt-ico i { height: 6px; border-radius: 3px; background: var(--accent-gold); opacity: 0.7; }
.bt-opt-ico i:nth-child(2) { width: 70%; opacity: 0.5; }
.bt-opt-ico i:nth-child(3) { width: 85%; opacity: 0.35; }
.bt-gobar { display: flex; justify-content: center; gap: 10px; margin-top: 6px; }
.an-btn.bt-redo { flex: 0 0 auto; min-width: 150px; padding: 14px 22px; font-size: 0.95rem; border-radius: 12px; }

/* 시작 화면 아래: Maia 소개 */
.bt-intro { width: 100%; max-width: 1500px; margin: 10px auto 0; padding: 26px 0 8px; display: flex; flex-direction: column; gap: 18px; }
.bt-intro[hidden] { display: none; }
.bt-intro-lbl { display: flex; align-items: center; gap: 14px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; color: var(--accent-gold); }
.bt-intro-lbl span { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--border-purple), transparent); }
.bt-intro-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* 첫 화면 (한 화면 안에) */
.bt-setup.bt-landing { min-height: 0; gap: 0; }
.bt-land { display: flex; flex-direction: column; gap: clamp(10px, 2vh, 20px); min-height: calc(100vh - 175px); }
.bt-hero { flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; min-height: 0; }
.bt-hero-main { position: relative; display: flex; flex-direction: column; justify-content: center; gap: clamp(12px, 2.4vh, 24px); padding: clamp(22px, 4vh, 48px) clamp(22px, 3vw, 48px); border-radius: 12px; border: 1px solid var(--border-purple); overflow: hidden;
  background: radial-gradient(ellipse at 0% 0%, color-mix(in srgb, var(--accent-gold) 16%, transparent), transparent 60%), var(--card-bg); }
.bt-hero-main::after { content: ''; position: absolute; right: -40px; bottom: -40px; width: 260px; height: 260px; opacity: 0.12; background: repeating-conic-gradient(var(--sq-dark, #b58863) 0 25%, var(--sq-light, #f0d9b5) 0 50%) 0 0 / 65px 65px; transform: rotate(12deg); pointer-events: none; }
.bt-kicker { align-self: flex-start; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--accent-gold); color: var(--accent-gold); font-size: 0.8rem; font-weight: 900; letter-spacing: 0.04em; }
.bt-lead { margin: 0; max-width: 620px; font-size: clamp(1.15rem, 1.8vw, 1.75rem); font-weight: 800; line-height: 1.45; color: var(--text-main); word-break: keep-all; }
.bt-lead b { color: var(--accent-gold); }
.bt-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.bt-cta .an-btn { flex: 0 0 auto; }
.bt-last-set { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.bt-last-set .bt-sum-l { margin-right: 4px; }
.bt-demo { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: clamp(18px, 3vh, 32px) clamp(18px, 2.4vw, 32px); border-radius: 12px; border: 1px solid var(--border-purple); background: var(--card-bg); }
.bt-demo-h { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.bt-demo-h b { display: block; font-size: 1.05rem; font-weight: 900; color: #60a5fa; }
.bt-demo-h span:not(.bt-lv-ico) { font-size: 0.78rem; color: var(--text-muted); font-weight: 700; }
.bt-demo .bt-cand { grid-template-columns: 56px minmax(0, 1fr) 46px; font-size: 0.95rem; padding: 5px 2px; }
.bt-demo .bt-pbar { height: 10px; }
.bt-demo-lv { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--border-purple); }
.bt-demo-lv .bt-lv-ico { width: 30px; height: 30px; }
.bt-land .bt-intro-grid { flex: 0 0 auto; }
.bt-land .bt-icard { display: flex; gap: 14px; align-items: flex-start; padding: clamp(14px, 2.2vh, 22px) 20px; }
.bt-land .bt-icard svg { flex: 0 0 auto; }
.bt-land .bt-icard b { margin: 2px 0 4px; }
.bt-land .bt-intro-stats div { padding: clamp(10px, 1.6vh, 16px) 10px; }
@media (max-width: 900px) {
  .bt-land { min-height: 0; }
  .bt-hero { grid-template-columns: minmax(0, 1fr); }
}
.bt-icard { padding: 22px 22px 20px; border-radius: 12px; border: 1px solid var(--border-purple); background: linear-gradient(180deg, color-mix(in srgb, var(--accent-gold) 6%, var(--card-bg)), var(--card-bg)); }
.bt-icard svg { width: 34px; height: 34px; padding: 8px; border-radius: 10px; fill: none; stroke: var(--accent-gold); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; background: color-mix(in srgb, var(--accent-gold) 12%, transparent); }
.bt-icard b { display: block; margin: 14px 0 6px; font-size: 1rem; font-weight: 900; color: var(--text-main); }
.bt-icard p { margin: 0; font-size: 0.84rem; line-height: 1.6; color: var(--text-muted); }
.bt-intro-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: 10px; border: 1px solid var(--border-purple); background: var(--card-bg); overflow: hidden; }
.bt-intro-stats div { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px; }
.bt-intro-stats div + div { border-left: 1px solid var(--border-purple); }
.bt-intro-stats b { font-size: 1.5rem; font-weight: 900; color: var(--accent-gold); font-variant-numeric: tabular-nums; }
.bt-intro-stats span { font-size: 0.76rem; font-weight: 700; color: var(--text-muted); }
.bt-intro-credit { text-align: center; font-size: 0.74rem; color: var(--text-muted); }
.bt-intro-credit a { color: var(--text-muted); }
@media (max-width: 760px) {
  .bt-intro-grid { grid-template-columns: minmax(0, 1fr); }
  .bt-intro-stats b { font-size: 1.1rem; }
}

/* 대국 후 자유롭게 두기: 변화수 · 누르면 두는 곳 */
.st-mv.bt-vmv { font-weight: 600; color: #b9b4cc; }
html[data-theme="light"] .st-mv.bt-vmv { color: #5f5a75; }
.bt-var { color: var(--text-muted); }
.bt-explore .bt-cand, .bt-explore .st-db-row[data-san], .bt-explore .an-pv-moves span { cursor: pointer; }
.bt-explore .bt-cand:hover { background: rgba(255, 255, 255, 0.06); }
#bt-btns { flex-wrap: wrap; }
.bt-actrow { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.bt-actrow a.an-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }   /* 링크 버튼(나도 Maia와 두기)도 다른 버튼과 같게 */

/* 급하게 둔 수 */
.t-rush { color: #f59e0b; }
.bt-rrow span.t-rush { font-weight: 900; }

/* 실황 */
.bt-phase { display: inline-flex; align-items: center; gap: 6px; min-width: 0; flex: 1; justify-content: flex-end; overflow: hidden; }
.bt-ph { flex: 0 0 auto; padding: 2px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 900; border: 1px solid currentColor; }
.ph-o { color: #4ade80; }
.ph-m { color: #60a5fa; }
.ph-e { color: #f472b6; }
.bt-ph-op { min-width: 0; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-feed { display: flex; flex-direction: column; gap: 4px; max-height: max(140px, calc(100vh - 720px)); overflow: auto; }
.bt-fi { display: flex; gap: 8px; align-items: baseline; padding: 6px 10px; border-radius: 8px; background: var(--bg-dark); border-left: 3px solid var(--border-purple); font-size: 0.8rem; line-height: 1.45; }
.bt-fi[data-id] { cursor: pointer; }
.bt-fi[data-id]:hover { background: color-mix(in srgb, var(--accent-gold) 8%, var(--bg-dark)); }
.bt-fno { flex: 0 0 auto; font-size: 0.72rem; font-weight: 800; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.bt-ftx { min-width: 0; color: var(--text-main); }
.bt-ftx em { font-style: normal; font-weight: 900; color: #4ade80; }
.f-hit { border-left-color: #4ade80; } .f-hit b { color: #4ade80; }
.f-rare, .f-maia { border-left-color: #f28ac6; } .f-rare b, .f-maia b { color: #f28ac6; }
.f-open, .f-phase { border-left-color: #60a5fa; } .f-open b, .f-phase b { color: #60a5fa; }
.f-db { border-left-color: var(--text-muted); }
.f-bad { border-left-color: #ff6b6b; } .f-bad b { color: #ff6b6b; }
.f-good { border-left-color: #26c2a3; } .f-good b { color: #26c2a3; }
.f-rush { border-left-color: #f59e0b; } .f-rush b { color: #f59e0b; }
.f-dis { border-left-color: #a78bfa; } .f-dis b { color: #a78bfa; }
.f-end { border-left-color: var(--accent-gold); } .f-end b { color: var(--accent-gold); }

/* 옵션 창 (보드 아래) */
.bt-optgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 14px; }
.bt-orow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 8px; border-radius: 8px; background: var(--bg-dark); font-size: 0.8rem; font-weight: 700; color: var(--text-main); cursor: pointer; }
.bt-orow.dis { opacity: 0.45; cursor: default; }
.bt-orow .an-switch { width: 34px; height: 19px; }
.bt-orow .an-switch span::before { width: 13px; height: 13px; }
.bt-orow .an-switch input:checked + span::before { transform: translateX(15px); }

/* Maia · Stockfish 의견 차이 */
.bt-dis { margin-top: 8px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(167, 139, 250, 0.45); background: rgba(167, 139, 250, 0.08); font-size: 0.78rem; }
.bt-dis b { display: block; margin-bottom: 4px; color: #a78bfa; font-weight: 900; }
.bt-dis div { display: flex; gap: 8px; font-weight: 700; }
.bt-dis div span { min-width: 64px; color: var(--text-muted); }
.bt-dis p { margin: 4px 0 0; color: var(--text-muted); }

/* Maia 예측 적중 */
.bt-hit { margin-top: 8px; padding: 6px 10px; border-radius: 8px; font-size: 0.78rem; font-weight: 900; color: #4ade80; background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.35); }
.bt-toast { position: absolute; left: 50%; top: 12%; z-index: 20; transform: translate(-50%, -8px); display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 18px; border-radius: 12px; background: rgba(16, 14, 26, 0.88); border: 1px solid rgba(74, 222, 128, 0.55); color: #fff; text-align: center; pointer-events: none; opacity: 0; transition: opacity 0.25s, transform 0.25s; }
.bt-toast.on { opacity: 1; transform: translate(-50%, 0); }
.bt-toast b { font-size: 0.95rem; font-weight: 900; color: #4ade80; }
.bt-toast span { font-size: 0.8rem; font-weight: 700; color: #ddd; }
.an-btn.bt-go { flex: 0 0 auto; min-width: 240px; padding: 14px 28px; font-size: 1rem; border-radius: 12px; }

.bt-wnav { display: flex; justify-content: space-between; margin-top: auto; }
.bt-wnav .an-btn { flex: 0 0 auto; min-width: 120px; }

@media (max-width: 760px) {
  .bt-cards.c3, .bt-cards.c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-cards.c2, .bt-ogrid { grid-template-columns: minmax(0, 1fr); }
  .bt-pick { min-height: 140px; }
  .bt-step-line { width: 12px; }
  .bt-step { padding: 6px 6px; font-size: 0.78rem; }
}

/* 카드 머리 */
.bt-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.bt-badge { padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border-purple); background: var(--bg-dark); font-size: 0.72rem; font-weight: 800; color: var(--text-muted); white-space: nowrap; }
.bt-badge.gold { color: var(--accent-gold); border-color: var(--accent-gold); }
.bt-eng-sw { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 8px 14px; border-bottom: 1px solid var(--border-purple); }
.bt-sw { display: inline-flex; align-items: center; gap: 6px; font-size: 0.72rem; font-weight: 800; color: var(--text-muted); cursor: pointer; }
.bt-sw .an-switch { width: 34px; height: 19px; }
.bt-sw .an-switch span::before { width: 13px; height: 13px; }
.bt-sw .an-switch input:checked + span::before { transform: translateX(15px); }
.bt-sub { margin: 10px 0 5px; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }

/* 설정 */
.bt-form { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }
.bt-frow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bt-lbl { min-width: 64px; font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.bt-pills { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.bt-pills button { height: 28px; padding: 0 9px; border-radius: 7px; border: 1px solid var(--border-purple); background: var(--bg-dark); color: var(--text-muted); font-size: 0.8rem; font-weight: 800; cursor: pointer; font-family: inherit; }
.bt-pills button:hover { color: var(--text-main); }
.bt-pills button.on { border-color: var(--accent-gold); background: var(--accent-gold); color: var(--on-accent, var(--bg-dark)); }
.bt-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; min-height: 1.2em; }
.bt-actions { display: flex; gap: 6px; margin-top: 10px; }

/* 기보 */
.bt-tree { height: max(100px, calc((100vh - 560px) / 2)); }   /* 기본은 예전의 절반, 아래 손잡이로 조절 */
.bt-layout.bt-plain .bt-tree { height: max(140px, calc((100vh - 330px) / 2)); }
.bt-vres { height: 10px; margin: 0 0 2px; cursor: ns-resize; position: relative; touch-action: none; }
.bt-vres::after { content: ''; position: absolute; left: 50%; top: 3px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--border-purple); }
.bt-vres:hover::after { background: var(--accent-gold); }
body.bt-resizing, body.bt-resizing * { cursor: ns-resize !important; user-select: none; }

/* 화면 출렁임 막기 (연구 화면과 같은 방식): 양옆 칸 높이를 화면에 고정하고 안에서만 스크롤,
   엔진 라인 · Maia 후보 칸은 내용이 바뀌어도 높이가 그대로 */
@media (min-width: 1001px) {
  .bt-layout .st-side, .bt-layout .st-right { height: calc(100vh - 96px); max-height: none; }
}
#bt-pvs { display: flex; min-height: calc(3 * 25px + 8px); }
#bt-cands { min-height: 172px; }
#bt-last { min-height: 74px; box-sizing: border-box; }
/* 칸 높이 고정 (2026-11-18): 수마다 내용이 바뀌어도 칸 높이가 그대로 → 양옆 칸 스크롤이 왔다갔다하지 않음
   방금 둔 수(적중 줄 자리 포함) · 승무패 막대 + 의견 차이 상자 자리 · 후보 수 6개 + 범례 · DB 요약 한 줄 · DB 수 8줄 */
#bt-last { height: 118px; min-height: 0; overflow: hidden; }
.bt-hit.bt-off { visibility: hidden; }
#bt-wdl { height: 146px; overflow: hidden; }
.bt-dis p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#bt-cands { height: 172px; min-height: 0; overflow: hidden; }
#bt-db-sum { height: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-main #bt-db-moves { height: 232px; min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* 'Maia 생각 중' 줄: 대국 중에는 자리를 늘 잡아 둠 (끝나면 bot.js 가 뺌) */
.bt-think.bt-off { visibility: hidden; }
.bt-feed { height: max(120px, calc(100vh - 660px)); max-height: none; }
.st-mv .bt-mvp { margin-left: 3px; font-size: 0.68rem; font-weight: 700; color: var(--text-muted); }
.st-mv.active .bt-mvp { color: var(--on-accent); }
.bt-res { display: inline-block; margin-left: 6px; font-weight: 900; color: var(--accent-gold); }
.bt-think { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border-purple); font-size: 0.8rem; font-weight: 800; color: var(--text-muted); }
.bt-think-dots { display: inline-flex; gap: 4px; }
.bt-think-dots i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: bt-think 1s ease-in-out infinite; }
.bt-think-dots i:nth-child(2) { animation-delay: 0.15s; }
.bt-think-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes bt-think { 0%, 100% { opacity: 0.25; } 50% { opacity: 1; } }
#bt-gamecard .pz-msg { margin-top: 8px; min-height: 0; }
#bt-gamecard .pz-msg:empty { display: none; }
/* 빈 칸 클릭: 갈 수 있는 기물이 여럿일 때 고르기 */
.bt-from .pz-promo-box button { position: relative; }
.bt-from .pz-promo-box button span { position: absolute; right: 4px; bottom: 2px; font-size: 0.7rem; font-weight: 900; color: #2a2a2a; }
.an-btn.bt-warn { border-color: #e5484d; color: #ff6b70; }
.an-btn:disabled { opacity: 0.4; cursor: default; }

/* Maia 예측: 방금 둔 수 */
.bt-last { padding: 8px 10px; border-radius: 10px; background: var(--bg-dark); border: 1px solid var(--border-purple); }
.bt-last-top { display: flex; align-items: center; gap: 8px; }
.bt-last-top b { font-size: 1rem; font-weight: 900; }
.bt-last-who { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); }
.bt-rar { margin-left: auto; padding: 1px 7px; border-radius: 6px; font-size: 0.7rem; font-weight: 900; border: 1px solid currentColor; }
.r-expected { color: #8fd18f; }
.r-common { color: #5ea9cf; }
.r-rare { color: #e6b800; }
.r-surprise { color: #f28ac6; }
.bt-last-p { display: flex; align-items: baseline; gap: 8px; margin-top: 4px; font-size: 0.74rem; color: var(--text-muted); font-weight: 700; }
.bt-big { font-size: 1.45rem; font-weight: 900; color: var(--text-main); font-variant-numeric: tabular-nums; }
.bt-meter { height: 5px; margin-top: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.bt-meter i { display: block; height: 100%; background: var(--accent-gold); }

/* Maia 예측: 후보 수 */
.bt-cand { display: grid; grid-template-columns: 82px minmax(0, 1fr) 40px; gap: 8px; align-items: center; padding: 3px 4px; border-radius: 6px; font-size: 0.82rem; }
.bt-cand .san { font-weight: 800; white-space: nowrap; }
.bt-cand .pct { text-align: right; font-weight: 800; font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.bt-cand.played { background: color-mix(in srgb, var(--accent-gold) 16%, transparent); }
.bt-pbar { height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.07); overflow: hidden; }
.bt-pbar i { display: block; height: 100%; background: #2f6fd6; border-radius: 4px; }
.bt-best { margin-left: 5px; font-style: normal; font-size: 0.64rem; font-weight: 900; color: #4ade80; }
.bt-legend { display: flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 0.68rem; color: var(--text-muted); }
.bt-legend i { width: 10px; height: 10px; border-radius: 3px; background: color-mix(in srgb, var(--accent-gold) 35%, transparent); }

/* 오프닝 DB: 실제 비율 · Maia 확률 비교 */
.bt-db-band { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); }
.st-db-row.bt-db-head { cursor: default; font-size: 0.68rem; font-weight: 800; color: var(--text-muted); padding-top: 6px; }
.st-db-row.bt-db-head:hover { background: none; }
.st-db-row.bt-db-head .pct, .st-db-row.bt-db-head .n { font-size: 0.68rem; font-weight: 800; }
.st-db-row { cursor: default; }
.st-db-row .bt-maia-p { color: #6fa3ff; }
.st-db-row.bt-played { background: color-mix(in srgb, var(--accent-gold) 16%, transparent); }

/* 대국 통계 */
.bt-stat-row { display: grid; grid-template-columns: minmax(0, 1fr) 64px 76px; gap: 6px; padding: 4px 4px; font-size: 0.8rem; border-bottom: 1px solid var(--border-purple); }
.bt-stat-row:last-of-type { border-bottom: 0; }
.bt-stat-row span:not(:first-child) { text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.bt-stat-head { font-size: 0.72rem; font-weight: 800; color: var(--text-muted); }
.bt-stat-note { margin-top: 6px; font-size: 0.72rem; }

/* 리뷰 */
.bt-sum { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.bt-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; border: 1px solid var(--border-purple); background: var(--bg-dark); font-size: 0.74rem; font-weight: 800; color: var(--text-main); }
.t-blunder { color: #ff6b6b; }
.t-mistake { color: #fb923c; }
.t-inacc { color: #e6b800; }
.t-hard { color: #4ade80; }
.t-common { color: #60a5fa; }
.bt-chip.t-est { color: var(--accent-gold); border-color: var(--accent-gold); }
.bt-rev { max-height: 300px; overflow: auto; border-radius: 10px; border: 1px solid var(--border-purple); background: var(--bg-dark); }
.bt-rrow { display: grid; grid-template-columns: minmax(70px, 1.1fr) 50px 50px 46px minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 6px; align-items: center; padding: 5px 10px; font-size: 0.8rem; border-bottom: 1px solid var(--border-purple); cursor: pointer; }
.bt-rrow:last-child { border-bottom: 0; }
.bt-rrow:hover { background: rgba(255, 255, 255, 0.05); }
.bt-rrow.on { background: color-mix(in srgb, var(--accent-gold) 18%, transparent); }
.bt-rhead { position: sticky; top: 0; z-index: 1; background: var(--bg-dark); cursor: default; font-size: 0.7rem; font-weight: 800; color: var(--text-muted); }
.bt-rhead:hover { background: var(--bg-dark); }
.bt-rsan { font-weight: 800; white-space: nowrap; }
.bt-rsan em { font-style: normal; color: var(--text-muted); margin-right: 3px; font-weight: 600; }
.bt-rbest { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-rbest em { font-style: normal; color: #4ade80; font-size: 0.72rem; }
.bt-rtags { display: flex; flex-wrap: wrap; gap: 4px; }
.bt-rtags i { font-style: normal; font-size: 0.7rem; font-weight: 800; }

html[data-theme="light"] .bt-meter, html[data-theme="light"] .bt-pbar { background: rgba(0, 0, 0, 0.08); }

@media (max-width: 1000px) {
  .bt-layout .st-right { position: static; }
  .bt-tree, .bt-layout.bt-plain .bt-tree { height: 150px; }
  /* 휴대폰 방침: 보드가 맨 위, 중요한 버튼(무르기 · 기권 · 새 대국 · 리뷰)은 스크롤 없이 → 기보 창 안에서 버튼을 맨 위로 */
  .bt-layout .an-board-col { order: -1; }
  #bt-game { display: flex; flex-direction: column; }
  #bt-game > #bt-btns { order: -3; margin: 0 0 8px; }
  #bt-game > #bt-think, #bt-game > #bt-msg { order: -2; margin: 0 0 8px; }
  #bt-gamecard .pz-msg { margin: 0 0 8px; }
  #bt-engcard .an-engine-name { min-width: 0; }
  #bt-eng-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .bt-vres { height: 20px; }
  .bt-vres::after { top: 8px; }
}
@media (max-width: 760px) {
  .bt-main { padding: 10px 10px 24px; }
  .bt-layout, .bt-layout.bt-noleft, .bt-layout.bt-noright, .bt-layout.bt-noleft.bt-noright { --board-max: calc(100vw - 20px); gap: 12px; }
  .bt-setup { min-height: calc(100vh - 110px); }
  /* 단계 화면의 '이전 · 다음' 과 시작 버튼: 화면 아래에 고정 */
  .bt-wnav, .bt-gobar { position: sticky; bottom: 0; z-index: 5; padding: 10px 0; background: linear-gradient(transparent, var(--bg-dark) 30%); }
  .bt-gobar { flex-wrap: wrap; }
  .bt-cards.bt-small.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }   /* 추가 옵션: 둘씩 나란히 */
  .bt-small .bt-pick { min-height: 96px; }
  .bt-step:not(.on) { font-size: 0; gap: 0; }   /* 단계 표시: 지금 단계만 이름, 나머지는 번호만 → 한 줄 */
  .bt-step:not(.on) span { font-size: 0.78rem; }
  .an-btn.bt-go { min-width: 0; flex: 1 1 auto; }
  .an-btn.bt-redo { min-width: 0; }
  .bt-wide .bt-mock { width: 180px; height: 90px; }
  .bt-pick.bt-wide { min-height: 170px; }
  .bt-pick.bt-sumc { min-height: 120px; }
  .bt-rrow { grid-template-columns: minmax(64px, 1fr) 44px 44px 40px minmax(0, 1fr); font-size: 0.76rem; padding: 5px 6px; }
  .bt-rrow > :nth-child(6) { grid-column: 1 / -1; }   /* 태그는 다음 줄로 */
  .bt-rrow > :nth-child(6):empty { display: none; }
}

/* 시작 포지션: 작은 보드 미리보기 · FEN 입력 */
.bt-posart { display: block; width: clamp(110px, 14vw, 190px); }
.bt-posart.sm { width: 92px; }
.bt-mini { display: grid; grid-template-columns: repeat(8, 1fr); aspect-ratio: 1; border-radius: 6px; overflow: hidden; border: 1px solid var(--border-purple); }
.bt-mini i { position: relative; display: block; background: var(--sq-light, #f0d9b5); }
.bt-mini i.d { background: var(--sq-dark, #b58863); }
.bt-mini img { position: absolute; inset: 0; width: 100%; height: 100%; }
.bt-fenbox { display: flex; flex-direction: column; gap: 8px; width: min(640px, 100%); margin: 16px auto 0; }
.bt-fen-in { width: 100%; box-sizing: border-box; resize: vertical; min-height: 54px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border-purple); background: var(--card-bg); color: var(--text-main); font: 600 0.86rem/1.4 ui-monospace, Consolas, monospace; }
.bt-fen-in:focus { outline: none; border-color: var(--accent-gold); }
.bt-fen-msg { font-size: 0.8rem; font-weight: 600; }
.bt-fen-msg.ok { color: #3fb97f; } .bt-fen-msg.bad { color: #ef5a5a; }
.bt-wnav .an-btn:disabled { opacity: 0.45; cursor: default; }

/* 첫 화면: 지난 대국 */
.bt-games { display: flex; flex-direction: column; gap: 10px; }
.bt-games-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.bt-games-h b { font-size: 1rem; color: var(--text-main); }
.bt-glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; max-height: 42vh; overflow-y: auto; padding: 2px; }
.bt-gcard { --c: #8b93a7; display: grid; grid-template-columns: 30px 26px minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 12px; border: 1px solid var(--border-purple); background: var(--card-bg); cursor: pointer; transition: border-color .15s; }
.bt-gcard.w { --c: #3fb97f; } .bt-gcard.l { --c: #ef5a5a; } .bt-gcard.p { --c: var(--accent-gold); }
.bt-gcard:hover { border-color: var(--accent-gold); }
.bt-gres { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; font-weight: 900; font-size: 0.8rem; color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
.bt-gk img { width: 26px; height: 26px; display: block; }
.bt-gmain { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.bt-gmain b { font-size: 0.88rem; color: var(--text-main); }
.bt-gmain span { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-gdate { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }
.bt-gdel { height: 28px; min-width: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-muted); font: inherit; font-size: 0.78rem; font-weight: 800; cursor: pointer; }
.bt-gdel:hover { border-color: var(--border-purple); color: var(--text-main); }
.bt-gdel.armed { border-color: #ef5a5a; color: #ef5a5a; }
.bt-gmore { grid-column: 1 / -1; justify-self: center; }

/* 대국 화면: 공유 주소 */
.bt-sharebox { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; font-size: 0.78rem; }
.bt-sharebox[hidden] { display: none; }
.bt-shareurl { flex: 1; min-width: 160px; height: 30px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--border-purple); background: var(--bg-dark); color: var(--text-main); font: inherit; font-size: 0.78rem; }
.bt-good { color: #3fb97f; font-weight: 800; } .bt-bad { color: #ef5a5a; font-weight: 800; }
/* 정리 (2026-11-12): 그라데이션 대신 단색 */
.bt-pick.bt-lv { background: color-mix(in srgb, var(--lv, var(--accent-gold)) 6%, var(--card-bg)); }
.bt-pick.bt-lv.on { background: color-mix(in srgb, var(--lv) 14%, var(--card-bg)); }
.bt-hero-main { background: var(--card-bg); border-top: 3px solid var(--accent-gold); }
.bt-icard { background: var(--card-bg); }
.bt-intro-lbl span { background: var(--border-purple); }

/* Stockfish · Leela 첫 화면: 왼쪽 색 고르기 + 바로 시작, 오른쪽 레벨 목록 */
.bt-hero-lv { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.bt-qcs { display: flex; gap: 8px; }
.bt-qc { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 84px; padding: 10px 6px 8px; border-radius: 10px; border: 1px solid var(--border-purple); background: var(--bg-dark); color: var(--text-muted); font: inherit; font-size: 0.8rem; font-weight: 800; cursor: pointer; }
.bt-qc img { width: 34px; height: 34px; }
.bt-qc-k2 { display: flex; } .bt-qc-k2 img + img { margin-left: -12px; }
.bt-qc:hover { border-color: var(--accent-gold); }
.bt-qc.on { border-color: var(--accent-gold); color: var(--text-main); background: color-mix(in srgb, var(--accent-gold) 10%, var(--bg-dark)); }
.bt-hero-lv .bt-cta { position: relative; z-index: 1; }
.bt-hint-s { font-size: 0.76rem; color: var(--text-muted); font-weight: 600; }
.bt-lvlist { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px; border: 1px solid var(--border-purple); background: var(--card-bg); overflow-y: auto; }
.bt-lvlist-h { margin: 0 0 4px 4px; font-size: 0.8rem; font-weight: 900; color: var(--text-muted); }
.bt-lvrow { display: grid; grid-template-columns: 34px 64px 76px minmax(0, 1fr); align-items: center; gap: 12px; flex: 1 1 0; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1px solid transparent; background: color-mix(in srgb, var(--lv) 5%, transparent); color: var(--text-main); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.bt-lvrow:hover { border-color: color-mix(in srgb, var(--lv) 55%, transparent); }
.bt-lvrow.on { border-color: var(--lv); background: color-mix(in srgb, var(--lv) 16%, transparent); }
.bt-lvrow .bt-lv-ico { width: 34px; height: 34px; }
.bt-lvrow b { font-size: 1rem; font-weight: 900; color: var(--lv); white-space: nowrap; }
.bt-lvrow-t { font-size: 0.8rem; font-weight: 800; color: var(--text-main); white-space: nowrap; }
.bt-lvrow-d { font-size: 0.78rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 900px) {
  .bt-hero-lv { grid-template-columns: minmax(0, 1fr); }
  .bt-lvrow { grid-template-columns: 30px 56px minmax(0, 1fr); gap: 10px; }
  .bt-lvrow .bt-lv-ico { width: 30px; height: 30px; }
  .bt-lvrow-t { display: none; }
  .bt-qc { flex: 1 1 0; width: auto; }
}

/* Leela 봇: 레벨 6개는 3개씩 두 줄 */
.bt-cards.c-lv.c-lv6 .bt-pick { flex-basis: calc(33.333% - 10px); }
.bt-icard p { word-break: keep-all; }


/* 정사각 · 가로가 긴 화면(폴드 펼침 · 듀오): 대국 체스판이 화면 높이를 넘지 않게 (보통 폰은 그대로 폭 가득) */
@media (max-width: 1000px) { .bt-layout, .bt-layout.bt-noleft, .bt-layout.bt-noright, .bt-layout.bt-noleft.bt-noright { --board-max: min(calc(100vw - 40px), 760px, max(280px, calc(100vh - 260px))); } }
@media (max-width: 760px) { .bt-layout, .bt-layout.bt-noleft, .bt-layout.bt-noright, .bt-layout.bt-noleft.bt-noright { --board-max: min(calc(100vw - 20px), max(260px, calc(100vh - 260px))); } }
