/* EmPowerBall Leagues: public displays. Everything is scoped under .epb so the theme is left alone. */

.epb {
	--epb-primary: #2E266D;
	--epb-secondary: #8B3DFF;
	--epb-text: #FFFFFF;
	--epb-accent: #E61F93;
	--epb-primary-deep: #1F1A4D;
	--epb-line: rgba(255, 255, 255, 0.12);
	--epb-soft: rgba(255, 255, 255, 0.06);
	--epb-muted: rgba(255, 255, 255, 0.72);
	--epb-radius: 14px;
	box-sizing: border-box;
	color: var(--epb-text);
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
}
.epb *, .epb *::before, .epb *::after { box-sizing: inherit; }

/* ------------------------------------------------------------------ */
/* League container                                                    */
/* ------------------------------------------------------------------ */

.epb-league {
	background:
		radial-gradient(120% 80% at 100% 0%, rgba(139, 61, 255, 0.35) 0%, rgba(139, 61, 255, 0) 60%),
		var(--epb-primary);
	border-radius: var(--epb-radius);
	padding: clamp(16px, 3vw, 32px);
	margin: 0 0 32px;
	overflow: hidden;
}

.epb-league__head { margin-bottom: 18px; }
.epb .epb-league__title {
	color: var(--epb-text);
	font-size: clamp(1.4rem, 3.2vw, 2rem);
	font-weight: 800;
	letter-spacing: -0.01em;
	margin: 0;
	line-height: 1.15;
}
.epb-league__sub { color: var(--epb-muted); margin: 4px 0 0; font-size: 0.95rem; }

/* Tabs */
.epb-tabs {
	display: flex;
	gap: 6px;
	padding: 4px;
	background: rgba(0, 0, 0, 0.22);
	border-radius: 999px;
	overflow-x: auto;
	scrollbar-width: none;
	margin-bottom: 20px;
}
.epb-tabs::-webkit-scrollbar { display: none; }

.epb .epb-tab,
.epb .epb-subtab {
	appearance: none;
	border: 0;
	cursor: pointer;
	font: inherit;
	white-space: nowrap;
	color: var(--epb-text);
	background: transparent;
	border-radius: 999px;
	transition: background 0.15s ease, color 0.15s ease;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
}
.epb .epb-tab {
	flex: 1 0 auto;
	padding: 10px 18px;
	font-weight: 700;
	font-size: 0.95rem;
}
.epb .epb-tab:hover { background: rgba(255, 255, 255, 0.08); }
.epb .epb-tab[aria-selected="true"] {
	background: var(--epb-secondary);
	color: var(--epb-text);
}
.epb .epb-tab:focus-visible,
.epb .epb-subtab:focus-visible {
	outline: 2px solid var(--epb-accent);
	outline-offset: 2px;
}

.epb-subtabs { display: flex; gap: 8px; margin-bottom: 16px; }
.epb .epb-subtab {
	padding: 7px 14px;
	font-size: 0.9rem;
	font-weight: 600;
	border: 1px solid var(--epb-line);
}
.epb .epb-subtab[aria-selected="true"] {
	border-color: var(--epb-accent);
	background: rgba(230, 31, 147, 0.16);
}
.epb-pill {
	display: inline-block;
	min-width: 1.6em;
	padding: 0 6px;
	margin-left: 4px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.14);
	font-size: 0.78rem;
	text-align: center;
}

/* Panel titles show only when the tabs are not running (no JS). */
.epb-panel__title { color: var(--epb-text); font-size: 1.2rem; margin: 24px 0 12px; }
.epb-tabs-ready .epb-sr-when-tabs {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap;
}

.epb .epb-empty {
	color: var(--epb-muted);
	background: var(--epb-soft);
	border: 1px dashed var(--epb-line);
	border-radius: 12px;
	padding: 18px;
	margin: 0;
	text-align: center;
}
.epb .epb-key { color: var(--epb-muted); font-size: 0.82rem; margin: 12px 2px 0; }

