/**
 * ROM Shortcodes - structure only.
 *
 * No colour is declared outright. Everything resolves through a custom property
 * whose fallback is either `inherit`, `currentColor` or a mix of the surrounding
 * text colour, so an unconfigured block takes the theme's palette. Set a token
 * on the settings screen or as a shortcode attribute and it takes over.
 */

/* -------------------------------------------------------------------------
 * Shared
 * ---------------------------------------------------------------------- */

.rsc {
	padding: var(--rsc-pad, 0);

	/* A shortcode renders a bare div, which most themes give no margin at all.
	   Without this, two blocks stacked on a page sit flush against each other. */
	margin-bottom: var(--rsc-block-gap, 2.5rem);

	color: var(--rsc-text, inherit);
	background: var(--rsc-bg, transparent);
	border-radius: var(--rsc-radius, 6px);
	box-sizing: border-box;
}

/* The gap is deliberately kept on the last block too. Zeroing it looks tidy
   inside a single container, but a block that ends `.entry-content` is still
   followed by whatever the theme prints after the article - related games,
   comments - and those would then sit flush against it. */

/* Links that sit inside a block's own text - term links in the details table
   and the hero meta line - follow the accent once one is set, because a bare
   theme's default link blue rarely survives a dark card. */
.rsc-details-table td a,
.rsc-details-item dd a,
.rsc-hero-meta a {
	color: var(--rsc-accent, inherit);
}

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

