/* Layout: одна колонка «приборных панелей» — сравнение двух игроков, затем графики, затем журнал дуэлей */
:root {
  --bg: #0a0b0e; --panel: rgba(20, 22, 27, .78); --panel-solid: #15171c; --panel-2: rgba(255, 255, 255, .035); --line: rgba(255, 255, 255, .08);
  --fg: #f4f5f7; --muted: #8a909c; --accent: #e6e8ec; --active: #2b2f37; --link: #8ab4ff;
  --primary-bg: #f4f5f7; --primary-fg: #0a0b0e;
  --w: #34d399; --l: #fb7185;
  /* синий — игрок 1, красный — игрок 2 */
  --p1: #3b82f6; --p2: #ef4444; --p1-text: #60a5fa; --p2-text: #f87171;
  --p1-soft: linear-gradient(90deg, rgba(59, 130, 246, .22), rgba(59, 130, 246, .04) 70%);
  --p2-soft: linear-gradient(90deg, rgba(239, 68, 68, .22), rgba(239, 68, 68, .04) 70%);
  --t-s: #c084fc; --t-a: #34d399; --t-b: #60a5fa; --t-c: #fbbf24; --t-d: #fb7185;
  --on-chip: #0a0b0e; --gold: #d6b25e;
  --glow-1: rgba(59, 130, 246, .10); --glow-2: rgba(239, 68, 68, .08);
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-data: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #f4f5f8; --panel: rgba(255, 255, 255, .9); --panel-solid: #ffffff; --panel-2: rgba(15, 23, 42, .035); --line: rgba(15, 23, 42, .1);
    --fg: #111827; --muted: #5b6474; --accent: #1f2937; --active: #e5e7eb; --link: #2563eb;
    --primary-bg: #111827; --primary-fg: #ffffff;
    --w: #059669; --l: #e11d48;
    --p1: #2563eb; --p2: #dc2626; --p1-text: #2563eb; --p2-text: #dc2626;
    --p1-soft: linear-gradient(90deg, rgba(37, 99, 235, .14), rgba(37, 99, 235, .03) 70%);
    --p2-soft: linear-gradient(90deg, rgba(220, 38, 38, .14), rgba(220, 38, 38, .03) 70%);
    --t-s: #9333ea; --t-a: #059669; --t-b: #2563eb; --t-c: #d97706; --t-d: #e11d48;
    --on-chip: #ffffff; --gold: #a16207;
    --glow-1: rgba(37, 99, 235, .08); --glow-2: rgba(220, 38, 38, .06);
    color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #f4f5f8; --panel: rgba(255, 255, 255, .9); --panel-solid: #ffffff; --panel-2: rgba(15, 23, 42, .035); --line: rgba(15, 23, 42, .1);
  --fg: #111827; --muted: #5b6474; --accent: #1f2937; --active: #e5e7eb; --link: #2563eb;
  --primary-bg: #111827; --primary-fg: #ffffff;
  --w: #059669; --l: #e11d48;
  --p1: #2563eb; --p2: #dc2626; --p1-text: #2563eb; --p2-text: #dc2626;
  --p1-soft: linear-gradient(90deg, rgba(37, 99, 235, .14), rgba(37, 99, 235, .03) 70%);
  --p2-soft: linear-gradient(90deg, rgba(220, 38, 38, .14), rgba(220, 38, 38, .03) 70%);
  --t-s: #9333ea; --t-a: #059669; --t-b: #2563eb; --t-c: #d97706; --t-d: #e11d48;
  --on-chip: #ffffff; --gold: #a16207;
  --glow-1: rgba(37, 99, 235, .08); --glow-2: rgba(220, 38, 38, .06);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); -webkit-text-size-adjust: 100%; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--fg);
  font-family: var(--font-body); font-size: 14px; line-height: 1.45;
}
.wrap {
  max-width: 1180px; margin: 0 auto;
  padding-block: 20px 48px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: grid; gap: 18px;
}
h1, h2 { font-family: var(--font-display); font-weight: 400; margin: 0; text-wrap: balance; letter-spacing: .02em; }
h1 { font-size: 22px; }
h2 { font-size: 15px; text-transform: uppercase; letter-spacing: .08em; }
.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.brand { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.brand .tag { font-family: var(--font-data); font-size: 12px; color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { background: transparent; border: 0; padding: 6px 12px; cursor: pointer; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--fg); box-shadow: inset 0 -2px 0 var(--accent); }
.btn {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn:hover { border-color: var(--muted); }
.btn.on { border-color: var(--accent); color: var(--accent); }
.btn svg { width: 15px; height: 15px; flex: none; }
a.btn { text-decoration: none; color: inherit; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 14px; min-width: 0; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }

/* Nav */
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--muted); text-decoration: none; padding: 7px 14px; border-radius: 8px; border: 1px solid transparent; font-weight: 500; }
.nav a:hover { color: var(--fg); border-color: var(--line); }
.nav a[aria-current="page"] { color: var(--fg); background: var(--panel); border-color: var(--line); box-shadow: inset 0 -2px 0 var(--accent); }
.page { display: grid; gap: 18px; min-width: 0; }

/* Подменю раздела */
.subnav { display: flex; flex-wrap: wrap; gap: 4px 18px; border-bottom: 1px solid var(--line); padding-bottom: 2px; margin-top: -6px; }
.subnav a { color: var(--muted); text-decoration: none; padding: 6px 2px; border-bottom: 2px solid transparent; font-size: 14px; }
.subnav a:hover { color: var(--fg); }
.subnav a[aria-current="page"] { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.page.empty > section, .page.empty > footer { display: none; }

/* Таблица тир-листа: чемпионы × карты */
.matrix { min-width: 860px; }
.matrix th, .matrix td { padding: 4px 4px; }
.matrix tbody tr { cursor: pointer; }
.matrix tbody tr:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.matrix tbody tr.cur td { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.matrix .chip { min-width: 30px; font-size: 11px; padding: 2px 6px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--fg); cursor: pointer; }
.linkbtn:hover { color: var(--accent); }
.tl-select { min-width: 200px; }

/* Star (доп. фильтр) */
.btn.star { --star: var(--p1); color: var(--star); border-color: color-mix(in srgb, var(--star) 45%, var(--line)); }
.btn.star svg { width: 17px; height: 17px; fill: none; }
.btn.star.active svg { fill: currentColor; }
.btn.star.active { background: color-mix(in srgb, var(--star) 14%, var(--panel-2)); }
.btn.star.ignored { --star: var(--l); }
.btn.star.ignored svg { fill: currentColor; }
.btn.star:disabled { --star: var(--muted); opacity: .55; cursor: not-allowed; }
.hint { font-size: 13px; color: var(--muted); }
.hint.bad { color: var(--l); }

/* Rank filter */
.rankbox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; background: var(--panel-2); }
.rankbox label { display: inline-flex; align-items: center; gap: 6px; }
.ranks-line { display: flex; gap: 4px; }
.ranks-line { flex-wrap: wrap; }
.rk { min-width: 28px; height: 26px; padding: 0 4px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-display); font-size: 11px; border: 1px solid var(--line); color: var(--muted); }
.rk.in { color: var(--on-chip); border-color: transparent; }

/* Comparison table */
.scroll { overflow-x: auto; min-width: 0; }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
.cmp { min-width: 780px; }
.cmp th { font-weight: 500; color: var(--muted); font-size: 12px; text-align: center; padding: 4px 6px; white-space: nowrap; }
.cmp thead tr:first-child th { text-transform: uppercase; letter-spacing: .06em; font-size: 11px; }
.cmp th.grp { border-bottom: 1px solid var(--line); }
.cmp td { padding: 6px; text-align: center; vertical-align: middle; }
.cmp tbody tr.r1 td { background: var(--p1-soft); }
.cmp tbody tr.r2 td { background: var(--p2-soft); }
.cmp tbody tr.r1 td:first-child { border-radius: 10px 0 0 0; }
.cmp tbody tr.r1 td:last-child { border-radius: 0 10px 0 0; }
.cmp tbody tr.r2 td:first-child { border-radius: 0 0 0 10px; }
.cmp tbody tr.r2 td:last-child { border-radius: 0 0 10px 0; }
.cmp td.sep { border-left: 1px solid var(--line); }
.cmp td.v { font-family: var(--font-data); font-size: 18px; font-weight: 700; width: 80px; min-width: 80px; }
/* ширина колонок не зависит от того, есть ли в них цифры: таблица не «прыгает», когда появляются данные */
.cmp td.v:empty::after { content: "\00a0"; }
.cmp td.v.w { color: var(--w); }
.cmp td.v.l { color: var(--l); }

