/* Palette — no purple.
 *   bg          deep charcoal with a hint of cool blue
 *   surface     slightly raised card
 *   text        near-white
 *   accent      amber gold (Radiant-ish) — primary CTA, highlights
 *   good        green — done state
 *   bad         red — enemy reports, failures
 *   info        teal-blue — queued/running
 */
:root {
  --bg:         #0c0e12;
  --bg-2:       #0f1218;
  --surface:    #161a22;
  --surface-2:  #1c212b;
  --border:     #262d39;
  --text:       #ecedee;
  --text-dim:   #8b94a4;
  --text-faint: #5b6473;

  --accent:     #f5b042;   /* amber gold */
  --accent-2:   #ffce6b;
  --good:       #4ade80;
  --bad:        #ef5a5a;
  --info:       #4fa9ff;

  --radius:     8px;
  --radius-sm:  6px;
  --shadow:     0 6px 24px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

/* The `hidden` HTML attribute applies `display: none` via the UA stylesheet,
 * which is overridden by anything we set explicitly (e.g. `.card { display:
 * flex }`). Make `hidden` win to keep panels invisible until JS shows them. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ─── Scrollbar — themed, replaces the default system one ─────────── */
/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
/* WebKit / Chromium / Edge */
::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 999px;
  /* Inset via transparent border so the thumb reads as a slim pill. */
  border: 3px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 60%, var(--border));
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:active {
  background: var(--accent);
  background-clip: padding-box;
}
::-webkit-scrollbar-corner {
  background: transparent;
}

body {
  /* Subtle radial accent — gives the page some depth without being shouty. */
  background:
    radial-gradient(1100px 600px at 80% -10%, rgba(245, 176, 66, 0.10), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(79, 169, 255, 0.06), transparent 60%),
    var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── Hero ───────────────────────────────────────────────────── */

.hero {
  padding: 56px 0 36px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.topbar .brand { margin-right: auto; text-decoration: none; color: inherit; }

/* Compact search bar in the topbar — only visible for logged-in users. */
.topbar-search {
  display: flex;
  align-items: stretch;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  height: 36px;
  transition: border-color 120ms ease;
}
.topbar-search:focus-within { border-color: var(--accent); }
.topbar-search input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 0 10px;
  width: 170px;
  min-width: 0;
}
.topbar-search input::placeholder { color: var(--text-faint); font-family: 'Inter', sans-serif; }
.topbar-search button {
  background: var(--surface-2);
  border: 0;
  color: var(--accent);
  font-size: 16px;
  font-weight: 700;
  padding: 0 12px;
  cursor: pointer;
  transition: background 120ms ease;
}
.topbar-search button:hover { background: var(--accent); color: #19140a; }

@media (max-width: 560px) {
  .topbar-search input { width: 110px; font-size: 12px; }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* ─── Auth slot ──────────────────────────────────────────────── */

.auth-slot { display: flex; align-items: center; }

.steam-login-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(180deg, #1b2838 0%, #0e1a2b 100%);
  color: #c7d5e0;
  border: 1px solid #2a475e;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease, background 120ms ease;
}
.steam-login-btn:hover {
  border-color: #66c0f4;
  color: #fff;
}
.steam-login-btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 5px 6px 5px 5px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 120ms ease;
}
.user-chip:hover { border-color: var(--accent); }
.user-chip img {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
}
.user-chip .user-name {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.user-chip .logout {
  background: transparent;
  color: var(--text-faint);
  border: none;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 0 8px 0 2px;
  border-radius: 50%;
  transition: color 120ms ease;
}
.user-chip .logout:hover { color: var(--bad); }

@media (max-width: 560px) {
  .topbar { margin-bottom: 20px; }
  .user-chip .user-name { max-width: 90px; }
  .steam-login-btn { padding: 7px 12px; font-size: 13px; }
}
.brand-mark {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--accent);
  color: #19140a;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.brand-name {
  font-size: 13px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 2px;
}

h1 {
  font-size: clamp(28px, 5vw, 44px);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1.15;
}
.accent {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--text-dim);
  max-width: 620px;
  margin: 0 0 28px;
  font-size: 16px;
}
.subtitle em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

/* Form */

.analyze-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

#match-id {
  flex: 1 1 280px;
  min-width: 0;
  background: var(--surface);
  border: 1.5px solid var(--border);
  color: var(--text);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
  transition: border-color 120ms ease, background 120ms ease;
}
#match-id::placeholder {
  color: var(--text-faint);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0;
}
#match-id:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface-2);
}
#match-id:invalid:not(:placeholder-shown) {
  border-color: var(--bad);
}

#analyze-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #19140a;
  border: none;
  padding: 14px 22px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease, box-shadow 120ms ease;
  box-shadow: 0 4px 16px rgba(245, 176, 66, 0.22);
}
#analyze-btn:hover { background: var(--accent-2); }
#analyze-btn:active { transform: translateY(1px); }
#analyze-btn:disabled {
  background: var(--surface-2);
  color: var(--text-faint);
  cursor: not-allowed;
  box-shadow: none;
}
#analyze-btn:disabled .btn-arrow { display: none; }

.hint {
  color: var(--text-faint);
  font-size: 13px;
  margin-top: 14px;
}

/* ─── Cards / status / errors ────────────────────────────────── */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.status-card { display: flex; flex-direction: column; gap: 12px; }
.status-row { display: flex; align-items: center; gap: 14px; }

.status-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  position: relative;
}
.status-dot[data-state="queued"]  { background: var(--info); }
.status-dot[data-state="running"] { background: var(--accent); }
.status-dot[data-state="done"]    { background: var(--good); }
.status-dot[data-state="failed"]  { background: var(--bad); }
.status-dot[data-state="queued"]::after,
.status-dot[data-state="running"]::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid currentColor;
  color: inherit;
  opacity: 0.5;
  animation: pulse 1.6s ease-out infinite;
}
.status-dot[data-state="queued"]::after  { color: var(--info); }
.status-dot[data-state="running"]::after { color: var(--accent); }
@keyframes pulse {
  0%   { transform: scale(1);   opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}

.status-headline {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.status-sub {
  font-size: 14px;
  color: var(--text-dim);
}

.status-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-faint);
  padding-top: 10px;
  border-top: 1px solid var(--border);
}
.status-meta code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
}
.dot-sep { color: var(--text-faint); }

.error-card {
  border-color: rgba(239, 90, 90, 0.35);
  background: linear-gradient(180deg, rgba(239, 90, 90, 0.08), var(--surface));
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.error-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: var(--bad);
  color: #1a0a0a;
  font-weight: 800;
  font-size: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.error-headline { font-weight: 700; font-size: 16px; }
.error-sub { color: var(--text-dim); margin-top: 4px; font-size: 14px; word-break: break-word; }
.retry-btn {
  margin-top: 12px;
  background: transparent;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: background 120ms ease, color 120ms ease;
}
.retry-btn:hover { background: var(--accent); color: #19140a; }

/* ─── Results ────────────────────────────────────────────────── */

.results {
  animation: fade-in 320ms ease-out both;
  padding-bottom: 60px;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

/* ─── Verdict hero ───────────────────────────────────────────────
   One unified top-of-match panel: plain-language severity verdict fused
   with the 4-number report breakdown. --vh-c escalates with the bucket
   (level-0 calm … level-4 «помойка») and tints the glow, badge, title. */
.verdict-hero {
  --vh-c: var(--text-dim);
  position: relative;
  overflow: hidden;
  margin-bottom: 28px;
  padding: 22px 24px;
  background:
    radial-gradient(130% 150% at 0% 0%,
      color-mix(in srgb, var(--vh-c) 16%, transparent), transparent 58%),
    var(--surface);
  border: 1px solid var(--border);
  border-top: 2px solid var(--vh-c);
  border-radius: var(--radius);
}
.verdict-hero.level-0 { --vh-c: var(--good); }
.verdict-hero.level-1 { --vh-c: var(--info); }
.verdict-hero.level-2 { --vh-c: var(--accent-2); }
.verdict-hero.level-3 { --vh-c: var(--accent); }
.verdict-hero.level-4 { --vh-c: var(--bad); }

.vh-main {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.vh-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 96px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--vh-c) 13%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--vh-c) 42%, transparent);
}
.vh-badge-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 46px;
  font-weight: 800;
  line-height: 1;
  color: var(--vh-c);
}
.vh-badge-cap {
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.vh-copy { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.vh-title {
  font-size: clamp(20px, 4vw, 27px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.3px;
  color: var(--vh-c);
}
.vh-desc {
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-dim);
}
.vh-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.vh-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-left: 1px solid var(--border);
}
.vh-stat:first-child { border-left: 0; }
.vh-stat b {
  font-family: 'JetBrains Mono', monospace;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
}
.vh-stat b.c-accent { color: var(--accent); }
.vh-stat b.c-info   { color: var(--info); }
.vh-stat b.c-bad    { color: var(--bad); }
.vh-stat span {
  font-size: 11px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-faint);
}

.section-h {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 8px 0 14px;
}

.reports-list { display: flex; flex-direction: column; gap: 10px; }
.report {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--info);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 14px;
  align-items: center;
}
.report.enemy { border-left-color: var(--bad); }
.report.neutral { border-left-color: var(--text-faint); }
/* When the viewer is the target of a report — accent ring + amber tint. */
.report.on-viewer {
  border-left-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px rgba(245, 176, 66, 0.25);
}
.report .time {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
  color: var(--accent);
  font-size: 14px;
}
.report .who {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 15px;
}
.report .who .name { font-weight: 600; }
.report .who .arrow { color: var(--text-faint); margin: 0 2px; }
.report .badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 8px;
  border-radius: 5px;
  text-transform: uppercase;
}
.report.friendly .badge { background: rgba(79, 169, 255, 0.15); color: var(--info); }
.report.enemy    .badge { background: rgba(239, 90, 90, 0.15); color: var(--bad); }
.report.neutral  .badge { background: rgba(139, 148, 164, 0.12); color: var(--text-faint); }
.report .afk-tag {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #1a0a0a;
  background: var(--accent);
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.6px;
}

/* Cause chips — the parser's verdict on WHY the report was filed. Full-width
   row under the time/who/badge grid line. */
.report .report-causes {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}
.cause-chip {
  display: inline-block;
  font-size: 11px;
  color: var(--text-dim);
  background: rgba(139, 148, 164, 0.1);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 999px;
  cursor: default;
}
/* ≥70% confidence — the parser is sure (e.g. ping 7s before the press). */
.cause-chip--hot {
  color: var(--accent);
  background: rgba(245, 176, 66, 0.12);
  border-color: rgba(245, 176, 66, 0.4);
}
.cause-chip--won {
  color: var(--info);
  background: rgba(79, 169, 255, 0.1);
  border-color: rgba(79, 169, 255, 0.35);
}

/* Reason tags — what the reporter actually ticked in Valve's report form
   (Report.Reasons). The stated accusation, vs the round cause pills above which
   are our inferred motive. Squarer + solid so the two layers read apart. Sits
   above the cause row. */
.report .report-reasons {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}
.report-reasons .reasons-lead {
  font-size: 11px;
  color: var(--text-faint);
  letter-spacing: 0.3px;
}
.reason-chip {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-dim);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: 6px;
  cursor: default;
}
.reason-chip--bad  { color: var(--bad);    background: rgba(239, 90, 90, 0.14);  border-color: rgba(239, 90, 90, 0.4); }
.reason-chip--warn { color: var(--accent); background: rgba(245, 176, 66, 0.12); border-color: rgba(245, 176, 66, 0.4); }
.reason-chip--info { color: var(--info);   background: rgba(79, 169, 255, 0.12); border-color: rgba(79, 169, 255, 0.4); }

/* «Почему репортят» dashboard block — spans both columns of the
   .reports-breakdown grid (labels are long, bars need the width). */
.rb-block--cause {
  grid-column: 1 / -1;
}
/* Double-class so this wins over the base .rb-bucket defined later in the file. */
.rb-bucket.rb-bucket--cause {
  grid-template-columns: 170px 1fr 30px;
}
.rb-bucket.rb-bucket--cause .rb-bucket-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Human verdict cards: «ты сам» / «крайний» / «мусор». */
.cause-verdicts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-bottom: 10px;
}
.cause-verdict {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-faint);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.cause-verdict strong {
  display: block;
  font-size: 22px;
  font-family: 'JetBrains Mono', monospace;
}
.cause-verdict strong small {
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 400;
}
.cause-verdict span {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin: 2px 0 6px;
}
.cause-verdict p {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-dim);
}
.cause-verdict--fixable { border-left-color: var(--accent); }
.cause-verdict--fixable span { color: var(--accent); }
.cause-verdict--stomp { border-left-color: var(--good); }
.cause-verdict--stomp span { color: var(--good); }
.cause-verdict--tilt { border-left-color: var(--info); }
.cause-verdict--tilt span { color: var(--info); }
.cause-verdict--noise span { color: var(--text-faint); }

.cause-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-faint);
  margin-bottom: 8px;
  user-select: none;
}
.cause-details summary:hover { color: var(--text-dim); }

