/* Scoop Predictions – front-end components. Colours can be overridden by the theme. */
:root {
	--sp-ink: #111613;
	--sp-muted: #55605A;
	--sp-line: #E2E5DF;
	--sp-line-soft: #EEF0EC;
	--sp-surface: #FFFFFF;
	--sp-surface-alt: #FAFBF8;
	--sp-green: #0B6E3A;
	--sp-green-soft: #E3F1E8;
	--sp-green-text: #07502A;
	--sp-bright: #3DDC84;
	--sp-amber: #B45309;
	--sp-lost-bg: #FBE9E7;
	--sp-lost-text: #8A1C12;
	--sp-wait-bg: #FDF1E4;
	--sp-wait-text: #8A3F06;
	--sp-display: "Barlow Condensed", "Arial Narrow", sans-serif;
}

.sp-list { display: flex; flex-direction: column; gap: 16px; margin: 0 0 24px; }
.sp-head,
.sp-row {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) 150px 52px 92px;
	grid-template-areas: "time teams tip odds res";
	align-items: center;
	column-gap: 14px;
}
.sp-head { padding: 0 18px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--sp-muted); }
.sp-time { grid-area: time; }
.sp-teams { grid-area: teams; }
.sp-tip { grid-area: tip; }
.sp-odds { grid-area: odds; text-align: right; }
.sp-res { grid-area: res; display: flex; justify-content: flex-end; align-items: center; gap: 8px; }

.sp-card { background: var(--sp-surface); border: 1px solid var(--sp-line); border-radius: 10px; overflow: hidden; }
.sp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 18px; background: var(--sp-surface-alt); border-bottom: 1px solid var(--sp-line); }
.sp-card-title { font-weight: 700; font-size: 14px; }
.sp-card-meta { font-size: 13px; color: var(--sp-muted); margin-left: auto; }
.sp-card-head .sp-badge { margin-left: 4px; }

