.mtg-spec-table,
.mtg-spec-table * {
	box-sizing: border-box;
}

.mtg-spec-table {
	--mtg-spec-label-width: 38%;
	--mtg-spec-cell-padding-y: 8px;
	--mtg-spec-cell-padding-x: 14px;
	--mtg-spec-line-height: 1.35;
	width: 100%;
	background: #fff;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	overflow: hidden;
}

.mtg-spec-table__body {
	display: grid;
	width: 100%;
	margin: 0;
	padding: 0;
	row-gap: 0;
}

.mtg-spec-table__header,
.mtg-spec-table__row {
	display: grid;
	grid-template-columns: var(--mtg-spec-label-width) minmax(0, 1fr);
	width: 100%;
	min-width: 0;
	height: auto;
	min-height: 0;
	margin: 0;
	border-bottom: 1px solid #e8e8e8;
	background: #fff;
}

.mtg-spec-table__header {
	font-weight: 700;
}

.mtg-spec-table__row:last-child {
	border-bottom-width: 0;
}

.mtg-spec-table__label,
.mtg-spec-table__value,
.mtg-spec-table__header-cell {
	display: flex;
	align-items: center;
	min-width: 0;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
	min-height: 0;
	line-height: var(--mtg-spec-line-height);
}

.mtg-spec-table__label {
	padding: var(--mtg-spec-cell-padding-y) var(--mtg-spec-cell-padding-x);
	color: #333;
	background: #fafafa;
	font-size: 14px;
	font-weight: 500;
}

.mtg-spec-table__value {
	margin: 0;
	padding: var(--mtg-spec-cell-padding-y) var(--mtg-spec-cell-padding-x);
	color: #222;
	background: #fff;
	font-size: 14px;
}

.mtg-spec-table__value a {
	color: #9a1f24;
}

.mtg-spec-table__header-cell {
	padding: var(--mtg-spec-cell-padding-y) var(--mtg-spec-cell-padding-x);
	background: #f5f5f5;
	color: #111;
}

.mtg-spec-table__label-inner {
	display: inline-flex;
	align-items: center;
	min-width: 0;
	gap: 8px;
}

.mtg-spec-table__icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	color: #9a1f24;
	font-size: 16px;
	line-height: 1;
}

.mtg-spec-table__icon svg,
.mtg-spec-table__icon i {
	display: block;
	width: 1em;
	height: 1em;
}

.mtg-spec-table__label-text {
	min-width: 0;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
}

.mtg-spec-table--alternate .mtg-spec-table__row:nth-child(even) {
	background: #fafafa;
}

.mtg-spec-table--alternate .mtg-spec-table__row:nth-child(even) .mtg-spec-table__label,
.mtg-spec-table--alternate .mtg-spec-table__row:nth-child(even) .mtg-spec-table__value {
	background: transparent;
}

.mtg-spec-table__row.is-highlighted {
	background: #fff7f7;
}

.mtg-spec-table__row.is-highlighted .mtg-spec-table__label,
.mtg-spec-table__row.is-highlighted .mtg-spec-table__value,
.mtg-spec-table__row:hover .mtg-spec-table__label,
.mtg-spec-table__row:hover .mtg-spec-table__value {
	background: transparent;
}

.mtg-spec-table--layout-inline_list .mtg-spec-table__row {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 12px;
	padding: var(--mtg-spec-cell-padding-y) var(--mtg-spec-cell-padding-x);
}

.mtg-spec-table--layout-inline_list .mtg-spec-table__label,
.mtg-spec-table--layout-inline_list .mtg-spec-table__value {
	width: auto;
	padding: 0;
	background: transparent;
}

.mtg-spec-table--layout-inline_list .mtg-spec-table__label::after {
	content: ":";
	margin-left: 2px;
}

.mtg-spec-table--layout-comparison .mtg-spec-table__label {
	border-right: 1px solid #e8e8e8;
}

.mtg-spec-table--density-normal {
	--mtg-spec-cell-padding-y: 12px;
	--mtg-spec-cell-padding-x: 16px;
	--mtg-spec-line-height: 1.5;
}

.mtg-spec-table--density-spacious {
	--mtg-spec-cell-padding-y: 16px;
	--mtg-spec-cell-padding-x: 18px;
	--mtg-spec-line-height: 1.6;
}

.mtg-spec-table--matrix {
	--mtg-spec-matrix-col-1: 30%;
	--mtg-spec-matrix-col-2: 20%;
	--mtg-spec-matrix-col-3: 23%;
	--mtg-spec-matrix-col-4: 27%;
	--mtg-spec-matrix-border-color: #e8e8e8;
	overflow: hidden;
}

.mtg-spec-table__matrix-scroll {
	width: 100%;
	max-width: 100%;
}

