/* Direction: a coach's post-game sheet. Graphite chrome, gold only where gold means something,
   Radiant green and Dire red only for wins and losses. Signature: the thin W/L tick. */
:root {
  --bg: #0e0f11;
  --panel: #15171a;
  --panel-2: #1c1f23;
  --panel-3: #23272c;
  --line: rgba(232, 230, 225, .08);
  --line-2: rgba(232, 230, 225, .14);
  --text: #e8e6e1;
  --text-2: #a7a69f;
  --muted: #74756f;
  --accent: #d4a64a;
  --accent-ink: #e3bb68;
  --win: #5fae6e;
  --loss: #d0604f;
  --warn: #d4a64a;
  --radiant: #5fae6e;
  --dire: #d0604f;
  --radius: 12px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-ink); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--text); }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, tr.click:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px;
}
img { display: block; }
b { font-weight: 500; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 32px;
  padding: 0 24px; height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 500; font-size: 15px; white-space: nowrap; }
.brand:hover { color: var(--text); }
.logo { width: 20px; height: 20px; color: var(--accent); flex: none; }
#nav { display: flex; gap: 4px; flex: 1; align-items: center; min-width: 0; }
#nav a { color: var(--text-2); padding: 0 12px; height: 32px; display: inline-flex; align-items: center; border-radius: 8px; white-space: nowrap; transition: color .15s var(--ease), background-color .15s var(--ease); }
#nav a:hover { color: var(--text); background: var(--panel-2); }
#nav a.active { color: var(--text); background: var(--panel-2); box-shadow: inset 0 1px 0 var(--line-2); }
#nav .spacer { flex: 1; }
#nav .spacer + a { color: var(--muted); }

/* pinned accounts */
.pins { display: flex; align-items: center; gap: 6px; flex: none; }
.pins:empty { display: none; }
.pin {
  width: 30px; height: 30px; border-radius: 50%; overflow: hidden; flex: none;
  display: grid; place-items: center; background: var(--panel-3); color: var(--text-2); font-size: 11px; text-transform: uppercase;
  box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow .15s var(--ease), transform .1s var(--ease);
}
.pin img { width: 100%; height: 100%; object-fit: cover; }
.pin:hover { box-shadow: 0 0 0 2px var(--text-2); color: var(--text); }
.pin.active { box-shadow: 0 0 0 2px var(--accent); }
.pin:active { transform: scale(.94); }
.pins .pin-toggle {
  width: 30px; height: 30px; padding: 0; border-radius: 50%; flex: none;
  background: transparent; color: var(--text-2); box-shadow: inset 0 0 0 1px var(--line-2);
}
.pins .pin-toggle:hover { background: var(--panel-2); color: var(--text); }
.pins .pin-toggle svg { width: 16px; height: 16px; fill: none; }
.pins .pin-toggle.on { color: var(--accent); }
.pins .pin-toggle.on svg { fill: currentColor; }

main { width: 100%; max-width: 1280px; margin: 0 auto; padding: 32px 24px 48px; flex: 1; }
main > * { animation: rise .32s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(4px); } }
.foot { color: var(--muted); font-size: 12px; padding: 20px 24px; border-top: 1px solid var(--line); text-align: center; }
.foot a { color: var(--text-2); }