.rsc .rsc-muted {
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc .rsc-heading {
	margin: 0 0 0.75em;
	font-size: 1.15em;
	line-height: 1.3;
	color: var(--rsc-text, inherit);
}

.rsc-screen-reader {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.rsc .rsc-btn {
	display: inline-block;
	padding: 0.7em 1.4em;
	border: 1px solid transparent;
	border-radius: var(--rsc-radius, 6px);
	background: var(--rsc-accent, currentColor);
	color: var(--rsc-accent-text, Canvas);
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: opacity 0.15s ease;
}

.rsc .rsc-btn:hover,
.rsc .rsc-btn:focus-visible {
	opacity: 0.85;
	color: var(--rsc-accent-text, Canvas);
}

/* Counting down: dimmed and inert, but still focusable so a keyboard user is
   not thrown out of the button while they wait. */
.rsc .rsc-btn[aria-disabled="true"] {
	opacity: 0.65;
	cursor: default;
}

/* Armed. The colour change is the whole signal that the wait is over, so this
   is one of the few places the plugin insists on a colour of its own when none
   has been configured. */
.rsc .rsc-dl-btn.rsc-is-ready {
	background: var(--rsc-ready, #16a34a);
	color: var(--rsc-ready-text, #ffffff);
	animation: rsc-ready-in 0.35s ease;
}

.rsc .rsc-dl-btn.rsc-is-ready:hover,
.rsc .rsc-dl-btn.rsc-is-ready:focus-visible {
	color: var(--rsc-ready-text, #ffffff);
}

@keyframes rsc-ready-in {
	from {
		transform: scale(0.94);
	}

	to {
		transform: scale(1);
	}
}

@media (prefers-reduced-motion: reduce) {
	.rsc .rsc-dl-btn.rsc-is-ready {
		animation: none;
	}
}

.rsc .rsc-empty {
	margin: 0;
	padding: 2em 0;
	text-align: center;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

/* -------------------------------------------------------------------------
 * Grids and cards
 * ---------------------------------------------------------------------- */

.rsc-grid-items {
	--rsc-cols: var(--rsc-columns, 4);

	display: grid;
	grid-template-columns: repeat(var(--rsc-cols), minmax(0, 1fr));
	gap: var(--rsc-gap, 20px);
}

@media (max-width: 1024px) {
	.rsc-grid-items {
		--rsc-cols: var(--rsc-columns-md, 3);
	}
}

@media (max-width: 680px) {
	.rsc-grid-items {
		--rsc-cols: var(--rsc-columns-sm, 2);
	}
}

/* A lone [rom_card] would otherwise stretch to the full container width and
   blow its 3:4 cover art up with it. */
.rsc-card-single {
	max-width: var(--rsc-card-width, 320px);
}

.rsc-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	background: var(--rsc-card-bg, transparent);
	border: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 14%, transparent));
	border-radius: var(--rsc-radius, 6px);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.rsc-card:hover {
	transform: translateY(-3px);
	border-color: var(--rsc-accent, color-mix(in srgb, currentColor 30%, transparent));
	box-shadow: 0 10px 24px -12px rgba(0, 0, 0, 0.55);
}

.rsc-card-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.rsc-card-art {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: color-mix(in srgb, currentColor 8%, transparent);
}

.rsc-card-img,
.rsc-card-noart {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.rsc-card-link:hover .rsc-card-img {
	transform: scale(1.04);
}

.rsc-badge {
	position: absolute;
	top: 0.5em;
	left: 0.5em;
	padding: 0.25em 0.6em;
	border-radius: calc(var(--rsc-radius, 6px) / 1.5);
	background: var(--rsc-accent, currentColor);
	color: var(--rsc-accent-text, Canvas);
	font-size: 0.7em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.rsc-card-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	margin: 0.7em 0.8em 0;
	font-size: 0.95em;
	line-height: 1.35;
	color: var(--rsc-text, inherit);
	overflow: hidden;
	overflow-wrap: anywhere;
}

.rsc-card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin: 0.5em 0.8em 0.9em;
	font-size: 0.8em;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-card-format,
.rsc-card-size {
	padding: 0.15em 0.5em;
	border: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 16%, transparent));
	border-radius: calc(var(--rsc-radius, 6px) / 1.5);
}

.rsc-pagination {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4em;
	margin-top: calc(var(--rsc-gap, 20px) * 1.2);
}

.rsc-pagination .page-numbers {
	display: inline-block;
	min-width: 2.4em;
	padding: 0.5em 0.7em;
	border: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 16%, transparent));
	border-radius: var(--rsc-radius, 6px);
	color: inherit;
	text-align: center;
	text-decoration: none;
}

.rsc-pagination .page-numbers.current {
	background: var(--rsc-accent, currentColor);
	color: var(--rsc-accent-text, Canvas);
	border-color: transparent;
}

.rsc-pagination .page-numbers.dots {
	border-color: transparent;
}

/* -------------------------------------------------------------------------
 * Wide cards - landscape art, badges, title over the artwork
 * ---------------------------------------------------------------------- */

.rsc-w-card {
	min-width: 0;
	border-radius: var(--rsc-radius, 6px);
	overflow: hidden;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rsc-w-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 26px -14px rgba(0, 0, 0, 0.6);
}

.rsc-w-link {
	display: block;
	color: inherit;
	text-decoration: none;
}

.rsc-w-art {
	position: relative;
	display: block;

	/* Overridable so a site can match whatever shape its artwork is cropped to
	   without forking the template. */
	aspect-ratio: var(--rsc-art-ratio, 16 / 10);
	border-radius: var(--rsc-radius, 6px);
	overflow: hidden;
	background: color-mix(in srgb, currentColor 10%, transparent);
}

.rsc-w-img,
.rsc-w-noart {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.rsc-w-link:hover .rsc-w-img {
	transform: scale(1.05);
}

/* The gradient only exists so the overlaid title stays readable on any art. */
.rsc-w-veil {
	position: absolute;
	inset: auto 0 0 0;
	height: 62%;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.55) 45%, transparent);
	pointer-events: none;
}

.rsc-w-caption {
	position: absolute;
	inset: auto 0 0 0;
	padding: 0.8em 0.9em;
}

.rsc-w-caption .rsc-w-title {
	margin: 0;
	color: #fff;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.rsc-w-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: 0.95em;
	font-weight: 700;
	line-height: 1.3;
	overflow: hidden;
	overflow-wrap: anywhere;
}

.rsc-w-below .rsc-w-title {
	margin: 0.7em 0 0;
	color: var(--rsc-text, inherit);
}

/* Badges */

.rsc-chips {
	position: absolute;
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	max-width: calc(100% - 1.2em);
}

.rsc-tl {
	top: 0.6em;
	left: 0.6em;
}

.rsc-tr {
	top: 0.6em;
	right: 0.6em;
	justify-content: flex-end;
}

.rsc-bl {
	bottom: 0.6em;
	left: 0.6em;
}

.rsc-chip {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	padding: 0.22em 0.5em;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.66);
	color: #fff;
	font-size: 0.68em;
	font-weight: 700;
	line-height: 1.5;
	white-space: nowrap;
	backdrop-filter: blur(2px);
}

