/* ---- opening ---- */
.opening__legend { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; height: 32px; margin-bottom: 8px; transition: opacity .3s; }
.opening__legend.is-locked { opacity: .35; pointer-events: none; }
.legend__item { font: 400 16px/1.2 var(--font-body); display: inline-flex; align-items: center; gap: 8px; padding: 4px 10px;
  border: 1.5px solid var(--wro-black); border-radius: 0; background: var(--wro-white); color: var(--wro-black); cursor: pointer; }
.legend__item i { display: inline-block; width: 12px; height: 12px; }
.legend__item.is-active { background: var(--wro-black); color: var(--wro-white); }
.legend__item:focus-visible { outline: 3px solid var(--wro-yellow); outline-offset: 2px; }

.opening__chart { display: block; width: 1520px; height: 690px; overflow: visible; font-family: var(--font-body); }
.opening__chart .axis line { stroke: rgba(0, 0, 0, .12); stroke-width: 2; }
.opening__chart .axis text { font-size: 22px; fill: #555; font-variant-numeric: tabular-nums; }
.opening__chart .baseline { stroke: var(--wro-black); stroke-width: 2; }
.opening__chart .bar__value { font-family: var(--font-display); font-size: 40px; font-weight: 700; fill: var(--wro-black); transition: opacity .4s; }
.opening__chart .bar__name { font-size: 26px; font-weight: 400; fill: var(--wro-black); transition: opacity .4s; }
.opening__chart .bar.is-off .bar__value { opacity: 0; }
.opening__chart .bar.is-off .bar__name { opacity: .3; }
.opening__chart .bar__ghost { fill: none; stroke: var(--wro-black); stroke-width: 2.5; stroke-dasharray: 8 6; opacity: 0; transition: opacity .3s; }
.opening__chart .bar.has-ghost .bar__ghost { opacity: .5; }
.opening__chart .bar__ghost-value { font-size: 20px; font-weight: 500; fill: var(--wro-black); opacity: 0; font-variant-numeric: tabular-nums; transition: opacity .3s; }
.opening__chart .bar.has-ghost .bar__ghost-value { opacity: .45; }
.opening__chart .ghost-note { font-size: 18px; fill: var(--wro-grey); opacity: 0; transition: opacity .3s; }
.opening__chart .ghost-note.is-on { opacity: 1; }
.opening__chart .section { font-family: var(--font-display); font-size: 28px; font-weight: 600; fill: var(--wro-black); }
.opening__chart .line { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: .8; transition: opacity .4s; }
.opening__chart .area { fill-opacity: .16; transition: opacity .4s; }
.opening__chart .end { transition: opacity .4s; }
.opening__chart .line.is-off, .opening__chart .area.is-off, .opening__chart .end.is-off { opacity: 0; }

/* ---- world map ---- */
.map { display: block; width: 1520px; height: 730px; overflow: visible; }
.map__land { fill: #E4E4E4; stroke: var(--wro-white); stroke-width: .8; transition: fill .6s, fill-opacity .6s; }
.map__land.is-on { fill-opacity: .35; }
.map__dot { fill-opacity: .88; stroke: var(--wro-white); stroke-width: 1.5; }
.map__dot.is-hot { stroke: var(--wro-black); stroke-width: 2.5; }
.map__ping { fill: none; stroke-width: 3; }
.map__label { animation: fade-in .5s both; }
.map__label text { fill: var(--wro-black); paint-order: stroke; stroke: var(--wro-white); stroke-width: 5px; stroke-linejoin: round; }
.map__label-name { font: 500 20px var(--font-body); }
.map__label-value { font: 700 28px var(--font-display); font-variant-numeric: tabular-nums; }
.map__leader { stroke: #333; stroke-width: 1.5; }
.map__debug { font: 700 11px var(--font-body); fill: var(--wro-black); paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.map__info { position: absolute; left: 0; top: 330px; width: 330px; pointer-events: none; }
.map__stats div { display: flex; align-items: baseline; gap: 12px; }
.map__stats b { font: 700 56px/1.05 var(--font-display); font-variant-numeric: tabular-nums; }
.map__stats span { font: 400 22px var(--font-body); }
.map__legend svg { display: block; margin-top: 12px; overflow: visible; }
.map__legend circle { fill: none; stroke: #555; stroke-width: 1.5; }
.map__legend line { stroke: #999; stroke-dasharray: 3 3; }
.map__legend text { font: 400 18px var(--font-body); fill: #333; }
.map__legend p { margin: 4px 0 0; font: 400 18px var(--font-body); color: #555; }
@keyframes fade-in { from { opacity: 0; } }

/* ---- shared legend rows ---- */
.race__legend, .learning__legend {
  display: flex; flex-wrap: wrap; gap: 24px; align-items: center; height: 32px; margin-bottom: 8px; font: 400 18px var(--font-body); }
.race__legend span, .learning__legend span { display: inline-flex; align-items: center; gap: 8px; }
.race__legend i, .learning__legend i { display: inline-block; width: 14px; height: 14px; }
.learning__legend b b b { font: 700 20px var(--font-display); font-variant-numeric: tabular-nums; }

/* ---- bar chart race ---- */
.race { display: block; width: 1520px; height: 700px; overflow: visible; font-family: var(--font-body); }
.race__axis line { stroke: rgba(0, 0, 0, .12); stroke-width: 2; }
.race__axis text { font-size: 18px; fill: #555; font-variant-numeric: tabular-nums; }
.race__base { stroke: var(--wro-black); stroke-width: 2; }
.race__name { font-size: 22px; fill: var(--wro-black); }
.race__value { font: 700 26px var(--font-display); fill: var(--wro-black); font-variant-numeric: tabular-nums; }
.race__caption { position: absolute; right: 12px; top: 430px; display: flex; flex-direction: column; gap: 4px; padding: 18px 28px;
  background: var(--wro-yellow); opacity: 0; transform: translateY(-8px); transition: opacity .5s, transform .5s; pointer-events: none; }
.race__caption.is-on { opacity: 1; transform: none; }
.race__caption span { font: 500 20px var(--font-body); letter-spacing: .12em; text-transform: uppercase; }
.race__caption b { font: 700 40px/1.1 var(--font-display); }

/* ---- learning ---- */
.learning__legend i.is-line { height: 4px; width: 22px; }
.learning { display: block; width: 1520px; height: 700px; overflow: visible; font-family: var(--font-body); }
.learning .axis line { stroke: rgba(0, 0, 0, .12); stroke-width: 2; }
.learning .axis text { font-size: 20px; fill: #555; font-variant-numeric: tabular-nums; }
.learning .baseline { stroke: var(--wro-black); stroke-width: 2; }
.learning .section { font: 600 24px var(--font-display); fill: var(--wro-black); }
.learning .area { fill-opacity: .18; }
.learning .line { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.learning__bar { fill-opacity: .55; }
.learning__bar.is-surge { fill-opacity: 1; }
.learning__surge, .learning__rate-label { paint-order: stroke; stroke: var(--wro-white); stroke-width: 6px; stroke-linejoin: round; }
.learning__surge { font: 700 22px var(--font-display); fill: var(--wro-black); opacity: 0; transition: opacity .3s; }
.learning__surge.is-on { opacity: 1; }
.learning__rate { fill: none; stroke: var(--wro-navy); stroke-width: 4; stroke-linejoin: round; }
.learning__rate-end { fill: var(--wro-navy); }
.learning__rate-label { font: 700 24px var(--font-display); fill: var(--wro-navy); }


/* learning: section titles on a white background, above the milestone lines */
.learning .section-bg { fill: var(--wro-white); }