/* Cause categories double as match-list filters: clickable + live highlight. */
.cause-verdict[data-cause-filter],
.rb-bucket--cause[data-cause-filter] { cursor: pointer; }
.cause-verdict[data-cause-filter] { transition: border-color .12s, background .12s; }
.cause-verdict[data-cause-filter]:hover { border-color: var(--text-dim); }
.cause-verdict[data-cause-filter]:focus-visible,
.rb-bucket--cause[data-cause-filter]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.cause-verdict.is-active { border-color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.cause-verdict--stomp.is-active { border-color: var(--good); box-shadow: inset 0 0 0 1.5px var(--good); }
.cause-verdict--tilt.is-active  { border-color: var(--info); box-shadow: inset 0 0 0 1.5px var(--info); }
.cause-verdict--noise.is-active { border-color: var(--text-faint); box-shadow: inset 0 0 0 1.5px var(--text-faint); }
.rb-bucket--cause[data-cause-filter] { border-radius: 6px; transition: background .12s; }
.rb-bucket--cause[data-cause-filter]:hover { background: var(--surface); }
.rb-bucket--cause.is-active { background: var(--surface); box-shadow: inset 2px 0 0 var(--accent); }
.rb-bucket--cause.is-active .rb-bucket-label { color: var(--text); font-weight: 700; }

.rb-hint { color: var(--text-faint); font-weight: 400; }
.cause-clear {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  font: inherit;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 999px;
  cursor: pointer;
}
.cause-clear:hover { color: var(--text); border-color: var(--text-faint); }

/* Hero imagery — square icon for inline rows, wide portrait for player cards. */
.hero-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
}
.hero-icon--sm { width: 26px; height: 26px; border-radius: 5px; }
.hero-icon--missing {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  position: relative;
}
.hero-icon--missing::after {
  content: '?';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-weight: 700;
  font-size: 12px;
}

.empty {
  text-align: center;
  color: var(--text-dim);
  font-size: 15px;
  padding: 28px 0;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.players-details {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.players-details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  outline: none;
  list-style: none;
}
.players-details summary::-webkit-details-marker { display: none; }
.players-details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  transition: transform 120ms ease;
}
.players-details[open] summary::before { transform: rotate(90deg); }

.players-list {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.player {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.player.radiant { border-left: 3px solid var(--good); }
.player.dire    { border-left: 3px solid var(--bad); }

.hero-portrait {
  width: 100%;
  aspect-ratio: 256 / 144;
  object-fit: cover;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  display: block;
}
.hero-portrait--missing {
  background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
  position: relative;
}
.hero-portrait--missing::after {
  content: 'нет героя';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-faint);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
}

.player .pmeta { padding: 12px 14px; }

.player .ptop {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.player .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
  object-fit: cover;
}
.player .avatar--missing {
  display: inline-block;
  background: linear-gradient(135deg, var(--surface-2), var(--bg-2));
}
.player .pname-wrap { min-width: 0; flex: 1; }
.player .pname {
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
a.pname:hover { color: var(--accent); }
.player .pingame {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.player .phero { color: var(--text-dim); font-size: 13px; margin-top: 6px; }
.player .pkda {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.player .pkda .k    { color: var(--good); }
.player .pkda .d    { color: var(--bad); }
.player .pkda .a    { color: var(--accent); }
.player .pkda .sep  { color: var(--text-faint); margin: 0 4px; }

/* ─── Footer ─────────────────────────────────────────────────── */

.footer {
  margin-top: auto;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 12px;
  border-top: 1px solid var(--border);
}

/* ─── Mobile ─────────────────────────────────────────────────── */

@media (max-width: 560px) {
  .hero { padding: 36px 0 24px; }
  .vh-main { flex-direction: column; align-items: flex-start; gap: 14px; }
  .vh-badge { flex-direction: row; gap: 8px; align-items: baseline; min-width: 0; }
  .vh-badge-cap { margin-top: 0; }
  .vh-stats { gap: 0; }
  .report {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .report .badge { justify-self: start; }
}

/* ─── Dashboard ─────────────────────────────────────────────── */

/* When the page is in authed mode the hero shrinks. */
body[data-mode="authed"] .hero { padding: 22px 0 0; }
body[data-mode="authed"] #anon-hero { display: none; }

.dashboard { padding-bottom: 60px; }

.dash-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0 14px;
}
.dash-h { margin: 0; }
.dash-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

.last-synced { color: var(--text-faint); font-size: 12px; }

.privacy-indicator {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.privacy-indicator.public  { color: var(--good); background: rgba(74, 222, 128, 0.10); border-color: rgba(74, 222, 128, 0.30); }
.privacy-indicator.private { color: var(--bad);  background: rgba(239, 90, 90, 0.10); border-color: rgba(239, 90, 90, 0.30); }
.privacy-indicator.error   { color: var(--accent); background: rgba(245, 176, 66, 0.10); border-color: rgba(245, 176, 66, 0.30); }

.dash-error code {
  display: block;
  margin-top: 10px;
  padding: 8px 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-faint);
  font-size: 11px;
  word-break: break-word;
}

.dash-empty p { margin: 0 0 10px; }
.dash-empty p:last-child { margin-bottom: 0; }
.dash-empty strong { color: var(--bad); font-weight: 700; }

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
.refresh-btn:hover { border-color: var(--accent); color: var(--accent); }
.refresh-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.refresh-btn svg { flex-shrink: 0; }

.dash-summary { margin-bottom: 24px; }

/* ─── Stat strip (above the card list) ───────────────────────────────────── */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.stat-tile-wide { grid-column: span 1; }
.stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-label {
  font-size: 11px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.stat-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}
@media (max-width: 980px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-tile-wide { grid-column: span 2; }
}
@media (max-width: 560px) {
  .stat-strip { grid-template-columns: 1fr; }
  .stat-tile-wide { grid-column: span 1; }
}

/* ─── Filter rows (period / lobby / mode / outcome / reports) ────────────── */
.dash-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 18px;
}
.filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.filter-row-secondary {
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  padding-top: 10px;
  gap: 12px;
}
.filter-kicker {
  min-width: 62px;
  font-size: 10px;
  letter-spacing: 1.3px;
  text-transform: uppercase;
  color: var(--text-faint);
  font-weight: 700;
}
.chip-group {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  padding: 3px;
  border-radius: 6px;
}
.chip {
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease;
}
.chip:hover { color: var(--text); }
.chip.active {
  background: var(--accent);
  color: #1a0f00;
}
.filter-select {
  height: 32px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  padding: 0 28px 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  color-scheme: dark;
  min-width: 180px;
}
.filter-row-secondary .dash-search,
.filter-row-secondary .dash-sort {
  flex: 1 1 180px;
  min-width: 0;
}
.filter-row-secondary .dash-search input,
.filter-row-secondary .dash-sort select {
  width: 100%;
}

.cards-list { display: grid; gap: 8px; margin-bottom: 24px; }

.match-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: grid;
  grid-template-columns: 60px 1fr auto auto;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: border-color 120ms ease, transform 80ms ease;
}
.match-card:hover  { border-color: var(--accent); }
.match-card:active { transform: translateY(1px); }

.match-card.victory { border-left: 3px solid var(--good); }
.match-card.defeat  { border-left: 3px solid var(--bad); }
.match-card.unknown { border-left: 3px solid var(--text-faint); }

.match-hero-icon {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  object-fit: cover;
}
.match-hero-icon.missing {
  background: linear-gradient(135deg, var(--surface-2), var(--surface));
  position: relative;
}
.match-hero-icon.missing::after {
  content: '?';
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-weight: 700;
}

.match-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.match-line1 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.match-hero-name { font-weight: 600; font-size: 15px; }
.match-result {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
}
.match-result.win  { color: var(--good); background: rgba(74, 222, 128, 0.12); }
.match-result.loss { color: var(--bad);  background: rgba(239, 90, 90, 0.12); }
.match-line2 { color: var(--text-dim); font-size: 13px; display: flex; gap: 8px; flex-wrap: wrap; }
.match-line2 .sep { color: var(--text-faint); }
.match-kda {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 600;
}
.match-kda .k { color: var(--good); }
.match-kda .d { color: var(--bad); }
.match-kda .a { color: var(--accent); }
.match-kda .sep { color: var(--text-faint); margin: 0 2px; }

.match-reports {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
}
.match-reports-num {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}
.match-reports-num.zero { color: var(--text-faint); }
.match-reports-num.some { color: var(--accent); }
.match-reports-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-faint);
  margin-top: 2px;
  font-family: 'Inter', sans-serif;
}

.match-status {
  font-size: 11px;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
}
.match-status.done       { background: rgba(74, 222, 128, 0.12); color: var(--good); }
.match-status.queued,
.match-status.running    { background: rgba(79, 169, 255, 0.12); color: var(--info); }
.match-status.failed     { background: rgba(239, 90, 90, 0.12); color: var(--bad); }
.match-status.no_replay,
.match-status.not_scheduled { background: rgba(139, 148, 164, 0.10); color: var(--text-faint); }

@media (max-width: 560px) {
  .match-card { grid-template-columns: 48px 1fr; row-gap: 8px; }
  .match-reports, .match-status { grid-column: span 2; text-align: left; }
  .match-reports { display: flex; align-items: baseline; gap: 6px; }
  .match-reports-num { font-size: 16px; }
}

/* Heroes breakdown panel. */
.heroes-details {
  border-top: 1px solid var(--border);
  padding-top: 18px;
  margin-top: 8px;
}
.heroes-details summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.4px;
  outline: none;
  list-style: none;
}
.heroes-details summary::-webkit-details-marker { display: none; }
.heroes-details summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  transition: transform 120ms ease;
}
.heroes-details[open] summary::before { transform: rotate(90deg); }
.heroes-breakdown {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}
.hero-row {
  display: grid;
  grid-template-columns: 32px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.hero-row .games { color: var(--text-dim); font-size: 13px; }
.hero-row .reports {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 700;
  color: var(--accent);
}
.hero-row .pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-faint);
  min-width: 50px;
  text-align: right;
}

.dash-empty { margin-top: 20px; padding: 20px; font-size: 14px; line-height: 1.5; }
.dash-empty em { color: var(--accent); font-style: normal; font-weight: 600; }

.back-btn {
  background: transparent;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 14px;
  padding: 4px 8px 4px 0;
  transition: color 120ms ease;
}
.back-btn:hover { color: var(--accent); }

/* ─── Analytics UI refresh ───────────────────────────────────── */

.anon-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 22px 34px;
  align-items: center;
}
.anon-hero h1,
.anon-hero .subtitle,
.anon-hero .analyze-form,
.anon-hero .hint {
  grid-column: 1;
}
.anon-preview {
  grid-column: 2;
  grid-row: 1 / span 4;
  align-self: stretch;
  min-height: 310px;
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 12px;
  background:
    linear-gradient(145deg, rgba(245, 176, 66, 0.12), transparent 48%),
    linear-gradient(180deg, #171b24 0%, #11151d 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.preview-main {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
}
.preview-eyebrow,
.panel-kicker {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.preview-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 70px;
  font-weight: 800;
  line-height: 0.95;
  color: var(--accent);
}
.preview-title {
  color: var(--text);
  font-weight: 700;
  font-size: 18px;
}
.preview-bar,
.risk-bar {
  height: 8px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.preview-bar span,
.risk-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--good), var(--accent), var(--bad));
  border-radius: inherit;
}
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.preview-grid div {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 10px;
}
.preview-grid strong {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
}
.preview-grid span {
  display: block;
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 11px;
  line-height: 1.35;
}

.analytics-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) minmax(230px, 0.9fr) minmax(230px, 0.9fr);
  gap: 12px;
  margin: -10px 0 16px;
}
.analysis-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-width: 0;
}
.risk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0 12px;
}
.risk-score {
  font-family: 'JetBrains Mono', monospace;
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  color: var(--accent);
}
.risk-copy {
  margin-top: 4px;
  color: var(--text-dim);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 12px;
}
.risk-ring {
  --score: 0;
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, var(--surface) 0 57%, transparent 58%),
    conic-gradient(var(--accent) calc(var(--score) * 1%), rgba(255, 255, 255, 0.08) 0);
  border: 1px solid var(--border);
  flex: 0 0 auto;
}
.risk-ring span {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  font-size: 12px;
  font-weight: 800;
}
.risk-meta {
  margin-top: 10px;
  color: var(--text-faint);
  font-size: 12px;
}
.metric-stack {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}
.metric-stack div,
.pipeline-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}
.metric-stack span,
.pipeline-item strong {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  font-weight: 800;
  font-size: 19px;
}
.metric-stack small,
.pipeline-item span {
  color: var(--text-faint);
  font-size: 12px;
}
.pipeline-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.pipeline-item.good strong { color: var(--good); }
.pipeline-item.info strong { color: var(--info); }
.pipeline-item.bad strong { color: var(--bad); }
.pipeline-item.muted strong { color: var(--text-faint); }

.dash-controls {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(180px, 250px) 170px;
  gap: 10px;
  align-items: stretch;
  margin: 6px 0 14px;
}
.segmented {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-width: 0;
  overflow: auto;
}
.segmented button {
  border: 0;
  background: transparent;
  color: var(--text-dim);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.segmented button.active {
  color: #17110a;
  background: var(--accent);
}
.dash-search,
.dash-sort {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  min-width: 0;
}
.dash-search:focus-within,
.dash-sort:focus-within { border-color: var(--accent); }
.dash-search span,
.dash-sort span {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.dash-search input,
.dash-sort select {
  min-width: 0;
  width: 100%;
  height: 42px;
  background: transparent;
  border: 0;
  color: var(--text);
  outline: 0;
  font: inherit;
  font-size: 13px;
}
.dash-sort select { color-scheme: dark; cursor: pointer; }

.cards-list {
  /* Single column — accumulating dashboard renders the filtered slice as a
     vertical list. Earlier "auto-fill 360px" rule wrapped the list into a
     multi-column grid, which broke the timeline scan. */
  grid-template-columns: minmax(0, 1fr);
}
.match-card {
  grid-template-columns: 40px minmax(0, 1fr) auto auto;
  grid-template-areas: "icon info status reports";
  min-height: 60px;
  padding: 8px 12px;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.022), rgba(255, 255, 255, 0.008)),
    var(--surface);
}
.match-card .match-hero-icon {
  width: 38px;
  height: 38px;
  border-radius: 5px;
}
.match-card .match-line1 {
  gap: 8px;
  font-size: 14px;
}
.match-card .match-line2 {
  font-size: 12px;
  gap: 6px;
}
.match-card .match-reports-num { font-size: 18px; }
.match-card .match-status {
  font-size: 10px;
  padding: 3px 6px;
}

