.stats-intro { min-height: 16rem; display: flex; flex-direction: column; justify-content: end;
  padding: 1.4rem clamp(1.3rem, 3vw, 2.5rem); margin: 0 0 1.7rem;
  border: 1px solid #53616a;
  background: linear-gradient(90deg, #08131bf0, #0a1924d1 58%, #0a19247a),
              url("/static/img/rf-fleet-bg.jpg") center 34% / cover; }
.stats-intro .eyebrow { margin: 0 0 .55rem; }
.stats-intro h1 { margin: 0; font: 500 clamp(3rem, 7vw, 5.7rem)/.98 "Arial Narrow", Bahnschrift, sans-serif;
  letter-spacing: .045em; text-transform: uppercase; }
.stats-intro > p:last-child { color: #dce5e8; margin: .8rem 0 0; }
.stats-demo-notice { display: flex; align-items: flex-start; gap: 1rem; padding: 1rem 1.25rem;
  border: 1px solid #926032; background: linear-gradient(100deg, #302419, #1b252a 65%);
  color: #e2d5c4; font-size: .9rem; margin: 0 0 1.5rem; }
.stats-demo-notice strong, .demo-tag { color: #ffd39b; text-transform: uppercase;
  letter-spacing: .13em; font: 800 .72rem/1.5 "Arial Narrow", Bahnschrift, sans-serif; }
.stats-demo-notice strong { white-space: nowrap; padding: .2rem .55rem; border: 1px solid #ca803c; }
.stats-demo-notice b { color: #fff; }
.demo-tag { vertical-align: middle; font-size: .64rem; padding: .2rem .45rem; border: 1px solid #9a6333;
  margin-left: .25rem; white-space: nowrap; }
.stats-overview { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; margin-bottom: 1.5rem; }
.stats-overview-card { display: grid; gap: .35rem; padding: 1.1rem 1.2rem; background: #142129;
  border: 1px solid #3c4d57; border-top: 2px solid #9b542d; min-height: 7rem; }
.stats-overview-card > span { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; }
.stats-overview-card strong { color: var(--text); font: 600 2.1rem/1 "Arial Narrow", Bahnschrift, sans-serif; }
.stats-overview-card strong.name-gold { color: #e0a83e; }
.stats-overview-card strong.name-legendary { color: #8fe0f4; }
.stats-overview-card small { color: #99a7ad; font-size: .74rem; }
.stats-search { position: relative; margin: 1.8rem 0; max-width: 34rem; }
.stats-search label { display: block; margin-bottom: .45rem; color: var(--text); font-weight: 700; }
.stats-search input, .achievement-tools input, .stats-picker select {
  width: 100%; color: var(--text); background: #101b22; border: 1px solid #51616a;
  border-radius: 2px; font: inherit; padding: .68rem .85rem; }
.stats-search input:focus, .achievement-tools input:focus, .stats-picker select:focus {
  outline: 2px solid var(--gold); outline-offset: 2px; }
.stats-search-results { position: absolute; z-index: 5; top: 100%; width: 100%; max-height: 22rem;
  overflow-y: auto; background: #1a2932; border: 1px solid #62707a; box-shadow: 0 14px 30px #0009; }
.stats-search-results[hidden], .stats-view[hidden] { display: none; }
.stats-search-results button { display: flex; align-items: center; gap: .65rem; width: 100%; padding: .7rem .9rem;
  border: 0; border-bottom: 1px solid #394b55; color: var(--text); background: none;
  font: inherit; text-align: left; cursor: pointer; }
.stats-search-results button:hover { background: #2a3a42; }
.stats-search-results small { margin-left: auto; color: var(--muted); }
.stats-search-results p { margin: .8rem; color: var(--muted); }
.stats-tabs { display: flex; flex-wrap: wrap; gap: .3rem; border-bottom: 1px solid #5b6467;
  margin: 2rem 0 1.6rem; }
.stats-tabs button { border: 0; border-bottom: 3px solid transparent; background: none;
  color: #aab6bb; padding: .75rem 1rem; font: 800 .82rem/1.4 "Arial Narrow", Bahnschrift, sans-serif;
  letter-spacing: .12em; text-transform: uppercase; cursor: pointer; }
.stats-tabs button:hover { color: var(--text); background: #19262e; }
.stats-tabs button[aria-selected="true"] { color: var(--gold-2); border-bottom-color: var(--gold); }
.stats-view { min-height: 34rem; }
.stats-section-heading { display: flex; align-items: end; justify-content: space-between; flex-wrap: wrap;
  gap: 1rem; margin: 0 0 1.4rem; }
.stats-section-heading .eyebrow { display: block; margin-bottom: .4rem; }
.stats-section-heading h2 { margin: 0; text-transform: uppercase; }
.stats-picker { display: flex; align-items: center; gap: .65rem; color: var(--muted);
  font: 700 .8rem/1 "Arial Narrow", Bahnschrift, sans-serif; text-transform: uppercase; letter-spacing: .12em; }
.stats-picker select { width: auto; min-width: 11rem; color-scheme: dark; }
.stats-panel { background: #152129; border: 1px solid #3b4b55; padding: 1.2rem; min-width: 0; }
.stats-panel h3, .trend-card h3, .replay-events h3 { margin: 0 0 1rem;
  font: 600 1.3rem/1.2 "Arial Narrow", Bahnschrift, sans-serif; text-transform: uppercase; letter-spacing: .06em; }
.monthly-feature { display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(0, 2fr);
  min-height: 18rem; margin-bottom: 1rem; background: radial-gradient(circle at 0 20%, #3e3324, #182730 48%, #111d25);
  border: 1px solid #655640; }
.monthly-leader { padding: 1.8rem 2rem; border-right: 1px solid #726049; }
.monthly-leader h3 { margin: 1rem 0 .45rem; font: 600 clamp(2.3rem, 4vw, 3.5rem)/1 "Arial Narrow", Bahnschrift, sans-serif; }
.monthly-leader p { color: var(--gold-2); font-size: 1.2rem; font-weight: 700; }
.monthly-leader small { display: block; color: var(--muted); max-width: 20rem; line-height: 1.5; }
.monthly-podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; align-items: end; padding: 1.4rem; }
.podium-place { display: grid; align-content: end; gap: .8rem; padding: 1rem; min-height: 11rem;
  background: #ffffff0b; border-top: 3px solid #707b7e; }
.podium-place.place-1 { min-height: 15rem; border-top-color: var(--gold); background: #fa9d3e12; }
.podium-place.place-2 { min-height: 13rem; border-top-color: #b3bdc2; }
.podium-rank { font: 500 3rem/1 "Arial Narrow", Bahnschrift, sans-serif; color: #ffffff44; }
.podium-place .player-link { font-size: 1.2rem; display: block; text-align: left; }
.podium-place small { color: var(--muted); display: block; margin-top: .35rem; }
.monthly-bottom { display: grid; grid-template-columns: minmax(0, 2.2fr) minmax(14rem, 1fr); gap: 1rem; }
.race-wins { display: grid; gap: .6rem; }
.race-win { display: flex; align-items: center; gap: .8rem; padding: .6rem .7rem; border: 1px solid #34424b;
  border-left: 3px solid currentColor; }
.race-win strong { margin-left: auto; font-size: 1.5rem; }
.race-win small { color: var(--muted); }
.bellato { color: var(--bellato); } .cora { color: var(--cora); } .accretia { color: var(--accretia); }
.race-pill { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em; padding: .15rem .45rem; border: 1px solid currentColor; white-space: nowrap; }
.player-link { color: var(--text); background: none; border: 0; border-bottom: 1px dotted #d1d7d7;
  padding: 0; font: inherit; font-weight: 700; cursor: pointer; }
.player-link:hover { color: var(--gold-2); border-bottom-color: var(--gold); }
.player-link.name-gold, .name-gold { color: #e0a83e; }
.player-link.name-legendary, .name-legendary { color: #8fe0f4; text-shadow: 0 0 8px #8fe0f44d; }
.player-link.name-gold:hover { color: #ffd98a; }
.player-link.name-legendary:hover { color: #c9f2ff; border-bottom-color: #8fe0f4; }
.stats-search-results .name-gold { color: #e0a83e; }
.stats-search-results .name-legendary { color: #8fe0f4; }
.stats-table-wrap { overflow-x: auto; }
.stats-table { border-collapse: collapse; width: 100%; white-space: nowrap; }
.stats-table th { color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-size: .72rem; text-align: left; }
.stats-table th, .stats-table td { border-bottom: 1px solid #35434a; padding: .62rem .65rem; }
.stats-table tbody tr:hover { background: #ffffff08; }
.stats-table .num { font-weight: 700; color: var(--gold-2); }
.stats-board-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.board-card { padding: 1rem; }
.board-card .stats-table th, .board-card .stats-table td { padding: .65rem .35rem; }
.achievement-tools { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.achievement-tools input { max-width: 18rem; }
.achievement-groups { display: flex; flex-wrap: wrap; gap: .4rem; }
.achievement-groups button { padding: .48rem .75rem; background: #17252d; color: var(--muted);
  border: 1px solid #4e5c64; font: 700 .75rem/1 "Arial Narrow", Bahnschrift, sans-serif;
  text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.achievement-groups button:hover, .achievement-groups button[aria-pressed="true"] {
  border-color: var(--gold); color: var(--gold-2); }
.achievement-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.achievement-card { background: #152129; border: 1px solid #41505a; padding: 1.2rem; min-width: 0; }
.achievement-card h3 { font-size: 1.2rem; margin: .35rem 0 1rem; }
.achievement-tiers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .35rem; margin-bottom: 1rem; }
.achievement-tier { display: grid; gap: .2rem; padding: .45rem; border: 1px solid #384850;
  color: #89969c; font-size: .7rem; line-height: 1.3; }
.achievement-tier.reached { color: #e6d5bd; border-color: #a66e39; background: #9f5b261c; }
.achievement-tier.tier-1.reached { color: #c98a51; border-color: #a9713f; background: #a9713f1b; }
.achievement-tier.tier-2.reached { color: #c2cbd0; border-color: #9fa8ad; background: #9fa8ad16; }
.achievement-tier.tier-3.reached { color: #e0a83e; border-color: #e0a83e; background: #e0a83e17; }
.achievement-tier.tier-4.reached { color: #8fe0f4; border-color: #7fd4e8; background: #7fd4e820; }
.achievement-tier small { opacity: .75; }
.achievement-leaders { border-top: 1px solid #3b4a52; padding-top: .75rem; }
.achievement-leaders > strong { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.achievement-leaders > div { display: flex; justify-content: space-between; gap: .5rem; margin-top: .45rem; font-size: .86rem; }
.achievement-leaders b { color: var(--gold-2); }
.trend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.trend-card { background: #152129; border: 1px solid #3b4b55; padding: 1.25rem; min-width: 0; }
.trend-wide { grid-column: 1 / -1; }
.trend-card h3 span { color: var(--muted); font: 400 .8rem/1 system-ui, sans-serif; letter-spacing: normal; text-transform: none; }
.population-now { display: flex; gap: .7rem; align-items: baseline; }
.population-now strong { font: 600 2.5rem/1 "Arial Narrow", Bahnschrift, sans-serif; }
.population-now span { color: var(--muted); }
.race-legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: .8rem 0; font-size: .85rem; }
.race-legend span::before { content: ""; display: inline-block; width: .55rem; height: .55rem; margin-right: .35rem; background: currentColor; }
.stats-chart { display: block; width: 100%; height: auto; min-height: 12rem; }
.stats-chart text { fill: #aab4b9; font: 11px system-ui, sans-serif; }
.chart-axis { fill: none; stroke: #6a787f; stroke-width: 1; }
.chart-grid { fill: none; stroke: #3b4a53; stroke-width: 1; stroke-dasharray: 4 5; }
.chart-line { fill: none; stroke: currentColor; stroke-width: 3; }
.chart-dot, .chart-fill { fill: currentColor; }
.ranked-bars { display: grid; gap: 1rem; }
.ranked-bar > div { display: flex; justify-content: space-between; gap: .5rem; font-size: .83rem; }
.ranked-bar strong { color: var(--gold-2); }
.ranked-bar progress { width: 100%; height: .55rem; appearance: none; border: 0; background: #2c3c45; }
.ranked-bar progress::-webkit-progress-bar { background: #2c3c45; }
.ranked-bar progress::-webkit-progress-value { background: linear-gradient(90deg, #d85f28, #f9a34d); }
.ranked-bar progress::-moz-progress-bar { background: var(--gold); }
.replay-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(15rem, 1fr); gap: 1rem; }
.replay-main, .replay-events { background: #142129; border: 1px solid #42525b; }
.replay-main { padding: 1rem; }
.replay-map { position: relative; width: min(100%, 741px); aspect-ratio: 741 / 732;
  overflow: hidden; border: 1px solid #627078; background: #121b20; margin: 0 auto; }
.replay-map canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.replay-controls { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin-top: 1rem; }
.replay-controls button { border: 1px solid #775b43; color: var(--text); background: #1d2b33;
  cursor: pointer; padding: .55rem .75rem; font: 700 .78rem/1 "Arial Narrow", Bahnschrift, sans-serif; text-transform: uppercase; }
.replay-controls button:hover, .replay-speeds button[aria-pressed="true"] { border-color: var(--gold); color: var(--gold-2); }
.replay-speeds { display: flex; gap: .25rem; margin-left: auto; }
.replay-speeds button { padding: .55rem .48rem; }
.replay-controls input { flex: 1 1 100%; order: 2; accent-color: var(--gold); }
.replay-controls output { color: var(--gold-2); font-size: .8rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.replay-legend { display: flex; flex-wrap: wrap; gap: .75rem; color: var(--muted); margin-top: .8rem; font-size: .73rem; }
.replay-legend span::before { content: ""; display: inline-block; width: .55rem; height: .55rem;
  background: currentColor; margin-right: .35rem; }
.replay-legend span:last-child::before { display: none; }
.replay-legend .bellato { color: #77a7ed; } .replay-legend .cora { color: #a4d36e; }
.replay-legend .accretia { color: #e98976; }
.replay-events { padding: 1.1rem; max-height: 57rem; overflow-y: auto; }
.replay-events h3 small { display: block; color: var(--muted); font-size: .72rem; font-weight: 400;
  text-transform: none; letter-spacing: 0; margin-top: .35rem; line-height: 1.5; }
.replay-score { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; margin-bottom: 1.2rem; }
.replay-score div { background: #202f36; border-top: 2px solid currentColor; padding: .65rem .3rem; text-align: center; }
.replay-score strong { display: block; color: var(--text); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.replay-score span { font-size: .67rem; text-transform: uppercase; }
.replay-score .bellato { color: #77a7ed; } .replay-score .cora { color: #a4d36e; }
.replay-score .accretia { color: #e98976; }
.replay-events ol { list-style: none; padding: 0; margin: 0; }
.replay-events li { border-left: 2px solid #55656d; }
.replay-events li.is-current { border-left-color: var(--gold); background: #f89c3514; }
.replay-events button { display: grid; gap: .2rem; width: 100%; padding: .6rem .7rem; color: var(--text);
  border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
.replay-events button:hover { background: #ffffff0c; }
.replay-events time { color: var(--gold-2); font-size: .75rem; }
.replay-feed-name { font-weight: 700; }
.replay-feed-name.bellato { color: #77a7ed; } .replay-feed-name.cora { color: #a4d36e; }
.replay-feed-name.accretia { color: #e98976; }
.player-dialog { width: min(46rem, calc(100vw - 2rem)); max-height: min(90vh, 58rem);
  overflow-y: auto; padding: 0; background: #142129; color: var(--text);
  border: 1px solid #6b767a; box-shadow: 0 30px 100px #000c; }
.player-dialog::backdrop { background: #061016d9; }
.player-dialog-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center;
  justify-content: space-between; padding: .8rem 1.2rem; background: #0d171e; border-bottom: 1px solid #4b5b63; }
.player-dialog-top button { color: var(--text); background: none; border: 0; font-size: 1.6rem; cursor: pointer; }
#player-detail { padding: 1.4rem; }
.profile-heading { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.profile-heading h2 { margin: 0 0 .5rem; text-transform: uppercase; font-size: 2.5rem; }
.profile-rank { color: var(--gold-2); font: 800 .7rem/1.3 "Arial Narrow", Bahnschrift, sans-serif; letter-spacing: .14em; }
.profile-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 1.4rem 0; }
.profile-metrics div { background: #1d2c35; border-top: 2px solid #a76437; padding: .8rem; }
.profile-metrics span, .profile-details span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; }
.profile-metrics strong { display: block; font: 600 1.65rem/1.2 "Arial Narrow", Bahnschrift, sans-serif; margin-top: .35rem; }
.profile-details { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; border: 1px solid #42525a; padding: 1rem; }
.profile-details strong { display: block; margin-top: .2rem; }
.linked-characters { display: flex; justify-content: space-between; gap: .5rem; align-items: center; margin: 0 0 1rem;
  padding: .7rem; background: #f39a3417; border: 1px solid #855e37; font-size: .82rem; }
.linked-characters button { background: none; color: var(--gold-2); border: 0; text-decoration: underline; cursor: pointer; }
.profile-section { margin-top: 1.5rem; }
.profile-section h3 { margin: 0 0 .6rem; text-transform: uppercase; font-size: .95rem; letter-spacing: .07em; }
.profile-section h3 small { color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: normal; }
.profile-badges { display: flex; flex-wrap: wrap; gap: .45rem; }
.achievement-badge { padding: .35rem .55rem; border: 1px solid #98764d; background: #bb8b361c;
  color: #f4ca8c; font-size: .72rem; }
.achievement-badge.tier-1, .achievement-legend .tier-1 { color: #c98a51; border-color: #a9713f; }
.achievement-badge.tier-2, .achievement-legend .tier-2 { color: #c2cbd0; border-color: #9fa8ad; }
.achievement-badge.tier-3, .achievement-legend .tier-3 { color: #e0a83e; border-color: #e0a83e; }
.achievement-badge.tier-4, .achievement-legend .tier-4 { color: #8fe0f4; border-color: #7fd4e8;
  background: #7fd4e81b; box-shadow: 0 0 12px #7fd4e82b; }
.achievement-badge.tier-3 { border-color: #d1a354; }
.achievement-legend { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem;
  margin: 0 0 1.1rem; }
.achievement-legend > span { padding: .28rem .6rem; border: 1px solid; background: #17242d;
  font: 700 .72rem/1.3 "Arial Narrow", Bahnschrift, sans-serif; text-transform: uppercase;
  letter-spacing: .08em; }
.achievement-legend small { color: var(--muted); margin-left: .5rem; }
.achievement-feed { margin-bottom: 1.4rem; }
.achievement-feed-heading { display: flex; justify-content: space-between; align-items: end;
  flex-wrap: wrap; gap: .5rem; border-bottom: 1px solid #3b4b55; padding-bottom: .7rem; }
.achievement-feed-heading h3 { margin: .25rem 0 0; }
.achievement-feed-heading > span { color: var(--muted); font-size: .75rem; }
.achievement-feed ol { margin: 0; padding: 0; list-style: none; max-height: 23rem; overflow-y: auto; }
.achievement-feed li { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .8rem;
  padding: .65rem 0; border-bottom: 1px solid #33434c; }
.achievement-feed li:last-child { border-bottom: 0; }
.achievement-feed time { flex: 0 0 9.6rem; color: var(--muted); font-size: .73rem;
  font-variant-numeric: tabular-nums; }
.achievement-feed .player-link { font-weight: 700; }
.achievement-feed .achievement-badge { font-size: .73rem; }
.achievement-feed-group { margin-left: auto; color: var(--muted); font-size: .69rem;
  text-transform: uppercase; letter-spacing: .1em; }
.profile-split { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.profile-section ol { margin: 0; padding-left: 1.3rem; }
.profile-section li { padding: .3rem 0; }
.profile-section li strong { color: var(--gold-2); }
.recent-fights { list-style: none; padding: 0 !important; }
.recent-fights li { display: grid; grid-template-columns: 8.7rem 1fr; gap: .3rem;
  border-bottom: 1px solid #3b4b54; }
.recent-fights time, .recent-fights small { color: var(--muted); font-size: .76rem; }
.recent-fights small { grid-column: 2; }
.profile-footnote { color: var(--muted); font-size: .76rem; margin: 1.5rem 0 0; }
@media (max-width: 950px) {
  .stats-overview { grid-template-columns: repeat(2, 1fr); }
  .stats-board-grid { grid-template-columns: 1fr 1fr; }
  .monthly-bottom { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .stats-demo-notice { display: grid; }
  .stats-demo-notice strong { justify-self: start; }
  .stats-tabs { gap: 0; }
  .stats-tabs button { padding: .6rem .55rem; font-size: .72rem; }
  .monthly-feature { grid-template-columns: 1fr; }
  .monthly-leader { border-right: 0; border-bottom: 1px solid #726049; }
  .monthly-podium { min-height: 11rem; }
  .podium-place, .podium-place.place-1, .podium-place.place-2 { min-height: 8rem; }
  .stats-board-grid, .achievement-grid, .trend-grid, .replay-layout { grid-template-columns: 1fr; }
  .trend-wide { grid-column: auto; }
  .replay-events { max-height: 26rem; }
}
@media (max-width: 450px) {
  .stats-intro { min-height: 13rem; }
  .achievement-feed time { flex: 0 0 100%; }
  .achievement-feed-group { display: none; }
  .stats-overview { gap: .5rem; }
  .stats-overview-card { padding: .8rem; }
  .stats-overview-card strong { font-size: 1.55rem; }
  .stats-tabs button { flex: 1 1 33%; }
  .stats-section-heading h2 { font-size: 1.8rem; }
  .stats-picker { width: 100%; }
  .stats-picker select { flex: 1; min-width: 0; }
  .monthly-podium { gap: .3rem; padding: .65rem; }
  .podium-place { padding: .5rem; }
  .podium-place .player-link { font-size: .9rem; }
  .podium-rank { font-size: 2rem; }
  .achievement-tiers { grid-template-columns: repeat(2, 1fr); }
  .profile-metrics { grid-template-columns: repeat(2, 1fr); }
  .profile-details, .profile-split { grid-template-columns: 1fr; }
  .recent-fights li { grid-template-columns: 1fr; }
  .recent-fights small { grid-column: 1; }
}
