/* La estantería «¿A qué jugamos?» (includes/estanteria.php, assets/estanteria.js). Tokens del tema. */

.mv-st {
	--ink: var(--mv-ink, #121214);
	--paper: var(--mv-paper, #ffffff);
	--paper-2: var(--mv-paper-2, #f6f6f7);
	--hair: var(--mv-hair, #e2e2e5);
	--ink-2: var(--mv-ink-2, #5c5c66);
	--spot: var(--mv-spot, #f95700);
	--spot-ink: var(--mv-spot-ink, #ffffff);
	--accent: var(--mv-accent-text, #0969da);
	grid-column: 1 / -1;
	margin: 0 0 clamp(32px, 5vw, 48px);
	color: var(--mv-ink);
	font-family: var(--mv-text, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
}

.mv-st *,
.mv-st *::before,
.mv-st *::after {
	box-sizing: border-box;
}

/* Tintas por plataforma (colores del producto) */
.mv-st--nintendo { --lomo: var(--mv-red, #e30613);    --lomo-ink: #ffffff; }
.mv-st--pc       { --lomo: var(--mv-cyan, #0086c4);   --lomo-ink: #ffffff; }
.mv-st--retro    { --lomo: var(--mv-yellow, #d97706); --lomo-ink: #ffffff; }
.mv-st--varias   { --lomo: #3f3f46;                   --lomo-ink: #ffffff; }

/* ---------- Cabecera ---------- */
.mv-st__head {
	margin-bottom: 20px;
}

.mv-st__title {
	margin: 0 0 0.5rem;
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: clamp(24px, 3.5vw, 30px);
	line-height: 1.25;
	letter-spacing: normal;
	text-transform: none;
	color: var(--mv-ink);
}

.mv-st__lead {
	margin: 0;
	max-width: 44rem;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--mv-ink-2);
}

/* ---------- Mandos ---------- */
.mv-st__mandos {
	display: grid;
	gap: 12px;
	margin: 0 0 24px;
	padding: 16px;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper-2);
	box-shadow: none;
}

.mv-st__fila {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.mv-st__etiqueta {
	flex: 0 0 auto;
	min-width: 8em;
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: 0.875rem;
	text-transform: none;
	letter-spacing: normal;
	color: var(--mv-ink-2);
}

.mv-st__consola,
.mv-st__chip,
.mv-st__dado {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.5rem 1rem;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper);
	color: var(--mv-ink);
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	box-shadow: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.mv-st__consola {
	font-size: 0.875rem;
	font-weight: 600;
}

.mv-st__consola:hover,
.mv-st__chip:hover {
	transform: none;
	box-shadow: none;
	border-color: var(--mv-ink);
	background: var(--mv-paper-2);
}

.mv-st__consola[aria-pressed="true"],
.mv-st__chip[aria-pressed="true"] {
	background: var(--mv-ink);
	color: var(--mv-paper);
	border-color: var(--mv-ink);
}

.mv-st__consola:focus-visible,
.mv-st__chip:focus-visible,
.mv-st__dado:focus-visible,
.mv-st__mas:focus-visible,
.mv-st__carta:focus-visible {
	outline: 2px solid var(--mv-spot);
	outline-offset: 2px;
}

.mv-st__fila--buscar {
	gap: 10px;
}

.mv-st__buscar {
	flex: 1 1 16rem;
}

.mv-st__buscar input {
	width: 100%;
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper);
	color: var(--mv-ink);
	font: inherit;
	font-size: 0.9375rem;
}

.mv-st__buscar input:focus {
	outline: 2px solid var(--mv-spot);
	border-color: var(--mv-spot);
}

.mv-st__orden {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.875rem;
	text-transform: none;
	color: var(--mv-ink-2);
}

.mv-st__orden select {
	min-height: 44px;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper);
	color: var(--mv-ink);
	font: inherit;
	font-size: 0.875rem;
	text-transform: none;
}

.mv-st__dado {
	min-height: 44px;
	background: var(--mv-spot);
	color: var(--mv-spot-ink);
	border-color: var(--mv-spot);
	box-shadow: none;
	font-size: 0.9375rem;
	font-weight: 600;
}

.mv-st__dado:hover {
	transform: none;
	box-shadow: none;
	background: color-mix(in srgb, var(--mv-spot) 88%, black);
}

.mv-st__dado span {
	display: inline-block;
	transition: none;
}

.mv-st__dado:hover span {
	transform: none;
}

/* ---------- Baldas temáticas ---------- */
.mv-st__balda {
	margin: 0 0 32px;
}

.mv-st__balda header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	margin-bottom: 12px;
	padding-top: 8px;
	border-top: 1px solid var(--mv-hair);
}

.mv-st__balda-t {
	margin: 0;
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: 1.25rem;
	line-height: 1.3;
	text-transform: none;
	color: var(--mv-ink);
}

.mv-st__balda header p {
	margin: 0;
	font-size: 0.875rem;
	color: var(--mv-ink-2);
}

.mv-st__tira {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: clamp(132px, 30vw, 168px);
	gap: 16px;
	margin: 0;
	padding: 4px 4px 16px;
	margin-bottom: 4px;
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	background: none;
	border-bottom: 1px solid var(--mv-hair);
}

.mv-st__tira .mv-st__item {
	scroll-snap-align: start;
}

/* Barras de desplazamiento sobrias */
.mv-st__tira,
.mv-st__hoja-body {
	scrollbar-width: thin;
	scrollbar-color: var(--mv-hair) transparent;
}

.mv-st__tira::-webkit-scrollbar,
.mv-st__hoja-body::-webkit-scrollbar {
	width: 6px;
	height: 6px;
}

.mv-st__tira::-webkit-scrollbar-track,
.mv-st__hoja-body::-webkit-scrollbar-track {
	background: transparent;
}

.mv-st__tira::-webkit-scrollbar-thumb,
.mv-st__hoja-body::-webkit-scrollbar-thumb {
	background: var(--mv-hair);
	border-radius: 3px;
}

.mv-st__tira::-webkit-scrollbar-thumb:hover,
.mv-st__hoja-body::-webkit-scrollbar-thumb:hover {
	background: var(--mv-ink-2);
}

.mv-st__tira::-webkit-scrollbar-button,
.mv-st__hoja-body::-webkit-scrollbar-button {
	display: none;
}

/* ---------- Catálogo ---------- */
.mv-st__cuenta {
	margin: 0 0 16px;
	padding-top: 8px;
	border-top: 1px solid var(--mv-hair);
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: 1.125rem;
	text-transform: none;
	color: var(--mv-ink);
}

.mv-st__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(150px, 44%), 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mv-st__item {
	margin: 0;
	min-width: 0;
}

.mv-st__carta {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper);
	color: var(--mv-ink);
	text-decoration: none;
	box-shadow: none;
	overflow: hidden;
	transition: border-color 0.15s ease;
}

.mv-st__carta:hover {
	color: var(--mv-ink);
	transform: none;
	box-shadow: none;
	border-color: var(--mv-ink);
}

.mv-st__tapa {
	position: relative;
	display: block;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: var(--mv-paper-2);
}

.mv-st__tapa img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.mv-st__sin {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	padding: 12px;
	color: var(--mv-ink);
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: 1rem;
	line-height: 1.25;
	text-align: center;
	text-transform: none;
}

.mv-st__dto,
.mv-st__top {
	position: absolute;
	top: 6px;
	padding: 0.15em 0.5em;
	border: 1px solid transparent;
	border-radius: 3px;
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: none;
	transform: none;
}

.mv-st__dto {
	right: 6px;
	background: var(--mv-red, #dc2626);
	color: #ffffff;
	transform: none;
}

.mv-st__top {
	left: 6px;
	background: var(--mv-spot);
	color: var(--mv-spot-ink);
	transform: none;
}

.mv-st__pie {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 6px 8px;
	padding: 10px;
	flex: 1 0 auto;
	border-top: 1px solid var(--mv-hair);
}

.mv-st__nombre {
	grid-column: 1 / -1;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.875rem;
	line-height: 1.25;
	text-transform: none;
	color: var(--mv-ink);
}

.mv-st__leds {
	display: flex;
	gap: 4px;
}

/* Una luz por consola */
.mv-st__led {
	width: 8px;
	height: 8px;
	border: 1px solid var(--mv-hair);
	border-radius: 50%;
	background: var(--mv-paper);
}

.mv-st__led--g {
	background: var(--mv-green, #16a34a);
	border-color: var(--mv-green, #16a34a);
}

.mv-st__led--j {
	background: var(--mv-orange, #d97706);
	border-color: var(--mv-orange, #d97706);
}

.mv-st__led--d {
	border: 1px dashed var(--mv-red, #dc2626);
	background: none;
}

.mv-st__led--n {
	border-color: var(--mv-hair);
	border-radius: 2px;
	background: none;
}

.mv-st__led.is-tuya {
	outline: 2px solid var(--mv-spot);
	outline-offset: 1px;
}

.mv-st__precio {
	justify-self: end;
	padding: 0.15em 0.45em;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper-2);
	color: var(--mv-ink);
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.8125rem;
	white-space: nowrap;
}

.mv-st__vacio {
	padding: 28px;
	border: 1px dashed var(--mv-hair);
	border-radius: 3px;
	text-align: center;
	font-size: 0.9375rem;
	color: var(--mv-ink-2);
}

.mv-st__mas-wrap {
	margin: 24px 0 0;
	text-align: center;
}

.mv-st__mas {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0.5rem 1.5rem;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper);
	color: var(--mv-ink);
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.9375rem;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mv-st__mas:hover {
	transform: none;
	box-shadow: none;
	background: var(--mv-paper-2);
	border-color: var(--mv-ink);
}

/* ---------- Panel con la ficha ---------- */
html.mv-st-abierta {
	overflow: hidden;
}

.mv-st__panel {
	position: fixed;
	inset: 0;
	z-index: 1000;
}

.mv-st__velo {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.mv-st__hoja {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(460px, 100%);
	border-left: 1px solid var(--mv-hair);
	background: var(--mv-paper);
	color: var(--mv-ink);
	box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
	transform: translateX(105%);
	transition: transform 0.22s cubic-bezier(0.2, 0.9, 0.3, 1);
	outline: none;
}

.mv-st__panel.is-abierto .mv-st__velo { opacity: 1; }
.mv-st__panel.is-abierto .mv-st__hoja { transform: none; }

.mv-st__hoja-bar {
	display: flex;
	gap: 8px;
	padding: 10px 12px;
	border-bottom: 1px solid var(--mv-hair);
	background: var(--mv-paper-2);
}

.mv-st__nav,
.mv-st__cerrar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper);
	color: var(--mv-ink);
	font-size: 1.125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.mv-st__nav:hover:not(:disabled),
.mv-st__cerrar:hover {
	background: var(--mv-paper-2);
	border-color: var(--mv-ink);
}

.mv-st__nav:disabled {
	opacity: 0.35;
	cursor: default;
}

.mv-st__cerrar {
	margin-left: auto;
	background: var(--mv-paper);
	color: var(--mv-ink);
}

.mv-st__hoja-body {
	flex: 1 1 auto;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 18px 18px 28px;
}

@media (max-width: 640px) {
	.mv-st__hoja {
		top: auto;
		left: 0;
		width: 100%;
		max-height: 90vh;
		border-left: 0;
		border-top: 1px solid var(--mv-hair);
		box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
		transform: translateY(105%);
	}

	/* Consolas y géneros: una fila que se desliza de lado */
	.mv-st__fila:not(.mv-st__fila--buscar) {
		flex-wrap: nowrap;
		overflow-x: auto;
		margin-inline: -12px;
		padding: 2px 12px 6px;
		scrollbar-width: none;
	}

	.mv-st__fila:not(.mv-st__fila--buscar)::-webkit-scrollbar {
		display: none;
	}

	.mv-st__fila > * {
		flex: 0 0 auto;
	}

	.mv-st__etiqueta {
		min-width: 0;
		font-size: 0.8125rem;
	}

	.mv-st__buscar {
		flex-basis: 100%;
	}

	.mv-st__mandos {
		padding: 12px;
		box-shadow: none;
	}
}

/* Ficha corta dentro del panel */
.mv-stf__head {
	display: grid;
	grid-template-columns: 88px 1fr;
	gap: 14px;
	align-items: end;
}

.mv-stf__portada {
	width: 88px;
	height: auto;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	box-shadow: none;
}

.mv-stf__tipo {
	display: inline-block;
	margin: 0 0 6px;
	padding: 0.15em 0.5em;
	background: var(--mv-paper-2);
	color: var(--mv-ink-2);
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.75rem;
	text-transform: none;
}

.mv-stf__nombre {
	margin: 0;
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: 1.35rem;
	line-height: 1.25;
	text-transform: none;
}

.mv-stf__nombre a {
	color: inherit;
	text-decoration: none;
}

.mv-stf__credito {
	margin: 6px 0 0;
	font-size: 0.75rem;
	color: var(--mv-ink-2);
}

.mv-stf__frase {
	margin: 16px 0;
	font-size: 1.125rem;
	font-weight: 400;
	line-height: 1.4;
	color: var(--mv-ink);
}

.mv-stf__trailer {
	position: relative;
	display: block;
	margin: 0 0 16px;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	overflow: hidden;
	color: #ffffff;
	text-decoration: none;
}

.mv-stf__trailer img {
	display: block;
	width: 100%;
	height: auto;
}

.mv-stf__trailer span {
	position: absolute;
	left: 10px;
	bottom: 10px;
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 0.75rem;
	background: rgba(0, 0, 0, 0.75);
	border: 1px solid rgba(255, 255, 255, 0.2);
	border-radius: 3px;
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.8125rem;
	text-transform: none;
	color: #ffffff;
	transition: background-color 0.15s ease;
}

.mv-stf__trailer:hover span {
	background: var(--mv-spot);
	border-color: var(--mv-spot);
	color: var(--mv-spot-ink);
}

.mv-stf__sub {
	margin: 18px 0 8px;
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: 1.125rem;
	text-transform: none;
	color: var(--mv-ink);
}

.mv-stf .mv-juego__semaforo {
	padding: 0;
}

.mv-stf__si {
	margin: 0;
	padding: 0;
	list-style: none;
}

.mv-stf__si li {
	position: relative;
	margin: 0 0 6px;
	padding-left: 1.5em;
	font-size: 0.9375rem;
}

.mv-stf__si li::before {
	content: "✓";
	position: absolute;
	left: 0;
	color: var(--mv-green, #16a34a);
	font-weight: 600;
}

.mv-stf__datos {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 6px 14px;
	margin: 16px 0;
	font-size: 0.875rem;
}

.mv-stf__datos dt {
	font-family: var(--mv-text);
	font-weight: 600;
	text-transform: none;
	color: var(--mv-ink-2);
}

.mv-stf__datos dd {
	margin: 0;
	font-weight: 500;
	color: var(--mv-ink);
}

.mv-stf__acciones {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 0;
}

/* Cargando y ruleta */
.mv-st__cargando,
.mv-st__ruleta {
	display: grid;
	justify-items: center;
	gap: 14px;
	padding: 30px 0;
	text-align: center;
}

.mv-st__cargando .mv-st__tapa,
.mv-st__ruleta .mv-st__tapa {
	width: 180px;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	box-shadow: none;
}

.mv-st__cargando .mv-st__tapa {
	animation: mv-st-pulso 0.9s ease-in-out infinite alternate;
}

.mv-st__cargando p,
.mv-st__ruleta-n {
	margin: 0;
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: 1.25rem;
	text-transform: none;
	color: var(--mv-ink);
}

.mv-st__ruleta-t {
	margin: 0;
	font-family: var(--mv-text);
	font-weight: 500;
	font-size: 0.9375rem;
	text-transform: none;
	color: var(--mv-ink-2);
}

.mv-st__ruleta .mv-st__tapa {
	animation: mv-st-baraja 0.3s ease-in-out infinite alternate;
}

.mv-st__ruleta.is-hecho .mv-st__tapa {
	animation: mv-st-premio 0.3s ease-out both;
	box-shadow: none;
	border-color: var(--mv-spot);
}

@keyframes mv-st-pulso { to { opacity: 0.55; } }
@keyframes mv-st-baraja { from { opacity: 0.7; } to { opacity: 1; } }
@keyframes mv-st-premio { from { transform: scale(0.96); } to { transform: scale(1); } }

.mv-st__error {
	padding: 20px 0;
	color: var(--mv-ink-2);
}

@media (prefers-reduced-motion: reduce) {
	.mv-st *,
	.mv-st *::before {
		animation: none !important;
		transition: none !important;
	}
}

/* Sin JavaScript: el panel y los mandos que no funcionan, fuera */
.mv-st:not(.is-js) .mv-st__mandos,
.mv-st:not(.is-js) .mv-st__panel {
	display: none;
}

.mv-st__listas {
	margin: 10px 0 0;
	font-weight: 600;
}

/* ---------- Lista de una consola ([movicio-juegos-consola], páginas /estanteria/<consola>/) ---------- */
.mv-lista,
.mv-lista__otras {
	max-width: var(--mv-wide, 58rem);
	margin-inline: auto;
}

.mv-lista {
	margin-block: 0 clamp(32px, 5vw, 48px);
}

.mv-lista__title {
	margin: 0 0 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--mv-hair);
	font-family: var(--mv-text);
	font-weight: 600;
	font-style: normal;
	font-size: clamp(24px, 3.5vw, 30px);
	text-transform: none;
	color: var(--mv-ink);
}

.mv-lista__n {
	color: var(--mv-ink-2);
	font-size: 0.75em;
	font-weight: 500;
}

.mv-lista__lead {
	margin: 0 0 18px;
	color: var(--mv-ink-2);
	font-size: 1rem;
	line-height: 1.5;
}

.mv-lista__juegos {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr));
	gap: 16px 20px;
}

.mv-lista__juego {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	margin: 0;
	padding: 8px 0;
}

.mv-lista__tapa {
	flex: none;
	width: 64px;
	height: 64px;
	object-fit: cover;
	border: 1px solid var(--mv-hair);
	border-radius: 3px;
	background: var(--mv-paper-2);
}

.mv-lista__texto {
	min-width: 0;
}

.mv-lista__nombre {
	margin: 0;
	font-family: var(--mv-text);
	font-weight: 600;
	font-size: 0.9375rem;
	line-height: 1.3;
}

.mv-lista__nombre a {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--mv-ink);
	text-decoration: none;
}

.mv-lista__nombre a:hover {
	color: var(--mv-spot);
}

.mv-lista__meta {
	margin: 2px 0 0;
	color: var(--mv-ink-2);
	font-size: 0.8125rem;
	font-weight: 500;
}

.mv-lista__frase {
	margin: 4px 0 0;
	font-size: 0.875rem;
	line-height: 1.4;
	color: var(--mv-ink-2);
}

.mv-lista__otras {
	margin-block: 24px 0;
}
