/* Reset scopeado: evita que el theme o el page builder (Elementor/Divi/etc.)
   pisen box-sizing, márgenes, tipografía, o estilos de botón/imagen por defecto. */
.vmg-container,
.vmg-container *,
.vmg-container *::before,
.vmg-container *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
	line-height: normal;
	text-shadow: none;
	letter-spacing: normal;
	float: none;
}

.vmg-container img {
	max-width: none;
	height: auto;
	border: none;
	vertical-align: middle;
}

.vmg-container button {
	appearance: none;
	-webkit-appearance: none;
	background-image: none;
	text-transform: none;
	line-height: normal;
}

.vmg-container {
	display: block;
	position: relative;
	width: 100%;
	max-width: 480px;
	aspect-ratio: 1080 / 1920;
	margin: 0 auto;
	background: var(--vmg-color-fondo, #ffffff);
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	border-radius: 12px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
	user-select: none;
	isolation: isolate;
	container-type: inline-size;
	container-name: vmg;
}

/* Si el navegador no soporta aspect-ratio (muy poco común hoy), usamos un
   padding-top como fallback para no perder el formato vertical 1080x1920. */
@supports not (aspect-ratio: 1080 / 1920) {
	.vmg-container {
		height: 0;
		padding-top: calc(100% * 1920 / 1080);
	}
}

.vmg-titulo {
	position: absolute;
	top: 3%;
	height: 10%;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	font-size: 5vw;
	font-size: 5cqw;
	font-weight: 800;
	color: var(--vmg-color-texto, #1a1a1a);
	padding: 0 8%;
	line-height: 1.1;
	overflow: hidden;
}

.vmg-board {
	position: absolute;
	top: 15%;
	bottom: 18%;
	left: 0;
	right: 0;
	overflow: hidden;
}

.vmg-card {
	position: absolute;
	aspect-ratio: 1 / 1;
	transform: translate(-50%, -50%);
	cursor: pointer;
	perspective: 800px;
	box-sizing: border-box;
}

.vmg-card-inner {
	position: relative;
	width: 100%;
	height: 100%;
	transition: transform 0.55s cubic-bezier(0.4, 0.2, 0.2, 1);
	transform-style: preserve-3d;
}

.vmg-card.is-flipped .vmg-card-inner {
	transform: rotateY(180deg);
}

.vmg-card-face {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	backface-visibility: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.vmg-card-front {
	background: var(--vmg-color-circulo, #2e9e46);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18), inset 0 -6px 10px rgba(0, 0, 0, 0.12);
}

.vmg-card-front::after {
	content: "?";
	color: rgba(255, 255, 255, 0.85);
	font-size: 0.9em;
	font-weight: 800;
}

.vmg-card-back {
	background: #ffffff;
	border: 3px solid var(--vmg-color-circulo, #2e9e46);
	transform: rotateY(180deg);
	padding: 6%;
	text-align: center;
}

.vmg-card-back img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.vmg-card-back .vmg-texto {
	font-size: 0.4em;
	font-weight: 700;
	color: var(--vmg-color-texto, #1a1a1a);
	line-height: 1.15;
}

.vmg-card-back .vmg-emoji {
	font-size: 0.9em;
	line-height: 1;
}

.vmg-card.is-matched .vmg-card-front,
.vmg-card.is-matched .vmg-card-back {
	box-shadow: 0 0 0 4px gold, 0 6px 14px rgba(0, 0, 0, 0.18);
}

.vmg-card.is-locked {
	pointer-events: none;
	opacity: 0.55;
}

.vmg-footer {
	position: absolute;
	bottom: 2%;
	height: 12%;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
}

.vmg-logo {
	max-width: 40%;
	max-height: 100%;
	object-fit: contain;
}

.vmg-logo-text {
	font-size: 5vw;
	font-size: 5cqw;
	font-weight: 900;
	letter-spacing: 0.05em;
	color: var(--vmg-color-texto, #1a1a1a);
}

.vmg-overlay {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, 0.92);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	animation: vmg-fade-in 0.3s ease;
}

@keyframes vmg-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

.vmg-overlay-box {
	text-align: center;
	padding: 8%;
}

.vmg-overlay-msg {
	font-size: 6vw;
	font-size: 6cqw;
	font-weight: 800;
	color: var(--vmg-color-texto, #1a1a1a);
	margin-bottom: 8%;
	line-height: 1.25;
}

.vmg-btn-reset {
	background: var(--vmg-color-circulo, #2e9e46);
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 4% 10%;
	font-size: 3.6vw;
	font-size: 3.6cqw;
	font-weight: 700;
	cursor: pointer;
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
}

.vmg-btn-reset:hover {
	filter: brightness(1.05);
}
