/*
 * Game Pulse: the shared components (widgets, boards, tables, filters, previews, KPI strips) and the r12 look
 * contract (docs/pilot/game-pulse-r12-design.md, section 2).
 *
 * Every component reads only the --gp-* tokens below. Their neutral defaults follow the Pulse theme's palette
 * (--wp--preset--color--*), so dark mode follows too. A game sets its values in assets/css/look-<game>.css, scoped
 * to [data-game="<game>"], .is-game-<game>; that file loads after every other Game Pulse stylesheet. The defaults
 * are declared with zero specificity (:where), so any game scope wins over them without !important.
 *
 *   --gp-surface, --gp-surface-2, --gp-surface-sunk      panel, raised inner panel (tiles, cards), inset well (tables,
 *                                                        inputs); any background value, gradient layers allowed
 *   --gp-ink, --gp-ink-muted, --gp-ink-strong            body text, secondary text, emphasis
 *   --gp-accent, --gp-accent-ink, --gp-accent-2          signature colour, text on it, a second accent
 *   --gp-title-ink, --gp-title-shadow                    headings: colour and text-shadow
 *   --gp-head-font, --gp-body-font, --gp-num-font        font stacks: titles, body, numbers
 *   --gp-frame-border, --gp-frame-radius,                panel frame: border shorthand, radius, box-shadow,
 *   --gp-frame-shadow, --gp-frame-image                  border-image (or none)
 *   --gp-tab-bg, --gp-tab-ink, --gp-tab-active-bg,       section tabs; --gp-tab-shape is a clip-path or none
 *   --gp-tab-active-ink, --gp-tab-shape
 *   --gp-btn-bg, --gp-btn-ink, --gp-btn-border,          buttons, chips, segmented controls (border is a shorthand)
 *   --gp-btn-hover-bg
 *   --gp-table-head-bg, --gp-table-head-ink,             tables and boards
 *   --gp-row-alt, --gp-row-hover, --gp-grid-line
 *   --gp-good, --gp-bad, --gp-warn                       up/down, alive/dead, warnings
 *   --gp-pop-bg, --gp-pop-border, --gp-pop-shadow        previews and tooltips (border is a shorthand)
 *   --gp-hero-bg                                         the hero band's background (layered gradients)
 *
 * Extras a look may also set: --gp-tabbar-bg and --gp-tabbar-rule (the bar behind the tabs), --gp-hero-ink,
 * --gp-hero-title, --gp-hero-accent, --gp-hero-rule (the hero band is always dark), --gp-radius-inner (chips, inputs,
 * inner tiles; derived from --gp-frame-radius), --gp-bar, --gp-bar-track, --gp-bar-radius, --gp-bar-overlay
 * (progress bars), --gp-live-bg, --gp-live-ink (the Live badge), --gp-series-1 ... -5 (chart lines), --heat-0 ... 5.
 * The legacy tokens (--gp-panel-bg, --gp-panel-alt-bg, --gp-panel-border, --gp-panel-shadow, --gp-radius,
 * --gp-radius-sm, --gp-tone, --gp-tabs-*) still feed the defaults, so module stylesheets that set them keep working.
 * --gp-sticky-top is set by pulse.js (the height of the sticky site header); sticky tabs and table heads sit under it.
 */