/* generic */
h1 { font-size: 24px; font-weight: 500; line-height: 1.25; margin: 0 0 4px; }
h2 { font-size: 16px; font-weight: 500; line-height: 1.35; margin: 0 0 16px; }
h3 { font-size: 13px; font-weight: 500; margin: 0 0 12px; color: var(--text-2); }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin-bottom: 16px; min-width: 0; }
.panel > h2:last-child, .panel > p:last-child { margin-bottom: 0; }
.panel.muted { padding: 20px 24px; }
.panel .row.between > h2 { margin-bottom: 0; }
.panel > .row.between:first-child { margin-bottom: 16px; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 5fr) minmax(0, 3fr); }
.grid > .panel { margin-bottom: 0; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.row.between > a { font-size: 13px; color: var(--text-2); }
.row.between > a:hover { color: var(--text); }
.win { color: var(--win); }
.loss { color: var(--loss); }
.warn { color: var(--warn); }
.loader { padding: 64px 24px; text-align: center; color: var(--muted); }
.error { background: rgba(208, 96, 79, .08); border: 1px solid rgba(208, 96, 79, .28); color: #e7aaa0; padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; }

button, .btn {
  font: inherit; font-weight: 500; cursor: pointer;
  background: var(--text); color: #141518; border: 0; border-radius: 8px;
  height: 36px; padding: 0 16px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  transition: background-color .15s var(--ease), color .15s var(--ease), transform .1s var(--ease);
}
button:hover, .btn:hover { background: #fff; color: #141518; }
button:active, .btn:active { transform: scale(.98); }
button.ghost, .btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line-2); }
button.ghost:hover, .btn.ghost:hover { background: var(--panel-2); color: var(--text); }
button:disabled { opacity: .45; cursor: default; transform: none; }
input, select {
  font: inherit; color: var(--text); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 8px; height: 36px; padding: 0 12px; min-width: 0;
  transition: border-color .15s var(--ease);
}
select {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2374756f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
select:hover, input:hover { border-color: var(--line-2); }
input:focus, select:focus { outline: none; border-color: var(--accent); }
option { background: var(--panel-2); color: var(--text); }
details summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
details summary:hover { color: var(--text); }

/* setup */
.setup { max-width: 560px; margin: 48px auto; }
.setup .panel { padding: 32px; }
.setup h1 { font-size: 28px; margin-bottom: 8px; }
.setup input { width: 100%; font-size: 16px; height: 44px; padding: 0 16px; }
.setup button[type=submit] { height: 44px; }
.setup ol { padding-left: 20px; margin: 0; color: var(--text-2); }
.setup ol li { margin-bottom: 8px; }
.setup ol li::marker { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.search-res { margin-top: 12px; display: grid; gap: 4px; }
.search-res a { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 8px; color: var(--text); transition: background-color .15s var(--ease); }
.search-res a:hover { background: var(--panel-2); }
.search-res a .small { margin-left: auto; font-family: var(--mono); }
.search-res img { width: 32px; height: 32px; border-radius: 6px; }

/* profile */
.profile { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile img.av { width: 64px; height: 64px; border-radius: 10px; }
.profile .info { flex: 1; min-width: 200px; }
.profile .info .row { gap: 8px 12px; }
.rank { font-size: 13px; color: var(--accent-ink); }
.meta { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.form { display: flex; align-items: center; gap: 3px; margin-top: 12px; }
.form .tick { width: 4px; height: 16px; border-radius: 2px; background: var(--loss); opacity: .85; }
.form .tick.w { background: var(--win); }
.form span.small { margin-left: 8px; font-family: var(--mono); }

/* stat tiles: a ledger of figures, label on top */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; }
.tile { display: flex; flex-direction: column; padding: 12px 0; border-top: 1px solid var(--line); min-width: 0; }
.tile .l { order: -1; color: var(--text-2); font-size: 12px; line-height: 1.4; }
.tile .v { font-family: var(--mono); font-size: 20px; font-weight: 500; line-height: 1.3; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tile .d { font-size: 12px; color: var(--muted); margin-top: 2px; font-family: var(--mono); }

/* tables */
.tbl-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 400; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th.sort { cursor: pointer; user-select: none; transition: color .15s var(--ease); }
th.sort:hover { color: var(--text); }
td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; height: 48px; }
tr:last-child td { border-bottom: 0; }
tr.click { cursor: pointer; }
tr.click td { transition: background-color .12s var(--ease); }
tr.click:hover td { background: var(--panel-2); }
tr.me td { background: rgba(212, 166, 74, .07); }
tr.me td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--mono); font-size: 12px; }
td.num b { font-weight: 500; color: var(--text); }
.hero-cell { display: flex; align-items: center; gap: 12px; }
.hero-cell img { width: 48px; height: 28px; border-radius: 4px; object-fit: cover; background: var(--panel-2); flex: none; }
.hero-cell .small { color: var(--muted); }
.res-badge { display: inline-block; width: 4px; height: 24px; border-radius: 2px; vertical-align: middle; font-size: 0; overflow: hidden; }
.res-badge.w { background: var(--win); }
.res-badge.l { background: var(--loss); }
.items { display: flex; gap: 2px; align-items: center; }
.items img, .items .empty { width: 30px; height: 22px; border-radius: 3px; background: var(--panel-2); object-fit: cover; }
.items .neutral { border-radius: 50%; width: 22px; margin-left: 4px; }
.bar { height: 4px; border-radius: 2px; background: var(--panel-3); overflow: hidden; min-width: 64px; }
.bar > i { display: block; height: 100%; border-radius: 2px; background: var(--win); }

/* filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }
.pager span { font-family: var(--mono); font-size: 12px; }
.pager button { width: 36px; padding: 0; }

/* insights */
.ins { display: grid; gap: 4px; }
.ins-item { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ins-item:first-child { border-top: 0; padding-top: 4px; }
.ins-item .ic { flex: none; width: 20px; height: 20px; display: grid; place-items: center; margin-top: 1px; }
.ins-item .ic svg { width: 16px; height: 16px; }
.ins-item .ic.n { font-family: var(--mono); font-size: 12px; border-radius: 6px; background: var(--panel-3); color: var(--text); }
.ins-item.good .ic.n { color: var(--win); }
.ins-item.warn { color: var(--text); }
.ins-item b { display: block; margin-bottom: 2px; font-weight: 500; }
.ins-item p { margin: 0; color: var(--text-2); }
.ins-item p.small { color: var(--muted); }
.lede { margin: -8px 0 16px; }

/* match page */
.back { display: inline-flex; margin-bottom: 16px; font-size: 13px; color: var(--text-2); }
.match-head { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.match-head .score { font-family: var(--mono); font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.match-head .score .r { color: var(--radiant); }
.match-head .score .d { color: var(--dire); }
.big-res { font-size: 22px; font-weight: 500; padding-left: 12px; border-left: 4px solid currentColor; line-height: 1.2; }
.me-card { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.me-card .portrait { width: 128px; height: 72px; border-radius: 8px; object-fit: cover; }
.grade { width: 72px; height: 72px; border-radius: 12px; display: grid; place-items: center; font-family: var(--mono); font-size: 32px; font-weight: 500; background: var(--panel-2); border: 1px solid var(--line-2); color: var(--text-2); }
.grade.S { color: var(--accent); border-color: rgba(212, 166, 74, .5); background: rgba(212, 166, 74, .08); }
.grade.A { color: var(--win); border-color: rgba(95, 174, 110, .45); }
.grade.B { color: var(--text); }
.grade.C { color: var(--warn); }
.grade.D { color: var(--loss); border-color: rgba(208, 96, 79, .45); }
.grade + .muted { margin-top: 4px; font-family: var(--mono); }
.bench { display: grid; grid-template-columns: minmax(0, 168px) 1fr 48px; gap: 8px 12px; align-items: center; font-size: 13px; }
.bench .bar { height: 4px; }
.bench .num { text-align: right; font-family: var(--mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.timeline { display: flex; flex-wrap: wrap; gap: 8px; }
.timeline .it { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); font-family: var(--mono); }
.timeline .it img { width: 44px; height: 32px; border-radius: 4px; }
.skills { display: flex; flex-wrap: wrap; gap: 4px; }
.skills .sk { position: relative; }
.skills .sk img, .skills .sk .t { width: 36px; height: 36px; border-radius: 4px; background: var(--panel-2); }
.skills .sk .t { display: grid; place-items: center; font-size: 10px; font-weight: 500; color: var(--accent-ink); border: 1px solid var(--line-2); }
.skills .sk span { position: absolute; bottom: 0; right: 2px; font-size: 10px; font-family: var(--mono); color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; }
.team-title { font-weight: 500; font-size: 16px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.team-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: currentColor; }
.team-title.r { color: var(--radiant); }
.team-title.d { color: var(--dire); }
.chart-box { position: relative; height: 260px; }
.chart-box.lg { height: 300px; }
.chart-box.sm { height: 200px; }
.tag { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11px; line-height: 18px; font-weight: 400; background: var(--panel-3); color: var(--text-2); vertical-align: 1px; }
.sec { margin-top: 24px; }

@media (max-width: 860px) {
  .g2, .g3, .g-main { grid-template-columns: minmax(0, 1fr); }
  main { padding: 20px 16px 40px; }
  .top { padding: 8px 16px; gap: 4px 16px; height: auto; flex-wrap: wrap; }
  #nav { overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px; flex-basis: 100%; order: 2; }
  #nav::-webkit-scrollbar { display: none; }
  #nav .spacer { min-width: 8px; }
  .pins { order: 1; margin-left: auto; gap: 4px; }
  .pin, .pins .pin-toggle { width: 28px; height: 28px; }
  .panel { padding: 20px 16px; }
  .panel.muted { padding: 16px; }
  .setup { margin: 16px auto; }
  .setup .panel { padding: 24px 20px; }
  .bench { grid-template-columns: minmax(0, 120px) 1fr 44px; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
  .tile .v { font-size: 18px; }
  .hide-m { display: none; }
  .match-head { gap: 12px 20px; }
  .profile > .row { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
