:root {
	--player-bg: #f3f7fd;
	--player-card: rgba(255, 255, 255, 0.98);
	--player-border: #d9e4f4;
	--player-text: #10213a;
	--player-muted: #6d7f99;
	--player-primary: #2563eb;
	--player-success: #16a34a;
	--player-danger: #ef4444;
	--player-shadow: 0 12px 28px rgba(16, 33, 58, 0.07);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	min-height: 100%;
	margin: 0;
	padding: 0;
	max-width: 100%;
	overflow-x: hidden;
	font-family: Inter, Arial, sans-serif;
	background: var(--player-bg);
	color: var(--player-text);
}

body.player-profile-body {
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	background: var(--player-bg);
	color: var(--player-text);
}

.player-profile-page {
	flex: 1;
	min-height: 100vh;
	padding: 16px 10px 28px;
}

.player-profile-container {
	width: min(1320px, 100%);
	margin: 0 auto;
	display: grid;
	gap: 12px;
}

.player-profile-hero {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 14px;
	border-radius: 22px;
	background: linear-gradient(135deg, #2455d8 0%, #4d81ef 60%, #79a9ff 100%);
	color: #fff;
	box-shadow: var(--player-shadow);
}

.player-profile-hero__left {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.player-profile-avatar {
	width: 62px;
	height: 62px;
	border-radius: 18px;
	background: rgba(255, 255, 255, 0.16);
	border: 1px solid rgba(255, 255, 255, 0.22);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.05rem;
	font-weight: 900;
	flex: 0 0 auto;
}

.player-profile-badge {
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 0 10px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	font-size: 0.66rem;
	font-weight: 900;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.player-profile-hero h1 {
	margin: 8px 0 4px;
	font-size: 1.38rem;
	line-height: 1.05;
	font-weight: 900;
	overflow-wrap: anywhere;
}

.player-profile-hero p {
	margin: 0;
	color: rgba(255, 255, 255, 0.88);
	font-size: 0.82rem;
	line-height: 1.4;
}

.player-profile-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.player-btn {
	appearance: none;
	border: none;
	text-decoration: none;
	border-radius: 12px;
	min-height: 40px;
	padding: 0 14px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.76rem;
	font-weight: 900;
	text-align: center;
	transition:
		transform 0.18s ease,
		box-shadow 0.18s ease,
		opacity 0.18s ease;
}

.player-btn:hover {
	transform: translateY(-1px);
}

.player-btn--primary {
	background: #fff;
	color: #1f4eb6;
}

.player-btn--soft {
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	border: 1px solid rgba(255, 255, 255, 0.22);
}

.player-overview-grid {
	display: grid;
	gap: 12px;
}

.player-card {
	background: var(--player-card);
	border: 1px solid var(--player-border);
	border-radius: 20px;
	padding: 14px;
	box-shadow: var(--player-shadow);
	min-width: 0;
}

.section-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 12px;
}

.section-header h2 {
	margin: 0;
	font-size: 1rem;
	font-weight: 900;
}

.section-header p {
	margin: 3px 0 0;
	color: var(--player-muted);
	font-size: 0.74rem;
	line-height: 1.4;
}

.player-info-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin-bottom: 12px;
}

.player-info-grid > div,
.match-history-item__meta > div {
	background: #f7faff;
	border: 1px solid #dce8f7;
	border-radius: 14px;
	padding: 10px;
	min-width: 0;
}

.player-info-grid span,
.match-history-item__meta span,
.player-notes-box span,
.player-stat-box span {
	display: block;
	color: var(--player-muted);
	font-size: 0.62rem;
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.player-info-grid strong,
.match-history-item__meta strong,
.player-stat-box strong {
	font-size: 0.84rem;
	font-weight: 900;
	color: var(--player-text);
	overflow-wrap: anywhere;
}

.player-notes-box {
	background: #f7faff;
	border: 1px solid #dce8f7;
	border-radius: 16px;
	padding: 12px;
}

.player-notes-box div {
	color: var(--player-text);
	font-size: 0.78rem;
	line-height: 1.55;
}

.player-stats-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

.player-stats-grid--hero {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.player-stat-box {
	background: #f7faff;
	border: 1px solid #dce8f7;
	border-radius: 16px;
	padding: 12px;
	min-width: 0;
}

.player-stat-box strong {
	font-size: 1rem;
}

.player-empty {
	padding: 14px;
	border-radius: 14px;
	background: #f7faff;
	border: 1px dashed #cad9ee;
	color: var(--player-muted);
	font-size: 0.8rem;
}

.match-history-list {
	display: grid;
	gap: 12px;
}

.match-history-item {
	background: #fbfdff;
	border: 1px solid #dce8f7;
	border-radius: 18px;
	padding: 14px;
	box-shadow: 0 8px 18px rgba(16, 33, 58, 0.04);
}

.match-history-item__top {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 12px;
}

.match-history-item__top h3 {
	margin: 0;
	font-size: 0.94rem;
	font-weight: 900;
	overflow-wrap: anywhere;
}

.match-history-item__top p {
	margin: 4px 0 0;
	color: var(--player-muted);
	font-size: 0.72rem;
}

.match-result-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 0 12px;
	border-radius: 999px;
	font-size: 0.68rem;
	font-weight: 900;
	width: fit-content;
	background: #eef3fb;
	color: #45628e;
}

.match-result-pill.is-win {
	background: rgba(22, 163, 74, 0.14);
	color: var(--player-success);
}

.match-result-pill.is-loss {
	background: rgba(239, 68, 68, 0.14);
	color: var(--player-danger);
}

.match-scoreline {
	display: grid;
	gap: 8px;
	margin-bottom: 12px;
	padding: 12px;
	background: #f7faff;
	border: 1px solid #dce8f7;
	border-radius: 16px;
}

.match-scoreline strong {
	font-size: 1.15rem;
	font-weight: 900;
	color: #1f4eb6;
}

.match-set-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.match-set-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 30px;
	padding: 0 10px;
	border-radius: 999px;
	background: #edf4ff;
	border: 1px solid #d7e4fb;
	color: #355483;
	font-size: 0.7rem;
	font-weight: 900;
}

.match-history-item__meta {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
}

@media (min-width: 768px) {
	.player-profile-page {
		padding: 18px 14px 34px;
	}

	.player-profile-hero {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		padding: 18px;
	}

	.player-overview-grid {
		grid-template-columns: 1.05fr 0.95fr;
	}

	.player-stats-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.player-stats-grid--hero {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.match-history-item__top {
		flex-direction: row;
		justify-content: space-between;
		align-items: flex-start;
	}

	.match-history-item__meta {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (min-width: 1100px) {
	.player-profile-container {
		gap: 14px;
	}

	.player-card {
		padding: 16px;
	}

	.player-stats-grid {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.match-history-item__meta {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.player-profile-hero h1 {
		font-size: 1.18rem;
	}

	.player-profile-hero p {
		font-size: 0.76rem;
	}

	.player-info-grid,
	.match-history-item__meta,
	.player-stats-grid,
	.player-stats-grid--hero {
		grid-template-columns: 1fr;
	}

	.player-btn {
		width: 100%;
	}
}
@media (max-width: 768px) {
    .player-profile-page {
        padding: 8px !important;
    }

    .player-profile-container {
        max-width: 100% !important;
        padding: 0 !important;
        gap: 10px !important;
    }

    /* sekcje */
    .player-profile-card,
    .player-card,
    .profile-card,
    .stats-card,
    .balance-card,
    .matches-card {
        padding: 12px !important;
        border-radius: 16px !important;
    }

    /* 2 kafle obok siebie */
    .player-stats-grid,
    .stats-grid,
    .career-stats-grid,
    .player-balance-grid,
    .balance-grid,
    .player-info-grid {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }

    /* pojedynczy kafel */
    .player-stat-box,
    .stat-box,
    .player-stat,
    .balance-stat,
    .info-box {
        min-width: 0 !important;
        padding: 10px 10px !important;
        border-radius: 12px !important;
    }

    .player-stat-box .label,
    .stat-box .label,
    .player-stat-label,
    .stat-label,
    .info-label {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    .player-stat-box .value,
    .stat-box .value,
    .player-stat-value,
    .stat-value,
    .info-value {
        font-size: 20px !important;
        line-height: 1.1 !important;
        font-weight: 700 !important;
    }

    /* nagłówki sekcji */
    .player-profile-card h2,
    .player-profile-card h3,
    .player-card h2,
    .player-card h3,
    .stats-card h2,
    .stats-card h3 {
        font-size: 22px !important;
        margin-bottom: 6px !important;
    }

    .player-profile-card p,
    .player-card p,
    .stats-card p {
        font-size: 12px !important;
    }

    /* hero u góry */
    .player-profile-hero,
    .profile-hero,
    .player-header-card {
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .player-profile-hero h1,
    .profile-hero h1,
    .player-header-card h1 {
        font-size: 24px !important;
        line-height: 1.15 !important;
    }

    /* przyciski */
    .player-profile-actions,
    .profile-actions {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .player-profile-actions a,
    .player-profile-actions button,
    .profile-actions a,
    .profile-actions button {
        padding: 10px 12px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .player-stat-box .value,
    .stat-box .value,
    .player-stat-value,
    .stat-value,
    .info-value {
        font-size: 18px !important;
    }
}