/*
	Container query root.
	Resize this wrapper and the component responds based on its own space.
*/
.rbf-scorecard-shell {
	width: 100%;
	container-type: inline-size;
	container-name: rbf-scorecard;
}

/* Base/mobile-first component */
.rbf-scorecard {
	--rbf-red: #ff3434;
	--rbf-red-soft: rgba(255, 52, 52, 0.12);
	--rbf-bg: #101010;
	--rbf-panel: rgba(18, 18, 18, 0.92);
	--rbf-panel-soft: rgba(255, 255, 255, 0.035);
	--rbf-border: rgba(255, 255, 255, 0.12);
	--rbf-border-soft: rgba(255, 255, 255, 0.075);
	--rbf-text: #f7f7f7;
	--rbf-muted: #9a9a9a;
	--rbf-radius: 18px;

	color: var(--rbf-text);
}

.rbf-scorecard__panels {
	display: grid;
	grid-template-columns: 1fr;
	gap: 18px;
}

.rbf-panel {
	min-width: 0;
	padding: 16px;
	background: rgba(0, 0, 0, 0.2);
	border: 1px solid var(--rbf-border);
	border-radius: var(--rbf-radius);
}

.rbf-panel__header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 14px;
}

.rbf-panel__icon {
	position: relative;
	flex: 0 0 44px;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border-radius: 10px;
	background:
		linear-gradient(
			180deg,
			rgba(255, 52, 52, 0.16),
			rgba(255, 52, 52, 0.07)
		);
	border: 1px solid rgba(255, 52, 52, 0.16);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

/* Rating header icon */
.rbf-panel__icon--ratings::before {
	content: "";
	width: 22px;
	height: 22px;
	background:
		linear-gradient(var(--rbf-red), var(--rbf-red)) 0 100% / 4px 8px no-repeat,
		linear-gradient(var(--rbf-red), var(--rbf-red)) 6px 100% / 4px 13px no-repeat,
		linear-gradient(var(--rbf-red), var(--rbf-red)) 12px 100% / 4px 18px no-repeat,
		linear-gradient(var(--rbf-red), var(--rbf-red)) 18px 100% / 4px 22px no-repeat;
	filter: drop-shadow(0 0 8px rgba(255, 52, 52, 0.45));
}

/* Specs header icon */
.rbf-panel__icon--specs::before {
	content: "⚙";
	font-size: 23px;
	line-height: 1;
	color: var(--rbf-red);
	text-shadow: 0 0 12px rgba(255, 52, 52, 0.45);
}

.rbf-panel__title {
	margin: 0;
  line-height: 1;
	font-size: 1.5rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #fff;
	padding: 0px;
}

.rbf-panel__subtitle {
	margin: 5px 0 0;
	font-size: 12px;
	line-height: 1.25;
	color: var(--rbf-muted);
}

.rbf-panel__body {
	padding: 12px;
	border-radius: 14px;
	background:
		linear-gradient(
			180deg,
			rgba(255, 255, 255, 0.035),
			rgba(255, 255, 255, 0.015)
		);
	border: 1px solid var(--rbf-border-soft);
}

.rbf-kv-list {
	display: block;
}

.rbf-kv-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 46px;
	padding: 11px 0;
	border-bottom: 1px solid var(--rbf-border-soft);
}

.rbf-kv-card:last-child {
	border-bottom: 0;
}

.rbf-kv-card__key {
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.25;
	color: #f1f1f1;
}

.rbf-kv-card__value {
	min-width: 0;
	text-align: right;
	font-size: 15px;
	font-weight: 800;
	line-height: 1.25;
	color: #fff;
	letter-spacing: -0.02em;
}

.rbf-panel--ratings .rbf-kv-card__value {
	color: #fff;
}

.rbf-colour-dots {
	display: inline-flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}

.rbf-colour-dots span {
	width: 12px;
	height: 12px;
	display: block;
	border-radius: 50%;
	background: var(--dot-color);
	box-shadow: 0 0 10px rgba(255, 255, 255, 0.14);
}

@supports (box-shadow: 0 0 10px color-mix(in srgb, red, transparent 55%)) {
	.rbf-colour-dots span {
		box-shadow: 0 0 10px color-mix(in srgb, var(--dot-color), transparent 55%);
	}
}

.rbf-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 9px;
	border-radius: 8px;
	background: rgba(255, 255, 255, 0.12);
	border: 1px solid rgba(255, 255, 255, 0.08);
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.rbf-panel__note {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px solid var(--rbf-border-soft);
	font-size: 12px;
	line-height: 1.45;
	color: var(--rbf-muted);
}

.rbf-panel__note-icon {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 52, 52, 0.65);
	border-radius: 50%;
	color: var(--rbf-red);
	font-size: 12px;
	font-weight: 800;
	box-shadow: 0 0 16px rgba(255, 52, 52, 0.12);
}

.rbf-panel__note-icon--shield {
	border-radius: 7px;
}

/* Medium container: two main columns, key:value rows */
@container rbf-scorecard (min-width: 720px) {
	.rbf-scorecard__panels {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}

	.rbf-panel {
		padding: 18px;
	}

	.rbf-panel__body {
		padding: 14px 16px;
	}

	.rbf-kv-card {
		min-height: 50px;
	}

	.rbf-kv-card__key {
		font-size: 14px;
		color: #f5f5f5;
	}

	.rbf-kv-card__value {
		font-size: 16px;
	}
}

/* Wide container: two main columns, horizontal key/value columns inside each panel */
@container rbf-scorecard (min-width: 1100px) {
	.rbf-scorecard__panels {
		gap: 22px;
	}

	.rbf-panel {
		padding: 24px;
	}

	.rbf-panel__header {
		margin-bottom: 22px;
	}

	.rbf-panel__body {
		padding: 28px 20px 22px;
	}

	.rbf-kv-list {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		align-items: stretch;
	}

	.rbf-kv-card {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		justify-content: flex-start;
		gap: 42px;
		min-height: 140px;
		padding: 14px 16px;
		border-bottom: 0;
		border-right: 1px solid var(--rbf-border-soft);
	}

	.rbf-kv-card:first-child {
		padding-left: 8px;
	}

	.rbf-kv-card:last-child {
		border-right: 0;
		padding-right: 8px;
	}

	.rbf-kv-card__key {
		width: 100%;
		font-size: 14px;
		text-align: left;
		color: #fff;
	}

	.rbf-kv-card__value {
		width: 100%;
		text-align: left;
		font-size: 16px;
		font-weight: 700;
	}

	.rbf-panel--ratings .rbf-kv-card__value {
		font-size: 21px;
		letter-spacing: 0;
	}

	.rbf-colour-dots {
		justify-content: flex-start;
		gap: 7px;
	}

	.rbf-colour-dots span {
		width: 13px;
		height: 13px;
	}
}

/* Very narrow containers */
@container rbf-scorecard (max-width: 360px) {
	.rbf-panel {
		padding: 14px;
		border-radius: 14px;
	}

	.rbf-panel__icon {
		width: 38px;
		height: 38px;
		flex-basis: 38px;
	}

	.rbf-kv-card {
		align-items: flex-start;
		flex-direction: column;
		gap: 6px;
	}

	.rbf-kv-card__value {
		text-align: left;
	}

	.rbf-colour-dots {
		justify-content: flex-start;
	}
}