.rsc-chip-size {
	background: var(--rsc-accent, #e60012);
	color: var(--rsc-accent-text, #fff);
}

.rsc-chip-dl {
	background: var(--rsc-chip-dl, #1d6ff2);
	color: #fff;
}

.rsc-chip-rating {
	color: var(--rsc-star, #ffb300);
}

.rsc-w-card .rsc-chip {
	position: static;
}

.rsc-tl.rsc-chip {
	position: absolute;
}

/* -------------------------------------------------------------------------
 * Carousel
 * ---------------------------------------------------------------------- */

.rsc-carousel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 0.9em;
}

.rsc-carousel-head .rsc-heading {
	margin: 0;
}

.rsc-carousel-tools {
	display: flex;
	align-items: center;
	gap: 0.4em;
}

.rsc-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2em;
	height: 2em;
	padding: 0;
	border: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 20%, transparent));
	border-radius: var(--rsc-radius, 6px);
	background: transparent;
	color: inherit;
	font-size: 1.05em;
	line-height: 1;
	cursor: pointer;
}

.rsc-arrow:hover:not(:disabled) {
	border-color: var(--rsc-accent, currentColor);
	color: var(--rsc-accent, inherit);
}

.rsc-arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.rsc-see-all {
	margin-left: 0.4em;
	padding-left: 0.8em;
	border-left: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 20%, transparent));
	color: inherit;
	font-size: 0.88em;
	text-decoration: none;
}

.rsc-see-all:hover {
	color: var(--rsc-accent, inherit);
}

.rsc-carousel-track {
	--rsc-per-view: var(--rsc-columns, 4);

	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--rsc-per-view) - 1) * var(--rsc-gap, 20px)) / var(--rsc-per-view));
	gap: var(--rsc-gap, 20px);
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;

	/* Room for the scrollbar, and so a title printed under a card is not left
	   sitting on the edge of the track. */
	padding-bottom: 0.75em;
}

.rsc-carousel-item {
	scroll-snap-align: start;
	min-width: 0;
}

@media (max-width: 1024px) {
	.rsc-carousel-track {
		--rsc-per-view: var(--rsc-columns-md, 3);
	}
}

@media (max-width: 680px) {
	.rsc-carousel-track {
		--rsc-per-view: var(--rsc-columns-sm, 2);
	}
}

@media (prefers-reduced-motion: reduce) {
	.rsc-carousel-track {
		scroll-behavior: auto;
	}
}

/* -------------------------------------------------------------------------
 * Stats line
 * ---------------------------------------------------------------------- */

.rsc-stats {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4em 0.9em;
	font-size: 0.95em;
}

.rsc-stats.rsc-align-center {
	justify-content: center;
}

.rsc-stats.rsc-align-right {
	justify-content: flex-end;
}

.rsc-stat {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
}

/* A round badge with the icon drawn inside it in white, rather than a bare
   coloured dot. */
.rsc-stat-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.7em;
	height: 1.7em;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--rsc-accent, currentColor);
	color: #fff;
}

.rsc-stat-icon svg {
	width: 60%;
	height: 60%;
}

.rsc-stat-icon-dl {
	background: var(--rsc-chip-dl, #1d6ff2);
}

.rsc-stat-label {
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-stat-sep {
	color: var(--rsc-muted, color-mix(in srgb, currentColor 45%, transparent));
}

/* -------------------------------------------------------------------------
 * Stars
 * ---------------------------------------------------------------------- */

.rsc-stars {
	display: inline-flex;
	align-items: center;
	gap: 0.1em;
	line-height: 1;
}

.rsc-star {
	position: relative;
	display: inline-block;
	font-size: 1.05em;
}

.rsc-star-bg {
	color: var(--rsc-border, color-mix(in srgb, currentColor 25%, transparent));
}

.rsc-star-fg {
	position: absolute;
	inset: 0;
	width: var(--rsc-fill, 0%);
	overflow: hidden;
	color: var(--rsc-star, currentColor);
}

.rsc-star-btn {
	padding: 0 0.05em;
	border: 0;
	background: none;
	color: inherit;
	line-height: 1;
	cursor: pointer;
}

.rsc-stars-live .rsc-star-btn:hover ~ .rsc-star-btn .rsc-star-fg {
	width: 0;
}

/* -------------------------------------------------------------------------
 * Hero
 * ---------------------------------------------------------------------- */

.rsc-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.45em;
	margin-bottom: 1em;
	font-size: 0.85em;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-breadcrumb a {
	color: inherit;
}

.rsc-hero-body {
	display: flex;
	flex-wrap: wrap;
	gap: var(--rsc-gap, 20px);
}

.rsc-hero-art {
	flex: 0 0 220px;
	max-width: 100%;
}

.rsc-hero-img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--rsc-radius, 6px);
}

