/* ============================================================
 * SuccesOne - Stats avancées étendues (page /mes-stats/)
 * 5 sections, 13 modules
 * Indépendant de stats-extra.css (mais partage la palette SO)
 * ============================================================ */

/* ------------------------------------------------------------
 * Override : page accueillant le shortcode [user-stats-extended]
 * en pleine largeur (sidebar masquee).
 *
 * Double strategie :
 *  - filter PHP body_class -> body.user-stats-ext-fullwidth
 *  - vanilla JS au debut du shortcode (idem + html.user-stats-ext-fullwidth)
 *
 * Les selecteurs ci-dessous ciblent les 2 cas pour garantir
 * que le full-width s'applique meme si le filter PHP echoue
 * (page builder, contenu encode, etc.).
 * ------------------------------------------------------------ */

body.user-stats-ext-fullwidth #secondary,
body.user-stats-ext-fullwidth .sidebar.widget-area,
html.user-stats-ext-fullwidth body #secondary,
html.user-stats-ext-fullwidth body .sidebar.widget-area {
	display: none !important;
}

body.user-stats-ext-fullwidth .middle-main.content-cols2,
body.user-stats-ext-fullwidth .middle-main.sidebar-left,
body.user-stats-ext-fullwidth .middle-main.content-full,
html.user-stats-ext-fullwidth body .middle-main.content-cols2,
html.user-stats-ext-fullwidth body .middle-main.sidebar-left,
html.user-stats-ext-fullwidth body .middle-main.content-full {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

body.user-stats-ext-fullwidth #primary.content-area,
html.user-stats-ext-fullwidth body #primary.content-area {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
}

body.user-stats-ext-fullwidth #primary.content-area .inner,
html.user-stats-ext-fullwidth body #primary.content-area .inner {
	padding: 0 !important;
}

/* Le titre WP de la page (ex : "Mes stats") fait doublon avec notre hero
   "Mes Stats Avancees" -> on le masque sur cette page uniquement. */
body.user-stats-ext-fullwidth #primary .post-details > .entry-header,
html.user-stats-ext-fullwidth body #primary .post-details > .entry-header {
	display: none !important;
}

/* Quelques themes ajoutent du padding au .inner / .post-details, on neutralise
   pour que notre page ait son propre rythme visuel sans contraintes externes. */
body.user-stats-ext-fullwidth #primary .post.post-details,
html.user-stats-ext-fullwidth body #primary .post.post-details {
	background: transparent !important;
	padding: 0 !important;
	border: none !important;
	box-shadow: none !important;
}

body.user-stats-ext-fullwidth #primary .post.post-details > .entry-content,
html.user-stats-ext-fullwidth body #primary .post.post-details > .entry-content {
	padding: 0 !important;
	margin: 0 !important;
}

/* Container du theme (.main-row .container) est limite par le CSS du theme
   (ex: 1170px). On le force a etre plus large pour profiter de la suppression
   sidebar. Garde une marge raisonnable. */
body.user-stats-ext-fullwidth .main-row > .container,
html.user-stats-ext-fullwidth body .main-row > .container {
	max-width: 1400px !important;
}


:root {
	--so-green:        #66cc33;
	--so-green-dark:   #4fa326;
	--so-dark:         #3D3F4B;
	--so-text:         #2c2e38;
	--so-muted:        #6b6e7c;
	--so-border:       #e3e6ee;
	--so-card-bg:      #ffffff;
	--so-page-bg:      #f4f6fb;
	--so-rarity-elite:    #c41a3b;
	--so-rarity-veryrare: #f25d3c;
	--so-rarity-rare:     #f0c419;
	--so-rarity-common:   #8aa6ce;
}

.user-stats-ext-page {
	background: var(--so-page-bg);
	padding: 40px 0 60px;
	color: var(--so-text);
	font-family: 'Open Sans', sans-serif;
	font-size: 13px;
	line-height: 1.5;
	max-width: 1280px;
	margin: 0 auto;
}

/* ============ HERO ============ */

