/* BE Tiers — отдельный тир-лист в духе mctiers. Без доната. */
:root {
  --bg: #0E1220;
  --panel: #151A2B;
  --panel-2: #1B2135;
  --line: #262E46;
  --text: #E7EAF3;
  --muted: #8189A3;
  --t1: #F6C445; --t1-lo: #B98F2A;
  --t2: #C9D2DF; --t2-lo: #8E98A8;
  --t3: #DE8C4E; --t3-lo: #A2603A;
  --t4: #7BAAE0; --t4-lo: #52759F;
  --t5: #A196CF; --t5-lo: #6F6797;
  --eu: #3E7BE0; --as: #D9534F; --na: #E0663E; --sa: #3FB27F; --ru: #7A5CE0;
  --px: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 400 15px/1.5 var(--body); font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--t1); outline-offset: 2px; }
img.px { image-rendering: pixelated; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 520px) { .wrap { padding: 0 16px; } }

/* шапка */
.tbar { background: var(--panel); border-bottom: 1px solid var(--line); }
.tbar .wrap { display: flex; align-items: center; gap: 20px; height: 64px; }
.tlogo { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 800 20px/1 var(--px); white-space: nowrap; }
.tlogo img { width: 28px; height: 28px; }
.tlogo span { color: var(--muted); font-weight: 500; }
.tsearch { margin-left: auto; position: relative; width: min(300px, 46vw); }
@media (max-width: 600px) { .tbar .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; gap: 10px; } .tsearch { width: 100%; margin: 0; } .tlogo span { display: none; } }
.tsearch input { width: 100%; height: 40px; padding: 0 12px 0 36px; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; font: inherit; }
.tsearch input::placeholder { color: var(--muted); }
.tsearch input:focus { outline: none; border-color: var(--t4); }
.tsearch svg { position: absolute; left: 11px; top: 11px; width: 18px; height: 18px; fill: var(--muted); }

