/* ===============================
   Design System (DS1)
   =============================== */
:root {
	/* Tokens (default: DARK) */
	--sp-bg: #0f172a;
	--sp-panel: #111827; /* legacy name (surface/card) */
	--sp-text: #e5e7eb;
	--sp-text-muted: #cbd5e1;
	--sp-accent: #7dd3fc;
	--sp-accent-2: #38bdf8;
	--sp-border: #1f2937;
	--sp-accent-contrast: #001b2b;

	/* Alias tokens (new theme system names) */
	--sp-background: var(--sp-bg);
	--sp-card: var(--sp-panel);
	--sp-muted-text: var(--sp-text-muted);

	--sp-radius: 12px;
	--sp-radius-sm: 8px;
	--sp-gap: 12px;
	--sp-gap-sm: 8px;
	--sp-font: 14px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Arial, "Apple Color Emoji","Segoe UI Emoji";
}

html[data-theme="dark"] {
	color-scheme: dark;
	--sp-bg: #0f172a;
	--sp-panel: #111827;
	--sp-text: #e5e7eb;
	--sp-text-muted: #cbd5e1;
	--sp-accent: #7dd3fc;
	--sp-accent-2: #38bdf8;
	--sp-border: #1f2937;
	--sp-accent-contrast: #001b2b;
}

html[data-theme="light"] {
	color-scheme: light;
	--sp-bg: #ffffff;
	--sp-panel: #f8fafc;
	--sp-text: #0f172a;
	--sp-text-muted: #334155;
	--sp-accent: #0369a1;
	--sp-accent-2: #0ea5e9;
	--sp-border: #e2e8f0;
	--sp-accent-contrast: #ffffff;
}

/* ===============================
   Reset & Base
   =============================== */
* { box-sizing: border-box; }
html, body {
	margin: 0;
	padding: 0;
	background: var(--sp-bg);
	background-color: var(--sp-bg);
	color: var(--sp-text);
	font: var(--sp-font);
}

a { color: var(--sp-accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono { font-variant-numeric: tabular-nums; }

/* Smooth theme transitions (minimal + scoped) */
html.sp-theme-ready body,
html.sp-theme-ready .sp-sidebar,
html.sp-theme-ready .sp-card,
html.sp-theme-ready .sp-nav,
html.sp-theme-ready input,
html.sp-theme-ready select,
html.sp-theme-ready .sp-side__collapse,
html.sp-theme-ready .sp-side__link,
html.sp-theme-ready .sp-btn--ghost {
	transition:
		background-color .18s ease,
		color .18s ease,
		border-color .18s ease,
		box-shadow .18s ease;
}

/* ===============================
   Components
   =============================== */
.sp-container { max-width: 1140px; margin: 0 auto; padding: 16px; }

.sp-card {
	background: var(--sp-panel);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	overflow: hidden;
}
.sp-card__header {
	padding: 10px 12px;
	font-weight: 700;
	color: var(--sp-accent);
	background: color-mix(in srgb, var(--sp-bg) 80%, black 0%);
	border-bottom: 1px solid var(--sp-border);
}

.sp-row { display: flex; gap: var(--sp-gap); align-items: center; }

.sp-loading { display: inline-flex; gap: 8px; align-items: center; color: var(--sp-text-muted); }
.sp-spinner {
	width: 14px;
	height: 14px;
	border-radius: 999px;
	border: 2px solid color-mix(in srgb, var(--sp-text-muted) 30%, transparent);
	border-top-color: var(--sp-accent-2);
	animation: sp-spin .8s linear infinite;
}
@keyframes sp-spin {
	to { transform: rotate(360deg); }
}

.sp-btn {
	height: 36px;
	padding: 0 14px;
	border-radius: var(--sp-radius-sm);
	border: 1px solid transparent;
	color: var(--sp-accent-contrast);
	background: linear-gradient(90deg, var(--sp-accent), var(--sp-accent-2));
	font-weight: 700;
	cursor: pointer;
}
.sp-btn:disabled { opacity: .6; cursor: not-allowed; }

.sp-table { width: 100%; border-collapse: collapse; }
.sp-table thead th {
	text-align: left;
	font-size: 12px;
	color: var(--sp-text-muted);
	padding: 8px 12px;
	border-bottom: 1px solid var(--sp-border);
}
.sp-table tbody td {
	padding: 10px 12px;
	border-top: 1px solid var(--sp-border);
	color: var(--sp-text);
}
.sp-table tbody tr:nth-child(odd) td {
	background: color-mix(in srgb, var(--sp-accent) 8%, transparent);
}

.sp-kv {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 4px 16px;
	padding: 12px;
}
.sp-kv__label { color: var(--sp-text-muted); text-align: left; padding-left: 8px; }
.sp-kv__value { color: var(--sp-text); text-align: right; padding-right: 12px; }

.sp-team { display: flex; gap: 8px; align-items: center; }
.sp-team img { width: 36px; height: 36px; object-fit: contain; }

/* ===============================
   Navigation
   =============================== */
.sp-nav {
	display: flex;
	gap: var(--sp-gap);
	margin-bottom: 16px;
}
.sp-nav__tab {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 36px;
	padding: 0 14px;
	border-radius: var(--sp-radius-sm);
	border: 1px solid var(--sp-border);
	background: color-mix(in srgb, var(--sp-panel) 92%, transparent);
	color: var(--sp-text);
	font-weight: 700;
	cursor: pointer;
	transition: background .15s ease, border-color .15s ease;
}
.sp-nav__tab:hover {
	text-decoration: none;
	background: color-mix(in srgb, var(--sp-accent) 10%, var(--sp-panel));
	border-color: color-mix(in srgb, var(--sp-accent) 35%, var(--sp-border));
}
.sp-nav__tab.is-active {
	color: var(--sp-accent-contrast);
	background: linear-gradient(90deg, var(--sp-accent), var(--sp-accent-2));
	border-color: transparent;
	cursor: default;
	pointer-events: none;
}

/* ===============================
   Shell Layout (Sidebar)
   =============================== */
.sp-shell {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	min-height: 100vh;
}
.sp-shell__main {
	min-width: 0;
}

.sp-sidebar {
	position: sticky;
	top: 0;
	height: 100vh;
	width: 260px;
	padding: 10px;
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--sp-panel) 86%, transparent), transparent);
	border-right: 1px solid var(--sp-border);
	overflow: auto;
}
.sp-sidebar.is-collapsed {
	width: 72px;
}