.rsc-hero-info {
	flex: 1 1 260px;
	min-width: 0;
}

.rsc-hero-title {
	margin: 0 0 0.4em;
	line-height: 1.2;
	color: var(--rsc-text, inherit);
	overflow-wrap: anywhere;
}

.rsc-hero-rating {
	display: flex;
	align-items: center;
	gap: 0.5em;
	margin: 0 0 0.8em;
	font-size: 0.9em;
}

.rsc-hero-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em 1.4em;
	margin: 0 0 1em;
	padding: 0;
	list-style: none;
	font-size: 0.9em;
}

.rsc-hero-meta li {
	margin: 0;
}

.rsc-hero-excerpt {
	margin: 0 0 1.2em;
}

.rsc-hero-actions {
	margin: 0;
}

@media (max-width: 480px) {
	.rsc-hero-art {
		flex-basis: 140px;
	}
}

/* -------------------------------------------------------------------------
 * Details
 * ---------------------------------------------------------------------- */

.rsc-details-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.92em;
}

.rsc-details-table th,
.rsc-details-table td {
	padding: 0.6em 0.2em;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 12%, transparent));
}

.rsc-details-table th {
	width: 38%;
	font-weight: 600;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-details-table tr:last-child th,
.rsc-details-table tr:last-child td {
	border-bottom: 0;
}

.rsc-details-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: var(--rsc-gap, 20px);
	margin: 0;
}

.rsc-details-item dt {
	font-size: 0.8em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-details-item dd {
	margin: 0.2em 0 0;
	font-weight: 600;
	overflow-wrap: anywhere;
}

/* -------------------------------------------------------------------------
 * Screenshots
 * ---------------------------------------------------------------------- */

.rsc-shots-grid {
	--rsc-cols: var(--rsc-columns, 3);

	display: grid;
	grid-template-columns: repeat(var(--rsc-cols), minmax(0, 1fr));
	gap: var(--rsc-gap, 20px);
}

@media (max-width: 680px) {
	.rsc-shots-grid {
		--rsc-cols: var(--rsc-columns-sm, 2);
	}
}

.rsc-shot-link {
	display: block;
	overflow: hidden;
	border-radius: var(--rsc-radius, 6px);
	line-height: 0;
}

.rsc-shot-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.rsc-shot-link:hover .rsc-shot-img {
	transform: scale(1.04);
}

/* Lightbox - painted on its own dark scrim, independent of the theme. */

.rsc-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vmin;
	background: rgba(0, 0, 0, 0.88);
}

.rsc-lightbox img {
	max-width: 100%;
	max-height: 100%;
	border-radius: var(--rsc-radius, 6px);
	object-fit: contain;
}

.rsc-lightbox button {
	position: absolute;
	padding: 0.5em 0.8em;
	border: 0;
	background: rgba(255, 255, 255, 0.12);
	color: #fff;
	font-size: 1.5rem;
	line-height: 1;
	border-radius: var(--rsc-radius, 6px);
	cursor: pointer;
}

.rsc-lightbox .rsc-lb-close {
	top: 2vmin;
	right: 2vmin;
}

.rsc-lightbox .rsc-lb-prev {
	left: 2vmin;
}

.rsc-lightbox .rsc-lb-next {
	right: 2vmin;
}

/* -------------------------------------------------------------------------
 * Rating widget and downloads
 * ---------------------------------------------------------------------- */

.rsc-rating-widget {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6em;
}

.rsc-rating-score {
	display: inline-flex;
	align-items: baseline;
	gap: 0.35em;
	font-size: 0.9em;
}

.rsc-rating-message {
	flex: 1 0 100%;
	margin: 0.2em 0 0;
	font-size: 0.85em;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-download-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6em;
}

.rsc-download-note {
	margin: 0.8em 0 0;
	font-size: 0.85em;
}

/* -------------------------------------------------------------------------
 * Telegram banner
 * ---------------------------------------------------------------------- */

