/*
 * Game Pulse: the Hearthstone section. The inn's warm wood, gold trim and parchment, with the blue of the Legend
 * medal as the accent, as --gp-* overrides under [data-game="hearthstone"] and .is-game-hearthstone (the shared
 * components in pulse.css and the theme's band, tabs and panels read them), plus the section's own pieces (.gp-hs-*).
 * Colours use light-dark(), so the light and dark schemes come from one declaration.
 */

[data-game="hearthstone"],
.is-game-hearthstone {
	--wp--preset--color--primary: light-dark(#8A5A12, #F2C14E);
	--wp--preset--color--primary-bright: light-dark(#C8902E, #FFD877);
	--wp--preset--color--accent: light-dark(#1C6FD1, #6EC1FF);
	--wp--preset--color--ink: light-dark(#3A2414, #F3E6C4);
	--wp--preset--color--muted: light-dark(#6E5236, #C9B48C);
	--wp--preset--color--surface: light-dark(#FBF3DF, #1C120B);
	--wp--preset--color--surface-alt: light-dark(#F4E7C5, #26180E);
	--wp--preset--color--border: light-dark(#D9BF86, #5A3B22);
	--gp-hs-wood: #4A2E1C;
	--gp-hs-wood-dark: #2B1A10;
	--gp-hs-gold: #F2C14E;
	--gp-hs-gold-deep: #C8902E;
	--gp-hs-parchment: light-dark(#F7ECCF, #241710);
	--gp-hs-legend: light-dark(#1C6FD1, #6EC1FF);
	--gp-tone: var(--gp-hs-gold-deep);
	--gp-radius: 12px;
	--gp-head-font: var(--pulse-font-fantasy, Georgia, "Times New Roman", serif);
	--gp-hero-bg:
		radial-gradient(42rem 14rem at 50% -4rem, rgba(110, 193, 255, 0.22), transparent 70%),
		radial-gradient(36rem 12rem at 50% 130%, rgba(242, 193, 78, 0.22), transparent 70%),
		repeating-linear-gradient(90deg, rgba(0, 0, 0, 0.16) 0 2px, transparent 2px 90px),
		repeating-linear-gradient(0deg, rgba(255, 220, 160, 0.035) 0 1px, transparent 1px 7px),
		linear-gradient(180deg, #4A2E1C, #2B1A10);
	--gp-hero-rule: #F2C14E;
	--gp-hero-accent: #FFD877;
	--gp-hero-title: #FFE9AE;
	--gp-hero-ink: #F3E6C4;
	--gp-hero-pill: rgba(242, 193, 78, 0.6);
	--gp-icon-radius: 50%;
	--gp-icon-ring: #C8902E;
	--gp-tabs-bg: #2B1A10;
	--gp-tabs-rule: #7A5226;
	--gp-tabs-ink: #E9D7A8;
	--gp-tabs-active: #FFD877;
	--gp-panel-border: light-dark(#C9A55E, #6B4429);
	--gp-panel-bg:
		radial-gradient(120% 90% at 50% 0%, light-dark(rgba(255, 255, 255, 0.6), rgba(242, 193, 78, 0.06)), transparent 60%),
		var(--gp-hs-parchment);
	--gp-panel-shadow: 0 0 0 3px light-dark(rgba(74, 46, 28, 0.12), rgba(0, 0, 0, 0.35)), 0 14px 28px -22px rgba(43, 26, 16, 0.7);
	--gp-panel-title: light-dark(#5A3714, #FFD877);
	--gp-plate-bg: linear-gradient(180deg, #4A2E1C, #2B1A10);
	--gp-plate-border: #C8902E;
	--gp-plate-ink: #FFE9AE;
	--gp-plate-bar: linear-gradient(180deg, #6EC1FF, #1C6FD1);
	--gp-plate-track: #1A0F08;
	--gp-hs-series-1: light-dark(#1C6FD1, #6EC1FF);
	--gp-hs-series-2: light-dark(#B7791F, #F2C14E);
	--gp-hs-series-3: light-dark(#9B2C2C, #FC8181);
	--gp-hs-series-4: light-dark(#2F855A, #68D391);
	--gp-hs-series-5: light-dark(#6B46C1, #B794F4);
	--gp-hs-series-6: light-dark(#4A2E1C, #E9D7A8);
	/* The hero band's class labels in the classes' colours. */
	--class-death-knight: #8EC6E8;
	--class-demon-hunter: #6FCF5A;
	--class-druid: #FF9A3C;
	--class-hunter: #6FCF5A;
	--class-mage: #6EC1FF;
	--class-paladin: #F5B8D0;
	--class-priest: #FFFFFF;
	--class-rogue: #FFE16A;
	--class-shaman: #4E8CFF;
	--class-warlock: #B39DFF;
	--class-warrior: #E0A070;
}

/* The section's components. */
.gp-hs {
	min-width: 0;
	color: var(--wp--preset--color--ink);
}

.gp-hs-regions {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
}

@media (min-width: 900px) {
	.gp-hs-regions {
		grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	}
}

.gp-hs-region {
	min-width: 0;
}

.gp-hs-region__name {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	margin: 0;
	font-family: var(--gp-head-font);
	font-size: 1.05rem;
	text-align: center;
	color: var(--gp-panel-title);
}

.gp-hs-region__note,
.gp-hs-read {
	margin: 0.2rem 0 0.6rem;
	font-size: 0.8rem;
	text-align: center;
	color: var(--wp--preset--color--muted);
}

img.gp-hs-mode,
img.gp-hs-class {
	border-radius: 50%;
	vertical-align: middle;
}

.gp-hs-table th[scope="row"] {
	font-weight: 600;
	overflow-wrap: anywhere;
}

.gp-hs-table tr[data-rank="1"] th[scope="row"] {
	color: var(--gp-hs-legend);
}

.gp-hs-move {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.gp-hs-move.is-up {
	color: light-dark(#2F855A, #68D391);
}

.gp-hs-move.is-down {
	color: light-dark(#9B2C2C, #FC8181);
}

.gp-hs-move.is-new {
	color: var(--gp-hs-legend);
	font-weight: 600;
}

.gp-hs-move.is-held {
	color: var(--wp--preset--color--muted);
}

/* The top ten: a rank in a gold coin beside each nameplate. */
.gp-hs-top {
	display: grid;
	gap: 0.35rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-hs-top li {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}

.gp-hs-rank {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 1.9rem;
	height: 1.9rem;
	font-weight: 700;
	font-size: 0.85rem;
	color: #2B1A10;
	background: radial-gradient(circle at 35% 30%, #FFE9AE, #F2C14E 55%, #C8902E);
	border: 1px solid #7A5226;
	border-radius: 50%;
}

.gp-hs-top li:first-child .gp-hs-rank {
	color: #FFFFFF;
	background: radial-gradient(circle at 35% 30%, #A8DBFF, #1C6FD1 60%, #0E3E7A);
	border-color: #0E3E7A;
}

/* The generic nameplate in the inn's wood and gold; the initial becomes a mana crystal. */
.gp-plate--hearthstone {
	min-width: 0;
	color: var(--gp-plate-ink);
	background: var(--gp-plate-bg);
	border: 1px solid var(--gp-plate-border);
	border-radius: 999px;
}

.gp-plate--hearthstone .gp-plate__name a {
	color: inherit;
}

.gp-plate--hearthstone .gp-plate__meta {
	color: #E9D7A8;
}

.gp-plate--hearthstone .gp-plate__initial {
	color: #FFFFFF;
	background: linear-gradient(160deg, #A8DBFF, #1C6FD1 55%, #0E3E7A);
	clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
	border-radius: 0;
}

/* Season tiles. */
.gp-hs-tiles {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-hs-tile {
	display: grid;
	justify-items: center;
	gap: 0.25rem;
	padding: 0.85rem;
	text-align: center;
	border: 1px solid var(--gp-panel-border);
	border-radius: 10px;
	background: light-dark(rgba(255, 255, 255, 0.5), rgba(0, 0, 0, 0.2));
}

.gp-hs-tile strong {
	font-family: var(--gp-head-font);
	font-size: 1.6rem;
	line-height: 1.1;
	color: var(--gp-hs-legend);
}

.gp-hs-tile span {
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
}

/* Charts (drawn on the server as SVG). */
.gp-hs-chart {
	margin: 0;
}

.gp-hs-chart svg {
	display: block;
	width: 100%;
	height: auto;
}

.gp-hs-chart figcaption {
	margin-top: 0.3rem;
	font-size: 0.8rem;
	text-align: center;
	color: var(--wp--preset--color--muted);
}

.gp-hs-grid {
	stroke: light-dark(rgba(74, 46, 28, 0.18), rgba(233, 215, 168, 0.14));
	stroke-width: 1;
}

.gp-hs-axis {
	font-size: 11px;
	fill: var(--wp--preset--color--muted);
}

.gp-hs-line {
	fill: none;
	stroke-width: 2.5;
	stroke-linejoin: round;
	stroke-linecap: round;
}

.gp-hs-line--1 { --gp-hs-c: var(--gp-hs-series-1); }
.gp-hs-line--2 { --gp-hs-c: var(--gp-hs-series-2); }
.gp-hs-line--3 { --gp-hs-c: var(--gp-hs-series-3); }
.gp-hs-line--4 { --gp-hs-c: var(--gp-hs-series-4); }
.gp-hs-line--5 { --gp-hs-c: var(--gp-hs-series-5); }
.gp-hs-line--6 { --gp-hs-c: var(--gp-hs-series-6); }

polyline.gp-hs-line {
	stroke: var(--gp-hs-c);
}

.gp-hs-dot,
.gp-hs-bar {
	fill: var(--gp-hs-c);
}

.gp-hs-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.3rem 0.9rem;
	margin: 0.4rem 0 0;
	padding: 0;
	list-style: none;
	font-size: 0.8rem;
}

.gp-hs-key::before {
	content: "";
	display: inline-block;
	width: 0.7rem;
	height: 0.7rem;
	margin-right: 0.3rem;
	vertical-align: -1px;
	border-radius: 2px;
	background: var(--gp-hs-c);
}

.gp-hs-key span {
	font-weight: 600;
}

/* Cards: the mana crystal carries the cost. */
.gp-hs-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-hs-card {
	display: grid;
	grid-template-columns: auto auto 1fr;
	align-items: center;
	gap: 0.2rem 0.5rem;
	padding: 0.5rem;
	border: 1px solid var(--gp-panel-border);
	border-radius: 8px;
}

.gp-hs-card__text {
	grid-column: 1 / -1;
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
}

.gp-hs-mana {
	position: relative;
	display: inline-grid;
	place-items: center;
}

.gp-hs-mana > span {
	position: absolute;
	font-weight: 800;
	color: #FFFFFF;
	text-shadow: 0 0 2px #000, 0 1px 2px #000;
}

@media (forced-colors: active) {
	.gp-hs-rank,
	.gp-plate--hearthstone .gp-plate__initial {
		forced-color-adjust: none;
	}
}

/* ---- r12: the ladder browser (mode and region as segmented controls, BattleTag search, sortable columns) ---- */

.gp-hs-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.gp-hs-board[hidden],
.gp-hs-table tr[hidden] {
	display: none !important;
}

.gp-hs-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.6rem 0.9rem;
	margin: 0 0 1rem;
	text-align: center;
}

.gp-hs-filters .gp-search input {
	min-height: 2.5rem;
	width: min(16rem, 80vw);
	padding: 0.3rem 0.9rem;
	border: 2px solid #A8711F;
	border-radius: 999px;
	font: inherit;
	font-size: 0.9rem;
	color: var(--wp--preset--color--ink);
	background: var(--gp-surface-sunk, var(--wp--preset--color--surface));
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.gp-hs-filters__show {
	min-height: 2.5rem;
	padding: 0.3rem 1rem;
	border: 2px solid #A8711F;
	border-radius: 10px;
	font: inherit;
	font-weight: 700;
	color: #FFE9AE;
	background: linear-gradient(180deg, #4A2E1C, #2B1A10);
	cursor: pointer;
}

.gp-hs-filters.is-enhanced .gp-hs-filters__show {
	display: none;
}

.gp-hs-count {
	flex-basis: 100%;
	min-height: 1.2em;
	margin: 0;
	font-size: 0.85rem;
	color: var(--wp--preset--color--muted);
}

.gp-hs-board__head {
	margin-bottom: 0.5rem;
}

.gp-hs-board .gp-table-wrap,
.gp-hs-board .gp-hs-chart {
	max-width: 48rem;
	margin-inline: auto;
}

.gp-hs-board .gp-hs-chart {
	margin-top: 1.25rem;
}

.gp-hs-sortable th[scope="col"] {
	padding: 0;
}

.gp-sort {
	display: block;
	width: 100%;
	padding: 0.5rem 0.6rem;
	border: 0;
	font: inherit;
	font-weight: 700;
	text-align: inherit;
	color: inherit;
	background: transparent;
	cursor: pointer;
}

.gp-sort::after {
	content: "\2195";
	margin-left: 0.3em;
	opacity: 0.45;
}

th[aria-sort="ascending"] .gp-sort::after {
	content: "\25B2";
	opacity: 1;
}

th[aria-sort="descending"] .gp-sort::after {
	content: "\25BC";
	opacity: 1;
}

.gp-sort:focus-visible {
	outline: 2px solid #8FD0FF;
	outline-offset: -2px;
}

.gp-hs-rank-cell {
	font-variant-numeric: tabular-nums;
	font-weight: 700;
}

.gp-hs-rating-cell {
	font-variant-numeric: tabular-nums;
}

.gp-hs-badge {
	display: inline-block;
	padding: 0 0.45rem;
	border-radius: 999px;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #FFFFFF;
	background: linear-gradient(180deg, #4E8CFF, #2A4FC0);
}

/* ---- r12: "right now" on the overview ---- */

.gp-hs-now {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
	gap: 0.9rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gp-hs-now__card {
	--gp-hsd-class: #6B4423;
	display: grid;
	align-content: start;
	gap: 0.35rem;
	padding: 0.85rem 1rem;
	border-radius: 14px;
	text-align: center;
	color: #F3E6C4;
	background:
		radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--gp-hsd-class) 55%, transparent), transparent 70%),
		linear-gradient(180deg, #2E1D12, #1A0F08);
	box-shadow: inset 0 0 0 1px rgba(255, 233, 174, 0.2), 0 0 0 2px #6B4423, 0 0 0 3px #A8711F;
}

.gp-hs-now__kicker {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	margin: 0;
	font-size: 0.72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #E3D2A6;
}

.gp-hs-now__title {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin: 0;
	font-family: var(--gp-head-font);
	font-weight: 900;
	font-size: 1.2rem;
	line-height: 1.2;
	color: #FFFFFF;
	text-shadow: 0 2px 0 #000, 0 0 3px #000;
}

.gp-hs-now__title a {
	color: inherit;
}

.gp-hs-now__title img {
	border-radius: 50%;
	box-shadow: 0 0 0 2px #1A0F08, 0 0 0 3px #F2C14E;
}

.gp-hs-now__meta {
	margin: 0;
	font-size: 0.85rem;
	color: #E3D2A6;
}

.gp-hs-now__list {
	display: grid;
	gap: 0.3rem;
	margin: 0.2rem 0 0;
	padding: 0;
	list-style: none;
}

.gp-hs-now__list li {
	display: flex;
	justify-content: space-between;
	gap: 0.6rem;
	padding: 0.25rem 0.6rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.3);
}

.gp-hs-now__region {
	font-size: 0.8rem;
	color: #CDBF9E;
}

.gp-hs-now__list a {
	font-family: var(--gp-head-font);
	font-weight: 700;
	color: #FFD877;
}