.sp-sidebar__top {
	display: flex;
	gap: 10px;
	align-items: center;
	margin-bottom: 10px;
}
.sp-sidebar__brand {
	font-weight: 800;
	color: var(--sp-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sp-side__collapse {
	width: 36px;
	height: 36px;
	border-radius: var(--sp-radius-sm);
	border: 1px solid var(--sp-border);
	background: color-mix(in srgb, var(--sp-panel) 92%, transparent);
	color: var(--sp-text);
	cursor: pointer;
	display: inline-grid;
	place-items: center;
}
.sp-side__collapse:focus-visible {
	box-shadow: var(--sp-focus);
	outline: none;
}

.sp-side__nav {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 6px 0;
}
.sp-side__link {
	display: grid;
	grid-template-columns: 24px 1fr;
	gap: 10px;
	align-items: center;
	padding: 10px 12px;
	border-radius: var(--sp-radius-sm);
	border: 1px solid transparent;
	color: var(--sp-text);
	background: transparent;
	font-weight: 700;
	text-decoration: none;
}
.sp-side__link:hover {
	text-decoration: none;
	background: color-mix(in srgb, var(--sp-accent) 10%, var(--sp-panel));
	border-color: color-mix(in srgb, var(--sp-accent) 35%, var(--sp-border));
}
.sp-side__link:focus-visible {
	box-shadow: var(--sp-focus);
	outline: none;
}
.sp-side__link.is-active {
	color: var(--sp-accent-contrast);
	background: linear-gradient(90deg, var(--sp-accent), var(--sp-accent-2));
	border-color: transparent;
}
.sp-side__icon {
	width: 24px;
	height: 24px;
	display: grid;
	place-items: center;
	font-size: 16px;
	line-height: 1;
}
.sp-side__label {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sp-sidebar.is-collapsed .sp-sidebar__brand {
	display: none;
}
.sp-sidebar.is-collapsed .sp-side__link {
	grid-template-columns: 24px;
	justify-items: center;
	padding: 10px;
}
.sp-sidebar.is-collapsed .sp-side__label {
	display: none;
}

.sp-sidebar__bottom {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--sp-border);
}
.sp-side__themeBtn {
	width: 100%;
	text-align: left;
	cursor: pointer;
}
.sp-side__themeBtn:focus-visible {
	box-shadow: var(--sp-focus);
	outline: none;
}
.sp-side__auth {
	display: grid;
	gap: 8px;
}
.sp-side__authBtn {
	width: 100%;
	justify-content: center;
}
.sp-side__user {
	display: flex;
	justify-content: center;
}

@media (max-width: 860px) {
	.sp-shell {
		grid-template-columns: minmax(0, 1fr);
	}
	.sp-sidebar {
		position: static;
		height: auto;
		border-right: none;
		border-bottom: 1px solid var(--sp-border);
	}
}

/* ===============================
   Landing Hero
   =============================== */
.landing-hero {
	min-height: calc(100vh - 120px);
	display: grid;
	place-items: center;
	align-content: center;
	gap: 24px;
	text-align: center;
}
.landing-title {
	font-size: clamp(28px, 6vw, 54px);
	line-height: 1.1;
	margin: 0;
	color: var(--sp-text);
	text-shadow: 0 2px 24px color-mix(in srgb, var(--sp-accent) 25%, transparent);
}
.landing-illustration img {
	width: min(60vw, 360px);
	height: auto;
	display: block;
	margin: 0 auto;
	filter: drop-shadow(0 12px 40px color-mix(in srgb, var(--sp-accent-2) 25%, transparent));
	user-select: none;
}

/* ===============================
   Player Compare Page
   =============================== */
.player-compare-page { margin-top: 16px; }
.player-compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 860px) {
	.player-compare-grid { grid-template-columns: 1fr; }
}
.player-column { display: flex; flex-direction: column; gap: 12px; }
.player-filter-row label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; }