.rsc-telegram {
	--rsc-tg: var(--rsc-tg-brand, #229ed9);
}

.rsc-tg-link {
	display: flex;
	align-items: center;
	gap: 0.9em;
	color: inherit;
	text-decoration: none;
}

/* Wide bar: icon, text and button on one row. */
.rsc-tg-banner {
	padding: 0;
}

.rsc-tg-banner .rsc-tg-link {
	padding: 1em 1.1em;
	border: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 14%, transparent));
	border-left: 4px solid var(--rsc-tg);
	border-radius: var(--rsc-radius, 6px);
	background: var(--rsc-card-bg, transparent);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rsc-tg-banner .rsc-tg-link:hover {
	border-color: var(--rsc-tg);
	box-shadow: 0 8px 20px -14px rgba(0, 0, 0, 0.5);
}

.rsc-tg-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.4em;
	height: 2.4em;
	flex: 0 0 auto;
	border-radius: 50%;
	background: var(--rsc-tg);
	color: #fff;
}

.rsc-tg-body {
	display: block;
	flex: 1 1 auto;
	min-width: 0;
}

.rsc-tg-title {
	display: block;
	font-weight: 700;
	line-height: 1.3;
	color: var(--rsc-text, inherit);
}

.rsc-tg-text {
	display: block;
	margin-top: 0.15em;
	font-size: 0.87em;
	line-height: 1.45;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc .rsc-tg-btn {
	flex: 0 0 auto;
	padding: 0.6em 1.3em;
	background: var(--rsc-tg);
	color: #fff;
	font-size: 0.9em;
	white-space: nowrap;
}

/* Panel: the title bar comes from the shared panel shell, so the row inside is
   just the text and the button. */
.rsc-tg-panel .rsc-tg-link {
	display: block;
	text-align: center;
}

.rsc-tg-panel .rsc-tg-text {
	margin-bottom: 0.9em;
}

.rsc-tg-panel .rsc-tg-btn {
	display: inline-block;
}

/* Inline: one compact line, for tucking under a download box. */
.rsc-tg-inline {
	padding: 0;
}

.rsc-tg-inline .rsc-tg-link {
	gap: 0.6em;
	font-size: 0.92em;
}

.rsc-tg-inline .rsc-tg-badge {
	width: 1.9em;
	height: 1.9em;
}

.rsc-tg-inline .rsc-tg-badge svg {
	width: 18px;
	height: 18px;
}

.rsc-tg-inline .rsc-tg-btn {
	padding: 0.45em 1em;
	font-size: 0.85em;
}

@media (max-width: 560px) {
	.rsc-tg-banner .rsc-tg-link,
	.rsc-tg-inline .rsc-tg-link {
		flex-wrap: wrap;
	}

	.rsc-tg-banner .rsc-tg-btn,
	.rsc-tg-inline .rsc-tg-btn {
		flex-basis: 100%;
		text-align: center;
	}
}

/* -------------------------------------------------------------------------
 * Archive heading
 * ---------------------------------------------------------------------- */

.rsc-archive-head {
	margin-bottom: 1.2rem;
}

.rsc-archive-head-row {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5em 0.8em;
}

.rsc-archive-title {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--rsc-text, inherit);
}

.rsc-archive-count {
	font-size: 0.85rem;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-archive-intro {
	margin-top: 0.6em;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 72%, transparent));
}

.rsc-archive-intro p:last-child {
	margin-bottom: 0;
}

/* A card rendered straight into a theme loop, with no grid wrapper of its own
   to size it - the loop's own grid decides the width. */
.rsc-in-loop {
	max-width: none;
	margin-bottom: 0;
}

@media (max-width: 768px) {
	.rsc-archive-title {
		font-size: 21px;
	}
}

/* -------------------------------------------------------------------------
 * List cards - for a sidebar or any narrow column
 * ---------------------------------------------------------------------- */

/* A list ignores the column count: it is always one item per row. */
.rsc-layout-list .rsc-grid-items {
	grid-template-columns: 1fr;
	gap: 0.7em;
}

.rsc-l-card {
	min-width: 0;
}

.rsc-l-link {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 0.75em;
	align-items: center;
	color: inherit;
	text-decoration: none;
}

.rsc-l-art {
	display: block;
	aspect-ratio: 1;
	border-radius: calc(var(--rsc-radius, 6px) / 1.4);
	overflow: hidden;
	background: color-mix(in srgb, currentColor 10%, transparent);
}

