/* Glen Sharman - career and live tracker. Dark, immersive, one sans throughout. */

:root {
  color-scheme: dark;
  --page: #0a0d14;
  --card: #121722;
  --card-2: #171d2a;
  --line: #232b3a;
  --grid: #1e2532;
  --axis: #323b4c;
  --ink: #f0efec;
  --ink-2: #c3c2b7;
  --muted: #8a93a3;
  --accent: #e9b949;
  --live: #e5484d;
  --runs: #3987e5;
  --hundred: #d95926;
  --wkts: #199e70;
  --keep: #c98500;
  --deemph: #3a4352;
  --radius: 18px;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .6);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- hero */

.hero {
  position: relative;
  overflow: hidden;
  padding: 28px 0 40px;
  background:
    radial-gradient(800px 420px at 12% -10%, rgba(57, 135, 229, .28), transparent 60%),
    radial-gradient(700px 380px at 95% 10%, rgba(233, 185, 73, .16), transparent 62%),
    linear-gradient(180deg, #0d1220 0%, var(--page) 100%);
}
.hero::after {
  content: "";
  position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(233, 185, 73, .5), transparent);
}
.hero__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.tag {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2);
}
.tag--live { background: rgba(229, 72, 77, .16); box-shadow: inset 0 0 0 1px rgba(229, 72, 77, .5); color: #ffb3b5; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.hero__name {
  margin: 34px 0 6px;
  font-size: clamp(52px, 13vw, 148px);
  font-weight: 900;
  line-height: .86;
  letter-spacing: -.045em;
  text-transform: uppercase;
}
.hero__name span { display: block; color: transparent; -webkit-text-stroke: 1.5px rgba(240, 239, 236, .55); }
.hero__role { margin: 18px 0 0; font-size: clamp(15px, 2.2vw, 19px); color: var(--ink-2); }
.hero__role b { color: var(--ink); font-weight: 700; }
.journey { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; padding: 0; list-style: none; }
.journey li {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px 8px 8px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .04);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
}
.journey img, .journey .blank {
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
}
.journey .blank { display: grid; place-items: center; background: var(--card-2); color: var(--muted); font-size: 11px; font-weight: 800; }
.journey b { display: block; font-size: 13px; }
.journey small { color: var(--muted); }
.journey li.is-now { box-shadow: inset 0 0 0 1px rgba(233, 185, 73, .55); background: rgba(233, 185, 73, .07); }

.kpis {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 30px;
}
.kpi {
  padding: 16px 16px 14px;
  border-radius: 16px;
  background: rgba(18, 23, 34, .75);
  box-shadow: inset 0 0 0 1px var(--line);
  backdrop-filter: blur(6px);
}
.kpi__v { display: block; font-size: 34px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.kpi__v small { font-size: 20px; color: var(--muted); font-weight: 700; }
.kpi__l { display: block; margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--muted); }
.kpi--hero { grid-column: span 2; background: linear-gradient(140deg, rgba(57, 135, 229, .22), rgba(18, 23, 34, .8)); }
.kpi--hero .kpi__v { font-size: 52px; }

/* ---------------------------------------------------------------- nav */

