.teamsList {
	display: flex;
	flex-direction: column;
	gap: var(--s-2);
	padding-left: 0;
}

.headerRow {
	display: none;
	width: 100%;
	align-items: center;
	padding: var(--s-1-5) var(--s-3);
	column-gap: var(--s-2);
	font-size: var(--font-xs);
	font-weight: var(--weight-bold);
	grid-template-columns: 2.5rem 3.5rem 2rem 1fr 3rem 1fr;
}

.teamCard {
	display: grid;
	width: 100%;
	align-items: center;
	padding: var(--s-2) var(--s-3);
	border-radius: var(--radius-box);
	border: 1px solid var(--color-border);
	background-color: var(--color-bg-high);
	column-gap: var(--s-2);
	row-gap: var(--s-2);
	font-size: var(--font-xs);
	grid-template-columns: 2rem 3.5rem 2rem 1fr 3rem;
	grid-template-areas:
		"handle seed logo name sp"
		"players players players players players";
	list-style: none;
}

.handleArea {
	grid-area: handle;
}

.seedArea {
	grid-area: seed;
}

.logoArea {
	grid-area: logo;
}

.nameArea {
	grid-area: name;
	min-width: 0;
	overflow: hidden;
}

.spArea {
	grid-area: sp;
}

.playersArea {
	grid-area: players;
}

@container (width >= 640px) {
	.headerRow {
		display: grid;
	}

	.teamCard {
		grid-template-columns: 2.5rem 3.5rem 2rem 1fr 3rem 1fr;
		grid-template-areas: "handle seed logo name sp players";
		row-gap: 0;
	}
}

.teamCardDragging {
	opacity: 0.5;
}

.dragHandle {
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: grab;
	background: none;
	border: none;
	font-size: var(--font-lg);
	color: var(--color-text-high);
	padding: var(--s-1);
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;

	&:hover {
		color: var(--color-text);
	}

	&:active:not(:disabled) {
		cursor: grabbing;
	}

	&:disabled {
		cursor: not-allowed;
		opacity: 0.5;
	}
}

.seedInput {
	text-align: center;
	padding: var(--s-0-5);
	border-radius: var(--radius-field);
	border: 1px solid var(--color-border);
	background-color: var(--color-bg);
	color: var(--color-text);
	font-size: var(--font-xs);

	&:focus {
		outline: var(--focus-ring);
		outline-offset: 1px;
	}
}

.teamNameContainer {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--s-1);
	min-width: 0;
}

.teamName {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.newBadge {
	flex-shrink: 0;
	background-color: var(--color-second);
	color: var(--color-text-inverse);
	font-size: var(--font-2xs);
	font-weight: var(--weight-bold);
	padding: 1px 4px;
	border-radius: var(--radius-field);
	text-transform: uppercase;
}

.playersList {
	display: flex;
	flex-wrap: wrap;
	gap: var(--s-1);
}

.playerBadge {
	display: flex;
	align-items: center;
	gap: var(--s-1);
	background-color: var(--color-bg-higher);
	border-radius: var(--radius-selector);
	padding: 0 var(--s-2);
	height: var(--selector-size-sm);
	font-weight: var(--weight-semi);
}

.playerNew {
	position: relative;
}

.playerNewBadge {
	background-color: var(--color-second);
	color: var(--color-text-inverse);
	font-size: var(--font-2xs);
	font-weight: var(--weight-bold);
	padding: 1px 3px;
	border-radius: var(--radius-field);
	text-transform: uppercase;
	margin-left: var(--s-1);
}

.playerRemoved {
	text-decoration: line-through;
	color: var(--color-text-high);
	opacity: 0.6;
}

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

.outOfOrder {
	color: var(--color-warning);
}

.form {
	width: 100%;
	display: flex;
	align-items: center;
}

.orderButton {
	margin-block-start: var(--s-2);
	margin-inline-end: auto;
}

.overlay {
	background-color: var(--color-bg-high);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-box);
	padding: var(--s-2) var(--s-3);
	box-shadow:
		0 4px 6px -1px rgb(0 0 0 / 0.1),
		0 2px 4px -2px rgb(0 0 0 / 0.1);
	opacity: 0.8;
}