/* Inline pill for game mode / lobby type next to hero name. */
.match-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.match-pill-ranked { color: var(--accent); border-color: rgba(245, 176, 66, 0.4); }
.match-pill-turbo  { color: #5fb6ff;       border-color: rgba(95, 182, 255, 0.4); }
.match-card .match-hero-icon { grid-area: icon; }
.match-info { grid-area: info; }
.match-reports { grid-area: reports; }
.match-status {
  grid-area: status;
  justify-self: end;
}
.match-hero-icon {
  width: 50px;
  height: 50px;
}
.match-reports-num { font-size: 26px; }

.dashboard-lower {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.75fr);
  gap: 12px;
  margin-bottom: 18px;
}
.panel-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.panel-title-row h3 {
  margin: 3px 0 0;
  font-size: 16px;
  line-height: 1.2;
}
.panel-title-row > span {
  color: var(--text-faint);
  font-size: 12px;
  white-space: nowrap;
}
.dash-timeline {
  display: flex;
  align-items: end;
  gap: 6px;
  height: 92px;
  padding: 10px 4px 0;
  border-bottom: 1px solid var(--border);
}
.timeline-stick {
  flex: 1;
  min-width: 12px;
  height: 72px;
  display: flex;
  align-items: end;
  justify-content: center;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}
.timeline-stick span {
  display: block;
  width: 100%;
  max-width: 20px;
  height: var(--h);
  border-radius: 5px 5px 0 0;
  background: var(--text-faint);
  transition: transform 100ms ease, opacity 100ms ease;
}
.timeline-stick:hover span { transform: translateY(-3px); opacity: 0.9; }
.timeline-stick.win span { background: var(--good); }
.timeline-stick.loss span { background: var(--bad); }
.timeline-stick.hot span { background: var(--accent); box-shadow: 0 0 0 1px rgba(245, 176, 66, 0.3); }
.hero-bars {
  display: grid;
  gap: 10px;
}
.hero-bar {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 1.4fr 34px;
  align-items: center;
  gap: 10px;
  color: var(--text-dim);
  font-size: 13px;
}
.hero-bar > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-bar div {
  height: 8px;
  background: var(--bg-2);
  border-radius: 999px;
  overflow: hidden;
}
.hero-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--bad));
  border-radius: inherit;
}
.hero-bar strong {
  text-align: right;
  font-family: 'JetBrains Mono', monospace;
  color: var(--accent);
}

.match-hero-panel {
  margin-bottom: 14px;
}
.match-scoreboard {
  background:
    linear-gradient(135deg, rgba(79, 169, 255, 0.09), transparent 46%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.match-scoreboard > summary {
  list-style: none;
  cursor: pointer;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.match-scoreboard > summary::-webkit-details-marker { display: none; }
.match-score-meta { min-width: 0; }
.match-score-line {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 6px 0 6px;
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700;
  line-height: 1;
}
.match-score-line .score-radiant { color: var(--good); }
.match-score-line .score-dire    { color: var(--bad); }
.match-score-line .score-sep     { color: var(--text-faint); }
.match-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--text-dim);
  font-size: 13px;
}
.match-subline span {
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 999px;
}
.match-outcome.win  { color: var(--good); border-color: rgba(74, 222, 128, 0.35); }
.match-outcome.loss { color: var(--bad);  border-color: rgba(239, 90, 90, 0.35); }
.scoreboard-toggle {
  color: var(--text-faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.match-scoreboard[open] .scoreboard-toggle::after { content: ' ▴'; }
.match-scoreboard:not([open]) .scoreboard-toggle::after { content: ' ▾'; }
.scoreboard-teams {
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.18);
}
.scoreboard-team {
  padding: 10px 14px;
}
.scoreboard-team + .scoreboard-team {
  border-top: 1px solid var(--border);
}
.scoreboard-team-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.scoreboard-team-radiant .scoreboard-team-label { color: var(--good); }
.scoreboard-team-dire    .scoreboard-team-label { color: var(--bad); }
.scoreboard-roster {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.scoreboard-player {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
}
.scoreboard-player.is-viewer {
  border-color: rgba(240, 179, 63, 0.45);
  background: rgba(240, 179, 63, 0.08);
}
.scoreboard-player-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.scoreboard-player-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.scoreboard-player-kda {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

/* "вероятный руинер" stamp — sits between team label and roster, styled like
   an ink seal: red dashed border, slight rotation, mono caps. One per team max. */
.ruiner-stamp {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  padding: 4px 10px 4px 8px;
  border: 1.5px dashed var(--bad);
  border-radius: 4px;
  background: rgba(231, 76, 60, 0.06);
  transform: rotate(-1.5deg);
  font-family: 'JetBrains Mono', monospace;
}
.ruiner-stamp-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--bad);
  white-space: nowrap;
}
.ruiner-stamp-target {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text);
}
/* Bigger hero portrait so the «вероятный руинер» stamp reads at a glance. */
.ruiner-stamp-target .hero-icon {
  width: 44px;
  height: 44px;
  border-radius: 7px;
}
.ruiner-stamp-name { font-weight: 600; }
.ruiner-stamp-kda { color: var(--text-dim); }
.ruiner-stamp-pings { color: var(--text-faint); font-size: 11px; }

/* Insights = wide banner (first report) on top, uniform stat tiles below. */
.match-insights {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 16px;
}
.insight-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.insight-banner-kicker {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.insight-banner-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
}
.insight-banner-time {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-dim);
  font-size: 13px;
  padding-right: 4px;
  border-right: 1px solid var(--border);
  margin-right: 4px;
}
.insight-banner-side {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.insight-banner-side .hero-icon { flex-shrink: 0; }
.insight-banner-arrow {
  color: var(--text-faint);
  font-size: 16px;
}

.insight-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.insight-tile {
  --it-c: var(--text-dim);
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Severity tint: calm = green «всё чисто», warn = amber, hot = red. The accent
   colour drives the plate border, a soft corner glow, and the inline number. */
.insight-tile.lv-calm { --it-c: var(--good); }
.insight-tile.lv-warn { --it-c: var(--accent); }
.insight-tile.lv-hot  { --it-c: var(--bad); }
.insight-tile.lv-calm,
.insight-tile.lv-warn,
.insight-tile.lv-hot {
  border-color: color-mix(in srgb, var(--it-c) 38%, var(--border));
  background:
    radial-gradient(120% 130% at 100% 0%,
      color-mix(in srgb, var(--it-c) 11%, transparent), transparent 62%),
    var(--surface);
}
.it-label {
  color: var(--text-faint);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.it-body { display: flex; flex-direction: column; gap: 7px; }
.it-text {
  font-size: 13px;
  line-height: 1.35;
  color: var(--text-dim);
  overflow-wrap: anywhere;
}
.it-text.it-ok { color: var(--good); font-weight: 600; }
/* Inline «wow» number — colour follows the tile severity. */
.it-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 19px;
  font-weight: 800;
  color: var(--it-c);
  vertical-align: -1px;
}

/* Hero-chip row (kept the .war-* class names from the ping-war tile). */
.it-chain {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
/* A side of the «кто → кому» chain: stacks distinct players vertically so
   multiple reporters don't smear into one confusing inline run. */
.it-side {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.it-pair {
  display: flex;
  align-items: center;
  gap: 5px;
}
.it-chain .hero-icon { width: 22px; height: 22px; border-radius: 4px; display: block; }
/* Thin team-colored frame around each hero icon (свет = good, тьма = bad). */
.it-chain .war-hero {
  display: inline-flex;
  padding: 1.5px;
  border-radius: 5px;
  border: 1px solid var(--text-faint);
  line-height: 0;
}
.it-chain .war-hero.radiant { border-color: var(--good); }
.it-chain .war-hero.dire    { border-color: var(--bad); }
.it-chain .war-arrow { color: var(--text-faint); font-size: 12px; }
.it-chain .war-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
}

/* Steam profile links — inline `<a>` wrapping every player nick on the
   match page (scoreboard, reports list, chat events, insights). Subtle
   underline-on-hover; visited == default so the dashboard doesn't drift. */
.profile-link,
.profile-link:visited {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.18);
}
.profile-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.match-timeline-panel { margin-bottom: 18px; position: relative; }
.match-timeline-caption {
  display: block;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.4px;
}
.match-timeline {
  position: relative;
  height: 78px;
  margin: 12px 8px 4px;
  border-bottom: 1px solid var(--border);
}
.match-timeline::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  height: 2px;
  background: linear-gradient(90deg, var(--good), var(--accent), var(--bad));
  opacity: 0.55;
}
.report-dot {
  position: absolute;
  bottom: 14px;
  transform: translateX(-50%);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--surface);
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(245, 176, 66, 0.4);
  cursor: pointer;
}
.report-dot span {
  position: absolute;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  white-space: nowrap;
}
/* Ally-only ping markers — small diamonds above the line so they don't crowd reports below. */
.ping-dot {
  position: absolute;
  bottom: 30px;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  border: 1px solid var(--surface);
  background: #8a6dd6;
  box-shadow: 0 0 0 1px rgba(138, 109, 214, 0.35);
  cursor: help;
  padding: 0;
}
.ping-dot:hover { background: #b59bff; }

/* Tip markers — green stalk rising from the line to a small «tip» label on top.
   Anchored at the line (bottom: 22px); content stacks upward, dot last so it
   sits on the line. */
.tip-marker {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: help;
}
.tip-marker-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--good);
  line-height: 1;
  margin-bottom: 2px;
}
.tip-marker-stalk {
  width: 2px;
  height: 24px;
  background: var(--good);
  opacity: 0.7;
}
.tip-marker-dot {
  width: 7px;
  height: 7px;
  margin-top: -1px;
  border-radius: 50%;
  background: var(--good);
  border: 1px solid var(--surface);
  box-shadow: 0 0 0 1px rgba(83, 209, 140, 0.4);
}
.tip-marker:hover .tip-marker-stalk,
.tip-marker:hover .tip-marker-dot { opacity: 1; background: #6ee7a0; }

/* Markers are clickable (tap to pin the tooltip) — pointer over help. */
.ping-dot, .tip-marker { cursor: pointer; }
/* Active marker = the one whose tooltip is open. A subtle ring ties them. */
.report-dot.tl-active { box-shadow: 0 0 0 3px rgba(245, 176, 66, 0.5); }
.ping-dot.tl-active { background: #b59bff; box-shadow: 0 0 0 3px rgba(138, 109, 214, 0.5); }
.tip-marker.tl-active .tip-marker-stalk,
.tip-marker.tl-active .tip-marker-dot { opacity: 1; background: #6ee7a0; }

/* Timeline event tooltip — glass card popped above the clicked marker. */
.tl-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 30;
  max-width: 320px; padding: 10px 12px; border-radius: 12px;
  background: rgba(18, 20, 26, 0.92); backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border-soft); box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(6px); transition: opacity 0.13s, transform 0.13s;
}
.tl-tip.show { opacity: 1; transform: translateY(0); }
.tl-tip-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.tl-tip-kind {
  font-family: 'JetBrains Mono', monospace; font-size: 10px; font-weight: 800;
  letter-spacing: 0.5px; text-transform: uppercase; padding: 2px 7px; border-radius: 6px;
}
.tl-tip-kind.kind-report { background: rgba(245, 176, 66, 0.16); color: var(--accent); }
.tl-tip-kind.kind-ping   { background: rgba(138, 109, 214, 0.2);  color: #b59bff; }
.tl-tip-kind.kind-tip    { background: rgba(83, 209, 140, 0.16); color: var(--good); }
.tl-tip-time {
  font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-faint);
  margin-left: auto;
}
.tl-tip-line { display: flex; align-items: center; gap: 8px; }
.tl-tip-ent { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.tl-tip-ent b { font-size: 13px; font-weight: 700; color: var(--text); white-space: nowrap; }
.tl-tip-ent i { font-size: 11px; font-style: normal; color: var(--text-dim); white-space: nowrap; }
.tl-tip-arr { font-size: 12px; color: var(--text-faint); flex: none; }

.match-chat-panel {
  margin-bottom: 18px;
}
.chat-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.chat-metric {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.chat-metric strong {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 20px;
  line-height: 1;
  color: var(--text);
}
.chat-metric span {
  display: block;
  margin-top: 5px;
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}
.chat-log {
  display: grid;
  gap: 6px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}
.chat-event {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) minmax(88px, auto);
  gap: 10px;
  align-items: start;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.022);
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-left: 3px solid var(--text-faint);
  border-radius: var(--radius-sm);
}
.chat-event.friendly { border-left-color: var(--info); }
.chat-event.enemy { border-left-color: var(--bad); }
/* Faction tint for chat messages — Radiant green, Dire red. Wins over
   friendly/enemy on chat messages because the user reads by team, not by
   "my side / their side". Report rows still use friendly/enemy. */
.chat-event-message.radiant {
  border-left-color: var(--good);
  background: linear-gradient(90deg, rgba(102, 187, 106, 0.08), rgba(255, 255, 255, 0.022));
}
.chat-event-message.dire {
  border-left-color: var(--bad);
  background: linear-gradient(90deg, rgba(239, 90, 90, 0.08), rgba(255, 255, 255, 0.022));
}
.chat-event-message.radiant .chat-author strong { color: var(--good); }
.chat-event-message.dire .chat-author strong { color: var(--bad); }
.chat-event.hot {
  background: rgba(240, 179, 63, 0.055);
  border-color: rgba(240, 179, 63, 0.16);
  border-left-color: var(--accent);
}
.chat-event.viewer {
  box-shadow: inset 0 0 0 1px rgba(240, 179, 63, 0.16);
}
.chat-event-report {
  background:
    linear-gradient(90deg, rgba(240, 179, 63, 0.13), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.026);
  border-color: rgba(240, 179, 63, 0.28);
  border-left-color: var(--accent);
}
.chat-event-report.on-viewer {
  box-shadow: inset 3px 0 0 var(--accent), 0 0 0 1px rgba(240, 179, 63, 0.22);
}
/* Tip = positive event → green, overrides the faction/relation tint. */
.chat-event-tip {
  background:
    linear-gradient(90deg, rgba(83, 209, 140, 0.12), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.026);
  border-color: rgba(83, 209, 140, 0.26);
  border-left-color: var(--good);
}
.chat-event-tip .chat-tags span {
  color: var(--good);
  border-color: rgba(83, 209, 140, 0.4);
}
.chat-time {
  color: var(--accent);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 800;
  line-height: 26px;
}
.chat-body { min-width: 0; }
.chat-author {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--text-dim);
  font-size: 12px;
}
.chat-author strong {
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 180px;
}
.chat-author > span {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.7px;
  text-transform: uppercase;
}
.chat-author .viewer-chip {
  color: #170f07;
  background: var(--accent);
  border-radius: 4px;
  padding: 1px 5px;
}
.chat-text {
  margin-top: 5px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.chat-event.wheel .chat-text {
  color: var(--info);
  font-weight: 700;
}
.chat-event.all-chat .chat-text {
  color: #f6d28b;
}
.chat-tags {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
}
.chat-tags span {
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.55px;
  text-transform: uppercase;
  white-space: nowrap;
}
.chat-event.hot .chat-tags span,
.chat-event-report .chat-tags span {
  color: var(--accent);
  border-color: rgba(240, 179, 63, 0.28);
  background: rgba(240, 179, 63, 0.09);
}
.chat-truncated {
  color: var(--text-faint);
  text-align: center;
  font-size: 12px;
  padding: 10px;
}

/* Dashboard heroes — dotabuff-style table. */
.hero-reports-panel { margin-bottom: 14px; }
.hero-reports-table {
  display: grid;
  gap: 0;
}
.hero-reports-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) 70px 120px 80px;
  align-items: center;
  gap: 10px;
  padding: 5px 10px;
  font-size: 13px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}
