/* Psyern Leaderboard — Shared Base Styles */

.psyern-lb {
	position: relative;
	width: 100%;
	max-width: 100%;
	margin: 0 auto;
	padding: 24px;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
	overflow: visible !important;
}

/* Hard-reset: block any WP-theme color leaking into table cells.
   Scoped selectors so theme-specific overrides (higher specificity) still win. */
.psyern-lb .psyern-lb__table th,
.psyern-lb .psyern-lb__table td {
	color: inherit;
	font-family: inherit;
}

.psyern-lb a,
.psyern-lb a:hover,
.psyern-lb a:visited {
	color: inherit;
	text-decoration: none;
}

/* Block WP-theme color overrides on common inline elements */
.psyern-lb span,
.psyern-lb p,
.psyern-lb div,
.psyern-lb label,
.psyern-lb strong,
.psyern-lb em {
	color: inherit;
}

/* Stronger table isolation against WP themes with body/entry-content scoped rules */
.psyern-lb .psyern-lb__table,
.psyern-lb .psyern-lb__table thead,
.psyern-lb .psyern-lb__table tbody,
.psyern-lb .psyern-lb__table tr {
	color: inherit;
	font-family: inherit;
}

/* Prevent WP themes from clipping the scroll container */
.psyern-lb,
.psyern-lb * {
	box-sizing: border-box;
}

/* ─── Header ─── */
.psyern-lb__header {
	margin-bottom: 20px;
	padding-bottom: 16px;
}

.psyern-lb__title {
	font-size: clamp(1.1rem, 3vw, 1.5rem);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 0 0 8px;
}

.psyern-lb__meta {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	font-size: 0.8rem;
	opacity: 0.7;
}

/* ─── Controls ─── */
.psyern-lb__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.psyern-lb__modes {
	display: flex;
	gap: 4px;
}

.psyern-lb__mode-btn {
	padding: 8px 20px;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	transition: all 0.2s;
	background: transparent;
}

.psyern-lb__limits {
	display: flex;
	gap: 4px;
}

.psyern-lb__limit-btn {
	padding: 4px 12px;
	border: 1px solid;
	border-radius: 3px;
	cursor: pointer;
	font-size: 0.75rem;
	font-weight: 600;
	background: transparent;
	transition: all 0.2s;
}

/* ─── Top 3 Section ─── */
.psyern-lb__top3 {
	display: grid !important;
	grid-template-columns: 1fr 1.2fr 1fr !important;
	gap: 10px !important;
	margin-bottom: 24px;
	align-items: end;
	width: 100%;
}

.psyern-lb__top3-card {
	text-align: center;
	padding: 16px 10px;
	border-radius: 8px;
	position: relative;
	transition: transform 0.3s;
	min-width: 0;
}

/* Platz 1 — Mitte, größer */
.psyern-lb__top3-card--1 {
	transform: scale(1.04);
	padding: 20px 12px;
}

/* Platz 3 — etwas kleiner */
.psyern-lb__top3-card--3 {
	opacity: 0.9;
}

.psyern-lb__top3-rank {
	font-size: 1.4rem;
	display: block;
	margin-bottom: 4px;
}

/* Avatar — abgestufte Größen: #1 groß, #2 mittel, #3 klein */
.psyern-lb__top3-avatar {
	border-radius: 50% !important;
	object-fit: cover;
	margin: 0 auto 6px;
	display: block;
	max-width: none;
}

.psyern-lb__top3-card--1 .psyern-lb__top3-avatar {
	width: 48px !important;
	height: 48px !important;
}

.psyern-lb__top3-card--2 .psyern-lb__top3-avatar {
	width: 40px !important;
	height: 40px !important;
}

.psyern-lb__top3-card--3 .psyern-lb__top3-avatar {
	width: 36px !important;
	height: 36px !important;
}