.rsc-l-img,
.rsc-l-noart {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rsc-l-body {
	display: block;
	min-width: 0;
}

.rsc-l-title {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	font-size: 0.9em;
	font-weight: 600;
	line-height: 1.35;
	color: var(--rsc-text, inherit);
	overflow: hidden;
	overflow-wrap: anywhere;
}

.rsc-l-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.2em 0.7em;
	margin-top: 0.25em;
	font-size: 0.78em;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-l-rating {
	color: var(--rsc-star, inherit);
}

.rsc-l-link:hover .rsc-l-title {
	color: var(--rsc-accent, inherit);
}

/* -------------------------------------------------------------------------
 * Term lists
 * ---------------------------------------------------------------------- */

.rsc-term-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rsc-terms-list .rsc-term a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.6em;
	padding: 0.55em 0;
	border-bottom: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 12%, transparent));
	color: inherit;
	font-size: 0.92em;
	text-decoration: none;
}

.rsc-terms-list .rsc-term:last-child a {
	border-bottom: 0;
}

.rsc-terms-list .rsc-term a:hover .rsc-term-name {
	color: var(--rsc-accent, inherit);
}

.rsc-term-count {
	flex: 0 0 auto;
	padding: 0.1em 0.55em;
	border-radius: 999px;
	background: color-mix(in srgb, currentColor 10%, transparent);
	font-size: 0.85em;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-terms-tags .rsc-term-items {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4em;
}

.rsc-terms-tags .rsc-term a {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	padding: 0.35em 0.8em;
	border: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 16%, transparent));
	border-radius: 999px;
	color: inherit;
	font-size: 0.85em;
	text-decoration: none;
}

.rsc-terms-tags .rsc-term a:hover {
	border-color: var(--rsc-accent, currentColor);
	color: var(--rsc-accent, inherit);
}

/* -------------------------------------------------------------------------
 * Banner hero - byline, wide artwork, rating, one download call
 * ---------------------------------------------------------------------- */

.rsc-hero-banner {
	padding: 0;
}

.rsc-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5em;
	margin: 0 0 1.2em;
	font-size: 0.92em;
	font-weight: 600;
}

.rsc-byline-author {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.rsc-verified {
	flex: 0 0 auto;
	color: var(--rsc-chip-dl, #1d6ff2);
}

.rsc-byline-sep,
.rsc-byline-date {
	font-weight: 400;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-banner-art {
	margin: 0 0 1.4em;
	border-radius: calc(var(--rsc-radius, 6px) * 1.4);
	overflow: hidden;
	line-height: 0;
}

.rsc-banner-img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: var(--rsc-art-ratio, 16 / 9);
	object-fit: cover;
}

.rsc-banner-rating {
	display: flex;
	justify-content: center;
	margin-bottom: 1.1em;
}

.rsc-banner-rating .rsc-rating-widget {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
}

.rsc-banner-rating .rsc-stars {
	font-size: 1.35em;
}

.rsc-banner-rating .rsc-rating-score {
	display: inline-flex;
	align-items: baseline;
	gap: 0.3em;
	font-size: 1.05em;
}

.rsc-banner-rating .rsc-rating-avg,
.rsc-banner-rating .rsc-rating-outof {
	font-weight: 700;
	color: var(--rsc-text, inherit);
}

.rsc-banner-actions {
	margin: 0;
	text-align: center;
}

.rsc .rsc-btn-lg {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.95em 2.4em;
	border-radius: 999px;
	font-size: 1.1em;
	font-weight: 700;
}

.rsc-btn-icon {
	flex: 0 0 auto;
}

@media (max-width: 600px) {
	.rsc .rsc-btn-lg {
		display: flex;
		justify-content: center;
		padding-inline: 1.4em;
	}

	.rsc-banner-rating .rsc-stars {
		font-size: 1.15em;
	}
}

/* -------------------------------------------------------------------------
 * Actions strip - downloads, rating, download call on one line
 * ---------------------------------------------------------------------- */

.rsc-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.7em 1.4em;
	padding-block: var(--rsc-pad, 0.9em);
	border-top: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 14%, transparent));
	border-bottom: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 14%, transparent));
	font-size: 0.95em;
}

.rsc-actions.rsc-align-center {
	justify-content: center;
}

.rsc-actions.rsc-align-right {
	justify-content: flex-end;
}

.rsc-action {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
}