.hero-reports-row .hero-reports-icon { width: 24px; height: 24px; }
.hero-reports-row:first-child { border-top: none; }
.hero-reports-head {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.hero-reports-name {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.hero-reports-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hero-reports-icon {
  width: 36px;
  height: 36px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}
.hero-reports-icon.missing {
  background: rgba(255, 255, 255, 0.06);
}
.hero-reports-games {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
}
.hero-reports-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
}
.hero-reports-count.some { color: var(--bad); }
.hero-reports-count.zero { color: var(--text-faint); }
.hero-reports-pergame {
  color: var(--text-dim);
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

/* Dashboard reports breakdown — win/loss split + minute buckets. */
.reports-breakdown {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 24px;
}
@media (max-width: 720px) {
  .reports-breakdown { grid-template-columns: 1fr; }
  .hero-reports-row { grid-template-columns: minmax(0, 1.4fr) 60px 80px 60px; gap: 8px; }
}
.rb-block-label {
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.rb-wl-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}
.rb-wl-win  { background: var(--good); }
.rb-wl-loss { background: var(--bad); }
.rb-wl-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-dim);
}
.rb-wl-legend > span {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}
.rb-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.rb-dot-win  { background: var(--good); }
.rb-dot-loss { background: var(--bad); }
.rb-buckets {
  display: grid;
  gap: 8px;
}
.rb-bucket {
  display: grid;
  grid-template-columns: 80px 1fr 30px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}
.rb-bucket-label { color: var(--text-dim); }
.rb-bucket-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 5px;
  overflow: hidden;
}
.rb-bucket-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
}
.rb-bucket strong {
  font-family: 'JetBrains Mono', monospace;
  text-align: right;
}

@media (max-width: 980px) {
  .anon-hero,
  .analytics-grid,
  .dashboard-lower,
  .match-hero-panel {
    grid-template-columns: 1fr;
  }
  .anon-preview {
    grid-column: 1;
    grid-row: auto;
    min-height: 0;
  }
  .dash-controls {
    grid-template-columns: 1fr;
  }
  .match-insights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .chat-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chat-event {
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .chat-tags {
    grid-column: 2;
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .topbar {
    flex-wrap: wrap;
  }
  .topbar .brand { width: 100%; }
  .analytics-grid { margin-top: 0; }
  .cards-list { grid-template-columns: 1fr; }
  .match-card {
    grid-template-columns: 48px minmax(0, 1fr);
    grid-template-areas:
      "icon info"
      "status status"
      "reports reports";
  }
  .match-status { justify-self: start; }
  .match-insights {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .chat-summary {
    grid-template-columns: 1fr;
  }
  .chat-log {
    max-height: 620px;
  }
  .hero-bar {
    grid-template-columns: minmax(70px, 1fr) 1fr 30px;
  }
  .match-hero-panel { padding: 12px; }
  .match-hero-media { display: none; }
  .match-risk-pill {
    width: 100%;
    aspect-ratio: auto;
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 8px;
    min-height: 58px;
  }
}

/* ─── 2026 dashboard refresh ───────────────────────────────────
   Dense Dota stats layout: closer to Dotabuff/STRATZ match history than a
   marketing page. Kept as an override layer to avoid churn in older states. */
:root {
  --bg: #0b0b0d;
  --bg-2: #101114;
  --surface: #15161a;
  --surface-2: #1b1d22;
  --surface-3: #202329;
  --border: #2b2f37;
  --border-soft: rgba(255, 255, 255, 0.075);
  --text: #f3f1ea;
  --text-dim: #a7a9b0;
  --text-faint: #6e737d;
  --accent: #f0b33f;
  --accent-2: #f36b3d;
  --good: #53d18c;
  --bad: #f15e5e;
  --info: #38b9c7;
  --radius: 8px;
  --radius-sm: 6px;
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.32);
}

html, body {
  background: var(--bg);
  color: var(--text);
}

body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.022) 1px, transparent 1px),
    linear-gradient(180deg, #101013 0%, #09090b 58%, #0d0b0b 100%);
  background-size: 48px 48px, 48px 48px, 100% 100%;
}

.hero { padding: 34px 0 22px; }
body[data-mode="authed"] .hero {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 11, 13, 0.84);
  backdrop-filter: blur(18px) saturate(130%);
}
body[data-mode="authed"] .topbar { margin-bottom: 0; }

.brand-mark {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #150f08;
  box-shadow: 0 0 0 1px rgba(240, 179, 63, 0.28), 0 10px 28px rgba(240, 179, 63, 0.12);
}
.brand-name {
  color: var(--text);
  letter-spacing: 1.4px;
}

.topbar-search,
.user-chip,
.steam-login-btn,
.refresh-btn,
.dash-search,
.dash-sort,
.filter-select {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--border-soft);
}

.anon-hero {
  min-height: calc(100vh - 150px);
  align-items: center;
}
.anon-hero h1 {
  max-width: 780px;
  font-size: clamp(40px, 7vw, 82px);
  letter-spacing: 0;
}
.subtitle {
  max-width: 680px;
  font-size: 17px;
}
.anon-preview {
  min-height: 430px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)),
    linear-gradient(135deg, rgba(240, 179, 63, 0.12), rgba(56, 185, 199, 0.08) 52%, rgba(241, 94, 94, 0.08));
  border-color: var(--border-soft);
}

.dashboard { padding-top: 24px; }
.dash-toolbar {
  margin: 0 0 14px;
  padding: 4px 0;
}
.dash-h {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 1.8px;
}
.privacy-indicator,
.last-synced {
  white-space: nowrap;
}

.stat-strip {
  grid-template-columns: 1.1fr 1.1fr 0.9fr 0.9fr 1.4fr;
  gap: 8px;
  margin-bottom: 12px;
}
.stat-tile {
  min-height: 86px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.014)),
    var(--surface);
  border-color: var(--border-soft);
  box-shadow: none;
}
.stat-num { font-size: 24px; }
.stat-label { color: var(--text-faint); }

.analytics-grid {
  grid-template-columns: 1.15fr 0.95fr 0.95fr;
  margin: 0 0 12px;
}
.analysis-panel,
.card,
.empty {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.042), rgba(255, 255, 255, 0.012)),
    var(--surface);
  border-color: var(--border-soft);
  box-shadow: none;
}
.risk-score,
.preview-score {
  color: var(--accent);
  text-shadow: 0 0 28px rgba(240, 179, 63, 0.18);
}
.risk-ring {
  background:
    radial-gradient(circle at center, var(--surface) 0 57%, transparent 58%),
    conic-gradient(var(--accent) calc(var(--score) * 1%), rgba(255, 255, 255, 0.08) 0);
}

.dash-filters {
  position: sticky;
  top: 62px;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 10px 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(16, 17, 20, 0.88);
  border-color: var(--border-soft);
  backdrop-filter: blur(16px) saturate(130%);
}
.filter-row {
  gap: 7px;
  flex-wrap: nowrap;
}
.filter-row-secondary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(300px, max-content) minmax(220px, 1fr) minmax(180px, 240px);
  border-top-color: var(--border-soft);
}
.filter-kicker {
  min-width: auto;
  color: var(--text-faint);
}
.chip-group,
.segmented {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid var(--border-soft);
}
.chip,
.segmented button {
  min-height: 30px;
  color: var(--text-dim);
}
.chip.active,
.segmented button.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #160f08;
}

.cards-list {
  gap: 6px;
  margin-bottom: 18px;
}
.match-card {
  grid-template-columns: 44px minmax(0, 1fr) minmax(96px, auto) 58px;
  min-height: 66px;
  padding: 9px 12px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
    var(--surface);
  border-color: var(--border-soft);
}
.match-card:hover {
  border-color: rgba(240, 179, 63, 0.55);
  background:
    linear-gradient(90deg, rgba(240, 179, 63, 0.07), rgba(255, 255, 255, 0.018)),
    var(--surface-2);
}
.match-card.victory { border-left-color: var(--good); }
.match-card.defeat { border-left-color: var(--bad); }
.match-card.unknown { border-left-color: var(--text-faint); }
.match-card .match-hero-icon {
  width: 42px;
  height: 42px;
}
.match-hero-name {
  font-size: 15px;
  font-weight: 800;
}
.match-id {
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
}
.match-result,
.match-status,
.match-pill {
  border-radius: 5px;
}
.match-pill {
  background: rgba(255, 255, 255, 0.035);
  border-color: var(--border-soft);
}
.match-pill-ranked {
  color: var(--accent);
  background: rgba(240, 179, 63, 0.10);
  border-color: rgba(240, 179, 63, 0.36);
}
.match-pill-turbo {
  color: var(--info);
  background: rgba(56, 185, 199, 0.10);
  border-color: rgba(56, 185, 199, 0.34);
}
.match-pill-unknown {
  color: var(--text-faint);
  border-style: dashed;
}
.match-reports {
  min-width: 48px;
  padding-left: 10px;
  border-left: 1px solid var(--border-soft);
}
.match-status {
  justify-self: stretch;
  text-align: center;
}

.dashboard-lower {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}
.dash-timeline {
  background: rgba(255, 255, 255, 0.018);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 10px 10px 0;
}
.timeline-stick span {
  border-radius: 4px 4px 0 0;
}

.match-hero-panel {
  background:
    linear-gradient(90deg, rgba(240, 179, 63, 0.10), rgba(56, 185, 199, 0.05)),
    var(--surface);
  border-color: var(--border-soft);
}
.match-insights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