/* киты */
.kits { background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
@media (max-width: 600px) { .kit { min-width: 68px; padding: 8px 6px 7px; font-size: 12px; } .kit img { width: 26px; height: 26px; } main { padding-top: 18px; } .head-row h1 { font-size: 22px; } .info { font-size: 13px; } }
.kits .wrap { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.kits .wrap::-webkit-scrollbar { display: none; }
.kit { display: grid; justify-items: center; gap: 4px; min-width: 84px; padding: 10px 10px 9px; background: none; border: 0; cursor: pointer;
  color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; border-bottom: 3px solid transparent; }
.kit img { width: 32px; height: 32px; image-rendering: pixelated; opacity: .75; }
.kit:hover { color: var(--text); }
.kit:hover img { opacity: 1; }
.kit[aria-selected="true"] { color: var(--text); border-bottom-color: var(--t1); }
.kit[aria-selected="true"] img { opacity: 1; }

main { padding: 28px 0 60px; }
.head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 0 0 18px; }
.head-row h1 { margin: 0; font: 700 26px/1.2 var(--body); }
.head-row p { margin: 0; color: var(--muted); }
.info { color: var(--muted); font-size: 14px; max-width: 70ch; margin: 0 0 18px; }

/* общий рейтинг */
.rows { display: grid; gap: 6px; }
.row { display: grid; grid-template-columns: 64px 56px minmax(150px, 1fr) 54px minmax(0, 2.1fr); align-items: center; gap: 0 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 0 14px 0 0; min-height: 68px; cursor: pointer; text-align: left; width: 100%; }
.row:hover { background: var(--panel-2); border-color: #34405F; }
.rank { align-self: stretch; display: grid; place-items: center; font: 800 22px/1 var(--px); color: var(--muted);
  border-radius: 9px 0 0 9px; background: var(--panel-2); clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%); }
.row.r1 .rank { background: linear-gradient(135deg, var(--t1), var(--t1-lo)); color: #2B1E00; }
.row.r2 .rank { background: linear-gradient(135deg, var(--t2), var(--t2-lo)); color: #1C2230; }
.row.r3 .rank { background: linear-gradient(135deg, var(--t3), var(--t3-lo)); color: #2A1405; }
.row .face { width: 48px; height: 48px; border-radius: 6px; image-rendering: pixelated; background: var(--panel-2); }
.who { min-width: 0; }
.who .n, .who .s { display: block; }
.who .n { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who .s { color: var(--muted); font-size: 13px; }
.who .s b { color: var(--text); font-weight: 600; }
.region { justify-self: start; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 5px; background: var(--eu); color: #fff; }
.region.AS { background: var(--as); } .region.NA { background: var(--na); } .region.SA { background: var(--sa); } .region.RU { background: var(--ru); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: grid; justify-items: center; width: 46px; }
.chip .ic { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); border: 2px solid var(--line); }
.chip .ic img { width: 20px; height: 20px; image-rendering: pixelated; }
.chip .tt { margin-top: -6px; font-size: 11px; font-weight: 800; line-height: 1; padding: 3px 5px; border-radius: 4px; background: var(--line); color: var(--text); }
.chip.empty { opacity: .28; }
.chip.empty .tt { visibility: hidden; }
.t1 { --c: var(--t1); --c-lo: var(--t1-lo); } .t2 { --c: var(--t2); --c-lo: var(--t2-lo); } .t3 { --c: var(--t3); --c-lo: var(--t3-lo); }
.t4 { --c: var(--t4); --c-lo: var(--t4-lo); } .t5 { --c: var(--t5); --c-lo: var(--t5-lo); }
.chip[class*=" t"] .ic { border-color: var(--c); }
.chip[class*=" t"] .tt { background: var(--c); color: #12141C; }
.chip.lt .tt { background: var(--c-lo); color: #fff; }
.chip.retired .tt { background: #3A4157; color: var(--muted); }
@media (max-width: 860px) {
  .row { grid-template-columns: 34px 44px minmax(0, 1fr) auto; gap: 0 10px; padding: 10px 12px 12px 10px; min-height: 0; }
  .row .rank { align-self: center; width: 34px; height: 34px; border-radius: 8px; clip-path: none; font-size: 16px; }
  .row .face { width: 44px; height: 44px; }
  .who .n { font-size: 16px; }
  .who .s { font-size: 12px; }
  .row .region { align-self: start; margin-top: 2px; }
  .row .chips { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin-top: 10px; justify-content: stretch; }
  .chip { width: auto; }
  .chip .ic { width: 30px; height: 30px; }
  .chip .ic img { width: 18px; height: 18px; }
  .chip .tt { font-size: 10px; padding: 2px 3px; }
}


/* кит: колонки тиров */
.cols { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; align-items: start; }
.col { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.col h2 { margin: 0; padding: 12px 14px; font: 800 16px/1 var(--body); color: #12141C; background: var(--c); display: flex; justify-content: space-between; }
.col h2 small { font-weight: 600; opacity: .7; }
.col ul { list-style: none; margin: 0; padding: 6px; }
.col li button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px; border: 0; background: none; border-radius: 6px; cursor: pointer; text-align: left; }
.col li button:hover { background: var(--panel-2); }
.col li img { width: 28px; height: 28px; border-radius: 4px; image-rendering: pixelated; }
.col li .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.col li .hl { font-size: 11px; font-weight: 800; padding: 2px 5px; border-radius: 4px; background: var(--c); color: #12141C; }
.col li .hl.lt { background: var(--c-lo); color: #fff; }
.col li.retired .n { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(129, 137, 163, .5); }
.col .none { color: var(--muted); padding: 8px; font-size: 14px; }
@media (max-width: 980px) { .cols { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }

.msg { color: var(--muted); padding: 40px 0; text-align: center; }

/* карточка игрока */
dialog.card { width: min(520px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); color: var(--text); }
dialog.card::backdrop { background: rgba(5, 7, 14, .7); }
.card .top { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; padding: 22px; border-bottom: 1px solid var(--line); }
.card .top img { width: 96px; height: 96px; border-radius: 10px; image-rendering: pixelated; background: var(--panel-2); }
.card h2 { margin: 0 0 4px; font: 800 24px/1.15 var(--body); overflow-wrap: anywhere; }
.card .sub { color: var(--muted); }
.card .stats { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 1px solid var(--line); }
.card .stats div { padding: 14px 22px; }
.card .stats b { display: block; font: 800 22px/1.1 var(--px); }
.card .stats span { color: var(--muted); font-size: 13px; }
.card .ktab { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 18px 22px 22px; }
.card .k { display: grid; justify-items: center; gap: 4px; padding: 10px 4px; border-radius: 8px; background: var(--panel-2); font-size: 12px; color: var(--muted); }
.card .k img { width: 28px; height: 28px; image-rendering: pixelated; }
.card .k b { font-size: 14px; color: var(--c, var(--muted)); }
.card .k i { font-style: normal; font-size: 11px; }
.card .close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border: 0; border-radius: 8px; background: var(--panel-2); cursor: pointer; font-size: 20px; line-height: 1; }
@media (max-width: 480px) { .card .top { grid-template-columns: 72px 1fr; } .card .top img { width: 72px; height: 72px; } .card .ktab { grid-template-columns: repeat(2, 1fr); } }

/* подвал */
.tfoot { border-top: 1px solid var(--line); padding: 22px 0 32px; color: var(--muted); font-size: 13px; }
.tfoot .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.tfoot .legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-right: auto; }
.tfoot .legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--c); margin-right: 6px; vertical-align: -1px; }

/* значки званий */
.badge { width: 16px; height: 16px; image-rendering: pixelated; vertical-align: -3px; margin-right: 6px; }
.badge.big { width: 24px; height: 24px; vertical-align: -6px; margin-right: 8px; }
.tfoot .ranks { display: flex; flex-wrap: wrap; gap: 6px 16px; flex-basis: 100%; }
.tfoot .ranks span { display: inline-flex; align-items: center; }
.card .top img.badge.big { width: 24px; height: 24px; border-radius: 0; background: none; }