:root {
	--gp-head-font: var(--wp--preset--font-family--heading, system-ui, sans-serif);
	--gp-body-font: var(--wp--preset--font-family--body, system-ui, sans-serif);
	--gp-num-font: var(--wp--preset--font-family--body, system-ui, sans-serif);
	--gp-hero-bg: radial-gradient(60rem 18rem at 85% -4rem, rgba(251, 191, 36, 0.16), transparent 70%), linear-gradient(160deg, #0B0F1A, #1F2937);
	--gp-sticky-top: 4rem;
}

:where(:root, [data-game], [class*="is-game-"]) {
	--gp-surface: var(--gp-panel-bg, var(--wp--preset--color--surface-alt, #F8FAFC));
	--gp-surface-2: var(--gp-panel-alt-bg, var(--wp--preset--color--surface, #FFFFFF));
	--gp-surface-sunk: var(--wp--preset--color--surface, #FFFFFF);
	--gp-ink: var(--wp--preset--color--ink, #0F172A);
	--gp-ink-muted: var(--wp--preset--color--muted, #64748B);
	--gp-ink-strong: var(--wp--preset--color--ink, #0F172A);
	--gp-accent: var(--wp--preset--color--primary-text, var(--wp--preset--color--primary, #B45309));
	--gp-accent-ink: var(--wp--preset--color--on-primary, #FFFFFF);
	--gp-accent-2: var(--gp-tone, var(--wp--preset--color--accent, #059669));
	--gp-title-ink: var(--wp--preset--color--ink, #0F172A);
	--gp-title-shadow: none;
	--gp-frame-border: 1px solid var(--gp-panel-border, var(--wp--preset--color--border, #E2E8F0));
	--gp-frame-radius: var(--gp-radius, 14px);
	--gp-frame-shadow: var(--gp-panel-shadow, none);
	--gp-frame-image: none;
	--gp-radius-inner: min(var(--gp-radius-sm, 10px), var(--gp-frame-radius));
	--gp-tab-bg: transparent;
	--gp-tab-ink: var(--gp-tabs-ink, #E5E7EB);
	--gp-tab-active-bg: transparent;
	--gp-tab-active-ink: var(--gp-tabs-active, #FBBF24);
	--gp-tab-shape: none;
	--gp-tabbar-bg: var(--gp-tabs-bg, #111827);
	--gp-tabbar-rule: var(--gp-tabs-rule, rgba(255, 255, 255, 0.12));
	--gp-btn-bg: var(--wp--preset--color--surface, #FFFFFF);
	--gp-btn-ink: var(--wp--preset--color--ink, #0F172A);
	--gp-btn-border: 1px solid var(--wp--preset--color--border, #CBD5E1);
	--gp-btn-hover-bg: var(--wp--preset--color--surface-alt, #F1F5F9);
	--gp-table-head-bg: var(--wp--preset--color--surface-alt, #F8FAFC);
	--gp-table-head-ink: var(--wp--preset--color--muted, #64748B);
	--gp-row-alt: transparent;
	--gp-row-hover: color-mix(in srgb, var(--wp--preset--color--primary, #D97706) 7%, transparent);
	--gp-grid-line: var(--wp--preset--color--border, #E2E8F0);
	--gp-good: var(--wp--preset--color--accent-text, light-dark(#047857, #34D399));
	--gp-bad: var(--pulse-danger, light-dark(#B91C1C, #FCA5A5));
	--gp-warn: light-dark(#B45309, #FBBF24);
	--gp-pop-bg: var(--wp--preset--color--surface, #FFFFFF);
	--gp-pop-border: 1px solid var(--wp--preset--color--border, #CBD5E1);
	--gp-pop-shadow: 0 16px 40px -14px rgba(15, 23, 42, 0.5), 0 2px 6px rgba(15, 23, 42, 0.12);
}

/* The body font of a game's pages and of every shared component. */
.gp-section,
.gp-widget,
.gp-race,
.gp-pop {
	font-family: var(--gp-body-font);
}

/* A frame: every boxed component draws its frame from the same four tokens. */
.gp-widget,
.gp-race-chart,
.gp-stat-chart,
.gp-map,
.gp-death-form,
.gp-race-card,
.gp-leader,
.gp-table-wrap,
.gp-filters,
.gp-race-filters {
	border-image: var(--gp-frame-image);
}

.gp-widget {
	margin: var(--wp--preset--spacing--40, 1.5rem) 0;
	padding: var(--wp--preset--spacing--40, 1.5rem);
	border: var(--gp-frame-border);
	border-radius: var(--gp-frame-radius);
	background: var(--gp-surface);
	box-shadow: var(--gp-frame-shadow);
	color: var(--gp-ink);
}

.gp-title {
	margin: 0 0 0.25rem;
	font-family: var(--gp-head-font, inherit);
	font-size: var(--wp--preset--font-size--medium, 1.125rem);
	color: var(--gp-title-ink);
	text-shadow: var(--gp-title-shadow);
}

.gp-intro {
	margin: 0 0 var(--wp--preset--spacing--30, 1rem);
	color: var(--gp-ink-muted);
}

.gp-intro--small {
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

.gp-stats {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
	gap: 0.75rem;
	margin: 0 0 var(--wp--preset--spacing--30, 1rem);
}

/* A stats page section (<section class="gp-stats">) holds charts and tables, not a grid of tiles. */
section.gp-stats,
.gp-stats--section {
	display: block;
	margin: var(--wp--preset--spacing--50, 2rem) auto;
}

section.gp-stats > * + *,
.gp-stats--section > * + * {
	margin-top: var(--wp--preset--spacing--40, 1.5rem);
}

.gp-stats--panel {
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	margin-bottom: 0;
}

.gp-stat {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	padding: 0.9rem 1rem;
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-2);
	border: var(--gp-frame-border);
	box-shadow: var(--gp-frame-shadow);
	overflow: hidden;
}

/* Summary tiles carry a thin tinted edge, so a row of them reads as one instrument panel. */
.gp-stat::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 3px;
	background: var(--gp-accent-2);
	opacity: 0.85;
}

.gp-stat-value {
	font-family: var(--gp-num-font);
	font-size: var(--wp--preset--font-size--x-large, 1.75rem);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: var(--gp-ink-strong);
	line-height: 1.1;
}

.gp-stat-label {
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

.gp-stat-note {
	margin-top: 0.3rem;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

.gp-chart {
	margin: 0.5rem 0;
}

.gp-chart canvas {
	display: block;
	width: 100%;
	height: 240px;
}

.gp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	margin: 0;
}

.gp-table th,
.gp-table td {
	padding: 0.5rem 0.6rem;
	text-align: left;
	border-bottom: 1px solid var(--gp-grid-line);
	vertical-align: top;
}

.gp-table th {
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--gp-ink-muted);
}

.gp-table td {
	color: var(--gp-ink);
}

.gp-table .gp-num {
	font-family: var(--gp-num-font);
}

.gp-table thead th {
	font-family: var(--gp-head-font, inherit);
	background: var(--gp-table-head-bg);
	color: var(--gp-table-head-ink);
	border-bottom-width: 2px;
	white-space: nowrap;
}

.gp-table tbody tr:nth-child(even of :not([hidden], .gp-group-row)) {
	background: var(--gp-row-alt);
}

.gp-table tbody tr:hover {
	background: var(--gp-row-hover);
}

.gp-table--compact td,
.gp-table--compact th {
	padding: 0.3rem 0.5rem;
}

.gp-num {
	font-variant-numeric: tabular-nums;
	text-align: right;
}

.gp-note {
	margin: 0.75rem 0 0;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

.gp-note--error {
	color: var(--gp-bad);
}

.gp-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 0.75rem;
}

.gp-form input {
	flex: 1 1 12rem;
	padding: 0.55rem 0.7rem;
	border: 1px solid var(--gp-grid-line);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-sunk);
	color: var(--gp-ink);
	font: inherit;
}

.gp-news {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gp-news li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.5rem 0;
	border-bottom: 1px solid var(--gp-grid-line);
}

.gp-news a {
	font-weight: 600;
	text-decoration: none;
}

.gp-news a:hover,
.gp-news a:focus-visible {
	text-decoration: underline;
}

.gp-news-date {
	flex: none;
	color: var(--gp-ink-muted);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

/* Countdown: one tile per unit, digits that do not jump as they tick. */
.gp-countdown {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.gp-countdown-part {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 4.5rem;
	padding: 0.6rem 0.8rem;
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-2);
	border: var(--gp-frame-border);
	box-shadow: var(--gp-frame-shadow);
}

.gp-countdown-part strong {
	font-family: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	font-size: var(--wp--preset--font-size--x-large, 1.75rem);
	font-variant-numeric: tabular-nums;
	color: var(--gp-accent);
	line-height: 1.1;
}

.gp-countdown-part small {
	color: var(--gp-ink-muted);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-size: 0.7rem;
	font-weight: 700;
}

.gp-countdown-done {
	font-weight: 700;
	color: var(--gp-good);
}

/* Highlights timeline ([gp_highlights]) */

.gp-timeline {
	list-style: none;
	margin: var(--wp--preset--spacing--30, 1rem) 0;
	padding: 0 0 0 1.25rem;
	border-left: 2px solid var(--wp--preset--color--border, #E2E8F0);
}

.gp-timeline-item {
	position: relative;
	padding: 0 0 var(--wp--preset--spacing--40, 1.5rem) 0.75rem;
}

.gp-timeline-item::before {
	content: "";
	position: absolute;
	left: calc(-1.25rem - 7px);
	top: 0.35rem;
	width: 12px;
	height: 12px;
	border-radius: 999px;
	background: var(--gp-accent);
	box-shadow: 0 0 0 4px var(--wp--preset--color--surface, #FFFFFF);
}

.gp-timeline-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

.gp-pill {
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	font-size: 0.7rem;
	background: var(--wp--preset--color--primary-soft, #FFFBEB);
	color: var(--gp-accent);
}

.gp-pill--world-first,
.gp-pill--record {
	background: var(--gp-live-bg, #047857);
	color: var(--gp-live-ink, #FFFFFF);
}

.gp-timeline-title {
	display: block;
	margin-top: 0.25rem;
	font-weight: 700;
	font-size: var(--wp--preset--font-size--medium, 1.125rem);
	text-decoration: none;
}

.gp-timeline-title:hover,
.gp-timeline-title:focus-visible {
	text-decoration: underline;
}

.gp-timeline-player {
	display: block;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	color: var(--gp-ink-muted);
}

.gp-timeline-item p {
	margin: 0.35rem 0 0;
}

.gp-stat-note--error {
	color: var(--gp-bad);
}

/* Race boards ([gp_race]) */

.gp-race {
	margin: var(--wp--preset--spacing--40, 1.5rem) auto;
	color: var(--gp-ink);
}

.gp-race-top {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
	gap: 1rem;
	align-items: stretch;
}

@media (max-width: 860px) {
	.gp-race-top {
		grid-template-columns: minmax(0, 1fr);
	}
}

.gp-race-top .gp-stats {
	margin: 0;
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* No leader yet: the four tiles take the whole row instead of leaving half of it empty. */
.gp-race-top:not(:has(.gp-leader)) {
	grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 861px) {
	.gp-race-top:not(:has(.gp-leader)) .gp-stats {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.gp-race-stats .gp-stat-value {
	font-size: var(--wp--preset--font-size--large, 1.375rem);
	overflow-wrap: anywhere;
}

/* The leader: a "crown" card. */
.gp-leader {
	position: relative;
	padding: 1.1rem 1.25rem 1.25rem;
	border-radius: var(--gp-frame-radius);
	border: var(--gp-frame-border);
	background:
		radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--gp-crown, #E8C04A) 18%, transparent), transparent 60%),
		var(--gp-leader-bg, var(--gp-surface-2));
	box-shadow: var(--gp-frame-shadow);
	color: var(--gp-ink);
	overflow: hidden;
}

.gp-leader p {
	margin: 0;
}

.gp-leader-label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-family: var(--gp-head-font, inherit);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
	color: var(--gp-accent);
}

/* The crown, drawn with a clip path (no image), with a darker rim so it holds on light and dark cards. */
.gp-leader-label::before {
	content: "";
	flex: none;
	width: 1.6rem;
	height: 1.1rem;
	background: linear-gradient(180deg, var(--gp-crown-light, #F6DC8C), var(--gp-crown, #E8C04A) 55%, var(--gp-crown-dark, #A8800F));
	clip-path: polygon(0 100%, 4% 22%, 28% 58%, 50% 0, 72% 58%, 96% 22%, 100% 100%);
	filter: drop-shadow(0 1px 0 rgba(0, 0, 0, 0.35));
}

.gp-leader-name {
	margin-top: 0.35rem !important;
	font-family: var(--gp-head-font, inherit);
	color: var(--gp-title-ink);
	text-shadow: var(--gp-title-shadow);
	font-size: var(--wp--preset--font-size--x-large, 1.75rem);
	font-weight: 800;
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.gp-leader-name a {
	text-decoration: none;
}

.gp-leader-name a:hover,
.gp-leader-name a:focus-visible {
	text-decoration: underline;
}

.gp-leader-sub,
.gp-racer-sub {
	color: var(--gp-ink-muted);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

.gp-leader-meta {
	margin-top: 0.5rem !important;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

/* Progress bars: the fill and the track come from the game (an XP bar, a hitpoints bar, a life globe). */
.gp-progress {
	position: relative;
	height: 12px;
	margin-top: 0.75rem;
	border-radius: var(--gp-bar-radius, 999px);
	background: var(--gp-bar-track, var(--wp--preset--color--border, #E2E8F0));
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.18);
	overflow: hidden;
}

.gp-progress span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--gp-bar-overlay, linear-gradient(transparent, transparent)), var(--gp-bar, linear-gradient(90deg, var(--gp-accent), var(--wp--preset--color--accent, #059669)));
	box-shadow: 1px 0 0 rgba(0, 0, 0, 0.45);
	transition: width 600ms cubic-bezier(0.2, 0, 0, 1);
}

.gp-race-notes {
	margin: 1rem 0 0;
	padding: 0.75rem 1rem 0.75rem 2rem;
	border-radius: var(--gp-radius-inner);
	border: 1px dashed var(--gp-grid-line);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

.gp-race-notes li + li {
	margin-top: 0.35rem;
}

/* The filter toolbar */
.gp-race-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.75rem;
	margin: 1rem 0;
	padding: 0.75rem 0.9rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface);
}

.gp-filter {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

.gp-filter label {
	font-weight: 600;
	color: var(--gp-ink-muted);
}

.gp-filter--search {
	flex: 1 1 14rem;
}

.gp-filter input[type="search"],
.gp-filter select {
	min-height: 2.5rem;
	padding: 0.45rem 0.65rem;
	border: 1px solid var(--gp-grid-line);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-sunk);
	color: var(--gp-ink);
	font: inherit;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

.gp-filter input[type="search"]:focus-visible,
.gp-filter select:focus-visible {
	border-color: var(--gp-accent);
}

.gp-filter--check label {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 2.5rem;
	color: var(--gp-ink);
}

.gp-filter--check input {
	accent-color: var(--gp-accent);
	width: 1.05rem;
	height: 1.05rem;
}

.gp-filter--actions {
	flex-direction: row;
	align-items: center;
	gap: 0.75rem;
	margin-left: auto;
}

.gp-race--js .gp-filter-submit {
	display: none;
}

.gp-watch-link {
	font-weight: 700;
	white-space: nowrap;
}

.gp-table-wrap {
	overflow-x: auto;
	border: var(--gp-frame-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-sunk);
	box-shadow: var(--gp-frame-shadow);
}

.gp-table caption {
	padding: 0.6rem 0.75rem;
	text-align: left;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

.gp-table th[scope="row"] {
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	font-size: inherit;
	color: inherit;
}

.gp-racer-name,
.gp-racer-sub {
	display: block;
}

.gp-racer-name a {
	text-decoration: none;
}

.gp-racer-name a:hover,
.gp-racer-name a:focus-visible {
	text-decoration: underline;
}

.gp-race-table tbody tr[data-row]:hover {
	background: var(--gp-row-hover);
}

.gp-race-table tbody tr[data-rank="1"]:not([hidden]) {
	background: color-mix(in srgb, var(--gp-accent) 8%, transparent);
}

/* Rank medals for the top three: the rank stays as text, the disc only marks the podium. */
.gp-race-table tbody tr:is([data-rank="1"], [data-rank="2"], [data-rank="3"]) > td:first-child {
	text-align: center;
	font-weight: 800;
	color: #1A1306;
	/* Rows align to the top, so the disc sits on the number's line rather than the middle of a two-line row. */
	background: radial-gradient(circle closest-side at 50% 50%, var(--gp-medal) 0 calc(100% - 4px), var(--gp-medal-ring) calc(100% - 4px) calc(100% - 1.5px), transparent calc(100% - 1px)) 50% calc(0.5rem + 0.85em - 0.95rem) / 1.9rem 1.9rem no-repeat;
}

.gp-race-table tbody tr[data-rank="1"] {
	--gp-medal: #E8C04A;
	--gp-medal-ring: #A8800F;
}

.gp-race-table tbody tr[data-rank="2"] {
	--gp-medal: #CBD2DC;
	--gp-medal-ring: #7D8796;
}

.gp-race-table tbody tr[data-rank="3"] {
	--gp-medal: #D08A4E;
	--gp-medal-ring: #8E5427;
}

.gp-group-row th {
	background: var(--gp-surface);
	color: var(--gp-ink);
	font-family: var(--gp-head-font, inherit);
}

/* Badges: the word always carries the meaning; the mark in front only repeats it. */
.gp-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0.1rem 0.5rem;
	border-radius: var(--gp-badge-radius, 999px);
	font-size: 0.72rem;
	font-weight: 700;
	white-space: nowrap;
	background: var(--gp-surface-sunk);
	color: var(--gp-ink);
	border: 1px solid var(--gp-grid-line);
}

.gp-badge--live {
	background: var(--gp-live-bg, #047857);
	border-color: transparent;
	color: var(--gp-live-ink, #FFFFFF);
}

.gp-badge--live::before {
	content: "";
	width: 0.45rem;
	height: 0.45rem;
	border-radius: 999px;
	background: currentColor;
}

.gp-badge--dead {
	color: var(--gp-bad);
	border-color: color-mix(in srgb, var(--gp-bad) 40%, transparent);
}

/* Off the hiscores is a warning, not a death. */
.gp-badge--missing {
	color: var(--gp-warn);
	border-color: color-mix(in srgb, var(--gp-warn) 45%, transparent);
}

.gp-race-notes {
	border-left: 3px solid color-mix(in srgb, var(--gp-warn) 60%, transparent);
}

.gp-badge--finished,
.gp-badge--ranked,
.gp-badge--alive {
	color: var(--gp-good);
	border-color: color-mix(in srgb, var(--gp-good) 40%, transparent);
}

/* Fallback marks when the theme's drawn glyphs are not there: a heart and a cross. */
.gp-badge--alive::before {
	content: "\2665\FE0E";
	font-size: 0.85em;
}

.gp-badge--dead::before {
	content: "\271D\FE0E";
	font-size: 0.85em;
}

.gp-race-count {
	margin: 0.5rem 0 0;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

/* Race and stats charts ([gp_race_chart], .gp-stat-chart): a framed instrument. */

.gp-race-chart,
.gp-stat-chart {
	box-sizing: border-box;
	margin: var(--wp--preset--spacing--40, 1.5rem) auto;
	padding: 1rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-frame-radius);
	background: var(--gp-surface);
	box-shadow: var(--gp-frame-shadow);
	color: var(--gp-ink);
}

/* Range switch above a stats chart: a segmented control, one link per range; the current one is filled. */
.gp-stat-chart__ranges ul {
	display: inline-flex;
	flex-wrap: wrap;
	box-sizing: border-box;
	max-width: 100%;
	gap: 2px;
	margin: 0 0 .75rem;
	padding: 2px;
	list-style: none;
	border: var(--gp-btn-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-btn-bg);
}
.gp-stat-chart__ranges li { margin: 0; }
.gp-stat-chart__ranges a {
	display: inline-block;
	padding: .35rem .8rem;
	border-radius: max(0px, calc(var(--gp-radius-inner) - 2px));
	font-size: .8125rem;
	font-weight: 600;
	letter-spacing: .01em;
	text-decoration: none;
	color: var(--gp-btn-ink);
}
.gp-stat-chart__ranges a:hover,
.gp-stat-chart__ranges a:focus-visible { background: var(--gp-btn-hover-bg); }
.gp-stat-chart__ranges a[aria-current="true"],
.gp-stat-chart__ranges a[aria-current="true"][href] {
	background: var(--gp-accent);
	color: var(--gp-accent-ink);
}

.gp-stat-chart-canvas {
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-sunk);
	border: 1px solid var(--gp-grid-line);
	overflow: hidden;
}

.gp-race-chart canvas,
.gp-stat-chart canvas {
	display: block;
	width: 100%;
	height: 280px;
}

.gp-race-chart figcaption,
.gp-stat-chart figcaption {
	margin-top: 0.5rem;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

.gp-legend,
.gp-race-chart-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1rem;
	margin: 0.5rem 0 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

.gp-legend li {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.gp-legend-swatch {
	display: inline-block;
	width: 1.5rem;
	border-top: 3px solid currentColor;
}

/* Race overview cards ([gp_races]) */

.gp-race-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
	gap: 1rem;
	margin: var(--wp--preset--spacing--40, 1.5rem) auto;
}

.gp-race-card {
	position: relative;
	padding: 1.25rem;
	border-radius: var(--gp-frame-radius);
	border: var(--gp-frame-border);
	background: var(--gp-surface-2);
	box-shadow: var(--gp-frame-shadow);
	color: var(--gp-ink);
	overflow: hidden;
}

.gp-race-card h3 {
	margin: 0.25rem 0 0.5rem;
	font-family: var(--gp-head-font, inherit);
	font-size: var(--wp--preset--font-size--large, 1.375rem);
}

.gp-race-card h3 a {
	text-decoration: none;
	color: var(--gp-ink);
}

.gp-race-card h3 a:hover,
.gp-race-card h3 a:focus-visible {
	text-decoration: underline;
}

.gp-race-card-kind {
	margin: 0;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--gp-good);
}

.gp-race-card-leader {
	margin: 0 0 0.75rem;
}

.gp-race-card .gp-stats {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	margin: 0;
}

.gp-race-card .gp-stat-value {
	font-size: var(--wp--preset--font-size--large, 1.375rem);
}

/* Multi-stream ([gp_watch]) */

.gp-watch-tabs ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 1rem;
	padding: 0;
	list-style: none;
}

.gp-watch-tabs a {
	display: inline-block;
	padding: 0.4rem 0.9rem;
	border-radius: 999px;
	border: 1px solid var(--gp-grid-line);
	background: var(--gp-surface-sunk);
	text-decoration: none;
	font-weight: 600;
}

.gp-watch-tabs a:hover {
	border-color: var(--gp-accent);
}

.gp-watch-tabs a[aria-current="page"] {
	background: var(--gp-accent);
	border-color: transparent;
	color: var(--gp-accent-ink);
}

.gp-watch-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
	margin: 1rem auto;
}

.gp-watch-item {
	margin: 0;
}

/* The leader gets the full width when the count is odd. */
.gp-watch-grid--1 .gp-watch-item,
.gp-watch-grid--3 .gp-watch-item:first-child,
.gp-watch-grid--5 .gp-watch-item:first-child {
	grid-column: 1 / -1;
}

@media (max-width: 760px) {
	.gp-watch-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

.gp-watch-frame {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--gp-radius-inner);
	overflow: hidden;
	background: var(--wp--preset--color--night, #0B0F1A);
	border: var(--gp-frame-border);
	box-shadow: var(--gp-panel-shadow, 0 12px 32px -16px rgba(15, 23, 42, 0.35));
}

.gp-watch-frame iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* A Twitch player waiting to be asked for (nothing loads from Twitch before the click). */
.gp-watch-frame.is-idle {
	display: grid;
	place-items: center;
	background:
		radial-gradient(120% 90% at 50% 0%, rgba(145, 70, 255, 0.35), transparent 60%),
		var(--wp--preset--color--night, #0B0F1A);
}

.gp-watch-load {
	display: grid;
	justify-items: center;
	gap: 0.4rem;
	padding: 1rem;
	color: #F4F0FF;
	text-align: center;
	text-decoration: none;
}

.gp-watch-load__play {
	width: 3.25rem;
	height: 3.25rem;
	border-radius: 50%;
	background: #9146FF;
	box-shadow: 0 6px 18px -6px rgba(145, 70, 255, 0.8);
	position: relative;
}

.gp-watch-load__play::after {
	content: "";
	position: absolute;
	left: 54%;
	top: 50%;
	transform: translate(-50%, -50%);
	border-style: solid;
	border-width: 0.6rem 0 0.6rem 1rem;
	border-color: transparent transparent transparent #FFFFFF;
}

.gp-watch-load__label {
	font-weight: 700;
}

.gp-watch-load__note {
	font-size: 0.8rem;
	opacity: 0.8;
}

.gp-watch-load:hover .gp-watch-load__play,
.gp-watch-load:focus-visible .gp-watch-load__play {
	background: #A970FF;
}

.gp-watch-load:focus-visible {
	outline: 3px solid #A970FF;
	outline-offset: 2px;
	border-radius: 8px;
}

.gp-watch-item figcaption {
	margin-top: 0.35rem;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

/* Register form ([gp_register]) and the death report form (.gp-death-form) */

.gp-register fieldset,
.gp-death-form fieldset {
	margin: 0;
	padding: 1rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-radius-inner);
}

.gp-register legend,
.gp-death-form legend {
	padding: 0 0.4rem;
	font-weight: 700;
	font-family: var(--gp-head-font, inherit);
}

.gp-register-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 0.9rem;
}

.gp-register select,
.gp-death-form select {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.8rem;
	border: 1px solid var(--gp-grid-line);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-sunk);
	color: var(--gp-ink);
	font: inherit;
}

.gp-death-form {
	display: grid;
	gap: 1rem;
	padding: var(--wp--preset--spacing--40, 1.5rem);
	border: var(--gp-frame-border);
	border-radius: var(--gp-frame-radius);
	background: var(--gp-surface);
	box-shadow: var(--gp-frame-shadow);
	color: var(--gp-ink);
}

.gp-death-form label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

.gp-death-form input:not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="hidden"]),
.gp-death-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 0.7rem 0.8rem;
	border: 1px solid var(--gp-grid-line);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-sunk);
	color: var(--gp-ink);
	font: inherit;
}

.gp-death-form textarea {
	min-height: 7rem;
	resize: vertical;
}

.gp-death-form :is(input, select, textarea):focus-visible {
	border-color: var(--gp-accent);
}

.gp-death-form button,
.gp-death-form [type="submit"] {
	justify-self: start;
	cursor: pointer;
}

.gp-death-form .gp-hint,
.gp-death-form small {
	color: var(--gp-ink-muted);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
}

/*
 * Maps (.gp-map): a figure holding the toolbar, notes, the viewport with the SVG (which keeps its own viewBox
 * proportions at full width), the tooltip, the legend and the table. The figure is a panel; the viewport is the map.
 */

.gp-map {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	margin: var(--wp--preset--spacing--40, 1.5rem) auto;
	padding: 0.75rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-frame-radius);
	background: var(--gp-surface);
	box-shadow: var(--gp-frame-shadow);
	color: var(--gp-ink);
}

.gp-map__viewport {
	border: 1px solid var(--gp-grid-line);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-map-bg, var(--wp--preset--color--surface, #FFFFFF));
}

.gp-map__svg {
	display: block;
	width: 100%;
	height: auto;
}

.gp-map > .gp-note {
	margin: 0 0 0.5rem;
}

.gp-map__toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
	margin: 0 0 0.5rem;
}

.gp-map__toolbar[hidden] {
	display: none;
}

.gp-map__button {
	min-width: 2.25rem;
	min-height: 2.25rem;
	padding: 0 0.5rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-sunk);
	color: var(--gp-ink);
	font: inherit;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.gp-map__button:hover {
	border-color: var(--gp-accent);
	color: var(--gp-accent);
}

.gp-map .gp-table-wrap {
	margin-top: 0.75rem;
}

/*
 * Markers: the plugin sets the radius (r, and --size: the radius in viewBox units) and --tone, the marker's share
 * of the largest (0 to 1). The game tint fills them; a bigger share is more opaque, so the size and the opacity
 * say the same thing and colour is never the only cue.
 */
.gp-map__marker {
	fill: var(--gp-accent-2);
	fill-opacity: calc(0.4 + 0.55 * var(--tone, 1));
	stroke: var(--wp--preset--color--surface, #FFFFFF);
	stroke-width: 1.5px;
	cursor: pointer;
	transition: fill-opacity 150ms ease, stroke-width 150ms ease;
}

/* The same hook on an HTML element placed over the map. */
:is(span, div, button, li).gp-map__marker {
	position: absolute;
	width: calc(2px * var(--size, 6));
	height: calc(2px * var(--size, 6));
	border-radius: 999px;
	background: var(--gp-accent-2);
	border: 1.5px solid var(--wp--preset--color--surface, #FFFFFF);
	transform: translate(-50%, -50%);
	opacity: calc(0.45 + 0.5 * var(--tone, 1));
}

.gp-map__marker:hover,
.gp-map__marker:focus,
.gp-map__marker.is-active {
	fill-opacity: 1;
	opacity: 1;
	stroke: var(--gp-ink);
	stroke-width: 2.5px;
	outline: none;
}

.gp-map__marker:focus-visible {
	stroke: var(--gp-accent);
	stroke-width: 3px;
	outline: 3px solid var(--gp-accent);
	outline-offset: 2px;
}

/* The legend (a figcaption): lines of text, then the heat scale as one row of steps. */
.gp-map__legend {
	margin: 0.5rem 0 0;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

.gp-map__legend p {
	margin: 0.2rem 0;
}

.gp-map__legend ul,
.gp-map__scale {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 1rem;
	margin: 0.5rem 0;
	padding: 0;
	list-style: none;
}

.gp-map__legend li {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.gp-map__scale-title {
	font-weight: 700;
	color: var(--gp-ink);
}

.gp-map__legend :is(.gp-swatch, [class*="__swatch"]) {
	display: inline-block;
	width: 0.95rem;
	height: 0.95rem;
	border-radius: var(--gp-badge-radius, 3px);
	background: var(--gp-tone, currentColor);
	border: 1px solid color-mix(in srgb, var(--gp-ink) 30%, transparent);
}

/* A swatch on the heat scale shows the same step as the map's shapes (its inline colour is only the fallback). */
.gp-map__legend .gp-heat-0[class*="__swatch"],
.gp-map__legend .gp-heat-1[class*="__swatch"],
.gp-map__legend .gp-heat-2[class*="__swatch"],
.gp-map__legend .gp-heat-3[class*="__swatch"],
.gp-map__legend .gp-heat-4[class*="__swatch"],
.gp-map__legend .gp-heat-5[class*="__swatch"] {
	background: var(--gp-heat) !important;
}

.gp-map__tooltip {
	position: absolute;
	z-index: 5;
	box-sizing: border-box;
	max-width: 220px;
	padding: 0.45rem 0.65rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-ink);
	color: var(--wp--preset--color--surface, #FFFFFF);
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	font-weight: 600;
	line-height: 1.4;
	box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.5);
	pointer-events: none;
}

.gp-map__tooltip[hidden] {
	display: none;
}

.gp-map__tooltip strong {
	display: block;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

/* Heat scale for zones and worlds: SVG shapes take the fill, HTML cells the background and a readable ink. */
.gp-heat-0,
.gp-heat-1,
.gp-heat-2,
.gp-heat-3,
.gp-heat-4,
.gp-heat-5 {
	fill: var(--gp-heat);
	background-color: var(--gp-heat);
	color: var(--gp-heat-ink);
}

.gp-heat-0 { --gp-heat: var(--heat-0, light-dark(#FEF3C7, #1F2937)); --gp-heat-ink: var(--heat-ink-0, light-dark(#0F172A, #E2E8F0)); }
.gp-heat-1 { --gp-heat: var(--heat-1, light-dark(#FDE68A, #3B2A08)); --gp-heat-ink: var(--heat-ink-1, light-dark(#0F172A, #FDE68A)); }
.gp-heat-2 { --gp-heat: var(--heat-2, light-dark(#FCD34D, #78350F)); --gp-heat-ink: var(--heat-ink-2, light-dark(#0F172A, #FEF3C7)); }
.gp-heat-3 { --gp-heat: var(--heat-3, light-dark(#F59E0B, #B45309)); --gp-heat-ink: var(--heat-ink-3, light-dark(#0F172A, #FFFFFF)); }
.gp-heat-4 { --gp-heat: var(--heat-4, light-dark(#B45309, #F59E0B)); --gp-heat-ink: var(--heat-ink-4, light-dark(#FFFFFF, #0B0F1A)); }
.gp-heat-5 { --gp-heat: var(--heat-5, light-dark(#78350F, #FCD34D)); --gp-heat-ink: var(--heat-ink-5, light-dark(#FFFFFF, #0B0F1A)); }

/* Class leaders (.gp-class-leaders): one card per class, the class colour as an edge and a glyph disc. */
.gp-class-leaders {
	margin: var(--wp--preset--spacing--40, 1.5rem) auto;
}

.gp-class-leaders__list,
ul.gp-class-leaders {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
	gap: 0.75rem;
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
}

.gp-class-leader--unclaimed {
	opacity: 0.72;
}

/* The glyph takes the first column on every row; the text lines stack in the second. */
.gp-class-leader > :not(svg) {
	grid-column: 2;
}

.gp-class-leader > svg {
	grid-row: 1 / span 3;
	align-self: start;
}

.gp-class-leader__class {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-weight: 700;
}

.gp-class-leader {
	position: relative;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: 0.25rem 0.75rem;
	padding: 0.8rem 0.9rem 0.8rem 1.1rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-2);
	box-shadow: var(--gp-frame-shadow);
	color: var(--gp-ink);
	overflow: hidden;
}

.gp-class-leader::before {
	content: "";
	position: absolute;
	inset: 0 auto 0 0;
	width: 5px;
	background: var(--class, var(--gp-tone, #D97706));
}

.gp-class-leader > svg,
.gp-class-leader .gp-glyph,
.gp-class-leader .gp-class-glyph {
	grid-row: span 3;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0.45rem;
	box-sizing: border-box;
	border-radius: var(--gp-badge-radius, 999px);
	background: #0A1024;
	color: var(--class, var(--gp-tone, #E8C04A));
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--class, #E8C04A) 55%, transparent);
}

.gp-class-leader :is(h3, h4, .gp-class-leader-name, .gp-class-leader__name) {
	margin: 0;
	font-family: var(--gp-head-font, inherit);
	font-size: var(--wp--preset--font-size--medium, 1.0625rem);
	font-weight: 800;
	line-height: 1.2;
	overflow-wrap: anywhere;
}

.gp-class-leader :is(p, small, .gp-class-leader-meta):not(.gp-class-leader__name) {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-small, 0.8125rem);
	color: var(--gp-ink-muted);
}

/* Inline skill glyph with its value (.gp-skill) and a world number with its country (.gp-world-pill). */
.gp-class-glyph {
	display: inline-block;
	flex: none;
	width: 1.25em;
	height: 1.25em;
	vertical-align: -0.22em;
}

.gp-skill {
	display: inline-flex;
	align-items: center;
	gap: 0.3em;
	font-variant-numeric: tabular-nums;
	font-weight: 700;
	white-space: nowrap;
}

.gp-skill svg {
	flex: none;
	width: 1.2em;
	height: 1.2em;
	color: var(--gp-accent);
}

.gp-world-pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
	padding: 0.1em 0.55em;
	border: var(--gp-frame-border);
	border-radius: var(--gp-badge-radius, 999px);
	background: var(--gp-surface);
	font-family: var(--wp--preset--font-family--mono, ui-monospace, monospace);
	font-size: 0.8em;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	color: var(--gp-ink);
}

.gp-world-pill :is(abbr, small, .gp-world-pill__cc) {
	padding-left: 0.4em;
	border-left: 1px solid var(--gp-grid-line);
	font-size: 0.85em;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--gp-ink-muted);
}

@media (prefers-reduced-motion: reduce) {
	.gp-progress span,
	.gp-map__marker {
		transition: none;
	}
}

@media (forced-colors: active) {
	.gp-progress span {
		background: Highlight;
	}

	.gp-race-table tbody tr:is([data-rank="1"], [data-rank="2"], [data-rank="3"]) > td:first-child {
		outline: 2px solid CanvasText;
		outline-offset: -6px;
	}

	.gp-leader-label::before,
	.gp-stat::before,
	.gp-class-leader::before {
		background: CanvasText;
	}
}

/* ---- Game Pulse 2.0: nameplates, overviews, section lists, rarity colours ---------------------------------
 * A nameplate (gamepulse_nameplate()) follows its game's convention; the theme sets the per-game tokens
 * (--gp-plate-bg, --gp-plate-border, --gp-plate-ink, --gp-plate-bar, --gp-plate-track) and the class colours. */

.gp-plate {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	max-width: 100%;
	min-width: 12rem;
	padding: 0.3rem 0.55rem 0.35rem 0.35rem;
	color: var(--gp-plate-ink, var(--gp-ink));
	background: var(--gp-plate-bg, var(--wp--preset--color--surface-alt, #F8FAFC));
	border: 1px solid var(--gp-plate-border, var(--wp--preset--color--border, #E2E8F0));
	border-radius: var(--gp-radius-inner);
	vertical-align: middle;
	text-align: left;
	color-scheme: dark;
}

.gp-plate__icon {
	flex: none;
	display: inline-grid;
	place-items: center;
}

.gp-plate__icon img {
	display: block;
	border-radius: var(--gp-icon-radius, 4px);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
}

.gp-plate__initial {
	display: inline-grid;
	place-items: center;
	width: 36px;
	height: 36px;
	font-weight: 700;
	color: #0B0A0C;
	background: var(--class, #C8B88A);
}

.gp-plate__body {
	display: grid;
	gap: 0.1rem;
	min-width: 0;
	flex: 1;
}

.gp-plate__name {
	font-weight: 700;
	line-height: 1.2;
	color: var(--class, inherit);
	overflow-wrap: anywhere;
}

.gp-plate__name a {
	color: inherit;
	text-decoration: none;
}

.gp-plate__name a:hover,
.gp-plate__name a:focus-visible {
	text-decoration: underline;
}

.gp-plate__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.78rem;
	line-height: 1.3;
	opacity: 0.92;
}

.gp-plate__badge {
	border-radius: 50%;
}

.gp-plate__sub {
	font-size: 0.72rem;
	opacity: 0.75;
}

.gp-plate__bar {
	position: relative;
	display: block;
	height: 7px;
	margin-top: 0.15rem;
	background: var(--gp-plate-track, rgba(127, 127, 127, 0.25));
	border: 1px solid rgba(0, 0, 0, 0.65);
	overflow: hidden;
}

.gp-plate__fill {
	display: block;
	height: 100%;
	background: var(--gp-plate-bar, var(--gp-accent));
}

/* WoW: the experience bar's segments; OSRS: crisp edges and the chat-yellow name with its shadow;
 * Path of Exile: small capitals and a darker frame. */
.gp-plate--wow .gp-plate__bar {
	border-radius: 2px;
}

.gp-plate--wow .gp-plate__bar::after {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(90deg, transparent 0 calc(5% - 1px), rgba(0, 0, 0, 0.55) calc(5% - 1px) 5%);
}

.gp-plate--osrs {
	border-width: 2px;
	border-radius: 0;
	box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.12), inset -1px -1px 0 rgba(0, 0, 0, 0.4);
	font-family: var(--pulse-font-chunky, Verdana, sans-serif);
}

.gp-plate--osrs .gp-plate__name {
	color: var(--gp-plate-ink, #FFFF00);
	text-shadow: 1px 1px 0 #000000;
}

.gp-plate--osrs .gp-plate__meta {
	color: #FF981F;
	text-shadow: 1px 1px 0 #000000;
}

.gp-plate--poe {
	border-radius: 0;
}

.gp-plate--poe .gp-plate__name {
	font-variant: small-caps;
	letter-spacing: 0.02em;
	color: #E5D3A1;
}

.gp-plate--poe .gp-plate__icon img {
	border-radius: 0;
	box-shadow: 0 0 0 1px #000000, 0 0 0 2px var(--class, #6E5714);
}

.gp-plate.is-dead {
	filter: grayscale(0.85);
	opacity: 0.8;
}

.gp-plate.is-dead .gp-plate__name {
	text-decoration: line-through;
	text-decoration-thickness: 1px;
}

.gp-racer .gp-plate {
	min-width: 14rem;
}

.gp-leader-name .gp-plate {
	font-size: 1.05rem;
}

/* Path of Exile item rarity colours, for item and character names that carry them. */
.gp-rarity--normal { color: #C8C8C8; }
.gp-rarity--magic { color: #8888FF; }
.gp-rarity--rare { color: #FFFF77; }
.gp-rarity--unique { color: #AF6025; }

/* A game's overview: the leader, the tiles and the next places. */
.gp-overview {
	display: grid;
	gap: 1rem;
}

.gp-overview__list {
	display: grid;
	gap: 0.45rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 700px) {
	.gp-overview__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.gp-overview__list li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.gp-overview__rank {
	flex: none;
	width: 1.6rem;
	font-weight: 700;
	text-align: right;
	color: var(--gp-accent-2);
}

.gp-overview__list .gp-plate {
	flex: 1;
	min-width: 0;
}

.gp-overview__more {
	margin: 0;
	font-weight: 600;
}

/* A section's guides and updates. */
.gp-post-list {
	display: grid;
	gap: 0.9rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-post-item {
	display: grid;
	gap: 0.15rem;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--gp-grid-line);
}

.gp-post-item:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.gp-post-item > a {
	font-weight: 700;
	font-size: 1.05rem;
}

.gp-post-item time {
	font-size: 0.8rem;
	color: var(--gp-ink-muted);
}

.gp-post-item p {
	margin: 0;
}

/* The WoW map: Blizzard's continent maps under the zone hit areas. */
.gp-map--wow-progress .gp-map__svg,
.gp-map--wow-deaths .gp-map__svg {
	max-height: 82vh;
	background: #2B2416;
}

.gp-map__base {
	pointer-events: none;
}

.gp-map__stage .gp-map__region.gp-heat-0 {
	fill: transparent;
}

.gp-map__stage .gp-map__region:is(:hover, :focus-visible, [aria-pressed="true"]) {
	stroke: #FFFFFF;
	stroke-opacity: 1;
	stroke-width: 1.6;
}

.gp-map__stage .gp-map__label--zone {
	pointer-events: none;
}
/* A class leader's card already shows its class picture: the plate inside fits the card, without a second icon. */
.gp-class-leader .gp-plate {
	display: flex;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}

.gp-class-leader .gp-plate__icon {
	display: none;
}

/* ---- r12 shared components: buttons, the filter bar, sortable boards, previews, KPI strips, on this page ---------
 * Markup and data attributes: includes/README-modules.md. Everything below reads only the look-contract tokens. */

/* Buttons (a plain <button class="gp-btn"> or <a class="gp-btn">). */
.gp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-height: 2.25rem;
	box-sizing: border-box;
	padding: 0.35rem 0.9rem;
	border: var(--gp-btn-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-btn-bg);
	color: var(--gp-btn-ink);
	font: inherit;
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
	font-weight: 650;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
}

.gp-btn:hover,
.gp-btn:focus-visible {
	background: var(--gp-btn-hover-bg);
}

.gp-btn--primary {
	background: var(--gp-accent);
	color: var(--gp-accent-ink);
	border-color: transparent;
}

/* The filter bar (.gp-filters): segmented controls, icon chips, a search box and a sort select. */
.gp-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.6rem 1rem;
	margin: 0.75rem 0;
	padding: 0.65rem 0.8rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface);
	color: var(--gp-ink);
	font-size: var(--wp--preset--font-size--small, 0.9375rem);
}

.gp-grid > .gp-panel .gp-filters {
	background: var(--gp-surface-2);
}

.gp-filters fieldset {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.gp-filters legend,
.gp-filters__label {
	display: block;
	margin: 0 0 0.25rem;
	padding: 0;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gp-ink-muted);
}

.gp-search {
	display: flex;
	flex: 1 1 13rem;
	flex-direction: column;
	min-width: 0;
}

.gp-search input,
.gp-sort select,
.gp-filters select {
	box-sizing: border-box;
	width: 100%;
	min-height: 2.25rem;
	padding: 0.35rem 0.65rem;
	border: var(--gp-btn-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-sunk);
	color: var(--gp-ink);
	font: inherit;
	color-scheme: inherit;
}

.gp-search input {
	padding-left: 2rem;
	background-image: linear-gradient(transparent, transparent);
}

.gp-search {
	position: relative;
}

/* The magnifier, drawn: a ring and a handle. */
.gp-search::after {
	content: "";
	position: absolute;
	left: 0.7rem;
	bottom: 0.72rem;
	width: 0.6rem;
	height: 0.6rem;
	border: 2px solid var(--gp-ink-muted);
	border-radius: 50%;
	box-shadow: 4px 4px 0 -2.5px var(--gp-ink-muted);
	pointer-events: none;
}

.gp-sort,
.gp-filters__select {
	display: flex;
	flex: 0 1 12rem;
	flex-direction: column;
	min-width: 0;
}

.gp-search input:focus-visible,
.gp-filters select:focus-visible {
	outline: 2px solid var(--gp-accent);
	outline-offset: 1px;
}

/* Segmented control: radio inputs in labels; the checked one is filled. */
.gp-seg__options,
.gp-chips__options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem;
}

.gp-seg__options {
	gap: 2px;
	padding: 2px;
	border: var(--gp-btn-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-btn-bg);
}

.gp-seg label,
.gp-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	min-height: 2rem;
	box-sizing: border-box;
	padding: 0.2rem 0.7rem;
	border-radius: max(0px, calc(var(--gp-radius-inner) - 2px));
	color: var(--gp-btn-ink);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
}

.gp-chip {
	border: var(--gp-btn-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-btn-bg);
}

.gp-seg label:hover,
.gp-chip:hover {
	background: var(--gp-btn-hover-bg);
}

/* The input stays in the accessibility tree and keyboard order; the label is what shows. */
.gp-seg input,
.gp-chip input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.gp-seg label:has(input:checked),
.gp-chip:has(input:checked),
.gp-chip[aria-pressed="true"],
.gp-chip.is-on {
	background: var(--gp-accent);
	color: var(--gp-accent-ink);
	border-color: transparent;
}

.gp-seg label:has(input:focus-visible),
.gp-chip:has(input:focus-visible),
.gp-chip:focus-visible {
	outline: 2px solid var(--gp-accent);
	outline-offset: 2px;
}

.gp-chip img,
.gp-chip svg {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	object-fit: contain;
}

.gp-chip small {
	font-size: 0.72rem;
	opacity: 0.8;
}

/* The "Apply" button: there for a visitor without JavaScript; hidden once the filters apply at once. */
.gp-filters__go {
	align-self: flex-end;
}

.gp-filters.is-live .gp-filters__go {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.gp-filters__count {
	flex-basis: 100%;
	margin: 0;
	font-size: 0.8rem;
	color: var(--gp-ink-muted);
}

.gp-filters__reset {
	align-self: flex-end;
	padding: 0.3rem 0.2rem;
	border: 0;
	background: none;
	color: var(--gp-accent);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 650;
	text-decoration: underline;
	cursor: pointer;
}

.gp-filters__reset[hidden] {
	display: none;
}

[data-gp-empty][hidden] {
	display: none;
}

[data-gp-empty] {
	margin: 0.75rem 0;
	padding: 0.75rem 1rem;
	border: 1px dashed var(--gp-grid-line);
	border-radius: var(--gp-radius-inner);
	color: var(--gp-ink-muted);
}

/* Boards: sticky head inside a scroll box, click-to-sort columns, rank movement, gap to the leader. */
.gp-table-wrap.gp-board {
	max-height: min(78vh, 60rem);
	overflow: auto;
	overscroll-behavior: contain;
}

.gp-board thead th {
	position: sticky;
	top: 0;
	z-index: 2;
}

th[data-sort] {
	padding: 0;
}

.gp-sort-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	width: 100%;
	box-sizing: border-box;
	padding: 0.5rem 0.6rem;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-align: inherit;
	cursor: pointer;
}

th.gp-num .gp-sort-btn {
	justify-content: flex-end;
}

.gp-sort-btn::after {
	content: "";
	flex: none;
	width: 0.5rem;
	height: 0.5rem;
	opacity: 0.35;
	background: currentColor;
	clip-path: polygon(50% 0, 100% 40%, 0 40%, 0 60%, 100% 60%, 50% 100%);
}

th[aria-sort="ascending"] .gp-sort-btn::after {
	opacity: 1;
	clip-path: polygon(50% 10%, 100% 75%, 0 75%);
}

th[aria-sort="descending"] .gp-sort-btn::after {
	opacity: 1;
	clip-path: polygon(0 25%, 100% 25%, 50% 90%);
}

.gp-sort-btn:focus-visible {
	outline: 2px solid var(--gp-accent);
	outline-offset: -2px;
}

/* Rank movement since the stored reading about six hours ago: an arrow and the places. */
.gp-move {
	display: block;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.1;
	white-space: nowrap;
}

.gp-move--up {
	color: var(--gp-good);
}

.gp-move--down {
	color: var(--gp-bad);
}

.gp-move--same {
	color: var(--gp-ink-muted);
	font-weight: 500;
}

.gp-move--up::before {
	content: "\25B2\FE0E";
	margin-right: 0.1rem;
	font-size: 0.85em;
}

.gp-move--down::before {
	content: "\25BC\FE0E";
	margin-right: 0.1rem;
	font-size: 0.85em;
}

.gp-gap {
	color: var(--gp-ink-muted);
}

/* Movers: who gained the most in the last six hours. */
.gp-movers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem 0.6rem;
	margin: 0.75rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.85rem;
}

.gp-movers__title {
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gp-ink-muted);
}

.gp-movers__item {
	display: inline-flex;
	align-items: baseline;
	gap: 0.35rem;
	padding: 0.2rem 0.6rem;
	border: var(--gp-btn-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-2);
}

.gp-movers__item strong {
	color: var(--gp-ink-strong);
}

.gp-movers__gain {
	font-family: var(--gp-num-font);
	font-variant-numeric: tabular-nums;
	color: var(--gp-good);
	font-weight: 700;
}

/* Below 640 px a board's rows become cards: the name on top, every other cell as "label value". */
@media (max-width: 640px) {
	.gp-table-wrap.gp-board {
		max-height: none;
		overflow: visible;
		border: 0;
		background: none;
		box-shadow: none;
	}

	.gp-board .gp-table,
	.gp-board .gp-table tbody {
		display: block;
	}

	.gp-board .gp-table thead {
		display: none;
	}

	.gp-board .gp-table caption {
		display: block;
		padding: 0 0 0.5rem;
	}

	.gp-board .gp-table tr[data-row],
	.gp-board .gp-table tr[data-gp-item] {
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		gap: 0.15rem 0.75rem;
		margin: 0 0 0.6rem;
		padding: 0.6rem 0.75rem;
		border: var(--gp-frame-border);
		border-radius: var(--gp-radius-inner);
		background: var(--gp-surface-2);
		box-shadow: var(--gp-frame-shadow);
	}

	.gp-board .gp-table tr[hidden] {
		display: none;
	}

	.gp-board .gp-table tr > * {
		display: flex;
		grid-column: 1 / -1;
		justify-content: space-between;
		gap: 0.75rem;
		padding: 0.1rem 0;
		border: 0;
		text-align: right;
	}

	.gp-board .gp-table tr > td:first-child {
		grid-column: 1;
		grid-row: 1;
		display: block;
		align-self: start;
		min-width: 1.9rem;
		text-align: center;
	}

	.gp-board .gp-table tr > th[scope="row"] {
		grid-column: 2;
		grid-row: 1;
		display: block;
		text-align: left;
	}

	/* Long text (a source, a status line) reads left-aligned under its label. */
	.gp-board .gp-table tr > td:not(.gp-num) {
		flex-direction: column;
		gap: 0.1rem;
		text-align: left;
	}

	.gp-board .gp-table td[data-label]::before {
		content: attr(data-label);
		flex: none;
		font-size: 0.72rem;
		font-weight: 700;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		text-align: left;
		color: var(--gp-ink-muted);
	}

	.gp-board .gp-table .gp-group-row {
		display: block;
		margin: 0.75rem 0 0.4rem;
	}

	.gp-board .gp-plate {
		min-width: 0;
		width: 100%;
		box-sizing: border-box;
	}
}

/* Preview popover (.gp-pop): one per page, filled from a <template> or a stored-data REST answer. */
.gp-pop {
	position: absolute;
	z-index: 90;
	box-sizing: border-box;
	width: max-content;
	max-width: min(22rem, calc(100vw - 1rem));
	padding: 0.75rem 0.85rem;
	border: var(--gp-pop-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-pop-bg);
	box-shadow: var(--gp-pop-shadow);
	color: var(--gp-ink);
	font-size: 0.875rem;
	line-height: 1.45;
	text-align: left;
}

.gp-pop[hidden] {
	display: none;
}

.gp-pop::before {
	content: "";
	position: absolute;
	left: var(--gp-pop-arrow, 1.25rem);
	width: 0.7rem;
	height: 0.7rem;
	background: inherit;
	border: inherit;
	transform: translateX(-50%) rotate(45deg);
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.gp-pop[data-side="below"]::before {
	top: -0.4rem;
}

.gp-pop[data-side="above"]::before {
	bottom: -0.4rem;
	transform: translateX(-50%) rotate(225deg);
}

.gp-pop__loading {
	margin: 0;
	color: var(--gp-ink-muted);
}

[data-gp-preview],
[data-gp-preview-rest] {
	cursor: help;
}

a[data-gp-preview],
a[data-gp-preview-rest],
[data-gp-preview] a,
[data-gp-preview-rest] a {
	cursor: pointer;
}

[data-gp-preview]:focus-visible,
[data-gp-preview-rest]:focus-visible {
	outline: 2px solid var(--gp-accent);
	outline-offset: 2px;
}

/* A character preview card (gamepulse_preview_card_html()). */
.gp-pv {
	display: grid;
	gap: 0.4rem;
	min-width: 15rem;
}

.gp-pv__head {
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.gp-pv__head img {
	flex: none;
	border-radius: var(--gp-icon-radius, 4px);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55);
}

.gp-pv__name {
	display: block;
	font-family: var(--gp-head-font, inherit);
	font-size: 1.05rem;
	font-weight: 800;
	line-height: 1.2;
	color: var(--gp-title-ink);
	text-shadow: var(--gp-title-shadow);
}

/* The class colour marks the picture (as text it would not hold on every popover background: a white Priest). */
.gp-pv__head img {
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.55), 0 0 0 3px var(--class, transparent);
}

.gp-pv__line {
	display: block;
	font-size: 0.8rem;
	color: var(--gp-ink-muted);
}

.gp-pv__facts {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: 0.15rem 0.75rem;
	margin: 0;
	font-size: 0.82rem;
}

.gp-pv__facts dt {
	color: var(--gp-ink-muted);
}

.gp-pv__facts dd {
	margin: 0;
	font-family: var(--gp-num-font);
	font-variant-numeric: tabular-nums;
}

.gp-pv__bar {
	position: relative;
	display: block;
	height: 6px;
	border-radius: var(--gp-bar-radius, 999px);
	background: var(--gp-bar-track, var(--gp-grid-line));
	overflow: hidden;
}

.gp-pv__bar > span {
	display: block;
	height: 100%;
	background: var(--gp-bar, var(--gp-accent));
}

.gp-pv__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 0.8rem;
	margin: 0.1rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.82rem;
	font-weight: 650;
}

.gp-pv__links a {
	color: var(--gp-accent);
}

/* KPI strip (.gp-kpis): big numbers with a label, the change on 24 hours ago and a sparkline. */
.gp-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 8.75rem), 1fr));
	gap: 0.6rem;
	margin: 0 0 0.9rem;
	padding: 0;
	list-style: none;
}

.gp-kpi {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
	margin: 0;
	padding: 0.7rem 0.85rem 0.6rem;
	border: var(--gp-frame-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-surface-2);
	box-shadow: var(--gp-frame-shadow);
	color: var(--gp-ink);
	overflow: hidden;
}

.gp-kpi__label {
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--gp-ink-muted);
}

.gp-kpi__value {
	font-family: var(--gp-num-font);
	font-size: clamp(1.35rem, 2.6vw, 1.8rem);
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	line-height: 1.1;
	color: var(--gp-ink-strong);
	overflow-wrap: anywhere;
}

.gp-kpi__value a {
	color: inherit;
	text-decoration: none;
}

.gp-kpi__value a:hover,
.gp-kpi__value a:focus-visible {
	text-decoration: underline;
}

.gp-kpi__delta {
	font-size: 0.75rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	color: var(--gp-ink-muted);
}

.gp-kpi__delta--up {
	color: var(--gp-good);
}

.gp-kpi__delta--down {
	color: var(--gp-bad);
}

.gp-kpi__note {
	font-size: 0.72rem;
	line-height: 1.35;
	color: var(--gp-ink-muted);
}

.gp-kpi__spark {
	display: block;
	width: 100%;
	height: 1.75rem;
	margin-top: auto;
	padding-top: 0.3rem;
	overflow: visible;
}

.gp-kpi__spark-line {
	fill: none;
	stroke: var(--gp-accent);
	stroke-width: 1.75;
	stroke-linejoin: round;
	stroke-linecap: round;
	vector-effect: non-scaling-stroke;
}

.gp-kpi__spark-area {
	fill: color-mix(in srgb, var(--gp-accent) 14%, transparent);
	stroke: none;
}

.gp-kpi__spark-dot {
	fill: var(--gp-accent);
}

/* On this page (.gp-toc): the panels of a long page as anchors; one scrolling line on phones. */
.gp-toc {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.75rem;
	margin: 0 0 var(--gp-section-gap, 1.25rem);
	font-size: 0.85rem;
}

.gp-toc__title {
	flex: none;
	margin: 0;
	white-space: nowrap;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gp-ink-muted);
}

.gp-toc ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-toc a {
	display: inline-block;
	padding: 0.2rem 0.65rem;
	border: var(--gp-btn-border);
	border-radius: var(--gp-radius-inner);
	background: var(--gp-btn-bg);
	color: var(--gp-btn-ink);
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.gp-toc a:hover,
.gp-toc a:focus-visible,
.gp-toc a[aria-current="true"] {
	background: var(--gp-btn-hover-bg);
}

@media (max-width: 640px) {
	.gp-toc {
		flex-wrap: nowrap;
	}

	.gp-toc ol {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-mask: linear-gradient(90deg, #000 85%, transparent);
		mask: linear-gradient(90deg, #000 85%, transparent);
	}
}

/* Panels a TOC links to leave room for the sticky header and tabs. */
.gp-panel[id],
.gp-board,
[data-gp-filters] {
	scroll-margin-top: calc(var(--gp-sticky-top, 4rem) + 3.5rem);
}

@media (prefers-reduced-motion: reduce) {
	.gp-pop {
		transition: none;
	}
}

@media (forced-colors: active) {
	.gp-seg label:has(input:checked),
	.gp-chip:has(input:checked),
	.gp-chip[aria-pressed="true"] {
		outline: 2px solid Highlight;
	}

	.gp-kpi__spark-line {
		stroke: CanvasText;
	}
}

/* Deaths lists ([gp_deaths]): one line per death, its parts spaced; inside a panel the panel names the list. */
.gp-grid > .gp-panel .gp-deaths__title {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.gp-deaths__list {
	margin: 0;
	padding-left: 2.2rem;
}

.gp-death {
	padding: 0.3rem 0;
	border-bottom: 1px solid var(--gp-grid-line);
	color: var(--gp-ink);
}

.gp-death > * + * {
	margin-left: 0.6rem;
}

.gp-death__when,
.gp-death__detail,
.gp-death__source {
	font-size: 0.85rem;
	color: var(--gp-ink-muted);
	font-variant-numeric: tabular-nums;
}

.gp-death__detail::before,
.gp-death__source::before {
	content: "·";
	margin-right: 0.6rem;
}