/* Micro UX hints + selection affordances (scoped, no behavior changes) */
.sp-micro-hint {
	font-size: 12px;
	line-height: 1.2;
	margin-top: 6px;
	opacity: 0.85;
	color: var(--sp-text-muted);
}
.sp-name-link,
a.team-link {
	cursor: pointer;
	text-decoration: none;
	text-underline-offset: 2px;
	text-decoration-thickness: 1px;
	text-decoration-color: color-mix(in srgb, var(--sp-text) 35%, transparent);
}
.sp-name-link:hover,
a.team-link:hover {
	text-decoration: underline;
}

.sp-compare-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}
.sp-compare-row__left {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}
.sp-compare-row__right {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}
.sp-compare-badge,
.sp-selected-badge {
	display: inline-flex;
	align-items: center;
	white-space: nowrap;
	font-size: 11px;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 999px;
	border: 1px solid var(--sp-border);
	background: color-mix(in srgb, var(--sp-panel) 92%, transparent);
	color: var(--sp-text-muted);
	user-select: none;
}
.sp-selected-badge {
	display: none;
	border-color: color-mix(in srgb, var(--sp-accent-2) 55%, var(--sp-border));
	background: color-mix(in srgb, var(--sp-accent) 18%, var(--sp-panel));
	color: var(--sp-text);
}

.sp-compare-table tbody tr td { transition: background 120ms ease, box-shadow 120ms ease; }
.sp-compare-table tbody tr:not(.is-disabled) { cursor: pointer; }
.sp-compare-table tbody tr:not(.is-disabled):hover td {
	background: color-mix(in srgb, var(--sp-accent) 8%, var(--sp-panel));
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--sp-accent) 16%, var(--sp-border));
}
.sp-compare-table tbody tr.is-selected .sp-compare-badge { display: none; }
.sp-compare-table tbody tr.is-selected .sp-selected-badge { display: inline-flex; }

.sp-table tbody tr.is-selected td {
	outline: 2px solid var(--sp-accent-2);
	background: color-mix(in srgb, var(--sp-accent) 15%, var(--sp-panel));
}
.sp-table tbody tr.is-disabled td { opacity: .6; cursor: not-allowed; }

/* Explicit compare selection (checkbox-only) */
.sp-compare-table tbody tr:not(.is-disabled) { cursor: default; }
.sp-compare-row { position: relative; padding-right: 30px; }
.sp-compare-checkbox {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: var(--sp-accent-2);
}

/* Group card selection highlight */
.group.sp-card.is-selected {
    outline: 2px solid var(--sp-accent-2);
    box-shadow: 0 8px 26px color-mix(in srgb, var(--sp-accent-2) 20%, transparent);
    border-color: color-mix(in srgb, var(--sp-accent-2) 45%, var(--sp-border));
}
.group.sp-card.is-selected .sp-card__header {
    color: var(--sp-accent-contrast);
    background: linear-gradient(90deg, var(--sp-accent), var(--sp-accent-2));
    border-bottom-color: transparent;
}