@media (max-width: 1100px) {
  .stat-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-tile-wide { grid-column: span 2; }
  .dash-filters { grid-template-columns: 1fr 1fr; }
  .filter-row-secondary { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  body[data-mode="authed"] .hero { position: static; }
  .anon-hero { min-height: auto; }
  .anon-hero h1 { font-size: clamp(34px, 12vw, 54px); }
  .dash-toolbar,
  .dash-toolbar-right {
    align-items: flex-start;
    flex-direction: column;
  }
  .dash-toolbar-right { margin-left: 0; }
  .stat-strip,
  .analytics-grid,
  .dash-filters,
  .dashboard-lower,
  .match-insights {
    grid-template-columns: 1fr;
  }
  .stat-tile-wide,
  .filter-row-secondary {
    grid-column: auto;
  }
  .filter-row {
    align-items: flex-start;
    flex-direction: column;
  }
  .chip-group {
    width: 100%;
    overflow-x: auto;
  }
  .chip { white-space: nowrap; }
  .match-card {
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-areas:
      "icon info"
      "status reports";
  }
  .match-reports {
    justify-self: end;
    border-left: 0;
    padding-left: 0;
  }
}

/* ─── Conduct import: behavior score panel + cutoff markers ───────────────── */

.import-toggle:hover { border-color: var(--accent); color: var(--accent); }

.import-box {
  background:
    linear-gradient(180deg, rgba(245, 176, 66, 0.06), rgba(255, 255, 255, 0.01)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 0 0 14px;
}
.import-box-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 14px;
}
.import-close {
  background: none;
  border: 0;
  color: var(--text-faint);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.import-close:hover { color: var(--text); }
.import-hint { margin: 0 0 8px; font-size: 12px; color: var(--text-dim); }
.import-hint code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--accent-2);
}
.import-text {
  width: 100%;
  min-height: 64px;
  resize: vertical;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  padding: 8px 10px;
}
.import-text:focus { outline: none; border-color: var(--accent); }
.import-actions { display: flex; align-items: center; gap: 12px; margin-top: 8px; }
.import-msg { font-size: 12px; color: var(--text-dim); margin-right: auto; }
.import-msg.ok  { color: var(--good); }
.import-msg.err { color: var(--bad); }
.import-submit {
  background: var(--accent);
  color: #1a1206;
  border: 0;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 13px;
  padding: 7px 16px;
  cursor: pointer;
}
.import-submit:hover { background: var(--accent-2); }
.import-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.import-steps {
  margin: 4px 0 8px;
  padding-left: 20px;
  font-size: 13px;
  color: var(--text-dim);
}
.import-steps li { margin: 7px 0; }
.import-step-txt { margin-right: 8px; }
.import-steps kbd {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 1px 4px;
  color: var(--text);
}
.bookmarklet-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--accent);
  color: #1a1206;
  font-weight: 700;
  font-size: 12px;
  text-decoration: none;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  cursor: grab;
  white-space: nowrap;
}
.bookmarklet-chip:hover  { background: var(--accent-2); }
.bookmarklet-chip:active { cursor: grabbing; }
.import-manual { margin-top: 4px; }
.import-manual > summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--text-faint);
  list-style: revert;
}
.import-manual > summary:hover { color: var(--text-dim); }
.import-manual .import-text { margin-top: 8px; }
#import-auto-msg { margin-top: 8px; min-height: 16px; }

/* ─── Behavior score panel (Steam conduct import) ───────────────── */

.behavior-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  background:
    radial-gradient(620px 240px at 0% 0%, rgba(74, 222, 128, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.008)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 0 0 14px;
}

.bp-head { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 20px; align-items: center; }
.bp-face {
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 18px currentColor);
  color: var(--accent);
}
.bp-face.great { color: var(--good); }
.bp-face.good  { color: var(--accent-2); }
.bp-face.mid   { color: var(--accent); }
.bp-face.low   { color: #ff8a4c; }
.bp-face.bad   { color: var(--bad); }
.bp-face-svg { width: 100%; height: 100%; display: block; }

.bp-head-text { min-width: 0; }
.bp-kicker {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
  margin-bottom: 6px;
}
.bp-score-row { display: flex; align-items: baseline; gap: 12px; }
.bp-score {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -1px;
  color: var(--text);
}
.bp-score.great { color: var(--good); }
.bp-score.good  { color: var(--accent-2); }
.bp-score.mid   { color: var(--accent); }
.bp-score.low   { color: #ff8a4c; }
.bp-score.bad   { color: var(--bad); }
.bp-delta { font-size: 15px; font-weight: 700; }
.bp-delta.up   { color: var(--good); }
.bp-delta.down { color: var(--bad); }
.bp-delta.flat { color: var(--text-faint); }
.bp-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  margin: 12px 0 8px;
}
.bp-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  transition: width 400ms ease;
  background: var(--accent);
}
.bp-bar span.great { background: var(--good); }
.bp-bar span.good  { background: var(--accent-2); }
.bp-bar span.mid   { background: var(--accent); }
.bp-bar span.low   { background: #ff8a4c; }
.bp-bar span.bad   { background: var(--bad); }
.bp-meta { font-size: 12px; color: var(--text-dim); }
.bp-meta strong { color: var(--text); }

/* Per-window counted-report stats (засчитанные Стимом — gameplay reports,
   comms reports, abandons, commends). NOT mixed into the always-visible
   analytics — those run off PARSED matches only. */
.bp-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bp-stat {
  display: flex;
  align-items: baseline;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 12px;
}
.bp-stat strong {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.bp-stat span { font-size: 11px; color: var(--text-dim); }
.bp-stat.hot  strong { color: var(--bad); }
.bp-stat.hot  { border-color: rgba(239, 90, 90, 0.30); }
.bp-stat.good strong { color: var(--good); }
.bp-stat.good { border-color: rgba(74, 222, 128, 0.30); }

/* Score-over-time chart — wow-effect line graph for zoomers. */
.bp-chart-wrap {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 2px;
}
.bp-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}
.bp-chart-title {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-faint);
}
.bp-chart-caption { font-size: 11px; color: var(--text-faint); }
.bp-chart {
  width: 100%;
  height: 180px;
  display: block;
  color: var(--accent);
}
.bp-chart.great { color: var(--good); }
.bp-chart.good  { color: var(--accent-2); }
.bp-chart.mid   { color: var(--accent); }
.bp-chart.low   { color: #ff8a4c; }
.bp-chart.bad   { color: var(--bad); }
.bp-chart-line  { stroke: currentColor; }
.bp-chart-area  { color: currentColor; }
.bp-chart-grid  { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.bp-chart-label { fill: var(--text-faint); font-size: 10px; font-family: 'JetBrains Mono', monospace; text-anchor: end; }
.bp-chart-dot              { fill: var(--accent); stroke: var(--surface); stroke-width: 1.5; }
.bp-chart-dot.great        { fill: var(--good); }
.bp-chart-dot.good         { fill: var(--accent-2); }
.bp-chart-dot.mid          { fill: var(--accent); }
.bp-chart-dot.low          { fill: #ff8a4c; }
.bp-chart-dot.bad          { fill: var(--bad); }
.bp-chart-axis {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 4px;
  padding: 0 38px 0 38px;
}

@media (max-width: 640px) {
  .bp-head { grid-template-columns: 72px minmax(0, 1fr); gap: 14px; }
  .bp-face { width: 72px; height: 72px; }
  .bp-score { font-size: 38px; }
}

/* ─── Conduct cutoff marker (Apple-style typographic divider) ─────
   Pure typography between two hairlines. NOT clickable: a cutoff is the
   Steam recalculation point, not a match — clicking it never made sense. */
.conduct-marker {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 6px 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', sans-serif;
}
.conduct-marker::before,
.conduct-marker::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--border);
}
.cm-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.2px;
}
.cm-score {
  font-weight: 600;
  color: var(--text);
  font-feature-settings: "tnum";
  letter-spacing: 0.3px;
}
.cm-delta {
  font-weight: 600;
  font-size: 11px;
  color: var(--text-faint);
  font-feature-settings: "tnum";
}
.cm-meta, .cm-date { color: var(--text-faint); font-size: 11px; }
.cm-dot { color: var(--text-faint); opacity: 0.6; }
.conduct-marker.up   .cm-delta { color: var(--good); }
.conduct-marker.down .cm-delta { color: var(--bad); }

/* The cutoff (latest checkpoint) is the headline marker — a touch more
   weight, amber rules, but still no link affordance. */
.conduct-marker.current { margin: 14px 4px; }
.conduct-marker.current::before,
.conduct-marker.current::after { border-top: 1px solid rgba(245, 176, 66, 0.45); }
.conduct-marker.current .cm-score {
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.4px;
}
.cm-cut {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}
.cm-progress {
  font-size: 11px;
  font-weight: 500;
  color: var(--accent-2);
  white-space: nowrap;
  margin-left: 4px;
}

@media (max-width: 720px) {
  .cm-meta, .cm-date, .cm-dot { display: none; }
}

/* Visual separation between the match list and the "Когда тебя репортят"
   panel below it. Without this gap the panel head abuts the last card. */
#dash-reports-breakdown-panel,
#dash-heroes-panel {
  margin-top: 18px;
}

/* ═══════════════════════════════════════════════════════════════════
   v3 — Dotabuff/Stratz minimal skin.
   Flat surfaces, calm typography, a tabular match list. Appended last
   so it wins over the v2 layer. The whole point: less visual noise,
   numbers carry the hierarchy, everything scans like a clean table.
   ═══════════════════════════════════════════════════════════════════ */

/* 1. Flat surfaces — drop the stacked gradients. One solid card colour
      + a hairline border. This is the main declutter lever. (Behavior
      panel keeps its radial glow on purpose — it's the hero element.) */
.stat-tile,
.analysis-panel,
.card,
.empty,
.match-card,
.import-box,
.dash-timeline,
.match-pill,
.chip-group,
.segmented {
  background: var(--surface);
  box-shadow: none;
}

/* 2. Calm micro-labels — kill the HUD-style heavy uppercase tracking.
      Modern/minimal = quiet labels, loud numbers. */
.stat-label,
.panel-kicker,
.bp-kicker,
.filter-kicker,
.bp-chart-title,
.section-h,
.dash-h {
  text-transform: none;
  letter-spacing: 0.2px;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-faint);
}
.dash-h { font-size: 13px; color: var(--text-dim); }
.section-h { font-size: 14px; color: var(--text-dim); margin: 4px 0 10px; }

/* 3. Numbers lead; drop the glows. */
.stat-num { font-weight: 700; letter-spacing: -0.3px; }
.risk-score, .preview-score { text-shadow: none; }

/* 4. Match list → tabular & scannable (Dotabuff feel). Flat row, flat
      hover, result colour only as a thin left rail. */
.cards-list { gap: 4px; }
.match-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 56px;
  transition: background 110ms ease, border-color 110ms ease;
}
.match-card:hover {
  background: var(--surface-2);
  border-color: var(--border-soft);
}
.match-card.victory { border-left: 3px solid var(--good); }
.match-card.defeat  { border-left: 3px solid var(--bad); }
.match-card.unknown { border-left: 3px solid var(--text-faint); }
.match-hero-name { font-weight: 700; }
.match-status { background: transparent; border: 1px solid var(--border); color: var(--text-dim); }
.match-status.done { color: var(--good); border-color: rgba(74,222,128,0.28); }

/* 5. Stat strip + analytics read calmer & lighter. */
.stat-tile     { border: 1px solid var(--border); min-height: 82px; }
.analytics-grid { gap: 10px; }
.analysis-panel { border: 1px solid var(--border); border-radius: 10px; }

/* 6. Chips/segmented — flat track, solid accent only when active. */
.chip-group, .segmented { background: var(--bg-2); border: 1px solid var(--border); }
.chip.active,
.segmented button.active {
  background: var(--accent);
  color: #160f08;
}
.dash-filters { background: rgba(13, 15, 19, 0.92); border: 1px solid var(--border); }

/* 7. Behavior panel: a hair flatter to sit in the same family, but keep
      the green radial + face glow (the deliberate wow moment). */
.behavior-panel { box-shadow: none; }

/* ═══════════════════════════════════════════════════════════════════
   v4 — daily reports chart, thin dropdown filters, compact rhythm.
   Goal: the whole overview (score + chart + KPIs + filters + first
   matches) fits within ~1–1.5 screens.
   ═══════════════════════════════════════════════════════════════════ */

/* ── «Пульс репортов» — hero reports-by-day chart ─────────────────────────── */
/* Compact secondary chart (lives in the rail, not the centerpiece). */
.reports-chart-panel.rc-compact {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 14px 16px 12px;
  box-shadow: var(--shadow);
}

