:root {
  color-scheme: dark;
  --bg: #111214;
  --panel: #191b1f;
  --border: #303136;
  --ink: #f4f0e7;
  --muted: #b4b3b2;
  --gold: #e8c480;
  font: 100%/1.55 "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: var(--gold); text-underline-offset: .2em; }
a:hover { color: #ffdfa4; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
button, input { font: inherit; }
img { display: block; max-width: 100%; }
h1, h2, p { margin-top: 0; }
h1, h2 { line-height: 1.12; letter-spacing: -.035em; }
h1 { font-size: clamp(2.7rem, 8vw, 5.4rem); margin-bottom: .65rem; font-weight: 800; }
h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 1rem; }
.wrap { width: min(calc(100% - 2rem), 1140px); margin-inline: auto; }
.site-header { border-bottom: 1px solid var(--border); background: #131416; }
.masthead { min-height: 72px; display: flex; flex-wrap: wrap; gap: .5rem 2rem; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: .45rem; align-items: center; font-size: .94rem; font-weight: 800; letter-spacing: .08em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { color: var(--gold); }
.mark { display: inline-block; width: 13px; height: 13px; margin-right: .37rem; transform: rotate(45deg); border: 2px solid var(--gold); box-shadow: inset 0 0 0 2px #131416; background: #916b36; }
.masthead nav, .actions, .segments, .pagination { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.masthead nav a, .segments a { padding: .5rem .75rem; border-radius: 4px; color: var(--muted); font-size: .93rem; font-weight: 600; text-decoration: none; }
.masthead nav a[aria-current], .segments a[aria-current] { color: var(--gold); background: #29241b; }
.hero { position: relative; isolation: isolate; display: grid; grid-template-columns: 1.4fr 1fr; min-height: 390px; align-items: center; margin-top: 2rem; border: 1px solid #454036; border-top: 3px solid var(--gold); overflow: hidden; background: radial-gradient(ellipse at 80% 45%, #362d20, transparent 52%), linear-gradient(115deg, #222326, #151618 66%); }
.hero-content { position: relative; z-index: 1; padding: clamp(1.3rem, 4.4vw, 3.4rem); }
.hero h1 { max-width: 12ch; }
.hero h1 em { color: var(--gold); font-style: normal; }
.eyebrow { font-size: .84rem; font-weight: 800; color: var(--gold); letter-spacing: .12em; margin-bottom: .9rem; }
.lede { color: var(--muted); max-width: 40ch; margin: 1.05rem 0 1.7rem; }
.hero-emblem { display: grid; width: 100%; height: 100%; place-items: center; background: repeating-linear-gradient(145deg, transparent 0 22px, #ffffff08 23px 24px, transparent 25px 42px); }
.hero-emblem img { width: min(82%, 320px); height: auto; image-rendering: pixelated; filter: drop-shadow(0 13px 18px #000a); }
.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid #555148; border-radius: 4px; min-height: 43px; padding: .45rem .95rem; background: #1d1e21; color: var(--ink); font-weight: 700; text-decoration: none; cursor: pointer; transition: background-color .15s ease; }
.button:hover { background: #313035; color: var(--ink); }
.button.primary { background: var(--gold); color: #20190f; border-color: var(--gold); }
.button.primary:hover { background: #ffe0a7; }
.metrics, .profile-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); margin-top: 1rem; background: var(--panel); }
.metrics > div, .profile-metrics > div { padding: .85rem 1.2rem; display: flex; align-items: baseline; gap: .4rem .8rem; flex-wrap: wrap; }
.metrics > div + div, .profile-metrics > div + div { border-left: 1px solid var(--border); }
.metrics strong { font-size: 1.75rem; color: var(--gold); }
.metrics span, .profile-metrics dt, .muted, .person span, .result-meta > span:last-child { color: var(--muted); }
.section { margin-top: 2.5rem; }
.section-heading { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.footer { border-top: 1px solid var(--border); margin-top: 3rem; padding: 1.25rem 0 2rem; font-weight: 700; display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.footer span, .empty { color: var(--muted); font-weight: 400; }
.page-heading { margin: 2.3rem 0 1.4rem; }
.page-heading h1, .profile-header h1 { font-size: clamp(2.6rem, 7vw, 4.35rem); }
.standings-heading { display: flex; align-items: end; justify-content: space-between; gap: .8rem 2rem; flex-wrap: wrap; border-bottom: 1px solid var(--border); padding: 0 0 1rem; }
.standings-heading h1, .standings-heading > p { margin: 0; }
.standings-heading > p { color: var(--muted); }
.tier-filters { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .85rem; }
.tier-filters a { display: inline-grid; place-items: center; min-height: 42px; padding: .32rem .68rem; border: 1px solid var(--border); border-radius: 4px; background: var(--panel); color: var(--tier, var(--ink)); font-weight: 750; text-decoration: none; }
.tier-filters a:hover, .tier-filters a[aria-current] { border-color: var(--tier, var(--gold)); background: #30291e; }
.tier-groups .player:focus-visible { position: relative; z-index: 1; }
.filters { display: flex; justify-content: space-between; gap: 1rem; align-items: end; flex-wrap: wrap; border: 1px solid var(--border); padding: .8rem; background: var(--panel); }
.segments { gap: .2rem; }
.filters label { display: block; font-size: .86rem; color: var(--muted); margin-bottom: .3rem; }
.filters form > div { display: flex; gap: .5rem; }
.filters input { color: var(--ink); background: #121316; border: 1px solid #515058; border-radius: 4px; padding: .48rem .65rem; min-width: 0; width: min(52vw, 300px); }
.match { margin: .9rem 0; }
.match a { margin-left: .5rem; }
.tier-groups { display: grid; gap: .6rem; }
.tier-group { display: grid; grid-template-columns: 92px minmax(0, 1fr); border: 1px solid var(--border); background: var(--panel); }
.tier-group h2 { margin: 0; display: grid; place-items: center; min-height: 68px; border-left: 3px solid var(--tier); border-right: 1px solid var(--border); color: var(--tier); background: #ffffff05; }
.roster { padding: .6rem; display: grid; align-items: center; grid-template-columns: repeat(auto-fill, minmax(min(100%, 185px), 1fr)); gap: .45rem; }
.roster > .muted { grid-column: 1 / -1; padding: .35rem; }
.player { display: flex; align-items: center; gap: .55rem; color: var(--ink); text-decoration: none; font-weight: 650; background: #131418; border: 1px solid #38383c; border-radius: 4px; padding: .38rem; min-width: 0; }
.player span { overflow-wrap: anywhere; min-width: 0; font-size: .9rem; }
.player small { margin-left: auto; color: var(--muted); font-size: .875rem; }
.player:hover { border-color: var(--tier); }
.avatar { image-rendering: pixelated; background: #302a26; border-radius: 3px; flex: none; object-fit: cover; }
.tier { color: var(--tier); border: 1px solid color-mix(in srgb, var(--tier) 40%, #29292b); font-weight: 800; border-radius: 4px; padding: .1em .38em; background: #18181c; display: inline-block; line-height: 1.2; }
.LT5 { --tier: #a8b5c6; }.HT5 { --tier: #93b8fc; }.LT4 { --tier: #7de0d0; }.HT4 { --tier: #73dc97; }.LT3 { --tier: #c0a7fd; }
.HT3 { --tier: #f49be6; }.LT2 { --tier: #ffa28f; }.HT2 { --tier: #ffba72; }.LT1 { --tier: #eec87a; }.HT1 { --tier: #ffdf8c; }
.placement { background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--tier, var(--gold)); min-width: 0; margin-bottom: .65rem; }
.placement-info { display: flex; align-items: center; gap: .65rem; padding: .7rem; }
.person, .result-meta { display: flex; flex-direction: column; align-items: flex-start; gap: .12rem; min-width: 0; }
.person a { color: var(--ink); font-weight: 750; overflow-wrap: anywhere; }
.person span, .result-meta > span:last-child { font-size: .875rem; }
.result-meta { margin-left: auto; align-items: end; text-align: right; }
.result-card { width: 100%; height: auto; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; align-items: start; }
.pagination { margin-top: 1.35rem; justify-content: center; }
.pagination a, .pagination span { padding: .4rem; }
.back { display: inline-block; margin: 1.5rem 0 .8rem; }
.profile-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; padding: clamp(1rem, 3vw, 2rem); border: 1px solid var(--border); border-top: 3px solid var(--gold); background: var(--panel); }
.profile-header h1 { margin: 0; overflow-wrap: anywhere; }
.profile-header > div { min-width: 0; }
.profile-tier { margin-left: auto; font-size: 2rem; }
.profile-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.profile-metrics > div { flex-direction: column; }
.profile-metrics dd { margin: 0; font-weight: 750; }
.history { list-style: none; padding: 0; }
.history li { display: grid; grid-template-columns: 1fr .5fr 1fr 1fr; align-items: center; gap: .6rem; border-bottom: 1px solid var(--border); padding: .8rem; background: var(--panel); }
.skip { position: absolute; left: 1rem; top: -5rem; background: #151617; padding: .4rem; z-index: 2; }
.skip:focus { top: .5rem; }
@media (max-width: 650px) {
  .masthead { padding: .75rem 0; gap: .4rem; }
  .masthead nav a { padding: .4rem .5rem; }
  .hero { grid-template-columns: 1fr; margin-top: 1rem; min-height: 0; }
  .hero-emblem { position: absolute; right: 0; top: 0; width: 58%; opacity: .28; }
  .hero-content { padding-block: 1.8rem; }
  .hero h1 { max-width: 11ch; }
  .results-grid { grid-template-columns: 1fr; }
  .tier-group { grid-template-columns: 60px minmax(0, 1fr); }
  .tier-group h2 { font-size: 1.35rem; }
  .roster { padding: .4rem; }
  .profile-header .avatar { width: 70px; height: 70px; }
  .profile-header { gap: .55rem; }
  .profile-header h1 { font-size: clamp(1.6rem, 7.6vw, 3rem); }
  .profile-metrics > div { padding: .65rem; }
  .history li { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