/* Score bubbles */
.score-bubbles {
	display: flex;
	gap: 12px;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	margin: 8px 0 12px;
}
.score-bubble {
	display: grid;
	place-items: center;
	border-radius: 999px;
	font-weight: 800;
	line-height: 1;
	border: 1px solid var(--sp-border);
	user-select: none;
}
.score-bubble--lg { width: 96px; height: 96px; font-size: 22px; }
.score-bubble--md { width: 72px; height: 72px; font-size: 18px; }
.score-bubble--sm { width: 56px; height: 56px; font-size: 16px; }
.score-bubble--primary {
	color: var(--sp-accent-contrast);
	background: linear-gradient(135deg, color-mix(in srgb, var(--sp-accent) 85%, white 0%), var(--sp-accent-2));
	box-shadow: 0 6px 18px color-mix(in srgb, var(--sp-accent-2) 25%, transparent);
}
.score-bubble--secondary {
	color: var(--sp-text);
	background: color-mix(in srgb, var(--sp-accent) 10%, var(--sp-panel));
}
.score-bubble--neutral {
	color: var(--sp-text);
	background: color-mix(in srgb, var(--sp-text) 6%, var(--sp-panel));
}

/* Confidence meter */
.confidence-meter {
	margin-top: 12px;
	padding: 8px 10px 12px;
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius-sm);
	background: color-mix(in srgb, var(--sp-panel) 95%, transparent);
}
.confidence-meter__labels {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 12px;
	color: var(--sp-text-muted);
	margin-bottom: 6px;
}
.confidence-meter__bar {
	position: relative;
	height: 14px;
	border-radius: 999px;
	background: linear-gradient(90deg, #ef4444, #f59e0b 50%, #22c55e);
	overflow: hidden;
	border: 1px solid var(--sp-border);
}
.confidence-meter__pointer {
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 10px;
	height: 20px;
	border-radius: 2px;
	background: #e5e7eb;
	box-shadow: 0 0 0 2px rgba(0,0,0,.15);
}
.confidence-meter__percent {
	margin-top: 6px;
	text-align: center;
	font-size: 12px;
	color: var(--sp-text-muted);
}

/* Buttons variants */
.sp-btn--sm { height: 30px; padding: 0 10px; font-size: 12px; }
.sp-btn--ghost {
	background: transparent;
	color: var(--sp-text);
	border-color: var(--sp-border);
}
.sp-btn--ghost:hover {
	background: color-mix(in srgb, var(--sp-accent) 10%, var(--sp-panel));
}
.sp-btn--block-sm { width: auto; }
@media (max-width: 640px) {
	.sp-btn--block-sm { width: 100%; }
}

/* Favorite star button (used inside ClickableRow; must be clearly visible in both themes) */
.fav-star {
	display: inline-grid;
	place-items: center;
	line-height: 1;
	user-select: none;
	cursor: pointer;
	border-radius: 999px;
	border: 1px solid var(--sp-border);
	background: transparent;
	color: var(--sp-text);
	transition: background-color .15s ease, border-color .15s ease, transform .12s ease, filter .15s ease;
}
.fav-star:hover { transform: translateY(-1px); }
.fav-star:active { transform: translateY(0); }
.fav-star:focus-visible {
	box-shadow: var(--sp-focus);
	outline: none;
}
.fav-star:disabled {
	opacity: .6;
	cursor: not-allowed;
	transform: none;
}
.fav-star--sm { width: 32px; height: 32px; font-size: 16px; }
.fav-star--xs { width: 24px; height: 24px; font-size: 14px; }

.fav-star--inactive {
	background: transparent;
	border-color: var(--sp-border);
	color: color-mix(in srgb, var(--sp-text-muted) 92%, var(--sp-text));
}
.fav-star--inactive:hover {
	background: color-mix(in srgb, var(--sp-accent) 10%, var(--sp-panel));
	border-color: color-mix(in srgb, var(--sp-accent) 35%, var(--sp-border));
	color: var(--sp-text);
}

/* Use an explicit gold tone to guarantee contrast in dark mode */
.fav-star--active {
	color: #fbbf24;
	background: color-mix(in srgb, #fbbf24 18%, var(--sp-panel));
	border-color: color-mix(in srgb, #fbbf24 60%, var(--sp-border));
	box-shadow: 0 6px 18px color-mix(in srgb, #fbbf24 18%, transparent);
}
.fav-star--active:hover {
	background: color-mix(in srgb, #fbbf24 26%, var(--sp-panel));
	border-color: color-mix(in srgb, #fbbf24 72%, var(--sp-border));
	filter: brightness(1.05);
}

/* Modal */
.sp-modal {
	position: fixed;
	inset: 0;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 1000;
}
.sp-modal.is-open { display: flex; }
.sp-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.5);
}
.sp-modal__dialog {
	position: relative;
	max-width: 520px;
	width: 100%;
	background: var(--sp-panel);
	border: 1px solid var(--sp-border);
	border-radius: var(--sp-radius);
	box-shadow: 0 12px 40px rgba(0,0,0,.35);
	overflow: hidden;
	max-height: 80vh;
	display: flex;
	flex-direction: column;
}
.sp-modal__header {
	padding: 10px 12px;
	font-weight: 700;
	color: var(--sp-accent);
	background: color-mix(in srgb, var(--sp-bg) 80%, black 0%);
	border-bottom: 1px solid var(--sp-border);
}
.sp-modal__body { padding: 12px; flex: 1; overflow: auto; }
.sp-modal__footer { padding: 10px 12px; border-top: 1px solid var(--sp-border); display: flex; justify-content: flex-end; gap: 8px; }

/* ===============================
   Footer
   =============================== */
.sp-footer {
	padding: 16px;
	border-top: 1px solid var(--sp-border);
	margin-top: 24px;
	background: color-mix(in srgb, var(--sp-panel) 95%, transparent);
}
.sp-footer__text {
	margin: 0;
	text-align: center;
	color: var(--sp-text-muted);
	font-size: 12px;
}

/* ===============================
   Visual Upgrades (Alive/Modern)
   =============================== */

/* Tokens (additions) */
:root {
	--sp-shadow-sm: 0 2px 10px rgba(0,0,0,.18);
	--sp-shadow-md: 0 8px 26px rgba(0,0,0,.28);
	--sp-shadow-lg: 0 12px 40px rgba(0,0,0,.36);
	--sp-focus: 0 0 0 3px color-mix(in srgb, var(--sp-accent-2) 45%, transparent);
}
html[data-theme="light"] {
	--sp-shadow-sm: 0 2px 10px rgba(0,0,0,.08);
	--sp-shadow-md: 0 8px 26px rgba(0,0,0,.12);
	--sp-shadow-lg: 0 12px 40px rgba(0,0,0,.16);
}

/* Typography scale */
h1, .h1 { font-size: clamp(22px, 4.5vw, 34px); line-height: 1.15; margin: 0 0 8px; letter-spacing: .2px; }
h2, .h2 { font-size: clamp(18px, 3.5vw, 24px); line-height: 1.2; margin: 0 0 8px; letter-spacing: .2px; }
h3, .h3 { font-size: clamp(16px, 3vw, 20px); line-height: 1.25; margin: 0 0 6px; }
p { margin: 0 0 10px; color: var(--sp-text); }
small, .text-muted { color: var(--sp-text-muted); }

/* Inputs */
input, select {
	height: 36px;
	padding: 0 10px;
	border-radius: var(--sp-radius-sm);
	border: 1px solid var(--sp-border);
	background: color-mix(in srgb, var(--sp-panel) 94%, transparent);
	color: var(--sp-text);
	outline: none;
	transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease;
}
input:focus-visible, select:focus-visible, .sp-btn:focus-visible {
	box-shadow: var(--sp-focus);
	border-color: color-mix(in srgb, var(--sp-accent-2) 40%, var(--sp-border));
}
label { color: var(--sp-text-muted); font-size: 12px; }
label > input, label > select { margin-top: 4px; }

/* Status text */
.status { color: var(--sp-text-muted); font-size: 12px; margin-left: 8px; opacity: .9; transition: opacity .25s ease; }

/* Cards: depth + hover lift */
.sp-card {
	box-shadow: var(--sp-shadow-sm);
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease;
}
.sp-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--sp-shadow-md);
}
.sp-card__header {
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--sp-accent) 18%, transparent), transparent),
		color-mix(in srgb, var(--sp-bg) 80%, black 0%);
}

