/**
 * Standalone iframe: Orange / Purple Cap tables.
 *
 * @package ISPV2
 */

/*
 * Do not set overflow-y: hidden on html/body here: inside an iframe it can make
 * scrollHeight match the viewport and break parent resize JS, leaving iframe scrollbars.
 * Hide horizontal overflow only; vertical size is driven by content + parent iframe height.
 */
html {
	box-sizing: border-box;
	overflow-x: hidden;
	overflow-y: visible;
	width: 100%;
	max-width: 100%;
}

*,
*::before,
*::after {
	box-sizing: inherit;
}

body.isp-tournament-caps-shell,
div.isp-tournament-caps-shell.isp-tc-leaders--inline {
	margin: 0;
	padding: 0;
	background: transparent;
	overflow-x: hidden;
	overflow-y: visible;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	font-size: 13px;
	color: #111827;
	line-height: 1.45;
	-webkit-font-smoothing: antialiased;
}

#isp-tournament-caps-root,
.isp-tournament-caps-root {
	max-width: 100%;
	width: 100%;
	margin: 0;
	padding: 0;
	overflow-x: hidden;
}

/* Card + theme accent (Orange vs Purple) */
.isp-tc-card {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #e5e7eb;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

.isp-tc-theme--orange .isp-tc-card {
	border-top: 3px solid #ea580c;
}

.isp-tc-theme--purple .isp-tc-card {
	border-top: 3px solid #7c3aed;
}

.isp-tc-title-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	padding: 12px 14px 10px;
	border-bottom: 1px solid #f3f4f6;
	background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.isp-tc-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: #0f172a;
}

.isp-tc-title--with-icon {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Inline cap icon (tabs + headings) */
.isp-tc-cap-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	line-height: 0;
}

.isp-tc-cap-icon svg {
	display: block;
}

.isp-tc-cap-icon--orange {
	color: #ea580c;
}

.isp-tc-cap-icon--purple {
	color: #7c3aed;
}

.isp-tc-tab__label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.isp-tc-theme--orange .isp-tc-title {
	color: #9a3412;
}

.isp-tc-theme--purple .isp-tc-title {
	color: #5b21b6;
}

.isp-tc-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 4px 8px;
	border-radius: 999px;
	background: #f1f5f9;
	color: #64748b;
	border: 1px solid #e2e8f0;
}

.isp-tc-theme--orange .isp-tc-badge {
	background: #fff7ed;
	color: #c2410c;
	border-color: #fed7aa;
}

.isp-tc-theme--purple .isp-tc-badge {
	background: #f5f3ff;
	color: #6d28d9;
	border-color: #ddd6fe;
}

/* Top 10 only — no inner scroll; never show scrollbars on this wrapper. */
.isp-tc-table-wrap {
	/*overflow: hidden !important;*/
	/*max-height: 420px !important ;*/
	scrollbar-width: none;
	-ms-overflow-style: none;
}

/*.isp-tc-table-wrap::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}*/

.isp-tc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}

.isp-tc-table th,
.isp-tc-table td {
	padding: 10px 12px;
	text-align: left;
	border-bottom: 1px solid #f1f5f9;
	vertical-align: middle;
}

.isp-tc-table thead th {
	background: #e8efeb;
	font-weight: 700;
	color: #1e293b;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	box-shadow: 0 1px 0 #e2e8f0;
}

/* Primary stat column (Runs / Wickets) — teal highlight */
.isp-tc-th--primary {
	background: #ccfbf1 !important;
	color: #0f766e !important;
	box-shadow:
		inset 0 -2px 0 #5eead4,
		0 1px 0 #e2e8f0 !important;
}

.isp-tc-th-num {
	text-align: right;
}

.isp-tc-th-batter {
	min-width: 118px;
}

.isp-tc-th-team {
	min-width: 132px;
}

.isp-tc-table tbody tr {
	background: #fff;
	transition: background-color 0.12s ease;
}

.isp-tc-table tbody tr:nth-child(even) {
	background: #fafbfc;
}

.isp-tc-table tbody tr:hover {
	background: #f5f7fa;
}