.mtg-spec-table__matrix-header,
.mtg-spec-table__matrix-row {
	display: grid;
	grid-template-columns:
		var(--mtg-spec-matrix-col-1, 30%)
		var(--mtg-spec-matrix-col-2, 20%)
		var(--mtg-spec-matrix-col-3, 23%)
		var(--mtg-spec-matrix-col-4, 27%);
	width: 100%;
	min-width: 0;
}

.mtg-spec-table__matrix-header {
	background: #fafafa;
	border-bottom: 1px solid var(--mtg-spec-matrix-border-color);
}

.mtg-spec-table__matrix-body {
	width: 100%;
}

.mtg-spec-table__matrix-row {
	background: #fff;
	border-bottom: 1px solid var(--mtg-spec-matrix-border-color);
}

.mtg-spec-table__matrix-row:last-child {
	border-bottom: 0;
}

.mtg-spec-table__matrix-cell {
	display: flex;
	align-items: center;
	min-width: 0;
	padding: 10px 14px;
	color: #222;
	font-size: 14px;
	line-height: 1.35;
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
	border-right: 1px solid var(--mtg-spec-matrix-border-color);
}

.mtg-spec-table__matrix-cell:last-child {
	border-right: 0;
}

.mtg-spec-table__matrix-heading {
	color: #333;
	font-weight: 600;
	background: #fafafa;
}

.mtg-spec-table__matrix-upgrade.is-highlighted {
	color: #9a1f24;
	font-weight: 600;
}

.mtg-spec-table__note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 12px;
	padding: 10px 14px;
	color: #333;
	font-size: 13px;
	line-height: 1.45;
	background: #fff7f7;
	border: 1px solid #f0d4d6;
	border-radius: 6px;
}

.mtg-spec-table__note-icon {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	margin-top: 0.15em;
	color: #9a1f24;
	line-height: 1;
}

.mtg-spec-table__note-icon svg,
.mtg-spec-table__note-icon i {
	display: block;
	width: 1em;
	height: 1em;
}

.mtg-spec-table__note-text {
	min-width: 0;
}

@media (max-width: 767px) {
	.mtg-spec-table--mobile-stacked .mtg-spec-table__header,
	.mtg-spec-table--mobile-stacked .mtg-spec-table__row,
	.mtg-spec-table--layout-stacked .mtg-spec-table__header,
	.mtg-spec-table--layout-stacked .mtg-spec-table__row {
		grid-template-columns: 1fr;
	}

	.mtg-spec-table--mobile-stacked .mtg-spec-table__label,
	.mtg-spec-table--layout-stacked .mtg-spec-table__label {
		padding: 10px 12px 5px;
	}

	.mtg-spec-table--mobile-stacked .mtg-spec-table__value,
	.mtg-spec-table--layout-stacked .mtg-spec-table__value {
		padding: 5px 12px 10px;
	}

	.mtg-spec-table--mobile-two_columns .mtg-spec-table__header,
	.mtg-spec-table--mobile-two_columns .mtg-spec-table__row {
		grid-template-columns: var(--mtg-spec-label-width) minmax(0, 1fr);
	}

	.mtg-spec-table--mobile-horizontal_scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.mtg-spec-table--mobile-horizontal_scroll .mtg-spec-table__body,
	.mtg-spec-table--mobile-horizontal_scroll .mtg-spec-table__header {
		min-width: 680px;
	}

	.mtg-spec-table--matrix-mobile-horizontal_scroll {
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.mtg-spec-table--matrix-mobile-horizontal_scroll .mtg-spec-table__matrix-scroll {
		min-width: 760px;
	}

	.mtg-spec-table--matrix-mobile-stacked_cards {
		background: transparent;
		border: 0;
		border-radius: 0;
		overflow: visible;
	}

	.mtg-spec-table--matrix-mobile-stacked_cards .mtg-spec-table__matrix-header {
		display: none;
	}

	.mtg-spec-table--matrix-mobile-stacked_cards .mtg-spec-table__matrix-body {
		display: grid;
		gap: 12px;
	}

	.mtg-spec-table--matrix-mobile-stacked_cards .mtg-spec-table__matrix-row {
		display: grid;
		grid-template-columns: 1fr;
		border: 1px solid var(--mtg-spec-matrix-border-color);
		border-radius: 6px;
		overflow: hidden;
	}

	.mtg-spec-table--matrix-mobile-stacked_cards .mtg-spec-table__matrix-cell {
		display: grid;
		grid-template-columns: minmax(110px, 0.85fr) minmax(0, 1.15fr);
		gap: 10px;
		align-items: start;
		border-right: 0;
		border-bottom: 1px solid var(--mtg-spec-matrix-border-color);
	}

	.mtg-spec-table--matrix-mobile-stacked_cards .mtg-spec-table__matrix-cell:last-child {
		border-bottom: 0;
	}

	.mtg-spec-table--matrix-mobile-stacked_cards .mtg-spec-table__matrix-cell::before {
		content: attr(data-label);
		color: #555;
		font-weight: 600;
	}
}