/* Navigation: sticky, glassy */
.sp-nav {
	position: sticky;
	top: 0;
	z-index: 20;
	padding: 8px 12px;
	margin: 0 0 16px;
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--sp-panel) 80%, transparent), transparent);
	backdrop-filter: blur(6px);
	border-bottom: 1px solid var(--sp-border);
	box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.sp-nav__tab {
	transition: color .15s ease, background .2s ease, border-color .2s ease, transform .15s ease;
}
.sp-nav__tab:hover {
	transform: translateY(-1px);
}

/* Buttons: polish */
.sp-btn {
	box-shadow: inset 0 -2px 0 rgba(0,0,0,.15), 0 6px 18px color-mix(in srgb, var(--sp-accent-2) 20%, transparent);
	transition: transform .15s ease, box-shadow .2s ease, filter .2s ease, background-position .2s ease;
	background-size: 200% 100%;
	background-position: 0% 0%;
}
.sp-btn:hover {
	transform: translateY(-1px);
	box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 10px 24px color-mix(in srgb, var(--sp-accent-2) 28%, transparent);
	background-position: 100% 0%;
}
.sp-btn:active {
	transform: translateY(0);
	box-shadow: inset 0 1px 0 rgba(0,0,0,.2);
}
.sp-btn--ghost {
	box-shadow: none;
}