.psyern-lb__top3-name {
	font-weight: 700;
	font-size: 0.85rem;
	margin-bottom: 3px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.psyern-lb__top3-card--1 .psyern-lb__top3-name {
	font-size: 0.95rem;
}

.psyern-lb__top3-stats {
	font-size: 0.75rem;
	opacity: 0.8;
}

/* ─── Separator ─── */
.psyern-lb__separator {
	border: none;
	height: 1px;
	background: currentColor;
	opacity: 0.15;
	margin: 16px 0;
}

/* ─── Table Scroll Container ─── */
.psyern-lb__table-wrap {
	width: 100% !important;
	overflow-x: auto !important;
	overflow-y: visible !important;
	-webkit-overflow-scrolling: touch;
	border-radius: 4px;
	display: block !important;
}

/* Scroll shadow hints */
.psyern-lb__table-wrap {
	background:
		linear-gradient(to right, var(--psyern-bg, transparent) 30%, transparent),
		linear-gradient(to left, var(--psyern-bg, transparent) 30%, transparent),
		linear-gradient(to right, rgba(0,0,0,0.15), transparent 20px),
		linear-gradient(to left, rgba(0,0,0,0.15), transparent 20px);
	background-position: left center, right center, left center, right center;
	background-repeat: no-repeat;
	background-size: 40px 100%, 40px 100%, 20px 100%, 20px 100%;
	background-attachment: local, local, scroll, scroll;
}

/* ─── Table ─── */
.psyern-lb__table {
	width: max-content;
	min-width: 100%;
	border-collapse: separate;
	border-spacing: 0;
}

/* Always show scrollbar on desktop */
.psyern-lb__table-wrap {
	scrollbar-width: thin;
}
.psyern-lb__table-wrap::-webkit-scrollbar {
	height: 8px;
}
.psyern-lb__table-wrap::-webkit-scrollbar-track {
	background: rgba(255,255,255,0.05);
	border-radius: 4px;
}
.psyern-lb__table-wrap::-webkit-scrollbar-thumb {
	background: rgba(255,255,255,0.2);
	border-radius: 4px;
}
.psyern-lb__table-wrap::-webkit-scrollbar-thumb:hover {
	background: rgba(255,255,255,0.35);
}

/* ─── Sticky Columns: Rank (#) + Avatar + Name ─── */
.psyern-lb__table th:nth-child(1),
.psyern-lb__table td:nth-child(1),
.psyern-lb__table th:nth-child(2),
.psyern-lb__table td:nth-child(2),
.psyern-lb__table th:nth-child(3),
.psyern-lb__table td:nth-child(3) {
	position: sticky;
	z-index: 2;
	background: var(--psyern-bg, #0a0a0a);
}
.psyern-lb__table th:nth-child(1),
.psyern-lb__table td:nth-child(1) {
	left: 0;
}
.psyern-lb__table th:nth-child(2),
.psyern-lb__table td:nth-child(2) {
	left: 42px;
}
.psyern-lb__table th:nth-child(3),
.psyern-lb__table td:nth-child(3) {
	left: 78px;
}
/* Shadow on the sticky edge to indicate scrollable content */
.psyern-lb__table td:nth-child(3)::after,
.psyern-lb__table th:nth-child(3)::after {
	content: '';
	position: absolute;
	top: 0;
	right: -10px;
	bottom: 0;
	width: 10px;
	background: linear-gradient(to right, rgba(0,0,0,0.3), transparent);
	pointer-events: none;
}
.psyern-lb__table th:nth-child(1),
.psyern-lb__table th:nth-child(2),
.psyern-lb__table th:nth-child(3) {
	z-index: 3;
}
/* Hover row must also set background on sticky cells */
.psyern-lb__table tbody tr:hover td:nth-child(1),
.psyern-lb__table tbody tr:hover td:nth-child(2),
.psyern-lb__table tbody tr:hover td:nth-child(3) {
	background: color-mix(in srgb, var(--psyern-bg, #0a0a0a) 85%, white);
}

.psyern-lb__table th {
	text-align: left;
	padding: 10px 12px;
	font-weight: 600;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	white-space: nowrap;
	color: inherit;
}

.psyern-lb__table td {
	padding: 10px 12px;
	white-space: nowrap;
	color: inherit;
}

.psyern-lb__table tbody tr {
	transition: background 0.15s;
	animation: psyern-row-in 0.4s ease both;
}

/* ─── Sticky Columns: Rank + Avatar + Name ─── */
.psyern-lb__table th:nth-child(1),
.psyern-lb__table td:nth-child(1) {
	position: sticky;
	left: 0;
	z-index: 3;
	background: inherit;
}

.psyern-lb__table th:nth-child(2),
.psyern-lb__table td:nth-child(2) {
	position: sticky;
	left: 42px;
	z-index: 3;
	background: inherit;
}

.psyern-lb__table th:nth-child(3),
.psyern-lb__table td:nth-child(3) {
	position: sticky;
	left: 82px;
	z-index: 3;
	background: inherit;
	min-width: 120px;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Shadow edge on the sticky name column */
.psyern-lb__table th:nth-child(3)::after,
.psyern-lb__table td:nth-child(3)::after {
	content: '';
	position: absolute;
	top: 0;
	right: -8px;
	bottom: 0;
	width: 8px;
	background: linear-gradient(to right, rgba(0,0,0,0.08), transparent);
	pointer-events: none;
}

/* Inherit row background for sticky cells on hover */
.psyern-lb__table tbody tr:hover td:nth-child(1),
.psyern-lb__table tbody tr:hover td:nth-child(2),
.psyern-lb__table tbody tr:hover td:nth-child(3) {
	background: inherit;
}

/* Sticky header row */
.psyern-lb__table thead th {
	position: sticky;
	top: 0;
	z-index: 4;
	background: inherit;
}

/* ─── Faction Bar ─── */
.psyern-lb__faction-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
	font-size: 0.75rem;
	font-weight: 600;
}

.psyern-lb__faction-bar-track {
	flex: 1;
	height: 10px;
	border-radius: 5px;
	overflow: hidden;
	display: flex;
	background: rgba(128, 128, 128, 0.2);
}

.psyern-lb__faction-bar-east {
	background: #e74c3c;
	transition: width 0.6s ease;
}

.psyern-lb__faction-bar-west {
	background: #3498db;
	transition: width 0.6s ease;
}

.psyern-lb__faction-label-east {
	color: #e74c3c;
	white-space: nowrap;
}

.psyern-lb__faction-label-west {
	color: #3498db;
	white-space: nowrap;
}

/* ─── Faction Badge ─── */
.psyern-lb__faction {
	display: inline-block;
	padding: 1px 6px;
	border-radius: 3px;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	vertical-align: middle;
	margin-left: 6px;
}

.psyern-lb__faction--east {
	background: rgba(231, 76, 60, 0.15);
	color: #e74c3c;
	border: 1px solid rgba(231, 76, 60, 0.3);
}

.psyern-lb__faction--west {
	background: rgba(52, 152, 219, 0.15);
	color: #3498db;
	border: 1px solid rgba(52, 152, 219, 0.3);
}

.psyern-lb__faction--neutral {
	background: rgba(149, 165, 166, 0.15);
	color: #95a5a6;
	border: 1px solid rgba(149, 165, 166, 0.3);
}

/* ─── Level Badge ─── */
.psyern-lb__level {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	opacity: 0.7;
}

/* ─── Boss Kills / Reputation ─── */
.psyern-lb__boss-kills,
.psyern-lb__reputation {
	white-space: nowrap;
	font-size: 0.85rem;
}

.psyern-lb__boss-kills::before {
	content: none;
}

.psyern-lb__reputation::before {
	content: none;
}

/* ─── Search ─── */
.psyern-lb__search {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	/* Mobile: volle Breite in eigener Zeile */
	width: auto;
}

.psyern-lb__search-input {
	padding: 5px 10px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 3px;
	/* Explizit theme-konform: kein weißer Kasten */
	background: rgba(0, 0, 0, 0.35) !important;
	color: inherit !important;
	font-family: inherit;
	font-size: 0.8rem;
	width: 180px;
	transition: border-color 0.2s, background 0.2s;
	outline: none;
	/* iOS Safari: kein runder Input */
	-webkit-appearance: none;
	appearance: none;
}

.psyern-lb__search-input:focus {
	border-color: rgba(255, 255, 255, 0.55);
	background: rgba(0, 0, 0, 0.5) !important;
}

.psyern-lb__search-input::placeholder {
	opacity: 0.45;
	color: inherit;
}

/* Such-Button (mobil sichtbar) */
.psyern-lb__search-btn {
	display: none;
	padding: 5px 10px;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.08);
	color: inherit;
	font-size: 0.8rem;
	cursor: pointer;
	line-height: 1;
	transition: background 0.2s;
	white-space: nowrap;
}

.psyern-lb__search-btn:hover {
	background: rgba(255, 255, 255, 0.15);
}

/* ─── Pagination ─── */
.psyern-lb__pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 4px;
	margin-top: 16px;
	flex-wrap: wrap;
}

.psyern-lb__page-btn {
	padding: 6px 12px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	border-radius: 3px;
	background: transparent;
	color: rgba(255, 255, 255, 0.55) !important;
	font-family: inherit;
	font-size: 0.8rem;
	cursor: pointer;
	transition: opacity 0.15s, background 0.15s, border-color 0.15s, color 0.15s;
}

.psyern-lb__page-btn:hover:not([disabled]) {
	color: rgba(255, 255, 255, 0.9) !important;
	border-color: rgba(255, 255, 255, 0.5);
}

.psyern-lb__page-btn.active {
	color: #fff !important;
	border-color: rgba(255, 255, 255, 0.6);
	font-weight: 700;
	background: rgba(255, 255, 255, 0.08);
}

.psyern-lb__page-btn[disabled] {
	color: rgba(255, 255, 255, 0.2) !important;
	border-color: rgba(255, 255, 255, 0.1);
	cursor: default;
}

.psyern-lb__page-ellipsis {
	padding: 6px 4px;
	font-size: 0.8rem;
	opacity: 0.45;
	user-select: none;
}

/* ─── Online/Offline Badges ─── */
.psyern-lb__badge-online,
.psyern-lb__badge-offline {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
}

.psyern-lb__badge-online {
	background: #2ecc71;
}

.psyern-lb__badge-offline {
	background: #555;
}

/* ─── Rank Highlight Rows (JS-rendered) ─── */
.psyern-lb__rank-1 td:first-child,
.psyern-lb__rank-2 td:first-child,
.psyern-lb__rank-3 td:first-child {
	border-left: 3px solid transparent;
}

/* Map JS rank classes to theme selectors (themes use --1/--2/--3 on top3 cards) */
.psyern-lb.psyern-lb--military .psyern-lb__rank-1 td:first-child { border-left-color: #4ade80; }
.psyern-lb.psyern-lb--military .psyern-lb__rank-2 td:first-child { border-left-color: #3a7a3a; }
.psyern-lb.psyern-lb--military .psyern-lb__rank-3 td:first-child { border-left-color: #2a4a2a; }
.psyern-lb.psyern-lb--military .psyern-lb__badge-online { background: #4ade80; }
.psyern-lb.psyern-lb--military .psyern-lb__badge-offline { background: #2a4a2a; }

.psyern-lb.psyern-lb--ash .psyern-lb__rank-1 td:first-child { border-left-color: #c8392b; }
.psyern-lb.psyern-lb--ash .psyern-lb__rank-2 td:first-child { border-left-color: #d4a853; }
.psyern-lb.psyern-lb--ash .psyern-lb__rank-3 td:first-child { border-left-color: #3d3530; }
.psyern-lb.psyern-lb--ash .psyern-lb__badge-online { background: #52b788; }
.psyern-lb.psyern-lb--ash .psyern-lb__badge-offline { background: #3d3530; }

.psyern-lb.psyern-lb--ops .psyern-lb__rank-1 td:first-child { border-left-color: #4ade80; }
.psyern-lb.psyern-lb--ops .psyern-lb__rank-2 td:first-child { border-left-color: #2a8a4a; }
.psyern-lb.psyern-lb--ops .psyern-lb__rank-3 td:first-child { border-left-color: #0d3b0d; }
.psyern-lb.psyern-lb--ops .psyern-lb__badge-online { background: #4ade80; }
.psyern-lb.psyern-lb--ops .psyern-lb__badge-offline { background: #0d3b0d; }

.psyern-lb.psyern-lb--outbreak .psyern-lb__rank-1 td:first-child { border-left-color: #f59e0b; }
.psyern-lb.psyern-lb--outbreak .psyern-lb__rank-2 td:first-child { border-left-color: #a8621f; }
.psyern-lb.psyern-lb--outbreak .psyern-lb__rank-3 td:first-child { border-left-color: #78350f; }
.psyern-lb.psyern-lb--outbreak .psyern-lb__badge-online { background: #16a34a; }
.psyern-lb.psyern-lb--outbreak .psyern-lb__badge-offline { background: #78350f; }

.psyern-lb.psyern-lb--cyberpunk .psyern-lb__rank-1 td:first-child { border-left-color: #ff00ff; }
.psyern-lb.psyern-lb--cyberpunk .psyern-lb__rank-2 td:first-child { border-left-color: #00ffff; }
.psyern-lb.psyern-lb--cyberpunk .psyern-lb__rank-3 td:first-child { border-left-color: #00ff88; }
.psyern-lb.psyern-lb--cyberpunk .psyern-lb__badge-online { background: #00ff88; box-shadow: 0 0 6px rgba(0, 255, 136, 0.5); }
.psyern-lb.psyern-lb--cyberpunk .psyern-lb__badge-offline { background: #2a2a3a; }

.psyern-lb.psyern-lb--stalker .psyern-lb__rank-1 td:first-child { border-left-color: #ff8c00; }
.psyern-lb.psyern-lb--stalker .psyern-lb__rank-2 td:first-child { border-left-color: #ffcc00; }
.psyern-lb.psyern-lb--stalker .psyern-lb__rank-3 td:first-child { border-left-color: #8b7355; }
.psyern-lb.psyern-lb--stalker .psyern-lb__badge-online { background: #ff8c00; box-shadow: 0 0 4px rgba(255, 140, 0, 0.5); }
.psyern-lb.psyern-lb--stalker .psyern-lb__badge-offline { background: #2a2010; }

.psyern-lb.psyern-lb--inferno .psyern-lb__rank-1 td:first-child { border-left-color: #ff4500; }
.psyern-lb.psyern-lb--inferno .psyern-lb__rank-2 td:first-child { border-left-color: #ff8c00; }
.psyern-lb.psyern-lb--inferno .psyern-lb__rank-3 td:first-child { border-left-color: #ffc800; }
.psyern-lb.psyern-lb--inferno .psyern-lb__badge-online { background: #ff6a00; box-shadow: 0 0 6px rgba(255, 106, 0, 0.6); }
.psyern-lb.psyern-lb--inferno .psyern-lb__badge-offline { background: #2a1000; }

.psyern-lb.psyern-lb--frostbite .psyern-lb__rank-1 td:first-child { border-left-color: #5ba8e0; }
.psyern-lb.psyern-lb--frostbite .psyern-lb__rank-2 td:first-child { border-left-color: #a0d4ff; }
.psyern-lb.psyern-lb--frostbite .psyern-lb__rank-3 td:first-child { border-left-color: #3a6080; }
.psyern-lb.psyern-lb--frostbite .psyern-lb__badge-online { background: #5ba8e0; box-shadow: 0 0 6px rgba(91, 168, 224, 0.6); }
.psyern-lb.psyern-lb--frostbite .psyern-lb__badge-offline { background: #152540; }

.psyern-lb.psyern-lb--bubblegum .psyern-lb__rank-1 td:first-child { border-left-color: #ff69b4; }
.psyern-lb.psyern-lb--bubblegum .psyern-lb__rank-2 td:first-child { border-left-color: #ffb6da; }
.psyern-lb.psyern-lb--bubblegum .psyern-lb__rank-3 td:first-child { border-left-color: #d090b0; }
.psyern-lb.psyern-lb--bubblegum .psyern-lb__badge-online { background: #ff69b4; box-shadow: 0 0 6px rgba(255, 105, 180, 0.6); }
.psyern-lb.psyern-lb--bubblegum .psyern-lb__badge-offline { background: #2a1240; }

/* ─── Cell Styles ─── */
.psyern-lb__rank {
	font-weight: 700;
	min-width: 30px;
	display: inline-block;
}

.psyern-lb__avatar {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	object-fit: cover;
	vertical-align: middle;
}

.psyern-lb__name {
	font-weight: 600;
}

.psyern-lb__kd {
	font-weight: 700;
}

.psyern-lb__playtime {
	font-size: 0.8rem;
	opacity: 0.7;
}

/* ─── Accessibility ─── */

.psyern-lb__mode-btn:focus-visible,
.psyern-lb__limit-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.psyern-lb__table tbody tr:focus-within {
	outline: 1px solid currentColor;
	outline-offset: -1px;
}

.psyern-lb__sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ─── Animations ─── */
@keyframes psyern-row-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

.psyern-lb__table tbody tr:nth-child(1) { animation-delay: 0.05s; }
.psyern-lb__table tbody tr:nth-child(2) { animation-delay: 0.1s; }
.psyern-lb__table tbody tr:nth-child(3) { animation-delay: 0.15s; }
.psyern-lb__table tbody tr:nth-child(4) { animation-delay: 0.2s; }
.psyern-lb__table tbody tr:nth-child(5) { animation-delay: 0.25s; }
.psyern-lb__table tbody tr:nth-child(6) { animation-delay: 0.3s; }
.psyern-lb__table tbody tr:nth-child(7) { animation-delay: 0.35s; }
.psyern-lb__table tbody tr:nth-child(8) { animation-delay: 0.4s; }
.psyern-lb__table tbody tr:nth-child(9) { animation-delay: 0.45s; }
.psyern-lb__table tbody tr:nth-child(10) { animation-delay: 0.5s; }

/* ─── Loading / Error ─── */
.psyern-lb__loading {
	text-align: center;
	padding: 40px;
	font-size: 0.9rem;
	opacity: 0.6;
}

/* ─── Player Card (single view) ─── */

.psyern-lb__player-card {
	max-width: 480px;
	width: 100%;
	margin: 0 auto;
	text-align: center;
	box-sizing: border-box;
}

.psyern-lb__player-avatar {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
	margin: 0 auto 8px;
	display: block;
}

.psyern-lb__player-name {
	font-size: 1.2rem;
	font-weight: 700;
	margin: 8px 0;
	word-break: break-word;
}

.psyern-lb__player-status {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 4px;
}

.psyern-lb__player-status-label {
	font-size: 0.85rem;
}

/* Stats grid — 2 columns, collapses to 1 on narrow viewports */
.psyern-lb__player-stats-grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 8px;
	text-align: left;
	margin-top: 16px;
	width: 100%;
	box-sizing: border-box;
}

.psyern-lb__stat-item {
	padding: 6px 8px;
	min-width: 0;
}

.psyern-lb__stat-label {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.6;
	margin-bottom: 2px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.psyern-lb__stat-value {
	font-size: 1rem;
	font-weight: 700;
	word-break: break-word;
}

.psyern-lb__player-last-login {
	margin-top: 10px;
	font-size: 0.8rem;
	opacity: 0.7;
}

.psyern-lb__player-kills {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 12px;
	justify-content: center;
}

.psyern-lb__faction--sm {
	font-size: 0.7rem;
}

/* Server status card */
.psyern-lb__server-card {
	text-align: left;
	width: 100%;
	box-sizing: border-box;
}

.psyern-lb__server-name {
	font-size: 1.2rem;
	font-weight: 700;
	margin-bottom: 16px;
	word-break: break-word;
}

/* ─── Responsive ─── */

/* Tablet */
@media (max-width: 768px) {
	.psyern-lb {
		padding: 16px 12px;
	}

	/* Top 3 bleibt 3-spaltig auf Tablet — nur Padding kleiner */
	.psyern-lb__top3-card {
		padding: 12px 8px;
	}

	/* Player card avatar on tablet */
	.psyern-lb__player-avatar {
		width: 68px;
		height: 68px;
	}

	.psyern-lb__controls {
		flex-direction: column;
		align-items: flex-start;
	}

	/* Suche auf Tablet: volle Breite */
	.psyern-lb__search {
		width: 100%;
		margin-left: 0;
	}

	.psyern-lb__search-input {
		flex: 1;
		width: auto;
	}

	/* Adjust sticky offsets for smaller avatar column */
	.psyern-lb__table th:nth-child(2),
	.psyern-lb__table td:nth-child(2) {
		left: 36px;
	}

	.psyern-lb__table th:nth-child(3),
	.psyern-lb__table td:nth-child(3) {
		left: 66px;
		min-width: 100px;
		max-width: 140px;
	}
}

/* Mobile */
@media (max-width: 480px) {
	.psyern-lb {
		padding: 10px 8px;
		font-size: 12px;
	}

	.psyern-lb__title {
		font-size: 1rem;
	}

	.psyern-lb__mode-btn {
		padding: 6px 14px;
		font-size: 0.75rem;
	}

	/* Suche: volle Breite + Suchbutton sichtbar */
	.psyern-lb__search {
		width: 100%;
		margin-left: 0;
	}

	.psyern-lb__search-input {
		flex: 1;
		width: auto;
		font-size: 16px; /* Verhindert iOS-Zoom beim Fokus */
	}

	.psyern-lb__search-btn {
		display: inline-flex;
		align-items: center;
	}

	/* Top3: 1-spaltig, größere Cards + Avatare */
	.psyern-lb__top3 {
		grid-template-columns: 1fr !important;
		gap: 8px !important;
	}

	/* Player card: 1-spaltig auf Mobile, kleinerer Avatar */
	.psyern-lb__player-stats-grid {
		grid-template-columns: 1fr 1fr;
	}

	.psyern-lb__player-avatar {
		width: 60px;
		height: 60px;
	}

	.psyern-lb__player-name {
		font-size: 1rem;
	}

	.psyern-lb__top3-card--1 {
		transform: none;
		order: -1;
	}

	.psyern-lb__top3-card {
		padding: 14px 12px;
		display: flex;
		align-items: center;
		gap: 12px;
		text-align: left;
	}

	.psyern-lb__top3-rank {
		font-size: 1.2rem;
		flex-shrink: 0;
		margin-bottom: 0;
		min-width: 28px;
	}

	/* Avatare auf Mobile: einheitlich, nicht zu groß */
	.psyern-lb__top3-card--1 .psyern-lb__top3-avatar,
	.psyern-lb__top3-card--2 .psyern-lb__top3-avatar,
	.psyern-lb__top3-card--3 .psyern-lb__top3-avatar {
		width: 44px !important;
		height: 44px !important;
		flex-shrink: 0;
		margin: 0;
	}

	.psyern-lb__top3-info {
		flex: 1;
		min-width: 0;
	}

	.psyern-lb__top3-name {
		font-size: 0.9rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.psyern-lb__top3-card--1 .psyern-lb__top3-name {
		font-size: 1rem;
	}

	.psyern-lb__top3-stats {
		font-size: 0.8rem;
		opacity: 0.85;
		margin-top: 2px;
	}

	/* Tabelle auf Mobile */
	.psyern-lb__table th,
	.psyern-lb__table td {
		padding: 8px 6px;
		font-size: 0.75rem;
	}

	/* On very small screens, only pin rank + name (skip avatar) */
	.psyern-lb__table th:nth-child(2),
	.psyern-lb__table td:nth-child(2) {
		position: static;
	}

	.psyern-lb__table th:nth-child(3),
	.psyern-lb__table td:nth-child(3) {
		left: 36px;
		min-width: 80px;
		max-width: 110px;
		font-size: 0.7rem;
	}

	.psyern-lb__avatar {
		width: 22px;
		height: 22px;
	}
}

/* Very small screens (≤ 360px, e.g. iPhone SE) */
@media (max-width: 360px) {
	.psyern-lb__player-stats-grid {
		grid-template-columns: 1fr;
	}

	.psyern-lb__player-card {
		padding: 0 4px;
	}

	.psyern-lb__stat-value {
		font-size: 0.9rem;
	}
}

/* ─── WordPress Theme Override Protection ─── */

/* Force scroll on table-wrap regardless of WP theme overflow rules */
.entry-content .psyern-lb__table-wrap,
.post-content .psyern-lb__table-wrap,
.page-content .psyern-lb__table-wrap,
.elementor-widget-container .psyern-lb__table-wrap,
.wp-block-shortcode .psyern-lb__table-wrap,
.et_pb_text_inner .psyern-lb__table-wrap,
article .psyern-lb__table-wrap {
	overflow-x: auto !important;
	overflow-y: visible !important;
}

/* Prevent WP themes from breaking grid/images inside leaderboard */
.psyern-lb img {
	max-width: none;
}

.psyern-lb__avatar {
	width: 28px !important;
	height: 28px !important;
	border-radius: 50% !important;
	object-fit: cover;
	display: inline-block;
}

/* Reduced motion (WCAG 2.3.3) */
@media (prefers-reduced-motion: reduce) {
	.psyern-lb__table tbody tr {
		animation: none;
	}
	.psyern-lb__top3-card {
		transition: none;
	}
	.psyern-lb,
	.psyern-lb * {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}
