/* /user/stats (playerstats.js). Scoped to .ps; colours follow the site's dark theme. */
.ps {
	--ps-card: #141414;
	--ps-card-2: #1b1b1b;
	--ps-line: #262626;
	--ps-text: #e2e2e2;
	--ps-muted: #8d8d8d;
	--ps-accent: #2a9fd6;
	--ps-good: #a9cf54;
	--ps-bad: #e0533f;
	color: var(--ps-text);
	padding-bottom: 30px;
}
.ps a { color: var(--ps-accent); text-decoration: none; }
.ps a:hover { text-decoration: underline; }
.ps a.ps-hero:hover, .ps a.ps-record:hover, .ps a.ps-pick:hover { text-decoration: none; }
.ps h1, .ps h2, .ps h3 { color: #fff; }
.ps-muted { color: var(--ps-muted); }
.ps-good { color: var(--ps-good) !important; }
.ps-bad { color: var(--ps-bad) !important; }
.ps-nowrap { white-space: nowrap; }
.ps-sub { font-size: 12.5px; margin: -4px 0 8px; }

/* top bar */
.ps-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 14px; }
.ps-title { font-size: 24px; margin: 0; }
.ps-title .fa { color: var(--ps-accent); margin-right: 4px; }
.ps-search { display: flex; gap: 0; }
.ps-search .form-control { width: 240px; border-radius: 4px 0 0 4px; }
.ps-search .btn { border-radius: 0 4px 4px 0; }
.ps-alert .ps-muted { color: inherit; opacity: .85; margin-top: 4px; font-size: 13px; }

