/* Loaded last on Web Client editor pages — wins over STHSMain/CCHL/Bootstrap */

/* Keep roster editor controls readable when league-wide STHS styles are present. */
body.webclient-page #rostereditor .webclient-captains-panel,
body.webclient-page #rostereditor .webclient-jerseys-panel {
	width: 100% !important;
	margin: 0 0 20px !important;
	padding: 16px !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 14px !important;
	background: #f8fafc !important;
	text-align: left !important;
}

body.webclient-page #rostereditor .webclient-captains-panel > h3,
body.webclient-page #rostereditor .webclient-jerseys-panel > h3 {
	margin: 0 0 12px !important;
	font-size: 1rem !important;
	line-height: 1.3 !important;
	text-align: left !important;
}

body.webclient-page #rostereditor .webclient-captains-league,
body.webclient-page #rostereditor .webclient-jerseys-league {
	width: 100% !important;
	min-width: 0 !important;
	margin: 0 0 16px !important;
	text-align: left !important;
}

body.webclient-page #rostereditor .webclient-captains-league > h4,
body.webclient-page #rostereditor .webclient-jerseys-league > h4 {
	margin: 0 0 10px !important;
	font-size: 0.85rem !important;
	line-height: 1.3 !important;
	font-weight: 700 !important;
	text-align: left !important;
}

body.webclient-page #rostereditor .webclient-captains-grid {
	display: grid !important;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
	align-items: end !important;
	gap: 12px 16px !important;
	width: 100% !important;
	margin: 0 !important;
}

body.webclient-page #rostereditor .webclient-captains-field {
	min-width: 0 !important;
}

body.webclient-page #rostereditor .webclient-captains-field label {
	display: block !important;
	margin: 0 0 4px !important;
	font-size: 0.8rem !important;
	font-weight: 600 !important;
	text-align: left !important;
}

body.webclient-page #rostereditor .webclient-captains-field select {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	min-height: 40px !important;
	padding: 8px 10px !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 8px !important;
	background: #ffffff !important;
	box-sizing: border-box !important;
}

body.webclient-page #rostereditor .webclient-jerseys-leagues {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	align-items: start !important;
	gap: 16px !important;
	width: 100% !important;
}

body.webclient-page #rostereditor .webclient-jerseys-table-wrap {
	width: 100% !important;
	max-height: min(65vh, 560px) !important;
	overflow: auto !important;
	margin: 0 !important;
	border: 1px solid #e2e8f0 !important;
	border-radius: 10px !important;
	background: #ffffff !important;
}

body.webclient-page #rostereditor .webclient-jerseys-table {
	width: 100% !important;
	margin: 0 !important;
	font-size: 0.875rem !important;
}

body.webclient-page #rostereditor .webclient-jerseys-table th,
body.webclient-page #rostereditor .webclient-jerseys-table td {
	padding: 8px 12px !important;
	text-align: left !important;
}

body.webclient-page #rostereditor .webclient-jersey-input {
	width: 64px !important;
	min-height: 36px !important;
	padding: 6px 8px !important;
	text-align: center !important;
}

@media screen and (max-width: 760px) {
	body.webclient-page #rostereditor .webclient-jerseys-leagues {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

body.webclient-page #rostereditor .columnwrapper.webclient-roster-grid {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap !important;
	align-items: stretch !important;
	gap: 12px !important;
	width: 100% !important;
	min-width: 0 !important;
	overflow: visible !important;
}

body.webclient-page #rostereditor .col4.roster-column {
	float: none !important;
	flex: 1 1 calc(25% - 9px) !important;
	min-width: 180px !important;
	max-width: none !important;
	width: auto !important;
	display: flex !important;
	flex-direction: column !important;
	box-sizing: border-box !important;
}

body.webclient-page #rostereditor .positionlist {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 8px !important;
	margin: 0 0 16px !important;
	padding: 0 !important;
	border: none !important;
	background: transparent !important;
	font-size: 0.875rem !important;
}

body.webclient-page #rostereditor .rowname {
	white-space: normal !important;
	word-break: normal !important;
	overflow: visible !important;
	text-overflow: clip !important;
	writing-mode: horizontal-tb !important;
}

body.webclient-page #lineeditor .webclient-line-tabs .tabcontainer.ui-tabs-panel[aria-hidden="true"] {
	display: none !important;
}

body.webclient-page #lineeditor .webclient-lines-grid.ui-tabs-panel:not([aria-hidden="true"]) {
	display: grid !important;
	grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	gap: 12px !important;
	width: 100% !important;
}

body.webclient-page #lineeditor .webclient-lines-grid.ui-tabs-panel[aria-hidden="true"] {
	display: none !important;
}