.sp-row { min-height: 44px; padding: 13px 18px; border-bottom: 1px solid var(--sp-line-soft); color: var(--sp-ink); text-decoration: none; }
.sp-row:last-child { border-bottom: 0; }
.sp-row:hover { background: #F7F9F5; color: var(--sp-ink); }
.sp-row:focus-visible { outline: 2px solid var(--sp-green); outline-offset: -2px; }
.sp-row .sp-time { font-weight: 600; color: var(--sp-muted); font-variant-numeric: tabular-nums; font-size: 14px; }
.sp-day { display: block; font-size: 12px; font-weight: 700; color: var(--sp-ink); }
.sp-teams { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sp-team { display: flex; align-items: center; gap: 10px; font-weight: 600; min-width: 0; }
.sp-team-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row-league { font-size: 12px; color: var(--sp-muted); }
.sp-pill { display: inline-block; padding: 5px 10px; border-radius: 6px; background: var(--sp-green-soft); color: var(--sp-green-text); font-weight: 700; font-size: 14px; line-height: 1.3; }
.sp-row .sp-odds { font-weight: 700; font-variant-numeric: tabular-nums; }
.sp-score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; }

/* Crests and flags */
.sp-crest { width: 24px; height: 28px; flex-shrink: 0; object-fit: contain; display: inline-block; vertical-align: middle; }
img.sp-crest { width: 26px; height: 26px; }
.sp-crest--flag, img.sp-crest--flag { width: 30px; height: 20px; object-fit: cover; border-radius: 3px; border: 1px solid var(--sp-line); }
.sp-crest--empty { display: inline-flex; align-items: center; justify-content: center; background: var(--sp-line-soft); color: var(--sp-muted); font-size: 9px; font-weight: 700; }

/* Confidence bars */
.sp-conf { display: inline-flex; gap: 3px; }
.sp-bar { width: 8px; height: 18px; border-radius: 2px; background: #DDE2DA; }
.sp-bar.is-on { background: var(--sp-green); }

/* Status badges: text label + colour, never colour alone */
.sp-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; letter-spacing: .03em; line-height: 1.2; }
.sp-badge--won { background: var(--sp-green-soft); color: var(--sp-green-text); }
.sp-badge--lost { background: var(--sp-lost-bg); color: var(--sp-lost-text); }
.sp-badge--pending { background: var(--sp-wait-bg); color: var(--sp-wait-text); }
.sp-badge--postponed, .sp-badge--void { background: var(--sp-line-soft); color: #3A433E; }

.sp-empty { padding: 18px; background: var(--sp-surface); border: 1px dashed #C9CFC6; border-radius: 10px; color: var(--sp-muted); margin: 0 0 24px; }
.sp-section-title { font-family: var(--sp-display); font-weight: 700; font-size: 26px; line-height: 1.15; margin: 8px 0 12px; }

/* Day tabs and market chips */
.sp-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.sp-tab { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid #D5DAD3; background: var(--sp-surface); color: var(--sp-ink); font-weight: 600; text-decoration: none; }
.sp-tab:hover { border-color: var(--sp-ink); color: var(--sp-ink); }
.sp-tab.is-active { background: var(--sp-ink); border-color: var(--sp-ink); color: #fff; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; margin: 0 0 22px; border-top: 1px solid var(--sp-line); }
.sp-chip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 6px; background: #E6EAE4; color: var(--sp-ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.sp-chip:hover { background: #DBE0D8; color: var(--sp-ink); }
.sp-chip.is-active { background: var(--sp-green); color: #fff; }

/* Banker card */
.sp-banker { display: flex; flex-direction: column; gap: 12px; background: var(--sp-ink); color: #fff; border-radius: 10px; padding: 20px; }
.sp-banker-tag { align-self: flex-start; padding: 4px 10px; border-radius: 4px; background: var(--sp-amber); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.sp-banker-meta { font-size: 13px; color: #C9D1CC; }
.sp-banker-match { font-family: var(--sp-display); font-weight: 700; font-size: 28px; line-height: 1.1; margin-top: -6px; }
.sp-banker-boxes { display: flex; gap: 10px; }
.sp-banker-box { flex: 1; background: #1E2622; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.sp-banker-box span { font-size: 12px; color: #C9D1CC; }
.sp-banker-box strong { font-size: 17px; }
.sp-banker-box .is-tip { color: var(--sp-bright); }
.sp-banker .sp-badge { align-self: flex-start; }
.sp-banker-link { display: flex; align-items: center; justify-content: center; height: 44px; border-radius: 8px; background: var(--sp-bright); color: #0A1A10; font-weight: 700; text-decoration: none; }
.sp-banker-link:hover { background: #5BE59A; color: #0A1A10; }

/* Sidebar cards */
.sp-side-card { background: var(--sp-surface); border: 1px solid var(--sp-line); border-radius: 10px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.sp-side-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.sp-side-head h2 { margin: 0; font-family: var(--sp-display); font-weight: 700; font-size: 22px; }
.sp-side-head a { font-size: 14px; font-weight: 600; }
.sp-tally { display: flex; gap: 10px; }
.sp-tally > span { flex: 1; border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; }
.sp-tally span span { font-size: 12px; }
.sp-tally strong { font-size: 22px; font-weight: 800; }
.sp-tally-won { background: var(--sp-green-soft); color: var(--sp-green-text); }
.sp-tally-lost { background: var(--sp-lost-bg); color: var(--sp-lost-text); }
.sp-mini { display: flex; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--sp-line-soft); font-size: 14px; color: var(--sp-ink); text-decoration: none; }
.sp-mini:hover { color: var(--sp-green); }
.sp-mini-text { flex: 1; min-width: 0; }
.sp-mini-text span { display: block; color: var(--sp-muted); font-size: 13px; }
.sp-links { list-style: none; margin: 0; padding: 0; }
.sp-links li { border-bottom: 1px solid var(--sp-line-soft); }
.sp-links li:last-child { border-bottom: 0; }
.sp-links a { display: block; padding: 11px 0; color: var(--sp-ink); font-weight: 600; text-decoration: none; }
.sp-links a:hover { color: var(--sp-green); }

/* Results page */
.sp-record { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: baseline; padding: 16px 20px; margin: 0 0 24px; background: var(--sp-surface); border: 1px solid var(--sp-line); border-radius: 10px; }
.sp-record strong { font-size: 24px; font-weight: 800; }
.sp-record-note { color: var(--sp-muted); font-size: 13px; margin-left: auto; }
.sp-day-title { font-family: var(--sp-display); font-weight: 700; font-size: 24px; margin: 8px 0 10px; }
.sp-day-title span { font-family: inherit; font-size: 16px; color: var(--sp-muted); font-weight: 600; margin-left: 8px; }
.sp-pager { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0 24px; }
.sp-pager a { display: inline-flex; align-items: center; height: 44px; padding: 0 18px; border: 1px solid #D5DAD3; border-radius: 8px; background: var(--sp-surface); font-weight: 600; text-decoration: none; color: var(--sp-ink); }

/* Match page */
.sp-match-meta { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--sp-green); }
.sp-match-title { font-family: var(--sp-display); font-weight: 800; font-size: clamp(30px, 5vw, 44px); line-height: 1.05; margin: 0 0 20px; }
.sp-match-teams { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; padding: 24px; background: var(--sp-surface); border: 1px solid var(--sp-line); border-radius: 12px; margin-bottom: 16px; }
.sp-match-team { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; font-weight: 700; font-size: 18px; }
.sp-match-team .sp-crest { width: 56px; height: 64px; }
.sp-match-team img.sp-crest { width: 64px; height: 64px; }
.sp-match-team .sp-crest--flag, .sp-match-team img.sp-crest--flag { width: 72px; height: 48px; }
.sp-match-vs { font-family: var(--sp-display); font-weight: 800; font-size: 32px; color: var(--sp-muted); font-variant-numeric: tabular-nums; }
.sp-match-tip { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 24px; }
.sp-match-tip > div { background: var(--sp-ink); color: #fff; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.sp-match-tip > div > span:first-child { font-size: 12px; color: #C9D1CC; }
.sp-match-tip strong { font-size: 20px; }
.sp-match-tip .is-tip { color: var(--sp-bright); }
.sp-match-tip .sp-bar { background: #3A433E; }
.sp-match-tip .sp-bar.is-on { background: var(--sp-bright); }
.sp-match-tip .sp-badge { align-self: flex-start; }
.sp-match-analysis { margin-bottom: 28px; }

@media (max-width: 640px) {
	.sp-head { display: none; }
	.sp-row {
		grid-template-columns: 44px minmax(0, 1fr) auto auto;
		grid-template-areas:
			"time teams tip tip"
			"time teams odds res";
		row-gap: 6px;
		column-gap: 10px;
		padding: 12px 14px;
	}
	.sp-row .sp-time { font-size: 13px; align-self: start; padding-top: 4px; }
	.sp-tip { justify-self: end; }
	.sp-pill { font-size: 13px; padding: 4px 8px; }
	.sp-odds { font-size: 13px; }
	.sp-bar { width: 6px; height: 12px; }
	.sp-card-head { padding: 9px 14px; }
	.sp-match-teams { padding: 18px 12px; }
}

@media (prefers-reduced-motion: reduce) {
	* { scroll-behavior: auto !important; }
}

/* Fixture page: previous predictions */
.sp-history-record { margin: -6px 0 12px; color: var(--sp-muted); font-weight: 600; }
.sp-history { margin-bottom: 28px; }
.sp-hist { border-bottom: 1px solid var(--sp-line-soft); scroll-margin-top: 16px; }
.sp-hist:last-child { border-bottom: 0; }
.sp-hist:target { background: #F7F9F5; }
.sp-hist-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto 70px 88px; align-items: center; gap: 12px; padding: 12px 18px; }
summary.sp-hist-row { cursor: pointer; list-style: none; }
summary.sp-hist-row::-webkit-details-marker { display: none; }
summary.sp-hist-row:hover { background: #F7F9F5; }
summary.sp-hist-row:focus-visible { outline: 2px solid var(--sp-green); outline-offset: -2px; }
.sp-hist-date { font-size: 13px; font-weight: 600; color: var(--sp-muted); }
.sp-hist-match { font-weight: 600; min-width: 0; }
.sp-hist-match small { display: block; font-weight: 400; font-size: 12px; color: var(--sp-muted); }
.sp-hist-score { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 14px; text-align: right; }
.sp-hist-res { display: flex; justify-content: flex-end; }
details.sp-hist .sp-hist-match::after { content: "Read analysis"; display: block; font-size: 12px; font-weight: 600; color: var(--sp-green); }
details.sp-hist[open] .sp-hist-match::after { content: "Hide analysis"; }
.sp-hist-body { padding: 0 18px 16px 126px; color: #3A433E; }
.sp-hist-body > :first-child { margin-top: 0; }

@media (max-width: 640px) {
	.sp-hist-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "date res" "match match" "tip score"; row-gap: 6px; padding: 12px 14px; }
	.sp-hist-date { grid-area: date; }
	.sp-hist-res { grid-area: res; }
	.sp-hist-match { grid-area: match; }
	.sp-hist-tip { grid-area: tip; }
	.sp-hist-score { grid-area: score; }
	.sp-hist-body { padding: 0 14px 14px; }
}
