/* Стили шахматного режима. Владелец — агент интерфейса шахмат. */

/* ---------- экран выбора партии ---------- */
.ch-lobby { max-width: 760px; margin: 0 auto; padding: 18px 12px 30px; text-align: center; }

.ch-lobby h2 { font-size: 30px; color: var(--accent); margin: 16px 0 6px; }
.ch-lobby p { color: #cfcab3; max-width: 600px; margin: 0 auto 10px; }

button.ch-opt { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 16px; font-size: 17px; }
button.ch-opt small { font-size: 13px; font-weight: 400; opacity: .8; }

.ch-lobby .s-tag { margin-top: 16px; }

p.ch-duel-line { color: var(--s-ink); background: #2b281d; border: 1px solid #5c4d33; border-left: 3px solid var(--s-gold); border-radius: 4px; padding: 8px 12px; display: inline-block; }
p.ch-duel-line b { color: var(--s-gold); }

/* ---------- экран доски ---------- */
body.in-chess .top { display: none; }
body.in-chess .wrap { padding: 8px 12px 0; }
#chess { position: relative; }
#chess.ch-boardview { display: flex; flex-direction: column; gap: 6px; height: calc(100vh - 8px); }
#chess[hidden] { display: none !important; }
.ch-hint { flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; font-size: 13px; min-height: 22px; line-height: 1.35; }
.ch-body { flex: 1; min-height: 0; display: flex; gap: 8px; padding-bottom: 6px; }
.ch-boardbox { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: hidden; background: #14150f; border-radius: 8px; }
#chess-board { position: absolute; display: block; user-select: none; -webkit-user-select: none; }
.ch-side { flex: 0 0 330px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.ch-side .hcol { flex: none; }
.ch-status { border-left: 4px solid var(--blue); } .ch-status.p1 { border-left-color: var(--red); }
.ch-turn { font-size: 19px; font-weight: 700; }
.ch-qbar { height: 5px; background: #3a3e31; border-radius: 3px; overflow: hidden; margin-top: 3px; }
.ch-qbar i { display: block; height: 100%; background: var(--accent); }
.ch-card { max-height: 300px; }
.ch-log { flex: 1 1 auto !important; min-height: 80px; display: flex; flex-direction: column; }
#ch-log { flex: 1; overflow-y: auto; font-size: 12.5px; }
.ch-le { padding: 2px 0; border-bottom: 1px solid var(--line); }
.ch-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.ch-dot.s0 { background: var(--blue); } .ch-dot.s1 { background: var(--red); }
.ch-n { color: var(--dim); }
.ch-lduel { font-size: 11px; padding: 0 5px; border-radius: 6px; background: #4a3a22; color: #ffd84a; white-space: nowrap; }
.ch-lduel.o-attackerDied, .ch-lduel.o-bothDied { background: #4a2420; color: #ffb4ab; }
.ch-lduel.o-retreat { background: #3a3e31; color: var(--text); }

/* узкое окно: панель под доской */
@media (max-aspect-ratio: 5/4) {
  .ch-body { flex-direction: column; }
  .ch-side { flex: 0 0 210px; flex-direction: row; }
  .ch-side > * { flex: 1 1 0 !important; min-width: 0; }
  
  .ch-card { max-height: none; }
}

/* карточка фигуры */
.ch-pc-head { display: flex; gap: 8px; align-items: center; margin-bottom: 4px; }
.ch-pc-head .nm { font-size: 15px; }
.ch-pc .hpbar { margin: 2px 0 5px; }
.ch-w { display: flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 2px 4px; border-radius: 5px; border: 1px solid transparent; margin-bottom: 2px; }
.ch-w.on { border-color: var(--accent); background: #3a3826; }
.ch-w .ii, .ch-w .ii-img { flex: none; }
.ch-am { color: #ffd84a; font-weight: 700; margin-left: 4px; }
.ch-am .dim { font-weight: 400; }
.ch-bag { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-top: 3px; }
.ch-bag span { display: inline-flex; align-items: center; gap: 4px; }
.ch-pc .ii-img, .ch-mf .ii-img, .ch-w .ii-img, .ch-bag .ii-img { width: 22px; height: 22px; object-fit: contain; }

/* баннер «Ход Красных» */
.ch-banner { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.9); pointer-events: none; opacity: 0; z-index: 5;
  padding: 12px 34px; border-radius: 10px; font-size: 30px; font-weight: 800; background: rgba(20,21,15,.88); border: 2px solid var(--blue); color: #cfe0ff;
  transition: opacity .25s, transform .25s; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.ch-banner.s1 { border-color: var(--red); color: #ffd2cc; }
.ch-banner.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ---------- окна поверх доски ---------- */
.ch-layer { position: absolute; inset: 0; z-index: 20; background: rgba(10,11,8,.62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ch-layer[hidden] { display: none; }
.ch-modal { background: var(--panel); border: 1px solid #55594a; border-radius: 12px; padding: 16px 18px; width: min(680px, 100%); max-height: calc(100vh - 60px); overflow-y: auto;
  box-shadow: 0 14px 40px rgba(0,0,0,.6); }
.ch-modal h3 { margin: 0 0 10px; font-size: 20px; color: var(--accent); }
.ch-modal .sec { margin: 8px 0 3px; }
.ch-vs { display: flex; align-items: stretch; gap: 8px; }

.ch-mf { flex: 1; display: flex; gap: 8px; background: var(--panel2); border-radius: 8px; padding: 6px 8px; border-left: 4px solid var(--blue); }
.ch-mf.p1 { border-left-color: var(--red); }
.ch-mf-b { flex: 1; min-width: 0; } .ch-mf .hpbar { margin: 2px 0 3px; height: 7px; }

.ch-arena { flex: none; width: 190px; text-align: center; }
.ch-thumb { width: 180px; height: 140px; border-radius: 6px; background: #14150f; display: block; margin: 0 auto; }
.ch-arena-n { font-weight: 700; margin-top: 3px; }
.ch-pv { flex: 1; min-width: 0; }
.ch-pv .pos { color: #8fdc8f; } .ch-pv .neg { color: #ff9e94; }
ul.ch-perks { margin: 2px 0 0; padding-left: 18px; font-size: 13px; }
ul.ch-perks li { margin: 1px 0; }
.ch-est { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 3px 0; }
.ch-est span { width: 58px; color: var(--dim); }
.ch-est b { width: 40px; text-align: right; }
.ch-eb { flex: 1; height: 12px; background: #2a2d25; border-radius: 6px; overflow: hidden; }
.ch-eb i { display: block; height: 100%; }
.ch-est.e-win .ch-eb i { background: #57d163; } .ch-est.e-ret .ch-eb i { background: #e8c547; } .ch-est.e-lose .ch-eb i { background: #e4533f; }

@media (max-width: 620px) { .ch-vs{ flex-direction: column; } .ch-arena { width: auto; } }

/* итог дуэли */
.ch-res { font-size: 26px; font-weight: 800; color: #ffd84a; margin-bottom: 4px; }
.ch-res.o-retreat { color: var(--text); } .ch-res.o-attackerDied, .ch-res.o-bothDied { color: #ff8a80; }
.ch-cr { display: flex; gap: 8px; align-items: center; background: var(--panel2); border-radius: 8px; padding: 6px 8px; margin-top: 6px; border-left: 4px solid var(--blue); }
.ch-cr.p1 { border-left-color: var(--red); }
.ch-cr .neg { color: #ff9e94; } .ch-cr .pos { color: #8fdc8f; }
.ch-end { font-size: 34px; font-weight: 800; text-align: center; color: var(--accent); }
.ch-end.s0 { color: #7db4ff; } .ch-end.s1 { color: #ff8a80; }
.ch-endbox p { text-align: center; }

/* ---------- заставка дуэли ---------- */
#duel-splash { position: fixed; inset: 0; z-index: 2000; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(8,8,6,.92); cursor: pointer; opacity: 0; transition: opacity .25s; }
#duel-splash.on { display: flex; opacity: 1; }
#duel-splash .ds-art { width: min(1100px, 92vw); aspect-ratio: 16 / 6; border-radius: 12px; background: url(../art/ui/duel.png) center / cover no-repeat;
  box-shadow: 0 10px 40px rgba(0,0,0,.7); animation: ds-in .5s ease-out; }
#duel-splash .ds-art[data-fb] { background: linear-gradient(90deg, #1c4a96, #20221b 45%, #20221b 55%, #8c211a); }
#duel-splash .ds-text { font-size: clamp(24px, 4vw, 44px); font-weight: 800; color: var(--accent); text-shadow: 0 3px 12px #000; margin-top: -2.4em; animation: ds-in .6s ease-out; }
#duel-splash .ds-sub { color: var(--dim); font-size: 14px; margin-top: 1.4em; }
@keyframes ds-in { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- против компьютера ---------- */
.ch-vsai { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; text-align: left; }
.ch-vsai.off { opacity: .6; }
.ch-vsai-h { font-size: 17px; margin-bottom: 2px; }
.ch-vsai .sec { margin: 8px 0 4px; }
.ch-tgs { display: flex; gap: 6px; }
button.ch-tg { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; font-size: 14px; }
button.ch-tg small { font-size: 11.5px; font-weight: 400; opacity: .75; }
button.ch-tg.on { border-color: var(--accent); background: #3a3826; color: var(--accent); }
.ch-lvl-d { margin: 5px 0 10px; min-height: 1.3em; }
.ch-vsai button.ch-opt { width: 100%; }
.ch-who { font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 8px; background: #3a3826; color: var(--accent); vertical-align: middle; }
.ch-who.ai { background: #2c2f3a; color: #b8c6e8; }
.ch-mode { color: #cfcab3; }
.ch-why { font-size: 11.5px; color: var(--dim); padding-left: 16px; font-style: italic; }
.ch-tiptext { color: #50dcff; }
.ch-comp h3 { color: #ff8a80; }
.ch-comp-why { margin: -6px 0 8px; font-style: italic; }

/* Блок 6: переключатель вида доски (изометрия / сверху) — в углу поля */
#chess .ch-tools { position: absolute; left: 8px; top: 8px; z-index: 4; display: flex; align-items: center; gap: 6px; }
#chess .ch-rotbox { display: inline-flex; gap: 4px; }
#chess button.ch-viewtg, #chess button.ch-rotbtn { padding: 5px 10px; font-size: 12.5px; opacity: .92; background: rgba(20,21,15,.85); border: 1px solid #55594a; border-radius: 6px; }
#chess button.ch-rotbtn { min-width: 32px; font-size: 16px; line-height: 1; padding: 4px 8px; }
#chess button.ch-rotbtn.ch-rot0 { font-size: 12.5px; }
#chess button.ch-rotbtn:disabled { opacity: .4; cursor: default; }
#chess button.ch-viewtg:hover, #chess button.ch-rotbtn:hover:not(:disabled) { opacity: 1; border-color: var(--accent); }
#chess.ch-flatview .ch-rotbox, #chess.ch-flatview .ch-rotlnk { display: none !important; }   /* поворот — только в изометрии */
#chess .fr-link.ch-viewlnk, #chess .fr-link.ch-rotlnk { display: none; }   /* ссылка «Вид» в шапке — только на телефоне (там кнопка в углу доски закрывает клетки a8/b8) */

/* ===== Волна 3 (18.11.2026): шахматы на единой рамке (css/frame.css) =====
   Верх — заголовок «Шахматы» + путь + чей ход + «История · Меню»; центр — доска и правая панель (карточка фигуры, предупреждения);
   окна — одна карточка над затемнённой доской, кнопки окна — в нижней строке; низ — подсказка/чей ход слева, кнопки партии справа.
   Все новые правила — с префиксом ch-/#chess. Изометрическую доску и переключатель вида не трогаем. */
body.in-chess .wrap { max-width: 1320px; }
#chess.ch-boardview > .ch-fr { flex: 1 1 auto; min-height: 0; }
@supports (height: 100dvh) { #chess.ch-boardview { height: calc(100dvh - 8px); } }
#chess .ch-fr { border-radius: 6px; }
#chess .ch-fr .fr-main.has-body { min-height: 0; overflow: hidden; background-image: none; }
#chess .ch-frbody { min-height: 0; padding: 8px; }
#chess .ch-body { gap: 8px; padding: 0; }
#chess .ch-boardbox { border-radius: 4px; border: 1px solid var(--ui-line, #3b4033); }
#chess .ch-side { flex: 0 0 320px; }
#chess .hcol, #chess .ch-warn { background: var(--ui-panel, #21241d); border: 1px solid var(--ui-line2, #4a503b); border-radius: 5px; padding: 10px 12px; color: var(--ui-ink, #f1eadb); }
#chess .ch-card { max-height: none; flex: 0 1 auto; min-height: 0; overflow-y: auto; }
#chess .fr-stat.ch-status { background: none; border: 0; border-radius: 0; padding: 0; overflow: visible; font-size: 13px; }
#chess .fr-stat .ch-turn { font-size: 14px; font-weight: 400; }
#chess .fr-stat .ch-turn b { font-weight: 800; }
#chess .hcol .sec, #chess .ch-modal .sec, #chess .ch-hist .sec { color: var(--ui-gold, #e8bc70); font-size: 11px; font-weight: 800; letter-spacing: .12em; margin: 8px 0 4px; }
.ch-warn[hidden], .ch-hist[hidden], .ch-layer[hidden] { display: none !important; }
#chess .ch-warn { flex: none; border-left: 4px solid var(--ui-warn, #ffcc80); background: #2b281d; font-size: 13.5px; line-height: 1.35; }
.ch-wn + .ch-wn { margin-top: 6px; }
.ch-wn b { color: var(--ui-warn, #ffcc80); }
.ch-wn-bad b { color: #ff9e94; }
#chess .ch-warn:has(.ch-wn-bad) { border-left-color: #ff8a2a; }
/* шапка */
.fr-head .ch-status .ch-who { font-size: 12px; }
.fr-head .fr-link.on { color: var(--ui-gold-hi, #f6d294); border-color: var(--ui-gold, #e8bc70); background: transparent; }
.fr-head .fr-link { min-width: 0; }
/* нижняя строка: подсказка занимает ровно три строки, чтобы доска не прыгала при наведении */
#chess .fr-status.ch-hint { height: 3.9em; overflow-y: auto; font-size: 14px; line-height: 1.3; }
#chess .fr-status.ch-hint b { color: var(--ui-ink, #f1eadb); }
#chess .fr-status.ch-hint .c0 { color: #7db4ff; } #chess .fr-status.ch-hint .c1 { color: #ff8a80; }
#chess .fr-status.ch-hint .bad { color: #ff9e94; }
#chess .fr-status.ch-hint .ch-tiptext { color: #50dcff; }
#chess .fr .fr-btn.ch-bad { color: #ff9e94; border-color: #7a3a33; }
#chess .fr .fr-btn.ch-bad:hover:not(:disabled) { background: #2c1f1b; border-color: #ff9e94; }
/* «История»: выезжающая панель справа */
.ch-hist { position: absolute; top: 0; right: 0; bottom: 0; z-index: 4; width: min(420px, 100%); overflow-y: auto; padding: 20px 22px;
  background: var(--ui-panel, #21241d); border-left: 1px solid var(--ui-line2, #4a503b); box-shadow: -10px 0 24px rgba(0, 0, 0, .45); }
.ch-hist .fr-card-h { font-size: clamp(24px, 2.6vw, 32px); }
.ch-histmode { margin-bottom: 8px; color: var(--ui-muted, #bab7a7); }
.ch-cnt { margin: 6px 0 10px; }
.ch-hist .ch-qbar { height: 7px; background: #3a3e31; border-radius: 4px; margin-top: 4px; }
.ch-hist #ch-log, #chess #ch-log { flex: none; overflow: visible; font-size: 13px; }
.ch-hist .ch-le { padding: 7px 10px; margin-bottom: 6px; background: var(--ui-panel2, #272b23); border: 1px solid var(--ui-line, #3b4033); border-radius: 4px; }
.ch-lduel { margin-left: 4px; }
/* окна: карточка поверх затемнённой доски */
#chess .ch-layer, #chess .fr-main.has-body > .ch-layer { padding: 14px; background: rgba(12, 12, 9, .62); z-index: 20; }
#chess .fr-over > .fr-card { max-height: 100%; min-height: 0; }
#chess .fr-card.ch-modal { width: min(100%, 620px); padding: 20px 26px 22px; border-radius: 5px; border: 1px solid var(--ui-line2, #4a503b); background: rgba(33, 36, 29, .96); }
#chess .fr-card.ch-modal.fr-card-wide { width: min(100%, 900px); }
#chess .ch-modal .fr-card-h { margin-top: 0; }
#chess .ch-modal .fr-lead { margin-bottom: 10px; }
.ch-comp-why { display: block; margin-top: 6px; font-style: italic; }
.ch-trio { display: grid; grid-template-columns: 1fr 1fr 220px; gap: 8px; margin: 10px 0 6px; }
.ch-trio.ch-duo { grid-template-columns: 1fr 1fr; }
.ch-team { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ch-team-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ui-muted, #bab7a7); }
.ch-mf.dead, .ch-cr.dead { opacity: .6; }
.ch-roster { margin: 2px 0 4px; color: var(--ui-muted, #bab7a7); }
.ch-noammo { margin: 2px 0; }
#chess .ch-trio .ch-mf, #chess .ch-trio .ch-cr { display: flex; align-items: flex-start; gap: 10px; min-width: 0; margin: 0; padding: 10px 12px; background: var(--ui-panel2, #272b23);
  border: 1px solid var(--ui-line, #3b4033); border-left: 3px solid var(--blue); border-radius: 4px; }
#chess .ch-trio .ch-mf.p1, #chess .ch-trio .ch-cr.p1 { border-left-color: var(--red); }
#chess .ch-trio .ch-arena { width: auto; text-align: left; border-left-color: var(--ui-gold, #e8bc70); }
#chess .ch-trio .portrait.sm { width: 58px; height: 58px; border: 1px solid var(--ui-line2, #4a503b); border-radius: 4px; }
#chess .ch-trio .ch-thumb { flex: none; width: 84px; height: 65px; margin: 0; border: 1px solid var(--ui-line2, #4a503b); border-radius: 4px; }
#chess .ch-trio .ch-arena-n { font-weight: 600; }
.ch-trio .hpbar { margin: 2px 0 3px; height: 7px; }
.ch-pv { margin-top: 4px; }
.ch-more { margin-top: 10px; }
.ch-heal { margin-top: 8px; color: var(--ui-muted, #bab7a7); }
.ch-reason { margin-top: 12px; padding: 10px 13px; background: var(--ui-panel2, #272b23); border: 1px solid var(--ui-line2, #4a503b); border-left: 3px solid var(--ui-gold, #e8bc70); border-radius: 4px; }
#chess .fr-card-h.o-attackerDied, #chess .fr-card-h.o-bothDied { color: #ff8a80; }
#chess .fr-card-h.ch-end { text-align: left; font-weight: 600; font-size: clamp(26px, 3vw, 36px); }
#chess .ch-endbox p { text-align: left; }
/* лобби */
#chess .ch-lobby-fr .fr-main { min-height: 520px; }
#chess .ch-lobby-fr .fr-over { padding: 24px 20px; }
#chess .ch-lobby-fr .fr-card { max-height: none; }
.ch-lgrid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; align-items: start; margin-top: 12px; }
.ch-lside { display: flex; flex-direction: column; gap: 10px; }
p.ch-duel-line { display: block; margin: 0 0 10px; }
#chess .ch-vsai { background: var(--ui-panel2, #272b23); border: 1px solid var(--ui-line, #3b4033); border-radius: 4px; padding: 12px 14px 14px; }
.ch-vsai-h { font-size: 16px; }
#chess button.ch-tg { min-height: 44px; padding: 6px 4px; font-size: 14px; color: var(--ui-ink, #f1eadb); background: var(--ui-panel, #21241d); border: 1px solid var(--ui-line2, #4a503b); border-radius: 4px; }
#chess button.ch-tg:hover:not(:disabled) { border-color: var(--ui-gold, #e8bc70); background: var(--ui-panel3, #2c3026); }
#chess button.ch-tg.on { color: var(--ui-gold-hi, #f6d294); background: var(--ui-gold-bg, #393021); border-color: var(--ui-gold, #e8bc70); }
#chess .ch-lside button.ch-opt { align-items: flex-start; min-height: 64px; padding: 10px 14px; text-align: left; color: var(--ui-ink, #f1eadb); background: var(--ui-panel2, #272b23);
  border: 1px solid var(--ui-line, #3b4033); border-radius: 4px; }
#chess .ch-lside button.ch-opt:hover:not(:disabled) { background: var(--ui-panel3, #2c3026); border-color: var(--ui-gold, #e8bc70); }
#chess .ch-lside button.ch-opt small { color: var(--ui-muted, #bab7a7); opacity: 1; }
/* заставка дуэли: заголовок на засечках */
#duel-splash .ds-text { font-family: var(--s-serif, Georgia, "Times New Roman", serif); font-weight: 600; }
/* узкое окно и телефон: панель под доской */
@media (max-aspect-ratio: 5/4) {
  #chess .ch-side { flex: 0 1 auto; flex-direction: column; max-height: 38%; min-height: 110px; }
  #chess .ch-side > * { flex: 0 0 auto !important; }
  #chess .ch-side > .ch-card { flex: 1 1 auto !important; min-height: 0; }
}
@media (max-width: 900px) { .ch-trio { grid-template-columns: 1fr 1fr; } .ch-trio .ch-arena { grid-column: 1 / -1; } .ch-lgrid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  body.in-chess .wrap { padding: 8px 6px 0; }
  #chess .ch-tools { display: none; }
  #chess .fr-link.ch-viewlnk { display: inline-flex; }
  /* шапка партии: «История · Вид ⟲ ⟳» в первой строке (⟲ ⟳ ≥ 40 px), «Инструкция · Меню» во второй; точки-разделители не нужны */
  #chess.ch-boardview .fr-links { flex-wrap: wrap; }
  #chess.ch-boardview .fr-head .fr-links > .fr-link + .fr-link::before { content: none; margin: 0; }
  #chess.ch-boardview .fr-head .fr-links > .fr-link { margin-right: 6px; }
  #chess .fr-link.ch-rotlnk { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; font-size: 22px; line-height: 1; padding: 0 8px; }
  .ch-st-x { display: none; }
  #chess .ch-frbody { padding: 4px; }
  #chess .fr-card.ch-modal { padding: 14px 14px 16px; }
  .ch-trio, .ch-trio.ch-duo { grid-template-columns: 1fr; }
  #chess .ch-trio .portrait.sm { width: 48px; height: 48px; }
  .ch-hist { width: 100%; padding: 14px; }
  #chess .fr-status.ch-hint { height: 4.9em; font-size: 13px; }
  #chess .fr .fr-btn { min-height: 48px; }
}

/* ---------------- Инструкция ---------------- */
.ch-help { position: fixed; inset: 0; z-index: 60; background: rgba(10, 11, 8, .82); display: flex; align-items: center; justify-content: center; padding: 14px; }
.ch-help[hidden] { display: none !important; }
#chess .ch-helpcard { width: min(1180px, 100%); max-height: 100%; min-width: 0; display: flex; flex-direction: column; overflow: hidden; background: rgba(33, 36, 29, .98); border: 1px solid var(--ui-line2, #4a503b); border-radius: 5px; }
#chess .ch-helpcard .fr-card-in { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding: 18px 22px 16px; }
.ch-help-top { flex: none; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ch-help-tabs { flex: none; display: flex; gap: 6px; margin: 12px 0 10px; overflow-x: auto; padding-bottom: 2px; }
.ch-help-tab { flex: none; background: transparent; color: var(--ui-muted, #bab7a7); border: 1px solid var(--ui-line, #3b4033); border-radius: 4px; padding: 7px 12px; font: inherit; font-size: 14px; cursor: pointer; }
.ch-help-tab:hover { color: var(--ui-text, #ece8d6); border-color: var(--ui-line2, #4a503b); }
.ch-help-tab.on { color: var(--ui-gold, #e8bc70); border-color: var(--ui-gold, #e8bc70); background: rgba(232, 188, 112, .08); }
.ch-help-body { overflow: auto; min-height: 0; min-width: 0; flex: 1; padding-right: 4px; font-size: 14px; line-height: 1.45; }
.ch-help-body h3 { margin: 14px 0 6px; font-size: 16px; color: var(--ui-gold, #e8bc70); }
.ch-help-body h3:first-child { margin-top: 2px; }
.ch-help-body ul { margin: 4px 0 8px; padding-left: 20px; }
.ch-help-body li { margin: 4px 0; }
.ch-tw { overflow-x: auto; max-width: 100%; margin: 8px 0 12px; border: 1px solid var(--ui-line, #3b4033); border-radius: 4px; }
.ch-ht { border-collapse: collapse; font-size: 13px; width: 100%; }
.ch-ht th, .ch-ht td { padding: 6px 9px; border-bottom: 1px solid var(--ui-line, #3b4033); text-align: left; vertical-align: top; }
.ch-ht thead th { position: sticky; top: 0; background: #272b23; color: var(--ui-muted, #bab7a7); font-weight: 600; white-space: nowrap; font-size: 12px; }
.ch-ht tbody th { white-space: nowrap; color: var(--ui-text, #ece8d6); font-weight: 700; background: rgba(255, 255, 255, .02); position: sticky; left: 0; }
.ch-ht td { min-width: 52px; }
.ch-pt td:nth-child(2) { min-width: 170px; } .ch-pt td:nth-child(11) { min-width: 230px; } .ch-gt td:nth-child(9), .ch-gt td:nth-child(14) { min-width: 120px; }
.ch-ht tr:last-child td, .ch-ht tr:last-child th { border-bottom: 0; }
/* 21.11.2026: арены партии — значок в легенде справки, описание в окне дуэли, строка под доской */
.ch-artag { display: inline-block; min-width: 24px; padding: 0 4px; border-radius: 4px; background: rgba(0, 0, 0, .55); font-weight: 700; font-size: 12px; text-align: center; }
ul.ch-arenas { margin: 4px 0 2px; padding-left: 4px; list-style: none; }
ul.ch-arenas li { margin: 2px 0; }
.ch-arena-d { max-width: 200px; margin: 2px auto 0; line-height: 1.25; }
.ch-arnote { display: block; color: var(--ui-dim, #b8b39a); font-size: 12px; margin-top: 2px; }
@media (max-width: 600px) { .ch-help { padding: 6px; } #chess .ch-helpcard .fr-card-in { padding: 12px 12px 10px; } .ch-ht { font-size: 12px; } }