.user-stats-ext-hero {
	text-align: center;
	margin: 0 0 36px;
	padding: 30px 20px 26px;
	background: linear-gradient(135deg, var(--so-dark), #2a2c36);
	color: #fff;
	border-radius: 6px;
}

.user-stats-ext-hero-title {
	font-family: 'Gafata', sans-serif;
	font-size: 2.3em;
	margin: 0 0 8px;
	color: #fff;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	font-weight: 300;
}

.user-stats-ext-hero-sub {
	margin: 0;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.85);
}

.user-stats-ext-hero-sub strong {
	color: var(--so-green);
}

.user-stats-ext-locked {
	max-width: 600px;
	margin: 60px auto;
	padding: 40px 30px;
	background: #fff;
	border-radius: 6px;
	border: 1px solid var(--so-border);
	text-align: center;
	color: var(--so-muted);
}

.user-stats-ext-locked .button {
	display: inline-block;
	margin-top: 12px;
	padding: 10px 24px;
	background: var(--so-green);
	color: #fff !important;
	text-decoration: none !important;
	border-radius: 3px;
}

/* ============ SECTIONS ============ */

.user-stats-ext-section {
	margin: 0 0 44px;
	padding: 0 20px;
}

.ext-section-header {
	margin: 0 0 20px;
	padding-bottom: 14px;
	border-bottom: 2px solid var(--so-green);
}

.ext-section-header h2 {
	font-family: 'Gafata', sans-serif;
	font-size: 1.5em;
	margin: 0 0 4px;
	color: var(--so-dark);
	text-transform: uppercase;
	letter-spacing: 1px;
	font-weight: 300;
}

.ext-section-header p {
	margin: 0;
	color: var(--so-muted);
	font-size: 13px;
}

/* ============ GRIDS ============ */

.ext-section-body {
	display: grid;
	gap: 20px;
}

.ext-grid-3 {
	grid-template-columns: repeat(3, 1fr);
}

.ext-grid-2 {
	grid-template-columns: 1fr 1fr;
}

@media (max-width: 991px) {
	.ext-grid-3 {
		grid-template-columns: 1fr;
	}
	.ext-grid-2 {
		grid-template-columns: 1fr;
	}
}

/* ============ CARDS ============ */

.ext-card {
	background: var(--so-card-bg);
	border: 1px solid var(--so-border);
	border-radius: 6px;
	padding: 22px 22px 18px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
}

.ext-card-wide {
	grid-column: span 2;
}

@media (max-width: 991px) {
	.ext-card-wide {
		grid-column: auto;
	}
}

.ext-card-title {
	font-family: 'Gafata', sans-serif;
	font-size: 1.15em;
	margin: 0 0 6px;
	color: var(--so-dark);
	text-transform: uppercase;
	letter-spacing: 0.8px;
	font-weight: 400;
}

.ext-card-title hr {
	border: none;
	border-top: 2px solid var(--so-green);
	width: 40px;
	margin: 6px 0 0;
}

.ext-card-desc {
	color: var(--so-muted);
	font-size: 12px;
	margin: 6px 0 14px;
	min-height: 32px;
}

/* ============ AJAX wrappers ============ */

.ext-ajax {
	flex: 1 1 auto;
	min-height: 80px;
	min-width: 0;
}

.ext-ajax img.loading {
	display: block;
	margin: 28px auto;
	max-width: 32px;
	opacity: 0.6;
}

.ext-empty {
	text-align: center;
	color: var(--so-muted);
	padding: 30px 10px;
}

.ext-empty img {
	max-width: 80px;
	opacity: 0.5;
	margin-bottom: 8px;
}

/* ============ ext-list générique ============ */

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

/* ============ rarity badges (partagés) ============ */

.rarity-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 11px;
	font-weight: 700;
	color: #fff;
	letter-spacing: 0.3px;
}

