/* STATS_COMPARE_V1 — вкладка «Сравнение». Классы только с префиксом cmp-; общие .empty / .muted из styles.css не трогаем. */
.cmp-bar { gap: 10px; margin-bottom: 10px; }
.cmp-row { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.cmp-blocks { flex-wrap: wrap; }
.cmp-students { display: flex; flex-direction: column; gap: 6px; flex: 1 1 480px; min-width: 0; }
.cmp-grp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cmp-gbtn { font-weight: 700; border-style: dashed; }
.cmp-sbtn { font-size: 12px; padding: 4px 9px; }
.cmp-tune { margin-top: 2px; }
#cmpThr { width: 150px; flex: none; }
.cmp-thrv { min-width: 40px; color: var(--gold-400, #e5b566); font-variant-numeric: tabular-nums; }
.cmp-num { width: 74px; }
.cmp-bar .stc-grid.stc-off { opacity: .35; pointer-events: none; }
.cmp-opp-note { color: var(--gold-400, #e5b566); }
.cmp-short { color: #ffb36b !important; }
.cmp-legend { margin: 2px 0 0; line-height: 1.45; }
.cmp-bbtn.cmp-tone-blue { --tone: #3fa9d9; }
.cmp-bbtn.cmp-tone-purple { --tone: #a97be0; }
.cmp-bbtn.cmp-tone-teal { --tone: #34c3a6; }
.cmp-bbtn.cmp-tone-orange { --tone: #f0903c; }
.cmp-bbtn.cmp-tone-green { --tone: #67c04e; }
.cmp-bbtn.cmp-tone-red { --tone: #e06b5f; }
.cmp-bbtn.cmp-tone-gold { --tone: #d4a24b; }
.cmp-bbtn { border-left: 3px solid var(--tone, #888); }

.cmp-result { margin-top: 6px; }
.cmp-empty { padding: 26px 14px; text-align: center; color: var(--muted2, #8b8b8b); }
.cmp-err { margin: 0 0 10px; padding: 8px 12px; border-radius: 8px; background: rgba(224, 107, 95, .12); color: #ff9a8d; font-size: 12.5px; }
.cmp-two { display: flex; gap: 14px; align-items: flex-start; }
.cmp-main { flex: 1 1 auto; min-width: 0; }
.cmp-side { flex: 0 0 360px; max-width: 360px; padding: 10px 12px; border-radius: 10px; background: var(--bg-2, rgba(255, 255, 255, .04)); border: 1px solid var(--line, #2a2a2a); }
.cmp-side h4 { margin: 0 0 4px; font-size: 13px; color: var(--gold-400, #e5b566); }
.cmp-hint { margin: 0 0 8px; font-size: 11px; line-height: 1.4; color: var(--muted2, #8b8b8b); }
@media (max-width: 1200px) { .cmp-two { flex-direction: column; } .cmp-side { flex-basis: auto; max-width: none; width: 100%; } }

.cmp-scroll { overflow: auto; max-height: 78vh; border: 1px solid var(--line, #2a2a2a); border-radius: 10px; }
.cmp-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; width: max-content; min-width: 100%; }
.cmp-table th, .cmp-table td { padding: 4px 8px; border-bottom: 1px solid rgba(255, 255, 255, .05); white-space: nowrap; }
.cmp-table thead th { position: sticky; top: 0; z-index: 3; background: #15130f; vertical-align: top; }
.cmp-lab { position: sticky; left: 0; z-index: 2; background: #15130f; min-width: 170px; text-align: left; color: #e8e2d4; }
.cmp-lab-h { z-index: 4 !important; }
.cmp-col { color: var(--muted2, #8b8b8b); width: 28px; text-align: center; font-size: 11px; }
.cmp-lab span { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.cmp-first td { border-top: 1px solid rgba(255, 255, 255, .09); }
.cmp-sec td { background: rgba(212, 162, 75, .12); color: var(--gold-400, #e5b566); font-weight: 700; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; padding: 5px 8px; }
.cmp-sum td.cmp-lab, .cmp-sum td.cmp-col, .cmp-sum td.cmp-med { background: #1b1812; }
.cmp-bt { display: inline-block; padding: 3px 10px; border-radius: 6px; color: #101010; font-weight: 800; font-size: 12.5px; background: #888; }
.cmp-tone-blue.cmp-bt { background: #3fa9d9; } .cmp-tone-purple.cmp-bt { background: #a97be0; } .cmp-tone-teal.cmp-bt { background: #34c3a6; }
.cmp-tone-orange.cmp-bt { background: #f0903c; } .cmp-tone-green.cmp-bt { background: #67c04e; } .cmp-tone-red.cmp-bt { background: #e06b5f; } .cmp-tone-gold.cmp-bt { background: #d4a24b; }

.cmp-stu { min-width: 92px; text-align: center; position: sticky; }
.cmp-stu-name { display: block; font-weight: 700; color: #fff; max-width: 120px; margin: 0 auto; overflow: hidden; text-overflow: ellipsis; }
.cmp-stu-sub { display: block; font-size: 10.5px; color: var(--muted2, #8b8b8b); font-weight: 500; }
.cmp-stu-sc { display: flex; justify-content: center; gap: 6px; margin-top: 2px; font-size: 10.5px; font-weight: 700; }
.cmp-stu-sc em { font-style: normal; }
.cmp-stu-sc .g { color: #66d662; } .cmp-stu-sc .r { color: #ff7a6b; } .cmp-stu-sc .d { color: #cfc29a; }
.cmp-x { background: none; border: 0; color: var(--muted2, #8b8b8b); cursor: pointer; font-size: 14px; line-height: 1; padding: 0 2px; }
.cmp-stu .cmp-x { position: absolute; top: 2px; right: 3px; opacity: 0; }
.cmp-stu:hover .cmp-x { opacity: 1; }
.cmp-x:hover { color: #fff; }

.cmp-c { text-align: center; cursor: pointer; position: relative; min-width: 92px; font-variant-numeric: tabular-nums; color: #f2eee3; }
.cmp-c b { font-weight: 700; font-size: 13px; }
.cmp-c small { display: block; font-size: 9.5px; color: rgba(255, 255, 255, .42); line-height: 1.1; }
.cmp-c:hover { outline: 1px solid rgba(255, 255, 255, .35); outline-offset: -1px; }
.cmp-na, .cmp-low { color: rgba(255, 255, 255, .38); }
.cmp-low b { font-weight: 500; font-style: italic; }
.cmp-t-good { background: rgba(80, 200, 90, calc(var(--a, 0) * .42)); }
.cmp-t-bad { background: rgba(235, 90, 75, calc(var(--a, 0) * .46)); }
.cmp-t-up { background: rgba(232, 176, 72, calc(var(--a, 0) * .42)); }
.cmp-t-down { background: rgba(70, 150, 230, calc(var(--a, 0) * .46)); }
.cmp-hot { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .38); }
.cmp-hot b { color: #fff; }
.cmp-mk { position: absolute; top: 1px; left: 3px; font-size: 8px; font-style: normal; }
.cmp-mk-b { color: #8df07f; } .cmp-mk-w { color: #ff8d80; }
.cmp-med { text-align: center; min-width: 64px; color: #cfc29a; background: rgba(255, 255, 255, .03); }
.cmp-dir { background: none; border: 1px solid rgba(255, 255, 255, .15); border-radius: 5px; color: var(--muted2, #8b8b8b); cursor: pointer; font-size: 10px; line-height: 1; padding: 2px 4px; margin-left: 4px; vertical-align: middle; }
.cmp-dir:hover { color: #fff; border-color: rgba(255, 255, 255, .5); }
.cmp-dir-up { color: #8df07f; border-color: rgba(120, 220, 110, .5); }
.cmp-dir-dn { color: #ff8d80; border-color: rgba(255, 130, 115, .5); }
.cmp-table tr.cmp-flash td { animation: cmpflash 1.5s ease-out; }
@keyframes cmpflash { 0% { box-shadow: inset 0 0 0 2px #e5b566; } 100% { box-shadow: inset 0 0 0 2px transparent; } }

.cmp-plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cmp-plist li { padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .04); border-left: 3px solid #888; cursor: pointer; font-size: 12px; line-height: 1.35; }
.cmp-plist li:hover { background: rgba(255, 255, 255, .08); }
.cmp-plist li.cmp-p-bad { border-left-color: #ff7a6b; }
.cmp-plist li.cmp-p-up { border-left-color: #e8b048; }
.cmp-plist li.cmp-p-down { border-left-color: #4696e6; }
.cmp-plist li b { color: #fff; }
.cmp-plist li i { font-style: normal; color: var(--muted2, #8b8b8b); }
.cmp-p-v { display: block; font-variant-numeric: tabular-nums; color: #fff; font-weight: 700; }
.cmp-p-v em { font-style: normal; font-weight: 500; color: var(--muted2, #8b8b8b); }
.cmp-p-w { display: block; font-size: 10.5px; color: var(--muted2, #8b8b8b); }

.cmp-pop { position: fixed; z-index: 9000; width: 360px; max-height: 70vh; overflow: auto; padding: 10px 12px; border-radius: 12px; background: #1a1813; border: 1px solid #4a4130; box-shadow: 0 14px 40px rgba(0, 0, 0, .55); font-size: 12.5px; }
.cmp-pop-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; color: #fff; }
.cmp-pop-s { font-size: 11px; color: var(--muted2, #8b8b8b); margin-bottom: 8px; }
.cmp-pr { display: grid; grid-template-columns: 96px 1fr 52px 64px auto; gap: 8px; align-items: center; padding: 3px 0; }
.cmp-pr.low { opacity: .5; }
.cmp-pn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #e8e2d4; }
.cmp-pb { height: 8px; background: rgba(255, 255, 255, .07); border-radius: 4px; overflow: hidden; }
.cmp-pb i { display: block; height: 100%; background: linear-gradient(90deg, #8a6a2a, #e5b566); }
.cmp-pr b { text-align: right; font-variant-numeric: tabular-nums; color: #fff; }
.cmp-pr small { color: var(--muted2, #8b8b8b); font-size: 10px; text-align: right; }

/* фильтры как в «Данных по ученикам»: стек, уровень, рум, байин, турнир, нагрузка */
.cmp-frows { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cmp-frows.stc-off { opacity: .35; pointer-events: none; }
.cmp-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.cmp-frow > .stats-sample-label { min-width: 118px; }
.cmp-comp { border-style: dashed; opacity: .9; }
.cmp-comp.active { opacity: 1; }
.cmp-abi { display: block; font-size: 11px; color: var(--gold-400, #e5b566); font-weight: 600; font-variant-numeric: tabular-nums; cursor: help; }

/* STATS_HEATMAP_V1: префлоп-карты 13x13 */
#tab-compare.cmp-heatmode .cmp-row-blocks, #tab-compare.cmp-heatmode .cmp-tune-table, #tab-compare.cmp-heatmode .cmp-legend, #tab-compare.cmp-heatmode #cmpOppNote { display: none; }
.cmh-ctl { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 10px; }
.cmh-sum { margin-bottom: 10px; max-height: none; }
.cmh-num { cursor: default !important; }
.cmh-leg { margin: 6px 0 10px; line-height: 1.45; }
.cmh-grid { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.cmh-card { flex: 0 0 auto; padding: 8px 10px 8px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line, #2a2a2a); }
.cmh-medcard { border-color: #6b5a2c; }
.cmh-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 5px; color: #fff; font-size: 12.5px; }
.cmh-h span { color: var(--muted2, #8b8b8b); font-size: 11px; font-variant-numeric: tabular-nums; }
.cmh-g { display: grid; grid-template-columns: repeat(13, 26px); gap: 1px; }
.cmh-c { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 26px; height: 25px; border-radius: 3px; cursor: pointer; font-style: normal; color: #f2eee3; line-height: 1; }
.cmh-c u { text-decoration: none; font-size: 7px; opacity: .6; }
.cmh-c b { font-size: 9.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cmh-c.cmh-dk { color: #1a1308; }
.cmh-c.cmh-low { opacity: .38; }
.cmh-c:hover { outline: 1px solid #fff; z-index: 2; }
.cmh-f { display: flex; gap: 12px; margin-top: 5px; font-size: 11px; color: var(--muted2, #8b8b8b); }
.cmh-f b { color: #fff; }

/* STATS_DRILL_V1: проблемные зоны по группам и раздачи hit/miss */
.cmp-pz-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 7px; }
.cmp-pz-tabs .stats-mode-btn { padding: 3px 9px; font-size: 11.5px; }
.cmp-pz-g { margin: 0 0 8px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 9px; background: rgba(255, 255, 255, .02); }
.cmp-pz-g > summary { cursor: pointer; display: flex; justify-content: space-between; gap: 8px; align-items: baseline; padding: 6px 9px; color: #fff; font-size: 12.5px; list-style: none; }
.cmp-pz-g > summary::-webkit-details-marker { display: none; }
.cmp-pz-n { color: var(--muted2, #8b8b8b); font-size: 10.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cmp-pz-s { margin: 0 6px 6px; padding: 4px 0 0 7px; border-left: 3px solid var(--tone, #888); }
.cmp-pz-sh { font-size: 11px; color: #d8cfae; margin: 0 0 3px; }
.cmp-pz-sh i { font-style: normal; color: var(--muted2, #8b8b8b); margin-left: 4px; }
.cmp-plist li { position: relative; padding-right: 64px; }
.cmp-plist li[style*="--tone"] { border-left-color: var(--tone); }
.cmp-pz-t { display: flex; justify-content: space-between; gap: 8px; }
.cmp-dr { background: rgba(229, 181, 102, .14); border: 1px solid rgba(229, 181, 102, .45); color: #e5b566; border-radius: 6px; font-size: 10.5px; padding: 2px 7px; cursor: pointer; line-height: 1.3; }
.cmp-dr:hover { background: rgba(229, 181, 102, .3); color: #fff; }
.cmp-plist .cmp-dr { position: absolute; right: 7px; bottom: 6px; }
.cmp-pr .cmp-dr { margin-left: 4px; }
.cmp-drill { position: fixed; z-index: 9100; top: 70px; right: 24px; width: min(620px, calc(100vw - 48px)); max-height: calc(100vh - 100px); overflow: auto; padding: 12px 14px; border-radius: 12px; background: #1a1813; border: 1px solid #5a4d33; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); font-size: 12.5px; }
.cmp-drill-h { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; color: #fff; }
.cmp-drill-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cmp-drill-c h5 { margin: 0 0 5px; font-size: 12px; color: #e5b566; }
.cmp-drill-hit h5 { color: #8df07f; } .cmp-drill-miss h5 { color: #ff8d80; }
.cmp-drill-c ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.cmp-dr-i { display: grid; grid-template-columns: 62px 38px 1fr 48px; gap: 6px; align-items: center; padding: 4px 6px; border-radius: 6px; background: rgba(255, 255, 255, .04); cursor: pointer; font-variant-numeric: tabular-nums; }
.cmp-dr-i:hover { background: rgba(255, 255, 255, .1); }
.cmp-dr-d { color: var(--muted2, #8b8b8b); font-size: 11px; } .cmp-dr-c { color: #fff; font-weight: 700; } .cmp-dr-p { color: var(--muted2, #8b8b8b); font-size: 11px; text-align: right; }
.cmp-dr-i b { text-align: right; }
@media (max-width: 700px) { .cmp-drill-cols { grid-template-columns: 1fr; } }

/* STATS_SIM_V1: схожесть игроков */
.cmp-sim-wrap { display: flex; gap: 14px; align-items: flex-start; }
.cmp-sim-m { flex: 0 1 auto; max-width: 62%; }
.cmp-sim { border-collapse: separate; border-spacing: 1px; font-size: 11.5px; }
.cmp-sim th { font-weight: 700; padding: 3px 6px; white-space: nowrap; text-align: left; }
.cmp-sim-h { height: 96px; vertical-align: bottom; } .cmp-sim-h span { display: inline-block; writing-mode: vertical-rl; transform: rotate(180deg); }
.cmp-sim-c { width: 44px; min-width: 44px; text-align: center; padding: 6px 2px; color: #fff; font-variant-numeric: tabular-nums; border-radius: 3px; }
.cmp-sim-self { background: rgba(255, 255, 255, .06); } .cmp-sim-na { color: var(--muted2, #8b8b8b); }
.cmp-sim-cards { flex: 1 1 320px; min-width: 260px; display: flex; flex-direction: column; gap: 10px; }
.cmp-sim-card { padding: 9px 12px; border-radius: 10px; background: rgba(255, 255, 255, .03); border: 1px solid var(--line, #2a2a2a); border-left-width: 4px; }
.cmp-sim-card h4 { margin: 0 0 6px; font-size: 12.5px; line-height: 1.35; }
@media (max-width: 1100px) { .cmp-sim-wrap { flex-direction: column; } .cmp-sim-m { max-width: 100%; } }
.cmp-coinwarn { margin: 6px 0 10px; padding: 8px 12px; border-radius: 8px; background: rgba(240, 144, 60, .12); border: 1px solid rgba(240, 144, 60, .45); color: #f1d9bd; font-size: 12.5px; line-height: 1.5; }
.cmp-coinwarn[hidden] { display: none; }
.cmp-coinwarn .stats-mode-btn { margin-left: 8px; }
.cmp-local { margin: 8px 0 10px; padding: 8px 10px; border-radius: 8px; background: rgba(63, 169, 217, .1); border: 1px solid rgba(63, 169, 217, .35); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 12.5px; }
.cmp-local .cmp-loc-btn { text-decoration: none; }
.cmp-local .muted-mini { flex: 1 1 100%; line-height: 1.4; }
a.cmp-dr-loc { text-decoration: none; margin-left: 4px; color: #7fb7e6; }

/* STATS_HEAT_VILLAIN_V1: строка «откуда действие» в префлоп-картах */
.cmh-vrow { align-items: center; flex-wrap: wrap; }
.cmh-vsep { display: inline-block; width: 1px; height: 18px; margin: 0 8px; background: var(--line, rgba(255,255,255,.14)); vertical-align: middle; }
.cmh-vnote { margin-left: 10px; max-width: 520px; line-height: 1.35; }