/* #1 ranked player — full row + themed text */
.isp-tc-theme--orange .isp-tc-tr--leader {
	background: linear-gradient(90deg, #fff7ed 0%, #ffedd5 50%, #fff7ed 100%) !important;
	box-shadow: inset 0 1px 0 #fed7aa;
}

.isp-tc-theme--orange .isp-tc-tr--leader td {
	color: #9a3412;
	border-bottom-color: #fed7aa;
}

.isp-tc-theme--orange .isp-tc-tr--leader:hover {
	background: linear-gradient(90deg, #ffedd5 0%, #fed7aa 50%, #ffedd5 100%) !important;
}

.isp-tc-theme--orange .isp-tc-tr--leader .isp-tc-batter__name {
	color: #c2410c;
}

.isp-tc-theme--purple .isp-tc-tr--leader {
	background: linear-gradient(90deg, #f5f3ff 0%, #ede9fe 50%, #f5f3ff 100%) !important;
	box-shadow: inset 0 1px 0 #ddd6fe;
}

.isp-tc-theme--purple .isp-tc-tr--leader td {
	color: #5b21b6;
	border-bottom-color: #ddd6fe;
}

.isp-tc-theme--purple .isp-tc-tr--leader:hover {
	background: linear-gradient(90deg, #ede9fe 0%, #ddd6fe 50%, #ede9fe 100%) !important;
}

.isp-tc-theme--purple .isp-tc-tr--leader .isp-tc-batter__name {
	color: #6d28d9;
}

/* Leader row: primary stat cell — extra teal tie-in */
.isp-tc-theme--orange .isp-tc-tr--leader .isp-tc-td--primary,
.isp-tc-theme--purple .isp-tc-tr--leader .isp-tc-td--primary {
	background: rgba(45, 212, 191, 0.22) !important;
	color: #0f766e !important;
	font-weight: 800;
}

.isp-tc-batter {
	font-weight: 400;
	overflow-wrap: anywhere;
	word-wrap: break-word;
}

.isp-tc-batter__name {
	color: #1d4ed8;
	font-weight: 600;
}

.isp-tc-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	color: #111827;
	white-space: nowrap;
}

.isp-tc-num--runs {
	font-weight: 700;
}

.isp-tc-vs {
	color: #334155;
	font-size: 12px;
	line-height: 1.35;
}

.isp-tc-empty {
	text-align: center;
	color: #64748b;
	padding: 28px 16px !important;
	font-size: 13px;
}

/* Combined cap leaders: tabs (pill style + cap icons) */
.isp-tc-leaders--both .isp-tc-tabs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 0;
	padding: 10px 10px 12px;
	border-bottom: 1px solid #e5e7eb;
	background: #fafafa;
	border-radius: 10px 10px 0 0;
}

.isp-tc-leaders--single .isp-tc-tabs {
	display: none;
}

.isp-tc-tab {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 8px 14px;
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #64748b;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 999px;
	cursor: pointer;
	transition:
		color 0.15s ease,
		border-color 0.15s ease,
		box-shadow 0.15s ease,
		background 0.15s ease;
}

.isp-tc-tab:hover {
	color: #0f172a;
	border-color: #cbd5e1;
}

.isp-tc-tab--active {
	color: #0f172a;
}

.isp-tc-tab[data-panel='orange'].isp-tc-tab--active {
	border-color: #fdba74;
	color: #9a3412;
	box-shadow: 0 2px 10px rgba(234, 88, 12, 0.18);
	background: #fffbeb;
}

.isp-tc-tab[data-panel='purple'].isp-tc-tab--active {
	border-color: #c4b5fd;
	color: #5b21b6;
	box-shadow: 0 2px 10px rgba(124, 58, 237, 0.22);
	background: #faf5ff;
}

.isp-tc-leaders--both .isp-tc-card {
	border-radius: 0 0 10px 10px;
	border-top: none;
}

.isp-tc-leaders--both .isp-tc-tabs + .isp-tc-panels .isp-tc-panel--orange .isp-tc-card {
	border-top-left-radius: 0;
	border-top-right-radius: 0;
}

.isp-tc-panel[hidden] {
	display: none !important;
}

.isp-tc-panel-err {
	margin: 0;
	padding: 20px 14px;
	color: #b91c1c;
	font-size: 13px;
	line-height: 1.45;
}