.rarity-elite    { background: var(--so-rarity-elite); }
.rarity-veryrare { background: var(--so-rarity-veryrare); }
.rarity-rare     { background: var(--so-rarity-rare); color: #2c2e38; }
.rarity-common   { background: var(--so-rarity-common); }

/* ============ Top games (Section 1 - Mes 100% rares) ============ */

.ext-topgames-list {
	max-height: 460px;
	overflow-y: auto;
}

.ext-topgame-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 4px;
	border-bottom: 1px solid var(--so-border);
}

.ext-topgame-item:last-child {
	border-bottom: none;
}

.ext-topgame-thumb {
	flex: 0 0 50px;
	width: 50px;
	height: 50px;
	border-radius: 4px;
	overflow: hidden;
	background: #f0f1f6;
}

.ext-topgame-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ext-topgame-thumb-empty {
	background: #e0e3eb;
}

.ext-topgame-body {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
}

.ext-topgame-body .title {
	display: block;
	font-weight: 600;
	color: var(--so-text);
	font-size: 13px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ext-topgame-body .title a {
	color: inherit;
	text-decoration: none;
}

.ext-topgame-body .title a:hover {
	color: var(--so-green);
}

.ext-topgame-body .desc {
	display: block;
	font-size: 11px;
	color: var(--so-muted);
	margin-top: 2px;
}

.ext-topgame-body .desc em {
	font-style: italic;
}

/* ============ Donut charts (Difficulty + G distribution) ============ */

.ext-donut-chart {
	width: 100%;
	height: 200px;
	margin: 0 0 12px;
}

.ext-donut-legend {
	list-style: none;
	padding: 0;
	margin: 0 0 10px;
}

.ext-donut-legend li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 0;
	font-size: 12px;
	border-bottom: 1px dashed #f0f1f6;
}

.ext-donut-legend li:last-child {
	border-bottom: none;
}

.donut-dot {
	flex: 0 0 12px;
	width: 12px;
	height: 12px;
	border-radius: 50%;
}