/* Tables: hover highlight */
.sp-table tbody tr { transition: background .2s ease, outline-color .2s ease; }
.sp-table tbody tr:hover td {
	background: color-mix(in srgb, var(--sp-accent) 12%, var(--sp-panel));
}

/* Score bubbles: bounce-in + gentle hover */
@keyframes sp-bubble-in {
	0% { transform: scale(.6) translateY(6px); opacity: 0; }
	60% { transform: scale(1.06) translateY(0); opacity: 1; }
	100% { transform: scale(1) translateY(0); opacity: 1; }
}
.score-bubble {
	animation: sp-bubble-in .5s cubic-bezier(.2,.7,.2,1) both;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.score-bubble:hover { transform: translateY(-2px) scale(1.02); }
.score-bubble--primary { box-shadow: 0 10px 28px color-mix(in srgb, var(--sp-accent-2) 30%, transparent); }

/* Confidence meter: animated pointer */
.confidence-meter__pointer {
	transition: left .6s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, transform .3s ease;
}
.confidence-meter__pointer:hover { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(255,255,255,.08), 0 0 0 5px rgba(0,0,0,.06); }

/* Modal: fade & rise */
@keyframes sp-fade {
	from { opacity: 0; } to { opacity: 1; }
}
@keyframes sp-rise {
	from { transform: translateY(8px); opacity: .92; }
	to { transform: translateY(0); opacity: 1; }
}
.sp-modal.is-open .sp-modal__backdrop { animation: sp-fade .25s ease both; }
.sp-modal.is-open .sp-modal__dialog { animation: sp-rise .28s ease both; box-shadow: var(--sp-shadow-lg); }

/* Page mount: subtle fade+slide */
@keyframes sp-mount {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}
.sp-container, main, .player-compare-page, .landing-hero {
	animation: sp-mount .35s ease-out both;
}

/* Landing: floating illustration */
@keyframes sp-float {
	0% { transform: translateY(0); }
	50% { transform: translateY(-6px); }
	100% { transform: translateY(0); }
}
.landing-illustration img {
	animation: sp-float 5s ease-in-out infinite;
}

/* Touch targets */
@media (hover: none) and (pointer: coarse) {
	.sp-btn, .sp-nav__tab { height: 42px; padding: 0 18px; }
	input, select { height: 42px; }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: .001ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .001ms !important;
		scroll-behavior: auto !important;
	}
}

/* ===============================
   Landing Page Sections
   =============================== */
.landing-page {
	position: relative;
	display: grid;
	gap: 24px;
}
.landing-page::before {
	content: "";
	position: fixed;
	inset: 0;
	z-index: -2;
	background:
		radial-gradient(60% 40% at 20% 10%, color-mix(in srgb, var(--sp-accent-2) 14%, transparent), transparent 60%),
		radial-gradient(40% 30% at 80% 20%, color-mix(in srgb, var(--sp-accent) 12%, transparent), transparent 60%),
		linear-gradient(120deg, color-mix(in srgb, var(--sp-bg) 88%, black 0%), color-mix(in srgb, var(--sp-bg) 92%, black 0%));
	animation: sp-bg-shift 18s ease-in-out infinite alternate;
}
.landing-page::after {
	/* subtle diagonal lines */
	content: "";
	position: fixed;
	inset: 0;
	z-index: -1;
	background-image:
		repeating-linear-gradient(135deg, rgba(255,255,255,.03) 0px, rgba(255,255,255,.03) 1px, transparent 1px, transparent 14px);
	pointer-events: none;
}
@keyframes sp-bg-shift {
	0% { filter: hue-rotate(0deg) brightness(1); }
	100% { filter: hue-rotate(-8deg) brightness(1.02); }
}