/* The button is a jump link to the download box, so it stays visually lighter
   than the real download button further down the page. */
.rsc-actions .rsc-action-button {
	margin-left: auto;
}

.rsc-actions.rsc-align-center .rsc-action-button,
.rsc-actions.rsc-align-right .rsc-action-button {
	margin-left: 0;
}

.rsc .rsc-btn-sm {
	padding: 0.5em 1.2em;
	font-size: 0.92em;
}

.rsc-action-rating .rsc-rating-widget {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

@media (max-width: 600px) {
	.rsc-actions {
		gap: 0.6em 1em;
	}

	.rsc-actions .rsc-action-button {
		margin-left: 0;
		flex-basis: 100%;
	}

	.rsc-actions .rsc-btn-sm {
		display: block;
		text-align: center;
	}
}

/* -------------------------------------------------------------------------
 * Panel download box
 * ---------------------------------------------------------------------- */

/* A panel paints its own surface, so it ignores the block padding the rest of
   the shortcodes take from --rsc-pad. Shared by the download box and the
   details table, so the two read as the same component. */
.rsc-is-panel {
	padding: 0;
}

.rsc-panel-box {
	border: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 14%, transparent));
	border-radius: var(--rsc-radius, 6px);
	background: var(--rsc-card-bg, transparent);
	overflow: hidden;
}

.rsc-panel-bar {
	display: flex;
	align-items: center;
	gap: 0.7em;
	padding: 0.85em 1.1em;
	background: var(--rsc-panel, var(--rsc-accent, currentColor));
	color: var(--rsc-panel-text, #fff);
}

.rsc-panel-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.9em;
	height: 1.9em;
	flex: 0 0 auto;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	font-size: 0.8em;
	line-height: 1;
}

.rsc-panel-title {
	margin: 0;
	color: inherit;
	font-size: 1.05em;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.rsc-panel-body {
	padding: 1.2em;
}

/* Spec table -------------------------------------------------------------- */

.rsc-spec {
	display: grid;
	gap: 0.6em;
	margin: 0 0 1.4em;
}

/* Nothing follows the rows in a details panel, so the trailing gap is only
   dead space there. */
.rsc-spec-flush {
	margin-bottom: 0;
}

.rsc-spec-row {
	display: grid;
	grid-template-columns: minmax(120px, 1fr) 2fr;
	align-items: stretch;
	border: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 12%, transparent));
	border-radius: calc(var(--rsc-radius, 6px) / 1.4);
	overflow: hidden;
}

.rsc-spec-label {
	position: relative;
	margin: 0;
	padding: 0.9em 1em 0.9em 1.2em;
	border-right: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 12%, transparent));
	color: var(--rsc-label, var(--rsc-accent, inherit));
	font-weight: 700;
}

/* The marker down the left edge of every row. */
.rsc-spec-label::before {
	content: "";
	position: absolute;
	top: 0.45em;
	bottom: 0.45em;
	left: 0;
	width: 4px;
	border-radius: 0 3px 3px 0;
	background: var(--rsc-panel, var(--rsc-accent, currentColor));
}

.rsc-spec-value {
	margin: 0;
	padding: 0.9em 1em;
	color: var(--rsc-text, inherit);
	overflow-wrap: anywhere;
}

@media (max-width: 520px) {
	.rsc-spec-row {
		grid-template-columns: 1fr;
	}

	.rsc-spec-label {
		border-right: 0;
		border-bottom: 1px solid var(--rsc-border, color-mix(in srgb, currentColor 12%, transparent));
		padding-block: 0.6em;
	}
}

/* Button and count -------------------------------------------------------- */

.rsc-downloads-panel .rsc-download-buttons {
	justify-content: center;
}

.rsc-downloads-panel .rsc-btn {
	padding: 0.85em 2em;
	border-radius: calc(var(--rsc-radius, 6px) / 1.2);
	font-size: 1.02em;
}

.rsc-download-count {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.4em;
	margin: 1em 0 0;
	font-size: 0.92em;
	color: var(--rsc-muted, color-mix(in srgb, currentColor 62%, transparent));
}

.rsc-count-icon {
	color: var(--rsc-chip-dl, var(--rsc-accent, currentColor));
}

.rsc-count-value {
	color: var(--rsc-text, inherit);
}

.rsc-downloads-panel .rsc-download-note {
	text-align: center;
}