/* cards */
.ps-card { background: var(--ps-card); border: 1px solid var(--ps-line); border-radius: 8px; padding: 16px 18px; margin-bottom: 16px; min-width: 0; }
.ps-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.ps-card-head h3 { font-size: 17px; font-weight: 600; margin: 0; letter-spacing: .2px; }
.ps-controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ps-controls .form-control { width: auto; background: var(--ps-card-2); border-color: #333; color: var(--ps-text); }
.ps-two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.ps-two .ps-card { margin-bottom: 16px; }

/* segmented buttons */
.ps-seg { display: inline-flex; border: 1px solid #333; border-radius: 4px; overflow: hidden; }
.ps-seg button { background: var(--ps-card-2); color: var(--ps-muted); border: 0; padding: 4px 11px; font-size: 12.5px; }
.ps-seg button + button { border-left: 1px solid #333; }
.ps-seg button.active { background: var(--ps-accent); color: #fff; }

/* header */
.ps-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.ps-avatar { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; flex: none; }
.ps-avatar-empty { background: var(--ps-card-2); display: flex; align-items: center; justify-content: center; font-size: 28px; color: #555; }
.ps-who { flex: 1 1 260px; min-width: 0; }
.ps-name { font-size: 24px; font-weight: 600; color: #fff; word-break: break-word; }
.ps-links { margin-top: 4px; font-size: 13px; }
.ps-links a { margin-right: 14px; white-space: nowrap; }
.ps-tabs { display: flex; gap: 4px; margin-top: 10px; flex-wrap: wrap; }
.ps-tabs a { padding: 4px 12px; border-radius: 4px; background: var(--ps-card-2); border: 1px solid #2c2c2c; color: var(--ps-muted); font-size: 13px; }
.ps-tabs a:hover { color: #fff; text-decoration: none; }
.ps-tabs a.active { background: var(--ps-accent); border-color: var(--ps-accent); color: #fff; }
.ps-status { text-align: right; font-size: 13px; line-height: 1.6; }
.ps-chip { display: inline-block; margin-top: 4px; padding: 2px 9px; border-radius: 10px; background: rgba(42, 159, 214, .15); color: var(--ps-accent); font-size: 12px; }
.ps-medal { display: inline-block; vertical-align: middle; font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 10px; margin-left: 6px; background: #2b2b2b; color: #ddd; }
.ps-medal-1, .ps-medal-2 { background: #3b3326; color: #c9b38a; }
.ps-medal-3, .ps-medal-4 { background: #24343a; color: #8fc4cf; }
.ps-medal-5 { background: #3b3420; color: #e3c060; }
.ps-medal-6 { background: #23352d; color: #7fd1a6; }
.ps-medal-7 { background: #2d2a40; color: #b8a7f0; }
.ps-medal-8 { background: #40261f; color: #f0a27f; }

.ps-landing { text-align: center; padding: 50px 20px; }
.ps-landing h2 { margin-top: 0; }
.ps-landing p { max-width: 560px; margin: 0 auto 20px; }
.ps-empty h3 { margin-top: 0; }

/* KPI tiles */
.ps-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 12px; margin-bottom: 16px; }
.ps-kpi { background: var(--ps-card); border: 1px solid var(--ps-line); border-radius: 8px; padding: 12px 14px; }
.ps-kpi-label { color: var(--ps-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .6px; }
.ps-kpi-value { font-size: 26px; font-weight: 600; color: #fff; margin: 2px 0; }
.ps-kpi-sub { color: var(--ps-muted); font-size: 12px; }

/* charts (c3 on a dark background) */
.ps-chart { width: 100%; }
.ps .c3 svg { font: 11px "Helvetica Neue", Helvetica, Arial, sans-serif; }
.ps .c3 .c3-axis text, .ps .c3 .c3-legend-item text, .ps .c3 .c3-axis-y-label, .ps .c3 .c3-axis-y2-label, .ps .c3 .c3-axis-x-label { fill: #a5a5a5; }
.ps .c3 .c3-axis path, .ps .c3 .c3-axis line { stroke: #3a3a3a; }
.ps .c3 .c3-grid line { stroke: #2a2a2a; }
.ps .c3 .ps-fifty line { stroke: #555; stroke-dasharray: 4 4; }
.ps .c3 .c3-line { stroke-width: 2px; }
.ps .c3-tooltip { background: #101010; border: 1px solid #333; box-shadow: 0 4px 14px rgba(0, 0, 0, .6); opacity: 1; }
.ps .c3-tooltip th { background: #222; color: #fff; }
.ps .c3-tooltip td { background: #161616; color: #ddd; border-left-color: #2a2a2a; }
.ps .c3-tooltip tr { border-color: #2a2a2a; }
.ps-tip { background: #101010; border: 1px solid #333; padding: 7px 10px; color: #ddd; border-radius: 4px; white-space: nowrap; }
.ps-tip img { height: 22px; border-radius: 3px; margin-right: 6px; vertical-align: middle; }

/* hero pool */
.ps-pool { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-bottom: 10px; }
.ps-pool-picker { background: var(--ps-card-2); border-radius: 6px; padding: 12px 14px; }
.ps-pick-title { font-weight: 600; color: #fff; }
.ps-pick-group { color: var(--ps-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; margin: 8px 0 3px; }
.ps-pick { display: flex; align-items: center; gap: 8px; padding: 3px 0; color: var(--ps-text) !important; text-decoration: none !important; }
.ps-pick:hover span { color: #fff; }
.ps-pick img { height: 22px; width: 39px; object-fit: cover; border-radius: 3px; }
.ps-pick span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-pick b { font-variant-numeric: tabular-nums; }
.ps-pick-all { display: inline-block; margin-top: 8px; font-size: 13px; }
.ps-more { margin-top: 10px; background: var(--ps-card-2); border-color: #333; color: var(--ps-text); }

/* tables */
.ps-table-wrap { overflow-x: auto; }
.ps-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.ps-table th { color: var(--ps-muted); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .4px; padding: 6px 8px; border-bottom: 1px solid #2c2c2c; text-align: right; white-space: nowrap; }
.ps-table td { padding: 5px 8px; border-bottom: 1px solid #1f1f1f; text-align: right; }
.ps-table .ps-left { text-align: left; }
.ps-table tbody tr:hover td { background: #1a1a1a; }
.ps-table tr.ps-few td { color: #6a6a6a; }
#ps-heroes th { cursor: pointer; user-select: none; }
#ps-heroes th:hover { color: #ddd; }
.ps-table th.ps-sorted { color: #fff; }
.ps-table th.ps-sorted::after { content: " \25B2"; font-size: 9px; }
.ps-table th.ps-sorted.ps-desc::after { content: " \25BC"; }
.ps-hero { display: inline-flex; align-items: center; gap: 8px; color: var(--ps-text) !important; white-space: nowrap; }
.ps-hero img { height: 22px; width: 39px; object-fit: cover; border-radius: 3px; }
.ps-bar { position: relative; min-width: 90px; height: 18px; }
.ps-bar span { position: absolute; left: 0; top: 3px; bottom: 3px; background: rgba(42, 159, 214, .35); border-radius: 2px; }
.ps-bar b { position: relative; font-weight: 400; padding-right: 2px; line-height: 18px; display: block; text-align: right; }

/* peers */
.ps-peers { max-height: 520px; overflow-y: auto; }
.ps-peer { display: flex; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px solid #1f1f1f; font-size: 13px; }
.ps-peer img, .ps-peer-noimg { width: 24px; height: 24px; border-radius: 4px; flex: none; background: #222; }
.ps-peer-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ps-peer-bar { flex: 0 0 90px; min-width: 0; }
.ps-peer-wr { flex: 0 0 38px; text-align: right; font-variant-numeric: tabular-nums; }
.ps-peer .btn, .ps-peer-gap { flex: 0 0 62px; }
.ps-peer .btn { background: var(--ps-card-2); border-color: #333; color: var(--ps-text); }

/* records */
.ps-records { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.ps-record { display: flex; background: var(--ps-card-2); border: 1px solid var(--ps-line); border-radius: 6px; overflow: hidden; color: var(--ps-text) !important; text-decoration: none !important; transition: border-color .15s; }
.ps-record:hover { border-color: var(--ps-accent); }
.ps-record-img { flex: 0 0 96px; background-size: cover; background-position: center; }
.ps-record-body { padding: 8px 12px; min-width: 0; font-size: 12.5px; }
.ps-record-label { color: var(--ps-muted); text-transform: uppercase; font-size: 11px; letter-spacing: .5px; }
.ps-record-value { font-size: 22px; font-weight: 600; color: var(--ps-good); line-height: 1.2; }
.ps-record-top { color: var(--ps-accent); font-size: 11.5px; margin-top: 2px; }

.ps-about { color: var(--ps-muted); font-size: 13px; }
.ps-about summary { cursor: pointer; color: #bbb; }
.ps-about ul { margin-top: 8px; }

/* /user/personalscores (personalscores.js) */
.ps-two-even { grid-template-columns: 1fr 1fr; }
.ps-kpi-text { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pss-div { position: relative; height: 10px; flex: 1 1 120px; min-width: 60px; background: #1d1d1d; border-radius: 2px; }
.pss-div::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; border-left: 1px solid #444; }
.pss-div span { position: absolute; top: 0; bottom: 0; border-radius: 2px; }
.pss-div .pos { left: 50%; background: var(--ps-good); }
.pss-div .neg { right: 50%; background: var(--ps-bad); }
.pss-bar-row, .pss-trend-row, .pss-role { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 13px; }
.pss-bar-row .ps-hero { flex: 0 0 170px; overflow: hidden; }
.pss-bar-row b, .pss-role b { flex: 0 0 44px; text-align: right; font-variant-numeric: tabular-nums; }
.pss-bar-detail { flex: 0 0 auto; font-size: 12px; min-width: 100px; text-align: right; }
.pss-roles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 8px 28px; }
.pss-role-title { color: var(--ps-muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; margin: 4px 0; }
.pss-role img { width: 22px; height: 22px; flex: none; }
.pss-role-name { flex: 0 0 80px; }
.pss-role-n { flex: 0 0 26px; text-align: right; font-size: 11.5px; }
.pss-trend-row .ps-hero { flex: 1 1 auto; }
.pss-trend-row b { min-width: 36px; text-align: right; }
.pss-arrow { color: #666; }
.pss-filter { width: 180px; background: var(--ps-card-2); border-color: #333; color: var(--ps-text); }
#pss-table th { cursor: pointer; user-select: none; }
.pss-th-sub { display: block; font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 10.5px; color: #666; }
.pss-score-cell { display: flex; align-items: center; gap: 8px; min-width: 170px; }
.pss-score-cell b { flex: 0 0 44px; text-align: right; }
.pss-privacy { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.pss-privacy label { font-weight: 400; margin: 0; cursor: pointer; }
.pss-privacy input { margin-right: 5px; }

/* /admin/panel */
.adm-links { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.adm-links a { display: block; background: var(--ps-card-2); border: 1px solid var(--ps-line); border-radius: 6px; padding: 10px 12px; color: var(--ps-text); }
.adm-links a:hover { border-color: var(--ps-accent); text-decoration: none; }
.adm-links b { display: block; color: #fff; }
.adm-links span { color: var(--ps-muted); font-size: 12.5px; }

.adm-users th a { color: inherit; }
.adm-users th a:hover { color: #fff; text-decoration: none; }
.adm-users td { vertical-align: middle; padding: 5px 5px; }
.adm-users th { padding: 6px 5px; letter-spacing: 0; }
.adm-num { width: 56px; background: var(--ps-card-2); border: 1px solid #333; color: var(--ps-text); border-radius: 3px; padding: 1px 4px; text-align: right; }
.adm-num-s { width: 40px; }
.adm-users .btn { background: var(--ps-card-2); border-color: #333; color: var(--ps-text); }
.adm-pages .pagination { margin: 14px 0 0; }
.adm-pages .pagination > li > a, .adm-pages .pagination > li > span { background: var(--ps-card-2); border-color: #2c2c2c; color: var(--ps-text); }
.adm-pages .pagination > .active > span { background: var(--ps-accent); border-color: var(--ps-accent); }

/* /user/profile */
.ps-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.ps-badges img { height: 40px; border-radius: 4px; }
.ps-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0 0 14px; font-size: 13.5px; }
.ps-dl dt { color: var(--ps-muted); font-weight: 400; }
.ps-dl dd { margin: 0; word-break: break-all; }
.ps-email label { color: var(--ps-muted); font-weight: 400; font-size: 13.5px; }
.ps-email-row { display: flex; gap: 8px; max-width: 420px; }
.ps-email-row .form-control { background: var(--ps-card-2); border-color: #333; color: var(--ps-text); }

/* failed Personal update (user.partials.queue-failed) */
.ps-chip-bad { background: rgba(224, 83, 63, .15); color: var(--ps-bad); }
.ps-failed { border-color: rgba(224, 83, 63, .55); }
.ps-failed h3 { font-size: 17px; margin: 0 0 8px; color: var(--ps-bad); }
.ps-failed p { margin: 0 0 6px; }
.ps-failed p:last-child { margin-bottom: 0; }

/* admin: hand-pick a player for the Personal worker (player header) */
.ps-admin-queue { margin-top: 6px; }
.ps-admin-queue .btn { background: var(--ps-card-2); border-color: #333; color: var(--ps-text); }

@media (max-width: 991px) {
	.ps-two, .ps-pool, .ps-two-even { grid-template-columns: 1fr; }
	.ps-status { text-align: left; }
}
@media (max-width: 600px) {
	.ps-search, .ps-search .form-control { width: 100%; }
	.ps-search { flex: 1 1 100%; }
	.ps-card { padding: 12px; }
	.ps-kpi-value { font-size: 22px; }
}