/* Hero */
.hero {
	min-height: calc(100vh - 160px);
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	align-items: center;
	gap: 24px;
	position: relative;
}
.hero__content { padding: 8px; }
.hero__title {
	font-size: clamp(30px, 6.2vw, 56px);
	line-height: 1.05;
	margin: 0 0 10px;
	text-shadow: 0 2px 24px color-mix(in srgb, var(--sp-accent) 25%, transparent);
}
.hero__subtitle {
	margin: 0 0 16px;
	color: var(--sp-text-muted);
	font-size: clamp(14px, 2.8vw, 18px);
}
.hero__actions { display: flex; gap: 12px; align-items: center; }
.hero__cta { font-size: 15px; }
.hero__visual {
	position: relative;
	aspect-ratio: 1 / 1;
	max-width: min(64vw, 420px);
	justify-self: center;
}
.hero__glow {
	position: absolute;
	inset: 6% 6% 10% 6%;
	border-radius: 50%;
	background:
		radial-gradient(50% 50% at 50% 50%, color-mix(in srgb, var(--sp-accent-2) 28%, transparent), transparent 60%);
	filter: blur(22px);
	z-index: 0;
	opacity: .9;
}
.hero__ball {
	position: relative;
	z-index: 1;
	width: 100%;
	height: auto;
	display: block;
	filter: drop-shadow(0 14px 44px color-mix(in srgb, var(--sp-accent-2) 28%, transparent));
	animation: sp-float 6s ease-in-out infinite;
	user-select: none;
}
@media (max-width: 860px) {
	.hero {
		grid-template-columns: 1fr;
		min-height: auto;
		padding-top: 12px;
	}
	.hero__visual {
		max-width: min(72vw, 360px);
	}
}

/* Feature cards grid */
.features {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}
@media (max-width: 1024px) {
	.features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
	.features { grid-template-columns: 1fr; }
}
.feature-card {
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 12px;
	align-items: center;
	padding: 14px;
	border-radius: var(--sp-radius);
	border: 1px solid color-mix(in srgb, var(--sp-accent) 20%, var(--sp-border));
	background:
		linear-gradient(180deg, color-mix(in srgb, var(--sp-panel) 90%, transparent), color-mix(in srgb, var(--sp-panel) 96%, transparent));
	backdrop-filter: blur(6px);
	box-shadow: var(--sp-shadow-sm);
	color: inherit;
	text-decoration: none;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease, background .25s ease, filter .25s ease;
}
.feature-card:hover {
	transform: translateY(-2px) scale(1.01);
	box-shadow: var(--sp-shadow-md);
	border-color: color-mix(in srgb, var(--sp-accent-2) 36%, var(--sp-border));
	text-decoration: none;
}
.feature-card__icon {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	border-radius: 10px;
	color: var(--sp-accent-2);
	background: color-mix(in srgb, var(--sp-accent) 10%, transparent);
	border: 1px solid color-mix(in srgb, var(--sp-accent-2) 24%, var(--sp-border));
	box-shadow: inset 0 -1px 0 rgba(0,0,0,.18);
}
.feature-card__body {
	/* Home/Landing cards don't currently render an icon column; ensure content uses full width */
	grid-column: 1 / -1;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}
.feature-card__body p {
	color: var(--sp-text-muted);
	line-height: 1.45;
	max-width: 42ch; /* comfortable read length on desktop; still wraps naturally */
	white-space: normal;
}

/* Start Here */
.start-here { margin-top: 8px; }
.start-here__body { padding: 12px; }
.start-list {
	margin: 10px 0 0;
	padding-left: 18px;
}
.start-list li { margin: 6px 0; }

/* ===============================
   Injuries UI
   =============================== */
.injury-chip {
	margin-top: 6px;
	font-size: 0.85rem;
	padding: 4px 8px;
	border-radius: 999px;
	display: inline-block;
	white-space: nowrap;
}
.injury-chip--injured {
	background: #ffe5e5;
	color: #b00020;
	border: 1px solid #ffb3b3;
}
.injury-chip--fit {
	background: #e6f7e6;
	color: #137333;
	border: 1px solid #b3e6b3;
}

