/* Old Gamers: clan stats site. Phone first. */

/* Fonts, color tokens, header and nav come from /assets/brand/brand.css (shared with the map). */

* { box-sizing: border-box; }
html { color-scheme: dark; scrollbar-color: var(--line-strong) var(--bg); scrollbar-width: thin; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent-strong); text-decoration: underline; text-decoration-color: rgba(227, 163, 94, 0.4); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-color: currentColor; }
::selection { background: var(--accent); color: var(--accent-ink); }
*:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1rem; color: var(--text-dim); font-weight: 600; letter-spacing: 0.01em; }
p { margin: 0 0 0.8em; }
b { font-weight: 650; }
.wrap { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
.dim { color: var(--text-dim); }
.small { font-size: 0.85rem; }
.empty { color: var(--text-dim); padding: 18px 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 6px 10px; border-radius: 6px; z-index: 99; }
.skip:focus { left: 8px; }
.icon { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.1em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; text-decoration: none; border: 1px solid transparent; cursor: pointer; line-height: 1.2; }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: var(--accent-strong); }
.btn--ghost { border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { background: var(--bg-elevated); }
.btn--sm { padding: 7px 12px; font-size: 0.85rem; }

/* Hero */
.hero { padding: 36px 0 12px; }
.hero__eyebrow, .eyebrow { font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin: 0 0 12px; }
.eyebrow a { color: inherit; text-decoration: none; }
.hero__tagline { font-size: 1.15rem; color: var(--text-dim); max-width: 48ch; margin: 12px 0 18px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 22px; }

/* Stat cards */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 10px; min-width: 0; }
.stat__v { font-family: var(--font-display); font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__l { color: var(--text-dim); font-size: 0.78rem; margin-top: 4px; }
.stat__s { color: var(--text-faint); font-size: 0.75rem; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }

/* Blocks */
.block { margin: 34px 0; }
.block__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.block__head a { font-size: 0.9rem; }
.block--two { display: grid; grid-template-columns: 1fr; gap: 28px; }
.block--two > * { min-width: 0; }
@media (min-width: 900px) { .block--two { grid-template-columns: 1fr 1fr; } }
.prose p { color: var(--text-dim); }
.prose p:first-child { color: var(--text); }
.page-head { padding: 30px 0 6px; }
.page-head p { color: var(--text-dim); max-width: 70ch; }
.page-head--player h1, .page-head--match h1 { word-break: break-word; }
.fav { color: var(--text); font-size: 0.95rem; }

/* Chips and badges */
.chip { display: inline-block; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--bg-elevated-2); border: 1px solid var(--line); white-space: nowrap; line-height: 1.5; }
.chip--erangel { color: #a9c48f; } .chip--miramar { color: #e0b97f; } .chip--sanhok { color: #8fcf9a; } .chip--vikendi { color: #b7d3e8; }
.chip--karakin { color: #e2c594; } .chip--taego { color: #c7d59a; } .chip--deston { color: #97c9c6; } .chip--rondo { color: #d9c5a3; }
.chip--paramo { color: #c2a288; } .chip--haven { color: #b9b9c8; } .chip--jackal { color: #a7bba1; }
.place { display: inline-block; font-family: var(--mono); font-size: 0.8rem; font-weight: 600; padding: 2px 7px; border-radius: 6px; background: var(--bg-elevated-2); color: var(--text-dim); border: 1px solid var(--line); min-width: 2.6em; text-align: center; }
.place--top { color: var(--top); }
.place--win { color: var(--accent-ink); background: var(--win); border-color: var(--win); }
.plink { color: var(--text); text-decoration: none; font-weight: 600; }
.plink:hover { color: var(--accent-strong); }
.plink--guest { color: var(--text-dim); font-weight: 500; }
.role { font-size: 0.75rem; color: var(--text-faint); margin-left: 4px; }

/* Match feed */
.feed { display: flex; flex-direction: column; gap: 8px; }
.feed__row { display: block; background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; color: var(--text); cursor: pointer; }
.feed__meta { text-decoration: none; color: var(--text-dim); }
.feed__go { display: inline-flex; align-items: center; gap: 2px; color: var(--accent-strong); font-weight: 600; }
.feed__go .icon { font-size: 0.9em; }
.feed__row:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.feed__row--win { border-color: rgba(216, 179, 90, 0.35); background: linear-gradient(90deg, var(--win-bg), var(--bg-elevated) 60%); }
.feed__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-dim); margin-bottom: 6px; }
.feed__time { margin-left: auto; white-space: nowrap; }
.feed__squad { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 4px 0; }
.feed__squad + .feed__squad { border-top: 1px dashed var(--line); }
.feed__names { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.feed__name b { font-family: var(--mono); font-weight: 600; font-size: 0.78rem; color: var(--text-dim); margin-left: 4px; }
.feed__tot { grid-column: 2; display: flex; gap: 14px; font-size: 0.78rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
@media (min-width: 760px) {
  .feed__row { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
  .feed__meta { flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0; align-content: start; }
  .feed__time { margin-left: 0; }
  .feed__go { margin-left: auto; }
  .feed__squad { grid-template-columns: auto 1fr auto; }
  .feed__tot { grid-column: auto; }
}

/* Leaders + dinners */
.leaders { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.leader { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.leader__l { font-size: 0.75rem; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--mono); }
.leader__n { font-weight: 600; margin: 4px 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader__v { font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--accent-strong); }
@media (min-width: 760px) { .leaders { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1000px) { .leaders { grid-template-columns: repeat(6, 1fr); } }
.dinners { display: grid; grid-template-columns: 1fr; gap: 8px; }
.dinner { display: block; text-decoration: none; color: var(--text); background: var(--bg-elevated); border: 1px solid rgba(216, 179, 90, 0.3); border-radius: var(--radius); padding: 12px; }
.dinner:hover { background: var(--bg-hover); }
.dinner__names { font-weight: 600; margin: 6px 0 2px; }
.dinner__meta { font-size: 0.8rem; color: var(--text-dim); }
@media (min-width: 640px) { .dinners { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .dinners { grid-template-columns: repeat(3, 1fr); } }

/* Tables */
.tscroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
.table th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-faint); font-weight: 600; }
.table .num { text-align: right; }
.table tbody tr:hover { background: var(--bg-elevated); }
.table .row--win td { background: var(--win-bg); }
.table td:first-child, .table th:first-child { padding-left: 4px; }
.table td.empty { white-space: normal; }
.table--players td:first-child { font-weight: 600; }
time { white-space: nowrap; }

/* Player cards */
.pcards { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.pcard { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.pcard h3 { margin-bottom: 8px; }
.pcard .stats { grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pcard .stat { background: var(--bg); padding: 8px 8px 6px; }
.pcard .stat__v { font-size: 1.2rem; }
@media (min-width: 1000px) { .pcards { grid-template-columns: repeat(3, 1fr); } }

/* Trend */
.trend { width: 100%; height: auto; display: block; background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); }
.tr__bar { fill: rgba(236, 233, 226, 0.22); }
.tr__bar--win { fill: var(--win); }
.tr__line { fill: none; stroke: var(--accent-strong); stroke-width: 1.5; stroke-linejoin: round; }
.tr__dot { fill: var(--accent-strong); }
.tr__t { fill: var(--text-faint); font-size: 10px; font-family: var(--mono); }
.tr__t--r { text-anchor: end; }

/* Heatmap component */
.heat { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.heat__tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 10px 0; scrollbar-width: none; }
.heat__tabs::-webkit-scrollbar { display: none; }
.heat__tabs button { flex: 0 0 auto; background: var(--bg); border: 1px solid var(--line); color: var(--text-dim); padding: 6px 10px; border-radius: 999px; font: inherit; font-size: 0.82rem; cursor: pointer; }
.heat__tabs button.is-on { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); font-weight: 600; }
.heat__tabs button b { font-family: var(--mono); font-weight: 500; opacity: 0.8; margin-left: 4px; }
.heat__map { position: relative; width: 100%; aspect-ratio: 1 / 1; max-height: 78vh; background: #0a0c0e; }
.heat__map.leaflet-container { background: #0a0c0e; font: inherit; }
.heat__map .leaflet-control-attribution { display: none; }
.heat__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; padding: 10px; font-size: 0.82rem; color: var(--text-dim); border-top: 1px solid var(--line); }
.heat__bar label { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; }
.heat__bar .sw { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.heat__bar .sw--kill { background: var(--kill); } .heat__bar .sw--death { background: var(--death); } .heat__bar .sw--drop { background: linear-gradient(90deg, #2d6bd1, #f2d33b, #e03b2f); border-radius: 3px; width: 22px; }
.heat__bar .heat__n { margin-left: auto; font-family: var(--mono); font-size: 0.75rem; }
.heat__places { padding: 0 10px 10px; font-size: 0.85rem; color: var(--text-dim); }
.heat__places b { color: var(--text); }
.heat__empty { padding: 28px 16px; color: var(--text-dim); text-align: center; }
.heat--big .heat__map { max-height: 82vh; }
.heat__ext { margin: 10px 0 0; }
.heat__ext .icon { font-size: 0.85em; }
@media (min-width: 900px) { .heat { max-width: 780px; } .heat--big { max-width: 900px; } .match__grid .heat { max-width: none; } }
.leaflet-tooltip.heat-tip { background: var(--bg-elevated-2); color: var(--text); border: 1px solid var(--line-strong); font-size: 0.78rem; padding: 3px 7px; border-radius: 6px; box-shadow: none; }
.leaflet-tooltip.heat-tip::before { display: none; }
.drop-label { font-family: var(--mono); font-size: 10px; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; white-space: nowrap; }

/* Map cards */
.mapcards { display: grid; grid-template-columns: 1fr; gap: 8px; }
.mapcard { display: flex; gap: 12px; align-items: center; background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; }
.mapcard img { width: 64px; height: 64px; border-radius: 8px; flex: 0 0 auto; }
.mapcard div { display: flex; flex-direction: column; min-width: 0; }
.mapcard b { font-family: var(--font-display); }
.mapcard--link { text-decoration: none; color: var(--text); }
.mapcard--link:hover { background: var(--bg-hover); border-color: var(--line-strong); }
.mapcard--link .icon { margin-left: 4px; font-size: 0.85em; }
@media (min-width: 700px) { .mapcards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .mapcards { grid-template-columns: repeat(3, 1fr); } }

/* Leaderboard */
.lb__controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin: 12px 0 14px; }
.seg { display: inline-flex; background: var(--bg-elevated); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { background: none; border: 0; color: var(--text-dim); font: inherit; font-size: 0.82rem; padding: 6px 11px; border-radius: 999px; cursor: pointer; }
.seg button.is-on { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.seg button:disabled { opacity: 0.35; cursor: default; }
.lb__stat { font-size: 0.85rem; color: var(--text-dim); display: inline-flex; gap: 8px; align-items: center; }
.lb__stat select { background: var(--bg-elevated); color: var(--text); border: 1px solid var(--line-strong); border-radius: 8px; padding: 6px 8px; font: inherit; font-size: 0.85rem; }
.lb__table th { cursor: pointer; user-select: none; }
.lb__table th, .lb__table td { padding: 7px 7px; }
.lb__table th.is-sorted { color: var(--accent-strong); }
.lb__table td.is-sorted, .lb__table th.is-sorted { background: rgba(207, 138, 66, 0.08); }
.lb__table .rank { color: var(--text-faint); font-family: var(--mono); width: 2.5em; }
.lb__table .under td { color: var(--text-faint); }
.lb__table .under td .plink { color: var(--text-dim); }
.lb__note { color: var(--text-faint); font-size: 0.8rem; margin-top: 10px; }
@media (max-width: 760px) { .lb__table .col-x { display: none; } }

/* Match page */
.match__grid { display: grid; grid-template-columns: 1fr; gap: 24px; margin-top: 14px; }
.match__grid > * { min-width: 0; }
@media (min-width: 1000px) { .match__grid { grid-template-columns: 1.15fr 1fr; align-items: start; } }
.roster { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; margin-bottom: 10px; }
.roster--win { border-color: rgba(216, 179, 90, 0.4); }
.roster__head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; font-weight: 600; }
.roster__head .dim { font-weight: 400; font-size: 0.85rem; }
.roster .table { font-size: 0.85rem; }
.roster .table td, .roster .table th { padding: 6px 8px; }
.timeline { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; max-height: 560px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-elevated); }
.timeline li { display: grid; grid-template-columns: 48px 1fr; gap: 10px; padding: 7px 12px; border-bottom: 1px solid var(--line); align-items: baseline; }
.timeline li:last-child { border-bottom: 0; }
.timeline .t { font-family: var(--mono); color: var(--text-faint); font-size: 0.78rem; }
.timeline .ev--kill .who { color: var(--kill); }
.timeline .ev--death .who { color: var(--death); }
.timeline .ev--teamkill { background: rgba(217, 107, 95, 0.1); }
.timeline .ev--revive .who { color: #9fc1e0; }
.timeline .m { font-weight: 600; }
.match__links { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 4px; }
.tool-panel { background: var(--bg-elevated); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.tool-panel__name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin: 0; }
.tool-panel__desc { color: var(--text-dim); margin: 0 0 8px; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 48px; padding: 22px 0 36px; font-size: 0.85rem; color: var(--text-dim); }
.site-footer__inner { display: flex; flex-direction: column; gap: 6px; }
.site-footer__meta { color: var(--text-faint); }
@media (min-width: 760px) { .site-footer__inner { flex-direction: row; justify-content: space-between; gap: 20px; } }

@media (prefers-reduced-motion: no-preference) {
  .feed__row, .btn, .seg button { transition: background-color 0.15s ease, border-color 0.15s ease; }
}