.donut-name {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.donut-val {
	flex: 0 0 auto;
	color: var(--so-muted);
	font-size: 11px;
}

.ext-donut-foot {
	font-size: 11px;
	color: var(--so-muted);
	border-top: 1px solid var(--so-border);
	padding-top: 8px;
	margin-top: 8px;
}

.ext-donut-rarest {
	margin-top: 6px;
	padding: 6px 8px;
	background: #fdfbe7;
	border-left: 3px solid var(--so-rarity-rare);
	border-radius: 2px;
	color: var(--so-text);
	font-size: 12px;
}

/* Hide CanvasJS watermark */
.user-stats-ext-page .canvasjs-chart-credit,
.user-stats-ext-page a[href*="canvasjs.com"] {
	display: none !important;
	visibility: hidden !important;
	opacity: 0 !important;
	pointer-events: none !important;
}

/* ============ Profil chasseur grid (Section 1) ============ */

.ext-profile-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.ext-kpi {
	background: #f7f9fd;
	padding: 12px 10px;
	border-radius: 4px;
	text-align: center;
	border: 1px solid #eef0f7;
	min-width: 0;
	overflow: hidden;
}

.ext-kpi-wide {
	grid-column: span 2;
}

.ext-kpi-val {
	font-family: 'Gafata', sans-serif;
	font-size: 1.7em;
	color: var(--so-green-dark);
	font-weight: 400;
	line-height: 1.1;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ext-kpi-val-sm {
	font-size: 1.1em;
}

.ext-kpi-lbl {
	font-size: 11px;
	color: var(--so-muted);
	margin-top: 4px;
	line-height: 1.3;
}

.ext-kpi-lbl small {
	display: block;
	font-size: 10px;
	color: #999;
	margin-top: 2px;
}

/* ============ Section 2 - Top rare achievements unlocked ============ */

.ext-rareach-list {
	max-height: 480px;
	overflow-y: auto;
}

.ext-rareach-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 4px;
	border-bottom: 1px solid var(--so-border);
}

.ext-rareach-item:last-child { border-bottom: none; }

.ext-rareach-rank {
	flex: 0 0 32px;
	font-family: 'Gafata', sans-serif;
	font-size: 18px;
	color: var(--so-muted);
	text-align: center;
}

.ext-rareach-thumb {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	border-radius: 4px;
	overflow: hidden;
	background: #f0f1f6;
}

.ext-rareach-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ext-rareach-thumb-empty { background: #e0e3eb; }

.ext-rareach-body {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
}

.ext-rareach-body .title {
	display: block;
	font-weight: 600;
	font-size: 13px;
	color: var(--so-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ext-rareach-body .desc {
	display: block;
	font-size: 11px;
	color: var(--so-muted);
	margin-top: 2px;
}

/* ============ Section 2 - Records temporels ============ */

.ext-records-list {
	list-style: none;
	padding: 0;
	margin: 0 0 12px;
}

.ext-record-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid var(--so-border);
}

.ext-record-item:last-child { border-bottom: none; }

.ext-record-icon {
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	background: linear-gradient(135deg, var(--so-green), var(--so-green-dark));
	color: #fff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.ext-record-body {
	flex: 1 1 auto;
	min-width: 0;
}

.ext-record-title {
	font-size: 11px;
	color: var(--so-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ext-record-period {
	font-family: 'Gafata', sans-serif;
	font-size: 16px;
	color: var(--so-text);
	margin: 2px 0;
}

.ext-record-stat {
	font-size: 12px;
	color: var(--so-muted);
}

.ext-records-foot {
	border-top: 1px solid var(--so-border);
	padding-top: 8px;
	font-size: 11px;
	color: var(--so-muted);
}

/* ============ Section 2 - Vitesse de complétion ============ */

.ext-speed-summary {
	text-align: center;
	margin: 0 0 16px;
	padding: 14px 10px;
	background: linear-gradient(135deg, #f7f9fd, #ffffff);
	border-radius: 4px;
	border: 1px solid var(--so-border);
}

.ext-speed-big {
	font-family: 'Gafata', sans-serif;
	font-size: 2.2em;
	color: var(--so-green-dark);
	line-height: 1;
}

.ext-speed-lbl {
	color: var(--so-muted);
	font-size: 11px;
	margin-top: 4px;
}

.ext-speed-section {
	margin-bottom: 14px;
}

.ext-speed-section h4 {
	font-family: 'Gafata', sans-serif;
	font-size: 13px;
	color: var(--so-dark);
	margin: 0 0 6px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 400;
}

.ext-speed-section h4 i {
	color: var(--so-green);
	margin-right: 4px;
}

.ext-mini-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ext-mini-list li {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 0;
	border-bottom: 1px dashed #f0f1f6;
}

.ext-mini-list li:last-child { border-bottom: none; }

.ext-mini-thumb {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border-radius: 3px;
	overflow: hidden;
	background: #f0f1f6;
}

.ext-mini-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ext-mini-thumb-empty { background: #e0e3eb; }

.ext-mini-body {
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
}

.ext-mini-body .title {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--so-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ext-mini-body .desc {
	display: block;
	font-size: 10px;
	color: var(--so-muted);
}

/* ============ Section 2 - Premier / dernier succès ============ */

.ext-firstlast-pair {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 14px;
}

@media (max-width: 767px) {
	.ext-firstlast-pair { grid-template-columns: 1fr; }
}

.ext-firstlast-card {
	background: linear-gradient(135deg, #fafbfe, #ffffff);
	border: 1px solid var(--so-border);
	border-radius: 4px;
	padding: 14px 12px;
	text-align: center;
}

.ext-firstlast-label {
	font-size: 11px;
	color: var(--so-green-dark);
	text-transform: uppercase;
	letter-spacing: 0.5px;
	font-weight: 600;
	margin-bottom: 8px;
}

.ext-firstlast-thumb {
	display: block;
	width: 56px;
	height: 56px;
	border-radius: 4px;
	overflow: hidden;
	margin: 0 auto 8px;
	background: #f0f1f6;
}

.ext-firstlast-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ext-firstlast-thumb-empty { background: #e0e3eb; }

.ext-firstlast-title {
	font-family: 'Gafata', sans-serif;
	font-size: 14px;
	color: var(--so-text);
}

.ext-firstlast-game {
	font-size: 11px;
	color: var(--so-muted);
	margin: 2px 0;
}

.ext-firstlast-game a {
	color: inherit;
}

.ext-firstlast-meta {
	font-size: 11px;
	color: var(--so-muted);
}

.ext-firstlast-span {
	margin-top: 12px;
	text-align: center;
	font-size: 12px;
	color: var(--so-text);
	padding: 8px;
	background: #f7f9fd;
	border-radius: 3px;
}

.ext-firstlast-span i {
	color: var(--so-green);
	margin-right: 4px;
}

/* ============ Section 3 - Plateformes (table) ============ */

.ext-platforms-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 11px;
	table-layout: fixed;
}

/* Largeurs explicites des colonnes (table-layout: fixed les force, contrairement
 * a min-width sur td qui n'est pas respecte de maniere fiable par les browsers
 * en mode auto). Ratio total = 100% : nom 36% + G 22% + % 12% + jeux 10% + 100% 20%. */
.ext-platforms-table col.ext-col-name { width: 36%; }
.ext-platforms-table col.ext-col-g { width: 22%; }
.ext-platforms-table col.ext-col-pct { width: 12%; }
.ext-platforms-table col.ext-col-games { width: 10%; }
.ext-platforms-table col.ext-col-perfect { width: 20%; }

.ext-platforms-table th {
	text-align: left;
	padding: 6px 4px;
	border-bottom: 2px solid var(--so-green);
	color: var(--so-dark);
	font-weight: 600;
	text-transform: uppercase;
	font-size: 10px;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

/* Aligne a droite les colonnes numeriques (G, %, Jeux, 100%) pour lisibilite */
.ext-platforms-table th:not(:first-child),
.ext-platforms-table td:not(:first-child) {
	text-align: right;
	padding-left: 6px;
}

.ext-platforms-table td {
	padding: 6px 4px;
	border-bottom: 1px solid var(--so-border);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ext-platforms-table tr:last-child td {
	border-bottom: none;
}

.ext-platforms-name {
	font-weight: 600;
	color: var(--so-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	padding-right: 6px;
}

.ext-platforms-foot {
	margin-top: 8px;
	font-size: 11px;
	color: var(--so-muted);
}

/* ============ Section 3 - Historique annuel (chart) ============ */

.ext-history-chart {
	width: 100%;
	height: 240px;
}

.ext-history-foot {
	margin-top: 8px;
	font-size: 11px;
	color: var(--so-muted);
	border-top: 1px solid var(--so-border);
	padding-top: 8px;
}

/* ============ Section 4 - Quasi-100% ============ */

.ext-ghost-list {
	list-style: none;
	padding: 0;
	margin: 0;
	max-height: 520px;
	overflow-y: auto;
}

.ext-ghost-item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 10px 4px;
	border-bottom: 1px solid var(--so-border);
}

.ext-ghost-item:last-child { border-bottom: none; }

.ext-ghost-thumb {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 4px;
	overflow: hidden;
	background: #f0f1f6;
}

.ext-ghost-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ext-ghost-thumb-empty { background: #e0e3eb; }

.ext-ghost-body {
	flex: 1 1 auto;
	min-width: 0;
}

.ext-ghost-body .title {
	display: block;
	font-weight: 600;
	font-size: 13px;
	color: var(--so-text);
}

.ext-ghost-body .desc {
	display: block;
	font-size: 11px;
	color: var(--so-muted);
	margin-top: 2px;
}

.ext-ghost-missing {
	display: inline-block;
	padding: 1px 6px;
	background: var(--so-rarity-veryrare);
	color: #fff;
	border-radius: 3px;
	font-weight: 700;
	margin-right: 4px;
}

.ext-ghost-bottleneck {
	display: block;
	margin-top: 4px;
	padding: 4px 8px;
	background: #fdfbe7;
	border-left: 2px solid var(--so-rarity-rare);
	border-radius: 2px;
	font-size: 11px;
	color: var(--so-text);
	font-style: italic;
}

/* ============ Section 4 - Prochains paliers ============ */

.ext-milestones-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ext-milestone-item {
	margin: 0 0 18px;
}

.ext-milestone-head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
}

.ext-milestone-head i {
	color: var(--so-green);
	font-size: 16px;
}

.ext-milestone-label {
	flex: 1 1 auto;
	font-weight: 600;
	color: var(--so-text);
	font-size: 13px;
	text-transform: capitalize;
}

.ext-milestone-target {
	font-size: 12px;
	color: var(--so-muted);
}

.ext-milestone-bar {
	width: 100%;
	height: 8px;
	background: #eef0f7;
	border-radius: 4px;
	overflow: hidden;
}

.ext-milestone-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--so-green), var(--so-green-dark));
	border-radius: 4px;
	transition: width 0.6s ease;
}

.ext-milestone-foot {
	margin-top: 4px;
	font-size: 11px;
	color: var(--so-muted);
}

/* ============ Section 5 - Rang SO ============ */

.ext-rank-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.ext-rank-grid-2 {
	grid-template-columns: 1fr 1fr;
	max-width: 720px;
	margin: 0 auto;
}

@media (max-width: 767px) {
	.ext-rank-grid,
	.ext-rank-grid-2 { grid-template-columns: 1fr; }
}

.ext-rank-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 18px;
	background: linear-gradient(135deg, #fafbfe, #ffffff);
	border: 1px solid var(--so-border);
	border-radius: 5px;
}

a.ext-rank-link,
a.ext-rank-link:visited,
a.ext-rank-link:focus,
a.ext-rank-link:hover {
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

a.ext-rank-link:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px rgba(0,0,0,0.08);
	border-color: var(--so-green);
}

a.ext-rank-link:hover .ext-rank-arrow {
	color: var(--so-green);
	transform: translateX(2px);
}

.ext-rank-arrow {
	font-size: 10px;
	color: var(--so-muted);
	margin-left: 4px;
	transition: color .15s ease, transform .15s ease;
	vertical-align: baseline;
}

.ext-rank-icon {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	background: linear-gradient(135deg, var(--so-dark), #2a2c36);
	color: var(--so-green);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
}

.ext-rank-body {
	flex: 1 1 auto;
	min-width: 0;
}

.ext-rank-label {
	font-size: 11px;
	color: var(--so-muted);
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ext-rank-val {
	font-family: 'Gafata', sans-serif;
	font-size: 1.8em;
	color: var(--so-green-dark);
	margin: 4px 0;
	line-height: 1;
}

.ext-rank-val small {
	font-family: 'Open Sans', sans-serif;
	font-size: 11px;
	color: var(--so-muted);
}

.ext-rank-pct {
	font-size: 12px;
	color: var(--so-text);
	font-weight: 600;
}

/* ============ Responsive tweaks ============ */

@media (max-width: 991px) {
	.user-stats-ext-page {
		padding: 20px 0 30px;
	}
	.user-stats-ext-hero {
		padding: 22px 16px 18px;
	}
	.user-stats-ext-hero-title {
		font-size: 1.6em;
	}
	.user-stats-ext-section {
		margin-bottom: 32px;
		padding: 0 12px;
	}
	.ext-card {
		padding: 16px 14px 14px;
	}
	.ext-grid-3, .ext-grid-2 {
		grid-template-columns: 1fr;
	}
	.ext-card-wide {
		grid-column: auto;
	}
}

@media (max-width: 767px) {
	.ext-profile-grid {
		grid-template-columns: 1fr;
	}
	.ext-kpi-wide {
		grid-column: auto;
	}
	.ext-kpi-val { font-size: 1.4em; }
	.ext-rareach-rank { display: none; }
	.ext-platforms-table { font-size: 11px; }
	.ext-platforms-table th, .ext-platforms-table td { padding: 4px 3px; }
	.ext-rank-icon { flex: 0 0 44px; width: 44px; height: 44px; font-size: 18px; }
	.ext-rank-val { font-size: 1.4em; }
}