body.webclient-page #lineeditor .webclient-lines-grid > .linesection {
	float: none !important;
	width: auto !important;
	margin: 0 !important;
}

/* The legacy line editor used a floated 75/25 split inside these panels.
   The modern page already has its own two-column layout, so let both panels fill their grid tracks. */
body.webclient-page #lineeditor .webclient-lines-main > .linetabs,
body.webclient-page #lineeditor .webclient-lines-main .webclient-line-tabs {
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	margin: 0 !important;
}

body.webclient-page #lineeditor .webclient-lines-players .playerlist,
body.webclient-page #lineeditor .webclient-lines-players .frmPlayerList,
body.webclient-page #lineeditor .webclient-lines-players .playerselect {
	display: block !important;
	float: none !important;
	width: 100% !important;
	max-width: none !important;
	min-width: 0 !important;
	margin: 0 !important;
}

body.webclient-page #lineeditor .webclient-lines-players .playerselect .option,
body.webclient-page #lineeditor .webclient-lines-players .playerselect .option label {
	display: block !important;
	width: 100% !important;
	max-width: 100% !important;
	box-sizing: border-box !important;
}

@media screen and (max-width: 1024px) {
	body.webclient-page #lineeditor .webclient-lines-grid.ui-tabs-panel:not([aria-hidden="true"]) {
		grid-template-columns: 1fr !important;
	}
}

@media screen and (max-width: 640px) {
	body.webclient-page #rostereditor .columnwrapper.webclient-roster-grid {
		flex-wrap: nowrap !important;
		overflow-x: auto !important;
		overflow-y: visible !important;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		padding-bottom: 8px;
	}

	body.webclient-page #rostereditor .col4.roster-column {
		flex: 0 0 min(85vw, 280px) !important;
		min-width: min(85vw, 280px) !important;
		max-width: min(85vw, 280px) !important;
		scroll-snap-align: start;
	}
}

/* Mobile: prevent iOS Safari auto-zoom on tap (inputs need >= 16px when focused) */
@media (hover: none) and (pointer: coarse) {
	body.webclient-page input,
	body.webclient-page select,
	body.webclient-page textarea {
		font-size: 16px !important;
	}

	body.webclient-page #lineeditor .playerlist .playerselect .option label,
	body.webclient-page #lineeditor .positionlist label,
	body.webclient-page #rostereditor .positionlist label {
		font-size: 16px !important;
	}

	body.webclient-page #lineeditor input.textname {
		touch-action: manipulation;
	}

	body.webclient-page #rostereditor li.playerrow {
		touch-action: manipulation;
	}

	body.webclient-page #rostereditor li.playerrow.ui-sortable-helper {
		touch-action: none;
	}
}

/* Keep the player filters compact in the narrow sidebar, and match line slot text. */
body.webclient-page #lineeditor .webclient-lines-players .positionlist {
	display: flex !important;
	flex-wrap: nowrap !important;
	justify-content: space-between !important;
	gap: 3px !important;
	width: 100% !important;
	max-width: 100% !important;
	overflow-x: auto !important;
}

body.webclient-page #lineeditor .webclient-lines-players .positionlist label {
	flex: 0 0 auto !important;
	gap: 3px !important;
	padding: 4px 5px !important;
	font-size: 0.75rem !important;
	line-height: 1.1 !important;
	white-space: nowrap !important;
}

body.webclient-page #lineeditor .webclient-lines-players .playerselect .option label {
	font-size: 0.875rem !important;
	line-height: 1.3 !important;
}

body.webclient-page #lineeditor .webclient-lines-players .playerselect .option label .smalllist {
	font-size: 0.875rem !important;
	color: #64748b !important;
}

body.webclient-page #lineeditor .webclient-line-tabs .ui-tabs-nav > li {
	float: none !important;
	flex: 0 0 auto !important;
	overflow: visible !important;
}

body.webclient-page #lineeditor .webclient-line-tabs .ui-tabs-nav > li > a {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	min-width: max-content !important;
	padding: 8px 12px !important;
	border: 1px solid #cbd5e1 !important;
	border-radius: 999px !important;
	background: #ffffff !important;
	color: #334155 !important;
	font-size: 0.8125rem !important;
	line-height: 1.2 !important;
	text-align: center !important;
	text-decoration: none !important;
	text-indent: 0 !important;
	text-transform: none !important;
	visibility: visible !important;
	opacity: 1 !important;
	white-space: nowrap !important;
	overflow: visible !important;
}

body.webclient-page #lineeditor .webclient-line-tabs .ui-tabs-nav > li.ui-tabs-active > a {
	border-color: #2563eb !important;
	background: #2563eb !important;
	color: #ffffff !important;
	box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25) !important;
}