.rc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin-bottom: 6px;
}
.rc-head-left { min-width: 0; }
.rc-head-right { display: flex; align-items: center; gap: 10px; }
.rc-kicker {
  font-size: 11px; color: var(--text-faint); font-weight: 700;
  letter-spacing: 0.16em; text-transform: uppercase;
}
.rc-headline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.rc-total {
  font-size: 28px; font-weight: 800; line-height: 0.95; letter-spacing: -0.02em;
  color: var(--text); font-variant-numeric: tabular-nums;
}
.rc-total-cap { font-size: 13px; color: var(--text-dim); font-weight: 500; }
.rc-trend {
  font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  font-variant-numeric: tabular-nums; border: 1px solid transparent;
}
.rc-trend.up   { color: #ff9d7a; background: rgba(243, 107, 61, 0.14); border-color: rgba(243, 107, 61, 0.30); }
.rc-trend.down { color: #6ee0a3; background: rgba(83, 209, 140, 0.13); border-color: rgba(83, 209, 140, 0.28); }
.rc-trend.flat { color: var(--text-dim); background: rgba(255, 255, 255, 0.05); }
.rc-subline { font-size: 12.5px; color: var(--text-dim); font-weight: 500; margin-top: 7px; }

.rc-periods {
  display: inline-flex; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 3px;
}
.rc-periods button {
  border: 0; background: transparent; color: var(--text-dim);
  font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 7px; cursor: pointer;
  font-family: inherit; transition: color 0.15s, background 0.15s;
}
.rc-periods button:hover { color: var(--text); }
.rc-periods button.active { background: var(--accent); color: #160f08; }
.rc-share {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px; border-radius: 10px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; font-family: inherit; color: var(--text);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  border: 1px solid var(--border); transition: transform 0.15s, border-color 0.15s, box-shadow 0.2s;
}
.rc-share:hover { transform: translateY(-1px); border-color: var(--accent); box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4); }
.rc-share:active { transform: scale(0.97); }
.rc-share.busy { opacity: 0.6; pointer-events: none; }

.rc-legend { display: flex; gap: 16px; flex-wrap: wrap; margin: 12px 0 6px; }
.rc-lg { font-size: 11.5px; color: var(--text-dim); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.rc-lg::before { content: ''; width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rc-lg.enemy::before { background: linear-gradient(180deg, #46d2e0, #26818d); }
.rc-lg.team::before  { background: linear-gradient(180deg, #ff8f60, #e84e26); }
.rc-lg.clean::before { background: var(--good); border-radius: 50%; }
.rc-lg.spike::before { background: var(--bad); box-shadow: 0 0 8px var(--bad); }

.rc-stage { position: relative; width: 100%; height: 140px; margin-top: 2px; }
.rc-chart { width: 100%; height: 100%; display: block; overflow: visible; }

.rc-base { stroke: rgba(255, 255, 255, 0.10); stroke-width: 1; }
.rc-norm { stroke: rgba(255, 255, 255, 0.22); stroke-width: 1; stroke-dasharray: 3 5; }
.rc-norm-cap { fill: var(--text-faint); font-size: 10px; font-family: 'JetBrains Mono', monospace; }
.rc-seg.enemy { fill: url(#rcEnemy); }
.rc-seg.team  { fill: url(#rcTeam); }
.rc-seg.enemy.spike { fill: #e65b5b; }
.rc-seg.team.spike  { fill: #ff7048; }
.rc-div   { fill: rgba(255, 255, 255, 0.42); }
.rc-glow  { fill: var(--bad); filter: url(#rcBlur); opacity: 0.34; }
.rc-clean { fill: var(--good); opacity: 0.85; }
.rc-env   { fill: none; stroke: #5ad3e0; stroke-width: 1.6; opacity: 0.5; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 4px rgba(90, 211, 224, 0.45)); }
.rc-spike-dot { fill: #fff; }
.rc-spike-num { fill: var(--text); font-size: 11px; font-weight: 800; font-family: 'Inter', sans-serif; }
.rc-day { transition: opacity 0.18s ease; }
.rc-chart rect.rc-hit { cursor: crosshair; }

.rc-axis {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-faint);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 6px; padding: 0 6px;
}

/* glass tooltip */
.rc-tip {
  position: absolute; left: 0; top: 0; pointer-events: none; z-index: 6;
  min-width: 156px; padding: 11px 13px; border-radius: 13px;
  background: rgba(18, 20, 26, 0.86); backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border-soft); box-shadow: 0 16px 38px rgba(0, 0, 0, 0.5);
  opacity: 0; transform: translateY(6px); transition: opacity 0.13s, transform 0.13s;
}
.rc-tip.show { opacity: 1; transform: translateY(0); }
.rc-tip-d { font-size: 12px; color: var(--text-faint); font-weight: 600; margin-bottom: 6px; }
.rc-tip-big { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.rc-tip-big span { font-size: 13px; font-weight: 600; color: var(--text-dim); margin-left: 5px; }
.rc-tip-split { display: flex; gap: 13px; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--text-dim); }
.rc-tip-split span { display: inline-flex; align-items: center; gap: 5px; }
.rc-tip-split i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.rc-tip-split .e i { background: #39c0cf; }
.rc-tip-split .t i { background: #f36b3d; }
.rc-tip-tag { display: inline-block; margin-top: 9px; font-size: 11px; font-weight: 700; padding: 3px 9px; border-radius: 7px; background: rgba(255, 255, 255, 0.06); color: var(--text-dim); }
.rc-tip-tag.spike { background: rgba(241, 94, 94, 0.16); color: #ff8a7e; }
.rc-tip-tag.clean { background: rgba(83, 209, 140, 0.15); color: #6ee0a3; }
.rc-tip-tag.team  { background: rgba(243, 107, 61, 0.15); color: #ff9d7a; }
.rc-tip-tag.muted { opacity: 0.7; }

/* KPI row under the chart */
.rc-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.rc-kpi {
  background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-soft);
  border-radius: 12px; padding: 13px 15px;
}
.rc-kpi-val { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }
.rc-kpi-lab { font-size: 12px; color: var(--text-dim); font-weight: 600; margin-top: 6px; }
.rc-kpi-sub { font-size: 11px; color: var(--text-faint); font-weight: 500; margin-top: 2px; }
.rc-kpi.bad  .rc-kpi-val { color: var(--bad); }
.rc-kpi.good .rc-kpi-val { color: var(--good); }
.rc-kpi.warn .rc-kpi-val { color: var(--accent); }
.rc-kpi.info .rc-kpi-val { color: var(--info); }

@media (max-width: 560px) {
  .reports-chart-panel.rc-hero { padding: 18px 16px 14px; border-radius: 14px; }
  .rc-total { font-size: 42px; }
  .rc-head-right { width: 100%; justify-content: space-between; }
  .rc-kpis { grid-template-columns: 1fr 1fr; }
  .rc-kpi:nth-child(3) { grid-column: 1 / -1; }
}

/* Thin dropdown filter row — replaces the old chip-group block. The base
   `.dash-filters` sets flex-direction:column, so we MUST reset it to row here
   or the dropdowns stack vertically. */
.dash-filters {
  position: static;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 0;
  margin: 0 0 12px;
  background: transparent;
  border: 0;
  backdrop-filter: none;
}
.thin-select, .thin-search {
  height: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  padding: 0 10px;
}
.thin-select {
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  padding-right: 24px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6' fill='none' stroke='%238b94a4' stroke-width='1.6'><path d='M1 1l4 4 4-4'/></svg>");
  background-repeat: no-repeat;
  background-position: right 8px center;
}
.thin-search { flex: 1; min-width: 150px; }
.thin-select:hover, .thin-search:hover { border-color: var(--border-soft); }
.thin-select:focus, .thin-search:focus { outline: none; border-color: var(--accent); }
.thin-select option { background: var(--surface-2); color: var(--text); }

/* Compact rhythm — squeeze the overview into ~1.5 screens. */
.dashboard { padding-top: 16px; }
.behavior-panel { padding: 14px 16px; gap: 10px; margin-bottom: 12px; }
.behavior-panel .bp-head { grid-template-columns: 74px minmax(0, 1fr); gap: 16px; }
.behavior-panel .bp-face { width: 74px; height: 74px; }
.behavior-panel .bp-score { font-size: 40px; }
.behavior-panel .bp-bar { margin: 9px 0 6px; }
.stat-strip { margin-bottom: 12px; }
.stat-tile { min-height: 70px; padding: 10px 14px; }
.stat-num { font-size: 22px; }
.stat-sub { font-size: 11px; }

/* Secondary analytics block sits below the match list, clearly separated. */
.dash-secondary {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.dash-secondary .analytics-grid { margin-bottom: 14px; }

@media (max-width: 760px) {
  .dash-filters { gap: 5px; }
  .thin-select { flex: 1 1 calc(50% - 5px); }
  .thin-search { flex: 1 1 100%; }
}

/* ── Insights row — "когда тебя репортят" + "часто выбираемые герои" (moved up
   above the match list). Flex so a single visible panel fills the width. ── */
.insights-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0 0 12px;
  align-items: stretch;
}
.insights-row > section {
  flex: 1 1 340px;
  min-width: 0;
  margin: 0;
}
.insights-row #dash-heroes-panel { flex-grow: 1.3; }
/* Narrow panel → stack the win/loss + minute-bucket blocks vertically. */
.insights-row .reports-breakdown { grid-template-columns: 1fr; gap: 14px; }
.insights-row .panel-title-row h3 { font-size: 14px; margin: 0 0 8px; }

/* Link to the GCPD page inside the import steps (not the bookmarklet chip). */
.import-steps a:not(.bookmarklet-chip) {
  color: var(--accent-2);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
}
.import-steps a:not(.bookmarklet-chip):hover { color: var(--accent); }

/* Match-list pagination. */
.dash-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 4px 0 20px;
}
.dash-pagination .page-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 120ms ease, color 120ms ease;
}
.dash-pagination .page-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.dash-pagination .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dash-pagination .page-info { font-size: 12px; color: var(--text-dim); white-space: nowrap; }
.dash-pagination .page-info strong { color: var(--text); font-family: 'JetBrains Mono', monospace; }

/* ─── 2026 dashboard layout — wide main feed + context rail ─────────────────── */
/* Default (mobile/tablet): single column — the rail just flows under main. */
.dash-main { min-width: 0; }
.dash-rail { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.dash-rail .analytics-grid,
.dash-rail .insights-row { margin: 0; }

@media (min-width: 1200px) {
  /* Container width is the same 1280px everywhere (header, dashboard, match
     page). The dashboard splits that width into a main feed + a 320px context
     rail; the rail collapses to a single column at narrower viewports. */
  .dash-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    column-gap: 24px;
    align-items: start;
  }
  /* In the narrow rail every cluster collapses to a single column. */
  .dash-rail .analytics-grid,
  .dash-rail .insights-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .dash-rail .behavior-panel { margin: 0; }
}

/* ─── Conduct nudge — every-~14-games behavior-score refresh prompt ─────────── */
.conduct-nudge {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center;
  gap: 12px; padding: 14px 14px 14px 16px; border-radius: 14px;
  background: linear-gradient(180deg, var(--surface), var(--bg-2));
  border: 1px solid var(--border-soft);
}
.cn-glow { position: absolute; inset: 0; pointer-events: none; opacity: 0.55; }
.cn-icon {
  width: 34px; height: 34px; border-radius: 10px; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 700; color: var(--accent);
  background: rgba(240, 179, 63, 0.12); border: 1px solid rgba(240, 179, 63, 0.25);
}
.cn-body { min-width: 0; position: relative; }
.cn-title { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.cn-sub { font-size: 12px; color: var(--text-dim); margin-top: 3px; line-height: 1.35; }
.cn-progress { height: 5px; border-radius: 99px; background: rgba(255, 255, 255, 0.07); margin-top: 9px; overflow: hidden; }
.cn-progress > span { display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--info), var(--accent)); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.cn-action {
  position: relative; align-self: center; white-space: nowrap;
  height: 32px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
  color: var(--text); font-weight: 600; font-size: 12.5px; cursor: pointer; font-family: inherit;
  transition: transform 0.15s, border-color 0.15s;
}
.cn-action:hover { transform: translateY(-1px); border-color: var(--accent); }
.cn-action[hidden] { display: none; }
.cn-dismiss {
  align-self: start; background: transparent; border: 0; color: var(--text-faint);
  font-size: 17px; line-height: 1; cursor: pointer; padding: 0 2px; position: relative;
}
.cn-dismiss:hover { color: var(--text); }

/* Due — animated, gold accent (Steam recomputed; time to refresh). */
.conduct-nudge.due { border-color: rgba(240, 179, 63, 0.35); }
.conduct-nudge.due .cn-glow { background: radial-gradient(130% 150% at 100% 0%, rgba(240, 179, 63, 0.18), transparent 60%); animation: cnBreathe 3.2s ease-in-out infinite; }
.conduct-nudge.due .cn-icon { animation: cnSpinPulse 3.4s ease-in-out infinite; }
.conduct-nudge.due::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 32%, rgba(255, 255, 255, 0.07) 50%, transparent 68%);
  transform: translateX(-120%); animation: cnShimmer 3.8s ease-in-out infinite;
}
/* Onboard — calmer, cyan (never imported). */
.conduct-nudge.onboard .cn-icon { color: var(--info); background: rgba(56, 185, 199, 0.12); border-color: rgba(56, 185, 199, 0.28); }
.conduct-nudge.onboard .cn-glow { background: radial-gradient(130% 150% at 100% 0%, rgba(56, 185, 199, 0.14), transparent 60%); animation: cnBreathe 4.6s ease-in-out infinite; }
/* Progress — quiet, green, no animation (up to date). */
.conduct-nudge.progress .cn-icon { color: var(--good); background: rgba(83, 209, 140, 0.10); border-color: rgba(83, 209, 140, 0.22); }
.conduct-nudge.progress .cn-glow { opacity: 0; }

@keyframes cnBreathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
@keyframes cnSpinPulse { 0%, 100% { transform: rotate(0) scale(1); } 50% { transform: rotate(180deg) scale(1.08); } }
@keyframes cnShimmer { 0% { transform: translateX(-120%); } 55%, 100% { transform: translateX(120%); } }
@media (prefers-reduced-motion: reduce) {
  .conduct-nudge .cn-glow, .conduct-nudge .cn-icon, .conduct-nudge::after { animation: none !important; }
}

/* Dotabuff-style lane + region pills on match cards. */
.match-pill-lane {
  color: #b89bff;
  border-color: rgba(170, 140, 255, 0.32);
  background: rgba(170, 140, 255, 0.10);
}
/* Регион — не плашка, а тихая подпись с иконкой-глобусом. */
.match-region {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: var(--text-faint);
  background: none;
  border: 0;
  padding: 0;
}
.match-region::before {
  content: "";
  width: 12px;
  height: 12px;
  flex: none;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M3 12h18'/><path d='M12 3a14 14 0 0 1 0 18'/><path d='M12 3a14 14 0 0 0 0 18'/></svg>") center/contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><circle cx='12' cy='12' r='9'/><path d='M3 12h18'/><path d='M12 3a14 14 0 0 1 0 18'/><path d='M12 3a14 14 0 0 0 0 18'/></svg>") center/contain no-repeat;
  opacity: 0.7;
}

/* Иконки ролей: SVG в /icons/positions/pos-N.svg, отрисовываются как
   CSS-маска, чтобы наследовать цвет позиции от родителя. */
.pos-ic {
  display: inline-block;
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  -webkit-mask-position: center;
          mask-position: center;
  -webkit-mask-size: contain;
          mask-size: contain;
  -webkit-mask-repeat: no-repeat;
          mask-repeat: no-repeat;
}
.pos-ic-1 { -webkit-mask-image: url("/icons/positions/pos-1.png");    mask-image: url("/icons/positions/pos-1.png"); }
.pos-ic-2 { -webkit-mask-image: url("/icons/positions/pos-2.png");    mask-image: url("/icons/positions/pos-2.png"); }
.pos-ic-3 { -webkit-mask-image: url("/icons/positions/pos-3.png");    mask-image: url("/icons/positions/pos-3.png"); }
.pos-ic-4 { -webkit-mask-image: url("/icons/positions/pos-4.png");    mask-image: url("/icons/positions/pos-4.png"); }
.pos-ic-5 { -webkit-mask-image: url("/icons/positions/pos-5.png");    mask-image: url("/icons/positions/pos-5.png"); }

.pos-badge { position: relative; gap: 0; }
.pos-badge .pos-ic { width: 20px; height: 20px; }
.pos-badge .pos-num {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--text-dim);
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
}
.match-pill-lane { display: inline-flex; align-items: center; gap: 5px; }
.match-pill-lane .pos-ic { width: 13px; height: 13px; }

/* «На какой позиции тебя репортят» — reports-per-match bars by position 1-5. */
.pos-bars { display: flex; flex-direction: column; gap: 8px; }
.pos-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: center; padding: 6px 8px; border-radius: 10px; }
.pos-row.worst { background: rgba(241, 94, 94, 0.07); box-shadow: inset 0 0 0 1px rgba(241, 94, 94, 0.22); }
.pos-badge { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; font-family: 'JetBrains Mono', monospace; color: var(--text); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); }
.pos-badge.p1 { color: #ffd27a; } .pos-badge.p2 { color: #7fd0ea; } .pos-badge.p3 { color: #ff9d7a; } .pos-badge.p4 { color: #9fe0b6; } .pos-badge.p5 { color: #b89bff; }
.pos-meta { min-width: 0; }
.pos-name { font-size: 12.5px; font-weight: 600; color: var(--text-dim); display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.pos-flag { font-size: 10px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--bad); background: rgba(241, 94, 94, 0.14); padding: 2px 7px; border-radius: 6px; }
.pos-track { height: 7px; border-radius: 99px; background: rgba(255, 255, 255, 0.06); overflow: hidden; }
.pos-fill { display: block; height: 100%; border-radius: 99px; transition: width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.pos-fill.cool { background: linear-gradient(90deg, #3d8fe0, var(--info)); }
.pos-fill.warm { background: linear-gradient(90deg, var(--accent), #ffce6b); }
.pos-fill.hot  { background: linear-gradient(90deg, var(--accent-2), var(--bad)); }
.pos-stat { text-align: right; white-space: nowrap; }
.pos-stat strong { display: block; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.pos-stat small { display: block; font-size: 10.5px; color: var(--text-faint); margin-top: 3px; }

/* ── UX polish: skeleton, reset-filters, back-to-top, focus rings ──────────── */
.dash-skeleton { display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.sk { border-radius: 12px; background: linear-gradient(100deg, var(--surface) 40%, var(--surface-2) 50%, var(--surface) 60%); background-size: 200% 100%; animation: skShimmer 1.4s ease-in-out infinite; border: 1px solid var(--border-soft); }
.sk-strip { height: 92px; }
.sk-row { height: 34px; max-width: 680px; }
.sk-card { height: 58px; }
@keyframes skShimmer { 0% { background-position: 130% 0; } 100% { background-position: -30% 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

.thin-reset {
  height: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer;
  font-size: 12px; font-weight: 600; font-family: inherit;
  color: var(--bad); background: rgba(241, 94, 94, 0.08);
  border: 1px solid rgba(241, 94, 94, 0.30);
  transition: background 0.15s, color 0.15s;
}
.thin-reset:hover { background: rgba(241, 94, 94, 0.16); }
.empty-reset {
  display: inline-block; margin-left: 10px; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; font-weight: 600; font-family: inherit;
  color: var(--text); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--border);
  transition: border-color 0.15s;
}
.empty-reset:hover { border-color: var(--accent); color: var(--accent); }

.back-top {
  position: fixed; right: 22px; bottom: 22px; z-index: 60;
  width: 42px; height: 42px; border-radius: 50%; cursor: pointer;
  font-size: 18px; font-weight: 700; color: var(--text);
  background: rgba(22, 24, 30, 0.85); backdrop-filter: blur(10px);
  border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s, border-color 0.15s;
}
.back-top:hover { transform: translateY(-3px); border-color: var(--accent); }

/* Keyboard affordance — visible focus ring on interactive elements, including
   the now-focusable match cards. Mouse clicks don't trigger it. */
.match-card:focus-visible,
.page-btn:focus-visible,
.thin-select:focus-visible,
.thin-search:focus-visible,
.thin-reset:focus-visible,
.back-top:focus-visible,
.rc-periods button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}


/* ═══════════════════════════════════════════════════════════════════
   Anonymous landing — full redesign (v2).
   Vertical flow: hero-top (copy + example report) → how-it-works → value
   props. Appended last so it overrides earlier hero/grid rules.
   ═══════════════════════════════════════════════════════════════════ */

.anon-hero {
  display: flex;
  flex-direction: column;
  gap: 60px;
  padding: 8px 0 48px;
}

/* ── Hero top: pitch + example ──────────────────────────────────── */
.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 430px;
  column-gap: 56px;
  align-items: center;
  min-height: calc(100vh - 210px);
}
.hero-copy { min-width: 0; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  padding: 6px 13px 6px 10px;
  border-radius: 999px;
  background: rgba(240, 179, 63, 0.08);
  border: 1px solid rgba(240, 179, 63, 0.22);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.hero-eyebrow-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(240, 179, 63, 0.55);
  animation: heroDot 2.4s ease-out infinite;
}
@keyframes heroDot {
  0%   { box-shadow: 0 0 0 0 rgba(240, 179, 63, 0.5); }
  70%  { box-shadow: 0 0 0 8px rgba(240, 179, 63, 0); }
  100% { box-shadow: 0 0 0 0 rgba(240, 179, 63, 0); }
}

.anon-hero h1 {
  max-width: 14ch;
  font-size: clamp(38px, 6vw, 74px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
}
.anon-hero .accent {
  background: linear-gradient(100deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.anon-hero .subtitle {
  max-width: 54ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 26px;
}
.anon-hero .subtitle em {
  font-style: normal;
  font-weight: 700;
  color: var(--text);
}
.anon-hero .hint {
  margin-top: 16px;
  color: var(--text-faint);
  font-size: 13px;
}

.hero-trust {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px 10px;
}
.hero-trust li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--text-dim);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
}
.hero-trust li::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--good);
  flex-shrink: 0;
}

/* ── Example report card (mirrors real product UI) ──────────────── */
.ex-report {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.014)),
    var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}
.ex-report::before {
  content: '';
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 100% 0%, rgba(240, 179, 63, 0.13), transparent 55%);
}
.ex-head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.ex-head-l { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ex-tag {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent);
}
.ex-match { font-family: 'JetBrains Mono', monospace; font-size: 12.5px; color: var(--text-dim); }
.ex-meta {
  font-size: 11px; font-weight: 700; color: var(--text-faint);
  padding: 5px 9px; border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}

.ex-rows { position: relative; display: flex; flex-direction: column; gap: 8px; }
.ex-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--text-faint);
}
.ex-row.enemy    { border-left-color: var(--bad); }
.ex-row.friendly { border-left-color: var(--info); }
.ex-time {
  font-family: 'JetBrains Mono', monospace; font-weight: 700;
  font-size: 13px; color: var(--accent);
}
.ex-who { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13.5px; }
.ex-ava {
  flex-shrink: 0;
  width: 26px; height: 26px; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800;
  color: #0c0c0e;
  background: var(--c, var(--text-faint));
}
.ex-ava--you {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #150f08;
}
.ex-name {
  font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ex-arrow { color: var(--text-faint); }
.ex-badge {
  font-size: 10px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 6px; white-space: nowrap;
}
.ex-badge.enemy    { background: rgba(241, 94, 94, 0.15); color: var(--bad); }
.ex-badge.friendly { background: rgba(56, 185, 199, 0.15); color: var(--info); }

.ex-foot {
  position: relative;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 14px; margin-top: 16px;
}
.ex-foot-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ex-foot-kicker {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-faint);
}
.ex-foot-sub { font-size: 12px; color: var(--text-dim); }
.ex-score {
  font-family: 'JetBrains Mono', monospace; font-weight: 800;
  font-size: 44px; line-height: 0.9; color: var(--accent);
  text-shadow: 0 0 28px rgba(240, 179, 63, 0.25);
  white-space: nowrap;
}
.ex-score span { font-size: 18px; color: var(--text-faint); margin-left: 1px; }
.ex-bar {
  position: relative;
  margin-top: 12px; height: 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); overflow: hidden;
}
.ex-bar span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--good), var(--accent), var(--bad));
}

/* ── Section heading shared by steps + features ─────────────────── */
.hero-sec-h {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ── How it works ──────────────────────────────────────────────── */
.hero-steps ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.step {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 18px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012)),
    var(--surface);
  border: 1px solid var(--border-soft);
}
.step-num {
  flex-shrink: 0;
  width: 34px; height: 34px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: 'JetBrains Mono', monospace; font-weight: 800; font-size: 16px;
  color: var(--accent);
  background: rgba(240, 179, 63, 0.10);
  border: 1px solid rgba(240, 179, 63, 0.24);
}
.step-body h3 { margin: 4px 0 5px; font-size: 15px; font-weight: 700; color: var(--text); }
.step-body p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-dim); }

/* ── Value props ───────────────────────────────────────────────── */
.hero-features {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
.hero-features--4 { grid-template-columns: repeat(4, 1fr); gap: 14px; }

/* ── Closing CTA — single centered line under all value-prop sections ─── */
.hero-closing {
  margin: 36px auto 0;
  max-width: 64ch;
  text-align: center;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
}

/* Short trust line sitting between subtitle and the analyze form. Calmer
   than the subtitle but bigger than the hint. */
.hero-disclaimer {
  margin: 10px 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-faint);
}

/* One-line lead-in under .hero-sec-h, used by «Что внутри отчёта»,
   «Как это работает технически», «Зачем всё это?». */
.hero-vp-intro {
  margin: -8px 0 16px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-dim);
}

/* Plain prose under .hero-sec-h when a section is a single paragraph instead
   of a feature grid (used by «Зачем всё это?»). */
.hero-vp-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-dim);
  max-width: 64ch;
}
.hf {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 18px;
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.01)),
    var(--surface);
  border: 1px solid var(--border-soft);
}
.hf-ic {
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 11px;
  color: var(--accent);
  background: rgba(240, 179, 63, 0.10);
  border: 1px solid rgba(240, 179, 63, 0.22);
}
.hf-ic svg { width: 21px; height: 21px; }
.hf-body h3 { margin: 2px 0 5px; font-size: 15px; font-weight: 700; color: var(--text); }
.hf-body p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--text-dim); }

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 980px) {
  .hero-top {
    grid-template-columns: 1fr;
    row-gap: 36px;
    min-height: 0;
  }
  .ex-report { max-width: 520px; }
  .hero-steps ol,
  .hero-features--4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .hero-steps ol,
  .hero-features,
  .hero-features--4 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .anon-hero { gap: 44px; }
  .anon-hero h1 { font-size: clamp(32px, 11vw, 46px); }
  .ex-score { font-size: 38px; }
}