.injury-section {
	margin-top: 16px;
}
.injury-section h3 {
	margin: 0 0 8px;
	font-size: 1rem;
}
.injury-status {
	padding: 8px 10px;
	border-radius: 8px;
	font-size: 0.9rem;
}
.injury-status--fit {
	background: #e6f7e6;
	color: #137333;
	border: 1px solid #b3e6b3;
}
.injury-card {
	padding: 10px 12px;
	border-radius: var(--sp-radius-sm);
	background: var(--sp-panel);
	color: var(--sp-text);
	border: 1px solid var(--sp-border);
	font-size: 0.9rem;
}
.injury-card + .injury-card {
	margin-top: 8px;
}
.injury-card__header {
	display: flex;
	align-items: center;
	margin-bottom: 6px;
	font-weight: 600;
}
.injury-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #b00020;
	margin-right: 6px;
}
.injury-card__row {
	display: flex;
	gap: 4px;
	margin-top: 2px;
}
.injury-card__field {
	font-weight: 500;
}
.injury-card__value {
	opacity: 1;
}

/* ===============================
   Ad/Banner styles
   =============================== */
.ad-banner-slot {
	width: 100%;
	margin: 0 0 20px;
}
.banner-container {
	width: 100%;
	display: flex;
	justify-content: center;
	margin: 0 auto;
}
.banner-container img {
	max-width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
}

/* ===============================
   Prediction page side ads layout
   =============================== */
.prediction-layout {
	display: flex;
	gap: 16px;
}
.main-content {
	width: 75%;
}
.side-ad-column {
	width: 25%;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}
.side-banner {
	max-width: 320px;
	width: 100%;
	margin-bottom: 16px;
}
.side-banner img {
	width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
}
@media (max-width: 860px) {
	/* Hide ad column on mobile, let main content take full width */
	.side-ad-column { display: none; }
	.main-content { width: 100%; }
}

/* Fixtures panel: full-width banners below list */
.fixtures-banners {
	margin-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.fixtures-banner {
	width: 100%;
}
.fixtures-banner img {
	width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
}

/* Generic full-width banners (reusable) */
.full-width-banners {
	display: flex;
	flex-direction: column;
	gap: 16px;
}
.full-banner {
	width: 100%;
}
.full-banner img {
	width: 100%;
	height: auto;
	border-radius: 10px;
	display: block;
}
.banner-row {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	flex-wrap: wrap;
}
/* Keep side-by-side banners at standard size (like other banners) */
.banner--standard img {
	max-width: 320px;
	width: 100%;
	height: auto;
	border-radius: 10px;
}
/* Do not stretch the side-by-side banner containers */
.banner-row .full-banner { flex: 0 0 auto; width: auto; }
@media (max-width: 860px) {
	.banner-row { flex-direction: column; }
}

/* Double-width banner (equivalent to two standard banners + gap) */
.banner--double img {
	max-width: calc((320px * 2) + 16px);
	width: 100%;
}
/* Expand prediction pre-banner container width by 10% (so the visual is wider) */
.full-banner.banner--double.banner--pre {
	width: calc(((320px * 2) + 16px) * 1.1);
	max-width: 100%;
}
/* 10% shorter height while keeping width; uses cropping to preserve layout */
.banner--short img {
	aspect-ratio: 20 / 9; /* ~10% shorter than 2:1 */
	object-fit: contain; /* ensure full banner content stays inside the frame */
	object-position: center;
}
.banner--short-20 img {
	aspect-ratio: 5 / 2; /* 20% shorter than 2:1 */
	object-fit: cover;
	object-position: center;
}
.banner--center img { object-position: center; }

/* Pre banners: 10% wider */
.banner--pre:not(.banner--double) img {
	max-width: 384px; /* default for generic pre banners (e.g., H2H) */
	width: 100%;
	height: auto;
	object-fit: contain;
	object-position: center;
}
/* Prediction page: pre-prediction banner fixed to requested size */
/* Removed Prediction page pre-banner sizing */
.banner--double.banner--pre img { max-width: calc(((320px * 2) + 16px) * 1.1); }
/* Prediction pre-banner: an extra 10% shorter height */
.banner--shorter img {
	aspect-ratio: 22 / 9; /* 10% shorter than 20/9 */
	object-fit: contain;
	object-position: center;
}