.nav {
  position: sticky; top: 0; z-index: 20;
  background: rgba(10, 13, 20, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; gap: 6px; overflow-x: auto; padding: 10px 16px; scrollbar-width: none; }
.nav__inner::-webkit-scrollbar { display: none; }
.nav a {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 13px; font-weight: 600;
}
.nav a:hover { background: rgba(255, 255, 255, .06); color: var(--ink); }
.nav a.is-on { background: var(--ink); color: var(--page); }
.nav a.nav__live { color: #ffb3b5; }

/* ---------------------------------------------------------------- sections */

.section { padding: 56px 0 8px; scroll-margin-top: 50px; }
.section__kicker { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.section__title { margin: 6px 0 6px; font-size: clamp(30px, 5vw, 46px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; }
.section__lede { margin: 0 0 24px; max-width: 720px; color: var(--ink-2); font-size: 16px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: start; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-6 { grid-column: span 6; }
.span-4 { grid-column: span 4; }
@media (max-width: 900px) { .span-8, .span-6, .span-4 { grid-column: span 12; } }

.card {
  position: relative;
  padding: 18px 18px 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.card h3 { margin: 0; font-size: 16px; font-weight: 700; letter-spacing: -.01em; }
.card .sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.card .chart { margin-top: 14px; position: relative; }
.foot { margin: 10px 0 0; font-size: 12px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend i.line { width: 16px; height: 2px; border-radius: 1px; }

details.table { margin-top: 10px; }
details.table summary { cursor: pointer; font-size: 12px; font-weight: 600; color: var(--muted); list-style: none; }
details.table summary::-webkit-details-marker { display: none; }
details.table summary::before { content: "\25B8  "; }
details.table[open] summary::before { content: "\25BE  "; }
.tbl-wrap { overflow-x: auto; margin-top: 8px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 8px 8px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tbl th { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.tbl th:first-child, .tbl td:first-child, .tbl th.l { text-align: left; }
.tbl td.l { text-align: left; }
.tbl tr:hover td { background: rgba(255, 255, 255, .02); }
.tbl a { text-decoration: none; }
.tbl a:hover { text-decoration: underline; }
.tbl .hi td { background: rgba(233, 185, 73, .08); }
.tbl .hi td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

/* ---------------------------------------------------------------- charts */

svg.viz { display: block; width: 100%; overflow: visible; }
.viz .grid line { stroke: var(--grid); stroke-width: 1; }
.viz .axis line { stroke: var(--axis); stroke-width: 1; }
.viz text { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.viz text.v { fill: var(--ink-2); font-weight: 600; }
.viz text.band { fill: var(--ink-2); font-size: 11px; font-weight: 600; }
.viz rect.bandbg { fill: rgba(255, 255, 255, .025); }
.viz .bar { transform-box: fill-box; transform-origin: 50% 100%; transition: transform .9s cubic-bezier(.2, .8, .2, 1), opacity .2s; }
.viz.pre .bar { transform: scaleY(0); }
.viz .bar.is-hover { opacity: .8; }
.viz .hit { fill: transparent; cursor: pointer; outline: none; }
.viz .hit:focus-visible { stroke: var(--accent); stroke-width: 1; }
.viz path.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz path.area { stroke: none; }
.viz .draw { transition: stroke-dashoffset 1.6s ease-out; }
.viz .cross { stroke: var(--ink-2); stroke-width: 1; opacity: .4; }
.viz circle.mark { stroke: var(--card); stroke-width: 2; }

.tip {
  position: fixed; z-index: 50;
  pointer-events: none;
  min-width: 150px; max-width: 260px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(23, 29, 42, .97);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5), inset 0 0 0 1px var(--line);
  font-size: 12px;
  opacity: 0; transform: translateY(4px);
  transition: opacity .12s, transform .12s;
}
.tip.on { opacity: 1; transform: none; }
.tip b { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.tip .r { display: flex; align-items: center; gap: 8px; margin-top: 3px; }
.tip .r strong { font-size: 14px; color: var(--ink); }
.tip .r span { color: var(--muted); }
.tip .r i { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }

.bars { display: grid; gap: 9px; margin-top: 14px; }
.brow { display: grid; grid-template-columns: minmax(90px, 34%) 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.brow__l { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow__l small { color: var(--muted); }
.brow__t { height: 10px; border-radius: 0 4px 4px 0; background: transparent; position: relative; }
.brow__t i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; background: var(--runs); transform-origin: left; transition: transform .9s cubic-bezier(.2, .8, .2, 1); }
.pre .brow__t i { transform: scaleX(0); }
.brow__v { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 44px; text-align: right; }
.brow__v small { color: var(--muted); font-weight: 500; margin-left: 4px; }

.map { height: 420px; border-radius: 14px; overflow: hidden; margin-top: 14px; background: var(--card-2); }
.leaflet-container { background: #0f141e !important; font-family: var(--sans) !important; }
/* OpenStreetMap tiles, darkened to sit in the page. */
.leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) brightness(.82) contrast(.9) saturate(.6); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: #171d2a !important; color: var(--ink) !important; box-shadow: 0 10px 30px rgba(0, 0, 0, .5) !important; }
.leaflet-popup-content { margin: 12px 14px !important; font-size: 12px; }
.leaflet-popup-content b { font-size: 13px; }
.leaflet-control-attribution { background: rgba(10, 13, 20, .7) !important; color: var(--muted) !important; }
.leaflet-control-attribution a { color: var(--ink-2) !important; }

/* ---------------------------------------------------------------- live */

.live {
  margin-top: -1px;
  padding: 20px;
  border-radius: 22px;
  background:
    radial-gradient(500px 200px at 0% 0%, rgba(57, 135, 229, .18), transparent 70%),
    var(--card);
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line);
}
.live.is-live { background: radial-gradient(500px 220px at 0% 0%, rgba(229, 72, 77, .22), transparent 70%), var(--card); box-shadow: var(--shadow), inset 0 0 0 1px rgba(229, 72, 77, .45); }
.live__grid { display: grid; gap: 18px; grid-template-columns: 1.4fr 1fr; }
@media (max-width: 860px) { .live__grid { grid-template-columns: 1fr; } }
.live__meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.live__teams { display: grid; gap: 8px; margin-top: 12px; }
.lteam { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, .03); }
.lteam.is-his { box-shadow: inset 0 0 0 1px rgba(233, 185, 73, .4); }
.lteam img, .lteam .blank { width: 36px; height: 36px; border-radius: 50%; background: #fff; object-fit: cover; }
.lteam .blank { display: grid; place-items: center; background: var(--card-2); color: var(--muted); font-size: 12px; font-weight: 800; }
.lteam b { font-size: 15px; }
.lteam .score { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.lteam.is-bat .score::after { content: " \25CF"; color: var(--live); font-size: 12px; vertical-align: 6px; }
.live__result { margin: 12px 0 0; font-weight: 700; color: var(--accent); }
.me { padding: 16px; border-radius: 16px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); }
.me h4 { margin: 0 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.me__big { font-size: 56px; font-weight: 900; line-height: 1; letter-spacing: -.03em; }
.me__big small { font-size: 22px; color: var(--muted); font-weight: 700; letter-spacing: 0; }
.me__how { margin: 6px 0 0; color: var(--ink-2); font-size: 13px; }
.me__row { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; color: var(--ink-2); }
.me__row b { color: var(--ink); font-size: 18px; display: block; }
.next { margin-top: 14px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; padding: 12px 14px; border-radius: 14px; background: rgba(233, 185, 73, .07); box-shadow: inset 0 0 0 1px rgba(233, 185, 73, .25); font-size: 13px; }
.next b { font-size: 14px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 999px; background: var(--ink); color: var(--page); text-decoration: none; font-weight: 700; font-size: 13px; }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }

/* ---------------------------------------------------------------- feature cards */

.tons { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); margin-top: 6px; }
.ton {
  position: relative;
  overflow: hidden;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(150deg, rgba(217, 89, 38, .22), rgba(18, 23, 34, .9) 60%);
  box-shadow: inset 0 0 0 1px rgba(217, 89, 38, .35);
  text-decoration: none;
}
.ton__runs { font-size: 46px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.ton__runs small { font-size: 24px; color: var(--ink-2); }
.ton__vs { margin-top: 8px; font-weight: 700; font-size: 14px; }
.ton__meta { margin-top: 4px; font-size: 12px; color: var(--ink-2); }
.ton__club { position: absolute; right: 12px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: #fff; object-fit: cover; opacity: .9; }

.miles { position: relative; margin: 10px 0 0; padding: 0 0 0 22px; list-style: none; }
.miles::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--runs), var(--accent)); border-radius: 2px; }
.miles li { position: relative; padding: 6px 0 12px; }
.miles li::before { content: ""; position: absolute; left: -21px; top: 11px; width: 12px; height: 12px; border-radius: 50%; background: var(--card); box-shadow: inset 0 0 0 3px var(--accent); }
.miles b { display: block; font-size: 14px; }
.miles span { font-size: 12px; color: var(--muted); }

.stat3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.stat3--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat3 div { padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .03); box-shadow: inset 0 0 0 1px var(--line); }
.stat3 b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stat3 span { font-size: 12px; color: var(--muted); }

.wld { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; margin-top: 12px; }
.wld i { display: block; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.filters select, .filters input {
  padding: 9px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--card-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font: inherit; font-size: 13px;
}
.filters input { min-width: 200px; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; background: rgba(255, 255, 255, .06); color: var(--ink-2); }
.pill--won { background: rgba(25, 158, 112, .18); color: #7fe0bb; }
.pill--lost { background: rgba(229, 72, 77, .14); color: #ffb3b5; }
.pill--c { background: rgba(233, 185, 73, .14); color: var(--accent); }

.notes { margin-top: 18px; color: var(--ink-2); font-size: 13px; }
.notes li { margin-bottom: 6px; }

.page-foot { padding: 40px 0 60px; color: var(--muted); font-size: 12px; text-align: center; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

.skeleton { height: 240px; border-radius: 14px; background: linear-gradient(90deg, #141a26, #1a2130, #141a26); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------------------------------------------------------------- match page */

.mhead { padding: 22px 0 26px; background: radial-gradient(600px 260px at 10% -20%, rgba(57, 135, 229, .25), transparent 65%), linear-gradient(180deg, #0d1220, var(--page)); }
.mtabs { display: flex; gap: 6px; padding: 4px; border-radius: 14px; background: var(--card-2); overflow-x: auto; scrollbar-width: none; }
.mtab { flex: 1 0 auto; border: 0; padding: 10px 14px; border-radius: 11px; background: transparent; font-weight: 700; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.mtab[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); }
.inn-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 16px 2px 6px; }
.inn-total b { flex: none; white-space: nowrap; font-size: 40px; font-weight: 900; letter-spacing: -.03em; }
.inn-total span { color: var(--muted); font-size: 13px; text-align: right; }
.sc td .how { display: block; font-size: 12px; color: var(--muted); font-weight: 500; white-space: normal; }
.sc td.nm { font-weight: 700; white-space: normal; }
.sc tr.is-in td { background: rgba(229, 72, 77, .07); }
.balls { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.ball { flex: none; display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 6px; border-radius: 999px; background: #1c2333; font-weight: 800; font-size: 13px; }
.ball--4 { background: var(--runs); color: #fff; }
.ball--6 { background: var(--accent); color: #1a1205; }
.ball--w { background: var(--live); color: #fff; }
.ball--x { background: transparent; box-shadow: inset 0 0 0 2px var(--line); font-size: 12px; }
.ball--over { background: transparent; color: var(--muted); font-size: 10px; min-width: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; }
  .viz.pre .bar, .pre .brow__t i { transform: none; }
}

/* ---------------------------------------------------------------- live chase */

.chase { display: block; margin: 10px 0 0; font-size: 17px; font-weight: 600; line-height: 1.35; }
.chase b { color: var(--accent); font-size: 20px; font-variant-numeric: tabular-nums; }
.chase__rr { display: block; font-size: 13px; font-weight: 500; color: var(--muted); }
.live__result .chase { margin: 0; color: var(--ink); }