/* ═══════════════════════════════════════════════════════════════════
   v5 — calm match row. One loud thing per row: the reports number.
   Mode/region/status all whisper; result lives in a thin left rail;
   role is a quiet caption, not a plaque.
   ═══════════════════════════════════════════════════════════════════ */

/* Status no longer has its own column — it's a quiet inline tag in line 2. */
.match-card {
  grid-template-columns: 44px minmax(0, 1fr) 64px;
  grid-template-areas: "icon info reports";
  align-items: center;
}

/* Thin result rail (was 3px) — the single win/loss signal now that the
   explicit W/L badge is gone. */
.match-card.victory { border-left: 2px solid var(--good); }
.match-card.defeat  { border-left: 2px solid var(--bad); }
.match-card.unknown { border-left: 2px solid var(--text-faint); }

/* Line 1: just hero name + a quiet role caption. */
.match-line1 { gap: 10px; align-items: baseline; }

/* Role: icon + «мид · поз. 2», quiet — no background, no border, no plaque. */
.match-lane {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  border: 0;
  padding: 0;
  letter-spacing: 0;
  text-transform: none;
}
.match-lane .pos-ic { width: 13px; height: 13px; opacity: 0.85; }

/* Mode: small grey inline text in line 2 (was a loud uppercase pill). */
.match-mode {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  letter-spacing: 0;
  text-transform: none;
}
.match-mode.ranked { color: rgba(240, 179, 63, 0.78); }