/* ------------------------------------------------------------------ */
/* Logos                                                               */
/* ------------------------------------------------------------------ */

.epb-logo {
	display: inline-block;
	flex: none;
	object-fit: contain;
	background: transparent;
	vertical-align: middle;
}
/* Team logos keep their own transparent background. The extra specificity
   stops theme or page builder image styles adding a box, border or shadow. */
.epb img.epb-logo,
.epb .epb-logo--default {
	background: transparent !important;
	background-color: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	object-fit: contain;
	max-width: none;
	height: auto;
	aspect-ratio: 1 / 1;
}

/* ------------------------------------------------------------------ */
/* Fixtures and results                                                */
/* ------------------------------------------------------------------ */

.epb .epb-date {
	color: var(--epb-muted);
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	margin: 22px 0 10px;
}
.epb .epb-date:first-child { margin-top: 0; }

.epb-panel, .epb-subpanel { container-type: inline-size; }
.epb-matches { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); }

.epb-match {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 10px 12px;
	padding: 14px 16px;
	background: var(--epb-soft);
	border: 1px solid var(--epb-line);
	border-radius: 12px;
}
.epb-match__side {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	font-weight: 600;
}
.epb-match__side--home { justify-content: flex-end; text-align: right; }
.epb-match__name {
	min-width: 0;
	overflow-wrap: anywhere;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.epb-match.is-played .epb-match__side:not(.is-winner) { color: var(--epb-muted); }
.epb-match__side.is-winner { color: var(--epb-text); font-weight: 800; }

.epb-match__centre {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 84px;
}
.epb-match__final {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 4px 12px;
	border-radius: 8px;
	background: var(--epb-primary-deep);
	font-size: 1.5rem;
	font-weight: 800;
	line-height: 1.1;
}
.epb-match__final i { font-style: normal; color: var(--epb-muted); font-weight: 600; }
.epb-match__pitch { font-size: 0.75rem; color: var(--epb-muted); margin-top: 4px; white-space: nowrap; }
.epb-match__ko {
	padding: 6px 12px;
	border-radius: 8px;
	border: 1px solid var(--epb-secondary);
	font-weight: 700;
	font-size: 0.95rem;
	white-space: nowrap;
}
.epb-match__ko--off { border-color: var(--epb-line); color: var(--epb-muted); font-weight: 600; }

.epb-match__foot {
	grid-column: 1 / -1;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	padding-top: 10px;
	border-top: 1px solid var(--epb-line);
}
.epb-tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 10px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 600;
	background: rgba(255, 255, 255, 0.1);
}
.epb-tag--epb { background: var(--epb-accent); }
.epb-tag--potm { background: rgba(139, 61, 255, 0.45); }
.epb-tag__team { font-weight: 500; opacity: 0.75; font-size: 0.72rem; }
.epb .epb-table td.epb-c-epb { color: var(--epb-accent); font-weight: 800; }
.epb .epb-table thead th.epb-c-epb { color: var(--epb-accent); }
.epb-star { color: #FFD24A; }

.epb-ball {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	background:
		radial-gradient(circle at 35% 35%, #fff 0 22%, transparent 23%),
		conic-gradient(from 0deg, var(--epb-text) 0 25%, var(--epb-secondary) 0 50%, var(--epb-text) 0 75%, var(--epb-secondary) 0);
	box-shadow: 0 0 0 1.5px var(--epb-text);
	flex: none;
}

@container (max-width: 480px) {
	.epb-match { padding: 12px; gap: 8px; }
	.epb-match__side { flex-direction: column-reverse; gap: 6px; text-align: center; font-size: 0.9rem; }
	.epb-match__side--away { flex-direction: column; }
	.epb-match__side--home { justify-content: center; text-align: center; }
	.epb-match__final { font-size: 1.3rem; padding: 4px 10px; }
	.epb-match__centre { min-width: 72px; }
}
@media (max-width: 480px) {
	.epb-match { padding: 12px; gap: 8px; }
	.epb-match__side { flex-direction: column-reverse; gap: 6px; text-align: center; font-size: 0.9rem; }
	.epb-match__side--away { flex-direction: column; }
	.epb-match__side--home { justify-content: center; text-align: center; }
	.epb-match__final { font-size: 1.3rem; padding: 4px 10px; }
	.epb-match__centre { min-width: 72px; }
}

/* ------------------------------------------------------------------ */
/* Tables                                                              */
/* ------------------------------------------------------------------ */

.epb-table-wrap {
	overflow-x: auto;
	border-radius: 12px;
	border: 1px solid var(--epb-line);
}
.epb .epb-table {
	width: 100%;
	border-collapse: collapse;
	border: 0;
	margin: 0;
	color: var(--epb-text);
	background: transparent;
	font-size: 0.95rem;
}
.epb .epb-table th,
.epb .epb-table td {
	padding: 11px 10px;
	text-align: center;
	border: 0;
	border-bottom: 1px solid var(--epb-line);
	background: transparent;
	color: inherit;
	vertical-align: middle;
}
.epb .epb-table thead th {
	background: rgba(0, 0, 0, 0.22);
	font-size: 0.76rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--epb-muted);
}
.epb .epb-table abbr { text-decoration: none; border: 0; cursor: help; }
.epb .epb-table tbody tr:nth-child(even) td { background: rgba(255, 255, 255, 0.03); }
.epb .epb-table tbody tr:last-child td { border-bottom: 0; }
.epb .epb-table tbody tr:hover td { background: rgba(139, 61, 255, 0.18); }

.epb .epb-table .epb-c-team { text-align: left; width: 100%; }
.epb .epb-table .epb-c-pos { width: 42px; color: var(--epb-muted); font-weight: 700; }
.epb .epb-table td.epb-c-pts { font-weight: 800; font-size: 1.05rem; }
.epb .epb-table thead th.epb-c-pts { color: var(--epb-text); }
.epb-table--league tbody tr:first-child td.epb-c-pos { color: var(--epb-accent); }

.epb-team { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }

.epb-formguide { display: inline-flex; gap: 3px; }
.epb-formguide__item {
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 4px;
	font-size: 0.68rem;
	font-weight: 800;
}
.epb-formguide__item--w { background: #22B573; }
.epb-formguide__item--d { background: rgba(255, 255, 255, 0.28); }
.epb-formguide__item--l { background: var(--epb-accent); }

.epb-bar {
	display: inline-block;
	width: 70px;
	height: 6px;
	border-radius: 3px;
	background: rgba(255, 255, 255, 0.15);
	overflow: hidden;
	vertical-align: middle;
	margin-right: 6px;
}
.epb-bar span { display: block; height: 100%; background: var(--epb-accent); }

@media (max-width: 760px) { .epb .epb-table .epb-hide-md { display: none; } }
@media (max-width: 480px) {
	.epb .epb-table .epb-hide-sm { display: none; }
	.epb .epb-table th, .epb .epb-table td { padding: 10px 6px; font-size: 0.9rem; }
	.epb-team { gap: 8px; }
}

/* ------------------------------------------------------------------ */
/* Ticker                                                              */
/* ------------------------------------------------------------------ */

.epb-ticker {
	display: flex;
	align-items: stretch;
	background: var(--epb-primary);
	border-radius: 10px;
	overflow: hidden;
	margin: 0 0 24px;
	min-height: 48px;
	font-size: 0.95rem;
}
.epb-ticker__label {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	padding: 0 16px;
	background: var(--epb-accent);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 0.8rem;
	position: relative;
	z-index: 1;
}
.epb-ticker__label .epb-ball { box-shadow: 0 0 0 1.5px var(--epb-text); }

.epb-ticker__viewport {
	flex: 1;
	overflow: hidden;
	display: flex;
	align-items: center;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 24px, #000 calc(100% - 24px), transparent 100%);
}
.epb-ticker__viewport--static { padding: 0 16px; -webkit-mask-image: none; mask-image: none; }
.epb-ticker__empty { color: var(--epb-muted); }

.epb-ticker__track {
	display: flex;
	width: max-content;
	animation: epb-ticker var(--epb-ticker-duration, 30s) linear infinite;
}
.epb-ticker:hover .epb-ticker__track,
.epb-ticker:focus-within .epb-ticker__track { animation-play-state: paused; }

.epb .epb-ticker__list {
	display: flex;
	list-style: none;
	margin: 0;
	padding: 0;
}
.epb .epb-ticker__item {
	display: flex;
	align-items: center;
	margin: 0;
	padding: 0 22px;
	white-space: nowrap;
	border-right: 1px solid var(--epb-line);
}
.epb .epb-ticker__item a {
	display: flex;
	align-items: center;
	color: inherit;
	text-decoration: none;
}
.epb .epb-ticker__item a:hover .epb-ticker__team { text-decoration: underline; }
.epb-ticker__item a, .epb-ticker__item { gap: 8px; }
.epb-ticker__league {
	color: var(--epb-secondary);
	background: rgba(255, 255, 255, 0.92);
	border-radius: 4px;
	padding: 1px 6px;
	font-size: 0.7rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.epb-ticker__team { font-weight: 600; }
.epb-ticker__score {
	background: var(--epb-secondary);
	border-radius: 5px;
	padding: 2px 8px;
	font-weight: 800;
}
.epb .epb-ticker__epb {
	color: var(--epb-text);
	background: var(--epb-accent);
	border-radius: 4px;
	padding: 0 4px;
	font-size: 0.72rem;
	font-weight: 800;
}

@keyframes epb-ticker {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
	.epb-ticker__track { animation: none; }
	.epb-ticker__track .epb-ticker__list[aria-hidden="true"] { display: none; }
	.epb-ticker__viewport { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
}

@media (max-width: 600px) {
	.epb-ticker { flex-direction: column; border-radius: 8px; }
	.epb-ticker__label { padding: 8px 14px; justify-content: center; }
	.epb-ticker__viewport { min-height: 44px; }
}

/* Phones: show all four tabs as a 2 x 2 grid rather than scrolling off the edge. */
@media (max-width: 600px) {
	.epb-tabs {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 6px;
		border-radius: 16px;
		overflow: visible;
	}
	.epb .epb-tab {
		padding: 10px 8px;
		font-size: 0.9rem;
		white-space: normal;
		border-radius: 12px;
	}
}
/* Belt and braces: themes that force display on [hidden] elements. */
.epb .epb-panel[hidden], .epb .epb-subpanel[hidden] { display: none !important; }

/* Ticker items: league name on a small line above, result underneath. */
.epb-ticker { min-height: 60px; }
.epb .epb-ticker__item,
.epb .epb-ticker__item a {
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 3px;
}
.epb .epb-ticker__item { padding: 8px 24px; }
.epb .epb-ticker__league {
	background: none;
	padding: 0;
	border-radius: 0;
	color: var(--epb-muted);
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.2;
}
.epb-ticker__result { display: flex; align-items: center; gap: 8px; line-height: 1.2; }
.epb .epb-ticker__item a:hover .epb-ticker__league { color: var(--epb-text); }

/* EmPowerBall "E" logo next to the ticker label, on a white badge so the pink bar shows. */
.epb .epb-ticker__label { gap: 10px; }
.epb-ticker__logo {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 7px;
	background: #FFFFFF;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.epb .epb-ticker__logo img { display: block; width: 22px; height: 22px; margin: 0; padding: 0; border: 0; max-width: none; }

/* Full width ticker: runs edge to edge (the script lines it up with the screen). */
.epb-ticker--full { border-radius: 0; max-width: none; position: relative; }
.epb-ticker--full .epb-ticker__label { padding-left: max(16px, env(safe-area-inset-left)); }
@media (max-width: 600px) { .epb-ticker--full { border-radius: 0; } }