.sel {
  appearance: none; -webkit-appearance: none;
  background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b95ab'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 28px 6px 14px;
  min-width: 140px; max-width: 220px; cursor: pointer; text-align: left;
}
.sel.p1 { background-color: var(--p1); color: var(--on-chip); border-color: transparent; font-weight: 600; }
.sel.p2 { background-color: var(--p2); color: var(--on-chip); border-color: transparent; font-weight: 600; }
.sel option { background: var(--panel); color: var(--fg); font-weight: 400; }
.sel.sm { min-width: 0; }

.chip { display: inline-block; min-width: 40px; padding: 3px 10px; border-radius: 999px; font-family: var(--font-display); font-size: 13px; color: var(--on-chip); }
.chip.none { background: transparent; color: var(--muted); border: 1px dashed var(--line); }
.t-S { background: var(--t-s); } .t-A { background: var(--t-a); } .t-b { background: var(--t-b); } .t-c { background: var(--t-c); } .t-d { background: var(--t-d); }
.delta { font-family: var(--font-data); font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }

/* Pies */
.pies { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.pie { display: flex; align-items: center; gap: 16px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); min-width: 0; }
.pie svg { width: 108px; height: 108px; flex: none; }
.pie .cap { display: grid; gap: 6px; min-width: 0; }
.pie .cap b { font-weight: 600; }
.leg { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 0; }
.leg i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.leg span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Bars */
.bars { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 16px; align-items: start; }
.chart { min-width: 0; }
.chart svg { display: block; width: 100%; min-width: 600px; height: auto; }
.chart .ax { fill: var(--muted); font-family: var(--font-data); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .lbl { fill: var(--fg); font-size: 11.5px; }
.chart .vl { font-family: var(--font-data); font-size: 10px; }
.chart .empty { fill: var(--muted); font-size: 14px; }
.side { display: grid; gap: 8px; align-content: start; }
.kv { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 8px; }
.kv dt { color: var(--muted); text-align: right; font-size: 13px; }
.kv dd { margin: 0; font-family: var(--font-data); font-weight: 700; font-size: 17px; }
.kv .sel { width: 100%; max-width: none; min-width: 0; font-family: var(--font-body); font-size: 13px; font-weight: 400; padding-block: 4px; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; }

.inl { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; }
.inl .sel { color: var(--fg); }

/* Picks */
.pick-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.pick-win { border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; gap: 8px; min-width: 0; background: var(--panel-2); }
.pick-win.r1 { border-top: 3px solid var(--p1); }
.pick-win.r2 { border-top: 3px solid var(--p2); }
.pick-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.pick-head h3 { margin: 0; font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.pick-head .muted { font-size: 12px; }
.picks th.who { white-space: normal; line-height: 1.25; }
.picks th.who span { display: block; color: var(--fg); font-weight: 600; overflow-wrap: anywhere; }
.picks tbody tr:hover td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
.picks { min-width: 360px; font-size: 13px; }
.picks th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.picks td { padding: 5px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.picks tr:last-child td { border-bottom: 0; }
.picks .r { text-align: right; }
.picks td.name { font-weight: 600; white-space: nowrap; }
.picks td.wr { font-family: var(--font-data); font-weight: 700; }

/* Tier helper */
.helper { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.hmain { display: grid; gap: 12px; min-width: 0; }
.htab { min-width: 620px; font-size: 13px; }
.htab th { color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.htab th:first-child, .htab td:first-child { text-align: left; }
.htab td { padding: 5px 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
.htab tr:last-child td { border-bottom: 0; }
.htab td.first { font-weight: 600; }
.htab .chip { min-width: 34px; font-size: 12px; padding: 2px 8px; }
.edge { font-family: var(--font-data); font-weight: 700; display: inline-block; min-width: 36px; padding: 1px 6px; border-radius: 6px; }
.edge.pos { color: var(--p1-text); background: color-mix(in srgb, var(--p1) 16%, transparent); }
.edge.neg { color: var(--p2-text); background: color-mix(in srgb, var(--p2) 16%, transparent); }
.edge.zero { color: var(--t-c); background: color-mix(in srgb, var(--t-c) 14%, transparent); }
.rec { font-family: var(--font-data); font-size: 12px; }
.card { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; display: grid; gap: 10px; min-width: 0; }
.card h3 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cls { font-family: var(--font-body); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.stats div { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; min-width: 0; }
.stats dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.stats dd { margin: 0; font-family: var(--font-data); font-size: 13px; overflow-wrap: anywhere; }
.blk { display: grid; gap: 2px; }
.blk b { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.blk p { margin: 0; white-space: pre-line; font-size: 13px; overflow-wrap: anywhere; }

/* Champions page */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tile { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: left; cursor: pointer; display: grid; gap: 4px; }
.tile:hover { border-color: var(--muted); }
.tile[aria-pressed="true"] { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tile b { font-family: var(--font-display); font-weight: 400; font-size: 15px; }
.tile span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.tile .num { font-size: 12px; text-transform: none; letter-spacing: 0; }
.maptiers { min-width: 480px; }
.mods { display: grid; gap: 8px; }
.mods h3 { margin: 0; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 500; }
.modrow { display: flex; flex-wrap: wrap; gap: 6px; }
.mod { font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); }
.mod b { font-family: var(--font-data); margin-left: 4px; }
.mod.pos b { color: var(--w); } .mod.neg b { color: var(--l); }

/* Players page */
.search { background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; min-width: 0; width: 220px; max-width: 100%; }
.players-t td.r, .players-t th.r { text-align: right; }
.players-t select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }

/* Duel log */
.log { min-width: 720px; font-size: 13px; }
.log th { text-align: left; color: var(--muted); font-weight: 500; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.log td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.log tr:last-child td { border-bottom: 0; }
.res { font-family: var(--font-display); font-size: 12px; padding: 2px 8px; border-radius: 6px; color: var(--on-chip); }
.res.W { background: var(--w); } .res.L { background: var(--l); }
.bd { font-family: var(--font-data); font-size: 11px; color: var(--muted); }
.log th.c, .log td.c { text-align: center; }
.log td.tier { font-family: var(--font-data); font-size: 12px; color: var(--muted); }
.log td.tier.cor { color: var(--fg); font-weight: 700; }
/* тир в сравнении с соперником: выше / ниже / равный */
.log td.tier.hi, .tier-legend .hi { color: var(--t-a); }
.log td.tier.lo, .tier-legend .lo { color: var(--l); }
.log td.tier.eq, .tier-legend .eq { color: var(--t-c); }
.log td.tier.hi, .log td.tier.lo, .log td.tier.eq { font-weight: 700; }
.tier-legend { margin: 0; font-size: 12px; }
.tier-legend span { font-weight: 600; }
.chip.cmp-hi { background: var(--t-a); } .chip.cmp-lo { background: var(--l); } .chip.cmp-eq { background: var(--t-c); }
.res-pair { display: inline-flex; gap: 4px; }
.log .me { font-weight: 700; color: var(--accent); }

/* Rank editor */
details.panel > summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::after { content: "+"; font-family: var(--font-data); color: var(--muted); font-size: 18px; }
details[open].panel > summary::after { content: "−"; }
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 6px 14px; }
.players label { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.players label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.players select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }

.foot { font-size: 12px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px 16px; }
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  background: var(--panel-2); border: 1px solid var(--accent); color: var(--fg);
  padding: 10px 16px; border-radius: 10px; max-width: calc(100% - 32px); z-index: 20;
}
.toast.err { border-color: var(--l); }

/* User menu */
.user { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.user .who { display: inline-flex; align-items: center; gap: 6px; color: var(--fg); text-decoration: none; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.user .who:hover { border-color: var(--muted); }
.role { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); border: 1px solid var(--line); padding: 1px 6px; border-radius: 999px; }
.role.admin { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.role.editor { color: var(--w); border-color: color-mix(in srgb, var(--w) 50%, var(--line)); }
.role.advanced { color: var(--fg); }

/* Login */
.login-wrap { min-height: 100vh; min-height: 100dvh; box-sizing: border-box; display: grid; place-items: center; padding-block: 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.login { width: 100%; max-width: 380px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; display: grid; gap: 16px; }
.login h1 { font-size: 26px; }
.login p { margin: 0; color: var(--muted); }

/* Forms */
.form { display: grid; gap: 12px; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: 12px; color: var(--muted); }
.inp, .field select, .field textarea {
  width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; color: var(--fg); font: inherit; min-width: 0;
}
.field textarea { min-height: 76px; resize: vertical; }
.inp:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); outline: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-chip); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--l); border-color: color-mix(in srgb, var(--l) 45%, var(--line)); }
.btn.sm { padding: 3px 9px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.err { color: var(--l); font-size: 13px; margin: 0; }
.ok { color: var(--t-a); font-size: 13px; margin: 0; }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px 12px; align-items: end; }
.winner { display: flex; flex-wrap: wrap; gap: 6px; }
.winner label { flex: 1; white-space: nowrap; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; background: var(--panel-2); font-size: 13px; }
.winner input { accent-color: var(--w); }
.winner label:has(input:checked) { border-color: var(--w); color: var(--w); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.notice { font-size: 13px; color: var(--muted); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin: 0; }
.cols2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; align-items: start; }
.log.users-t { min-width: 0; }
.users-t td { vertical-align: middle; }
.users-t select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
.edit-only { display: none !important; }
body.can-edit .edit-only { display: revert !important; }
.mu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 6px; }
.mu-grid label { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); font-size: 13px; }
.mu-grid input { width: 52px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; color: var(--fg); text-align: right; font-family: var(--font-data); }
.maptiers select { background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 4px; color: var(--fg); }
.card .form .field textarea { min-height: 60px; }
.pager { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#dlPager:not(:empty) { margin-bottom: 10px; }
.log td.act { white-space: nowrap; }
.log td.act > * + * { margin-left: 6px; }
.loading { padding: 48px 0; text-align: center; color: var(--muted); }

@media (max-width: 900px) {
  .helper { grid-template-columns: 1fr; }
  .pick-pair { grid-template-columns: 1fr; }
  .top { gap: 10px; }
}
@media (max-width: 760px) {
  .bars { grid-template-columns: 1fr; }
  .side { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
  .side.kv { grid-template-columns: 64px 1fr; }
}
@media (prefers-reduced-motion: no-preference) {
  .pie circle.fg { transition: stroke-dasharray .35s ease; }
  .chart rect { transition: height .25s ease, y .25s ease; }
}

/* Тиры игроков (картинки 1–12) */
.ptier { display: inline-block; vertical-align: middle; object-fit: contain; }
.ptier-cell { display: inline-flex; align-items: center; gap: 8px; }
.rk-img { display: inline-flex; padding: 2px; border-radius: 6px; border: 1px solid transparent; opacity: .3; }
.rk-img.in { opacity: 1; border-color: var(--line); background: var(--panel); }
.log td.ptier-td { padding-top: 2px; padding-bottom: 2px; width: 34px; }
.version-bar { background: var(--l); color: #fff; padding: 10px 16px; text-align: center; font-weight: 600; position: sticky; top: 0; z-index: 30; }

/* Выпадающий список тиров игроков с картинками */
.tpick { display: inline-flex; align-items: center; gap: 8px; min-width: 120px; padding: 3px 8px 3px 4px; background: var(--panel-2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font: inherit; text-align: left; }
.tpick:hover, .tpick[aria-expanded="true"] { border-color: var(--accent); }
.tpick > span:not(.tpick-caret):not(.tpick-empty) { flex: 1; white-space: nowrap; }
.tpick-caret { color: var(--muted); font-size: 11px; }
.tpick-empty { display: inline-flex; justify-content: center; width: 24px; color: var(--muted); }
.tpick-menu { position: fixed; z-index: 1000; display: flex; flex-direction: column; max-height: min(520px, calc(100vh - 16px)); overflow-y: auto; min-width: 150px; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0, 0, 0, .35); }
.tpick-menu [role="option"] { flex: none; display: flex; align-items: center; gap: 10px; padding: 3px 10px 3px 4px; background: none; color: var(--fg); border: 0; border-radius: 6px; cursor: pointer; font: inherit; text-align: left; white-space: nowrap; }
.tpick-menu [role="option"] .tpick-empty { width: 32px; }
.tpick-menu [role="option"]:hover, .tpick-menu [role="option"]:focus-visible { background: var(--panel-2); outline: none; }
.tpick-menu [role="option"][aria-selected="true"] { box-shadow: inset 3px 0 0 var(--accent); background: var(--panel-2); font-weight: 600; }

/* Картинки карт и чемпионов */
.cimg { border-radius: 6px; object-fit: cover; vertical-align: middle; flex: none; background: var(--panel-2); }
.mimg { border-radius: 4px; object-fit: cover; flex: none; background: var(--panel-2); }
.with-img { display: inline-flex; align-items: center; gap: 8px; }
.matrix th.mh { vertical-align: bottom; }
.matrix th.mh .mimg { display: block; margin: 0 auto 4px; }
#chInfoTitle, #chEditTitle { display: flex; align-items: center; gap: 10px; }
.htab td.mid { background: color-mix(in srgb, var(--accent) 5%, transparent); }

/* Вкладка «Чемпионы» — как лист CHAMPS */
.ch-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.ch-form .field.wide { grid-column: span 2; }
.ch-form textarea { min-height: 80px; resize: vertical; }

/* Админ: картинки */
h3.sub { margin: 6px 0 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.img-tile { display: grid; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); justify-items: start; }
.img-tile .pic { width: 100%; aspect-ratio: 16 / 9; display: grid; place-items: center; border-radius: 6px; background: var(--bg); overflow: hidden; font-size: 12px; }
.img-tile.champ .pic { aspect-ratio: 1; width: 96px; }
.img-tile .pic img { width: 100%; height: 100%; object-fit: cover; }
.img-tile .actions { gap: 6px; }

/* Регистрация и свой игрок */
.login.reg { max-width: 560px; }
.login .alt a, .login .alt { font-size: 13px; }
.claim { display: grid; gap: 12px; }
.claim-step { display: grid; gap: 8px; }
.claim-list { display: flex; flex-wrap: wrap; gap: 6px; max-height: 210px; overflow-y: auto; padding: 2px; }
.claim-p { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-2); color: var(--fg); font: inherit; font-size: 13px; cursor: pointer; }
.claim-p:hover:not(:disabled) { border-color: var(--accent); }
.claim-p.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.claim-p:disabled { opacity: .45; cursor: not-allowed; }
.claim-p small { color: var(--muted); }
.claim-none { justify-self: start; }
.claim-none.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.claim-pick { padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); }
.claim-me { display: flex; align-items: center; gap: 12px; }
.claim-me > div { display: grid; gap: 2px; }
.claim-me b { font-size: 16px; }
.claim-tier { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
#mePlayer { display: grid; gap: 12px; }
.req-mine { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; }
.req-mine .st { font-size: 12px; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line); }
.req-mine .st.approved, td.ok-t { color: var(--w); }
.req-mine .st.rejected, td.bad-t { color: var(--l); }

/* Заявки */
.badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: var(--l); color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.req-t td { vertical-align: middle; }
.req-t td.act { white-space: nowrap; }

/* Название в шапке: QCDL+ — серебро, QCDL++ — золото, с переливом и подсветкой */
#brand.shine { background-size: 200% 100%; background-repeat: repeat-x; -webkit-background-clip: text; background-clip: text; color: transparent; animation: brand-shine 6s linear infinite; }
#brand.silver {
  background-image: linear-gradient(100deg, #8d96a3 0%, #dfe4ea 18%, #9aa3af 34%, #ffffff 50%, #a7b0bb 66%, #e9edf2 82%, #8d96a3 100%);
  filter: drop-shadow(0 0 6px rgba(214, 224, 238, .45));
}
#brand.gold {
  background-image: linear-gradient(100deg, #a4701b 0%, #f3cf6a 18%, #b8862a 34%, #fff2bd 50%, #c99632 66%, #f7d97c 82%, #a4701b 100%);
  filter: drop-shadow(0 0 8px rgba(244, 188, 66, .6));
}
@keyframes brand-shine { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
@media (prefers-reduced-motion: reduce) { #brand.shine { animation: none; } }
.user .who .ptier { margin-right: 2px; }

/* Discord */
/* Telegram: кнопки, окно с кодом, привязка в профиле */
.btn.tg { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: #229ed9; border-color: #229ed9; color: #fff; text-decoration: none; }
.btn.tg:hover { background: #1c88bb; border-color: #1c88bb; }
.btn.tg svg { width: 18px; height: 18px; }
.btn.tg.sm svg { width: 15px; height: 15px; }
.tg-or-line { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; }
.tg-or-line::before, .tg-or-line::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.tg-box { display: grid; gap: 10px; padding: 14px; border: 1px solid color-mix(in srgb, #229ed9 45%, var(--line)); border-radius: 12px; background: color-mix(in srgb, #229ed9 7%, var(--panel-2)); font-size: 13px; }
.tg-box > b { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.tg-box > b svg { width: 18px; height: 18px; color: #229ed9; }
.tg-box a { color: var(--link); }
.tg-row { display: flex; gap: 8px; }
.tg-row .inp { flex: 1; min-width: 0; }
.tg-code { font-family: var(--font-data); letter-spacing: .25em; }
.tg-code::placeholder { font-family: var(--font-body); letter-spacing: normal; }
.tg-box .err:empty, .tg-box .ok:empty { display: none; }
.tg-ok { display: flex; align-items: center; gap: 8px; border-color: color-mix(in srgb, var(--w) 45%, var(--line)); }
.tg-ok svg { width: 18px; height: 18px; flex: none; color: #229ed9; }
.acc-tg { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 13px; }
.acc-tg:empty { display: none; }
.tg-on { display: inline-flex; align-items: center; gap: 6px; }
.tg-on svg { width: 16px; height: 16px; color: #229ed9; }
.u-tg { display: inline-flex; align-items: center; gap: 4px; margin-left: 6px; color: var(--muted); }
.u-tg svg { width: 12px; height: 12px; color: #229ed9; }
.lg-forgot { margin-top: -6px !important; text-align: right; }
.rs-step { display: grid; gap: 8px; }
.rs-step[hidden] { display: none; }
.u-nopass { display: block; color: var(--l); }
.reg-pass { display: grid; gap: 16px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.steps a { color: var(--accent); }
.grid-form .field.wide { grid-column: 1 / -1; }
td.ok-t, span.ok-t { color: var(--w); }

/* Игроки с тем же тиром */
.peers { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.peers .ptier { flex: none; margin-top: 1px; }
.peers b { color: var(--fg); font-weight: 500; }

/* Кто и когда добавил: кнопка открывает окно */
.log th.src-h, .log td.src { width: 26px; padding-left: 4px; padding-right: 0; }
.src-mark { display: inline-grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: 6px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); cursor: pointer; }
.src-mark.imp { border-color: var(--line); background: transparent; color: var(--muted); }
.src-mark:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--fg); }
.src-mark svg { width: 13px; height: 13px; }
/* Игра: дуэли, добавленные за раз, — заголовок со счётом и полоса слева */
.log tr.g-head td { padding-top: 10px; padding-bottom: 6px; border-top: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: var(--panel-2); font-size: 13px; }
.log tr.g-head td:first-child, .log tr.g-row td:first-child { box-shadow: inset 3px 0 0 color-mix(in srgb, var(--accent) 55%, transparent); }
.log tr.g-row td { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.log tr.g-last td { border-bottom: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.log tr.g-last + tr:not(.g-head) td { padding-top: 10px; }
.g-tag { display: inline-block; margin-right: 10px; padding: 1px 7px; border-radius: 5px; background: var(--active); color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.g-score { display: inline-block; margin: 0 8px; font-weight: 700; font-variant-numeric: tabular-nums; }
b.pl1 { color: var(--p1-text); } b.pl2 { color: var(--p2-text); }
.warn-t { color: #eab308; } span.bad-t { color: var(--l); }
/* Окно (диалог) */
.dlg { max-width: min(760px, calc(100vw - 32px)); max-height: calc(100vh - 64px); padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); color: var(--fg); box-shadow: 0 20px 60px rgba(0, 0, 0, .5); }
.dlg::backdrop { background: rgba(0, 0, 0, .55); }
.dlg form { display: flex; flex-direction: column; gap: 12px; padding: 18px 20px; max-height: calc(100vh - 66px); }
.dlg h2 { margin: 0; font-size: 17px; }
.dlg #dlgBody { overflow: auto; font-size: 14px; }
.dlg #dlgBody p { margin: 0 0 10px; }
.dlg .actions { justify-content: flex-end; }
.info-facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0 0 14px; }
.info-facts dt { color: var(--muted); }
.info-facts dd { margin: 0; }
.info-duels { width: 100%; border-collapse: collapse; font-size: 13px; }
.info-duels td { padding: 5px 8px; border-top: 1px solid var(--line); white-space: nowrap; }
.info-duels td.r { text-align: right; } .info-duels td.c { text-align: center; }
.dup-pairs tr.dp-a td { border-top: 2px solid color-mix(in srgb, var(--accent) 30%, var(--line)); }
.dup-pairs tr.dp-b td { border-top: 1px dashed var(--line); }
.req-dupes { margin-top: 4px; font-size: 13px; }
.req-dupes summary { cursor: pointer; color: #eab308; }
.req-dupes .info-duels { margin-top: 6px; }

/* Расшифровка названия под QCDL */
.brand-name { display: grid; gap: 2px; }
.brand-sub { font-size: 10px; letter-spacing: .06em; color: var(--muted); white-space: nowrap; }
.login .brand-sub { font-size: 11px; }

/* ================= Оформление 2.0: современный тёмный, синий игрок против красного ================= */
body {
  background:
    radial-gradient(900px 500px at 15% -10%, var(--glow-1), transparent 60%),
    radial-gradient(900px 500px at 90% -10%, var(--glow-2), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}
.wrap { max-width: 1320px; }
h1, h2 { font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 17px; font-weight: 600; text-transform: none; letter-spacing: -.01em; }
a { color: var(--link); }

/* Шапка: название слева, меню-капсула, активный раздел серый */
.top { padding-bottom: 16px; border-bottom: 1px solid var(--line); }
#brand { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.brand-sub { font-size: 10.5px; letter-spacing: .04em; }
.nav { background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; padding: 4px; gap: 2px; }
.nav a { border: 0; border-radius: 8px; padding: 7px 16px; font-size: 13.5px; }
.nav a:hover { color: var(--fg); background: var(--panel-2); }
.nav a[aria-current="page"] { background: var(--active); color: var(--fg); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08), 0 1px 2px rgba(0, 0, 0, .35); }
.user .who { border-radius: 12px; background: var(--panel-2); padding: 6px 12px; }
.role.admin, .role.editor { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }
.role.advanced { color: #c7cdd6; }
.badge { background: var(--p2); }

/* Подразделы — плашки */
.subnav { border: 0; gap: 6px; margin-top: -4px; padding: 0; }
.subnav a { border: 0; border-radius: 8px; padding: 6px 12px; font-size: 13.5px; }
.subnav a:hover { background: var(--panel-2); }
.subnav a[aria-current="page"] { background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); color: var(--fg); font-weight: 600; }

/* Панели */
.panel { border-radius: 18px; padding: 22px; background: var(--panel); backdrop-filter: blur(10px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04), 0 20px 40px -24px rgba(0, 0, 0, .6); }
.notice { border-radius: 12px; }
.pie, .pick-win, .card, .claim-pick, .img-tile, .tile, .rankbox { border-radius: 14px; }

/* Кнопки, списки, поля */
.btn { border-radius: 10px; background: var(--panel-2); padding: 7px 13px; }
.btn:hover { border-color: color-mix(in srgb, var(--fg) 25%, transparent); }
.btn.primary { background: var(--primary-bg); border-color: var(--primary-bg); color: var(--primary-fg); }
.btn.star { --star: var(--w); }
.btn.on { border-color: var(--fg); color: var(--fg); }
.seg { border-radius: 12px; padding: 3px; gap: 2px; background: var(--panel-2); }
.seg button { border-radius: 9px; padding: 6px 12px; }
.seg button[aria-pressed="true"] { background: var(--active); box-shadow: none; color: var(--fg); }
.sel { border-radius: 10px; background-color: var(--panel-2); }
.sel option, .field select option { background: var(--panel-solid); color: var(--fg); }
.inp, .field select, .field textarea, .search { border-radius: 10px; }
.inp:focus, .field select:focus, .field textarea:focus, .search:focus { border-color: color-mix(in srgb, var(--fg) 40%, transparent); outline: none; }
.toast, .tpick-menu { background: var(--panel-solid); }
.toast { border-color: var(--line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4); }
.tpick { border-radius: 10px; }
.tpick-menu { border-radius: 12px; }

/* Сравнение: строка игрока 1 синяя, игрока 2 красная */
.cmp { border-collapse: separate; border-spacing: 0 8px; }
.cmp th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.cmp td { padding: 11px 8px; }
.cmp tbody tr.r1 td, .cmp tbody tr.r2 td { background: transparent; border-radius: 0; }
.cmp tbody tr.r1 { background: var(--p1-soft); }
.cmp tbody tr.r2 { background: var(--p2-soft); }
.cmp tbody tr td:first-child { border-radius: 14px 0 0 14px !important; }
.cmp tbody tr td:last-child { border-radius: 0 14px 14px 0 !important; }
.cmp tbody tr.r1 td:first-child { box-shadow: inset 3px 0 0 var(--p1); }
.cmp tbody tr.r2 td:first-child { box-shadow: inset 3px 0 0 var(--p2); }
.cmp td.sep { border-left: 0; }
.cmp td.v { font-family: var(--font-body); font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sel.p1, .sel.p2 { border-radius: 10px; color: #fff; font-weight: 700; border-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23ffffff'/%3E%3C/svg%3E"); }
.sel.p1 { background-color: var(--p1); box-shadow: 0 6px 18px -8px var(--p1); }
.sel.p2 { background-color: var(--p2); box-shadow: 0 6px 18px -8px var(--p2); }
.chip { border-radius: 8px; font-family: var(--font-body); font-weight: 700; }
.leg i { border-radius: 50%; }
.res { font-family: var(--font-body); font-weight: 700; color: #fff; }
.res.W { background: #10b981; } .res.L { background: #e11d48; }

/* Списки дуэлей */
.log th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.log tbody tr:hover td { background: var(--panel-2); }
.log td.pl1 { color: var(--p1-text); font-weight: 600; }
.log td.pl2 { color: var(--p2-text); font-weight: 600; }
.log .me { color: var(--fg); background: color-mix(in srgb, var(--fg) 8%, transparent); }
.pick-win.r1 { border-top: 0; box-shadow: inset 0 3px 0 var(--p1); }
.pick-win.r2 { border-top: 0; box-shadow: inset 0 3px 0 var(--p2); }
.card h3, .tile b { font-weight: 700; }

/* Подсветка иконок тиров: от голубых до рубинового — цветом самой иконки */
.ptier.pt6 { filter: drop-shadow(0 0 3px rgba(95, 208, 234, .9)) drop-shadow(0 0 8px rgba(95, 208, 234, .55)); }
.ptier.pt7 { filter: drop-shadow(0 0 3px rgba(79, 198, 232, .9)) drop-shadow(0 0 9px rgba(79, 198, 232, .6)); }
.ptier.pt8 { filter: drop-shadow(0 0 3px rgba(255, 111, 224, .9)) drop-shadow(0 0 9px rgba(255, 111, 224, .55)); }
.ptier.pt9 { filter: drop-shadow(0 0 3px rgba(209, 76, 255, .95)) drop-shadow(0 0 10px rgba(209, 76, 255, .6)); }
.ptier.pt10 { filter: drop-shadow(0 0 3px rgba(255, 90, 58, .9)) drop-shadow(0 0 10px rgba(255, 90, 58, .55)); }
.ptier.pt11 { filter: drop-shadow(0 0 3px rgba(255, 59, 59, .95)) drop-shadow(0 0 11px rgba(255, 59, 59, .6)); }
.ptier.pt12 { filter: drop-shadow(0 0 4px rgba(230, 16, 52, 1)) drop-shadow(0 0 12px rgba(230, 16, 52, .7)); }
.rk-img { border-radius: 9px; }

/* Вход и регистрация */
.login { border-radius: 18px; background: var(--panel); backdrop-filter: blur(10px); box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7); }
.login h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }

/* Переключатель темы под кнопкой профиля */
.user { flex-direction: column; align-items: flex-end; gap: 6px; }
.theme-sw { display: inline-flex; padding: 2px; gap: 2px; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); }
.theme-sw button { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 11.5px; cursor: pointer; }
.theme-sw button svg { width: 12px; height: 12px; }
.theme-sw button:hover { color: var(--fg); }
.theme-sw button[aria-pressed="true"] { background: var(--active); color: var(--fg); }
/* язык и тема рядом */
.sw-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.lang-sw button { font-weight: 600; letter-spacing: .02em; }
.login-lang { justify-self: end; margin-bottom: -8px; }

/* «Смотреть сайт как» */
.viewas-bar { position: sticky; top: 0; z-index: 40; display: flex; justify-content: center; align-items: center; gap: 12px; padding: 8px 16px; background: color-mix(in srgb, var(--gold) 22%, var(--panel-solid)); border-bottom: 1px solid color-mix(in srgb, var(--gold) 50%, transparent); font-size: 13px; }
.viewas { gap: 6px; }
.viewas .seg { justify-self: start; flex-wrap: wrap; }


/* Профиль игрока */
a.plink { color: inherit; text-decoration: none; font-weight: 600; }
a.plink:hover { color: var(--link); text-decoration: underline; }
.pp-head { display: flex; align-items: center; gap: 16px; }
.pp-head > div { display: grid; gap: 4px; }
.pp-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.pp-tier { margin-top: 4px; }
.pp-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pp-stats > div { display: grid; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.pp-stats > div > span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.pp-stats b { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pp-stats b .with-img { font-size: 16px; }
.pp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 18px; align-items: start; }
/* Турниры: игроки шире (без прокрутки), карты уже */
@media (min-width: 1100px) { .ts-cols { grid-template-columns: 1.45fr 1.1fr .75fr; } }
.pp-full[hidden] { display: none; }
.ev-wsel { min-width: 150px; }
.pp-t { min-width: 0; }
.pp-t td.r, .pp-t th.r { text-align: right; }
.pp-acc { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 24px; }
.pp-acc > div { display: grid; gap: 2px; }
.pp-acc .field select { min-width: 220px; }

/* Название в светлой теме: золото и серебро темнее, чтобы читались на белом */
:root[data-theme="light"] #brand.gold {
  background-image: linear-gradient(100deg, #7a4f0c 0%, #b8862a 20%, #8a5a0f 38%, #d9a536 50%, #8f6012 66%, #c08d2e 82%, #7a4f0c 100%);
  filter: drop-shadow(0 0 5px rgba(201, 150, 50, .35));
}
:root[data-theme="light"] #brand.silver {
  background-image: linear-gradient(100deg, #4b5563 0%, #8b95a3 20%, #556070 38%, #a3adba 50%, #5b6676 66%, #8f99a6 82%, #4b5563 100%);
  filter: drop-shadow(0 0 4px rgba(120, 130, 145, .35));
}

/* ===== 2.2 ===== */
/* полоса прокрутки всегда занимает место — страница не сдвигается, когда прокрутка появляется или исчезает */
html { scrollbar-gutter: stable; }
/* выпадающие списки — в цветах темы */
select option, select optgroup { background-color: var(--panel-solid); color: var(--fg); }
.maptiers select, .players-t select, .users-t select { background-color: var(--panel-solid); color: var(--fg); border-radius: 8px; }

/* «кор.» и «ср. по картам» под чипом не сдвигают строку */
.cmp td { position: relative; }
.cmp td .delta { position: absolute; left: 0; right: 0; bottom: 2px; margin: 0; font-size: 10px; line-height: 1; }

/* основной тир-лист */
.tl-main { color: var(--fg); font-weight: 600; text-decoration: none; border-bottom: 1px dashed var(--muted); }
.tl-main:hover { color: var(--link); border-color: var(--link); }
.tl-main.empty { color: var(--l); border-color: var(--l); }
.tl-is-main { display: inline-flex; align-items: center; padding: 6px 12px; border-radius: 10px; border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent); color: var(--gold); font-size: 13px; font-weight: 600; }

/* «Моя БД» над числом дуэлей; ширина подписи постоянная, чтобы меню не прыгало */
.brand { align-items: center; }
.brand .tag { display: block; min-width: 200px; line-height: 1.3; white-space: nowrap; } /* «Моя БД» в той же строке, что и число дуэлей: шапка не меняет высоту */
.tag-scope { font-family: var(--font-body); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--p1-text); }

/* список дуэлей: игрок 1 и его чемпион по правому краю, иконки тира ближе к никам, W и L одной ширины */
.log th.rt, .log td.rt { text-align: right; }
.log th.ptier-h, .log td.ptier-td { width: 28px; padding-left: 2px; padding-right: 2px; }
.res { display: inline-block; width: 24px; padding: 2px 0; text-align: center; }

/* цвета тиров чемпионов, как в таблице */
.tc-dm, .tc-d, .tc-dp { background: #3d3d3d; color: #fff; }
.tc-cm, .tc-c { background: #777777; color: #fff; }
.tc-cp { background: #aa0100; color: #fff; }
.tc-bm { background: #fce6a1; color: #5c4400; }
.tc-b { background: #fbe61a; color: #4d4300; }
.tc-bp { background: #f9ba10; color: #4a3200; }
.tc-Am { background: #d5eebd; color: #24502a; }
.tc-A { background: #4cae80; color: #fff; }
.tc-Ap { background: #24744c; color: #fff; }
.tc-Sm { background: #e5cef1; color: #4a2470; }
.tc-S, .tc-Sp { background: #592f85; color: #fff; }


/* роль lvl2 — как редактор */
.role.expert { color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); }


/* Добавление дуэлей: строка после пик-банов и таблица строк */
.paste-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 12px; align-items: end; }
.paste-row .inp { font-family: var(--font-data); font-size: 12.5px; }
.paste-note { margin: 0; font-size: 13px; color: var(--w); }
.paste-note.bad { color: var(--t-c); }
.duel-rows { width: auto; min-width: 0; border-collapse: separate; border-spacing: 0 6px; }
.duel-rows th { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 500; text-align: left; padding: 0 6px; }
.duel-rows th.rt { text-align: right; } .duel-rows th.c { text-align: center; }
.duel-rows td { padding: 0 4px; }
.duel-rows td.rt { text-align: right; } .duel-rows td.c { text-align: center; width: 64px; }
.duel-rows td.rt .with-img { justify-content: flex-end; }
.duel-rows .cell { background: var(--panel-solid); border: 1px solid var(--line); border-radius: 9px; padding: 6px 8px; color: var(--fg); font: inherit; font-size: 13px; min-width: 0; }
.duel-rows select.cell { max-width: 150px; }
.duel-rows input.cell { width: 150px; }
.duel-rows input.cell.rt { text-align: right; }
.duel-rows .cell.bad, .wl.bad { border-color: var(--l); box-shadow: 0 0 0 1px var(--l); }
/* формат не выбран — дуэль добавится, но ячейка мигает, чтобы про неё не забыли */
@keyframes fmt-pulse { 0%, 100% { box-shadow: 0 0 0 1px var(--t-c); } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--t-c) 25%, transparent); } }
.duel-rows .cell[data-k="fmt"]:invalid { border-color: var(--t-c); color: var(--t-c); animation: fmt-pulse 1.6s ease-in-out infinite; }
.fmt-need { display: inline-block; padding: 1px 8px; border-radius: 6px; border: 1px solid var(--t-c); color: var(--t-c); font-size: 12px; animation: fmt-pulse 1.6s ease-in-out infinite; }
/* в ещё пустой строке не мигает */
.duel-rows tr:has([data-k="p1"]:placeholder-shown):has([data-k="p2"]:placeholder-shown) .cell[data-k="fmt"]:invalid { animation: none; border-color: var(--line); color: inherit; }
@media (prefers-reduced-motion: reduce) { .duel-rows .cell[data-k="fmt"]:invalid, .fmt-need { animation: none; } }
.wl { width: 56px; padding: 6px 0; border: 1px solid var(--line); border-radius: 9px; background: var(--panel-2); color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.wl:hover { border-color: color-mix(in srgb, var(--fg) 30%, transparent); color: var(--fg); }
.wl.W { background: #10b981; border-color: #10b981; color: #fff; }
.wl.L { background: #e11d48; border-color: #e11d48; color: #fff; }
#fHint { font-size: 12px; }

/* Форма дуэлей: новые игроки и неиграемые карты Турнира */
.duel-rows .cell.newnick { border-color: var(--t-c); box-shadow: 0 0 0 1px var(--t-c); }
.duel-rows tr.off td { opacity: .32; }
.duel-rows tr.off .wl { cursor: not-allowed; }
.newp { display: grid; gap: 8px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--t-c) 45%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--t-c) 7%, transparent); }
.newp > b { font-size: 13px; color: var(--t-c); }
.newp-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-size: 13px; }
.newp-nick { font-weight: 700; min-width: 120px; }

/* Раскрывающийся список игроков в форме дуэлей */
.nick-menu { max-height: min(360px, calc(100vh - 16px)); }
.nick-menu [role="option"][aria-selected="true"] { box-shadow: inset 3px 0 0 var(--p1); }
.nick-none { padding: 8px 12px; font-size: 13px; color: var(--t-c); white-space: nowrap; }

/* Переименование игрока */
.ren-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--muted); cursor: pointer; vertical-align: middle; opacity: .55; }
.ren-btn svg { width: 13px; height: 13px; }
.ren-btn:hover, .ren-btn:focus-visible { opacity: 1; color: var(--fg); background: var(--panel-2); }
.pl-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.pl-sort { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; }
#plDir { min-width: 136px; }
#plHead th[data-sort] { cursor: pointer; user-select: none; }
#plHead th[data-sort]:hover { color: var(--fg); }
#plHead th.sorted { color: var(--accent); }
#plHead th.sorted::after { content: " ↓"; }
#plHead th.sorted[aria-sort="ascending"]::after { content: " ↑"; }
.del-btn:hover, .del-btn:focus-visible { color: var(--l); }
.pl-add { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin: 12px 0 4px; font-size: 13px; }
.pl-add .inp { width: 200px; padding: 5px 8px; }
.pl-add .err:empty { display: none; }
.ren { display: inline-flex; align-items: center; gap: 6px; }
.ren .inp { width: 170px; padding: 4px 8px; }

/* Раскрывающиеся списки чемпионов и игроков с картинками (кнопка поверх скрытого select) */
.fs-src { display: none !important; }
.fsel { display: inline-flex; align-items: center; gap: 8px; font: inherit; color: var(--fg); text-align: left; cursor: pointer; vertical-align: middle; }
.fsel .fs-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fsel .cimg, .fsel .ptier { flex: none; margin: -3px 0; }
.fsel .cimg { border-radius: 5px; }
.fsel .fs-noimg { display: none; }
.fsel:disabled { opacity: .55; cursor: not-allowed; }
.fsel.cell { background: var(--panel-solid) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238b95ab'/%3E%3C/svg%3E") no-repeat right 8px center; padding-right: 24px; }
.duel-rows .fsel.cell { width: 150px; }
.fsel-menu { overflow: hidden; }
.fsel-menu .fs-list { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.fsel-menu .fs-search { flex: none; margin: 2px 2px 6px; padding: 6px 10px; font-size: 13px; }
.fsel-menu .fs-noimg { flex: none; width: 22px; }
.fsel-menu { max-height: min(340px, calc(100vh - 16px)); font-size: 13px; }
.fsel-menu [role="option"] { gap: 8px; padding-top: 2px; padding-bottom: 2px; }
.fsel-menu [role="option"] .cimg { width: 22px; height: 22px; }
.fsel-menu .cimg { border-radius: 5px; }

/* Тиры: режим редактирования в матрице */
.btn.edit-mode svg { width: 15px; height: 15px; }
.btn.edit-mode.on { background: color-mix(in srgb, var(--w) 18%, var(--panel-2)); border-color: color-mix(in srgb, var(--w) 55%, transparent); color: var(--fg); }
.edit-on { color: var(--w); }
.matrix th.mh { cursor: pointer; }
.matrix th.mh.cur span { color: var(--fg); }
.matrix th.mh.cur .mimg { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.matrix td.tcell.cur { box-shadow: inset 0 0 0 2px var(--accent); border-radius: 6px; }
.matrix.editing td.tcell { cursor: cell; }
.matrix.editing td.tcell:hover { background: color-mix(in srgb, var(--w) 14%, transparent); }
.matrix.editing td.tcell:focus-visible { outline: 2px solid var(--w); outline-offset: -2px; }
.matrix.editing { box-shadow: 0 0 0 1px color-mix(in srgb, var(--w) 35%, transparent); border-radius: 10px; }
.cell-menu { padding: 8px; gap: 6px; min-width: 0; }
.cell-menu-head { display: flex; align-items: center; gap: 8px; padding: 0 2px 4px; font-size: 13px; }
.cell-menu-grid { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; }
.cell-menu [role="option"] { padding: 3px; justify-content: center; }
.cell-menu [role="option"] .chip { min-width: 38px; text-align: center; }
.cell-menu [role="option"][aria-selected="true"] { box-shadow: inset 0 0 0 2px var(--accent); }

/* Матчапы на карте */
#muTitle { display: flex; align-items: center; gap: 12px; }
#muTitle .mimg { border-radius: 6px; }
.mu-t td.first .cimg { border-radius: 6px; }
.mu-t td:last-child { text-align: left; }
.mu-t th:last-child { text-align: left; }
/* Подсветка сильнейшего: синий — чемпион 1, красный — чемпион 2, жёлтый — равны */
.htab td.adv { background: linear-gradient(90deg, color-mix(in srgb, var(--ac) 26%, transparent), color-mix(in srgb, var(--ac) 5%, transparent) 80%); box-shadow: inset 3px 0 0 var(--ac); }
.htab td.adv.r { background: linear-gradient(270deg, color-mix(in srgb, var(--ac) 26%, transparent), color-mix(in srgb, var(--ac) 5%, transparent) 80%); box-shadow: inset -3px 0 0 var(--ac); }
.htab td.adv.a { --ac: var(--p1); } .htab td.adv.b { --ac: var(--p2); } .htab td.adv.eq { --ac: var(--t-c); }
.mod-v { display: inline-block; min-width: 28px; font-family: var(--font-data); font-variant-numeric: tabular-nums; }
.mod-v.pos { color: var(--w); } .mod-v.neg { color: var(--l); }
.mod-step { display: inline-flex; align-items: center; gap: 6px; }
.mod-step .btn.sm { width: 26px; height: 26px; padding: 0; justify-content: center; font-weight: 700; }

/* Сравнение двух чемпионов */
.vs { color: var(--muted); font-weight: 700; font-size: 12px; text-transform: uppercase; }
.cmp2 th.hc-a, .cmp2 th.hc-b { white-space: nowrap; }
.cmp2 th .cimg { vertical-align: middle; margin: 0 6px; border-radius: 5px; }
.cmp2 tr.total td { border-top: 2px solid var(--line); font-weight: 700; background: var(--panel-2); }

/* Таблицы дуэлей: значки карт и портреты чемпионов */
td.map-c { white-space: nowrap; }
.map-c .map-name { margin-right: 6px; }
.mbadge { vertical-align: middle; margin-left: 2px; filter: drop-shadow(0 0 3px rgba(34, 197, 94, .35)); }
.mbadge.rail { margin-left: 4px; filter: none; }
td.ch-c { white-space: nowrap; }
td.ch-c .with-img { gap: 6px; }
td.ch-c .cimg { border-radius: 5px; }
td.rt.ch-c .with-img { justify-content: flex-end; }

/* Доп. фильтр — зелёная звёздочка */
.btn.star { gap: 6px; padding-left: 10px; padding-right: 10px; }
.btn.star .star-img { width: 22px; height: auto; transition: filter .15s, opacity .15s; opacity: .8; }
.btn.star:hover .star-img, .btn.star.active .star-img { opacity: 1; }
.btn.star.active .star-img { filter: drop-shadow(0 0 6px rgba(34, 197, 94, .8)); }
.btn.star.ignored .star-img { opacity: 1; filter: hue-rotate(225deg) saturate(1.6) drop-shadow(0 0 5px rgba(239, 68, 68, .7)); }
.btn.star:disabled .star-img { filter: grayscale(1); }

/* Профиль игрока: доступ к тир-листам */
.pp-lists { display: grid; gap: 8px; margin-top: 14px; }
.pp-list-grid { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.chk { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.chk input { width: 16px; height: 16px; accent-color: var(--w); }


/* Профиль игрока: форма, тепловая карта */
.pp-form { display: flex; flex-wrap: wrap; gap: 8px; }
.pp-game { display: grid; grid-template-columns: auto auto; align-items: center; gap: 2px 8px; min-width: 120px; padding: 8px 10px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; background: var(--panel-2); }
.pp-game.w { border-left-color: var(--w); }
.pp-game.l { border-left-color: var(--l); }
.pp-game > b { font-size: 16px; }
.pp-game.w > b { color: var(--w); }
.pp-game.l > b { color: var(--l); }
.pp-game .pp-opp, .pp-game .pp-champs { grid-column: 1 / -1; font-size: 13px; }
.pp-game .pp-champs { display: flex; gap: 2px; }
.heat { border-collapse: separate; border-spacing: 3px; }
.heat th { font-size: 12px; font-weight: 600; color: var(--muted); text-align: left; white-space: nowrap; padding: 2px 6px; }
.heat thead th { text-align: center; }
.heat td { min-width: 54px; padding: 4px 6px; text-align: center; border-radius: 6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.heat td b { display: block; font-size: 13px; }
.heat td small { font-size: 11px; color: var(--muted); }
.heat td.h-empty { background: color-mix(in srgb, var(--line) 35%, transparent); }
.heat tbody th { color: var(--fg, inherit); }

/* Турниры: выбор серии, метка выпуска, привязка игр */
.tour-row { display: flex; flex-wrap: wrap; align-items: end; gap: 10px 16px; margin: 4px 0 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); }
.tour-row .field[hidden] { display: none; }
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { background: transparent; color: var(--fg); border: 0; border-right: 1px solid var(--line); padding: 8px 14px; font: inherit; font-size: 14px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--active); }
.seg button.muted { color: var(--muted); }
.seg button.on { background: var(--fg); color: var(--bg); font-weight: 700; }
.tour-num { display: inline-flex; align-items: center; gap: 6px; }
.tour-num b { font-size: 18px; color: var(--muted); }
.tour-num input { width: 90px; }
.tour-sum { display: grid; gap: 2px; font-size: 13px; align-self: center; }
.tour-sum b { font-size: 16px; }
.t-tag { display: inline-block; padding: 1px 8px; margin-right: 6px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; text-decoration: none;
  background: color-mix(in srgb, var(--w) 18%, transparent); color: var(--w); }
.t-tag:hover { background: color-mix(in srgb, var(--w) 30%, transparent); }
.fmt-c .t-tag { margin: 0 0 0 4px; }
.bind-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 10px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--w) 50%, var(--line)); border-radius: 12px;
  background: color-mix(in srgb, var(--w) 10%, var(--panel-solid)); position: sticky; top: 8px; z-index: 5; box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }
.bind-bar[hidden] { display: none; }
.bind-bar input { width: 80px; }
td.sel-c, th.sel-c { width: 28px; padding-right: 0; text-align: center; }
.tchk { width: 16px; height: 16px; accent-color: var(--w); cursor: pointer; vertical-align: middle; }
.ev-head > div { display: grid; gap: 4px; }
.ev-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.ev-win { margin-top: 6px; max-width: 260px; }
.ev-date { font-size: 15px; }
.pp-stats small { font-size: 12px; }
.ev-card { text-decoration: none; color: inherit; }
.ev-card:hover { border-color: var(--muted); }
#tsSeries { margin-left: auto; }

/* Графики: подсветка столбца при наведении, винрейт под чемпионом, окошко по клику */
.chart .hit { fill: transparent; }
.chart .bar-g:hover .hit, .chart .bar-g.sel .hit { fill: color-mix(in srgb, var(--fg) 8%, transparent); }
.chart .bar-g:hover .bar, .chart .bar-g.sel .bar { filter: brightness(1.25); }
.chart .bar-g:hover .lbl, .chart .bar-g.sel .lbl { font-weight: 700; }
#pcSvg .bar-g { cursor: default; }
.bar-pop { pointer-events: none; }
/* «Моя БД»: проставить результат уже добавленной дуэли */
.res-set { width: 24px; height: 22px; padding: 0; border: 1px dashed var(--line); border-radius: 5px; background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.res-set:hover:not(:disabled) { border-style: solid; border-color: var(--w); color: var(--w); background: color-mix(in srgb, var(--w) 14%, transparent); }
.chart .sub { font-family: var(--font-data); font-size: 10px; font-weight: 600; }
.legend .muted { font-size: 12px; }
.bar-pop { position: fixed; z-index: 60; min-width: 220px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-solid); box-shadow: 0 12px 32px rgba(0, 0, 0, .45); }
.bar-pop[hidden] { display: none; }
.bp-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.bp-head > div { display: grid; gap: 2px; }
.bp-head b { font-size: 16px; }
.bp-head .muted { font-size: 12px; }
.bp-kv { display: grid; grid-template-columns: auto auto; gap: 4px 16px; margin: 0; font-variant-numeric: tabular-nums; }
.bp-kv dt { color: var(--muted); font-size: 13px; }
.bp-kv dd { margin: 0; text-align: right; font-weight: 700; }
.bp-kv .bp-wr { font-size: 18px; }
.bp-bar { height: 6px; margin-top: 10px; border-radius: 3px; background: var(--l); overflow: hidden; }
.bp-bar i { display: block; height: 100%; background: var(--w); }
.pick-empty { display: grid; gap: 4px; padding: 18px 20px; text-align: center; font-size: 14px; border-style: dashed; }
.pick-empty b { font-size: 16px; color: var(--fg); }
.pick-empty[hidden] { display: none; }
/* списки в таблице сравнения постоянной ширины: длинный ник или имя не сдвигает колонки */
.cmp .fsel, .cmp select.sel { width: 168px; max-width: 168px; }
.cmp .fsel.p1, .cmp .fsel.p2 { width: 200px; max-width: 200px; }
.cmp #t1, .cmp #t2 { width: 64px; min-width: 64px; }
.cmp #tc1, .cmp #tc2 { width: 96px; min-width: 96px; }

/* блокировка пользователя */
.blk-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: color-mix(in srgb, var(--l) 18%, transparent); color: var(--l); font-size: 11px; font-weight: 600; vertical-align: middle; cursor: help; }
.users-t tr.blocked td:first-child { color: var(--muted); }
.blk-note { margin: 8px 0 0; color: var(--l); font-size: 13px; }
.users-t td.act { display: table-cell; }
.u-acts { display: flex; flex-direction: column; align-items: stretch; gap: 6px; }
.u-acts .btn { width: 100%; white-space: nowrap; justify-content: center; }
.u-acts .inp { width: 150px; padding: 3px 8px; }
.users-t td:nth-child(4) { white-space: nowrap; }
.users-t td:nth-child(3) { white-space: normal; line-height: 1.9; }
.cup { display: inline-block; vertical-align: middle; flex: none; filter: drop-shadow(0 0 3px rgba(245, 197, 66, .45)); }
.cup-w { display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }

/* кнопка «На оплату хостинга» над числом дуэлей */
.brand-meta { display: grid; gap: 6px; justify-items: start; min-width: 260px; } /* постоянная ширина: строка «Моя БД · …» не сдвигает меню */
.btn.donate { text-decoration: none; color: var(--gold); border-color: color-mix(in srgb, var(--gold) 55%, transparent); font-weight: 600; }
/* полоска сбора над кнопкой; кнопка рядом с ней — компактнее */
.goal { display: grid; gap: 3px; width: 240px; max-width: 100%; color: var(--fg); text-decoration: none; font-size: 12px; line-height: 1.2; }
.goal .g-head { display: flex; justify-content: space-between; gap: 8px; }
.goal .g-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal .g-sum { font-family: var(--font-data); color: var(--muted); white-space: nowrap; }
.goal .g-track { display: block; height: 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.goal .g-fill { display: block; height: 100%; background: linear-gradient(90deg, color-mix(in srgb, var(--gold) 70%, #000), var(--gold)); border-radius: 3px; }
a.goal[href]:hover .g-title { color: var(--gold); }
.goal:not([hidden]) + .btn.donate { padding: 2px 8px; font-size: 11px; }
.btn.donate:hover { background: color-mix(in srgb, var(--gold) 14%, transparent); }

/* Чемпионы: карточки по классам */
.ch-groups { display: grid; gap: 22px; }
.ch-group { display: grid; gap: 12px; }
.ch-gh { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 500; }
.chc-cls { --c: var(--muted); display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--c); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); background: color-mix(in srgb, var(--c) 12%, transparent); }
.chc-cls[data-cls="Light"] { --c: var(--t-b); }
.chc-cls[data-cls="Mid"] { --c: var(--gold); }
.chc-cls[data-cls="Heavy"] { --c: var(--l); }
.ch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: 12px; }
.chc { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel-2); min-width: 0; }
.chc.cur { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.chc-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.chc-head .cimg { border-radius: 12px; flex: none; }
.chc-name { display: grid; gap: 5px; justify-items: start; min-width: 0; }
.chc-name b { font-family: var(--font-display); font-size: 17px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
button.chc-head { width: 100%; padding: 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-align: left; }
button.chc-head svg { width: 15px; height: 15px; margin-left: auto; color: var(--muted); opacity: .35; transition: opacity .15s; flex: none; }
button.chc-head:hover svg, button.chc-head:focus-visible svg { opacity: 1; }
button.chc-head:hover b { text-decoration: underline; }
.chc-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chs { display: grid; gap: 4px; padding: 7px 7px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); min-width: 0; }
.chs-l { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chs-l img { flex: none; opacity: .85; }
.chs b { font-family: var(--font-data); font-size: 11.5px; font-weight: 600; letter-spacing: -.02em; }
.chs b .sep { font-style: normal; color: var(--muted); font-weight: 400; }
.chc-ab { padding: 9px 10px; border-radius: 9px; border: 1px solid var(--line); }
.chc-ab h4 { margin: 0 0 4px; font-size: 10.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.chc-ab p { margin: 0; font-size: 13px; line-height: 1.4; white-space: pre-line; overflow-wrap: anywhere; }
/* цвета ячеек из таблицы: в тёмной теме — приглушённые */
.chc [data-cf] { background: color-mix(in srgb, var(--cf) 22%, #15171c); border-color: color-mix(in srgb, var(--cf) 40%, transparent); }
.chc [data-cf] .chs-l, .chc [data-cf] h4, .chc [data-cf] .sep { color: color-mix(in srgb, var(--cf) 55%, var(--fg)); }
:root[data-theme="light"] .chc [data-cf] { background: var(--cf); color: #141a26; border-color: transparent; }
:root[data-theme="light"] .chc [data-cf] .chs-l, :root[data-theme="light"] .chc [data-cf] h4, :root[data-theme="light"] .chc [data-cf] .sep { color: #3a4356; }
@media (max-width: 480px) {
  .ch-grid { grid-template-columns: minmax(0, 1fr); }
  .chc-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* «Моя БД»: W / L можно проставить позже */
.wl-later { margin: -2px 0 8px; font-size: 13px; color: var(--muted); }