/* Status: a small coloured dot + muted label — a state indicator, not a
   button. Pushed to the right end of the meta line, away from the number. */
.match-line2 { align-items: center; }
.match-line2 .match-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: none;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-faint);
}
.match-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
  background: var(--text-faint);
}
.match-status.done .match-status-dot    { background: var(--good); }
.match-status.queued .match-status-dot,
.match-status.running .match-status-dot { background: var(--info); }
.match-status.failed .match-status-dot  { background: var(--bad); }

/* Reports: the one accent. Bigger number, clear divider, breathing room. */
.match-card .match-reports {
  border-left: 1px solid var(--border-soft);
  padding-left: 12px;
  min-width: 56px;
}
.match-card .match-reports-num { font-size: 24px; font-weight: 800; }

/* Override the older breakpoints (≤700 / ≤560) that stacked a separate
   "status" grid column — status is inline now, so keep the 3-item row. */
@media (max-width: 700px) {
  .match-card {
    grid-template-columns: 48px minmax(0, 1fr) auto;
    grid-template-areas: "icon info reports";
  }
  .match-card .match-reports {
    grid-area: reports;
    grid-column: auto;
    justify-self: end;
    border-left: 1px solid var(--border-soft);
    padding-left: 12px;
  }
}
@media (max-width: 560px) {
  .match-line2 { flex-wrap: wrap; }
  .match-line2 .match-status { margin-left: 0; }
}

/* ════════════════════════════════════════════════════════════════════
 * Ideas board + player leaderboard. Fully additive — no existing rule is
 * touched, so ranking pages are unaffected.
 * ════════════════════════════════════════════════════════════════════ */

/* Topbar nav — segmented control in the Apple HIG style. Heroes / Matches
   are public; the Dashboard tab is `hidden` in markup for anon and revealed
   in JS once /auth/me resolves authed. Same shell either way — the only
   visible difference between anon and authed is the presence of one extra
   pill, not a different layout. */
#main-nav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 22px;
  margin-right: auto;
  padding: 3px;
  background: color-mix(in srgb, var(--text) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--text-dim);
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.nav-link:hover { color: var(--text); }
.nav-link.is-active {
  color: var(--text);
  background: var(--bg, #0c0e12);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 0 0 0.5px color-mix(in srgb, var(--text) 8%, transparent);
}

/* Header ideas icon */
.nav-icon {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: var(--text-dim);
  text-decoration: none;
  transition: background .15s, color .15s, transform .15s;
}
.nav-icon svg { width: 20px; height: 20px; }
.nav-icon:hover { color: var(--accent); background: var(--surface-2); transform: translateY(-1px); }
.nav-icon.is-active { color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }

/* Left-edge pull-out → ideas */
.ideas-fab {
  position: fixed;
  left: 0;
  top: 72%;
  z-index: 70;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 60px;
  padding: 15px 10px 17px;
  border: 0;
  border-radius: 0 16px 16px 0;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-2) 100%);
  color: #2a1c00;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
  transform: translateX(-50%);
  transition: transform .3s cubic-bezier(.22, .9, .3, 1.2), box-shadow .3s, filter .2s;
  animation: ideasPeek 3.4s ease-in-out infinite;
  overflow: hidden;
}
body[data-mode="authed"] .ideas-fab { display: flex; }
.ideas-fab:hover, .ideas-fab:focus-visible {
  transform: translateX(0);
  animation: none;
  outline: none;
  filter: brightness(1.05);
  box-shadow: 0 12px 38px color-mix(in srgb, var(--accent) 50%, transparent);
}
.ideas-fab-ic { width: 27px; height: 27px; position: relative; z-index: 1; }
.ideas-fab-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .02em;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  position: relative;
  z-index: 1;
}
.ideas-fab-glow {
  position: absolute;
  inset: -40% -60%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .6), transparent 60%);
  opacity: 0;
  transition: opacity .3s;
}
.ideas-fab:hover .ideas-fab-glow { opacity: .4; }
@keyframes ideasPeek {
  0%, 100% { transform: translateX(-50%); }
  50%      { transform: translateX(-38%); }
}

.ideas-view { padding-top: 18px; }
.ideas-head { margin-bottom: 16px; }
.ideas-title { margin: 0 0 6px; }
.ideas-intro { margin: 0; color: var(--text-dim); max-width: 60ch; }

/* Sub-tabs */
.ideas-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-bottom: 20px;
}
.ideas-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--text-dim);
  font: inherit;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.ideas-tab:hover { color: var(--text); }
.ideas-tab.is-active { color: var(--bg); background: var(--accent); }

/* Propose form */
.idea-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 22px;
}

/* Anon CTA shown where .idea-form would normally sit. Same chrome (surface +
   border + radius) so it doesn't look bolted on. */
.ideas-anon-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.ideas-anon-cta-text {
  margin: 0;
  color: var(--text-dim);
  font-size: 14px;
  flex: 1 1 280px;
}
.idea-title-input, .idea-body-input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
  resize: vertical;
}
.idea-title-input { font-weight: 600; }
.idea-title-input:focus, .idea-body-input:focus {
  outline: none;
  border-color: var(--accent);
}
.idea-form-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}
.idea-form-msg { font-size: 13px; color: var(--text-dim); margin-right: auto; }
.idea-form-msg.is-ok { color: var(--good); }
.idea-form-msg.is-err { color: var(--bad); }
.idea-submit {
  appearance: none;
  border: 0;
  background: var(--accent);
  color: var(--bg);
  font: inherit;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: filter .15s;
}
.idea-submit:hover { filter: brightness(1.07); }
.idea-submit:disabled { opacity: .55; cursor: default; }

.ideas-skeleton { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }

/* Three columns */
.ideas-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: start;
}
.ideas-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 120px;
}
.ideas-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.ideas-col-title { font-weight: 700; font-size: 14px; letter-spacing: .01em; }
.ideas-col[data-status="proposed"]    .ideas-col-title { color: var(--info); }
.ideas-col[data-status="in_progress"] .ideas-col-title { color: var(--accent); }
.ideas-col[data-status="done"]        .ideas-col-title { color: var(--good); }
.ideas-col-count {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-2);
  border-radius: 999px;
  padding: 2px 9px;
  min-width: 24px;
  text-align: center;
}
.ideas-col-list { display: flex; flex-direction: column; gap: 10px; }
.ideas-col-empty {
  color: var(--text-faint);
  font-size: 13px;
  text-align: center;
  padding: 18px 0;
}

/* Idea card */
.idea-card {
  display: flex;
  gap: 10px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  position: relative;
}
.idea-vote {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  min-width: 42px;
  padding: 6px 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.idea-vote:hover { border-color: var(--accent); color: var(--text); }
.idea-vote.is-voted {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
}
.idea-vote:disabled { opacity: .6; cursor: default; }
.idea-vote-ic { font-size: 11px; line-height: 1; }
.idea-vote-n { font-size: 15px; font-weight: 800; line-height: 1.1; }
.idea-main { min-width: 0; flex: 1; }
.idea-card-title { margin: 0 0 4px; font-size: 14.5px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.idea-body { margin: 0 0 8px; font-size: 13px; color: var(--text-dim); line-height: 1.45; word-break: break-word; white-space: pre-wrap; }
.idea-meta { display: flex; align-items: center; gap: 6px; }
.idea-ava { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.idea-ava--ph { background: var(--surface-2); }
.idea-author { font-size: 12px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.idea-admin {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity .15s;
}
.idea-card:hover .idea-admin, .idea-admin:focus-within { opacity: 1; }
.idea-move, .idea-del {
  appearance: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  border-radius: 5px;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  transition: background .15s, color .15s, border-color .15s;
}
.idea-move:hover { color: var(--accent); border-color: var(--accent); }
.idea-del:hover { color: var(--bad); border-color: var(--bad); }

/* Leaderboard */
.leaderboard-note { color: var(--text-dim); font-size: 13px; margin: 0 0 14px; }
.leaderboard-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.leaderboard { width: 100%; border-collapse: collapse; font-size: 14px; }
.leaderboard thead th {
  text-align: right;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--text-faint);
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.leaderboard th.lb-rank, .leaderboard th.lb-player { text-align: left; }
.leaderboard tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: right; }
.leaderboard tbody tr:last-child td { border-bottom: 0; }
.leaderboard tbody tr:hover { background: var(--bg-2); }
.lb-rank { width: 1%; white-space: nowrap; text-align: left !important; color: var(--text-dim); font-weight: 700; }
.lb-rank--top { color: var(--accent); }
.lb-rank--1 { color: #ffd35c; }
.lb-rank--2 { color: #cfd6e2; }
.lb-rank--3 { color: #e3a06a; }
.lb-player { text-align: left !important; }
.lb-player-cell { display: inline-flex; align-items: center; gap: 9px; }
.lb-ava { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.lb-ava--ph { background: var(--surface-2); }
.lb-num { font-variant-numeric: tabular-nums; color: var(--text-dim); }
.lb-score { color: var(--text); font-weight: 800; }

@media (max-width: 860px) {
  .ideas-columns, .ideas-skeleton { grid-template-columns: 1fr; }
  #main-nav { margin-left: 8px; }
  .nav-link { padding: 6px 9px; }
}
@media (max-width: 560px) {
  .leaderboard thead th:nth-child(4),
  .leaderboard tbody td:nth-child(4),
  .leaderboard thead th:nth-child(5),
  .leaderboard tbody td:nth-child(5) { display: none; }
  .ideas-fab { top: auto; bottom: 84px; width: 52px; }
  .ideas-fab-ic { width: 23px; height: 23px; }
}
@media (prefers-reduced-motion: reduce) {
  .ideas-fab { animation: none; transform: translateX(-38%); }
}

/* ════════════════════════════════════════════════════════════════════
 * Public analytics views (/heroes, /matches). Shared table chrome,
 * per-view tweaks where the columns differ.
 * ════════════════════════════════════════════════════════════════════ */

.analytics-view { padding: 16px 0 64px; }

.analytics-toolbar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 0 0 14px;
  flex-wrap: wrap;
}
.analytics-toolbar .section-h { margin: 0; }
.analytics-toolbar input[type="search"] {
  flex: 0 1 280px;
  margin-left: auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
}
.analytics-toolbar input[type="search"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}

.analytics-table-wrap { overflow-x: auto; }
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 14px;
}
.analytics-table thead th {
  text-align: left;
  padding: 11px 14px;
  background: var(--surface-2, #14171d);
  color: var(--text-dim);
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.analytics-table thead th[data-sort] { cursor: pointer; }
.analytics-table thead th[data-sort]:hover { color: var(--text); }
.analytics-table thead th.is-active { color: var(--accent); }
.analytics-table thead th.is-active::after {
  content: '▾';
  margin-left: 4px;
  font-size: 11px;
}
.analytics-table thead th.is-active[data-dir="asc"]::after { content: '▴'; }
.analytics-table tbody td {
  padding: 8px 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
  vertical-align: middle;
}
.analytics-table tbody tr:last-child td { border-bottom: 0; }
.analytics-table .th-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.analytics-table .th-hero { width: 1px; white-space: nowrap; }

/* Hero icon in Heroes table — native 16:9 portrait so cover() doesn't crop.
   Dotabuff uses the same aspect; we tuned size to match the row height. */
.heroes-table .hero-ic {
  width: 56px;
  height: 32px;
  border-radius: 4px;
  object-fit: cover;
  margin-right: 12px;
  vertical-align: middle;
  background: var(--surface-2, #14171d);
}
.heroes-table .hero-ic-empty { display: inline-block; }
.heroes-table tbody td:first-child { font-weight: 500; }

/* Matches: hero strips split into Radiant / Dire columns. Each side has a
   tinted background tint so the team is obvious without per-icon borders. */
.matches-table tbody tr { cursor: pointer; transition: background .12s; }
.matches-table tbody tr:hover { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.matches-table .th-heroes { width: 1%; white-space: nowrap; padding: 6px 10px; }
.matches-table .th-radiant { background: color-mix(in srgb, var(--good, #4ade80) 4%, transparent); }
.matches-table .th-dire    { background: color-mix(in srgb, var(--bad, #f15e5e) 4%, transparent); }
.matches-table thead .th-radiant { color: var(--good, #4ade80); }
.matches-table thead .th-dire    { color: var(--bad,  #f15e5e); }

.match-hero-ic {
  width: 40px;
  height: 23px;
  border-radius: 3px;
  object-fit: cover;
  margin-right: 3px;
  vertical-align: middle;
  background: var(--surface-2, #14171d);
}
.match-hero-ic:last-child { margin-right: 0; }

.match-winner {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2, #14171d);
  color: var(--text-dim);
}
.match-winner.is-radiant { color: var(--good, #4ade80); }
.match-winner.is-dire    { color: var(--bad,  #f15e5e); }

.match-when { color: var(--text-dim); }

.analytics-skeleton { display: grid; gap: 8px; margin-top: 8px; }
.analytics-skeleton .sk-row {
  height: 38px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2, #14171d) 50%, var(--surface) 100%);
  background-size: 200% 100%;
  animation: sk-shimmer 1.2s linear infinite;
}
@keyframes sk-shimmer { to { background-position: -200% 0; } }

.analytics-pagination {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

@media (max-width: 560px) {
  .analytics-table { font-size: 13px; }
  .heroes-table .hero-ic { width: 44px; height: 25px; margin-right: 8px; }
  .match-hero-ic { width: 28px; height: 16px; }
  .matches-table .th-heroes { max-width: 180px; overflow-x: auto; }
}
